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 7BD457E75 for ; Fri, 24 Oct 2014 10:01:46 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 24 Oct 2014 01:10:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="405277431" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2014 01:02:27 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9O8ABxx004204; Fri, 24 Oct 2014 16:10:11 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9O8A9tb024465; Fri, 24 Oct 2014 16:10:11 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9O8A9Tg024461; Fri, 24 Oct 2014 16:10:09 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Fri, 24 Oct 2014 16:10:06 +0800 Message-Id: <1414138209-24431-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH 0/3] Vhost app removes dependency of 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: Fri, 24 Oct 2014 08:01:47 -0000 To remove the dependency of RTE_MBUF_REFCNT for vhost zero copy, the mbuf need introduce EXTERNAL_MBUF(in ol_flags) to indicate it attaches to an external buffer, say, from guest space. And don't free the external buffer when freeing the mbuf itself in host, in addition, RX function in PMD need make sure not overwrite this flag when filling ol_flags from descriptors to mbuf. Changchun Ouyang (3): mbuf use EXTERNAL_MBUF in ol_flags to indicate it is an external buffer, when freeing such kind of mbuf, just need put mbuf itself back into mempool, doesn't free the attached external buffer, user/caller need take care of detaching and freeing the external buffer. Every pmd RX function need keep the EXTERNAL_MBUF flag in mbuf.ol_flags, and can't overwrite it when filling ol_flags from descriptor to mbuf, otherwise, it probably cause to crash when freeing a mbuf and trying to freeing its attached external buffer, say, from guest space. vhost zero copy removes the dependency on macro REFCNT by using EXTERNAL_MBUF flag in mbuf.ol_flags to indicate it is an external buffer from guest. examples/vhost/main.c | 19 +++++-------------- lib/librte_mbuf/rte_mbuf.h | 5 ++++- lib/librte_pmd_e1000/igb_rxtx.c | 5 +++-- lib/librte_pmd_i40e/i40e_rxtx.c | 8 +++++--- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 8 +++++--- lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 12 ++++++++---- 6 files changed, 30 insertions(+), 27 deletions(-) -- 1.8.4.2