Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d97117bd authored by Toshiaki Makita's avatar Toshiaki Makita Committed by Greg Kroah-Hartman
Browse files

virtio_net: Fix not restoring real_num_rx_queues



[ Upstream commit 188313c137c4f76afd0862f50dbc185b198b9e2a ]

When _virtnet_set_queues() failed we did not restore real_num_rx_queues.
Fix this by placing the change of real_num_rx_queues after
_virtnet_set_queues().
This order is also in line with virtnet_set_channels().

Fixes: 4941d472 ("virtio-net: do not reset during XDP set")
Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c2e63dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2377,10 +2377,10 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog,
		}
	}

	netif_set_real_num_rx_queues(dev, curr_qp + xdp_qp);
	err = _virtnet_set_queues(vi, curr_qp + xdp_qp);
	if (err)
		goto err;
	netif_set_real_num_rx_queues(dev, curr_qp + xdp_qp);
	vi->xdp_queue_pairs = xdp_qp;

	for (i = 0; i < vi->max_queue_pairs; i++) {