Whamcloud - gitweb
LU-12222 lnet: Introduce constant for the lolnd NID 12/38312/3
authorChris Horn <hornc@cray.com>
Wed, 22 Apr 2020 16:39:46 +0000 (11:39 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 7 May 2020 05:42:54 +0000 (05:42 +0000)
This patch adds a new constant, LNET_NID_LO_0, to represent the lolnd
NID 0@lo.

HPE-bug-id: LUS-8457
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I3e57637f297b8de306905a447af8f025e31d1fcf
Reviewed-on: https://review.whamcloud.com/38312
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
17 files changed:
lnet/include/uapi/linux/lnet/lnet-types.h
lnet/lnet/api-ni.c
lnet/lnet/config.c
lnet/lnet/lib-move.c
lnet/lnet/lib-msg.c
lnet/lnet/peer.c
lnet/lnet/router.c
lnet/utils/lnetconfig/liblnetconfig.c
lustre/llite/llite_lib.c
lustre/lmv/lmv_obd.c
lustre/mgc/mgc_request.c
lustre/obdclass/obd_mount.c
lustre/obdclass/obd_mount_server.c
lustre/ptlrpc/events.c
lustre/ptlrpc/nodemap_handler.c
lustre/target/tgt_handler.c
lustre/utils/portals.c

index 616e80c..3280e1f 100644 (file)
@@ -107,6 +107,9 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num)
        return (type << 16) | num;
 }
 
        return (type << 16) | num;
 }
 
+/** The lolnd NID (i.e. myself) */
+#define LNET_NID_LO_0 LNET_MKNID(LNET_MKNET(LOLND, 0), 0)
+
 #define WIRE_ATTR      __attribute__((packed))
 
 /* Packed version of struct lnet_process_id to transfer via network */
 #define WIRE_ATTR      __attribute__((packed))
 
 /* Packed version of struct lnet_process_id to transfer via network */
index 5922a6a..3fda86b 100644 (file)
@@ -1645,7 +1645,7 @@ lnet_ping_info_validate(struct lnet_ping_info *pinfo)
        /* Loopback is guaranteed to be present */
        if (pinfo->pi_nnis < 1 || pinfo->pi_nnis > lnet_interfaces_max)
                return -ERANGE;
        /* Loopback is guaranteed to be present */
        if (pinfo->pi_nnis < 1 || pinfo->pi_nnis > lnet_interfaces_max)
                return -ERANGE;
-       if (LNET_NETTYP(LNET_NIDNET(LNET_PING_INFO_LONI(pinfo))) != LOLND)
+       if (LNET_PING_INFO_LONI(pinfo) != LNET_NID_LO_0)
                return -EPROTO;
        return 0;
 }
                return -EPROTO;
        return 0;
 }
@@ -2807,7 +2807,7 @@ lnet_fill_ni_info(struct lnet_ni *ni, struct lnet_ioctl_config_ni *cfg_ni,
        }
 
        cfg_ni->lic_nid = ni->ni_nid;
        }
 
        cfg_ni->lic_nid = ni->ni_nid;
-       if (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND)
+       if (ni->ni_nid == LNET_NID_LO_0)
                cfg_ni->lic_status = LNET_NI_STATUS_UP;
        else
                cfg_ni->lic_status = ni->ni_status->ns_status;
                cfg_ni->lic_status = LNET_NI_STATUS_UP;
        else
                cfg_ni->lic_status = ni->ni_status->ns_status;
