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 AF2E943284; Sat, 4 Nov 2023 08:22:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A77B4029E; Sat, 4 Nov 2023 08:22:21 +0100 (CET) Received: from out203-205-221-233.mail.qq.com (out203-205-221-233.mail.qq.com [203.205.221.233]) by mails.dpdk.org (Postfix) with ESMTP id 58FD84028B; Sat, 4 Nov 2023 08:22:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1699082524; bh=ijl74cE6swUvAF48hFtPDknEaFhZhbDqkePTXfj8CrM=; h=From:To:Cc:Subject:Date; b=CXXHjOCcy1TDTDmV4xyPKxQuc4N0J01JL0vOoZP5kIdf1VFXsIMtQsrWYgOftl1Wt TdzoJFaN500xUKUK1bi4CRRXyDtRnH+K74TysmoLFpwcR3r8QPKG6yoMmn/BHjYyAl EZVN/apdz/On4byjKK2V9Gi8+vVxcxS6zzaYzkiQ= Received: from liwg-V5320.. ([36.112.73.58]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 575AD8A8; Sat, 04 Nov 2023 15:21:53 +0800 X-QQ-mid: xmsmtpt1699082513tjqgnc99i Message-ID: X-QQ-XMAILINFO: NGsJ5Fy+2UsSCHT2f/Q40qlkgpaQgr0wD3WaC9J4BgP5Mp2l3rG/uUEKYldezx Mt2x72WKcQAQtfOvGlKsFP+G7oI4/zeuWLYpkG8gglLuzSHklgzNHmViY8kgUslNBBAfNeNXb4QX 8mfzD8pxmZhNqY5N6TEwuYs7bDwqWPlaKdMHJE5u5GTnLeSDZRW6DRq3GYxqM4vH1AavVeuh6Al2 9uUCWkLg7Sf3fD48ySry/31bmGckGTLLaNpR3fqihocwr8jdez6gEqDZfOz4sVG4TGVK0gK4pXVV AJK6r0kUtE0n9Tp75KQx0DlKhCh6YFY179XmFZLhpvAcZhr8Xll6XUWVAsM0rLouwkgo9Su8LWKV OBMpGtCkq094T8c/jRTssaQ89y66LnJBClvjgeha1KpRXy6rB5+/5/ffTmcR0f1LEts3qTyrrwyQ hvq6jlYVGam5aYZEngU94VFRp9iG+SGJHvVjLB4pLm4kkY7Q+hgm67cLU2aYRykdS3jFvfZc+ahq 0blEpNpZym9gW6J1F7NJfi3WCDMwgYGZ2Hq+IAv63/J6qRJCOu5n4SG0CaKOKh2JHNM9+nJ42lE1 WpHjxAhqXGZjPf1cvCzhZpUlif/hJuKI0No86eRJW51mcT56egRyLiZhhveY1lFPCUk06FDjaKW/ 4z7gNGuO6+nyfHvjYznOChGvalbGocWU6M440jv3uU8LrS/7UeGhGOAsnWuUOSBih63lPCEKb2tH lSC+xyBL6m5TWj4U+eNpvgRNHDQJKNLxOPQ/KJ2s+1vtDKaFSA0uu8Fg/dfgh0Ifv9xdKsqOLBL8 BGBmtkB8PA+WHRxz8JtBSA2BoXJz2c4iQ4L5MILV4tdrnmSXLJichDb/gpV2OHMe5OhADOsz0AFG eghdfAP767bIHD7627XTKgL548Eui7vC5LOkzPoMOUe60EA0igWzgsm2gcZJWVQFmQiTsFA1LUKV /C4T4/NUxRhbx0LloDLCKcICgUL/5J9PRc6ITXKfl1Hk+CfCtTUg== X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= From: Weiguo Li To: skori@marvell.com, pbhagavatula@marvell.com Cc: dev@dpdk.org, stable@dpdk.org, Weiguo Li Subject: [PATCH] examples/l2fwd-event: fix missing unlock issue Date: Sat, 4 Nov 2023 15:21:53 +0800 X-OQ-MSGID: <20231104072153.2063064-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 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 --- 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