[PATCH net] net: enetc: make sure all traffic classes can send large frames

Subsystems: freescale enetc ethernet drivers, networking drivers, the rest

STALE1760d LANDED

Landed in mainline as e378f4967c8e on 2021-10-21.

3 messages, 3 authors, 2021-10-21 · open the first message on its own page

[PATCH net] net: enetc: make sure all traffic classes can send large frames

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-10-20 17:34:12

The enetc driver does not implement .ndo_change_mtu, instead it
configures the MAC register field PTC{Traffic Class}MSDUR[MAXSDU]
statically to a large value during probe time.

The driver used to configure only the max SDU for traffic class 0, and
that was fine while the driver could only use traffic class 0. But with
the introduction of mqprio, sending a large frame into any other TC than
0 is broken.

This patch fixes that by replicating per traffic class the static
configuration done in enetc_configure_port_mac().

Fixes: cbe9e835946f ("enetc: Enable TC offloading with mqprio")
Reported-by: Richie Pearn <redacted>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index ead2b93bf614..64f92770691f 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -517,10 +517,13 @@ static void enetc_port_si_configure(struct enetc_si *si)
 
 static void enetc_configure_port_mac(struct enetc_hw *hw)
 {
+	int tc;
+
 	enetc_port_wr(hw, ENETC_PM0_MAXFRM,
 		      ENETC_SET_MAXFRM(ENETC_RX_MAXFRM_SIZE));
 
-	enetc_port_wr(hw, ENETC_PTCMSDUR(0), ENETC_MAC_MAXFRM_SIZE);
+	for (tc = 0; tc < 8; tc++)
+		enetc_port_wr(hw, ENETC_PTCMSDUR(tc), ENETC_MAC_MAXFRM_SIZE);
 
 	enetc_port_wr(hw, ENETC_PM0_CMD_CFG, ENETC_PM0_CMD_PHY_TX_EN |
 		      ENETC_PM0_CMD_TXP	| ENETC_PM0_PROMISC);
-- 
2.25.1

RE: [PATCH net] net: enetc: make sure all traffic classes can send large frames

From: Claudiu Manoil <claudiu.manoil@nxp.com>
Date: 2021-10-21 09:37:27

-----Original Message-----
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Sent: Wednesday, October 20, 2021 8:34 PM
[...]
Subject: [PATCH net] net: enetc: make sure all traffic classes can send large
frames

The enetc driver does not implement .ndo_change_mtu, instead it
configures the MAC register field PTC{Traffic Class}MSDUR[MAXSDU]
statically to a large value during probe time.

The driver used to configure only the max SDU for traffic class 0, and
that was fine while the driver could only use traffic class 0. But with
the introduction of mqprio, sending a large frame into any other TC than
0 is broken.

This patch fixes that by replicating per traffic class the static
configuration done in enetc_configure_port_mac().

Fixes: cbe9e835946f ("enetc: Enable TC offloading with mqprio")
Reported-by: Richie Pearn <redacted>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Reviewed-by: <Claudiu Manoil <claudiu.manoil@nxp.com>

Re: [PATCH net] net: enetc: make sure all traffic classes can send large frames

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-21 15:10:10

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:

On Wed, 20 Oct 2021 20:33:40 +0300 you wrote:
The enetc driver does not implement .ndo_change_mtu, instead it
configures the MAC register field PTC{Traffic Class}MSDUR[MAXSDU]
statically to a large value during probe time.

The driver used to configure only the max SDU for traffic class 0, and
that was fine while the driver could only use traffic class 0. But with
the introduction of mqprio, sending a large frame into any other TC than
0 is broken.

[...]
Here is the summary with links:
  - [net] net: enetc: make sure all traffic classes can send large frames
    https://git.kernel.org/netdev/net/c/e378f4967c8e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help