[PATCH 3/4] ethdev: add meter profile config calculation
Dumitrescu, Cristian
cristian.dumitrescu at intel.com
Thu May 19 16:55:03 CEST 2022
> diff --git a/lib/ethdev/rte_mtr.h b/lib/ethdev/rte_mtr.h
> index 40df0888c8..d7b916b168 100644
> --- a/lib/ethdev/rte_mtr.h
> +++ b/lib/ethdev/rte_mtr.h
> @@ -524,6 +524,30 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
> uint32_t meter_profile_id,
> struct rte_mtr_error *error);
>
> +/**
> + * Meter profile calculate
> + *
> + * Calculate CIR, CBS and EBS values for a given meter profile ID.
> + * Convert user-provided values to PMD-specific configuration.
> + *
> + * @param[in] port_id
> + * The port identifier of the Ethernet device.
> + * @param[in] meter_profile_id
> + * Meter profile ID. Needs to be the valid.
> + * @param[out] meter_profile_cfg
> + * Meter profile configuration filled by PMD.
> + * @param[out] error
> + * Error details. Filled in only on error, when not NULL.
> + * @return
> + * 0 on success, non-zero error code otherwise.
> + */
> +__rte_experimental
> +int
> +rte_mtr_meter_profile_calculate(uint16_t port_id,
> + uint32_t meter_profile_id,
> + void *meter_profile_cfg,
> + struct rte_mtr_error *error);
> +
> /**
> * Check whether a meter policy can be created on a given port.
> *
I don't understand the purpose of this proposed API function, can you please explain?
It looks to me that you want to have an alternative way to create a meter profile, so why not use the existing API function rte_mtr_meter_profile_add() ? It does the same thing.
Also, who allocates this opaque array meter_profile_cfg? Assuming it is the user that needs to allocate it, how does the user know its size?
More information about the dev
mailing list