diff mbox

[v12,09/17] Don't do skb recycle, if device use external buffer.

Message ID 480af4c409789eafb08c5aa13e3c195ae1ab747a.1285853725.git.xiaohui.xin@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xin, Xiaohui Sept. 30, 2010, 2:04 p.m. UTC
None
diff mbox

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 76c8301..1aede3a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -565,6 +565,12 @@  int skb_recycle_check(struct sk_buff *skb, int skb_size)
 	if (skb_shared(skb) || skb_cloned(skb))
 		return 0;
 
+	/* if the device wants to do mediate passthru, the skb may
+	 * get external buffer, so don't recycle
+	 */
+	if (dev_is_mpassthru(skb->dev))
+		return 0;
+
 	skb_release_head_state(skb);
 	shinfo = skb_shinfo(skb);
 	atomic_set(&shinfo->dataref, 1);