Whamcloud - gitweb
LU-15851 gnilnd: Remove invalid ASSERT from kgnilnd_send()
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd_cb.c
index 3ec2e55..fbcec23 100644 (file)
@@ -27,6 +27,9 @@
 #include <asm/page.h>
 #include <linux/nmi.h>
 #include <linux/pagemap.h>
+
+#include <libcfs/linux/linux-mem.h>
+
 #include "gnilnd.h"
 
 /* this is useful when needed to debug wire corruption. */
@@ -79,14 +82,20 @@ kgnilnd_schedule_device(kgn_device_t *dev)
         * has come around and set ready to zero */
        already_live = cmpxchg(&dev->gnd_ready, GNILND_DEV_IDLE, GNILND_DEV_IRQ);
 
-       if (!already_live) {
-               wake_up_all(&dev->gnd_waitq);
-       }
+       if (!already_live)
+               wake_up(&dev->gnd_waitq);
+}
+
+void kgnilnd_schedule_device_timer(cfs_timer_cb_arg_t data)
+{
+       kgn_device_t *dev = cfs_from_timer(dev, data, gnd_map_timer);
+
+       kgnilnd_schedule_device(dev);
 }
 
-void kgnilnd_schedule_device_timer(unsigned long arg)
+void kgnilnd_schedule_device_timer_rd(cfs_timer_cb_arg_t data)
 {
-       kgn_device_t *dev = (kgn_device_t *) arg;
+       kgn_device_t *dev = cfs_from_timer(dev, data, gnd_rdmaq_timer);
 
        kgnilnd_schedule_device(dev);
 }
@@ -250,7 +259,7 @@ kgnilnd_free_tx(kgn_tx_t *tx)
        if (tx->tx_phys != NULL) {
                kmem_cache_free(kgnilnd_data.kgn_tx_phys_cache, tx->tx_phys);
                CDEBUG(D_MALLOC, "slab-freed 'tx_phys': %lu at %p.\n",
-                      LNET_MAX_IOV * sizeof(gni_mem_segment_t), tx->tx_phys);
+                      GNILND_MAX_IOV * sizeof(gni_mem_segment_t), tx->tx_phys);
        }
 
        /* Only free the buffer if we used it */
@@ -274,7 +283,7 @@ kgnilnd_alloc_tx (void)
        if (CFS_FAIL_CHECK(CFS_FAIL_GNI_ALLOC_TX))
                return tx;
 
-       tx = kmem_cache_alloc(kgnilnd_data.kgn_tx_cache, GFP_ATOMIC);
+       tx = kmem_cache_zalloc(kgnilnd_data.kgn_tx_cache, GFP_ATOMIC);
        if (tx == NULL) {
                CERROR("failed to allocate tx\n");
                return NULL;
@@ -282,9 +291,6 @@ kgnilnd_alloc_tx (void)
        CDEBUG(D_MALLOC, "slab-alloced 'tx': %lu at %p.\n",
               sizeof(*tx), tx);
 
-       /* need this memset, cache alloc'd memory is not cleared */
-       memset(tx, 0, sizeof(*tx));
-
        /* setup everything here to minimize time under the lock */
        tx->tx_buftype = GNILND_BUF_NONE;
        tx->tx_msg.gnm_type = GNILND_MSG_NONE;
@@ -301,8 +307,8 @@ kgnilnd_alloc_tx (void)
 #define _kgnilnd_cksum(seed, ptr, nob)  csum_partial(ptr, nob, seed)
 
 /* we don't use offset as every one is passing a buffer reference that already
- * includes the offset into the base address -
- *  see kgnilnd_setup_virt_buffer and kgnilnd_setup_immediate_buffer */
+ * includes the offset into the base address.
+ */
 static inline __u16
 kgnilnd_cksum(void *ptr, size_t nob)
 {
@@ -511,9 +517,9 @@ kgnilnd_nak_rdma(kgn_conn_t *conn, int rx_type, int error, __u64 cookie, lnet_ni
        kgnilnd_queue_tx(conn, tx);
 }
 
-int
+static int
 kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
-                              struct kvec *iov, struct bio_vec *kiov,
+                              struct bio_vec *kiov,
                               unsigned int offset, unsigned int nob)
 {
        kgn_msg_t       *msg = &tx->tx_msg;
@@ -526,16 +532,11 @@ kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
 
        if (nob == 0) {
                tx->tx_buffer = NULL;
-       } else if (kiov != NULL) {
+       } else {
 
-               if ((niov > 0) && unlikely(niov > (nob/PAGE_SIZE))) {
-                       niov = round_up(nob + offset + kiov->bv_offset,
-                                       PAGE_SIZE);
-               }
-
-               LASSERTF(niov > 0 && niov < GNILND_MAX_IMMEDIATE/PAGE_SIZE,
-                       "bad niov %d msg %p kiov %p iov %p offset %d nob%d\n",
-                       niov, msg, kiov, iov, offset, nob);
+               if (niov && niov > (nob >> PAGE_SHIFT))
+                       niov = DIV_ROUND_UP(nob + offset + kiov->bv_offset,
+                                           PAGE_SIZE);
 
                while (offset >= kiov->bv_len) {
                        offset -= kiov->bv_len;
@@ -543,6 +544,11 @@ kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
                        kiov++;
                        LASSERT(niov > 0);
                }
+
+               LASSERTF(niov > 0 && niov < GNILND_MAX_IMMEDIATE/PAGE_SIZE,
+                       "bad niov %d msg %p kiov %p offset %d nob%d\n",
+                       niov, msg, kiov, offset, nob);
+
                for (i = 0; i < niov; i++) {
                        /* We can't have a bv_offset on anything but the first
                         * entry, otherwise we'll have a hole at the end of the
@@ -591,29 +597,6 @@ kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
                tx->tx_buftype = GNILND_BUF_IMMEDIATE_KIOV;
                tx->tx_nob = nob;
 
-       } else {
-               /* For now this is almost identical to kgnilnd_setup_virt_buffer, but we
-                * could "flatten" the payload into a single contiguous buffer ready
-                * for sending direct over an FMA if we ever needed to. */
-
-               LASSERT(niov > 0);
-
-               while (offset >= iov->iov_len) {
-                       offset -= iov->iov_len;
-                       niov--;
-                       iov++;
-                       LASSERT(niov > 0);
-               }
-
-               if (nob > iov->iov_len - offset) {
-                       CERROR("Can't handle multiple vaddr fragments\n");
-                       return -EMSGSIZE;
-               }
-
-               tx->tx_buffer = (void *)(((unsigned long)iov->iov_base) + offset);
-
-               tx->tx_buftype = GNILND_BUF_IMMEDIATE;
-               tx->tx_nob = nob;
        }
 
        /* checksum payload early - it shouldn't be changing after lnd_send */
@@ -634,34 +617,6 @@ kgnilnd_setup_immediate_buffer(kgn_tx_t *tx, unsigned int niov,
 }
 
 int
-kgnilnd_setup_virt_buffer(kgn_tx_t *tx,
-                         unsigned int niov, struct kvec *iov,
-                         unsigned int offset, unsigned int nob)
-
-{
-       LASSERT(nob > 0);
-       LASSERT(niov > 0);
-       LASSERT(tx->tx_buftype == GNILND_BUF_NONE);
-
-       while (offset >= iov->iov_len) {
-               offset -= iov->iov_len;
-               niov--;
-               iov++;
-               LASSERT(niov > 0);
-       }
-
-       if (nob > iov->iov_len - offset) {
-               CERROR("Can't handle multiple vaddr fragments\n");
-               return -EMSGSIZE;
-       }
-
-       tx->tx_buftype = GNILND_BUF_VIRT_UNMAPPED;
-       tx->tx_nob = nob;
-       tx->tx_buffer = (void *)(((unsigned long)iov->iov_base) + offset);
-       return 0;
-}
-
-int
 kgnilnd_setup_phys_buffer(kgn_tx_t *tx, int nkiov, struct bio_vec *kiov,
                          unsigned int offset, unsigned int nob)
 {
@@ -685,7 +640,7 @@ kgnilnd_setup_phys_buffer(kgn_tx_t *tx, int nkiov, struct bio_vec *kiov,
        }
 
        CDEBUG(D_MALLOC, "slab-alloced 'tx->tx_phys': %lu at %p.\n",
-              LNET_MAX_IOV * sizeof(gni_mem_segment_t), tx->tx_phys);
+              GNILND_MAX_IOV * sizeof(gni_mem_segment_t), tx->tx_phys);
 
        /* if loops changes, please change kgnilnd_cksum_kiov
         *   and kgnilnd_setup_immediate_buffer */
@@ -732,7 +687,7 @@ kgnilnd_setup_phys_buffer(kgn_tx_t *tx, int nkiov, struct bio_vec *kiov,
                        GOTO(error, rc);
                }
 
-               if ((phys - tx->tx_phys) == LNET_MAX_IOV) {
+               if ((phys - tx->tx_phys) == GNILND_MAX_IOV) {
                        CERROR ("payload too big (%d)\n", (int)(phys - tx->tx_phys));
                        rc = -EMSGSIZE;
                        GOTO(error, rc);
@@ -776,21 +731,10 @@ error:
 
 static inline int
 kgnilnd_setup_rdma_buffer(kgn_tx_t *tx, unsigned int niov,
-                         struct kvec *iov, struct bio_vec *kiov,
+                         struct bio_vec *kiov,
                          unsigned int offset, unsigned int nob)
 {
-       int     rc;
-
-       LASSERTF((iov == NULL) != (kiov == NULL), "iov 0x%p, kiov 0x%p, tx 0x%p,"
-                                               " offset %d, nob %d, niov %d\n"
-                                               , iov, kiov, tx, offset, nob, niov);
-
-       if (kiov != NULL) {
-               rc = kgnilnd_setup_phys_buffer(tx, niov, kiov, offset, nob);
-       } else {
-               rc = kgnilnd_setup_virt_buffer(tx, niov, iov, offset, nob);
-       }
-       return rc;
+       return kgnilnd_setup_phys_buffer(tx, niov, kiov, offset, nob);
 }
 
 /* kgnilnd_parse_lnet_rdma()
@@ -931,7 +875,7 @@ kgnilnd_verify_rdma_cksum(kgn_tx_t *tx, __u16 rx_cksum, int put_len)
                                kgnilnd_dump_blob(D_BUFFS, "RDMA payload",
                                                  tx->tx_buffer, nob);
                        }
-                       /* fall through to dump log */
+                       fallthrough;
                case 1:
                        libcfs_debug_dumplog();
                        break;
@@ -966,12 +910,6 @@ kgnilnd_mem_add_map_list(kgn_device_t *dev, kgn_tx_t *tx)
                dev->gnd_map_nphys++;
                dev->gnd_map_physnop += tx->tx_phys_npages;
                break;
-
-       case GNILND_BUF_VIRT_MAPPED:
-               bytes = tx->tx_nob;
-               dev->gnd_map_nvirt++;
-               dev->gnd_map_virtnob += tx->tx_nob;
-               break;
        }
 
        if (tx->tx_msg.gnm_type == GNILND_MSG_PUT_ACK ||
@@ -1015,21 +953,16 @@ kgnilnd_mem_del_map_list(kgn_device_t *dev, kgn_tx_t *tx)
                dev->gnd_map_nphys--;
                dev->gnd_map_physnop -= tx->tx_phys_npages;
                break;
-
-       case GNILND_BUF_VIRT_UNMAPPED:
-               bytes = tx->tx_nob;
-               dev->gnd_map_nvirt--;
-               dev->gnd_map_virtnob -= tx->tx_nob;
-               break;
        }
 
        if (tx->tx_msg.gnm_type == GNILND_MSG_PUT_ACK ||
            tx->tx_msg.gnm_type == GNILND_MSG_GET_REQ) {
                atomic64_sub(bytes, &dev->gnd_rdmaq_bytes_out);
                LASSERTF(atomic64_read(&dev->gnd_rdmaq_bytes_out) >= 0,
-                        "bytes_out negative! %ld\n", atomic64_read(&dev->gnd_rdmaq_bytes_out));
+                        "bytes_out negative! %lld\n",
+                        (s64)atomic64_read(&dev->gnd_rdmaq_bytes_out));
                GNIDBG_TX(D_NETTRACE, tx, "rdma -- %d to %lld",
-                         bytes, atomic64_read(&dev->gnd_rdmaq_bytes_out));
+                         bytes, (s64)atomic64_read(&dev->gnd_rdmaq_bytes_out));
        }
 
        atomic_dec(&dev->gnd_n_mdd);
@@ -1073,7 +1006,6 @@ kgnilnd_map_buffer(kgn_tx_t *tx)
        case GNILND_BUF_IMMEDIATE:
        case GNILND_BUF_IMMEDIATE_KIOV:
        case GNILND_BUF_PHYS_MAPPED:
-       case GNILND_BUF_VIRT_MAPPED:
                return 0;
 
        case GNILND_BUF_PHYS_UNMAPPED:
@@ -1086,41 +1018,16 @@ kgnilnd_map_buffer(kgn_tx_t *tx)
                 * - this needs to turn into a non-fatal error soon to allow
                 *  GART resource, etc starvation handling */
                if (rrc != GNI_RC_SUCCESS) {
-                       GNIDBG_TX(D_NET, tx, "Can't map %d pages: dev %d "
-                               "phys %u pp %u, virt %u nob %llu",
+                       GNIDBG_TX(D_NET, tx,
+                                 "Can't map %d pages: dev %d phys %u pp %u",
                                tx->tx_phys_npages, dev->gnd_id,
-                               dev->gnd_map_nphys, dev->gnd_map_physnop,
-                               dev->gnd_map_nvirt, dev->gnd_map_virtnob);
+                               dev->gnd_map_nphys, dev->gnd_map_physnop);
                        RETURN(rrc == GNI_RC_ERROR_RESOURCE ? -ENOMEM : -EINVAL);
                }
 
                tx->tx_buftype = GNILND_BUF_PHYS_MAPPED;
                kgnilnd_mem_add_map_list(dev, tx);
                return 0;
-
-       case GNILND_BUF_VIRT_UNMAPPED:
-               rrc = kgnilnd_mem_register(dev->gnd_handle,
-                       (__u64)tx->tx_buffer, tx->tx_nob,
-                       NULL, flags, &tx->tx_map_key);
-               if (rrc != GNI_RC_SUCCESS) {
-                       GNIDBG_TX(D_NET, tx, "Can't map %u bytes: dev %d "
-                               "phys %u pp %u, virt %u nob %llu",
-                               tx->tx_nob, dev->gnd_id,
-                               dev->gnd_map_nphys, dev->gnd_map_physnop,
-                               dev->gnd_map_nvirt, dev->gnd_map_virtnob);
-                       RETURN(rrc == GNI_RC_ERROR_RESOURCE ? -ENOMEM : -EINVAL);
-               }
-
-               tx->tx_buftype = GNILND_BUF_VIRT_MAPPED;
-               kgnilnd_mem_add_map_list(dev, tx);
-               if (tx->tx_msg.gnm_type == GNILND_MSG_PUT_ACK ||
-                   tx->tx_msg.gnm_type == GNILND_MSG_GET_REQ) {
-                       atomic64_add(tx->tx_nob, &dev->gnd_rdmaq_bytes_out);
-                       GNIDBG_TX(D_NETTRACE, tx, "rdma ++ %d to %ld\n",
-                              tx->tx_nob, atomic64_read(&dev->gnd_rdmaq_bytes_out));
-               }
-
-               return 0;
        }
 }
 
