crypto/virtio: fix dataqueues iteration
Checks
Commit Message
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")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
drivers/crypto/virtio/virtio_cryptodev.c | 3 +--
drivers/crypto/virtio/virtio_rxtx.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
Comments
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
> > 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")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks
@@ -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 *)
@@ -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]);
}