@@ -2899,7 +2899,7 @@ lnet_fill_ni_info_legacy(struct lnet_ni *ni,
        config->cfg_config_u.cfg_net.net_peer_rtr_credits =
                ni->ni_net->net_tunables.lct_peer_rtr_credits;
 
        config->cfg_config_u.cfg_net.net_peer_rtr_credits =
                ni->ni_net->net_tunables.lct_peer_rtr_credits;
 
-       if (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND)
+       if (ni->ni_nid == LNET_NID_LO_0)
                net_config->ni_status = LNET_NI_STATUS_UP;
        else
                net_config->ni_status = ni->ni_status->ns_status;
                net_config->ni_status = LNET_NI_STATUS_UP;
        else
                net_config->ni_status = ni->ni_status->ns_status;
index 7fea399..b27306e 100644 (file)
@@ -1101,7 +1101,7 @@ lnet_parse_priority(char *str, unsigned int *priority, char **token)
 }
 
 static int
 }
 
 static int
-lnet_parse_route (char *str, int *im_a_router)
+lnet_parse_route(char *str, int *im_a_router)
 {
        /* static scratch buffer OK (single threaded) */
        static char cmd[LNET_SINGLE_TEXTBUF_NOB];
 {
        /* static scratch buffer OK (single threaded) */
        static char cmd[LNET_SINGLE_TEXTBUF_NOB];
@@ -1110,17 +1110,17 @@ lnet_parse_route (char *str, int *im_a_router)
        LIST_HEAD(gateways);
        struct list_head *tmp1;
        struct list_head *tmp2;
        LIST_HEAD(gateways);
        struct list_head *tmp1;
        struct list_head *tmp2;
-       __u32             net;
-       lnet_nid_t        nid;
-       struct lnet_text_buf  *ltb;
-       int               rc;
-       char             *sep;
-       char             *token = str;
-       int               ntokens = 0;
-       int               myrc = -1;
-       __u32             hops;
-       int               got_hops = 0;
-       unsigned int      priority = 0;
+       __u32 net;
+       lnet_nid_t nid;
+       struct lnet_text_buf *ltb;
+       int rc;
+       char *sep;
+       char *token = str;
+       int ntokens = 0;
+       int myrc = -1;
+       __u32 hops;
+       int got_hops = 0;
+       unsigned int priority = 0;
 
        /* save a copy of the string for error messages */
        strncpy(cmd, str, sizeof(cmd));
 
        /* save a copy of the string for error messages */
        strncpy(cmd, str, sizeof(cmd));
@@ -1191,8 +1191,7 @@ lnet_parse_route (char *str, int *im_a_router)
                                        goto token_error;
 
                                nid = libcfs_str2nid(ltb->ltb_text);
                                        goto token_error;
 
                                nid = libcfs_str2nid(ltb->ltb_text);
-                               if (nid == LNET_NID_ANY ||
-                                   LNET_NETTYP(LNET_NIDNET(nid)) == LOLND)
+                               if (nid == LNET_NID_ANY || nid == LNET_NID_LO_0)
                                        goto token_error;
                        }
                }
                                        goto token_error;
                        }
                }
