#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>
#include <net/ip6_checksum.h>
#include <net/netdev_queues.h>
#include "ionic.h"
#include "ionic_lif.h"
#include "ionic_txrx.h"
static dma_addr_t ionic_tx_map_single(struct ionic_queue *q,
void *data, size_t len);
static dma_addr_t ionic_tx_map_frag(struct ionic_queue *q,
const skb_frag_t *frag,
size_t offset, size_t len);
static void ionic_tx_desc_unmap_bufs(struct ionic_queue *q,
struct ionic_tx_desc_info *desc_info);
static void ionic_tx_clean(struct ionic_queue *q,
struct ionic_tx_desc_info *desc_info,
struct ionic_txq_comp *comp,
bool in_napi);
static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell)
{ … }
static inline void ionic_rxq_post(struct ionic_queue *q, bool ring_dbell)
{ … }
bool ionic_txq_poke_doorbell(struct ionic_queue *q)
{ … }
bool ionic_rxq_poke_doorbell(struct ionic_queue *q)
{ … }
static inline struct ionic_txq_sg_elem *ionic_tx_sg_elems(struct ionic_queue *q)
{ … }
static inline struct netdev_queue *q_to_ndq(struct net_device *netdev,
struct ionic_queue *q)
{ … }
static void *ionic_rx_buf_va(struct ionic_buf_info *buf_info)
{ … }
static dma_addr_t ionic_rx_buf_pa(struct ionic_buf_info *buf_info)
{ … }
static unsigned int ionic_rx_buf_size(struct ionic_buf_info *buf_info)
{ … }
static int ionic_rx_page_alloc(struct ionic_queue *q,
struct ionic_buf_info *buf_info)
{ … }
static void ionic_rx_page_free(struct ionic_queue *q,
struct ionic_buf_info *buf_info)
{ … }
static bool ionic_rx_buf_recycle(struct ionic_queue *q,
struct ionic_buf_info *buf_info, u32 len)
{ … }
static void ionic_rx_add_skb_frag(struct ionic_queue *q,
struct sk_buff *skb,
struct ionic_buf_info *buf_info,
u32 off, u32 len,
bool synced)
{ … }
static struct sk_buff *ionic_rx_build_skb(struct ionic_queue *q,
struct ionic_rx_desc_info *desc_info,
unsigned int headroom,
unsigned int len,
unsigned int num_sg_elems,
bool synced)
{ … }
static struct sk_buff *ionic_rx_copybreak(struct net_device *netdev,
struct ionic_queue *q,
struct ionic_rx_desc_info *desc_info,
unsigned int headroom,
unsigned int len,
bool synced)
{ … }
static void ionic_xdp_tx_desc_clean(struct ionic_queue *q,
struct ionic_tx_desc_info *desc_info)
{ … }
static int ionic_xdp_post_frame(struct ionic_queue *q, struct xdp_frame *frame,
enum xdp_action act, struct page *page, int off,
bool ring_doorbell)
{ … }
int ionic_xdp_xmit(struct net_device *netdev, int n,
struct xdp_frame **xdp_frames, u32 flags)
{ … }
static void ionic_xdp_rx_put_bufs(struct ionic_queue *q,
struct ionic_buf_info *buf_info,
int nbufs)
{ … }
static bool ionic_run_xdp(struct ionic_rx_stats *stats,
struct net_device *netdev,
struct bpf_prog *xdp_prog,
struct ionic_queue *rxq,
struct ionic_buf_info *buf_info,
int len)
{ … }
static void ionic_rx_clean(struct ionic_queue *q,
struct ionic_rx_desc_info *desc_info,
struct ionic_rxq_comp *comp)
{ … }
bool ionic_rx_service(struct ionic_cq *cq)
{ … }
static inline void ionic_write_cmb_desc(struct ionic_queue *q,
void *desc)
{ … }
void ionic_rx_fill(struct ionic_queue *q)
{ … }
void ionic_rx_empty(struct ionic_queue *q)
{ … }
static void ionic_dim_update(struct ionic_qcq *qcq, int napi_mode)
{ … }
int ionic_tx_napi(struct napi_struct *napi, int budget)
{ … }
static void ionic_xdp_do_flush(struct ionic_cq *cq)
{ … }
int ionic_rx_napi(struct napi_struct *napi, int budget)
{ … }
int ionic_txrx_napi(struct napi_struct *napi, int budget)
{ … }
static dma_addr_t ionic_tx_map_single(struct ionic_queue *q,
void *data, size_t len)
{ … }
static dma_addr_t ionic_tx_map_frag(struct ionic_queue *q,
const skb_frag_t *frag,
size_t offset, size_t len)
{ … }
static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb,
struct ionic_tx_desc_info *desc_info)
{ … }
static void ionic_tx_desc_unmap_bufs(struct ionic_queue *q,
struct ionic_tx_desc_info *desc_info)
{ … }
static void ionic_tx_clean(struct ionic_queue *q,
struct ionic_tx_desc_info *desc_info,
struct ionic_txq_comp *comp,
bool in_napi)
{ … }
static bool ionic_tx_service(struct ionic_cq *cq,
unsigned int *total_pkts,
unsigned int *total_bytes,
bool in_napi)
{ … }
unsigned int ionic_tx_cq_service(struct ionic_cq *cq,
unsigned int work_to_do,
bool in_napi)
{ … }
void ionic_tx_flush(struct ionic_cq *cq)
{ … }
void ionic_tx_empty(struct ionic_queue *q)
{ … }
static int ionic_tx_tcp_inner_pseudo_csum(struct sk_buff *skb)
{ … }
static int ionic_tx_tcp_pseudo_csum(struct sk_buff *skb)
{ … }
static void ionic_tx_tso_post(struct net_device *netdev, struct ionic_queue *q,
struct ionic_txq_desc *desc,
struct sk_buff *skb,
dma_addr_t addr, u8 nsge, u16 len,
unsigned int hdrlen, unsigned int mss,
bool outer_csum,
u16 vlan_tci, bool has_vlan,
bool start, bool done)
{ … }
static int ionic_tx_tso(struct net_device *netdev, struct ionic_queue *q,
struct sk_buff *skb)
{ … }
static void ionic_tx_calc_csum(struct ionic_queue *q, struct sk_buff *skb,
struct ionic_tx_desc_info *desc_info)
{ … }
static void ionic_tx_calc_no_csum(struct ionic_queue *q, struct sk_buff *skb,
struct ionic_tx_desc_info *desc_info)
{ … }
static void ionic_tx_skb_frags(struct ionic_queue *q, struct sk_buff *skb,
struct ionic_tx_desc_info *desc_info)
{ … }
static int ionic_tx(struct net_device *netdev, struct ionic_queue *q,
struct sk_buff *skb)
{ … }
static int ionic_tx_descs_needed(struct ionic_queue *q, struct sk_buff *skb)
{ … }
static netdev_tx_t ionic_start_hwstamp_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{ … }