From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5EFF55932 for ; Wed, 20 Aug 2014 03:40:39 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 19 Aug 2014 18:43:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,898,1400050800"; d="scan'208";a="590532683" Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by orsmga002.jf.intel.com with ESMTP; 19 Aug 2014 18:43:53 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 19 Aug 2014 18:43:52 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 19 Aug 2014 18:43:52 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.198]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.147]) with mapi id 14.03.0195.001; Wed, 20 Aug 2014 09:43:50 +0800 From: "Liu, Jijiang" To: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] i40e: support xen domain0 Thread-Index: AQHPt4clIf/VWkePDU+f775upNPWP5vYwLOA Date: Wed, 20 Aug 2014 01:43:50 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D61B74@SHSMSX101.ccr.corp.intel.com> References: <1407996773-7055-1-git-send-email-helin.zhang@intel.com> In-Reply-To: <1407996773-7055-1-git-send-email-helin.zhang@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] i40e: support xen domain0 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, 20 Aug 2014 01:40:39 -0000 Acked-by: Jijiang Liu > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang > Sent: Thursday, August 14, 2014 2:13 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] i40e: support xen domain0 >=20 > i40e was failing to run in XEN domain0, as the physical memory for adminq > DMA should be allocated and translated in a different way for XEN domain0= . > So > rte_memzone_reserve_bounded() should be used for DMA memory allocation, > and rte_mem_phy2mch() should be used for DMA memory address translation > to support running i40e PMD in XEN domain0. >=20 > Signed-off-by: Helin Zhang > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index 9ed31b5..7a823a0 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -1515,14 +1515,23 @@ > i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw, >=20 > id++; > snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id); > +#ifdef RTE_LIBRTE_XEN_DOM0 > + mz =3D rte_memzone_reserve_bounded(z_name, size, 0, 0, alignment, > + RTE_PGSIZE_2M); > +#else > mz =3D rte_memzone_reserve_aligned(z_name, size, 0, 0, alignment); > +#endif > if (!mz) > return I40E_ERR_NO_MEMORY; >=20 > mem->id =3D id; > mem->size =3D size; > mem->va =3D mz->addr; > +#ifdef RTE_LIBRTE_XEN_DOM0 > + mem->pa =3D rte_mem_phy2mch(mz->memseg_id, mz->phys_addr); #else > mem->pa =3D mz->phys_addr; > +#endif >=20 > return I40E_SUCCESS; > } > -- > 1.8.1.4