netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: fix comment above build_skb()
@ 2013-07-23 19:22 Florian Fainelli
  2013-07-25  0:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2013-07-23 19:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, eric.dumazet, bhutchings, Florian Fainelli

build_skb() specifies that the data parameter must come from a kmalloc'd
area, this is only true if frag_size equals 0, because then build_skb()
will use kzsize(data) to figure out the actual data size. Update the
comment to reflect that special condition.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes since v1:
- explain the case where frag_size != 0

 net/core/skbuff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 20e02d2..3df4d4c 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -309,7 +309,8 @@ EXPORT_SYMBOL(__alloc_skb);
  * @frag_size: size of fragment, or 0 if head was kmalloced
  *
  * Allocate a new &sk_buff. Caller provides space holding head and
- * skb_shared_info. @data must have been allocated by kmalloc()
+ * skb_shared_info. @data must have been allocated by kmalloc() only if
+ * @frag_size is 0, otherwise data should come from the page allocator.
  * The return is the new skb buffer.
  * On a failure the return is %NULL, and @data is not freed.
  * Notes :
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] net: fix comment above build_skb()
  2013-07-23 19:22 [PATCH v2] net: fix comment above build_skb() Florian Fainelli
@ 2013-07-25  0:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-07-25  0:59 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, eric.dumazet, bhutchings

From: "Florian Fainelli" <f.fainelli@gmail.com>
Date: Tue, 23 Jul 2013 20:22:39 +0100

> build_skb() specifies that the data parameter must come from a kmalloc'd
> area, this is only true if frag_size equals 0, because then build_skb()
> will use kzsize(data) to figure out the actual data size. Update the
> comment to reflect that special condition.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-25  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23 19:22 [PATCH v2] net: fix comment above build_skb() Florian Fainelli
2013-07-25  0:59 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).