diff options
author | Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> | 2010-08-16 20:34:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 06:59:49 -0400 |
commit | 24763d80fbb45aaf477d53c2203c929f6c41b5fc (patch) | |
tree | 1d1ae83c08b04b3f22153bfc1a611ce3511c7638 | |
parent | 8dec32cc421864702912c4341934fe0c737a9798 (diff) |
qlcnic: turn off lro when rxcsum is disabled.
o Also dont allow lro to be turn on, if rx csum is disabled
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ethtool.c | 23 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 2 |
3 files changed, 25 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 7f4e11bd4cd4..f6b887d409d5 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -894,6 +894,7 @@ struct qlcnic_mac_req { | |||
894 | #define QLCNIC_MSI_ENABLED 0x02 | 894 | #define QLCNIC_MSI_ENABLED 0x02 |
895 | #define QLCNIC_MSIX_ENABLED 0x04 | 895 | #define QLCNIC_MSIX_ENABLED 0x04 |
896 | #define QLCNIC_LRO_ENABLED 0x08 | 896 | #define QLCNIC_LRO_ENABLED 0x08 |
897 | #define QLCNIC_LRO_DISABLED 0x00 | ||
897 | #define QLCNIC_BRIDGE_ENABLED 0X10 | 898 | #define QLCNIC_BRIDGE_ENABLED 0X10 |
898 | #define QLCNIC_DIAG_ENABLED 0x20 | 899 | #define QLCNIC_DIAG_ENABLED 0x20 |
899 | #define QLCNIC_ESWITCH_ENABLED 0x40 | 900 | #define QLCNIC_ESWITCH_ENABLED 0x40 |
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c index 3d4655dce4b5..e38fc3d96d43 100644 --- a/drivers/net/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/qlcnic/qlcnic_ethtool.c | |||
@@ -818,7 +818,21 @@ static u32 qlcnic_get_rx_csum(struct net_device *dev) | |||
818 | static int qlcnic_set_rx_csum(struct net_device *dev, u32 data) | 818 | static int qlcnic_set_rx_csum(struct net_device *dev, u32 data) |
819 | { | 819 | { |
820 | struct qlcnic_adapter *adapter = netdev_priv(dev); | 820 | struct qlcnic_adapter *adapter = netdev_priv(dev); |
821 | |||
822 | if (!!data) { | ||
823 | adapter->rx_csum = !!data; | ||
824 | return 0; | ||
825 | } | ||
826 | |||
827 | if (adapter->flags & QLCNIC_LRO_ENABLED) { | ||
828 | if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_DISABLED)) | ||
829 | return -EIO; | ||
830 | |||
831 | dev->features &= ~NETIF_F_LRO; | ||
832 | qlcnic_send_lro_cleanup(adapter); | ||
833 | } | ||
821 | adapter->rx_csum = !!data; | 834 | adapter->rx_csum = !!data; |
835 | dev_info(&adapter->pdev->dev, "disabling LRO as rx_csum is off\n"); | ||
822 | return 0; | 836 | return 0; |
823 | } | 837 | } |
824 | 838 | ||
@@ -1001,6 +1015,15 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data) | |||
1001 | if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)) | 1015 | if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)) |
1002 | return -EINVAL; | 1016 | return -EINVAL; |
1003 | 1017 | ||
1018 | if (!adapter->rx_csum) { | ||
1019 | dev_info(&adapter->pdev->dev, "rx csum is off, " | ||
1020 | "cannot toggle lro\n"); | ||
1021 | return -EINVAL; | ||
1022 | } | ||
1023 | |||
1024 | if ((data & ETH_FLAG_LRO) && (adapter->flags & QLCNIC_LRO_ENABLED)) | ||
1025 | return 0; | ||
1026 | |||
1004 | if (data & ETH_FLAG_LRO) { | 1027 | if (data & ETH_FLAG_LRO) { |
1005 | hw_lro = QLCNIC_LRO_ENABLED; | 1028 | hw_lro = QLCNIC_LRO_ENABLED; |
1006 | netdev->features |= NETIF_F_LRO; | 1029 | netdev->features |= NETIF_F_LRO; |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index bf4077a1e824..abd7cd6db6fd 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -995,7 +995,7 @@ __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) | |||
995 | 995 | ||
996 | qlcnic_config_intr_coalesce(adapter); | 996 | qlcnic_config_intr_coalesce(adapter); |
997 | 997 | ||
998 | if (adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO) | 998 | if (netdev->features & NETIF_F_LRO) |
999 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); | 999 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); |
1000 | 1000 | ||
1001 | qlcnic_napi_enable(adapter); | 1001 | qlcnic_napi_enable(adapter); |