Commit 1051404b authored by Jijie Shao's avatar Jijie Shao Committed by Jakub Kicinski
Browse files

net: hibmcge: adjust the burst len configuration of the MAC controller to improve TX performance.



Adjust the burst len configuration of the MAC controller
to improve TX performance.

Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250702125716.2875169-3-shaojijie@huawei.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1d7cd7a9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -168,6 +168,11 @@ static void hbg_hw_set_mac_max_frame_len(struct hbg_priv *priv,

void hbg_hw_set_mtu(struct hbg_priv *priv, u16 mtu)
{
	/* burst_len BIT(29) set to 1 can improve the TX performance.
	 * But packet drop occurs when mtu > 2000.
	 * So, BIT(29) reset to 0 when mtu > 2000.
	 */
	u32 burst_len_bit = (mtu > 2000) ? 0 : 1;
	u32 frame_len;

	frame_len = mtu + VLAN_HLEN * priv->dev_specs.vlan_layers +
@@ -175,6 +180,9 @@ void hbg_hw_set_mtu(struct hbg_priv *priv, u16 mtu)

	hbg_hw_set_pcu_max_frame_len(priv, frame_len);
	hbg_hw_set_mac_max_frame_len(priv, frame_len);

	hbg_reg_write_field(priv, HBG_REG_BRUST_LENGTH_ADDR,
			    HBG_REG_BRUST_LENGTH_B, burst_len_bit);
}

void hbg_hw_mac_enable(struct hbg_priv *priv, u32 enable)
+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,8 @@
#define HBG_REG_TX_CFF_ADDR_2_ADDR		(HBG_REG_SGMII_BASE + 0x0490)
#define HBG_REG_TX_CFF_ADDR_3_ADDR		(HBG_REG_SGMII_BASE + 0x0494)
#define HBG_REG_RX_CFF_ADDR_ADDR		(HBG_REG_SGMII_BASE + 0x04A0)
#define HBG_REG_BRUST_LENGTH_ADDR		(HBG_REG_SGMII_BASE + 0x04C4)
#define HBG_REG_BRUST_LENGTH_B			BIT(29)
#define HBG_REG_RX_BUF_SIZE_ADDR		(HBG_REG_SGMII_BASE + 0x04E4)
#define HBG_REG_RX_BUF_SIZE_M			GENMASK(15, 0)
#define HBG_REG_BUS_CTRL_ADDR			(HBG_REG_SGMII_BASE + 0x04E8)