]> git.droids-corp.org - dpdk.git/commitdiff
examples/l3fwd: add include for macro definition
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 15 Jun 2022 17:10:12 +0000 (18:10 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 26 Jun 2022 08:44:38 +0000 (10:44 +0200)
The header files "l3fwd_em.h" and "l3fwd_em_sequential.h" use the
"__rte_always_inline" macro but don't directly include "rte_common.h" to
get the definition of it. This inclusion is not necessary for
compilation, but the lack of it can confuse some indexers - such as
those in eclipse, which reports the lines:

"static __rte_always_inline uint16_t"

as possible definitions of a variable called "uint16_t". This confusion
leads to uint16_t being flagged as an unknown type in all other parts of
the project being indexed, e.g. across all of DPDK code.

Adding in the include of rte_common.h makes it clear to the indexer that
those lines are  part of a function definition, and that allows eclipse
to correctly recognise uint16_t as a type from stdint.h

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
examples/l3fwd/l3fwd_em.h
examples/l3fwd/l3fwd_em_sequential.h

index 11bd9518583187062cbe670750103152c5e14162..fe2ee59f6a9416e56eb9315a65c1267e0fbc78dc 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef __L3FWD_EM_H__
 #define __L3FWD_EM_H__
 
+#include <rte_common.h>
+
 static __rte_always_inline uint16_t
 l3fwd_em_handle_ipv4(struct rte_mbuf *m, uint16_t portid,
                     struct rte_ether_hdr *eth_hdr, struct lcore_conf *qconf)
index f426c508ef73063dbe23460389c0b6ceca9e73c2..d2f75edb8a657811ad500a5e4043a5b40c43a504 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef __L3FWD_EM_SEQUENTIAL_H__
 #define __L3FWD_EM_SEQUENTIAL_H__
 
+#include <rte_common.h>
+
 /**
  * @file
  * This is an optional implementation of packet classification in Exact-Match