@@ -281,6 +281,10 @@ struct lan78xx_net {u32chipid;u32chiprev;structmii_bus*mdiobus;++intfc_autoneg;+u8fc_autoneg_control;+u8fc_request_control;};/* use ethtool to change the level for any given device */
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
Ben.
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
Ben.
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control) parameters
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
Woojung
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
Ben.
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control) parameters
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
No, get_pauseparam should return the same settings that were passed to
the last set_pauseparam.
Ben.
--
Ben Hutchings
Tomorrow will be cancelled due to lack of interest.
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control) parameters
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
No, get_pauseparam should return the same settings that were passed to
the last set_pauseparam.
Ben.
I used drivers/net/ethernet/intel/e1000e driver as reference.
It's implementation also returns status updated after autonegotiation.
Look into wrong one?
Woojung
From: Ben Hutchings <hidden> Date: 2016-02-19 01:21:05
On Fri, 2016-02-19 at 00:16 +0000, Woojung.Huh@microchip.com wrote:
quoted
quoted
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control) parameters
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
No, get_pauseparam should return the same settings that were passed to
the last set_pauseparam.
Ben.
I used drivers/net/ethernet/intel/e1000e driver as reference.
It's implementation also returns status updated after autonegotiation.
Look into wrong one?
Unfortunately the API has not always been clearly defined and there are
lots of bugs (or at least inconsistencies) in drivers. The comments in
include/uapi/linux/ethtool.h are supposed to be definitive; if they are
not clear then please suggest additional or alternative wording.
Ben.
--
Ben Hutchings
Tomorrow will be cancelled due to lack of interest.
-----Original Message-----
From: Ben Hutchings [mailto:ben@decadent.org.uk]
Sent: Thursday, February 18, 2016 8:21 PM
To: Woojung Huh - C21699; davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH V2 net-next 2/3] lan78xx: add ethtool set & get pause
functions
On Fri, 2016-02-19 at 00:16 +0000, Woojung.Huh@microchip.com wrote:
quoted
quoted
quoted
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control)
parameters
quoted
quoted
quoted
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
No, get_pauseparam should return the same settings that were passed
to
quoted
quoted
the last set_pauseparam.
Ben.
I used drivers/net/ethernet/intel/e1000e driver as reference.
It's implementation also returns status updated after autonegotiation.
Look into wrong one?
Unfortunately the API has not always been clearly defined and there are
lots of bugs (or at least inconsistencies) in drivers. The comments in
include/uapi/linux/ethtool.h are supposed to be definitive; if they are
not clear then please suggest additional or alternative wording.
I will update and repost it.
BTW, do you know which driver is implemented set/get_pauseparam() correctly?
Thanks.
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
What do you mean "return actual pause flags" when autoneg is enabled?
Pause flags set by (or default) advertise flag?
Thanks.
From: David Miller <davem@davemloft.net> Date: 2016-02-22 19:10:18
From: <Woojung.Huh@microchip.com>
Date: Mon, 22 Feb 2016 18:28:18 +0000
quoted
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
What do you mean "return actual pause flags" when autoneg is enabled?
Pause flags set by (or default) advertise flag?
It means what was negotiated by autonegotiation, and is actually in use.
Otherwise, how can the user find out what was negotiated?
From: Ben Hutchings <hidden> Date: 2016-02-22 20:05:35
On Mon, 2016-02-22 at 14:10 -0500, David Miller wrote:
From: <Woojung.Huh@microchip.com>
Date: Mon, 22 Feb 2016 18:28:18 +0000
quoted
quoted
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
What do you mean "return actual pause flags" when autoneg is enabled?
Pause flags set by (or default) advertise flag?
It means what was negotiated by autonegotiation, and is actually in use.
Otherwise, how can the user find out what was negotiated?
Well, actually we don't *directly* report the autonegotiation flow
control mode at present. We report which pause flags were advertised
and what the link partner advertised, from which you can work it out.
Perhaps ethtool (the utility) should explicitly show what the result
is.
Ben.
--
Ben Hutchings
The generation of random numbers is too important to be left to chance.
- Robert Coveyou
-----Original Message-----
From: Ben Hutchings [mailto:ben@decadent.org.uk]
Sent: Monday, February 22, 2016 3:05 PM
To: David Miller; Woojung Huh - C21699
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH V2 net-next 2/3] lan78xx: add ethtool set & get pause
functions
On Mon, 2016-02-22 at 14:10 -0500, David Miller wrote:
quoted
From: <Woojung.Huh@microchip.com>
Date: Mon, 22 Feb 2016 18:28:18 +0000
quoted
quoted
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
What do you mean "return actual pause flags" when autoneg is enabled?
Pause flags set by (or default) advertise flag?
It means what was negotiated by autonegotiation, and is actually in use.
Otherwise, how can the user find out what was negotiated?
Well, actually we don't *directly* report the autonegotiation flow
control mode at present. We report which pause flags were advertised
and what the link partner advertised, from which you can work it out.
NIC advertises pause flags via advertise register (phy reg 0x4) based on Rx & Tx flags,
and get_pauseparam() returns Rx & Tx flags set by set_pauseparm() if autonegotiation is enabled?
Perhaps ethtool (the utility) should explicitly show what the result
is.
Ethtool -a reports Rx/Tx flags and Rx/Tx negotiated flag based on advertising and lp_advertising value.
From: Ben Hutchings <hidden> Date: 2016-02-23 00:04:09
On Mon, 2016-02-22 at 20:28 +0000, Woojung.Huh@microchip.com wrote:
quoted
-----Original Message-----
From: Ben Hutchings [mailto:ben@decadent.org.uk]
Sent: Monday, February 22, 2016 3:05 PM
To: David Miller; Woojung Huh - C21699
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH V2 net-next 2/3] lan78xx: add ethtool set & get pause
functions
On Mon, 2016-02-22 at 14:10 -0500, David Miller wrote:
quoted
From: <Woojung.Huh@microchip.com>
Date: Mon, 22 Feb 2016 18:28:18 +0000
quoted
quoted
This is incorrect; you should always return the manual settings
(fc_request_control flags) here. If autonegotiation is enabled then
your get_settings function will return the actual pause flags.
What do you mean "return actual pause flags" when autoneg is enabled?
Pause flags set by (or default) advertise flag?
It means what was negotiated by autonegotiation, and is actually in use.
Otherwise, how can the user find out what was negotiated?
Well, actually we don't *directly* report the autonegotiation flow
control mode at present. We report which pause flags were advertised
and what the link partner advertised, from which you can work it out.
NIC advertises pause flags via advertise register (phy reg 0x4) based on Rx & Tx flags,
and get_pauseparam() returns Rx & Tx flags set by set_pauseparm() if autonegotiation is enabled?
Yes.
quoted
Perhaps ethtool (the utility) should explicitly show what the result
is.
Ethtool -a reports Rx/Tx flags and Rx/Tx negotiated flag based on advertising and lp_advertising value.
It would probably make sense to include the result of pause frame
autonegotiation in both the 'ethtool -a' and 'ethtool' (no option)
output.
Ben.
--
Ben Hutchings
The generation of random numbers is too important to be left to chance.
- Robert Coveyou