From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 2/3] net: dsa: allow DSA switch drivers to provide their own phylink mac ops
Date: Tue, 9 Apr 2024 19:22:13 +0100 [thread overview]
Message-ID: <ZhWHVc/bhaC/rYq7@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240409165230.eznwc4opf3mq7qkl@skbuf>
On Tue, Apr 09, 2024 at 07:52:30PM +0300, Vladimir Oltean wrote:
> On Tue, Apr 09, 2024 at 05:29:23PM +0100, Russell King (Oracle) wrote:
> > This changes the logic - it allows driver authors to provide the
> > MAC operations, omit the mac_link_down() op _and_ an
> > ops->phylink_mac_link_down() function. This could lead to buggy
> > drivers since this will only happen in this path and none of the
> > others.
> >
> > I want this to be an "either provide phylink_mac_ops, and thus
> > none of the phylink_mac_* ops in dsa_switch_ops will be called" or
> > "don't provide phylink_mac_ops and the phylink_mac_* ops in
> > dsa_switch_ops will be called". It's then completely clear cut
> > that it's one or the other, whereas the code above makes it
> > unclear.
>
> If you want for the API transition to be self-documenting and clear,
> it would be good to do that validation separately and more comprehensively
> rather than just a fall-through for one single operation here.
>
> If phylink_mac_link_ops is provided, the following ds->ops methods are
> obsoleted and can't be provided at the same time (fail probing otherwise):
>
> - phylink_mac_select_pcs()
> - phylink_mac_prepare()
> - phylink_mac_config()
> - phylink_mac_finish()
> - phylink_mac_link_down()
> - phylink_mac_link_up()
>
> Hopefully it makes it more clear that the following are _not_ obsoleted
> by the dedicated phylink mac_ops:
>
> - phylink_get_caps()
> - phylink_fixed_state()
>
> Then (after this validation), the simplified
> "if (ops && ops->mac_link_down) else (ds->ops->phylink_mac_link_down)"
> would be equivalent, because we've errored out on the case which has a
> mix of old and new API.
Okay. However, I can't predict when I'll get around to doing these
changes as my time is very limited over this week and next week - so
may be right before the merge window is due.
Maybe we should've done that for the ops->adjust_link vs
ops->phylink_mac_link_down/ops->phylink_mac_link_up as well.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-04-09 18:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 11:19 [PATCH net-next 0/3] net: dsa: allow phylink_mac_ops in DSA drivers Russell King (Oracle)
2024-04-08 11:19 ` [PATCH net-next 1/3] net: dsa: introduce dsa_phylink_to_port() Russell King (Oracle)
2024-04-08 23:41 ` Andrew Lunn
2024-04-08 23:50 ` Florian Fainelli
2024-04-08 11:19 ` [PATCH net-next 2/3] net: dsa: allow DSA switch drivers to provide their own phylink mac ops Russell King (Oracle)
2024-04-08 23:45 ` Andrew Lunn
2024-04-08 23:51 ` Florian Fainelli
2024-04-09 3:15 ` kernel test robot
2024-04-09 8:04 ` Russell King (Oracle)
2024-04-09 12:37 ` Vladimir Oltean
2024-04-09 15:33 ` Vladimir Oltean
2024-04-09 16:29 ` Russell King (Oracle)
2024-04-09 16:52 ` Vladimir Oltean
2024-04-09 18:22 ` Russell King (Oracle) [this message]
2024-04-08 11:19 ` [PATCH net-next 3/3] net: dsa: mv88e6xxx: provide own phylink MAC operations Russell King (Oracle)
2024-04-08 23:45 ` Andrew Lunn
2024-04-08 23:51 ` Florian Fainelli
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=ZhWHVc/bhaC/rYq7@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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).