Skip to contentSkip to conversation

crypto/virtio: fix dataqueues iteration

PATCH Applied Gowrishankar Muthukrishnan 2 participants 3 messages Jan 7, 2025 – Jan 8, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/virtio: fix dataqueues iteration

Fix dataqueues iteration using nb_queue_pairs info available in device data instead of max dataqueues as dataqueue count might have been changed in device configuration.

Fixes 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")
---
 drivers/crypto/virtio/virtio_cryptodev.c | 3 +--
 drivers/crypto/virtio/virtio_rxtx.c      | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/crypto/virtio/virtio_cryptodev.c +1 -2
index 98415af123..b4a6fae9e0 100644
@@ -848,9 +848,8 @@ static void
 virtio_crypto_dev_free_mbufs(struct rte_cryptodev *dev)
 {
 	uint32_t i;
-	struct virtio_crypto_hw *hw = dev->data->dev_private;
 
-	for (i = 0; i < hw->max_dataqueues; i++) {
+	for (i = 0; i < dev->data->nb_queue_pairs; i++) {
 		VIRTIO_CRYPTO_INIT_LOG_DBG("Before freeing dataq[%d] used "
 			"and unused buf", i);
 		VIRTQUEUE_DUMP((struct virtqueue *)
drivers/crypto/virtio/virtio_rxtx.c +1 -2
index 48b5f4ebbb..d02486661f 100644
@@ -419,12 +419,11 @@ virtio_crypto_dataq_start(struct rte_cryptodev *dev)
 	 * -	Setup vring structure for data queues
 	 */
 	uint16_t i;
-	struct virtio_crypto_hw *hw = dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
 
 	/* Start data vring. */
-	for (i = 0; i < hw->max_dataqueues; i++) {
+	for (i = 0; i < dev->data->nb_queue_pairs; i++) {
 		virtio_crypto_vring_start(dev->data->queue_pairs[i]);
 		VIRTQUEUE_DUMP((struct virtqueue *)dev->data->queue_pairs[i]);
 	}
Signature · 1 line
2.25.1
Applied
#2 lore raw
Quoted 11 lines
Quoted 10 lines

Subject: [PATCH] crypto/virtio: fix dataqueues iteration

Fix dataqueues iteration using nb_queue_pairs info available in device data instead of max dataqueues as dataqueue count might have been changed in device configuration.

Fixes 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")

Applied to dpdk-next-crypto
Thanks