lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  2 Apr 2019 11:17:47 -0700
From:   greearb@...delatech.com
To:     netdev@...r.kernel.org
Cc:     Ben Greear <greearb@...delatech.com>
Subject: [PATCH] igb:  Debugging for setting rate negotiation settings.

From: Ben Greear <greearb@...delatech.com>

I found this useful while debugging an issue setting igb to
fixed rates.

Signed-off-by: Ben Greear <greearb@...delatech.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 350a2f120fc4..0f86b4eb5e30 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -8711,8 +8711,11 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u32 spd, u8 dplx)
 	/* Make sure dplx is at most 1 bit and lsb of speed is not set
 	 * for the switch() below to work
 	 */
-	if ((spd & 1) || (dplx & ~1))
+	if ((spd & 1) || (dplx & ~1)) {
+		dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration, bit-mismatch, spd: 0x%x  dplx: 0x%x\n",
+			spd, dplx);
 		goto err_inval;
+	}
 
 	/* Fiber NIC's only allow 1000 gbps Full duplex
 	 * and 100Mbps Full duplex for 100baseFx sfp
@@ -8722,6 +8725,8 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u32 spd, u8 dplx)
 		case SPEED_10 + DUPLEX_HALF:
 		case SPEED_10 + DUPLEX_FULL:
 		case SPEED_100 + DUPLEX_HALF:
+			dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration, fiber does not support HD, spd: 0x%x  dplx: 0x%x\n",
+				spd, dplx);
 			goto err_inval;
 		default:
 			break;
@@ -8746,17 +8751,24 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u32 spd, u8 dplx)
 		adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
 		break;
 	case SPEED_1000 + DUPLEX_HALF: /* not supported */
+		dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration:  1Gbps HD not supported\n",
+			spd, dplx);
+		goto err_inval;
 	default:
+		dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration, case not handled, spd: 0x%x  dplx: 0x%x\n",
+			spd, dplx);
 		goto err_inval;
 	}
 
+	dev_info(&pdev->dev, "Set Speed: %d  dplx: %d  autoneg: %d  forced-speed-duplex: %d\n",
+		 spd, dplx, mac->autoneg, mac->forced_speed_duplex);
+
 	/* clear MDI, MDI(-X) override is only allowed when autoneg enabled */
 	adapter->hw.phy.mdix = AUTO_ALL_MODES;
 
 	return 0;
 
 err_inval:
-	dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
 	return -EINVAL;
 }
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