From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next 07/11] net: dsa: mv88e6xxx: add port link setter
Date: Thu, 3 Nov 2016 00:05:17 +0100 [thread overview]
Message-ID: <20161102230517.GK384@lunn.ch> (raw)
In-Reply-To: <8760o55x9j.fsf@ketchup.i-did-not-set--mail-host-address--so-tickle-me>
> Do you expect to return an error if adjust_link is called with
> phydev->duplex == DUPLEX_UNKNOWN, or, do you expect to fallback to
> unforced duplex when setting such value?
ethtool(1) itself does not allow you to specify "unknown". It only
allows "full" or "half". So passing DUPLEX_UNKNOWN means using the API
directly. The core ethtool code does not sanity check the request, so
will pass on DUPLEX_UNKNOWN to the drivers.
A quick search of the drivers, 99% seem to ignore DUPLEX_UNKNOWN. The
1% is bnx2x, which has:
/* If received a request for an unknown duplex, assume full*/
if (cmd->duplex == DUPLEX_UNKNOWN)
cmd->duplex = DUPLEX_FULL;
I personally would return -EINVAL, since it is unclear what
DUPLEX_UNKNOWN means. It could be argued that falling back to Half is
correct, since failed autoneg generally results in 10/Half. Every
Ethernet can do that, where as a device needs to be 25 years or
younger to support Full :-)
Andrew
next prev parent reply other threads:[~2016-11-02 23:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-01 3:20 [PATCH net-next 00/11] net: dsa: mv88e6xxx: refine port operations Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 01/11] net: dsa: mv88e6xxx: add port files Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 02/11] net: dsa: mv88e6xxx: add port state setter Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 03/11] net: dsa: mv88e6xxx: add port vlan map setter Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 04/11] net: dsa: mv88e6xxx: add port FID accessors Vivien Didelot
2016-11-01 9:38 ` Andrew Lunn
2016-11-02 1:01 ` Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 05/11] net: dsa: mv88e6xxx: add port PVID accessors Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 06/11] net: dsa: mv88e6xxx: add port 802.1Q mode setter Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 07/11] net: dsa: mv88e6xxx: add port link setter Vivien Didelot
2016-11-01 9:43 ` Andrew Lunn
2016-11-02 1:07 ` Vivien Didelot
2016-11-02 9:16 ` Andrew Lunn
2016-11-02 22:31 ` Vivien Didelot
2016-11-02 23:05 ` Andrew Lunn [this message]
2016-11-01 3:20 ` [PATCH net-next 08/11] net: dsa: mv88e6xxx: add port duplex setter Vivien Didelot
2016-11-01 9:44 ` Andrew Lunn
2016-11-02 1:12 ` Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 09/11] net: dsa: mv88e6xxx: add port's RGMII delay setter Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 10/11] net: dsa: mv88e6xxx: add port's MAC speed setter Vivien Didelot
2016-11-01 3:20 ` [PATCH net-next 11/11] net: dsa: mv88e6xxx: setup port's MAC Vivien Didelot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161102230517.GK384@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).