aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajesh Borundia <Rajesh.Borundia@qlogic.com>2011-04-01 10:28:31 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-06 15:47:13 -0400
commitb56421d0b7527f8ecea3de030cf508468fdc9ba1 (patch)
treead983757c4a7517c91cdeb30e827ad364dd3ce33
parentf8d54811cb125094769704722e4eda6610339b92 (diff)
qlcnic: Fix LRO disable
o In dev->open LRO was enabled by default, enable it depending upon netdev->features , kernel may have disabled it. o Configure LRO when interface is up. Signed-off-by: Rajesh Borundia <Rajesh.Borundia@qlogic.com> Signed-off-by: Anirban Chakraborty <Anirban.Chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c26
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c6
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c3
3 files changed, 24 insertions, 11 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 24a79a6fc73..6be4d5a26c7 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -998,22 +998,28 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
998 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO)) 998 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
999 return -EINVAL; 999 return -EINVAL;
1000 1000
1001 if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)) 1001 if (data & ETH_FLAG_LRO) {
1002 return -EINVAL;
1003 1002
1004 if (!adapter->rx_csum) { 1003 if (netdev->features & NETIF_F_LRO)
1005 dev_info(&adapter->pdev->dev, "rx csum is off, " 1004 return 0;
1006 "cannot toggle lro\n");
1007 return -EINVAL;
1008 }
1009 1005
1010 if ((data & ETH_FLAG_LRO) && (netdev->features & NETIF_F_LRO)) 1006 if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
1011 return 0; 1007 return -EINVAL;
1008
1009 if (!adapter->rx_csum) {
1010 dev_info(&adapter->pdev->dev, "rx csum is off, "
1011 "cannot toggle lro\n");
1012 return -EINVAL;
1013 }
1012 1014
1013 if (data & ETH_FLAG_LRO) {
1014 hw_lro = QLCNIC_LRO_ENABLED; 1015 hw_lro = QLCNIC_LRO_ENABLED;
1015 netdev->features |= NETIF_F_LRO; 1016 netdev->features |= NETIF_F_LRO;
1017
1016 } else { 1018 } else {
1019
1020 if (!(netdev->features & NETIF_F_LRO))
1021 return 0;
1022
1017 hw_lro = 0; 1023 hw_lro = 0;
1018 netdev->features &= ~NETIF_F_LRO; 1024 netdev->features &= ~NETIF_F_LRO;
1019 } 1025 }
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index 3901be85dca..498cca92126 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -566,6 +566,9 @@ int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
566 u64 word; 566 u64 word;
567 int rv; 567 int rv;
568 568
569 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
570 return 0;
571
569 memset(&req, 0, sizeof(struct qlcnic_nic_req)); 572 memset(&req, 0, sizeof(struct qlcnic_nic_req));
570 573
571 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23); 574 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
@@ -711,6 +714,9 @@ int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter)
711 u64 word; 714 u64 word;
712 int rv; 715 int rv;
713 716
717 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
718 return 0;
719
714 memset(&req, 0, sizeof(struct qlcnic_nic_req)); 720 memset(&req, 0, sizeof(struct qlcnic_nic_req));
715 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23); 721 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
716 722
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 8bf9a968f7f..7f9edb2f147 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -773,7 +773,8 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
773 features |= (NETIF_F_TSO | NETIF_F_TSO6); 773 features |= (NETIF_F_TSO | NETIF_F_TSO6);
774 vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6); 774 vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6);
775 } 775 }
776 if (adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO) 776
777 if (netdev->features & NETIF_F_LRO)
777 features |= NETIF_F_LRO; 778 features |= NETIF_F_LRO;
778 779
779 if (esw_cfg->offload_flags & BIT_0) { 780 if (esw_cfg->offload_flags & BIT_0) {