From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: netdev@vger.kernel.org, linux-usb@vger.kernel.org
Cc: leedom@chelsio.com, hariprasad@chelsio.com,
donald.c.skidmore@intel.com, oliver@neukum.org, balbi@ti.com,
matthew.vick@intel.com, mgorman@suse.de, davem@davemloft.net,
jeffrey.t.kirsher@intel.com
Subject: [net-next PATCH v3 2/5] cxgb4/cxgb4vf: Replace __skb_alloc_page with __dev_alloc_page
Date: Tue, 11 Nov 2014 09:26:42 -0800 [thread overview]
Message-ID: <20141111172642.16460.73564.stgit@ahduyck-vm-fedora20> (raw)
In-Reply-To: <20141111172523.16460.16845.stgit@ahduyck-vm-fedora20>
Drop the bloated use of __skb_alloc_page and replace it with
__dev_alloc_page. In addition update the one other spot that is
allocating a page so that it allocates with the correct flags.
Cc: Hariprasad S <hariprasad@chelsio.com>
Cc: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 6 +++---
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 5e1b314..20ee002 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -576,7 +576,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
__be64 *d = &q->desc[q->pidx];
struct rx_sw_desc *sd = &q->sdesc[q->pidx];
- gfp |= __GFP_NOWARN | __GFP_COLD;
+ gfp |= __GFP_NOWARN;
if (s->fl_pg_order == 0)
goto alloc_small_pages;
@@ -585,7 +585,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
* Prefer large buffers
*/
while (n) {
- pg = alloc_pages(gfp | __GFP_COMP, s->fl_pg_order);
+ pg = __dev_alloc_pages(gfp, s->fl_pg_order);
if (unlikely(!pg)) {
q->large_alloc_failed++;
break; /* fall back to single pages */
@@ -615,7 +615,7 @@ static unsigned int refill_fl(struct adapter *adap, struct sge_fl *q, int n,
alloc_small_pages:
while (n--) {
- pg = __skb_alloc_page(gfp, NULL);
+ pg = __dev_alloc_page(gfp);
if (unlikely(!pg)) {
q->alloc_failed++;
break;
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
index 85036e6..9df40df 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
@@ -602,6 +602,8 @@ static unsigned int refill_fl(struct adapter *adapter, struct sge_fl *fl,
*/
BUG_ON(fl->avail + n > fl->size - FL_PER_EQ_UNIT);
+ gfp |= __GFP_NOWARN;
+
/*
* If we support large pages, prefer large buffers and fail over to
* small pages if we can't allocate large pages to satisfy the refill.
@@ -612,8 +614,7 @@ static unsigned int refill_fl(struct adapter *adapter, struct sge_fl *fl,
goto alloc_small_pages;
while (n) {
- page = alloc_pages(gfp | __GFP_COMP | __GFP_NOWARN,
- FL_PG_ORDER);
+ page = __dev_alloc_pages(gfp, FL_PG_ORDER);
if (unlikely(!page)) {
/*
* We've failed inour attempt to allocate a "large
@@ -657,7 +658,7 @@ static unsigned int refill_fl(struct adapter *adapter, struct sge_fl *fl,
alloc_small_pages:
while (n--) {
- page = __skb_alloc_page(gfp | __GFP_NOWARN, NULL);
+ page = __dev_alloc_page(gfp);
if (unlikely(!page)) {
fl->alloc_failed++;
break;
next prev parent reply other threads:[~2014-11-11 17:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 17:26 [net-next PATCH v3 0/5] Replace __skb_alloc_pages with simpler function Alexander Duyck
2014-11-11 17:26 ` [net-next PATCH v3 1/5] net: Add device Rx page allocation function Alexander Duyck
2014-11-11 17:26 ` Alexander Duyck [this message]
2014-11-11 17:26 ` [net-next PATCH v3 3/5] phonet: Replace calls to __skb_alloc_page with __dev_alloc_page Alexander Duyck
2014-11-11 17:26 ` [net-next PATCH v3 4/5] fm10k/igb/ixgbe: Replace __skb_alloc_page with dev_alloc_page Alexander Duyck
2014-11-11 17:28 ` Jeff Kirsher
2014-11-11 17:48 ` David Miller
[not found] ` <20141111.124826.2036471212277751765.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2014-11-11 17:56 ` Jeff Kirsher
2014-11-11 17:57 ` David Miller
2014-11-11 17:27 ` [net-next PATCH v3 5/5] net: Remove __skb_alloc_page and __skb_alloc_pages Alexander Duyck
2014-11-12 5:11 ` [net-next PATCH v3 0/5] Replace __skb_alloc_pages with simpler function David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141111172642.16460.73564.stgit@ahduyck-vm-fedora20 \
--to=alexander.h.duyck@redhat.com \
--cc=balbi@ti.com \
--cc=davem@davemloft.net \
--cc=donald.c.skidmore@intel.com \
--cc=hariprasad@chelsio.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=leedom@chelsio.com \
--cc=linux-usb@vger.kernel.org \
--cc=matthew.vick@intel.com \
--cc=mgorman@suse.de \
--cc=netdev@vger.kernel.org \
--cc=oliver@neukum.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox