Skip to contentSkip to conversation

vmxnet3: move rss code block under eop descriptor

PATCH Superseded Ronak Doshi 4 participants 8 messages Feb 7, 2023 – Feb 8, 2023

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmxnet3: move rss code block under eop descriptor

Commit b3973bb40041 ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor.

This patch moves the RSS codeblock under eop descritor.

---
 drivers/net/vmxnet3/vmxnet3_drv.c | 50 +++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +25 -25
index 56267c327f0b..682987040ea8 100644
@@ -1546,31 +1546,6 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
 				rxd->len = rbi->len;
 			}
 
-#ifdef VMXNET3_RSS
-			if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
-			    (adapter->netdev->features & NETIF_F_RXHASH)) {
-				enum pkt_hash_types hash_type;
-
-				switch (rcd->rssType) {
-				case VMXNET3_RCD_RSS_TYPE_IPV4:
-				case VMXNET3_RCD_RSS_TYPE_IPV6:
-					hash_type = PKT_HASH_TYPE_L3;
-					break;
-				case VMXNET3_RCD_RSS_TYPE_TCPIPV4:
-				case VMXNET3_RCD_RSS_TYPE_TCPIPV6:
-				case VMXNET3_RCD_RSS_TYPE_UDPIPV4:
-				case VMXNET3_RCD_RSS_TYPE_UDPIPV6:
-					hash_type = PKT_HASH_TYPE_L4;
-					break;
-				default:
-					hash_type = PKT_HASH_TYPE_L3;
-					break;
-				}
-				skb_set_hash(ctx->skb,
-					     le32_to_cpu(rcd->rssHash),
-					     hash_type);
-			}
-#endif
 			skb_record_rx_queue(ctx->skb, rq->qid);
 			skb_put(ctx->skb, rcd->len);
 
@@ -1653,6 +1628,31 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
 			u32 mtu = adapter->netdev->mtu;
 			skb->len += skb->data_len;
 
+#ifdef VMXNET3_RSS
+			if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
+			    (adapter->netdev->features & NETIF_F_RXHASH)) {
+				enum pkt_hash_types hash_type;
+
+				switch (rcd->rssType) {
+				case VMXNET3_RCD_RSS_TYPE_IPV4:
+				case VMXNET3_RCD_RSS_TYPE_IPV6:
+					hash_type = PKT_HASH_TYPE_L3;
+					break;
+				case VMXNET3_RCD_RSS_TYPE_TCPIPV4:
+				case VMXNET3_RCD_RSS_TYPE_TCPIPV6:
+				case VMXNET3_RCD_RSS_TYPE_UDPIPV4:
+				case VMXNET3_RCD_RSS_TYPE_UDPIPV6:
+					hash_type = PKT_HASH_TYPE_L4;
+					break;
+				default:
+					hash_type = PKT_HASH_TYPE_L3;
+					break;
+				}
+				skb_set_hash(skb,
+					     le32_to_cpu(rcd->rssHash),
+					     hash_type);
+			}
+#endif
 			vmxnet3_rx_csum(adapter, skb,
 					(union Vmxnet3_GenericDesc *)rcd);
 			skb->protocol = eth_type_trans(skb, adapter->netdev);
Signature · 1 line
2.11.0
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH net ] vmxnet3: move rss code block under eop descriptor

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
maintainer
#2 lore raw
In reply to Ronak Doshi
Quoted 5 lines · On Tue, 7 Feb 2023 11:28:49 -0800 Ronak Doshi wrote:

Commit b3973bb40041 ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor.

This patch moves the RSS codeblock under eop descritor.

Does it mean it always fails, often fails or occasionally fails to provide the right hash?

Please add a Fixes tag so that the patch is automatically pulled into the stable releases.

maintainer
#3 lore raw
Quoted 5 lines · Jakub Kicinski
Quoted 4 lines · On Tue, 7 Feb 2023 11:28:49 -0800 Ronak Doshi wrote:

Commit b3973bb40041 ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor.

Quoted 7 lines
Quoted 1 line

This patch moves the RSS codeblock under eop descritor.

Does it mean it always fails, often fails or occasionally fails to provide the right hash?

Please add a Fixes tag so that the patch is automatically pulled into the stable releases.

Fixes: is not the way to do this, you need a cc: stable in the signed-off-by area please as the documentation has stated for 16+ years :)

thanks,

greg k-h

maintainer
#4 lore raw
Quoted 8 lines · On Wed, 8 Feb 2023 08:25:29 +0100 Greg KH wrote:
Quoted 5 lines

Does it mean it always fails, often fails or occasionally fails to provide the right hash?

Please add a Fixes tag so that the patch is automatically pulled into the stable releases.

Fixes: is not the way to do this, you need a cc: stable in the signed-off-by area please as the documentation has stated for 16+ years :)

Ah, I have been caught! :]
I may have started telling people "to put the Fixes tag on for stable" because it seems most succinct and understandable.
I'll go back to saying "for the benefit of the backporters", or some such, sorry..

#5 lore raw
In reply to Jakub Kicinski
Quoted 11 lines · > On 2/7/23, 10:12 PM, "Jakub Kicinski" <[email protected]…
Quoted 5 lines · On Tue, 7 Feb 2023 11:28:49 -0800 Ronak Doshi wrote:

Commit b3973bb40041 ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor.

This patch moves the RSS codeblock under eop descritor.

Does it mean it always fails, often fails or occasionally fails to provide the right hash?

This will cause issues mostly for cases which require multiple rx descriptors. For single rx descriptor packet, eop and sop will be same, so no issue.

Thanks,
Ronak

maintainer
#6 lore raw
Quoted 5 lines · On Wed, 8 Feb 2023 18:48:42 +0000 Ronak Doshi wrote:
Quoted 5 lines · On Tue, 7 Feb 2023 11:28:49 -0800 Ronak Doshi wrote:
Quoted 4 lines

Commit b3973bb40041 ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

This patch moves the RSS codeblock under eop descritor.

Does it mean it always fails, often fails or occasionally fails to provide the right hash?

This will cause issues mostly for cases which require multiple rx descriptors. For single rx descriptor packet, eop and sop will be same, so no issue.

Could you add to the commit message when user will most likely encounter that situation? With high MTUs? Depending on the underlying HW/NIC?

#7 lore raw
Quoted 5 lines · On 2/8/23, 11:18 AM, "Jakub Kicinski" <[email protected]…

Could you add to the commit message when user will most likely encounter that situation? With high MTUs? Depending on the underlying HW/NIC?

Sure, let me add it.

Thanks,
Ronak