[openib-general] [PATCH] Problem with directed route SMPs with beginning or ending LID routed parts

Ralph Campbell ralphc at pathscale.com
Mon Jan 16 11:17:59 PST 2006


OK.  Here is a much simplified patch which fixes the problem of a
directed route SMP with a with beginning or ending LID routed part.

Signed-off-by: Ralph Campbell <ralphc at pathscale.com>

Index: core/mad.c
===================================================================
--- core/mad.c	(revision 5030)
+++ core/mad.c	(working copy)
@@ -665,7 +665,15 @@
 	struct ib_wc mad_wc;
 	struct ib_send_wr *send_wr = &mad_send_wr->send_wr;
 
-	if (!smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
+	/*
+	 * Directed route handling starts if the initial LID routed part of
+	 * a request or the ending LID routed part of a response is empty.
+	 * If we are at the start of the LID routed part, don't update the
+	 * hop_ptr or hop_cnt.  See section 14.2.2, Vol 1 IB spec.
+	 */
+	if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
+	     IB_LID_PERMISSIVE &&
+	    !smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
 		ret = -EINVAL;
 		printk(KERN_ERR PFX "Invalid directed route\n");
 		goto out;

-- 
Ralph Campbell <ralphc at pathscale.com>




More information about the general mailing list