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 1EE1DA0545; Wed, 6 Jul 2022 02:37:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 382A342B6C; Wed, 6 Jul 2022 02:37:50 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6FEBE40687 for ; Wed, 6 Jul 2022 02:37:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657067868; x=1688603868; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=CD5uhRqRmemt1YTJ8InxKe0cN9Igo6c2tma64Kgwf1A=; b=KVKaiEW5aQAAuNGn+pZRqGhekBoZdqz0LVVnyeaWI6MSmkequa46Y6a6 F3ZefdRnJbnhMOGx7V5tcWNhce7uQeRPUNZ/Hn7fFuwrb2rQZX4mY7lgn mKaiaWMX7zyFZhCWue4cEJkrDFht11wrZzqKzIGVDPdnIuc/s+yk2kGaw aL9IBdPma7/PC8gPFY7UnBIWbWJkZ7ibiUin25aGAWvkIPV+TnRReB/tj fNGDfKIcm+7wlfu8JO3BHbks+UqHJYVVnu3Ifs5AaQ95NEvTP2nOOBqxL NAd7KEmrgdC45bvl4dh/iYGBWlmi31PJNOBylaHYxmAFu5pdvMWIogoZh w==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="369917429" X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="369917429" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 17:37:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="650411642" Received: from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210]) by fmsmga008.fm.intel.com with ESMTP; 05 Jul 2022 17:37:47 -0700 From: Nicolas Chautru To: dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com, hemant.agrawal@nxp.com Cc: maxime.coquelin@redhat.com, trix@redhat.com, mdr@ashroe.eu, bruce.richardson@intel.com, david.marchand@redhat.com, stephen@networkplumber.org, Nicolas Chautru Subject: [PATCH v4 7/7] bbdev: add a lock option for enqueue/dequeue operation Date: Tue, 5 Jul 2022 17:23:42 -0700 Message-Id: <1657067022-54373-8-git-send-email-nicolas.chautru@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1657067022-54373-1-git-send-email-nicolas.chautru@intel.com> References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <1657067022-54373-1-git-send-email-nicolas.chautru@intel.com> 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 Locking is not explicitly required but can be valuable in case the application cannot guarantee to be thread-safe, or specifically is at risk of using the same queue from multiple threads. This is an option for PMD to use this. Signed-off-by: Nicolas Chautru --- lib/bbdev/rte_bbdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index b7ecf94..8e7ca86 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -407,6 +407,8 @@ struct rte_bbdev_queue_data { struct rte_bbdev_stats queue_stats; /**< Queue statistics */ enum rte_bbdev_enqueue_status enqueue_status; /**< Enqueue status when op is rejected */ bool started; /**< Queue state */ + rte_rwlock_t lock_enq; /**< lock protection for the Enqueue */ + rte_rwlock_t lock_deq; /**< lock protection for the Dequeue */ }; /** @internal Enqueue encode operations for processing on queue of a device. */ -- 1.8.3.1