Thread (21 messages) 21 messages, 2 authors, 2026-03-02

Re: [PATCH net-next v2 06/10] devlink: add devlink_dev_driver_name() helper and use it in trace events

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-02-28 22:58:07
Also in: linux-rdma, linux-trace-kernel, netdev

On Wed, 25 Feb 2026 14:34:18 +0100 Jiri Pirko wrote:
+const char *devlink_dev_driver_name(const struct devlink *devlink)
+{
+	struct device *dev = devlink->dev;
+
+	return dev ? dev->driver->name : NULL;
+}
+EXPORT_SYMBOL_GPL(devlink_dev_driver_name);
You say we need this in prep for shared instances, which is fair, but
shared instances should presumably share across the same driver, most
of the time? So perhaps we should do a similar thing here as you did to
the bus/dev name? Maybe when shared instance is allocated:

	devlink->driver_name = kasprintf("%s+", dev->driver);

And then:

+const char *devlink_dev_driver_name(const struct devlink *devlink)
+{
+	struct device *dev = devlink->dev;
+
+	return dev ? dev->driver->name : devlink->driver_name;
+}
+EXPORT_SYMBOL_GPL(devlink_dev_driver_name);

?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help