Skip to content

Commit ae6c1dc

Browse files
Jijie Shaokuba-moo
authored andcommitted
net: hibmcge: fix not restore rx pause mac addr after reset issue
The MAC hardware supports receiving two types of pause frames from link partner. One is a pause frame with a destination address of 01:80:C2:00:00:01. The other is a pause frame whose destination address is the address of the hibmcge driver. 01:80:C2:00:00:01 is supported by default. In .ndo_set_mac_address(), the hibmcge driver calls .hbg_hw_set_rx_pause_mac_addr() to set its mac address as the destination address of the rx puase frame. Therefore, pause frames with two types of MAC addresses can be received. Currently, the rx pause addr does not restored after reset. As a result, pause frames whose destination address is the hibmcge driver address cannot be correctly received. This patch restores the configuration by calling .hbg_hw_set_rx_pause_mac_addr() after reset is complete. Fixes: 3f5a61f ("net: hibmcge: Add reset supported in this module") Signed-off-by: Jijie Shao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1d6c3e0 commit ae6c1dc

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/hisilicon/hibmcge

1 file changed

+3
-0
lines changed

drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ static void hbg_restore_mac_table(struct hbg_priv *priv)
2626

2727
static void hbg_restore_user_def_settings(struct hbg_priv *priv)
2828
{
29+
/* The index of host mac is always 0. */
30+
u64 rx_pause_addr = ether_addr_to_u64(priv->filter.mac_table[0].addr);
2931
struct ethtool_pauseparam *pause_param = &priv->user_def.pause_param;
3032

3133
hbg_restore_mac_table(priv);
3234
hbg_hw_set_mtu(priv, priv->netdev->mtu);
3335
hbg_hw_set_pause_enable(priv, pause_param->tx_pause,
3436
pause_param->rx_pause);
37+
hbg_hw_set_rx_pause_mac_addr(priv, rx_pause_addr);
3538
}
3639

3740
int hbg_rebuild(struct hbg_priv *priv)

0 commit comments

Comments
 (0)