[PATCH v7 4/7] ring: make dump function more verbose

Morten Brørup mb at smartsharesystems.com
Thu Nov 7 12:49:34 CET 2024


> From: Konstantin Ananyev [mailto:konstantin.ananyev at huawei.com]
> Sent: Wednesday, 30 October 2024 22.23
> 
> From: Eimear Morrissey <eimear.morrissey at huawei.com>
> 
> The current rte_ring_dump function uses the generic rte_ring_headtail
> structure to access head/tail positions. This is incorrect for the RTS
> case where the head is stored in a different offset in the union of
> structs. Switching to a separate function for each sync type allows
> to dump correct head/tail values and extra metadata.
> 
> Signed-off-by: Eimear Morrissey <eimear.morrissey at huawei.com>
> ---
> +static const char *
> +ring_get_sync_type(const enum rte_ring_sync_type st)
> +{
> +	switch (st) {
> +	case RTE_RING_SYNC_ST:
> +		return "single thread";
> +	case RTE_RING_SYNC_MT:
> +		return "multi thread";
> +	case RTE_RING_SYNC_MT_RTS:
> +		return "multi thread - RTS";
> +	case RTE_RING_SYNC_MT_HTS:
> +		return "multi thread - HTS";
> +	default:
> +		return "unknown";
> +	}

I would prefer "ST", "MT" "MT_RTS" and "MT_HTS" instead of the "human readable" strings.

With or without suggested change,
Acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list