[PATCH v3 7/7] bbdev: add a lock option for enqueue/dequeue operation
Nicolas Chautru
nicolas.chautru at intel.com
Tue Jun 28 03:35:37 CEST 2022
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 at intel.com>
---
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
More information about the dev
mailing list