* [PATCH] examples/l3fwd: fix missing unlock issue
@ 2023-11-04 7:27 Weiguo Li
0 siblings, 0 replies; only message in thread
From: Weiguo Li @ 2023-11-04 7:27 UTC (permalink / raw)
To: skori; +Cc: jerinj, dev, stable, Weiguo Li
The function l3fwd_get_free_event_port acquires a lock on
'evt_rsrc->evp.lock' at the beginning. This lock is expected
to be released at the first return statement, when no free
event port is available.
Fixes: aaf58cb85b62 ("examples/l3fwd: add event port and queue setup")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
---
examples/l3fwd/l3fwd_event.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index 20be22c6db..40c69baafb 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -205,6 +205,7 @@ l3fwd_get_free_event_port(struct l3fwd_event_resources *evt_rsrc)
rte_spinlock_lock(&evt_rsrc->evp.lock);
if (index >= evt_rsrc->evp.nb_ports) {
+ rte_spinlock_unlock(&evt_rsrc->evp.lock);
printf("No free event port is available\n");
return -1;
}
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-04 7:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 7:27 [PATCH] examples/l3fwd: fix missing unlock issue Weiguo Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).