Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp842490rwb; Wed, 16 Nov 2022 08:20:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf55BHNp5rqgnYlEh4IKkbbXdwAIOro4jdIS7Ax/SvaU9S/Ff7GkjQhVWQDaBm88bMaZMC/l X-Received: by 2002:a17:907:8c08:b0:78c:2c03:804c with SMTP id ta8-20020a1709078c0800b0078c2c03804cmr18713056ejc.107.1668615647563; Wed, 16 Nov 2022 08:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615647; cv=none; d=google.com; s=arc-20160816; b=vsxPYff4Ae3ptLj6sCWsDakrSCjZxjECXJKe4TjEpgsZY+KwP2gXgkYBQUPXRMlXR1 H/gTi1kxwWNbHwYV0Oqg7z2eo4l6Cd4vc8G3Qlsxf4lkprR1Cw2WzcKOOLnoDWuaQajG kt8/q4sD8Z6M+1RDMTxAIrIgJRsQpO+niCKryE1UXqe6cDCjiu7i6yRvrAHdpRYWzVSY ly0FtcyeAcf+M+aEZxKT1zCMndnO9j2V+yVXpczbK0yXQ21MC1h8T5mwZCPYYkii5Tlz +yEgmJCK7VSEClJcuOOdCU1esah2GPGlDk2X6h7SsJp1vehM0D58PT0k9Gjv1eXKq/d4 1AjQ== 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:date:subject:cc:to:from :dkim-signature; bh=dVxxYz/Xwaxo+DgxgJ14SDniPpnywgt2pHW45VTrdlE=; b=lsIkak11n9/uZX6q49pStx9O7xQbuz2LIMrmucoHY7A2pAO0BrsUytdCIXY7XeBJl9 VALnsg1zxVM2UuZ/3m5v+filNLVFIypmIMH1byGbpAZ9iSEmN9u+Wh3DXG4CvpWcPxFD O+PtTawvnWD6PleOu2+L37L+X0OABfK5vw5lk/rgOH1QIOhpqgCXfd1sWKNFFQA8XNdT pd2KUusBLaJf+YqTc5PZ6QPB//e9qmLLiub4g1CRCCVnWGs1N0Yp36I0QG+HWmT7t+By AOPX/R4J0TX6lqTrrXm6xMhQsScmM5aI7JmihL4O0oBWwiFGNj24sIkdkhpO0t9jHF6H 4DDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XC08bUuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd17-20020a170907629100b007add1f44d35si14394553ejc.963.2022.11.16.08.20.24; Wed, 16 Nov 2022 08:20:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XC08bUuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232869AbiKPPqF (ORCPT + 91 others); Wed, 16 Nov 2022 10:46:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233016AbiKPPqA (ORCPT ); Wed, 16 Nov 2022 10:46:00 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAAD827917; Wed, 16 Nov 2022 07:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668613558; x=1700149558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1/gkxejWIA7ingIPW/2Fo+kxpItp23dI6rVvmXK6vEs=; b=XC08bUuMhTnfnU2IKwr/m0M+YcRuBG0cxPZCEZiXJ7A6KOi0mhySistE KVB03LAn6+CZb0Y7998scwIABgw70GZxrzKWdl+7F2waOxr0TdT5uywXi tDN7us5xeaM84hQX0IuJrVAuxxvhMqsVUO51jFI2PMiNQyLDmARgwfohO yteXm5ZGKbEteO8CLFp2Jjv4pB8CslyyQ9qBjuMOhqEaeZwNSHRJw9L5d 9rmIHK6+TLBTn+049SfpdSCo+TVc+4mbgLe504M+mKW8IJS2oAeXM34IC KARUeIamPL2pyrHr6cWj4AXXvYItX1Ci0iIVd90DE/kGR4+bQToWu9QFp g==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="311282694" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="311282694" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 07:45:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="814125429" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="814125429" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga005.jf.intel.com with ESMTP; 16 Nov 2022 07:45:55 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 2AGFjstk031345; Wed, 16 Nov 2022 15:45:54 GMT From: Alexander Lobakin To: Horatiu Vultur Cc: Alexander Lobakin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next v2 1/5] net: lan966x: Add XDP_PACKET_HEADROOM Date: Wed, 16 Nov 2022 16:45:28 +0100 Message-Id: <20221116154528.3390307-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221115214456.1456856-2-horatiu.vultur@microchip.com> References: <20221115214456.1456856-1-horatiu.vultur@microchip.com> <20221115214456.1456856-2-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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: Horatiu Vultur Date: Tue, 15 Nov 2022 22:44:52 +0100 > Update the page_pool params to allocate XDP_PACKET_HEADROOM space as > headroom for all received frames. > This is needed for when the XDP_TX and XDP_REDIRECT are implemented. > > Signed-off-by: Horatiu Vultur [...] > @@ -466,6 +470,7 @@ static struct sk_buff *lan966x_fdma_rx_get_frame(struct lan966x_rx *rx, > > skb_mark_for_recycle(skb); > > + skb_reserve(skb, XDP_PACKET_HEADROOM); Oh, forgot to ask previously. Just curious, which platforms do usually have this NIC? Do those platforms have CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS set? If no, then adding %NET_SKB_PAD to the headroom can significantly improve performance, as currently you have 28 bytes of IFH + 14 bytes of Eth header, so IP header is not aligned to 4 bytes boundary. Kernel and other drivers often expect IP header to be aligned. Adding %NET_SKB_PAD to the headroom addresses that. ...but be careful, I've just realized that you have IFH in front of Eth header, that means that it will also become unaligned after that change, so make sure you don't access it with words bigger than 2 bytes. Just test all the variants and pick the best :D > skb_put(skb, FDMA_DCB_STATUS_BLOCKL(db->status)); > > lan966x_ifh_get_timestamp(skb->data, ×tamp); > @@ -786,7 +791,8 @@ static int lan966x_fdma_get_max_frame(struct lan966x *lan966x) > return lan966x_fdma_get_max_mtu(lan966x) + > IFH_LEN_BYTES + > SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + > - VLAN_HLEN * 2; > + VLAN_HLEN * 2 + > + XDP_PACKET_HEADROOM; > } [...] > -- > 2.38.0 Thanks, Olek