[ofw][IBAL]smp m_key authentication

Alex Estrin alex.estrin at qlogic.com
Mon Apr 23 14:52:08 PDT 2007


Hi Yossi,

Proposed patch intended to fix following issues:
1. If portinfo m_key is zero check will always fail, no cached info will
ever be returned.
2. As per spec no check should be done if portinfo m_key is zero.
>From chapter 14.2.4 C14-15: "An M_Key contained in the MADHeader:M_Key
of the SMP shall not be checked at the receiving port with the
PortInfo:M_Key set to zero. As a result, no authentication is
performed."

Please review.

Thanks,
Alex


Index: kernel/al_smi.c
===================================================================
--- kernel/al_smi.c	(revision 630)
+++ kernel/al_smi.c	(working copy)
@@ -2135,23 +2135,32 @@
 		p_smp->mgmt_class == IB_MCLASS_SUBN_LID );
 
 	/* simple m-key check */
-	if( p_spl_qp_svc->m_key && p_smp->m_key == p_spl_qp_svc->m_key )
+	if( p_spl_qp_svc->m_key )
 	{
-		if(!p_spl_qp_svc->cache_en )
+		if( p_smp->m_key == p_spl_qp_svc->m_key )
 		{
-			p_spl_qp_svc->cache_en = TRUE;
+			if( !p_spl_qp_svc->cache_en )
+			{
+				p_spl_qp_svc->cache_en = TRUE;
+				AL_EXIT( AL_DBG_SMI );
+				return IB_NOT_DONE;
+			}
+		}
+		else
+		{
+			AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey
check failed \n"));
+			AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey
check SMP= 0x%08x:%08x  SVC = 0x%08x:%08x \n",
+
((uint32_t*)&p_smp->m_key)[0],((uint32_t*)&p_smp->m_key)[1],
+
((uint32_t*)&p_spl_qp_svc->m_key)[0],((uint32_t*)&p_spl_qp_svc->m_key)[1
]));
+
+			p_spl_qp_svc->cache_en = FALSE;
 			AL_EXIT( AL_DBG_SMI );
 			return IB_NOT_DONE;
 		}
 	}
-	else
+	else if( !p_spl_qp_svc->cache_en )
 	{
-		AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey check
failed \n"));
-		AL_PRINT(TRACE_LEVEL_WARNING, AL_DBG_SMI, ("Mkey check
SMP= 0x%08x:%08x  SVC = 0x%08x:%08x \n",
-
((uint32_t*)&p_smp->m_key)[0],((uint32_t*)&p_smp->m_key)[1],
-
((uint32_t*)&p_spl_qp_svc->m_key)[0],((uint32_t*)&p_spl_qp_svc->m_key)[1
]));
-
-		p_spl_qp_svc->cache_en = FALSE;
+		p_spl_qp_svc->cache_en = TRUE;
 		AL_EXIT( AL_DBG_SMI );
 		return IB_NOT_DONE;
 	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: al_smi.patch
Type: application/octet-stream
Size: 1606 bytes
Desc: al_smi.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20070423/b888730a/attachment.obj>


More information about the ofw mailing list