From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 30110B6C5 for ; Tue, 17 Feb 2015 09:43:10 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 17 Feb 2015 00:43:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,593,1418112000"; d="scan'208";a="667388682" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.28]) ([10.237.220.28]) by fmsmga001.fm.intel.com with ESMTP; 17 Feb 2015 00:43:05 -0800 Message-ID: <54E2FF18.6010408@intel.com> Date: Tue, 17 Feb 2015 08:43:04 +0000 From: "Gonzalez Monroy, Sergio" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Stephen Hemminger References: <1424102913-18944-1-git-send-email-sergio.gonzalez.monroy@intel.com> <20150216154710.42bd6fe9@uryu.home.lan> In-Reply-To: <20150216154710.42bd6fe9@uryu.home.lan> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 0/2] Removal of RTE_MBUF_REFCNT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 08:43:10 -0000 On 16/02/2015 20:47, Stephen Hemminger wrote: > On Mon, 16 Feb 2015 16:08:31 +0000 > Sergio Gonzalez Monroy wrote: > >> This patch tries to remove the RTE_MBUF_REFCNT config options and dependencies >> by introducing a new mbuf flag IND_ATTACHED_MBUF that would indicate when the mbuf >> is an indirect attached mbuf, to differentiate between indirect mbufs and mbufs >> with external memory buffers (ie. vhost zero copy). >> >> Previous discussion: >> http://dpdk.org/ml/archives/dev/2014-October/007127.html >> >> Currently for mbufs with refcnt, we cannot free mbufs with external memory >> buffers (ie. vhost zero copy), as they are recognized as indirect >> attached mbufs and therefore we free the direct mbuf it points to, >> resulting in an error in the case of external memory buffers. >> >> We solve the issue by introducing the IND_ATTACHED_MBUF flag, which indicates >> that the mbuf is an indirect attached mbuf pointing to another mbuf. >> When we free an mbuf, we only free the direct mbuf if the flag is set. >> Freeing an mbuf with external buffer is the same as freeing a non attached mbuf. >> The flag is set during attach and clear on detach. >> >> So in the case of vhost zero copy where we have mbufs with external >> buffers, by default we just free the mbuf and it is up to the user to deal with >> the external buffer. >> >> Sergio Gonzalez Monroy (2): >> mbuf: Introduce IND_ATTACHED_MBUF flag >> Remove RTE_MBUF_REFCNT references >> >> app/test/test_link_bonding.c | 15 ----------- >> app/test/test_mbuf.c | 17 +++---------- >> config/common_bsdapp | 1 - >> config/common_linuxapp | 1 - >> examples/Makefile | 4 +-- >> examples/ip_fragmentation/Makefile | 4 --- >> examples/ip_pipeline/Makefile | 3 --- >> examples/ip_pipeline/main.c | 5 ---- >> examples/ipv4_multicast/Makefile | 4 --- >> examples/vhost/main.c | 19 +++----------- >> lib/librte_ip_frag/Makefile | 4 --- >> lib/librte_ip_frag/rte_ip_frag.h | 4 --- >> lib/librte_mbuf/rte_mbuf.c | 2 -- >> lib/librte_mbuf/rte_mbuf.h | 45 +++++++-------------------------- >> lib/librte_pmd_bond/Makefile | 4 --- >> lib/librte_pmd_bond/rte_eth_bond.h | 2 -- >> lib/librte_pmd_bond/rte_eth_bond_args.c | 2 -- >> lib/librte_pmd_bond/rte_eth_bond_pmd.c | 10 -------- >> lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 8 ------ >> lib/librte_port/Makefile | 4 --- >> 20 files changed, 19 insertions(+), 139 deletions(-) >> > What about supporting a clone operation instead of and in addition > to attach? The refcnt is also useful when there are two paths for > a packet (going into mulitple rings). There is already an rte_pktmbuf_clone function, not sure if that is what you are asking. Sergio