On 12/14/22 14:24, Wan Junjie wrote: > Libxdp will load an embeded program by default. And OVS will > remove the program when it destroy the xsks. This is not a > good experience if we pre-load an xdp program. Every time we > restart OVS, it will remove the program. > > Add an option 'inhibit', so we can disable the default program > load and remove. Use command for a afxdp type interface like below: > ovs-vsctl set int xxx options:inhibit=true > > -- > v2: fix some code missing > > Signed-off-by: Wan Junjie <[email protected]> > --- > lib/netdev-afxdp.c | 45 +++++++++++++++++++++++++++----------- > lib/netdev-linux-private.h | 3 +++ > 2 files changed, 35 insertions(+), 13 deletions(-)
Hi, Wan. Thanks for the patch! It seems to miss some essential parts though. In order for the interface to work with an XDP program, the socket fd has to be added into xsks_map of that program. This should be done with bpf_map_update_elem(). However, there is no code in this patch that would get an xsks_map fd and update the map. This way the interface will not be able to receive any traffic. Or am I missing something? Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
