Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / vmxnet3 / vmxnet3_ethtool.c
index a0feb17a023844fac5840e8c92998f46d119464e..600ab56c0008bab49251505e38ca911b611da2c1 100644 (file)
@@ -263,7 +263,8 @@ int vmxnet3_set_features(struct net_device *netdev, netdev_features_t features)
        unsigned long flags;
        netdev_features_t changed = features ^ netdev->features;
 
-       if (changed & (NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_RX)) {
+       if (changed & (NETIF_F_RXCSUM | NETIF_F_LRO |
+                      NETIF_F_HW_VLAN_CTAG_RX)) {
                if (features & NETIF_F_RXCSUM)
                        adapter->shared->devRead.misc.uptFeatures |=
                        UPT1_F_RXCSUM;
@@ -279,7 +280,7 @@ int vmxnet3_set_features(struct net_device *netdev, netdev_features_t features)
                        adapter->shared->devRead.misc.uptFeatures &=
                                                        ~UPT1_F_LRO;
 
-               if (features & NETIF_F_HW_VLAN_RX)
+               if (features & NETIF_F_HW_VLAN_CTAG_RX)
                        adapter->shared->devRead.misc.uptFeatures |=
                        UPT1_F_RXVLAN;
                else
@@ -472,6 +473,12 @@ vmxnet3_set_ringparam(struct net_device *netdev,
                                                VMXNET3_RX_RING_MAX_SIZE)
                return -EINVAL;
 
+       /* if adapter not yet initialized, do nothing */
+       if (adapter->rx_buf_per_pkt == 0) {
+               netdev_err(netdev, "adapter not completely initialized, "
+                          "ring size cannot be changed yet\n");
+               return -EOPNOTSUPP;
+       }
 
        /* round it up to a multiple of VMXNET3_RING_SIZE_ALIGN */
        new_tx_ring_size = (param->tx_pending + VMXNET3_RING_SIZE_MASK) &