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

- Subsystems: FREESCALE ENETC ETHERNET DRIVERS, NETWORKING DRIVERS, THE REST
- Maintainers: Claudiu Manoil, Vladimir Oltean, Wei Fang, Clark Wang, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
- Status: LANDED (e378f4967c8e · 2021-10-21 13:44)
- Landed in mainline as e378f4967c8e on 2021-10-21.
- List: netdev
- 3 messages, 3 authors
- Page: https://ratatoskr.run/netdev/2021/10/11214008/t

## \[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 
- Message: https://ratatoskr.run/netdev/2021/10/11214008.md

```text
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 
- Message: https://ratatoskr.run/netdev/2021/10/11214076.md

```text
> -----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 
- Message: https://ratatoskr.run/netdev/2021/10/11214121.md

```text
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski [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


```
