On Thu, Dec 05, 2019 at 03:32:19PM +0100, Eelco Chaudron wrote: > > > On 23 Nov 2019, at 1:26, William Tu wrote: > > >Now netdev-afxdp always forwards all packets to userspace because > >it is using libbpf's default XDP program, see 'xsk_load_xdp_prog'. > >There are some cases when users want to keep packets in kernel instead > >of sending to userspace, for example, management traffic such as SSH > >should be processed in kernel. > > > >The patch enables loading the user-provided XDP program by > > $ovs-vsctl -- set int afxdp-p0 options:xdp-obj=<path/to/xdp/obj> > > > >So users can implement their filtering logic or traffic steering idea > >in their XDP program, and rest of the traffic passes to AF_XDP socket > >handled by OVS. > > Did a quick test (no review) and found that we run into a repeat loop with > best-effort mode: > > > 2019-12-05T14:28:05.687Z|100465|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:28:05.688Z|100466|netdev_afxdp|ERR|best-effort mode and > xdp-obj can't be set together > 2019-12-05T14:28:05.688Z|100467|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:28:05.688Z|100468|netdev_afxdp|INFO|eno1: Removing xdp > program. > 2019-12-05T14:28:05.689Z|100469|netdev_afxdp|INFO|Removed XDP program ID: 0 > 2019-12-05T14:28:05.691Z|100470|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:28:05.692Z|100471|netdev_afxdp|ERR|best-effort mode and > xdp-obj can't be set together > 2019-12-05T14:28:05.692Z|100472|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:28:05.692Z|100473|netdev_afxdp|INFO|eno1: Removing xdp > program. > 2019-12-05T14:28:05.693Z|100474|netdev_afxdp|INFO|Removed XDP program ID: 0 > 2019-12-05T14:28:05.695Z|100475|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:28:05.696Z|100476|netdev_afxdp|ERR|best-effort mode and > xdp-obj can't be set together > 2019-12-05T14:28:05.696Z|100477|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:28:05.696Z|100478|netdev_afxdp|INFO|eno1: Removing xdp > program. > 2019-12-05T14:28:05.697Z|100479|netdev_afxdp|INFO|Removed XDP program ID: 0 > 2019-12-05T14:28:05.699Z|100480|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:28:05.700Z|100481|netdev_afxdp|ERR|best-effort mode and > xdp-obj can't be set together > 2019-12-05T14:28:05.700Z|100482|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:28:05.701Z|100483|netdev_afxdp|INFO|eno1: Removing xdp > program. > > Loop also happens when I configure a non existing object: > > 2019-12-05T14:31:17.562Z|311021|netdev_afxdp|ERR|Invalid xdp-obj > '/root/af_xdp_kernie.o': No such file or directory. > 2019-12-05T14:31:17.562Z|311022|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:31:17.562Z|311023|netdev_afxdp|INFO|eno1: Removing xdp > program. > 2019-12-05T14:31:17.562Z|311024|netdev_afxdp|INFO|Removed XDP program ID: 0 > 2019-12-05T14:31:17.565Z|311025|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:31:17.566Z|311026|netdev_afxdp|ERR|Invalid xdp-obj > '/root/af_xdp_kernie.o': No such file or directory. > 2019-12-05T14:31:17.566Z|311027|netdev|WARN|eno1: could not set > configuration (Invalid argument) > 2019-12-05T14:31:17.566Z|311028|netdev_afxdp|INFO|eno1: Removing xdp > program. > 2019-12-05T14:31:17.566Z|311029|netdev_afxdp|INFO|Removed XDP program ID: 0 > 2019-12-05T14:31:17.569Z|311030|bridge|WARN|could not open network device > tapVM (No such device) > 2019-12-05T14:31:17.570Z|311031|netdev_afxdp|ERR|Invalid xdp-obj > '/root/af_xdp_kernie.o': No such file or directory. > 2019-12-05T14:31:17.570Z|311032|netdev|WARN|eno1: could not set > configuration (Invalid argument)
Hi Eelco, Thanks for reporting the infinite add/remove issue. Ilya has a patch fixing it [PATCH 2/3] netdev-afxdp: Avoid removing of XDP program if not loaded. In short, the loop is 1) misconfigure netdev-afxdp 2) clean up xdp program using bpf_set_link_xdp_fd, (trigger if-notifier) 3) reconfigure --> goto step 1 Actually 2) is not necessary because xdp program is not loaded. I will rebase on his fix and send newer version Thanks William _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
