Skip to contentSkip to conversation

ethtool: Display reg dump length via get driver info.

RFC In review Ajit Khaparde 2 participants 8 messages Mar 18, 2011 – Mar 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 ethtool: Display reg dump length via get driver info.

Devices like BE store Reg Dump Data in the hardware. This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

Patch:
----

---
 ethtool.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
ethtool.c +4 -2
index e9cb2c9..a0c7c99 100644
@@ -1423,11 +1423,13 @@ static int dump_drvinfo(struct ethtool_drvinfo *info)
 		"driver: %s\n"
 		"version: %s\n"
 		"firmware-version: %s\n"
-		"bus-info: %s\n",
+		"bus-info: %s\n"
+		"regdump-len: %d\n",
 		info->driver,
 		info->version,
 		info->fw_version,
-		info->bus_info);
+		info->bus_info,
+		info->regdump_len);
 
 	return 0;
 }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 1 line · Ajit Khaparde

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software 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.
#2 lore raw

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 3 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

-Ajit

Quoted 1 line

Ben.

--
Ben Hutchings, Senior Software 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.

#3 lore raw
Quoted 24 lines · On Fri, 2011-03-18 at 14:52 -0700, [email protected] wrote:

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 3 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Quoted 4 lines

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

OK, so what you're really interested in is 'does this version of the driver support register dump'?

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software 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.
#4 lore raw

________________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 5:00 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: RE: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 25 lines · On Fri, 2011-03-18 at 14:52 -0700, [email protected] wrote:
Quoted 24 lines

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 3 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Quoted 7 lines
Quoted 4 lines

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

OK, so what you're really interested in is 'does this version of the driver support register dump'?

Yes. I did not want to add another option in ethtool to get this info out.

Quoted 1 line

Ben.

--
Ben Hutchings, Senior Software 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.

#5 lore raw

PATCH 1/1 ethtool: Report driver features described in struct ethtool_drvinfo

Quoted 37 lines · On Fri, 2011-03-18 at 15:07 -0700, [email protected] wrote:

________________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 5:00 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: RE: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 29 lines · On Fri, 2011-03-18 at 14:52 -0700, [email protected] wrote:
Quoted 28 lines

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 3 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

Quoted 4 lines
Quoted 2 lines

OK, so what you're really interested in is 'does this version of the driver support register dump'?

Yes. I did not want to add another option in ethtool to get this info out.

So, how about this?

Ben.

---
ETHTOOL_GDRVINFO fills out struct ethtool_drvinfo with the size of the data returned by various other operations. The size should be non-zero if and only if the driver implements that operation. Therefore, we can report whether the driver supports certain operations without actually trying them (which may be expensive and disruptive).

Do this in dump_drvinfo() rather than adding a separation operation.

---
 ethtool.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
ethtool.c +10 -2
index e9cb2c9..32df0ee 100644
@@ -1423,11 +1423,19 @@ static int dump_drvinfo(struct ethtool_drvinfo *info)
 		"driver: %s\n"
 		"version: %s\n"
 		"firmware-version: %s\n"
-		"bus-info: %s\n",
+		"bus-info: %s\n"
+		"supports-statistics: %s\n"
+		"supports-test: %s\n"
+		"supports-eeprom-access: %s\n"
+		"supports-register-dump: %s\n",
 		info->driver,
 		info->version,
 		info->fw_version,
-		info->bus_info);
+		info->bus_info,
+		info->n_stats ? "yes" : "no",
+		info->testinfo_len ? "yes" : "no",
+		info->eedump_len ? "yes" : "no",
+		info->regdump_len ? "yes" : "no");
 
 	return 0;
 }

---

Signature · 3 lines
Ben Hutchings, Senior Software 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.
#6 lore raw

RE: [PATCH ethtool] ethtool: Report driver features described in struct ethtool_drvinfo

_______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 5:44 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: [PATCH ethtool] ethtool: Report driver features described in struct ethtool_drvinfo

Quoted 46 lines · On Fri, 2011-03-18 at 15:07 -0700, [email protected] wrote:
Quoted 37 lines

________________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 5:00 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: RE: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 29 lines · On Fri, 2011-03-18 at 14:52 -0700, [email protected] wrote:
Quoted 6 lines

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 20 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

Quoted 4 lines
Quoted 2 lines

OK, so what you're really interested in is 'does this version of the driver support register dump'?

Yes. I did not want to add another option in ethtool to get this info out.

So, how about this?

Ben.

Quoted 8 lines

---
ETHTOOL_GDRVINFO fills out struct ethtool_drvinfo with the size of the data returned by various other operations. The size should be non-zero if and only if the driver implements that operation. Therefore, we can report whether the driver supports certain operations without actually trying them (which may be expensive and disruptive).

Do this in dump_drvinfo() rather than adding a separation operation.

This one is fine too.
Though I would have liked the other one where it displays either zero or the max value. You could add Acked-by:
Ajit Khaparde <[email protected]>

-Ajit

Quoted 36 lines

---
ethtool.c | 12 ++++++++++--

1 files changed, 10 insertions(+), 2 deletions(-)
ethtool.c +10 -4
index e9cb2c9..32df0ee 100644
@@ -1423,11 +1423,19 @@ static int dump_drvinfo(struct ethtool_drvinfo *info)
                "driver: %s\n"
                "version: %s\n"
                "firmware-version: %s\n"
-               "bus-info: %s\n",
+               "bus-info: %s\n"
+               "supports-statistics: %s\n"
+               "supports-test: %s\n"
+               "supports-eeprom-access: %s\n"
+               "supports-register-dump: %s\n",
                info->driver,
                info->version,
                info->fw_version,
-               info->bus_info);
+               info->bus_info,
+               info->n_stats ? "yes" : "no",
+               info->testinfo_len ? "yes" : "no",
+               info->eedump_len ? "yes" : "no",
+               info->regdump_len ? "yes" : "no");
 
        return 0;
 }
---
 
--

Ben Hutchings, Senior Software 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.

#7 lore raw

Re: [PATCH ethtool] ethtool: Report driver features described in struct ethtool_drvinfo

In reply to Ben Hutchings
Quoted 38 lines · Ben Hutchings
Quoted 37 lines · On Fri, 2011-03-18 at 15:07 -0700, [email protected] wrote:

________________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 5:00 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: RE: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 29 lines · On Fri, 2011-03-18 at 14:52 -0700, [email protected] wrote:
Quoted 28 lines

______________________________________
From: Ben Hutchings [[email protected]]
Sent: Friday, March 18, 2011 4:32 PM
To: Khaparde, Ajit
Cc: [email protected]
Subject: Re: [RFC] ethtool: Display reg dump length via get driver info.

Quoted 3 lines · Ajit Khaparde
Quoted 1 line

Devices like BE store Reg Dump Data in the hardware.

Where else would it be?

Well yes. That's true.

Quoted 9 lines
Quoted 3 lines

This change will allow to just peek into the hardware to see if any data is available for a dump and analysis, without actually dumping the register data.

[...]

This is wrong. ethtool_ops::get_regs_len really should return a constant, otherwise ethtool (and the kernel) cannot allocate a buffer of the right size. If the size of a dump really does vary then make it return the maximum possible size for the device.

Yes, it is a constant size. And will always be the max size possible.
I just want to see if I can get the length, without really making the ethtoool -d call. Because that will trigger the dump too.
At that moment, I may not be interested in the data itself.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

OK, so what you're really interested in is 'does this version of the driver support register dump'?

Yes. I did not want to add another option in ethtool to get this info out.

So, how about this?

[...]
I've applied this change.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software 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.