Skip to content

Commit

Permalink
Set action to drop if its a short flow.
Browse files Browse the repository at this point in the history
To handle the cases where TrafficAction gets overridden after being marked as
drop, use short flow flag as well to identify drop action.

Change-Id: I45e98836c5463a9913f2a9bdb9aeedc2643f6c2c
Closes-bug: #1664301
(cherry picked from commit 517775d)
  • Loading branch information
manishsing committed Apr 19, 2017
1 parent 57564be commit 32bd722
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/vnsw/agent/pkt/flow_entry.cc
Expand Up @@ -2097,11 +2097,6 @@ bool FlowEntry::ActionRecompute() {
}
}

// Force short flows to DROP
if (is_flags_set(FlowEntry::ShortFlow)) {
action |= (1 << TrafficAction::DENY);
}

if (SetQosConfigIndex()) {
ret = true;
}
Expand Down
2 changes: 0 additions & 2 deletions src/vnsw/agent/pkt/test/test_flow_util.h
Expand Up @@ -323,10 +323,8 @@ class ShortFlow : public FlowVerify {

virtual void Verify(FlowEntry *fe) {
EXPECT_TRUE(fe->is_flags_set(FlowEntry::ShortFlow) == true);
EXPECT_TRUE((fe->data().match_p.action_info.action & (1 << TrafficAction::DENY)) != 0);
FlowEntry *rev = fe->reverse_flow_entry();
EXPECT_TRUE(rev->is_flags_set(FlowEntry::ShortFlow) == true);
EXPECT_TRUE((rev->data().match_p.action_info.action & (1 << TrafficAction::DENY)) != 0);
}
private:
};
Expand Down
3 changes: 2 additions & 1 deletion src/vnsw/agent/test-xml/test_xml_oper.cc
Expand Up @@ -1325,7 +1325,8 @@ static bool MatchFlowAction(FlowEntry *flow, const string &str) {
}

if (str == "deny") {
return ((action & TrafficAction::DROP_FLAGS) != 0);
return (((action & TrafficAction::DROP_FLAGS) != 0) |
(flow->IsShortFlow()));
}

return false;
Expand Down
4 changes: 4 additions & 0 deletions src/vnsw/agent/vrouter/ksync/flowtable_ksync.cc
Expand Up @@ -368,6 +368,10 @@ int FlowTableKSyncEntry::Encode(sandesh_op::type op, char *buf, int buf_len) {
req.set_fr_rindex(rev_flow->flow_handle());
}

if (flow_entry_->IsShortFlow()) {
action = VR_FLOW_ACTION_DROP;
}

req.set_fr_flags(flags);
req.set_fr_action(action);
req.set_fr_drop_reason(drop_reason);
Expand Down

0 comments on commit 32bd722

Please sign in to comment.