@@ -1539,6 +1539,7 @@ void kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status)
fps = fpo->fpo_owner;
if (frd) {
frd->frd_valid = false;
+ frd->frd_posted = false;
fmr->fmr_frd = NULL;
spin_lock(&fps->fps_lock);
list_add_tail(&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
@@ -1634,6 +1635,7 @@ int kiblnd_fmr_pool_map(struct kib_fmr_poolset *fps, struct kib_tx *tx,
fmr->fmr_key = is_rx ? mr->rkey : mr->lkey;
fmr->fmr_frd = frd;
fmr->fmr_pool = fpo;
+ frd->frd_posted = false;
return 0;
}
@@ -272,6 +272,7 @@ struct kib_fast_reg_descriptor { /* For fast registration */
struct ib_reg_wr frd_fastreg_wr;
struct ib_mr *frd_mr;
bool frd_valid;
+ bool frd_posted;
};
struct kib_fmr_pool {
@@ -721,6 +721,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
struct kib_msg *msg = tx->tx_msg;
struct kib_peer_ni *peer_ni = conn->ibc_peer;
struct lnet_ni *ni = peer_ni->ibp_ni;
+ struct kib_fast_reg_descriptor *frd = tx->tx_fmr.fmr_frd;
int ver = conn->ibc_version;
int rc;
int done;
@@ -809,11 +810,10 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
/* close_conn will launch failover */
rc = -ENETDOWN;
} else {
- struct kib_fast_reg_descriptor *frd = tx->tx_fmr.fmr_frd;
const struct ib_send_wr *bad = &tx->tx_wrq[tx->tx_nwrq - 1].wr;
struct ib_send_wr *wrq = &tx->tx_wrq[0].wr;
- if (frd) {
+ if (frd && !frd->frd_posted) {
if (!frd->frd_valid) {
wrq = &frd->frd_inv_wr;
wrq->next = &frd->frd_fastreg_wr.wr;
@@ -837,11 +837,13 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
conn->ibc_last_send = ktime_get();
- if (!rc)
+ if (rc == 0) {
+ if (frd)
+ frd->frd_posted = true;
return 0;
+ }
- /*
- * NB credits are transferred in the actual
+ /* NB credits are transferred in the actual
* message, which can only be the last work item
*/
conn->ibc_credits += credit;