[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190328211254.1894-13-jiri@resnulli.us>
Date: Thu, 28 Mar 2019 22:12:54 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, mlxsw@...lanox.com, idosch@...lanox.com,
jakub.kicinski@...ronome.com, f.fainelli@...il.com, andrew@...n.ch,
vivien.didelot@...il.com, michael.chan@...adcom.com
Subject: [patch net-next 12/12] net: devlink: add warning for ndo_get_port_parent_id set when not needed
From: Jiri Pirko <jiri@...lanox.com>
Currently if the driver registers devlink port instance, he should set
the devlink port attributes as well. Then the devlink core is able to
obtain switch id itself, no need for driver to implement the ndo.
Once all drivers will implement devlink port registration, this ndo
should be removed. This warning guides new drivers to do things as
they should be done.
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
rfc->v1:
- new patch
---
net/core/devlink.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 0935b73c2076..cccb8c120b88 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -5379,6 +5379,7 @@ void devlink_port_type_eth_set(struct devlink_port *devlink_port,
err = ops->ndo_get_phys_port_name(netdev, name, sizeof(name));
WARN_ON(err != -EOPNOTSUPP);
}
+ WARN_ON(netdev->netdev_ops->ndo_get_port_parent_id);
__devlink_port_type_set(devlink_port, DEVLINK_PORT_TYPE_ETH, netdev);
}
EXPORT_SYMBOL_GPL(devlink_port_type_eth_set);
--
2.17.2
Powered by blists - more mailing lists