xdp: add flag to enforce driver mode
After commit b5cdae3291 ("net: Generic XDP") we automatically fall
back to a generic XDP variant if the driver does not support native
XDP. Allow for an option where the user can specify that always the
native XDP variant should be selected and in case it's not supported
by a driver, just bail out.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
0a5539f661
commit
0489df9a43
@@ -6873,6 +6873,8 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
|
||||
ASSERT_RTNL();
|
||||
|
||||
xdp_op = ops->ndo_xdp;
|
||||
if (!xdp_op && (flags & XDP_FLAGS_DRV_MODE))
|
||||
return -EOPNOTSUPP;
|
||||
if (!xdp_op || (flags & XDP_FLAGS_SKB_MODE))
|
||||
xdp_op = generic_xdp_install;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user