From patchwork Wed Aug 9 16:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13348225 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 81AC2C001E0 for ; Wed, 9 Aug 2023 17:02:37 +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:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XB0wlS1EWNqUSNVK2GTvUKKO29Wd+SmfN591p5qPhx4=; b=nhKl5up6vZrPta 3IV9AoKzDZUypX1U4JzbdP5kImqoOQ9wbuoTpRC9oeoXsNThK1VoYpOYsEDUSgeWGU0CHOct5r/gp DBeAhHyXytgwDRQGGdvDwhz2WLLLFqBI7XsKsgcKcda+fzft1dNZnTBSFg7C7mXJzIfq+mz0LVNI/ /YDB4Boj2xIlbRbSOlkcyKu2RSmPHvxPQxdTuDXnVS0USXO/rIje+XqlvlntqZJpOhcc4ZLR53/Cc Ou8WCa4lOI9t9VKfsFT6SP4WbB9ZINMM0bU0kjCh8vcHTW4rhf+gh1XJ8eyqKh719vaPZXCWJuqnK ROnfkeqiQC8aFxsghl4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTmZV-005TEk-1J; Wed, 09 Aug 2023 17:02:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTmZO-005TB2-13 for linux-arm-kernel@lists.infradead.org; Wed, 09 Aug 2023 17:02:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B6A256417B; Wed, 9 Aug 2023 17:02:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F458C433CD; Wed, 9 Aug 2023 17:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691600520; bh=DE4uo4JK2isjtFObJJyFLlrT5b6CK5kuMo4uw+Jhg2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFN6RYl+M59YpWe19hAChu5SWzQB35nUp6hDH8BPSvUnpKx+NF67xEXL973v0+iFA TGP89k4RRXhABdvN2W/azWDTKPMFI8EdXLVK3dM9dpW0tPGHNrrZ9+/JZlbAR4G2Jo ZeZ1O0hxTM4wpzr04uaJaAj1HVdeeVB9UOjW6P6a9aSf72SMMtlE63TtxQLvwdvrg6 FMQSzTEIbp4Aygb5LqkP5LD6HB/89fr7vnxDbBzniKXx9RmhvU31Y0QcQ2jF9m2DgG h7S5q3X4/qYytyNUkhxXsgc/CtiJziehwwDwnqjTeXW28QF7JDPGLuFT3wIIG7O+pS YcsQZk9Y4C4yA== From: Jisheng Zhang To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v3 04/10] net: stmmac: enlarge max rx/tx queues and channels to 16 Date: Thu, 10 Aug 2023 00:50:01 +0800 Message-Id: <20230809165007.1439-5-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230809165007.1439-1-jszhang@kernel.org> References: <20230809165007.1439-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230809_100202_403305_570B165F X-CRM114-Status: GOOD ( 12.50 ) 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 xgmac supports up to 16 rx/tx queues and up to 16 channels. Signed-off-by: Jisheng Zhang Acked-by: Alexandre TORGUE --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 5 ++--- include/linux/stmmac.h | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index a0c2ef8bb0ac..aaae82d3d9dc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -202,9 +202,8 @@ static void dwxgmac2_map_mtl_to_dma(struct mac_device_info *hw, u32 queue, void __iomem *ioaddr = hw->pcsr; u32 value, reg; - reg = (queue < 4) ? XGMAC_MTL_RXQ_DMA_MAP0 : XGMAC_MTL_RXQ_DMA_MAP1; - if (queue >= 4) - queue -= 4; + reg = XGMAC_MTL_RXQ_DMA_MAP0 + (queue & ~0x3); + queue &= 0x3; value = readl(ioaddr + reg); value &= ~XGMAC_QxMDMACH(queue); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index ef67dba775d0..11671fd6adee 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -15,9 +15,9 @@ #include #include -#define MTL_MAX_RX_QUEUES 8 -#define MTL_MAX_TX_QUEUES 8 -#define STMMAC_CH_MAX 8 +#define MTL_MAX_RX_QUEUES 16 +#define MTL_MAX_TX_QUEUES 16 +#define STMMAC_CH_MAX 16 #define STMMAC_RX_COE_NONE 0 #define STMMAC_RX_COE_TYPE1 1