netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-11  9:50 [PATCH NEXT 0/2]nexten: bug fixes Amit Kumar Salecha
@ 2011-03-11  9:50 ` Amit Kumar Salecha
  2011-03-14 22:15   ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Amit Kumar Salecha @ 2011-03-11  9:50 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

o Allow setting speed and auto negotiation parameters for GbE ports.
o Log an error message to indicate duplex setting is not supported in
  the hardware currently.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/netxen/netxen_nic.h         |    6 ++-
 drivers/net/netxen/netxen_nic_ctx.c     |   15 +++++++
 drivers/net/netxen/netxen_nic_ethtool.c |   69 ++++++++++--------------------
 3 files changed, 43 insertions(+), 47 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index a113805..d7299f1 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -739,7 +739,8 @@ struct netxen_recv_context {
 #define NX_CDRP_CMD_READ_PEXQ_PARAMETERS	0x0000001c
 #define NX_CDRP_CMD_GET_LIC_CAPABILITIES	0x0000001d
 #define NX_CDRP_CMD_READ_MAX_LRO_PER_BOARD	0x0000001e
-#define NX_CDRP_CMD_MAX				0x0000001f
+#define NX_CDRP_CMD_CONFIG_GBE_PORT		0x0000001f
+#define NX_CDRP_CMD_MAX				0x00000020
 
 #define NX_RCODE_SUCCESS		0
 #define NX_RCODE_NO_HOST_MEM		1
@@ -1054,6 +1055,7 @@ typedef struct {
 #define NX_FW_CAPABILITY_BDG			(1 << 8)
 #define NX_FW_CAPABILITY_FVLANTX		(1 << 9)
 #define NX_FW_CAPABILITY_HW_LRO			(1 << 10)
+#define NX_FW_CAPABILITY_GBE_LINK_CFG		(1 << 11)
 
 /* module types */
 #define LINKEVENT_MODULE_NOT_PRESENT			1
@@ -1349,6 +1351,8 @@ void netxen_advert_link_change(struct netxen_adapter *adapter, int linkup);
 void netxen_pci_camqm_read_2M(struct netxen_adapter *, u64, u64 *);
 void netxen_pci_camqm_write_2M(struct netxen_adapter *, u64, u64);
 
+int nx_fw_cmd_set_gbe_port(struct netxen_adapter *adapter,
+				u32 speed, u32 duplex, u32 autoneg);
 int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu);
 int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu);
 int netxen_config_hw_lro(struct netxen_adapter *adapter, int enable);
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index f7d06cb..f16966a 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -112,6 +112,21 @@ nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu)
 	return 0;
 }
 
+int
+nx_fw_cmd_set_gbe_port(struct netxen_adapter *adapter,
+			u32 speed, u32 duplex, u32 autoneg)
+{
+
+	return netxen_issue_cmd(adapter,
+				adapter->ahw.pci_func,
+				NXHAL_VERSION,
+				speed,
+				duplex,
+				autoneg,
+				NX_CDRP_CMD_CONFIG_GBE_PORT);
+
+}
+
 static int
 nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 {
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 587498e..481f331 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -214,7 +214,6 @@ skip:
 			check_sfp_module = netif_running(dev) &&
 				adapter->has_link_events;
 		} else {
-			ecmd->autoneg = AUTONEG_ENABLE;
 			ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg);
 			ecmd->advertising |=
 				(ADVERTISED_TP | ADVERTISED_Autoneg);
@@ -252,53 +251,31 @@ static int
 netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
 	struct netxen_adapter *adapter = netdev_priv(dev);
-	__u32 status;
+	int ret;
 
-	/* read which mode */
-	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
-		/* autonegotiation */
-		if (adapter->phy_write &&
-		    adapter->phy_write(adapter,
-				       NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
-				       ecmd->autoneg) != 0)
-			return -EIO;
-		else
-			adapter->link_autoneg = ecmd->autoneg;
+	if (adapter->ahw.port_type != NETXEN_NIC_GBE)
+		return -EOPNOTSUPP;
 
-		if (adapter->phy_read &&
-		    adapter->phy_read(adapter,
-				      NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
-				      &status) != 0)
-			return -EIO;
+	if (!(adapter->capabilities & NX_FW_CAPABILITY_GBE_LINK_CFG)) {
+		netdev_info(dev, "Firmware upgrade required to "
+				"support this operation\n");
+		return -EOPNOTSUPP;
+	}
 
-		/* speed */
-		switch (ecmd->speed) {
-		case SPEED_10:
-			netxen_set_phy_speed(status, 0);
-			break;
-		case SPEED_100:
-			netxen_set_phy_speed(status, 1);
-			break;
-		case SPEED_1000:
-			netxen_set_phy_speed(status, 2);
-			break;
-		}
-		/* set duplex mode */
-		if (ecmd->duplex == DUPLEX_HALF)
-			netxen_clear_phy_duplex(status);
-		if (ecmd->duplex == DUPLEX_FULL)
-			netxen_set_phy_duplex(status);
-		if (adapter->phy_write &&
-		    adapter->phy_write(adapter,
-				       NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
-				       *((int *)&status)) != 0)
-			return -EIO;
-		else {
-			adapter->link_speed = ecmd->speed;
-			adapter->link_duplex = ecmd->duplex;
-		}
-	} else
+	ret = nx_fw_cmd_set_gbe_port(adapter, ecmd->speed, ecmd->duplex,
+				     ecmd->autoneg);
+	if (ret == NX_RCODE_NOT_SUPPORTED && ecmd->duplex == DUPLEX_HALF) {
+		netdev_info(dev, "Speed and autoneg mode settings supported, "
+			    "half duplex mode not supported\n");
 		return -EOPNOTSUPP;
+	} else if (ret) {
+		netdev_info(dev, "Setting speed, duplex or autoneg failed\n");
+		return -EIO;
+	}
+
+	adapter->link_speed = ecmd->speed;
+	adapter->link_duplex = ecmd->duplex;
+	adapter->link_autoneg = ecmd->autoneg;
 
 	if (!netif_running(dev))
 		return 0;
-- 
1.6.3.3


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

* [PATCH NEXT 0/2]nexten: bug fixes
@ 2011-03-11 10:44 Amit Kumar Salecha
  2011-03-11 10:44 ` [PATCH NEXT 1/2] netxen: Notify firmware of Flex-10 interface down Amit Kumar Salecha
  2011-03-11 10:44 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
  0 siblings, 2 replies; 10+ messages in thread
