From patchwork Mon Nov 8 08:03:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xin, Xiaohui" X-Patchwork-Id: 307832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA87gpmj024576 for ; Mon, 8 Nov 2010 07:42:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754165Ab0KHHmG (ORCPT ); Mon, 8 Nov 2010 02:42:06 -0500 Received: from mga03.intel.com ([143.182.124.21]:26506 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803Ab0KHHmE (ORCPT ); Mon, 8 Nov 2010 02:42:04 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 07 Nov 2010 23:42:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,313,1286175600"; d="scan'208";a="345803486" Received: from gw-vmm.sh.intel.com (HELO localhost.localdomain.org) ([10.239.48.110]) by azsmga001.ch.intel.com with ESMTP; 07 Nov 2010 23:42:01 -0800 From: xiaohui.xin@intel.com To: eric.dumazet@gmail.com, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com, mingo@elte.hu, davem@davemloft.net, herbert@gondor.hengli.com.au, jdike@linux.intel.com Cc: Xin Xiaohui Subject: Re:[PATCH v14 06/17] Use callback to deal with skb_release_data() specially. Date: Mon, 8 Nov 2010 16:03:50 +0800 Message-Id: <1289203430-5935-1-git-send-email-xiaohui.xin@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1288861663.2659.47.camel@edumazet-laptop> References: <1288861663.2659.47.camel@edumazet-laptop> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Nov 2010 07:42:52 +0000 (UTC) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c83b421..df852f2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -224,6 +224,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, child->fclone = SKB_FCLONE_UNAVAILABLE; } + shinfo->destructor_arg = NULL; out: return skb; nodata: @@ -343,6 +344,13 @@ static void skb_release_data(struct sk_buff *skb) if (skb_has_frags(skb)) skb_drop_fraglist(skb); + if (skb->dev && dev_is_mpassthru(skb->dev)) { + struct skb_ext_page *ext_page = + skb_shinfo(skb)->destructor_arg; + if (ext_page && ext_page->dtor) + ext_page->dtor(ext_page); + } + kfree(skb->head); } }