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);