From: Amit Kumar Salecha @ 2011-03-11 10:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty


Hi
  Series of 2 bug fixes, please apply them on net-next branch.

Thanks
-Amit

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

* [PATCH NEXT 1/2] netxen: Notify firmware of Flex-10 interface down
  2011-03-11 10:44 [PATCH NEXT 0/2]nexten: bug fixes Amit Kumar Salecha
@ 2011-03-11 10:44 ` Amit Kumar Salecha
  2011-03-11 10:44 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
  1 sibling, 0 replies; 10+ messages in thread
From: Amit Kumar Salecha @ 2011-03-11 10:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

Notify firmware when a Flex-10 interface is brought down
so that virtual connect manager can display the correct link status.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/netxen/netxen_nic_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 33fac32..83348dc 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1032,6 +1032,9 @@ __netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
 	netif_carrier_off(netdev);
 	netif_tx_disable(netdev);
 
+	if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION)
+		netxen_linkevent_request(adapter, 0);
+
 	if (adapter->stop_port)
 		adapter->stop_port(adapter);
 
-- 
1.6.3.3


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

* [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-11 10:44 [PATCH NEXT 0/2]nexten: bug fixes Amit Kumar Salecha
  2011-03-11 10:44 ` [PATCH NEXT 1/2] netxen: Notify firmware of Flex-10 interface down Amit Kumar Salecha
@ 2011-03-11 10:44 ` Amit Kumar Salecha
  2011-04-11 22:56   ` Ben Hutchings
  1 sibling, 1 reply; 10+ messages in thread
From: Amit Kumar Salecha @ 2011-03-11 10:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

