drivers/net/ethernet/netronome/nfp/nfp_net.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_net.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_net.h- Extension
.h- Size
- 31198 bytes
- Lines
- 1057
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/interrupt.hlinux/list.hlinux/netdevice.hlinux/pci.hlinux/dim.hlinux/io-64-nonatomic-hi-lo.hlinux/semaphore.hlinux/workqueue.hnet/xdp.hnfp_net_ctrl.h
Detected Declarations
struct nfp_cppstruct nfp_dev_infostruct nfp_dp_opsstruct nfp_eth_table_portstruct nfp_netstruct nfp_net_r_vectorstruct nfp_portstruct xsk_buff_poolstruct nfp_nfd3_tx_descstruct nfp_nfd3_tx_bufstruct nfp_nfdk_tx_descstruct nfp_nfdk_tx_bufstruct nfp_net_tx_ringstruct nfp_net_rx_descstruct nfp_meta_parsedstruct nfp_net_rx_hashstruct nfp_net_rx_bufstruct nfp_net_xsk_rx_bufstruct nfp_net_rx_ringstruct nfp_net_r_vectorstruct nfp_net_fw_versionstruct nfp_stat_pairstruct nfp_net_dpstruct nfp_netstruct nfp_fs_entrystruct nfp_mbox_amsg_entryenum nfp_qcp_ptrfunction nfp_net_fw_ver_eqfunction nn_readbfunction nn_writebfunction nn_readwfunction nn_writewfunction nn_readlfunction nn_writelfunction nn_readqfunction nn_writeqfunction nn_pci_flushfunction nfp_qcp_rd_ptr_addfunction nfp_qcp_wr_ptr_addfunction _nfp_qcp_readfunction nfp_qcp_rd_ptr_readfunction nfp_qcp_wr_ptr_readfunction nfp_net_is_data_vnicfunction nfp_net_runningfunction nfp_ctrl_lockfunction nfp_ctrl_unlockfunction nn_ctrl_bar_lockfunction nn_ctrl_bar_trylock
Annotated Snippet
extern const struct net_device_ops nfp_nfd3_netdev_ops;
extern const struct net_device_ops nfp_nfdk_netdev_ops;
static inline bool nfp_netdev_is_nfp_net(struct net_device *netdev)
{
return netdev->netdev_ops == &nfp_nfd3_netdev_ops ||
netdev->netdev_ops == &nfp_nfdk_netdev_ops;
}
static inline int nfp_net_coalesce_para_check(u32 param)
{
if (param >= ((1 << 16) - 1))
return -EINVAL;
return 0;
}
/* Prototypes */
void nfp_net_get_fw_version(struct nfp_net_fw_version *fw_ver,
void __iomem *ctrl_bar);
struct nfp_net *
nfp_net_alloc(struct pci_dev *pdev, const struct nfp_dev_info *dev_info,
void __iomem *ctrl_bar, bool needs_netdev,
unsigned int max_tx_rings, unsigned int max_rx_rings);
void nfp_net_free(struct nfp_net *nn);
int nfp_net_init(struct nfp_net *nn);
void nfp_net_clean(struct nfp_net *nn);
int nfp_ctrl_open(struct nfp_net *nn);
void nfp_ctrl_close(struct nfp_net *nn);
void nfp_net_set_ethtool_ops(struct net_device *netdev);
void nfp_net_info(struct nfp_net *nn);
int __nfp_net_reconfig(struct nfp_net *nn, u32 update);
int nfp_net_reconfig(struct nfp_net *nn, u32 update);
unsigned int nfp_net_rss_key_sz(struct nfp_net *nn);
void nfp_net_rss_write_itbl(struct nfp_net *nn);
void nfp_net_rss_write_key(struct nfp_net *nn);
void nfp_net_coalesce_write_cfg(struct nfp_net *nn);
int nfp_net_mbox_lock(struct nfp_net *nn, unsigned int data_size);
int nfp_net_mbox_reconfig(struct nfp_net *nn, u32 mbox_cmd);
int nfp_net_mbox_reconfig_and_unlock(struct nfp_net *nn, u32 mbox_cmd);
void nfp_net_mbox_reconfig_post(struct nfp_net *nn, u32 update);
int nfp_net_mbox_reconfig_wait_posted(struct nfp_net *nn);
unsigned int
nfp_net_irqs_alloc(struct pci_dev *pdev, struct msix_entry *irq_entries,
unsigned int min_irqs, unsigned int want_irqs);
void nfp_net_irqs_disable(struct pci_dev *pdev);
void
nfp_net_irqs_assign(struct nfp_net *nn, struct msix_entry *irq_entries,
unsigned int n);
struct sk_buff *
nfp_net_tls_tx(struct nfp_net_dp *dp, struct nfp_net_r_vector *r_vec,
struct sk_buff *skb, u64 *tls_handle, int *nr_frags);
void nfp_net_tls_tx_undo(struct sk_buff *skb, u64 tls_handle);
struct nfp_net_dp *nfp_net_clone_dp(struct nfp_net *nn);
int nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_dp *new,
struct netlink_ext_ack *extack);
int nfp_net_fs_add_hw(struct nfp_net *nn, struct nfp_fs_entry *entry);
int nfp_net_fs_del_hw(struct nfp_net *nn, struct nfp_fs_entry *entry);
#ifdef CONFIG_NFP_DEBUG
void nfp_net_debugfs_create(void);
void nfp_net_debugfs_destroy(void);
struct dentry *nfp_net_debugfs_device_add(struct pci_dev *pdev);
void nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir);
void nfp_net_debugfs_dir_clean(struct dentry **dir);
#else
static inline void nfp_net_debugfs_create(void)
{
}
static inline void nfp_net_debugfs_destroy(void)
{
}
static inline struct dentry *nfp_net_debugfs_device_add(struct pci_dev *pdev)
{
return NULL;
}
static inline void
nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir)
{
}
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/interrupt.h`, `linux/list.h`, `linux/netdevice.h`, `linux/pci.h`, `linux/dim.h`, `linux/io-64-nonatomic-hi-lo.h`, `linux/semaphore.h`.
- Detected declarations: `struct nfp_cpp`, `struct nfp_dev_info`, `struct nfp_dp_ops`, `struct nfp_eth_table_port`, `struct nfp_net`, `struct nfp_net_r_vector`, `struct nfp_port`, `struct xsk_buff_pool`, `struct nfp_nfd3_tx_desc`, `struct nfp_nfd3_tx_buf`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.