Message ID | 165755852267.777605.3537291928925405314.stgit@fed.void |
---|---|
State | Accepted |
Commit | b159525903d12f1e8824285db7a6bb88fea465c8 |
Headers | show |
Series | conntrack: Improve multithread scalability. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | warning | apply and check: warning |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
Paolo Valerio <pvalerio@redhat.com> writes: > From: Ilya Maximets <i.maximets@ovn.org> > > This could save some costly key comparison miss, especially in the > case there are many expired connections waiting for the sweeper to > evict them. > > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > Signed-off-by: Paolo Valerio <pvalerio@redhat.com> > --- Acked-by: Aaron Conole <aconole@redhat.com>
diff --git a/lib/conntrack.c b/lib/conntrack.c index 468450a89..13c5ab628 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -586,14 +586,17 @@ conn_key_lookup(struct conntrack *ct, const struct conn_key *key, bool found = false; CMAP_FOR_EACH_WITH_HASH (conn, cm_node, hash, &ct->conns) { - if (!conn_key_cmp(&conn->key, key) && !conn_expired(conn, now)) { + if (conn_expired(conn, now)) { + continue; + } + if (!conn_key_cmp(&conn->key, key)) { found = true; if (reply) { *reply = false; } break; } - if (!conn_key_cmp(&conn->rev_key, key) && !conn_expired(conn, now)) { + if (!conn_key_cmp(&conn->rev_key, key)) { found = true; if (reply) { *reply = true;