Skip to content

Commit ef210ef

Browse files
Asmaa Mnebhidavem330
authored andcommitted
mlxbf_gige: Fix intermittent no ip issue
Although the link is up, there is no ip assigned on setups with high background traffic. Nothing is transmitted nor received. The RX error count keeps on increasing. After several minutes, the RX error count stagnates and the GigE interface finally gets an ip. The issue is that mlxbf_gige_rx_init() is called before phy_start(). As soon as the RX DMA is enabled in mlxbf_gige_rx_init(), the RX CI reaches the max of 128, and becomes equal to RX PI. RX CI doesn't decrease since the code hasn't ran phy_start yet. Bring the PHY up before starting the RX. Fixes: f92e186 ("Add Mellanox BlueField Gigabit Ethernet driver") Reviewed-by: David Thompson <davthompson@nvidia.com> Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3f14b37 commit ef210ef

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ static int mlxbf_gige_open(struct net_device *netdev)
147147
*/
148148
priv->valid_polarity = 0;
149149

150-
err = mlxbf_gige_rx_init(priv);
150+
phy_start(phydev);
151+
152+
err = mlxbf_gige_tx_init(priv);
151153
if (err)
152154
goto free_irqs;
153-
err = mlxbf_gige_tx_init(priv);
155+
err = mlxbf_gige_rx_init(priv);
154156
if (err)
155-
goto rx_deinit;
156-
157-
phy_start(phydev);
157+
goto tx_deinit;
158158

159159
netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll);
160160
napi_enable(&priv->napi);
@@ -176,8 +176,8 @@ static int mlxbf_gige_open(struct net_device *netdev)
176176

177177
return 0;
178178

179-
rx_deinit:
180-
mlxbf_gige_rx_deinit(priv);
179+
tx_deinit:
180+
mlxbf_gige_tx_deinit(priv);
181181

182182
free_irqs:
183183
mlxbf_gige_free_irqs(priv);

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv)
142142
writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN,
143143
priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS);
144144

145+
writeq(ilog2(priv->rx_q_entries),
146+
priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2);
147+
145148
/* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to
146149
* indicate readiness to receive interrupts
147150
*/
@@ -154,9 +157,6 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv)
154157
data |= MLXBF_GIGE_RX_DMA_EN;
155158
writeq(data, priv->base + MLXBF_GIGE_RX_DMA);
156159

157-
writeq(ilog2(priv->rx_q_entries),
158-
priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2);
159-
160160
return 0;
161161

162162
free_wqe_and_skb:

0 commit comments

Comments
 (0)