[v3,7/7] bbdev: add a lock option for enqueue/dequeue operation
Checks
Commit Message
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(+)
@@ -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 */