Re: em(4) does not autonegotiate when fixed media is set

From: <tuexen_at_freebsd.org>
Date: Wed, 02 Mar 2022 15:40:38 UTC
> On 2. Mar 2022, at 16:33, J.R. Oldroyd <fbsd@opal.com> wrote:
> 
> An em(4) interface configured with fixed media/mediatype settings, as in:
> 	ifconfig em0 media 100baseTX mediatype full-duplex
> does not respond to autonegotiation from the switch it is connected to.
> (Actually, it does for 1000base but not for 100base or 10base.)  As a
> result, the switch may end up with mis-matched configuration.
> 
> Attached patch enables autonegotiation even when media settings are set
> to fixed 100base or 10base.
Is that what is expected? When using the above command I would expect
that 100MBit/sec is used, not that the card negotiates with the peer
something else. But my expectations might be wrong...

Best regards
Michael
> 
> I am not sure if there should also be:
> 	hw->phy.autoneg_wait_to_complete = FALSE;
> for these 100base and 10base cases to handle the situation where the other
> end isn't going to autonegotiate either.
> 
> 	-jr
> 
> <if_em.c.diff>