alloc_etherdev_mqs(9)
π 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:
eth_header(9)eth_get_headlen(9)eth_type_trans(9)eth_header_cache(9)eth_header_cache_update(9)eth_header_parse_protocol(9)eth_prepare_mac_addr_change(9)eth_commit_mac_addr_change(9)eth_mac_addr(9)ether_setup(9)platform_get_ethdev_address(9)nvmem_get_mac_address(9)fwnode_get_mac_address(9)device_get_mac_address(9)device_get_ethdev_address(9)
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
- 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