File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,8 @@ int NHTFlowCache::put_pkt(Packet &pkt)
327327 return 0 ;
328328 }
329329
330+ prefetch_export_expired ();
331+
330332 uint64_t hashval = XXH64 (m_key, m_keylen, 0 ); /* Calculates hash value from key created before. */
331333
332334 FlowRecord *flow; /* Pointer to flow we will be working with. */
@@ -650,4 +652,10 @@ telemetry::Content NHTFlowCache::get_cache_telemetry()
650652 return dict;
651653}
652654
655+ void NHTFlowCache::prefetch_export_expired () const
656+ {
657+ for (decltype (m_timeout_idx) i = m_timeout_idx; i < m_timeout_idx + m_line_new_idx; i++) {
658+ __builtin_prefetch (m_flow_table[i], 0 , 1 );
659+ }
660+ }
653661}
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ class CacheOptParser : public OptionsParser
159159 }
160160};
161161
162- class FlowRecord
162+ class alignas ( 64 ) FlowRecord
163163{
164164 uint64_t m_hash;
165165
@@ -257,6 +257,7 @@ class NHTFlowCache : TelemetryUtils, public StoragePlugin
257257 void update_flow_end_reason_stats (uint8_t reason);
258258 void update_flow_record_stats (uint64_t packets_count);
259259 telemetry::Content get_cache_telemetry ();
260+ void prefetch_export_expired () const ;
260261
261262#ifdef FLOW_CACHE_STATS
262263 void print_report ();
You can’t perform that action at this time.
0 commit comments