All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: netdev@vger.kernel.org
Cc: Joao Pinto <Joao.Pinto@synopsys.com>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	"David S. Miller" <davem@davemloft.net>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next 05/26] net: stmmac: xgmac: Implement tx_queue_prio()
Date: Mon,  5 Aug 2019 18:44:32 +0200	[thread overview]
Message-ID: <e0536be2fc13bdd7df7815f4863fef57accfab48.1565022597.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1565022597.git.joabreu@synopsys.com>
In-Reply-To: <cover.1565022597.git.joabreu@synopsys.com>

Implement the TX Queue Priority callback in XGMAC core.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h      |  4 ++++
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 19 ++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
index 86a42bc39d21..b77091161765 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
@@ -127,6 +127,10 @@
 #define XGMAC_MTL_RXQ_DMA_MAP1		0x00001034
 #define XGMAC_QxMDMACH(x)		GENMASK((x) * 8 + 3, (x) * 8)
 #define XGMAC_QxMDMACH_SHIFT(x)		((x) * 8)
+#define XGMAC_TC_PRTY_MAP0		0x00001040
+#define XGMAC_TC_PRTY_MAP1		0x00001044
+#define XGMAC_PSTC(x)			GENMASK((x) * 8 + 7, (x) * 8)
+#define XGMAC_PSTC_SHIFT(x)		((x) * 8)
 #define XGMAC_MTL_TXQ_OPMODE(x)		(0x00001100 + (0x80 * (x)))
 #define XGMAC_TQS			GENMASK(25, 16)
 #define XGMAC_TQS_SHIFT			16
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index ce6503dfc86d..bfbd5ae11540 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -118,6 +118,23 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio,
 	writel(value, ioaddr + reg);
 }
 
+static void dwxgmac2_tx_queue_prio(struct mac_device_info *hw, u32 prio,
+				   u32 queue)
+{
+	void __iomem *ioaddr = hw->pcsr;
+	u32 value, reg;
+
+	reg = (queue < 4) ? XGMAC_TC_PRTY_MAP0 : XGMAC_TC_PRTY_MAP1;
+	if (queue >= 4)
+		queue -= 4;
+
+	value = readl(ioaddr + reg);
+	value &= ~XGMAC_PSTC(queue);
+	value |= (prio << XGMAC_PSTC_SHIFT(queue)) & XGMAC_PSTC(queue);
+
+	writel(value, ioaddr + reg);
+}
+
 static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,
 					    u32 rx_alg)
 {
@@ -428,7 +445,7 @@ const struct stmmac_ops dwxgmac210_ops = {
 	.rx_ipc = dwxgmac2_rx_ipc,
 	.rx_queue_enable = dwxgmac2_rx_queue_enable,
 	.rx_queue_prio = dwxgmac2_rx_queue_prio,
-	.tx_queue_prio = NULL,
+	.tx_queue_prio = dwxgmac2_tx_queue_prio,
 	.rx_queue_routing = NULL,
 	.prog_mtl_rx_algorithms = dwxgmac2_prog_mtl_rx_algorithms,
 	.prog_mtl_tx_algorithms = dwxgmac2_prog_mtl_tx_algorithms,
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: netdev@vger.kernel.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 05/26] net: stmmac: xgmac: Implement tx_queue_prio()
Date: Mon,  5 Aug 2019 18:44:32 +0200	[thread overview]
Message-ID: <e0536be2fc13bdd7df7815f4863fef57accfab48.1565022597.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1565022597.git.joabreu@synopsys.com>
In-Reply-To: <cover.1565022597.git.joabreu@synopsys.com>

Implement the TX Queue Priority callback in XGMAC core.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h      |  4 ++++
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 19 ++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
index 86a42bc39d21..b77091161765 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
@@ -127,6 +127,10 @@
 #define XGMAC_MTL_RXQ_DMA_MAP1		0x00001034
 #define XGMAC_QxMDMACH(x)		GENMASK((x) * 8 + 3, (x) * 8)
 #define XGMAC_QxMDMACH_SHIFT(x)		((x) * 8)
+#define XGMAC_TC_PRTY_MAP0		0x00001040
+#define XGMAC_TC_PRTY_MAP1		0x00001044
+#define XGMAC_PSTC(x)			GENMASK((x) * 8 + 7, (x) * 8)
+#define XGMAC_PSTC_SHIFT(x)		((x) * 8)
 #define XGMAC_MTL_TXQ_OPMODE(x)		(0x00001100 + (0x80 * (x)))
 #define XGMAC_TQS			GENMASK(25, 16)
 #define XGMAC_TQS_SHIFT			16
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index ce6503dfc86d..bfbd5ae11540 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -118,6 +118,23 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio,
 	writel(value, ioaddr + reg);
 }
 
