alloc_etherdev_mqs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– alloc_etherdev_mqs(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, welcome to the alloc_etherdev_mqs(9) page from the Kernel API Manual ✨ this is the one that literally makes you an Ethernet device out of thin air (well, out of memory). let's get into it πŸ¦‹


✨ NAME ✨

alloc_etherdev_mqs β€” Allocates and sets up an Ethernet device πŸ’… no cap, that's the whole vibe


🌸 SYNOPSIS 🌸

struct net_device * alloc_etherdev_mqs (int sizeof_priv , unsigned int
txqs , unsigned int rxqs );

it's giving "one function, three args, infinite possibilities" πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • sizeof_priv β€” Size of additional driver-private structure to be allocated for this Ethernet device. yep, that's your little private stash, sized exactly how you ask 🫢
  • txqs β€” The number of TX queues this device has. count 'em, queen πŸ‘‘
  • rxqs β€” The number of RX queues this device has. same energy, but for receiving πŸ’Œ

πŸ’œ DESCRIPTION πŸ’œ

so what does it actually do? Fill in the fields of the device structure with Ethernet-generic values. Basically does everything except registering the device β€” main character behavior honestly, it does the whole makeover and then hands you the keys 😭✨

It constructs a new net device, complete with a private data area of size (sizeof_priv). And listen β€” a 32-byte (not bit) alignment is enforced for this private data area. not bit, bestie, byte. do not come for me on this, the docs said it, I said it πŸ’€

lowkey important: it sets everything up but does not register the device. that part is on you, iykyk πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./net/ethernet/eth.c β€” and here's the whole friend group, no one left out fr fr:


and that's the page, bestie πŸ§šπŸ’– this whole thing lives in ./net/ethernet and it's dated October 2026, all under the alloc_etherdev_mqs(9) banner β€” slay, go forth and allocate πŸ“β­

πŸ“¦ where this page comes from