Date: Fri, 22 Jan 2016 17:03:32 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294578 - head/sys/dev/ixgbe Message-ID: <201601221703.u0MH3WqF052420@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Fri Jan 22 17:03:32 2016 New Revision: 294578 URL: https://svnweb.freebsd.org/changeset/base/294578 Log: Fix ix advertise value after media change When ifconfig sets media then the values displayed by the advertise_speed value are invalidated. Fix this by setting the bits correctly including setting advertise to 0 for media = auto. Reviewed by: sbruno MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D5034 Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Fri Jan 22 16:59:06 2016 (r294577) +++ head/sys/dev/ixgbe/if_ix.c Fri Jan 22 17:03:32 2016 (r294578) @@ -1948,10 +1948,16 @@ ixgbe_media_change(struct ifnet * ifp) hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = - ((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) | - ((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) | - ((speed & IXGBE_LINK_SPEED_100_FULL) << 0); + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { + adapter->advertise = 0; + } else { + if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0) + adapter->advertise |= 1 << 2; + if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0) + adapter->advertise |= 1 << 1; + if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0) + adapter->advertise |= 1 << 0; + } return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601221703.u0MH3WqF052420>