src/dpdk/drivers/net/bnx2x/bnx2x.c
static int bnx2x_nic_load_analyze_req(struct bnx2x_softc *sc, uint32_t load_code)
{
	uint32_t my_fw, loaded_fw;

	/* is another pf loaded on this engine? */
	if ((load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) &&
	    (load_code != FW_MSG_CODE_DRV_LOAD_COMMON)) {
		/* build my FW version dword */
		my_fw = (BNX2X_5710_FW_MAJOR_VERSION +
			 (BNX2X_5710_FW_MINOR_VERSION << 8) +
			 (BNX2X_5710_FW_REVISION_VERSION << 16) +
			 (BNX2X_5710_FW_ENGINEERING_VERSION << 24));

		/* read loaded FW from chip */
		loaded_fw = REG_RD(sc, XSEM_REG_PRAM);
		PMD_DRV_LOG(DEBUG, sc, "loaded FW 0x%08x / my FW 0x%08x",
			    loaded_fw, my_fw);

		/* abort nic load if version mismatch */
		if (my_fw != loaded_fw) {
			PMD_DRV_LOG(NOTICE, sc,
				    "FW 0x%08x already loaded (mine is 0x%08x)",
				    loaded_fw, my_fw);
			return -1;
		}
	}

	return 0;
}
/*
 * Check whether another PF has already loaded FW to chip. In virtualized
 * environments a pf from anoth VM may have already initialized the device
 * including loading FW.
 */
Check whether another PF has already loaded FW to chip. In virtualized
environments a pf from anoth VM may have already initialized the device
including loading FW.
Check whether another PF has already loaded FW to chip . In virtualized environments a pf from anoth VM may have already initialized the device including loading FW .
static int bnx2x_nic_load_analyze_req(struct bnx2x_softc *sc, uint32_t load_code)
{
	uint32_t my_fw, loaded_fw;
	if ((load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) &&
	    (load_code != FW_MSG_CODE_DRV_LOAD_COMMON)) {
		my_fw = (BNX2X_5710_FW_MAJOR_VERSION +
			 (BNX2X_5710_FW_MINOR_VERSION << 8) +
			 (BNX2X_5710_FW_REVISION_VERSION << 16) +
			 (BNX2X_5710_FW_ENGINEERING_VERSION << 24));
		loaded_fw = REG_RD(sc, XSEM_REG_PRAM);
		PMD_DRV_LOG(DEBUG, sc, "loaded FW 0x%08x / my FW 0x%08x",
			    loaded_fw, my_fw);
		if (my_fw != loaded_fw) {
			PMD_DRV_LOG(NOTICE, sc,
				    "FW 0x%08x already loaded (mine is 0x%08x)",
				    loaded_fw, my_fw);
			return -1;
		}
	}
	return 0;
}
static int bnx2x_nic_load_analyze_req ( struct bnx2x_softc * sc , uint32_t load_code ) { uint32_t my_fw , loaded_fw ; if ( ( load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP ) && ( load_code != FW_MSG_CODE_DRV_LOAD_COMMON ) ) { my_fw = ( BNX2X_5710_FW_MAJOR_VERSION + ( BNX2X_5710_FW_MINOR_VERSION << 8 ) + ( BNX2X_5710_FW_REVISION_VERSION << 16 ) + ( BNX2X_5710_FW_ENGINEERING_VERSION << 24 ) ) ; loaded_fw = REG_RD ( sc , XSEM_REG_PRAM ) ; PMD_DRV_LOG ( DEBUG , sc , " " , loaded_fw , my_fw ) ; if ( my_fw != loaded_fw ) { PMD_DRV_LOG ( NOTICE , sc , " " , loaded_fw , my_fw ) ; return -1 ; } } return 0 ; }
Check whether another PF has already loaded FW to chip.
Check whether another PF has already loaded FW to chip .
/* is another pf loaded on this engine? */ /* build my FW version dword */ /* read loaded FW from chip */ /* abort nic load if version mismatch */