All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
@ 2016-12-19 22:25 Hal Rosenstock
       [not found] ` <094d3fd9-a478-ce30-b2de-8983c783c411-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hal Rosenstock @ 2016-12-19 22:25 UTC (permalink / raw)
  To: Weiny, Ira; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA


Rather than printing "Could be FDR10", print
"Could be FDR10 (Found link at QDR but expected speed is FDR10)"
for this case.

Confusion is with words "Could be" and fact that both
QDR and FDR10 are both 10.0 Gbps.

Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
Change since v1:
Preserved original "Could be FDR10" so can grep for "Could be"
along with adding new language.

 src/ibdiag_common.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index f74eed4..ad8551f 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -814,8 +814,14 @@ check_ext_speed:
 
 check_fdr10_active:
 	if ((mad_get_field(port->ext_info, 0,
-			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
-		snprintf(speed_msg, msg_size, "Could be FDR10");
+			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
+		/* Special case QDR to try to avoid confusion with FDR10 */
+		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
+			snprintf(speed_msg, msg_size,
+				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
+		else
+			snprintf(speed_msg, msg_size, "Could be FDR10");
+	}
 }
 
 int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
       [not found] ` <094d3fd9-a478-ce30-b2de-8983c783c411-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-12-20 10:41   ` Yuval Shaia
       [not found]     ` <20161220104149.GC7351-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Yuval Shaia @ 2016-12-20 10:41 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
