src/dpdk/drivers/net/mvpp2/mrvl_mtr.c
static int
mrvl_meter_profile_delete(struct rte_eth_dev *dev,
			      uint32_t meter_profile_id,
			      struct rte_mtr_error *error)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct mrvl_mtr_profile *profile;

	profile = mrvl_mtr_profile_from_id(priv, meter_profile_id);
	if (!profile)
		return -rte_mtr_error_set(error, ENODEV,
					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
					  NULL, "Profile id does not exist\n");

	if (profile->refcnt)
		return -rte_mtr_error_set(error, EPERM,
					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
					  NULL, "Profile is used\n");

	LIST_REMOVE(profile, next);
	rte_free(profile);

	return 0;
}
/**
 * Remove profile from the list of profiles.
 *
 * @param dev Pointer to the device.
 * @param meter_profile_id Id of the profile to remove.
 * @param error Pointer to the error.
 * @returns 0 on success, negative value otherwise.
 */
Remove profile from the list of profiles.
@param dev Pointer to the device.
@param meter_profile_id Id of the profile to remove.
@param error Pointer to the error.
@returns 0 on success, negative value otherwise.
Remove profile from the list of profiles . @param dev Pointer to the device . @param meter_profile_id Id of the profile to remove . @param error Pointer to the error . @returns 0 on success negative value otherwise .
static int
mrvl_meter_profile_delete(struct rte_eth_dev *dev,
			      uint32_t meter_profile_id,
			      struct rte_mtr_error *error)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct mrvl_mtr_profile *profile;
	profile = mrvl_mtr_profile_from_id(priv, meter_profile_id);
	if (!profile)
		return -rte_mtr_error_set(error, ENODEV,
					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
					  NULL, "Profile id does not exist\n");
	if (profile->refcnt)
		return -rte_mtr_error_set(error, EPERM,
					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
					  NULL, "Profile is used\n");
	LIST_REMOVE(profile, next);
	rte_free(profile);
	return 0;
}
static int mrvl_meter_profile_delete ( struct rte_eth_dev * dev , uint32_t meter_profile_id , struct rte_mtr_error * error ) { struct mrvl_priv * priv = dev -> data -> dev_private ; struct mrvl_mtr_profile * profile ; profile = mrvl_mtr_profile_from_id ( priv , meter_profile_id ) ; if ( ! profile ) return - rte_mtr_error_set ( error , ENODEV , RTE_MTR_ERROR_TYPE_METER_PROFILE_ID , NULL , " \n " ) ; if ( profile -> refcnt ) return - rte_mtr_error_set ( error , EPERM , RTE_MTR_ERROR_TYPE_METER_PROFILE_ID , NULL , " \n " ) ; LIST_REMOVE ( profile , next ) ; rte_free ( profile ) ; return 0 ; }
Remove profile from the list of profiles.
Remove profile from the list of profiles .