[04/20] ring: fix missing includes for c11 model header

Message ID 20210114110606.21142-5-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series ensure headers have correct includes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Jan. 14, 2021, 11:05 a.m. UTC
  Add in the missing includes into the header file for c11 memory model,
so it can be compiled up independently of the other headers.

Fixes: 39368ebfc606 ("ring: introduce C11 memory model barrier option")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_ring/rte_ring_c11_mem.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

David Marchand Jan. 14, 2021, 12:57 p.m. UTC | #1
On Thu, Jan 14, 2021 at 12:07 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Add in the missing includes into the header file for c11 memory model,
> so it can be compiled up independently of the other headers.
>
> Fixes: 39368ebfc606 ("ring: introduce C11 memory model barrier option")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  lib/librte_ring/rte_ring_c11_mem.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
> index 0fb73a3371..12caf06a31 100644
> --- a/lib/librte_ring/rte_ring_c11_mem.h
> +++ b/lib/librte_ring/rte_ring_c11_mem.h
> @@ -10,6 +10,10 @@
>  #ifndef _RTE_RING_C11_MEM_H_
>  #define _RTE_RING_C11_MEM_H_
>
> +#include <stdint.h>
> +#include <rte_common.h>
> +#include <rte_ring_core.h>
> +

This header is never directly included, like rte_ring_generic.h.
I'd rather flag it as not being checked.
  
Ananyev, Konstantin Jan. 14, 2021, 1:54 p.m. UTC | #2
> 
> On Thu, Jan 14, 2021 at 12:07 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > Add in the missing includes into the header file for c11 memory model,
> > so it can be compiled up independently of the other headers.
> >
> > Fixes: 39368ebfc606 ("ring: introduce C11 memory model barrier option")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  lib/librte_ring/rte_ring_c11_mem.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
> > index 0fb73a3371..12caf06a31 100644
> > --- a/lib/librte_ring/rte_ring_c11_mem.h
> > +++ b/lib/librte_ring/rte_ring_c11_mem.h
> > @@ -10,6 +10,10 @@
> >  #ifndef _RTE_RING_C11_MEM_H_
> >  #define _RTE_RING_C11_MEM_H_
> >
> > +#include <stdint.h>
> > +#include <rte_common.h>
> > +#include <rte_ring_core.h>
> > +
> 
> This header is never directly included, like rte_ring_generic.h.
> I'd rather flag it as not being checked.

Yep, it is sort of 'internal' header that we need to keep public,
because of inlined  ring enqueue/dequeue functions.

> 
> 
> --
> David Marchand
  

Patch

diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
index 0fb73a3371..12caf06a31 100644
--- a/lib/librte_ring/rte_ring_c11_mem.h
+++ b/lib/librte_ring/rte_ring_c11_mem.h
@@ -10,6 +10,10 @@ 
 #ifndef _RTE_RING_C11_MEM_H_
 #define _RTE_RING_C11_MEM_H_
 
+#include <stdint.h>
+#include <rte_common.h>
+#include <rte_ring_core.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)