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

login
register
mail settings
Submitter Xin, Xiaohui
Date Nov. 9, 2010, 9:03 a.m.
Message ID <97fa0298a51dc64626ff44e1756d09b94e4697df.1289280886.git.xiaohui.xin@intel.com>
Download mbox | patch
Permalink /patch/70513/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Xin, Xiaohui - Nov. 9, 2010, 9:03 a.m.
From: Xin Xiaohui <xiaohui.xin@intel.com>

Signed-off-by: Xin Xiaohui <xiaohui.xin@intel.com>
Signed-off-by: Zhao Yu <yzhao81new@gmail.com>
Reviewed-by: Jeff Dike <jdike@linux.intel.com>
---
 net/core/skbuff.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3d81113..075f4c5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -557,6 +557,12 @@  bool skb_recycle_check(struct sk_buff *skb, int skb_size)
 	if (skb_shared(skb) || skb_cloned(skb))
 		return false;
 
+	/* 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);