Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ifconfig xx0 -mediaopt flowcontrol (was Re: disabling mediaopts for if_wm(4))

 Hi, all.

 Currently, (almost?) all Ethernet driver can't disable flow control

	ifconfig xxN -mediaopt flowcontrol

FreeBSD has the same problem.

Flow control stuff can be separated into three different parts:

	A) interface (UI, API) to control Ethernet interface

	B) Autonego

		0) Set PHY's auto negotiation advertise register's
		flow bits first.

		1) and then, do autonego

	C) set MAC

		Check link partner's advertise bit from B-1's result
		and set MAC registers correctly.
 B) and C) works on wm(4) and ixg(4) now. Problem"s" are in A).

 A few years ago, I noticed that I can't change flow control setting
of wm(4) via ifconfig(8). And then, I added some printf()s to track
the problem. One of the problem is that the second argument of ifmedia_init().
Almost all driver has no IFM_ETH_FMASK in the second argument.
Another problem is in ifmedia_match(). I forgot the detail, but
the problem was caused by not passing flowcontrol media mask into
each driver correctly. See also PR#48950

 For ixg(4), it has a special sysctl to change the setting

% sysctl hw.ixg0.fc
hw.ixg0.fc = 3
% sysctl -d hw.ixg0.fc
Set flow control mode using these values:
        0 - off
        1 - rx pause
        2 - tx pause
        3 - tx and rx pause

                SAITOH Masanobu (

Home | Main Index | Thread Index | Old Index