[dpdk-dev,1/4] eal: introduce the rte macro for always inline

Message ID 20170513092728.30050-1-jerin.jacob@caviumnetworks.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob May 13, 2017, 9:27 a.m. UTC
  Different drivers use internal macros like force_inline for compiler
always inline feature.
Standardizing it through __rte_always_inline macro.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
This patch has the following false positive checkpatch warning:

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#26: FILE: lib/librte_eal/common/include/rte_common.h:108:
+#define __rte_always_inline inline __attribute__((always_inline))
---
 lib/librte_eal/common/include/rte_common.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Bruce Richardson May 15, 2017, 8:07 a.m. UTC | #1
On Sat, May 13, 2017 at 02:57:25PM +0530, Jerin Jacob wrote:
> Different drivers use internal macros like force_inline for compiler
> always inline feature.
> Standardizing it through __rte_always_inline macro.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---

Good cleanup.

Series Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson June 1, 2017, 11:57 a.m. UTC | #2
On Sat, May 13, 2017 at 02:57:25PM +0530, Jerin Jacob wrote:
> Different drivers use internal macros like force_inline for compiler
> always inline feature.
> Standardizing it through __rte_always_inline macro.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> This patch has the following false positive checkpatch warning:
> 
Definitely good to have.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson June 1, 2017, 11:59 a.m. UTC | #3
On Thu, Jun 01, 2017 at 12:57:30PM +0100, Bruce Richardson wrote:
> On Sat, May 13, 2017 at 02:57:25PM +0530, Jerin Jacob wrote:
> > Different drivers use internal macros like force_inline for compiler
> > always inline feature.
> > Standardizing it through __rte_always_inline macro.
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> > This patch has the following false positive checkpatch warning:
> > 
> Definitely good to have.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>

Just noticed I already acked this set before!
Can this please be merged soon, so we can have these macros available
for use in other patches.

Thanks,
/Bruce
  
Thomas Monjalon June 6, 2017, 8:35 p.m. UTC | #4
15/05/2017 10:07, Bruce Richardson:
> On Sat, May 13, 2017 at 02:57:25PM +0530, Jerin Jacob wrote:
> > Different drivers use internal macros like force_inline for compiler
> > always inline feature.
> > Standardizing it through __rte_always_inline macro.
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> 
> Good cleanup.
> 
> Series Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index e057f6e21..a9a749488 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -102,6 +102,11 @@  typedef uint16_t unaligned_uint16_t;
  */
 #define RTE_SET_USED(x) (void)(x)
 
+/**
+ * Force a function to be inlined
+ */
+#define __rte_always_inline inline __attribute__((always_inline))
+
 /*********** Macros for pointer arithmetic ********/
 
 /**