Change lp_primary_nid in struct lnet_peer to struct lnet_nid.
Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I386e85062257f6f8832ffdf4b9603c0e1c072dae
Reviewed-on: https://review.whamcloud.com/42102
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
extern const struct lnet_lnd the_lolnd;
extern int avoid_asym_router_failure;
extern const struct lnet_lnd the_lolnd;
extern int avoid_asym_router_failure;
-extern unsigned int lnet_nid_cpt_hash(lnet_nid_t nid, unsigned int number);
+extern unsigned int lnet_nid_cpt_hash(struct lnet_nid *nid,
+ unsigned int number);
extern int lnet_cpt_of_nid_locked(struct lnet_nid *nid, struct lnet_ni *ni);
extern int lnet_cpt_of_nid(lnet_nid_t nid, struct lnet_ni *ni);
extern struct lnet_ni *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
extern int lnet_cpt_of_nid_locked(struct lnet_nid *nid, struct lnet_ni *ni);
extern int lnet_cpt_of_nid(lnet_nid_t nid, struct lnet_ni *ni);
extern struct lnet_ni *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
struct lnet_peer_ni *lnet_peer_get_ni_locked(struct lnet_peer *lp,
lnet_nid_t nid);
struct lnet_peer_ni *lnet_find_peer_ni_locked(lnet_nid_t nid);
struct lnet_peer_ni *lnet_peer_get_ni_locked(struct lnet_peer *lp,
lnet_nid_t 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);
void lnet_peer_net_added(struct lnet_net *net);
lnet_nid_t lnet_peer_primary_nid_locked(lnet_nid_t nid);
struct lnet_peer *lnet_find_peer(lnet_nid_t nid);
void lnet_peer_net_added(struct lnet_net *net);
lnet_nid_t lnet_peer_primary_nid_locked(lnet_nid_t nid);
static inline bool
lnet_peer_ni_is_primary(struct lnet_peer_ni *lpni)
{
static inline bool
lnet_peer_ni_is_primary(struct lnet_peer_ni *lpni)
{
- return lnet_nid_to_nid4(&lpni->lpni_nid) ==
- lpni->lpni_peer_net->lpn_peer->lp_primary_nid;
+ return nid_same(&lpni->lpni_nid,
+ &lpni->lpni_peer_net->lpn_peer->lp_primary_nid);
}
bool lnet_peer_is_uptodate(struct lnet_peer *lp);
}
bool lnet_peer_is_uptodate(struct lnet_peer *lp);
if (old != alive)
CERROR("route to %s through %s has gone from %s to %s\n",
libcfs_net2str(route->lr_net),
if (old != alive)
CERROR("route to %s through %s has gone from %s to %s\n",
libcfs_net2str(route->lr_net),
- libcfs_nid2str(route->lr_gateway->lp_primary_nid),
+ libcfs_nidstr(&route->lr_gateway->lp_primary_nid),
old ? "up" : "down",
alive ? "up" : "down");
}
old ? "up" : "down",
alive ? "up" : "down");
}
struct list_head lp_rtr_list;
/* primary NID of the peer */
struct list_head lp_rtr_list;
/* primary NID of the peer */
- lnet_nid_t lp_primary_nid;
+ struct lnet_nid lp_primary_nid;
/* source NID to use during discovery */
lnet_nid_t lp_disc_src_nid;
/* source NID to use during discovery */
lnet_nid_t lp_disc_src_nid;
-unsigned int
-lnet_nid_cpt_hash(lnet_nid_t nid, unsigned int number)
+static unsigned int
+lnet_nid4_cpt_hash(lnet_nid_t nid, unsigned int number)
{
__u64 key = nid;
unsigned int val;
{
__u64 key = nid;
unsigned int val;
return (unsigned int)(key + val + (val >> 1)) % number;
}
return (unsigned int)(key + val + (val >> 1)) % number;
}
+unsigned int
+lnet_nid_cpt_hash(struct lnet_nid *nid, unsigned int number)
+{
+ unsigned int val;
+ u32 h = 0;
+ int i;
+
+ LASSERT(number >= 1 && number <= LNET_CPT_NUMBER);
+
+ if (number == 1)
+ return 0;
+
+ if (nid_is_nid4(nid))
+ return lnet_nid4_cpt_hash(lnet_nid_to_nid4(nid), number);
+
+ for (i = 0; i < 4; i++)
+ h = hash_32(nid->nid_addr[i]^h, 32);
+ val = hash_32(LNET_NID_NET(nid) ^ h, LNET_CPT_BITS);
+ if (val < number)
+ return val;
+ return (unsigned int)(h + val + (val >> 1)) % number;
+}
+
int
lnet_cpt_of_nid_locked(struct lnet_nid *nid, struct lnet_ni *ni)
{
struct lnet_net *net;
int
lnet_cpt_of_nid_locked(struct lnet_nid *nid, struct lnet_ni *ni)
{
struct lnet_net *net;
- /* FIXME handle long-addr nid */
- lnet_nid_t nid4 = lnet_nid_to_nid4(nid);
/* must called with hold of lnet_net_lock */
if (LNET_CPT_NUMBER == 1)
/* must called with hold of lnet_net_lock */
if (LNET_CPT_NUMBER == 1)
*/
if (ni != NULL) {
if (ni->ni_cpts != NULL)
*/
if (ni != NULL) {
if (ni->ni_cpts != NULL)
- return ni->ni_cpts[lnet_nid_cpt_hash(nid4,
+ return ni->ni_cpts[lnet_nid_cpt_hash(nid,
- return lnet_nid_cpt_hash(nid4, LNET_CPT_NUMBER);
+ return lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
}
/* no NI provided so look at the net */
net = lnet_get_net_locked(LNET_NID_NET(nid));
if (net != NULL && net->net_cpts != NULL) {
}
/* no NI provided so look at the net */
net = lnet_get_net_locked(LNET_NID_NET(nid));
if (net != NULL && net->net_cpts != NULL) {
- return net->net_cpts[lnet_nid_cpt_hash(nid4, net->net_ncpts)];
+ return net->net_cpts[lnet_nid_cpt_hash(nid, net->net_ncpts)];
- return lnet_nid_cpt_hash(nid4, LNET_CPT_NUMBER);
+ return lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
mutex_lock(&the_lnet.ln_api_mutex);
lp = lnet_find_peer(ping->ping_id.nid);
if (lp) {
mutex_lock(&the_lnet.ln_api_mutex);
lp = lnet_find_peer(ping->ping_id.nid);
if (lp) {
- ping->ping_id.nid = lp->lp_primary_nid;
+ ping->ping_id.nid =
+ lnet_nid_to_nid4(&lp->lp_primary_nid);
ping->mr_info = lnet_peer_is_multi_rail(lp);
lnet_peer_decref_locked(lp);
}
ping->mr_info = lnet_peer_is_multi_rail(lp);
lnet_peer_decref_locked(lp);
}
mutex_lock(&the_lnet.ln_api_mutex);
lp = lnet_find_peer(discover->ping_id.nid);
if (lp) {
mutex_lock(&the_lnet.ln_api_mutex);
lp = lnet_find_peer(discover->ping_id.nid);
if (lp) {
- discover->ping_id.nid = lp->lp_primary_nid;
+ discover->ping_id.nid =
+ lnet_nid_to_nid4(&lp->lp_primary_nid);
discover->mr_info = lnet_peer_is_multi_rail(lp);
lnet_peer_decref_locked(lp);
}
discover->mr_info = lnet_peer_is_multi_rail(lp);
lnet_peer_decref_locked(lp);
}
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
if (!lnet_is_route_alive(route))
continue;
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
if (!lnet_is_route_alive(route))
continue;
- gw_pnid = route->lr_gateway->lp_primary_nid;
+ gw_pnid = lnet_nid_to_nid4(&route->lr_gateway->lp_primary_nid);
/* no protection on below fields, but it's harmless */
if (last_route && (last_route->lr_seq - route->lr_seq < 0))
/* no protection on below fields, but it's harmless */
if (last_route && (last_route->lr_seq - route->lr_seq < 0))
lnet_peer_ni_decref_locked(new_lpni);
CDEBUG(D_NET, "msg %p delayed. %s pending discovery\n",
lnet_peer_ni_decref_locked(new_lpni);
CDEBUG(D_NET, "msg %p delayed. %s pending discovery\n",
- msg, libcfs_nid2str(peer->lp_primary_nid));
+ msg, libcfs_nidstr(&peer->lp_primary_nid));
libcfs_nidstr(&ni->ni_nid), libcfs_id2str(peer_id), getmd);
/* setup information for lnet_build_msg_event */
libcfs_nidstr(&ni->ni_nid), libcfs_id2str(peer_id), getmd);
/* setup information for lnet_build_msg_event */
- msg->msg_initiator = getmsg->msg_txpeer->lpni_peer_net->lpn_peer->lp_primary_nid;
+ msg->msg_initiator =
+ lnet_nid_to_nid4(&getmsg->msg_txpeer->lpni_peer_net->lpn_peer->lp_primary_nid);
msg->msg_from = peer_id.nid;
msg->msg_type = LNET_MSG_GET; /* flag this msg as an "optimized" GET */
msg->msg_hdr.src_nid = peer_id.nid;
msg->msg_from = peer_id.nid;
msg->msg_type = LNET_MSG_GET; /* flag this msg as an "optimized" GET */
msg->msg_hdr.src_nid = peer_id.nid;
}
static struct lnet_peer_ni *
}
static struct lnet_peer_ni *
-lnet_peer_ni_alloc(lnet_nid_t nid)
+lnet_peer_ni_alloc(lnet_nid_t nid4)
{
struct lnet_peer_ni *lpni;
struct lnet_net *net;
{
struct lnet_peer_ni *lpni;
struct lnet_net *net;
- cpt = lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
+ lnet_nid4_to_nid(nid4, &nid);
+ cpt = lnet_nid_cpt_hash(&nid, LNET_CPT_NUMBER);
LIBCFS_CPT_ALLOC(lpni, lnet_cpt_table(), cpt, sizeof(*lpni));
if (!lpni)
LIBCFS_CPT_ALLOC(lpni, lnet_cpt_table(), cpt, sizeof(*lpni));
if (!lpni)
else
lpni->lpni_ns_status = LNET_NI_STATUS_UP;
lpni->lpni_ping_feats = LNET_PING_FEAT_INVAL;
else
lpni->lpni_ns_status = LNET_NI_STATUS_UP;
lpni->lpni_ping_feats = LNET_PING_FEAT_INVAL;
- lnet_nid4_to_nid(nid, &lpni->lpni_nid);
lpni->lpni_cpt = cpt;
atomic_set(&lpni->lpni_healthv, LNET_MAX_HEALTH_VALUE);
lpni->lpni_cpt = cpt;
atomic_set(&lpni->lpni_healthv, LNET_MAX_HEALTH_VALUE);
- net = lnet_get_net_locked(LNET_NIDNET(nid));
+ net = lnet_get_net_locked(LNET_NID_NET(&nid));
lpni->lpni_net = net;
if (net) {
lpni->lpni_txcredits = net->net_tunables.lct_peer_tx_credits;
lpni->lpni_net = net;
if (net) {
lpni->lpni_txcredits = net->net_tunables.lct_peer_tx_credits;
}
static struct lnet_peer *
}
static struct lnet_peer *
-lnet_peer_alloc(lnet_nid_t nid)
+lnet_peer_alloc(lnet_nid_t nid4)
+ lnet_nid4_to_nid(nid4, &nid);
LIBCFS_CPT_ALLOC(lp, lnet_cpt_table(), CFS_CPT_ANY, sizeof(*lp));
if (!lp)
return NULL;
LIBCFS_CPT_ALLOC(lp, lnet_cpt_table(), CFS_CPT_ANY, sizeof(*lp));
if (!lp)
return NULL;
* to ever use a different interface when sending messages to
* myself.
*/
* to ever use a different interface when sending messages to
* myself.
*/
- if (nid == LNET_NID_LO_0)
lp->lp_state = LNET_PEER_NO_DISCOVERY;
lp->lp_state = LNET_PEER_NO_DISCOVERY;
- lp->lp_cpt = lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
+ lp->lp_cpt = lnet_nid_cpt_hash(&nid, LNET_CPT_NUMBER);
- CDEBUG(D_NET, "%p nid %s\n", lp, libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "%p nid %s\n", lp, libcfs_nidstr(&lp->lp_primary_nid));
void
lnet_destroy_peer_locked(struct lnet_peer *lp)
{
void
lnet_destroy_peer_locked(struct lnet_peer *lp)
{
- CDEBUG(D_NET, "%p nid %s\n", lp, libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "%p nid %s\n", lp, libcfs_nidstr(&lp->lp_primary_nid));
LASSERT(atomic_read(&lp->lp_refcount) == 0);
LASSERT(lp->lp_rtr_refcount == 0);
LASSERT(atomic_read(&lp->lp_refcount) == 0);
LASSERT(lp->lp_rtr_refcount == 0);
wake_up(&the_lnet.ln_dc_waitq);
}
CDEBUG(D_NET, "peer %s NID %s\n",
wake_up(&the_lnet.ln_dc_waitq);
}
CDEBUG(D_NET, "peer %s NID %s\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
libcfs_nidstr(&lpni->lpni_nid));
}
libcfs_nidstr(&lpni->lpni_nid));
}
struct lnet_peer_ni *lpni = NULL, *lpni2;
int rc = 0, rc2 = 0;
struct lnet_peer_ni *lpni = NULL, *lpni2;
int rc = 0, rc2 = 0;
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(peer->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&peer->lp_primary_nid));
spin_lock(&peer->lp_lock);
peer->lp_state |= LNET_PEER_MARK_DELETED;
spin_lock(&peer->lp_lock);
peer->lp_state |= LNET_PEER_MARK_DELETED;
* -EBUSY: The lnet_peer_ni is the primary, and not the only peer_ni.
*/
static int
* -EBUSY: The lnet_peer_ni is the primary, and not the only peer_ni.
*/
static int
-lnet_peer_del_nid(struct lnet_peer *lp, lnet_nid_t nid, unsigned flags)
+lnet_peer_del_nid(struct lnet_peer *lp, lnet_nid_t nid4, unsigned int flags)
{
struct lnet_peer_ni *lpni;
{
struct lnet_peer_ni *lpni;
- lnet_nid_t primary_nid = lp->lp_primary_nid;
+ struct lnet_nid primary_nid = lp->lp_primary_nid;
+ struct lnet_nid nid;
int rc = 0;
bool force = (flags & LNET_PEER_RTR_NI_FORCE_DEL) ? true : false;
int rc = 0;
bool force = (flags & LNET_PEER_RTR_NI_FORCE_DEL) ? true : false;
+ lnet_nid4_to_nid(nid4, &nid);
if (!(flags & LNET_PEER_CONFIGURED)) {
if (lp->lp_state & LNET_PEER_CONFIGURED) {
rc = -EPERM;
if (!(flags & LNET_PEER_CONFIGURED)) {
if (lp->lp_state & LNET_PEER_CONFIGURED) {
rc = -EPERM;
* deleting it
*/
if (lp->lp_state & LNET_PEER_LOCK_PRIMARY &&
* deleting it
*/
if (lp->lp_state & LNET_PEER_LOCK_PRIMARY &&
+ nid_same(&primary_nid, &nid)) {
- lpni = lnet_find_peer_ni_locked(nid);
+ lpni = lnet_peer_ni_find_locked(&nid);
if (!lpni) {
rc = -ENOENT;
goto out;
if (!lpni) {
rc = -ENOENT;
goto out;
* This function only allows deletion of the primary NID if it
* is the only NID.
*/
* This function only allows deletion of the primary NID if it
* is the only NID.
*/
- if (nid == lp->lp_primary_nid && lp->lp_nnis != 1 && !force) {
+ if (nid_same(&nid, &lp->lp_primary_nid) && lp->lp_nnis != 1 && !force) {
rc = -EBUSY;
goto out;
}
lnet_net_lock(LNET_LOCK_EX);
rc = -EBUSY;
goto out;
}
lnet_net_lock(LNET_LOCK_EX);
- if (nid == lp->lp_primary_nid && lp->lp_nnis != 1 && force) {
+ if (nid_same(&nid, &lp->lp_primary_nid) && lp->lp_nnis != 1 && force) {
struct lnet_peer_ni *lpni2;
/* assign the next peer_ni to be the primary */
lpni2 = lnet_get_next_peer_ni_locked(lp, NULL, lpni);
LASSERT(lpni2);
struct lnet_peer_ni *lpni2;
/* assign the next peer_ni to be the primary */
lpni2 = lnet_get_next_peer_ni_locked(lp, NULL, lpni);
LASSERT(lpni2);
- lp->lp_primary_nid = lnet_nid_to_nid4(&lpni2->lpni_nid);
+ lp->lp_primary_nid = lpni2->lpni_nid;
}
rc = lnet_peer_ni_del_locked(lpni, force);
}
rc = lnet_peer_ni_del_locked(lpni, force);
out:
CDEBUG(D_NET, "peer %s NID %s flags %#x: %d\n",
out:
CDEBUG(D_NET, "peer %s NID %s flags %#x: %d\n",
- libcfs_nid2str(primary_nid), libcfs_nid2str(nid), flags, rc);
+ libcfs_nidstr(&primary_nid), libcfs_nidstr(&nid),
+ flags, rc);
continue;
peer = lpni->lpni_peer_net->lpn_peer;
continue;
peer = lpni->lpni_peer_net->lpn_peer;
- if (peer->lp_primary_nid !=
- lnet_nid_to_nid4(&lpni->lpni_nid)) {
+ if (!nid_same(&peer->lp_primary_nid,
+ &lpni->lpni_nid)) {
lnet_peer_ni_del_locked(lpni, false);
continue;
}
lnet_peer_ni_del_locked(lpni, false);
continue;
}
if (!lnet_isrouter(lp))
continue;
if (!lnet_isrouter(lp))
continue;
- gw_nid = lp->lpni_peer_net->lpn_peer->lp_primary_nid;
+ /* FIXME handle large-addr nid */
+ gw_nid = lnet_nid_to_nid4(
+ &lp->lpni_peer_net->lpn_peer->lp_primary_nid);
lnet_net_unlock(LNET_LOCK_EX);
lnet_del_route(LNET_NET_ANY, gw_nid);
lnet_net_unlock(LNET_LOCK_EX);
lnet_del_route(LNET_NET_ANY, gw_nid);
lnet_nid4_to_nid(nid4, &nid);
lnet_nid4_to_nid(nid4, &nid);
- cpt = lnet_nid_cpt_hash(nid4, LNET_CPT_NUMBER);
+ cpt = lnet_nid_cpt_hash(&nid, LNET_CPT_NUMBER);
ptable = the_lnet.ln_peer_tables[cpt];
lpni = lnet_get_peer_ni_locked(ptable, &nid);
ptable = the_lnet.ln_peer_tables[cpt];
lpni = lnet_get_peer_ni_locked(ptable, &nid);
+lnet_peer_ni_find_locked(struct lnet_nid *nid)
+{
+ struct lnet_peer_ni *lpni;
+ struct lnet_peer_table *ptable;
+ int cpt;
+
+ cpt = lnet_nid_cpt_hash(nid, LNET_CPT_NUMBER);
+
+ ptable = the_lnet.ln_peer_tables[cpt];
+ lpni = lnet_get_peer_ni_locked(ptable, nid);
+
+ return lpni;
+}
+
+struct lnet_peer_ni *
lnet_peer_get_ni_locked(struct lnet_peer *lp, lnet_nid_t nid)
{
struct lnet_peer_net *lpn;
lnet_peer_get_ni_locked(struct lnet_peer *lp, lnet_nid_t nid)
{
struct lnet_peer_net *lpn;
for (cpt = 0; cpt < lncpt; cpt++) {
ptable = the_lnet.ln_peer_tables[cpt];
list_for_each_entry(lp, &ptable->pt_peer_list, lp_peer_list) {
for (cpt = 0; cpt < lncpt; cpt++) {
ptable = the_lnet.ln_peer_tables[cpt];
list_for_each_entry(lp, &ptable->pt_peer_list, lp_peer_list) {
+ if (!nid_is_nid4(&lp->lp_primary_nid))
+ continue;
if (i >= count)
goto done;
if (i >= count)
goto done;
- id.nid = lp->lp_primary_nid;
+ id.nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
if (copy_to_user(&ids[i], &id, sizeof(id)))
goto done;
i++;
if (copy_to_user(&ids[i], &id, sizeof(id)))
goto done;
i++;
spin_unlock(&lpni->lpni_lock);
}
CDEBUG(D_NET, "peer %s nid %s: %d\n",
spin_unlock(&lpni->lpni_lock);
}
CDEBUG(D_NET, "peer %s nid %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), libcfs_nid2str(nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), libcfs_nid2str(nid), rc);
LIBCFS_FREE(ne, sizeof(*ne));
out:
CDEBUG(D_NET, "peer %s nid %s: %d\n",
LIBCFS_FREE(ne, sizeof(*ne));
out:
CDEBUG(D_NET, "peer %s nid %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), libcfs_nid2str(nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), libcfs_nid2str(nid), rc);
lnet_nid_t
lnet_peer_primary_nid_locked(lnet_nid_t nid)
{
lnet_nid_t
lnet_peer_primary_nid_locked(lnet_nid_t nid)
{
+ /* FIXME handle large-addr nid */
struct lnet_peer_ni *lpni;
lnet_nid_t primary_nid = nid;
lpni = lnet_find_peer_ni_locked(nid);
if (lpni) {
struct lnet_peer_ni *lpni;
lnet_nid_t primary_nid = nid;
lpni = lnet_find_peer_ni_locked(nid);
if (lpni) {
- primary_nid = lpni->lpni_peer_net->lpn_peer->lp_primary_nid;
+ primary_nid = lnet_nid_to_nid4(
+ &lpni->lpni_peer_net->lpn_peer->lp_primary_nid);
lnet_peer_ni_decref_locked(lpni);
}
lnet_peer_ni_decref_locked(lpni);
}
}
EXPORT_SYMBOL(LNetAddPeer);
}
EXPORT_SYMBOL(LNetAddPeer);
+/* FIXME support large-addr nid */
lnet_nid_t
LNetPrimaryNID(lnet_nid_t nid)
{
lnet_nid_t
LNetPrimaryNID(lnet_nid_t nid)
{
}
lp = lpni->lpni_peer_net->lpn_peer;
}
}
lp = lpni->lpni_peer_net->lpn_peer;
}
- primary_nid = lp->lp_primary_nid;
+ primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
out_decref:
lnet_peer_ni_decref_locked(lpni);
out_unlock:
out_decref:
lnet_peer_ni_decref_locked(lpni);
out_unlock:
/* Add peer_ni to peer_net */
lpni->lpni_peer_net = lpn;
/* Add peer_ni to peer_net */
lpni->lpni_peer_net = lpn;
- if (lp->lp_primary_nid == lnet_nid_to_nid4(&lpni->lpni_nid))
+ if (nid_same(&lp->lp_primary_nid, &lpni->lpni_nid))
list_add(&lpni->lpni_peer_nis, &lpn->lpn_peer_nis);
else
list_add_tail(&lpni->lpni_peer_nis, &lpn->lpn_peer_nis);
list_add(&lpni->lpni_peer_nis, &lpn->lpn_peer_nis);
else
list_add_tail(&lpni->lpni_peer_nis, &lpn->lpn_peer_nis);
if (!lpn->lpn_peer) {
new_lpn = true;
lpn->lpn_peer = lp;
if (!lpn->lpn_peer) {
new_lpn = true;
lpn->lpn_peer = lp;
- if (lp->lp_primary_nid == lnet_nid_to_nid4(&lpni->lpni_nid))
+ if (nid_same(&lp->lp_primary_nid, &lpni->lpni_nid))
list_add(&lpn->lpn_peer_nets, &lp->lp_peer_nets);
else
list_add_tail(&lpn->lpn_peer_nets, &lp->lp_peer_nets);
list_add(&lpn->lpn_peer_nets, &lp->lp_peer_nets);
else
list_add_tail(&lpn->lpn_peer_nets, &lp->lp_peer_nets);
libcfs_nidstr(&lpni->lpni_nid));
CDEBUG(D_NET, "peer %s NID %s flags %#x\n",
libcfs_nidstr(&lpni->lpni_nid));
CDEBUG(D_NET, "peer %s NID %s flags %#x\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
libcfs_nidstr(&lpni->lpni_nid), flags);
lnet_peer_ni_decref_locked(lpni);
lnet_net_unlock(LNET_LOCK_EX);
libcfs_nidstr(&lpni->lpni_nid), flags);
lnet_peer_ni_decref_locked(lpni);
lnet_net_unlock(LNET_LOCK_EX);
* that an existing peer is being modified.
*/
if (lp->lp_state & LNET_PEER_CONFIGURED) {
* that an existing peer is being modified.
*/
if (lp->lp_state & LNET_PEER_CONFIGURED) {
- if (lp->lp_primary_nid != nid)
+ if (lnet_nid_to_nid4(&lp->lp_primary_nid) != nid)
rc = -EEXIST;
else if ((lp->lp_state ^ flags) & LNET_PEER_MULTI_RAIL)
rc = -EPERM;
goto out;
} else if (!(flags & LNET_PEER_CONFIGURED)) {
rc = -EEXIST;
else if ((lp->lp_state ^ flags) & LNET_PEER_MULTI_RAIL)
rc = -EPERM;
goto out;
} else if (!(flags & LNET_PEER_CONFIGURED)) {
- if (lp->lp_primary_nid == nid) {
+ if (lnet_nid_to_nid4(&lp->lp_primary_nid) == nid) {
rc = -EEXIST;
goto out;
}
rc = -EEXIST;
goto out;
}
lnet_peer_ni_decref_locked(lpni);
out:
CDEBUG(D_NET, "peer %s NID %s flags %#x: %d\n",
lnet_peer_ni_decref_locked(lpni);
out:
CDEBUG(D_NET, "peer %s NID %s flags %#x: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), libcfs_nid2str(nid),
+ libcfs_nidstr(&lp->lp_primary_nid), libcfs_nid2str(nid),
* Call with the lnet_api_mutex held.
*/
static int
* Call with the lnet_api_mutex held.
*/
static int
-lnet_peer_set_primary_nid(struct lnet_peer *lp, lnet_nid_t nid, unsigned flags)
+lnet_peer_set_primary_nid(struct lnet_peer *lp, lnet_nid_t nid,
+ unsigned int flags)
- lnet_nid_t old = lp->lp_primary_nid;
+ struct lnet_nid old = lp->lp_primary_nid;
- if (lp->lp_primary_nid == nid)
+ if (lnet_nid_to_nid4(&lp->lp_primary_nid) == nid)
goto out;
if (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY))
goto out;
if (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY))
- lp->lp_primary_nid = nid;
+ lnet_nid4_to_nid(nid, &lp->lp_primary_nid);
rc = lnet_peer_add_nid(lp, nid, flags);
if (rc) {
rc = lnet_peer_add_nid(lp, nid, flags);
if (rc) {
return 0;
CDEBUG(D_NET, "peer %s NID %s: %d\n",
return 0;
CDEBUG(D_NET, "peer %s NID %s: %d\n",
- libcfs_nid2str(old), libcfs_nid2str(nid), rc);
+ libcfs_nidstr(&old), libcfs_nid2str(nid), rc);
}
/* Primary NID must match */
}
/* Primary NID must match */
- if (lp->lp_primary_nid != prim_nid) {
+ if (lnet_nid_to_nid4(&lp->lp_primary_nid) != prim_nid) {
CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n",
libcfs_nid2str(prim_nid),
CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n",
libcfs_nid2str(prim_nid),
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
lnet_peer_ni_decref_locked(lpni);
lp = lpni->lpni_peer_net->lpn_peer;
lnet_peer_ni_decref_locked(lpni);
lp = lpni->lpni_peer_net->lpn_peer;
- if (prim_nid != lp->lp_primary_nid) {
+ if (prim_nid != lnet_nid_to_nid4(&lp->lp_primary_nid)) {
CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n",
libcfs_nid2str(prim_nid),
CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n",
libcfs_nid2str(prim_nid),
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
}
lnet_net_unlock(LNET_LOCK_EX);
}
lnet_net_unlock(LNET_LOCK_EX);
- if (nid == LNET_NID_ANY || nid == lp->lp_primary_nid)
+ if (nid == LNET_NID_ANY || nid == lnet_nid_to_nid4(&lp->lp_primary_nid))
return lnet_peer_del(lp);
flags = LNET_PEER_CONFIGURED;
return lnet_peer_del(lp);
flags = LNET_PEER_CONFIGURED;
}
CDEBUG(D_NET, "Queue peer %s: %d\n",
}
CDEBUG(D_NET, "Queue peer %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
LIST_HEAD(pending_msgs);
CDEBUG(D_NET, "Discovery complete. Dequeue peer %s\n",
LIST_HEAD(pending_msgs);
CDEBUG(D_NET, "Discovery complete. Dequeue peer %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
list_del_init(&lp->lp_dc_list);
spin_lock(&lp->lp_lock);
list_del_init(&lp->lp_dc_list);
spin_lock(&lp->lp_lock);
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Push Put error %d from %s (source %s)\n",
ev->status,
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Push Put error %d from %s (source %s)\n",
ev->status,
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
libcfs_nid2str(ev->source.nid));
goto out;
}
libcfs_nid2str(ev->source.nid));
goto out;
}
lp->lp_state &= ~LNET_PEER_NIDS_UPTODATE;
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Corrupted Push from %s\n",
lp->lp_state &= ~LNET_PEER_NIDS_UPTODATE;
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Corrupted Push from %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
*/
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL)) {
CERROR("Push from non-Multi-Rail peer %s dropped\n",
*/
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL)) {
CERROR("Push from non-Multi-Rail peer %s dropped\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
*/
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_DISCOVERY)) {
CDEBUG(D_NET, "Peer %s has discovery disabled\n",
*/
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_DISCOVERY)) {
CDEBUG(D_NET, "Peer %s has discovery disabled\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
/*
* Mark the peer for deletion if we already know about it
* and it's going from discovery set to no discovery set
/*
* Mark the peer for deletion if we already know about it
* and it's going from discovery set to no discovery set
LNET_PEER_DISCOVERING)) &&
lp->lp_state & LNET_PEER_DISCOVERED) {
CDEBUG(D_NET, "Marking %s:0x%x for deletion\n",
LNET_PEER_DISCOVERING)) &&
lp->lp_state & LNET_PEER_DISCOVERED) {
CDEBUG(D_NET, "Marking %s:0x%x for deletion\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
lp->lp_state);
lp->lp_state |= LNET_PEER_MARK_DELETION;
}
lp->lp_state |= LNET_PEER_NO_DISCOVERY;
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET, "Peer %s has discovery enabled\n",
lp->lp_state);
lp->lp_state |= LNET_PEER_MARK_DELETION;
}
lp->lp_state |= LNET_PEER_NO_DISCOVERY;
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET, "Peer %s has discovery enabled\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
lp->lp_state &= ~LNET_PEER_NO_DISCOVERY;
}
lp->lp_state &= ~LNET_PEER_NO_DISCOVERY;
}
*/
if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
CDEBUG(D_NET, "peer %s(%p) is MR\n",
*/
if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
CDEBUG(D_NET, "peer %s(%p) is MR\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("Push says %s is Multi-Rail, DLC says not\n",
} else if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("Push says %s is Multi-Rail, DLC says not\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
} else if (lnet_peer_discovery_disabled) {
CDEBUG(D_NET, "peer %s(%p) not MR: DD disabled locally\n",
} else if (lnet_peer_discovery_disabled) {
CDEBUG(D_NET, "peer %s(%p) not MR: DD disabled locally\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET, "peer %s(%p) not MR: DD disabled remotely\n",
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET, "peer %s(%p) not MR: DD disabled remotely\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else {
CDEBUG(D_NET, "peer %s(%p) is MR capable\n",
} else {
CDEBUG(D_NET, "peer %s(%p) is MR capable\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
lp->lp_state |= LNET_PEER_MULTI_RAIL;
lnet_peer_clr_non_mr_pref_nids(lp);
}
lp->lp_state |= LNET_PEER_MULTI_RAIL;
lnet_peer_clr_non_mr_pref_nids(lp);
}
lp->lp_state &= ~LNET_PEER_NIDS_UPTODATE;
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Truncated Push from %s (%d nids)\n",
lp->lp_state &= ~LNET_PEER_NIDS_UPTODATE;
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Truncated Push from %s (%d nids)\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
pbuf->pb_info.pi_nnis);
goto out;
}
pbuf->pb_info.pi_nnis);
goto out;
}
memcpy(&lp->lp_data->pb_info, &pbuf->pb_info,
LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis));
CDEBUG(D_NET, "Ping/Push race from %s: %u vs %u\n",
memcpy(&lp->lp_data->pb_info, &pbuf->pb_info,
LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis));
CDEBUG(D_NET, "Ping/Push race from %s: %u vs %u\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
LNET_PING_BUFFER_SEQNO(pbuf),
LNET_PING_BUFFER_SEQNO(lp->lp_data));
}
LNET_PING_BUFFER_SEQNO(pbuf),
LNET_PING_BUFFER_SEQNO(lp->lp_data));
}
if (!lp->lp_data) {
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Cannot allocate Push buffer for %s %u\n",
if (!lp->lp_data) {
lp->lp_state |= LNET_PEER_FORCE_PING;
CDEBUG(D_NET, "Cannot allocate Push buffer for %s %u\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
LNET_PING_BUFFER_SEQNO(pbuf));
goto out;
}
LNET_PING_BUFFER_SEQNO(pbuf));
goto out;
}
LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis));
lp->lp_state |= LNET_PEER_DATA_PRESENT;
CDEBUG(D_NET, "Received Push %s %u\n",
LNET_PING_INFO_SIZE(pbuf->pb_info.pi_nnis));
lp->lp_state |= LNET_PEER_DATA_PRESENT;
CDEBUG(D_NET, "Received Push %s %u\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
LNET_PING_BUFFER_SEQNO(pbuf));
out:
LNET_PING_BUFFER_SEQNO(pbuf));
out:
goto again;
CDEBUG(D_NET, "peer %s NID %s: %d. %s\n",
goto again;
CDEBUG(D_NET, "peer %s NID %s: %d. %s\n",
- (lp ? libcfs_nid2str(lp->lp_primary_nid) : "(none)"),
+ (lp ? libcfs_nidstr(&lp->lp_primary_nid) : "(none)"),
libcfs_nidstr(&lpni->lpni_nid), rc,
(!block) ? "pending discovery" : "discovery complete");
libcfs_nidstr(&lpni->lpni_nid), rc,
(!block) ? "pending discovery" : "discovery complete");
spin_unlock(&lp->lp_lock);
CDEBUG(D_NET, "peer %s ev->status %d\n",
spin_unlock(&lp->lp_lock);
CDEBUG(D_NET, "peer %s ev->status %d\n",
- libcfs_nid2str(lp->lp_primary_nid), ev->status);
+ libcfs_nidstr(&lp->lp_primary_nid), ev->status);
}
/* Handle a Reply message. This is the reply to a Ping message. */
}
/* Handle a Reply message. This is the reply to a Ping message. */
lp->lp_ping_error = ev->status;
CDEBUG(D_NET, "Ping Reply error %d from %s (source %s)\n",
ev->status,
lp->lp_ping_error = ev->status;
CDEBUG(D_NET, "Ping Reply error %d from %s (source %s)\n",
ev->status,
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
libcfs_nid2str(ev->source.nid));
goto out;
}
libcfs_nid2str(ev->source.nid));
goto out;
}
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = 0;
CDEBUG(D_NET, "Corrupted Ping Reply from %s: %d\n",
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = 0;
CDEBUG(D_NET, "Corrupted Ping Reply from %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_DISCOVERY) ||
lnet_peer_discovery_disabled) {
CDEBUG(D_NET, "Peer %s has discovery disabled\n",
if (!(pbuf->pb_info.pi_features & LNET_PING_FEAT_DISCOVERY) ||
lnet_peer_discovery_disabled) {
CDEBUG(D_NET, "Peer %s has discovery disabled\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
/* Detect whether this peer has toggled discovery from on to
* off and whether we can delete and re-create the peer. Peers
/* Detect whether this peer has toggled discovery from on to
* off and whether we can delete and re-create the peer. Peers
(lp->lp_state & (LNET_PEER_DISCOVERED |
LNET_PEER_MULTI_RAIL))) {
CDEBUG(D_NET, "Marking %s:0x%x for deletion\n",
(lp->lp_state & (LNET_PEER_DISCOVERED |
LNET_PEER_MULTI_RAIL))) {
CDEBUG(D_NET, "Marking %s:0x%x for deletion\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
lp->lp_state);
lp->lp_state |= LNET_PEER_MARK_DELETION;
}
lp->lp_state |= LNET_PEER_NO_DISCOVERY;
} else {
CDEBUG(D_NET, "Peer %s has discovery enabled\n",
lp->lp_state);
lp->lp_state |= LNET_PEER_MARK_DELETION;
}
lp->lp_state |= LNET_PEER_NO_DISCOVERY;
} else {
CDEBUG(D_NET, "Peer %s has discovery enabled\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
lp->lp_state &= ~LNET_PEER_NO_DISCOVERY;
}
lp->lp_state &= ~LNET_PEER_NO_DISCOVERY;
}
if (pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL) {
if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
CDEBUG(D_NET, "peer %s(%p) is MR\n",
if (pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL) {
if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
CDEBUG(D_NET, "peer %s(%p) is MR\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("Reply says %s is Multi-Rail, DLC says not\n",
} else if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("Reply says %s is Multi-Rail, DLC says not\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
} else if (lnet_peer_discovery_disabled) {
CDEBUG(D_NET,
"peer %s(%p) not MR: DD disabled locally\n",
} else if (lnet_peer_discovery_disabled) {
CDEBUG(D_NET,
"peer %s(%p) not MR: DD disabled locally\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET,
"peer %s(%p) not MR: DD disabled remotely\n",
} else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) {
CDEBUG(D_NET,
"peer %s(%p) not MR: DD disabled remotely\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
} else {
CDEBUG(D_NET, "peer %s(%p) is MR capable\n",
} else {
CDEBUG(D_NET, "peer %s(%p) is MR capable\n",
- libcfs_nid2str(lp->lp_primary_nid), lp);
+ libcfs_nidstr(&lp->lp_primary_nid), lp);
lp->lp_state |= LNET_PEER_MULTI_RAIL;
lnet_peer_clr_non_mr_pref_nids(lp);
}
} else if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("DLC says %s is Multi-Rail, Reply says not\n",
lp->lp_state |= LNET_PEER_MULTI_RAIL;
lnet_peer_clr_non_mr_pref_nids(lp);
}
} else if (lp->lp_state & LNET_PEER_MULTI_RAIL) {
if (lp->lp_state & LNET_PEER_CONFIGURED) {
CWARN("DLC says %s is Multi-Rail, Reply says not\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
} else {
CERROR("Multi-Rail state vanished from %s\n",
} else {
CERROR("Multi-Rail state vanished from %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
lp->lp_state &= ~LNET_PEER_MULTI_RAIL;
}
}
lp->lp_state &= ~LNET_PEER_MULTI_RAIL;
}
}
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = 0;
CDEBUG(D_NET, "Truncated Reply from %s (%d nids)\n",
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = 0;
CDEBUG(D_NET, "Truncated Reply from %s (%d nids)\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
pbuf->pb_info.pi_nnis);
goto out;
}
pbuf->pb_info.pi_nnis);
goto out;
}
*/
if (pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL &&
pbuf->pb_info.pi_nnis > 1 &&
*/
if (pbuf->pb_info.pi_features & LNET_PING_FEAT_MULTI_RAIL &&
pbuf->pb_info.pi_nnis > 1 &&
- lp->lp_primary_nid == pbuf->pb_info.pi_ni[1].ns_nid) {
+ lnet_nid_to_nid4(&lp->lp_primary_nid) ==
+ pbuf->pb_info.pi_ni[1].ns_nid) {
if (LNET_PING_BUFFER_SEQNO(pbuf) < lp->lp_peer_seqno)
CDEBUG(D_NET, "peer %s: seq# got %u have %u. peer rebooted?\n",
if (LNET_PING_BUFFER_SEQNO(pbuf) < lp->lp_peer_seqno)
CDEBUG(D_NET, "peer %s: seq# got %u have %u. peer rebooted?\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
LNET_PING_BUFFER_SEQNO(pbuf),
lp->lp_peer_seqno);
LNET_PING_BUFFER_SEQNO(pbuf),
lp->lp_peer_seqno);
/* We're happy with the state of the data in the buffer. */
CDEBUG(D_NET, "peer %s data present %u. state = 0x%x\n",
/* We're happy with the state of the data in the buffer. */
CDEBUG(D_NET, "peer %s data present %u. state = 0x%x\n",
- libcfs_nid2str(lp->lp_primary_nid), lp->lp_peer_seqno, lp->lp_state);
+ libcfs_nidstr(&lp->lp_primary_nid), lp->lp_peer_seqno,
+ lp->lp_state);
if (lp->lp_state & LNET_PEER_DATA_PRESENT)
lnet_ping_buffer_decref(lp->lp_data);
else
if (lp->lp_state & LNET_PEER_DATA_PRESENT)
lnet_ping_buffer_decref(lp->lp_data);
else
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = -ETIMEDOUT;
CDEBUG(D_NET, "Ping Unlink for message to peer %s\n",
lp->lp_state |= LNET_PEER_PING_FAILED;
lp->lp_ping_error = -ETIMEDOUT;
CDEBUG(D_NET, "Ping Unlink for message to peer %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
}
/* We've passed through LNetPut() */
if (lp->lp_state & LNET_PEER_PUSH_SENT) {
}
/* We've passed through LNetPut() */
if (lp->lp_state & LNET_PEER_PUSH_SENT) {
lp->lp_state |= LNET_PEER_PUSH_FAILED;
lp->lp_push_error = -ETIMEDOUT;
CDEBUG(D_NET, "Push Unlink for message to peer %s\n",
lp->lp_state |= LNET_PEER_PUSH_FAILED;
lp->lp_push_error = -ETIMEDOUT;
CDEBUG(D_NET, "Push Unlink for message to peer %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
}
spin_unlock(&lp->lp_lock);
}
}
spin_unlock(&lp->lp_lock);
}
if (rc) {
CERROR("Error adding NID %s to peer %s: %d\n",
libcfs_nid2str(addnis[i].ns_nid),
if (rc) {
CERROR("Error adding NID %s to peer %s: %d\n",
libcfs_nid2str(addnis[i].ns_nid),
- libcfs_nid2str(lp->lp_primary_nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
if (rc == -ENOMEM)
goto out;
}
if (rc == -ENOMEM)
goto out;
}
if (rc) {
CERROR("Error deleting NID %s from peer %s: %d\n",
libcfs_nid2str(delnis[i]),
if (rc) {
CERROR("Error deleting NID %s from peer %s: %d\n",
libcfs_nid2str(delnis[i]),
- libcfs_nid2str(lp->lp_primary_nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
if (rc == -ENOMEM)
goto out;
}
if (rc == -ENOMEM)
goto out;
}
CFS_FREE_PTR_ARRAY(addnis, nnis);
CFS_FREE_PTR_ARRAY(delnis, nnis);
lnet_ping_buffer_decref(pbuf);
CFS_FREE_PTR_ARRAY(addnis, nnis);
CFS_FREE_PTR_ARRAY(delnis, nnis);
lnet_ping_buffer_decref(pbuf);
- CDEBUG(D_NET, "peer %s (%p): %d\n", libcfs_nid2str(lp->lp_primary_nid), lp, rc);
+ CDEBUG(D_NET, "peer %s (%p): %d\n",
+ libcfs_nidstr(&lp->lp_primary_nid), lp, rc);
if (rc) {
spin_lock(&lp->lp_lock);
if (rc) {
spin_lock(&lp->lp_lock);
if (pbuf)
return lnet_peer_merge_data(lp, pbuf);
if (pbuf)
return lnet_peer_merge_data(lp, pbuf);
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&lp->lp_primary_nid));
lp->lp_state &= ~(LNET_PEER_DISCOVERING | LNET_PEER_FORCE_PING |
LNET_PEER_FORCE_PUSH);
CDEBUG(D_NET, "peer %s(%p) state %#x\n",
lp->lp_state &= ~(LNET_PEER_DISCOVERING | LNET_PEER_FORCE_PING |
LNET_PEER_FORCE_PUSH);
CDEBUG(D_NET, "peer %s(%p) state %#x\n",
- libcfs_nid2str(lp->lp_primary_nid), lp, lp->lp_state);
+ libcfs_nidstr(&lp->lp_primary_nid), lp, lp->lp_state);
/* no-op if lnet_peer_del() has already been called on this peer */
if (lp->lp_state & LNET_PEER_MARK_DELETED)
/* no-op if lnet_peer_del() has already been called on this peer */
if (lp->lp_state & LNET_PEER_MARK_DELETED)
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 (lp->lp_primary_nid == LNET_NID_LO_0) {
+ if (nid_is_lo0(&lp->lp_primary_nid)) {
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);
* to update the status of the nids that we currently have
* recorded in that peer.
*/
* to update the status of the nids that we currently have
* recorded in that peer.
*/
- } else if (lp->lp_primary_nid == nid ||
- (lnet_is_nid_in_ping_info(lp->lp_primary_nid, &pbuf->pb_info) &&
+ } else if (lnet_nid_to_nid4(&lp->lp_primary_nid) == nid ||
+ (lnet_is_nid_in_ping_info(lnet_nid_to_nid4(&lp->lp_primary_nid),
+ &pbuf->pb_info) &&
lnet_is_discovery_disabled(lp))) {
rc = lnet_peer_merge_data(lp, pbuf);
} else {
lnet_is_discovery_disabled(lp))) {
rc = lnet_peer_merge_data(lp, pbuf);
} else {
rc = lnet_peer_set_primary_nid(lp, nid, flags);
if (rc) {
CERROR("Primary NID error %s versus %s: %d\n",
rc = lnet_peer_set_primary_nid(lp, nid, flags);
if (rc) {
CERROR("Primary NID error %s versus %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
libcfs_nid2str(nid), rc);
} else {
rc = lnet_peer_merge_data(lp, pbuf);
libcfs_nid2str(nid), rc);
} else {
rc = lnet_peer_merge_data(lp, pbuf);
- CDEBUG(D_NET, "peer %s(%p): %d. state = 0x%x\n", libcfs_nid2str(lp->lp_primary_nid), lp, rc,
+ CDEBUG(D_NET, "peer %s(%p): %d. state = 0x%x\n",
+ libcfs_nidstr(&lp->lp_primary_nid), lp, rc,
lp->lp_state);
mutex_unlock(&the_lnet.ln_api_mutex);
lp->lp_state);
mutex_unlock(&the_lnet.ln_api_mutex);
LNetMDUnlink(mdh);
CDEBUG(D_NET, "peer %s:%d\n",
LNetMDUnlink(mdh);
CDEBUG(D_NET, "peer %s:%d\n",
- libcfs_nid2str(lp->lp_primary_nid), rc);
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
spin_lock(&lp->lp_lock);
return rc ? rc : LNET_REDISCOVER_PEER;
spin_lock(&lp->lp_lock);
return rc ? rc : LNET_REDISCOVER_PEER;
nnis = max(lp->lp_data_nnis, LNET_INTERFACES_MIN);
nnis = max(lp->lp_data_nnis, LNET_INTERFACES_MIN);
- rc = lnet_send_ping(lp->lp_primary_nid, &lp->lp_ping_mdh, nnis, lp,
+ rc = lnet_send_ping(lnet_nid_to_nid4(&lp->lp_primary_nid),
+ &lp->lp_ping_mdh, nnis, lp,
the_lnet.ln_dc_handler, false);
/*
the_lnet.ln_dc_handler, false);
/*
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&lp->lp_primary_nid));
spin_lock(&lp->lp_lock);
return 0;
fail_error:
spin_lock(&lp->lp_lock);
return 0;
fail_error:
- CDEBUG(D_NET, "peer %s: %d\n", libcfs_nid2str(lp->lp_primary_nid), rc);
+ CDEBUG(D_NET, "peer %s: %d\n", libcfs_nidstr(&lp->lp_primary_nid), rc);
/*
* The errors that get us here are considered hard errors and
* cause Discovery to terminate. So we clear PING_SENT, but do
/*
* The errors that get us here are considered hard errors and
* cause Discovery to terminate. So we clear PING_SENT, but do
if (!LNetMDHandleIsInvalid(mdh))
LNetMDUnlink(mdh);
if (!LNetMDHandleIsInvalid(mdh))
LNetMDUnlink(mdh);
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&lp->lp_primary_nid));
spin_lock(&lp->lp_lock);
return rc ? rc : LNET_REDISCOVER_PEER;
}
spin_lock(&lp->lp_lock);
return rc ? rc : LNET_REDISCOVER_PEER;
}
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&lp->lp_primary_nid));
if (lp->lp_disc_dst_nid != LNET_NID_ANY)
id.nid = lp->lp_disc_dst_nid;
else
if (lp->lp_disc_dst_nid != LNET_NID_ANY)
id.nid = lp->lp_disc_dst_nid;
else
- id.nid = lp->lp_primary_nid;
+ id.nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
lnet_net_unlock(cpt);
rc = LNetPut(lp->lp_disc_src_nid, lp->lp_push_mdh,
lnet_net_unlock(cpt);
rc = LNetPut(lp->lp_disc_src_nid, lp->lp_push_mdh,
if (rc)
goto fail_unlink;
if (rc)
goto fail_unlink;
- CDEBUG(D_NET, "peer %s\n", libcfs_nid2str(lp->lp_primary_nid));
+ CDEBUG(D_NET, "peer %s\n", libcfs_nidstr(&lp->lp_primary_nid));
spin_lock(&lp->lp_lock);
return 0;
spin_lock(&lp->lp_lock);
return 0;
LNetMDUnlink(lp->lp_push_mdh);
LNetInvalidateMDHandle(&lp->lp_push_mdh);
fail_error:
LNetMDUnlink(lp->lp_push_mdh);
LNetInvalidateMDHandle(&lp->lp_push_mdh);
fail_error:
- CDEBUG(D_NET, "peer %s(%p): %d\n", libcfs_nid2str(lp->lp_primary_nid), lp, rc);
+ CDEBUG(D_NET, "peer %s(%p): %d\n", libcfs_nidstr(&lp->lp_primary_nid),
+ lp, rc);
/*
* The errors that get us here are considered hard errors and
* cause Discovery to terminate. So we clear PUSH_SENT, but do
/*
* The errors that get us here are considered hard errors and
* cause Discovery to terminate. So we clear PUSH_SENT, but do
static void lnet_peer_discovery_error(struct lnet_peer *lp, int error)
{
CDEBUG(D_NET, "Discovery error %s: %d\n",
static void lnet_peer_discovery_error(struct lnet_peer *lp, int error)
{
CDEBUG(D_NET, "Discovery error %s: %d\n",
- libcfs_nid2str(lp->lp_primary_nid), error);
+ libcfs_nidstr(&lp->lp_primary_nid), error);
spin_lock(&lp->lp_lock);
lp->lp_dc_error = error;
spin_lock(&lp->lp_lock);
lp->lp_dc_error = error;
*/
spin_lock(&lp->lp_lock);
CDEBUG(D_NET, "peer %s(%p) state %#x\n",
*/
spin_lock(&lp->lp_lock);
CDEBUG(D_NET, "peer %s(%p) state %#x\n",
- libcfs_nid2str(lp->lp_primary_nid), lp,
+ libcfs_nidstr(&lp->lp_primary_nid), lp,
lp->lp_state);
if (lp->lp_state & (LNET_PEER_MARK_DELETION |
LNET_PEER_MARK_DELETED))
lp->lp_state);
if (lp->lp_state & (LNET_PEER_MARK_DELETION |
LNET_PEER_MARK_DELETED))
else
rc = lnet_peer_discovered(lp);
CDEBUG(D_NET, "peer %s(%p) state %#x rc %d\n",
else
rc = lnet_peer_discovered(lp);
CDEBUG(D_NET, "peer %s(%p) state %#x rc %d\n",
- libcfs_nid2str(lp->lp_primary_nid), lp,
+ libcfs_nidstr(&lp->lp_primary_nid), lp,
lp->lp_state, rc);
spin_unlock(&lp->lp_lock);
lp->lp_state, rc);
spin_unlock(&lp->lp_lock);
- cfg->prcfg_prim_nid = lp->lp_primary_nid;
+ cfg->prcfg_prim_nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
cfg->prcfg_mr = lnet_peer_is_multi_rail(lp);
cfg->prcfg_mr = lnet_peer_is_multi_rail(lp);
- cfg->prcfg_cfg_nid = lp->lp_primary_nid;
+ cfg->prcfg_cfg_nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
cfg->prcfg_count = lp->lp_nnis;
cfg->prcfg_size = size;
cfg->prcfg_state = lp->lp_state;
cfg->prcfg_count = lp->lp_nnis;
cfg->prcfg_size = size;
cfg->prcfg_state = lp->lp_state;
* use the gateway's lp_primary_nid to delete the route as the
* lr_nid can be a constituent NID of the peer
*/
* use the gateway's lp_primary_nid to delete the route as the
* lr_nid can be a constituent NID of the peer
*/
- lnet_del_route_from_rnet(route->lr_gateway->lp_primary_nid,
- &rnet->lrn_routes, l);
+ lnet_del_route_from_rnet(
+ lnet_nid_to_nid4(&route->lr_gateway->lp_primary_nid),
+ &rnet->lrn_routes, l);
if (lp) {
route = list_first_entry(l, struct lnet_route,
if (lp) {
route = list_first_entry(l, struct lnet_route,
lnet_net_lock(LNET_LOCK_EX);
CDEBUG(D_NET, "transfering routes from %s -> %s\n",
lnet_net_lock(LNET_LOCK_EX);
CDEBUG(D_NET, "transfering routes from %s -> %s\n",
- libcfs_nid2str(src->lp_primary_nid),
- libcfs_nid2str(target->lp_primary_nid));
+ libcfs_nidstr(&src->lp_primary_nid),
+ libcfs_nidstr(&target->lp_primary_nid));
list_for_each_entry(route, &src->lp_routes, lr_gwlist) {
list_for_each_entry(route, &src->lp_routes, lr_gwlist) {
- CDEBUG(D_NET, "%s: %s->%s\n", libcfs_nid2str(src->lp_primary_nid),
+ CDEBUG(D_NET, "%s: %s->%s\n",
+ libcfs_nidstr(&src->lp_primary_nid),
libcfs_net2str(route->lr_net),
libcfs_nid2str(route->lr_nid));
}
libcfs_net2str(route->lr_net),
libcfs_nid2str(route->lr_nid));
}
spin_unlock(&gw->lp_lock);
if (gw->lp_rtr_refcount > 0)
CERROR("peer %s is being used as a gateway but routing feature is not turned on\n",
spin_unlock(&gw->lp_lock);
if (gw->lp_rtr_refcount > 0)
CERROR("peer %s is being used as a gateway but routing feature is not turned on\n",
- libcfs_nid2str(gw->lp_primary_nid));
+ libcfs_nidstr(&gw->lp_primary_nid));
return false;
}
spin_unlock(&gw->lp_lock);
return false;
}
spin_unlock(&gw->lp_lock);
(route->lr_hops == 1 || route->lr_hops == LNET_UNDEFINED_HOPS)) {
CWARN("route %s->%s is detected to be multi-hop but hop count is set to %d\n",
libcfs_net2str(route->lr_net),
(route->lr_hops == 1 || route->lr_hops == LNET_UNDEFINED_HOPS)) {
CWARN("route %s->%s is detected to be multi-hop but hop count is set to %d\n",
libcfs_net2str(route->lr_net),
- libcfs_nid2str(route->lr_gateway->lp_primary_nid),
+ libcfs_nidstr(&route->lr_gateway->lp_primary_nid),
(int) route->lr_hops);
}
}
(int) route->lr_hops);
}
}
if (lp_state & LNET_PEER_PING_FAILED ||
pbuf->pb_info.pi_features & LNET_PING_FEAT_RTE_DISABLED) {
CDEBUG(D_NET, "Set routes down for gw %s because %s %d\n",
if (lp_state & LNET_PEER_PING_FAILED ||
pbuf->pb_info.pi_features & LNET_PING_FEAT_RTE_DISABLED) {
CDEBUG(D_NET, "Set routes down for gw %s because %s %d\n",
- libcfs_nid2str(lp->lp_primary_nid),
+ libcfs_nidstr(&lp->lp_primary_nid),
lp_state & LNET_PEER_PING_FAILED ? "ping failed" :
"route feature is disabled", lp->lp_ping_error);
/* If the ping failed or the peer has routing disabled then
lp_state & LNET_PEER_PING_FAILED ? "ping failed" :
"route feature is disabled", lp->lp_ping_error);
/* If the ping failed or the peer has routing disabled then
}
CDEBUG(D_NET, "Discovery is disabled. Processing reply for gw: %s:%d\n",
}
CDEBUG(D_NET, "Discovery is disabled. Processing reply for gw: %s:%d\n",
- libcfs_nid2str(lp->lp_primary_nid), pbuf->pb_info.pi_nnis);
+ libcfs_nidstr(&lp->lp_primary_nid), pbuf->pb_info.pi_nnis);
/*
* examine the ping response to determine if the routes on that
/*
* examine the ping response to determine if the routes on that
* determine otherwise.
*/
CDEBUG(D_NET, "%s: Router discovery failed %d\n",
* determine otherwise.
*/
CDEBUG(D_NET, "%s: Router discovery failed %d\n",
- libcfs_nid2str(lp->lp_primary_nid), lp->lp_dc_error);
+ libcfs_nidstr(&lp->lp_primary_nid), lp->lp_dc_error);
while ((lpni = lnet_get_next_peer_ni_locked(lp, NULL, lpni)) != NULL)
lpni->lpni_ns_status = LNET_NI_STATUS_DOWN;
while ((lpni = lnet_get_next_peer_ni_locked(lp, NULL, lpni)) != NULL)
lpni->lpni_ns_status = LNET_NI_STATUS_DOWN;
}
/* our lookups must be true */
}
/* our lookups must be true */
- LASSERT(route2->lr_gateway->lp_primary_nid != gateway);
+ LASSERT(lnet_nid_to_nid4(&route2->lr_gateway->lp_primary_nid) !=
+ gateway);
list_for_each_entry_safe(route, tmp, route_list, lr_list) {
gateway = route->lr_gateway;
if (gw_nid != LNET_NID_ANY &&
list_for_each_entry_safe(route, tmp, route_list, lr_list) {
gateway = route->lr_gateway;
if (gw_nid != LNET_NID_ANY &&
- gw_nid != gateway->lp_primary_nid)
+ gw_nid != lnet_nid_to_nid4(&gateway->lp_primary_nid))
if (lpni) {
lp = lpni->lpni_peer_net->lpn_peer;
LASSERT(lp);
if (lpni) {
lp = lpni->lpni_peer_net->lpn_peer;
LASSERT(lp);
- gw_nid = lp->lp_primary_nid;
+ gw_nid = lnet_nid_to_nid4(&lp->lp_primary_nid);
lnet_peer_ni_decref_locked(lpni);
}
lnet_peer_ni_decref_locked(lpni);
}
lpn = lnet_get_next_peer_net_locked(rtr, net_id);
if (!lpn) {
CERROR("gateway %s has no networks\n",
lpn = lnet_get_next_peer_net_locked(rtr, net_id);
if (!lpn) {
CERROR("gateway %s has no networks\n",
- libcfs_nid2str(rtr->lp_primary_nid));
+ libcfs_nidstr(&rtr->lp_primary_nid));
found_lpn = true;
CDEBUG(D_NET, "rtr %s(%p) %s(%p) next ping %lld\n",
found_lpn = true;
CDEBUG(D_NET, "rtr %s(%p) %s(%p) next ping %lld\n",
- libcfs_nid2str(rtr->lp_primary_nid), rtr,
+ libcfs_nidstr(&rtr->lp_primary_nid), rtr,
libcfs_net2str(net_id), lpn,
lpn->lpn_next_ping);
libcfs_net2str(net_id), lpn,
lpn->lpn_next_ping);
if (!found_lpn || !lpn) {
CERROR("no local network found for gateway %s\n",
if (!found_lpn || !lpn) {
CERROR("no local network found for gateway %s\n",
- libcfs_nid2str(rtr->lp_primary_nid));
+ libcfs_nidstr(&rtr->lp_primary_nid));
spin_unlock(&rtr->lp_lock);
/* find the peer_ni associated with the primary NID */
spin_unlock(&rtr->lp_lock);
/* find the peer_ni associated with the primary NID */
- lpni = lnet_peer_get_ni_locked(rtr, rtr->lp_primary_nid);
+ lpni = lnet_peer_get_ni_locked(
+ rtr, lnet_nid_to_nid4(&rtr->lp_primary_nid));
if (!lpni) {
CDEBUG(D_NET, "Expected to find an lpni for %s, but non found\n",
if (!lpni) {
CDEBUG(D_NET, "Expected to find an lpni for %s, but non found\n",
- libcfs_nid2str(rtr->lp_primary_nid));
+ libcfs_nidstr(&rtr->lp_primary_nid));
continue;
}
lnet_peer_ni_addref_locked(lpni);
continue;
}
lnet_peer_ni_addref_locked(lpni);
lpn->lpn_next_ping = now + alive_router_check_interval;
else
CERROR("Failed to discover router %s\n",
lpn->lpn_next_ping = now + alive_router_check_interval;
else
CERROR("Failed to discover router %s\n",
- libcfs_nid2str(rtr->lp_primary_nid));
+ libcfs_nidstr(&rtr->lp_primary_nid));
/* NB cpt lock was dropped in lnet_discover_peer_locked() */
if (version != the_lnet.ln_routers_version) {
/* NB cpt lock was dropped in lnet_discover_peer_locked() */
if (version != the_lnet.ln_routers_version) {
- lnet_nid_t nid = peer->lp_primary_nid;
+ struct lnet_nid *nid = &peer->lp_primary_nid;
int nrefs = atomic_read(&peer->lp_refcount);
int nrtrrefs = peer->lp_rtr_refcount;
int alive = lnet_is_gateway_alive(peer);
int nrefs = atomic_read(&peer->lp_refcount);
int nrtrrefs = peer->lp_rtr_refcount;
int alive = lnet_is_gateway_alive(peer);
"%-4d %7d %5s %s\n",
nrefs, nrtrrefs,
alive ? "up" : "down",
"%-4d %7d %5s %s\n",
nrefs, nrtrrefs,
alive ? "up" : "down",
list_for_each_entry(rnet, rn_list, lrn_list) {
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
/* look if gw nid on the same net matches */
list_for_each_entry(rnet, rn_list, lrn_list) {
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
/* look if gw nid on the same net matches */
- gw_prim_nid = route->lr_gateway->lp_primary_nid;
+ gw_prim_nid = lnet_nid_to_nid4(
+ &route->lr_gateway->lp_primary_nid);
lpni = NULL;
while ((lpni = lnet_get_next_peer_ni_locked(route->lr_gateway,
NULL,
lpni = NULL;
while ((lpni = lnet_get_next_peer_ni_locked(route->lr_gateway,
NULL,
rn_list = &the_lnet.ln_remote_nets_hash[i];
list_for_each_entry(rnet, rn_list, lrn_list) {
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
rn_list = &the_lnet.ln_remote_nets_hash[i];
list_for_each_entry(rnet, rn_list, lrn_list) {
list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
- gw_nid = route->lr_gateway->lp_primary_nid;
+ gw_nid = lnet_nid_to_nid4(
+ &route->lr_gateway->lp_primary_nid);
rc = cfs_match_nid_net(gw_nid,
rte_action->ud_net_id.udn_net_type,
&rte_action->ud_net_id.udn_net_num_range,
rc = cfs_match_nid_net(gw_nid,
rte_action->ud_net_id.udn_net_type,
&rte_action->ud_net_id.udn_net_num_range,
ptable = the_lnet.ln_peer_tables[cpt];
list_for_each_entry(lp, &ptable->pt_peer_list, lp_peer_list) {
CDEBUG(D_NET, "udsp examining lp %s\n",
ptable = the_lnet.ln_peer_tables[cpt];
list_for_each_entry(lp, &ptable->pt_peer_list, lp_peer_list) {
CDEBUG(D_NET, "udsp examining lp %s\n",
- libcfs_nid2str(lp->lp_primary_nid));
+ libcfs_nidstr(&lp->lp_primary_nid));
list_for_each_entry(lpn,
&lp->lp_peer_nets,
lpn_peer_nets) {
list_for_each_entry(lpn,
&lp->lp_peer_nets,
lpn_peer_nets) {