src/dpdk/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
int32_t
ulp_default_flow_destroy(struct rte_eth_dev *eth_dev, uint32_t flow_id)
{
	struct bnxt_ulp_context *ulp_ctx;
	int rc = 0;

	ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev);
	if (!ulp_ctx) {
		BNXT_TF_DBG(ERR, "ULP context is not initialized\n");
		return -EINVAL;
	}

	if (!flow_id) {
		BNXT_TF_DBG(DEBUG, "invalid flow id zero\n");
		return rc;
	}

	if (bnxt_ulp_cntxt_acquire_fdb_lock(ulp_ctx)) {
		BNXT_TF_DBG(ERR, "Flow db lock acquire failed\n");
		return -EINVAL;
	}
	rc = ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_DEFAULT,
				     flow_id);
	if (rc)
		BNXT_TF_DBG(ERR, "Failed to destroy flow.\n");
	bnxt_ulp_cntxt_release_fdb_lock(ulp_ctx);

	return rc;
}
/*
 * Function to destroy default rules for the following paths
 * 1) Device PORT to DPDK App
 * 2) DPDK App to Device PORT
 * 3) VF Representor to VF
 * 4) VF to VF Representor
 *
 * eth_dev [in] Ptr to rte eth device.
 * flow_id [in] Flow identifier.
 *
 * Returns 0 on success or negative number on failure.
 */
Function to destroy default rules for the following paths
1) Device PORT to DPDK App
2) DPDK App to Device PORT
3) VF Representor to VF
4) VF to VF Representor

eth_dev [in] Ptr to rte eth device.
flow_id [in] Flow identifier.

Returns 0 on success or negative number on failure.
Function to destroy default rules for the following paths 1 ) Device PORT to DPDK App 2 ) DPDK App to Device PORT 3 ) VF Representor to VF 4 ) VF to VF Representor eth_dev [ in ] Ptr to rte eth device . flow_id [ in ] Flow identifier . Returns 0 on success or negative number on failure .
int32_t
ulp_default_flow_destroy(struct rte_eth_dev *eth_dev, uint32_t flow_id)
{
	struct bnxt_ulp_context *ulp_ctx;
	int rc = 0;
	ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev);
	if (!ulp_ctx) {
		BNXT_TF_DBG(ERR, "ULP context is not initialized\n");
		return -EINVAL;
	}
	if (!flow_id) {
		BNXT_TF_DBG(DEBUG, "invalid flow id zero\n");
		return rc;
	}
	if (bnxt_ulp_cntxt_acquire_fdb_lock(ulp_ctx)) {
		BNXT_TF_DBG(ERR, "Flow db lock acquire failed\n");
		return -EINVAL;
	}
	rc = ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_DEFAULT,
				     flow_id);
	if (rc)
		BNXT_TF_DBG(ERR, "Failed to destroy flow.\n");
	bnxt_ulp_cntxt_release_fdb_lock(ulp_ctx);
	return rc;
}
int32_t ulp_default_flow_destroy ( struct rte_eth_dev * eth_dev , uint32_t flow_id ) { struct bnxt_ulp_context * ulp_ctx ; int rc = 0 ; ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get ( eth_dev ) ; if ( ! ulp_ctx ) { BNXT_TF_DBG ( ERR , " \n " ) ; return - EINVAL ; } if ( ! flow_id ) { BNXT_TF_DBG ( DEBUG , " \n " ) ; return rc ; } if ( bnxt_ulp_cntxt_acquire_fdb_lock ( ulp_ctx ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return - EINVAL ; } rc = ulp_mapper_flow_destroy ( ulp_ctx , BNXT_ULP_FDB_TYPE_DEFAULT , flow_id ) ; if ( rc ) BNXT_TF_DBG ( ERR , " \n " ) ; bnxt_ulp_cntxt_release_fdb_lock ( ulp_ctx ) ; return rc ; }
Function to destroy default rules for the following paths
 1) Device PORT to DPDK App
 2) DPDK App to Device PORT
 3) VF Representor to VF
 4) VF to VF Representor
Function to destroy default rules for the following paths 1 ) Device PORT to DPDK App 2 ) DPDK App to Device PORT 3 ) VF Representor to VF 4 ) VF to VF Representor