[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b71f40d6-42b1-9600-01cd-cba743c34d26@nutanix.com>
Date: Mon, 14 Jun 2021 15:53:39 +0100
From: Jonathan Davies <jonathan.davies@...anix.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Oliver Neukum <oneukum@...e.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: usbnet: allow overriding of default USB interface
naming
On 14/06/2021 13:23, Andrew Lunn wrote:
>>>> Userspace solutions include:
>>>> 1. udev backing off and retrying in the event of a collision; or
>>>> 2. avoiding ever renaming a device to a name in the "eth%d" namespace.
>>>
>>> Picking a different namespace does not cause a lack of collisions to
>>> happen, you could have multiple usb network devices being found at the
>>> same time, right?
>>>
>>> So no matter what, 1) has to happen.
>>
>> Within a namespace, the "%d" in "eth%d" means __dev_alloc_name finds a name
>> that's not taken. I didn't check the locking but assume that can only happen
>> serially, in which case two devices probed in parallel would not mutually
>> collide.
>>
>> So I don't think it's necessarily true that 1) has to happen.
>
> Say you changed the namespace to usb%d. And you want the device in USB
> port 1.4 to be usb1 and the device in USB port 1.3 to be usb0. They
> probe the other way around. You have the same problem, you need to
> handle the race condition in udev, back off an try again.
The point of the patch was that if your intended names are usb0 and usb1
then the module parameter would allow you to nominate a prefix for the
initial names that's not "usb", thereby avoiding collisions.
But I can see that the consensus is to live with the possibility of
overlap between the names initially assigned by the kernel and the
intended names, so this is moot.
Thanks for all the input.
Jonathan
Powered by blists - more mailing lists