From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FFAAC31680 for ; Mon, 21 Jan 2019 19:12:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 225AC20989 for ; Mon, 21 Jan 2019 19:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbfAUTMU convert rfc822-to-8bit (ORCPT ); Mon, 21 Jan 2019 14:12:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50622 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbfAUTMU (ORCPT ); Mon, 21 Jan 2019 14:12:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDC9187643; Mon, 21 Jan 2019 19:12:19 +0000 (UTC) Received: from localhost (ovpn-200-36.brq.redhat.com [10.40.200.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id C084060A9F; Mon, 21 Jan 2019 19:12:14 +0000 (UTC) Date: Mon, 21 Jan 2019 20:12:13 +0100 From: Jesper Dangaard Brouer To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Paul Menzel , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , intel-wired-lan , Netdev , Magnus Karlsson , "Karlsson, Magnus" , brouer@redhat.com Subject: Re: [Intel-wired-lan] [PATCH] i40e: replace switch-statement with if-clause Message-ID: <20190121201213.4cb33c97@redhat.com> In-Reply-To: References: <20190121163356.31332-1-bjorn.topel@gmail.com> <60f67e64-568c-bf04-5e9c-0429c5ae2882@molgen.mpg.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 21 Jan 2019 19:12:20 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 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