Skip to contentSkip to conversation

AF_XDP headroom

DISCUSSION Vladimír Čunát 2 participants 2 messages Dec 17, 2019

lore
Share & tools
lore
#0 lore raw

Hello.

I configured .frame_headroom = 0 (default) but I receive packets with larger one (256).  Am I doing something wrong?  Kernel [docs] says:

Quoted 1 line

There is also an option to set the headroom of each single buffer in

the UMEM. If you set this to N bytes, it means that the packet will start N bytes into the buffer leaving the first N bytes for the application to use.

which doesn't sound to leave an option for kernel-space to change/increase it, but apparently it does so for me.  In my case it wouldn't really be an issue, except it makes me unsure e.g. whether 2k frames are guaranteed to handle standard 1.5k payloads.

[docs]
https://www.kernel.org/doc/html/latest/networking/af_xdp.html?highlight=headroom

Thanks
--Vladimir

#1 lore raw
Quoted 6 lines · Vladimír Čunát

Hello.

I configured .frame_headroom = 0 (default) but I receive packets with larger one (256). Am I doing something wrong? Kernel [docs] says:

This is correct.
The 256 headroom is for XDP frame's headroom, reserved in driver. So you shouldn't use it.
if you configure .frame_headroom = 256, then your frame will start with 256 + 256.

Quoted 4 lines
Quoted 1 line

There is also an option to set the headroom of each single buffer in

the UMEM. If you set this to N bytes, it means that the packet will start N bytes into the buffer leaving the first N bytes for the application to use.

Yes
William

Quoted 12 lines

which doesn't sound to leave an option for kernel-space to change/increase it, but apparently it does so for me. In my case it wouldn't really be an issue, except it makes me unsure e.g. whether 2k frames are guaranteed to handle standard 1.5k payloads.

[docs]
https://www.kernel.org/doc/html/latest/networking/af_xdp.html?highlight=headroom

Thanks
--Vladimir