drivers/net/ethernet/netronome/nfp/nfp_net_dp.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_net_dp.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/netronome/nfp/nfp_net_dp.h
Extension
.h
Size
6812 bytes
Lines
220
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nfp_dp_ops {
	enum nfp_nfd_version version;
	unsigned int tx_min_desc_per_pkt;
	u32 cap_mask;
	u64 dma_mask;

	int (*poll)(struct napi_struct *napi, int budget);
	int (*xsk_poll)(struct napi_struct *napi, int budget);
	void (*ctrl_poll)(struct tasklet_struct *t);
	netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *netdev);
	bool (*ctrl_tx_one)(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
			    struct sk_buff *skb, bool old);
	void (*rx_ring_fill_freelist)(struct nfp_net_dp *dp,
				      struct nfp_net_rx_ring *rx_ring);
	int (*tx_ring_alloc)(struct nfp_net_dp *dp,
			     struct nfp_net_tx_ring *tx_ring);
	void (*tx_ring_reset)(struct nfp_net_dp *dp,
			      struct nfp_net_tx_ring *tx_ring);
	void (*tx_ring_free)(struct nfp_net_tx_ring *tx_ring);
	int (*tx_ring_bufs_alloc)(struct nfp_net_dp *dp,
				  struct nfp_net_tx_ring *tx_ring);
	void (*tx_ring_bufs_free)(struct nfp_net_dp *dp,
				  struct nfp_net_tx_ring *tx_ring);

	void (*print_tx_descs)(struct seq_file *file,
			       struct nfp_net_r_vector *r_vec,
			       struct nfp_net_tx_ring *tx_ring,
			       u32 d_rd_p, u32 d_wr_p);
};

static inline void
nfp_net_tx_ring_reset(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring)
{
	return dp->ops->tx_ring_reset(dp, tx_ring);
}

static inline void
nfp_net_rx_ring_fill_freelist(struct nfp_net_dp *dp,
			      struct nfp_net_rx_ring *rx_ring)
{
	dp->ops->rx_ring_fill_freelist(dp, rx_ring);
}

static inline int
nfp_net_tx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring)
{
	return dp->ops->tx_ring_alloc(dp, tx_ring);
}

static inline void
nfp_net_tx_ring_free(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring)
{
	dp->ops->tx_ring_free(tx_ring);
}

static inline int
nfp_net_tx_ring_bufs_alloc(struct nfp_net_dp *dp,
			   struct nfp_net_tx_ring *tx_ring)
{
	return dp->ops->tx_ring_bufs_alloc(dp, tx_ring);
}

static inline void
nfp_net_tx_ring_bufs_free(struct nfp_net_dp *dp,
			  struct nfp_net_tx_ring *tx_ring)
{
	dp->ops->tx_ring_bufs_free(dp, tx_ring);
}

static inline void
nfp_net_debugfs_print_tx_descs(struct seq_file *file, struct nfp_net_dp *dp,
			       struct nfp_net_r_vector *r_vec,
			       struct nfp_net_tx_ring *tx_ring,
			       u32 d_rd_p, u32 d_wr_p)
{
	dp->ops->print_tx_descs(file, r_vec, tx_ring, d_rd_p, d_wr_p);
}

extern const struct nfp_dp_ops nfp_nfd3_ops;
extern const struct nfp_dp_ops nfp_nfdk_ops;

netdev_tx_t nfp_net_tx(struct sk_buff *skb, struct net_device *netdev);

#endif /* _NFP_NET_DP_ */

Annotation

Implementation Notes