Commit ecd2d8b0 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: stop devlink warn on mgmt device

If we don't set a port type, the devlink code will eventually
print a WARN in the kernel log.  Because the mgmt device is
not really a useful port, don't register it as a devlink port.

Fixes: b3f064e9 ("ionic: add support for device id 0x1004")
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7cba832
...@@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic) ...@@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic)
return err; return err;
} }
/* don't register the mgmt_nic as a port */
if (ionic->is_mgmt_nic)
return 0;
devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
0, false, 0, NULL, 0); 0, false, 0, NULL, 0);
err = devlink_port_register(dl, &ionic->dl_port, 0); err = devlink_port_register(dl, &ionic->dl_port, 0);
if (err) if (err)
dev_err(ionic->dev, "devlink_port_register failed: %d\n", err); dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
else if (!ionic->is_mgmt_nic) else
devlink_port_type_eth_set(&ionic->dl_port, devlink_port_type_eth_set(&ionic->dl_port,
ionic->master_lif->netdev); ionic->master_lif->netdev);
...@@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic) ...@@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic)
{ {
struct devlink *dl = priv_to_devlink(ionic); struct devlink *dl = priv_to_devlink(ionic);
devlink_port_unregister(&ionic->dl_port); if (ionic->dl_port.registered)
devlink_port_unregister(&ionic->dl_port);
devlink_unregister(dl); devlink_unregister(dl);
} }
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