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 965426A16 for ; Tue, 17 May 2016 15:44:49 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 17 May 2016 06:44:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,324,1459839600"; d="scan'208";a="105397371" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga004.fm.intel.com with ESMTP; 17 May 2016 06:44:47 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.130]) by irsmsx110.ger.corp.intel.com ([169.254.15.57]) with mapi id 14.03.0248.002; Tue, 17 May 2016 14:44:47 +0100 From: "Ananyev, Konstantin" To: Thomas Monjalon CC: "dev@dpdk.org" , Hiroyuki Mikita , "olivier.matz@6wind.com" Thread-Topic: [dpdk-dev] [PATCH v2] mbuf: decrease refcnt when detaching Thread-Index: AQHRr5OGTZbJUl8op0mwi7XajqfNVp+9A3aAgAATOoD///yWgIAAEUNw Date: Tue, 17 May 2016 13:44:46 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B518CE@irsmsx105.ger.corp.intel.com> References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <2164081.rUYNJaTDcf@xps13> <2601191342CEEE43887BDE71AB97725836B518A4@irsmsx105.ger.corp.intel.com> <1709340.0fJkCxgyM5@xps13> In-Reply-To: <1709340.0fJkCxgyM5@xps13> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] mbuf: decrease refcnt when detaching 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 May 2016 13:44:50 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Tuesday, May 17, 2016 2:40 PM > To: Ananyev, Konstantin > Cc: dev@dpdk.org; Hiroyuki Mikita; olivier.matz@6wind.com > Subject: Re: [dpdk-dev] [PATCH v2] mbuf: decrease refcnt when detaching >=20 > 2016-05-17 12:59, Ananyev, Konstantin: > > > > The rte_pktmbuf_detach() function should decrease refcnt on a direc= t > > > > buffer. > > > > > > As you have noticed, "whenever the indirect buffer is detached, > > > the reference counter on the direct buffer is decremented." > > > So the current behaviour of rte_pktmbuf_detach() is buggy. > > > Why not fix it without renaming? > > > If you consider this behavioral bug is part of the API, we > > > can fix it in a new function unattach and deprecate detach. > > > But Konstantin, why do you want to keep a restore function? > > > What is the need? > > > > I think it might be a useful functionality in some situations: > > some users can attach/detach to external memory buffers (no mbufs) > > and similar functionality is required. >=20 > Attach to external memory buffer (raw buffer) is not currently supported. >=20 > > Let say right now examples/vhost/main.c has its own pktmbuf_detach_zcp(= ) >=20 > You should look at the commit http://dpdk.org/commit/68363d85 > "examples/vhost: remove the non-working zero copy code" >=20 > > which is doing pretty much the same - restore original values, after de= taching > > mbuf from external (virtio) memory buffer. > > Would be good if we'll use a standard API function here. >=20 > You are welcome to implement mbuf attach to raw buffer. > But it is not a requirement for this fix. Hmm, still not sure why we can't keep an existing function? Obviously it wouldn't cost anything and I still think might be useful. Konstantin