From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
matttbe@kernel.org, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org, thomas.petazzoni@bootlin.com
Subject: [PATCH iwl-next 2/3] igb: take the user intent into account when pause autoneg is on
Date: Sat, 21 Nov 2026 11:36:11 +0100 [thread overview]
Message-ID: <20261121103613.166611-3-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20261121103613.166611-1-maxime.chevallier@bootlin.com>
Currently, the pause parameters on igb are set to the default value when
pause autoneg is enabled, regardless of the parameters supplied by the
user (i.e. it ignores the "rx on/off tx on/off" params when pause aneg
is on).
Let's take the user intent into account when enabling pause autoneg.
While at it, simplify the tests on tx/rx values.
Tested on i350-T4 cards.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index cfa36eab8b0a..03c69409a6f4 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -406,8 +406,16 @@ static int igb_set_pauseparam(struct net_device *netdev,
while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
usleep_range(1000, 2000);
+ if (pause->rx_pause && pause->tx_pause)
+ hw->fc.requested_mode = e1000_fc_full;
+ else if (pause->rx_pause)
+ hw->fc.requested_mode = e1000_fc_rx_pause;
+ else if (pause->tx_pause)
+ hw->fc.requested_mode = e1000_fc_tx_pause;
+ else
+ hw->fc.requested_mode = e1000_fc_none;
+
if (adapter->fc_autoneg == AUTONEG_ENABLE) {
- hw->fc.requested_mode = e1000_fc_default;
if (netif_running(adapter->netdev)) {
igb_down(adapter);
igb_up(adapter);
@@ -415,15 +423,6 @@ static int igb_set_pauseparam(struct net_device *netdev,
igb_reset(adapter);
}
} else {
- if (pause->rx_pause && pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_full;
- else if (pause->rx_pause && !pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_rx_pause;
- else if (!pause->rx_pause && pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_tx_pause;
- else if (!pause->rx_pause && !pause->tx_pause)
- hw->fc.requested_mode = e1000_fc_none;
-
hw->fc.current_mode = hw->fc.requested_mode;
retval = ((hw->phy.media_type == e1000_media_type_copper) ?
--
2.56.1
next prev parent reply other threads:[~2026-11-21 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 10:36 [PATCH iwl-next 0/3] igb: Align the flow-control behaviour with ethtool's specs Maxime Chevallier
2026-11-21 10:36 ` [PATCH iwl-next 1/3] igb: don't change the pause config when changing the link ksettings Maxime Chevallier
2026-11-21 10:36 ` Maxime Chevallier [this message]
2026-11-21 10:36 ` [PATCH iwl-next 3/3] igb: advertise symmetric pause only for full flow control Maxime Chevallier
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=20261121103613.166611-3-maxime.chevallier@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=matttbe@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=willemb@google.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