netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Rick Jones <rick.jones2@hp.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
	netdev@vger.kernel.org, rusty@rustcorp.com.au, mst@redhat.com
Subject: Re: what's in a bus_info
Date: Fri, 4 Nov 2011 17:07:05 -0700	[thread overview]
Message-ID: <20111104170705.0553b8cf@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <4EB47DB1.2000005@hp.com>

On Fri, 04 Nov 2011 17:05:05 -0700
Rick Jones <rick.jones2@hp.com> wrote:

> On 11/04/2011 04:42 PM, Ben Hutchings wrote:
> > On Fri, 2011-11-04 at 16:31 -0700, Rick Jones wrote:
> 
> >> I guess that wraps back around to the question of whether there is a
> >> "standard" for what should be in bus_info.  And if it is impractical to
> >> get the PCI bus information,
> >
> > I'm not that familiar with virtio, but would I be right in thinking that
> > the virtio 'bus' device is likely to be the child of a PCI device?  So
> > then you mgiht want to get bus_name() for the grandparent of the net
> > device:
> > 	dev_dev = dev->dev.parent->parent;
> > (possibly checking for nulls).
> 
> I'll take a look.
> 
> > If there's some reasonable way to distinguish a 'real' from a virtual
> > bus then we could have the generic implementation try to follow parents
> > until it finds a bus device.  However I think the device model
> > maintainers have been gradually moving away from the bus/class
> > distinction and so we may not be able to do that.
> >
> >> whether it is better to return virtioN or
> >> ethN.  Or perhaps something else entirely.
> > [...]
> >
> > Returning the device name seems entirely unhelpful since the user
> > already has that.  'virtioN' is perhaps not much better though.
> 
> Agreed, but thought I should ask :)

My view of bus_info, is that it is an informational string for administrators.
Tools shouldn't depend on the value.  If a tool wants to find out about
the physical device, then it should readlink the value of /sys/class/net/ethX/device

  reply	other threads:[~2011-11-05  0:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 22:27 what's in a bus_info Rick Jones
2011-11-04 23:02 ` Ben Hutchings
2011-11-04 23:31   ` Rick Jones
2011-11-04 23:42     ` Ben Hutchings
2011-11-05  0:05       ` Rick Jones
2011-11-05  0:07         ` Stephen Hemminger [this message]
2011-11-05  1:17           ` Rick Jones

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=20111104170705.0553b8cf@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=bhutchings@solarflare.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    --cc=rusty@rustcorp.com.au \
    /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).