* [PATCH] i40e: support xen domain0
@ 2014-08-14 6:12 Helin Zhang
[not found] ` <1407996773-7055-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Helin Zhang @ 2014-08-14 6:12 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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.
Signed-off-by: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
lib/librte_pmd_i40e/i40e_ethdev.c | 9 +++++++++
1 file changed, 9 insertions(+)
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,
id++;
snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id);
+#ifdef RTE_LIBRTE_XEN_DOM0
+ mz = rte_memzone_reserve_bounded(z_name, size, 0, 0, alignment,
+ RTE_PGSIZE_2M);
+#else
mz = rte_memzone_reserve_aligned(z_name, size, 0, 0, alignment);
+#endif
if (!mz)
return I40E_ERR_NO_MEMORY;
mem->id = id;
mem->size = size;
mem->va = mz->addr;
+#ifdef RTE_LIBRTE_XEN_DOM0
+ mem->pa = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr);
+#else
mem->pa = mz->phys_addr;
+#endif
return I40E_SUCCESS;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1407996773-7055-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] i40e: support xen domain0 [not found] ` <1407996773-7055-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2014-08-14 7:16 ` Zhan, Zhaochen 2014-08-20 1:43 ` Liu, Jijiang 1 sibling, 0 replies; 4+ messages in thread From: Zhan, Zhaochen @ 2014-08-14 7:16 UTC (permalink / raw) To: Zhang, Helin, dev-VfR2kkLFssw@public.gmane.org > 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. > > Signed-off-by: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Tested-by: Zhaochen Zhan <zhaochen.zhan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> This patch updates i40e to support xen domain0, testpmd can works OK with it. It is ready to be integrated to dpdk.org. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i40e: support xen domain0 [not found] ` <1407996773-7055-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2014-08-14 7:16 ` Zhan, Zhaochen @ 2014-08-20 1:43 ` Liu, Jijiang [not found] ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D61B74-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 1 sibling, 1 reply; 4+ messages in thread From: Liu, Jijiang @ 2014-08-20 1:43 UTC (permalink / raw) To: Zhang, Helin, dev-VfR2kkLFssw@public.gmane.org Acked-by: Jijiang Liu <jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Helin Zhang > Sent: Thursday, August 14, 2014 2:13 PM > To: dev-VfR2kkLFssw@public.gmane.org > Subject: [dpdk-dev] [PATCH] i40e: support xen domain0 > > 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. > > Signed-off-by: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > 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, > > id++; > snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id); > +#ifdef RTE_LIBRTE_XEN_DOM0 > + mz = rte_memzone_reserve_bounded(z_name, size, 0, 0, alignment, > + RTE_PGSIZE_2M); > +#else > mz = rte_memzone_reserve_aligned(z_name, size, 0, 0, alignment); > +#endif > if (!mz) > return I40E_ERR_NO_MEMORY; > > mem->id = id; > mem->size = size; > mem->va = mz->addr; > +#ifdef RTE_LIBRTE_XEN_DOM0 > + mem->pa = rte_mem_phy2mch(mz->memseg_id, mz->phys_addr); #else > mem->pa = mz->phys_addr; > +#endif > > return I40E_SUCCESS; > } > -- > 1.8.1.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D61B74-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] i40e: support xen domain0 [not found] ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D61B74-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2014-08-25 13:59 ` Thomas Monjalon 0 siblings, 0 replies; 4+ messages in thread From: Thomas Monjalon @ 2014-08-25 13:59 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev-VfR2kkLFssw > > 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. > > > > Signed-off-by: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > Acked-by: Jijiang Liu <jijiang.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Applied for version 1.7.1. Thanks -- Thomas ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-25 13:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 6:12 [PATCH] i40e: support xen domain0 Helin Zhang
[not found] ` <1407996773-7055-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-14 7:16 ` Zhan, Zhaochen
2014-08-20 1:43 ` Liu, Jijiang
[not found] ` <1ED644BD7E0A5F4091CF203DAFB8E4CC01D61B74-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-08-25 13:59 ` Thomas Monjalon
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.