src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
		  struct rte_flow_error *error)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct rte_flow *f;
	int ret;

	LIST_FOREACH(f, &priv->flows, next) {
		if (f == flow)
			break;
	}

	if (!flow) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Rule was not found");
		return -rte_errno;
	}

	LIST_REMOVE(f, next);

	ret = mrvl_flow_remove(priv, flow, error);
	if (ret)
		return ret;

	rte_free(flow);

	return 0;
}
/**
 * DPDK flow destroy callback called when flow is to be removed.
 *
 * @param dev Pointer to the device.
 * @param flow Pointer to the flow.
 * @param error Pointer to the flow error.
 * @returns 0 in case of success, negative value otherwise.
 */
DPDK flow destroy callback called when flow is to be removed.
@param dev Pointer to the device.
@param flow Pointer to the flow.
@param error Pointer to the flow error.
@returns 0 in case of success, negative value otherwise.
DPDK flow destroy callback called when flow is to be removed . @param dev Pointer to the device . @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_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
		  struct rte_flow_error *error)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct rte_flow *f;
	int ret;
	LIST_FOREACH(f, &priv->flows, next) {
		if (f == flow)
			break;
	}
	if (!flow) {
		rte_flow_error_set(error, EINVAL,
				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
				   "Rule was not found");
		return -rte_errno;
	}
	LIST_REMOVE(f, next);
	ret = mrvl_flow_remove(priv, flow, error);
	if (ret)
		return ret;
	rte_free(flow);
	return 0;
}
static int mrvl_flow_destroy ( struct rte_eth_dev * dev , struct rte_flow * flow , struct rte_flow_error * error ) { struct mrvl_priv * priv = dev -> data -> dev_private ; struct rte_flow * f ; int ret ; LIST_FOREACH ( f , & priv -> flows , next ) { if ( f == flow ) break ; } if ( ! flow ) { rte_flow_error_set ( error , EINVAL , RTE_FLOW_ERROR_TYPE_UNSPECIFIED , NULL , " " ) ; return - rte_errno ; } LIST_REMOVE ( f , next ) ; ret = mrvl_flow_remove ( priv , flow , error ) ; if ( ret ) return ret ; rte_free ( flow ) ; return 0 ; }
DPDK flow destroy callback called when flow is to be removed.
DPDK flow destroy callback called when flow is to be removed .