o Allow setting speed and auto negotiation parameters for GbE ports.
o Log an error message to indicate duplex setting is not supported in
  the hardware currently.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/netxen/netxen_nic.h         |    6 ++-
 drivers/net/netxen/netxen_nic_ctx.c     |   15 +++++++
 drivers/net/netxen/netxen_nic_ethtool.c |   69 ++++++++++--------------------
 3 files changed, 43 insertions(+), 47 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index a113805..d7299f1 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -739,7 +739,8 @@ struct netxen_recv_context {
 #define NX_CDRP_CMD_READ_PEXQ_PARAMETERS	0x0000001c
 #define NX_CDRP_CMD_GET_LIC_CAPABILITIES	0x0000001d
 #define NX_CDRP_CMD_READ_MAX_LRO_PER_BOARD	0x0000001e
-#define NX_CDRP_CMD_MAX				0x0000001f
+#define NX_CDRP_CMD_CONFIG_GBE_PORT		0x0000001f
+#define NX_CDRP_CMD_MAX				0x00000020
 
 #define NX_RCODE_SUCCESS		0
 #define NX_RCODE_NO_HOST_MEM		1
@@ -1054,6 +1055,7 @@ typedef struct {
 #define NX_FW_CAPABILITY_BDG			(1 << 8)
 #define NX_FW_CAPABILITY_FVLANTX		(1 << 9)
 #define NX_FW_CAPABILITY_HW_LRO			(1 << 10)
+#define NX_FW_CAPABILITY_GBE_LINK_CFG		(1 << 11)
 
 /* module types */
 #define LINKEVENT_MODULE_NOT_PRESENT			1
@@ -1349,6 +1351,8 @@ void netxen_advert_link_change(struct netxen_adapter *adapter, int linkup);
 void netxen_pci_camqm_read_2M(struct netxen_adapter *, u64, u64 *);
 void netxen_pci_camqm_write_2M(struct netxen_adapter *, u64, u64);
 
+int nx_fw_cmd_set_gbe_port(struct netxen_adapter *adapter,
+				u32 speed, u32 duplex, u32 autoneg);
 int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu);
 int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu);
 int netxen_config_hw_lro(struct netxen_adapter *adapter, int enable);
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index f7d06cb..f16966a 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -112,6 +112,21 @@ nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu)
 	return 0;
 }
 
+int
+nx_fw_cmd_set_gbe_port(struct netxen_adapter *adapter,
+			u32 speed, u32 duplex, u32 autoneg)
+{
+
+	return netxen_issue_cmd(adapter,
+				adapter->ahw.pci_func,
+				NXHAL_VERSION,
+				speed,
+				duplex,
+				autoneg,
+				NX_CDRP_CMD_CONFIG_GBE_PORT);
+
+}
+
 static int
 nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 {
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 587498e..481f331 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -214,7 +214,6 @@ skip:
 			check_sfp_module = netif_running(dev) &&
 				adapter->has_link_events;
 		} else {
-			ecmd->autoneg = AUTONEG_ENABLE;
 			ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg);
 			ecmd->advertising |=
 				(ADVERTISED_TP | ADVERTISED_Autoneg);
@@ -252,53 +251,31 @@ static int
 netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
 	struct netxen_adapter *adapter = netdev_priv(dev);
-	__u32 status;
+	int ret;
 
-	/* read which mode */
-	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
-		/* autonegotiation */
-		if (adapter->phy_write &&
-		    adapter->phy_write(adapter,
-				       NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
-				       ecmd->autoneg) != 0)
-			return -EIO;
-		else
-			adapter->link_autoneg = ecmd->autoneg;
+	if (adapter->ahw.port_type != NETXEN_NIC_GBE)
+		return -EOPNOTSUPP;
 
-		if (adapter->phy_read &&
-		    adapter->phy_read(adapter,
-				      NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
-				      &status) != 0)
-			return -EIO;
+	if (!(adapter->capabilities & NX_FW_CAPABILITY_GBE_LINK_CFG)) {
+		netdev_info(dev, "Firmware upgrade required to "
+				"support this operation\n");
+		return -EOPNOTSUPP;
+	}
 
