drivers/net/ethernet/netronome/nfp/nfp_app.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_app.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_app.h- Extension
.h- Size
- 12869 bytes
- Lines
- 449
- 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.
- 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/devlink.htrace/events/devlink.hnfp_net_repr.h
Detected Declarations
struct bpf_progstruct net_devicestruct netdev_bpfstruct netlink_ext_ackstruct pci_devstruct sk_buffstruct nfp_appstruct nfp_cppstruct nfp_pfstruct nfp_reprstruct nfp_netstruct nfp_app_typestruct nfp_appenum nfp_app_idfunction assert_nfp_app_lockedfunction nfp_app_is_lockedfunction nfp_app_initfunction nfp_app_cleanfunction nfp_app_vnic_allocfunction nfp_app_vnic_freefunction nfp_app_vnic_initfunction nfp_app_vnic_cleanfunction nfp_app_repr_openfunction nfp_app_repr_stopfunction nfp_app_repr_initfunction nfp_app_repr_precleanfunction nfp_app_repr_cleanfunction nfp_app_check_mtufunction nfp_app_repr_change_mtufunction nfp_app_needs_ctrl_vnicfunction nfp_app_ctrl_has_metafunction nfp_app_ctrl_uses_data_vnicsfunction nfp_app_has_tcfunction nfp_app_setup_tcfunction nfp_app_bpffunction nfp_app_xdp_offloadfunction __nfp_app_ctrl_txfunction nfp_app_ctrl_txfunction nfp_app_ctrl_rxfunction nfp_app_ctrl_rx_rawfunction nfp_app_eswitch_mode_getfunction nfp_app_eswitch_mode_setfunction nfp_app_sriov_enablefunction nfp_app_sriov_disable
Annotated Snippet
struct nfp_app_type {
enum nfp_app_id id;
const char *name;
u32 ctrl_cap_mask;
bool ctrl_has_meta;
int (*init)(struct nfp_app *app);
void (*clean)(struct nfp_app *app);
const char *(*extra_cap)(struct nfp_app *app, struct nfp_net *nn);
int (*ndo_init)(struct nfp_app *app, struct net_device *netdev);
void (*ndo_uninit)(struct nfp_app *app, struct net_device *netdev);
int (*vnic_alloc)(struct nfp_app *app, struct nfp_net *nn,
unsigned int id);
void (*vnic_free)(struct nfp_app *app, struct nfp_net *nn);
int (*vnic_init)(struct nfp_app *app, struct nfp_net *nn);
void (*vnic_clean)(struct nfp_app *app, struct nfp_net *nn);
int (*repr_init)(struct nfp_app *app, struct net_device *netdev);
void (*repr_preclean)(struct nfp_app *app, struct net_device *netdev);
void (*repr_clean)(struct nfp_app *app, struct net_device *netdev);
int (*repr_open)(struct nfp_app *app, struct nfp_repr *repr);
int (*repr_stop)(struct nfp_app *app, struct nfp_repr *repr);
int (*check_mtu)(struct nfp_app *app, struct net_device *netdev,
int new_mtu);
int (*repr_change_mtu)(struct nfp_app *app, struct net_device *netdev,
int new_mtu);
u64 *(*port_get_stats)(struct nfp_app *app,
struct nfp_port *port, u64 *data);
int (*port_get_stats_count)(struct nfp_app *app, struct nfp_port *port);
u8 *(*port_get_stats_strings)(struct nfp_app *app,
struct nfp_port *port, u8 *data);
int (*start)(struct nfp_app *app);
void (*stop)(struct nfp_app *app);
int (*netdev_event)(struct nfp_app *app, struct net_device *netdev,
unsigned long event, void *ptr);
void (*ctrl_msg_rx)(struct nfp_app *app, struct sk_buff *skb);
void (*ctrl_msg_rx_raw)(struct nfp_app *app, const void *data,
unsigned int len);
int (*setup_tc)(struct nfp_app *app, struct net_device *netdev,
enum tc_setup_type type, void *type_data);
int (*bpf)(struct nfp_app *app, struct nfp_net *nn,
struct netdev_bpf *xdp);
int (*xdp_offload)(struct nfp_app *app, struct nfp_net *nn,
struct bpf_prog *prog,
struct netlink_ext_ack *extack);
int (*sriov_enable)(struct nfp_app *app, int num_vfs);
void (*sriov_disable)(struct nfp_app *app);
enum devlink_eswitch_mode (*eswitch_mode_get)(struct nfp_app *app);
int (*eswitch_mode_set)(struct nfp_app *app, u16 mode);
struct net_device *(*dev_get)(struct nfp_app *app, u32 id,
bool *redir_egress);
};
/**
* struct nfp_app - NFP application container
* @pdev: backpointer to PCI device
* @pf: backpointer to NFP PF structure
* @cpp: pointer to the CPP handle
* @ctrl: pointer to ctrl vNIC struct
* @reprs: array of pointers to representors
* @type: pointer to const application ops and info
* @ctrl_mtu: MTU to set on the control vNIC (set in .init())
* @netdev_nb: Netdevice notifier block
* @priv: app-specific priv data
*/
struct nfp_app {
struct pci_dev *pdev;
struct nfp_pf *pf;
struct nfp_cpp *cpp;
struct nfp_net *ctrl;
struct nfp_reprs __rcu *reprs[NFP_REPR_TYPE_MAX + 1];
const struct nfp_app_type *type;
unsigned int ctrl_mtu;
struct notifier_block netdev_nb;
Annotation
- Immediate include surface: `net/devlink.h`, `trace/events/devlink.h`, `nfp_net_repr.h`.
- Detected declarations: `struct bpf_prog`, `struct net_device`, `struct netdev_bpf`, `struct netlink_ext_ack`, `struct pci_dev`, `struct sk_buff`, `struct nfp_app`, `struct nfp_cpp`, `struct nfp_pf`, `struct nfp_repr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.