diff options
author | arybchik <arybchik@FreeBSD.org> | 2017-01-01 19:46:56 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2017-01-01 19:46:56 +0000 |
commit | 00aa695ecabfc4421b3d0e6aa35d222745e3d6d5 (patch) | |
tree | 05708fb42e9fff46e9d7a93a88a3ca5d4eebef54 /sys/dev/sfxge | |
parent | e927f880ba874b5800aed6cd6d4c86a14ce206de (diff) | |
download | FreeBSD-src-00aa695ecabfc4421b3d0e6aa35d222745e3d6d5.zip FreeBSD-src-00aa695ecabfc4421b3d0e6aa35d222745e3d6d5.tar.gz |
MFC r310820
sfxge(4): move queue size checks to after the NIC config has been populated
Submitted by: Mark Spender <mspender at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
Diffstat (limited to 'sys/dev/sfxge')
-rw-r--r-- | sys/dev/sfxge/sfxge.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c index dcc9a07..94b7035 100644 --- a/sys/dev/sfxge/sfxge.c +++ b/sys/dev/sfxge/sfxge.c @@ -737,6 +737,16 @@ sfxge_create(struct sfxge_softc *sc) goto fail3; sc->enp = enp; + /* Initialize MCDI to talk to the microcontroller. */ + DBGPRINT(sc->dev, "mcdi_init..."); + if ((error = sfxge_mcdi_init(sc)) != 0) + goto fail4; + + /* Probe the NIC and build the configuration data area. */ + DBGPRINT(sc->dev, "nic_probe..."); + if ((error = efx_nic_probe(enp)) != 0) + goto fail5; + if (!ISP2(sfxge_rx_ring_entries) || (sfxge_rx_ring_entries < EFX_RXQ_MINNDESCS) || (sfxge_rx_ring_entries > EFX_RXQ_MAXNDESCS)) { @@ -759,16 +769,6 @@ sfxge_create(struct sfxge_softc *sc) } sc->txq_entries = sfxge_tx_ring_entries; - /* Initialize MCDI to talk to the microcontroller. */ - DBGPRINT(sc->dev, "mcdi_init..."); - if ((error = sfxge_mcdi_init(sc)) != 0) - goto fail4; - - /* Probe the NIC and build the configuration data area. */ - DBGPRINT(sc->dev, "nic_probe..."); - if ((error = efx_nic_probe(enp)) != 0) - goto fail5; - SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "version", CTLFLAG_RD, @@ -861,14 +861,14 @@ fail7: efx_nvram_fini(enp); fail6: +fail_tx_ring_entries: +fail_rx_ring_entries: efx_nic_unprobe(enp); fail5: sfxge_mcdi_fini(sc); fail4: -fail_tx_ring_entries: -fail_rx_ring_entries: sc->enp = NULL; efx_nic_destroy(enp); SFXGE_EFSYS_LOCK_DESTROY(&sc->enp_lock); |