On 12/16/19 4:07 AM, Toke Høiland-Jørgensen wrote: > When attaching XDP programs, userspace can set flags to request the attach > mode (generic/SKB mode, driver mode or hw offloaded mode). If no such flags > are requested, the kernel will attempt to attach in driver mode, and then > silently fall back to SKB mode if this fails. > > The silent fallback is a major source of user confusion, as users will try > to load a program on a device without XDP support, and instead of an error > they will get the silent fallback behaviour, not notice, and then wonder > why performance is not what they were expecting. > > In an attempt to combat this, let's switch all the samples to default to > explicitly requesting driver-mode attach. As part of this, ensure that all > the userspace utilities have a switch to enable SKB mode. For those that > have a switch to request driver mode, keep it but turn it into a no-op. > > Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > --- > samples/bpf/xdp1_user.c | 5 ++++- > samples/bpf/xdp_adjust_tail_user.c | 5 ++++- > samples/bpf/xdp_fwd_user.c | 17 ++++++++++++++--- > samples/bpf/xdp_redirect_cpu_user.c | 4 ++++ > samples/bpf/xdp_redirect_map_user.c | 5 ++++- > samples/bpf/xdp_redirect_user.c | 5 ++++- > samples/bpf/xdp_router_ipv4_user.c | 3 +++ > samples/bpf/xdp_rxq_info_user.c | 4 ++++ > samples/bpf/xdp_sample_pkts_user.c | 12 +++++++++--- > samples/bpf/xdp_tx_iptunnel_user.c | 5 ++++- > samples/bpf/xdpsock_user.c | 5 ++++- > 11 files changed, 58 insertions(+), 12 deletions(-) > Acked-by: David Ahern <dsahern@xxxxxxxxx> Thanks for doing this, Toke.