Re: [Intel-wired-lan] [PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread Björn Töpel
Den mån 21 jan. 2019 kl 20:12 skrev Jesper Dangaard Brouer : > > On Mon, 21 Jan 2019 17:53:45 +0100 > Björn Töpel wrote: > > > > If that jump tables are a common problem, I wonder, why the compiler > > > cannot be adapted to generate better performing code or an option passed > > > to the compiler

Re: [Intel-wired-lan] [PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread Jesper Dangaard Brouer
On Mon, 21 Jan 2019 17:53:45 +0100 Björn Töpel wrote: > > If that jump tables are a common problem, I wonder, why the compiler > > cannot be adapted to generate better performing code or an option passed > > to the compiler. > > > > It might make sense to use -fno-jump-tables or a better value

Re: [PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread Jesper Dangaard Brouer
On Mon, 21 Jan 2019 17:33:56 +0100 bjorn.to...@gmail.com wrote: > From: Björn Töpel > > GCC will generate jump tables for switch-statements with more than 5 > case statements. An entry into the jump table is an indirect call, > which means that for CONFIG_RETPOLINE builds, this is rather > expen

Re: [Intel-wired-lan] [PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread Björn Töpel
Den mån 21 jan. 2019 kl 17:42 skrev Paul Menzel : > > Dear Björn, > > > On 01/21/19 17:33, bjorn.to...@gmail.com wrote: > > From: Björn Töpel > > > > GCC will generate jump tables for switch-statements with more than 5 > > case statements. An entry into the jump table is an indirect call, > > whic

Re: [Intel-wired-lan] [PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread Paul Menzel
Dear Björn, On 01/21/19 17:33, bjorn.to...@gmail.com wrote: > From: Björn Töpel > > GCC will generate jump tables for switch-statements with more than 5 > case statements. An entry into the jump table is an indirect call, > which means that for CONFIG_RETPOLINE builds, this is rather > expensiv

[PATCH] i40e: replace switch-statement with if-clause

2019-01-21 Thread bjorn . topel
From: Björn Töpel GCC will generate jump tables for switch-statements with more than 5 case statements. An entry into the jump table is an indirect call, which means that for CONFIG_RETPOLINE builds, this is rather expensive. This commit replaces the switch-statement that acts on the XDP program