crypto/mlx5: add keytag configuration
[dpdk.git] / drivers / raw / ioat / ioat_common.c
index fcb3057..60de411 100644 (file)
@@ -147,6 +147,7 @@ idxd_dev_configure(const struct rte_rawdev *dev,
        /* in case we are reconfiguring a device, free any existing memory */
        rte_free(rte_idxd->desc_ring);
        rte_free(rte_idxd->hdl_ring);
+       rte_free(rte_idxd->hdl_ring_flags);
 
        /* allocate the descriptor ring at 2x size as batches can't wrap */
        rte_idxd->desc_ring = rte_zmalloc(NULL,
@@ -162,8 +163,18 @@ idxd_dev_configure(const struct rte_rawdev *dev,
                rte_idxd->desc_ring = NULL;
                return -ENOMEM;
        }
+       rte_idxd->hdl_ring_flags = rte_zmalloc(NULL,
+                       sizeof(*rte_idxd->hdl_ring_flags) * max_desc, 0);
+       if (rte_idxd->hdl_ring_flags == NULL) {
+               rte_free(rte_idxd->desc_ring);
+               rte_free(rte_idxd->hdl_ring);
+               rte_idxd->desc_ring = NULL;
+               rte_idxd->hdl_ring = NULL;
+               return -ENOMEM;
+       }
        rte_idxd->hdls_read = rte_idxd->batch_start = 0;
        rte_idxd->batch_size = 0;
+       rte_idxd->hdls_avail = 0;
 
        return 0;
 }