Thread (3 messages) 3 messages, 2 authors, 2008-05-25

Re: Single packet receiving in multiple ring buffers

From: Evgeniy Polyakov <hidden>
Date: 2008-05-25 13:31:48
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Possibly related (same subject, not in this thread)

On Sun, May 25, 2008 at 06:04:34AM -0700, David Miller (davem@davemloft.net) wrote:
quoted
If it is not convenient to use such scheme, you can always put data
into pages and then copy tiny bit into skb->data to be able to
specify IP layer protocol, all the rest system will do for itself
via pskb_may_copy() if needed.
The network input uses "pskb_may_pull()" not "pskb_may_copy()" :-)
For those who like pskb_may_copy() name, here is a patch :)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bbd8d00..1fb5723 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -990,6 +990,11 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
 	return __pskb_pull_tail(skb, len-skb_headlen(skb)) != NULL;
 }
 
+static inline int pskb_may_copy(struct sk_buff *skb, unsigned int len)
+{
+	return pskb_may_pull(skb, len);
+}
+
 /**
  *	skb_headroom - bytes at buffer head
  *	@skb: buffer to check

-- 
	Evgeniy Polyakov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help