All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
@ 2015-12-29 10:43 Hal Rosenstock
       [not found] ` <568263DF.6020505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hal Rosenstock @ 2015-12-29 10:43 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Christoph Lameter, Weiny, Ira, Matan Barak,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA


Port number is not part of ClassPortInfo attribute but is
still needed as a parameter when invoking process_mad.

To properly handle this attribute, port_num is added as a
parameter to get_counter_table and get_perf_mad was changed
not to store port_num in the attribute itself when it's
querying the ClassPortInfo attribute.

This handles issue pointed out by Matan Barak <matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

Fixes: 145d9c541032 ('IB/core: Display extended counter set if available')

Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Acked-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Acked-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
Change from v1:
Added fixes line to description

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 539040f..2daf832 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -438,7 +438,8 @@ static int get_perf_mad(struct ib_device *dev, int port_num, int attr,
 	in_mad->mad_hdr.method        = IB_MGMT_METHOD_GET;
 	in_mad->mad_hdr.attr_id       = attr;
 
-	in_mad->data[41] = port_num;	/* PortSelect field */
+	if (attr != IB_PMA_CLASS_PORT_INFO)
+		in_mad->data[41] = port_num;	/* PortSelect field */
 
 	if ((dev->process_mad(dev, IB_MAD_IGNORE_MKEY,
 		 port_num, NULL, NULL,
@@ -714,11 +715,12 @@ err:
  * Figure out which counter table to use depending on
  * the device capabilities.
  */
-static struct attribute_group *get_counter_table(struct ib_device *dev)
+static struct attribute_group *get_counter_table(struct ib_device *dev,
+						 int port_num)
 {
 	struct ib_class_port_info cpi;
 
-	if (get_perf_mad(dev, 0, IB_PMA_CLASS_PORT_INFO,
+	if (get_perf_mad(dev, port_num, IB_PMA_CLASS_PORT_INFO,
 				&cpi, 40, sizeof(cpi)) >= 0) {
 
 		if (cpi.capability_mask && IB_PMA_CLASS_CAP_EXT_WIDTH)
@@ -776,7 +778,7 @@ static int add_port(struct ib_device *device, int port_num,
 		goto err_put;
 	}
 
-	p->pma_table = get_counter_table(device);
+	p->pma_table = get_counter_table(device, port_num);
 	ret = sysfs_create_group(&p->kobj, p->pma_table);
 	if (ret)
 		goto err_put_gid_attrs;
--
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] 6+ messages in thread

* Re: [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
       [not found] ` <568263DF.6020505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2015-12-29 12:21   ` Or Gerlitz
       [not found]     ` <56827AB7.50508-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-12-29 16:58   ` Christoph Lameter
  1 sibling, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2015-12-29 12:21 UTC (permalink / raw)
  To: Hal Rosenstock, Doug Ledford
  Cc: Christoph Lameter, Weiny, Ira, Matan Barak,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/29/2015 12:43 PM, Hal Rosenstock wrote:
> Port number is not part of ClassPortInfo attribute but is
> still needed as a parameter when invoking process_mad.

Please remove the blank line above your 1st sentence.

>
> To properly handle this attribute, port_num is added as a
> parameter to get_counter_table and get_perf_mad was changed
> not to store port_num in the attribute itself when it's
> querying the ClassPortInfo attribute.
>
> This handles issue pointed out by Matan Barak <matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>
> Fixes: 145d9c541032 ('IB/core: Display extended counter set if available')
>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
again, remove the blank line after the fixes tag.

Also,  I am not that the way Doug is setting the branch for pull would 
preserve commit IDs when
the offending patch landed in Linus tree. If this is the case, we should 
put your patch in 2nd pull
request and have the right commit ID there. Please check with Doug.
> Acked-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Acked-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> Change from v1:
> Added fixes line to description

So this patch makes mlx4 IB driver on Eth ports workable with the 
4.5-rc1 proposed bits?

--
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] 6+ messages in thread

* Re: [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
       [not found]     ` <56827AB7.50508-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-12-29 12:46       ` Hal Rosenstock
       [not found]         ` <568280BE.8030005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hal Rosenstock @ 2015-12-29 12:46 UTC (permalink / raw)
  To: Or Gerlitz, Doug Ledford
  Cc: Christoph Lameter, Weiny, Ira, Matan Barak,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 12/29/2015 7:21 AM, Or Gerlitz wrote:
