Skip to content

Commit

Permalink
Merge pull request #6212 from ooststep/creditfc_fix
Browse files Browse the repository at this point in the history
prov/verbs: account for off-by-one credit initialization
  • Loading branch information
shefty authored Aug 26, 2020
2 parents b3de148 + 8018cd1 commit 220af33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion prov/verbs/src/fi_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ struct vrb_ep {
uint64_t sq_credits;
uint64_t peer_rq_credits;
/* Protected by recv CQ lock */
uint64_t rq_credits_avail;
int64_t rq_credits_avail;
uint64_t threshold;

union {
Expand Down
6 changes: 6 additions & 0 deletions prov/verbs/src/verbs_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ vrb_alloc_init_ep(struct fi_info *info, struct vrb_domain *domain,
return NULL;
}

// When we are enabling flow control, we artificially inject
// a credit so that the credit messaging itself is not blocked
// by a lack of credits. To counter this, we will adjust the number
// of credit we send the first time by initializing to -1.
ep->rq_credits_avail = -1;

ep->info = fi_dupinfo(info);
if (!ep->info)
goto err1;
Expand Down

0 comments on commit 220af33

Please sign in to comment.