All of lore.kernel.org
 help / color / mirror / Atom feed
* dpdk kernel module when calling xen_create_contiguous_region
@ 2014-05-01 13:57 Samuel Monderer
  2014-05-01 15:06 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Monderer @ 2014-05-01 13:57 UTC (permalink / raw)
  To: xen-devel@lists.xen.org; +Cc: Shimon Zadok, Eyal Ben Saadon, Andrew Sergeev

Hi,

DPDK application requires hugepages to run.
XEN DOM0 does not support hugepages, to be able to run dpdk application in Dom0 a kernel module has been developed to facilitate the allocation and
mapping of memory.

The current version of dpdk uses the old version of  xen_create_contiguous_region which doesn't get the 4th parameter dma_handle.
I tried to update the call to  xen_create_contiguous_region as following, but the module crashes when it calls  xen_create_contiguous_region.
--- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
+++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
@@ -64,6 +64,7 @@
 #include <linux/errno.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>

 #include <xen/xen.h>
 #include <xen/page.h>
@@ -309,6 +310,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
        uint64_t pfn, vstart, vaddr;
        uint32_t i, num_block, size;
        int idx;
+       dma_addr_t dma_handle;

        /* Allocate 2M memory once */
        num_block = meminfo->size / 2;
@@ -344,7 +346,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
                 * contiguous physical addresses, its maximum size is 2M.
                 */
                if (xen_create_contiguous_region(mm_data->block_info[i].vir_addr,
-                                   DOM0_CONTIG_NUM_ORDER, 0) == 0) {
+                                   DOM0_CONTIG_NUM_ORDER, 0, &dma_handle) == 0) {
                        mm_data->block_info[i].exchange_flag = 1;
                        mm_data->block_info[i].mfn =
                                pfn_to_mfn(mm_data->block_info[i].pfn);

Tried to find some documentation xen memory regions without success.

Samuel

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

* Re: dpdk kernel module when calling xen_create_contiguous_region
  2014-05-01 13:57 dpdk kernel module when calling xen_create_contiguous_region Samuel Monderer
@ 2014-05-01 15:06 ` Konrad Rzeszutek Wilk
  2014-05-01 15:20   ` Samuel Monderer
       [not found]   ` <20140501150653.GA18826-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-05-01 15:06 UTC (permalink / raw)
  To: Samuel Monderer
  Cc: Shimon Zadok, Eyal Ben Saadon, Andrew Sergeev,
	xen-devel@lists.xen.org

On Thu, May 01, 2014 at 01:57:17PM +0000, Samuel Monderer wrote:
> Hi,
> 
> DPDK application requires hugepages to run.
> XEN DOM0 does not support hugepages, to be able to run dpdk application in Dom0 a kernel module has been developed to facilitate the allocation and
> mapping of memory.
> 
> The current version of dpdk uses the old version of  xen_create_contiguous_region which doesn't get the 4th parameter dma_handle.
> I tried to update the call to  xen_create_contiguous_region as following, but the module crashes when it calls  xen_create_contiguous_region.


You might consider also CC-ing the DPDK developers.

> --- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> +++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> @@ -64,6 +64,7 @@
>  #include <linux/errno.h>
>  #include <linux/vmalloc.h>
>  #include <linux/mm.h>
> 
>  #include <xen/xen.h>
>  #include <xen/page.h>
> @@ -309,6 +310,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
>         uint64_t pfn, vstart, vaddr;
>         uint32_t i, num_block, size;
>         int idx;
> +       dma_addr_t dma_handle;
> 
>         /* Allocate 2M memory once */
>         num_block = meminfo->size / 2;
> @@ -344,7 +346,7 @@ dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
>                  * contiguous physical addresses, its maximum size is 2M.
>                  */
>                 if (xen_create_contiguous_region(mm_data->block_info[i].vir_addr,
> -                                   DOM0_CONTIG_NUM_ORDER, 0) == 0) {
> +                                   DOM0_CONTIG_NUM_ORDER, 0, &dma_handle) == 0) {
>                         mm_data->block_info[i].exchange_flag = 1;
>                         mm_data->block_info[i].mfn =
>                                 pfn_to_mfn(mm_data->block_info[i].pfn);
> 
> Tried to find some documentation xen memory regions without success.
> 
> Samuel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [Xen-devel] dpdk kernel module when calling xen_create_contiguous_region
       [not found]   ` <20140501150653.GA18826-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
@ 2014-05-01 15:20     ` Samuel Monderer
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Monderer @ 2014-05-01 15:20 UTC (permalink / raw)
  To: xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org
  Cc: dev-VfR2kkLFssw@public.gmane.org



> -----Original Message-----
> From: Konrad Rzeszutek Wilk [mailto:konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org]
> Sent: Thursday, May 01, 2014 6:07 PM
> To: Samuel Monderer
> Cc: xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org; Shimon Zadok; Eyal Ben Saadon; Andrew
> Sergeev
> Subject: Re: [Xen-devel] dpdk kernel module when calling
> xen_create_contiguous_region
> 
> On Thu, May 01, 2014 at 01:57:17PM +0000, Samuel Monderer wrote:
> > Hi,
> >
> > DPDK application requires hugepages to run.
> > XEN DOM0 does not support hugepages, to be able to run dpdk
> > application in Dom0 a kernel module has been developed to facilitate the
> allocation and mapping of memory.
> >
> > The current version of dpdk uses the old version of
> xen_create_contiguous_region which doesn't get the 4th parameter
> dma_handle.
> > I tried to update the call to  xen_create_contiguous_region as following,
> but the module crashes when it calls  xen_create_contiguous_region.
> 
> 
> You might consider also CC-ing the DPDK developers.

CCed DPDK Developers

> 
> > --- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> > +++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> > @@ -64,6 +64,7 @@
> >  #include <linux/errno.h>
> >  #include <linux/vmalloc.h>
> >  #include <linux/mm.h>
> >
> >  #include <xen/xen.h>
> >  #include <xen/page.h>
> > @@ -309,6 +310,7 @@ dom0_prepare_memsegs(struct memory_info*
> meminfo, struct dom0_
> >         uint64_t pfn, vstart, vaddr;
> >         uint32_t i, num_block, size;
> >         int idx;
> > +       dma_addr_t dma_handle;
> >
> >         /* Allocate 2M memory once */
> >         num_block = meminfo->size / 2; @@ -344,7 +346,7 @@
> > dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
> >                  * contiguous physical addresses, its maximum size is 2M.
> >                  */
> >                 if (xen_create_contiguous_region(mm_data-
> >block_info[i].vir_addr,
> > -                                   DOM0_CONTIG_NUM_ORDER, 0) == 0) {
> > +                                   DOM0_CONTIG_NUM_ORDER, 0,
> > + &dma_handle) == 0) {
> >                         mm_data->block_info[i].exchange_flag = 1;
> >                         mm_data->block_info[i].mfn =
> >
> > pfn_to_mfn(mm_data->block_info[i].pfn);
> >
> > Tried to find some documentation xen memory regions without success.
> >
> > Samuel
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org
> > http://lists.xen.org/xen-devel

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

* Re: dpdk kernel module when calling xen_create_contiguous_region
  2014-05-01 15:06 ` Konrad Rzeszutek Wilk
@ 2014-05-01 15:20   ` Samuel Monderer
       [not found]   ` <20140501150653.GA18826-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Monderer @ 2014-05-01 15:20 UTC (permalink / raw)
  To: xen-devel@lists.xen.org; +Cc: dev@dpdk.org



> -----Original Message-----
> From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com]
> Sent: Thursday, May 01, 2014 6:07 PM
> To: Samuel Monderer
> Cc: xen-devel@lists.xen.org; Shimon Zadok; Eyal Ben Saadon; Andrew
> Sergeev
> Subject: Re: [Xen-devel] dpdk kernel module when calling
> xen_create_contiguous_region
> 
> On Thu, May 01, 2014 at 01:57:17PM +0000, Samuel Monderer wrote:
> > Hi,
> >
> > DPDK application requires hugepages to run.
> > XEN DOM0 does not support hugepages, to be able to run dpdk
> > application in Dom0 a kernel module has been developed to facilitate the
> allocation and mapping of memory.
> >
> > The current version of dpdk uses the old version of
> xen_create_contiguous_region which doesn't get the 4th parameter
> dma_handle.
> > I tried to update the call to  xen_create_contiguous_region as following,
> but the module crashes when it calls  xen_create_contiguous_region.
> 
> 
> You might consider also CC-ing the DPDK developers.

