aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vmxnet3/vmxnet3_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_drv.c')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 0d47c3a0530..7a494f79c88 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1082,7 +1082,7 @@ vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
1082 struct sk_buff *skb, 1082 struct sk_buff *skb,
1083 union Vmxnet3_GenericDesc *gdesc) 1083 union Vmxnet3_GenericDesc *gdesc)
1084{ 1084{
1085 if (!gdesc->rcd.cnc && adapter->rxcsum) { 1085 if (!gdesc->rcd.cnc && adapter->netdev->features & NETIF_F_RXCSUM) {
1086 /* typical case: TCP/UDP over IP and both csums are correct */ 1086 /* typical case: TCP/UDP over IP and both csums are correct */
1087 if ((le32_to_cpu(gdesc->dword[3]) & VMXNET3_RCD_CSUM_OK) == 1087 if ((le32_to_cpu(gdesc->dword[3]) & VMXNET3_RCD_CSUM_OK) ==
1088 VMXNET3_RCD_CSUM_OK) { 1088 VMXNET3_RCD_CSUM_OK) {
@@ -2081,10 +2081,10 @@ vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter)
2081 devRead->misc.ddLen = cpu_to_le32(sizeof(struct vmxnet3_adapter)); 2081 devRead->misc.ddLen = cpu_to_le32(sizeof(struct vmxnet3_adapter));
2082 2082
2083 /* set up feature flags */ 2083 /* set up feature flags */
2084 if (adapter->rxcsum) 2084 if (adapter->netdev->features & NETIF_F_RXCSUM)
2085 devRead->misc.uptFeatures |= UPT1_F_RXCSUM; 2085 devRead->misc.uptFeatures |= UPT1_F_RXCSUM;
2086 2086
2087 if (adapter->lro) { 2087 if (adapter->netdev->features & NETIF_F_LRO) {
2088 devRead->misc.uptFeatures |= UPT1_F_LRO; 2088 devRead->misc.uptFeatures |= UPT1_F_LRO;
2089 devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS); 2089 devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS);
2090 } 2090 }
@@ -2593,9 +2593,6 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
2593 if (new_mtu < VMXNET3_MIN_MTU || new_mtu > VMXNET3_MAX_MTU) 2593 if (new_mtu < VMXNET3_MIN_MTU || new_mtu > VMXNET3_MAX_MTU)
2594 return -EINVAL; 2594 return -EINVAL;
2595 2595
2596 if (new_mtu > 1500 && !adapter->jumbo_frame)
2597 return -EINVAL;
2598
2599 netdev->mtu = new_mtu; 2596 netdev->mtu = new_mtu;
2600 2597
2601 /* 2598 /*
@@ -2641,28 +2638,18 @@ vmxnet3_declare_features(struct vmxnet3_adapter *adapter, bool dma64)
2641{ 2638{
2642 struct net_device *netdev = adapter->netdev; 2639 struct net_device *netdev = adapter->netdev;
2643 2640
2644 netdev->features = NETIF_F_SG | 2641 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
2645 NETIF_F_HW_CSUM | 2642 NETIF_F_HW_CSUM | NETIF_F_HW_VLAN_TX |
2646 NETIF_F_HW_VLAN_TX | 2643 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_LRO;
2647 NETIF_F_HW_VLAN_RX | 2644 if (dma64)
2648 NETIF_F_HW_VLAN_FILTER |
2649 NETIF_F_TSO |
2650 NETIF_F_TSO6 |
2651 NETIF_F_LRO;
2652
2653 printk(KERN_INFO "features: sg csum vlan jf tso tsoIPv6 lro");
2654
2655 adapter->rxcsum = true;
2656 adapter->jumbo_frame = true;
2657 adapter->lro = true;
2658
2659 if (dma64) {
2660 netdev->features |= NETIF_F_HIGHDMA; 2645 netdev->features |= NETIF_F_HIGHDMA;
2661 printk(" highDMA"); 2646 netdev->vlan_features = netdev->hw_features & ~NETIF_F_HW_VLAN_TX;
2662 } 2647 netdev->features = netdev->hw_features |
2648 NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
2663 2649
2664 netdev->vlan_features = netdev->features; 2650 netdev_info(adapter->netdev,
2665 printk("\n"); 2651 "features: sg csum vlan jf tso tsoIPv6 lro%s\n",
2652 dma64 ? " highDMA" : "");
2666} 2653}
2667 2654
2668 2655
@@ -2874,6 +2861,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
2874 .ndo_start_xmit = vmxnet3_xmit_frame, 2861 .ndo_start_xmit = vmxnet3_xmit_frame,
2875 .ndo_set_mac_address = vmxnet3_set_mac_addr, 2862 .ndo_set_mac_address = vmxnet3_set_mac_addr,
2876 .ndo_change_mtu = vmxnet3_change_mtu, 2863 .ndo_change_mtu = vmxnet3_change_mtu,
2864 .ndo_set_features = vmxnet3_set_features,
2877 .ndo_get_stats = vmxnet3_get_stats, 2865 .ndo_get_stats = vmxnet3_get_stats,
2878 .ndo_tx_timeout = vmxnet3_tx_timeout, 2866 .ndo_tx_timeout = vmxnet3_tx_timeout,
2879 .ndo_set_multicast_list = vmxnet3_set_mc, 2867 .ndo_set_multicast_list = vmxnet3_set_mc,