#include <linux/dma-mapping.h>
#include <linux/ip.h>
#include <linux/pci.h>
#include <linux/skbuff.h>
#include <linux/tcp.h>
#include <uapi/linux/udp.h>
#include "funeth.h"
#include "funeth_ktls.h"
#include "funeth_txrx.h"
#include "funeth_trace.h"
#include "fun_queue.h"
#define FUN_XDP_CLEAN_THRES …
#define FUN_XDP_CLEAN_BATCH …
static int fun_map_pkt(struct device *dev, const struct skb_shared_info *si,
void *data, unsigned int data_len,
dma_addr_t *addr, unsigned int *len)
{ … }
static void *txq_end(const struct funeth_txq *q)
{ … }
static unsigned int txq_to_end(const struct funeth_txq *q, void *p)
{ … }
static unsigned int tx_req_ndesc(const struct fun_eth_tx_req *req)
{ … }
static struct fun_dataop_gl *fun_write_gl(const struct funeth_txq *q,
struct fun_eth_tx_req *req,
const dma_addr_t *addrs,
const unsigned int *lens,
unsigned int ngle)
{ … }
static __be16 tcp_hdr_doff_flags(const struct tcphdr *th)
{ … }
static struct sk_buff *fun_tls_tx(struct sk_buff *skb, struct funeth_txq *q,
unsigned int *tls_len)
{ … }
static unsigned int write_pkt_desc(struct sk_buff *skb, struct funeth_txq *q,
unsigned int tls_len)
{ … }
static unsigned int fun_txq_avail(const struct funeth_txq *q)
{ … }
static void fun_tx_check_stop(struct funeth_txq *q)
{ … }
static bool fun_txq_may_restart(struct funeth_txq *q)
{ … }
netdev_tx_t fun_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{ … }
static u16 txq_hw_head(const struct funeth_txq *q)
{ … }
static unsigned int fun_unmap_pkt(const struct funeth_txq *q, unsigned int idx)
{ … }
static bool fun_txq_reclaim(struct funeth_txq *q, int budget)
{ … }
int fun_txq_napi_poll(struct napi_struct *napi, int budget)
{ … }
static unsigned int fun_xdpq_clean(struct funeth_txq *q, unsigned int budget)
{ … }
bool fun_xdp_tx(struct funeth_txq *q, struct xdp_frame *xdpf)
{ … }
int fun_xdp_xmit_frames(struct net_device *dev, int n,
struct xdp_frame **frames, u32 flags)
{ … }
static void fun_txq_purge(struct funeth_txq *q)
{ … }
static void fun_xdpq_purge(struct funeth_txq *q)
{ … }
static struct funeth_txq *fun_txq_create_sw(struct net_device *dev,
unsigned int qidx,
unsigned int ndesc,
struct fun_irq *irq)
{ … }
static void fun_txq_free_sw(struct funeth_txq *q)
{ … }
int fun_txq_create_dev(struct funeth_txq *q, struct fun_irq *irq)
{ … }
static void fun_txq_free_dev(struct funeth_txq *q)
{ … }
int funeth_txq_create(struct net_device *dev, unsigned int qidx,
unsigned int ndesc, struct fun_irq *irq, int state,
struct funeth_txq **qp)
{ … }
struct funeth_txq *funeth_txq_free(struct funeth_txq *q, int state)
{ … }