Skip to content

Commit

Permalink
Get hentry even if Invalid, to manipulate bucket entry
Browse files Browse the repository at this point in the history
While deleting over flow table entry, the main bucket entry is fetched
using an API which return only valid hash entries. Due to this, if the
bucket entry is invalid, the over flow entry is not manipulated in the
list of bucket, but over flow entry is manipulated independently. Beause
of this, next index of main hash entry still points to cleared over flow
entry.  Later if same over flow entry is added to same bucket, the next
index goes bad.

As a fix, the API which returns hash entry unconditinally is used to
manipulate the bucket entry. Also next_index is not made invalid whilte
invalidating hash table entry. This gets invalidated only when the
overflow entry is deleted

An extra vr_release_hentry() is removed from flow.

Change-Id: I90f50847a0f928f4325290bb0b8cb0ec5f47e108
closs-bug: #1539397
  • Loading branch information
divakardhar committed Jan 29, 2016
1 parent f456685 commit 18cdcd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion dp-core/vr_flow.c
Expand Up @@ -224,7 +224,6 @@ __vr_flow_reset_entry(struct vrouter *router, struct vr_flow_entry *fe)
(VR_FLOW_FLAG_ACTIVE | VR_FLOW_FLAG_EVICTED |
VR_FLOW_FLAG_NEW_FLOW);

vr_htable_release_hentry(router->vr_flow_table, &fe->fe_hentry);
return;
}

Expand Down
7 changes: 4 additions & 3 deletions dp-core/vr_htable.c
Expand Up @@ -165,11 +165,12 @@ vr_htable_hentry_invalidate(struct vr_htable *table, vr_hentry_t *ent)
if (!table || !ent)
return;

ent->hentry_next_index = VR_INVALID_HENTRY_INDEX;
ent->hentry_bucket_index = VR_INVALID_HENTRY_INDEX;

if (ent->hentry_index >= table->ht_hentries)
if (ent->hentry_index >= table->ht_hentries) {
ent->hentry_next_index = VR_INVALID_HENTRY_INDEX;
vr_htable_put_free_oentry(table, ent);
}

ent->hentry_flags &= VR_HENTRY_FLAG_IN_FREE_LIST;
}
Expand All @@ -186,7 +187,7 @@ __vr_htable_hentry_invalidate(struct vr_htable *table, vr_hentry_t *ent)
return;

if (ent->hentry_index >= table->ht_hentries) {
head_ent = vr_htable_get_hentry_by_index((vr_htable_t)table,
head_ent = __vr_htable_get_hentry_by_index((vr_htable_t)table,
ent->hentry_bucket_index);
for (prev = head_ent; prev; prev = prev->hentry_next) {
if (prev->hentry_next == ent) {
Expand Down

0 comments on commit 18cdcd5

Please sign in to comment.