Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1011305ybc; Sat, 16 Nov 2019 13:02:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzpQDKq3BWpynWxrEdNfBseLY9wo2hO28WEMy7l9yQvBTBH2OAaRvofp5IbLJF6zPxmtOIq X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr12733690ejb.157.1573938144897; Sat, 16 Nov 2019 13:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573938144; cv=none; d=google.com; s=arc-20160816; b=kUCOzdypKchLmCcay1db8xPEcJnZvrtlx+ExTbyi2aQnIyBHJ9R6DtiFziwt4o91ZX VP/ByRRzPYYG0Unsu4CecUCn5XNPvx/URYCIVz0Eihj4EQ5puoTWbZcMSlIpaC6eLwLz RyssdR98lEsrPKV7TpMr1FXnFg502zzrKnkZdp3H8EoKt4ipc1azgy2OCYDJYgJ9BAPe zxVADlWPuvIWZFGb05qyTp3R9LfzZ+fN/YdbHLIvSl1R2BMwk504xtBvCEtLRzthmLEu g/Rtduxj11a9+wyh+Gz8BxNDU+ynCtPBSWFu5h1frtHa/UmnsRxfpXfaZd05lxMtWFgj kzbw== 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:from:subject:cc:to:message-id:date; bh=33P6XRSJVgp5FMgc3MLkeHLrGEOMxKZI82S2PfAAomM=; b=ri5qRXBNbYle03BT5apkRnBWFPKd5KRMSIR01KOMAn4AwDHy1e5tqnSYhYp6qAWeEm K5X+Ve+QO3ru+uv7pX4l+1u4H9mrBCSY3aQ5j7h6FwZzyufGMO6q8nZdTbqW2WXZjgX0 dJotwe3wBlvtY7c/lronacTeennhotSAOymS+oj5oAkV/+wQlkKi1wosUKbOVgH/HJH9 yTBxrAVqnQWqsdykwFRC9pEKKy3qftINVVS8NMthlswXZdKIYs+iWEAtyV07rFhhjNCS i6s/WY1RLj4LKYGAdW4K1ONA8YnDYQ126YiAaGwv3dCwBUzF/OH0lTjpzAd884yVUmUU 7tog== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si8609894edw.352.2019.11.16.13.01.59; Sat, 16 Nov 2019 13:02:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbfKPVBD (ORCPT + 99 others); Sat, 16 Nov 2019 16:01:03 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:53748 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727485AbfKPVBD (ORCPT ); Sat, 16 Nov 2019 16:01:03 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:1e2::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id A1578151A15F1; Sat, 16 Nov 2019 13:01:01 -0800 (PST) Date: Sat, 16 Nov 2019 13:01:01 -0800 (PST) Message-Id: <20191116.130101.268806870571558138.davem@davemloft.net> To: alobakin@dlink.ru Cc: ecree@solarflare.com, jiri@mellanox.com, edumazet@google.com, idosch@mellanox.com, pabeni@redhat.com, petrm@mellanox.com, sd@queasysnail.net, f.fainelli@gmail.com, jaswinder.singh@linaro.org, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, linuxwifi@intel.com, kvalo@codeaurora.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 net-next] net: core: allow fast GRO for skbs with Ethernet header in head From: David Miller In-Reply-To: <20191115091135.13487-1-alobakin@dlink.ru> References: <20191115091135.13487-1-alobakin@dlink.ru> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 16 Nov 2019 13:01:02 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin Date: Fri, 15 Nov 2019 12:11:35 +0300 > Commit 78d3fd0b7de8 ("gro: Only use skb_gro_header for completely > non-linear packets") back in May'09 (v2.6.31-rc1) has changed the > original condition '!skb_headlen(skb)' to > 'skb->mac_header == skb->tail' in gro_reset_offset() saying: "Since > the drivers that need this optimisation all provide completely > non-linear packets" (note that this condition has become the current > 'skb_mac_header(skb) == skb_tail_pointer(skb)' later with commmit > ced14f6804a9 ("net: Correct comparisons and calculations using > skb->tail and skb-transport_header") without any functional changes). > > For now, we have the following rough statistics for v5.4-rc7: > 1) napi_gro_frags: 14 > 2) napi_gro_receive with skb->head containing (most of) payload: 83 > 3) napi_gro_receive with skb->head containing all the headers: 20 > 4) napi_gro_receive with skb->head containing only Ethernet header: 2 > > With the current condition, fast GRO with the usage of > NAPI_GRO_CB(skb)->frag0 is available only in the [1] case. > Packets pushed by [2] and [3] go through the 'slow' path, but > it's not a problem for them as they already contain all the needed > headers in skb->head, so pskb_may_pull() only moves skb->data. > > The layout of skbs in the fourth [4] case at the moment of > dev_gro_receive() is identical to skbs that have come through [1], > as napi_frags_skb() pulls Ethernet header to skb->head. The only > difference is that the mentioned condition is always false for them, > because skb_put() and friends irreversibly alter the tail pointer. > They also go through the 'slow' path, but now every single > pskb_may_pull() in every single .gro_receive() will call the *really* > slow __pskb_pull_tail() to pull headers to head. This significantly > decreases the overall performance for no visible reasons. ... > Signed-off-by: Alexander Lobakin Applied to net-next, thanks.