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 57EAE12A1 for ; Wed, 7 May 2014 06:35:44 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 06 May 2014 21:35:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,1000,1389772800"; d="scan'208,217";a="527524116" Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by fmsmga001.fm.intel.com with ESMTP; 06 May 2014 21:35:48 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.19.9.28) by FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 6 May 2014 21:35:48 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX119.amr.corp.intel.com (10.19.9.28) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 6 May 2014 21:35:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.31]) by shsmsx102.ccr.corp.intel.com ([169.254.2.5]) with mapi id 14.03.0123.003; Wed, 7 May 2014 12:35:46 +0800 From: "Liu, Jijiang" To: "dev@dpdk.org" Thread-Topic: could not l2fwd in DOM0 Thread-Index: Ac9j0vUnb82OilObREO8jzx6VqYofAFadQ8wABuIuhA= Date: Wed, 7 May 2014 04:35:46 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01C6C07E@SHSMSX101.ccr.corp.intel.com> References: <7b60de2c2b904fe78a5ab2f73c08955f@MUC-SRV-MBX2.advaoptical.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] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] could not l2fwd in DOM0 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: Wed, 07 May 2014 04:35:45 -0000 Hi, I have checked source codes of xen_create_contiguous_region function in ker= nel 3.14, and found the dma_handle cannot be NULL. int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, unsigned int address_bits, dma_addr_t *dma_handle) { unsigned long *in_frames =3D discontig_frames, out_frame; unsigned long flags; int success; unsigned long vstart =3D (unsigned long)phys_to_virt(pstart); ... *dma_handle =3D virt_to_machine(vstart).maddr; return success ? 0 : -ENOMEM; } Thanks Frank Liu -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Samuel Monderer Sent: Wednesday, April 30, 2014 1:54 AM To: dev@dpdk.org Cc: Shimon Zadok Subject: [dpdk-dev] could not l2fwd in DOM0 Hi, First I've encountered a compiling problem when compiling for DOM0 due to p= rototype change of the function xen_create_contiguous_region I made the fol= lowing changes: diff --git a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c b/lib/librte_e= al/linuxapp/xen index 87fa3e6..8addc21 100644 --- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c +++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c @@ -64,6 +64,7 @@ #include #include #include +//#include #include #include @@ -309,6 +310,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struc= t dom0_mm_data uint64_t pfn, vstart, vaddr; uint32_t i, num_block, size; int idx; + dma_addr_t *dma_handle =3D NULL; /* Allocate 2M memory once */ num_block =3D meminfo->size / 2; @@ -344,7 +346,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struc= t dom0_mm_data * contiguous physical addresses, its maximum size is 2M. */ if (xen_create_contiguous_region(mm_data->block_info[i].vir= _addr, - DOM0_CONTIG_NUM_ORDER, 0) =3D=3D 0) { + DOM0_CONTIG_NUM_ORDER, 0, + dma_handle) =3D=3D 0) { mm_data->block_info[i].exchange_flag =3D 1; mm_data->block_info[i].mfn =3D pfn_to_mfn(mm_data->block_info[i].pfn); After that I tried to run l2fwd example and got a segmentation fault root@Smart:~/samuelm/dpdk/dpdk# modprobe uio root@Smart:~/samuelm/dpdk/dpdk= # insmod ./x86_64-default-linuxapp-gcc/kmod/igb_uio.ko root@Smart:~/samuelm/dpdk/dpdk# insmod ./x86_64-default-linuxapp-gcc/kmod/r= te_dom0_mm.ko root@Smart:~/samuelm/dpdk/dpdk# cd examples/l2fwd/build/ root@Smart:~/samue= lm/dpdk/dpdk/examples/l2fwd/build# echo 2048 > /sys/kernel/mm/dom0-mm/memsi= ze-mB/memsize root@Smart:~/samuelm/dpdk/dpdk/examples/l2fwd/build# ./l2fwd -c 3 -n 4 --xe= n-dom0 -- -q 1 -p 3 EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 0 on socket 0 EAL: Setting up memory... Segmentation fault root@Smart:~/samuelm/dpdk/dpdk/examples/l2fwd/build# Has anyone already encountered this problem? Samuelm