]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: don't reorder list on lookup
authorVictor Julien <victor@inliniac.net>
Mon, 13 Jan 2020 14:39:20 +0000 (15:39 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Aug 2020 09:43:46 +0000 (11:43 +0200)
Reduces cache misses.

src/flow-hash.c

index 0e1e7aaa90a8c17aaf6c798217cf325e124ae340..742333a8ef84d173400daa13d3e59d8cfa5ac5af 100644 (file)
@@ -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) {