From 0b45e1e5363f61febc7033f1b9bda14689c88644 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 25 Mar 2022 08:24:45 +0100 Subject: lib: Notify once for packets in new fset The fset add function was notifying for each packet already stored in the rx rbuff, which isn't needed. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/dev.c b/src/lib/dev.c index 5f6a3694..d73205e2 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1459,8 +1459,6 @@ int fset_add(struct flow_set * set, struct flow * flow; struct flow_set_entry * fse; int ret; - size_t packets; - size_t i; if (set == NULL || fd < 0 || fd >= SYS_MAX_FLOWS) return -EINVAL; @@ -1493,8 +1491,7 @@ int fset_add(struct flow_set * set, pthread_rwlock_unlock(&set->lock); - packets = shm_rbuff_queued(ai.flows[fd].rx_rb); - for (i = 0; i < packets; i++) + if (shm_rbuff_queued(ai.flows[fd].rx_rb)) shm_flow_set_notify(ai.fqset, ai.flows[fd].flow_id, FLOW_PKT); pthread_rwlock_unlock(&ai.lock); -- cgit v1.2.3