projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b68df01
)
virtio_net: reject XDP programs using header adjustment
author
Jakub Kicinski
<
[email protected]
>
Wed, 25 Jan 2017 22:56:36 +0000
(14:56 -0800)
committer
David S. Miller
<
[email protected]
>
Thu, 26 Jan 2017 03:48:40 +0000
(22:48 -0500)
commit
17bedab27231
("bpf: xdp: Allow head adjustment in XDP prog")
added a new XDP helper to prepend and remove data from a frame.
Make virtio_net reject programs making use of this helper until
proper support is added.
Signed-off-by: Jakub Kicinski <
[email protected]
>
Acked-by: John Fastabend <
[email protected]
>
Acked-by: Jason Wang <
[email protected]
>
Acked-by: Michael S. Tsirkin <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/virtio_net.c
patch
|
blob
|
history
diff --git
a/drivers/net/virtio_net.c
b/drivers/net/virtio_net.c
index 4c6e9b43f1d3aa9c3c90c0d75110c9752ee0f3b4..765c2d6358daf38203cdb1a50a31cc04f65c1968 100644
(file)
--- a/
drivers/net/virtio_net.c
+++ b/
drivers/net/virtio_net.c
@@
-1715,6
+1715,11
@@
static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog)
u16 xdp_qp = 0, curr_qp;
int i, err;
+ if (prog && prog->xdp_adjust_head) {
+ netdev_warn(dev, "Does not support bpf_xdp_adjust_head()\n");
+ return -EOPNOTSUPP;
+ }
+
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) ||
virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) ||