@@ -1164,8 +1071,6 @@ kgnilnd_unmap_buffer(kgn_tx_t *tx, int error)
        /* code below relies on +1 relationship ... */
        BUILD_BUG_ON(GNILND_BUF_PHYS_MAPPED !=
                     (GNILND_BUF_PHYS_UNMAPPED + 1));
-       BUILD_BUG_ON(GNILND_BUF_VIRT_MAPPED !=
-                    (GNILND_BUF_VIRT_UNMAPPED + 1));
 
        switch (tx->tx_buftype) {
        default:
@@ -1174,7 +1079,6 @@ kgnilnd_unmap_buffer(kgn_tx_t *tx, int error)
        case GNILND_BUF_NONE:
        case GNILND_BUF_IMMEDIATE:
        case GNILND_BUF_PHYS_UNMAPPED:
-       case GNILND_BUF_VIRT_UNMAPPED:
                break;
        case GNILND_BUF_IMMEDIATE_KIOV:
                if (tx->tx_phys != NULL) {
@@ -1188,7 +1092,6 @@ kgnilnd_unmap_buffer(kgn_tx_t *tx, int error)
                break;
 
        case GNILND_BUF_PHYS_MAPPED:
-       case GNILND_BUF_VIRT_MAPPED:
                LASSERT(tx->tx_conn != NULL);
 
                dev = tx->tx_conn->gnc_device;
@@ -1387,7 +1290,7 @@ kgnilnd_tx_log_retrans(kgn_conn_t *conn, kgn_tx_t *tx)
         * that we fill up our mailbox, we'll keep trying to resend that msg
         * until we exceed the max_retrans _or_ gnc_last_rx expires, indicating
         * that he hasn't send us any traffic in return */
-       
+
        /* some reasonable throttling of the debug message */
        if (log_retrans) {
                unsigned long now = jiffies;
@@ -1758,11 +1661,12 @@ kgnilnd_queue_tx(kgn_conn_t *conn, kgn_tx_t *tx)
                        /* it was sent, break out of switch to avoid default case of queueing */
                        break;
                }
-               /* needs to queue to try again, so fall through to default case */
+               /* needs to queue to try again, so... */
+               fallthrough;
        case GNILND_MSG_NOOP:
                /* Just make sure this goes out first for this conn */
                add_tail = 0;
-               /* fall through... */
+               fallthrough;
        default:
                spin_lock(&conn->gnc_list_lock);
                kgnilnd_tx_add_state_locked(tx, conn->gnc_peer, conn, GNILND_TX_FMAQ, add_tail);
@@ -1773,7 +1677,7 @@ 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)
+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;
@@ -1796,7 +1700,7 @@ kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target)
        /* 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 */
@@ -1820,7 +1724,7 @@ kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target)
 
        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. */
@@ -1833,7 +1737,8 @@ kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target)
        /* 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);
@@ -1844,7 +1749,8 @@ kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target)
 
        /* 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) {
@@ -2114,7 +2020,7 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
 {
        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;
@@ -2125,22 +2031,21 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
        kgn_net_t        *net = ni->ni_data;
        kgn_tx_t         *tx;
        int               rc = 0;
-       int               mpflag = 0;
+       /* '1' for consistency with code that checks !mpflag to restore */
+       unsigned int mpflag = 1;
        int               reverse_rdma_flag = *kgnilnd_tunables.kgn_reverse_rdma;
 
        /* NB 'private' is different depending on what we're sending.... */
        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);
-       LASSERTF(niov <= LNET_MAX_IOV,
-               "lntmsg %p niov %d\n", lntmsg, niov);
 
        if (msg_vmflush)
-               mpflag = cfs_memory_pressure_get_and_set();
+               mpflag = memalloc_noreclaim_save();
 
        switch (type) {
        default:
@@ -2170,16 +2075,18 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
                       break;
 
                if ((reverse_rdma_flag & GNILND_REVERSE_GET) == 0)
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_REQ, ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_REQ,
+                                               lnet_nid_to_nid4(&ni->ni_nid));
                else
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_REQ_REV, ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_REQ_REV,
+                                               lnet_nid_to_nid4(&ni->ni_nid));
 
                if (tx == NULL) {
                        rc = -ENOMEM;
                        goto out;
                }
                rc = kgnilnd_setup_rdma_buffer(tx, lntmsg->msg_md->md_niov,
-                                              NULL, lntmsg->msg_md->md_kiov,
+                                              lntmsg->msg_md->md_kiov,
                                               0, lntmsg->msg_md->md_length);
                if (rc != 0) {
                        CERROR("unable to setup buffer: %d\n", rc);
@@ -2191,7 +2098,7 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
                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;
@@ -2199,12 +2106,13 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
 
                tx->tx_lntmsg[0] = lntmsg;
                if ((reverse_rdma_flag & GNILND_REVERSE_GET) == 0)
-                       tx->tx_msg.gnm_u.get.gngm_hdr = *hdr;
+                       lnet_hdr_to_nid4(hdr, &tx->tx_msg.gnm_u.get.gngm_hdr);
                else
-                       tx->tx_msg.gnm_u.putreq.gnprm_hdr = *hdr;
+                       lnet_hdr_to_nid4(hdr,
+                                          &tx->tx_msg.gnm_u.putreq.gnprm_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:
@@ -2214,16 +2122,18 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
                       break;
 
                if ((reverse_rdma_flag & GNILND_REVERSE_PUT) == 0)
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_REQ, ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_REQ,
+                                               lnet_nid_to_nid4(&ni->ni_nid));
                else
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_REQ_REV, ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_REQ_REV,
+                                               lnet_nid_to_nid4(&ni->ni_nid));
 
                if (tx == NULL) {
                        rc = -ENOMEM;
                        goto out;
                }
 
