From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 993F4A0096 for ; Wed, 5 Jun 2019 10:32:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C5961B9BB; Wed, 5 Jun 2019 10:32:56 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0EC151B9A8 for ; Wed, 5 Jun 2019 10:32:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2019 01:32:53 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 05 Jun 2019 01:32:53 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Jun 2019 01:32:52 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Jun 2019 01:32:52 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.10]) by shsmsx102.ccr.corp.intel.com ([169.254.2.134]) with mapi id 14.03.0415.000; Wed, 5 Jun 2019 16:32:50 +0800 From: "Li, Xiaoyun" To: "Li, Xiaoyun" , "Ye, Xiaolong" CC: "Wu, Jingjing" , "Wiles, Keith" , "Liang, Cunming" , "Maslekar, Omkar" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 4/6] examples/ntb: enable an example for ntb Thread-Index: AQHVGejlkP1iUW2xJEm5zaROxaK52aaKiPmAgACdgNCAAZNE0A== Date: Wed, 5 Jun 2019 08:32:50 +0000 Message-ID: References: <20190603084611.40931-1-xiaoyun.li@intel.com> <20190603084611.40931-5-xiaoyun.li@intel.com> <20190604064801.GA94383@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 4/6] examples/ntb: enable an example for ntb X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi > > I noticed that there are two allocations, one for pkts_recv[0] and anot= her for > > pkts_recv[0]->buf_addr, How about we declare > > > > struct rte_rawdev_buf pkts_recv[1]; > > > > and allocate memory for its buf_addr > > > > pkts_recv[0].buf_addr =3D malloc(size); > > > > then we call > > > > rte_rawdev_dequeue_buffers(dev_id, &pkts_recv, 1, (void *)size); > > > > After that, we just need to free once. > > > > free(pkts_recv[0].buf_addr); > > Double pointer does not represent 2D arrays. Please refer to https://stackoverflow.com/questions/4470950/why-cant-we-use-double-pointer-= to-represent-two-dimensional-arrays It will cause segment fault in enqueue/dequeue. I will free twice. > > >2.17.1 > > >