DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] fm10k: support XEN domain0
@ 2015-05-15  8:56 Shaopeng He
  2015-05-15 10:21 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Shaopeng He @ 2015-05-15  8:56 UTC (permalink / raw)
  To: dev; +Cc: Shaopeng He

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 <shaopeng.he@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-01 10:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15  8:56 [dpdk-dev] [PATCH] fm10k: support XEN domain0 Shaopeng He
2015-05-15 10:21 ` Thomas Monjalon
2015-05-15 23:57 ` Stephen Hemminger
2015-05-18  2:23   ` Liu, Jijiang
2015-06-02  3:27     ` He, Shaopeng
2015-06-05  3:17 ` Liu, Jijiang
2015-06-23  1:21   ` He, Shaopeng
2015-06-30  3:27     ` He, Shaopeng
2015-07-01 10:47       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).