]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix wrong CQE decompression
authorTariq Toukan <tariqt@mellanox.com>
Wed, 22 Feb 2017 15:20:16 +0000 (17:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Feb 2017 15:43:10 +0000 (10:43 -0500)
commitd18b66cf64178a9f6900cbd76ffaae8d7faed36e
treed9bf7529f24cc817b4f514e081d77162bb284f62
parent2ee4a0ec16ca33fed6104e48914a067b44452c12
net/mlx5e: Fix wrong CQE decompression

In cqe compression with striding RQ, the decompression of the CQE field
wqe_counter was done with a wrong wraparound value.
This caused handling cqes with a wrong pointer to wqe (rx descriptor)
and creating SKBs with wrong data, pointing to wrong (and already consumed)
strides/pages.

The meaning of the CQE field wqe_counter in striding RQ holds the
stride index instead of the WQE index. Hence, when decompressing
a CQE, wqe_counter should have wrapped-around the number of strides
in a single multi-packet WQE.

We dropped this wrap-around mask at all in CQE decompression of striding
RQ. It is not needed as in such cases the CQE compression session would
break because of different value of wqe_id field, starting a new
compression session.

Tested:
 ethtool -K ethxx lro off/on
 ethtool --set-priv-flags ethxx rx_cqe_compress on
 super_netperf 16 {ipv4,ipv6} -t TCP_STREAM -m 50 -D
 verified no csum errors and no page refcount issues.

Fixes: 7739ff19cd50 ("net/mlx5e: CQE compression")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reported-by: Tom Herbert <tom@herbertland.com>
Cc: kernel-team@fb.com
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c