-               rc = kgnilnd_setup_rdma_buffer(tx, niov, NULL,
+               rc = kgnilnd_setup_rdma_buffer(tx, niov,
                                               kiov, offset, nob);
                if (rc != 0) {
                        kgnilnd_tx_done(tx, rc);
@@ -2233,12 +2143,13 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
 
                tx->tx_lntmsg[0] = lntmsg;
                if ((reverse_rdma_flag & GNILND_REVERSE_PUT) == 0)
-                       tx->tx_msg.gnm_u.putreq.gnprm_hdr = *hdr;
+                       lnet_hdr_to_nid4(hdr,
+                                          &tx->tx_msg.gnm_u.putreq.gnprm_hdr);
                else
-                       tx->tx_msg.gnm_u.get.gngm_hdr = *hdr;
+                       lnet_hdr_to_nid4(hdr, &tx->tx_msg.gnm_u.get.gngm_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;
        }
 
@@ -2247,26 +2158,27 @@ kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
        LASSERTF(nob <= *kgnilnd_tunables.kgn_max_immediate,
                "lntmsg 0x%p too large %d\n", lntmsg, nob);
 
-       tx = kgnilnd_new_tx_msg(GNILND_MSG_IMMEDIATE, ni->ni_nid);
+       tx = kgnilnd_new_tx_msg(GNILND_MSG_IMMEDIATE,
+                               lnet_nid_to_nid4(&ni->ni_nid));
        if (tx == NULL) {
                rc = -ENOMEM;
                goto out;
        }
 
-       rc = kgnilnd_setup_immediate_buffer(tx, niov, NULL, kiov, offset, nob);
+       rc = kgnilnd_setup_immediate_buffer(tx, niov, kiov, offset, nob);
        if (rc != 0) {
                kgnilnd_tx_done(tx, rc);
                goto out;
        }
 
-       tx->tx_msg.gnm_u.immediate.gnim_hdr = *hdr;
+       lnet_hdr_to_nid4(hdr, &tx->tx_msg.gnm_u.immediate.gnim_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 */
        if (msg_vmflush)
-               cfs_memory_pressure_restore(mpflag);
+               memalloc_noreclaim_restore(mpflag);
        return rc;
 }
 
@@ -2298,7 +2210,7 @@ kgnilnd_setup_rdma(struct lnet_ni *ni, kgn_rx_t *rx, struct lnet_msg *lntmsg, in
                LBUG();
        }
 
-       tx = kgnilnd_new_tx_msg(done_type, ni->ni_nid);
+       tx = kgnilnd_new_tx_msg(done_type, lnet_nid_to_nid4(&ni->ni_nid));
        if (tx == NULL)
                goto failed_0;
 
@@ -2306,7 +2218,7 @@ kgnilnd_setup_rdma(struct lnet_ni *ni, kgn_rx_t *rx, struct lnet_msg *lntmsg, in
        if (rc != 0)
                goto failed_1;
 
-       rc = kgnilnd_setup_rdma_buffer(tx, niov, NULL, kiov, offset, nob);
+       rc = kgnilnd_setup_rdma_buffer(tx, niov, kiov, offset, nob);
        if (rc != 0)
                goto failed_1;
 
@@ -2325,7 +2237,8 @@ kgnilnd_setup_rdma(struct lnet_ni *ni, kgn_rx_t *rx, struct lnet_msg *lntmsg, in
 
  failed_1:
        kgnilnd_tx_done(tx, rc);
-       kgnilnd_nak_rdma(conn, done_type, rc, rxmsg->gnm_u.get.gngm_cookie, ni->ni_nid);
+       kgnilnd_nak_rdma(conn, done_type, rc, rxmsg->gnm_u.get.gngm_cookie,
+                        lnet_nid_to_nid4(&ni->ni_nid));
  failed_0:
        lnet_finalize(lntmsg, rc);
 }
@@ -2369,8 +2282,8 @@ kgnilnd_eager_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                CERROR("Couldnt find matching peer %p or conn %p / %p\n",
                        peer, conn, found_conn);
                if (found_conn) {
-                       CERROR("Unexpected connstamp %#llx(%#llx expected)"
-                               " from %s", rxmsg->gnm_connstamp,
+                       CERROR("Unexpected connstamp %#llx(%#llx expected) from %s\n",
+                               rxmsg->gnm_connstamp,
                                found_conn->gnc_peer_connstamp,
                                libcfs_nid2str(peer->gnp_nid));
                }
@@ -2497,7 +2410,7 @@ kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                                case 2:
                                        kgnilnd_dump_blob(D_BUFFS, "bad payload checksum",
                                                          &rxmsg[1], rxmsg->gnm_payload_len);
-                                       /* fall through to dump */
+                                       fallthrough;
                                case 1:
                                        libcfs_debug_dumplog();
                                        break;
@@ -2512,16 +2425,10 @@ kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                        }
                }
 
-               if (kiov != NULL)
-                       lnet_copy_flat2kiov(
-                               niov, kiov, offset,
-                               *kgnilnd_tunables.kgn_max_immediate,
-                               &rxmsg[1], 0, mlen);
-               else
-                       lnet_copy_flat2iov(
-                               niov, NULL, offset,
-                               *kgnilnd_tunables.kgn_max_immediate,
-                               &rxmsg[1], 0, mlen);
+               lnet_copy_flat2kiov(
+                       niov, kiov, offset,
+                       *kgnilnd_tunables.kgn_max_immediate,
+                       &rxmsg[1], 0, mlen);
 
                kgnilnd_consume_rx(rx);
                lnet_finalize(lntmsg, 0);
@@ -2536,13 +2443,14 @@ kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                        /* only error if lntmsg == NULL, otherwise we are just
                         * short circuiting the rdma process of 0 bytes */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       lntmsg == NULL ? -ENOENT : 0,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        lntmsg == NULL ? -ENOENT : 0,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                        RETURN(0);
                }
                /* sending ACK with sink buff. info */
-               tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_ACK, ni->ni_nid);
+               tx = kgnilnd_new_tx_msg(GNILND_MSG_PUT_ACK,
+                                       lnet_nid_to_nid4(&ni->ni_nid));
                if (tx == NULL) {
                        kgnilnd_consume_rx(rx);
                        RETURN(-ENOMEM);
@@ -2553,7 +2461,7 @@ kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                        GOTO(nak_put_req, rc);
                }
 
