Commit a460f4a6 authored by Asmaa Mnebhi's avatar Asmaa Mnebhi Committed by David S. Miller

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: f92e1869 ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: default avatarDavid Thompson <davthompson@nvidia.com>
Signed-off-by: default avatarAsmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef210ef8
...@@ -130,9 +130,15 @@ static int mlxbf_gige_open(struct net_device *netdev) ...@@ -130,9 +130,15 @@ static int mlxbf_gige_open(struct net_device *netdev)
{ {
struct mlxbf_gige *priv = netdev_priv(netdev); struct mlxbf_gige *priv = netdev_priv(netdev);
struct phy_device *phydev = netdev->phydev; struct phy_device *phydev = netdev->phydev;
u64 control;
u64 int_en; u64 int_en;
int err; int err;
/* Perform general init of GigE block */
control = readq(priv->base + MLXBF_GIGE_CONTROL);
control |= MLXBF_GIGE_CONTROL_PORT_EN;
writeq(control, priv->base + MLXBF_GIGE_CONTROL);
err = mlxbf_gige_request_irqs(priv); err = mlxbf_gige_request_irqs(priv);
if (err) if (err)
return err; return err;
...@@ -365,7 +371,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev) ...@@ -365,7 +371,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
void __iomem *plu_base; void __iomem *plu_base;
void __iomem *base; void __iomem *base;
int addr, phy_irq; int addr, phy_irq;
u64 control;
int err; int err;
base = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_MAC); base = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_MAC);
...@@ -380,11 +385,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev) ...@@ -380,11 +385,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
if (IS_ERR(plu_base)) if (IS_ERR(plu_base))
return PTR_ERR(plu_base); return PTR_ERR(plu_base);
/* Perform general init of GigE block */
control = readq(base + MLXBF_GIGE_CONTROL);
control |= MLXBF_GIGE_CONTROL_PORT_EN;
writeq(control, base + MLXBF_GIGE_CONTROL);
netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv));
if (!netdev) if (!netdev)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment