From: Andrew Lunn <andrew@lunn.ch>
To: javen <javen_xu@realsil.com.cn>
Cc: 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,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 2/6] r8169: add support for phylink
Date: Fri, 3 Jul 2026 22:37:30 +0200 [thread overview]
Message-ID: <e9cadf1a-94f3-45e8-9b59-22082ee5c2da@lunn.ch> (raw)
In-Reply-To: <20260703092459.1124-3-javen_xu@realsil.com.cn>
> + if (jumbo) {
> + if (!tp->jumbo_pause_saved) {
> + struct ethtool_link_ksettings cmd = {};
> + bool adv_pause, adv_asym;
> +
> + phylink_ethtool_get_pauseparam(tp->phylink, &tp->saved_pause);
> + if (tp->saved_pause.autoneg) {
> + phylink_ethtool_ksettings_get(tp->phylink, &cmd);
> + adv_pause = ethtool_link_ksettings_test_link_mode(&cmd,
> + advertising,
> + Pause);
> + adv_asym = ethtool_link_ksettings_test_link_mode(&cmd,
> + advertising,
> + Asym_Pause);
> + if (adv_pause && !adv_asym) {
> + tp->saved_pause.rx_pause = 1;
> + tp->saved_pause.tx_pause = 1;
This does not look correct. Pause is negotiated. In order to determine
how to program the MAC you need to look at what the local side is
advertising, and what the link peer is advertising. I don't see
anything here about lp_.
I forget what the issues is. Is it something like, if you are using a
normal MTU, pause is supported? But with jumbo MTU it is not?
For this to work correctly, i would expect a change of MTU to trigger
a new autoneg, with the local advertisement changed. That might
require changes in phylink, since it does not expect this sort of
thing.
> @@ -5288,6 +5326,8 @@ static void rtl_remove_one(struct pci_dev *pdev)
> r8169_remove_leds(tp->leds);
>
> unregister_netdev(tp->dev);
> + if (tp->phylink)
> + phylink_destroy(tp->phylink);
I've not looked in detail, but is tp->phylink optional? I would expect
the probe to fail if it could not create it.
> +static int rtl_mac_enable_tx_lpi(struct phylink_config *config, u32 timer, bool tx_clk_stop)
> +{
> + struct rtl8169_private *tp = container_of(config, struct rtl8169_private, phylink_config);
> +
> + if (!rtl_supports_eee(tp))
> + return -EOPNOTSUPP;
Can that happen? You should only be telling phylink EEE is supported
if EEE is actually supported.
> +static int rtl_init_phylink(struct rtl8169_private *tp)
> +{
> + struct phylink *pl;
> + phy_interface_t phy_mode;
> +
> + tp->phylink_config.dev = &tp->dev->dev;
> + tp->phylink_config.type = PHYLINK_NETDEV;
> + tp->phylink_config.mac_managed_pm = true;
> + tp->phylink_config.lpi_capabilities = rtl8169_get_lpi_caps(tp);
> + tp->phylink_config.mac_capabilities |= MAC_ASYM_PAUSE | MAC_SYM_PAUSE;
> +
> + if (tp->sfp_mode) {
> + phy_mode = PHY_INTERFACE_MODE_INTERNAL;
> + tp->phylink_config.mac_capabilities |= MAC_10000FD;
Only 10G? Is it not possible to slow down to 1G for a 1G SFP?
Andrew
next prev parent reply other threads:[~2026-07-03 20:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 9:24 [PATCH net-next v4 0/6] r8169: add support for phylink javen
2026-07-03 9:24 ` [PATCH net-next v4 1/6] r8169: add speed in private struct javen
2026-07-03 20:21 ` Andrew Lunn
2026-07-03 9:24 ` [PATCH net-next v4 2/6] r8169: add support for phylink javen
2026-07-03 20:37 ` Andrew Lunn [this message]
2026-07-06 3:07 ` Javen
2026-07-06 12:57 ` Andrew Lunn
2026-07-03 9:24 ` [PATCH net-next v4 3/6] r8169: add support for RTL8116af javen
2026-07-03 9:24 ` [PATCH net-next v4 4/6] r8169: add ltr support for RTL8117 series javen
2026-07-03 9:24 ` [PATCH net-next v4 5/6] r8169: fix RTL8116af can not enter s0idle and c10 javen
2026-07-03 9:24 ` [PATCH net-next v4 6/6] r8169: add phylink support for RTL8127atf 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=e9cadf1a-94f3-45e8-9b59-22082ee5c2da@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.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=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