Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp437571pxt; Thu, 12 Aug 2021 01:53:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV2HmN4dDZ3A0vz4N7OtnkzJyU/JmgWfYqHXQBx/v3sM38Jz/8bGN2KqZ2IQ5vzWyZRTLM X-Received: by 2002:aa7:c898:: with SMTP id p24mr4228875eds.120.1628758382070; Thu, 12 Aug 2021 01:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628758382; cv=none; d=google.com; s=arc-20160816; b=KHp3vsM2235gmXNCTUi19eSvhuFVFD4bQalKRR7Vx+NXt8hGOZDGRMVJHT6GXNAzNW N7Rr/oOPLWKPlnefNqAzg7EhpfNc8/1eCCQmktqQ1CQlZDeLD8VhmB8wSh4vMsZ3bMpX t8S67v8EF+eghgBGDgqIrLIenQXhKRSK76u1O5JwiMD93PFPLQjRQjFtD+uDA1GYLbri 1HzwVmEIv4K7FFzmtybGZufuQP1VjQBX/dr4v5XD3G4sBl3ubT+ALeBTr5QeyDP+fbEj 4DRsXHS0zQJw1fc+FEfhEegy3vt9bJLGNdAUK7Fhkfv9AVA1LJvHSICZgwD/q0LHGW1Y CU4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=XFHOGWal8sj9+/NYHXBYiZDttgCo8MQmZS41UjmAkWM=; b=d705Mh/lxhQrPVLDspxsR4uulSliLcUOxrJ6Ecl1rKJCn6NzOdKcknAXzMg25BHXdF TlIEsls/KIhomlSA4TF4Rt3Awb6YOUPQfb9jby2rjMb4KKoxUn1/pxtFg+I8OW67izmO /w26MAQaDfpxBple3HLtHzFa7QWu9L4gwJTsboHBjylLsxrejdBQu7YSCcwMRDnZOMCj bfUTHBl6OSHnSHRcxCzzM53xtSU3Wktp1rsoKRfIESLqeoF7PlTUWuGiPubUueMrXJse 6gTx6CqjCf0XbGmmoFAsbomr7bCEbSlE7B0sYyImmpBCh/2L7ZHkGHvJ1MhSfWTWj02p xqIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TnjSaR4d; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si1977093edq.235.2021.08.12.01.52.38; Thu, 12 Aug 2021 01:53:02 -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=@gmail.com header.s=20161025 header.b=TnjSaR4d; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbhHLIsi (ORCPT + 99 others); Thu, 12 Aug 2021 04:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234086AbhHLIsh (ORCPT ); Thu, 12 Aug 2021 04:48:37 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 475D4C061765; Thu, 12 Aug 2021 01:48:12 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id l34-20020a05600c1d22b02902573c214807so6501627wms.2; Thu, 12 Aug 2021 01:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XFHOGWal8sj9+/NYHXBYiZDttgCo8MQmZS41UjmAkWM=; b=TnjSaR4dryTzq1TobA28+orXVqNx8bWsy3a0BDE3S8ve2uQk0vvzGrrbjTMwiMYRSu oVjzvVawcmA5v/FzG6o/huElHZV975CDYv739sdz/9JH5w0uUHoUSi7yi8jRBbn1uNTT zvJsSwqBh8GTzIUL2tPTjPQqgUOXT3zMDi9/l9AAUyYP9dIqe26Np3bnJ8/i/5AHADWI jbawWkZMCmsbQsJ6wwucKu6p68bSRUQai3WBFGBt5h21VQCTzbU6pCZs6bWK68urVxlu y844gmcFrRUavm2O4zOoyiXRCizIHUYCHULo8yFjZXAWFWp0PVsiwkmnJvRMGMdF+zGo nG2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XFHOGWal8sj9+/NYHXBYiZDttgCo8MQmZS41UjmAkWM=; b=V1Ath9cMBrcXSNALHPEyYuWLn2i9XarB2k2NxDuQTIzndT2lQsGMF9tzqRUlVGW98c iu5bk1NBXaftAfyJRlDJWsLQBZUbq+s9+J65vD8YExiem5R3+yWB6QeGorPnBAgINNSK 7kMJwB4wR3UM9q6OlhQk/y3Skmo/K9LvJlqQ6IrmuveK9WiantKAvYvawp1ZMEUuXgtS GGEtl+t48FOFncB82WFp8i/zndMoeb3PEW+Ow2QXwlKPIrj7klc4XGPWf9eUNyGM+k8N AnRot5coy1fGOlNYCWbHvEPJ4bSlEQSN2j9yfhM6gm8VZ9fEYPmbNxOZQrmnnHgBcH46 nN0g== X-Gm-Message-State: AOAM5306KXkyuMkN6PSgjTP2AARUu+JFfEyzcBgcY0gnvXd1297HbBxa 96LgM7VYCdMOX8Xyr5dN1Zg= X-Received: by 2002:a05:600c:b51:: with SMTP id k17mr2779184wmr.149.1628758090954; Thu, 12 Aug 2021 01:48:10 -0700 (PDT) Received: from [10.0.0.18] ([37.165.173.167]) by smtp.gmail.com with ESMTPSA id p14sm8720305wmi.42.2021.08.12.01.48.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 01:48:10 -0700 (PDT) Subject: Re: [PATCH net-next] stmmac: align RX buffers To: Marc Zyngier Cc: Thierry Reding , Matteo Croce , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Giuseppe Cavallaro , Alexandre Torgue , "David S. Miller" , Jakub Kicinski , Palmer Dabbelt , Paul Walmsley , Drew Fustini , Emil Renner Berthing , Jon Hunter , Will Deacon References: <20210614022504.24458-1-mcroce@linux.microsoft.com> <871r71azjw.wl-maz@kernel.org> <202417ef-f8ae-895d-4d07-1f9f3d89b4a4@gmail.com> <87o8a49idp.wl-maz@kernel.org> From: Eric Dumazet Message-ID: Date: Thu, 12 Aug 2021 10:48:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87o8a49idp.wl-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/21 4:16 PM, Marc Zyngier wrote: > On Wed, 11 Aug 2021 13:53:59 +0100, > Eric Dumazet wrote: > >> Are you sure you do not need to adjust stmmac_set_bfsize(), >> stmmac_rx_buf1_len() and stmmac_rx_buf2_len() ? >> >> Presumably DEFAULT_BUFSIZE also want to be increased by NET_SKB_PAD >> >> Patch for stmmac_rx_buf1_len() : >> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> index 7b8404a21544cf29668e8a14240c3971e6bce0c3..041a74e7efca3436bfe3e17f972dd156173957a9 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >> @@ -4508,12 +4508,12 @@ static unsigned int stmmac_rx_buf1_len(struct stmmac_priv *priv, >> >> /* First descriptor, not last descriptor and not split header */ >> if (status & rx_not_ls) >> - return priv->dma_buf_sz; >> + return priv->dma_buf_sz - NET_SKB_PAD - NET_IP_ALIGN; >> >> plen = stmmac_get_rx_frame_len(priv, p, coe); >> >> /* First descriptor and last descriptor and not split header */ >> - return min_t(unsigned int, priv->dma_buf_sz, plen); >> + return min_t(unsigned int, priv->dma_buf_sz - NET_SKB_PAD - NET_IP_ALIGN, plen); >> } >> >> static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv, > > Feels like a major deficiency of the original patch. Happy to test a > more complete patch if/when you have one. I wont have time in the immediate future. Matteo, if you do not work on a fix, I suggest we revert a955318fe67ec0d962760b5ee58e74bffaf649b8 stmmac: align RX buffers before a more polished version can be submitted.