int LNetSetLazyPortal(int portal);
int LNetClearLazyPortal(int portal);
int LNetCtl(unsigned int cmd, void *arg);
-void LNetDebugPeer(struct lnet_process_id id);
+void LNetDebugPeer(struct lnet_processid *id);
int LNetGetPeerDiscoveryStatus(void);
int LNetAddPeer(lnet_nid_t *nids, __u32 num_nids);
struct lnet_nid *nid);
struct lnet_peer_ni *lnet_find_peer_ni_locked(lnet_nid_t nid);
struct lnet_peer_ni *lnet_peer_ni_find_locked(struct lnet_nid *nid);
-struct lnet_peer *lnet_find_peer(lnet_nid_t nid);
+struct lnet_peer *lnet_find_peer4(lnet_nid_t nid);
+struct lnet_peer *lnet_find_peer(struct lnet_nid *nid);
void lnet_peer_net_added(struct lnet_net *net);
void lnet_peer_primary_nid_locked(lnet_nid_t nid, struct lnet_nid *result);
int lnet_discover_peer_locked(struct lnet_peer_ni *lpni, int cpt, bool block);
*/
struct lnet_event {
/** The identifier (nid, pid) of the target. */
- struct lnet_process_id target;
+ struct lnet_processid target;
/** The identifier (nid, pid) of the initiator. */
- struct lnet_process_id initiator;
+ struct lnet_processid initiator;
/** The source NID on the initiator. */
- struct lnet_process_id source;
+ struct lnet_processid source;
/**
* The NID of the immediate sender. If the request has been forwarded
* by routers, this is the NID of the last hop; otherwise it's the
* same as the source.
*/
- lnet_nid_t sender;
+ struct lnet_nid sender;
/** Indicates the type of the event. */
enum lnet_event_kind type;
/** The portal table index specified in the request */
- unsigned int pt_index;
+ unsigned int pt_index;
/** A copy of the match bits specified in the request. */
- __u64 match_bits;
+ __u64 match_bits;
/** The length (in bytes) specified in the request. */
- unsigned int rlength;
+ unsigned int rlength;
/**
* The length (in bytes) of the data that was manipulated by the
* operation. For truncated operations, the manipulated length will be
* see struct lnet_md). For all other operations, the manipulated length
* will be the length of the requested operation, i.e. rlength.
*/
- unsigned int mlength;
+ unsigned int mlength;
/**
* The handle to the MD associated with the event. The handle may be
* invalid if the MD has been unlinked.
* 64 bits of out-of-band user data. Only valid for LNET_EVENT_PUT.
* \see LNetPut
*/
- __u64 hdr_data;
+ __u64 hdr_data;
/**
* The message type, to ensure a handler for LNET_EVENT_SEND can
* distinguish between LNET_MSG_GET and LNET_MSG_PUT.
*/
- __u32 msg_type;
+ __u32 msg_type;
/**
* Indicates the completion status of the operation. It's 0 for
* successful operations, otherwise it's an error code.
*/
- int status;
+ int status;
/**
* Indicates whether the MD has been unlinked. Note that:
* - An event with unlinked set is the last event on the MD.
* - This field is also set for an explicit LNET_EVENT_UNLINK event.
* \see LNetMDUnlink
*/
- int unlinked;
+ int unlinked;
/**
* The displacement (in bytes) into the memory region that the
* operation used. The offset can be determined by the operation for
* a remote managed MD or by the local MD.
* \see struct lnet_md::options
*/
- unsigned int offset;
+ unsigned int offset;
/**
* The sequence number for this event. Sequence numbers are unique
* to each event.
*/
- volatile unsigned long sequence;
+ volatile unsigned long sequence;
};
/** \addtogroup lnet_data
return rc;
mutex_lock(&the_lnet.ln_api_mutex);
- lp = lnet_find_peer(ping->ping_id.nid);
+ lp = lnet_find_peer4(ping->ping_id.nid);
if (lp) {
ping->ping_id.nid =
lnet_nid_to_nid4(&lp->lp_primary_nid);
return rc;
mutex_lock(&the_lnet.ln_api_mutex);
- lp = lnet_find_peer(discover->ping_id.nid);
+ lp = lnet_find_peer4(discover->ping_id.nid);
if (lp) {
discover->ping_id.nid =
lnet_nid_to_nid4(&lp->lp_primary_nid);
}
EXPORT_SYMBOL(LNetCtl);
-void LNetDebugPeer(struct lnet_process_id id)
+void LNetDebugPeer(struct lnet_processid *id)
{
- lnet_debug_peer(id.nid);
+ lnet_debug_peer(lnet_nid_to_nid4(&id->nid));
}
EXPORT_SYMBOL(LNetDebugPeer);
if (ev_type == LNET_EVENT_SEND) {
/* event for active message */
- ev->target.nid = le64_to_cpu(hdr->dest_nid);
+ lnet_nid4_to_nid(le64_to_cpu(hdr->dest_nid), &ev->target.nid);
ev->target.pid = le32_to_cpu(hdr->dest_pid);
- ev->initiator.nid = LNET_NID_ANY;
+ ev->initiator.nid = LNET_ANY_NID;
ev->initiator.pid = the_lnet.ln_pid;
- ev->source.nid = LNET_NID_ANY;
+ ev->source.nid = LNET_ANY_NID;
ev->source.pid = the_lnet.ln_pid;
- ev->sender = LNET_NID_ANY;
+ ev->sender = LNET_ANY_NID;
} else {
/* event for passive message */
ev->target.pid = hdr->dest_pid;
- ev->target.nid = hdr->dest_nid;
+ lnet_nid4_to_nid(hdr->dest_nid, &ev->target.nid);
ev->initiator.pid = hdr->src_pid;
/* Multi-Rail: resolve src_nid to "primary" peer NID */
- ev->initiator.nid = lnet_nid_to_nid4(&msg->msg_initiator);
+ ev->initiator.nid = msg->msg_initiator;
/* Multi-Rail: track source NID. */
ev->source.pid = hdr->src_pid;
- ev->source.nid = hdr->src_nid;
- ev->rlength = hdr->payload_length;
- ev->sender = lnet_nid_to_nid4(&msg->msg_from);
+ lnet_nid4_to_nid(hdr->src_nid, &ev->source.nid);
+ ev->rlength = hdr->payload_length;
+ ev->sender = msg->msg_from;
ev->mlength = msg->msg_wanted;
ev->offset = msg->msg_offset;
}
if (status == 0 && msg->msg_ack) {
/* Only send an ACK if the PUT completed successfully */
- struct lnet_nid src;
lnet_msg_decommit(msg, cpt, 0);
ack_wmd = msg->msg_hdr.msg.put.ack_wmd;
- lnet_prep_send(msg, LNET_MSG_ACK, msg->msg_ev.source, 0, 0);
+ lnet_prep_send(msg, LNET_MSG_ACK,
+ lnet_pid_to_pid4(&msg->msg_ev.source), 0, 0);
msg->msg_hdr.msg.ack.dst_wmd = ack_wmd;
msg->msg_hdr.msg.ack.match_bits = msg->msg_ev.match_bits;
msg->msg_hdr.msg.ack.mlength = cpu_to_le32(msg->msg_ev.mlength);
- lnet_nid4_to_nid(msg->msg_ev.target.nid, &src);
- rc = lnet_send(&src, msg, &msg->msg_from);
+ rc = lnet_send(&msg->msg_ev.target.nid, msg,
+ &msg->msg_from);
lnet_net_lock(cpt);
/*
}
struct lnet_peer *
-lnet_find_peer(lnet_nid_t nid)
+lnet_find_peer4(lnet_nid_t nid)
{
struct lnet_peer_ni *lpni;
struct lnet_peer *lp = NULL;
return lp;
}
+struct lnet_peer *
+lnet_find_peer(struct lnet_nid *nid)
+{
+ struct lnet_peer_ni *lpni;
+ struct lnet_peer *lp = NULL;
+ int cpt;
+
+ cpt = lnet_net_lock_current();
+ lpni = lnet_peer_ni_find_locked(nid);
+ if (lpni) {
+ lp = lpni->lpni_peer_net->lpn_peer;
+ lnet_peer_addref_locked(lp);
+ lnet_peer_ni_decref_locked(lpni);
+ }
+ lnet_net_unlock(cpt);
+
+ return lp;
+}
+
struct lnet_peer_net *
lnet_get_next_peer_net_locked(struct lnet_peer *lp, __u32 prev_lpn_id)
{
pbuf = LNET_PING_INFO_TO_BUFFER(ev->md_start + ev->offset);
/* lnet_find_peer() adds a refcount */
- lp = lnet_find_peer(ev->source.nid);
+ lp = lnet_find_peer(&ev->source.nid);
if (!lp) {
CDEBUG(D_NET, "Push Put from unknown %s (source %s). Ignoring...\n",
- libcfs_nid2str(ev->initiator.nid),
- libcfs_nid2str(ev->source.nid));
+ libcfs_nidstr(&ev->initiator.nid),
+ libcfs_nidstr(&ev->source.nid));
pbuf->pb_needs_post = true;
return;
}
CDEBUG(D_NET, "Push Put error %d from %s (source %s)\n",
ev->status,
libcfs_nidstr(&lp->lp_primary_nid),
- libcfs_nid2str(ev->source.nid));
+ libcfs_nidstr(&ev->source.nid));
goto out;
}
spin_lock(&lp->lp_lock);
- lnet_nid4_to_nid(ev->target.nid, &lp->lp_disc_src_nid);
- lnet_nid4_to_nid(ev->source.nid, &lp->lp_disc_dst_nid);
+ lp->lp_disc_src_nid = ev->target.nid;
+ lp->lp_disc_dst_nid = ev->source.nid;
/*
* If some kind of error happened the contents of message
CDEBUG(D_NET, "Ping Reply error %d from %s (source %s)\n",
ev->status,
libcfs_nidstr(&lp->lp_primary_nid),
- libcfs_nid2str(ev->source.nid));
+ libcfs_nidstr(&ev->source.nid));
goto out;
}
out:
CDEBUG(D_NET, "%s Send to %s: %d\n",
(ev->msg_type == LNET_MSG_GET ? "Ping" : "Push"),
- libcfs_nid2str(ev->target.nid), rc);
+ libcfs_nidstr(&ev->target.nid), rc);
return rc;
}
__u32 size;
int rc;
- lp = lnet_find_peer(cfg->prcfg_prim_nid);
+ lp = lnet_find_peer4(cfg->prcfg_prim_nid);
if (!lp) {
rc = -ENOENT;
buffer = container_of(ev->md_start, struct srpc_buffer,
buf_msg);
- buffer->buf_peer = ev->source;
- buffer->buf_self = ev->target.nid;
+ buffer->buf_peer = lnet_pid_to_pid4(&ev->source);
+ buffer->buf_self = lnet_nid_to_nid4(&ev->target.nid);
LASSERT(scd->scd_buf_nposted > 0);
scd->scd_buf_nposted--;
(msg->msg_magic != SRPC_MSG_MAGIC &&
msg->msg_magic != __swab32(SRPC_MSG_MAGIC))) {
CERROR("Dropping RPC (%s) from %s: status %d mlength %d type %u magic %u.\n",
- sv->sv_name, libcfs_id2str(ev->initiator),
+ sv->sv_name, libcfs_idstr(&ev->initiator),
ev->status, ev->mlength,
msg->msg_type, msg->msg_magic);
* It tracks access patterns to this export on a per-client-NID basis
*/
struct nid_stat {
- lnet_nid_t nid;
+ struct lnet_nid nid;
struct hlist_node nid_hash;
struct list_head nid_list;
struct obd_device *nid_obd;
/** linkage for connections hash table */
struct rhash_head c_hash;
/** Our own lnet nid for this connection */
- lnet_nid_t c_self;
+ struct lnet_nid c_self;
/** Remote side nid for this connection */
- struct lnet_process_id c_peer;
+ struct lnet_processid c_peer;
/** UUID of the other side */
- struct obd_uuid c_remote_uuid;
+ struct obd_uuid c_remote_uuid;
/** reference counter for this connection */
- atomic_t c_refcount;
+ atomic_t c_refcount;
};
/** Client definition for PortalRPC */
struct ptlrpc_client {
- /** What lnet portal does this client send messages to by default */
- __u32 cli_request_portal;
- /** What portal do we expect replies on */
- __u32 cli_reply_portal;
- /** Name of the client */
+ /** What lnet portal does this client send messages to by default */
+ __u32 cli_request_portal;
+ /** What portal do we expect replies on */
+ __u32 cli_reply_portal;
+ /** Name of the client */
const char *cli_name;
};
CDEBUG(D_INFO, "PUT conn=%p refcount %d to %s\n",
conn, atomic_read(&conn->c_refcount),
- libcfs_nid2str(conn->c_peer.nid));
+ libcfs_nidstr(&conn->c_peer.nid));
}
struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *);
if (!conn)
return false;
- if (conn->c_peer.nid == conn->c_self)
+ if (nid_same(&conn->c_peer.nid, &conn->c_self))
return true;
- RETURN(LNetIsPeerLocal(conn->c_peer.nid));
+ RETURN(LNetIsPeerLocal(lnet_nid_to_nid4(&conn->c_peer.nid)));
}
/* ptlrpc/niobuf.c */
void sptlrpc_rule_set_free(struct sptlrpc_rule_set *set);
int sptlrpc_rule_set_expand(struct sptlrpc_rule_set *set);
int sptlrpc_rule_set_merge(struct sptlrpc_rule_set *set,
- struct sptlrpc_rule *rule);
+ struct sptlrpc_rule *rule);
int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
- enum lustre_sec_part from,
- enum lustre_sec_part to,
- lnet_nid_t nid,
- struct sptlrpc_flavor *sf);
+ enum lustre_sec_part from,
+ enum lustre_sec_part to,
+ lnet_nid_t nid,
+ struct sptlrpc_flavor *sf);
void sptlrpc_rule_set_dump(struct sptlrpc_rule_set *set);
int sptlrpc_process_config(struct lustre_cfg *lcfg);
int sptlrpc_conf_target_get_rules(struct obd_device *obd,
struct sptlrpc_rule_set *rset);
void sptlrpc_target_choose_flavor(struct sptlrpc_rule_set *rset,
- enum lustre_sec_part from,
- lnet_nid_t nid,
- struct sptlrpc_flavor *flavor);
+ enum lustre_sec_part from,
+ lnet_nid_t nid,
+ struct sptlrpc_flavor *flavor);
/* The maximum length of security payload. 1024 is enough for Kerberos 5,
* and should be enough for other future mechanisms but not sure.
struct obd_export *obd_uuid_lookup(struct obd_device *obd,
struct obd_uuid *uuid);
-int obd_nid_export_for_each(struct obd_device *obd, lnet_nid_t nid,
+int obd_nid_export_for_each(struct obd_device *obd, struct lnet_nid *nid,
int cb(struct obd_export *exp, void *data),
void *data);
int obd_nid_add(struct obd_device *obd, struct obd_export *exp);
static inline char *obd_export_nid2str(struct obd_export *exp)
{
return exp->exp_connection == NULL ?
- "<unknown>" : libcfs_nid2str(exp->exp_connection->c_peer.nid);
+ "<unknown>" : libcfs_nidstr(&exp->exp_connection->c_peer.nid);
}
static inline char *obd_import_nid2str(struct obd_import *imp)
{
return imp->imp_connection == NULL ?
- "<unknown>" : libcfs_nid2str(imp->imp_connection->c_peer.nid);
+ "<unknown>" : libcfs_nidstr(&imp->imp_connection->c_peer.nid);
}
int obd_export_evict_by_nid(struct obd_device *obd, const char *nid);
int found;
found = obd_nid_export_for_each(bl_exp->exp_obd,
- bl_exp_conn->c_peer.nid,
+ &bl_exp_conn->c_peer.nid,
ldlm_flock_lookup_cb,
&cb_data);
if (found)
break;
if (bl_owner == req_owner &&
- (bl_exp_conn->c_peer.nid ==
- req_exp->exp_connection->c_peer.nid)) {
+ nid_same(&bl_exp_conn->c_peer.nid,
+ &req_exp->exp_connection->c_peer.nid)) {
class_export_put(bl_exp);
return 1;
}
if (imp->imp_connection &&
imp->imp_connection->c_remote_uuid.uuid[0] == 0)
/* nid4refnet is used to restrict network connections */
- nid4refnet = imp->imp_connection->c_self;
+ nid4refnet = lnet_nid_to_nid4(&imp->imp_connection->c_self);
ptlrpc_conn = ptlrpc_uuid_to_connection(uuid, nid4refnet);
if (!ptlrpc_conn) {
CDEBUG(D_HA, "can't find connection %s\n", uuid->uuid);
const char *name = obd->obd_type->typ_name;
enum ldlm_ns_type ns_type = LDLM_NS_TYPE_UNKNOWN;
char *cli_name = lustre_cfg_buf(lcfg, 0);
- struct ptlrpc_connection fake_conn = { .c_self = 0,
+ struct ptlrpc_connection fake_conn = { .c_self = {},
.c_remote_uuid.uuid[0] = 0 };
int rc;
rc);
GOTO(err_import, rc);
}
- fake_conn.c_self = LNET_MKNID(refnet, 0);
+ lnet_nid4_to_nid(LNET_MKNID(refnet, 0), &fake_conn.c_self);
imp->imp_connection = &fake_conn;
}
} else if ((mds_conn || (lw_client && initial_conn) ||
OCD_HAS_FLAG(data, MDS_MDS)) && export->exp_connection) {
spin_unlock(&export->exp_lock);
- if (req->rq_peer.nid != export->exp_connection->c_peer.nid) {
+ if (req->rq_peer.nid !=
+ lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) {
/* MDS or LWP reconnected after failover. */
LCONSOLE_WARN("%s: Received %s connection from %s, removing former export from %s\n",
target->obd_name,
lw_client ? "LWP" : "MDS",
libcfs_nid2str(req->rq_peer.nid),
- libcfs_nid2str(export->exp_connection->c_peer.nid));
+ libcfs_nidstr(&export->exp_connection->c_peer.nid));
} else {
/* New connection from the same NID. */
LCONSOLE_WARN("%s: Received new %s connection from %s, %s former export from same NID\n",
"keep" : "remove");
}
- if (req->rq_peer.nid == export->exp_connection->c_peer.nid &&
+ if (req->rq_peer.nid ==
+ lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) &&
OCD_HAS_FLAG(data, MDS_MDS)) {
/*
* Because exports between MDTs will always be
rc = 0;
}
} else if (export->exp_connection != NULL && initial_conn &&
- req->rq_peer.nid != export->exp_connection->c_peer.nid) {
+ req->rq_peer.nid != lnet_nid_to_nid4(&export->exp_connection->c_peer.nid)) {
spin_unlock(&export->exp_lock);
/* In MDS failover we have static UUID but NID can change. */
LCONSOLE_WARN("%s: Client %s seen on new nid %s when existing nid %s is already connected\n",
target->obd_name, cluuid.uuid,
libcfs_nid2str(req->rq_peer.nid),
- libcfs_nid2str(
- export->exp_connection->c_peer.nid));
+ libcfs_nidstr(
+ &export->exp_connection->c_peer.nid));
rc = -EALREADY;
class_export_put(export);
export = NULL;
/* Check to see if connection came from another NID. */
if (export->exp_connection != NULL &&
- export->exp_connection->c_peer.nid != req->rq_peer.nid) {
+ lnet_nid_to_nid4(&export->exp_connection->c_peer.nid) !=
+ req->rq_peer.nid) {
obd_nid_del(export->exp_obd, export);
ptlrpc_connection_put(export->exp_connection);
export->exp_connection = NULL;
struct ptlrpc_request *req, int rc,
const char *ast_type)
{
- struct lnet_process_id peer = req->rq_import->imp_connection->c_peer;
+ struct lnet_processid *peer = &req->rq_import->imp_connection->c_peer;
if (!req->rq_replied || (rc && rc != -EINVAL)) {
if (ldlm_is_cancel(lock)) {
LDLM_DEBUG(lock,
"%s AST (req@%p x%llu) timeout from nid %s, but cancel was received (AST reply lost?)",
ast_type, req, req->rq_xid,
- libcfs_nid2str(peer.nid));
+ libcfs_nidstr(&peer->nid));
ldlm_lock_cancel(lock);
rc = -ERESTART;
} else if (rc == -ENODEV || rc == -ESHUTDOWN ||
} else {
LDLM_ERROR(lock,
"client (nid %s) %s %s AST (req@%p x%llu status %d rc %d), evict it",
- libcfs_nid2str(peer.nid),
+ libcfs_nidstr(&peer->nid),
req->rq_replied ? "returned error from" :
"failed to reply to",
ast_type, req, req->rq_xid,
LDLM_DEBUG(lock,
"client (nid %s) returned %d from %s AST (req@%p x%llu) - normal race",
- libcfs_nid2str(peer.nid),
+ libcfs_nidstr(&peer->nid),
req->rq_repmsg ?
lustre_msg_get_status(req->rq_repmsg) : -1,
ast_type, req, req->rq_xid);
if (rc == LUSTRE_ESTALE) {
CDEBUG(D_DLMTRACE,
"client/server (nid %s) out of sync -- not fatal\n",
- libcfs_nid2str(req->rq_import->imp_connection->c_peer.nid));
+ libcfs_nidstr(&req->rq_import->imp_connection->c_peer.nid));
rc = 0;
} else if (rc == -ETIMEDOUT && /* check there was no reconnect*/
req->rq_import_generation == imp->imp_generation) {
static void ucred_set_nid(struct mdt_thread_info *info, struct lu_ucred *uc)
{
if (info && info->mti_exp && info->mti_exp->exp_connection)
- uc->uc_nid = info->mti_exp->exp_connection->c_peer.nid;
+ uc->uc_nid = lnet_nid_to_nid4(
+ &info->mti_exp->exp_connection->c_peer.nid);
else
uc->uc_nid = LNET_NID_ANY;
}
{
struct nid_stat *stats = seq->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_mdt_print_open_files, seq);
}
mgc_conn = class_exp2cliimp(cld->cld_mgcexp)->imp_connection;
/* don't need to get local config */
- if (cld_is_nodemap(cld) && LNetIsPeerLocal(mgc_conn->c_peer.nid))
+ if (cld_is_nodemap(cld) &&
+ LNetIsPeerLocal(lnet_nid_to_nid4(&mgc_conn->c_peer.nid)))
GOTO(out, rc = 0);
/* allocate buffer for bulk transfer.
if (num_exports > 1)
CERROR("%s: node %s still connected during replace_nids connect_flags:%llx\n",
mgs_obd->obd_name,
- libcfs_nid2str(exp->exp_nid_stats->nid),
+ libcfs_nidstr(&exp->exp_nid_stats->nid),
exp_connect_flags(exp));
}
spin_unlock(&mgs_obd->obd_dev_lock);
int obd_export_evict_by_nid(struct obd_device *obd, const char *nid)
{
- lnet_nid_t nid_key = libcfs_str2nid((char *)nid);
+ struct lnet_nid nid_key;
struct obd_export *doomed_exp;
int exports_evicted = 0;
+ libcfs_strnid(&nid_key, nid);
+
spin_lock(&obd->obd_dev_lock);
/* umount has run already, so evict thread should leave
* its task to umount thread now */
spin_unlock(&obd->obd_dev_lock);
doomed_exp = NULL;
- while (obd_nid_export_for_each(obd, nid_key,
+ while (obd_nid_export_for_each(obd, &nid_key,
take_first, &doomed_exp) > 0) {
LASSERTF(doomed_exp != obd->obd_self_export,
spin_lock(&imp->imp_lock);
j = 0;
list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
- libcfs_nid2str_r(conn->oic_conn->c_peer.nid,
- nidstr, sizeof(nidstr));
+ libcfs_nidstr_r(&conn->oic_conn->c_peer.nid,
+ nidstr, sizeof(nidstr));
seq_printf(m, "%s%s", j ? ", " : "", nidstr);
j++;
}
if (imp->imp_connection)
- libcfs_nid2str_r(imp->imp_connection->c_peer.nid,
- nidstr, sizeof(nidstr));
+ libcfs_nidstr_r(&imp->imp_connection->c_peer.nid,
+ nidstr, sizeof(nidstr));
else
strncpy(nidstr, "<none>", sizeof(nidstr));
seq_printf(m, " ]\n"
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_export_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_export);
client_stat->nid_proc, client_stat->nid_stats);
LASSERTF(atomic_read(&client_stat->nid_exp_ref_count) == 0,
- "nid %s:count %d\n", libcfs_nid2str(client_stat->nid),
+ "nid %s:count %d\n", libcfs_nidstr(&client_stat->nid),
atomic_read(&client_stat->nid_exp_ref_count));
if (client_stat->nid_proc)
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_nodemap_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_nodemap);
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_uuid_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_uuid);
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_hash_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_hash);
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_replydata_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_replydata);
{
struct nid_stat *stats = m->private;
- return obd_nid_export_for_each(stats->nid_obd, stats->nid,
+ return obd_nid_export_for_each(stats->nid_obd, &stats->nid,
lprocfs_exp_print_fmd_count_seq, m);
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_fmd_count);
if (new_stat == NULL)
RETURN(-ENOMEM);
- new_stat->nid = *nid;
+ lnet_nid4_to_nid(*nid, &new_stat->nid);
new_stat->nid_obd = exp->exp_obd;
/* we need set default refcount to 1 to balance obd_disconnect */
atomic_set(&new_stat->nid_exp_ref_count, 1);
old_stat = cfs_hash_findadd_unique(obd->obd_nid_stats_hash,
- nid, &new_stat->nid_hash);
+ &new_stat->nid,
+ &new_stat->nid_hash);
CDEBUG(D_INFO, "Found stats %p for nid %s - ref %d\n",
old_stat, nidstr, atomic_read(&old_stat->nid_exp_ref_count));
destroy_new_ns:
if (new_stat->nid_proc != NULL)
lprocfs_remove(&new_stat->nid_proc);
- cfs_hash_del(obd->obd_nid_stats_hash, nid, &new_stat->nid_hash);
+ cfs_hash_del(obd->obd_nid_stats_hash, &new_stat->nid,
+ &new_stat->nid_hash);
destroy_new:
nidstat_putref(new_stat);
static int
nid_keycmp(struct rhashtable_compare_arg *arg, const void *obj)
{
- const lnet_nid_t *nid = arg->key;
+ const struct lnet_nid *nid = arg->key;
const struct obd_export *exp = obj;
- if (exp->exp_connection->c_peer.nid == *nid)
+ if (nid_same(&exp->exp_connection->c_peer.nid, nid))
return 0;
return -ESRCH;
}
static const struct rhashtable_params nid_hash_params = {
- .key_len = sizeof(lnet_nid_t),
+ .key_len = sizeof(struct lnet_nid),
.head_offset = offsetof(struct obd_export, exp_nid_hash),
.obj_hashfn = nid_keyhash,
.obj_cmpfn = nid_keycmp,
}
EXPORT_SYMBOL(obd_nid_del);
-int obd_nid_export_for_each(struct obd_device *obd, lnet_nid_t nid,
+int obd_nid_export_for_each(struct obd_device *obd, struct lnet_nid *nid,
int cb(struct obd_export *exp, void *data),
void *data)
{
int ret = 0;
rcu_read_lock();
- exports = rhltable_lookup(&obd->obd_nid_hash, &nid, nid_hash_params);
+ exports = rhltable_lookup(&obd->obd_nid_hash, nid, nid_hash_params);
if (!exports) {
ret = -ENODEV;
goto out_unlock;
static unsigned
nidstats_hash(struct cfs_hash *hs, const void *key, unsigned int mask)
{
- return cfs_hash_djb2_hash(key, sizeof(lnet_nid_t), mask);
+ return cfs_hash_djb2_hash(key, sizeof(struct lnet_nid), mask);
}
static void *
static int
nidstats_keycmp(const void *key, struct hlist_node *hnode)
{
- return *(lnet_nid_t *)nidstats_key(hnode) == *(lnet_nid_t *)key;
+ return nid_same((struct lnet_nid *)nidstats_key(hnode),
+ (struct lnet_nid *)key);
}
static void *
}
static struct cfs_hash_ops nid_stat_hash_ops = {
- .hs_hash = nidstats_hash,
- .hs_key = nidstats_key,
- .hs_keycmp = nidstats_keycmp,
- .hs_object = nidstats_object,
- .hs_get = nidstats_get,
- .hs_put_locked = nidstats_put_locked,
+ .hs_hash = nidstats_hash,
+ .hs_key = nidstats_key,
+ .hs_keycmp = nidstats_keycmp,
+ .hs_object = nidstats_object,
+ .hs_get = nidstats_get,
+ .hs_put_locked = nidstats_put_locked,
};
-
/*
* client_generation<->export hash operations
*/
}
static int
-check_write_checksum(struct obdo *oa, const struct lnet_process_id *peer,
+check_write_checksum(struct obdo *oa, const struct lnet_processid *peer,
__u32 client_cksum, __u32 server_cksum,
struct osc_brw_async_args *aa)
{
DFID " object "DOSTID" extent [%llu-%llu], original "
"client csum %x (type %x), server csum %x (type %x),"
" client csum now %x\n",
- obd_name, msg, libcfs_nid2str(peer->nid),
+ obd_name, msg, libcfs_nidstr(&peer->nid),
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
struct osc_brw_async_args *aa = (void *)&req->rq_async_args;
struct client_obd *cli = aa->aa_cli;
const char *obd_name = cli->cl_import->imp_obd->obd_name;
- const struct lnet_process_id *peer =
+ const struct lnet_processid *peer =
&req->rq_import->imp_connection->c_peer;
struct ost_body *body;
u32 client_cksum = 0;
GOTO(out, rc);
if (req->rq_bulk != NULL &&
- peer->nid != req->rq_bulk->bd_sender) {
+ lnet_nid_to_nid4(&peer->nid) != req->rq_bulk->bd_sender) {
via = " via ";
router = libcfs_nid2str(req->rq_bulk->bd_sender);
}
" extent [%llu-%llu], client %x/%x, "
"server %x, cksum_type %x\n",
obd_name,
- libcfs_nid2str(peer->nid),
+ libcfs_nidstr(&peer->nid),
via, router,
clbody->oa.o_valid & OBD_MD_FLFID ?
clbody->oa.o_parent_seq : 0ULL,
if ((cksum_missed & (-cksum_missed)) == cksum_missed)
CERROR("%s: checksum %u requested from %s but not sent\n",
obd_name, cksum_missed,
- libcfs_nid2str(peer->nid));
+ libcfs_nidstr(&peer->nid));
} else {
rc = 0;
}
LASSERT(oth != NULL);
if (ou && ou->ou_generation != our->our_generation) {
- const struct lnet_process_id *peer =
- &osp->opd_obd->u.cli.cl_import->imp_connection->c_peer;
+ const struct lnet_processid *peer;
+
rc = -ESTALE;
osp_trans_callback(env, oth, rc);
+ peer = &osp->opd_obd->u.cli.cl_import->imp_connection->c_peer;
CDEBUG(D_HA, "%s: stale tx to %s: gen %llu != %llu: rc = %d\n",
- osp->opd_obd->obd_name, libcfs_nid2str(peer->nid),
+ osp->opd_obd->obd_name, libcfs_nidstr(&peer->nid),
osp->opd_update->ou_generation, our->our_generation, rc);
RETURN(rc);
}
rc = lustre_msg_get_status(req->rq_repmsg);
if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) {
struct obd_import *imp = req->rq_import;
- lnet_nid_t nid = imp->imp_connection->c_peer.nid;
+ struct lnet_nid *nid = &imp->imp_connection->c_peer.nid;
__u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
if (ptlrpc_console_allow(req, opc, rc))
"%s: operation %s to node %s failed: rc = %d\n",
imp->imp_obd->obd_name,
ll_opcode2str(opc),
- libcfs_nid2str(nid), rc);
+ libcfs_nidstr(nid), rc);
RETURN(rc < 0 ? rc : -EINVAL);
}
req->rq_sent, req->rq_real_sent);
if (imp && obd_debug_peer_on_timeout)
- LNetDebugPeer(imp->imp_connection->c_peer);
+ LNetDebugPeer(&imp->imp_connection->c_peer);
ptlrpc_unregister_reply(req, async_unlink);
ptlrpc_unregister_bulk(req, async_unlink);
static u32 lnet_process_id_hash(const void *data, u32 len, u32 seed)
{
- const struct lnet_process_id *lpi = data;
+ const struct lnet_processid *lpi = data;
seed = cfs_hash_32(seed ^ lpi->pid, 32);
- seed ^= cfs_hash_64(lpi->nid, 32);
+ seed = cfs_hash_32(nidhash(&lpi->nid) ^ seed, 32);
return seed;
}
static int lnet_process_id_cmp(struct rhashtable_compare_arg *arg,
const void *obj)
{
- const struct lnet_process_id *lpi = arg->key;
+ const struct lnet_processid *lpi = arg->key;
const struct ptlrpc_connection *con = obj;
- if (lpi->nid == con->c_peer.nid &&
+ if (nid_same(&lpi->nid, &con->c_peer.nid) &&
lpi->pid == con->c_peer.pid)
return 0;
return -ESRCH;
};
struct ptlrpc_connection *
-ptlrpc_connection_get(struct lnet_process_id peer, lnet_nid_t self,
+ptlrpc_connection_get(struct lnet_process_id peer4, lnet_nid_t self,
struct obd_uuid *uuid)
{
struct ptlrpc_connection *conn, *conn2;
+ struct lnet_processid peer;
ENTRY;
- peer.nid = LNetPrimaryNID(peer.nid);
+ peer4.nid = LNetPrimaryNID(peer4.nid);
+ lnet_pid4_to_pid(peer4, &peer);
conn = rhashtable_lookup_fast(&conn_hash, &peer, conn_hash_params);
if (conn) {
ptlrpc_connection_addref(conn);
RETURN(NULL);
conn->c_peer = peer;
- conn->c_self = self;
+ lnet_nid4_to_nid(self, &conn->c_self);
atomic_set(&conn->c_refcount, 1);
if (uuid)
obd_str2uuid(&conn->c_remote_uuid, uuid->uuid);
out:
CDEBUG(D_INFO, "conn=%p refcount %d to %s\n",
conn, atomic_read(&conn->c_refcount),
- libcfs_nid2str(conn->c_peer.nid));
+ libcfs_nidstr(&conn->c_peer.nid));
return conn;
}
atomic_inc(&conn->c_refcount);
CDEBUG(D_INFO, "conn=%p refcount %d to %s\n",
conn, atomic_read(&conn->c_refcount),
- libcfs_nid2str(conn->c_peer.nid));
+ libcfs_nidstr(&conn->c_peer.nid));
RETURN(conn);
}
if (ev->type != LNET_EVENT_UNLINK && ev->status == 0) {
desc->bd_nob_transferred += ev->mlength;
- desc->bd_sender = ev->sender;
+ desc->bd_sender = lnet_nid_to_nid4(&ev->sender);
} else {
/* start reconnect and resend if network error hit */
spin_lock(&req->rq_lock);
if (ev->status != 0) /* We moaned above already... */
return;
req = ptlrpc_request_cache_alloc(GFP_ATOMIC);
- if (req == NULL) {
- CERROR("Can't allocate incoming request descriptor: "
- "Dropping %s RPC from %s\n",
- service->srv_name,
- libcfs_id2str(ev->initiator));
- return;
- }
- }
+ if (req == NULL) {
+ CERROR("Can't allocate incoming request descriptor: Dropping %s RPC from %s\n",
+ service->srv_name,
+ libcfs_idstr(&ev->initiator));
+ return;
+ }
+ }
ptlrpc_srv_req_init(req);
/* NB we ABSOLUTELY RELY on req being zeroed, so pointers are NULL,
req->rq_reqdata_len = ev->mlength;
ktime_get_real_ts64(&req->rq_arrival_time);
/* Multi-Rail: keep track of both initiator and source NID. */
- req->rq_peer = ev->initiator;
- req->rq_source = ev->source;
- req->rq_self = ev->target.nid;
+ req->rq_peer = lnet_pid_to_pid4(&ev->initiator);
+ req->rq_source = lnet_pid_to_pid4(&ev->source);
+ req->rq_self = lnet_nid_to_nid4(&ev->target.nid);
req->rq_rqbd = rqbd;
req->rq_phase = RQ_PHASE_NEW;
if (ev->type == LNET_EVENT_PUT)
* before the SENT event (oh yes we can), we know we
* read/wrote the peer buffer and how much... */
desc->bd_nob_transferred += ev->mlength;
- desc->bd_sender = ev->sender;
+ desc->bd_sender = lnet_nid_to_nid4(&ev->sender);
}
if (ev->status != 0)
sec->ps_id, sec2gsec(sec)->gs_mech->gm_name,
vcred->vc_uid, vcred->vc_gid,
sec_part_flags, svc_flag, import_to_gss_svc(imp),
- imp->imp_connection->c_peer.nid, imp->imp_obd->obd_name,
- LNetPrimaryNID(imp->imp_connection->c_self), caller_pid);
+ lnet_nid_to_nid4(&imp->imp_connection->c_peer.nid),
+ imp->imp_obd->obd_name,
+ LNetPrimaryNID(lnet_nid_to_nid4(&imp->imp_connection->c_self)),
+ caller_pid);
CDEBUG(D_SEC, "requesting key for %s\n", desc);
list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
CDEBUG(D_HA, "%s: connect to NID %s last attempt %lld\n",
imp->imp_obd->obd_name,
- libcfs_nid2str(conn->oic_conn->c_peer.nid),
+ libcfs_nidstr(&conn->oic_conn->c_peer.nid),
conn->oic_last_attempt);
/* If we have not tried this connection since
" %.*s (at %s)\n",
imp->imp_obd->obd_name,
target_len, target_start,
- libcfs_nid2str(imp_conn->oic_conn->c_peer.nid));
+ libcfs_nidstr(&imp_conn->oic_conn->c_peer.nid));
}
imp->imp_conn_current = imp_conn;
/* The below message is checked in conf-sanity.sh test_35[ab] */
CDEBUG(D_HA, "%s: import %p using connection %s/%s\n",
imp->imp_obd->obd_name, imp, imp_conn->oic_uuid.uuid,
- libcfs_nid2str(imp_conn->oic_conn->c_peer.nid));
+ libcfs_nidstr(&imp_conn->oic_conn->c_peer.nid));
out_unlock:
spin_unlock(&imp->imp_lock);
desc->bd_failure = 0;
- peer.pid = desc->bd_import->imp_connection->c_peer.pid;
- lnet_nid4_to_nid(desc->bd_import->imp_connection->c_peer.nid,
- &peer.nid);
+ peer = desc->bd_import->imp_connection->c_peer;
LASSERT(desc->bd_cbid.cbid_fn == client_bulk_callback);
LASSERT(desc->bd_cbid.cbid_arg == desc);
request->rq_repmsg = NULL;
}
- peer.pid = connection->c_peer.pid;
- lnet_nid4_to_nid(connection->c_peer.nid, &peer.nid);
+ peer = connection->c_peer;
if (request->rq_bulk &&
OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_BULK_REPLY_ATTACH)) {
reply_me = ERR_PTR(-ENOMEM);
rc = ptl_send_buf(&request->rq_req_md_h,
request->rq_reqbuf, request->rq_reqdata_len,
LNET_NOACK_REQ, &request->rq_req_cbid,
- LNET_NID_ANY, connection->c_peer,
+ LNET_NID_ANY,
+ lnet_pid_to_pid4(&connection->c_peer),
request->rq_request_portal,
request->rq_xid, 0, &bulk_cookie);
if (likely(rc == 0))
list_for_each_entry(exp, &nodemap->nm_member_list,
exp_target_data.ted_nodemap_member) {
if (exp->exp_connection != NULL)
- libcfs_nid2str_r(exp->exp_connection->c_peer.nid,
- nidstr, sizeof(nidstr));
+ libcfs_nidstr_r(&exp->exp_connection->c_peer.nid,
+ nidstr, sizeof(nidstr));
seq_printf(m, " { nid: %s, uuid: %s },",
nidstr, exp->exp_client_uuid.uuid);
/* if no conn assigned to this exp, reconnect will reclassify */
spin_lock(&exp->exp_lock);
if (exp->exp_connection) {
- nid = exp->exp_connection->c_peer.nid;
+ nid = lnet_nid_to_nid4(&exp->exp_connection->c_peer.nid);
} else {
spin_unlock(&exp->exp_lock);
continue;
{
bool req_ok = req->rq_reqmsg != NULL;
bool rep_ok = false;
- lnet_nid_t nid = LNET_NID_ANY;
+ struct lnet_nid *nid = NULL;
struct va_format vaf;
va_list args;
int rep_flags = -1;
spin_unlock(&req->rq_early_free_lock);
if (req->rq_import && req->rq_import->imp_connection)
- nid = req->rq_import->imp_connection->c_peer.nid;
+ nid = &req->rq_import->imp_connection->c_peer.nid;
else if (req->rq_export && req->rq_export->exp_connection)
- nid = req->rq_export->exp_connection->c_peer.nid;
+ nid = &req->rq_export->exp_connection->c_peer.nid;
va_start(args, fmt);
vaf.fmt = fmt;
req->rq_export ?
req->rq_export->exp_client_uuid.uuid :
"<?>",
- libcfs_nid2str(nid),
+ nid ? libcfs_nidstr(nid) : "<unknown>",
req->rq_request_portal, req->rq_reply_portal,
req->rq_reqlen, req->rq_replen,
req->rq_early_count, (s64)req->rq_timedout,
/* sec_config.c */
void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
- enum lustre_sec_part to,
- struct obd_uuid *target,
- lnet_nid_t nid,
- struct sptlrpc_flavor *sf);
+ enum lustre_sec_part to,
+ struct obd_uuid *target,
+ struct lnet_nid *nid,
+ struct sptlrpc_flavor *sf);
int sptlrpc_conf_init(void);
void sptlrpc_conf_fini(void);
sptlrpc_conf_choose_flavor(cliobd->cl_sp_me,
cliobd->cl_sp_to,
&cliobd->cl_target_uuid,
- conn->c_self, &sf);
+ &conn->c_self, &sf);
sp = imp->imp_obd->u.cli.cl_sp_me;
} else {
CDEBUG(D_SEC, "import %s->%s netid %x: select flavor %s\n",
imp->imp_obd->obd_name,
obd_uuid2str(&conn->c_remote_uuid),
- LNET_NIDNET(conn->c_self),
+ LNET_NID_NET(&conn->c_self),
sptlrpc_flavor2name(&sf, str, sizeof(str)));
}
*/
spin_lock(&exp->exp_lock);
sptlrpc_target_choose_flavor(rset, exp->exp_sp_peer,
- exp->exp_connection->c_peer.nid,
+ lnet_nid_to_nid4(&exp->exp_connection->c_peer.nid),
&new_flvr);
if (exp->exp_flvr_changed ||
!flavor_equal(&new_flvr, &exp->exp_flvr)) {
}
void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
- enum lustre_sec_part to,
- struct obd_uuid *target,
- lnet_nid_t nid,
- struct sptlrpc_flavor *sf)
+ enum lustre_sec_part to,
+ struct obd_uuid *target,
+ struct lnet_nid *nid,
+ struct sptlrpc_flavor *sf)
{
- struct sptlrpc_conf *conf;
- struct sptlrpc_conf_tgt *conf_tgt;
- char name[MTI_NAME_MAXLEN];
- int len, rc = 0;
+ struct sptlrpc_conf *conf;
+ struct sptlrpc_conf_tgt *conf_tgt;
+ char name[MTI_NAME_MAXLEN];
+ int len, rc = 0;
obd_uuid2fsname(name, target->uuid, sizeof(name));
mutex_lock(&sptlrpc_conf_lock);
- conf = sptlrpc_conf_get(name, 0);
- if (conf == NULL)
- goto out;
-
- /* convert uuid name (supposed end with _UUID) to target name */
- len = strlen(target->uuid);
- LASSERT(len > 5);
- memcpy(name, target->uuid, len - 5);
- name[len - 5] = '\0';
-
- conf_tgt = sptlrpc_conf_get_tgt(conf, name, 0);
- if (conf_tgt) {
- rc = sptlrpc_rule_set_choose(&conf_tgt->sct_rset,
- from, to, nid, sf);
- if (rc)
- goto out;
- }
+ conf = sptlrpc_conf_get(name, 0);
+ if (conf == NULL)
+ goto out;
+
+ /* convert uuid name (supposed end with _UUID) to target name */
+ len = strlen(target->uuid);
+ LASSERT(len > 5);
+ memcpy(name, target->uuid, len - 5);
+ name[len - 5] = '\0';
+
+ conf_tgt = sptlrpc_conf_get_tgt(conf, name, 0);
+ if (conf_tgt) {
+ rc = sptlrpc_rule_set_choose(&conf_tgt->sct_rset,
+ from, to, lnet_nid_to_nid4(nid), sf);
+ if (rc)
+ goto out;
+ }
- rc = sptlrpc_rule_set_choose(&conf->sc_rset, from, to, nid, sf);
+ rc = sptlrpc_rule_set_choose(&conf->sc_rset, from, to,
+ lnet_nid_to_nid4(nid), sf);
out:
mutex_unlock(&sptlrpc_conf_lock);
- if (rc == 0)
- get_default_flavor(sf);
+ if (rc == 0)
+ get_default_flavor(sf);
- flavor_set_flags(sf, from, to, 1);
+ flavor_set_flags(sf, from, to, 1);
}
/**
* certain peer (from, nid).
*/
void sptlrpc_target_choose_flavor(struct sptlrpc_rule_set *rset,
- enum lustre_sec_part from,
- lnet_nid_t nid,
- struct sptlrpc_flavor *sf)
+ enum lustre_sec_part from,
+ lnet_nid_t nid,
+ struct sptlrpc_flavor *sf)
{
- if (sptlrpc_rule_set_choose(rset, from, LUSTRE_SP_ANY, nid, sf) == 0)
- get_default_flavor(sf);
+ if (sptlrpc_rule_set_choose(rset, from, LUSTRE_SP_ANY, nid, sf) == 0)
+ get_default_flavor(sf);
}
#define SEC_ADAPT_DELAY (10)
CDEBUG(D_HA,
"All locks stolen from rs %p x%lld.t%lld o%d NID %s\n",
rs, rs->rs_xid, rs->rs_transno, rs->rs_opc,
- libcfs_nid2str(exp->exp_connection->c_peer.nid));
+ libcfs_nidstr(&exp->exp_connection->c_peer.nid));
}
if ((rs->rs_sent && !rs->rs_unlinked) || nlocks > 0) {
* NID is on the local node, allow any flavor
*/
if ((strcmp(exp->exp_obd->obd_type->typ_name,
- LUSTRE_MGS_NAME) == 0) &&
- (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
- LNetIsPeerLocal(exp->exp_connection->c_peer.nid)))
+ LUSTRE_MGS_NAME) == 0) &&
+ (exp->exp_flvr.sf_rpc == SPTLRPC_FLVR_NULL ||
+ LNetIsPeerLocal(lnet_nid_to_nid4(&exp->exp_connection->c_peer.nid))))
exp->exp_flvr.sf_rpc = SPTLRPC_FLVR_ANY;
if (exp->exp_flvr.sf_rpc != SPTLRPC_FLVR_ANY &&