From patchwork Mon Apr 3 13:13:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 125723 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 743A5428BE; Mon, 3 Apr 2023 15:19:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 027A740ED7; Mon, 3 Apr 2023 15:19:44 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2048.outbound.protection.outlook.com [40.107.7.48]) by mails.dpdk.org (Postfix) with ESMTP id 36E0340A7E for ; Mon, 3 Apr 2023 15:19:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h5G3OCDwwb889g7reTkTp3sgQRfvqHp9nf7GPRHher5oC4r7EHzrFyTy24P7N+2aiRFhGi/CiM7y+26dEZ+CRWDz2cv9wjRIwpF1K/rV+OzuKx6913LxQoS9ZJ8Acs7EGJiQ5/s6jwOq8Rt4zmK07wkyRSYxX2qZ2ZpthTgaJVn4ZMHviNnCXj5hVTlSTbhEpmyMwoVYIiJRh04CYWdElFaGnpRUkVgDosbfGTusx7qflPaylRU1KRxOsyFXsbsgg+YiWCc2ZcAT7sKMjgMPjobHX4+Cmhiot20yM81u14DvogwO0CZWgV6U2o4Iqe72j3uR70eXPy90XoBT5yHLSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dXLi4Qyv00epwKTna1z8SHTmB80GXEkTae3zeQJbg0g=; b=Vt9Lf2XoJ3X79fb3lL4aMLMH+470ekD1/Dt8/HQkIzo+S3AnBMwksb/2H61Ytj7gFQafMaWDn4Y7Y+P2b2hNUzjPu69hjnf82+WvSbCNSxk2plzXy3tYOPItZ7PdhzHUgSIQXIgZ0dRhTr7m2dxRG7EKVFgnKocM/xtsPm5aYciupP72nwLwyoTSF5TYZ+vq/VS1vWB2T7aDEnDf8tWdC5ohUk0W4KvTCWXapnTyLGjX0lwC7y6qR9MvaC0aXzX4+pjV/T3o8dRAIbk0kY3gZS5pyUH6AMOuaknsU5Gtl1JOdFEMP/xY3A+k4Y2uubjxhLY1Hq95ez0NF2oXht5D+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dXLi4Qyv00epwKTna1z8SHTmB80GXEkTae3zeQJbg0g=; b=Jt8vfEQGN28CkEDSUI7tOnkp8Or/KtOBpUCWJbA97ccJUZ7iLmiiMaqEZLg87l8NtqwaleWxxl3bXEbjlUSHgTjiVRXe5oHjEl8ULJUZaQRXohuYFrOfuFmCGsYT7lTdW5+PzoiKnlrdEDFDve/kjfowUIziDukFRqyZ8nqDjSA= Received: from AS9PR06CA0772.eurprd06.prod.outlook.com (2603:10a6:20b:484::27) by GVXPR07MB9869.eurprd07.prod.outlook.com (2603:10a6:150:121::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Mon, 3 Apr 2023 13:19:40 +0000 Received: from VI1EUR02FT024.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:484:cafe::8e) by AS9PR06CA0772.outlook.office365.com (2603:10a6:20b:484::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 13:19:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by VI1EUR02FT024.mail.protection.outlook.com (10.13.61.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6222.22 via Frontend Transport; Mon, 3 Apr 2023 13:19:40 +0000 Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 3 Apr 2023 15:19:38 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.193) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Mon, 3 Apr 2023 15:19:38 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id F1862380061; Mon, 3 Apr 2023 15:19:38 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Jerin Jacob CC: , Peter Nilsson J , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH 1/2] eventdev: add bulk type event ring operations Date: Mon, 3 Apr 2023 15:13:45 +0200 Message-ID: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1EUR02FT024:EE_|GVXPR07MB9869:EE_ X-MS-Office365-Filtering-Correlation-Id: 2842b66d-99d5-471f-fa64-08db344614be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hoez0b+sn1XoknUPcng3t9n9YmI3P/evysosp3LA51CPC0/CWLrVnw8UoPF7LfiUbkhQDcihCDEZiEDk7OrfDhnYdPorrJdqPqFe5z4atoXIeMR78RS3bnx/4Fm5ExoNvt5zd9s+7NkyprxxpCBIRGOzAAj252ENgzKEpev3vISYWh7nA0Hb8KL5T6qklkVh1jjxUFyTUU5aL71t7GPBiajIS8gMTz/l8EnR6rRBa37r18N/XNpA8p0LeRgtXIduuv27fWzU4ZyqwrPPau+F6EVy6fRejsM1JLJfDOqQ7SHoQk5C0bfXZoypzmIi3NbeeHcyQajBDCN+u5kJ3I9hhyb//Mmf41u1VGOdEgpNT4FTBmAykki843TPOg08Ih+gIkq/3Ecx2cqxowpRHzB+KaLm7lU18nddJy+IOTZlEqTwhqdc2eU0LnYM9IUyfB4uPduBaI6HVZr0L8IwDR/xYhsqgAnBzTeAr2hI65bx8FVDtNw+BYA8W9RBhwL/8kr75eAMYu6axLQcOl9UF4myhwMnh30UzkVVOH4RFpKM6TGaFNjP+ezPDOw8vNoXijOi8jERpkz/Y53uRydXvktIn1IeWUbKftjU+xlJpeoF8ANFZQvpc3SWabRwSDYZXRG7DGIt5EdC1ajc782fNHHkiDG6QnhYT97ao27GvMAKGiyW/+BTozo5QsniagGeS/di8T25LoaJoUl6ixPUMrL5useBNN+g/QLOFD2jxiJhku6ptCn1KZJ6qiU14slIsGE1 X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(396003)(39860400002)(376002)(451199021)(46966006)(36840700001)(40470700004)(356005)(5660300002)(7636003)(2616005)(47076005)(336012)(83380400001)(82310400005)(54906003)(316002)(478600001)(40480700001)(186003)(6266002)(86362001)(6666004)(107886003)(26005)(1076003)(82740400003)(82960400001)(41300700001)(36860700001)(40460700003)(36756003)(8676002)(4326008)(6916009)(70586007)(70206006)(8936002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 13:19:40.2535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2842b66d-99d5-471f-fa64-08db344614be X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR02FT024.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR07MB9869 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 Introduce bulk enqueue and dequeue operations into the API, to supplement the already-existing burst calls. Signed-off-by: Mattias Rönnblom Acked-by: Jerin Jacob --- lib/eventdev/rte_event_ring.h | 74 +++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lib/eventdev/rte_event_ring.h b/lib/eventdev/rte_event_ring.h index 7efa64444b..f9cf19ae16 100644 --- a/lib/eventdev/rte_event_ring.h +++ b/lib/eventdev/rte_event_ring.h @@ -67,6 +67,80 @@ rte_event_ring_free_count(const struct rte_event_ring *r) return rte_ring_free_count(&r->r); } + +/** + * Enqueue several objects on a ring. + * + * This function calls the multi-producer or the single-producer + * version depending on the default behavior that was specified at + * ring creation time (see flags). + * + * @param r + * pointer to the event ring + * @param events + * pointer to an array of struct rte_event objects + * @param n + * The number of events in the array to enqueue + * @param free_space + * if non-NULL, returns the amount of space in the ring after the + * enqueue operation has completed + * @return + * the number of objects enqueued, either 0 or n + */ +static __rte_always_inline unsigned int +rte_event_ring_enqueue_bulk(struct rte_event_ring *r, + const struct rte_event *events, + unsigned int n, uint16_t *free_space) +{ + unsigned int num; + uint32_t space; + + num = rte_ring_enqueue_bulk_elem(&r->r, events, + sizeof(struct rte_event), n, + &space); + + if (free_space != NULL) + *free_space = space; + + return num; +} + +/** + * Dequeue a set of events from a ring + * + * Note: this API does not work with pointers to events, rather it copies + * the events themselves to the destination ``events`` buffer. + * + * @param r + * pointer to the event ring + * @param events + * pointer to an array to hold the struct rte_event objects + * @param n + * number of events that can be held in the ``events`` array + * @param available + * if non-null, is updated to indicate the number of events remaining in + * the ring once the dequeue has completed + * @return + * the number of objects dequeued, either 0 or n + */ +static __rte_always_inline unsigned int +rte_event_ring_dequeue_bulk(struct rte_event_ring *r, + struct rte_event *events, + unsigned int n, uint16_t *available) +{ + unsigned int num; + uint32_t remaining; + + num = rte_ring_dequeue_bulk_elem(&r->r, events, + sizeof(struct rte_event), n, + &remaining); + + if (available != NULL) + *available = remaining; + + return num; +} + /** * Enqueue a set of events onto a ring * From patchwork Mon Apr 3 13:13:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 125724 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 383E5428BE; Mon, 3 Apr 2023 15:19:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25B32427E9; Mon, 3 Apr 2023 15:19:54 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2083.outbound.protection.outlook.com [40.107.105.83]) by mails.dpdk.org (Postfix) with ESMTP id 40EA241153 for ; Mon, 3 Apr 2023 15:19:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izH1AyQdbEIhjWwVo3z8NKRUrEyi/2hK0ocLanWbwvNZS1nVvIAZRcpVEXO7GrB/snH5Bv2+gEHQDiwh/hnkCfrtOPUeCYcndncmvMbeLVk3cygivqmbTqXLcDgLxoXeNso90FiB077wLpGQdgTg05bkphPf25BgdPlsnAlhcKVZLkMxkxe+oTrR2UwckSdxWLy+752lAUUf107C+kMTZ0c7xGGBpvQFAcMmnXVrtlf2Z0sNDC4g1ukMN5X8CUZLjrwYZh820k6WUwCW9jBi4x0KxLu6yqjT22soJ6o80jSXg5GUbtmX3GjcJkPLUaQClo1sMlCfVbfNAX9PAlLx2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jqHCsXTyVV+m0qpZ7XsgyN4o4vnqMCKJjAgOBowrElI=; b=LjzWdF0rvzGdhIj8Rl4dDnTiw4VuESHR6d1SGlN1qUpHEIY2GmDs23wW+L4vLMvnvy51M20RVj8q/mYMYbf2sUzQnHvUFa91kXexJJg9cSmcqX9LMQ65cpjykGWxCVvDSoAWF003zoTmkYCc5xPsOQ1pFKVQYJKQZMgt1IiCiAHjEPLbaIn/xyv8f6fxACgRbWpMH+/08bOyKhX0YTHoAXKoQpZggZ6rUuHx7NyjhKkwJDd2Apoe4Vhx9R7bj0BATobwXPL9NerIzI3SaK3dTq2tkXQzOlpbLO+y15F111mpXhRCDy5kBtKSQs91ELUtlgw3r/TvxmtJKJYlUSUq9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jqHCsXTyVV+m0qpZ7XsgyN4o4vnqMCKJjAgOBowrElI=; b=MHgQ4PuN/hrW6qW0J3V2gt6I6rcPc9E17Cw4bTNd8+KRllMNCEdT3+VwzSXU/rp/44//R4J7vX7o4lXtLeF/Yl1sArGXYZbMI4lFQYc/SlsT4cEnR7Hf4k9RSu51RACOKZk1wbn60kbH7kkZxZ+mjI19RUlf6vRWKTYBVuwqtdY= Received: from DB3PR08CA0014.eurprd08.prod.outlook.com (2603:10a6:8::27) by DB9PR07MB9293.eurprd07.prod.outlook.com (2603:10a6:10:459::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.29; Mon, 3 Apr 2023 13:19:51 +0000 Received: from DB5EUR02FT048.eop-EUR02.prod.protection.outlook.com (2603:10a6:8:0:cafe::f6) by DB3PR08CA0014.outlook.office365.com (2603:10a6:8::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 13:19:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by DB5EUR02FT048.mail.protection.outlook.com (10.13.58.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6222.37 via Frontend Transport; Mon, 3 Apr 2023 13:19:50 +0000 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSMB504.ericsson.se (153.88.183.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 3 Apr 2023 15:19:48 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.186) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Mon, 3 Apr 2023 15:19:48 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 2B99B380061; Mon, 3 Apr 2023 15:19:48 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Jerin Jacob CC: , Peter Nilsson J , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH 2/2] event/dsw: replace burst with bulk enqueue Date: Mon, 3 Apr 2023 15:13:46 +0200 Message-ID: <20230403131346.1070133-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> References: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5EUR02FT048:EE_|DB9PR07MB9293:EE_ X-MS-Office365-Filtering-Correlation-Id: a8743e14-1e0f-4cec-8294-08db34461b16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c1Wa0el2/WuRRIZQ3DX64fq4KTwJqkSPdILXL5ykZ+dEW2sEITJgFbZN0DAHslubSjObwUeXhdXgZihbD9xLdU/GzugpT1DMjeDNH2IEADSeWh+GQz89X8EyTE+hmNuD5GnseReW4c151gd4FITQxE7xtEm0KRyS1uHaH8BS6F2H0zO4UfSLZjAF1Giwnjhrcv5ocIGmmtOm21TwiO0jgu1N/1bkY/lKOjrK2TKaiAu+N9k9xvQrElhwZwaL9/fgbTOo8u/WjNKsWp5A9n45B8Fms0Kpf5srLs+/PX9rOR7thv8agMyPIeFVpVQf0KZyztDxEE+t55NeiMW4iavw13lLa8ZByNZL4RE8s3tkgQWb8X7Lm2/t29sseevcj2P6SNF2CttBck78ZWX6WfPMoEPXgoTiNRduCBNkSauv9RER4It38fxi3GE2irSK7kU212DInVopuocqkJARWKmdF8faUwyb9uXV1aS/36RlckuSA7OidFwWfgrtln5NoPX//i7idqswCofY+t+jj8aADUht+qB0m/BcLR8s7yOR370hIf/naMwZTYm8oXJBdtMn4++LSFnxkFY1H+cu011T85CzAySgmKFnLD68FXe1UO8oMF7NAtlyX+rZwp55AvaZ9dB0zfGA8iUnoBEKu78B+nIYhVamlGzc+fCI583U8pxx9js8tuK/y5/eFEBHy2Oxn76wL5pQQhFlyPwFBvW+db9CLcms0Xa3pgCK/kydqHvuATd7t/9jobzDxWF3+g9U X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(46966006)(36840700001)(40470700004)(86362001)(2906002)(36756003)(82310400005)(40460700003)(40480700001)(2616005)(186003)(6266002)(336012)(83380400001)(47076005)(1076003)(107886003)(26005)(8676002)(4326008)(478600001)(70586007)(36860700001)(70206006)(6916009)(41300700001)(356005)(7636003)(82740400003)(5660300002)(82960400001)(316002)(54906003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 13:19:50.8934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8743e14-1e0f-4cec-8294-08db34461b16 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR02FT048.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9293 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 An enqueue operation to a DSW port's input ring is guaranteed to succeed, an thus a bulk type enqueue (instead of a burst enqueue) may be used. There is also need not check the return code of such calls. This change shaves off a handful of CPU cycles worth of latency per enqueued event. Signed-off-by: Mattias Rönnblom --- drivers/event/dsw/dsw_event.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c index 9932caf2ee..90d298a255 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -590,7 +590,6 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port, struct dsw_port *dest_port = &(dsw->ports[dest_port_id]); uint16_t *buffer_len = &source_port->out_buffer_len[dest_port_id]; struct rte_event *buffer = source_port->out_buffer[dest_port_id]; - uint16_t enqueued = 0; if (*buffer_len == 0) return; @@ -598,13 +597,8 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port, /* The rings are dimensioned to fit all in-flight events (even * on a single ring), so looping will work. */ - do { - enqueued += - rte_event_ring_enqueue_burst(dest_port->in_ring, - buffer+enqueued, - *buffer_len-enqueued, - NULL); - } while (unlikely(enqueued != *buffer_len)); + rte_event_ring_enqueue_bulk(dest_port->in_ring, buffer, *buffer_len, + NULL); (*buffer_len) = 0; }