From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 64C54ADCE for ; Mon, 23 Feb 2015 19:37:17 +0100 (CET) Received: by mail-wi0-f177.google.com with SMTP id bs8so19752009wib.4 for ; Mon, 23 Feb 2015 10:37:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=3ANpbRHx0PQaLTmokGLr+FrerEC280+BLo4E14eK74Q=; b=GlYzHFaf5AC5QcK1rpiclfajJDdzbcBKVKf7Wj5Bp+DP9/81ECKfWwx/tzHcrOQoIA R7KyUUmUmmqgBMitv89xYSET+ue46aYPjyspW1iHxkK4yWJREUIF1Ujkr/u8jOhuzdnD xG8/TVZjLtpgx/fdnaotsAQSGRveqoU93l8yXWnwpfYW023NyX5hVaDS+VgUZqaxuou7 I45PxvqsKU529U9RUEJeJ4bHTROzZwW8nwzIjF+Bof56RmJQotY1L+Ciqon1u+FXDVOk cBCFRgXJcJqlJYcYoJlsqeUnLHrytMZCO6OVYa0oLswf4yKdfNSMMuJjuSrjbn+bF3Mi npLg== X-Gm-Message-State: ALoCoQnsA9djl4VGCCiuwjZ+kDlzspbvTT5Nsjl7c/ZZ+PBZYnhf3yLQrlmgwGi/53B2lKX6V6cX X-Received: by 10.180.105.131 with SMTP id gm3mr23560215wib.11.1424716637259; Mon, 23 Feb 2015 10:37:17 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id mb20sm17030899wic.18.2015.02.23.10.37.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 10:37:16 -0800 (PST) From: Thomas Monjalon To: "Gonzalez Monroy, Sergio" Date: Mon, 23 Feb 2015 19:36:46 +0100 Message-ID: <10033845.zAL0UFbZ4z@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <2601191342CEEE43887BDE71AB977258213EF713@irsmsx105.ger.corp.intel.com> References: <1424102913-18944-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1424257383-4177-1-git-send-email-sergio.gonzalez.monroy@intel.com> <2601191342CEEE43887BDE71AB977258213EF713@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 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: Mon, 23 Feb 2015 18:37:17 -0000 > > 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. > > > > v2: > > - Add missing parenthesis to RTE_MBUF_INDIRECT macro > > > > Sergio Gonzalez Monroy (2): > > mbuf: Introduce IND_ATTACHED_MBUF flag > > Remove RTE_MBUF_REFCNT references > > Acked-by: Konstantin Ananyev Applied, thanks