From patchwork Sun Apr 21 21:18:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mrhines@linux.vnet.ibm.com X-Patchwork-Id: 238264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B6A052C0112 for ; Mon, 22 Apr 2013 07:21:23 +1000 (EST) Received: from localhost ([::1]:49053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1hJ-0003A2-So for incoming@patchwork.ozlabs.org; Sun, 21 Apr 2013 17:21:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1ee-0007dC-1o for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UU1eT-0008Ce-84 for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:35 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:41221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UU1eT-0008CY-4D for qemu-devel@nongnu.org; Sun, 21 Apr 2013 17:18:25 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 21 Apr 2013 17:18:24 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 21 Apr 2013 17:18:22 -0400 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 0BFCE6E803F for ; Sun, 21 Apr 2013 17:18:19 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3LLILHg23068810 for ; Sun, 21 Apr 2013 17:18:21 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3LLILGC024045 for ; Sun, 21 Apr 2013 18:18:21 -0300 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3LLIJhh023852; Sun, 21 Apr 2013 18:18:21 -0300 From: mrhines@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Sun, 21 Apr 2013 17:18:00 -0400 Message-Id: <1366579081-6857-12-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366579081-6857-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1366579081-6857-1-git-send-email-mrhines@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13042121-5806-0000-0000-000020CF9DE7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.137 Cc: aliguori@us.ibm.com, quintela@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v5 11/12] rdma: core logic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Michael R. Hines" Code that does need to be visible is kept well contained inside this file and this is the only new additional file to the entire patch - good progress. This file includes the entire protocol and interfaces required to perform RDMA migration. Also, the configure and Makefile modifications to link this file are included. Full documentation is in docs/rdma.txt Signed-off-by: Michael R. Hines --- Makefile.objs | 1 + configure | 29 +++++++++++++++++++++++++++++ include/migration/migration.h | 4 ++++ migration.c | 8 ++++++++ 4 files changed, 42 insertions(+) diff --git a/Makefile.objs b/Makefile.objs index a473348..d744827 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -49,6 +49,7 @@ common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ common-obj-y += migration.o migration-tcp.o +common-obj-$(CONFIG_RDMA) += migration-rdma.o common-obj-y += qemu-char.o #aio.o common-obj-y += block-migration.o common-obj-y += page_cache.o xbzrle.o diff --git a/configure b/configure index ed49f91..53472e4 100755 --- a/configure +++ b/configure @@ -180,6 +180,7 @@ xfs="" vhost_net="no" kvm="no" +rdma="yes" gprof="no" debug_tcg="no" debug="no" @@ -920,6 +921,10 @@ for opt do ;; --enable-gtk) gtk="yes" ;; + --enable-rdma) rdma="yes" + ;; + --disable-rdma) rdma="no" + ;; --with-gtkabi=*) gtkabi="$optarg" ;; --enable-tpm) tpm="yes" @@ -1131,6 +1136,8 @@ echo " --enable-bluez enable bluez stack connectivity" echo " --disable-slirp disable SLIRP userspace network connectivity" echo " --disable-kvm disable KVM acceleration support" echo " --enable-kvm enable KVM acceleration support" +echo " --disable-rdma disable RDMA-based migration support" +echo " --enable-rdma enable RDMA-based migration support" echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" echo " --disable-nptl disable usermode NPTL support" echo " --enable-nptl enable usermode NPTL support" @@ -1805,6 +1812,23 @@ EOF libs_softmmu="$sdl_libs $libs_softmmu" fi +if test "$rdma" != "no" ; then + cat > $TMPC < +int main(void) { return 0; } +EOF + rdma_libs="-lrdmacm -libverbs" + if compile_prog "-Werror" "$rdma_libs" ; then + rdma="yes" + libs_softmmu="$libs_softmmu $rdma_libs" + else + if test "$rdma" = "yes" ; then + feature_not_found "rdma" + fi + rdma="no" + fi +fi + ########################################## # VNC TLS/WS detection if test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then @@ -3543,6 +3567,7 @@ echo "Linux AIO support $linux_aio" echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" +echo "RDMA support $rdma" echo "TCG interpreter $tcg_interpreter" echo "fdt support $fdt" echo "preadv support $preadv" @@ -4505,6 +4530,10 @@ if [ "$pixman" = "internal" ]; then echo "config-host.h: subdir-pixman" >> $config_host_mak fi +if test "$rdma" = "yes" ; then +echo "CONFIG_RDMA=y" >> $config_host_mak +fi + if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi diff --git a/include/migration/migration.h b/include/migration/migration.h index 3b4d5e9..f1c1999 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -76,6 +76,10 @@ void fd_start_incoming_migration(const char *path, Error **errp); void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp); +void rdma_start_outgoing_migration(void *opaque, const char *host_port, Error **errp); + +void rdma_start_incoming_migration(const char *host_port, Error **errp); + void migrate_fd_error(MigrationState *s); void migrate_fd_connect(MigrationState *s); diff --git a/migration.c b/migration.c index b13fa66..f9e3244 100644 --- a/migration.c +++ b/migration.c @@ -77,6 +77,10 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) if (strstart(uri, "tcp:", &p)) tcp_start_incoming_migration(p, errp); +#ifdef CONFIG_RDMA + else if (strstart(uri, "x-rdma:", &p)) + rdma_start_incoming_migration(p, errp); +#endif #if !defined(WIN32) else if (strstart(uri, "exec:", &p)) exec_start_incoming_migration(p, errp); @@ -407,6 +411,10 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); +#ifdef CONFIG_RDMA + } else if (strstart(uri, "x-rdma:", &p)) { + rdma_start_outgoing_migration(s, p, &local_err); +#endif #if !defined(WIN32) } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err);