diff mbox series

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

Message ID 20211020173340.1089992-1-vladimir.oltean@nxp.com (mailing list archive)
State Accepted
Commit e378f4967c8edd64c680f2e279cb646ee06b6f2d
Delegated to: Netdev Maintainers
Headers show
Series [net] net: enetc: make sure all traffic classes can send large frames | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag present in non-next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Vladimir Oltean Oct. 20, 2021, 5:33 p.m. UTC
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 <richard.pearn@nxp.com>
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(-)

Comments

Claudiu Manoil Oct. 21, 2021, 9:37 a.m. UTC | #1
> -----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 <richard.pearn@nxp.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---

Reviewed-by: <Claudiu Manoil <claudiu.manoil@nxp.com>
patchwork-bot+netdevbpf@kernel.org Oct. 21, 2021, 3:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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!
diff mbox series

Patch

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);