net/mlx5: support connection tracking between two ports
[dpdk.git] / drivers / common / octeontx2 / otx2_mbox.c
index 2b78109..6df1e8e 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <rte_atomic.h>
 #include <rte_cycles.h>
+#include <rte_malloc.h>
 
 #include "otx2_mbox.h"
 #include "otx2_dev.h"
@@ -36,7 +37,7 @@ otx2_mbox_fini(struct otx2_mbox *mbox)
 {
        mbox->reg_base = 0;
        mbox->hwbase = 0;
-       free(mbox->dev);
+       rte_free(mbox->dev);
        mbox->dev = NULL;
 }
 
@@ -128,7 +129,9 @@ otx2_mbox_init(struct otx2_mbox *mbox, uintptr_t hwbase, uintptr_t reg_base,
                return -ENODEV;
        }
 
-       mbox->dev = malloc(ndevs * sizeof(struct otx2_mbox_dev));
+       mbox->dev = rte_zmalloc("mbox dev",
+                               ndevs * sizeof(struct otx2_mbox_dev),
+                               OTX2_ALIGN);
        if (!mbox->dev) {
                otx2_mbox_fini(mbox);
                return -ENOMEM;