Date: Tue, 19 Jul 2022 09:57:49 GMT From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= <kd@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 94c272b4c6cc - stable/13 - igc: Change default duplex setting Message-ID: <202207190957.26J9vnQw012884@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=94c272b4c6ccf74739dac5b7d93543daf65a1793 commit 94c272b4c6ccf74739dac5b7d93543daf65a1793 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-19 09:36:48 +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 (cherry picked from commit 3b8d04f845b416d29a258658b8a48d1afb4a2e81) --- 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 20dbd3f71d39..607b893c9ab8 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -1071,16 +1071,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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207190957.26J9vnQw012884>