src/dpdk/drivers/net/bnx2x/bnx2x.c
static void bnx2x_squeeze_objects(struct bnx2x_softc *sc)
{
	uint32_t ramrod_flags = 0, vlan_mac_flags = 0;
	struct ecore_mcast_ramrod_params rparam = { NULL };
	struct ecore_vlan_mac_obj *mac_obj = &sc->sp_objs->mac_obj;
	int rc;

	/* Cleanup MACs' object first... */

	/* Wait for completion of requested */
	rte_bit_relaxed_set32(RAMROD_COMP_WAIT, &ramrod_flags);
	/* Perform a dry cleanup */
	rte_bit_relaxed_set32(RAMROD_DRV_CLR_ONLY, &ramrod_flags);

	/* Clean ETH primary MAC */
	rte_bit_relaxed_set32(ECORE_ETH_MAC, &vlan_mac_flags);
	rc = mac_obj->delete_all(sc, &sc->sp_objs->mac_obj, &vlan_mac_flags,
				 &ramrod_flags);
	if (rc != 0) {
		PMD_DRV_LOG(NOTICE, sc, "Failed to clean ETH MACs (%d)", rc);
	}

	/* Cleanup UC list */
	vlan_mac_flags = 0;
	rte_bit_relaxed_set32(ECORE_UC_LIST_MAC, &vlan_mac_flags);
	rc = mac_obj->delete_all(sc, mac_obj, &vlan_mac_flags, &ramrod_flags);
	if (rc != 0) {
		PMD_DRV_LOG(NOTICE, sc,
			    "Failed to clean UC list MACs (%d)", rc);
	}

	/* Now clean mcast object... */

	rparam.mcast_obj = &sc->mcast_obj;
	rte_bit_relaxed_set32(RAMROD_DRV_CLR_ONLY, &rparam.ramrod_flags);

	/* Add a DEL command... */
	rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_DEL);
	if (rc < 0) {
		PMD_DRV_LOG(NOTICE, sc,
			    "Failed to send DEL MCAST command (%d)", rc);
	}

	/* now wait until all pending commands are cleared */

	rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT);
	while (rc != 0) {
		if (rc < 0) {
			PMD_DRV_LOG(NOTICE, sc,
				    "Failed to clean MCAST object (%d)", rc);
			return;
		}

		rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT);
	}
}
/*
 * Cleans the object that have internal lists without sending
 * ramrods. Should be run when interrutps are disabled.
 */
Cleans the object that have internal lists without sending
ramrods. Should be run when interrutps are disabled.
Cleans the object that have internal lists without sending ramrods . Should be run when interrutps are disabled .
static void bnx2x_squeeze_objects(struct bnx2x_softc *sc)
{
	uint32_t ramrod_flags = 0, vlan_mac_flags = 0;
	struct ecore_mcast_ramrod_params rparam = { NULL };
	struct ecore_vlan_mac_obj *mac_obj = &sc->sp_objs->mac_obj;
	int rc;
	rte_bit_relaxed_set32(RAMROD_COMP_WAIT, &ramrod_flags);
	rte_bit_relaxed_set32(RAMROD_DRV_CLR_ONLY, &ramrod_flags);
	rte_bit_relaxed_set32(ECORE_ETH_MAC, &vlan_mac_flags);
	rc = mac_obj->delete_all(sc, &sc->sp_objs->mac_obj, &vlan_mac_flags,
				 &ramrod_flags);
	if (rc != 0) {
		PMD_DRV_LOG(NOTICE, sc, "Failed to clean ETH MACs (%d)", rc);
	}
	vlan_mac_flags = 0;
	rte_bit_relaxed_set32(ECORE_UC_LIST_MAC, &vlan_mac_flags);
	rc = mac_obj->delete_all(sc, mac_obj, &vlan_mac_flags, &ramrod_flags);
	if (rc != 0) {
		PMD_DRV_LOG(NOTICE, sc,
			    "Failed to clean UC list MACs (%d)", rc);
	}
	rparam.mcast_obj = &sc->mcast_obj;
	rte_bit_relaxed_set32(RAMROD_DRV_CLR_ONLY, &rparam.ramrod_flags);
	rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_DEL);
	if (rc < 0) {
		PMD_DRV_LOG(NOTICE, sc,
			    "Failed to send DEL MCAST command (%d)", rc);
	}
	rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT);
	while (rc != 0) {
		if (rc < 0) {
			PMD_DRV_LOG(NOTICE, sc,
				    "Failed to clean MCAST object (%d)", rc);
			return;
		}
		rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT);
	}
}
static void bnx2x_squeeze_objects ( struct bnx2x_softc * sc ) { uint32_t ramrod_flags = 0 , vlan_mac_flags = 0 ; struct ecore_mcast_ramrod_params rparam = { NULL } ; struct ecore_vlan_mac_obj * mac_obj = & sc -> sp_objs -> mac_obj ; int rc ; rte_bit_relaxed_set32 ( RAMROD_COMP_WAIT , & ramrod_flags ) ; rte_bit_relaxed_set32 ( RAMROD_DRV_CLR_ONLY , & ramrod_flags ) ; rte_bit_relaxed_set32 ( ECORE_ETH_MAC , & vlan_mac_flags ) ; rc = mac_obj -> delete_all ( sc , & sc -> sp_objs -> mac_obj , & vlan_mac_flags , & ramrod_flags ) ; if ( rc != 0 ) { PMD_DRV_LOG ( NOTICE , sc , " " , rc ) ; } vlan_mac_flags = 0 ; rte_bit_relaxed_set32 ( ECORE_UC_LIST_MAC , & vlan_mac_flags ) ; rc = mac_obj -> delete_all ( sc , mac_obj , & vlan_mac_flags , & ramrod_flags ) ; if ( rc != 0 ) { PMD_DRV_LOG ( NOTICE , sc , " " , rc ) ; } rparam . mcast_obj = & sc -> mcast_obj ; rte_bit_relaxed_set32 ( RAMROD_DRV_CLR_ONLY , & rparam . ramrod_flags ) ; rc = ecore_config_mcast ( sc , & rparam , ECORE_MCAST_CMD_DEL ) ; if ( rc < 0 ) { PMD_DRV_LOG ( NOTICE , sc , " " , rc ) ; } rc = ecore_config_mcast ( sc , & rparam , ECORE_MCAST_CMD_CONT ) ; while ( rc != 0 ) { if ( rc < 0 ) { PMD_DRV_LOG ( NOTICE , sc , " " , rc ) ; return ; } rc = ecore_config_mcast ( sc , & rparam , ECORE_MCAST_CMD_CONT ) ; } }
Cleans the object that have internal lists without sending
 ramrods.
Cleans the object that have internal lists without sending ramrods .
/* Cleanup MACs' object first... */ /* Wait for completion of requested */ /* Perform a dry cleanup */ /* Clean ETH primary MAC */ /* Cleanup UC list */ /* Now clean mcast object... */ /* Add a DEL command... */ /* now wait until all pending commands are cleared */