[v3,7/7] bbdev: add a lock option for enqueue/dequeue operation

Message ID 1656380137-44550-8-git-send-email-nicolas.chautru@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series bbdev changes for 22.11 |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues

Commit Message

Chautru, Nicolas June 28, 2022, 1:35 a.m. UTC
  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 <nicolas.chautru@intel.com>
---
 lib/bbdev/rte_bbdev.h | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

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 */