STRUCT NETDEV_QUEUE_MGMT_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

okay so bestie, gather round β€” this page is all about struct netdev_queue_mgmt_ops, which is literally the netdev ops bundle for queue management. that's the whole vibe. it's in the Kernel API Manual, section 9, and yes she's iconic for it ✨


πŸŽ€ SYNOPSIS πŸŽ€

here's the struct in all her glory, typed out exactly, no cap:

struct netdev_queue_mgmt_ops {
    size_t ndo_queue_mem_size;
    int (*ndo_queue_mem_alloc)(struct net_device *dev, struct netdev_queue_config *qcfg, void *per_queue_mem, int idx);
    void (*ndo_queue_mem_free)(struct net_device *dev, void *per_queue_mem);
    int (*ndo_queue_start)(struct net_device *dev, struct netdev_queue_config *qcfg, void *per_queue_mem, int idx);
    int (*ndo_queue_stop)(struct net_device *dev, void *per_queue_mem, int idx);
    void (*ndo_default_qcfg)(struct net_device *dev, struct netdev_queue_config *qcfg);
    int (*ndo_validate_qcfg)(struct net_device *dev, struct netdev_queue_config *qcfg, struct netlink_ext_ack *extack);
    struct device * (*ndo_queue_get_dma_dev)(struct net_device *dev, int idx);
    int (*ndo_queue_create)(struct net_device *dev, struct netlink_ext_ack *extack);
    unsigned int supported_params;
};

like, that's a lot of function pointers and honestly? she ate. πŸ“


🫢 Members 🫢

okay let's go through every single one, because we do not skip members in this house πŸ’–

  • ndo_queue_mem_size β€” the size of the struct that describes a queue's memory. that's it, that's the whole job. she's a size, she knows her size, slay.
  • ndo_queue_mem_alloc β€” allocate memory for an RX queue at the specified index. the shiny new memory gets written at the specified address. 🧚
  • ndo_queue_mem_free β€” free memory from an RX queue. the cleanup queen, we love her.
  • ndo_queue_start β€” start an RX queue with the specified memory and at the specified index. go go go 🏁
  • ndo_queue_stop β€” stop the RX queue at the specified index. heads up: the stopped queue's memory gets written at the specified address. πŸ’€
  • ndo_default_qcfg β€” (optional!) populate the queue config struct with defaults. queue config structs get passed to this helper before the user-requested settings are applied β€” so she's out here setting the vibe first and then the user comes in and redecorates. 🌸
  • ndo_validate_qcfg β€” (optional!) check if the queue config is supported. this one gets called when configuration affecting a queue may be changing β€” either because of NIC-wide config, or config scoped to the queue at a specified index. and when NIC-wide config changes, the callback gets invoked for all queues. all of them. every single one. no skipping. πŸ‘‘
  • ndo_queue_get_dma_dev β€” get the dma device for zero-copy operations to be used for this queue. return NULL on error. that's the rule, bestie, NULL on error, no exceptions. πŸ™ˆ
  • ndo_queue_create β€” create a new RX queue on a virtual device that will be paired with a physical device's queue via leasing. return the new queue id on success, negative error on failure. she's the matchmaker of the struct ngl πŸ’œ
  • supported_params β€” bitmask of supported parameters, see QCFG_*. iykyk ✨

🌈 Description 🌈

okay this is the important fine print and i need you to actually read it, not just scroll past, because it's giving caveat:

note that ndo_queue_mem_alloc and ndo_queue_mem_free may be called while the interface is closed. meanwhile ndo_queue_start and ndo_queue_stop will only be called for an interface which is open.

so like β€” alloc/free can happen anytime, but start/stop only when the interface is actually open. don't mix those up fr fr 🫢


πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're all in the group chat:


and that's the page! πŸŽ€ sign-off time: this one lives in ./include/net and it's dated October 2026 β€” so she's from the future, main character energy fr. bye bestie, go write some queue ops πŸ’…βœ¨

πŸ“¦ where this page comes from