Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1021997imu; Fri, 7 Dec 2018 12:47:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/XpCKPF2My45xVpLwSPzNfj2D/d59OFIy9RjOTyYLEIWLmp3+5/nekBQWLwD3a1Lewyutzv X-Received: by 2002:a63:c303:: with SMTP id c3mr3260609pgd.268.1544215643631; Fri, 07 Dec 2018 12:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544215643; cv=none; d=google.com; s=arc-20160816; b=NrUbqJJVKzCWNftpjMGJEWljegf+ONJE5hTMK/Xy5FAk7B2wg78MbAMmpYv8dgQjER VNAHkmXjU4bMq9nOahDZ9GtNxyNy5UNajO808iblxdOjN6U7LWQlZRzzPQ6Gotgi7Lei 9qVk7d0F/ruSIYcRgI7giCF6t2FrMSE1Vz4AGnQKxuJq7bj0Wd9cX2xwMuPwVN98vqNN zIVZqMgm0HL4daDCAi1Hy7LqXQJXWGVOz7EYybVTkYw2qyh1JU32NdPxXd4+ASAcsO3u aSEkjNa7P818I4o3MV79qhDPOQ5wR56tVOG0Pud8DE3qic4B2ifrF8on3371bY57jUqh zuXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=AYeC/W3OTLef8OMkJ9HyW7qRrMmNm4mzM5HOTEtcbBc=; b=BfI/W124GiIrcehyD33J29KdsRKtJ0A2YPC/GBBy9hYJWVTytZuo9YTLDvJmR2cZ/s 7aOx3+FOB04s5YqQxNd8HAJujLxR6bzh4wdOGwL8iNX/AcEY/B1SdLMm806VH97IKQpy mujYozufNhUnP1ao+R/kgAriAfvhfyTAF6bEQK3BzYdlASk2xgYDzfEtR9QHq19i1gMO RjrnQbTe2ZfC5QB5GmnBkcXVq3ojd0z2nabvBTrqXDRHO2WLVG7qmfz4JGvMFB166mu9 Di2xh42rNN+4E/BNhDOCAiJ7SGDevYa+j3r57t7rEih3wf7gMKbWMiW2YBICqRF1XROj 1dgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si3658967pgh.224.2018.12.07.12.47.08; Fri, 07 Dec 2018 12:47:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726159AbeLGUqb (ORCPT + 99 others); Fri, 7 Dec 2018 15:46:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35546 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbeLGUqa (ORCPT ); Fri, 7 Dec 2018 15:46:30 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 832AEC04576C; Fri, 7 Dec 2018 20:46:30 +0000 (UTC) Received: from ovpn-116-97.ams2.redhat.com (ovpn-116-97.ams2.redhat.com [10.36.116.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id E683E1001F57; Fri, 7 Dec 2018 20:46:28 +0000 (UTC) Message-ID: Subject: Re: [PATCH net-next v2 1/4] indirect call wrappers: helpers to speed-up indirect calls of builtin From: Paolo Abeni To: David Woodhouse , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paul Turner , linux-kernel@vger.kernel.org Date: Fri, 07 Dec 2018 21:46:27 +0100 In-Reply-To: References: <07aaed31eb0b515c173138e1358c412157e58ec2.1544032300.git.pabeni@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 07 Dec 2018 20:46:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-12-07 at 09:46 +0000, David Woodhouse wrote: > On Wed, 2018-12-05 at 19:13 +0100, Paolo Abeni wrote: > > +/* > > + * We can use INDIRECT_CALL_$NR for ipv6 related functions only if ipv6 is > > + * builtin, this macro simplify dealing with indirect calls with only ipv4/ipv6 > > + * alternatives > > + */ > > +#if IS_BUILTIN(CONFIG_IPV6) > > +#define INDIRECT_CALL_INET(f, f2, f1, ...) \ > > + INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__) > > +#elif IS_ENABLED(CONFIG_INET) > > +#define INDIRECT_CALL_INET(f, f2, f1, ...) INDIRECT_CALL_1(f, f1, __VA_ARGS__) > > +#else > > +#define INDIRECT_CALL_INET(f, f2, f1, ...) f(__VA_ARGS__) > > +#endif > > + > > +#endif > > Thanks for working on this. > > I'm not stunningly keen on the part cited above. And it doesn't seem to > be working either, given Dave's later error and reversion. My bad, I did not test vs a relevant cfg. Hopefully that can be fixed. > I wonder if we can declare the common case functions as 'weak' so that > the link failures don't happen when they're absent. I experimented a previous version with alias. I avoided weak alias usage, because I [mis?]understood not all compilers have a complete support for them (e.g. clang). Also, with weak ref, a coding error that is now discovered at build time will result in worse performance at runtime, likely with some uncommon configuration, possibly not as easily detected. I'm unsure that would be better ?!? > Once we extend this past the network code, especially to file systems' > f_ops, I suspect we're going to want to use something like static keys > to patch the common cases at runtime — perhaps changing the f_ops > default according to what the root file system is, etc. I'm sorry, I don't follow here. I think static keys can't be used for the reported network case: we have different list elements each contaning a different function pointer and we access/use different ptr on a per packet basis. > I'd quite like to see the API for this taking that into account even if > it's left to be a future development. Again, I'm lost here. Can you please give more hints? Thanks, Paolo