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

From: Jesper Dangaard Brouer <[email-masked]>
Date: Mon, 21 Jan 2019 20:12:13 +0100

On Mon, 21 Jan 2019 17:53:45 +0100
Björn Töpel <[email-masked]> 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 for the
> case-values-threshold param for the i40e code. However, doing that
> would require a much broader testing, since there are a number of
> different places where a switch-statement is used. And depending on
> the context, a jump table might still be a better option.

I recently found out that it is possible to disable GCC attributes per
function basis.  See how I played with it here:
  https://github.com/xdp-project/xdp-project/blob/master/areas/dma/dma01_test_hellwig_direct_dma.org#investigate-overhead-of-bpf-indirect-retpoline

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer