From: Weiguo Li <liwg06@foxmail.com>
To: skori@marvell.com, pbhagavatula@marvell.com
Cc: dev@dpdk.org, stable@dpdk.org, Weiguo Li <liweiguo@xencore.cn>
Subject: [PATCH] examples/l2fwd-event: fix missing unlock issue
Date: Sat, 4 Nov 2023 15:21:53 +0800 [thread overview]
Message-ID: <tencent_3611473A9DDF7023F6228731D03C2FA7F308@qq.com> (raw)
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
next reply other threads:[~2023-11-04 7:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-04 7:21 Weiguo Li [this message]
2023-11-04 7:51 ` [EXT] " Jerin Jacob Kollanukkaran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_3611473A9DDF7023F6228731D03C2FA7F308@qq.com \
--to=liwg06@foxmail.com \
--cc=dev@dpdk.org \
--cc=liweiguo@xencore.cn \
--cc=pbhagavatula@marvell.com \
--cc=skori@marvell.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).