[RFC PATCH 1/7] telemetry: rename unsigned 64-bit enum value to uint

Tyler Retzlaff roretzla at linux.microsoft.com
Wed Dec 14 18:30:05 CET 2022


On Tue, Dec 13, 2022 at 06:27:24PM +0000, Bruce Richardson wrote:
> For telemetry data, rather than having unsigned 64-bit values and signed
> 32-bit values, we want to just have unsigned and signed values, each
> stored with the max bit-width i.e. 64-bits. To that end, we rename the
> U64 enum entry to "UINT" to have a more generic name
> 
> For backward API-level compatibility, we can use a macro to alias the
> old name to the new.
> 
> Suggested-by: Morten Brørup <mb at smartsharesystems.com>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c
> index 34366ecee3..3c996484ec 100644
> --- a/lib/telemetry/telemetry_data.c
> +++ b/lib/telemetry/telemetry_data.c
> @@ -18,7 +18,7 @@ rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type)
>  	enum tel_container_types array_types[] = {
>  			RTE_TEL_ARRAY_STRING, /* RTE_TEL_STRING_VAL = 0 */
>  			RTE_TEL_ARRAY_INT,    /* RTE_TEL_INT_VAL = 1 */
> -			RTE_TEL_ARRAY_U64,    /* RTE_TEL_u64_VAL = 2 */
> +			RTE_TEL_ARRAY_U64,    /* RTE_TEL_UINT_VAL = 2 */
                        ^^^^^^^^^^^^^^^^^

is this supposed to be RTE_TEL_UINT_VAL?

>  			RTE_TEL_ARRAY_CONTAINER, /* RTE_TEL_CONTAINER = 3 */
>  	};
>  	d->type = array_types[type];
> @@ -173,7 +173,7 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d,
>  		return -EINVAL;
>  
>  	d->data_len++;
> -	e->type = RTE_TEL_U64_VAL;
> +	e->type = RTE_TEL_UINT_VAL;
>  	e->value.u64val = val;
>  	const size_t bytes = strlcpy(e->name, name, RTE_TEL_MAX_STRING_LEN);
>  	return bytes < RTE_TEL_MAX_STRING_LEN ? 0 : E2BIG;
> -- 
> 2.34.1


More information about the dev mailing list