gpu/cuda: fix build

Message ID 20220923082554.3832169-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series gpu/cuda: fix build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Thomas Monjalon Sept. 23, 2022, 8:25 a.m. UTC
  A recent commit removed errno.h from rte_common.h.
It has to be added in various places where it is used,
and wad implicitly included via rte_common.h,
but was forgotten in gpu/cuda.

As a result, the compilation is broken:
	drivers/gpu/cuda/gdrcopy.c:116:17: error: ‘ENOTSUP’ undeclared

Note that rte_errno.h does not include errno.h.
The include of errno.h is added.

Fixes: 72b452c5f259 ("eal: remove unneeded includes from a public header")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/gpu/cuda/common.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

David Marchand Sept. 23, 2022, 8:29 a.m. UTC | #1
On Fri, Sep 23, 2022 at 10:26 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> A recent commit removed errno.h from rte_common.h.
> It has to be added in various places where it is used,
> and wad implicitly included via rte_common.h,

was*

> but was forgotten in gpu/cuda.
>
> As a result, the compilation is broken:
>         drivers/gpu/cuda/gdrcopy.c:116:17: error: ‘ENOTSUP’ undeclared
>
> Note that rte_errno.h does not include errno.h.
> The include of errno.h is added.
>
> Fixes: 72b452c5f259 ("eal: remove unneeded includes from a public header")
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

I installed the cuda library headers and can confirm the build issue is fixed.

Tested-by: David Marchand <david.marchand@redhat.com>
  
David Marchand Sept. 23, 2022, 8:41 a.m. UTC | #2
On Fri, Sep 23, 2022 at 10:29 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Sep 23, 2022 at 10:26 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > A recent commit removed errno.h from rte_common.h.
> > It has to be added in various places where it is used,
> > and wad implicitly included via rte_common.h,
>
> was*
>
> > but was forgotten in gpu/cuda.
> >
> > As a result, the compilation is broken:
> >         drivers/gpu/cuda/gdrcopy.c:116:17: error: ‘ENOTSUP’ undeclared
> >
> > Note that rte_errno.h does not include errno.h.
> > The include of errno.h is added.
> >
> > Fixes: 72b452c5f259 ("eal: remove unneeded includes from a public header")
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Tested-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/drivers/gpu/cuda/common.h b/drivers/gpu/cuda/common.h
index 5144694d60..e809988503 100644
--- a/drivers/gpu/cuda/common.h
+++ b/drivers/gpu/cuda/common.h
@@ -6,6 +6,7 @@ 
 #define CUDA_COMMON_H
 
 #include <dlfcn.h>
+#include <errno.h>
 
 #include <rte_common.h>
 #include <rte_log.h>