Commit c3f10cbc authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

bnxt: call devlink_port_type_eth_set() before port register

Call devlink_port_type_eth_set() before devlink_port_register(). Bnxt
instances won't change type during lifetime. This avoids one extra
userspace devlink notification.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0e18132
...@@ -229,6 +229,7 @@ int bnxt_dl_register(struct bnxt *bp) ...@@ -229,6 +229,7 @@ int bnxt_dl_register(struct bnxt *bp)
goto err_dl_unreg; goto err_dl_unreg;
} }
devlink_port_type_eth_set(&bp->dl_port, bp->dev);
devlink_port_attrs_set(&bp->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, devlink_port_attrs_set(&bp->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
bp->pf.port_id, false, 0); bp->pf.port_id, false, 0);
rc = devlink_port_register(dl, &bp->dl_port, bp->pf.port_id); rc = devlink_port_register(dl, &bp->dl_port, bp->pf.port_id);
...@@ -236,7 +237,6 @@ int bnxt_dl_register(struct bnxt *bp) ...@@ -236,7 +237,6 @@ int bnxt_dl_register(struct bnxt *bp)
netdev_err(bp->dev, "devlink_port_register failed"); netdev_err(bp->dev, "devlink_port_register failed");
goto err_dl_param_unreg; goto err_dl_param_unreg;
} }
devlink_port_type_eth_set(&bp->dl_port, bp->dev);
rc = devlink_port_params_register(&bp->dl_port, bnxt_dl_port_params, rc = devlink_port_params_register(&bp->dl_port, bnxt_dl_port_params,
ARRAY_SIZE(bnxt_dl_port_params)); ARRAY_SIZE(bnxt_dl_port_params));
......
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