From: WingMan Kwok <w-kwok2@ti.com>
To: <davem@davemloft.net>, <m-karicheri2@ti.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: WingMan Kwok <w-kwok2@ti.com>, "Reece R. Pollack" <x0183204@ti.com>
Subject: [PATCH 1/2] net: Export __netdev_alloc_frag() to allow gfp_mask flags
Date: Wed, 29 Jul 2015 11:10:52 -0400 [thread overview]
Message-ID: <1438182653-2136-1-git-send-email-w-kwok2@ti.com> (raw)
This patch makes the function __netdev_alloc_frag() non-static and
exports it so that drivers that need to specify additional flags,
such as __GFP_DMA, can use it. The currently exported function,
netdev_alloc_frag() doesn't allow passing in gfp_mask flags.
Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Reece R. Pollack <x0183204@ti.com>
---
include/linux/skbuff.h | 1 +
net/core/skbuff.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index d6cdd6e..596deb3 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2139,6 +2139,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
kfree_skb(skb);
}
+void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask);
void *netdev_alloc_frag(unsigned int fragsz);
struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b6a19ca..6f3451f 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -350,7 +350,7 @@ EXPORT_SYMBOL(build_skb);
static DEFINE_PER_CPU(struct page_frag_cache, netdev_alloc_cache);
static DEFINE_PER_CPU(struct page_frag_cache, napi_alloc_cache);
-static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
+void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
{
struct page_frag_cache *nc;
unsigned long flags;
@@ -362,6 +362,7 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask)
local_irq_restore(flags);
return data;
}
+EXPORT_SYMBOL(__netdev_alloc_frag);
/**
* netdev_alloc_frag - allocate a page fragment
--
1.7.9.5
next reply other threads:[~2015-07-29 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 15:10 WingMan Kwok [this message]
2015-07-29 15:10 ` [PATCH 2/2] net: netcp: Allocate RX packet buffers using __GFP_DMA WingMan Kwok
2015-07-29 20:59 ` Eric Dumazet
2015-07-29 21:22 ` Murali Karicheri
2015-07-29 16:31 ` [PATCH 1/2] net: Export __netdev_alloc_frag() to allow gfp_mask flags Eric Dumazet
2015-07-29 20:22 ` Murali Karicheri
2015-07-29 20:37 ` Eric Dumazet
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=1438182653-2136-1-git-send-email-w-kwok2@ti.com \
--to=w-kwok2@ti.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--cc=x0183204@ti.com \
/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
all inboxes | Powered by JetHome®