Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4184466pxk; Tue, 8 Sep 2020 12:55:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/tpywTtxtbsICZppR8mbfTu5ZSKwlu8lhq4GgL5E7DsHltsuq/oWbicuP2XLask/9fZs9 X-Received: by 2002:a17:906:5488:: with SMTP id r8mr49367ejo.483.1599594900967; Tue, 08 Sep 2020 12:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599594900; cv=none; d=google.com; s=arc-20160816; b=YzHJO+V3nUGg6Wev1yGQRRJ8rKPQtEG9d4pXlBxd4huRMn9ieBbJhiN7vb3FAAEz8d slwvqEvNM9LO9qt3cEYvWHTvNe0Jlw2RBubdofTx34X7vh9uAES9auWcpKdvr46eLf9W ibniWDKRj9sClfCXzCtQtHJtNV/icU+05pM7zbemU7/aGS5Be6v/vBN0wR/CuT3xdw68 SpbO+STqsDrvGlFSEyfYUOaiquBcTA9zTM6iPMf16WW14t4ni39/9C52tmUu9TqMEGBm FTbn6R3YDzpMimjqAAJBjfw+7PJg/2GvRJ9sMyF9i4hEHM2dpgwkdMqqM74CetIOxYQG HN7Q== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=eMlsdbbqVDMD+xJZSb3yZoF6uWut7Nz0SjL9aJ0N25c=; b=Bx6tqli78Oc3HJni36rErhTIVhfKnchoA6kc+aBpeQQlp/UeLaWyK0hkaVO+QDjKGA oMgFbfdaVxJerOzW9PHI4xh9uYZkL1JihwT9wBlTrPgXp5WY5LCiXY8SjBeZPiqlmf9p sASaC3IHbiQRgsM/g9HR7lulTOESSz+nJgtkWGwf4K/vgHAh0Ja6qQFZM5ctvwCnS6IF akUuTvJ8jh9810C7ngdTblTtEAJ3U11YvfIugNUNDkX/uEHuRPv4OXelUWuxnfuo2p3p pPQWf0h75e4yPFdF1asngNKVD3iHnwax3NDxFTaaaj0Af027Bcx8fpqxuJr64bej+79B sizg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EJC+SgjW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si28627ejp.78.2020.09.08.12.54.37; Tue, 08 Sep 2020 12:55:00 -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=@kernel.org header.s=default header.b=EJC+SgjW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732196AbgIHTvw (ORCPT + 99 others); Tue, 8 Sep 2020 15:51:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:42672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730702AbgIHPt5 (ORCPT ); Tue, 8 Sep 2020 11:49:57 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B1C324859; Tue, 8 Sep 2020 15:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579917; bh=x6dG5iZPys6XcszX9f3KVT/6LcOENDa9YEo2YC63G9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EJC+SgjWj8lTrsk5TGrEdrnSLrfEOuAdBHLj6Yd7kSEAYq06NUWZYPi02x1qJpdYd Pn/Tqg3eUxu9Wvq+vtld1RBervnmRts7E79z0qBxGYxRiX8v7cUaeVjCYgcN1SDWY/ OTzRIyEFH6UdR2IvoYRI+rKldSkO7ApjdHS5/elA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Lobakin , Edward Cree , "David S. Miller" , Hyunsoon Kim Subject: [PATCH 5.4 086/129] net: core: use listified Rx for GRO_NORMAL in napi_gro_receive() Date: Tue, 8 Sep 2020 17:25:27 +0200 Message-Id: <20200908152234.000867723@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin commit 6570bc79c0dfff0f228b7afd2de720fb4e84d61d upstream. Commit 323ebb61e32b4 ("net: use listified RX for handling GRO_NORMAL skbs") made use of listified skb processing for the users of napi_gro_frags(). The same technique can be used in a way more common napi_gro_receive() to speed up non-merged (GRO_NORMAL) skbs for a wide range of drivers including gro_cells and mac80211 users. This slightly changes the return value in cases where skb is being dropped by the core stack, but it seems to have no impact on related drivers' functionality. gro_normal_batch is left untouched as it's very individual for every single system configuration and might be tuned in manual order to achieve an optimal performance. Signed-off-by: Alexander Lobakin Acked-by: Edward Cree Signed-off-by: David S. Miller Signed-off-by: Hyunsoon Kim Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5602,12 +5602,13 @@ static void napi_skb_free_stolen_head(st kmem_cache_free(skbuff_head_cache, skb); } -static gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb) +static gro_result_t napi_skb_finish(struct napi_struct *napi, + struct sk_buff *skb, + gro_result_t ret) { switch (ret) { case GRO_NORMAL: - if (netif_receive_skb_internal(skb)) - ret = GRO_DROP; + gro_normal_one(napi, skb); break; case GRO_DROP: @@ -5639,7 +5640,7 @@ gro_result_t napi_gro_receive(struct nap skb_gro_reset_offset(skb); - ret = napi_skb_finish(dev_gro_receive(napi, skb), skb); + ret = napi_skb_finish(napi, skb, dev_gro_receive(napi, skb)); trace_napi_gro_receive_exit(ret); return ret;