netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rick Jones <rick.jones2@hp.com>
To: Stephen Hemminger <shemminger@vyatta.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, 04 Nov 2011 18:17:08 -0700	[thread overview]
Message-ID: <4EB48E94.7010804@hp.com> (raw)
In-Reply-To: <20111104170705.0553b8cf@nehalam.linuxnetplumber.net>

On 11/04/2011 05:07 PM, Stephen Hemminger wrote:
> 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

Just a quick look under device for the virtio_net interface shows it 
isn't quite as "complete" as a bare iron tg3 interface (as an example)

The bare iron tg3 example:
raj@tardy:~$ ls /sys/class/net/eth0/device
broken_parity_status      enable         net        resource0
class                     firmware_node  numa_node  subsystem
config                    irq            power      subsystem_device
consistent_dma_mask_bits  local_cpulist  remove     subsystem_vendor
device                    local_cpus     rescan     uevent
dma_mask_bits             modalias       reset      vendor
driver                    msi_bus        resource   vpd

The virtio_net interface:

raj@raj-ubuntu-guest:~$ ls /sys/class/net/eth0/device
device  features  net    status     uevent
driver  modalias  power  subsystem  vendor


I have found that if I add a function to return a struct pci_dev * given 
a struct virtio_device, to virtio/virtio_pci.c and do a pci_name() 
against that, I do get a familiar looking bus address:

raj@raj-ubuntu-guest:~$ ethtool -i eth0
driver: virtio_net
version: I am versionless
firmware-version: I have no firmware
bus-info: 0000:00:03.0

and it even matches the lspci output for the guest:

00:03.0 Ethernet controller: Red Hat, Inc Virtio network device

(still my "playing around" version, hence the silly strings in version 
and firmware-version)

I suppose the question becomes whether it is worthwhile to clean it up 
and submit.    I'm also thinking it would be goodness to start 
displaying some sort of version number, and if there is anything the 
driver might query to fill-in as a firmware-version - perhaps something 
about the version of the driver on the other side?

rick jones

      reply	other threads:[~2011-11-05  1:17 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
2011-11-05  1:17           ` Rick Jones [this message]

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=4EB48E94.7010804@hp.com \
    --to=rick.jones2@hp.com \
    --cc=bhutchings@solarflare.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=shemminger@vyatta.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 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).