ixgbe: allocate structures on numa_node
authorIntel <intel.com>
Mon, 3 Jun 2013 00:00:00 +0000 (00:00 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Sep 2013 12:16:07 +0000 (14:16 +0200)
Signed-off-by: Intel
lib/librte_pmd_ixgbe/ixgbe_rxtx.c

index a950b50..922525c 100644 (file)
@@ -1930,8 +1930,8 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
                ixgbe_tx_queue_release(dev->data->tx_queues[queue_idx]);
 
        /* First allocate the tx queue data structure */
-       txq = rte_zmalloc("ethdev TX queue", sizeof(struct igb_tx_queue),
-                         CACHE_LINE_SIZE);
+       txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct igb_tx_queue),
+                                CACHE_LINE_SIZE, socket_id);
        if (txq == NULL)
                return (-ENOMEM);
 
@@ -1970,9 +1970,9 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
        txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;
 
        /* Allocate software ring */
-       txq->sw_ring = rte_zmalloc("txq->sw_ring",
+       txq->sw_ring = rte_zmalloc_socket("txq->sw_ring",
                                   sizeof(struct igb_tx_entry) * nb_desc,
-                                  CACHE_LINE_SIZE);
+                                  CACHE_LINE_SIZE, socket_id);
        if (txq->sw_ring == NULL) {
                ixgbe_tx_queue_release(txq);
                return (-ENOMEM);
@@ -2171,8 +2171,8 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
                ixgbe_rx_queue_release(dev->data->rx_queues[queue_idx]);
 
        /* First allocate the rx queue data structure */
-       rxq = rte_zmalloc("ethdev RX queue", sizeof(struct igb_rx_queue),
-                         CACHE_LINE_SIZE);
+       rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct igb_rx_queue),
+                                CACHE_LINE_SIZE, socket_id);
        if (rxq == NULL)
                return (-ENOMEM);
        rxq->mb_pool = mp;
@@ -2217,9 +2217,9 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 #else
        len = nb_desc;
 #endif
-       rxq->sw_ring = rte_zmalloc("rxq->sw_ring",
-                                  sizeof(struct igb_rx_entry) * len,
-                                  CACHE_LINE_SIZE);
+       rxq->sw_ring = rte_zmalloc_socket("rxq->sw_ring",
+                                         sizeof(struct igb_rx_entry) * len,
+                                         CACHE_LINE_SIZE, socket_id);
        if (rxq->sw_ring == NULL) {
                ixgbe_rx_queue_release(rxq);
                return (-ENOMEM);