STRUCT NFP_APP_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 like IRQMOD β€” things that are on by default but honestly counter-productive for control messages, which are often latency-sensitive 😭 like yes queen, turn that off
  • ctrl_has_meta β€” control messages have a prepend of type: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_unint in 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 fr
  • vnic_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.h
  • struct 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 called struct nfp_app_type(9) β€” go off, kernel docs, we love to see it πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from