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 508ABD37480 for ; Thu, 17 Oct 2024 12:33:02 +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=HRiIoUAIj3vACR008eeX7wuOVNoJfETHWN+XFmB344Q=; b=miiOH9mERcaH4uoueexDL22LFF PFs52A8vapGO28sQar+QiE/uBTCjPTPAkbumSVLKLM3stJUSAY6Z/ipsPepN7RR/ZOBqtAxv0KccZ yhEJTXuZAufn+EiXEH4F8LCeZHWqewR8JdazcjKDkZFBr9xMonsgS7pWVzT1bJDojF42JCZlgIR6k ivtA9dzW6xLX9Ce2l+c3TuPAFa+kKnrBp9/96Q9ME1+QMUsRb7MWJCAqJdenmr7+FoPhUa3uTR5/e z25iuZwmsyl4Osc9UJ4HFPiVfW8F3BHT6lRkhiDua/GLhc56eeJaHrhl919nYvfQuHYfJlM3AYRsb C0jHFPsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1PgN-0000000EmSf-02fL; Thu, 17 Oct 2024 12:32:47 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1PdO-0000000Eluj-0sYI for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 12:29:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 2F980A43D65; Thu, 17 Oct 2024 12:29:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E50C4CEC5; Thu, 17 Oct 2024 12:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729168180; bh=yd5Il7nYS8RK836o00Q0x0vsIfnv7ERNERDNUicu15c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ktuCV2Cgw0lV7EeBTGRZ3xOzke+9u/4WWh6TslyhJJMNwrCvw5axWh/HQdIn/LO+o gXVDPwJhQ12qwzNdmnWPoAxMOsAT3fcoEAAdOuZ+9DvmYbQy7zXZ29+TQFBislgAzr 8rdcC+nAxfpgKDz8ezw+rIFEFCnWfAwDmIry68FoZPstEhuSPQkkWe6HigQHCFhY2Q 9IlU8ja64MPGj8A8Q1EalGdG4AhEW2v3IT/SoV/di1IQmLPQjGn8HnxocagWVgv8Eo 3JutdfkML1Z/msj/4Fi590I6q4q/KrT3WHm3Spy3SbAhzYxdUkIMRuNjwiRy3zMLX0 iDN1kL1H8BxJQ== Date: Thu, 17 Oct 2024 13:29:36 +0100 From: Simon Horman To: Furong Xu <0x1207@gmail.com> Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vladimir Oltean , Andrew Lunn , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , xfr@outlook.com Subject: Re: [PATCH net-next v1 5/5] net: stmmac: xgmac: Complete FPE support Message-ID: <20241017122936.GF1697@kernel.org> References: <7b244a9d6550bd856298150fb4c083ca95b41f38.1728980110.git.0x1207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b244a9d6550bd856298150fb4c083ca95b41f38.1728980110.git.0x1207@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_052942_403988_9003514F X-CRM114-Status: GOOD ( 17.72 ) 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 Tue, Oct 15, 2024 at 05:09:26PM +0800, Furong Xu wrote: > FPE implementation for DWMAC4 and DWXGMAC differs only for: > 1) Offset address of MAC_FPE_CTRL_STS and MTL_FPE_CTRL_STS > 2) FPRQ(Frame Preemption Residue Queue) field in MAC_RxQ_Ctrl1 > > Refactor stmmac_fpe_ops callback functions to avoid code duplication > between gmac4 and xgmac. > > Signed-off-by: Furong Xu <0x1207@gmail.com> Hi Furong Xu, I think it would be best to split this patch so that the refactor of dwmac4 code is in one patch, and adding xgmac code is in another. ... > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c > index 6060a1d702c6..80f12b6e84e6 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_fpe.c > @@ -160,41 +160,54 @@ void stmmac_fpe_apply(struct stmmac_priv *priv) > } > } > > -static void dwmac5_fpe_configure(void __iomem *ioaddr, > - struct stmmac_fpe_cfg *cfg, > - u32 num_txq, u32 num_rxq, > - bool tx_enable, bool pmac_enable) > +static void common_fpe_configure(void __iomem *ioaddr, > + struct stmmac_fpe_cfg *cfg, u32 rxq, > + bool tx_enable, bool pmac_enable, > + u32 rxq_addr, u32 fprq_mask, u32 fprq_shift, > + u32 mac_fpe_addr, u32 int_en_addr, > + u32 int_en_bit) This function now has a lot of parameters. Could we consider another way? One idea I had was that describes the addresses for different chips. ... > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > index 75ad2da1a37f..6a79e6a111ed 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c > @@ -1290,8 +1290,8 @@ const struct stmmac_tc_ops dwxgmac_tc_ops = { > .setup_cls_u32 = tc_setup_cls_u32, > .setup_cbs = tc_setup_cbs, > .setup_cls = tc_setup_cls, > - .setup_taprio = tc_setup_taprio_without_fpe, > + .setup_taprio = tc_setup_taprio, > .setup_etf = tc_setup_etf, > .query_caps = tc_query_caps, > - .setup_mqprio = tc_setup_mqprio_unimplemented, > + .setup_mqprio = tc_setup_dwmac510_mqprio, > }; It is not clear to me how this hunk relates to the rest of the patch.