STRUCT NFP_APP_TYPE(9)
π NAME π
so like, struct nfp_app_type β bestie, it's literally the application definition β¨ that's the whole vibe, iykyk
quick heads-up, this page lives in the Kernel API Manual (section 9, fancy), so you know it's the real deal π
β¨ SYNOPSIS β¨
okay so here's the full shape of it, no cap, every field exactly as it is:
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);
};
like, it's giving "big struct, big responsibilities" π but honestly every single member is doing something and we're gonna go through all of them π«Ά
π MEMBERS π
okay so, member by member, let's get into it β grab a snack π
idβ the application ID, like its little passport πΈnameβ the application name, its government name basically β¨ctrl_cap_maskβ the ctrl vNIC capability mask. this one's lowkey iconic: it lets you disable features likeIRQMODβ things that are on by default but honestly counter-productive for control messages, which are often latency-sensitive π like yes queen, turn that offctrl_has_metaβ control messages have a prepend oftype:5/port:CTRLπinitβ does the basic app checks and init βcleanβ cleans up the app state π§Ήβ¨extra_capβ extra capabilities string, lil bonus content πndo_initβ vNIC and repr netdev.ndo_init, two for the price of one πndo_uninitβ vNIC and repr netdev.ndo_unintπ¦ (yes that's spelled.ndo_unintin the original, we don't gatekeep, we reproduce faithfully π)vnic_allocβ allocate vNICs (assign port types, etc.) β the "assigning port types" part is doing so much work fr frvnic_freeβ free up the app's vNIC state π«Άvnic_initβ vNIC netdev was registered βvnic_cleanβ vNIC netdev is about to be unregistered πrepr_initβ representor about to be registered πrepr_precleanβ representor about to unregistered, and it runs before the app's reference to it is removed β order matters bestie, timing is everything πrepr_cleanβ representor about to be unregistered πrepr_openβ representor netdev open callback π₯repr_stopβ representor netdev stop callback βcheck_mtuβ MTU change request on a netdev (verify it is valid) β verify only, we're just checking πrepr_change_mtuβ MTU change request on repr (make and verify the change) β this one actually does the thing π€port_get_statsβ get extra ethtool statistics for a port πport_get_stats_countβ get the count of those extra statistics for a port π’port_get_stats_stringsβ get the strings for the extra statistics π€startβ start application logic πstopβ stop application logic πnetdev_eventβ Netdevice notifier event πctrl_msg_rxβ control message handler π¨ctrl_msg_rx_rawβ handler for control messages from data queues πsetup_tcβ setup TC ndo βοΈbpfβ BPF ndo offload-related calls π§xdp_offloadβ offload an XDP program πβ¨sriov_enableβ app-specific sriov initialisation π¬sriov_disableβ app-specific sriov clean-up π§Όeswitch_mode_getβ get SR-IOV eswitch mode πeswitch_mode_setβ set SR-IOV eswitch mode ποΈdev_getβ get representor or internal port representing netdev πͺ (it's giving mirrorball)
π¦ DESCRIPTION π¦
Callbacks. that's it, that's the description π β it's a struct made of callbacks, and honestly that's the whole personality. every member up there is a little hook waiting for its moment, main character energy one callback at a time π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/netronome/nfp/nfp_app.hstruct nfp_app(9)
like go read the header and then go read struct nfp_app(9), they're literally siblings, you can't know one without the other π
okay so that's the whole page!! mwah π
tiny sign-off moment: this came from./drivers/net/ethernet/netrono...and it's dated October 2026, and the page itself is calledstruct nfp_app_type(9)β go off, kernel docs, we love to see it πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms