netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] netxen: explicity handle pause autoneg parameter
@ 2012-10-26 17:17 Flavio Leitner
  2012-10-26 21:10 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Flavio Leitner @ 2012-10-26 17:17 UTC (permalink / raw)
  To: netdev; +Cc: Sony Chacko, Rajesh Borundia, Flavio Leitner

The hardware doesn't support controlling pause frames autoneg, so
report that back correctly to userspace.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 6 ++++++
 1 file changed, 6 insertions(+)

I don't have the hardware handy to test this, so I appreciate
if someone could do it.

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index 10468e7..b4b46f9 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -488,6 +488,8 @@ netxen_nic_get_pauseparam(struct net_device *dev,
 	__u32 val;
 	int port = adapter->physical_port;
 
+	pause->autoneg = AUTONEG_DISABLE;
+
 	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
 		if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))
 			return;
@@ -532,6 +534,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
 	struct netxen_adapter *adapter = netdev_priv(dev);
 	__u32 val;
 	int port = adapter->physical_port;
+
+	if (pause->autoneg)
+		return -EOPNOTSUPP;
+
 	/* read mode */
 	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
 		if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))
-- 
1.7.11.4

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

* Re: [PATCH net-next] netxen: explicity handle pause autoneg parameter
  2012-10-26 17:17 [PATCH net-next] netxen: explicity handle pause autoneg parameter Flavio Leitner
@ 2012-10-26 21:10 ` Ben Hutchings
  2012-10-27  0:37   ` Flavio Leitner
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2012-10-26 21:10 UTC (permalink / raw)
  To: Flavio Leitner; +Cc: netdev, Sony Chacko, Rajesh Borundia

On Fri, 2012-10-26 at 15:17 -0200, Flavio Leitner wrote:
> The hardware doesn't support controlling pause frames autoneg, so
> report that back correctly to userspace.
> 
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
> ---
>  drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> I don't have the hardware handy to test this, so I appreciate
> if someone could do it.
> 
> diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> index 10468e7..b4b46f9 100644
> --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> @@ -488,6 +488,8 @@ netxen_nic_get_pauseparam(struct net_device *dev,
>  	__u32 val;
>  	int port = adapter->physical_port;
>  
> +	pause->autoneg = AUTONEG_DISABLE;

AUTONEG_DISABLE is really meant for use in ethtool_cmd::autoneg, not
ethtool_pauseparam::autoneg.  (Though they are both really booleans so
this works in practice.)

>  	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
>  		if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))
>  			return;
> @@ -532,6 +534,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
>  	struct netxen_adapter *adapter = netdev_priv(dev);
>  	__u32 val;
>  	int port = adapter->physical_port;
> +
> +	if (pause->autoneg)
> +		return -EOPNOTSUPP;

Should be -EINVAL; the operation (ETHTOOL_SPAUSEPARAM) is supported but
not these particular arguments.

Ben.

>  	/* read mode */
>  	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
>  		if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))

-- 
Ben Hutchings, Staff 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] 3+ messages in thread

* Re: [PATCH net-next] netxen: explicity handle pause autoneg parameter
  2012-10-26 21:10 ` Ben Hutchings
@ 2012-10-27  0:37   ` Flavio Leitner
  0 siblings, 0 replies; 3+ messages in thread
From: Flavio Leitner @ 2012-10-27  0:37 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, Sony Chacko, Rajesh Borundia

On Fri, 26 Oct 2012 22:10:42 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Fri, 2012-10-26 at 15:17 -0200, Flavio Leitner wrote:
> > The hardware doesn't support controlling pause frames autoneg, so
> > report that back correctly to userspace.
> > 
> > Signed-off-by: Flavio Leitner <fbl@redhat.com>
> > ---
> >  drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > I don't have the hardware handy to test this, so I appreciate
> > if someone could do it.
> > 
> > diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> > index 10468e7..b4b46f9 100644
> > --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> > +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
> > @@ -488,6 +488,8 @@ netxen_nic_get_pauseparam(struct net_device *dev,
> >  	__u32 val;
> >  	int port = adapter->physical_port;
> >  
> > +	pause->autoneg = AUTONEG_DISABLE;
> 
> AUTONEG_DISABLE is really meant for use in ethtool_cmd::autoneg, not
> ethtool_pauseparam::autoneg.  (Though they are both really booleans so
> this works in practice.)

I saw few places using it. I will change to 0 instead, though as the
meaning for both use-cases are the same (auto negotiation being enabled or
disabled) and probably won't change, maybe we could just share.
 
> >  	if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
> >  		if ((port < 0) || (port >= NETXEN_NIU_MAX_GBE_PORTS))
> >  			return;
> > @@ -532,6 +534,10 @@ netxen_nic_set_pauseparam(struct net_device *dev,
> >  	struct netxen_adapter *adapter = netdev_priv(dev);
> >  	__u32 val;
> >  	int port = adapter->physical_port;
> > +
> > +	if (pause->autoneg)
> > +		return -EOPNOTSUPP;
> 
> Should be -EINVAL; the operation (ETHTOOL_SPAUSEPARAM) is supported but
> not these particular arguments.

agree, fixing on v2.
thanks,
fbl

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

end of thread, other threads:[~2012-10-27  0:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-26 17:17 [PATCH net-next] netxen: explicity handle pause autoneg parameter Flavio Leitner
2012-10-26 21:10 ` Ben Hutchings
2012-10-27  0:37   ` Flavio Leitner

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