op == PTL_MD_OP_GET ? TX_TYPE_LARGE_PUT_RESPONSE :
TX_TYPE_LARGE_GET_RESPONSE);
if(tx == NULL){
- CERROR ("Can't start bulk rdma %d to "FMT_NID": tx descs exhausted\n",
- op, rx->rx_initiator.nid);
+ CERROR ("Can't start bulk rdma %d to " FMT_NID ": tx descs exhausted\n",
+ op,rx->rx_initiator.nid);
return -ENOMEM;
}
kptllnd_init_msg (tx->tx_msg,
PTLLND_MSG_TYPE_PUT,
sizeof(kptl_request_msg_t));
- kptllnd_tx_launch(tx, lntmsg->msg_target.nid,lntmsg);
+ kptllnd_tx_launch(tx, lntmsg->msg_target, lntmsg);
}
int
*/
tx = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_LARGE_PUT);
if(tx == NULL){
- CERROR ("Can't send %d to "LPX64": tx descs exhausted\n",
- type, target.nid);
+ CERROR ("Can't send %d to %s: tx descs exhausted\n",
+ type, libcfs_id2str(target));
return -ENOMEM;
}
*/
tx = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_LARGE_GET);
if(tx == NULL){
- CERROR ("Can't send %d to "LPX64": tx descs exhausted\n",
- type, target.nid);
+ CERROR ("Can't send %d to %s: tx descs exhausted\n",
+ type, libcfs_id2str(target));
return -ENOMEM;
}
*/
tx = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_LARGE_PUT);
if(tx == NULL){
- CERROR ("Can't send %d to "LPX64": tx descs exhausted\n",
- type, target.nid);
+ CERROR ("Can't send %d to %s: tx descs exhausted\n",
+ type, libcfs_id2str(target));
return -ENOMEM;
}
/* RDMA not expected */
nob = offsetof(kptl_msg_t, ptlm_u.immediate.kptlim_payload[payload_nob]);
if (nob > *kptllnd_tunables.kptl_max_msg_size) {
- CERROR("REPLY for "LPX64" too big but RDMA not requested:"
+ CERROR("REPLY for %s too big but RDMA not requested:"
"%d (max for message is %d)\n",
- target.nid, payload_nob,
+ libcfs_id2str(target), payload_nob,
*kptllnd_tunables.kptl_max_msg_size);
- CERROR("Can't REPLY IMMEDIATE %d to "LPX64"\n",
- nob, target.nid);
+ CERROR("Can't REPLY IMMEDIATE %d to %s\n",
+ nob, libcfs_id2str(target));
return -EINVAL;
}
break;
/* Incoming message consistent with RDMA? */
if (rx->rx_msg->ptlm_type != PTLLND_MSG_TYPE_GET) {
- CERROR("REPLY to "LPX64" bad msg type %x!!!\n",
- target.nid, rx->rx_msg->ptlm_type);
+ CERROR("REPLY to %s bad msg type %x!!!\n",
+ libcfs_id2str(target), rx->rx_msg->ptlm_type);
return -EINVAL;
}
*/
tx = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_SMALL_MESSAGE);
if(tx == NULL){
- CERROR ("Can't send %d to "LPX64": tx descs exhausted\n",
- type, target.nid);
+ CERROR ("Can't send %d to %s: tx descs exhausted\n",
+ type, libcfs_id2str(target));
return -ENOMEM;
}
}else{
launch:
- kptllnd_tx_launch(tx, target.nid,lntmsg);
+ kptllnd_tx_launch(tx, target, lntmsg);
PJK_UT_MSG_DATA("<<< SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n");
return 0;
}
kptl_peer_t *
kptllnd_peer_find_holding_list_lock (
kptl_data_t *kptllnd_data,
- lnet_nid_t nid);
+ lnet_process_id_t target);
int
kptllnd_peer_allocate (
kptl_data_t *kptllnd_data,
kptl_peer_t **peerp,
- lnet_nid_t nid,
- int pid)
+ lnet_process_id_t target)
{
kptl_peer_t *peer;
int rc;
- PJK_UT_MSG(">>> nid="LPX64" pid=%d\n",nid,pid);
+ PJK_UT_MSG(">>> id=%s\n",libcfs_id2str(target));
- LASSERT (nid != PTL_NID_ANY);
+ LASSERT (target.nid != PTL_NID_ANY);
LIBCFS_ALLOC(peer, sizeof (*peer));
if (peer == NULL) {
peer->peer_state = PEER_STATE_ALLOCATED;
peer->peer_kptllnd_data = kptllnd_data;
- peer->peer_nid = nid;
- peer->peer_pid = pid;
+ peer->peer_nid = target.nid;
+ peer->peer_pid = target.pid;
//peer->peer_incarnation = 0;
//peer->peer_tx_seqnum = 0;
*/
atomic_set (&peer->peer_refcount, 1);
- PJK_UT_MSG("<<< Peer=%p nid="LPX64"\n",peer,nid);
+ PJK_UT_MSG("<<< Peer=%p id=%s\n",peer,libcfs_id2str(target));
*peerp = peer;
return 0;
}
PJK_UT_MSG_DATA("Seq # = "LPX64"\n",tx->tx_msg->ptlm_seq);
PJK_UT_MSG("lnet TX nid=" LPX64 " pid=%d\n",peer->peer_nid,peer->peer_pid);
- PJK_UT_MSG("ptl TX nid=" LPX64 " pid=%d\n",target.nid,target.pid);
+ PJK_UT_MSG("ptl TX nid=" FMT_NID " pid=%d\n",target.nid,target.pid);
if(tx->tx_msg->ptlm_type == PTLLND_MSG_TYPE_GET ||
tx->tx_msg->ptlm_type == PTLLND_MSG_TYPE_PUT){
if(time_after_eq(jiffies,tx->tx_deadline)){
PJK_UT_MSG("Peer=%p PENDING tx=%p time=%lu sec\n",
peer,tx,(jiffies - tx->tx_deadline)/HZ);
- rc = 0;
+ rc = 1;
}
}
if(time_after_eq(jiffies,tx->tx_deadline)){
PJK_UT_MSG("Peer=%p ACTIVE tx=%p time=%lu sec\n",
peer,tx,(jiffies - tx->tx_deadline)/HZ);
- rc = 0;
+ rc = 1;
}
}
kptl_peer_t *
kptllnd_peer_find (
kptl_data_t *kptllnd_data,
- lnet_nid_t nid)
+ lnet_process_id_t target)
{
kptl_peer_t *peer;
unsigned long flags;
read_lock_irqsave(&kptllnd_data->kptl_peer_rw_lock, flags);
- peer = kptllnd_peer_find_holding_list_lock(kptllnd_data,nid);
+ peer = kptllnd_peer_find_holding_list_lock(kptllnd_data,target);
read_unlock_irqrestore(&kptllnd_data->kptl_peer_rw_lock, flags);
return peer;
}
kptl_peer_t *
kptllnd_peer_find_holding_list_lock (
kptl_data_t *kptllnd_data,
- lnet_nid_t nid)
+ lnet_process_id_t target)
{
- struct list_head *peer_list = kptllnd_nid2peerlist (kptllnd_data,nid);
+ struct list_head *peer_list = kptllnd_nid2peerlist (kptllnd_data,target.nid);
struct list_head *tmp;
kptl_peer_t *peer;
- PJK_UT_MSG(">>> nid="LPX64"\n",nid);
+ PJK_UT_MSG(">>> id=%s\n",libcfs_id2str(target));
list_for_each (tmp, peer_list) {
peer = list_entry (tmp, kptl_peer_t, peer_list);
LASSERT(peer->peer_state != PEER_STATE_CANCELED);
-
- if (peer->peer_nid != nid)
+
+ PJK_UT_MSG("NID: peer="LPX64" target="LPX64"\n",
+ peer->peer_nid,target.nid);
+ PJK_UT_MSG("PID: peer=%d target=%d\n",
+ peer->peer_pid,target.pid);
+
+ if (! (peer->peer_nid == target.nid &&
+ peer->peer_pid == target.pid))
continue;
- CDEBUG(D_NET, "got peer [%p] -> "LPX64" (%d)\n",
- peer, nid, atomic_read (&peer->peer_refcount));
+ CDEBUG(D_NET, "got peer [%p] -> %s (%d)\n",
+ peer, libcfs_id2str(target), atomic_read (&peer->peer_refcount));
kptllnd_peer_addref(peer,"find");
PJK_UT_MSG("<<< Peer=%p\n",peer);
kptl_peer_t *
kptllnd_peer_handle_hello (
kptl_data_t *kptllnd_data,
- lnet_nid_t nid,
- int pid,
+ lnet_process_id_t initiator,
kptl_msg_t *msg)
{
kptl_peer_t *peer = NULL;
*/
tx_hello = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_SMALL_MESSAGE);
if( tx_hello == NULL) {
- CERROR("Unable to allocate connect message for "LPX64"\n",nid);
+ CERROR("Unable to allocate connect message for %s\n",libcfs_id2str(initiator));
return 0;
}
* however we want to avoid doing this while holidng
* the peer_rw_lock and be forced into atomic context
*/
- rc = kptllnd_peer_allocate ( kptllnd_data, &peer_allocated, nid, pid);
+ rc = kptllnd_peer_allocate ( kptllnd_data, &peer_allocated, initiator);
if(rc != 0){
kptllnd_tx_decref(tx_hello);
- CERROR("Failed to create peer (nid="LPX64")\n",nid);
+ CERROR("Failed to create peer (id=%s)\n",libcfs_id2str(initiator));
return 0;
}
/*
* Look for peer because it could have been previously here
*/
- peer = kptllnd_peer_find_holding_list_lock(kptllnd_data,nid);
+ peer = kptllnd_peer_find_holding_list_lock(kptllnd_data,initiator);
/*
* If peer is already here
peer = NULL;
}else{
- CERROR("Receiving HELLO message on already connected peer " LPX64"\n",nid);
+ CERROR("Receiving HELLO message on already connected peer %s\n",
+ libcfs_id2str(initiator));
}
}
*/
rc = kptllnd_peer_add_to_list_locked ( kptllnd_data, peer_allocated);
if(rc != 0){
- CERROR("Failed to create peer (nid="LPX64")\n",nid);
+ CERROR("Failed to create peer (id=%s)\n",
+ libcfs_id2str(initiator));
goto failed;
}
void
kptllnd_tx_launch (
kptl_tx_t *tx,
- lnet_nid_t target_nid,
+ lnet_process_id_t target,
lnet_msg_t *ptlmsg )
{
kptl_data_t *kptllnd_data = tx->tx_po.po_kptllnd_data;
/* If I get here, I've committed to send, so I complete the tx with
* failure on any problems */
- PJK_UT_MSG(">>> TX=%p nid="LPX64"\n",tx,target_nid);
+ PJK_UT_MSG(">>> TX=%p target=%s\n",tx,libcfs_id2str(target));
LASSERT (tx->tx_ptlmsg == NULL);
tx->tx_ptlmsg = ptlmsg; /* finalize ptlmsg on completion */
* First try to find the peer (this will grab the
* read lock
*/
- peer = kptllnd_peer_find (kptllnd_data,target_nid);
+ peer = kptllnd_peer_find (kptllnd_data,target);
/*
* If we find the peer
*/
tx_hello = kptllnd_get_idle_tx(kptllnd_data,TX_TYPE_SMALL_MESSAGE);
if( tx_hello == NULL) {
- CERROR("Unable to allocate connect message for "LPX64"\n",target_nid);
+ CERROR("Unable to allocate connect message for %s\n",libcfs_id2str(target));
kptllnd_tx_decref (tx);
return;
}
* Allocate a new peer
* (it's not active until its on the list)
*/
- PJK_UT_MSG("TX %p creating NEW PEER nid="LPX64"\n",tx,target_nid);
- rc = kptllnd_peer_allocate ( kptllnd_data, &peer_allocated, target_nid, PTLLND_PID);
+ PJK_UT_MSG("TX %p creating NEW PEER %s\n",tx,libcfs_id2str(target));
+ rc = kptllnd_peer_allocate ( kptllnd_data, &peer_allocated, target);
if(rc != 0){
- CERROR("Failed to create peer (nid="LPX64")\n",target_nid);
+ CERROR("Failed to create peer %s\n",libcfs_id2str(target));
kptllnd_tx_decref (tx);
kptllnd_tx_decref (tx_hello);
return;
*/
write_lock_irqsave(g_lock, flags);
- peer = kptllnd_peer_find_holding_list_lock (kptllnd_data,target_nid);
+ peer = kptllnd_peer_find_holding_list_lock (kptllnd_data,target);
/*
* If we find the peer
if (peer != NULL) {
write_unlock_irqrestore(g_lock, flags);
- CDEBUG(D_TRACE,"HELLO message race occurred (nid="LPX64")\n",target_nid);
+ CDEBUG(D_TRACE,"HELLO message race occurred for %s\n",libcfs_id2str(target));
spin_lock_irqsave(&peer->peer_lock, flags);
kptllnd_peer_queue_tx_locked ( peer, tx );
if(rc != 0){
write_unlock_irqrestore(g_lock, flags);
- CERROR("Failed to add peer to list (nid="LPX64")\n",target_nid);
+ CERROR("Failed to add peer to list for %s\n",libcfs_id2str(target));
/* Drop these TXs tx*/
kptllnd_tx_decref (tx);
STAT_UPDATE(kps_rx_unlink_event);
if(!rxbp->rxbp_shutdown){
- PJK_UT_MSG("RXB Callback %s(%d) rxb=%p nid="FMT_NID" unlink=%d\n",
+ PJK_UT_MSG("RXB Callback %s(%d) rxb=%p id="FMT_NID" unlink=%d\n",
get_ev_type_string(ev->type),ev->type,
rxb,ev->initiator.nid,unlinked);
}
kptl_peer_t *peer = NULL;
int returned_credits = 0;
int type = msg->ptlm_type;
- lnet_nid_t lnet_initiator_nid = ptl2lnetnid(kptllnd_data,rx->rx_initiator.nid);
+ lnet_process_id_t lnet_initiator;
unsigned long flags;
PJK_UT_MSG_DATA("rx=%p nob=%d\n",rx,rx->rx_nob);
/*
+ * Setup the intiator for LNET
+ */
+ lnet_initiator.nid = ptl2lnetnid(kptllnd_data,rx->rx_initiator.nid);
+ lnet_initiator.pid = rx->rx_initiator.pid;
+
+ /*
* If the nob==0 then silently discard this message
*/
if(rx->rx_nob == 0)
PJK_UT_MSG_DATA("Msg NOB = %d\n",msg->ptlm_nob);
PJK_UT_MSG_DATA("Credits back from peer=%d\n",msg->ptlm_credits);
PJK_UT_MSG_DATA("Seq # ="LPX64"\n",msg->ptlm_seq);
- PJK_UT_MSG_DATA("lnet RX nid=" LPX64 "\n",lnet_initiator_nid);
+ PJK_UT_MSG_DATA("lnet RX nid=" LPX64 "\n",lnet_initiator.nid);
PJK_UT_MSG("ptl RX nid=" FMT_NID " pid=%d\n",rx->rx_initiator.nid,rx->rx_initiator.pid);
if(type == PTLLND_MSG_TYPE_HELLO)
{
peer = kptllnd_peer_handle_hello(
kptllnd_data,
- lnet_initiator_nid,
- rx->rx_initiator.pid,
+ lnet_initiator,
msg);
if( peer == NULL){
- CERROR ("Failed to create peer for "LPX64"\n",
- lnet_initiator_nid);
+ CERROR ("Failed to create peer for %s\n",
+ libcfs_id2str(lnet_initiator));
goto exit;
}
}
else
{
- peer = kptllnd_peer_find(kptllnd_data,lnet_initiator_nid);
+ peer = kptllnd_peer_find(kptllnd_data,lnet_initiator);
if( peer == NULL){
- CERROR ("No connection with "LPX64"\n",
- lnet_initiator_nid);
+ CERROR ("No connection with %s\n",
+ libcfs_id2str(lnet_initiator));
goto exit;
}
*kptllnd_tunables.kptl_peercredits);
spin_unlock_irqrestore(&peer->peer_lock, flags);
- PJK_UT_MSG_ALWAYS("Peer=%p Credits=%d Outstanding=%d\n",
+ PJK_UT_MSG("Peer=%p Credits=%d Outstanding=%d\n",
peer,peer->peer_credits,peer->peer_outstanding_credits);
/* Have I received credits that will let me send? */