STRUCT NETDEV_QUEUE_MGMT_OPS(9)
π 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. returnNULLon error. that's the rule, bestie,NULLon 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, seeQCFG_*. 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 thatndo_queue_mem_allocandndo_queue_mem_freemay be called while the interface is closed. meanwhilendo_queue_startandndo_queue_stopwill 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:
- Kernel file
./include/net/netdev_queues.h struct netdev_config(9)struct netdev_stat_ops(9)Lockless queue stopping / waking helpers.(9)netif_txq_maybe_stop(9)__netif_txq_completed_wake(9)
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
- 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