Prev: [RFC][PATCH v4 05/18] Add a function to indicate if device use external buffer.
Next: [RFC][PATCH v4 06/18] Add interface to get external buffers.
From: xiaohui.xin on 25 Apr 2010 05:30 From: Xin Xiaohui <xiaohui.xin(a)intel.com> Signed-off-by: Xin Xiaohui <xiaohui.xin(a)intel.com> Signed-off-by: Zhao Yu <yzhao81(a)gmail.com> Reviewed-by: Jeff Dike <jdike(a)linux.intel.com> --- net/core/skbuff.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ae223d2..169f22c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -553,6 +553,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); -- 1.5.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |