Skip to content

Commit

Permalink
Merge "Fix next page requests in kstate introspect set evicted flag i…
Browse files Browse the repository at this point in the history
…n next page request."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Dec 12, 2017
2 parents 54b40aa + 29bdbf8 commit e8658e8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/vnsw/agent/kstate/flow_kstate.cc
Expand Up @@ -169,6 +169,14 @@ const std::string FlowKState::DropCodeToStr(uint8_t drop_code) const {
}
}

void FlowKState::SetFlowHandle(KFlowResp *resp, const uint32_t idx) const {
if (evicted_) {
resp->set_flow_handle(integerToString(idx) + " evicted_set");
} else {
resp->set_flow_handle(integerToString(idx));
}
}

void FlowKState::SetFlowData(vector<KFlowInfo> &list,
const vr_flow_entry *k_flow,
const int index) const {
Expand Down Expand Up @@ -321,18 +329,16 @@ bool FlowKState::Run() {
}
if (count == KState::kMaxEntriesPerResponse) {
if (idx != max_flows) {
resp->set_flow_handle(integerToString(idx));
SetFlowHandle(resp, idx);
} else {
resp->set_flow_handle(integerToString(0));
SetFlowHandle(resp, 0);
}
SendResponse(resp);
return true;
}
}

resp->set_flow_handle(integerToString(0));
SetFlowHandle(resp, 0);
SendResponse(resp);

return true;
}

1 change: 1 addition & 0 deletions src/vnsw/agent/kstate/flow_kstate.h
Expand Up @@ -29,5 +29,6 @@ class FlowKState : public Task {
const std::string FlagToStr(unsigned int flag) const;
const std::string TcpFlagToStr(unsigned int flag) const;
const std::string DropCodeToStr(uint8_t drop_code) const;
void SetFlowHandle(KFlowResp *resp, const uint32_t idx) const;
};
#endif
5 changes: 5 additions & 0 deletions src/vnsw/agent/kstate/kstate_handler.cc
Expand Up @@ -124,6 +124,11 @@ void KMplsReq::HandleRequest() const {
void NextKFlowReq::HandleRequest() const {
FlowKState *task = new FlowKState(Agent::GetInstance(), context(),
get_flow_handle());
vector<string> tokens;
boost::split(tokens, get_flow_handle(), boost::is_any_of(" "));
if (tokens.size() == 2) {
task->set_evicted_flag(true);
}
TaskScheduler *scheduler = TaskScheduler::GetInstance();
scheduler->Enqueue(task);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/vrouter/flow_stats/flow_stats.sandesh
Expand Up @@ -65,7 +65,7 @@ struct SandeshFlowKey {
3: string dip;
4: u32 src_port;
5: u32 dst_port;
6: byte protocol;
6: u16 protocol;
}

/**
Expand Down

0 comments on commit e8658e8

Please sign in to comment.