From: Stephen Hemminger <shemminger@vyatta.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Chetan Loke <chetanloke@gmail.com>,
netdev@vger.kernel.org, "Loke, Chetan" <chetan.loke@netscout.com>
Subject: Re: [RFC] Enhance dev_ioctl to return <hwaddr>:<if_name::if_index> mapping
Date: Fri, 16 Jul 2010 11:04:07 -0700 [thread overview]
Message-ID: <20100716110407.316eb8f1@s6510> (raw)
In-Reply-To: <1279300205.2097.9.camel@achroite.uk.solarflarecom.com>
On Fri, 16 Jul 2010 18:10:05 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Fri, 2010-07-16 at 09:18 -0400, Chetan Loke wrote:
> [...]
> > Requirement:
> > R1)Ability to address NICs/interfaces using a mac-addr in ioctls. This
> > is required because we don't have a consistent naming scheme for
> > Ethernet devices.Asking customers and/or field-engineers to change
> > udev rules and
> > other config files is not feasible.
>
> I don't know why they would need to change those. It might be useful to
> have a simple userland tool that will look up a device name by MAC
> address. But it's not like a MAC address is any more user-friendly than
> a net device name!
>
> > Existing pain-points:
> > P1) ioctl needs either i) if-name or ii) if-index before we can invoke
> > bind() etc.This works fine if you know your configuration and it is not going
> > to change.However,if we hot-add a NIC and if you have adapters from multiple
> > vendors(think:driver load order) then upon a reboot,the 'eth'
> > interfaces can be re-mapped.
>
> As you well know, udev makes the name/MAC-address association
> persistent, so this is no longer a problem.
>
> [...]
> > W2.1) If renaming were to even succeed then none of the existing
> > drivers re-register their msix-vectors.
>
> There is no need to do that, since the IRQ handler names are not copied
> but are held by the driver. So the driver only needs to rewrite the
> names when the device is renamed. However that does require registering
> a netdev notifier. It might be worth adding a netdev operation for
> renaming, to make this easier for driver maintainers.
>
> [...]
> > But there is no programmatic way of deriving the 'ethX' name.
> [...]
>
> Deriving it from what? Are you aiming to determine what the name of a
> device will be before the physical device is installed?
>
> Ben.
>
The additional API is not needed. It is trivial to find address for device
and do reverse mapping. Either with ioctl's or /sys/class/net/XXX/addr
next prev parent reply other threads:[~2010-07-16 18:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-16 13:18 [RFC] Enhance dev_ioctl to return <hwaddr>:<if_name::if_index> mapping Chetan Loke
2010-07-16 17:10 ` Ben Hutchings
2010-07-16 18:04 ` Stephen Hemminger [this message]
2010-07-16 18:12 ` Loke, Chetan
2010-07-16 18:31 ` Stephen Hemminger
2010-07-16 19:29 ` Chetan Loke
2010-07-16 19:33 ` David Miller
2010-07-16 19:35 ` Chetan Loke
2010-07-16 19:40 ` David Miller
2010-07-16 20:02 ` Chetan Loke
2010-07-16 20:04 ` David Miller
2010-07-16 20:15 ` Chetan Loke
2010-07-16 20:18 ` David Miller
2010-07-16 20:49 ` Loke, Chetan
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=20100716110407.316eb8f1@s6510 \
--to=shemminger@vyatta.com \
--cc=bhutchings@solarflare.com \
--cc=chetan.loke@netscout.com \
--cc=chetanloke@gmail.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).