src/dpdk/drivers/net/bnx2x/bnx2x.c
static void bnx2x_link_attn(struct bnx2x_softc *sc)
{
	uint32_t pause_enabled = 0;
	struct host_port_stats *pstats;
	int cmng_fns;

	/* Make sure that we are synced with the current statistics */
	bnx2x_stats_handle(sc, STATS_EVENT_STOP);

	elink_link_update(&sc->link_params, &sc->link_vars);

	if (sc->link_vars.link_up) {

		/* dropless flow control */
		if (sc->dropless_fc) {
			pause_enabled = 0;

			if (sc->link_vars.flow_ctrl & ELINK_FLOW_CTRL_TX) {
				pause_enabled = 1;
			}

			REG_WR(sc,
			       (BAR_USTRORM_INTMEM +
				USTORM_ETH_PAUSE_ENABLED_OFFSET(SC_PORT(sc))),
			       pause_enabled);
		}

		if (sc->link_vars.mac_type != ELINK_MAC_TYPE_EMAC) {
			pstats = BNX2X_SP(sc, port_stats);
			/* reset old mac stats */
			memset(&(pstats->mac_stx[0]), 0,
			       sizeof(struct mac_stx));
		}

		if (sc->state == BNX2X_STATE_OPEN) {
			bnx2x_stats_handle(sc, STATS_EVENT_LINK_UP);
		}
	}

	if (sc->link_vars.link_up && sc->link_vars.line_speed) {
		cmng_fns = bnx2x_get_cmng_fns_mode(sc);

		if (cmng_fns != CMNG_FNS_NONE) {
			bnx2x_cmng_fns_init(sc, FALSE, cmng_fns);
			storm_memset_cmng(sc, &sc->cmng, SC_PORT(sc));
		}
	}

	bnx2x_link_report_locked(sc);

	if (IS_MF(sc)) {
		bnx2x_link_sync_notify(sc);
	}
}
/* this function is called upon a link interrupt */
this function is called upon a link interrupt
this function is called upon a link interrupt
static void bnx2x_link_attn(struct bnx2x_softc *sc)
{
	uint32_t pause_enabled = 0;
	struct host_port_stats *pstats;
	int cmng_fns;
	bnx2x_stats_handle(sc, STATS_EVENT_STOP);
	elink_link_update(&sc->link_params, &sc->link_vars);
	if (sc->link_vars.link_up) {
		if (sc->dropless_fc) {
			pause_enabled = 0;
			if (sc->link_vars.flow_ctrl & ELINK_FLOW_CTRL_TX) {
				pause_enabled = 1;
			}
			REG_WR(sc,
			       (BAR_USTRORM_INTMEM +
				USTORM_ETH_PAUSE_ENABLED_OFFSET(SC_PORT(sc))),
			       pause_enabled);
		}
		if (sc->link_vars.mac_type != ELINK_MAC_TYPE_EMAC) {
			pstats = BNX2X_SP(sc, port_stats);
			memset(&(pstats->mac_stx[0]), 0,
			       sizeof(struct mac_stx));
		}
		if (sc->state == BNX2X_STATE_OPEN) {
			bnx2x_stats_handle(sc, STATS_EVENT_LINK_UP);
		}
	}
	if (sc->link_vars.link_up && sc->link_vars.line_speed) {
		cmng_fns = bnx2x_get_cmng_fns_mode(sc);
		if (cmng_fns != CMNG_FNS_NONE) {
			bnx2x_cmng_fns_init(sc, FALSE, cmng_fns);
			storm_memset_cmng(sc, &sc->cmng, SC_PORT(sc));
		}
	}
	bnx2x_link_report_locked(sc);
	if (IS_MF(sc)) {
		bnx2x_link_sync_notify(sc);
	}
}
static void bnx2x_link_attn ( struct bnx2x_softc * sc ) { uint32_t pause_enabled = 0 ; struct host_port_stats * pstats ; int cmng_fns ; bnx2x_stats_handle ( sc , STATS_EVENT_STOP ) ; elink_link_update ( & sc -> link_params , & sc -> link_vars ) ; if ( sc -> link_vars . link_up ) { if ( sc -> dropless_fc ) { pause_enabled = 0 ; if ( sc -> link_vars . flow_ctrl & ELINK_FLOW_CTRL_TX ) { pause_enabled = 1 ; } REG_WR ( sc , ( BAR_USTRORM_INTMEM + USTORM_ETH_PAUSE_ENABLED_OFFSET ( SC_PORT ( sc ) ) ) , pause_enabled ) ; } if ( sc -> link_vars . mac_type != ELINK_MAC_TYPE_EMAC ) { pstats = BNX2X_SP ( sc , port_stats ) ; memset ( & ( pstats -> mac_stx [ 0 ] ) , 0 , sizeof ( struct mac_stx ) ) ; } if ( sc -> state == BNX2X_STATE_OPEN ) { bnx2x_stats_handle ( sc , STATS_EVENT_LINK_UP ) ; } } if ( sc -> link_vars . link_up && sc -> link_vars . line_speed ) { cmng_fns = bnx2x_get_cmng_fns_mode ( sc ) ; if ( cmng_fns != CMNG_FNS_NONE ) { bnx2x_cmng_fns_init ( sc , FALSE , cmng_fns ) ; storm_memset_cmng ( sc , & sc -> cmng , SC_PORT ( sc ) ) ; } } bnx2x_link_report_locked ( sc ) ; if ( IS_MF ( sc ) ) { bnx2x_link_sync_notify ( sc ) ; } }
this function is called upon a link interrupt
this function is called upon a link interrupt
/* Make sure that we are synced with the current statistics */ /* dropless flow control */ /* reset old mac stats */