diff mbox

opensm/osm_sa_path_record.c: Search for requester port should be under lock

Message ID 1393411921-25229-1-git-send-email-alexne@mellanox.com (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Alex Netes Feb. 26, 2014, 10:52 a.m. UTC
It might colide with the sweep operations.

Signed-off-by: Alex Netes <alexne@mellanox.com>
---
 opensm/osm_sa_path_record.c |   35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)

Comments

Hal Rosenstock Feb. 26, 2014, 6:34 p.m. UTC | #1
On 2/26/2014 5:52 AM, Alex Netes wrote:
> It might colide with the sweep operations.
> 
> Signed-off-by: Alex Netes <alexne@mellanox.com>

Thanks. Applied.

-- Hal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c
index d9c59b8..203cfc0 100644
--- a/opensm/osm_sa_path_record.c
+++ b/opensm/osm_sa_path_record.c
@@ -1727,23 +1727,6 @@  void osm_pr_rcv_process(IN void *context, IN void *data)
 		goto Exit;
 	}
 
-	/* update the requester physical port */
-	requester_port = osm_get_port_by_mad_addr(sa->p_log, sa->p_subn,
-						  osm_madw_get_mad_addr_ptr
-						  (p_madw));
-	if (requester_port == NULL) {
-		OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F16: "
-			"Cannot find requester physical port\n");
-		goto Exit;
-	}
-
-	if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
-		OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
-			"Requester port GUID 0x%" PRIx64 "\n",
-			cl_ntoh64(osm_port_get_guid(requester_port)));
-		osm_dump_path_record_v2(sa->p_log, p_pr, FILE_ID, OSM_LOG_DEBUG);
-	}
-
 	/* Validate rate if supplied */
 	if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_RATESELEC) &&
 	    (p_sa_mad->comp_mask & IB_PR_COMPMASK_RATE)) {
@@ -1781,6 +1764,24 @@  void osm_pr_rcv_process(IN void *context, IN void *data)
 	 */
 	cl_plock_acquire(sa->p_lock);
 
+	/* update the requester physical port */
+	requester_port = osm_get_port_by_mad_addr(sa->p_log, sa->p_subn,
+						  osm_madw_get_mad_addr_ptr
+						  (p_madw));
+	if (requester_port == NULL) {
+		OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F16: "
+			"Cannot find requester physical port\n");
+		cl_plock_release(sa->p_lock);
+		goto Exit;
+	}
+
+	if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+		OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+			"Requester port GUID 0x%" PRIx64 "\n",
+			cl_ntoh64(osm_port_get_guid(requester_port)));
+		osm_dump_path_record_v2(sa->p_log, p_pr, FILE_ID, OSM_LOG_DEBUG);
+	}
+
 	/* Handle multicast destinations separately */
 	if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_DGID) &&
 	    ib_gid_is_multicast(&p_pr->dgid)) {