[dpdk-dev] [PATCH] net/af_xdp: custom XDP program loading

Loftus, Ciara ciara.loftus at intel.com
Mon Sep 14 15:07:03 CEST 2020


> >
> > The new 'xdp_prog=<string>' vdev arg allows the user to specify the path
> to
> > a custom XDP program to be set on the device, instead of the default libbpf
> > one. The program must have an XSK_MAP of name 'xsks_map' which will
> > allow for the redirection of some packets to userspace and thus the PMD,
> > using some criteria defined in the program.
> > Note: a netdev may only load one program.
> >
> > Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
> > ---
> 
> [MT] Stupid question :), AF_XDP is specifically related to loading an XDP
> program that allows you to redirect packets to an XSK...
> why would you want to allow a custom XDP program to be loaded?
> 
> Other than that the code itself looked GTM

Hi Maryam,

Thanks for your feedback. It's a good question, and I will update the commit message in the v2 with the reasoning.

Sometimes it might be desired to redirect some not all packets to the xsk/PMD. eg. if the user wishes to drop or process a certain type of packet in the kernel. That logic can be put in the custom program. The key is that the custom program allows for *some* packets to still hit the xsk, and we check for that through checking the presence of the xsks_map.

Thanks,
Ciara

> 
> <snip>



More information about the dev mailing list