diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-06-18 15:41:09 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-06-18 15:41:09 +0000 |
commit | 7f9011de0cc3acf0dd3716194c1a65149ce3b571 (patch) | |
tree | 5dd922f1fab6b53c4c6d910149d94a09b722753f | |
parent | 9d6c0060b80ec1d62dbc7934835f685553381447 (diff) | |
download | FreeBSD-src-7f9011de0cc3acf0dd3716194c1a65149ce3b571.zip FreeBSD-src-7f9011de0cc3acf0dd3716194c1a65149ce3b571.tar.gz |
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
-rw-r--r-- | sys/dev/sfxge/sfxge_port.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/sfxge/sfxge_port.c b/sys/dev/sfxge/sfxge_port.c index 9bdfc1c..8559dc0 100644 --- a/sys/dev/sfxge/sfxge_port.c +++ b/sys/dev/sfxge/sfxge_port.c @@ -224,14 +224,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLER_ARGS) #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 *sc, efx_link_mode_t mode) /* 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); } |