-		/* speed */
-		switch (ecmd->speed) {
-		case SPEED_10:
-			netxen_set_phy_speed(status, 0);
-			break;
-		case SPEED_100:
-			netxen_set_phy_speed(status, 1);
-			break;
-		case SPEED_1000:
-			netxen_set_phy_speed(status, 2);
-			break;
-		}
-		/* set duplex mode */
-		if (ecmd->duplex == DUPLEX_HALF)
-			netxen_clear_phy_duplex(status);
-		if (ecmd->duplex == DUPLEX_FULL)
-			netxen_set_phy_duplex(status);
-		if (adapter->phy_write &&
-		    adapter->phy_write(adapter,
-				       NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
-				       *((int *)&status)) != 0)
-			return -EIO;
-		else {
-			adapter->link_speed = ecmd->speed;
-			adapter->link_duplex = ecmd->duplex;
-		}
-	} else
+	ret = nx_fw_cmd_set_gbe_port(adapter, ecmd->speed, ecmd->duplex,
+				     ecmd->autoneg);
+	if (ret == NX_RCODE_NOT_SUPPORTED && ecmd->duplex == DUPLEX_HALF) {
+		netdev_info(dev, "Speed and autoneg mode settings supported, "
+			    "half duplex mode not supported\n");
 		return -EOPNOTSUPP;
+	} else if (ret) {
+		netdev_info(dev, "Setting speed, duplex or autoneg failed\n");
+		return -EIO;
+	}
+
+	adapter->link_speed = ecmd->speed;
+	adapter->link_duplex = ecmd->duplex;
+	adapter->link_autoneg = ecmd->autoneg;
 
 	if (!netif_running(dev))
 		return 0;
-- 
1.6.3.3


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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-11  9:50 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
@ 2011-03-14 22:15   ` David Miller
  2011-03-14 22:30     ` Ben Hutchings
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2011-03-14 22:15 UTC (permalink / raw)
  To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty, sony.chacko

From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Fri, 11 Mar 2011 01:50:03 -0800

> From: Sony Chacko <sony.chacko@qlogic.com>
> 
> o Allow setting speed and auto negotiation parameters for GbE ports.
> o Log an error message to indicate duplex setting is not supported in
>   the hardware currently.
> 
> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

The kernel log is not the place to transmit this information.

Please work with Ben Hutchings who is working for ways to report
this to the user in the proper location, via ethtool.

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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-14 22:15   ` David Miller
@ 2011-03-14 22:30     ` Ben Hutchings
  2011-03-14 22:32       ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Hutchings @ 2011-03-14 22:30 UTC (permalink / raw)
  To: David Miller
  Cc: amit.salecha, netdev, ameen.rahman, anirban.chakraborty,
	sony.chacko

On Mon, 2011-03-14 at 15:15 -0700, David Miller wrote:
> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> Date: Fri, 11 Mar 2011 01:50:03 -0800
> 
> > From: Sony Chacko <sony.chacko@qlogic.com>
> > 
> > o Allow setting speed and auto negotiation parameters for GbE ports.
> > o Log an error message to indicate duplex setting is not supported in
> >   the hardware currently.
> > 
> > Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> > Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
> 
> The kernel log is not the place to transmit this information.
> 
> Please work with Ben Hutchings who is working for ways to report
> this to the user in the proper location, via ethtool.

