diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2023-02-07 10:53:40 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2023-02-07 23:07:28 +0100 |
commit | 30bbf891f1b8fd92db271c7198609a076d7fbf14 (patch) | |
tree | 012ee5d4c047770aa8af6b5650b158719fa08e2e /drivers/net/virtio_net.c | |
parent | 02fc0e73e852f78ec374004f924b9d84275d0006 (diff) | |
download | lwn-30bbf891f1b8fd92db271c7198609a076d7fbf14.tar.gz lwn-30bbf891f1b8fd92db271c7198609a076d7fbf14.zip |
virtio_net: Update xdp_features with xdp multi-buff
Now virtio-net supports xdp multi-buffer so add it to xdp_features.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/bpf/60c76cd63a0246db785606e8891b925fd5c9bf06.1675763384.git.lorenzo@kernel.org
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 692dff071782..ddc3dc7ea73c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3281,7 +3281,7 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog, virtnet_clear_guest_offloads(vi); } if (!old_prog) - xdp_features_set_redirect_target(dev, false); + xdp_features_set_redirect_target(dev, true); } else { xdp_features_clear_redirect_target(dev); vi->xdp_enabled = false; @@ -3940,8 +3940,10 @@ static int virtnet_probe(struct virtio_device *vdev) INIT_WORK(&vi->config_work, virtnet_config_changed_work); spin_lock_init(&vi->refill_lock); - if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) + if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) { vi->mergeable_rx_bufs = true; + dev->xdp_features |= NETDEV_XDP_ACT_RX_SG; + } if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_NOTF_COAL)) { vi->rx_usecs = 0; |