* Should we report bus width/speed via ethtool?
@ 2012-12-05 21:35 Ben Greear
2012-12-05 22:36 ` David Miller
2012-12-06 2:06 ` Ben Hutchings
0 siblings, 2 replies; 8+ messages in thread
From: Ben Greear @ 2012-12-05 21:35 UTC (permalink / raw)
To: netdev; +Cc: e1000-devel list
It seems the only way to get the current pci-e bus speed & width
in ixgbe (and probably many other NICs) is by parsing output
of lspci -vvv.
I'd personally find it easier if this info were available via
ethtool API.
Any opinions on adding this info? I was thinking something like:
struct ethtool_bus_speed {
u32 cur_speed; /* millions of transactions per sec, or Mhz for older PCI busses */
u32 cur_width; /* bus width */
/* Maximum values supported by NIC */
u32 max_speed;
u32 max_width;
#define BELOW_OPTIMAL_SPEED 0x1 /* Set if NIC cannot run at max speed with current bus settings */
u32 flags;
/* Plenty of space to grow, set to zero until defined */
u32 reserved[32];
};
This could also fit in the reserved space of the
struct ethtool_drvinfo if that were preferred (and
width and flags could be a u16 to save a bit of space
in that case).
Any opinions...or suggestions for other interesting bits to add?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Should we report bus width/speed via ethtool?
2012-12-05 21:35 Should we report bus width/speed via ethtool? Ben Greear
@ 2012-12-05 22:36 ` David Miller
2012-12-05 23:09 ` Ben Greear
2012-12-06 2:06 ` Ben Hutchings
1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2012-12-05 22:36 UTC (permalink / raw)
To: greearb; +Cc: netdev, e1000-devel
From: Ben Greear <greearb@candelatech.com>
Date: Wed, 05 Dec 2012 13:35:01 -0800
> It seems the only way to get the current pci-e bus speed & width
> in ixgbe (and probably many other NICs) is by parsing output
> of lspci -vvv.
>
> I'd personally find it easier if this info were available via
> ethtool API.
You could just as easily have ethtool determine the PCI device
location (using existing facilities) and fetch the PCI-e info from the
PCI sysfs files.
There is no reason to extend ethtool for this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Should we report bus width/speed via ethtool?
2012-12-05 22:36 ` David Miller
@ 2012-12-05 23:09 ` Ben Greear
2012-12-06 0:01 ` David Miller
0 siblings, 1 reply; 8+ messages in thread
From: Ben Greear @ 2012-12-05 23:09 UTC (permalink / raw)
To: David Miller; +Cc: netdev, e1000-devel
On 12/05/2012 02:36 PM, David Miller wrote:
> From: Ben Greear <greearb@candelatech.com>
> Date: Wed, 05 Dec 2012 13:35:01 -0800
>
>> It seems the only way to get the current pci-e bus speed & width
>> in ixgbe (and probably many other NICs) is by parsing output
>> of lspci -vvv.
>>
>> I'd personally find it easier if this info were available via
>> ethtool API.
>
> You could just as easily have ethtool determine the PCI device
> location (using existing facilities) and fetch the PCI-e info from the
> PCI sysfs files.
Any particular sysfs file? I've been grubbing around in there
and I don't see anything that specifies bus width or speed..
Maybe it's some binary blob that needs decoding?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Should we report bus width/speed via ethtool?
2012-12-05 23:09 ` Ben Greear
@ 2012-12-06 0:01 ` David Miller
2012-12-06 0:08 ` Rick Jones
2012-12-06 0:20 ` Brice Goglin
0 siblings, 2 replies; 8+ messages in thread
From: David Miller @ 2012-12-06 0:01 UTC (permalink / raw)
To: greearb; +Cc: netdev, e1000-devel
From: Ben Greear <greearb@candelatech.com>
Date: Wed, 05 Dec 2012 15:09:11 -0800
> On 12/05/2012 02:36 PM, David Miller wrote:
>> From: Ben Greear <greearb@candelatech.com>
>> Date: Wed, 05 Dec 2012 13:35:01 -0800
>>
>>> It seems the only way to get the current pci-e bus speed & width
>>> in ixgbe (and probably many other NICs) is by parsing output
>>> of lspci -vvv.
>>>
>>> I'd personally find it easier if this info were available via
>>> ethtool API.
>>
>> You could just as easily have ethtool determine the PCI device
>> location (using existing facilities) and fetch the PCI-e info from the
>> PCI sysfs files.
>
> Any particular sysfs file? I've been grubbing around in there
> and I don't see anything that specifies bus width or speed..
>
> Maybe it's some binary blob that needs decoding?
lspci might be a good place to figure this out :-) It's probably
grovelling around in PCI config space to determine these things.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Should we report bus width/speed via ethtool?
2012-12-06 0:01 ` David Miller
@ 2012-12-06 0:08 ` Rick Jones
2012-12-06 0:20 ` Brice Goglin
1 sibling, 0 replies; 8+ messages in thread
From: Rick Jones @ 2012-12-06 0:08 UTC (permalink / raw)
To: David Miller; +Cc: greearb, netdev, e1000-devel
On 12/05/2012 04:01 PM, David Miller wrote:
> lspci might be a good place to figure this out :-) It's probably
> grovelling around in PCI config space to determine these things.
And if not lspci, "pcitop" used to grub around for such things, though
its source may be rather moldy. I'm sure though that if various chipset
providers were willing to document their PCI performance counters,
*someone* would be happy to bring pcitop into the present day...
happy benchmarking,
rick jones
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Should we report bus width/speed via ethtool?
2012-12-06 0:01 ` David Miller
2012-12-06 0:08 ` Rick Jones
@ 2012-12-06 0:20 ` Brice Goglin
2012-12-06 0:44 ` Ben Greear
1 sibling, 1 reply; 8+ messages in thread
From: Brice Goglin @ 2012-12-06 0:20 UTC (permalink / raw)
To: greearb; +Cc: netdev, e1000-devel
Le 05/12/2012 16:01, David Miller a écrit :
> lspci might be a good place to figure this out :-) It's probably
> grovelling around in PCI config space to determine these things.
Right, it looks from PCI_EXP_LNKSTA in the config space (only works as
root). Here's how we do the same in hwloc (using the pciutils lib
underneath):
https://svn.open-mpi.org/trac/hwloc/browser/trunk/src/topology-libpci.c#L399
Brice
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Should we report bus width/speed via ethtool?
2012-12-05 21:35 Should we report bus width/speed via ethtool? Ben Greear
2012-12-05 22:36 ` David Miller
@ 2012-12-06 2:06 ` Ben Hutchings
1 sibling, 0 replies; 8+ messages in thread
From: Ben Hutchings @ 2012-12-06 2:06 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev, e1000-devel list
On Wed, 2012-12-05 at 13:35 -0800, Ben Greear wrote:
> It seems the only way to get the current pci-e bus speed & width
> in ixgbe (and probably many other NICs) is by parsing output
> of lspci -vvv.
>
> I'd personally find it easier if this info were available via
> ethtool API.
>
> Any opinions on adding this info? I was thinking something like:
[...]
This is nothing specific to network devices, so putting it in ethtool
info is totally inappropriate.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-12-06 2:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05 21:35 Should we report bus width/speed via ethtool? Ben Greear
2012-12-05 22:36 ` David Miller
2012-12-05 23:09 ` Ben Greear
2012-12-06 0:01 ` David Miller
2012-12-06 0:08 ` Rick Jones
2012-12-06 0:20 ` Brice Goglin
2012-12-06 0:44 ` Ben Greear
2012-12-06 2:06 ` Ben Hutchings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox