diff mbox series

[net,1/2] net: enetc: set MAC RX FIFO to recommended value

Message ID 20210307132339.2320009-1-olteanv@gmail.com
State New
Headers show
Series [net,1/2] net: enetc: set MAC RX FIFO to recommended value | expand

Commit Message

Vladimir Oltean March 7, 2021, 1:23 p.m. UTC
From: Alex Marginean <alexandru.marginean@nxp.com>

On LS1028A, the MAC RX FIFO defaults to the value 2, which is too high
and may lead to RX lock-up under traffic at a rate higher than 6 Gbps.
Set it to 1 instead, as recommended by the hardware design team and by
later versions of the ENETC block guide.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_hw.h | 2 ++
 drivers/net/ethernet/freescale/enetc/enetc_pf.c | 6 ++++++
 2 files changed, 8 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org March 8, 2021, 8:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Sun,  7 Mar 2021 15:23:38 +0200 you wrote:
> From: Alex Marginean <alexandru.marginean@nxp.com>
> 
> On LS1028A, the MAC RX FIFO defaults to the value 2, which is too high
> and may lead to RX lock-up under traffic at a rate higher than 6 Gbps.
> Set it to 1 instead, as recommended by the hardware design team and by
> later versions of the ENETC block guide.
> 
> [...]

Here is the summary with links:
  - [net,1/2] net: enetc: set MAC RX FIFO to recommended value
    https://git.kernel.org/netdev/net/c/1b2395dfff5b
  - [net,2/2] net: enetc: allow hardware timestamping on TX queues with tc-etf enabled
    https://git.kernel.org/netdev/net/c/29d98f54a4fe

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

Patch

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/ethernet/freescale/enetc/enetc_hw.h
index de0d20b0f489..00938f7960a4 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h
@@ -234,6 +234,8 @@  enum enetc_bdr_type {TX, RX};
 #define ENETC_PM0_MAXFRM	0x8014
 #define ENETC_SET_TX_MTU(val)	((val) << 16)
 #define ENETC_SET_MAXFRM(val)	((val) & 0xffff)
+#define ENETC_PM0_RX_FIFO	0x801c
+#define ENETC_PM0_RX_FIFO_VAL	1
 
 #define ENETC_PM_IMDIO_BASE	0x8030
 
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index ca02f033bea2..224fc37a6757 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -490,6 +490,12 @@  static void enetc_configure_port_mac(struct enetc_hw *hw)
 
 	enetc_port_wr(hw, ENETC_PM1_CMD_CFG, ENETC_PM0_CMD_PHY_TX_EN |
 		      ENETC_PM0_CMD_TXP	| ENETC_PM0_PROMISC);
+
+	/* On LS1028A, the MAC RX FIFO defaults to 2, which is too high
+	 * and may lead to RX lock-up under traffic. Set it to 1 instead,
+	 * as recommended by the hardware team.
+	 */
+	enetc_port_wr(hw, ENETC_PM0_RX_FIFO, ENETC_PM0_RX_FIFO_VAL);
 }
 
 static void enetc_mac_config(struct enetc_hw *hw, phy_interface_t phy_mode)