Skip to content

Commit ec76d0c

Browse files
Ronak Doshikuba-moo
authored andcommitted
vmxnet3: move rss code block under eop descriptor
Commit b3973bb ("vmxnet3: set correct hash type based on rss information") added hashType information into skb. However, rssType field is populated for eop descriptor. This can lead to incorrectly reporting of hashType for packets which use multiple rx descriptors. Multiple rx descriptors are used for Jumbo frame or LRO packets, which can hit this issue. This patch moves the RSS codeblock under eop descritor. Cc: [email protected] Fixes: b3973bb ("vmxnet3: set correct hash type based on rss information") Signed-off-by: Ronak Doshi <[email protected]> Acked-by: Peng Li <[email protected]> Acked-by: Guolin Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6e77a5a commit ec76d0c

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,31 +1546,6 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
15461546
rxd->len = rbi->len;
15471547
}
15481548

1549-
#ifdef VMXNET3_RSS
1550-
if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
1551-
(adapter->netdev->features & NETIF_F_RXHASH)) {
1552-
enum pkt_hash_types hash_type;
1553-
1554-
switch (rcd->rssType) {
1555-
case VMXNET3_RCD_RSS_TYPE_IPV4:
1556-
case VMXNET3_RCD_RSS_TYPE_IPV6:
1557-
hash_type = PKT_HASH_TYPE_L3;
1558-
break;
1559-
case VMXNET3_RCD_RSS_TYPE_TCPIPV4:
1560-
case VMXNET3_RCD_RSS_TYPE_TCPIPV6:
1561-
case VMXNET3_RCD_RSS_TYPE_UDPIPV4:
1562-
case VMXNET3_RCD_RSS_TYPE_UDPIPV6:
1563-
hash_type = PKT_HASH_TYPE_L4;
1564-
break;
1565-
default:
1566-
hash_type = PKT_HASH_TYPE_L3;
1567-
break;
1568-
}
1569-
skb_set_hash(ctx->skb,
1570-
le32_to_cpu(rcd->rssHash),
1571-
hash_type);
1572-
}
1573-
#endif
15741549
skb_record_rx_queue(ctx->skb, rq->qid);
15751550
skb_put(ctx->skb, rcd->len);
15761551

@@ -1653,6 +1628,31 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
16531628
u32 mtu = adapter->netdev->mtu;
16541629
skb->len += skb->data_len;
16551630

1631+
#ifdef VMXNET3_RSS
1632+
if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
1633+
(adapter->netdev->features & NETIF_F_RXHASH)) {
1634+
enum pkt_hash_types hash_type;
1635+
1636+
switch (rcd->rssType) {
1637+
case VMXNET3_RCD_RSS_TYPE_IPV4:
1638+
case VMXNET3_RCD_RSS_TYPE_IPV6:
1639+
hash_type = PKT_HASH_TYPE_L3;
1640+
break;
1641+
case VMXNET3_RCD_RSS_TYPE_TCPIPV4:
1642+
case VMXNET3_RCD_RSS_TYPE_TCPIPV6:
1643+
case VMXNET3_RCD_RSS_TYPE_UDPIPV4:
1644+
case VMXNET3_RCD_RSS_TYPE_UDPIPV6:
1645+
hash_type = PKT_HASH_TYPE_L4;
1646+
break;
1647+
default:
1648+
hash_type = PKT_HASH_TYPE_L3;
1649+
break;
1650+
}
1651+
skb_set_hash(skb,
1652+
le32_to_cpu(rcd->rssHash),
1653+
hash_type);
1654+
}
1655+
#endif
16561656
vmxnet3_rx_csum(adapter, skb,
16571657
(union Vmxnet3_GenericDesc *)rcd);
16581658
skb->protocol = eth_type_trans(skb, adapter->netdev);

0 commit comments

Comments
 (0)