netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] netxen: Fixes
@ 2011-09-19 18:49 Rajesh Borundia
  2011-09-19 18:49 ` [PATCH net-next 1/2] netxen: Fix vhdr_len in case of non vlan packets Rajesh Borundia
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rajesh Borundia @ 2011-09-19 18:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko

Please Apply it to net-next tree.

Thanks
Rajesh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] netxen: Fix vhdr_len in case of non vlan packets.
  2011-09-19 18:49 [PATCH 0/2] netxen: Fixes Rajesh Borundia
@ 2011-09-19 18:49 ` Rajesh Borundia
  2011-09-19 18:49 ` [PATCH net-next 2/2] netxen: Add pcie workaround Rajesh Borundia
  2011-09-20 18:57 ` [PATCH 0/2] netxen: Fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Rajesh Borundia @ 2011-09-19 18:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko

o Set vlan header length to zero.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_init.c   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index d6c6357..a8259cc 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -1620,7 +1620,7 @@ netxen_process_lro(struct netxen_adapter *adapter,
 	int index;
 	u16 lro_length, length, data_offset;
 	u32 seq_number;
-	u8 vhdr_len;
+	u8 vhdr_len = 0;
 
 	if (unlikely(ring > adapter->max_rds_rings))
 		return NULL;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] netxen: Add pcie workaround
  2011-09-19 18:49 [PATCH 0/2] netxen: Fixes Rajesh Borundia
  2011-09-19 18:49 ` [PATCH net-next 1/2] netxen: Fix vhdr_len in case of non vlan packets Rajesh Borundia
@ 2011-09-19 18:49 ` Rajesh Borundia
  2011-09-20 18:57 ` [PATCH 0/2] netxen: Fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Rajesh Borundia @ 2011-09-19 18:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko

o A performance drop was seen with firmware loaded
from flash. This workaround fixes it.
o Updated driver version to 4.0.77

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h    |    4 +-
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |   63 +++++++++++++++++++-
 2 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index 196b660..a876dff 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -53,8 +53,8 @@
 
 #define _NETXEN_NIC_LINUX_MAJOR 4
 #define _NETXEN_NIC_LINUX_MINOR 0
-#define _NETXEN_NIC_LINUX_SUBVERSION 76
-#define NETXEN_NIC_LINUX_VERSIONID  "4.0.76"
+#define _NETXEN_NIC_LINUX_SUBVERSION 77
+#define NETXEN_NIC_LINUX_VERSIONID  "4.0.77"
 
 #define NETXEN_VERSION_CODE(a, b, c)	(((a) << 24) + ((b) << 16) + (c))
 #define _major(v)	(((v) >> 24) & 0xff)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index de18e47..82626d6 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -400,6 +400,63 @@ static void netxen_set_port_mode(struct netxen_adapter *adapter)
 	}
 }
 
+#define PCI_CAP_ID_GEN  0x10
+
+static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
+{
+	u32 pdevfuncsave;
+	u32 c8c9value = 0;
+	u32 chicken = 0;
+	u32 control = 0;
+	int i, pos;
+	struct pci_dev *pdev;
+
+	pdev = adapter->pdev;
+
+	chicken = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_CHICKEN3));
+	/* clear chicken3.25:24 */
+	chicken &= 0xFCFFFFFF;
+	/*
+	 * if gen1 and B0, set F1020 - if gen 2, do nothing
+	 * if gen2 set to F1000
+	 */
+	pos = pci_find_capability(pdev, PCI_CAP_ID_GEN);
+	if (pos == 0xC0) {
+		pci_read_config_dword(pdev, pos + 0x10, &control);
+		if ((control & 0x000F0000) != 0x00020000) {
+			/*  set chicken3.24 if gen1 */
+			chicken |= 0x01000000;
+		}
+		dev_info(&adapter->pdev->dev, "Gen2 strapping detected\n");
+		c8c9value = 0xF1000;
+	} else {
+		/* set chicken3.24 if gen1 */
+		chicken |= 0x01000000;
+		dev_info(&adapter->pdev->dev, "Gen1 strapping detected\n");
+		if (adapter->ahw.revision_id == NX_P3_B0)
+			c8c9value = 0xF1020;
+		else
+			c8c9value = 0;
+	}
+
+	NXWR32(adapter, NETXEN_PCIE_REG(PCIE_CHICKEN3), chicken);
+
+	if (!c8c9value)
+		return;
+
+	pdevfuncsave = pdev->devfn;
+	if (pdevfuncsave & 0x07)
+		return;
+
+	for (i = 0; i < 8; i++) {
+		pci_read_config_dword(pdev, pos + 8, &control);
+		pci_read_config_dword(pdev, pos + 8, &control);
+		pci_write_config_dword(pdev, pos + 8, c8c9value);
+		pdev->devfn++;
+	}
+	pdev->devfn = pdevfuncsave;
+}
+
 static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
 {
 	u32 control;
@@ -867,7 +924,7 @@ netxen_start_firmware(struct netxen_adapter *adapter)
 	if (err < 0)
 		goto err_out;
 	if (err == 0)
-		goto wait_init;
+		goto pcie_strap_init;
 
 	if (first_boot != 0x55555555) {
 		NXWR32(adapter, CRB_CMDPEG_STATE, 0);
@@ -910,6 +967,10 @@ netxen_start_firmware(struct netxen_adapter *adapter)
 		| (_NETXEN_NIC_LINUX_SUBVERSION);
 	NXWR32(adapter, CRB_DRIVER_VERSION, val);
 
+pcie_strap_init:
+	if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+		netxen_pcie_strap_init(adapter);
+
 wait_init:
 	/* Handshake with the card before we register the devices. */
 	err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] netxen: Fixes
  2011-09-19 18:49 [PATCH 0/2] netxen: Fixes Rajesh Borundia
  2011-09-19 18:49 ` [PATCH net-next 1/2] netxen: Fix vhdr_len in case of non vlan packets Rajesh Borundia
  2011-09-19 18:49 ` [PATCH net-next 2/2] netxen: Add pcie workaround Rajesh Borundia
@ 2011-09-20 18:57 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-09-20 18:57 UTC (permalink / raw)
  To: rajesh.borundia; +Cc: netdev, ameen.rahman, sony.chacko

From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Mon, 19 Sep 2011 11:49:50 -0700

> Please Apply it to net-next tree.

Both patches applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-20 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-19 18:49 [PATCH 0/2] netxen: Fixes Rajesh Borundia
2011-09-19 18:49 ` [PATCH net-next 1/2] netxen: Fix vhdr_len in case of non vlan packets Rajesh Borundia
2011-09-19 18:49 ` [PATCH net-next 2/2] netxen: Add pcie workaround Rajesh Borundia
2011-09-20 18:57 ` [PATCH 0/2] netxen: Fixes David Miller

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).