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 D85B2C6FD1C for ; Tue, 14 Mar 2023 15:05:46 +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:Message-ID:In-reply-to: Date:Subject:Cc:To:From:References:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ADIErJh27nmjRpu0JWODKjTvQ4P17r85cPWbvbl4D08=; b=GCwKmFhwtTd+Pr L2FjyRqI/TGoJgIrL3W9QZq7+X6Eg4UauCpyzdYJN7QW8Ivro+5n9Ty+RSc7E1pRUbVtJLtNDgmKg 0BRzh45X7Wlar1eIS88Uy/j1zse/KJJCYXF2dH8BmDgnvXqAKQBLr6whMoo8NwKJXzOD42Ez7RLGi sTTvR25SQvrdWgydo/QFsnlzPx/H6HTdw3f7MLmHNFbvMz7w3W1LrMlk55hcmsWe3A4nLY/FyAh0Z jZf3qgQHB3nV4sdy8uI99SXdDhv9MFWre+Y2NfuoOA1iB227J+u9WNqaAmSZ4Axsd30HxL959XZIf FDMeOiobMVcnOa3z86tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pc6Cx-00AXrC-1K; Tue, 14 Mar 2023 15:04:59 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pc6Cu-00AXqa-0o for linux-arm-kernel@lists.infradead.org; Tue, 14 Mar 2023 15:04:58 +0000 Received: from maxwell ([109.43.51.107]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MirfG-1q7s7C21hs-00exTj; Tue, 14 Mar 2023 16:04:10 +0100 References: <20230314123759.132521-1-jh@henneberg-systemdesign.com> <20230314123759.132521-2-jh@henneberg-systemdesign.com> User-agent: mu4e 1.8.14; emacs 28.2 From: Jochen Henneberg To: Piotr Raczynski Cc: netdev@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , 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 1/2] net: stmmac: Premature loop termination check was ignored Date: Tue, 14 Mar 2023 16:01:11 +0100 In-reply-to: Message-ID: <878rfzgysa.fsf@henneberg-systemdesign.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Wm2ytKUEV+DxoSZFFVeK86m/t8EpAeUoSfliuYPGpl5SQt5RAgh e6KCsq7PxzEqWsy306OUb+dE2q0GAaFc9xLI2m5LEhIblLUO2f/QluyChJmWIhx6JjhaJme GUu8JIC9wCOmB5jzZgEfufDvVI1Bw+m82bg0HRaos5yqQb6d5paSo+lCgmNO0IVdm6tOWVH 26jGm1i/apkG0nctKwiLA== UI-OutboundReport: notjunk:1;M01:P0:NbTMfrKiRJU=;PKfWXhuZIT2Oe5LyhecyZpuYd8O gadBhi9lAMrFbjqC6m0y+TJ7eB18Fl7eF6jTpq75i+mte3L8NJjOJ+ii4LDfso6crmSVyFEc7 UnBXTTREWWxhpfLXw2a8HVzKk7y+Z5O8SMDApZpOp1laWkRnxlXROIX2aPyjyO2m0cKPNt17x 950D/TBDtENQBhRHlS5hOb/x5gkNfeOnVS5asEZzESBmtV98cmP9zcU85GP8J31CYaXDg8nBZ 1Yb4WZE46t529pc+VDDFd7kJfWbVGWC5jS+eSXEY1slzmikelXqhgSjGIHz8nfRLpsCL/3bCE ypFx3HrcbX3MqY0tfgiNnymycxTpKVbxgopejbtq1KX4sWK79FY6ynri8HMSm4jpSvtJ9LR+b IVVeMOjzbte733kLpV4VqzfAPuSTcDjvmruRjeSXJ95j9PZxSSFdiBv9NyRf0jqy+U6WnmqR5 JEiajaCeYuBvzK4Pr3RD2zkRQNXis+PWSVeSWJDH099OPYHXZ2Vv55ZfpQAS98+HiY76ynFDv OBNI6CKweeIRPg6kGic2Mo21kk44bTE27LQ9Gu9eCWMFp9hisiP3Cv+tP6lSaZvXX/EwRU2Pi zJ+Knykx4Z1Jdj1tnFDocv5sShpnWMDn5ogOlev6p2JhHI9mB+iKMqZran2qkAzI4VPsa70gy liLELTqIj7l+vWnY1TA/mRQZ6bK+SvR6KjYv33vfPw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230314_080456_576153_EADE5D7A 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 Piotr Raczynski writes: > On Tue, Mar 14, 2023 at 01:37:58PM +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. > > Your commit titles and messages seems identical in both patches, someone > may get confused, maybe you could change commit titles at least? > > Or since those are very related one liner fixes, maybe combine them into > one? I was told to split them into a series because the fixes apply to different kernel versions. > > Also a question, since you in generally goto backwards here, is it guarded from > an infinite loop (during some corner case scenario maybe)? In theory I think this may happen, however, I would consider that to be a different patch since it addresses a different issue. > > Other than that looks fine, thanks. > Reviewed-by: Piotr Raczynski > >> >> 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; >> >> -read_again: >> buf1_len = 0; >> buf2_len = 0; >> entry = next_entry; >> -- >> 2.39.2 >> -- Henneberg - Systemdesign Jochen Henneberg Loehnfeld 26 21423 Winsen (Luhe) -- Fon: +49 172 160 14 69 Url: https://www.henneberg-systemdesign.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50B07C6FD1D for ; Tue, 14 Mar 2023 15:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbjCNPFM (ORCPT ); Tue, 14 Mar 2023 11:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbjCNPFK (ORCPT ); Tue, 14 Mar 2023 11:05:10 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E9C9E67C; Tue, 14 Mar 2023 08:05:09 -0700 (PDT) Received: from maxwell ([109.43.51.107]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MirfG-1q7s7C21hs-00exTj; Tue, 14 Mar 2023 16:04:10 +0100 References: <20230314123759.132521-1-jh@henneberg-systemdesign.com> <20230314123759.132521-2-jh@henneberg-systemdesign.com> User-agent: mu4e 1.8.14; emacs 28.2 From: Jochen Henneberg To: Piotr Raczynski Cc: netdev@vger.kernel.org, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , 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 1/2] net: stmmac: Premature loop termination check was ignored Date: Tue, 14 Mar 2023 16:01:11 +0100 In-reply-to: Message-ID: <878rfzgysa.fsf@henneberg-systemdesign.com> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Wm2ytKUEV+DxoSZFFVeK86m/t8EpAeUoSfliuYPGpl5SQt5RAgh e6KCsq7PxzEqWsy306OUb+dE2q0GAaFc9xLI2m5LEhIblLUO2f/QluyChJmWIhx6JjhaJme GUu8JIC9wCOmB5jzZgEfufDvVI1Bw+m82bg0HRaos5yqQb6d5paSo+lCgmNO0IVdm6tOWVH 26jGm1i/apkG0nctKwiLA== UI-OutboundReport: notjunk:1;M01:P0:NbTMfrKiRJU=;PKfWXhuZIT2Oe5LyhecyZpuYd8O gadBhi9lAMrFbjqC6m0y+TJ7eB18Fl7eF6jTpq75i+mte3L8NJjOJ+ii4LDfso6crmSVyFEc7 UnBXTTREWWxhpfLXw2a8HVzKk7y+Z5O8SMDApZpOp1laWkRnxlXROIX2aPyjyO2m0cKPNt17x 950D/TBDtENQBhRHlS5hOb/x5gkNfeOnVS5asEZzESBmtV98cmP9zcU85GP8J31CYaXDg8nBZ 1Yb4WZE46t529pc+VDDFd7kJfWbVGWC5jS+eSXEY1slzmikelXqhgSjGIHz8nfRLpsCL/3bCE ypFx3HrcbX3MqY0tfgiNnymycxTpKVbxgopejbtq1KX4sWK79FY6ynri8HMSm4jpSvtJ9LR+b IVVeMOjzbte733kLpV4VqzfAPuSTcDjvmruRjeSXJ95j9PZxSSFdiBv9NyRf0jqy+U6WnmqR5 JEiajaCeYuBvzK4Pr3RD2zkRQNXis+PWSVeSWJDH099OPYHXZ2Vv55ZfpQAS98+HiY76ynFDv OBNI6CKweeIRPg6kGic2Mo21kk44bTE27LQ9Gu9eCWMFp9hisiP3Cv+tP6lSaZvXX/EwRU2Pi zJ+Knykx4Z1Jdj1tnFDocv5sShpnWMDn5ogOlev6p2JhHI9mB+iKMqZran2qkAzI4VPsa70gy liLELTqIj7l+vWnY1TA/mRQZ6bK+SvR6KjYv33vfPw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Piotr Raczynski writes: > On Tue, Mar 14, 2023 at 01:37:58PM +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. > > Your commit titles and messages seems identical in both patches, someone > may get confused, maybe you could change commit titles at least? > > Or since those are very related one liner fixes, maybe combine them into > one? I was told to split them into a series because the fixes apply to different kernel versions. > > Also a question, since you in generally goto backwards here, is it guarded from > an infinite loop (during some corner case scenario maybe)? In theory I think this may happen, however, I would consider that to be a different patch since it addresses a different issue. > > Other than that looks fine, thanks. > Reviewed-by: Piotr Raczynski > >> >> 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; >> >> -read_again: >> buf1_len = 0; >> buf2_len = 0; >> entry = next_entry; >> -- >> 2.39.2 >> -- Henneberg - Systemdesign Jochen Henneberg Loehnfeld 26 21423 Winsen (Luhe) -- Fon: +49 172 160 14 69 Url: https://www.henneberg-systemdesign.com