[dpdk-dev] [PATCH V6 2/3] ring: introduce new header file to include common functions

Jerin Jacob jerin.jacob at caviumnetworks.com
Sun Dec 3 13:13:21 CET 2017


-----Original Message-----
> Date: Sun, 26 Nov 2017 18:00:23 -0800
> From: Jia He <hejianet at gmail.com>
> To: jerin.jacob at caviumnetworks.com, dev at dpdk.org,
>  bruce.richardson at intel.com, konstantin.ananyev at intel.com
> Cc: olivier.matz at 6wind.com, jianbo.liu at arm.com, hemant.agrawal at nxp.com, Jia
>  He <hejianet at gmail.com>, Jia He <jia.he at hxt-semitech.com>
> Subject: [PATCH V6 2/3] ring: introduce new header file to include common
>  functions
> X-Mailer: git-send-email 2.7.4
> 
> move the common part of rte_ring.h into rte_ring_generic.h.
> move the memory barrier part into update_tail().
> 
> no functional changes here.
> 
> Signed-off-by: Jia He <jia.he at hxt-semitech.com>
> Suggested-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> Suggested-by: Ananyev, Konstantin <konstantin.ananyev at intel.com>

Wrong tag: complaint from checkpatch.
	Suggested-by: Ananyev, Konstantin <konstantin.ananyev at intel.com>

> ---
> + */
> +
> +#ifndef _RTE_RING_GENERIC_H_
> +#define _RTE_RING_GENERIC_H_
> +
> +static __rte_always_inline void
> +update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
> +		uint32_t single, uint32_t enqueue)
> +{

How about making enqueue as const. ie. const uint32_t enqueue ?

> +	if (enqueue)
> +		rte_smp_wmb();
> +	else
> +		rte_smp_rmb();

Other than that, it looks good to me.

Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>



More information about the dev mailing list