Mailing List Archive

[PATCH net ] 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.

Signed-off-by: Ronak Doshi <doshir@vmware.com>
Acked-by: Peng Li <lpeng@vmware.com>
Acked-by: Guolin Yang <gyang@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 50 +++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 56267c327f0b..682987040ea8 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -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);
--
2.11.0
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
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.
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
On Tue, Feb 07, 2023 at 10:12:21PM -0800, Jakub Kicinski wrote:
> 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.

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
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
On Wed, 8 Feb 2023 08:25:29 +0100 Greg KH wrote:
> > 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..
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
?> On 2/7/23, 10:12 PM, "Jakub Kicinski" <kuba@kernel.org <mailto:kuba@kernel.org>> wrote:
>
> 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
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
On Wed, 8 Feb 2023 18:48:42 +0000 Ronak Doshi wrote:
> > 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.

Could you add to the commit message when user will most likely
encounter that situation? With high MTUs? Depending on the
underlying HW/NIC?
Re: [PATCH net ] vmxnet3: move rss code block under eop descriptor [ In reply to ]
> On 2/8/23, 11:18 AM, "Jakub Kicinski" <kuba@kernel.org <mailto:kuba@kernel.org>> wrote:
>
> 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