STRUCT NFP_CPP_OPERATIONS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nfp_cpp_operations(9) β€” like, the NFP CPP operations structure, bestie ✨

okay so picture this: you're deep in the Kernel API Manual, section 9, and you've stumbled onto struct nfp_cpp_operations β€” the NFP CPP operations structure πŸŽ€. That's the whole vibe. It's a big ol' bundle of function pointers and sizes that tells the NFP CPP bus how to actually do stuff. Iconic. Let's get into it πŸ’–


✨ SYNOPSIS ✨

here's the whole struct, character for character, no cap:

struct nfp_cpp_operations {
    size_t area_priv_size;
    struct module *owner;
    int (*init)(struct nfp_cpp *cpp);
    void (*free)(struct nfp_cpp *cpp);
    int (*read_serial)(struct device *dev, u8 *serial);
    int (*get_interface)(struct device *dev);
    int (*area_init)(struct nfp_cpp_area *area, u32 dest, unsigned long long address, unsigned long size);
    void (*area_cleanup)(struct nfp_cpp_area *area);
    int (*area_acquire)(struct nfp_cpp_area *area);
    void (*area_release)(struct nfp_cpp_area *area);
    struct resource *(*area_resource)(struct nfp_cpp_area *area);
    phys_addr_t (*area_phys)(struct nfp_cpp_area *area);
    void __iomem *(*area_iomem)(struct nfp_cpp_area *area);
    int (*area_read)(struct nfp_cpp_area *area, void *kernel_vaddr, unsigned long offset, unsigned int length);
    int (*area_write)(struct nfp_cpp_area *area, const void *kernel_vaddr, unsigned long offset, unsigned int length);
    size_t explicit_priv_size;
    int (*explicit_acquire)(struct nfp_cpp_explicit *expl);
    void (*explicit_release)(struct nfp_cpp_explicit *expl);
    int (*explicit_put)(struct nfp_cpp_explicit *expl, const void *buff, size_t len);
    int (*explicit_get)(struct nfp_cpp_explicit *expl, void *buff, size_t len);
    int (*explicit_do)(struct nfp_cpp_explicit *expl, const struct nfp_cpp_explicit_command *cmd, u64 address);
};

🫢 MEMBERS 🫢

okay, member-by-member tour, iykyk 🌸

πŸ¦‹ the basics

  • area_priv_size β€” the size of the nfp_cpp_area private data. like, how much room your lil' area needs for its own stuff πŸ’œ
  • owner β€” the owner module, periodt.
  • init β€” initialize the NFP CPP bus πŸ”₯
  • free β€” free the bus. bye bestie πŸ‘‹

πŸŽ€ serial + interface

  • read_serial β€” read the serial number into the memory that's provided for it πŸ“
  • get_interface β€” return the CPP interface ✨

πŸ’… area operations

  • area_init β€” initialize a new NFP CPP area (not serialized! πŸ™ˆ)
  • area_cleanup β€” clean up a NFP CPP area (also not serialized πŸ™ˆ)
  • area_acquire β€” acquire the NFP CPP area (this one is serialized πŸ”’)
  • area_release β€” release area (serialized πŸ”’)
  • area_resource β€” get the resource range of the area (not serialized)
  • area_phys β€” get the physical address of the area (not serialized)
  • area_iomem β€” get the iomem of the area (not serialized)
  • area_read β€” perform a read from a NFP CPP area (serialized πŸ”’)
  • area_write β€” perform a write to a NFP CPP area (serialized πŸ”’)
lowkey note the serialization thing bestie β€” the ones marked not serialized are on you to manage, the serialized ones handle their own locking vibe check πŸ”’

🌈 explicit operations

  • explicit_priv_size β€” the size of an explicit's private area
  • explicit_acquire β€” acquire an explicit area
  • explicit_release β€” release an explicit area
  • explicit_put β€” write data to send πŸ“€
  • explicit_get β€” read data received πŸ“₯
  • explicit_do β€” perform the transaction ⭐

πŸ‘‘ SEE ALSO πŸ‘‘

go read the kernel file, fr fr:

Kernel file ./drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h

and your whole friend group of related pages πŸ’–


mwah πŸ’‹ this page came from ./drivers/net/ethernet/netrono... and it's dated October 2026 β€” so like, mark your calendar bestie πŸ—“οΈβœ¨ slay, go write some operations πŸ’…πŸŽ€

πŸ“¦ where this page comes from