[PATCH 5.4 062/111] igc: Fix Supported Pause Frame Link Setting

From: Greg Kroah-Hartman
Date: Mon Mar 29 2021 - 04:23:14 EST


From: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@xxxxxxxxx>

[ Upstream commit 9a4a1cdc5ab52118c1f2b216f4240830b6528d32 ]

The Supported Pause Frame always display "No" even though the Advertised
pause frame showing the correct setting based on the pause parameters via
ethtool. Set bit in link_ksettings to "Supported" for Pause Frame.

Before output:
Supported pause frame use: No

Expected output:
Supported pause frame use: Symmetric

Fixes: 8c5ad0dae93c ("igc: Add ethtool support")
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@xxxxxxxxx>
Reviewed-by: Malli C <mallikarjuna.chilakala@xxxxxxxxx>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@xxxxxxxxxxxxxxx>
Acked-by: Sasha Neftin <sasha.neftin@xxxxxxxxx>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/net/ethernet/intel/igc/igc_ethtool.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index d1a25d679b89..cbcb8611ab50 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1690,6 +1690,9 @@ static int igc_get_link_ksettings(struct net_device *netdev,
Autoneg);
}

+ /* Set pause flow control settings */
+ ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
+
switch (hw->fc.requested_mode) {
case igc_fc_full:
ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause);
--
2.30.1