This will avoid memory access penalties on NUMA systems.

Signed-off-by: Andrew Boyer <andrew.bo...@amd.com>
---
 drivers/net/ionic/ionic_ethdev.c    |  5 +++--
 drivers/net/ionic/ionic_lif.c       | 13 ++++++++-----
 drivers/net/ionic/ionic_rx_filter.c |  3 +--
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index b1d8663329..2f720315c3 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -1005,7 +1005,8 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void 
*init_params)
        /* Allocate memory for storing MAC addresses */
        eth_dev->data->mac_addrs = rte_calloc("ionic",
                                        adapter->max_mac_addrs,
-                                       RTE_ETHER_ADDR_LEN, 0);
+                                       RTE_ETHER_ADDR_LEN,
+                                       RTE_CACHE_LINE_SIZE);
        if (eth_dev->data->mac_addrs == NULL) {
                IONIC_PRINT(ERR, "Failed to allocate %u bytes needed to "
                        "store MAC addresses",
@@ -1083,7 +1084,7 @@ eth_ionic_dev_probe(void *bus_dev, struct rte_device 
*rte_dev,
                goto err;
        }
 
-       adapter = rte_zmalloc("ionic", sizeof(*adapter), 0);
+       adapter = rte_zmalloc("ionic", sizeof(*adapter), RTE_CACHE_LINE_SIZE);
        if (!adapter) {
                IONIC_PRINT(ERR, "OOM");
                err = -ENOMEM;
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 8b10b26266..eeec4860ba 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -598,7 +598,8 @@ ionic_qcq_alloc(struct ionic_lif *lif,
                total_size += rte_mem_page_size();
        }
 
-       new = rte_zmalloc("ionic", struct_size, 0);
+       new = rte_zmalloc_socket("ionic", struct_size,
+                               RTE_CACHE_LINE_SIZE, socket_id);
        if (!new) {
                IONIC_PRINT(ERR, "Cannot allocate queue structure");
                return -ENOMEM;
@@ -1037,17 +1038,19 @@ ionic_lif_alloc(struct ionic_lif *lif)
                return -ENOMEM;
        }
 
-       lif->txqcqs = rte_calloc("ionic",
+       lif->txqcqs = rte_calloc_socket("ionic",
                                adapter->max_ntxqs_per_lif,
-                               sizeof(*lif->txqcqs), 0);
+                               sizeof(*lif->txqcqs),
+                               RTE_CACHE_LINE_SIZE, socket_id);
        if (!lif->txqcqs) {
                IONIC_PRINT(ERR, "Cannot allocate tx queues array");
                return -ENOMEM;
        }
 
-       lif->rxqcqs = rte_calloc("ionic",
+       lif->rxqcqs = rte_calloc_socket("ionic",
                                adapter->max_nrxqs_per_lif,
-                               sizeof(*lif->rxqcqs), 0);
+                               sizeof(*lif->rxqcqs),
+                               RTE_CACHE_LINE_SIZE, socket_id);
        if (!lif->rxqcqs) {
                IONIC_PRINT(ERR, "Cannot allocate rx queues array");
                return -ENOMEM;
diff --git a/drivers/net/ionic/ionic_rx_filter.c 
b/drivers/net/ionic/ionic_rx_filter.c
index bbfc217826..cfcfd2a1ea 100644
--- a/drivers/net/ionic/ionic_rx_filter.c
+++ b/drivers/net/ionic/ionic_rx_filter.c
@@ -55,8 +55,7 @@ ionic_rx_filter_save(struct ionic_lif *lif, uint32_t flow_id,
        struct ionic_rx_filter *f;
        uint32_t key;
 
-       f = rte_zmalloc("ionic", sizeof(*f), 0);
-
+       f = rte_zmalloc("ionic", sizeof(*f), RTE_CACHE_LINE_SIZE);
        if (!f)
                return -ENOMEM;
 
-- 
2.17.1

Reply via email to