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 18BE8EED616 for ; Thu, 12 Sep 2024 15:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RGGb9FTQhbQlSl2zkUkshNpo9DFPq1cWylUSZYPWkAs=; b=y8y//k7iU2RLOM0FlipvZjOO9a ymAGvDY+2Wx1Xu6NnjB7r7Nn4080YjueiI1kSDVxcL6AoRfELyoquRB93kn7+3WvfMJaEKGLZZ7Bq 4TUINuST1f1zDpwUVR3dbHC0laZPrMKaAS2cEwyGwCmdzUyS+oGiMPe/dgcLASQQvlbDyylhb1Wim YM31flubl1/BDnL4YKJ9Zn5HJoeYJca8CYM1EzBxpOL6FWIaZM+AqzZnsIamYuJwpP9Y5iCdkaK7v HHw2Oif7rt5l5QlsV0a7xrl6Tn+/3DkSPaVBNlgyYLwwy20VYJyc1Fxd30K/yzBZfYDK+r0ndVqmO jNZHN7QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1solvq-0000000Db1Z-0VtV; Thu, 12 Sep 2024 15:40:30 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soluh-0000000Dahn-3NT4 for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2024 15:39:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9D6C15C5B93; Thu, 12 Sep 2024 15:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12D59C4CEC3; Thu, 12 Sep 2024 15:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726155558; bh=PsbP6YmUG40fnhWdGtrZKl7z1KBrwr8/1/qnLtehBvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tU6FOm+E2UPgzTBO+hPEN0MmR61pBecN9uxcn9dW2BCy7Ye5D2HVdvmet/hdO03gK xd3apWcCZNXHrlnMvA9vw0RMS5nZ7bPofqk20OFENcYhO4cQhssZD5WoyxvElnnFZp F8JpDjZ4LZXdDfqnqatLPmVr4bEpqLTYPO4bSvTiXjlgrapwyx4/Dlb/On7EU4d2VX Kmb8c/xhld7Iyjb0WEyWeHyKvYfIB5FmSet9B4aWu8vhOxa1qsz8gWe6FMqjt3ZeWU 4EfkpgaTwtPFZVubrxoZco78iZ2M5rf6Eav7lob1/eMM6j3kVrUze46g0ilumRUbVD 0NmIMieBI0qHg== Date: Thu, 12 Sep 2024 16:39:13 +0100 From: Simon Horman To: KhaiWenTan Cc: Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Xiaolei Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Choong Yong Liang , Tan Khai Wen Subject: Re: [PATCH net 1/1] net: stmmac: Fix zero-division error when disabling tc cbs Message-ID: <20240912153913.GO572255@kernel.org> References: <20240912015541.363600-1-khai.wen.tan@linux.intel.com> <20240912153730.GN572255@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240912153730.GN572255@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_083919_906648_5F7816AF X-CRM114-Status: GOOD ( 15.09 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 12, 2024 at 04:37:30PM +0100, Simon Horman wrote: > On Thu, Sep 12, 2024 at 09:55:41AM +0800, KhaiWenTan wrote: > > The commit b8c43360f6e4 ("net: stmmac: No need to calculate speed divider > > when offload is disabled") allows the "port_transmit_rate_kbps" to be > > set to a value of 0, which is then passed to the "div_s64" function when > > tc-cbs is disabled. This leads to a zero-division error. > > > > When tc-cbs is disabled, the idleslope, sendslope, and credit values the > > credit values are not required to be configured. Therefore, adding a return > > statement after setting the txQ mode to DCB when tc-cbs is disabled would > > prevent a zero-division error. > > > > Fixes: b8c43360f6e4 ("net: stmmac: No need to calculate speed divider when offload is disabled") > > Cc: > > Co-developed-by: Choong Yong Liang > > Signed-off-by: Choong Yong Liang > > Signed-off-by: KhaiWenTan ... One more thing, if you do post an updated patch, please be sure to wait until 24h after the original patch was posted. https://docs.kernel.org/process/maintainer-netdev.html