From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FE07C761A6 for ; Sat, 18 Mar 2023 05:22:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aowFUnATVgWEOU00lvie/+Tt+6r3PgQQve6hmf9MTAI=; b=InCajiZOzQpllV RfffbkkQ0S9a8RyWZpYEoGkDI4FwuNbwdfg2j/C+AurQu3XBtGQih1bpgZ1kiC0UpkFSjmmLohGzS jEeBcuNJZUYq/3Y7xP9n8U0It2gi9c6nur0ylIQtIU4mHH7p/Tr1aAHv7sqZiEAuKwCXhFrv9anmZ YqWxfFfJKVdHvuVovBCF0HI84a6kXhOijNhUokHY9rby+EOObN7ZLNtscuth/k80Zc9iPvkv4+M5Y 3lPc+N6BFxuk4+65QLgzQR7Z0DuTCE5fGAc5d6LIfnwCZ7a3d8wuyOO7luR4dqJyA7miLJPig5Mw/ qQFlTpF00NdsNGmI/xkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pdP0N-004Adl-1o; Sat, 18 Mar 2023 05:21:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pdP0L-004Ad6-0F for linux-arm-kernel@lists.infradead.org; Sat, 18 Mar 2023 05:21:22 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 1E3A860A0C; Sat, 18 Mar 2023 05:21:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E40A0C433D2; Sat, 18 Mar 2023 05:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679116879; bh=ArRYF4BA+E7Tyz1BYurYG5giIOqMsCRLQshVwP1KzDc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=obBbpX0QIRFajzPFiKavuEO5zhPk40CAT4gY88WL4IyupBpK4gsuXPsZMaOCT4TPE e6S6+n51fuWf0HzlpYrOptXdxgZU6Sq/FcblaBiR+vnlRENDjnoNVEMaL0vjMCrU9A z9qQq5vJXSs6vXxe3l5LRjlCOMKqC+ebv3TF4wI1Dx2KrpuYqZFBR0dQAoW2DlcbXc wywhFKzC0ovE1BTfFhIivZ8QGbDdRPTar6nBnSRwRXRq0ei8DHYBkHZ+DH+530CrLO DTjHkC8Ompu8DRdROTMy9QSCQB9FnZ8mMXfgaxmvNrvU2yYEBQvKQSXWJVe/r5gejk m2qqC7WlF+MTw== Date: Fri, 17 Mar 2023 22:21:17 -0700 From: Jakub Kicinski To: Jochen Henneberg Cc: netdev@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , Ong Boon Leong , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net V2 1/2] net: stmmac: Premature loop termination check was ignored on rx Message-ID: <20230317222117.3520d4cf@kernel.org> In-Reply-To: <20230316075940.695583-2-jh@henneberg-systemdesign.com> References: <20230316075940.695583-1-jh@henneberg-systemdesign.com> <20230316075940.695583-2-jh@henneberg-systemdesign.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230317_222121_176422_F12FB2BE X-CRM114-Status: GOOD ( 18.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 16 Mar 2023 08:59:39 +0100 Jochen Henneberg wrote: > The premature loop termination check makes sense only in case of the > jump to read_again where the count may have been updated. But > read_again did not include the check. > > Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support") > Signed-off-by: Jochen Henneberg > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index e4902a7bb61e..ea51c7c93101 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -5221,10 +5221,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) > len = 0; > } > > +read_again: > if (count >= limit) > break; Are you sure? Can you provide more detailed analysis? Do you observe a problem / error in real life or is this theoretical? As far as I can tell only path which jumps to read_again after doing count++ is via the drain_data jump, but I can't tell how it's discarding subsequent segments in that case.. > -read_again: > buf1_len = 0; > buf2_len = 0; > entry = next_entry; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel