Skip to content

Commit 6f3aeb1

Browse files
shemmingerJakub Kicinski
authored andcommitted
hv_netvsc: make recording RSS hash depend on feature flag
The recording of RSS hash should be controlled by NETIF_F_RXHASH. Fixes: 1fac7ca ("hv_netvsc: record hardware hash in skb") Suggested-by: Eric Dumazet <[email protected]> Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: Haiyang Zhang <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fc5141c commit 6f3aeb1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

drivers/net/hyperv/hyperv_net.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,8 @@ struct nvsp_message {
823823

824824
#define NETVSC_SUPPORTED_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | \
825825
NETIF_F_TSO | NETIF_F_IPV6_CSUM | \
826-
NETIF_F_TSO6 | NETIF_F_LRO | NETIF_F_SG)
826+
NETIF_F_TSO6 | NETIF_F_LRO | \
827+
NETIF_F_SG | NETIF_F_RXHASH)
827828

828829
#define VRSS_SEND_TAB_SIZE 16 /* must be power of 2 */
829830
#define VRSS_CHANNEL_MAX 64

drivers/net/hyperv/netvsc_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
803803
skb->ip_summed = CHECKSUM_UNNECESSARY;
804804
}
805805

806-
if (hash_info)
806+
if (hash_info && (net->features & NETIF_F_RXHASH))
807807
skb_set_hash(skb, *hash_info, PKT_HASH_TYPE_L4);
808808

809809
if (vlan) {

drivers/net/hyperv/rndis_filter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device,
12141214
/* Compute tx offload settings based on hw capabilities */
12151215
net->hw_features |= NETIF_F_RXCSUM;
12161216
net->hw_features |= NETIF_F_SG;
1217+
net->hw_features |= NETIF_F_RXHASH;
12171218

12181219
if ((hwcaps.csum.ip4_txcsum & NDIS_TXCSUM_ALL_TCP4) == NDIS_TXCSUM_ALL_TCP4) {
12191220
/* Can checksum TCP */

0 commit comments

Comments
 (0)