sfxge_port.c (229613) | sfxge_port.c (264772) |
---|---|
1/*- 2 * Copyright (c) 2010-2011 Solarflare Communications, Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010-2011 Solarflare Communications, Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_port.c 229613 2012-01-05 18:32:37Z jhb $"); | 31__FBSDID("$FreeBSD: head/sys/dev/sfxge/sfxge_port.c 264772 2014-04-22 20:19:09Z gnn $"); |
32 33#include <sys/types.h> 34#include <sys/limits.h> 35#include <net/ethernet.h> 36#include <net/if_dl.h> 37 38#include "common/efx.h" 39 --- 275 unchanged lines hidden (view full) --- 315} 316 317int 318sfxge_mac_filter_set(struct sfxge_softc *sc) 319{ 320 struct sfxge_port *port = &sc->port; 321 int rc; 322 | 32 33#include <sys/types.h> 34#include <sys/limits.h> 35#include <net/ethernet.h> 36#include <net/if_dl.h> 37 38#include "common/efx.h" 39 --- 275 unchanged lines hidden (view full) --- 315} 316 317int 318sfxge_mac_filter_set(struct sfxge_softc *sc) 319{ 320 struct sfxge_port *port = &sc->port; 321 int rc; 322 |
323 KASSERT(port->init_state == SFXGE_PORT_STARTED, ("port not started")); 324 | |
325 mtx_lock(&port->lock); | 323 mtx_lock(&port->lock); |
326 rc = sfxge_mac_filter_set_locked(sc); | 324 /* 325 * The function may be called without softc_lock held in the 326 * case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler 327 * checks IFF_DRV_RUNNING flag which implies port started, but 328 * it is not guaranteed to remain. softc_lock shared lock can't 329 * be held in the case of these ioctls processing, since it 330 * results in failure where kernel complains that non-sleepable 331 * lock is held in sleeping thread. Both problems are repeatable 332 * on LAG with LACP proto bring up. 333 */ 334 if (port->init_state == SFXGE_PORT_STARTED) 335 rc = sfxge_mac_filter_set_locked(sc); 336 else 337 rc = 0; |
327 mtx_unlock(&port->lock); 328 return rc; 329} 330 331void 332sfxge_port_stop(struct sfxge_softc *sc) 333{ 334 struct sfxge_port *port; --- 455 unchanged lines hidden --- | 338 mtx_unlock(&port->lock); 339 return rc; 340} 341 342void 343sfxge_port_stop(struct sfxge_softc *sc) 344{ 345 struct sfxge_port *port; --- 455 unchanged lines hidden --- |