Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9791398imu; Wed, 5 Dec 2018 10:16:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/X5r8OSxXj5cPq/wXRjK8pBMrLTrKHCWQxr1AQqpRr5EfVu1/j4+mFAjioiuxXto6L+vlMY X-Received: by 2002:a62:4549:: with SMTP id s70mr25148328pfa.233.1544033812097; Wed, 05 Dec 2018 10:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544033812; cv=none; d=google.com; s=arc-20160816; b=bUkY69mx7TJLV1bByDUPiZERlbjPfFN0B2prVGyC2/4vwx4Yl4Jd7f/yXTcfN6IIXD dK91Kg+wQs3ldwN532N/CgMiQWGCMmm564CfXco1dbce/KFdKqKxGeATR5QL1uB74752 3lC2bmJuG0AzSUAFxYev6TTWZjwfZgWXjV4FBkQGsfmhCO3kUhmY7I3RFENxHzj925hY N/zCS9WU3ACz1il7imJEacxOWdHqYaxz1U4fq390xDoY2giYpaJUMwkzkscxerCFuHT+ H0WKd33AOj62JDQo1h0mFaS6oeP0e6rCem97YEX2LqEKAEpEmzj0g2RZJIIlfJRljRnP S3Hg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fZcO1g+9mBO9tHGBNor+JbFVraupZQp5mpsOD74w9TY=; b=TBpqAwtFWScFm3UiMHgNt+tDk11hkbFtulr55Ltu53J/bO1a/1ou7M0LTEjAnhYEkq wD8uptV5l/P8mKDEOTl64j9YJf7FMSNVAu5J/KFGrLo4uJoJT4OnUSG+S2BRvqviFFUu 9p4KxvAJZ7FVyPGIB/VaCyheGzwKflDbKuj68i0l26poBvjdc+5mVar3RSVs4ZxubNTY god42+h0CMSIF+DZcpHLFtRHdBFESL0XCSWDAnte936FulM6YbM4pTyOda9QiIFcQkmk wKJ5pwLfDUa/N4fnHYLpvh93I+9m/mP1T3g7UrsLZdbH9G4loeJaxdhwXLGNDeJ4VQ3q 06mg== 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 h68si22055293plb.375.2018.12.05.10.16.36; Wed, 05 Dec 2018 10:16:52 -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 S1728339AbeLESOl (ORCPT + 99 others); Wed, 5 Dec 2018 13:14:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbeLESOc (ORCPT ); Wed, 5 Dec 2018 13:14:32 -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 5E25F309178C; Wed, 5 Dec 2018 18:14:32 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.32.181.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32DEB1001F54; Wed, 5 Dec 2018 18:14:30 +0000 (UTC) From: Paolo Abeni To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paul Turner , linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 4/4] udp: use indirect call wrappers for GRO socket lookup Date: Wed, 5 Dec 2018 19:13:42 +0100 Message-Id: <02ef79435eeaca4d809674764f20ec4c7b11d499.1544032300.git.pabeni@redhat.com> In-Reply-To: References: 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.41]); Wed, 05 Dec 2018 18:14:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This avoids another indirect call for UDP GRO. Again, the test for the IPv6 variant is performed first. v1 -> v2: - adapted to INDIRECT_CALL_ changes Signed-off-by: Paolo Abeni --- net/ipv4/udp_offload.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 9a141a6cf1a0..64f9715173ac 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -392,6 +392,8 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head, return NULL; } +INDIRECT_CALLABLE_DECLARE(struct sock *udp6_lib_lookup_skb(struct sk_buff *skb, + __be16 sport, __be16 dport)); struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb, struct udphdr *uh, udp_lookup_t lookup) { @@ -403,7 +405,8 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb, struct sock *sk; rcu_read_lock(); - sk = (*lookup)(skb, uh->source, uh->dest); + sk = INDIRECT_CALL_INET(lookup, udp6_lib_lookup_skb, + udp4_lib_lookup_skb, skb, uh->source, uh->dest); if (!sk) goto out_unlock; @@ -503,7 +506,8 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff, uh->len = newlen; rcu_read_lock(); - sk = (*lookup)(skb, uh->source, uh->dest); + sk = INDIRECT_CALL_INET(lookup, udp6_lib_lookup_skb, + udp4_lib_lookup_skb, skb, uh->source, uh->dest); if (sk && udp_sk(sk)->gro_enabled) { err = udp_gro_complete_segment(skb); } else if (sk && udp_sk(sk)->gro_complete) { -- 2.19.2