STRUCT NFP_PORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to the struct nfp_port(9) page from the Kernel API Manual β€” literally the structure representing NFP port. we are going to walk through every single member together, no cap, and nobody gets left behind πŸ’….


✨ SYNOPSIS ✨

here's the whole struct in all its glory β€” keep the code exactly as it is, especially that little line break inside speed_bitmap, bestie πŸ’€:

       struct nfp_port {
           struct net_device *netdev;
           enum nfp_port_type type;
           unsigned long flags;
           unsigned long tc_offload_cnt;
           struct nfp_app *app;
           void (*link_cb)(struct nfp_port *port);
           struct devlink_port dl_port;
           union {
             struct {
               unsigned int eth_id;
               bool eth_forced;
               struct nfp_eth_table_port *eth_port;
               u8 __iomem *eth_stats;
               unsigned long speed_bitmap[BITS_TO_LONGS(
       NFP_SUP_SPEED_NUMBER)];
             };
             struct {
               unsigned int pf_id;
               unsigned int vf_id;
               bool pf_split;
               unsigned int pf_split_id;
               u8 __iomem *vnic;
             };
           };
           struct list_head port_list;
        };

πŸŽ€ Members πŸŽ€

here's the member-by-member tea, in the same order as the struct, because we are not skipping a single one ✨

  • netdev β€” backpointer to associated netdev.
  • type β€” what port type does the entity represent.
  • flags β€” port flags.
  • tc_offload_cnt β€” number of active TC offloads; how offloads are counted is not defined, so use it as a boolean. lowkey that's the whole vibe.
  • app β€” backpointer to the app structure.
  • link_cb β€” callback when link status changed.
  • dl_port β€” devlink port structure.
  • {unnamed_union} β€” anonymous.
  • {unnamed_struct} β€” anonymous. (first inner struct)
    • eth_id β€” for NFP_PORT_PHYS_PORT, port ID in NFP enumeration scheme.
    • eth_forced β€” for NFP_PORT_PHYS_PORT, port is forced UP or DOWN, don't change it.
    • eth_port β€” for NFP_PORT_PHYS_PORT, translated ETH Table port entry.
    • eth_stats β€” for NFP_PORT_PHYS_PORT, MAC stats if available.
    • speed_bitmap β€” for NFP_PORT_PHYS_PORT, supported speed bitmap.
  • {unnamed_struct} β€” anonymous. (second inner struct)
    • pf_id β€” for NFP_PORT_PF_PORT, NFP_PORT_VF_PORT, ID of the PCI PF (0-3).
    • vf_id β€” for NFP_PORT_VF_PORT, ID of the PCI VF within pf_id.
    • pf_split β€” for NFP_PORT_PF_PORT, true if PCI PF has more than one vNIC.
    • pf_split_id β€” for NFP_PORT_PF_PORT, ID of PCI PF vNIC (valid if pf_split).
    • vnic β€” for NFP_PORT_PF_PORT, NFP_PORT_VF_PORT, vNIC ctrl memory.
  • port_list β€” entry on pf's list of ports.

🌈 SEE ALSO 🌈

go look at the kernel file ./drivers/net/ethernet/netronome/nfp/nfp_port.h, enum nfp_port_type(9), and enum nfp_port_flags(9). that's the whole friend group πŸ’–


mwah πŸ’‹ source/version: ./drivers/net/ethernet/netrono... β€” date: October 2026. periodt, go slay your NFP ports 🫢

πŸ“¦ where this page comes from