Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1919249imu; Fri, 14 Dec 2018 02:54:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOSO/qhZX4Uz0k7lQULk8I61bOQlV0BzyT5ba+q6sb7GQ7aMf+w2LUsy+zVKN2Ywt/WaSA X-Received: by 2002:a63:f515:: with SMTP id w21mr2275298pgh.220.1544784887408; Fri, 14 Dec 2018 02:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544784887; cv=none; d=google.com; s=arc-20160816; b=KxmPskp7lno3YQGk/oF/0KEoIX/RB2ygeHvMh85QWTu9Nf6xtHyqSunZgqtFZjji9/ y7JyAtgoKwU1gf9qYCmVoEXS34V5AVG12r/yKo2Rd+TOF94AmSbHeohzWbKz4w7Gbe3u YZNZbvJZ2ytoF4269gt8P7N4SuIewS74pbFXiP7W84a7VoOUEIU4uz94ZY5jiZBD0Iwu jL1gS5+xYzWXfNUccjcByDkH/c04i+iuLfMPBxRCN5smD0FNRkG+JDUdjUv4h6MXomLP 4006xCDddbQ1LapSG6nhqDWZlhppzViho3jjDQjtgd56cGxDbgbvxM9k7W8y1MgYn7CP F7Dw== 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=yvw12F9e+Altv6LFW89hFNvLAmvPPqQ/gq/9CTbktN30QuBbS5KNCQfjuFLqwdBPCT Ym0hALqN67VAmnfqTbPjseJvTf9reCnYQ2zAbKII5QpiyjkG18FlvJpWGSKUIXBPIQPv UfACDdvt9ohzKA3RzB5wAg1uRKaZdOcT5RE/PqWXuDbT3dkaf5bxSJe+7WGUDa8+MxHD +RiQOf3FQcnr/UX/CcZEfoTaxWPGNooiFt/n5e8CUKzTJtX8vxpgjoSmAsg8RSyd83x1 zmgQDbPnAEIJIXZVd7OtxYVOmdAFMDac4g9M1KAS5UdjFO9yGwfSkI5EwcSi7Xiu1YNh bviw== 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 ce11si4030840plb.420.2018.12.14.02.54.32; Fri, 14 Dec 2018 02:54:47 -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 S1729722AbeLNKwc (ORCPT + 99 others); Fri, 14 Dec 2018 05:52:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60816 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbeLNKw1 (ORCPT ); Fri, 14 Dec 2018 05:52:27 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 160FB306429A; Fri, 14 Dec 2018 10:52:27 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.32.181.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id A04C326FA9; Fri, 14 Dec 2018 10:52:25 +0000 (UTC) From: Paolo Abeni To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paul Turner , linux-kernel@vger.kernel.org, Edward Cree , David Woodhouse Subject: [PATCH net-next v3 4/4] udp: use indirect call wrappers for GRO socket lookup Date: Fri, 14 Dec 2018 11:52:00 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 14 Dec 2018 10:52:27 +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