-               rc = kgnilnd_setup_rdma_buffer(tx, niov, NULL,
+               rc = kgnilnd_setup_rdma_buffer(tx, niov,
                                               kiov, offset, mlen);
                if (rc != 0) {
                        GOTO(nak_put_req, rc);
@@ -2581,7 +2489,9 @@ kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
 
 nak_put_req:
                /* make sure we send an error back when the PUT fails */
-               kgnilnd_nak_rdma(conn, rxmsg->gnm_type, rc, rxmsg->gnm_u.get.gngm_cookie, ni->ni_nid);
+               kgnilnd_nak_rdma(conn, rxmsg->gnm_type, rc,
+                                rxmsg->gnm_u.get.gngm_cookie,
+                                lnet_nid_to_nid4(&ni->ni_nid));
                kgnilnd_tx_done(tx, rc);
                kgnilnd_consume_rx(rx);
 
@@ -2596,15 +2506,16 @@ nak_put_req:
                        /* only error if lntmsg == NULL, otherwise we are just
                         * short circuiting the rdma process of 0 bytes */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       lntmsg == NULL ? -ENOENT : 0,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        lntmsg == NULL ? -ENOENT : 0,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                        RETURN(0);
                }
                /* lntmsg can be null when parsing a LNET_GET */
                if (lntmsg != NULL) {
                        /* sending ACK with sink buff. info */
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_ACK_REV, ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_GET_ACK_REV,
+                                               lnet_nid_to_nid4(&ni->ni_nid));
                        if (tx == NULL) {
                                kgnilnd_consume_rx(rx);
                                RETURN(-ENOMEM);
@@ -2614,13 +2525,11 @@ nak_put_req:
                        if (rc != 0)
                                GOTO(nak_get_req_rev, rc);
 
-
-                       rc = kgnilnd_setup_rdma_buffer(tx, niov, NULL,
+                       rc = kgnilnd_setup_rdma_buffer(tx, niov,
                                                       kiov, offset, mlen);
                        if (rc != 0)
                                GOTO(nak_get_req_rev, rc);
 
-
                        tx->tx_msg.gnm_u.putack.gnpam_src_cookie =
                                rxmsg->gnm_u.putreq.gnprm_cookie;
                        tx->tx_msg.gnm_u.putack.gnpam_dst_cookie = tx->tx_id.txe_cookie;
@@ -2640,9 +2549,9 @@ nak_put_req:
                } else {
                        /* No match */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       -ENOENT,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        -ENOENT,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                }
 
                kgnilnd_consume_rx(rx);
@@ -2650,7 +2559,9 @@ nak_put_req:
 
 nak_get_req_rev:
                /* make sure we send an error back when the GET fails */
-               kgnilnd_nak_rdma(conn, rxmsg->gnm_type, rc, rxmsg->gnm_u.get.gngm_cookie, ni->ni_nid);
+               kgnilnd_nak_rdma(conn, rxmsg->gnm_type, rc,
+                                rxmsg->gnm_u.get.gngm_cookie,
+                                lnet_nid_to_nid4(&ni->ni_nid));
                kgnilnd_tx_done(tx, rc);
                kgnilnd_consume_rx(rx);
 
@@ -2667,9 +2578,9 @@ nak_get_req_rev:
                        /* only error if lntmsg == NULL, otherwise we are just
                         * short circuiting the rdma process of 0 bytes */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       lntmsg == NULL ? -ENOENT : 0,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        lntmsg == NULL ? -ENOENT : 0,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                        RETURN(0);
                }
 
@@ -2679,9 +2590,9 @@ nak_get_req_rev:
                } else {
                        /* No match */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       -ENOENT,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        -ENOENT,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                }
                kgnilnd_consume_rx(rx);
                RETURN(0);
