From patchwork Wed Dec 7 06:49:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kundapura, Ganapati" X-Patchwork-Id: 120517 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 B6A42A00C3; Wed, 7 Dec 2022 07:49:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 607B44114B; Wed, 7 Dec 2022 07:49:51 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3AC3F410D7 for ; Wed, 7 Dec 2022 07:49:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670395789; x=1701931789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sZiukRuCik30piWgX1X7ZgVTuqMRNSWyJK/2TLsztiA=; b=dct+30KmGB1N1MWEUP6iwry7K+EkGj+8QLnMriPC6mAA4SVTfdBR/i7x dt39MyHn7S51bEiFo6UdrSwxOOA1YKk3NN4Pjq7q56xLd1acdQyM3DJ01 bVNgbECG4FRmmcVEHIjqAdJP3mUpXPa+1/d0TXo7z479EgeiCsGzahTIU uf/FV03F1/+VS82Gchmf3AYIffuMK2aL9z3chgQ1dZacYgP1GLxzrQX1h Dj5CiK1ydnlYc9A4S4ZFIPOdj8f4RBahWa/a3nR6dGL1KXEwj1d3BiUWP kc/x5uh6zhge06pj4b2EgdXKQVcAfRELIDKSYHhC7SCh4L23KHsQ8alap w==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="304446586" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="304446586" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 22:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="975352937" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="975352937" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2022 22:49:47 -0800 From: Ganapati Kundapura To: dev@dpdk.org, jerinj@marvell.com, s.v.naga.harish.k@intel.com, abhinandan.gujjar@intel.com Cc: jay.jayatheerthan@intel.com, vfialko@marvell.com Subject: [PATCH v3 1/5] eventdev/event_crypto: process event port's impl rel cap Date: Wed, 7 Dec 2022 00:49:41 -0600 Message-Id: <20221207064945.1665368-1-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221201064652.1885734-1-ganapati.kundapura@intel.com> References: <20221201064652.1885734-1-ganapati.kundapura@intel.com> MIME-Version: 1.0 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 In the current implementation adapter queries event device's capability for implicit release support. This information is used to decide whether events are enqueued back as NEW or FWD events. This patch updates the adapter to query the port caps for implicit release to decide on events enqueuing back as NEW/FWD events. Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- v3: * Freed adapter and adapter->ebuf after rte_event_port_attr_get() failure v2: * Updated subject line in commit message diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 3c585d7..134470b 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -53,7 +53,7 @@ struct event_crypto_adapter { uint8_t eventdev_id; /* Event port identifier */ uint8_t event_port_id; - /* Store event device's implicit release capability */ + /* Store event port's implicit release capability */ uint8_t implicit_release_disabled; /* Flag to indicate backpressure at cryptodev * Stop further dequeuing events from eventdev @@ -320,7 +320,6 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, { struct event_crypto_adapter *adapter; char mem_name[CRYPTO_ADAPTER_NAME_LEN]; - struct rte_event_dev_info dev_info; int socket_id; uint8_t i; int ret; @@ -361,17 +360,6 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, return -ENOMEM; } - ret = rte_event_dev_info_get(dev_id, &dev_info); - if (ret < 0) { - RTE_EDEV_LOG_ERR("Failed to get info for eventdev %d: %s!", - dev_id, dev_info.driver_name); - eca_circular_buffer_free(&adapter->ebuf); - rte_free(adapter); - return ret; - } - - adapter->implicit_release_disabled = (dev_info.event_dev_cap & - RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); adapter->eventdev_id = dev_id; adapter->socket_id = socket_id; adapter->conf_cb = conf_cb; @@ -837,6 +825,7 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id) struct rte_event_crypto_adapter_conf adapter_conf; struct rte_service_spec service; int ret; + uint32_t impl_rel; if (adapter->service_inited) return 0; @@ -866,6 +855,19 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id) adapter->max_nb = adapter_conf.max_nb; adapter->event_port_id = adapter_conf.event_port_id; + + if (rte_event_port_attr_get(adapter->eventdev_id, + adapter->event_port_id, + RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE, + &impl_rel)) { + RTE_EDEV_LOG_ERR("Failed to get port info for eventdev %" PRId32, + adapter->eventdev_id); + eca_circular_buffer_free(&adapter->ebuf); + rte_free(adapter); + return -EINVAL; + } + + adapter->implicit_release_disabled = (uint8_t)impl_rel; adapter->service_inited = 1; return ret; From patchwork Wed Dec 7 06:49:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kundapura, Ganapati" X-Patchwork-Id: 120518 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 98406A00C3; Wed, 7 Dec 2022 07:49:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AD6B42BC9; Wed, 7 Dec 2022 07:49:52 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D9A91410D7 for ; Wed, 7 Dec 2022 07:49:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670395790; x=1701931790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8L4ukqPdbFxuxuHND+drFL8JqveOnRPO2n3rsF+LJmQ=; b=WTi3+by2wECrVOdEaDiPz2n7ABO2MFb24GMpOc081zJqq7nThKjyOYW4 nLQkBBNsYqsm4Gg7Uh8Hcj0hRUCFIoRPl58gwsAaA3LZ1LYOctxtpQteS b6KHVytBck9IHKs7YW4mg0MEQFhfQVGxPP5uk+nlNbUdPSqACv5qYJY9K 4DjOWlN7gBoyQCl0IGkYY3v5N8HvfgRrnmnYv9rdnfYtjbEKd7EF51AAd FSHlVXIxw8OStz7SvLxb4ezCvurXDFQdFeiC9owHPnGSLGIXHAYwIMe5X vZPIkusFQ/Ns+UbWcITcOv3Zwxhy3StdxzIzpYjPuJOIf7X4tC1drWt3Q A==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="304446588" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="304446588" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 22:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="975352940" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="975352940" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2022 22:49:47 -0800 From: Ganapati Kundapura To: dev@dpdk.org, jerinj@marvell.com, s.v.naga.harish.k@intel.com, abhinandan.gujjar@intel.com Cc: jay.jayatheerthan@intel.com, vfialko@marvell.com Subject: [PATCH v3 2/5] eventdev/crypto: fix wrong crypto enqueue count stats Date: Wed, 7 Dec 2022 00:49:42 -0600 Message-Id: <20221207064945.1665368-2-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221207064945.1665368-1-ganapati.kundapura@intel.com> References: <20221201064652.1885734-1-ganapati.kundapura@intel.com> <20221207064945.1665368-1-ganapati.kundapura@intel.com> MIME-Version: 1.0 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 crypto_enq_count is updated on failure to enqueue ops to cryptodev. Updated crypto_enq_count on successful enqueue of ops to cryptodev. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- v2: * Updated subject line in commit message diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 134470b..eaff577 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -485,6 +485,9 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev, cdev_id, qp_id, &nb_enqueued); + stats->crypto_enq_count += nb_enqueued; + n += nb_enqueued; + /** * If some crypto ops failed to flush to cdev and * space for another batch is not available, stop @@ -495,9 +498,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev, &qp_info->cbuf))) adapter->stop_enq_to_cryptodev = true; } - - stats->crypto_enq_count += nb_enqueued; - n += nb_enqueued; } return n; From patchwork Wed Dec 7 06:49:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kundapura, Ganapati" X-Patchwork-Id: 120519 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 0492EA00C3; Wed, 7 Dec 2022 07:50:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CA1E42D2B; Wed, 7 Dec 2022 07:49:53 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 4665F410FB for ; Wed, 7 Dec 2022 07:49:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670395790; x=1701931790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yBTaw9XGNfeiXRgYUWZ+XSFCqi5juFLvgig4UrUXuEE=; b=RHt/3dSWlYGljHwbyQN6/qQowhtehsVcokLtMmkhxhey84xfUPqab6ci BO97IX4q5ZsHJ2FtRDkIP67/1I/Iz51WolB+npGcDfLXETrBfZfKT6p2u qTZFAHIU38eSEgiQDfN2ZrWXb0kDUTIJIWlREUTo3MEY4sCd34058AZDO w7GQnPhD0MDSIx/0VMF681sj0cgYNcxvovAmjoSGboCNR2w5PBU2dslKU aYSW2YJWHt5F/ulLspvx4E6jhdnZvjRyJXLBesYvoJne/mvLqdP6UziAa sq97MBGJPBVJn60leaXJ/WZCwN1+W+lIPIh/R2uYrPRC3HsdUnmfpVk3D g==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="304446591" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="304446591" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 22:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="975352944" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="975352944" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2022 22:49:48 -0800 From: Ganapati Kundapura To: dev@dpdk.org, jerinj@marvell.com, s.v.naga.harish.k@intel.com, abhinandan.gujjar@intel.com Cc: jay.jayatheerthan@intel.com, vfialko@marvell.com Subject: [PATCH v3 3/5] eventdev/crypto: fix wrong offset used while flushing events Date: Wed, 7 Dec 2022 00:49:43 -0600 Message-Id: <20221207064945.1665368-3-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221207064945.1665368-1-ganapati.kundapura@intel.com> References: <20221201064652.1885734-1-ganapati.kundapura@intel.com> <20221207064945.1665368-1-ganapati.kundapura@intel.com> MIME-Version: 1.0 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 Events enqueued to eventdev from the beginning of the circular buffer. This leads to invalid or already freed events getting enqueued to eventdev from the circular buffer. Fixed by enqueuing the events to eventdev from the head pointer of circular buffer. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- v2: * Updated subject line in commit message diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index eaff577..c08984b 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -669,7 +669,7 @@ eca_circular_buffer_flush_to_evdev(struct event_crypto_adapter *adapter, else return 0; /* buffer empty */ - nb_ops_flushed = eca_ops_enqueue_burst(adapter, ops, n); + nb_ops_flushed = eca_ops_enqueue_burst(adapter, &ops[*headp], n); bufp->count -= nb_ops_flushed; if (!bufp->count) { *headp = 0; From patchwork Wed Dec 7 06:49:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kundapura, Ganapati" X-Patchwork-Id: 120520 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 C2D66A00C3; Wed, 7 Dec 2022 07:50:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7366442D30; Wed, 7 Dec 2022 07:49:54 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 8522B410D7 for ; Wed, 7 Dec 2022 07:49:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670395790; x=1701931790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GGeXN+yAlZp+uv+5QRBNjYDd5FOnn7ZgY/avS6FyPKs=; b=YgbtGXbfqbxgou7qZ8wL/oYtw9C1yvYAnRyB7d+HyJPvjssdzdWmyvsi JrllYYjdDZgCC9iPPoMcncRG4bE3SOqs+6sbkFtveinVLJ1hOPYPb8H0+ c8oF2U96Ra4s9ZNyhgudKIp4X/zji0CsvqrJ4oNjgHKvqGhgjoLrJDHn4 PT2DTmP9WScUiCfXLTGgbbHzBAalhGbApawfSdEuAZV0nAmM4tBzMfjZ/ tPW0C1gVaHyBGAG63UtXm1vqiCvVHg/2H7Dv8+64CWiSPQV5bbGD5VZaP UXDPIzKRKeK310fpHSN5rk4SKMdh+Erziqvx+SrPurleEHzgczzYRDqvr w==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="304446596" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="304446596" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 22:49:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="975352947" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="975352947" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2022 22:49:48 -0800 From: Ganapati Kundapura To: dev@dpdk.org, jerinj@marvell.com, s.v.naga.harish.k@intel.com, abhinandan.gujjar@intel.com Cc: jay.jayatheerthan@intel.com, vfialko@marvell.com Subject: [PATCH v3 4/5] eventdev/crypto: fix overflow in circular buffer Date: Wed, 7 Dec 2022 00:49:44 -0600 Message-Id: <20221207064945.1665368-4-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221207064945.1665368-1-ganapati.kundapura@intel.com> References: <20221201064652.1885734-1-ganapati.kundapura@intel.com> <20221207064945.1665368-1-ganapati.kundapura@intel.com> MIME-Version: 1.0 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 In case of crypto enqueue failures, even though backpressure flag is set to stop further dequeue from eventdev, the current logic does not stop dequeueing events for max_nb events. This is fixed by checking the backpressure just before dequeuing events from event device. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- v3: * Updated commit message v2: * Updated subject line in commit message diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index c08984b..31b8255 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -573,14 +573,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, if (adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) return 0; - if (unlikely(adapter->stop_enq_to_cryptodev)) { - nb_enqueued += eca_crypto_enq_flush(adapter); + for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) { - if (unlikely(adapter->stop_enq_to_cryptodev)) - goto skip_event_dequeue_burst; - } + if (unlikely(adapter->stop_enq_to_cryptodev)) { + nb_enqueued += eca_crypto_enq_flush(adapter); + + if (unlikely(adapter->stop_enq_to_cryptodev)) + break; + } - for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) { stats->event_poll_count++; n = rte_event_dequeue_burst(event_dev_id, event_port_id, ev, BATCH_SIZE, 0); @@ -591,8 +592,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter, nb_enqueued += eca_enq_to_cryptodev(adapter, ev, n); } -skip_event_dequeue_burst: - if ((++adapter->transmit_loop_count & (CRYPTO_ENQ_FLUSH_THRESHOLD - 1)) == 0) { nb_enqueued += eca_crypto_enq_flush(adapter); From patchwork Wed Dec 7 06:49:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kundapura, Ganapati" X-Patchwork-Id: 120521 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 7C0F8A00C3; Wed, 7 Dec 2022 07:50:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 611A042D37; Wed, 7 Dec 2022 07:49:55 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 29CAE410D7 for ; Wed, 7 Dec 2022 07:49:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670395791; x=1701931791; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wPOXmckpCan8HjZStt0DsE5OHeaa9Hl2jP/GbcoKWjo=; b=jklqeK7x8A3FX8v9irF6j5GZu2/4lpLZOv5CoEFEwz/eJ6EwrqPuQlTd b9UqmURfp2EuPIBV9NFClb44Lf5ng8s6UJnP47yZuKIty76XbOV55aBDF wTqeFM9mJ2d2Hjy7FpD49L2vMOG7H1popdVDWU+hPyvKcuchAQ+VjIM2s BLhVFcfhBX5eUy7iinauqh6cEWobtVv0SifvhfHPTGdU+Ay0oZVT/b2eK N63y3p4TNd+Yj2t7DFEqTgpJ74a3efIZgLqPv6jepLDN5uQbxT984AzGJ Yk/LN/ghqeWqA9+x8sTxzz157dxN0SAg7vZ8PJqUKGFHYy1NvwP8nFeYu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="304446599" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="304446599" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 22:49:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="975352950" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="975352950" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2022 22:49:49 -0800 From: Ganapati Kundapura To: dev@dpdk.org, jerinj@marvell.com, s.v.naga.harish.k@intel.com, abhinandan.gujjar@intel.com Cc: jay.jayatheerthan@intel.com, vfialko@marvell.com Subject: [PATCH v3 5/5] eventdev/crypto: fix failed events Date: Wed, 7 Dec 2022 00:49:45 -0600 Message-Id: <20221207064945.1665368-5-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221207064945.1665368-1-ganapati.kundapura@intel.com> References: <20221201064652.1885734-1-ganapati.kundapura@intel.com> <20221207064945.1665368-1-ganapati.kundapura@intel.com> MIME-Version: 1.0 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 Circular buffer stores events failed to enqueue to eventdev for retrying later. Current implementation adds the same crypto op to circular buffer instead of pointing all the ops in a batch. This fix updates the pointer to pointing to correct ops in the batch. Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation") Signed-off-by: Ganapati Kundapura Acked-by: Abhinandan Gujjar --- v3: * Updated commit message v2: * Updated subject line commit message diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 31b8255..5d962a1 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -753,7 +753,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter, for (i = nb_enqueued; i < n; i++) eca_circular_buffer_add( &adapter->ebuf, - ops[nb_enqueued]); + ops[i]); check: nb_deq += n;