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-doc, linux-rdma, linux-trace-kernel
Reply to
Jiri Pirko, 2026-02-25
On Wed, 25 Feb 2026 14:34:18 +0100 Jiri Pirko wrote:
quoted hunk ↗ jump to hunk
+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);

?
Thread (21 messages) 21 messages, 2 authors, last reply 2026-03-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help