[dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"

Stephen Hemminger stephen at networkplumber.org
Fri Sep 8 23:51:50 CEST 2017


On Fri, 8 Sep 2017 19:15:51 +0000
Yuyong Zhang <yuyong.zhang at casa-systems.com> wrote:

> Thanks Stephen for the quick response.
> 
> 
> 
> For performance considerations, which one is better:
> 
> 
> 
> 1.     Use –Wno-error=inline to turn off the warning which compiler will not do inline for the warned inline function
> 
> or
> 
> 2.     Modify dpdk header file to add __attribute__((always_inline)) to force complier to always do inline for these functions.
> 
> 
> 
> I assume option-2 is better for performance, any suggestions?
> 

The unlikely() branches are all error cases, there is no reason they should impact performance.
In fact excessive inline can cause code to grow and larger code causes more instruction cache misses.

Just use option 1.  You obviously already changed the compile flags because the default
DPDK make files have macro WERROR which does not enable this.


More information about the users mailing list