Skip to contentSkip to conversation

dmadev: fix build if RTE_DMADEV_DEBUG enabled

PATCH Applied Stephen Hemminger 3 participants 6 messages Oct 27, 2025 – Nov 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmadev: fix build if RTE_DMADEV_DEBUG enabled

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")
---
 lib/dmadev/rte_dmadev.h | 1 +
 1 file changed, 1 insertion(+)
lib/dmadev/rte_dmadev.h +1 -0
index 0f4f10ec12..e3d7c9d0ca 100644
@@ -145,6 +145,7 @@
  */
 
 #include <stdint.h>
+#include <errno.h>
 
 #include <rte_bitops.h>
 #include <rte_common.h>
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Stephen Hemminger

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")
#2 lore raw
In reply to Stephen Hemminger
Quoted 4 lines · Stephen Hemminger

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

Quoted 8 lines
                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")

I am not following the rationale... 8f1d23ece06a removed a macro but use of errno was already there, so I am skeptical this is the right
Fixes: tag.

The issue was present from the start, so:

Fixes 91e581e5c924 ("dmadev: add data plane API")
Quoted 3 lines
Signature · 1 line
David Marchand
#3 lore raw
Quoted 15 lines · On Wed, 29 Oct 2025 14:48:13 +0100 David Marchand <[email protected]>…
Quoted 4 lines · Stephen Hemminger

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

Quoted 8 lines
                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")
Quoted 12 lines

I am not following the rationale... 8f1d23ece06a removed a macro but use of errno was already there, so I am skeptical this is the right
Fixes: tag.

The issue was present from the start, so:

Fixes 91e581e5c924 ("dmadev: add data plane API")
Quoted 3 lines

Yes, the fixes tag is incorrect. The issue probably goes back further in time. Might be related to tracepoints not including errno.h

#4 lore raw
Quoted 26 lines · Stephen Hemminger
Quoted 22 lines · On Wed, 29 Oct 2025 14:48:13 +0100 David Marchand <[email protected]>…
Quoted 4 lines · Stephen Hemminger

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

Quoted 8 lines
                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 8f1d23ece06a ("eal: deprecate RTE_FUNC_PTR_* macros")

I am not following the rationale... 8f1d23ece06a removed a macro but use of errno was already there, so I am skeptical this is the right
Fixes: tag.

The issue was present from the start, so:

Fixes 91e581e5c924 ("dmadev: add data plane API")
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Yes, the fixes tag is incorrect. The issue probably goes back further in time. Might be related to tracepoints not including errno.h

Tracepoints were added later.

$ git blame 91e581e5c924 -- lib/dmadev/rte_dmadev.h | grep -A3 -E
'#include|RTE_DMADEV_DEBUG'
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  147) #include <stdint.h>
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  148)
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  149) #include
<rte_bitops.h>
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  150) #include
<rte_common.h>
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  151) #include
<rte_compat.h>
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  152) #include <rte_dev.h>
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  153)
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  154) #ifdef __cplusplus
b36970f2e13 (Chengwen Feng 2021-10-13 20:24:55 +0800  155) extern "C" {
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  739) #include
"rte_dmadev_core.h"
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  740)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  741) /**@{@name
DMA operation flag
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  742)  * @see
rte_dma_copy()
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  801) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  802)     if
(!rte_dma_is_valid(dev_id) || length == 0)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  803)
return -EINVAL;
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  804)
RTE_FUNC_PTR_OR_ERR_RET(*obj->copy, -ENOTSUP);
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  851) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  852)     if
(!rte_dma_is_valid(dev_id) || src == NULL || dst == NULL ||
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  853)
nb_src == 0 || nb_dst == 0)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  854)
return -EINVAL;
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  898) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  899)     if
(!rte_dma_is_valid(dev_id) || length == 0)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  900)
return -EINVAL;
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  901)
RTE_FUNC_PTR_OR_ERR_RET(*obj->fill, -ENOTSUP);
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  931) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  932)     if
(!rte_dma_is_valid(dev_id))
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  933)
return -EINVAL;
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  934)
RTE_FUNC_PTR_OR_ERR_RET(*obj->submit, -ENOTSUP);
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  972) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  973)     if
(!rte_dma_is_valid(dev_id) || nb_cpls == 0)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  974)         return 0;
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800  975)
RTE_FUNC_PTR_OR_ERR_RET(*obj->completed, 0);
--
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800 1032) #ifdef
RTE_DMADEV_DEBUG
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800 1033)     if
(!rte_dma_is_valid(dev_id) || nb_cpls == 0 || status == NULL)
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800 1034)         return 0;
91e581e5c92 (Chengwen Feng 2021-10-13 20:24:57 +0800 1035)
RTE_FUNC_PTR_OR_ERR_RET(*obj->completed_status, 0);
Signature · 1 line
David Marchand
#5 lore raw
In reply to Stephen Hemminger
Quoted 11 lines · Stephen Hemminger

Missing definition of errnos causes build failure:

In file included from ../lib/dmadev/rte_dmadev_trace.h:16,

                 from ../lib/dmadev/rte_dmadev_trace_points.c:8:

../lib/dmadev/rte_dmadev.h: In function ‘rte_dma_copy’:
../lib/dmadev/rte_dmadev.h:1183:25: error: ‘EINVAL’ undeclared (first use in this function)
1183 | return -EINVAL;
| ^~~~~~

Bugzilla ID: 1814

Fixes 91e581e5c924 ("dmadev: add data plane API")
Quoted 2 lines

Applied, thanks.

Signature · 1 line
David Marchand