DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"
@ 2017-09-08 18:45 Yuyong Zhang
  2017-09-08 19:08 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Yuyong Zhang @ 2017-09-08 18:45 UTC (permalink / raw)
  To: users

Hi,



I got lots of compile warning when integrating dpdk library such as:



: error: inlining failed in call to ‘rte_mempool_ops_dequeue_bulk.part.1’: call is unlikely and code size would grow [-Werror=inline]



: error: inlining failed in call to ‘rte_pktmbuf_free": call is unlikely and code size would grow [-Werror=inline]



Because company policy strictly enforces "waring as error", I have to fix those issues.



I can have an option to use –Wno-error=inline in make file to suppress these warnings. However we are building data plane application, performance is one of the biggest requirements, thus another option is to modify header files such as in rte_mbuf.h to add __attribute__((always_inlie)) i.e adding:



static inline void rte_pktmbuf_free(struct rte_mbuf *m) __attribute__((always_inline));



static inline void rte_pktmbuf_free(struct rte_mbuf *m)



1.     The assumptions is that Intel and others do a lot of performance testing on the DPDK, and there are specific functions that are always inlined already, is it on purpose for inline functions such as rte_pktmbuf_free not using always_inline?

2.     Which one is better for performance: using –Wno-error=inline vs adding __attribute__((always_inline)) to warned inline function header files?



Any inputs are appreciated.



Regards,



Yuyong









^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"
  2017-09-08 18:45 [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow" Yuyong Zhang
@ 2017-09-08 19:08 ` Stephen Hemminger
  2017-09-08 19:15   ` Yuyong Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2017-09-08 19:08 UTC (permalink / raw)
  To: Yuyong Zhang; +Cc: users

On Fri, 8 Sep 2017 18:45:52 +0000
Yuyong Zhang <yuyong.zhang@casa-systems.com> wrote:

> Hi,
> 
> 
> 
> I got lots of compile warning when integrating dpdk library such as:
> 
> 
> 
> : error: inlining failed in call to ‘rte_mempool_ops_dequeue_bulk.part.1’: call is unlikely and code size would grow [-Werror=inline]
> 
> 
> 
> : error: inlining failed in call to ‘rte_pktmbuf_free": call is unlikely and code size would grow [-Werror=inline]
> 
> 
> 
> Because company policy strictly enforces "waring as error", I have to fix those issues.

Turn off the warning, or fix the policy.

DPDK does lots of inlining and in some cases the code will be used in unlikely branchs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"
  2017-09-08 19:08 ` Stephen Hemminger
@ 2017-09-08 19:15   ` Yuyong Zhang
  2017-09-08 21:51     ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Yuyong Zhang @ 2017-09-08 19:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

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?



Thanks a lot.



Regards,



Yuyong







-----Original Message-----
From: Stephen Hemminger [mailto:stephen@networkplumber.org]
Sent: Friday, September 8, 2017 3:08 PM
To: Yuyong Zhang <yuyong.zhang@casa-systems.com>
Cc: users@dpdk.org
Subject: Re: [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"



On Fri, 8 Sep 2017 18:45:52 +0000

Yuyong Zhang <yuyong.zhang@casa-systems.com<mailto:yuyong.zhang@casa-systems.com>> wrote:



> Hi,

>

>

>

> I got lots of compile warning when integrating dpdk library such as:

>

>

>

> : error: inlining failed in call to ‘rte_mempool_ops_dequeue_bulk.part.1’: call is unlikely and code size would grow [-Werror=inline]

>

>

>

> : error: inlining failed in call to ‘rte_pktmbuf_free": call is unlikely and code size would grow [-Werror=inline]

>

>

>

> Because company policy strictly enforces "waring as error", I have to fix those issues.



Turn off the warning, or fix the policy.



DPDK does lots of inlining and in some cases the code will be used in unlikely branchs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow"
  2017-09-08 19:15   ` Yuyong Zhang
@ 2017-09-08 21:51     ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-09-08 21:51 UTC (permalink / raw)
  To: Yuyong Zhang; +Cc: users

On Fri, 8 Sep 2017 19:15:51 +0000
Yuyong Zhang <yuyong.zhang@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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-08 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08 18:45 [dpdk-users] compile warning in dpdk lib header files "error: inlining failed in call .... call is unlikely and code size would grow" Yuyong Zhang
2017-09-08 19:08 ` Stephen Hemminger
2017-09-08 19:15   ` Yuyong Zhang
2017-09-08 21:51     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).