From patchwork Thu Dec 13 10:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Wang X-Patchwork-Id: 48753 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D7031B502; Thu, 13 Dec 2018 11:19:31 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 8AA371B4E8 for ; Thu, 13 Dec 2018 11:19:29 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2018 02:19:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,348,1539673200"; d="scan'208";a="101210442" Received: from dpdk-xiao-1.sh.intel.com ([10.67.111.145]) by orsmga008.jf.intel.com with ESMTP; 13 Dec 2018 02:19:27 -0800 From: Xiao Wang To: alejandro.lucero@netronome.com, tiwei.bie@intel.com Cc: maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com, xiaolong.ye@intel.com, Xiao Wang Date: Thu, 13 Dec 2018 18:09:07 +0800 Message-Id: <20181213100910.13087-7-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20181213100910.13087-1-xiao.w.wang@intel.com> References: <20181213011014.110089-3-xiao.w.wang@intel.com> <20181213100910.13087-1-xiao.w.wang@intel.com> Subject: [dpdk-dev] [PATCH v3 6/9] net/ifc: add devarg for LM mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch series enables a new method for live migration, i.e. software assisted live migration. This patch provides a device argument for user to choose the methold. When "swlm=1", driver/device will do live migration with a relay thread dealing with dirty page logging. Without this parameter, device will do dirty page logging and there's no relay thread consuming CPU resource. Signed-off-by: Xiao Wang --- drivers/net/ifc/ifcvf_vdpa.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index c0e50354a..395c5112f 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -31,9 +32,11 @@ #endif #define IFCVF_VDPA_MODE "vdpa" +#define IFCVF_SW_FALLBACK_LM "swlm" static const char * const ifcvf_valid_arguments[] = { IFCVF_VDPA_MODE, + IFCVF_SW_FALLBACK_LM, NULL }; @@ -56,6 +59,7 @@ struct ifcvf_internal { rte_atomic32_t dev_attached; rte_atomic32_t running; rte_spinlock_t lock; + bool sw_lm; }; struct internal_list { @@ -767,6 +771,7 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct ifcvf_internal *internal = NULL; struct internal_list *list = NULL; int vdpa_mode = 0; + int sw_fallback_lm = 0; struct rte_kvargs *kvlist = NULL; int ret = 0; @@ -826,6 +831,14 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, internal->dev_addr.type = PCI_ADDR; list->internal = internal; + if (rte_kvargs_count(kvlist, IFCVF_SW_FALLBACK_LM)) { + ret = rte_kvargs_process(kvlist, IFCVF_SW_FALLBACK_LM, + &open_int, &sw_fallback_lm); + if (ret < 0) + goto error; + } + internal->sw_lm = sw_fallback_lm; + internal->did = rte_vdpa_register_device(&internal->dev_addr, &ifcvf_ops); if (internal->did < 0) {