public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [git patch review 1/2] IB/mad: Handle DR SMPs with a LID routed part
@ 2006-02-04 16:33 Roland Dreier
  2006-02-04 16:33 ` [git patch review 2/2] IB: Don't doublefree pages from scatterlist Roland Dreier
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2006-02-04 16:33 UTC (permalink / raw)
  To: linux-kernel, openib-general

Fix handling of directed route SMPs with a beginning or ending LID
routed part.

Signed-off-by: Ralph Campbell <ralphc@pathscale.com>
Signed-off-by: Hal Rosenstock <halr@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

---

 drivers/infiniband/core/mad.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

8cf3f04f45694db0699f608c0e3fb550c607cc88
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index d393b50..c82f47a 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct
 	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;
-- 
1.1.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-07  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-04 16:33 [git patch review 1/2] IB/mad: Handle DR SMPs with a LID routed part Roland Dreier
2006-02-04 16:33 ` [git patch review 2/2] IB: Don't doublefree pages from scatterlist Roland Dreier
2006-02-06 22:29   ` Hugh Dickins
2006-02-07  1:44     ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox