Commit 30bbf891 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Daniel Borkmann
Browse files

virtio_net: Update xdp_features with xdp multi-buff

parent 02fc0e73
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;