libeth_rx_hw_len_mtu(9)
π libeth_rx_hw_len_mtu β the manual page, bestie edition π
okay so bestie, this is a kernel API manual page for libeth_rx_hw_len_mtu, and it is genuinely so good. it's giving "tiny helper function that does SO much math for you" energy. let's get into it β¨
πΈ NAME πΈ
libeth_rx_hw_len_mtu β get the actual buffer size to be passed to HW
like, the real one. the one the hardware actually wants. no cap π«Ά
π¦ SYNOPSIS π¦
u32 libeth_rx_hw_len_mtu (const struct page_pool_params *pp , u32
max_len );
two arguments in, one u32 of freshly-calculated buffer length out. iconic behaviour, honestly π
π ARGUMENTS π
ppβ thepage_pool_paramsof the netdev you wanna calculate the size for. yes, that netdev. the one you're doing all this for πmax_lenβ the maximum buffer size for a single descriptor. the ceiling. the limit. the "bestie pls don't go past this" number β¨
β RETURN β
it hands you back the HW-writeable length per one buffer β the thing you pass to the HW so it stays happy. and it's literally accounting for all of this:
- the MTU the dev has
- the HW required alignment
- the minimum and maximum allowed values
- and the system's page size
like not me doing four whole jobs at once π it's everything, it's all of it, it's a whole vibe check for your buffer π§
π SEE ALSO π
the kernel file, right here:
./drivers/net/ethernet/intel/libeth/rx.c
and the whole friend group showing up for the function:
libeth_rx_hw_len_truesize(9)libeth_rx_page_pool_params(9)libeth_rx_page_pool_params_zc(9)libeth_rx_fq_create(9)libeth_rx_fq_destroy(9)libeth_rx_recycle_slow(9)libeth_rx_pt_gen_hash_type(9)
go read them too, fr fr, they all ate π
and that's the whole page, bestie! this one comes to you from ./drivers/net/ethernet/intel/l... dated October 2026, and it's out here living under the name libeth_rx_hw_len_mtu(9) β mwah, slay, no notes πππ
π¦ 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