diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-07-30 20:43:53 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-31 09:48:21 -0700 |
commit | 84c6b86875e01a08a0daa6fdd4a01b36bf0bf0b2 (patch) | |
tree | 06fb904b95b6f0427a577120753713aa39050660 /include | |
parent | f734607e819b951bae3b436b026ec672082e9241 (diff) | |
download | linux-84c6b86875e01a08a0daa6fdd4a01b36bf0bf0b2.tar.gz linux-84c6b86875e01a08a0daa6fdd4a01b36bf0bf0b2.tar.bz2 linux-84c6b86875e01a08a0daa6fdd4a01b36bf0bf0b2.zip |
xsk: don't allow umem replace at stack level
Currently drivers have to check if they already have a umem
installed for a given queue and return an error if so. Make
better use of XDP_QUERY_XSK_UMEM and move this functionality
to the core.
We need to keep rtnl across the calls now.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3bf7e93c9e96..282e2e95ad5b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -872,10 +872,10 @@ struct netdev_bpf { struct { struct bpf_offloaded_map *offmap; }; - /* XDP_SETUP_XSK_UMEM */ + /* XDP_QUERY_XSK_UMEM, XDP_SETUP_XSK_UMEM */ struct { - struct xdp_umem *umem; - u16 queue_id; + struct xdp_umem *umem; /* out for query*/ + u16 queue_id; /* in for query */ } xsk; }; }; @@ -3568,6 +3568,7 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack, int fd, u32 flags); u32 __dev_xdp_query(struct net_device *dev, bpf_op_t xdp_op, enum bpf_netdev_command cmd); +int xdp_umem_query(struct net_device *dev, u16 queue_id); int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb); int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |