The following patches add debugfs support to the ixgbe driver to give users the
ability to call functions registered in netdev_ops (simulating kernel actions)
as well as the ability to read and write to individual HW registers on the fly.
These options can be useful when debugging and unit testing ixgbe.
The following series implements...
---
Catherine Sullivan (3):
ixgbe: added reg_ops file to debugfs
ixgbe: added netdev_ops file to debugfs
ixgbe: add debugfs support
drivers/net/ethernet/intel/ixgbe/Makefile | 2
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 10 +
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 293 ++++++++++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +
4 files changed, 320 insertions(+), 2 deletions(-)
create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
--
Catherine Sullivan
This patch adds debugfs support to the ixgbe driver to give
users the ability to access kernel information and to
simulate kernel events.
The filesystem is set up in the following driver/PCI-instance
hierarchy:
<debugfs>
|-- ixgbe
|-- PCI instance
| |-- attribute files
|-- PCI instance
|-- attribute files
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/Makefile | 2 -
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 10 ++-
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 82 ++++++++++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 +++++
4 files changed, 109 insertions(+), 2 deletions(-)
create mode 100644 drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
Added the netdev_ops file to debugfs with a command to call the
ndo_tx_timeout function to give users the ability to simulate a
tx_timeout call made by the kernel.
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 103 ++++++++++++++++++++++
1 files changed, 101 insertions(+), 2 deletions(-)
Added the reg_ops file to debugfs with commands to read and write
a register to give users the ability to read and write individual
registers on the fly.
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)
From: Stephen Hemminger <hidden> Date: 2012-05-09 23:10:33
On Wed, 09 May 2012 16:09:40 -0700
Catherine Sullivan [off-list ref] wrote:
This patch adds debugfs support to the ixgbe driver to give
users the ability to access kernel information and to
simulate kernel events.
The filesystem is set up in the following driver/PCI-instance
hierarchy:
<debugfs>
|-- ixgbe
|-- PCI instance
| |-- attribute files
|-- PCI instance
|-- attribute files
Signed-off-by: Catherine Sullivan <redacted>
This should be an optional configuration since it is meant for special
case usage. See SKY2_DEBUG
From: Stephen Hemminger <hidden> Date: 2012-05-09 23:13:23
On Wed, 09 May 2012 16:09:45 -0700
Catherine Sullivan [off-list ref] wrote:
Added the netdev_ops file to debugfs with a command to call the
ndo_tx_timeout function to give users the ability to simulate a
tx_timeout call made by the kernel.
Signed-off-by: Catherine Sullivan <redacted>
What is the justification for creating a new API here?
Your exposing only one thing 'tx_timeout' and that is a generic property
of the device (not ixgbe specific). That value is already available via
sysfs.
From: Stephen Hemminger <hidden> Date: 2012-05-09 23:14:52
On Wed, 09 May 2012 16:09:50 -0700
Catherine Sullivan [off-list ref] wrote:
Added the reg_ops file to debugfs with commands to read and write
a register to give users the ability to read and write individual
registers on the fly.
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)
Aren't these registers already in ethtool? You are also
allowing write without any security checking.
From: Ben Hutchings <hidden> Date: 2012-05-10 00:18:15
On Wed, 2012-05-09 at 16:14 -0700, Stephen Hemminger wrote:
On Wed, 09 May 2012 16:09:50 -0700
Catherine Sullivan [off-list ref] wrote:
quoted
Added the reg_ops file to debugfs with commands to read and write
a register to give users the ability to read and write individual
registers on the fly.
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)
Aren't these registers already in ethtool?
ethtool register access is read-only and would be very heavy-weight for
interactive debugging. Not sure this is the best interface to
read/write registers, but it's certainly not redundant.
You are also allowing write without any security checking.
The file permissions are set to 0600 so it's root-only.
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.
From: Stephen Hemminger <hidden> Date: 2012-05-10 03:55:07
On Thu, 10 May 2012 01:18:10 +0100
Ben Hutchings [off-list ref] wrote:
On Wed, 2012-05-09 at 16:14 -0700, Stephen Hemminger wrote:
quoted
On Wed, 09 May 2012 16:09:50 -0700
Catherine Sullivan [off-list ref] wrote:
quoted
Added the reg_ops file to debugfs with commands to read and write
a register to give users the ability to read and write individual
registers on the fly.
Signed-off-by: Catherine Sullivan <redacted>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)
Aren't these registers already in ethtool?
ethtool register access is read-only and would be very heavy-weight for
interactive debugging. Not sure this is the best interface to
read/write registers, but it's certainly not redundant.
For debugging couldn't you could mmap the PCI space? That would allow writing
a user level debugger for the hardware.
Could you point me to where this is available in sysfs please? I'm not familiar with it.
Thanks,
Catherine
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Wednesday, May 09, 2012 4:13 PM
To: Sullivan, Catherine
Cc: netdev@vger.kernel.org
Subject: Re: [NET_NEXT RFC PATCH 2/3] ixgbe: added netdev_ops file to debugfs
On Wed, 09 May 2012 16:09:45 -0700
Catherine Sullivan [off-list ref] wrote:
Added the netdev_ops file to debugfs with a command to call the
ndo_tx_timeout function to give users the ability to simulate a
tx_timeout call made by the kernel.
Signed-off-by: Catherine Sullivan <redacted>
What is the justification for creating a new API here?
Your exposing only one thing 'tx_timeout' and that is a generic property of the device (not ixgbe specific). That value is already available via sysfs.
Could you point me to where this is available in sysfs please? I'm
not familiar with it.
Is the 'find' program not properly functioning on your computer?
[davem@drr net-next]$ find /sys -type f -name tx_timeout
/sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
/sys/devices/virtual/net/redhat0/queues/tx-0/tx_timeout
/sys/devices/pci0000:00/0000:00:1c.2/0000:06:00.0/net/p34p1/queues/tx-0/tx_timeout
[davem@drr net-next]$
I was aware of this, however this does not allow a call to the ndo_tx_timeout function which is what my patch does. Is there a way to do this with sysfs? I could not find this functionality.
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Thursday, May 10, 2012 1:32 PM
From: "Sullivan, Catherine" <redacted>
Date: Thu, 10 May 2012 20:28:28 +0000
Could you point me to where this is available in sysfs please? I'm not
familiar with it.
Is the 'find' program not properly functioning on your computer?
[davem@drr net-next]$ find /sys -type f -name tx_timeout /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
/sys/devices/virtual/net/redhat0/queues/tx-0/tx_timeout
/sys/devices/pci0000:00/0000:00:1c.2/0000:06:00.0/net/p34p1/queues/tx-0/tx_timeout
[davem@drr net-next]$
I was aware of this, however this does not allow a call to the
ndo_tx_timeout function which is what my patch does. Is there a way
to do this with sysfs? I could not find this functionality.
From: Stephen Hemminger <hidden> Date: 2012-05-10 21:35:42
On Thu, 10 May 2012 21:14:49 +0000
"Sullivan, Catherine" [off-list ref] wrote:
I was aware of this, however this does not allow a call to the ndo_tx_timeout function which is what my patch does. Is there a way to do this with sysfs? I could not find this functionality.
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Thursday, May 10, 2012 1:32 PM
From: "Sullivan, Catherine" <redacted>
Date: Thu, 10 May 2012 20:28:28 +0000
quoted
Could you point me to where this is available in sysfs please? I'm not
familiar with it.
Is the 'find' program not properly functioning on your computer?
[davem@drr net-next]$ find /sys -type f -name tx_timeout /sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
/sys/devices/virtual/net/redhat0/queues/tx-0/tx_timeout
/sys/devices/pci0000:00/0000:00:1c.2/0000:06:00.0/net/p34p1/queues/tx-0/tx_timeout
[davem@drr net-next]$
Are you trying to induce timeout for some tests or code coverage?
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Thursday, May 10, 2012 2:36 PM
On Thu, 10 May 2012 21:14:49 +0000
"Sullivan, Catherine" [off-list ref] wrote:
quoted
I was aware of this, however this does not allow a call to the
ndo_tx_timeout function which is what my patch does. Is there a way to
do this with sysfs? I could not find this functionality.
quoted
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Thursday, May 10, 2012 1:32 PM
From: "Sullivan, Catherine" <redacted>
Date: Thu, 10 May 2012 20:28:28 +0000
quoted
Could you point me to where this is available in sysfs please? I'm
not familiar with it.
Is the 'find' program not properly functioning on your computer?
[davem@drr net-next]$ find /sys -type f -name tx_timeout
/sys/devices/virtual/net/lo/queues/tx-0/tx_timeout
/sys/devices/virtual/net/redhat0/queues/tx-0/tx_timeout
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Wednesday, May 09, 2012 4:10 PM
On Wed, 09 May 2012 16:09:40 -0700
Catherine Sullivan [off-list ref] wrote:
quoted
This patch adds debugfs support to the ixgbe driver to give users the
ability to access kernel information and to simulate kernel events.
The filesystem is set up in the following driver/PCI-instance
hierarchy:
<debugfs>
|-- ixgbe
|-- PCI instance
| |-- attribute files
|-- PCI instance
|-- attribute files
Signed-off-by: Catherine Sullivan <redacted>
This should be an optional configuration since it is meant for special
case usage. See SKY2_DEBUG
After looking through the kernel, there doesn't seem to be a clear precedence for this. As was pointed out, SKY2_DEBUG is an optional configuration on its own. However regmap uses debugfs, and it is only optional based on CONFIG_DEBUG_FS, which is how this patch is currently set up. This patch does not have much overhead and we would prefer that it be enabled with CONFIG_DEBUG_FS.