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);
+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);
void lnet_peer_queue_message(struct lnet_peer *lp, struct lnet_msg *msg);
int lnet_peer_discovery_start(void);
struct list_head msg_activelist;
struct list_head msg_list; /* Q for credits/MD */
- struct lnet_process_id msg_target;
+ struct lnet_processid msg_target;
/* Primary NID of the source. */
- lnet_nid_t msg_initiator;
+ struct lnet_nid msg_initiator;
/* where is it from, it's only for building event */
- lnet_nid_t msg_from;
+ struct lnet_nid msg_from;
__u32 msg_type;
/*
* hold parameters in case message is with held due
* to discovery
*/
- lnet_nid_t msg_src_nid_param;
- lnet_nid_t msg_rtr_nid_param;
+ struct lnet_nid msg_src_nid_param;
+ struct lnet_nid msg_rtr_nid_param;
/*
* Deadline for the message after which it will be finalized if it
void kgnilnd_peer_increase_reconnect_locked(kgn_peer_t *peer);
void kgnilnd_queue_reply(kgn_conn_t *conn, kgn_tx_t *tx);
void kgnilnd_queue_tx(kgn_conn_t *conn, kgn_tx_t *tx);
-void kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target);
+void kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net,
+ struct lnet_processid *target);
int kgnilnd_send_mapped_tx(kgn_tx_t *tx, int try_map_if_full);
void kgnilnd_consume_rx(kgn_rx_t *rx);
}
void
-kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target)
+kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_processid *target)
{
kgn_peer_t *peer;
kgn_peer_t *new_peer = NULL;
/* I expect to find him, so only take a read lock */
read_lock(&kgnilnd_data.kgn_peer_conn_lock);
- peer = kgnilnd_find_peer_locked(target->nid);
+ peer = kgnilnd_find_peer_locked(lnet_nid_to_nid4(&target->nid));
if (peer != NULL) {
conn = kgnilnd_find_conn_locked(peer);
/* this could be NULL during quiesce */
CFS_RACE(CFS_FAIL_GNI_FIND_TARGET);
- node_state = kgnilnd_get_node_state(LNET_NIDADDR(target->nid));
+ node_state = kgnilnd_get_node_state(ntohl(target->nid->nid_addr[0]));
/* NB - this will not block during normal operations -
* the only writer of this is in the startup/shutdown path. */
/* ignore previous peer entirely - we cycled the lock, so we
* will create new peer and at worst drop it if peer is still
* in the tables */
- rc = kgnilnd_create_peer_safe(&new_peer, target->nid, net, node_state);
+ rc = kgnilnd_create_peer_safe(&new_peer, lnet_nid_to_nid4(&target->nid),
+ net, node_state);
if (rc != 0) {
up_read(&kgnilnd_data.kgn_net_rw_sem);
GOTO(no_peer, rc);
/* search for peer again now that we have the lock
* if we don't find it, add our new one to the list */
- kgnilnd_add_peer_locked(target->nid, new_peer, &peer);
+ kgnilnd_add_peer_locked(lnet_nid_to_nid4(&target->nid), new_peer,
+ &peer);
/* don't create a connection if the peer is not up */
if (peer->gnp_state != GNILND_PEER_UP) {
{
struct lnet_hdr *hdr = &lntmsg->msg_hdr;
int type = lntmsg->msg_type;
- struct lnet_process_id target = lntmsg->msg_target;
+ struct lnet_processid *target = &lntmsg->msg_target;
int target_is_router = lntmsg->msg_target_is_router;
int routing = lntmsg->msg_routing;
unsigned int niov = lntmsg->msg_niov;
LASSERT(!in_interrupt());
CDEBUG(D_NET, "sending msg type %d with %d bytes in %d frags to %s\n",
- type, nob, niov, libcfs_id2str(target));
+ type, nob, niov, libcfs_idstr(target));
LASSERTF(nob == 0 || niov > 0,
"lntmsg %p nob %d niov %d\n", lntmsg, nob, niov);
tx->tx_lntmsg[1] = lnet_create_reply_msg(ni, lntmsg);
if (tx->tx_lntmsg[1] == NULL) {
CERROR("Can't create reply for GET to %s\n",
- libcfs_nid2str(target.nid));
+ libcfs_nidstr(&target->nid));
kgnilnd_tx_done(tx, rc);
rc = -EIO;
goto out;
tx->tx_msg.gnm_u.putreq.gnprm_hdr = *hdr;
/* rest of tx_msg is setup just before it is sent */
- kgnilnd_launch_tx(tx, net, &target);
+ kgnilnd_launch_tx(tx, net, target);
goto out;
case LNET_MSG_REPLY:
case LNET_MSG_PUT:
tx->tx_msg.gnm_u.get.gngm_hdr = *hdr;
/* rest of tx_msg is setup just before it is sent */
- kgnilnd_launch_tx(tx, net, &target);
+ kgnilnd_launch_tx(tx, net, target);
goto out;
}
tx->tx_msg.gnm_u.immediate.gnim_hdr = *hdr;
tx->tx_lntmsg[0] = lntmsg;
- kgnilnd_launch_tx(tx, net, &target);
+ kgnilnd_launch_tx(tx, net, target);
out:
/* use stored value as we could have already finalized lntmsg here from a failed launch */
{
struct lnet_hdr *hdr = &lntmsg->msg_hdr;
int type = lntmsg->msg_type;
- struct lnet_process_id target = lntmsg->msg_target;
+ struct lnet_processid *target = &lntmsg->msg_target;
int target_is_router = lntmsg->msg_target_is_router;
int routing = lntmsg->msg_routing;
unsigned int payload_niov = lntmsg->msg_niov;
int nob;
int rc;
- /* NB 'private' is different depending on what we're sending.... */
+ /* NB 'private' is different depending on what we're sending.... */
- CDEBUG(D_NET, "sending %d bytes in %d frags to %s\n",
- payload_nob, payload_niov, libcfs_id2str(target));
+ CDEBUG(D_NET, "sending %d bytes in %d frags to %s\n",
+ payload_nob, payload_niov, libcfs_idstr(target));
LASSERT (payload_nob == 0 || payload_niov > 0);
LASSERT (payload_niov <= LNET_MAX_IOV);
/* Thread context */
LASSERT (!in_interrupt());
- tx = kiblnd_get_idle_tx(ni, target.nid);
+ tx = kiblnd_get_idle_tx(ni, lnet_nid_to_nid4(&target->nid));
if (tx == NULL) {
CERROR("Can't allocate %s txd for %s\n",
lnet_msgtyp2str(type),
- libcfs_nid2str(target.nid));
+ libcfs_nidstr(&target->nid));
return -ENOMEM;
}
ibmsg = tx->tx_msg;
0, lntmsg->msg_md->md_length);
if (rc != 0) {
CERROR("Can't setup GET sink for %s: %d\n",
- libcfs_nid2str(target.nid), rc);
+ libcfs_nidstr(&target->nid), rc);
tx->tx_hstatus = LNET_MSG_STATUS_LOCAL_ERROR;
kiblnd_tx_done(tx);
return -EIO;
tx->tx_lntmsg[1] = lnet_create_reply_msg(ni, lntmsg);
if (tx->tx_lntmsg[1] == NULL) {
CERROR("Can't create reply for GET -> %s\n",
- libcfs_nid2str(target.nid));
+ libcfs_nidstr(&target->nid));
kiblnd_tx_done(tx);
return -EIO;
}
/* finalise lntmsg[0,1] on completion */
tx->tx_lntmsg[0] = lntmsg;
tx->tx_waiting = 1; /* waiting for GET_DONE */
- kiblnd_launch_tx(ni, tx, target.nid);
+ kiblnd_launch_tx(ni, tx, lnet_nid_to_nid4(&target->nid));
return 0;
case LNET_MSG_REPLY:
payload_offset, payload_nob);
if (rc != 0) {
CERROR("Can't setup PUT src for %s: %d\n",
- libcfs_nid2str(target.nid), rc);
+ libcfs_nidstr(&target->nid), rc);
kiblnd_tx_done(tx);
return -EIO;
}
/* finalise lntmsg[0,1] on completion */
tx->tx_lntmsg[0] = lntmsg;
tx->tx_waiting = 1; /* waiting for PUT_{ACK,NAK} */
- kiblnd_launch_tx(ni, tx, target.nid);
+ kiblnd_launch_tx(ni, tx, lnet_nid_to_nid4(&target->nid));
return 0;
}
/* finalise lntmsg on completion */
tx->tx_lntmsg[0] = lntmsg;
- kiblnd_launch_tx(ni, tx, target.nid);
+ kiblnd_launch_tx(ni, tx, lnet_nid_to_nid4(&target->nid));
return 0;
}
static void
kiblnd_reply(struct lnet_ni *ni, struct kib_rx *rx, struct lnet_msg *lntmsg)
{
- struct lnet_process_id target = lntmsg->msg_target;
+ struct lnet_processid *target = &lntmsg->msg_target;
unsigned int niov = lntmsg->msg_niov;
struct bio_vec *kiov = lntmsg->msg_kiov;
unsigned int offset = lntmsg->msg_offset;
int rc;
tx = kiblnd_get_idle_tx(ni, rx->rx_conn->ibc_peer->ibp_nid);
- if (tx == NULL) {
- CERROR("Can't get tx for REPLY to %s\n",
- libcfs_nid2str(target.nid));
- goto failed_0;
- }
+ if (tx == NULL) {
+ CERROR("Can't get tx for REPLY to %s\n",
+ libcfs_nidstr(&target->nid));
+ goto failed_0;
+ }
- if (nob == 0)
- rc = 0;
- else
- rc = kiblnd_setup_rd_kiov(ni, tx, tx->tx_rd,
- niov, kiov, offset, nob);
+ if (nob == 0)
+ rc = 0;
+ else
+ rc = kiblnd_setup_rd_kiov(ni, tx, tx->tx_rd,
+ niov, kiov, offset, nob);
- if (rc != 0) {
- CERROR("Can't setup GET src for %s: %d\n",
- libcfs_nid2str(target.nid), rc);
- goto failed_1;
- }
+ if (rc != 0) {
+ CERROR("Can't setup GET src for %s: %d\n",
+ libcfs_nidstr(&target->nid), rc);
+ goto failed_1;
+ }
- rc = kiblnd_init_rdma(rx->rx_conn, tx,
- IBLND_MSG_GET_DONE, nob,
- &rx->rx_msg->ibm_u.get.ibgm_rd,
- rx->rx_msg->ibm_u.get.ibgm_cookie);
- if (rc < 0) {
- CERROR("Can't setup rdma for GET from %s: %d\n",
- libcfs_nid2str(target.nid), rc);
- goto failed_1;
- }
+ rc = kiblnd_init_rdma(rx->rx_conn, tx,
+ IBLND_MSG_GET_DONE, nob,
+ &rx->rx_msg->ibm_u.get.ibgm_rd,
+ rx->rx_msg->ibm_u.get.ibgm_cookie);
+ if (rc < 0) {
+ CERROR("Can't setup rdma for GET from %s: %d\n",
+ libcfs_nidstr(&target->nid), rc);
+ goto failed_1;
+ }
if (nob == 0) {
/* No RDMA: local completion may happen now! */
/* '1' for consistency with code that checks !mpflag to restore */
unsigned int mpflag = 1;
int type = lntmsg->msg_type;
- struct lnet_processid target;
+ struct lnet_processid *target = &lntmsg->msg_target;
unsigned int payload_niov = lntmsg->msg_niov;
struct bio_vec *payload_kiov = lntmsg->msg_kiov;
unsigned int payload_offset = lntmsg->msg_offset;
/* NB 'private' is different depending on what we're sending.
* Just ignore it...
*/
- target.pid = lntmsg->msg_target.pid;
- lnet_nid4_to_nid(lntmsg->msg_target.nid, &target.nid);
CDEBUG(D_NET, "sending %u bytes in %d frags to %s\n",
- payload_nob, payload_niov, libcfs_idstr(&target));
+ payload_nob, payload_niov, libcfs_idstr(target));
LASSERT (payload_nob == 0 || payload_niov > 0);
LASSERT (payload_niov <= LNET_MAX_IOV);
tx->tx_msg.ksm_zc_cookies[1] = 0;
/* The first fragment will be set later in pro_pack */
- rc = ksocknal_launch_packet(ni, tx, &target);
+ rc = ksocknal_launch_packet(ni, tx, target);
/*
* We can't test lntsmg->msg_vmflush again as lntmsg may
* have been freed.
unsigned int offset, unsigned int len)
{
msg->msg_type = type;
- msg->msg_target = target;
+ msg->msg_target.pid = target.pid;
+ lnet_nid4_to_nid(target.nid, &msg->msg_target.nid);
msg->msg_len = len;
msg->msg_offset = offset;
CERROR("recv from %s / send to %s aborted: "
"eager_recv failed %d\n",
libcfs_nidstr(&msg->msg_rxpeer->lpni_nid),
- libcfs_id2str(msg->msg_target), rc);
+ libcfs_idstr(&msg->msg_target), rc);
LASSERT(rc < 0); /* required by my callers */
}
LNET_STATS_TYPE_DROP);
CNETERR("Dropping message for %s: peer not alive\n",
- libcfs_id2str(msg->msg_target));
+ libcfs_idstr(&msg->msg_target));
msg->msg_health_status = LNET_MSG_STATUS_REMOTE_DROPPED;
if (do_send)
lnet_finalize(msg, -EHOSTUNREACH);
CNETERR("Aborting message for %s: LNetM[DE]Unlink() already "
"called on the MD/ME.\n",
- libcfs_id2str(msg->msg_target));
+ libcfs_idstr(&msg->msg_target));
if (do_send) {
msg->msg_no_resend = true;
CDEBUG(D_NET, "msg %p to %s canceled and will not be resent\n",
- msg, libcfs_id2str(msg->msg_target));
+ msg, libcfs_idstr(&msg->msg_target));
lnet_finalize(msg, -ECANCELED);
}
if (!msg->msg_routing)
msg->msg_hdr.src_nid =
cpu_to_le64(lnet_nid_to_nid4(&the_lnet.ln_loni->ni_nid));
- msg->msg_target.nid = lnet_nid_to_nid4(&the_lnet.ln_loni->ni_nid);
+ msg->msg_target.nid = the_lnet.ln_loni->ni_nid;
lnet_msg_commit(msg, cpt);
msg->msg_txni = the_lnet.ln_loni;
* what was originally set in the target or it will be the NID of
* a router if this message should be routed
*/
- /* FIXME handle large-addr nids */
- msg->msg_target.nid = lnet_nid_to_nid4(&msg->msg_txpeer->lpni_nid);
+ msg->msg_target.nid = msg->msg_txpeer->lpni_nid;
/*
* lnet_msg_commit assigns the correct cpt to the message, which
* continuing the same sequence of messages. Similarly, rtr_nid will
* affect our choice of next hop.
*/
- msg->msg_src_nid_param = src_nid;
- msg->msg_rtr_nid_param = rtr_nid;
+ lnet_nid4_to_nid(src_nid, &msg->msg_src_nid_param);
+ lnet_nid4_to_nid(rtr_nid, &msg->msg_rtr_nid_param);
/*
* If necessary, perform discovery on the peer that owns this peer_ni.
int
lnet_send(lnet_nid_t src_nid, struct lnet_msg *msg, lnet_nid_t rtr_nid)
{
- lnet_nid_t dst_nid = msg->msg_target.nid;
- int rc;
+ lnet_nid_t dst_nid = lnet_nid_to_nid4(&msg->msg_target.nid);
+ int rc;
/*
* NB: rtr_nid is set to LNET_NID_ANY for all current use-cases,
lnet_net_unlock(cpt);
CDEBUG(D_NET, "resending %s->%s: %s recovery %d try# %d\n",
- libcfs_nid2str(msg->msg_src_nid_param),
- libcfs_id2str(msg->msg_target),
+ libcfs_nidstr(&msg->msg_src_nid_param),
+ libcfs_idstr(&msg->msg_target),
lnet_msgtyp2str(msg->msg_type),
msg->msg_recovery,
msg->msg_retry_count);
- rc = lnet_send(msg->msg_src_nid_param, msg,
- msg->msg_rtr_nid_param);
+ rc = lnet_send(lnet_nid_to_nid4(&msg->msg_src_nid_param),
+ msg,
+ lnet_nid_to_nid4(&msg->msg_rtr_nid_param));
if (rc) {
CERROR("Error sending %s to %s: %d\n",
lnet_msgtyp2str(msg->msg_type),
- libcfs_id2str(msg->msg_target), rc);
+ libcfs_idstr(&msg->msg_target), rc);
msg->msg_no_resend = true;
lnet_finalize(msg, rc);
}
hdr->msg.put.offset = le32_to_cpu(hdr->msg.put.offset);
/* Primary peer NID. */
- lnet_nid4_to_nid(msg->msg_initiator, &info.mi_id.nid);
+ info.mi_id.nid = msg->msg_initiator;
info.mi_id.pid = hdr->src_pid;
info.mi_opc = LNET_MD_OP_PUT;
info.mi_portal = hdr->msg.put.ptl_index;
info.mi_rlength = hdr->payload_length;
info.mi_roffset = hdr->msg.put.offset;
info.mi_mbits = hdr->msg.put.match_bits;
- info.mi_cpt = lnet_cpt_of_nid(msg->msg_initiator, ni);
+ info.mi_cpt = lnet_nid2cpt(&msg->msg_initiator, ni);
msg->msg_rx_ready_delay = ni->ni_net->net_lnd->lnd_eager_recv == NULL;
ready_delay = msg->msg_rx_ready_delay;
source_id.nid = hdr->src_nid;
source_id.pid = hdr->src_pid;
/* Primary peer NID */
- lnet_nid4_to_nid(msg->msg_initiator, &info.mi_id.nid);
+ info.mi_id.nid = msg->msg_initiator;
info.mi_id.pid = hdr->src_pid;
info.mi_opc = LNET_MD_OP_GET;
info.mi_portal = hdr->msg.get.ptl_index;
info.mi_rlength = hdr->msg.get.sink_length;
info.mi_roffset = hdr->msg.get.src_offset;
info.mi_mbits = hdr->msg.get.match_bits;
- info.mi_cpt = lnet_cpt_of_nid(msg->msg_initiator, ni);
+ info.mi_cpt = lnet_nid2cpt(&msg->msg_initiator, ni);
rc = lnet_ptl_match_md(&info, msg);
if (rc == LNET_MATCHMD_DROP) {
msg->msg_receiving = 0;
/* FIXME need to handle large-addr nid */
- rc = lnet_send(lnet_nid_to_nid4(&ni->ni_nid), msg, msg->msg_from);
+ rc = lnet_send(lnet_nid_to_nid4(&ni->ni_nid), msg,
+ lnet_nid_to_nid4(&msg->msg_from));
if (rc < 0) {
/* didn't get as far as lnet_ni_send() */
CERROR("%s: Unable to send REPLY for GET from %s: %d\n",
msg->msg_offset = 0;
msg->msg_hdr = *hdr;
/* for building message event */
- msg->msg_from = from_nid4;
+ msg->msg_from = from_nid;
if (!for_me) {
msg->msg_target.pid = dest_pid;
- msg->msg_target.nid = dest_nid;
+ lnet_nid4_to_nid(dest_nid, &msg->msg_target.nid);
msg->msg_routing = 1;
} else {
msg->msg_rxni = ni;
lnet_ni_addref_locked(ni, cpt);
/* Multi-Rail: Primary NID of source. */
- msg->msg_initiator = lnet_peer_primary_nid_locked(src_nid);
+ lnet_peer_primary_nid_locked(src_nid, &msg->msg_initiator);
/*
* mark the status of this lpni as UP since we received a message
{
struct lnet_msg *msg = lnet_msg_alloc();
struct lnet_libmd *getmd = getmsg->msg_md;
- struct lnet_process_id peer_id = getmsg->msg_target;
+ struct lnet_processid *peer_id = &getmsg->msg_target;
int cpt;
LASSERT(!getmsg->msg_target_is_router);
if (msg == NULL) {
CERROR("%s: Dropping REPLY from %s: can't allocate msg\n",
- libcfs_nidstr(&ni->ni_nid), libcfs_id2str(peer_id));
+ libcfs_nidstr(&ni->ni_nid), libcfs_idstr(peer_id));
goto drop;
}
if (getmd->md_threshold == 0) {
CERROR("%s: Dropping REPLY from %s for inactive MD %p\n",
- libcfs_nidstr(&ni->ni_nid), libcfs_id2str(peer_id),
+ libcfs_nidstr(&ni->ni_nid), libcfs_idstr(peer_id),
getmd);
lnet_res_unlock(cpt);
goto drop;
LASSERT(getmd->md_offset == 0);
CDEBUG(D_NET, "%s: Reply from %s md %p\n",
- libcfs_nidstr(&ni->ni_nid), libcfs_id2str(peer_id), getmd);
+ libcfs_nidstr(&ni->ni_nid), libcfs_idstr(peer_id), getmd);
/* setup information for lnet_build_msg_event */
msg->msg_initiator =
- lnet_nid_to_nid4(&getmsg->msg_txpeer->lpni_peer_net->lpn_peer->lp_primary_nid);
- msg->msg_from = peer_id.nid;
+ 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_hdr.src_nid = lnet_nid_to_nid4(&peer_id->nid);
msg->msg_hdr.payload_length = getmd->md_length;
msg->msg_receiving = 1; /* required by lnet_msg_attach_md */
lnet_msg_attach_md(msg, getmd, getmd->md_offset, getmd->md_length);
lnet_res_unlock(cpt);
- cpt = lnet_cpt_of_nid(peer_id.nid, ni);
+ cpt = lnet_nid2cpt(&peer_id->nid, ni);
lnet_net_lock(cpt);
lnet_msg_commit(msg, cpt);
return msg;
drop:
- cpt = lnet_cpt_of_nid(peer_id.nid, ni);
+ cpt = lnet_nid2cpt(&peer_id->nid, ni);
lnet_net_lock(cpt);
lnet_incr_stats(&ni->ni_stats, LNET_MSG_GET, LNET_STATS_TYPE_DROP);
ev->target.nid = hdr->dest_nid;
ev->initiator.pid = hdr->src_pid;
/* Multi-Rail: resolve src_nid to "primary" peer NID */
- ev->initiator.nid = msg->msg_initiator;
+ ev->initiator.nid = lnet_nid_to_nid4(&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 = msg->msg_from;
+ ev->sender = lnet_nid_to_nid4(&msg->msg_from);
ev->mlength = msg->msg_wanted;
ev->offset = msg->msg_offset;
}
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);
- rc = lnet_send(msg->msg_ev.target.nid, msg, msg->msg_from);
+ rc = lnet_send(msg->msg_ev.target.nid, msg,
+ lnet_nid_to_nid4(&msg->msg_from));
lnet_net_lock(cpt);
/*
* this message consumed. The message will
* consume another credit when it gets resent.
*/
- msg->msg_target.nid = msg->msg_hdr.dest_nid;
+ lnet_nid4_to_nid(msg->msg_hdr.dest_nid, &msg->msg_target.nid);
lnet_msg_decommit_tx(msg, -EAGAIN);
msg->msg_sending = 0;
msg->msg_receiving = 0;
/* don't resend recovery messages */
if (msg->msg_recovery) {
CDEBUG(D_NET, "msg %s->%s is a recovery ping. retry# %d\n",
- libcfs_nid2str(msg->msg_from),
- libcfs_nid2str(msg->msg_target.nid),
+ libcfs_nidstr(&msg->msg_from),
+ libcfs_nidstr(&msg->msg_target.nid),
msg->msg_retry_count);
return -ENOTRECOVERABLE;
}
*/
if (msg->msg_no_resend) {
CDEBUG(D_NET, "msg %s->%s requested no resend. retry# %d\n",
- libcfs_nid2str(msg->msg_from),
- libcfs_nid2str(msg->msg_target.nid),
+ libcfs_nidstr(&msg->msg_from),
+ libcfs_nidstr(&msg->msg_target.nid),
msg->msg_retry_count);
return -ENOTRECOVERABLE;
}
/* check if the message has exceeded the number of retries */
if (msg->msg_retry_count >= lnet_retry_count) {
CNETERR("msg %s->%s exceeded retry count %d\n",
- libcfs_nid2str(msg->msg_from),
- libcfs_nid2str(msg->msg_target.nid),
+ libcfs_nidstr(&msg->msg_from),
+ libcfs_nidstr(&msg->msg_target.nid),
msg->msg_retry_count);
return -ENOTRECOVERABLE;
}
hdr = &msg->msg_hdr;
/* Multi-Rail: Primary peer NID */
- lnet_nid4_to_nid(msg->msg_initiator, &info.mi_id.nid);
+ info.mi_id.nid = msg->msg_initiator;
info.mi_id.pid = hdr->src_pid;
info.mi_opc = LNET_MD_OP_PUT;
info.mi_portal = hdr->msg.put.ptl_index;
}
}
-lnet_nid_t
-lnet_peer_primary_nid_locked(lnet_nid_t nid)
+void
+lnet_peer_primary_nid_locked(lnet_nid_t nid, struct lnet_nid *result)
{
/* FIXME handle large-addr nid */
struct lnet_peer_ni *lpni;
- lnet_nid_t primary_nid = nid;
+ lnet_nid4_to_nid(nid, result);
lpni = lnet_find_peer_ni_locked(nid);
if (lpni) {
- primary_nid = lnet_nid_to_nid4(
- &lpni->lpni_peer_net->lpn_peer->lp_primary_nid);
+ *result = lpni->lpni_peer_net->lpn_peer->lp_primary_nid;
lnet_peer_ni_decref_locked(lpni);
}
-
- return primary_nid;
}
bool
CDEBUG(D_NET, "sending pending message %s to target %s\n",
lnet_msgtyp2str(msg->msg_type),
- libcfs_id2str(msg->msg_target));
- rc = lnet_send(msg->msg_src_nid_param, msg,
- msg->msg_rtr_nid_param);
+ libcfs_idstr(&msg->msg_target));
+ rc = lnet_send(lnet_nid_to_nid4(&msg->msg_src_nid_param), msg,
+ lnet_nid_to_nid4(&msg->msg_rtr_nid_param));
if (rc < 0) {
CNETERR("Error sending %s to %s: %d\n",
lnet_msgtyp2str(msg->msg_type),
- libcfs_id2str(msg->msg_target), rc);
+ libcfs_idstr(&msg->msg_target), rc);
lnet_finalize(msg, rc);
}
}
list_for_each_entry_safe(msg, tmp, &resend, msg_list) {
list_del_init(&msg->msg_list);
- rc = lnet_send(msg->msg_src_nid_param, msg,
- msg->msg_rtr_nid_param);
+ rc = lnet_send(lnet_nid_to_nid4(&msg->msg_src_nid_param), msg,
+ lnet_nid_to_nid4(&msg->msg_rtr_nid_param));
if (rc < 0) {
CNETERR("Error sending %s to %s: %d\n",
lnet_msgtyp2str(msg->msg_type),
- libcfs_id2str(msg->msg_target), rc);
+ libcfs_idstr(&msg->msg_target), rc);
lnet_finalize(msg, rc);
}
}