netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: "David Laight" <David.Laight@ACULAB.COM>,
	"'Josh Elsasser'" <jelsasser@appneta.com>,
	"Jeff Kirsher" <jeffrey.t.kirsher@intel.com>,
	"Björn Töpel" <bjorn.topel@intel.com>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"nhorman@redhat.com" <nhorman@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>,
	Andrew Bowers <andrewx.bowers@intel.com>
Subject: Re: [net-next 01/12] i40e: replace switch-statement to speed-up retpoline-enabled builds
Date: Mon, 6 May 2019 10:43:43 +0200	[thread overview]
Message-ID: <14dd60c5-0fb7-1fc5-9bf6-4cb1510a1abc@iogearbox.net> (raw)
In-Reply-To: <4b9338513f16457ea167da651c8b997b@AcuMS.aculab.com>

On 04/30/2019 12:42 PM, David Laight wrote:
> From: Josh Elsasser
>> Sent: 29 April 2019 21:02
>> On Apr 29, 2019, at 12:16 PM, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>>
>>> From: Björn Töpel <bjorn.topel@intel.com>
>>>
>>> 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
>>> result with an if-clause.
>>
>> Apologies for the noise, but is this patch still required after the
>> recent threshold bump[0] and later removal[1] of switch-case jump
>> table generation when building with CONFIG_RETPOLINE?
>>
>> [0]: https://lore.kernel.org/patchwork/patch/1044863/
>> [1]: https://lore.kernel.org/patchwork/patch/1054472/
>>
>> If nothing else the commit message no longer seems accurate.
> 
> Looking at those two patches, the second one seems wrong:
> 
>    # Additionally, avoid generating expensive indirect jumps which
>    # are subject to retpolines for small number of switch cases.
>    # clang turns off jump table generation by default when under
> -  # retpoline builds, however, gcc does not for x86.
> -  KBUILD_CFLAGS += $(call cc-option,--param=case-values-threshold=20)
> +  # retpoline builds, however, gcc does not for x86. This has
> +  # only been fixed starting from gcc stable version 8.4.0 and
> +  # onwards, but not for older ones. See gcc bug #86952.
> +  ifndef CONFIG_CC_IS_CLANG
> +    KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables)
> +  endif
> 
> If -fno-jump-tables isn't supported then --param=case-values-threshold=20
> needs to be set (if supported).

Nope, not really, -fno-jump-tables support predates the latter, and
both are supported for gcc versions the kernel cares about.

  reply	other threads:[~2019-05-06  8:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 19:16 [net-next 00/12][pull request] 40GbE Intel Wired LAN Driver Updates 2019-04-29 Jeff Kirsher
2019-04-29 19:16 ` [net-next 01/12] i40e: replace switch-statement to speed-up retpoline-enabled builds Jeff Kirsher
2019-04-29 20:01   ` Josh Elsasser
2019-04-30 10:42     ` David Laight
2019-05-06  8:43       ` Daniel Borkmann [this message]
2019-05-02 14:47   ` Daniel Borkmann
2019-05-02 20:29     ` Björn Töpel
2019-05-02 20:40       ` Jeff Kirsher
2019-05-02 20:56         ` Björn Töpel
2019-05-02 20:57           ` Jeff Kirsher
2019-04-29 19:16 ` [net-next 02/12] i40e: Fix for allowing too many MDD events on VF Jeff Kirsher
2019-04-29 19:16 ` [net-next 03/12] i40e: change behavior on PF in response to MDD event Jeff Kirsher
2019-04-29 19:16 ` [net-next 04/12] i40e: remove error msg when vf with port vlan tries to remove vlan 0 Jeff Kirsher
2019-04-29 19:16 ` [net-next 05/12] i40e: ShadowRAM checksum calculation change Jeff Kirsher
2019-04-29 19:16 ` [net-next 06/12] i40e: Report advertised link modes on 40GBase_LR4, CR4 and fibre Jeff Kirsher
2019-04-29 19:16 ` [net-next 07/12] i40e: Further implementation of LLDP Jeff Kirsher
2019-04-29 19:16 ` [net-next 08/12] i40e: remove out-of-range comparisons in i40e_validate_cloud_filter Jeff Kirsher
2019-04-29 19:16 ` [net-next 09/12] i40e: update version number Jeff Kirsher
2019-04-29 19:16 ` [net-next 10/12] i40e: fix misleading message about promisc setting on un-trusted VF Jeff Kirsher
2019-04-29 19:16 ` [net-next 11/12] i40e: print PCI vendor and device ID during probe Jeff Kirsher
2019-04-29 19:16 ` [net-next 12/12] i40e: Introduce recovery mode support Jeff Kirsher
2019-04-30  1:07   ` Jakub Kicinski
2019-05-02  9:20     ` Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14dd60c5-0fb7-1fc5-9bf6-4cb1510a1abc@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=David.Laight@ACULAB.COM \
    --cc=andrewx.bowers@intel.com \
    --cc=bjorn.topel@intel.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jelsasser@appneta.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).