From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D84D043284; Sat, 4 Nov 2023 08:27:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A08154029E; Sat, 4 Nov 2023 08:27:56 +0100 (CET) Received: from out203-205-221-235.mail.qq.com (out203-205-221-235.mail.qq.com [203.205.221.235]) by mails.dpdk.org (Postfix) with ESMTP id 7D0304028B; Sat, 4 Nov 2023 08:27:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1699082865; bh=YiJPNauvQn672I2FRJAWnUsjY/LzyKafSwRHvhXYn+U=; h=From:To:Cc:Subject:Date; b=i2tN3H22f+KKLRZt2iEtNFfD2F51tt81z5fxQHcM1nYlgreuobtmWZyTygE0NsY+R cBr1wdWYwZ5zSS2n0gv0HtFk1Gn38mlZqXlufd+ORVzcp4M/IvYrdxbI77sjlMOSbv WfPDaj0Wb0/hjMVgM/LXrGQeXgkkLezgqPI9Df1g= Received: from liwg-V5320.. ([36.112.73.58]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 6E5B184D; Sat, 04 Nov 2023 15:27:37 +0800 X-QQ-mid: xmsmtpt1699082857t4u0ukydi Message-ID: X-QQ-XMAILINFO: NJ/+omVLhVgaTAZzIrbv+bgZA/rPMeXZw6WKqq2Tnv2BOA1/YBaZNDQ/QEHQRy kPeDBL+8Ak05uSA/g+12CFCEVKO1HB1mmj2HoJPVENQ4W0R8nxYogU5BoqZasVGpwoDTvxHpH9bE NcWNltE5Q8ibSFAIw00Y9tR+3YO6rbyF5sYNw/bh/Wu2rpSiJE3QGVrbN9HD4zvCzYo04dnlQYKT tJIJcZ/OaiMscitnt8zu84UkMxJJfHwmePmCDZRbR1vptFLE9KpyXDqtmVG7xWRG7DdaWABjmyBa eqg3a+z2G6IVY+xmMFswoDwrKYLjRdffAmoWlQqR384MOrFA2dGs3vizP/lVAH2ztpEkTnFsSjYl NniQMkQANOwYkdw86S9ii1IriHgh0gbG1Lyr2NohlNYZPT2fzYmPrRftWXQ+lnA4S2NMeDigHkp+ rTr68q91Stl4S6LFWuORxjjpmE32jODjq5u4g5jRyE5lHSDMVolMwUD+PWETj7oBrE+Typt00M42 DFWCqUZTxz4qsAMtUC+kPqrOfTro8tj36zQh5mUakzcrfqOpapObOyaXjBSPaEnShVjZ5QQUb5qu 1tYHzKst26RrrlYU3aN/KjhagriL3T+efXvhMynm5az9zVPB56JU5xagQdY8aF8lpFNi9T9zH2UX NN50eAhiV3NoyeBXQN5fywzDILe0bvezfz1OjxFQeSVWKOjpaM4OAlY9HFNyvS2PLphK6ACwpwhz X4JsdchSLcSw/UjqroZxbmPvVIyc/iQedxaGbyTGVZJJ1/aEqEilkypTnuIN9WAh5q6yQFTU7psK 8dp9c9d0/+26tyksYjSUsB69oJe0U5ccCNsw6NueU0t5MlsBjPvQPgT3BJeSHrD3bEVIlMfUOfBO tRtau2W9Yb4ALZeHzM40JdfeMPp7Kx09kbZo1TE3DcMAx5UhmiwiU3DDwrZrSDPdXelK61RWjx9p PPMPOsNn0+7YoU1PsyBZj00sGvJNgPPbF5Qnrah+dtGl2ulK/DHMnnH845UVtvvXD1GXee5Mwtjd iTWwXHLlygXuBgqBDWk7K8Llvd5Hg= X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= From: Weiguo Li To: skori@marvell.com Cc: jerinj@marvell.com, dev@dpdk.org, stable@dpdk.org, Weiguo Li Subject: [PATCH] examples/l3fwd: fix missing unlock issue Date: Sat, 4 Nov 2023 15:27:37 +0800 X-OQ-MSGID: <20231104072737.2064623-1-liwg06@foxmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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