STRUCT DEVLINK_PORT_ATTRS(9)
π struct devlink_port_attrs(9) β the devlink port object, bestie
okay so real talk, this is a page straight out of the Kernel API Manual, and it's literally the struct that describes a devlink port object. it's giving "small struct, big responsibilities" energy and we're gonna go through it together, no cap.
β¨ SYNOPSIS β¨
here's the whole glow-up in one block, copy it exactly bestie:
struct devlink_port_attrs {
u8 split:1, splittable:1, no_phys_port_name:1;
u32 lanes;
enum devlink_port_flavour flavour;
struct netdev_phys_item_id switch_id;
union {
struct devlink_port_phys_attrs phys;
struct devlink_port_pci_pf_attrs pci_pf;
struct devlink_port_pci_vf_attrs pci_vf;
struct devlink_port_pci_sf_attrs pci_sf;
};
};
πΈ Members πΈ
okay this is the part where we meet everybody in the group chat. one by one, no skipping π
splitβ tells you if this is a split port. that's it, that's the whole vibe.splittableβ tells you if the port can be split. lowkey different fromsplit, don't mix them up bestie π«Άno_phys_port_nameβ skips the automaticphys_port_namegeneration. but heads up: this exists for compatibility only, so a newly added driver or port instance should never set this. like, ever. periodt.lanesβ the maximum number of lanes the port supports. and no, a0value is not passed to netlink, so don't come for it.flavourβ the flavour of the port. iconic field name tbh, the kernel ate with that one πswitch_idβ if the port is part of a switch, this is a buffer with the ID; otherwise it'sNULL. simple as that.{unnamed_union}β this one's anonymous. mysterious. main character energy honestly πphysβ the physical port attributes.pci_pfβ the PCI PF port attributes.pci_vfβ the PCI VF port attributes.pci_sfβ the PCI SF port attributes.
ngl the union at the bottom is doing the most β four different attribute structs sharing one spot β but that's the design and we respect it π
π₯ SEE ALSO π₯
the whole friend group, all of them, here we go:
Kernel file ./include/net/devlink.h and also:
struct devlink_port_pci_pf_attrs(9)struct devlink_port_pci_vf_attrs(9)struct devlink_port_pci_sf_attrs(9)struct devlink_linecard_ops(9)struct devlink_dpipe_field(9)struct devlink_dpipe_header(9)struct devlink_dpipe_match(9)struct devlink_dpipe_action(9)struct devlink_dpipe_value(9)struct devlink_dpipe_entry(9)struct devlink_dpipe_dump_ctx(9)struct devlink_dpipe_table(9)struct devlink_dpipe_table_ops(9)struct devlink_dpipe_headers(9)struct devlink_resource_size_params(9)struct devlink_flash_notify(9)struct devlink_param(9)struct devlink_flash_update_params(9)struct devlink_region_ops(9)struct devlink_port_region_ops(9)struct devlink_health_reporter_ops(9)struct devlink_trap_metadata(9)struct devlink_trap_policer(9)struct devlink_trap_group(9)struct devlink_trap(9)struct devlink_port_ops(9)
likeβ¦ that is a long list, and every single one of them matters, so go read them too bestie π§
π sign-off π
that's the whole page!! it lives over in ./include/net, dated October 2026, and it's filed under struct devlink_port_attrs(9). go forth and configure your ports, you absolute legend πβ¨π
π¦ 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