From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: javen <javen_xu@realsil.com.cn>,
hkallweit1@gmail.com, nic_swsd@realtek.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
daniel@makrotopia.org, linux@armlinux.org.uk,
enelsonmoore@gmail.com, daniel@thingy.jp
Subject: Re: [PATCH net-next v5 2/8] net: phy: phylink: add helper to modify pause
Date: Tue, 7 Jul 2026 13:10:03 +0200 [thread overview]
Message-ID: <a5dcf2a7-8291-4ac9-bbf4-513b43524f10@bootlin.com> (raw)
In-Reply-To: <20260707091637.371-3-javen_xu@realsil.com.cn>
Hi,
On 7/7/26 11:16, javen wrote:
> From: Javen Xu <javen_xu@realsil.com.cn>
>
> For Realtek nics, when we enable jumbo, pause are not supported. So we
> must check the pause capabilities from ourself and lp.
>
> Signed-off-by: Javen Xu <javen_xu@realsil.com.cn>
> ---
> Changes in v5:
> - no changes, new file
> ---
> drivers/net/phy/phylink.c | 66 +++++++++++++++++++++++++++++++++++++++
> include/linux/phylink.h | 2 ++
> 2 files changed, 68 insertions(+)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 59dfe35afa54..c450ee33b75c 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -1828,6 +1828,72 @@ int phylink_set_fixed_link(struct phylink *pl,
> }
> EXPORT_SYMBOL_GPL(phylink_set_fixed_link);
>
> +/**
> + * phylink_set_mac_capabilities() - Dynamically update MAC capabilities
> + * @pl: a pointer to a &struct phylink returned from phylink_create()
> + * @mac_capabilities: the new MAC capabilities mask
> + *
> + * This function allows a MAC driver to dynamically change its capabilities,
> + * such as losing/gaining Pause frame support based on MTU size.
> + * It recalculates supported link modes and triggers renegotiation if needed.
> + */
> +void phylink_set_mac_capabilities(struct phylink *pl, unsigned long mac_capabilities)
This is a step in the right direction, but this is maybe too generic, as
mac_capabilities represent both the MAC's Pause support as well as Speed/Duplex
support.
The speed/duplex parts shouldn't be changed dynamically, I think the helper
needs to be specific in its naming that this is strictly about changing the MAC's
Pause / Asym capabilities dynamically, and be either passed some booleans, one for
rx one for tx, or fail if we try to change anything other than MAC_SYM_PAUSE and
MAC_ASYM_PAUSE.
Maybe something like "phylink_update_mac_pause_capabilities" ?
The 'update' part makes it clear this may trigger re-negotiation.
Maxime
next prev parent reply other threads:[~2026-07-07 11:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 9:16 [PATCH net-next v5 0/8] r8169: add support for phylink javen
2026-07-07 9:16 ` [PATCH net-next v5 1/8] r8169: add speed in private struct javen
2026-07-07 9:16 ` [PATCH net-next v5 2/8] net: phy: phylink: add helper to modify pause javen
2026-07-07 11:10 ` Maxime Chevallier [this message]
2026-07-07 9:16 ` [PATCH net-next v5 3/8] r8169: add support for phylink javen
2026-07-07 11:37 ` Maxime Chevallier
2026-07-07 9:16 ` [PATCH net-next v5 4/8] r8169: add support for RTL8116af javen
2026-07-07 9:16 ` [PATCH net-next v5 5/8] r8169: add ltr support for RTL8117 series javen
2026-07-07 9:16 ` [PATCH net-next v5 6/8] r8169: fix RTL8116af can not enter s0idle and c10 javen
2026-07-07 9:16 ` [PATCH net-next v5 7/8] r8169: add phylink support for RTL8127atf javen
2026-07-07 9:16 ` [PATCH net-next v5 8/8] r8169: add 1g " javen
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=a5dcf2a7-8291-4ac9-bbf4-513b43524f10@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=daniel@makrotopia.org \
--cc=daniel@thingy.jp \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enelsonmoore@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=javen_xu@realsil.com.cn \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.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