From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "Allan W. Nielsen" <allan.nielsen@microsemi.com>,
netdev@vger.kernel.org, raju.lakkaraju@microsemi.com
Subject: Re: [PATCH net-next 1/3] ethtool: (uapi) Add ETHTOOL_PHY_LOOPBACK to PHY tunables
Date: Tue, 29 Nov 2016 01:46:53 +0100 [thread overview]
Message-ID: <20161129004653.GA24782@lunn.ch> (raw)
In-Reply-To: <fabb91cd-9fc5-d935-727e-ff57e441e919@gmail.com>
> > If you really do what to do this, you should look at NETIF_F_LOOPBACK
> > and consider how this concept can be applied at the PHY, not the MAC.
> > But you need the full concept, so you see things like:
> >
> > 2: eth0: <LOOPBACK,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
> > link/ether 80:ee:73:83:60:27 brd ff:ff:ff:ff:ff:ff
> >
> > Humm, i've no idea how you actually enable the MAC loopback
> > NETIF_F_LOOPBACK represents. I don't see anything with ip link set.
>
> I am afraid you lost me on this, NETIF_F_LOOPBACK is a netdev_features_t
> bit, so it tells ethtool that this is a potential feature to be turned
> on with ethtool -K <iface>.
Yep, i'm talking rubbish after jumping to a wrong conclusion.
> The semantics of this loopack feature are
> not defined AFAICT, but a reasonable behavior from the driver is to put
> itself in a mode where packets send by a socket-level application are
> looped through the Ethernet adapter itself. Whether this happens at the
> DMA level, the MII signals, or somewhere in the PHY, is driver specific
> unfortunately.
Yes, the interesting one might be forcedeth which writes to the PHY
BMCR_LOOPBACK | BMCR_FULLDPLX | BMCR_SPEED1000;
when the NETIF_F_LOOPBACK feature is set.
Maybe this could be generalised and made available for all MACs which
don't support MAC loopback?
What needs considering is the correct duplex and speed. We need to
ensure the MAC and PHY agree on this.
> Now, there is another way to toggle a loopback for a given Ethernet
> adapter which is to actually set IFF_LOOPBACK in dev->flags for this
> interface. Some drivers seem to be able to properly react to that as
> well, although I see no way this can be done looking at the iproute2 or
> ifconfig man pages..
I prefer this one, since i expect this will set LOOPBACK in
2: eth0: <LOOPBACK,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
making it lot more obvious something funny is going on.
Andrew
next prev parent reply other threads:[~2016-11-29 0:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 13:24 [PATCH net-next 0/3] Adding PHY Loopback tunable Allan W. Nielsen
2016-11-28 13:24 ` [PATCH net-next 1/3] ethtool: (uapi) Add ETHTOOL_PHY_LOOPBACK to PHY tunables Allan W. Nielsen
2016-11-28 14:14 ` Andrew Lunn
2016-11-28 17:59 ` Florian Fainelli
2016-11-28 19:23 ` Allan W. Nielsen
2016-11-28 20:21 ` Andrew Lunn
2016-11-28 21:01 ` Florian Fainelli
2016-11-29 0:46 ` Andrew Lunn [this message]
2016-11-29 15:32 ` Allan W. Nielsen
2016-11-28 13:24 ` [PATCH net-next 2/3] ethtool: Core impl for ETHTOOL_PHY_LOOPBACK tunable Allan W. Nielsen
2016-11-28 13:24 ` [PATCH net-next 3/3] net: phy: Add Loopback support in Microsemi PHYs driver Allan W. Nielsen
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=20161129004653.GA24782@lunn.ch \
--to=andrew@lunn.ch \
--cc=allan.nielsen@microsemi.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=raju.lakkaraju@microsemi.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).