Skip to content

Commit

Permalink
Disable Eviction of flow in Vrouter
Browse files Browse the repository at this point in the history
Vrouter will track tcp flags, but will not evict the flow
entry once the session is closed and let vrouter agent
look at the flag to delete the flow eventually.

This is required till vrouter agent handles evict event
in a more stable way

Change-Id: I4aa0878f240e92988f8d84e054a2635852d40b7f
Partial-Bug: 1550759

Vrouter to generate EEXIST error appropriately

Vrouter to generate EEXIST error when flow add request
failed due to race between agent and datapath, where
flow entry was already created due to packet trap

Closes-Bug: 1547501
Change-Id: I0d2073622b06998dd5778fb94749958afc09bac0
(cherry picked from commit c17b4d4)
(cherry picked from commit b679020)

Vrouter to return error for invalid flow op

If a flow operation is requested for an index which
is not active, vrouter should return an ENOENT error
for such operation

Closes-Bug: 1548678
Change-Id: I42bbd58f41a868b1ce630046ae40e911df0d9491
(cherry picked from commit 1cf3761)
(cherry picked from commit 99763a1)
  • Loading branch information
Prabhjot Singh Sethi authored and naveen-n committed Mar 7, 2016
1 parent 032fd49 commit 966f27e
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions dp-core/vr_flow.c
Expand Up @@ -806,8 +806,18 @@ vr_flow_action(struct vrouter *router, struct vr_flow_entry *fe,
break;
}

/*
* Eviction of Flow in vrouter add additional events to vrouter
* agent state machine making it complex and unstable, till
* agent is handling vrouter eviction appropriately, disabling
* eviction from vrouter.
* NOTE: Vrouter agent will look at VR_FLOW_TCP_DEAD flag to
* clear/evict flow immediately
*/
#if 0
if (fe->fe_tcp_flags & VR_FLOW_TCP_DEAD)
vr_flow_mark_evict(router, fe);
#endif

return result;
}
Expand Down Expand Up @@ -1557,6 +1567,15 @@ vr_flow_set_req_is_invalid(struct vrouter *router, vr_flow_req *req,
goto invalid_req;
}
}
} else {
/*
* flow set request received with an index which is
* not active anymore, return ENOENT error
*/
if ((req->fr_flags & VR_FLOW_FLAG_ACTIVE) && !(req->fr_index < 0)) {
error = -ENOENT;
goto invalid_req;
}
}

if (req->fr_flags & VR_FLOW_FLAG_VRFT) {
Expand Down Expand Up @@ -1681,7 +1700,7 @@ static int
vr_flow_set(struct vrouter *router, vr_flow_req *req)
{
int ret;
unsigned int fe_index;
unsigned int fe_index = (unsigned int)-1;
bool new_flow = false, modified = false;

struct vr_flow_entry *fe = NULL, *rfe = NULL;
Expand Down Expand Up @@ -1725,8 +1744,19 @@ vr_flow_set(struct vrouter *router, vr_flow_req *req)
*/
if (!fe) {
fe = vr_add_flow_req(req, &fe_index);
if (!fe)
if (!fe) {
if (fe_index != (unsigned int)-1) {
/*
* add flow req failed to allocate an entry due to race
* between agent and datapath, where flow entry at fe_index
* was already created due to packet trap, return EEXIST
* error and allow agent to wait and handle flow add due to
* packet trap
*/
return -EEXIST;
}
return -ENOSPC;
}

new_flow = true;
infop->vfti_added++;
Expand Down

0 comments on commit 966f27e

Please sign in to comment.