Commit d52ce920 authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

cxgb4: Use device node in page allocation

Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c098b026
...@@ -592,8 +592,10 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n, ...@@ -592,8 +592,10 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
unsigned int cred = q->avail; unsigned int cred = q->avail;
__be64 *d = &q->desc[q->pidx]; __be64 *d = &q->desc[q->pidx];
struct rx_sw_desc *sd = &q->sdesc[q->pidx]; struct rx_sw_desc *sd = &q->sdesc[q->pidx];
int node;
gfp |= __GFP_NOWARN; gfp |= __GFP_NOWARN;
node = dev_to_node(adap->pdev_dev);
if (s->fl_pg_order == 0) if (s->fl_pg_order == 0)
goto alloc_small_pages; goto alloc_small_pages;
...@@ -602,7 +604,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n, ...@@ -602,7 +604,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
* Prefer large buffers * Prefer large buffers
*/ */
while (n) { while (n) {
pg = __dev_alloc_pages(gfp, s->fl_pg_order); pg = alloc_pages_node(node, gfp | __GFP_COMP, s->fl_pg_order);
if (unlikely(!pg)) { if (unlikely(!pg)) {
q->large_alloc_failed++; q->large_alloc_failed++;
break; /* fall back to single pages */ break; /* fall back to single pages */
...@@ -632,7 +634,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n, ...@@ -632,7 +634,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
alloc_small_pages: alloc_small_pages:
while (n--) { while (n--) {
pg = __dev_alloc_page(gfp); pg = alloc_pages_node(node, gfp, 0);
if (unlikely(!pg)) { if (unlikely(!pg)) {
q->alloc_failed++; q->alloc_failed++;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment