qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH V2] config: split PVRDMA from RDMA
@ 2018-08-16 15:16 Marcel Apfelbaum
  2018-08-16 15:43 ` Marcel Apfelbaum
  2018-08-16 15:48 ` Thomas Huth
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel Apfelbaum @ 2018-08-16 15:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: yuval.shaia, thuth, rebecca, peter.maydell

In some BSD systems RDMA migration is possible while
the pvrdma device can't be used because the mremap system call
is missing.

Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
---
 configure             | 55 ++++++++++++++++++++++++++++++++++++++++++-
 hw/rdma/Makefile.objs |  2 +-
 2 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 2a7796ea80..b6d37a735b 100755
--- a/configure
+++ b/configure
@@ -375,6 +375,7 @@ hax="no"
 hvf="no"
 whpx="no"
 rdma=""
+pvrdma=""
 gprof="no"
 debug_tcg="no"
 debug="no"
@@ -1363,6 +1364,10 @@ for opt do
   ;;
   --disable-rdma) rdma="no"
   ;;
+  --enable-pvrdma) pvrdma="yes"
+  ;;
+  --disable-pvrdma) pvrdma="no"
+  ;;
   --with-gtkabi=*) gtkabi="$optarg"
   ;;
   --disable-vte) vte="no"
@@ -1669,7 +1674,8 @@ disabled with --disable-FEATURE, default is enabled if available:
   hax             HAX acceleration support
   hvf             Hypervisor.framework acceleration support
   whpx            Windows Hypervisor Platform acceleration support
-  rdma            Enable RDMA-based migration and PVRDMA support
+  rdma            Enable RDMA-based migration
+  pvrdma          Enable PVRDMA support
   vde             support for vde network
   netmap          support for netmap network
   linux-aio       Linux AIO support
@@ -3064,6 +3070,48 @@ EOF
   fi
 fi
 
+##########################################
+# PVRDMA detection
+
+cat > $TMPC <<EOF &&
+#include <sys/mman.h>
+
+int
+main(void)
+{
+    char buf = 0;
+    void *addr = &buf;
+    addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
+
+    return 0;
+}
+EOF
+
+if test "$rdma" = "yes" ; then
+    case "$pvrdma" in
+    "")
+        if compile_prog "" ""; then
+            pvrdma="yes"
+        else
+            pvrdma="no"
+        fi
+        ;;
+    "yes")
+        if ! compile_prog "" ""; then
+            error_exit "PVRDMA is not supported since mremap is not implemented"
+        fi
+        pvrdma="yes"
+        ;;
+    "no")
+        pvrdma="no"
+        ;;
+    esac
+else
+    if test "$pvrdma" = "yes" ; then
+        error_exit "PVRDMA requires rdma suppport"
+    fi
+    pvrdma="no"
+fi
 
 ##########################################
 # VNC SASL detection
@@ -5952,6 +6000,7 @@ if test "$tcg" = "yes" ; then
 fi
 echo "malloc trim support $malloc_trim"
 echo "RDMA support      $rdma"
+echo "PVRDMA support    $pvrdma"
 echo "fdt support       $fdt"
 echo "membarrier        $membarrier"
 echo "preadv support    $preadv"
@@ -6708,6 +6757,10 @@ if test "$rdma" = "yes" ; then
   echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
 fi
 
+if test "$pvrdma" = "yes" ; then
+  echo "CONFIG_PVRDMA=y" >> $config_host_mak
+fi
+
 if test "$have_rtnetlink" = "yes" ; then
   echo "CONFIG_RTNETLINK=y" >> $config_host_mak
 fi
diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs
index 3504c39d21..bd36cbf51c 100644
--- a/hw/rdma/Makefile.objs
+++ b/hw/rdma/Makefile.objs
@@ -1,4 +1,4 @@
-ifeq ($(CONFIG_RDMA),y)
+ifeq ($(CONFIG_PVRDMA),y)
 obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o
 obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
                      vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA
  2018-08-16 15:16 [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA Marcel Apfelbaum
@ 2018-08-16 15:43 ` Marcel Apfelbaum
  2018-08-16 15:48 ` Thomas Huth
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Apfelbaum @ 2018-08-16 15:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: yuval.shaia, thuth, rebecca, peter.maydell

Hi

On 08/16/2018 06:16 PM, Marcel Apfelbaum wrote:
> In some BSD systems RDMA migration is possible while
> the pvrdma device can't be used because the mremap system call
> is missing.
>
> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> ---

v1->v2:

  - Test pvrdma support against mremap instead of BSD systems. (Peter 
Maydell)

Thanks,
Marcel

>   configure             | 55 ++++++++++++++++++++++++++++++++++++++++++-
>   hw/rdma/Makefile.objs |  2 +-
>   2 files changed, 55 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 2a7796ea80..b6d37a735b 100755
> --- a/configure
> +++ b/configure
> @@ -375,6 +375,7 @@ hax="no"
>   hvf="no"
>   whpx="no"
>   rdma=""
> +pvrdma=""
>   gprof="no"
>   debug_tcg="no"
>   debug="no"
> @@ -1363,6 +1364,10 @@ for opt do
>     ;;
>     --disable-rdma) rdma="no"
>     ;;
> +  --enable-pvrdma) pvrdma="yes"
> +  ;;
> +  --disable-pvrdma) pvrdma="no"
> +  ;;
>     --with-gtkabi=*) gtkabi="$optarg"
>     ;;
>     --disable-vte) vte="no"
> @@ -1669,7 +1674,8 @@ disabled with --disable-FEATURE, default is enabled if available:
>     hax             HAX acceleration support
>     hvf             Hypervisor.framework acceleration support
>     whpx            Windows Hypervisor Platform acceleration support
> -  rdma            Enable RDMA-based migration and PVRDMA support
> +  rdma            Enable RDMA-based migration
> +  pvrdma          Enable PVRDMA support
>     vde             support for vde network
>     netmap          support for netmap network
>     linux-aio       Linux AIO support
> @@ -3064,6 +3070,48 @@ EOF
>     fi
>   fi
>   
> +##########################################
> +# PVRDMA detection
> +
> +cat > $TMPC <<EOF &&
> +#include <sys/mman.h>
> +
> +int
> +main(void)
> +{
> +    char buf = 0;
> +    void *addr = &buf;
> +    addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
> +
> +    return 0;
> +}
> +EOF
> +
> +if test "$rdma" = "yes" ; then
> +    case "$pvrdma" in
> +    "")
> +        if compile_prog "" ""; then
> +            pvrdma="yes"
> +        else
> +            pvrdma="no"
> +        fi
> +        ;;
> +    "yes")
> +        if ! compile_prog "" ""; then
> +            error_exit "PVRDMA is not supported since mremap is not implemented"
> +        fi
> +        pvrdma="yes"
> +        ;;
> +    "no")
> +        pvrdma="no"
> +        ;;
> +    esac
> +else
> +    if test "$pvrdma" = "yes" ; then
> +        error_exit "PVRDMA requires rdma suppport"
> +    fi
> +    pvrdma="no"
> +fi
>   
>   ##########################################
>   # VNC SASL detection
> @@ -5952,6 +6000,7 @@ if test "$tcg" = "yes" ; then
>   fi
>   echo "malloc trim support $malloc_trim"
>   echo "RDMA support      $rdma"
> +echo "PVRDMA support    $pvrdma"
>   echo "fdt support       $fdt"
>   echo "membarrier        $membarrier"
>   echo "preadv support    $preadv"
> @@ -6708,6 +6757,10 @@ if test "$rdma" = "yes" ; then
>     echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
>   fi
>   
> +if test "$pvrdma" = "yes" ; then
> +  echo "CONFIG_PVRDMA=y" >> $config_host_mak
> +fi
> +
>   if test "$have_rtnetlink" = "yes" ; then
>     echo "CONFIG_RTNETLINK=y" >> $config_host_mak
>   fi
> diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs
> index 3504c39d21..bd36cbf51c 100644
> --- a/hw/rdma/Makefile.objs
> +++ b/hw/rdma/Makefile.objs
> @@ -1,4 +1,4 @@
> -ifeq ($(CONFIG_RDMA),y)
> +ifeq ($(CONFIG_PVRDMA),y)
>   obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o
>   obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
>                        vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o

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

* Re: [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA
  2018-08-16 15:16 [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA Marcel Apfelbaum
  2018-08-16 15:43 ` Marcel Apfelbaum
@ 2018-08-16 15:48 ` Thomas Huth
  2018-08-16 15:58   ` Marcel Apfelbaum
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2018-08-16 15:48 UTC (permalink / raw)
  To: Marcel Apfelbaum, qemu-devel; +Cc: yuval.shaia, rebecca, peter.maydell

On 08/16/2018 05:16 PM, Marcel Apfelbaum wrote:
> In some BSD systems RDMA migration is possible while
> the pvrdma device can't be used because the mremap system call
> is missing.
> 
> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> ---
>  configure             | 55 ++++++++++++++++++++++++++++++++++++++++++-
>  hw/rdma/Makefile.objs |  2 +-
>  2 files changed, 55 insertions(+), 2 deletions(-)
[...]
> diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs
> index 3504c39d21..bd36cbf51c 100644
> --- a/hw/rdma/Makefile.objs
> +++ b/hw/rdma/Makefile.objs
> @@ -1,4 +1,4 @@
> -ifeq ($(CONFIG_RDMA),y)
> +ifeq ($(CONFIG_PVRDMA),y)
>  obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o
>  obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
>                       vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o
> 

Again: Shouldn't the CONFIG_PVRDMA only guard the second line? I thought
the first list should be fine with CONFIG_RDMA?

 Thomas

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

* Re: [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA
  2018-08-16 15:48 ` Thomas Huth
@ 2018-08-16 15:58   ` Marcel Apfelbaum
  2018-08-16 16:00     ` Thomas Huth
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Apfelbaum @ 2018-08-16 15:58 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: yuval.shaia, rebecca, peter.maydell

Hi Thomas,

On 08/16/2018 06:48 PM, Thomas Huth wrote:
> On 08/16/2018 05:16 PM, Marcel Apfelbaum wrote:
>> In some BSD systems RDMA migration is possible while
>> the pvrdma device can't be used because the mremap system call
>> is missing.
>>
>> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> ---
>>   configure             | 55 ++++++++++++++++++++++++++++++++++++++++++-
>>   hw/rdma/Makefile.objs |  2 +-
>>   2 files changed, 55 insertions(+), 2 deletions(-)
> [...]
>> diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs
>> index 3504c39d21..bd36cbf51c 100644
>> --- a/hw/rdma/Makefile.objs
>> +++ b/hw/rdma/Makefile.objs
>> @@ -1,4 +1,4 @@
>> -ifeq ($(CONFIG_RDMA),y)
>> +ifeq ($(CONFIG_PVRDMA),y)
>>   obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o
>>   obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
>>                        vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o
>>

> Again:

Sorry for not seeing the comment earlier.

>   Shouldn't the CONFIG_PVRDMA only guard the second line? I thought
> the first list should be fine with CONFIG_RDMA?

Indeed, theoretically the first line can be compiled  with CONFIG_RDMA,
however the only code that utilize the first line .o files is the pvrdma 
code.
So we will simply have a bigger binary without any reason.

Thanks,
Marcel

>   Thomas

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

* Re: [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA
  2018-08-16 15:58   ` Marcel Apfelbaum
@ 2018-08-16 16:00     ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2018-08-16 16:00 UTC (permalink / raw)
  To: Marcel Apfelbaum, qemu-devel; +Cc: yuval.shaia, rebecca, peter.maydell

On 08/16/2018 05:58 PM, Marcel Apfelbaum wrote:
> Hi Thomas,
> 
> On 08/16/2018 06:48 PM, Thomas Huth wrote:
>> On 08/16/2018 05:16 PM, Marcel Apfelbaum wrote:
>>> In some BSD systems RDMA migration is possible while
>>> the pvrdma device can't be used because the mremap system call
>>> is missing.
>>>
>>> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>>> ---
>>>   configure             | 55 ++++++++++++++++++++++++++++++++++++++++++-
>>>   hw/rdma/Makefile.objs |  2 +-
>>>   2 files changed, 55 insertions(+), 2 deletions(-)
>> [...]
>>> diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs
>>> index 3504c39d21..bd36cbf51c 100644
>>> --- a/hw/rdma/Makefile.objs
>>> +++ b/hw/rdma/Makefile.objs
>>> @@ -1,4 +1,4 @@
>>> -ifeq ($(CONFIG_RDMA),y)
>>> +ifeq ($(CONFIG_PVRDMA),y)
>>>   obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o
>>>   obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
>>>                        vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o
>>>
> 
>> Again:
> 
> Sorry for not seeing the comment earlier.
> 
>>   Shouldn't the CONFIG_PVRDMA only guard the second line? I thought
>> the first list should be fine with CONFIG_RDMA?
> 
> Indeed, theoretically the first line can be compiled  with CONFIG_RDMA,
> however the only code that utilize the first line .o files is the pvrdma
> code.
> So we will simply have a bigger binary without any reason.

Ok, thanks for the explanation! Patch looks fine to me in that case, so:

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

end of thread, other threads:[~2018-08-16 16:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16 15:16 [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA Marcel Apfelbaum
2018-08-16 15:43 ` Marcel Apfelbaum
2018-08-16 15:48 ` Thomas Huth
2018-08-16 15:58   ` Marcel Apfelbaum
2018-08-16 16:00     ` Thomas Huth

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).