diff options
Diffstat (limited to 'drivers/net/cxgb4')
-rw-r--r-- | drivers/net/cxgb4/sge.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c index cc0b9975d472..311471b439a8 100644 --- a/drivers/net/cxgb4/sge.c +++ b/drivers/net/cxgb4/sge.c | |||
@@ -579,6 +579,7 @@ static inline void __refill_fl(struct adapter *adap, struct sge_fl *fl) | |||
579 | * @phys: the physical address of the allocated ring | 579 | * @phys: the physical address of the allocated ring |
580 | * @metadata: address of the array holding the SW state for the ring | 580 | * @metadata: address of the array holding the SW state for the ring |
581 | * @stat_size: extra space in HW ring for status information | 581 | * @stat_size: extra space in HW ring for status information |
582 | * @node: preferred node for memory allocations | ||
582 | * | 583 | * |
583 | * Allocates resources for an SGE descriptor ring, such as Tx queues, | 584 | * Allocates resources for an SGE descriptor ring, such as Tx queues, |
584 | * free buffer lists, or response queues. Each SGE ring requires | 585 | * free buffer lists, or response queues. Each SGE ring requires |
@@ -590,7 +591,7 @@ static inline void __refill_fl(struct adapter *adap, struct sge_fl *fl) | |||
590 | */ | 591 | */ |
591 | static void *alloc_ring(struct device *dev, size_t nelem, size_t elem_size, | 592 | static void *alloc_ring(struct device *dev, size_t nelem, size_t elem_size, |
592 | size_t sw_size, dma_addr_t *phys, void *metadata, | 593 | size_t sw_size, dma_addr_t *phys, void *metadata, |
593 | size_t stat_size) | 594 | size_t stat_size, int node) |
594 | { | 595 | { |
595 | size_t len = nelem * elem_size + stat_size; | 596 | size_t len = nelem * elem_size + stat_size; |
596 | void *s = NULL; | 597 | void *s = NULL; |
@@ -599,7 +600,7 @@ static void *alloc_ring(struct device *dev, size_t nelem, size_t elem_size, | |||
599 | if (!p) | 600 | if (!p) |
600 | return NULL; | 601 | return NULL; |
601 | if (sw_size) { | 602 | if (sw_size) { |
602 | s = kcalloc(nelem, sw_size, GFP_KERNEL); | 603 | s = kzalloc_node(nelem * sw_size, GFP_KERNEL, node); |
603 | 604 | ||
604 | if (!s) { | 605 | if (!s) { |
605 | dma_free_coherent(dev, len, p, *phys); | 606 | dma_free_coherent(dev, len, p, *phys); |
@@ -1982,7 +1983,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, | |||
1982 | iq->size = roundup(iq->size, 16); | 1983 | iq->size = roundup(iq->size, 16); |
1983 | 1984 | ||
1984 | iq->desc = alloc_ring(adap->pdev_dev, iq->size, iq->iqe_len, 0, | 1985 | iq->desc = alloc_ring(adap->pdev_dev, iq->size, iq->iqe_len, 0, |
1985 | &iq->phys_addr, NULL, 0); | 1986 | &iq->phys_addr, NULL, 0, NUMA_NO_NODE); |
1986 | if (!iq->desc) | 1987 | if (!iq->desc) |
1987 | return -ENOMEM; | 1988 | return -ENOMEM; |
1988 | 1989 | ||
@@ -2008,7 +2009,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, | |||
2008 | fl->size = roundup(fl->size, 8); | 2009 | fl->size = roundup(fl->size, 8); |
2009 | fl->desc = alloc_ring(adap->pdev_dev, fl->size, sizeof(__be64), | 2010 | fl->desc = alloc_ring(adap->pdev_dev, fl->size, sizeof(__be64), |
2010 | sizeof(struct rx_sw_desc), &fl->addr, | 2011 | sizeof(struct rx_sw_desc), &fl->addr, |
2011 | &fl->sdesc, STAT_LEN); | 2012 | &fl->sdesc, STAT_LEN, NUMA_NO_NODE); |
2012 | if (!fl->desc) | 2013 | if (!fl->desc) |
2013 | goto fl_nomem; | 2014 | goto fl_nomem; |
2014 | 2015 | ||
@@ -2095,7 +2096,8 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, | |||
2095 | 2096 | ||
2096 | txq->q.desc = alloc_ring(adap->pdev_dev, txq->q.size, | 2097 | txq->q.desc = alloc_ring(adap->pdev_dev, txq->q.size, |
2097 | sizeof(struct tx_desc), sizeof(struct tx_sw_desc), | 2098 | sizeof(struct tx_desc), sizeof(struct tx_sw_desc), |
2098 | &txq->q.phys_addr, &txq->q.sdesc, STAT_LEN); | 2099 | &txq->q.phys_addr, &txq->q.sdesc, STAT_LEN, |
2100 | netdev_queue_numa_node_read(netdevq)); | ||
2099 | if (!txq->q.desc) | 2101 | if (!txq->q.desc) |
2100 | return -ENOMEM; | 2102 | return -ENOMEM; |
2101 | 2103 | ||
@@ -2147,7 +2149,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq, | |||
2147 | 2149 | ||
2148 | txq->q.desc = alloc_ring(adap->pdev_dev, nentries, | 2150 | txq->q.desc = alloc_ring(adap->pdev_dev, nentries, |
2149 | sizeof(struct tx_desc), 0, &txq->q.phys_addr, | 2151 | sizeof(struct tx_desc), 0, &txq->q.phys_addr, |
2150 | NULL, 0); | 2152 | NULL, 0, NUMA_NO_NODE); |
2151 | if (!txq->q.desc) | 2153 | if (!txq->q.desc) |
2152 | return -ENOMEM; | 2154 | return -ENOMEM; |
2153 | 2155 | ||
@@ -2198,7 +2200,8 @@ int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq, | |||
2198 | 2200 | ||
2199 | txq->q.desc = alloc_ring(adap->pdev_dev, txq->q.size, | 2201 | txq->q.desc = alloc_ring(adap->pdev_dev, txq->q.size, |
2200 | sizeof(struct tx_desc), sizeof(struct tx_sw_desc), | 2202 | sizeof(struct tx_desc), sizeof(struct tx_sw_desc), |
2201 | &txq->q.phys_addr, &txq->q.sdesc, STAT_LEN); | 2203 | &txq->q.phys_addr, &txq->q.sdesc, STAT_LEN, |
2204 | NUMA_NO_NODE); | ||
2202 | if (!txq->q.desc) | 2205 | if (!txq->q.desc) |
2203 | return -ENOMEM; | 2206 | return -ENOMEM; |
2204 | 2207 | ||