* [PATCH] examples/l2fwd-event: fix missing unlock issue
@ 2023-11-04 7:21 Weiguo Li
2023-11-04 7:51 ` [EXT] " Jerin Jacob Kollanukkaran
0 siblings, 1 reply; 2+ messages in thread
From: Weiguo Li @ 2023-11-04 7:21 UTC (permalink / raw)
To: skori, pbhagavatula; +Cc: dev, stable, Weiguo Li
The function l2fwd_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: 080f57bceca4 ("examples/l2fwd-event: add eventdev main loop")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
---
examples/l2fwd-event/l2fwd_event.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c
index 4b5a032e35..842fd816e5 100644
--- a/examples/l2fwd-event/l2fwd_event.c
+++ b/examples/l2fwd-event/l2fwd_event.c
@@ -140,6 +140,7 @@ l2fwd_get_free_event_port(struct l2fwd_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] 2+ messages in thread
* RE: [EXT] [PATCH] examples/l2fwd-event: fix missing unlock issue
2023-11-04 7:21 [PATCH] examples/l2fwd-event: fix missing unlock issue Weiguo Li
@ 2023-11-04 7:51 ` Jerin Jacob Kollanukkaran
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2023-11-04 7:51 UTC (permalink / raw)
To: Weiguo Li, Sunil Kumar Kori, Pavan Nikhilesh Bhagavatula
Cc: dev, stable, Weiguo Li
> -----Original Message-----
> From: Weiguo Li <liwg06@foxmail.com>
> Sent: Saturday, November 4, 2023 12:52 PM
> To: Sunil Kumar Kori <skori@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Weiguo Li <liweiguo@xencore.cn>
> Subject: [EXT] [PATCH] examples/l2fwd-event: fix missing unlock issue
>
> External Email
>
> ----------------------------------------------------------------------
> The function l2fwd_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: 080f57bceca4 ("examples/l2fwd-event: add eventdev main loop")
> Cc: stable@dpdk.org
>
> Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
Please Fix issue found by CI at http://mails.dpdk.org/archives/test-report/2023-November/501341.html
> ---
> examples/l2fwd-event/l2fwd_event.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-
> event/l2fwd_event.c
> index 4b5a032e35..842fd816e5 100644
> --- a/examples/l2fwd-event/l2fwd_event.c
> +++ b/examples/l2fwd-event/l2fwd_event.c
> @@ -140,6 +140,7 @@ l2fwd_get_free_event_port(struct
> l2fwd_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] 2+ messages in thread
end of thread, other threads:[~2023-11-04 7:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 7:21 [PATCH] examples/l2fwd-event: fix missing unlock issue Weiguo Li
2023-11-04 7:51 ` [EXT] " Jerin Jacob Kollanukkaran
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).