hv_netvsc: Allow scatter-gather feature to be tunable
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 5 Sep 2019 23:23:07 +0000 (23:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Sep 2019 15:42:52 +0000 (17:42 +0200)
In a previous patch, the NETIF_F_SG was missing after the code changes.
That caused the SG feature to be "fixed". This patch includes it into
hw_features, so it is tunable again.

Fixes: 23312a3be999 ("netvsc: negotiate checksum and segmentation parameters")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c

index ecc9af050387ad8ebf4fe218068acb1e19a97f4a..670ef682f268118c34e345dabcbc5e20a718c955 100644 (file)
@@ -822,7 +822,7 @@ 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_TSO6 | NETIF_F_LRO | NETIF_F_SG)
 
 #define VRSS_SEND_TAB_SIZE 16  /* must be power of 2 */
 #define VRSS_CHANNEL_MAX 64
index 0a6cd2f1111fd40c6e79f394a12b5567f05da4b8..1f1192ebcbbd13ee0bcf4a718499a9708184250c 100644 (file)
@@ -2313,8 +2313,8 @@ static int netvsc_probe(struct hv_device *dev,
 
        /* hw_features computed in rndis_netdev_set_hwcaps() */
        net->features = net->hw_features |
-               NETIF_F_HIGHDMA | NETIF_F_SG |
-               NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
+               NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX |
+               NETIF_F_HW_VLAN_CTAG_RX;
        net->vlan_features = net->features;
 
        netdev_lockdep_set_classes(net);
index 317dbe9356c2615fe3f183023edea5b4dfc7e339..abaf8156d19d43c12603c514d1870e4bbb69ed18 100644 (file)
@@ -1207,6 +1207,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;
 
        if ((hwcaps.csum.ip4_txcsum & NDIS_TXCSUM_ALL_TCP4) == NDIS_TXCSUM_ALL_TCP4) {
                /* Can checksum TCP */