Skip to content

Commit

Permalink
Merge "In HashTables, handle the error case if deferred work entry cr…
Browse files Browse the repository at this point in the history
…eation fails"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Sep 6, 2016
2 parents bbefef8 + fd4ba32 commit 162737a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dp-core/vr_htable.c
Expand Up @@ -385,8 +385,17 @@ vr_htable_release_hentry(vr_htable_t htable, vr_hentry_t *ent)

/* Schedule the deletion on a cpu based on bucket index */
cpu_num = head_ent->hentry_index % vr_num_cpus;
vr_schedule_work(cpu_num, vr_htable_hentry_scheduled_delete,
(void *)delete_data);
if (vr_schedule_work(cpu_num, vr_htable_hentry_scheduled_delete,
(void *)delete_data)) {
/*
* We can only write back the status as not scheduled. There
* might be some entries that get marked as Deleted, but
* would not be pushed to free list as work queue is not
* scheduled. These marked entries would be deleted only if
* this hash bucket is revisisted
*/
(void)__sync_bool_compare_and_swap(&delete_data->hd_scheduled,1, 0);
}
}

return;
Expand Down

0 comments on commit 162737a

Please sign in to comment.