Re: [ovs-dev] [PATCH v7 5/5] conntrack: Check for expiration before comparing the keys during the lookup

2022-07-11 Thread Aaron Conole
Paolo Valerio  writes:

> From: Ilya Maximets 
>
> 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 
> Signed-off-by: Paolo Valerio 
> ---

Acked-by: Aaron Conole 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v7 5/5] conntrack: Check for expiration before comparing the keys during the lookup

2022-07-11 Thread 0-day Robot
Bleep bloop.  Greetings Paolo Valerio, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Unexpected sign-offs from developers who are not authors or co-authors 
or committers: Paolo Valerio 
Lines checked: 43, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v7 5/5] conntrack: Check for expiration before comparing the keys during the lookup

2022-07-11 Thread Paolo Valerio
From: Ilya Maximets 

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 
Signed-off-by: Paolo Valerio 
---
 lib/conntrack.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

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, >conns) {
-if (!conn_key_cmp(>key, key) && !conn_expired(conn, now)) {
+if (conn_expired(conn, now)) {
+continue;
+}
+if (!conn_key_cmp(>key, key)) {
 found = true;
 if (reply) {
 *reply = false;
 }
 break;
 }
-if (!conn_key_cmp(>rev_key, key) && !conn_expired(conn, now)) {
+if (!conn_key_cmp(>rev_key, key)) {
 found = true;
 if (reply) {
 *reply = true;

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev