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 16DF3A0096 for ; Wed, 5 Jun 2019 15:36:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D08DF1BA65; Wed, 5 Jun 2019 15:36:16 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A1D9F1B997 for ; Wed, 5 Jun 2019 15:36:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2019 06:36:14 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 05 Jun 2019 06:36:14 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Jun 2019 06:36:14 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Jun 2019 06:36:14 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.10]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.137]) with mapi id 14.03.0415.000; Wed, 5 Jun 2019 21:36:11 +0800 From: "Li, Xiaoyun" To: "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: AQHVGejlkP1iUW2xJEm5zaROxaK52aaKiPmAgACdgNCAAZNE0P//jXsAgADLhQA= Date: Wed, 5 Jun 2019 13:36:11 +0000 Message-ID: References: <20190603084611.40931-1-xiaoyun.li@intel.com> <20190603084611.40931-5-xiaoyun.li@intel.com> <20190604064801.GA94383@intel.com> <20190605092512.GA4003@intel.com> In-Reply-To: <20190605092512.GA4003@intel.com> 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" >=20 > Yes, I agree, but I don't think it is the case here. >=20 > >It will cause segment fault in enqueue/dequeue. >=20 > Hmm, have you debug it? Which line caused the segfault? >=20 > You can refer to test_rawdev_enqdeq function in skeleton_rawdev_test.c, w= hat > it does is similar to my suggestion, and you just need one alloc/free. >=20 Of course I debug on it. It will cause seg fault at rte_memcpy. Because buf= fers[0]->buf_addr is not right. You can see the debug log. (gdb) p test_pkts_send[0].buf_addr $3 =3D (void *) 0x5555562784c0 (gdb) n 164 rte_rawdev_set_attr(dev_id, "spad14", val); (gdb) ntb_attr_set(): Set attribute (spad14) Value (0) 165 val =3D size; (gdb) 166 rte_rawdev_set_attr(dev_id, "spad15", val); (gdb) ntb_attr_set(): Set attribute (spad15) Value (35) 175 rte_rawdev_enqueue_buffers(dev_id, (struct rte_rawdev_buf *= *)&test_pkts_send, 1, (void *)size); (gdb) Thread 1 "ntb_fwd" hit Breakpoint 2, ntb_enqueue_bufs (dev=3D0x555556023b80= , buffers=3D0x7fffffff7fe0, count=3D1, context=3D0x23) at /home/xiaoyun/ntb/dpdk-next-net-intel/drivers/raw/nt= b_rawdev/ntb_rawdev.c:244 244 struct ntb_hw *hw =3D dev->dev_private; (gdb) n 248 if (hw->ntb_ops->get_peer_mw_addr =3D=3D NULL) (gdb) 249 return -ENOTSUP; (gdb) p buffers[0]->buf_addr $4 =3D (void *) 0x6f77206f6c6c6568 (gdb) p &buffers[0]->buf_addr $5 =3D (void **) 0x5555562784c0 > Thanks, > Xiaolong >=20 > > > >I will free twice. > > > >> > >2.17.1 > >> > >