ethtool: Display reg dump length via get driver info.
Subsystems (2)
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
@@ -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
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.
______________________________________
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_lenreally 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.
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_lenreally 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.
________________________________________
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_lenreally 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.
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_lenreally 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
@@ -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.
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_lenreally 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_GDRVINFOfills out structethtool_drvinfowith 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@@ -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.
Re: [PATCH ethtool] ethtool: Report driver features described in struct ethtool_drvinfo
In reply to Ben HutchingsQuoted 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_lenreally 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.