diff options
| author | Yunjian Wang <wangyunjian@huawei.com> | 2024-02-20 11:12:07 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-06 14:37:48 +0000 |
| commit | 906986fed8276438e62af2e636e61a1f54e34acb (patch) | |
| tree | f936f52551fe876b5f4fc7ee1e95e936c4571abc | |
| parent | 2e95350fe9db9d53c701075060ac8ac883b68aee (diff) | |
| download | linux-906986fed8276438e62af2e636e61a1f54e34acb.tar.gz linux-906986fed8276438e62af2e636e61a1f54e34acb.tar.bz2 linux-906986fed8276438e62af2e636e61a1f54e34acb.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>
| -rw-r--r-- | drivers/net/tun.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 0b25b59f4403..bb0368272a1b 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -665,6 +665,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); |
