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 7EB67A0547; Tue, 28 Jun 2022 03:49:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60FD542B7C; Tue, 28 Jun 2022 03:48:54 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id AED2440691 for ; Tue, 28 Jun 2022 03:48:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656380926; x=1687916926; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=eqeyg9dhbknd3v2mTxDlKthqg15O+sM3ZBrLZ+x8cBY=; b=M0Kx/tj9Cub6we+msU+j72R3376g+lOp0T8wXsSX79aEU2Mx+nGZHX5J 63CiA9GcKJE6wIqJoD4rz4vtASq8CrZ+4Rmq72r8a0zE5ia116QAGVyvm G/ELtlciNG/i9yPovFRR90duNYuVoab/FX3+iONhLKG6Bz0HeZB3hCoGF lBoR1s93PLxIproda2HyQyloXDr3XP/yzLMM7P089Ojp/tbJREodkJ+wD 9UInl2y22Omy2v2xPLECLxQ81oxcF3faSBG6ifEXk9yL4ChsofxotFNtl dTBO4KWeE4BCHPEuOx5Us+BY/QhPnG0qfpzuXDeG4AiRN8PbhgTjigqGN g==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="264648619" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="264648619" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 18:48:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="587677091" Received: from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210]) by orsmga007.jf.intel.com with ESMTP; 27 Jun 2022 18:48:44 -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 v3 7/7] bbdev: add a lock option for enqueue/dequeue operation Date: Mon, 27 Jun 2022 18:35:37 -0700 Message-Id: <1656380137-44550-8-git-send-email-nicolas.chautru@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1656380137-44550-1-git-send-email-nicolas.chautru@intel.com> References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <1656380137-44550-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 explictly 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 c625a14..e0aa52e 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -458,6 +458,8 @@ struct rte_bbdev_data { int socket_id; /**< NUMA socket that device is on */ bool started; /**< Device run-time state */ uint16_t process_cnt; /** Counter of processes using the device */ + rte_rwlock_t lock_enq; /**< lock protection for the Enqueue */ + rte_rwlock_t lock_deq; /**< lock protection for the Dequeue */ }; /* Forward declarations */ -- 1.8.3.1