Re: [PATCH net-next RFC 1/3] faux: extend the creation function for module namespace

From
Jiri Pirko <jiri@resnulli.us>
Date
2025-03-18 15:26:17
Reply to
Greg KH, 2025-03-18
Tue, Mar 18, 2025 at 03:36:34PM +0100, gregkh@linuxfoundation.org wrote:
On Tue, Mar 18, 2025 at 01:47:04PM +0100, Jiri Pirko wrote:
quoted
From: Jiri Pirko <redacted>

It is hard for the faux user to avoid potential name conflicts, as it is
only in control of faux devices it creates. Therefore extend the faux
device creation function by module parameter, embed the module name into
the device name in format "modulename_permodulename" and allow module to
control it's namespace.
Do you have an example of how this will change the current names we have
in the system to this new way?  What is going to break if those names
change?
I was under impression, that since there are no in-tree users of faux
yet (at least I don't see them in net-next tree), there is no breakage.
I say this as the perf devices seem to have "issues" with their names
and locations in sysfs as userspace tools use them today, and in a
straight port to faux it is ok, but if the device name changes, that is
going to have problems.
Got it. I didn't consider that.

Why can't you handle this "namespace" issue yourself in the caller to
the api?  Why must the faux code handle it for you?  We don't do this
for platform devices, why is this any different?
Well, I wanted to avoid alloc&printf names in driver, since
dev_set_name() accepts vararg and faux_device_create()/faux_device_create_with_groups()
don't.

Perhaps "const char *name" could be formatted as well for
faux_device_create()/faux_device_create_with_groups(). My laziness
wanted to avoid that :) Would that make sense to you?
thanks,

greg k-h
Thread (18 messages) 18 messages, 4 authors, last reply 2025-03-19
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