]> git.hungrycats.org Git - linux/commitdiff
tun: Fix xdp_rxq_info's queue_index when detaching
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 20 Feb 2024 03:12:07 +0000 (11:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:45 +0000 (14:38 +0000)
[ Upstream commit 2a770cdc4382b457ca3d43d03f0f0064f905a0d0 ]

When a queue(tfile) is detached, we only update tfile's queue_index,
but do not update xdp_rxq_info's queue_index. This patch fixes it.

Fixes: 8bf5c4ee1889 ("tun: setup xdp_rxq_info")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Link: https://lore.kernel.org/r/1708398727-46308-1-git-send-email-wangyunjian@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/tun.c

index 603530e6cd7b9f289dff64e199dec01533db9f4a..42bf0a3ec632e65ccb2c312024bf210f67e2a1cc 100644 (file)
@@ -654,6 +654,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
                                   tun->tfiles[tun->numqueues - 1]);
                ntfile = rtnl_dereference(tun->tfiles[index]);
                ntfile->queue_index = index;
+               ntfile->xdp_rxq.queue_index = index;
                rcu_assign_pointer(tun->tfiles[tun->numqueues - 1],
                                   NULL);