mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
tun: Fix xdp_rxq_info's queue_index when detaching
[ Upstream commit2a770cdc43
] 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:8bf5c4ee18
("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>
This commit is contained in:
parent
a3c8fa54e9
commit
29360fd328
1 changed files with 1 additions and 0 deletions
|
@ -653,6 +653,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
|
||||||
tun->tfiles[tun->numqueues - 1]);
|
tun->tfiles[tun->numqueues - 1]);
|
||||||
ntfile = rtnl_dereference(tun->tfiles[index]);
|
ntfile = rtnl_dereference(tun->tfiles[index]);
|
||||||
ntfile->queue_index = index;
|
ntfile->queue_index = index;
|
||||||
|
ntfile->xdp_rxq.queue_index = index;
|
||||||
rcu_assign_pointer(tun->tfiles[tun->numqueues - 1],
|
rcu_assign_pointer(tun->tfiles[tun->numqueues - 1],
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue