Skip to contentSkip to conversation

mlx5 AF_XDP busy polling

DISCUSSION Federico Parola 1 participant 1 message Dec 23, 2022

lore
Share & tools
lore
#0 lore raw

Hello everyone,
I'm not able to make AF_XDP busy polling work correctly on a ConnectX-4 NIC. Whenever I run the xdpsock application in busy polling mode (-B flag), in either l2fwd or rx-drop mode, the NIC keeps generating interrupts and processing rate is very low. I'm on kernel 5.13. Is this a known problem?

By looking at the code I might have a possible explanation for this behavior:
- To perform a busy loop on the socket, a valid napi id must be stored in the sk_napi_id field of the socket structure (https://elixir.bootlin.com/linux/latest/source/include/net/busy_poll.h#L109)
- The sk_napi_id field of the socket is populated when the first packet is redirected to the socket, and the value is taken from the rxq associated to the packet xdp_buff (https://elixir.bootlin.com/linux/latest/source/include/net/busy_poll.h#L173)
- mlx5 appears to always assign the napi_id 0 to xsk queues, that is not a valid napi_id (https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c#L74)

Does this make sense?

Thank you,
Federico