All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Jonathan Davies <jonathan.davies@nutanix.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Oliver Neukum <oneukum@suse.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: usbnet: allow overriding of default USB interface naming
Date: Mon, 14 Jun 2021 14:23:53 +0200	[thread overview]
Message-ID: <YMdKWSjiXeiDESKR@lunn.ch> (raw)
In-Reply-To: <a620bc87-5ee7-6132-6aa0-6b99e1052960@nutanix.com>

> > > 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.

As GregKH said, 1) has to happen.

   Andrew

  reply	other threads:[~2021-06-14 12:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 15:23 [PATCH] net: usbnet: allow overriding of default USB interface naming Jonathan Davies
2021-06-11 17:16 ` Andrew Lunn
2021-06-14  9:32   ` Jonathan Davies
2021-06-14 12:40     ` Oliver Neukum
2021-06-12  7:01 ` Greg KH
2021-06-14  9:32   ` Jonathan Davies
2021-06-14  9:43     ` Greg KH
2021-06-14 10:58       ` Jonathan Davies
2021-06-14 12:23         ` Andrew Lunn [this message]
2021-06-14 14:53           ` Jonathan Davies
2021-06-14 13:51         ` Greg KH
2021-06-14 14:53           ` Jonathan Davies
2021-06-14 19:20             ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMdKWSjiXeiDESKR@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathan.davies@nutanix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.