All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement
@ 2013-04-05 12:36 Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 1/4] netxen_nic: Fix mismatched board type error Manish Chopra
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Manish Chopra @ 2013-04-05 12:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

Please apply this patch series to net-next.

Thanks,
Manish

Manish Chopra (4):
  netxen_nic: Fix mismatched board type error
  netxen_nic: Log driver version with firmware version
  netxen_nic: Add module parameters support to switch interrupts
  netxen_nic: Bump up the version to 4.0.81

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

* [PATCH net-next 1/4] netxen_nic: Fix mismatched board type error
  2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
@ 2013-04-05 12:36 ` Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 2/4] netxen_nic: Log driver version with firmware version Manish Chopra
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Manish Chopra @ 2013-04-05 12:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

o Display unknown board name and serial number
  in case of mismatched board type

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

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index 322a36b..e5ab1ec 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1855,7 +1855,7 @@ static const struct netxen_brdinfo netxen_boards[] = {
 
 #define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards)
 
-static inline void get_brd_name_by_type(u32 type, char *name)
+static inline int netxen_nic_get_brd_name_by_type(u32 type, char *name)
 {
 	int i, found = 0;
 	for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) {
@@ -1864,10 +1864,14 @@ static inline void get_brd_name_by_type(u32 type, char *name)
 			found = 1;
 			break;
 		}
+	}
 
+	if (!found) {
+		strcpy(name, "Unknown");
+		return -EINVAL;
 	}
-	if (!found)
-		name = "Unknown";
+
+	return 0;
 }
 
 static inline u32 netxen_tx_avail(struct nx_host_tx_ring *tx_ring)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 7867aeb..6049637 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -841,7 +841,9 @@ netxen_check_options(struct netxen_adapter *adapter)
 	}
 
 	if (adapter->portnum == 0) {
-		get_brd_name_by_type(adapter->ahw.board_type, brd_name);
+		if (netxen_nic_get_brd_name_by_type(adapter->ahw.board_type,
+						    brd_name))
+			strcpy(serial_num, "Unknown");
 
 		pr_info("%s: %s Board S/N %s  Chip rev 0x%x\n",
 				module_name(THIS_MODULE),
-- 
1.5.6

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

* [PATCH net-next 2/4] netxen_nic: Log driver version with firmware version
  2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 1/4] netxen_nic: Fix mismatched board type error Manish Chopra
@ 2013-04-05 12:36 ` Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 3/4] netxen_nic: Add module parameters support to switch interrupts Manish Chopra
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Manish Chopra @ 2013-04-05 12:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 6049637..cde5109 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -862,9 +862,9 @@ netxen_check_options(struct netxen_adapter *adapter)
 		adapter->ahw.cut_through = (i & 0x8000) ? 1 : 0;
 	}
 
-	dev_info(&pdev->dev, "firmware v%d.%d.%d [%s]\n",
-			fw_major, fw_minor, fw_build,
-			adapter->ahw.cut_through ? "cut-through" : "legacy");
+	dev_info(&pdev->dev, "Driver v%s, firmware v%d.%d.%d [%s]\n",
+		 NETXEN_NIC_LINUX_VERSIONID, fw_major, fw_minor, fw_build,
+		 adapter->ahw.cut_through ? "cut-through" : "legacy");
 
 	if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222))
 		adapter->capabilities = NXRD32(adapter, CRB_FW_CAPABILITIES_1);
-- 
1.5.6

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

* [PATCH net-next 3/4] netxen_nic: Add module parameters support to switch interrupts
  2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 1/4] netxen_nic: Fix mismatched board type error Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 2/4] netxen_nic: Log driver version with firmware version Manish Chopra