@@ -2692,9 +2603,9 @@ nak_get_req_rev:
                } else {
                        /* No match */
                        kgnilnd_nak_rdma(conn, rxmsg->gnm_type,
-                                       -ENOENT,
-                                       rxmsg->gnm_u.get.gngm_cookie,
-                                       ni->ni_nid);
+                                        -ENOENT,
+                                        rxmsg->gnm_u.get.gngm_cookie,
+                                        lnet_nid_to_nid4(&ni->ni_nid));
                }
                kgnilnd_consume_rx(rx);
                RETURN(0);
@@ -2770,7 +2681,8 @@ kgnilnd_check_conn_timeouts_locked(kgn_conn_t *conn)
                if (CFS_FAIL_CHECK(CFS_FAIL_GNI_NOOP_SEND))
                        return 0;
 
-               tx = kgnilnd_new_tx_msg(GNILND_MSG_NOOP, conn->gnc_peer->gnp_net->gnn_ni->ni_nid);
+               tx = kgnilnd_new_tx_msg(GNILND_MSG_NOOP,
+                                       lnet_nid_to_nid4(&conn->gnc_peer->gnp_net->gnn_ni->ni_nid));
                if (tx == NULL)
                        return 0;
                kgnilnd_queue_tx(conn, tx);
@@ -3019,7 +2931,7 @@ kgnilnd_update_reaper_timeout(long timeout)
 }
 
 static void
-kgnilnd_reaper_poke_with_stick(unsigned long arg)
+kgnilnd_reaper_poke_with_stick(cfs_timer_cb_arg_t arg)
 {
        wake_up(&kgnilnd_data.kgn_reaper_waitq);
 }
@@ -3062,8 +2974,8 @@ kgnilnd_reaper(void *arg)
                        prepare_to_wait(&kgnilnd_data.kgn_reaper_waitq, &wait,
                                        TASK_INTERRUPTIBLE);
                        spin_unlock(&kgnilnd_data.kgn_reaper_lock);
-                       setup_timer(&timer, kgnilnd_reaper_poke_with_stick,
-                                   next_check_time);
+                       cfs_timer_setup(&timer, kgnilnd_reaper_poke_with_stick,
+                                       next_check_time, 0);
                        mod_timer(&timer, (long) jiffies + timeout);
 
                        /* check flag variables before committing */
@@ -3778,7 +3690,8 @@ kgnilnd_process_fmaq(kgn_conn_t *conn)
                        if (CFS_FAIL_CHECK(CFS_FAIL_GNI_NOOP_SEND))
                                return;
 
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_NOOP, conn->gnc_peer->gnp_net->gnn_ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_NOOP,
+                                               lnet_nid_to_nid4(&conn->gnc_peer->gnp_net->gnn_ni->ni_nid));
                        if (tx != NULL) {
                                int     rc;
 
@@ -3840,7 +3753,7 @@ kgnilnd_process_fmaq(kgn_conn_t *conn)
        case GNILND_MSG_PUT_REQ:
        case GNILND_MSG_GET_REQ_REV:
                tx->tx_msg.gnm_u.putreq.gnprm_cookie = tx->tx_id.txe_cookie;
-
+               fallthrough;
        case GNILND_MSG_PUT_ACK:
        case GNILND_MSG_PUT_REQ_REV:
        case GNILND_MSG_GET_ACK_REV:
@@ -3920,10 +3833,9 @@ kgnilnd_process_rdmaq(kgn_device_t *dev)
                        new_ok -= atomic64_read(&dev->gnd_rdmaq_bytes_out);
                        atomic64_set(&dev->gnd_rdmaq_bytes_ok, new_ok);
 
-                       CDEBUG(D_NET, "resetting rdmaq bytes to %ld, deadline +%lu -> %lu, "
-                                      "current out %ld\n",
-                              atomic64_read(&dev->gnd_rdmaq_bytes_ok), dead_bump, dev->gnd_rdmaq_deadline,
-                              atomic64_read(&dev->gnd_rdmaq_bytes_out));
+                       CDEBUG(D_NET, "resetting rdmaq bytes to %lld, deadline +%lu -> %lu, current out %lld\n",
+                              (s64)atomic64_read(&dev->gnd_rdmaq_bytes_ok), dead_bump, dev->gnd_rdmaq_deadline,
+                              (s64)atomic64_read(&dev->gnd_rdmaq_bytes_out));
                }
                spin_unlock(&dev->gnd_rdmaq_lock);
        }
@@ -4110,6 +4022,8 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
        int           repost = 1, saw_complete;
        unsigned long timestamp, newest_last_rx, timeout;
        int           last_seq;
+       struct lnet_hdr hdr;
+       struct lnet_nid srcnid;
        ENTRY;
 
        /* Short circuit if the ep_handle is null.
@@ -4214,7 +4128,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
        rx->grx_msg = msg;
        rx->grx_conn = conn;
        rx->grx_eager = 0;
-       rx->grx_received = current_kernel_time();
+       ktime_get_ts64(&rx->grx_received);
 
        if (CFS_FAIL_CHECK(CFS_FAIL_GNI_NET_LOOKUP)) {
                rc = -ENONET;
@@ -4370,14 +4284,16 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
        case GNILND_MSG_IMMEDIATE:
                /* only get SMSG payload for IMMEDIATE */
                atomic64_add(msg->gnm_payload_len, &conn->gnc_device->gnd_short_rxbytes);
