Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
  • Loading branch information
odivlad committed Apr 1, 2024
1 parent 5ff17c4 commit 6428bdc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/ovn-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,18 @@ uint32_t
ovn_allocate_tnlid(struct hmap *set, const char *name, uint32_t min,
uint32_t max, uint32_t *hint)
{
for (uint32_t tnlid = *hint; tnlid != prev_tnlid(*hint, min, max);
tnlid = next_tnlid(tnlid, min, max)) {
/* Normalize hint, because it can be outside of [min, max]. */
*hint = next_tnlid(*hint, min, max);

uint32_t tnlid = *hint;
do {
if (ovn_add_tnlid(set, tnlid)) {
*hint = tnlid;
return tnlid;
}
tnlid = next_tnlid(tnlid, min, max);
}
while (tnlid != *hint);

static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
VLOG_WARN_RL(&rl, "all %s tunnel ids exhausted", name);
Expand Down

0 comments on commit 6428bdc

Please sign in to comment.