src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_flow_remove(struct mrvl_priv *priv, struct rte_flow *flow,
		 struct rte_flow_error *error)
{
	int ret;

	if (!priv->cls_tbl) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Classifier table not initialized");
		return -rte_errno;
	}

	ret = pp2_cls_tbl_remove_rule(priv->cls_tbl, &flow->rule);
	if (ret) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Failed to remove rule");
		return -rte_errno;
	}

	mrvl_free_all_key_mask(&flow->rule);

	if (flow->mtr) {
		flow->mtr->refcnt--;
		flow->mtr = NULL;
	}

	return 0;
}
/**
 * Remove classifier rule associated with given flow.
 *
 * @param priv Pointer to the port's private data.
 * @param flow Pointer to the flow.
 * @param error Pointer to the flow error.
 * @returns 0 in case of success, negative value otherwise.
 */
Remove classifier rule associated with given flow.
@param priv Pointer to the port's private data.
@param flow Pointer to the flow.
@param error Pointer to the flow error.
@returns 0 in case of success, negative value otherwise.
Remove classifier rule associated with given flow . @param priv Pointer to the port ' s private data . @param flow Pointer to the flow . @param error Pointer to the flow error . @returns 0 in case of success negative value otherwise .
static int
mrvl_flow_remove(struct mrvl_priv *priv, struct rte_flow *flow,
		 struct rte_flow_error *error)
{
	int ret;
	if (!priv->cls_tbl) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Classifier table not initialized");
		return -rte_errno;
	}
	ret = pp2_cls_tbl_remove_rule(priv->cls_tbl, &flow->rule);
	if (ret) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Failed to remove rule");
		return -rte_errno;
	}
	mrvl_free_all_key_mask(&flow->rule);
	if (flow->mtr) {
		flow->mtr->refcnt--;
		flow->mtr = NULL;
	}
	return 0;
}
static int mrvl_flow_remove ( struct mrvl_priv * priv , struct rte_flow * flow , struct rte_flow_error * error ) { int ret ; if ( ! priv -> cls_tbl ) { rte_flow_error_set ( error , EINVAL , RTE_FLOW_ERROR_TYPE_UNSPECIFIED , NULL , " " ) ; return - rte_errno ; } ret = pp2_cls_tbl_remove_rule ( priv -> cls_tbl , & flow -> rule ) ; if ( ret ) { rte_flow_error_set ( error , EINVAL , RTE_FLOW_ERROR_TYPE_UNSPECIFIED , NULL , " " ) ; return - rte_errno ; } mrvl_free_all_key_mask ( & flow -> rule ) ; if ( flow -> mtr ) { flow -> mtr -> refcnt -- ; flow -> mtr = NULL ; } return 0 ; }
Remove classifier rule associated with given flow.
Remove classifier rule associated with given flow .