> 
> Rather than printing "Could be FDR10", print
> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
> for this case.
> 
> Confusion is with words "Could be" and fact that both
> QDR and FDR10 are both 10.0 Gbps.
> 
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> Change since v1:
> Preserved original "Could be FDR10" so can grep for "Could be"
> along with adding new language.
> 
>  src/ibdiag_common.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> index f74eed4..ad8551f 100644
> --- a/src/ibdiag_common.c
> +++ b/src/ibdiag_common.c
> @@ -814,8 +814,14 @@ check_ext_speed:
>  
>  check_fdr10_active:
>  	if ((mad_get_field(port->ext_info, 0,
> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
> -		snprintf(speed_msg, msg_size, "Could be FDR10");
> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
> +		/* Special case QDR to try to avoid confusion with FDR10 */
> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
> +			snprintf(speed_msg, msg_size,
> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
> +		else
> +			snprintf(speed_msg, msg_size, "Could be FDR10");
> +	}

Since there is no "formatting" here can you take advantage with this change
and consider using strncpy instead of snprintf?

>  }
>  
>  int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
       [not found]     ` <20161220104149.GC7351-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
@ 2016-12-20 12:31       ` Hal Rosenstock
       [not found]         ` <b29d8763-94c5-2a7a-2e5f-31f707507152-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hal Rosenstock @ 2016-12-20 12:31 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/20/2016 5:41 AM, Yuval Shaia wrote:
> On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
>>
>> Rather than printing "Could be FDR10", print
>> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
>> for this case.
>>
>> Confusion is with words "Could be" and fact that both
>> QDR and FDR10 are both 10.0 Gbps.
>>
>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> ---
>> Change since v1:
>> Preserved original "Could be FDR10" so can grep for "Could be"
>> along with adding new language.
>>
>>  src/ibdiag_common.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
>> index f74eed4..ad8551f 100644
>> --- a/src/ibdiag_common.c
>> +++ b/src/ibdiag_common.c
>> @@ -814,8 +814,14 @@ check_ext_speed:
>>  
>>  check_fdr10_active:
>>  	if ((mad_get_field(port->ext_info, 0,
>> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
>> -		snprintf(speed_msg, msg_size, "Could be FDR10");
>> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
>> +		/* Special case QDR to try to avoid confusion with FDR10 */
>> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
>> +			snprintf(speed_msg, msg_size,
>> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
>> +		else
>> +			snprintf(speed_msg, msg_size, "Could be FDR10");
>> +	}
> 
> Since there is no "formatting" here can you take advantage with this change
> and consider using strncpy instead of snprintf?


This patch was merely changing the messages.

Sure; strncpy rather than snprintf could be used in these cases. That
could be done in a separate patch which would change all such
occurrences and not just here.

>>  }
>>  
>>  int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
       [not found]         ` <b29d8763-94c5-2a7a-2e5f-31f707507152-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-12-20 14:42           ` Yuval Shaia
  2016-12-20 15:01             ` Hal Rosenstock
  2016-12-20 15:08           ` Yuval Shaia
  1 sibling, 1 reply; 8+ messages in thread
From: Yuval Shaia @ 2016-12-20 14:42 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Dec 20, 2016 at 07:31:59AM -0500, Hal Rosenstock wrote:
> On 12/20/2016 5:41 AM, Yuval Shaia wrote:
> > On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
> >>
> >> Rather than printing "Could be FDR10", print
> >> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
> >> for this case.
> >>
> >> Confusion is with words "Could be" and fact that both
> >> QDR and FDR10 are both 10.0 Gbps.
> >>
> >> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >> ---
> >> Change since v1:
> >> Preserved original "Could be FDR10" so can grep for "Could be"
> >> along with adding new language.
> >>
> >>  src/ibdiag_common.c | 10 ++++++++--
> >>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> >> index f74eed4..ad8551f 100644
> >> --- a/src/ibdiag_common.c
> >> +++ b/src/ibdiag_common.c
> >> @@ -814,8 +814,14 @@ check_ext_speed:
> >>  
> >>  check_fdr10_active:
> >>  	if ((mad_get_field(port->ext_info, 0,
> >> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
> >> -		snprintf(speed_msg, msg_size, "Could be FDR10");
> >> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
> >> +		/* Special case QDR to try to avoid confusion with FDR10 */
> >> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)

Should this "4" be #define?

> >> +			snprintf(speed_msg, msg_size,
> >> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
> >> +		else
> >> +			snprintf(speed_msg, msg_size, "Could be FDR10");
> >> +	}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
  2016-12-20 14:42           ` Yuval Shaia
@ 2016-12-20 15:01             ` Hal Rosenstock
       [not found]               ` <0797688e-b9ab-78d5-71d1-1b796589ac80-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hal Rosenstock @ 2016-12-20 15:01 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/20/2016 9:42 AM, Yuval Shaia wrote:
> On Tue, Dec 20, 2016 at 07:31:59AM -0500, Hal Rosenstock wrote:
>> On 12/20/2016 5:41 AM, Yuval Shaia wrote:
>>> On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
>>>>
>>>> Rather than printing "Could be FDR10", print
>>>> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
>>>> for this case.
>>>>
>>>> Confusion is with words "Could be" and fact that both
>>>> QDR and FDR10 are both 10.0 Gbps.
>>>>
>>>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>> ---
>>>> Change since v1:
>>>> Preserved original "Could be FDR10" so can grep for "Could be"
>>>> along with adding new language.
>>>>
>>>>  src/ibdiag_common.c | 10 ++++++++--
>>>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
>>>> index f74eed4..ad8551f 100644
>>>> --- a/src/ibdiag_common.c
>>>> +++ b/src/ibdiag_common.c
>>>> @@ -814,8 +814,14 @@ check_ext_speed:
>>>>  
>>>>  check_fdr10_active:
>>>>  	if ((mad_get_field(port->ext_info, 0,
>>>> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
>>>> -		snprintf(speed_msg, msg_size, "Could be FDR10");
>>>> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
>>>> +		/* Special case QDR to try to avoid confusion with FDR10 */
>>>> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
> 
> Should this "4" be #define?

I think that such defines belong in the MAD libraries/headers but
unfortunately are missing.

>>>> +			snprintf(speed_msg, msg_size,
>>>> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
>>>> +		else
>>>> +			snprintf(speed_msg, msg_size, "Could be FDR10");
>>>> +	}
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
       [not found]               ` <0797688e-b9ab-78d5-71d1-1b796589ac80-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-12-20 15:04                 ` Yuval Shaia
  2016-12-20 15:06                   ` Hal Rosenstock
  0 siblings, 1 reply; 8+ messages in thread
From: Yuval Shaia @ 2016-12-20 15:04 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Dec 20, 2016 at 10:01:46AM -0500, Hal Rosenstock wrote:
> On 12/20/2016 9:42 AM, Yuval Shaia wrote:
> > On Tue, Dec 20, 2016 at 07:31:59AM -0500, Hal Rosenstock wrote:
> >> On 12/20/2016 5:41 AM, Yuval Shaia wrote:
> >>> On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
> >>>>
> >>>> Rather than printing "Could be FDR10", print
> >>>> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
> >>>> for this case.
> >>>>
> >>>> Confusion is with words "Could be" and fact that both
> >>>> QDR and FDR10 are both 10.0 Gbps.
> >>>>
> >>>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >>>> ---
> >>>> Change since v1:
> >>>> Preserved original "Could be FDR10" so can grep for "Could be"
> >>>> along with adding new language.
> >>>>
> >>>>  src/ibdiag_common.c | 10 ++++++++--
> >>>>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> >>>> index f74eed4..ad8551f 100644
> >>>> --- a/src/ibdiag_common.c
> >>>> +++ b/src/ibdiag_common.c
> >>>> @@ -814,8 +814,14 @@ check_ext_speed:
> >>>>  
> >>>>  check_fdr10_active:
> >>>>  	if ((mad_get_field(port->ext_info, 0,
> >>>> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
> >>>> -		snprintf(speed_msg, msg_size, "Could be FDR10");
> >>>> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
> >>>> +		/* Special case QDR to try to avoid confusion with FDR10 */
> >>>> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
> > 
> > Should this "4" be #define?
> 
> I think that such defines belong in the MAD libraries/headers but
> unfortunately are missing.

Suggesting to add it as (at least for me) 4 does not tell anything.

> 
> >>>> +			snprintf(speed_msg, msg_size,
> >>>> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
> >>>> +		else
> >>>> +			snprintf(speed_msg, msg_size, "Could be FDR10");
> >>>> +	}
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
  2016-12-20 15:04                 ` Yuval Shaia
@ 2016-12-20 15:06                   ` Hal Rosenstock
  0 siblings, 0 replies; 8+ messages in thread
From: Hal Rosenstock @ 2016-12-20 15:06 UTC (permalink / raw)
  To: Yuval Shaia; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/20/2016 10:04 AM, Yuval Shaia wrote:
> On Tue, Dec 20, 2016 at 10:01:46AM -0500, Hal Rosenstock wrote:
>> On 12/20/2016 9:42 AM, Yuval Shaia wrote:
>>> On Tue, Dec 20, 2016 at 07:31:59AM -0500, Hal Rosenstock wrote:
>>>> On 12/20/2016 5:41 AM, Yuval Shaia wrote:
>>>>> On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
>>>>>>
>>>>>> Rather than printing "Could be FDR10", print
>>>>>> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
>>>>>> for this case.
>>>>>>
>>>>>> Confusion is with words "Could be" and fact that both
>>>>>> QDR and FDR10 are both 10.0 Gbps.
>>>>>>
>>>>>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>>>> ---
>>>>>> Change since v1:
>>>>>> Preserved original "Could be FDR10" so can grep for "Could be"
>>>>>> along with adding new language.
>>>>>>
>>>>>>  src/ibdiag_common.c | 10 ++++++++--
>>>>>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
>>>>>> index f74eed4..ad8551f 100644
>>>>>> --- a/src/ibdiag_common.c
>>>>>> +++ b/src/ibdiag_common.c
>>>>>> @@ -814,8 +814,14 @@ check_ext_speed:
>>>>>>  
>>>>>>  check_fdr10_active:
>>>>>>  	if ((mad_get_field(port->ext_info, 0,
>>>>>> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
>>>>>> -		snprintf(speed_msg, msg_size, "Could be FDR10");
>>>>>> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
>>>>>> +		/* Special case QDR to try to avoid confusion with FDR10 */
>>>>>> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
>>>
>>> Should this "4" be #define?
>>
>> I think that such defines belong in the MAD libraries/headers but
>> unfortunately are missing.
> 
> Suggesting to add it as (at least for me) 4 does not tell anything.

I'll add comment to indicate that this means Active.

Fixing the generic issue is a larger issue I don't have the time to tackle.

>>
>>>>>> +			snprintf(speed_msg, msg_size,
>>>>>> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
>>>>>> +		else
>>>>>> +			snprintf(speed_msg, msg_size, "Could be FDR10");
>>>>>> +	}
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10
       [not found]         ` <b29d8763-94c5-2a7a-2e5f-31f707507152-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2016-12-20 14:42           ` Yuval Shaia
@ 2016-12-20 15:08           ` Yuval Shaia
  1 sibling, 0 replies; 8+ messages in thread
From: Yuval Shaia @ 2016-12-20 15:08 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Weiny, Ira, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Tue, Dec 20, 2016 at 07:31:59AM -0500, Hal Rosenstock wrote:
> On 12/20/2016 5:41 AM, Yuval Shaia wrote:
> > On Mon, Dec 19, 2016 at 05:25:11PM -0500, Hal Rosenstock wrote:
> >>
> >> Rather than printing "Could be FDR10", print
> >> "Could be FDR10 (Found link at QDR but expected speed is FDR10)"
> >> for this case.
> >>
> >> Confusion is with words "Could be" and fact that both
> >> QDR and FDR10 are both 10.0 Gbps.
> >>
> >> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >> ---
> >> Change since v1:
> >> Preserved original "Could be FDR10" so can grep for "Could be"
> >> along with adding new language.
> >>
> >>  src/ibdiag_common.c | 10 ++++++++--
> >>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
> >> index f74eed4..ad8551f 100644
> >> --- a/src/ibdiag_common.c
> >> +++ b/src/ibdiag_common.c
> >> @@ -814,8 +814,14 @@ check_ext_speed:
> >>  
> >>  check_fdr10_active:
> >>  	if ((mad_get_field(port->ext_info, 0,
> >> -			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
> >> -		snprintf(speed_msg, msg_size, "Could be FDR10");
> >> +			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) {
> >> +		/* Special case QDR to try to avoid confusion with FDR10 */
> >> +		if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4)
> >> +			snprintf(speed_msg, msg_size,
> >> +				 "Could be FDR10 (Found link at QDR but expected speed is FDR10)");
> >> +		else
> >> +			snprintf(speed_msg, msg_size, "Could be FDR10");
> >> +	}
> > 
> > Since there is no "formatting" here can you take advantage with this change
> > and consider using strncpy instead of snprintf?
> 
> 
> This patch was merely changing the messages.
> 
> Sure; strncpy rather than snprintf could be used in these cases. That
> could be done in a separate patch which would change all such
> occurrences and not just here.

Hope it'll not be forgotten :)

Still suggesting "while we are there"...

> 
> >>  }
> >>  
> >>  int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> >> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-12-20 15:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 22:25 [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10 Hal Rosenstock
     [not found] ` <094d3fd9-a478-ce30-b2de-8983c783c411-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-12-20 10:41   ` Yuval Shaia
     [not found]     ` <20161220104149.GC7351-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
2016-12-20 12:31       ` Hal Rosenstock
     [not found]         ` <b29d8763-94c5-2a7a-2e5f-31f707507152-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-12-20 14:42           ` Yuval Shaia
2016-12-20 15:01             ` Hal Rosenstock
     [not found]               ` <0797688e-b9ab-78d5-71d1-1b796589ac80-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-12-20 15:04                 ` Yuval Shaia
2016-12-20 15:06                   ` Hal Rosenstock
2016-12-20 15:08           ` Yuval Shaia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.