Skip to contentSkip to conversation

mii: add support of pause frames in mii_get_an

PATCH Applied artpol 4 participants 4 messages Apr 28, 2011 – Apr 29, 2011

Subsystems (2)
lore
Share & tools
lore

artpol

author
#0 lore raw

PATCH 1/1 mii: add support of pause frames in mii_get_an

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.

---

drivers/net/mii.c renamed from drivers/net/mii.c.orig +4 -0
@@ -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;
 }
#1 lore raw
Quoted 11 lines · On Thu, 28 Apr 2011 10:49:14 +0700 artpol <[email protected]> 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.

---

drivers/net/mii.c static u32 mii_get_an(struct mii_if_info · line 58

Quoted 10 lines
drivers/net/mii.c renamed from drivers/net/mii.c.orig +4 -0
@@ -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.

#2 lore raw
Quoted 22 lines · Stephen Hemminger
Quoted 19 lines · On Thu, 28 Apr 2011 10:49:14 +0700 artpol <[email protected]> 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.

---

drivers/net/mii.c renamed from drivers/net/mii.c.orig +4 -0
@@ -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;
 
Quoted 7 lines

drivers/net/mii.c static u32 mii_get_an(struct mii_if_info · line 58

Quoted 2 lines
drivers/net/mii.c renamed from drivers/net/mii.c.orig +0 -0
 	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.

Quoted 2 lines

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.

Signature · 3 lines
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.