summaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorYunjian Wang <wangyunjian@huawei.com>2024-02-20 11:12:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-06 14:35:22 +0000
commit32793f71f212db99560816a0916ff060e46dfc6f (patch)
tree0b7aacde36b4360f7e93f7b4882d3b64903883d0 /drivers/net/tun.c
parentec343a55b687a452f5e87f3b52bf9f155864df65 (diff)
downloadlinux-stable-32793f71f212db99560816a0916ff060e46dfc6f.tar.gz
linux-stable-32793f71f212db99560816a0916ff060e46dfc6f.tar.bz2
linux-stable-32793f71f212db99560816a0916ff060e46dfc6f.zip
tun: Fix xdp_rxq_info's queue_index when detaching
[ 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>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 055664a26f7a..625525275539 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -729,6 +729,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);