Skip to content

Commit

Permalink
Merge pull request #4 from hoopoepg/msg-pingpong-fix
Browse files Browse the repository at this point in the history
prov/rxd: fixed ack & window processing
  • Loading branch information
shefty authored Jun 30, 2017
2 parents c421cee + 8124b3f commit 5c07c3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions prov/rxd/src/rxd_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ static void rxd_handle_ack(struct rxd_ep *ep, struct ofi_ctrl_hdr *ctrl,
uint64_t idx;

FI_DBG(&rxd_prov, FI_LOG_EP_CTRL,
"ack- msg_id: %" PRIu64 ", segno: %d, buf: %p\n",
ctrl->msg_id, ctrl->seg_no, rx_buf);
"ack- msg_id: %" PRIu64 ", segno: %d, segsz: %d, buf: %p\n",
ctrl->msg_id, ctrl->seg_no, ctrl->seg_size, rx_buf);

idx = ctrl->msg_id & RXD_TX_IDX_BITS;
tx_entry = &ep->tx_entry_fs->buf[idx];
Expand All @@ -277,7 +277,11 @@ static void rxd_handle_ack(struct rxd_ep *ep, struct ofi_ctrl_hdr *ctrl,
}
} else {
tx_entry->rx_key = ctrl->rx_key;
tx_entry->window = ctrl->seg_no + ctrl->seg_size;
/* do not allow reduce window size (on duplicate acks) */
tx_entry->window = MAX(tx_entry->window, ctrl->seg_no + ctrl->seg_size);
FI_DBG(&rxd_prov, FI_LOG_EP_CTRL,
"ack- msg_id: %" PRIu64 ", window: %d\n",
ctrl->msg_id, tx_entry->window);
}
out:
rxd_ep_repost_buff(rx_buf);
Expand Down
8 changes: 6 additions & 2 deletions prov/rxd/src/rxd_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,16 @@ int rxd_ep_reply_ack(struct rxd_ep *ep, struct ofi_ctrl_hdr *in_ctrl,
ssize_t ret;
struct rxd_pkt_meta *pkt_meta;
struct rxd_pkt_data *pkt;
struct rxd_rx_entry *rx_entry;

pkt_meta = rxd_tx_pkt_alloc(ep);
if (!pkt_meta)
return -FI_ENOMEM;

rx_entry = &ep->rx_entry_fs->buf[rx_key];

pkt = (struct rxd_pkt_data *)pkt_meta->pkt_data;
rxd_init_ctrl_hdr(&pkt->ctrl, type, seg_size, in_ctrl->seg_no,
rxd_init_ctrl_hdr(&pkt->ctrl, type, seg_size, rx_entry->exp_seg_no,
in_ctrl->msg_id, rx_key, source);

FI_DBG(&rxd_prov, FI_LOG_EP_CTRL, "sending ack [%p] - %d, %d\n",
Expand Down Expand Up @@ -687,7 +690,8 @@ ssize_t rxd_ep_start_xfer(struct rxd_ep *ep, struct rxd_peer *peer,
pkt->ctrl.seg_no);
}

FI_DBG(&rxd_prov, FI_LOG_EP_CTRL, "start msg %p\n", pkt->ctrl.msg_id);
FI_DBG(&rxd_prov, FI_LOG_EP_CTRL, "start msg %p, size: %ld\n",
pkt->ctrl.msg_id, tx_entry->op_hdr.size);
rxd_set_timeout(tx_entry);
dlist_insert_tail(&pkt_meta->entry, &tx_entry->pkt_list);
dlist_insert_tail(&tx_entry->entry, &ep->tx_entry_list);
Expand Down

0 comments on commit 5c07c3e

Please sign in to comment.