From: Victor Julien Date: Mon, 13 Jan 2020 14:39:20 +0000 (+0100) Subject: flow: don't reorder list on lookup X-Git-Tag: suricata-6.0.0-beta1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48605f48674b1478a7dfcb03d67fa2d92eff4f51;p=thirdparty%2Fsuricata.git flow: don't reorder list on lookup Reduces cache misses. --- diff --git a/src/flow-hash.c b/src/flow-hash.c index 0e1e7aaa90..742333a8ef 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -634,22 +634,6 @@ Flow *FlowGetFlowFromHash(ThreadVars *tv, DecodeThreadVars *dtv, const Packet *p int32_t flow_times_out_at = (int32_t)(f->lastts.tv_sec + timeout); /* do the timeout check */ if (flow_times_out_at >= p->ts.tv_sec) { - /* we found our flow, lets put it on top of the - * hash list -- this rewards active flows */ - if (f->hprev) { - if (f->hnext) { - f->hnext->hprev = f->hprev; - } - f->hprev->hnext = f->hnext; - if (f == fb->tail) { - fb->tail = f->hprev; - } - - f->hnext = fb->head; - f->hprev = NULL; - fb->head->hprev = f; - fb->head = f; - } if (unlikely(TcpSessionPacketSsnReuse(p, f, f->protoctx) == 1)) { f = TcpReuseReplace(tv, dtv, fb, f, hash, p); if (f == NULL) {