All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD
@ 2011-07-14 18:23 Hal Rosenstock
       [not found] ` <4E1F3419.3010508-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Hal Rosenstock @ 2011-07-14 18:23 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Liran Liss, linux-rdma-u79uwXL29TY76Z2rM5mHXA


for FDR10 operation

Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
diff --git a/include/infiniband/mad.h b/include/infiniband/mad.h
index f00bf7a..8175704 100644
--- a/include/infiniband/mad.h
+++ b/include/infiniband/mad.h
@@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
 	IB_ATTR_VENDORMADSTBL = 0x1d,
 	IB_ATTR_SMINFO = 0x20,
 
-	IB_ATTR_LAST
+	IB_ATTR_LAST,
+
+	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
 };
 
 enum SA_ATTR_ID {
@@ -805,6 +807,15 @@ enum MAD_FIELDS {
 	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE11_F,
 	IB_PESC_LAST_F,
 
+	/*
+	 * Mellanox ExtendedPortInfo
+	 */
+	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+	IB_MLNX_EXT_PORT_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -1137,7 +1148,8 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_switchinfo, mad_dump_perfcounters, mad_dump_perfcounters_ext,
     mad_dump_perfcounters_xmt_sl, mad_dump_perfcounters_rcv_sl,
     mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err,
-    mad_dump_portsamples_control, mad_dump_port_ext_speeds_counters;
+    mad_dump_portsamples_control, mad_dump_port_ext_speeds_counters,
+    mad_dump_mlnx_ext_port_info;
 
 MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 				int start, int end);
diff --git a/src/dump.c b/src/dump.c
index 4b4279d..76987ff 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -836,6 +836,12 @@ void mad_dump_port_ext_speeds_counters(char *buf, int bufsz, void *val, int vals
 	_dump_fields(buf, bufsz, val, IB_PESC_PORT_SELECT_F, IB_PESC_LAST_F);
 }
 
+void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
+{
+	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+		     IB_MLNX_EXT_PORT_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
diff --git a/src/fields.c b/src/fields.c
index 8039882..665797b 100644
--- a/src/fields.c
+++ b/src/fields.c
@@ -578,6 +578,12 @@ static const ib_field_t ib_mad_f[] = {
 	{992, 32, "FECUncorrectableBlockCtrLane11", mad_dump_uint},
 	{0, 0},			/* IB_PESC_LAST_F */
 
+	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
+	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
+	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
+	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
+	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
diff --git a/src/libibmad.map b/src/libibmad.map
index 457ec86..ebeaf48 100644
--- a/src/libibmad.map
+++ b/src/libibmad.map
@@ -116,5 +116,6 @@ IBMAD_1.3 {
 		mad_field_name;
 		bm_call_via;
 		mad_dump_port_ext_speeds_counters;
+		mad_dump_mlnx_ext_port_info;
 	local: *;
 };
--
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] 4+ messages in thread

* RE: [PATCH] libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD
       [not found] ` <4E1F3419.3010508-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-07-14 18:34   ` Hefty, Sean
       [not found]     ` <1828884A29C6694DAF28B7E6B8A8237302E197-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2011-08-03 19:51   ` Ira Weiny
  1 sibling, 1 reply; 4+ messages in thread
From: Hefty, Sean @ 2011-07-14 18:34 UTC (permalink / raw)
  To: Hal Rosenstock, Ira Weiny; +Cc: Liran Liss, linux-rdma-u79uwXL29TY76Z2rM5mHXA

> -	IB_ATTR_LAST
> +	IB_ATTR_LAST,
> +
> +	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
>  };

Seems kind of odd to have something come after 'last'..

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

* Re: [PATCH] libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD
       [not found]     ` <1828884A29C6694DAF28B7E6B8A8237302E197-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-07-14 18:48       ` Hal Rosenstock
  0 siblings, 0 replies; 4+ messages in thread
From: Hal Rosenstock @ 2011-07-14 18:48 UTC (permalink / raw)
  To: Hefty, Sean; +Cc: Ira Weiny, Liran Liss, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 7/14/2011 2:34 PM, Hefty, Sean wrote:
>> -	IB_ATTR_LAST
>> +	IB_ATTR_LAST,
>> +
>> +	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
>>  };
> 
> Seems kind of odd to have something come after 'last'..

I'm not sure why IB_ATTR_LAST is even there (similarly for
IB_SA_ATTR_LAST); maybe a historical vestige at this point but due to
backward compatibility (who knows if it's used) should remain.

It's a poor name given vendor SM attribute IDs.

I didn't think it was safe to have IB_ATTR_LAST increase from 0x21 to
0xff91 because of this so I thought it best to add it as I did and treat
this new attribute ID as an exception if needed which it isn't currently.

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

* Re: [PATCH] libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD
       [not found] ` <4E1F3419.3010508-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2011-07-14 18:34   ` Hefty, Sean
@ 2011-08-03 19:51   ` Ira Weiny
  1 sibling, 0 replies; 4+ messages in thread