index ca4f62d..9dee2f9 100644 (file)
@@ -753,12 +753,12 @@ lnet_prep_send(struct lnet_msg *msg, int type, struct lnet_process_id target,
 static void
 lnet_ni_send(struct lnet_ni *ni, struct lnet_msg *msg)
 {
 static void
 lnet_ni_send(struct lnet_ni *ni, struct lnet_msg *msg)
 {
-       void   *priv = msg->msg_private;
+       void *priv = msg->msg_private;
        int rc;
 
        int rc;
 
-       LASSERT (!in_interrupt ());
-       LASSERT (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND ||
-                (msg->msg_txcredit && msg->msg_peertxcredit));
+       LASSERT(!in_interrupt());
+       LASSERT(ni->ni_nid == LNET_NID_LO_0 ||
+               (msg->msg_txcredit && msg->msg_peertxcredit));
 
        rc = (ni->ni_net->net_lnd->lnd_send)(ni, priv, msg);
        if (rc < 0) {
 
        rc = (ni->ni_net->net_lnd->lnd_send)(ni, priv, msg);
        if (rc < 0) {
@@ -2623,12 +2623,12 @@ static int
 lnet_select_pathway(lnet_nid_t src_nid, lnet_nid_t dst_nid,
                    struct lnet_msg *msg, lnet_nid_t rtr_nid)
 {
 lnet_select_pathway(lnet_nid_t src_nid, lnet_nid_t dst_nid,
                    struct lnet_msg *msg, lnet_nid_t rtr_nid)
 {
-       struct lnet_peer_ni     *lpni;
-       struct lnet_peer        *peer;
-       struct lnet_send_data   send_data;
-       int                     cpt, rc;
-       int                     md_cpt;
-       __u32                   send_case = 0;
+       struct lnet_peer_ni *lpni;
+       struct lnet_peer *peer;
+       struct lnet_send_data send_data;
+       int cpt, rc;
+       int md_cpt;
+       __u32 send_case = 0;
 
        memset(&send_data, 0, sizeof(send_data));
 
 
        memset(&send_data, 0, sizeof(send_data));
 
@@ -2656,7 +2656,7 @@ again:
         */
        send_data.sd_msg = msg;
        send_data.sd_cpt = cpt;
         */
        send_data.sd_msg = msg;
        send_data.sd_cpt = cpt;
-       if (LNET_NETTYP(LNET_NIDNET(dst_nid)) == LOLND) {
+       if (dst_nid == LNET_NID_LO_0) {
                rc = lnet_handle_lo_send(&send_data);
                lnet_net_unlock(cpt);
                return rc;
                rc = lnet_handle_lo_send(&send_data);
                lnet_net_unlock(cpt);
                return rc;
@@ -5047,14 +5047,14 @@ EXPORT_SYMBOL(LNetGet);
 int
 LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
 {
 int
 LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
 {
-       struct list_head        *e;
+       struct list_head *e;
        struct lnet_ni *ni = NULL;
        struct lnet_remotenet *rnet;
        struct lnet_ni *ni = NULL;
        struct lnet_remotenet *rnet;
-       __u32                   dstnet = LNET_NIDNET(dstnid);
-       int                     hops;
-       int                     cpt;
-       __u32                   order = 2;
-       struct list_head        *rn_list;
+       __u32 dstnet = LNET_NIDNET(dstnid);
+       int hops;
+       int cpt;
+       __u32 order = 2;
+       struct list_head *rn_list;
 
        /* if !local_nid_dist_zero, I don't return a distance of 0 ever
         * (when lustre sees a distance of 0, it substitutes 0@lo), so I
 
        /* if !local_nid_dist_zero, I don't return a distance of 0 ever
         * (when lustre sees a distance of 0, it substitutes 0@lo), so I
@@ -5070,7 +5070,7 @@ LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
                        if (srcnidp != NULL)
                                *srcnidp = dstnid;
                        if (orderp != NULL) {
                        if (srcnidp != NULL)
                                *srcnidp = dstnid;
                        if (orderp != NULL) {
-                               if (LNET_NETTYP(LNET_NIDNET(dstnid)) == LOLND)
+                               if (dstnid == LNET_NID_LO_0)
                                        *orderp = 0;
                                else
                                        *orderp = 1;
                                        *orderp = 0;
                                else
                                        *orderp = 1;
index e8c6025..d7e8436 100644 (file)
@@ -791,11 +791,10 @@ lnet_health_check(struct lnet_msg *msg)
         * if we're sending to the LOLND then the msg_txpeer will not be
         * set. So no need to sanity check it.
         */
         * if we're sending to the LOLND then the msg_txpeer will not be
         * set. So no need to sanity check it.
         */
-       if (msg->msg_tx_committed &&
-           LNET_NETTYP(LNET_NIDNET(msg->msg_txni->ni_nid)) != LOLND)
+       if (msg->msg_tx_committed && msg->msg_txni->ni_nid != LNET_NID_LO_0)
                LASSERT(msg->msg_txpeer);
        else if (msg->msg_tx_committed &&
                LASSERT(msg->msg_txpeer);
        else if (msg->msg_tx_committed &&
-                LNET_NETTYP(LNET_NIDNET(msg->msg_txni->ni_nid)) == LOLND)
+                msg->msg_txni->ni_nid == LNET_NID_LO_0)
                lo = true;
 
        if (hstatus != LNET_MSG_STATUS_OK &&
                lo = true;
 
        if (hstatus != LNET_MSG_STATUS_OK &&
index 37a76c8..8b32c2a 100644 (file)
@@ -277,7 +277,7 @@ lnet_peer_alloc(lnet_nid_t nid)
         * to ever use a different interface when sending messages to
         * myself.
         */
         * to ever use a different interface when sending messages to
         * myself.
         */
-       if (LNET_NETTYP(LNET_NIDNET(nid)) == LOLND)
+       if (nid == LNET_NID_LO_0)
                lp->lp_state = LNET_PEER_NO_DISCOVERY;
        lp->lp_cpt = lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
 
                lp->lp_state = LNET_PEER_NO_DISCOVERY;
        lp->lp_cpt = lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
 
@@ -2632,7 +2632,7 @@ static int lnet_peer_merge_data(struct lnet_peer *lp,
         * present in curnis[] then this peer is for this node.
         */
        for (i = 0; i < ncurnis; i++) {
         * present in curnis[] then this peer is for this node.
         */
        for (i = 0; i < ncurnis; i++) {
-               if (LNET_NETTYP(LNET_NIDNET(curnis[i])) == LOLND)
+               if (curnis[i] == LNET_NID_LO_0)
                        continue;
                for (j = 1; j < pbuf->pb_info.pi_nnis; j++) {
                        if (curnis[i] == pbuf->pb_info.pi_ni[j].ns_nid) {
                        continue;
                for (j = 1; j < pbuf->pb_info.pi_nnis; j++) {
                        if (curnis[i] == pbuf->pb_info.pi_ni[j].ns_nid) {
@@ -2855,7 +2855,7 @@ __must_hold(&lp->lp_lock)
        if (pbuf->pb_info.pi_nnis <= 1)
                goto out;
        nid = pbuf->pb_info.pi_ni[1].ns_nid;
        if (pbuf->pb_info.pi_nnis <= 1)
                goto out;
        nid = pbuf->pb_info.pi_ni[1].ns_nid;
-       if (LNET_NETTYP(LNET_NIDNET(lp->lp_primary_nid)) == LOLND) {
+       if (lp->lp_primary_nid == LNET_NID_LO_0) {
                rc = lnet_peer_set_primary_nid(lp, nid, flags);
                if (!rc)
                        rc = lnet_peer_merge_data(lp, pbuf);
                rc = lnet_peer_set_primary_nid(lp, nid, flags);
                if (!rc)
                        rc = lnet_peer_merge_data(lp, pbuf);
index d573fa3..9d7a839 100644 (file)
@@ -679,7 +679,7 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
               libcfs_net2str(net), hops, priority, libcfs_nid2str(gateway));
 
        if (gateway == LNET_NID_ANY ||
               libcfs_net2str(net), hops, priority, libcfs_nid2str(gateway));
 
        if (gateway == LNET_NID_ANY ||
-           LNET_NETTYP(LNET_NIDNET(gateway)) == LOLND ||
+           gateway == LNET_NID_LO_0 ||
            net == LNET_NIDNET(LNET_NID_ANY) ||
            LNET_NETTYP(net) == LOLND ||
            LNET_NIDNET(gateway) == net ||
            net == LNET_NIDNET(LNET_NID_ANY) ||
            LNET_NETTYP(net) == LOLND ||
            LNET_NIDNET(gateway) == net ||
index 5714b5c..2dd0a45 100644 (file)
@@ -610,8 +610,7 @@ static int infra_ping_nid(char *ping_nids, char *oper, int param, int ioc_call,
                        goto out;
 
                for (i = 0; i < ping.ping_count; i++) {
                        goto out;
 
                for (i = 0; i < ping.ping_count; i++) {
-                       if (!strcmp(libcfs_nid2str(ping.ping_buf[i].nid),
-                                   "0@lo"))
+                       if (ping.ping_buf[i].nid == LNET_NID_LO_0)
                                continue;
                        peer_ni = cYAML_create_seq_item(tmp);
                        if (peer_ni == NULL)
                                continue;
                        peer_ni = cYAML_create_seq_item(tmp);
                        if (peer_ni == NULL)
index a632430..6c6cc80 100644 (file)
@@ -2914,7 +2914,7 @@ void ll_compute_rootsquash_state(struct ll_sb_info *sbi)
                matched = false;
                i = 0;
                while (LNetGetId(i++, &id) != -ENOENT) {
                matched = false;
                i = 0;
                while (LNetGetId(i++, &id) != -ENOENT) {
-                       if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
+                       if (id.nid == LNET_NID_LO_0)
                                continue;
                        if (cfs_match_nid(id.nid, &squash->rsi_nosquash_nids)) {
                                matched = true;
                                continue;
                        if (cfs_match_nid(id.nid, &squash->rsi_nosquash_nids)) {
                                matched = true;
index e28cd46..25b09c4 100644 (file)
@@ -1126,7 +1126,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         * can distribute subdirs evenly from the beginning.
         */
        while (LNetGetId(i++, &lnet_id) != -ENOENT) {
         * can distribute subdirs evenly from the beginning.
         */
        while (LNetGetId(i++, &lnet_id) != -ENOENT) {
-               if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) {
+               if (lnet_id.nid != LNET_NID_LO_0) {
                        lmv->lmv_qos_rr_index = (u32)lnet_id.nid;
                        break;
                }
                        lmv->lmv_qos_rr_index = (u32)lnet_id.nid;
                        break;
                }
@@ -1214,7 +1214,7 @@ static int lmv_select_statfs_mdt(struct lmv_obd *lmv, __u32 flags)
                if (LNetGetId(i, &lnet_id) == -ENOENT)
                        break;
 
                if (LNetGetId(i, &lnet_id) == -ENOENT)
                        break;
 
-               if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) {
+               if (lnet_id.nid != LNET_NID_LO_0) {
                        /* We dont need a full 64-bit modulus, just enough
                         * to distribute the requests across MDTs evenly.
                         */
                        /* We dont need a full 64-bit modulus, just enough
                         * to distribute the requests across MDTs evenly.
                         */
index 1776eff..c0fed41 100644 (file)
@@ -1605,8 +1605,7 @@ static int mgc_process_recover_nodemap_log(struct obd_device *obd,
        mgc_conn = class_exp2cliimp(cld->cld_mgcexp)->imp_connection;
 
        /* don't need to get local config */
        mgc_conn = class_exp2cliimp(cld->cld_mgcexp)->imp_connection;
 
        /* don't need to get local config */
-       if (cld_is_nodemap(cld) &&
-           (LNET_NETTYP(LNET_NIDNET(mgc_conn->c_peer.nid)) == LOLND))
+       if (cld_is_nodemap(cld) && (mgc_conn->c_peer.nid == LNET_NID_LO_0))
                GOTO(out, rc = 0);
 
         /* allocate buffer for bulk transfer.
                GOTO(out, rc = 0);
 
         /* allocate buffer for bulk transfer.
index d9122c5..0c68d2f 100644 (file)
@@ -249,7 +249,7 @@ int lustre_start_mgc(struct super_block *sb)
                        struct lnet_process_id id;
 
                        while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
                        struct lnet_process_id id;
 
                        while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
-                               if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
+                               if (id.nid == LNET_NID_LO_0)
                                        continue;
                                nid = id.nid;
                                i++;
                                        continue;
                                nid = id.nid;
                                i++;
index 24bf5c7..55bbddf 100644 (file)
@@ -1161,7 +1161,7 @@ static int server_lsi2mti(struct lustre_sb_info *lsi,
 
        mti->mti_nid_count = 0;
        while (LNetGetId(i++, &id) != -ENOENT) {
 
        mti->mti_nid_count = 0;
        while (LNetGetId(i++, &id) != -ENOENT) {
-               if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
+               if (id.nid == LNET_NID_LO_0)
                        continue;
 
                /* server use --servicenode param, only allow specified
                        continue;
 
                /* server use --servicenode param, only allow specified
index 52be97b..147d406 100644 (file)
@@ -506,14 +506,14 @@ static void ptlrpc_master_callback(struct lnet_event *ev)
 int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
                        struct lnet_process_id *peer, lnet_nid_t *self)
 {
 int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
                        struct lnet_process_id *peer, lnet_nid_t *self)
 {
-       int               best_dist = 0;
-       __u32             best_order = 0;
-       int               count = 0;
-       int               rc = -ENOENT;
-       int               dist;
-       __u32             order;
-       lnet_nid_t        dst_nid;
-       lnet_nid_t        src_nid;
+       int best_dist = 0;
+       __u32 best_order = 0;
+       int count = 0;
+       int rc = -ENOENT;
+       int dist;
+       __u32 order;
+       lnet_nid_t dst_nid;
+       lnet_nid_t src_nid;
 
        peer->pid = LNET_PID_LUSTRE;
 
 
        peer->pid = LNET_PID_LUSTRE;
 
@@ -528,7 +528,7 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
                        continue;
 
                if (dist == 0) {                /* local! use loopback LND */
                        continue;
 
                if (dist == 0) {                /* local! use loopback LND */
-                       peer->nid = *self = LNET_MKNID(LNET_MKNET(LOLND, 0), 0);
+                       peer->nid = *self = LNET_NID_LO_0;
                        rc = 0;
                        break;
                }
                        rc = 0;
                        break;
                }
index c847f40..a30cd9c 100644 (file)
@@ -257,14 +257,14 @@ struct lu_nodemap *nodemap_lookup(const char *name)
  */
 struct lu_nodemap *nodemap_classify_nid(lnet_nid_t nid)
 {
  */
 struct lu_nodemap *nodemap_classify_nid(lnet_nid_t nid)
 {
-       struct lu_nid_range     *range;
-       struct lu_nodemap       *nodemap;
+       struct lu_nid_range *range;
+       struct lu_nodemap *nodemap;
        int rc;
 
        ENTRY;
 
        /* don't use 0@lo, use the first non-lo local NID instead */
        int rc;
 
        ENTRY;
 
        /* don't use 0@lo, use the first non-lo local NID instead */
-       if (LNET_NETTYP(LNET_NIDNET(nid)) == LOLND) {
+       if (nid == LNET_NID_LO_0) {
                struct lnet_process_id id;
                int i = 0;
 
                struct lnet_process_id id;
                int i = 0;
 
@@ -272,7 +272,7 @@ struct lu_nodemap *nodemap_classify_nid(lnet_nid_t nid)
                        rc = LNetGetId(i++, &id);
                        if (rc < 0)
                                RETURN(ERR_PTR(-EINVAL));
                        rc = LNetGetId(i++, &id);
                        if (rc < 0)
                                RETURN(ERR_PTR(-EINVAL));
-               } while (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND);
+               } while (id.nid == LNET_NID_LO_0);
 
                nid = id.nid;
                CDEBUG(D_INFO, "found nid %s\n", libcfs_nid2str(nid));
 
                nid = id.nid;
                CDEBUG(D_INFO, "found nid %s\n", libcfs_nid2str(nid));
index 7624a02..221342a 100644 (file)
@@ -886,9 +886,9 @@ EXPORT_SYMBOL(tgt_counter_incr);
 
 int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp)
 {
 
 int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp)
 {
-       struct lu_target        *tgt = class_exp2tgt(exp);
-       struct sptlrpc_flavor    flvr;
-       int                      rc = 0;
+       struct lu_target *tgt = class_exp2tgt(exp);
+       struct sptlrpc_flavor flvr;
+       int rc = 0;
 
        LASSERT(tgt);
        LASSERT(tgt->lut_obd);
 
        LASSERT(tgt);
        LASSERT(tgt->lut_obd);
@@ -918,8 +918,7 @@ int tgt_connect_check_sptlrpc(struct ptlrpc_request *req, struct obd_export *exp
                if ((strcmp(exp->exp_obd->obd_type->typ_name,
                           LUSTRE_MGS_NAME) == 0) &&
                     (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
                if ((strcmp(exp->exp_obd->obd_type->typ_name,
                           LUSTRE_MGS_NAME) == 0) &&
                     (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
-                     LNET_NETTYP(LNET_NIDNET(exp->exp_connection->c_peer.nid))
-                     == LOLND))
+                     exp->exp_connection->c_peer.nid == LNET_NID_LO_0))
                        exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
 
                if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&
                        exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
 
                if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&
index ca2eb34..abc7dba 100644 (file)
@@ -352,44 +352,44 @@ int jt_ptl_network(int argc, char **argv)
 int
 jt_ptl_list_nids(int argc, char **argv)
 {
 int
 jt_ptl_list_nids(int argc, char **argv)
 {
-        struct libcfs_ioctl_data data;
-        int                      all = 0, return_nid = 0;
-        int                      count;
-        int                      rc;
+       struct libcfs_ioctl_data data;
+       int all = 0, return_nid = 0;
+       int count;
+       int rc;
 
 
-        all = (argc == 2) && (strcmp(argv[1], "all") == 0);
-        /* Hack to pass back value */
-        return_nid = (argc == 2) && (argv[1][0] == 1);
+       all = (argc == 2) && (strcmp(argv[1], "all") == 0);
+       /* Hack to pass back value */
+       return_nid = (argc == 2) && (argv[1][0] == 1);
 
 
-        if ((argc > 2) && !(all || return_nid)) {
-                fprintf(stderr, "usage: %s [all]\n", argv[0]);
-                return 0;
-        }
+       if ((argc > 2) && !(all || return_nid)) {
+               fprintf(stderr, "usage: %s [all]\n", argv[0]);
+               return 0;
+       }
 
 
-        for (count = 0;; count++) {
-                LIBCFS_IOC_INIT (data);
-                data.ioc_count = count;
-                rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_GET_NI, &data);
-
-                if (rc < 0) {
-                        if ((count > 0) && (errno == ENOENT))
-                                /* We found them all */
-                                break;
-                        fprintf(stderr,"IOC_LIBCFS_GET_NI error %d: %s\n",
-                                errno, strerror(errno));
-                        return -1;
-                }
+       for (count = 0;; count++) {
+               LIBCFS_IOC_INIT(data);
+               data.ioc_count = count;
+               rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_GET_NI, &data);
+
+               if (rc < 0) {
+                       if ((count > 0) && (errno == ENOENT))
+                               /* We found them all */
+                               break;
+                       fprintf(stderr, "IOC_LIBCFS_GET_NI error %d: %s\n",
+                               errno, strerror(errno));
+                       return -1;
+               }
 
 
-                if (all || (LNET_NETTYP(LNET_NIDNET(data.ioc_nid)) != LOLND)) {
-                        printf("%s\n", libcfs_nid2str(data.ioc_nid));
-                        if (return_nid) {
-                                *(__u64 *)(argv[1]) = data.ioc_nid;
-                                return_nid--;
-                        }
-                }
-        }
+               if (all || (data.ioc_nid != LNET_NID_LO_0)) {
+                       printf("%s\n", libcfs_nid2str(data.ioc_nid));
+                       if (return_nid) {
+                               *(__u64 *)(argv[1]) = data.ioc_nid;
+                               return_nid--;
+                       }
+               }
+       }
 
 
-        return 0;
+       return 0;
 }
 
 int
 }
 
 int