diff options
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 18bc5b718bbb..c70ad515383a 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -38,8 +38,6 @@ | |||
38 | * Tx descriptors that can be associated with each corresponding FIFO. | 38 | * Tx descriptors that can be associated with each corresponding FIFO. |
39 | * intr_type: This defines the type of interrupt. The values can be 0(INTA), | 39 | * intr_type: This defines the type of interrupt. The values can be 0(INTA), |
40 | * 2(MSI_X). Default value is '2(MSI_X)' | 40 | * 2(MSI_X). Default value is '2(MSI_X)' |
41 | * lro: Specifies whether to enable Large Receive Offload (LRO) or not. | ||
42 | * Possible values '1' for enable '0' for disable. Default is '0' | ||
43 | * lro_max_pkts: This parameter defines maximum number of packets can be | 41 | * lro_max_pkts: This parameter defines maximum number of packets can be |
44 | * aggregated as a single large packet | 42 | * aggregated as a single large packet |
45 | * napi: This parameter used to enable/disable NAPI (polling Rx) | 43 | * napi: This parameter used to enable/disable NAPI (polling Rx) |
@@ -90,7 +88,7 @@ | |||
90 | #include "s2io.h" | 88 | #include "s2io.h" |
91 | #include "s2io-regs.h" | 89 | #include "s2io-regs.h" |
92 | 90 | ||
93 | #define DRV_VERSION "2.0.26.26" | 91 | #define DRV_VERSION "2.0.26.27" |
94 | 92 | ||
95 | /* S2io Driver name & version. */ | 93 | /* S2io Driver name & version. */ |
96 | static char s2io_driver_name[] = "Neterion"; | 94 | static char s2io_driver_name[] = "Neterion"; |
@@ -496,8 +494,6 @@ S2IO_PARM_INT(rxsync_frequency, 3); | |||
496 | /* Interrupt type. Values can be 0(INTA), 2(MSI_X) */ | 494 | /* Interrupt type. Values can be 0(INTA), 2(MSI_X) */ |
497 | S2IO_PARM_INT(intr_type, 2); | 495 | S2IO_PARM_INT(intr_type, 2); |
498 | /* Large receive offload feature */ | 496 | /* Large receive offload feature */ |
499 | static unsigned int lro_enable = 1; | ||
500 | module_param_named(lro, lro_enable, uint, 0); | ||
501 | 497 | ||
502 | /* Max pkts to be aggregated by LRO at one time. If not specified, | 498 | /* Max pkts to be aggregated by LRO at one time. If not specified, |
503 | * aggregation happens until we hit max IP pkt size(64K) | 499 | * aggregation happens until we hit max IP pkt size(64K) |
@@ -5124,8 +5120,6 @@ static void s2io_set_multicast(struct net_device *dev) | |||
5124 | /* Create the new Rx filter list and update the same in H/W. */ | 5120 | /* Create the new Rx filter list and update the same in H/W. */ |
5125 | i = 0; | 5121 | i = 0; |
5126 | netdev_for_each_mc_addr(ha, dev) { | 5122 | netdev_for_each_mc_addr(ha, dev) { |
5127 | memcpy(sp->usr_addrs[i].addr, ha->addr, | ||
5128 | ETH_ALEN); | ||
5129 | mac_addr = 0; | 5123 | mac_addr = 0; |
5130 | for (j = 0; j < ETH_ALEN; j++) { | 5124 | for (j = 0; j < ETH_ALEN; j++) { |
5131 | mac_addr |= ha->addr[j]; | 5125 | mac_addr |= ha->addr[j]; |
@@ -6735,13 +6729,10 @@ static int s2io_ethtool_set_flags(struct net_device *dev, u32 data) | |||
6735 | return -EINVAL; | 6729 | return -EINVAL; |
6736 | 6730 | ||
6737 | if (data & ETH_FLAG_LRO) { | 6731 | if (data & ETH_FLAG_LRO) { |
6738 | if (lro_enable) { | 6732 | if (!(dev->features & NETIF_F_LRO)) { |
6739 | if (!(dev->features & NETIF_F_LRO)) { | 6733 | dev->features |= NETIF_F_LRO; |
6740 | dev->features |= NETIF_F_LRO; | 6734 | changed = 1; |
6741 | changed = 1; | 6735 | } |
6742 | } | ||
6743 | } else | ||
6744 | rc = -EINVAL; | ||
6745 | } else if (dev->features & NETIF_F_LRO) { | 6736 | } else if (dev->features & NETIF_F_LRO) { |
6746 | dev->features &= ~NETIF_F_LRO; | 6737 | dev->features &= ~NETIF_F_LRO; |
6747 | changed = 1; | 6738 | changed = 1; |
@@ -6750,7 +6741,6 @@ static int s2io_ethtool_set_flags(struct net_device *dev, u32 data) | |||
6750 | if (changed && netif_running(dev)) { | 6741 | if (changed && netif_running(dev)) { |
6751 | s2io_stop_all_tx_queue(sp); | 6742 | s2io_stop_all_tx_queue(sp); |
6752 | s2io_card_down(sp); | 6743 | s2io_card_down(sp); |
6753 | sp->lro = !!(dev->features & NETIF_F_LRO); | ||
6754 | rc = s2io_card_up(sp); | 6744 | rc = s2io_card_up(sp); |
6755 | if (rc) | 6745 | if (rc) |
6756 | s2io_reset(sp); | 6746 | s2io_reset(sp); |
@@ -7307,7 +7297,7 @@ static int s2io_card_up(struct s2io_nic *sp) | |||
7307 | struct ring_info *ring = &mac_control->rings[i]; | 7297 | struct ring_info *ring = &mac_control->rings[i]; |
7308 | 7298 | ||
7309 | ring->mtu = dev->mtu; | 7299 | ring->mtu = dev->mtu; |
7310 | ring->lro = sp->lro; | 7300 | ring->lro = !!(dev->features & NETIF_F_LRO); |
7311 | ret = fill_rx_buffers(sp, ring, 1); | 7301 | ret = fill_rx_buffers(sp, ring, 1); |
7312 | if (ret) { | 7302 | if (ret) { |
7313 | DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n", | 7303 | DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n", |
@@ -7341,7 +7331,7 @@ static int s2io_card_up(struct s2io_nic *sp) | |||
7341 | /* Setting its receive mode */ | 7331 | /* Setting its receive mode */ |
7342 | s2io_set_multicast(dev); | 7332 | s2io_set_multicast(dev); |
7343 | 7333 | ||
7344 | if (sp->lro) { | 7334 | if (dev->features & NETIF_F_LRO) { |
7345 | /* Initialize max aggregatable pkts per session based on MTU */ | 7335 | /* Initialize max aggregatable pkts per session based on MTU */ |
7346 | sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu; | 7336 | sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu; |
7347 | /* Check if we can use (if specified) user provided value */ | 7337 | /* Check if we can use (if specified) user provided value */ |
@@ -7613,10 +7603,10 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7613 | * Packet with erroneous checksum, let the | 7603 | * Packet with erroneous checksum, let the |
7614 | * upper layers deal with it. | 7604 | * upper layers deal with it. |
7615 | */ | 7605 | */ |
7616 | skb->ip_summed = CHECKSUM_NONE; | 7606 | skb_checksum_none_assert(skb); |
7617 | } | 7607 | } |
7618 | } else | 7608 | } else |
7619 | skb->ip_summed = CHECKSUM_NONE; | 7609 | skb_checksum_none_assert(skb); |
7620 | 7610 | ||
7621 | swstats->mem_freed += skb->truesize; | 7611 | swstats->mem_freed += skb->truesize; |
7622 | send_up: | 7612 | send_up: |
@@ -7911,7 +7901,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7911 | else | 7901 | else |
7912 | sp->device_type = XFRAME_I_DEVICE; | 7902 | sp->device_type = XFRAME_I_DEVICE; |
7913 | 7903 | ||
7914 | sp->lro = lro_enable; | ||
7915 | 7904 | ||
7916 | /* Initialize some PCI/PCI-X fields of the NIC. */ | 7905 | /* Initialize some PCI/PCI-X fields of the NIC. */ |
7917 | s2io_init_pci(sp); | 7906 | s2io_init_pci(sp); |
@@ -8047,8 +8036,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8047 | dev->netdev_ops = &s2io_netdev_ops; | 8036 | dev->netdev_ops = &s2io_netdev_ops; |
8048 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 8037 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
8049 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 8038 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
8050 | if (lro_enable) | 8039 | dev->features |= NETIF_F_LRO; |
8051 | dev->features |= NETIF_F_LRO; | ||
8052 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; | 8040 | dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; |
8053 | if (sp->high_dma_flag == true) | 8041 | if (sp->high_dma_flag == true) |
8054 | dev->features |= NETIF_F_HIGHDMA; | 8042 | dev->features |= NETIF_F_HIGHDMA; |
@@ -8283,9 +8271,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8283 | dev->name); | 8271 | dev->name); |
8284 | } | 8272 | } |
8285 | 8273 | ||
8286 | if (sp->lro) | 8274 | DBG_PRINT(ERR_DBG, "%s: Large receive offload enabled\n", |
8287 | DBG_PRINT(ERR_DBG, "%s: Large receive offload enabled\n", | 8275 | dev->name); |
8288 | dev->name); | ||
8289 | if (ufo) | 8276 | if (ufo) |
8290 | DBG_PRINT(ERR_DBG, | 8277 | DBG_PRINT(ERR_DBG, |
8291 | "%s: UDP Fragmentation Offload(UFO) enabled\n", | 8278 | "%s: UDP Fragmentation Offload(UFO) enabled\n", |