[Openib-windows] [PATCH] client reregister bit and static mac for Mellanox device

Fabian Tillier ftillier at silverstorm.com
Mon Apr 24 16:34:05 PDT 2006


Hi Yossi,

On 4/24/06, Yossi Leybovich <sleybo at mellanox.co.il> wrote:
> Fab
>
> While debug the IPoIB reregister I found 2 bugs:
>
> 1. FW bug, our latest FW does not clear the client reregister bit on
> port_info_set response.
> This will be fix in the coming release but meanwhile I think we should
> add work around for the problem.
> It will add stability to our reregister flow.

Working around FW bugs belongs in the HCA driver, not in IBAL. 
Attached is a patch that fixes both the MT23108 and MTHCA drivers to
fix the FW behavior.

> 2. I had bug in the generation of Mac from mlnx guids so mlnx guids were
> always generated laa MACs.

Thanks, fixed in revision 322.

- Fab
-------------- next part --------------
Index: hw/mthca/kernel/hca_smp.c
===================================================================
--- hw/mthca/kernel/hca_smp.c	(revision 322)
+++ hw/mthca/kernel/hca_smp.c	(working copy)
@@ -314,8 +314,8 @@
 	IN		const	ib_mad_t					*p_mad_in,
 		OUT			ib_mad_t					*p_mad_out )
 {
-	if( p_mad_in->method != IB_MCLASS_SUBN_DIR &&
-		p_mad_in->method != IB_MCLASS_SUBN_LID )
+	if( p_mad_in->mgmt_class != IB_MCLASS_SUBN_DIR &&
+		p_mad_in->mgmt_class != IB_MCLASS_SUBN_LID )
 	{
 		return FALSE;
 	}
@@ -448,8 +448,8 @@
 	IN		const	uint8_t						port_num,
 	IN		const	ib_mad_t					*p_mad_out )
 {
-	if( p_mad_out->method != IB_MCLASS_SUBN_DIR &&
-		p_mad_out->method != IB_MCLASS_SUBN_LID )
+	if( p_mad_out->mgmt_class != IB_MCLASS_SUBN_DIR &&
+		p_mad_out->mgmt_class != IB_MCLASS_SUBN_LID )
 	{
 		return;
 	}
@@ -458,7 +458,6 @@
 	if( p_mad_out->status )
 		return;
 
-
 	switch( p_mad_out->attr_id )
 	{
 	case IB_MAD_ATTR_GUID_INFO:
@@ -568,6 +567,32 @@
 			status = IB_ERROR;
 			goto err_process_mad;
 		}
+
+		if( (p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR ||
+			p_mad_in->mgmt_class == IB_MCLASS_SUBN_LID) &&
+			p_mad_in->attr_id == IB_MAD_ATTR_PORT_INFO )
+		{
+			ib_port_info_t	*p_pi_in, *p_pi_out;
+
+			if( p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR )
+			{
+				p_pi_in = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_in );
+				p_pi_out = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_out );
+			}
+			else
+			{
+				p_pi_in = (ib_port_info_t*)(p_mad_in + 1);
+				p_pi_out = (ib_port_info_t*)(p_mad_out + 1);
+			}
+
+			/* Work around FW bug 33958 */
+			p_pi_out->subnet_timeout &= 0x7F;
+			if( p_mad_in->method == IB_MAD_METHOD_SET )
+				p_pi_out->subnet_timeout |= (p_pi_in->subnet_timeout & 0x80);
+		}
+
 		mlnx_update_cache( h_ca, port_num, p_mad_out );
 	}
 
Index: hw/mt23108/kernel/hca_smp.c
===================================================================
--- hw/mt23108/kernel/hca_smp.c	(revision 322)
+++ hw/mt23108/kernel/hca_smp.c	(working copy)
@@ -307,8 +307,8 @@
 	IN		const	ib_mad_t					*p_mad_in,
 		OUT			ib_mad_t					*p_mad_out )
 {
-	if( p_mad_in->method != IB_MCLASS_SUBN_DIR &&
-		p_mad_in->method != IB_MCLASS_SUBN_LID )
+	if( p_mad_in->mgmt_class != IB_MCLASS_SUBN_DIR &&
+		p_mad_in->mgmt_class != IB_MCLASS_SUBN_LID )
 	{
 		return FALSE;
 	}
@@ -441,8 +441,8 @@
 	IN		const	uint8_t						port_num,
 	IN		const	ib_mad_t					*p_mad_out )
 {
-	if( p_mad_out->method != IB_MCLASS_SUBN_DIR &&
-		p_mad_out->method != IB_MCLASS_SUBN_LID )
+	if( p_mad_out->mgmt_class != IB_MCLASS_SUBN_DIR &&
+		p_mad_out->mgmt_class != IB_MCLASS_SUBN_LID )
 	{
 		return;
 	}
@@ -451,7 +451,6 @@
 	if( p_mad_out->status )
 		return;
 
-
 	switch( p_mad_out->attr_id )
 	{
 	case IB_MAD_ATTR_GUID_INFO:
@@ -541,6 +540,31 @@
 			goto cleanup;
 		}
 
+		if( (p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR ||
+			p_mad_in->mgmt_class == IB_MCLASS_SUBN_LID) &&
+			p_mad_in->attr_id == IB_MAD_ATTR_PORT_INFO )
+		{
+			ib_port_info_t	*p_pi_in, *p_pi_out;
+
+			if( p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR )
+			{
+				p_pi_in = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_in );
+				p_pi_out = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_out );
+			}
+			else
+			{
+				p_pi_in = (ib_port_info_t*)(p_mad_in + 1);
+				p_pi_out = (ib_port_info_t*)(p_mad_out + 1);
+			}
+
+			/* Work around FW bug 33958 */
+			p_pi_out->subnet_timeout &= 0x7F;
+			if( p_mad_in->method == IB_MAD_METHOD_SET )
+				p_pi_out->subnet_timeout |= (p_pi_in->subnet_timeout & 0x80);
+		}
+
 		mlnx_update_cache( h_ca, port_num, p_mad_out );
 	}
 


More information about the ofw mailing list