All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] igb:  Debugging for setting rate negotiation settings.
@ 2019-04-02 18:17 greearb
  2019-04-05  2:18 ` kbuild test robot
  2019-04-05  3:16 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: greearb @ 2019-04-02 18:17 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

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

Signed-off-by: Ben Greear <greearb@candelatech.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-05  3:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 18:17 [PATCH] igb: Debugging for setting rate negotiation settings greearb
2019-04-05  2:18 ` kbuild test robot
2019-04-05  3:16 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.