DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vfio: fix stdbool usage without include
@ 2021-06-01  5:42 Christian Ehrhardt
  2021-06-01  7:25 ` Thomas Monjalon
  2021-06-01  8:28 ` [dpdk-dev] [PATCH v2] " Christian Ehrhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Ehrhardt @ 2021-06-01  5:42 UTC (permalink / raw)
  To: dev
  Cc: Nithin Dabilpuram, Anatoly Burakov, Thomas Monjalon, Christian Ehrhardt

This became visible by backporting the following for the 19.11 stable tree:
 c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"

The usage of type bool in the vfio code would require "#include
<stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
It happens that in eal_vfio_mp_sync.c it comes after "#include
<rte_log.h>".

And rte_log.h since 20.05 includes stdbool since this change:
 241e67bfe "log: add API to check if a logtype can log in a given level"
and thereby masks the issue in >20.05.

It should be safe to include stdbool.h from rte_vfio.h itself
to have bool present exactly when needed for the struct it defines
using that type.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 lib/eal/include/rte_vfio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
index e7a87454bea..2d90b364801 100644
--- a/lib/eal/include/rte_vfio.h
+++ b/lib/eal/include/rte_vfio.h
@@ -14,6 +14,7 @@
 extern "C" {
 #endif
 
+#include <stdbool.h>
 #include <stdint.h>
 
 /*
-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] vfio: fix stdbool usage without include
  2021-06-01  5:42 [dpdk-dev] [PATCH] vfio: fix stdbool usage without include Christian Ehrhardt
@ 2021-06-01  7:25 ` Thomas Monjalon
  2021-06-01  7:43   ` Christian Ehrhardt
  2021-06-01  8:28 ` [dpdk-dev] [PATCH v2] " Christian Ehrhardt
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2021-06-01  7:25 UTC (permalink / raw)
  To: dev, Christian Ehrhardt
  Cc: Nithin Dabilpuram, Anatoly Burakov, Christian Ehrhardt

01/06/2021 07:42, Christian Ehrhardt:
> This became visible by backporting the following for the 19.11 stable tree:
>  c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"
> 
> The usage of type bool in the vfio code would require "#include
> <stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
> It happens that in eal_vfio_mp_sync.c it comes after "#include
> <rte_log.h>".
> 
> And rte_log.h since 20.05 includes stdbool since this change:
>  241e67bfe "log: add API to check if a logtype can log in a given level"
> and thereby masks the issue in >20.05.
> 
> It should be safe to include stdbool.h from rte_vfio.h itself
> to have bool present exactly when needed for the struct it defines
> using that type.

A line "Fixes" is missing for the record of the root cause.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] vfio: fix stdbool usage without include
  2021-06-01  7:25 ` Thomas Monjalon
@ 2021-06-01  7:43   ` Christian Ehrhardt
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Ehrhardt @ 2021-06-01  7:43 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Nithin Dabilpuram, Anatoly Burakov

On Tue, Jun 1, 2021 at 9:25 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 01/06/2021 07:42, Christian Ehrhardt:
> > This became visible by backporting the following for the 19.11 stable tree:
> >  c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"
> >
> > The usage of type bool in the vfio code would require "#include
> > <stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
> > It happens that in eal_vfio_mp_sync.c it comes after "#include
> > <rte_log.h>".
> >
> > And rte_log.h since 20.05 includes stdbool since this change:
> >  241e67bfe "log: add API to check if a logtype can log in a given level"
> > and thereby masks the issue in >20.05.
> >
> > It should be safe to include stdbool.h from rte_vfio.h itself
> > to have bool present exactly when needed for the struct it defines
> > using that type.
>
> A line "Fixes" is missing for the record of the root cause.

Thanks Thomas for having a look,
it is slightly up for debate what exactly the root cause is here, but I think
c13ca4e81cac that introduced using bool without adding a header is the
right reference.

I'll send a v2 with that added

>
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] vfio: fix stdbool usage without include
  2021-06-01  5:42 [dpdk-dev] [PATCH] vfio: fix stdbool usage without include Christian Ehrhardt
  2021-06-01  7:25 ` Thomas Monjalon
@ 2021-06-01  8:28 ` Christian Ehrhardt
  2021-06-02 11:06   ` Burakov, Anatoly
  1 sibling, 1 reply; 6+ messages in thread
From: Christian Ehrhardt @ 2021-06-01  8:28 UTC (permalink / raw)
  To: dev
  Cc: Nithin Dabilpuram, Anatoly Burakov, Thomas Monjalon, Christian Ehrhardt

This became visible by backporting the following for the 19.11 stable tree:
 c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"

The usage of type bool in the vfio code would require "#include
<stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
It happens that in eal_vfio_mp_sync.c it comes after "#include
<rte_log.h>".

And rte_log.h since 20.05 includes stdbool since this change:
 241e67bfe "log: add API to check if a logtype can log in a given level"
and thereby mitigates the issue.

It should be safe to include stdbool.h from rte_vfio.h itself
to be present exactly when needed for the struct it defines using that
type.

Fixes: c13ca4e81cac ("vfio: fix DMA mapping granularity for IOVA as VA")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 lib/eal/include/rte_vfio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
index e7a87454bea..2d90b364801 100644
--- a/lib/eal/include/rte_vfio.h
+++ b/lib/eal/include/rte_vfio.h
@@ -14,6 +14,7 @@
 extern "C" {
 #endif
 
+#include <stdbool.h>
 #include <stdint.h>
 
 /*
-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vfio: fix stdbool usage without include
  2021-06-01  8:28 ` [dpdk-dev] [PATCH v2] " Christian Ehrhardt
@ 2021-06-02 11:06   ` Burakov, Anatoly
  2021-06-17 15:41     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Burakov, Anatoly @ 2021-06-02 11:06 UTC (permalink / raw)
  To: Christian Ehrhardt, dev; +Cc: Nithin Dabilpuram, Thomas Monjalon

On 01-Jun-21 9:28 AM, Christian Ehrhardt wrote:
> This became visible by backporting the following for the 19.11 stable tree:
>   c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"
> 
> The usage of type bool in the vfio code would require "#include
> <stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
> It happens that in eal_vfio_mp_sync.c it comes after "#include
> <rte_log.h>".
> 
> And rte_log.h since 20.05 includes stdbool since this change:
>   241e67bfe "log: add API to check if a logtype can log in a given level"
> and thereby mitigates the issue.
> 
> It should be safe to include stdbool.h from rte_vfio.h itself
> to be present exactly when needed for the struct it defines using that
> type.
> 
> Fixes: c13ca4e81cac ("vfio: fix DMA mapping granularity for IOVA as VA")
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>   lib/eal/include/rte_vfio.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
> index e7a87454bea..2d90b364801 100644
> --- a/lib/eal/include/rte_vfio.h
> +++ b/lib/eal/include/rte_vfio.h
> @@ -14,6 +14,7 @@
>   extern "C" {
>   #endif
>   
> +#include <stdbool.h>
>   #include <stdint.h>
>   
>   /*
> 
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vfio: fix stdbool usage without include
  2021-06-02 11:06   ` Burakov, Anatoly
@ 2021-06-17 15:41     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-06-17 15:41 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: dev, Nithin Dabilpuram, Burakov, Anatoly

02/06/2021 13:06, Burakov, Anatoly:
> On 01-Jun-21 9:28 AM, Christian Ehrhardt wrote:
> > This became visible by backporting the following for the 19.11 stable tree:
> >   c13ca4e8 "vfio: fix DMA mapping granularity for IOVA as VA"
> > 
> > The usage of type bool in the vfio code would require "#include
> > <stdbool.h>", but rte_vfio.h has no direct paths to stdbool.h.
> > It happens that in eal_vfio_mp_sync.c it comes after "#include
> > <rte_log.h>".
> > 
> > And rte_log.h since 20.05 includes stdbool since this change:
> >   241e67bfe "log: add API to check if a logtype can log in a given level"
> > and thereby mitigates the issue.
> > 
> > It should be safe to include stdbool.h from rte_vfio.h itself
> > to be present exactly when needed for the struct it defines using that
> > type.
> > 
> > Fixes: c13ca4e81cac ("vfio: fix DMA mapping granularity for IOVA as VA")
> > 
> > Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> > 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-17 15:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01  5:42 [dpdk-dev] [PATCH] vfio: fix stdbool usage without include Christian Ehrhardt
2021-06-01  7:25 ` Thomas Monjalon
2021-06-01  7:43   ` Christian Ehrhardt
2021-06-01  8:28 ` [dpdk-dev] [PATCH v2] " Christian Ehrhardt
2021-06-02 11:06   ` Burakov, Anatoly
2021-06-17 15:41     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).