From patchwork Tue Feb 5 15:34:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 2098101 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F307E3FDF1 for ; Tue, 5 Feb 2013 15:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755093Ab3BEPeQ (ORCPT ); Tue, 5 Feb 2013 10:34:16 -0500 Received: from mail-bk0-f43.google.com ([209.85.214.43]:50982 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755023Ab3BEPeO (ORCPT ); Tue, 5 Feb 2013 10:34:14 -0500 Received: by mail-bk0-f43.google.com with SMTP id jm19so144625bkc.2 for ; Tue, 05 Feb 2013 07:34:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=0wHYAMFAmfvD4ytkhAMWLQpnpgoXDAgmmHGtZ9yT4Os=; b=aHzZhw1KHvUgvh2CwMD7XioE5vIkuPEq32/GX7t2s4C6tPkSesC1DTo8KF02mWQqn/ iTqr7Cf9fKIKPGO1fUhd5wAtasgUnMjg6ZL/mDcXm+VGPG7rQ3uCokOPdbwhoRJxaV1Z klYfgU/kcQXs9dZb89c7opu8lixoXsghEFfs2CmPGHVINQURkoKnX+AUxkTlQrh26V1N Rt0ySYIj9cLA1Q8EPXFjsAW5Aq8uMzb5grwQQpNJ4iVaVdg+0gicddZu+6sqyNUywKFz C5iG5S9U0dWrnoJUeOu82fAu0DbBPJoAt4ypC20KTtdUmwsbxqousW6SbI/uqpNUSt+O ujGQ== X-Received: by 10.204.8.16 with SMTP id f16mr6895725bkf.81.1360078452763; Tue, 05 Feb 2013 07:34:12 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPS id x10sm6709874bkv.13.2013.02.05.07.34.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Feb 2013 07:34:11 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Alex Netes Subject: [PATCH] opensm/osm_req.c: fix first sweep m_key search algorithm Date: Tue, 5 Feb 2013 17:34:04 +0200 Message-Id: <1360078444-4835-1-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQmpAX375CneaQiTMOUGZhgQOr4robfLHYF1eJK+5rddTzOMXCSDaeO5wgwZgJm70YrZ+hJb Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org During the first sweep we don't have yet dest physp object Signed-off-by: Alex Netes --- opensm/osm_req.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/opensm/osm_req.c b/opensm/osm_req.c index 8ec4ac6..f9ffc81 100644 --- a/opensm/osm_req.c +++ b/opensm/osm_req.c @@ -93,7 +93,7 @@ static ib_net64_t req_determine_mkey(IN osm_sm_t * sm, p_physp = p_sm_port->p_physp; } - for (hop = 1; p_physp && hop <= p_path->hop_count; hop++) { + for (hop = 1; p_physp && hop < p_path->hop_count; hop++) { p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]); if (!p_physp) break; @@ -103,6 +103,8 @@ static ib_net64_t req_determine_mkey(IN osm_sm_t * sm, p_node = osm_physp_get_node_ptr(p_physp); } + p_physp = osm_node_get_physp_ptr(p_node, p_path->path[hop]); + /* At this point, p_physp points at the outgoing physp on the last hop, or NULL if we don't know it. */