diff mbox

[infiniband-diags,2/2] smpdump.c: Print number of bytes returned by umad_recv

Message ID 499f1d77-7da6-2c00-e826-bf4d0809f48a@dev.mellanox.co.il (mailing list archive)
State Changes Requested
Delegated to: Ira Weiny
Headers show

Commit Message

Hal Rosenstock Dec. 11, 2017, 2:57 p.m. UTC
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 src/smpdump.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ira Weiny Feb. 7, 2018, 5:35 a.m. UTC | #1
On Mon, Dec 11, 2017 at 09:57:23AM -0500, Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---
>  src/smpdump.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/smpdump.c b/src/smpdump.c
> index bc8559a..bb304d4 100644
> --- a/src/smpdump.c
> +++ b/src/smpdump.c
> @@ -281,6 +281,8 @@ int main(int argc, char *argv[])
>  	if (umad_recv(portid, umad, &length, -1) != mad_agent)
>  		IBPANIC("recv error: %s", strerror(errno));
>  
> +	printf("%d bytes received\n", length);

This seems like it is more for debugging.

How will this affect any scripts which include this command?  Should we make
this debug output?

Ira


> +
>  	if (!dump_char) {
>  		xdump(stdout, 0, smp->data, 64);
>  		if (smp->status)
> -- 
> 2.8.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hal Rosenstock Feb. 7, 2018, 11:46 a.m. UTC | #2
On 2/7/2018 12:35 AM, ira.weiny wrote:
> On Mon, Dec 11, 2017 at 09:57:23AM -0500, Hal Rosenstock wrote:
>>
>> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
>> ---
>>  src/smpdump.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/smpdump.c b/src/smpdump.c
>> index bc8559a..bb304d4 100644
>> --- a/src/smpdump.c
>> +++ b/src/smpdump.c
>> @@ -281,6 +281,8 @@ int main(int argc, char *argv[])
>>  	if (umad_recv(portid, umad, &length, -1) != mad_agent)
>>  		IBPANIC("recv error: %s", strerror(errno));
>>  
>> +	printf("%d bytes received\n", length);
> 
> This seems like it is more for debugging.

I don't recall now what the case was exactly where umad_recv succeeded
but it was unclear whether the data was valid or not. In that sense,
it's a missing part of the current information returned.

I think this command geared at manual debug of attribute IDs not
supported in smpquery.

> How will this affect any scripts which include this command?  

AFAIK there are no such scripts.

> Should we make this debug output?

That's probably better/safer and at least provides a way to obtain the
proposed added information.

Do you want an updated patch for this ?

-- Hal

> Ira
> 
> 
>> +
>>  	if (!dump_char) {
>>  		xdump(stdout, 0, smp->data, 64);
>>  		if (smp->status)
>> -- 
>> 2.8.4
>>
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ira Weiny Feb. 7, 2018, 4:12 p.m. UTC | #3
PiANCj4gT24gMi83LzIwMTggMTI6MzUgQU0sIGlyYS53ZWlueSB3cm90ZToNCj4gPiBPbiBNb24s
IERlYyAxMSwgMjAxNyBhdCAwOTo1NzoyM0FNIC0wNTAwLCBIYWwgUm9zZW5zdG9jayB3cm90ZToN
Cj4gPj4NCj4gPj4gU2lnbmVkLW9mZi1ieTogSGFsIFJvc2Vuc3RvY2sgPGhhbEBtZWxsYW5veC5j
b20+DQo+ID4+IC0tLQ0KPiA+PiAgc3JjL3NtcGR1bXAuYyB8IDIgKysNCj4gPj4gIDEgZmlsZSBj
aGFuZ2VkLCAyIGluc2VydGlvbnMoKykNCj4gPj4NCj4gPj4gZGlmZiAtLWdpdCBhL3NyYy9zbXBk
dW1wLmMgYi9zcmMvc21wZHVtcC5jIGluZGV4IGJjODU1OWEuLmJiMzA0ZDQNCj4gPj4gMTAwNjQ0
DQo+ID4+IC0tLSBhL3NyYy9zbXBkdW1wLmMNCj4gPj4gKysrIGIvc3JjL3NtcGR1bXAuYw0KPiA+
PiBAQC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Vhc3QgcHJvdmlkZXMgYSB3
YXkgdG8gb2J0YWluIHRoZSBwcm9wb3NlZA0KPiBhZGRlZCBpbmZvcm1hdGlvbi4NCj4gDQo+IERv
IHlvdSB3YW50IGFuIHVwZGF0ZWQgcGF0Y2ggZm9yIHRoaXMgPw0KDQpZZXMgcGxlYXNlLA0KSXJh
DQoNCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/smpdump.c b/src/smpdump.c
index bc8559a..bb304d4 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -281,6 +281,8 @@  int main(int argc, char *argv[])
 	if (umad_recv(portid, umad, &length, -1) != mad_agent)
 		IBPANIC("recv error: %s", strerror(errno));
 
+	printf("%d bytes received\n", length);
+
 	if (!dump_char) {
 		xdump(stdout, 0, smp->data, 64);
 		if (smp->status)