STRUCT NFP_DP_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct nfp_dp_ops(9) β€” from the Kernel API Manual, bestie πŸ’…

okay so picture this: you're deep in the kernel, you've got multiple different implementations of "dp" doing their thing, and somebody has to wrap them all up in one tidy little struct. That's struct nfp_dp_ops. It's literally the hook-collection energy we all deserve. ✨


🌸 NAME 🌸

struct nfp_dp_ops β€” hooks that wrap around the different implementations of different dp. no cap, that's the whole job. 🫢


✨ SYNOPSIS ✨

like, here's the whole vibe, verbatim:

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);
 };

πŸŽ€ Members πŸŽ€

bestie, let's meet the whole cast. every single one of them, nobody gets left out πŸ‘‘

  • version β€” tells you what dp type this is. it's giving name tag at the party 🏷️
  • tx_min_desc_per_pkt β€” the minimal TX descs you need for each packet. don't skimp, it's the bare minimum fr fr
  • cap_mask β€” the mask of supported features πŸ’«
  • dma_mask β€” DMA addressing capability. the range of addresses it can handle, iconic
  • poll β€” the napi poll for the normal rx/tx path
  • xsk_poll β€” the napi poll you get when xsk is enabled (special occasion poll ✨)
  • ctrl_poll β€” tasklet poll for the ctrl rx/tx path
  • xmit β€” xmit for the normal path, sending it πŸš€
  • ctrl_tx_one β€” xmit for the ctrl path. one at a time, main character energy
  • rx_ring_fill_freelist β€” gives buffers from the ring to FW. sharing is caring 🫢
  • tx_ring_alloc β€” allocate resources for a TX ring
  • tx_ring_reset β€” frees any untransmitted buffers and resets pointers. note the "any untransmitted buffers" part β€” that's a real consequence, not just a vibe check ⚠️
  • tx_ring_free β€” frees the resources that were allocated to a TX ring
  • tx_ring_bufs_alloc β€” allocate resources for each TX buffer
  • tx_ring_bufs_free β€” free the resources allocated to each TX buffer
  • print_tx_descs β€” shows the TX ring's info, for debug purposes. detective mode πŸ”

🌈 SEE ALSO 🌈


okay that's the whole page, you ate that πŸ’… go forth and wrap your dps. and for the record, this whole thing came out of ./drivers/net/ethernet/netrono... in October 2026 β€” that's the version/date stamp of the page itself, so jot that down in your notes babe πŸ“πŸ’–

πŸ“¦ where this page comes from