Date: Thu, 18 Jun 2015 15:41:10 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r284554 - stable/10/sys/dev/sfxge Message-ID: <201506181541.t5IFfA3E078035@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Thu Jun 18 15:41:09 2015 New Revision: 284554 URL: https://svnweb.freebsd.org/changeset/base/284554 Log: sfxge: use if_initbaudrate() to set interface baudrate It is required to cope with u_long limit for 10 Gbps in a right way. It is a direct commit to stable/10 since head differs (head does not have if_initbaudrate(), if_baudrate is simply uint64_t). Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D2849 Modified: stable/10/sys/dev/sfxge/sfxge_port.c Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Thu Jun 18 14:29:46 2015 (r284553) +++ stable/10/sys/dev/sfxge/sfxge_port.c Thu Jun 18 15:41:09 2015 (r284554) @@ -224,14 +224,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ -static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = { +static const uint64_t sfxge_link_baudrate[EFX_LINK_NMODES] = { [EFX_LINK_10HDX] = IF_Mbps(10), [EFX_LINK_10FDX] = IF_Mbps(10), [EFX_LINK_100HDX] = IF_Mbps(100), [EFX_LINK_100FDX] = IF_Mbps(100), [EFX_LINK_1000HDX] = IF_Gbps(1), [EFX_LINK_1000FDX] = IF_Gbps(1), - [EFX_LINK_10000FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX), + [EFX_LINK_10000FDX] = IF_Gbps(10), }; void @@ -250,7 +250,7 @@ sfxge_mac_link_update(struct sfxge_softc /* Push link state update to the OS */ link_state = (port->link_mode != EFX_LINK_DOWN ? LINK_STATE_UP : LINK_STATE_DOWN); - sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode]; + if_initbaudrate(sc->ifnet, sfxge_link_baudrate[port->link_mode]); if_link_state_change(sc->ifnet, link_state); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506181541.t5IFfA3E078035>