netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] skb_put: remove not needed check for skb linearity
@ 2010-03-30 13:01 Paulius Zaleckas
  2010-03-31  6:55 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Paulius Zaleckas @ 2010-03-30 13:01 UTC (permalink / raw)
  To: davem; +Cc: netdev

It is safe to call skb_put() on packets containing fragments.

Actually I have a case where I allocate packet header with some
extra headroom and then I dynamically add data as frag_list. After
adding frags I have to add more data to header and skb_put()
just BUG's on me :)

And we will save couple instructions for CPU.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
---

 include/linux/skbuff.h |    1 -
 net/core/skbuff.c      |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 124f90c..194e9fa 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1108,7 +1108,6 @@ extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
 static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
 {
 	unsigned char *tmp = skb_tail_pointer(skb);
-	SKB_LINEAR_ASSERT(skb);
 	skb->tail += len;
 	skb->len  += len;
 	return tmp;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 93c4e06..ea1ca61 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1011,7 +1011,6 @@ EXPORT_SYMBOL(skb_pad);
 unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
 {
 	unsigned char *tmp = skb_tail_pointer(skb);
-	SKB_LINEAR_ASSERT(skb);
 	skb->tail += len;
 	skb->len  += len;
 	if (unlikely(skb->tail > skb->end))


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

end of thread, other threads:[~2010-03-31  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 13:01 [PATCH] skb_put: remove not needed check for skb linearity Paulius Zaleckas
2010-03-31  6:55 ` 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).