All of lore.kernel.org
 help / color / mirror / Atom feed
* [net PATCH] mlx5: fix bug reading rss_hash_type from CQE
@ 2017-05-22 18:13 Jesper Dangaard Brouer
  2017-05-23 10:58 ` Saeed Mahameed
  2017-05-23 15:03 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Jesper Dangaard Brouer @ 2017-05-22 18:13 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Daniel Borkmann, netdev, Tariq Toukan, Alexei Starovoitov,
	Jesper Dangaard Brouer

Masks for extracting part of the Completion Queue Entry (CQE)
field rss_hash_type was swapped, namely CQE_RSS_HTYPE_IP and
CQE_RSS_HTYPE_L4.

The bug resulted in setting skb->l4_hash, even-though the
rss_hash_type indicated that hash was NOT computed over the
L4 (UDP or TCP) part of the packet.

Added comments from the datasheet, to make it more clear what
these masks are selecting.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
 include/linux/mlx5/device.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index dd9a263ed368..a940ec6a046c 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -787,8 +787,14 @@ enum {
 };
 
 enum {
-	CQE_RSS_HTYPE_IP	= 0x3 << 6,
-	CQE_RSS_HTYPE_L4	= 0x3 << 2,
+	CQE_RSS_HTYPE_IP	= 0x3 << 2,
+	/* cqe->rss_hash_type[3:2] - IP destination selected for hash
+	 * (00 = none,  01 = IPv4, 10 = IPv6, 11 = Reserved)
+	 */
+	CQE_RSS_HTYPE_L4	= 0x3 << 6,
+	/* cqe->rss_hash_type[7:6] - L4 destination selected for hash
+	 * (00 = none, 01 = TCP. 10 = UDP, 11 = IPSEC.SPI
+	 */
 };
 
 enum {

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-23 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 18:13 [net PATCH] mlx5: fix bug reading rss_hash_type from CQE Jesper Dangaard Brouer
2017-05-23 10:58 ` Saeed Mahameed
2017-05-23 13:04   ` Jesper Dangaard Brouer
2017-05-23 13:41     ` Saeed Mahameed
2017-05-23 15:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.