]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix repeated XSK usage on one channel
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Mon, 1 Jun 2020 13:03:44 +0000 (16:03 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 11 Jun 2020 22:37:55 +0000 (15:37 -0700)
commit99d8d0698921086130286d307b6fb9d8ba04c9d3
treeeee64985987f418de6272810b6c2c15fe3772e7f
parent4cc4f8ed906c80c4a733512f9dd64523b4e90142
net/mlx5e: Fix repeated XSK usage on one channel

After an XSK is closed, the relevant structures in the channel are not
zeroed. If an XSK is opened the second time on the same channel without
recreating channels, the stray values in the structures will lead to
incorrect operation of queues, which causes CQE errors, and the new
socket doesn't work at all.

This patch fixes the issue by explicitly zeroing XSK-related structs in
the channel on XSK close. Note that those structs are zeroed on channel
creation, and usually a configuration change (XDP program is set)
happens on XSK open, which leads to recreating channels, so typical XSK
usecases don't suffer from this issue. However, if XSKs are opened and
closed on the same channel without removing the XDP program, this bug
reproduces.

Fixes: c59ac2b74bd8 ("net/mlx5e: Add XSK zero-copy support")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c