Whamcloud - gitweb
LU-56 ptlrpc: post rqbd with flag LNET_INS_LOCAL
[fs/lustre-release.git] / lustre / ptlrpc / niobuf.c
index 179a8a8..e517e10 100644 (file)
@@ -775,10 +775,13 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
         if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_RQBD))
                 return (-ENOMEM);
 
-       /* NB: We need to replace LNET_INS_AFTER with LNET_INS_LOCAL
-        * after LNet SMP patches landed */
-        rc = LNetMEAttach(service->srv_req_portal,
-                          match_id, 0, ~0, LNET_UNLINK, LNET_INS_AFTER, &me_h);
+       /* NB: CPT affinity service should use new LNet flag LNET_INS_LOCAL,
+        * which means buffer can only be attached on local CPT, and LND
+        * threads can find it by grabbing a local lock */
+       rc = LNetMEAttach(service->srv_req_portal,
+                         match_id, 0, ~0, LNET_UNLINK,
+                         rqbd->rqbd_svcpt->scp_cpt >= 0 ?
+                         LNET_INS_LOCAL : LNET_INS_AFTER, &me_h);
         if (rc != 0) {
                 CERROR("LNetMEAttach failed: %d\n", rc);
                 return (-ENOMEM);