netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <Dept_NX_Linux_NIC_Driver@qlogic.com>,
	Manish Chopra <manish.chopra@qlogic.com>
Subject: [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application
Date: Fri, 26 Apr 2013 08:09:38 -0400	[thread overview]
Message-ID: <1366978183-7282-3-git-send-email-shahed.shaikh@qlogic.com> (raw)
In-Reply-To: <1366978183-7282-1-git-send-email-shahed.shaikh@qlogic.com>

From: Manish Chopra <manish.chopra@qlogic.com>

o LRO was not getting disabled when disabling checksum offloads
  using QLogic application.
o LRO was not getting re-enabled while enabling checksum offloads
  back

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h      |    1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index ba3c72f..fe82fbf 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -896,6 +896,7 @@ struct qlcnic_ipaddr {
 #define QLCNIC_FW_RESET_OWNER		0x2000
 #define QLCNIC_FW_HANG			0x4000
 #define QLCNIC_FW_LRO_MSS_CAP		0x8000
+#define QLCNIC_LRO_WAS_ENABLED		0x20000
 #define QLCNIC_IS_MSI_FAMILY(adapter) \
 	((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
 
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 8f4ce11..e387bf8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -975,7 +975,7 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
 		struct qlcnic_esw_func_cfg *esw_cfg)
 {
 	struct net_device *netdev = adapter->netdev;
-	unsigned long features, vlan_features;
+	netdev_features_t features, vlan_features;
 
 	if (qlcnic_83xx_check(adapter))
 		return;
@@ -994,8 +994,14 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
 		features |= NETIF_F_LRO;
 
 	if (esw_cfg->offload_flags & BIT_0) {
-		netdev->features |= features;
 		adapter->rx_csum = 1;
+		if (adapter->flags & QLCNIC_LRO_WAS_ENABLED) {
+			if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED))
+				return;
+			netdev_info(netdev, "Enabling LRO as Rx checksum is on\n");
+			netdev->features |= NETIF_F_LRO;
+		}
+		netdev->features |= features;
 		if (!(esw_cfg->offload_flags & BIT_1)) {
 			netdev->features &= ~NETIF_F_TSO;
 			features &= ~NETIF_F_TSO;
@@ -1005,6 +1011,15 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
 			features &= ~NETIF_F_TSO6;
 		}
 	} else {
+		if (netdev->features & NETIF_F_LRO) {
+			if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_DISABLED))
+				return;
+
+			if (qlcnic_82xx_check(adapter))
+				qlcnic_send_lro_cleanup(adapter);
+			netdev_info(netdev, "Disabling LRO as rx_csum is off\n");
+			adapter->flags |= QLCNIC_LRO_WAS_ENABLED;
+		}
 		netdev->features &= ~features;
 		features &= ~features;
 		adapter->rx_csum = 0;
-- 
1.5.6

  parent reply	other threads:[~2013-04-26 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 1/7] qlcnic: Fix setting MAC address Shahed Shaikh
2013-04-26 12:09 ` Shahed Shaikh [this message]
2013-04-26 20:54   ` [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application Ben Hutchings
2013-04-26 12:09 ` [PATCH net 3/7] qlcnic: Fix ethtool strings Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 4/7] qlcnic: Fix missing bracket in module parameter Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 5/7] qlcnic: Fix ethtool Supported port status for 83xx Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout Shahed Shaikh
2013-04-26 21:01   ` Ben Hutchings
2013-04-27 19:08     ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 7/7] qlcnic: Fix bug in diagnostics test reset recovery path Shahed Shaikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366978183-7282-3-git-send-email-shahed.shaikh@qlogic.com \
    --to=shahed.shaikh@qlogic.com \
    --cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=manish.chopra@qlogic.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).