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 0B55C594E for ; Fri, 15 May 2015 10:56:10 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 15 May 2015 01:56:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,433,1427785200"; d="scan'208";a="695268883" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 15 May 2015 01:56:09 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t4F8u7Bs017695; Fri, 15 May 2015 16:56:07 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t4F8u4Kf013739; Fri, 15 May 2015 16:56:06 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t4F8u4Yg013735; Fri, 15 May 2015 16:56:04 +0800 From: Shaopeng He To: dev@dpdk.org Date: Fri, 15 May 2015 16:56:02 +0800 Message-Id: <1431680162-13704-1-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 Cc: Shaopeng He Subject: [dpdk-dev] [PATCH] fm10k: 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: Fri, 15 May 2015 08:56:11 -0000 fm10k was failing to run in XEN domain0, as the physical memory for 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 fm10k PMD in XEN domain0. Signed-off-by: Shaopeng He --- lib/librte_pmd_fm10k/fm10k_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_pmd_fm10k/fm10k_ethdev.c b/lib/librte_pmd_fm10k/fm10k_ethdev.c index 275c19c..c85c856 100644 --- a/lib/librte_pmd_fm10k/fm10k_ethdev.c +++ b/lib/librte_pmd_fm10k/fm10k_ethdev.c @@ -1004,7 +1004,11 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, return (-ENOMEM); } q->hw_ring = mz->addr; +#ifdef RTE_LIBRTE_XEN_DOM0 + q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr); +#else q->hw_ring_phys_addr = mz->phys_addr; +#endif dev->data->rx_queues[queue_id] = q; return 0; @@ -1150,7 +1154,11 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, return (-ENOMEM); } q->hw_ring = mz->addr; +#ifdef RTE_LIBRTE_XEN_DOM0 + q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr); +#else q->hw_ring_phys_addr = mz->phys_addr; +#endif /* * allocate memory for the RS bit tracker. Enough slots to hold the -- 1.9.3