diff mbox

[libibmad,2/2] gs.c: In performance_reset_via, use proper CounterSelect2 field for PortCountersExtended

Message ID 26623475-0c21-ebf2-f4e8-dd40693fab64@dev.mellanox.co.il (mailing list archive)
State Accepted, archived
Delegated to: Ira Weiny
Headers show

Commit Message

Hal Rosenstock March 27, 2017, 3:35 p.m. UTC
Per MgtWG errata #9302

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
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

Comments

Ira Weiny April 30, 2017, 12:05 a.m. UTC | #1
On Mon, Mar 27, 2017 at 11:35:44AM -0400, Hal Rosenstock wrote:
> 
> Per MgtWG errata #9302
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>

Thanks applied,
Ira

> ---
> diff --git a/src/gs.c b/src/gs.c
> index 5541b6b..90db7e2 100644
> --- a/src/gs.c
> +++ b/src/gs.c
> @@ -110,11 +110,14 @@ uint8_t *performance_reset_via(void *rcvbuf, ib_portid_t * dest,
>  
>  	memset(rcvbuf, 0, IB_MAD_SIZE);
>  
> -	/* Same for attribute IDs */
> +	/* Next 2 lines - same for attribute IDs */
>  	mad_set_field(rcvbuf, 0, IB_PC_PORT_SELECT_F, port);
>  	mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT_F, mask);
>  	mask = mask >> 16;
> -	mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT2_F, mask);
> +	if (id == IB_GSI_PORT_COUNTERS_EXT)
> +		mad_set_field(rcvbuf, 0, IB_PC_EXT_COUNTER_SELECT2_F, mask);
> +	else
> +		mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT2_F, mask);
>  	rpc.attr.mod = 0;
>  	rpc.timeout = timeout;
>  	rpc.datasz = IB_PC_DATA_SZ;
--
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/gs.c b/src/gs.c
index 5541b6b..90db7e2 100644
--- a/src/gs.c
+++ b/src/gs.c
@@ -110,11 +110,14 @@  uint8_t *performance_reset_via(void *rcvbuf, ib_portid_t * dest,
 
 	memset(rcvbuf, 0, IB_MAD_SIZE);
 
-	/* Same for attribute IDs */
+	/* Next 2 lines - same for attribute IDs */
 	mad_set_field(rcvbuf, 0, IB_PC_PORT_SELECT_F, port);
 	mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT_F, mask);
 	mask = mask >> 16;
-	mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT2_F, mask);
+	if (id == IB_GSI_PORT_COUNTERS_EXT)
+		mad_set_field(rcvbuf, 0, IB_PC_EXT_COUNTER_SELECT2_F, mask);
+	else
+		mad_set_field(rcvbuf, 0, IB_PC_COUNTER_SELECT2_F, mask);
 	rpc.attr.mod = 0;
 	rpc.timeout = timeout;
 	rpc.datasz = IB_PC_DATA_SZ;