> On 12/29/2015 12:43 PM, Hal Rosenstock wrote:
>> This handles issue pointed out by Matan Barak <matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>>
>> Fixes: 145d9c541032 ('IB/core: Display extended counter set if
>> available')
>>
>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> again, remove the blank line after the fixes tag.
> 
> Also,  I am not that the way Doug is setting the branch for pull would
> preserve commit IDs when
> the offending patch landed in Linus tree. If this is the case, we should
> put your patch in 2nd pull
> request and have the right commit ID there. Please check with Doug.

Doug ?
--
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] 6+ messages in thread

* Re: [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
       [not found] ` <568263DF.6020505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2015-12-29 12:21   ` Or Gerlitz
@ 2015-12-29 16:58   ` Christoph Lameter
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2015-12-29 16:58 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Doug Ledford, Weiny, Ira, Matan Barak, linux-rdma-u79uwXL29TY76Z2rM5mHXA


Reviewed-by: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>

--
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] 6+ messages in thread

* Re: [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
       [not found]         ` <568280BE.8030005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-01-19 21:20           ` Doug Ledford
       [not found]             ` <569EA8B2.80607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Ledford @ 2016-01-19 21:20 UTC (permalink / raw)
  To: Hal Rosenstock, Or Gerlitz
  Cc: Christoph Lameter, Weiny, Ira, Matan Barak,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]

On 12/29/2015 07:46 AM, Hal Rosenstock wrote:
> On 12/29/2015 7:21 AM, Or Gerlitz wrote:
>> On 12/29/2015 12:43 PM, Hal Rosenstock wrote:
>>> This handles issue pointed out by Matan Barak <matanb-LDSdmyG8hGUWn1LaSxwUnA@public.gmane.org.il>
>>>
>>> Fixes: 145d9c541032 ('IB/core: Display extended counter set if
>>> available')
>>>
>>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> again, remove the blank line after the fixes tag.
>>
>> Also,  I am not that the way Doug is setting the branch for pull would
>> preserve commit IDs when
>> the offending patch landed in Linus tree. If this is the case, we should
>> put your patch in 2nd pull
>> request and have the right commit ID there. Please check with Doug.
> 
> Doug ?
> 

The commit id should be preserved as long as the commit ID you reference
is from my k.o tree and a k.o/ branch.  It only changes if I rebase, and
I don't do that on k.o branches that I've pushed to k.o (I have,
however, once rebased a k.o/ branch that I had only pushed to
github...and I try not to do that and will try even harder in the future
not to, but I did do it once).

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

* Re: [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling
       [not found]             ` <569EA8B2.80607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-01-19 21:21               ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2016-01-19 21:21 UTC (permalink / raw)
  To: Hal Rosenstock, Or Gerlitz
  Cc: Christoph Lameter, Weiny, Ira, Matan Barak,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]

On 01/19/2016 04:20 PM, Doug Ledford wrote:
> On 12/29/2015 07:46 AM, Hal Rosenstock wrote:
>> On 12/29/2015 7:21 AM, Or Gerlitz wrote:
>>> On 12/29/2015 12:43 PM, Hal Rosenstock wrote:
>>>> This handles issue pointed out by Matan Barak <matanb-LDSdmyG8hGXFtvusC2JeyQ@public.gmane.orgo.il>
>>>>
>>>> Fixes: 145d9c541032 ('IB/core: Display extended counter set if
>>>> available')
>>>>
>>>> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>> again, remove the blank line after the fixes tag.
>>>
>>> Also,  I am not that the way Doug is setting the branch for pull would
>>> preserve commit IDs when
>>> the offending patch landed in Linus tree. If this is the case, we should
>>> put your patch in 2nd pull
>>> request and have the right commit ID there. Please check with Doug.
>>
>> Doug ?
>>
> 
> The commit id should be preserved as long as the commit ID you reference
> is from my k.o tree and a k.o/ branch.  It only changes if I rebase, and
> I don't do that on k.o branches that I've pushed to k.o (I have,
> however, once rebased a k.o/ branch that I had only pushed to
> github...and I try not to do that and will try even harder in the future
> not to, but I did do it once).
> 

Oh, and I picked this up.  Thanks.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

end of thread, other threads:[~2016-01-19 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 10:43 [PATCH v2] IB/core: sysfs.c: Fix PerfMgt ClassPortInfo handling Hal Rosenstock
     [not found] ` <568263DF.6020505-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-29 12:21   ` Or Gerlitz
     [not found]     ` <56827AB7.50508-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-29 12:46       ` Hal Rosenstock
     [not found]         ` <568280BE.8030005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-01-19 21:20           ` Doug Ledford
     [not found]             ` <569EA8B2.80607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-19 21:21               ` Doug Ledford
2015-12-29 16:58   ` Christoph Lameter

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.