5 #include <pkt/pkt_types.h>
12 #define INDEX_LOCK(idx) \
13 tbb::mutex tmp_mutex, *mutex_ptr;\
14 if (idx == FlowEntry::kInvalidFlowHandle) {\
15 mutex_ptr = &tmp_mutex;\
17 mutex_ptr = &index_list_[idx].mutex_;\
19 tbb::mutex::scoped_lock lock(*mutex_ptr);
25 ksync_(ksync), proto_(NULL), count_(0), index_list_(), sm_log_count_(0) {
112 uint8_t evict_gen_id) {
114 if (kentry != NULL) {
146 uint8_t evict_gen_id;
159 object->UpdateFlowHandle(kentry, index);
185 if (evict_gen_id == gen_id) {
186 object->UpdateFlowHandle(kentry, index);
205 object->GenerateKSyncEvent(kentry, event);
216 uint8_t evict_gen_id = gen_id;
224 uint8_t diff = gen_id - old->
gen_id();
235 evict_gen_id = old->
gen_id();
243 flow->
gen_id(), evict_gen_id);
void Delete(FlowEntry *flow)
void LogFlow(FlowEventLog::Event event, FlowTableKSyncEntry *ksync, uint32_t flow_handle, uint8_t gen_id)
void set_evict_gen_id(uint8_t gen_id)
FlowTable * flow_table() const
uint32_t GetTransactionId()
FlowEntryPtr FindByIndex(uint32_t idx)
void UpdateKSync(FlowEntry *flow, bool update)
KSyncFlowIndexManager(KSync *ksync)
virtual ~KSyncFlowIndexManager()
struct IndexEntry * index_list_
void CreateInternal(FlowEntry *flow)
FlowTableKSyncEntry * ksync_entry_
void EvictFlowRequest(FlowEntry *flow, uint32_t flow_handle, uint8_t gen_id, uint8_t evict_gen_id)
AgentParam * params() const
void InitDone(uint32_t count)
void set_gen_id(uint8_t gen_id)
FlowProto * get_flow_proto() const
void Update(FlowEntry *flow)
uint32_t flow_handle() const
void set_transaction_id(uint32_t transaction_id)
uint16_t flow_index_sm_log_count() const
static const uint32_t kInvalidFlowHandle
FlowEntry * reverse_flow_entry()
void set_flow_handle(uint32_t flow_handle, uint8_t gen_id)
uint32_t vrouter_hash_id() const
void UpdateFlowHandle(FlowTableKSyncEntry *kentry, uint32_t index, uint8_t gen_id)
FlowEntryPtr flow_entry() const
void TriggerKSyncEvent(FlowTableKSyncEntry *kentry, KSyncEntry::KSyncEvent event)
void ReleaseIndexUnLocked(FlowEntry *flow)
FlowTableKSyncObject * ksync_object() const
static const uint8_t kActiveGenIdDiffMax
void DisableSend(FlowEntry *flow, uint8_t evict_gen_id)
uint8_t AcquireIndexUnLocked(uint32_t index, uint8_t gen_id, FlowEntry *flow)
boost::intrusive_ptr< FlowEntry > FlowEntryPtr
KSyncObject * GetObject() const