From: Ira Weiny @ 2011-08-03 19:51 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Liran Liss, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, 14 Jul 2011 11:23:21 -0700
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> 
> for FDR10 operation
> 
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Thanks applied,
Ira

> ---
> diff --git a/include/infiniband/mad.h b/include/infiniband/mad.h
> index f00bf7a..8175704 100644
> --- a/include/infiniband/mad.h
> +++ b/include/infiniband/mad.h
> @@ -141,7 +141,9 @@ enum SMI_ATTR_ID {
>  	IB_ATTR_VENDORMADSTBL = 0x1d,
>  	IB_ATTR_SMINFO = 0x20,
>  
> -	IB_ATTR_LAST
> +	IB_ATTR_LAST,
> +
> +	IB_ATTR_MLNX_EXT_PORT_INFO = 0xff90,
>  };
>  
>  enum SA_ATTR_ID {
> @@ -805,6 +807,15 @@ enum MAD_FIELDS {
>  	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE11_F,
>  	IB_PESC_LAST_F,
>  
> +	/*
> +	 * Mellanox ExtendedPortInfo
> +	 */
> +	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
> +	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
> +	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
> +	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
> +	IB_MLNX_EXT_PORT_LAST_F,
> +
>  	IB_FIELD_LAST_		/* must be last */
>  };
>  
> @@ -1137,7 +1148,8 @@ MAD_EXPORT ib_mad_dump_fn
>      mad_dump_switchinfo, mad_dump_perfcounters, mad_dump_perfcounters_ext,
>      mad_dump_perfcounters_xmt_sl, mad_dump_perfcounters_rcv_sl,
>      mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err,
> -    mad_dump_portsamples_control, mad_dump_port_ext_speeds_counters;
> +    mad_dump_portsamples_control, mad_dump_port_ext_speeds_counters,
> +    mad_dump_mlnx_ext_port_info;
>  
>  MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
>  				int start, int end);
> diff --git a/src/dump.c b/src/dump.c
> index 4b4279d..76987ff 100644
> --- a/src/dump.c
> +++ b/src/dump.c
> @@ -836,6 +836,12 @@ void mad_dump_port_ext_speeds_counters(char *buf, int bufsz, void *val, int vals
>  	_dump_fields(buf, bufsz, val, IB_PESC_PORT_SELECT_F, IB_PESC_LAST_F);
>  }
>  
> +void mad_dump_mlnx_ext_port_info(char *buf, int bufsz, void *val, int valsz)
> +{
> +	_dump_fields(buf, bufsz, val, IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
> +		     IB_MLNX_EXT_PORT_LAST_F);
> +}
> +
>  void xdump(FILE * file, char *msg, void *p, int size)
>  {
>  #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
> diff --git a/src/fields.c b/src/fields.c
> index 8039882..665797b 100644
> --- a/src/fields.c
> +++ b/src/fields.c
> @@ -578,6 +578,12 @@ static const ib_field_t ib_mad_f[] = {
>  	{992, 32, "FECUncorrectableBlockCtrLane11", mad_dump_uint},
>  	{0, 0},			/* IB_PESC_LAST_F */
>  
> +	{BITSOFFS(24, 8), "StateChangeEnable", mad_dump_hex},
> +	{BITSOFFS(56, 8), "LinkSpeedSupported", mad_dump_hex},
> +	{BITSOFFS(88, 8), "LinkSpeedEnabled", mad_dump_hex},
> +	{BITSOFFS(120, 8), "LinkSpeedActive", mad_dump_hex},
> +	{0, 0},			/* IB_MLNX_EXT_PORT_LAST_F */
> +
>  	{0, 0}			/* IB_FIELD_LAST_ */
>  
>  };
> diff --git a/src/libibmad.map b/src/libibmad.map
> index 457ec86..ebeaf48 100644
> --- a/src/libibmad.map
> +++ b/src/libibmad.map
> @@ -116,5 +116,6 @@ IBMAD_1.3 {
>  		mad_field_name;
>  		bm_call_via;
>  		mad_dump_port_ext_speeds_counters;
> +		mad_dump_mlnx_ext_port_info;
>  	local: *;
>  };


-- 
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@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] 4+ messages in thread

end of thread, other threads:[~2011-08-03 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 18:23 [PATCH] libibmad: Support for Mellanox vendor specific ExtendedPortInfo SM class MAD Hal Rosenstock
     [not found] ` <4E1F3419.3010508-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-07-14 18:34   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A8237302E197-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-07-14 18:48       ` Hal Rosenstock
2011-08-03 19:51   ` Ira Weiny

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.