Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp933852pxb; Wed, 6 Apr 2022 04:43:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7wKpD6NP0wSPGgy+58a8g61OrtaKPw5q1qyU4WIimK3KaQA80PdWKgQbLzM3Lc+DhmqFT X-Received: by 2002:a63:6c8a:0:b0:398:5208:220a with SMTP id h132-20020a636c8a000000b003985208220amr6765861pgc.176.1649245403867; Wed, 06 Apr 2022 04:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245403; cv=none; d=google.com; s=arc-20160816; b=ULI7Enh3Lsizje4/162lWptFDl1NMsLLvXg+WRyiTNQfh1FsIKc+xdACdLlaCUkFkd UlNejMJLuRcJF6Bycdd+9iOXZ9eLsR+i0Hd662iKmcsgFQ0si5N+2SzLIDlkSmwsKyYc gDikRyZSn0WOrMZu418JW5Sw+tzr9Y5aRrK++islmYkp0S84K+YKE7FwXq8LIQLFfqlb IQIBNjEYJKkDOmi5cDxAgwbb5ugRJVbw8jZ2GzsdaIs0O9pR+QsgEXBj8Hly32iLjXdV 3raFg8mXmT3tqXqMRy8EUhosOycOVcf6yOdpFb3sytadkr6LRs2qM5HA4STvqvCzV11Y ZrRw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VINbWgfpfYFTftsbxfZVx2H3liTkYdiwjgXvG5H3QGo=; b=wRC+Fwq7lWllOJ7K20DxtBftq+xB7O6R6/RxLuAkcwENA+JW0bhFvHYAR6ahVcUKoR Yae5fLdpKyZ4xEJ0f/aqLp7riOBNndLtEYNHcGnV1+UkJwFdO5yqhmH1+uR4QSOUsJim GY4uJ+jOn7FOM5QVBrJ3vadJIp2UcXx+8gx0lCrJKj2rC7LsnrdG/RvYhuMowIGGSjfx dczUiwnEs1/6xGcoCq4xZXFZTf4AmIl4gG9cjsYSgU8siEGXuUSRTUlnL65TzpCk31XL XtNTtCDD1Fmfod8PWI6tFlkoRQRiBJqF9zVeG27TV20nh03rw4Gm5EngygNDRV5IYlLK D0Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O6dehrR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n12-20020a170902d2cc00b00153b2d16490si15774387plc.152.2022.04.06.04.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O6dehrR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C6E6378CD5; Wed, 6 Apr 2022 03:00:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580020AbiDEXdf (ORCPT + 99 others); Tue, 5 Apr 2022 19:33:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349000AbiDEJsy (ORCPT ); Tue, 5 Apr 2022 05:48:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964B4DF39; Tue, 5 Apr 2022 02:39:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D875AB81B14; Tue, 5 Apr 2022 09:38:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3264BC385A4; Tue, 5 Apr 2022 09:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151537; bh=hmvmRAYy5CtEgcjuSbZG6PGypBuHsaexWH+raY5jLm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6dehrR5N8XZHyHm+i44LjgA36FRCO3N5tGJ3aSMK0gS9OssshLHRwQabun5l9/Sz EWoWMWcp+e+RDrkhf8663V36CG6L2UMfrPmHEx95uuPujUCkOWKXuXATagTXQVS2B2 VsjeIqgxbPEhHZ7aYOntNm639xPwSTqECJa5vb1c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Lobakin , Michal Swiatkowski , Sandeep Penigalapati , Tony Nguyen , Sasha Levin Subject: [PATCH 5.15 414/913] ixgbe: dont reserve excessive XDP_PACKET_HEADROOM on XSK Rx to skb Date: Tue, 5 Apr 2022 09:24:36 +0200 Message-Id: <20220405070352.256852576@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin [ Upstream commit 8f405221a73a53234486c185d8ef647377a53cc6 ] {__,}napi_alloc_skb() allocates and reserves additional NET_SKB_PAD + NET_IP_ALIGN for any skb. OTOH, ixgbe_construct_skb_zc() currently allocates and reserves additional `xdp->data - xdp->data_hard_start`, which is XDP_PACKET_HEADROOM for XSK frames. There's no need for that at all as the frame is post-XDP and will go only to the networking stack core. Pass the size of the actual data only to __napi_alloc_skb() and don't reserve anything. This will give enough headroom for stack processing. Fixes: d0bcacd0a130 ("ixgbe: add AF_XDP zero-copy Rx support") Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index 7c17932a5e4e..36f43dc3a55e 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -208,13 +208,11 @@ static struct sk_buff *ixgbe_construct_skb_zc(struct ixgbe_ring *rx_ring, struct sk_buff *skb; /* allocate a skb to store the frags */ - skb = __napi_alloc_skb(&rx_ring->q_vector->napi, - xdp->data_end - xdp->data_hard_start, + skb = __napi_alloc_skb(&rx_ring->q_vector->napi, datasize, GFP_ATOMIC | __GFP_NOWARN); if (unlikely(!skb)) return NULL; - skb_reserve(skb, xdp->data - xdp->data_hard_start); memcpy(__skb_put(skb, datasize), xdp->data, datasize); if (metasize) skb_metadata_set(skb, metasize); -- 2.34.1