git: 3b8d04f845b4 - main - igc: Change default duplex setting
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 Jul 2022 06:15:29 UTC
The branch main has been updated by kd:
URL: https://cgit.FreeBSD.org/src/commit/?id=3b8d04f845b416d29a258658b8a48d1afb4a2e81
commit 3b8d04f845b416d29a258658b8a48d1afb4a2e81
Author: Kornel Dulęba <kd@FreeBSD.org>
AuthorDate: 2022-06-30 11:57:58 +0000
Commit: Kornel Dulęba <kd@FreeBSD.org>
CommitDate: 2022-07-01 06:12:08 +0000
igc: Change default duplex setting
During media selection through ifconfig one might not specify
the duplex setting through the mediaopt flag.
In that case the igc driver would default to full-duplex.
The problem with this approach is that e1000(em/igb) driver
defaults to half-duplex.
Because of that if one connects both NICs and sets media to
e.g. 100baseTX on both of them no link will be found.
Fix that by matching igc behaviour with what e1000 does.
Reviewed by: grehan
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35673
---
sys/dev/igc/if_igc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
index 2430101283a2..b3de0f123c5c 100644
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -1070,16 +1070,16 @@ igc_if_media_change(if_ctx_t ctx)
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case IFM_100_TX:
- if ((ifm->ifm_media & IFM_GMASK) == IFM_HDX)
- adapter->hw.phy.autoneg_advertised = ADVERTISE_100_HALF;
- else
+ if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
adapter->hw.phy.autoneg_advertised = ADVERTISE_100_FULL;
+ else
+ adapter->hw.phy.autoneg_advertised = ADVERTISE_100_HALF;
break;
case IFM_10_T:
- if ((ifm->ifm_media & IFM_GMASK) == IFM_HDX)
- adapter->hw.phy.autoneg_advertised = ADVERTISE_10_HALF;
- else
+ if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
adapter->hw.phy.autoneg_advertised = ADVERTISE_10_FULL;
+ else
+ adapter->hw.phy.autoneg_advertised = ADVERTISE_10_HALF;
break;
default:
device_printf(adapter->dev, "Unsupported media type\n");