@ 2013-04-05 12:36 ` Manish Chopra
  2013-04-05 12:36 ` [PATCH net-next 4/4] netxen_nic: Bump up the version to 4.0.81 Manish Chopra
  2013-04-07 20:53 ` [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Manish Chopra @ 2013-04-05 12:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

o Adapters do not support co-existence of legacy Interrupt with
  MSI-X or MSI among multiple functions. Prevent attaching
  to a function during normal load, if MSI-x or MSI vectors are not available.

o Using use_msi=0 and use_msi_x=0 module parameters driver can be loaded in
  legacy mode as well as in MSI mode for all functions in the adapter.

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |   34 +++++++++++++-------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index cde5109..ff113e7 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -52,9 +52,13 @@ static int port_mode = NETXEN_PORT_MODE_AUTO_NEG;
 /* Default to restricted 1G auto-neg mode */
 static int wol_port_mode = 5;
 
-static int use_msi = 1;
+static int netxen_use_msi = 1;
+MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled)");
+module_param_named(use_msi, netxen_use_msi, int, 0444);
 
-static int use_msi_x = 1;
+static int netxen_use_msi_x = 1;
+MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled)");
+module_param_named(use_msi_x, netxen_use_msi_x, int, 0444);
 
 static int auto_fw_reset = AUTO_FW_RESET_ENABLED;
 module_param(auto_fw_reset, int, 0644);
@@ -592,8 +596,7 @@ static const struct net_device_ops netxen_netdev_ops = {
 #endif
 };
 
-static void
-netxen_setup_intr(struct netxen_adapter *adapter)
+static int netxen_setup_intr(struct netxen_adapter *adapter)
 {
 	struct netxen_legacy_intr_set *legacy_intrp;
 	struct pci_dev *pdev = adapter->pdev;
@@ -644,7 +647,7 @@ netxen_setup_intr(struct netxen_adapter *adapter)
 				adapter->max_sds_rings = num_msix;
 
 			dev_info(&pdev->dev, "using msi-x interrupts\n");
-			return;
+			return err;
 		}
 
 		if (err > 0)
@@ -653,17 +656,21 @@ netxen_setup_intr(struct netxen_adapter *adapter)
 		/* fall through for msi */
 	}
 
-	if (use_msi && !pci_enable_msi(pdev)) {
+	if (netxen_use_msi && !pci_enable_msi(pdev)) {
 		adapter->flags |= NETXEN_NIC_MSI_ENABLED;
 		adapter->tgt_status_reg = netxen_get_ioaddr(adapter,
 				msi_tgt_status[adapter->ahw.pci_func]);
 		dev_info(&pdev->dev, "using msi interrupts\n");
 		adapter->msix_entries[0].vector = pdev->irq;
-		return;
+		return 0;
 	}
 
+	if (netxen_use_msi || netxen_use_msi_x)
+		return -EOPNOTSUPP;
+
 	dev_info(&pdev->dev, "using legacy interrupts\n");
 	adapter->msix_entries[0].vector = pdev->irq;
+	return 0;
 }
 
 static void
@@ -879,8 +886,8 @@ netxen_check_options(struct netxen_adapter *adapter)
 
 	adapter->msix_supported = 0;
 	if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
-		adapter->msix_supported = !!use_msi_x;
-		adapter->rss_supported = !!use_msi_x;
+		adapter->msix_supported = !!netxen_use_msi_x;
+		adapter->rss_supported = !!netxen_use_msi_x;
 	} else {
 		u32 flashed_ver = 0;
 		netxen_rom_fast_read(adapter,
@@ -891,8 +898,8 @@ netxen_check_options(struct netxen_adapter *adapter)
 			switch (adapter->ahw.board_type) {
 			case NETXEN_BRDTYPE_P2_SB31_10G:
 			case NETXEN_BRDTYPE_P2_SB31_10G_CX4:
-				adapter->msix_supported = !!use_msi_x;
-				adapter->rss_supported = !!use_msi_x;
+				adapter->msix_supported = !!netxen_use_msi_x;
+				adapter->rss_supported = !!netxen_use_msi_x;
 				break;
 			default:
 				break;
@@ -1510,7 +1517,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	netxen_nic_clear_stats(adapter);
 
-	netxen_setup_intr(adapter);
+	if (netxen_setup_intr(adapter)) {
+		dev_err(&adapter->pdev->dev, "failed to setup interrupts\n");
+		goto err_out_decr_ref;
+	}
 
 	err = netxen_setup_netdev(adapter, netdev);
 	if (err)
-- 
1.5.6

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

* [PATCH net-next 4/4] netxen_nic: Bump up the version to 4.0.81
  2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
                   ` (2 preceding siblings ...)
  2013-04-05 12:36 ` [PATCH net-next 3/4] netxen_nic: Add module parameters support to switch interrupts Manish Chopra
@ 2013-04-05 12:36 ` Manish Chopra
  2013-04-07 20:53 ` [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Manish Chopra @ 2013-04-05 12:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index e5ab1ec..3fe09ab 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 80
-#define NETXEN_NIC_LINUX_VERSIONID  "4.0.80"
+#define _NETXEN_NIC_LINUX_SUBVERSION 81
+#define NETXEN_NIC_LINUX_VERSIONID  "4.0.81"
 
 #define NETXEN_VERSION_CODE(a, b, c)	(((a) << 24) + ((b) << 16) + (c))
 #define _major(v)	(((v) >> 24) & 0xff)
-- 
1.5.6

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

* Re: [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement
  2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
                   ` (3 preceding siblings ...)
  2013-04-05 12:36 ` [PATCH net-next 4/4] netxen_nic: Bump up the version to 4.0.81 Manish Chopra
@ 2013-04-07 20:53 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-04-07 20:53 UTC (permalink / raw)
  To: manish.chopra; +Cc: netdev, rajesh.borundia, Dept_NX_Linux_NIC_Driver

From: Manish Chopra <manish.chopra@qlogic.com>
Date: Fri,  5 Apr 2013 08:36:39 -0400

>   netxen_nic: Add module parameters support to switch interrupts

I'm not letting you add more module parameters to this driver,
sorry.

You guys really have to define reasonable infrastructure for
these sorts of interrupt configurations that all drivers use.

It must be a facility which uses a reasonable configuration mechanism,
which can be standardized across all drivers.

Module parameters do not meet those requirements.

I've rejected this entire patch series, you'll need to resubmit
it without the module parameter change.

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

end of thread, other threads:[~2013-04-07 20:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-05 12:36 [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement Manish Chopra
2013-04-05 12:36 ` [PATCH net-next 1/4] netxen_nic: Fix mismatched board type error Manish Chopra
2013-04-05 12:36 ` [PATCH net-next 2/4] netxen_nic: Log driver version with firmware version Manish Chopra
2013-04-05 12:36 ` [PATCH net-next 3/4] netxen_nic: Add module parameters support to switch interrupts Manish Chopra
2013-04-05 12:36 ` [PATCH net-next 4/4] netxen_nic: Bump up the version to 4.0.81 Manish Chopra
2013-04-07 20:53 ` [PATCH net-next 0/4] netxen_nic: Bug fixes and enhancement David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.