Skip to contentSkip to conversation

hv_netvsc: make recording RSS hash depend on feature flag

PATCH Applied Haiyang Zhang 3 participants 3 messages Nov 23, 2019 – Nov 24, 2019

Subsystems (4)
lore
Share & tools
lore

Haiyang Zhang

author maintainer
#0 lore raw

PATCH 1/1 hv_netvsc: make recording RSS hash depend on feature flag

From: Stephen Hemminger <[email protected]>

The recording of RSS hash should be controlled by NETIF_F_RXHASH.

Fixes 1fac7ca4e63b ("hv_netvsc: record hardware hash in skb")
---
 drivers/net/hyperv/hyperv_net.h   | 3 ++-
 drivers/net/hyperv/netvsc_drv.c   | 2 +-
 drivers/net/hyperv/rndis_filter.c | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/hyperv/hyperv_net.h +2 -1
index 4209d1cf57f6..0be5ce90dc7c 100644
@@ -822,7 +822,8 @@ struct nvsp_message {
 
 #define NETVSC_SUPPORTED_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | \
 				      NETIF_F_TSO | NETIF_F_IPV6_CSUM | \
-				      NETIF_F_TSO6 | NETIF_F_LRO | NETIF_F_SG)
+				      NETIF_F_TSO6 | NETIF_F_LRO | \
+				      NETIF_F_SG | NETIF_F_RXHASH)
 
 #define VRSS_SEND_TAB_SIZE 16  /* must be power of 2 */
 #define VRSS_CHANNEL_MAX 64
drivers/net/hyperv/netvsc_drv.c +1 -1
index 5fa5c49e481b..868e22e286ca 100644
@@ -803,7 +803,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 	}
 
-	if (hash_info)
+	if (hash_info && (net->features & NETIF_F_RXHASH))
 		skb_set_hash(skb, *hash_info, PKT_HASH_TYPE_L4);
 
 	if (vlan) {
drivers/net/hyperv/rndis_filter.c +1 -0
index c06178380ac8..206b4e77eaf0 100644
@@ -1214,6 +1214,7 @@ static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device,
 	/* Compute tx offload settings based on hw capabilities */
 	net->hw_features |= NETIF_F_RXCSUM;
 	net->hw_features |= NETIF_F_SG;
+	net->hw_features |= NETIF_F_RXHASH;
 
 	if ((hwcaps.csum.ip4_txcsum & NDIS_TXCSUM_ALL_TCP4) == NDIS_TXCSUM_ALL_TCP4) {
 		/* Can checksum TCP */
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

From: Haiyang Zhang <[email protected]> Sent: Saturday, November 23, 2019 3:50 PM

Quoted 10 lines

From: Stephen Hemminger <[email protected]>

The recording of RSS hash should be controlled by NETIF_F_RXHASH.

Fixes 1fac7ca4e63b ("hv_netvsc: record hardware hash in skb")