CCed DPDK Developers

> 
> > --- a/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> > +++ b/lib/librte_eal/linuxapp/xen_dom0/dom0_mm_misc.c
> > @@ -64,6 +64,7 @@
> >  #include <linux/errno.h>
> >  #include <linux/vmalloc.h>
> >  #include <linux/mm.h>
> >
> >  #include <xen/xen.h>
> >  #include <xen/page.h>
> > @@ -309,6 +310,7 @@ dom0_prepare_memsegs(struct memory_info*
> meminfo, struct dom0_
> >         uint64_t pfn, vstart, vaddr;
> >         uint32_t i, num_block, size;
> >         int idx;
> > +       dma_addr_t dma_handle;
> >
> >         /* Allocate 2M memory once */
> >         num_block = meminfo->size / 2; @@ -344,7 +346,7 @@
> > dom0_prepare_memsegs(struct memory_info* meminfo, struct dom0_
> >                  * contiguous physical addresses, its maximum size is 2M.
> >                  */
> >                 if (xen_create_contiguous_region(mm_data-
> >block_info[i].vir_addr,
> > -                                   DOM0_CONTIG_NUM_ORDER, 0) == 0) {
> > +                                   DOM0_CONTIG_NUM_ORDER, 0,
> > + &dma_handle) == 0) {
> >                         mm_data->block_info[i].exchange_flag = 1;
> >                         mm_data->block_info[i].mfn =
> >
> > pfn_to_mfn(mm_data->block_info[i].pfn);
> >
> > Tried to find some documentation xen memory regions without success.
> >
> > Samuel
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2014-05-01 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 13:57 dpdk kernel module when calling xen_create_contiguous_region Samuel Monderer
2014-05-01 15:06 ` Konrad Rzeszutek Wilk
2014-05-01 15:20   ` Samuel Monderer
     [not found]   ` <20140501150653.GA18826-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2014-05-01 15:20     ` [Xen-devel] " Samuel Monderer

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.