Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp795971pxf; Thu, 18 Mar 2021 11:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDvkqzf4M+xHmk4Z0shlGREExvN+5qVUTBmPaN6ZfKQsyw1SwxTKQbyLOcTN7FEnAhe32e X-Received: by 2002:a17:906:ccde:: with SMTP id ot30mr42701689ejb.550.1616093039289; Thu, 18 Mar 2021 11:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616093039; cv=none; d=google.com; s=arc-20160816; b=LaHdLW9b03BSKhuPJWEwY7uCWIjSQW/+pS//eXObFhW1h05jUlsgQwijC2T1kkQ2qt of+zMzOYvY29W1Kx/g6Zsq50c4+fwa45DNMPCDKZpbXvc0sJvPx9rjd2/x8fhjSbMs7K 2T6AcscfC3K5UleFEkOOKTBpptuFqakPpMI67CbFVx0cCESUVHkYc4ykwpVQRLCgN77p NZzGRLj5OYjvmC3bYxbSCsXWRvCyVWjdhQArdenjX13fvZmzjg2hRR6GYsMkEtIa76Y7 0HRKr0wg+fqRzo0gZ8Agm56ujzPtyZlifp/DVJekbF1P2BSMS8gsTqO8XBc9uqaI8i4M TdeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=CZPzXPr6kxKmjKYiFth7lEmlditzWiKAt31a6bYz0BI=; b=MSV2YegPZtovY/KsLQbkKA8sC8SNFZtPSV12hc5a02siVIy4vBFTa0JlU8mS2SF8sY j//bLhCMTO5ycKP0Q0kO2SI8oMfcvcahoVxADHZbQ0NPccGoVXu1hOTzfClyA6jOCPvF GqHsgeOPvFaJ/DfP0GaWqXbkIHkHgiMaoejig7VLhM6OuiOjL9BvQDQ51YbFbFXxEZtV ft99zJyJXMRGOK/KCV1aaZ2IuNl3dYTN2CWfs/zet7I98ciUtp1BJj4MKzoy2WckCkrb QIqnoNguVgWb8vx19vxbH1jVvLO4P2bzVj3ouf6SCuigBZkPFoM0qsWI8043sfeSga3h REaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=FIaVLXSW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si2340984ejf.568.2021.03.18.11.43.37; Thu, 18 Mar 2021 11:43:59 -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=@pm.me header.s=protonmail header.b=FIaVLXSW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232699AbhCRSmn (ORCPT + 99 others); Thu, 18 Mar 2021 14:42:43 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:64866 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232624AbhCRSmf (ORCPT ); Thu, 18 Mar 2021 14:42:35 -0400 Date: Thu, 18 Mar 2021 18:42:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1616092953; bh=CZPzXPr6kxKmjKYiFth7lEmlditzWiKAt31a6bYz0BI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=FIaVLXSW92dxr8oytIZCizii/i9XUVemC0T7TIRFjAl8uwZpExxjQ7C3+J5qZMr4W wwTyCbbGbZndoyKBBvrGYBmryILMnlvz6RobHBpFBkBBdlQ1i1TT2nqw1WeCuAmYTB yDraprzPaWRcHKCv4BKVytT64iZCjXFeB0+XMqZ0rcFlVbUjB57tUVJR5QOtqCAwLe 8aayIKPCRWVZuQYFOvvVtuYaiA2kx+5bjFKjKFbrFMj9tR4Om6jX8PT0e8zpnuE4tC 5gpLrw10tKVeR7UODv2P8EOCVlvB5NLFkaXNCHs5srn/NlZ1MGgsv1ROlw4lXYt79u EP2wMyhm3hm4Q== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexander Lobakin , Mauro Carvalho Chehab , Kirill Tkhai , Bartosz Golaszewski , Leon Romanovsky , Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH net-next 2/4] gro: add combined call_gro_receive() + INDIRECT_CALL_INET() helper Message-ID: <20210318184157.700604-3-alobakin@pm.me> In-Reply-To: <20210318184157.700604-1-alobakin@pm.me> References: <20210318184157.700604-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org call_gro_receive() is used to limit GRO recursion, but it works only with callback pointers. There's a combined version of call_gro_receive() + INDIRECT_CALL_2() in , but it doesn't check for IPv6 modularity. Add a similar new helper to cover both of these. It can and will be used to avoid retpoline overhead when IP header lies behind another offloaded proto. Signed-off-by: Alexander Lobakin --- include/net/gro.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/net/gro.h b/include/net/gro.h index 27c38b36df16..01edaf3fdda0 100644 --- a/include/net/gro.h +++ b/include/net/gro.h @@ -14,4 +14,12 @@ INDIRECT_CALLABLE_DECLARE(int ipv6_gro_complete(struct s= k_buff *, int)); INDIRECT_CALLABLE_DECLARE(struct sk_buff *inet_gro_receive(struct list_hea= d *, =09=09=09=09=09=09=09 struct sk_buff *)); INDIRECT_CALLABLE_DECLARE(int inet_gro_complete(struct sk_buff *, int)); + +#define indirect_call_gro_receive_inet(cb, f2, f1, head, skb)=09\ +({=09=09=09=09=09=09=09=09\ +=09unlikely(gro_recursion_inc_test(skb)) ?=09=09=09\ +=09=09NAPI_GRO_CB(skb)->flush |=3D 1, NULL :=09=09\ +=09=09INDIRECT_CALL_INET(cb, f2, f1, head, skb);=09\ +}) + #endif /* _NET_IPV6_GRO_H */ -- 2.31.0