netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an
@ 2011-04-28  2:15 artpol
  0 siblings, 0 replies; 5+ messages in thread
From: artpol @ 2011-04-28  2:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: davem, bhutchings, netdev

Add support of pause frames advertise in mii_get_an. This provides all
drivers that use mii_ethtool_gset to represent their own and Link
partner flow control abilities in ethtool.

 Signed-off-by: Artem Polyakov <artpol84@gmail.com>

---

--- linux-2.6.38.4/drivers/net/mii.c.orig	2011-04-28 08:46:13.000000000
+0700
+++ linux-2.6.38.4/drivers/net/mii.c	2011-04-25 23:04:20.694981968 +0700
@@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info
 		result |= ADVERTISED_100baseT_Half;
 	if (advert & ADVERTISE_100FULL)
 		result |= ADVERTISED_100baseT_Full;
+	if (advert & ADVERTISE_PAUSE_CAP)
+		result |= ADVERTISED_Pause;
+	if (advert & ADVERTISE_PAUSE_ASYM)
+		result |= ADVERTISED_Asym_Pause;
 
 	return result;
 }

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

* [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an
@ 2011-04-28  3:49 artpol
  2011-04-28  4:49 ` Stephen Hemminger
  2011-04-29 20:57 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: artpol @ 2011-04-28  3:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: davem, bhutchings, netdev

Add support of pause frames advertise in mii_get_an. This provides all drivers 
that use mii_ethtool_gset to represent their own and Link partner flow control
abilities in ethtool.

Signed-off-by: Artem Polyakov <artpol84@gmail.com>

---

--- linux-2.6.38.4/drivers/net/mii.c.orig	2011-04-28 08:46:13.000000000 +0700
+++ linux-2.6.38.4/drivers/net/mii.c	2011-04-25 23:04:20.694981968 +0700
@@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info
 		result |= ADVERTISED_100baseT_Half;
 	if (advert & ADVERTISE_100FULL)
 		result |= ADVERTISED_100baseT_Full;
+	if (advert & ADVERTISE_PAUSE_CAP)
+		result |= ADVERTISED_Pause;
+	if (advert & ADVERTISE_PAUSE_ASYM)
+		result |= ADVERTISED_Asym_Pause;
 
 	return result;
 }

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

* Re: [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an
  2011-04-28  3:49 [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an artpol
@ 2011-04-28  4:49 ` Stephen Hemminger
  2011-04-28 12:45   ` Ben Hutchings
  2011-04-29 20:57 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2011-04-28  4:49 UTC (permalink / raw)
  To: artpol; +Cc: linux-kernel, davem, bhutchings, netdev

On Thu, 28 Apr 2011 10:49:14 +0700
artpol <artpol84@gmail.com> wrote:

> Add support of pause frames advertise in mii_get_an. This provides all drivers 
> that use mii_ethtool_gset to represent their own and Link partner flow control
> abilities in ethtool.
> 
> Signed-off-by: Artem Polyakov <artpol84@gmail.com>
> 
> ---
> 
> --- linux-2.6.38.4/drivers/net/mii.c.orig	2011-04-28 08:46:13.000000000 +0700
> +++ linux-2.6.38.4/drivers/net/mii.c	2011-04-25 23:04:20.694981968 +0700
> @@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info
>  		result |= ADVERTISED_100baseT_Half;
>  	if (advert & ADVERTISE_100FULL)
>  		result |= ADVERTISED_100baseT_Full;
> +	if (advert & ADVERTISE_PAUSE_CAP)
> +		result |= ADVERTISED_Pause;
> +	if (advert & ADVERTISE_PAUSE_ASYM)
> +		result |= ADVERTISED_Asym_Pause;
>  
>  	return result;
>  }

One common driver problem is that auto negotiation of pause
is really a separate operation from negotiation of speed.
It should be possible to force no flow-control but still negotiate
speed and vice-versa.  The ethtool api breaks this into two operations
but many drivers munge them together.

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

* Re: [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an
  2011-04-28  4:49 ` Stephen Hemminger
@ 2011-04-28 12:45   ` Ben Hutchings
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2011-04-28 12:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: artpol, linux-kernel, davem, netdev

On Wed, 2011-04-27 at 21:49 -0700, Stephen Hemminger wrote:
> On Thu, 28 Apr 2011 10:49:14 +0700
> artpol <artpol84@gmail.com> wrote:
> 
> > Add support of pause frames advertise in mii_get_an. This provides all drivers 
> > that use mii_ethtool_gset to represent their own and Link partner flow control
> > abilities in ethtool.
> > 
> > Signed-off-by: Artem Polyakov <artpol84@gmail.com>
> > 
> > ---
> > 
> > --- linux-2.6.38.4/drivers/net/mii.c.orig	2011-04-28 08:46:13.000000000 +0700
> > +++ linux-2.6.38.4/drivers/net/mii.c	2011-04-25 23:04:20.694981968 +0700
> > @@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info
> >  		result |= ADVERTISED_100baseT_Half;
> >  	if (advert & ADVERTISE_100FULL)
> >  		result |= ADVERTISED_100baseT_Full;
> > +	if (advert & ADVERTISE_PAUSE_CAP)
> > +		result |= ADVERTISED_Pause;
> > +	if (advert & ADVERTISE_PAUSE_ASYM)
> > +		result |= ADVERTISED_Asym_Pause;
> >  
> >  	return result;
> >  }
> 
> One common driver problem is that auto negotiation of pause
> is really a separate operation from negotiation of speed.
> It should be possible to force no flow-control but still negotiate
> speed and vice-versa.

If you want to force flow control then turn off pause autoneg.
If you want to force speed then turn off advertising of other speeds.

> The ethtool api breaks this into two operations
> but many drivers munge them together.

There is some interaction between set_pauseparam and set_settings if
pause autoneg is enabled, which is why we have the
mii_advertise_flowctrl() function.

Anyway, this patch covers reporting only.

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] 5+ messages in thread

* Re: [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an
  2011-04-28  3:49 [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an artpol
  2011-04-28  4:49 ` Stephen Hemminger
@ 2011-04-29 20:57 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2011-04-29 20:57 UTC (permalink / raw)
  To: artpol84; +Cc: linux-kernel, bhutchings, netdev

From: artpol <artpol84@gmail.com>
Date: Thu, 28 Apr 2011 10:49:14 +0700

> Add support of pause frames advertise in mii_get_an. This provides all drivers 
> that use mii_ethtool_gset to represent their own and Link partner flow control
> abilities in ethtool.
> 
> Signed-off-by: Artem Polyakov <artpol84@gmail.com>

Applied, thanks.

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28  3:49 [PATCH 2.6.38.4] mii: add support of pause frames in mii_get_an artpol
2011-04-28  4:49 ` Stephen Hemminger
2011-04-28 12:45   ` Ben Hutchings
2011-04-29 20:57 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-04-28  2:15 artpol

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