Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2629445ybt; Mon, 22 Jun 2020 03:15:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoctdmBWY0D/dSQMk8TIeAx8AWyc1UadH3+Kn59T02LZvq6FlzSfqRNNWhxZw6mj0RT1xN X-Received: by 2002:a17:906:8417:: with SMTP id n23mr1639558ejx.192.1592820929075; Mon, 22 Jun 2020 03:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592820929; cv=none; d=google.com; s=arc-20160816; b=U+xBTOKC03p9i1JELx/1/QayQ4gYECFb8p3lExGNizZH9JXAG1VRplm0tqI5Ph7KDz 20Lbq29cWHcbRG+B8QWRhNJqT9K9WaJ0KvKMUDlHUlJet+Zakb7BGEf1ncGhsIcoJucg pWrgzaKNDytMybio3BSmuHLCF8ObDHkDcKjIvXzIJ3eB4RUvait0CoWUz424l0nqvXnx CPTeMnUTjydby51FTlApcvmT4xDOq80Pq5pYYzbGV/2PlzgnMsNJfei3vs1tYHl6rNI+ 2UGKU4bREQE2uBKhDUl4BIGusD41BiK/Lv2IgrWS3H7jUAyvZ7SLoSn2vr9AXTM3s4Xp 2TVg== 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:dkim-signature; bh=69klgGVI1dkB36AMFFulBdvM0svnrLhrX7+lM5J9xrc=; b=EnyhwPyxs19Gp8S4VJ6tj/xU5mmQUbxgpdANqlEiGm5kbFC4J0zQ4qi9SXUpo2Xmrj gsVKFus/JyNfS/38fnNBSU+q7CiDjDGOinvHkmq6Zb3z4OPEl8rVpeCJdwXQMDFwgd+1 zng8vewb+3lPv6m+2ksHzHnDBvNmxMQItM7XfcmfwOEg/S/7KC9S6fiEEzVZeOBXeycC pHeX5BZOxBPv+A0mK/ybJGb/dmZk448GDSgbewtE8APpi1oUAbau0OamL+oXHrWpRLEJ 3fd5Jyth5XSm//8IgXVuU8ulInvT/2OQskTBI2rWCUwoY5vzuQd6fz4I2UfStMAuAwu9 adMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XASkgD2G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si9173273ejq.198.2020.06.22.03.15.06; Mon, 22 Jun 2020 03:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XASkgD2G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgFVKNM (ORCPT + 99 others); Mon, 22 Jun 2020 06:13:12 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:26543 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726515AbgFVKNL (ORCPT ); Mon, 22 Jun 2020 06:13:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592820790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=69klgGVI1dkB36AMFFulBdvM0svnrLhrX7+lM5J9xrc=; b=XASkgD2GHv3gznFmNGnre0CG8DDdNUtEzeR3+ttevEDPdpsczcxBdu1vvBej6feGwC/V4w m0lF+Yew3lIN9cH4gHAhNXO68hmqwOzLB23gAOeA+zIN/lUIqf6ylcONsQbcfbCClS5jQh +1uViRqM4zlAzfbcgA8DDHYyBHbksiU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-Tu-T-sZ6OluCyn6PgjnbLQ-1; Mon, 22 Jun 2020 06:13:08 -0400 X-MC-Unique: Tu-T-sZ6OluCyn6PgjnbLQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6E071005513; Mon, 22 Jun 2020 10:13:06 +0000 (UTC) Received: from ovpn-113-146.ams2.redhat.com (ovpn-113-146.ams2.redhat.com [10.36.113.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDCD55C1BD; Mon, 22 Jun 2020 10:13:04 +0000 (UTC) Message-ID: Subject: Re: [PATCH net-next 2/2] ipv6: fib6: avoid indirect calls from fib6_rule_lookup From: Paolo Abeni To: Brian Vazquez , Brian Vazquez , Eric Dumazet , "David S . Miller" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Luigi Rizzo Date: Mon, 22 Jun 2020 12:13:03 +0200 In-Reply-To: <20200620031419.219106-2-brianvv@google.com> References: <20200620031419.219106-1-brianvv@google.com> <20200620031419.219106-2-brianvv@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 2020-06-19 at 20:14 -0700, Brian Vazquez wrote: > @@ -111,11 +111,13 @@ struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6, > } else { > struct rt6_info *rt; > > - rt = lookup(net, net->ipv6.fib6_local_tbl, fl6, skb, flags); > + rt = pol_lookup_func(lookup, > + net, net->ipv6.fib6_local_tbl, fl6, skb, flags); > if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN) > return &rt->dst; > ip6_rt_put_flags(rt, flags); > - rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags); > + rt = pol_lookup_func(lookup, > + net, net->ipv6.fib6_main_tbl, fl6, skb, flags); > if (rt->dst.error != -EAGAIN) > return &rt->dst; > ip6_rt_put_flags(rt, flags); Have you considered instead factoring out the slice of fib6_rule_lookup() using indirect calls to an header file? it looks like here (gcc 10.1.1) it sufficent let the compiler use direct calls and will avoid the additional branches. Thanks! Paolo