From patchwork Wed Nov 30 15:27:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapati Kundapura X-Patchwork-Id: 120355 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 1432BA00C2; Wed, 30 Nov 2022 16:27:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0E9440395; Wed, 30 Nov 2022 16:27:07 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id DB3F640151 for ; Wed, 30 Nov 2022 16:27:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669822026; x=1701358026; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=t0l866YzrBx0T6xIs/CI76XFmEu14KxROGOqFELTf2c=; b=izSXucJ5N7in0YAZRYwVQltSoJTRtwWxIX1oZZz57XleNCZX3+dBmVca iheXB7JVAG8vADiOd+TQuc5Vdw8QUkw3bZENtD8uIxD5HFv4jTbBUJ9mP KAM7vGal9joupDqW64ylOddwhL17ka3wpyUBKhWe7x2Fumh41mQicOsSA uS+zGrrQaxabt4vbgF1F/5tyw7yZLPBqqVYx8skl6o3wwyJk7fhv7EeMv //tpV46xLjM982b3JL10l26kmBmsNSrzXUAVyhY8OPnJi1qoJMLaRE7Gz KmmYM9tv+vBfEImMUXXuM51a7fugjqxFgUu/94df6V9j+B8gpuJRS0W0S g==; X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="298792792" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="298792792" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 07:27:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="889325382" X-IronPort-AV: E=Sophos;i="5.96,206,1665471600"; d="scan'208";a="889325382" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga006.fm.intel.com with ESMTP; 30 Nov 2022 07:27:04 -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 Subject: [PATCH v1] eventdev/crypto: wrong offset used while flushing events Date: Wed, 30 Nov 2022 09:27:02 -0600 Message-Id: <20221130152702.1685762-1-ganapati.kundapura@intel.com> X-Mailer: git-send-email 2.23.0 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 circular buffer. Fixed by enqueuing the events from the head pointer of circular buffer. Signed-off-by: Ganapati Kundapura diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 1c0a22b..fe7e9f9 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;