+static void dwxgmac2_tx_queue_prio(struct mac_device_info *hw, u32 prio,
+				   u32 queue)
+{
+	void __iomem *ioaddr = hw->pcsr;
+	u32 value, reg;
+
+	reg = (queue < 4) ? XGMAC_TC_PRTY_MAP0 : XGMAC_TC_PRTY_MAP1;
+	if (queue >= 4)
+		queue -= 4;
+
+	value = readl(ioaddr + reg);
+	value &= ~XGMAC_PSTC(queue);
+	value |= (prio << XGMAC_PSTC_SHIFT(queue)) & XGMAC_PSTC(queue);
+
+	writel(value, ioaddr + reg);
+}
+
 static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,
 					    u32 rx_alg)
 {
@@ -428,7 +445,7 @@ const struct stmmac_ops dwxgmac210_ops = {
 	.rx_ipc = dwxgmac2_rx_ipc,
 	.rx_queue_enable = dwxgmac2_rx_queue_enable,
 	.rx_queue_prio = dwxgmac2_rx_queue_prio,
-	.tx_queue_prio = NULL,
+	.tx_queue_prio = dwxgmac2_tx_queue_prio,
 	.rx_queue_routing = NULL,
 	.prog_mtl_rx_algorithms = dwxgmac2_prog_mtl_rx_algorithms,
 	.prog_mtl_tx_algorithms = dwxgmac2_prog_mtl_tx_algorithms,
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-08-05 16:45 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 16:44 [PATCH net-next 00/26] net: stmmac: Misc improvements for XGMAC Jose Abreu
2019-08-05 16:44 ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 01/26] net: stmmac: xgmac: Fix XGMAC selftests Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 02/26] net: stmmac: xgmac: Implement MMC counters Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 03/26] net: stmmac: Fix issues when number of Queues >= 4 Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 04/26] net: stmmac: xgmac: Implement set_mtl_tx_queue_weight() Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` Jose Abreu [this message]
2019-08-05 16:44   ` [PATCH net-next 05/26] net: stmmac: xgmac: Implement tx_queue_prio() Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 06/26] net: stmmac: Implement RSS and enable it in XGMAC core Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 07/26] net: stmmac: selftests: Add RSS test Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 08/26] net: stmmac: Implement VLAN Hash Filtering in XGMAC Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 09/26] net: stmmac: selftests: Add test for VLAN and Double VLAN Filtering Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 10/26] net: stmmac: Implement Safety Features in XGMAC core Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 11/26] net: stmmac: Add Flexible RX Parser support in XGMAC Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 12/26] net: stmmac: tc: Do not return a fragment entry Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 13/26] net: stmmac: selftests: Add a selftest for Flexible RX Parser Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 14/26] net: stmmac: Get correct timestamp values from XGMAC Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 15/26] net: stmmac: Prepare to add Split Header support Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 16/26] net: stmmac: xgmac: Correctly return that RX descriptor is not last one Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 17/26] net: stmmac: Add Split Header support and enable it in XGMAC cores Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 18/26] net: stmmac: dwxgmac: Add Flexible PPS support Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 19/26] net: stmmac: Add ethtool register dump for XGMAC cores Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 20/26] net: stmmac: Add a counter for Split Header packets Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 21/26] net: stmmac: Add support for SA Insertion/Replacement in XGMAC cores Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 22/26] net: stmmac: selftests: Add tests for SA Insertion/Replacement Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 23/26] net: stmmac: xgmac: Add EEE support Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 24/26] net: stmmac: Add support for VLAN Insertion Offload Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 25/26] net: stmmac: selftests: Add selftest for VLAN TX Offload Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 16:44 ` [PATCH net-next 26/26] net: stmmac: selftests: Return proper error code to userspace Jose Abreu
2019-08-05 16:44   ` Jose Abreu
2019-08-05 17:47 ` [PATCH net-next 00/26] net: stmmac: Misc improvements for XGMAC David Miller
2019-08-05 17:47   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0536be2fc13bdd7df7815f4863fef57accfab48.1565022597.git.joabreu@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.