diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 96c9bf5..8df37ab 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -606,23 +606,17 @@ kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, __u32 nob) * for FastReg or FMR with no gaps we can accumulate all * the fragments in one FastReg or FMR fragment. */ - if (((dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED) && !tx->tx_gaps) || - (dev->ibd_dev_caps & IBLND_DEV_CAPS_FASTREG_ENABLED)) { - /* FMR requires zero based address */ - if (dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED) - rd->rd_frags[0].rf_addr &= ~hdev->ibh_page_mask; - rd->rd_frags[0].rf_nob = nob; - rd->rd_nfrags = 1; - } else { - /* - * We're transmitting with gaps using FMR. - * We'll need to use multiple fragments and identify the - * zero based address of each fragment. - */ - for (i = 0; i < rd->rd_nfrags; i++) { - rd->rd_frags[i].rf_addr &= ~hdev->ibh_page_mask; - rd->rd_frags[i].rf_addr += i << hdev->ibh_page_shift; - } + + /* FMR requires zero based address */ + if (dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED) + rd->rd_frags[0].rf_addr &= ~hdev->ibh_page_mask; + rd->rd_frags[0].rf_nob = nob; + rd->rd_nfrags = 1; + + /* Check that there are no fragments */ + if (!(((dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED) && !tx->tx_gaps) || + (dev->ibd_dev_caps & IBLND_DEV_CAPS_FASTREG_ENABLED)) ) { + CERROR("Transmitting with gaps: %d bytes %d fragments\n", nob, rd->rd_nfrags); } return 0;