Skip to content

Commit

Permalink
prov/verbs: account for off-by-one credit initialization
Browse files Browse the repository at this point in the history
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 credits we send the first time by initializing to -1.

Signed-off-by: Stephen Oost <[email protected]>
  • Loading branch information
ooststep committed Aug 26, 2020
1 parent 7162ccf commit 8018cd1
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 8018cd1

Please sign in to comment.