Whamcloud - gitweb
LU-3467 target: use osc_reply_portal for OUT services 90/8390/5
authorMikhail Pershin <mike.pershin@intel.com>
Mon, 25 Nov 2013 13:53:40 +0000 (17:53 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 4 Dec 2013 00:55:42 +0000 (00:55 +0000)
OUT service is used to server both MDS-MDS updates and MDS-OST
therefore services on MDT and OST are set to use the same request
and reply portals to be fully unified and able to serve any type
of requests.

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: Ifff20343d879552e7568399c021e2c8e8c3d6bf2
Reviewed-on: http://review.whamcloud.com/8390
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/fld/fld_request.c
lustre/ldlm/ldlm_lib.c
lustre/mdt/mdt_mds.c
lustre/ost/ost_handler.c

index 93d1c1e..742afa8 100644 (file)
@@ -444,6 +444,7 @@ int fld_client_rpc(struct obd_export *exp,
 
         ptlrpc_request_set_replen(req);
         req->rq_request_portal = FLD_REQUEST_PORTAL;
+       req->rq_reply_portal = MDC_REPLY_PORTAL;
         ptlrpc_at_set_req_timeout(req);
 
        if (fld_op == FLD_LOOKUP &&
index 8360290..7c4bbb7 100644 (file)
@@ -270,34 +270,41 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         char *name = obddev->obd_type->typ_name;
         ldlm_ns_type_t ns_type = LDLM_NS_TYPE_UNKNOWN;
         int rc;
-       char    *cli_name = lustre_cfg_buf(lcfg, 0);
         ENTRY;
 
         /* In a more perfect world, we would hang a ptlrpc_client off of
          * obd_type and just use the values from there. */
-       if (!strcmp(name, LUSTRE_OSC_NAME) ||
-           (!(strcmp(name, LUSTRE_OSP_NAME)) &&
-            (is_osp_on_mdt(cli_name) &&
-              strstr(lustre_cfg_buf(lcfg, 1), "OST") != NULL))) {
-               /* OSC or OSP_on_MDT for OSTs */
-                rq_portal = OST_REQUEST_PORTAL;
-                rp_portal = OSC_REPLY_PORTAL;
-                connect_op = OST_CONNECT;
-                cli->cl_sp_me = LUSTRE_SP_CLI;
-                cli->cl_sp_to = LUSTRE_SP_OST;
-                ns_type = LDLM_NS_TYPE_OSC;
+       if (!strcmp(name, LUSTRE_OSC_NAME)) {
+               rq_portal = OST_REQUEST_PORTAL;
+               rp_portal = OSC_REPLY_PORTAL;
+               connect_op = OST_CONNECT;
+               cli->cl_sp_me = LUSTRE_SP_CLI;
+               cli->cl_sp_to = LUSTRE_SP_OST;
+               ns_type = LDLM_NS_TYPE_OSC;
        } else if (!strcmp(name, LUSTRE_MDC_NAME) ||
-                  !strcmp(name, LUSTRE_LWP_NAME) ||
-                  (!strcmp(name, LUSTRE_OSP_NAME) &&
-                   (is_osp_on_mdt(cli_name) &&
-                    strstr(lustre_cfg_buf(lcfg, 1), "OST") == NULL))) {
-               /* MDC or OSP_on_MDT for other MDTs */
-                rq_portal = MDS_REQUEST_PORTAL;
-                rp_portal = MDC_REPLY_PORTAL;
-                connect_op = MDS_CONNECT;
-                cli->cl_sp_me = LUSTRE_SP_CLI;
-                cli->cl_sp_to = LUSTRE_SP_MDT;
-                ns_type = LDLM_NS_TYPE_MDC;
+                  !strcmp(name, LUSTRE_LWP_NAME)) {
+               rq_portal = MDS_REQUEST_PORTAL;
+               rp_portal = MDC_REPLY_PORTAL;
+               connect_op = MDS_CONNECT;
+               cli->cl_sp_me = LUSTRE_SP_CLI;
+               cli->cl_sp_to = LUSTRE_SP_MDT;
+               ns_type = LDLM_NS_TYPE_MDC;
+       } else if (!strcmp(name, LUSTRE_OSP_NAME)) {
+               if (strstr(lustre_cfg_buf(lcfg, 1), "OST") == NULL) {
+                       /* OSP_on_MDT for other MDTs */
+                       connect_op = MDS_CONNECT;
+                       cli->cl_sp_to = LUSTRE_SP_MDT;
+                       ns_type = LDLM_NS_TYPE_MDC;
+                       rq_portal = OUT_PORTAL;
+               } else {
+                       /* OSP on MDT for OST */
+                       connect_op = OST_CONNECT;
+                       cli->cl_sp_to = LUSTRE_SP_OST;
+                       ns_type = LDLM_NS_TYPE_OSC;
+                       rq_portal = OST_REQUEST_PORTAL;
+               }
+               rp_portal = OSC_REPLY_PORTAL;
+               cli->cl_sp_me = LUSTRE_SP_CLI;
         } else if (!strcmp(name, LUSTRE_MGC_NAME)) {
                 rq_portal = MGS_REQUEST_PORTAL;
                 rp_portal = MGC_REPLY_PORTAL;
index 64231f7..367f659 100644 (file)
@@ -288,7 +288,7 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .bc_req_max_size        = OUT_MAXREQSIZE,
                        .bc_rep_max_size        = OUT_MAXREPSIZE,
                        .bc_req_portal          = OUT_PORTAL,
-                       .bc_rep_portal          = MDC_REPLY_PORTAL,
+                       .bc_rep_portal          = OSC_REPLY_PORTAL,
                },
                /*
                 * We'd like to have a mechanism to set this on a per-device
@@ -302,7 +302,8 @@ static int mds_start_ptlrpc_service(struct mds_device *m)
                        .tc_nthrs_max           = MDS_NTHRS_MAX,
                        .tc_nthrs_user          = mds_num_threads,
                        .tc_cpu_affinity        = 1,
-                       .tc_ctx_tags            = LCT_MD_THREAD,
+                       .tc_ctx_tags            = LCT_MD_THREAD |
+                                                 LCT_DT_THREAD,
                },
                .psc_cpt                = {
                        .cc_pattern             = mds_num_cpts,
index 72010ba..662a489 100644 (file)
@@ -768,7 +768,8 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                        .tc_nthrs_max           = OSS_CR_NTHRS_MAX,
                        .tc_nthrs_user          = oss_num_create_threads,
                        .tc_cpu_affinity        = 1,
-                       .tc_ctx_tags            = LCT_DT_THREAD,
+                       .tc_ctx_tags            = LCT_MD_THREAD |
+                                                 LCT_DT_THREAD,
                },
                .psc_cpt                = {
                        .cc_pattern             = oss_cpts,