-               rc = lnet_parse(net->gnn_ni, &msg->gnm_u.immediate.gnim_hdr,
-                               msg->gnm_srcnid, rx, 0);
+               lnet_hdr_from_nid4(&hdr, &msg->gnm_u.immediate.gnim_hdr);
+               lnet_nid4_to_nid(msg->gnm_srcnid, &srcnid);
+               rc = lnet_parse(net->gnn_ni, &hdr, &srcnid, rx, 0);
                repost = rc < 0;
                break;
        case GNILND_MSG_GET_REQ_REV:
        case GNILND_MSG_PUT_REQ:
-               rc = lnet_parse(net->gnn_ni, &msg->gnm_u.putreq.gnprm_hdr,
-                               msg->gnm_srcnid, rx, 1);
+               lnet_hdr_from_nid4(&hdr, &msg->gnm_u.putreq.gnprm_hdr);
+               lnet_nid4_to_nid(msg->gnm_srcnid, &srcnid);
+               rc = lnet_parse(net->gnn_ni, &hdr, &srcnid, rx, 1);
                repost = rc < 0;
                break;
        case GNILND_MSG_GET_NAK_REV:
@@ -4475,16 +4391,16 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                              tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                               "bad tx buftype %d", tx->tx_buftype);
 
                kgnilnd_finalize_rx_done(tx, msg);
                break;
        case GNILND_MSG_PUT_REQ_REV:
        case GNILND_MSG_GET_REQ:
-               rc = lnet_parse(net->gnn_ni, &msg->gnm_u.get.gngm_hdr,
-                               msg->gnm_srcnid, rx, 1);
+               lnet_hdr_from_nid4(&hdr, &msg->gnm_u.get.gngm_hdr);
+               lnet_nid4_to_nid(msg->gnm_srcnid, &srcnid);
+               rc = lnet_parse(net->gnn_ni, &hdr, &srcnid, rx, 1);
                repost = rc < 0;
                break;
 
@@ -4494,8 +4410,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                              tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                               "bad tx buftype %d", tx->tx_buftype);
 
                kgnilnd_complete_tx(tx, msg->gnm_u.completion.gncm_retval);
@@ -4507,8 +4422,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                              tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                               "bad tx buftype %d", tx->tx_buftype);
 
                lnet_set_reply_msg_len(net->gnn_ni, tx->tx_lntmsg[1],
@@ -4522,8 +4436,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                               tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                                "bad tx buftype %d", tx->tx_buftype);
 
                kgnilnd_finalize_rx_done(tx, msg);
@@ -4536,8 +4449,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                              tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                               "bad tx buftype %d", tx->tx_buftype);
 
                kgnilnd_finalize_rx_done(tx, msg);
@@ -4549,8 +4461,7 @@ kgnilnd_check_fma_rx(kgn_conn_t *conn)
                if (tx == NULL)
                        break;
 
-               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED ||
-                              tx->tx_buftype == GNILND_BUF_VIRT_MAPPED,
+               GNITX_ASSERTF(tx, tx->tx_buftype == GNILND_BUF_PHYS_MAPPED,
                                "bad tx buftype %d", tx->tx_buftype);
 
                kgnilnd_complete_tx(tx, msg->gnm_u.completion.gncm_retval);
@@ -4660,7 +4571,8 @@ kgnilnd_send_conn_close(kgn_conn_t *conn)
                if (conn->gnc_ephandle != NULL) {
                        int rc = 0;
 
-                       tx = kgnilnd_new_tx_msg(GNILND_MSG_CLOSE, conn->gnc_peer->gnp_net->gnn_ni->ni_nid);
+                       tx = kgnilnd_new_tx_msg(GNILND_MSG_CLOSE,
+                                               lnet_nid_to_nid4(&conn->gnc_peer->gnp_net->gnn_ni->ni_nid));
                        if (tx != NULL) {
                                tx->tx_msg.gnm_u.completion.gncm_retval = conn->gnc_error;
                                tx->tx_state = GNILND_TX_WAITING_COMPLETION;
@@ -4853,11 +4765,9 @@ kgnilnd_process_mapped_tx(kgn_device_t *dev)
                } else {
                       GNIDBG_TX(log_retrans_level, tx,
                                "transient map failure #%d %d pages/%d bytes phys %u@%u "
-                               "virt %u@%llu "
                                "nq_map %d mdd# %d/%d GART %ld",
                                dev->gnd_map_attempt, tx->tx_phys_npages, tx->tx_nob,
                                dev->gnd_map_nphys, dev->gnd_map_physnop * PAGE_SIZE,
-                               dev->gnd_map_nvirt, dev->gnd_map_virtnob,
                                atomic_read(&dev->gnd_nq_map),
                                atomic_read(&dev->gnd_n_mdd), atomic_read(&dev->gnd_n_mdd_held),
                                atomic64_read(&dev->gnd_nbytes_map));
@@ -4898,7 +4808,7 @@ kgnilnd_process_conns(kgn_device_t *dev, unsigned long deadline)
 
                conn = list_first_entry(&dev->gnd_ready_conns, kgn_conn_t, gnc_schedlist);
                list_del_init(&conn->gnc_schedlist);
-               /* 
+               /*
                 * Since we are processing conn now, we don't need to be on the delaylist any longer.
                 */