From: Shaopeng He Date: Fri, 15 May 2015 08:56:02 +0000 (+0800) Subject: fm10k: support Xen domain0 X-Git-Tag: spdx-start~8883 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6ffefc4c8fe0f8dc3ee88aa43e062c4167a27b47;p=dpdk.git fm10k: support Xen domain0 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 Acked-by: Jijiang Liu --- diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 406c350a4b..c1a20690a0 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1302,7 +1302,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; @@ -1448,7 +1452,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