I am?  Well, patches welcome, at least.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-14 22:30     ` Ben Hutchings
@ 2011-03-14 22:32       ` David Miller
  2011-03-14 22:44         ` Ben Hutchings
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2011-03-14 22:32 UTC (permalink / raw)
  To: bhutchings
  Cc: amit.salecha, netdev, ameen.rahman, anirban.chakraborty,
	sony.chacko

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 14 Mar 2011 22:30:22 +0000

> On Mon, 2011-03-14 at 15:15 -0700, David Miller wrote:
>> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
>> Date: Fri, 11 Mar 2011 01:50:03 -0800
>> 
>> > From: Sony Chacko <sony.chacko@qlogic.com>
>> > 
>> > o Allow setting speed and auto negotiation parameters for GbE ports.
>> > o Log an error message to indicate duplex setting is not supported in
>> >   the hardware currently.
>> > 
>> > Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
>> > Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
>> 
>> The kernel log is not the place to transmit this information.
>> 
>> Please work with Ben Hutchings who is working for ways to report
>> this to the user in the proper location, via ethtool.
> 
> I am?  Well, patches welcome, at least.

You were discussing a scheme, I think with Intel folks, about letting
such changes through then making ethtool re-read the settings and see
which changes were not integrated by the driver.

Then you'd emit a diagnostic from ethtool over stderr to report any
such discrepencies.

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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-14 22:32       ` David Miller
@ 2011-03-14 22:44         ` Ben Hutchings
  2011-03-14 22:54           ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Hutchings @ 2011-03-14 22:44 UTC (permalink / raw)
  To: David Miller
  Cc: amit.salecha, netdev, ameen.rahman, anirban.chakraborty,
	sony.chacko

On Mon, 2011-03-14 at 15:32 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Mon, 14 Mar 2011 22:30:22 +0000
> 
> > On Mon, 2011-03-14 at 15:15 -0700, David Miller wrote:
> >> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> >> Date: Fri, 11 Mar 2011 01:50:03 -0800
> >> 
> >> > From: Sony Chacko <sony.chacko@qlogic.com>
> >> > 
> >> > o Allow setting speed and auto negotiation parameters for GbE ports.
> >> > o Log an error message to indicate duplex setting is not supported in
> >> >   the hardware currently.
> >> > 
> >> > Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> >> > Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
> >> 
> >> The kernel log is not the place to transmit this information.
> >> 
> >> Please work with Ben Hutchings who is working for ways to report
> >> this to the user in the proper location, via ethtool.
> > 
> > I am?  Well, patches welcome, at least.
> 
> You were discussing a scheme, I think with Intel folks, about letting
> such changes through then making ethtool re-read the settings and see
> which changes were not integrated by the driver.
> 
> Then you'd emit a diagnostic from ethtool over stderr to report any
> such discrepencies.

Only for offload settings, where the API makes it clear which flags the
user is deliberately setting and the kernel or driver can reasonably fix
up others.  For link settings, that isn't clear, and drivers should
simply reject invalid combinations.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-14 22:44         ` Ben Hutchings
@ 2011-03-14 22:54           ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2011-03-14 22:54 UTC (permalink / raw)
  To: bhutchings
  Cc: amit.salecha, netdev, ameen.rahman, anirban.chakraborty,
	sony.chacko

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 14 Mar 2011 22:44:08 +0000

> For link settings, that isn't clear, and drivers should simply
> reject invalid combinations.

Ok, makes sense.

Amit please update your patch to silently reject link setting attempts
that are unsupported by the device.

Thanks.

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

* Re: [PATCH NEXT 2/2] netxen: support for GbE port settings
  2011-03-11 10:44 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
@ 2011-04-11 22:56   ` Ben Hutchings
  0 siblings, 0 replies; 10+ messages in thread
From: Ben Hutchings @ 2011-04-11 22:56 UTC (permalink / raw)
  To: Amit Kumar Salecha
  Cc: davem, netdev, ameen.rahman, anirban.chakraborty, Sony Chacko

On Fri, 2011-03-11 at 02:44 -0800, Amit Kumar Salecha wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
> 
> o Allow setting speed and auto negotiation parameters for GbE ports.
> o Log an error message to indicate duplex setting is not supported in
>   the hardware currently.
[...]
> +	ret = nx_fw_cmd_set_gbe_port(adapter, ecmd->speed, ecmd->duplex,
> +				     ecmd->autoneg);
> +	if (ret == NX_RCODE_NOT_SUPPORTED && ecmd->duplex == DUPLEX_HALF) {
> +		netdev_info(dev, "Speed and autoneg mode settings supported, "
> +			    "half duplex mode not supported\n");
>  		return -EOPNOTSUPP;
[...]

Should be -EINVAL.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

end of thread, other threads:[~2011-04-11 22:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 10:44 [PATCH NEXT 0/2]nexten: bug fixes Amit Kumar Salecha
2011-03-11 10:44 ` [PATCH NEXT 1/2] netxen: Notify firmware of Flex-10 interface down Amit Kumar Salecha
2011-03-11 10:44 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
2011-04-11 22:56   ` Ben Hutchings
  -- strict thread matches above, loose matches on Subject: below --
2011-03-11  9:50 [PATCH NEXT 0/2]nexten: bug fixes Amit Kumar Salecha
2011-03-11  9:50 ` [PATCH NEXT 2/2] netxen: support for GbE port settings Amit Kumar Salecha
2011-03-14 22:15   ` David Miller
2011-03-14 22:30     ` Ben Hutchings
2011-03-14 22:32       ` David Miller
2011-03-14 22:44         ` Ben Hutchings
2011-03-14 22:54           ` 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).