Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1701008pxb; Fri, 20 Aug 2021 11:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwadCIf6N1zzVyasCvom+lj+9UFtnAzYkDs4XKB4T5aw3NGjHxsBCjQpipoI8V9kz3CS2pE X-Received: by 2002:a05:6602:2cc5:: with SMTP id j5mr17196812iow.156.1629484944700; Fri, 20 Aug 2021 11:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629484944; cv=none; d=google.com; s=arc-20160816; b=MnsUayvl8ierS8PssUem1ipCUdSJZW0yP9hekYsrrry/Ab1TNWyox5tHah1VfcTYTw BVwb4IrF7nR2aDX9wNjYtpNGdUjfv79S+c9Pk/03jWHSTItlTkCshVlSMUCYKxZxsy3B HZQ/IV2ATfD9fsXlqQwKkbJMOk6FJwctrr4nsCo6dA7GqY0H7lJyw7kdQ1epe1Mw4Jx8 IbG+26wts/3G7TrndkbC18yiH9UGwfOgYrC0WV9R9CFFOs4zJQ9bYo0xonOSawKsMbyp RrLzNzxVw5VHBd7xsNpkvJR5x022KSEVdxWXW3DlcUxbMctSvBwDc6d7T2hjNeAnmhV4 P3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=2uq67aO6DiyD0swUlVE/etcF+9uqUnlf/jQqIo4F9dw=; b=d2pb+K9gMUt93RluzOQgr4rA/OrPxJ/y/vTi49ukPSkpQ3iyzPWpIYC9cQemK8GeFB iPKL4dm8Sm6nXVBnc2frKfkkUCanHdvsrYlDdUCggauMHIGxB+L6Tci9lRMEzJ6aeA/h UGhvxwsb3C8dzSlV4g5G+wPv0ozxHbJMxoPljtmcbsJwnRSmpbAMeQPAduzZ86Y2R3z8 81G3POkF/OrwWzK0p/z548703tX+ASU6Zuvh34l4tNWOxYkcuB1uBzD/lqHulVMZGrm2 JEJPj2ne/6TQCjgm4X/8Zb9lAbhMJ46E9jcpTBJZ6Qpy9kRdPY/HrZsIWY37kzvB3wAt ybhw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si6704378ioq.2.2021.08.20.11.42.12; Fri, 20 Aug 2021 11:42:24 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237552AbhHTSlm (ORCPT + 99 others); Fri, 20 Aug 2021 14:41:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbhHTSll (ORCPT ); Fri, 20 Aug 2021 14:41:41 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 505A760232; Fri, 20 Aug 2021 18:41:03 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mH9Rt-006GBI-8C; Fri, 20 Aug 2021 19:41:01 +0100 Date: Fri, 20 Aug 2021 19:41:00 +0100 Message-ID: <87bl5syn5v.wl-maz@kernel.org> From: Marc Zyngier To: Matteo Croce Cc: Eric Dumazet , Thierry Reding , netdev@vger.kernel.org, Linux Kernel Mailing List , linux-riscv , Giuseppe Cavallaro , Alexandre Torgue , "David S. Miller" , Jakub Kicinski , Palmer Dabbelt , Paul Walmsley , Drew Fustini , Emil Renner Berthing , Jon Hunter , Will Deacon Subject: Re: [PATCH net-next] stmmac: align RX buffers In-Reply-To: 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> <20210812121835.405d2e37@linux.microsoft.com> <874kbuapod.wl-maz@kernel.org> <87wnohqty1.wl-maz@kernel.org> <87fsv4qdzm.wl-maz@kernel.org> <87mtpcyrdv.wl-maz@kernel.org> <87h7fkyqpv.wl-maz@kernel.org> <87fsv4ypfn.wl-maz@kernel.org> <87eeaoyon3.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mcroce@linux.microsoft.com, eric.dumazet@gmail.com, thierry.reding@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, davem@davemloft.net, kuba@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, drew@beagleboard.org, kernel@esmil.dk, jonathanh@nvidia.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Aug 2021 19:14:22 +0100, Matteo Croce wrote: > > On Fri, Aug 20, 2021 at 8:09 PM Marc Zyngier wrote: > > > > On Fri, 20 Aug 2021 18:56:33 +0100, > > Matteo Croce wrote: > > > > > > On Fri, Aug 20, 2021 at 7:51 PM Marc Zyngier wrote: > > > > > > > > On Fri, 20 Aug 2021 18:35:45 +0100, > > > > Matteo Croce wrote: > > > > > > > > > > > > I think it's wrong. The original offset was 0, and to align it to the > > > > > > > boundary we need to add just NET_IP_ALIGN, which is two. > > > > > > > NET_SKB_PAD is a much bigger value, (I think 64), which is used to > > > > > > > reserve space to prepend an header, e.g. with tunnels. > > > > > > > > > > > > How about the other adjustments that Eric mentioned regarding the size > > > > > > of the buffer? Aren't they required? > > > > > > > > > > > > > > > > I guess that if stmmac_rx_buf1_len() needed such adjustment, it would > > > > > be already broken when XDP is in use. > > > > > When you use XDP, stmmac_rx_offset() adds a pretty big headroom of 256 > > > > > byte, which would easily trigger an overflow if not accounted. > > > > > Did you try attaching a simple XDP program on a stock 5.13 kernel? > > > > > > > > Yes, as mentioned in [1], to which you replied... > > > > > > > > M. > > > > > > > > [1] https://lore.kernel.org/r/87wnohqty1.wl-maz@kernel.org > > > > > > > > > > Great. > > > So I doubt that the adjustment is needed. > > > Does it work with all the frame size? > > > > I have no idea. Honestly, you are the one who should be able to answer > > these questions, given that you should have worked out how the buffer > > allocations work in this particular driver. > > > > This whole "let's try another random set of values until something > > sticks" is not how things ought to be done, and doesn't fill me with > > the utmost confidence that 5.14 (which apparently may well be cut in > > *two days*) is going to have a solid stmmac driver. > > > > I re-re-request that this patch gets reverted until you figure out > > what is wrong with the initial patch. > > > > Thanks, > > > > I would have done it, but I'll not have the hardware until next week at least, > otherwise I'd have tried all these tests myself. > > I'm sure that NET_SKB_PAD doesn't need to be there, if just removing > it fixes the problem, consider applying it and put a Fixes tag. No, I don't think that's the right thing to do. A patch breaks a driver, and the author of the patch is not in a position to fix it. That's OK, these things happen, it's just bad timing. But I don't understand this part of the kernel well enough to submit a patch based on a sample of *one*, at the last minute, just because "it works for me", and have the confidence that it doesn't break anything else. I have now posted a revert of the original patch[1]. I'll be happy to work with you, with a less pressure, in order to have something that works for everyone in the next cycle. Thanks, M. [1] https://lore.kernel.org/netdev/20210820183002.457226-1-maz@kernel.org -- Without deviation from the norm, progress is not possible.