Skip to content

Commit a460f4a

Browse files
Asmaa Mnebhidavem330
authored andcommitted
mlxbf_gige: Enable the GigE port in mlxbf_gige_open
At the moment, the GigE port is enabled in the mlxbf_gige_probe function. If the mlxbf_gige_open is not executed, this could cause pause frames to increase in the case where there is high backgroud traffic. This results in clogging the port. So move enabling the OOB port to mlxbf_gige_open. Fixes: f92e186 ("Add Mellanox BlueField Gigabit Ethernet driver") Reviewed-by: David Thompson <davthompson@nvidia.com> Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ef210ef commit a460f4a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,15 @@ static int mlxbf_gige_open(struct net_device *netdev)
130130
{
131131
struct mlxbf_gige *priv = netdev_priv(netdev);
132132
struct phy_device *phydev = netdev->phydev;
133+
u64 control;
133134
u64 int_en;
134135
int err;
135136

137+
/* Perform general init of GigE block */
138+
control = readq(priv->base + MLXBF_GIGE_CONTROL);
139+
control |= MLXBF_GIGE_CONTROL_PORT_EN;
140+
writeq(control, priv->base + MLXBF_GIGE_CONTROL);
141+
136142
err = mlxbf_gige_request_irqs(priv);
137143
if (err)
138144
return err;
@@ -365,7 +371,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
365371
void __iomem *plu_base;
366372
void __iomem *base;
367373
int addr, phy_irq;
368-
u64 control;
369374
int err;
370375

371376
base = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_MAC);
@@ -380,11 +385,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
380385
if (IS_ERR(plu_base))
381386
return PTR_ERR(plu_base);
382387

383-
/* Perform general init of GigE block */
384-
control = readq(base + MLXBF_GIGE_CONTROL);
385-
control |= MLXBF_GIGE_CONTROL_PORT_EN;
386-
writeq(control, base + MLXBF_GIGE_CONTROL);
387-
388388
netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv));
389389
if (!netdev)
390390
return -ENOMEM;

0 commit comments

Comments
 (0)