summaryrefslogtreecommitdiff
path: root/drivers/net/ifc
diff options
context:
space:
mode:
authorXiao Wang <xiao.w.wang@intel.com>2018-12-18 16:02:04 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-12-21 16:22:40 +0100
commit4c3f55cc23ea01712a255e356d6cd61f886045c1 (patch)
tree8d67ffc74cd18265b82af8ebd8d8bcbbcc52d1b1 /drivers/net/ifc
parent40ef35f4a504e7030882cf717eb01453d149685d (diff)
downloaddpdk-next-eventdev-4c3f55cc23ea01712a255e356d6cd61f886045c1.zip
dpdk-next-eventdev-4c3f55cc23ea01712a255e356d6cd61f886045c1.tar.gz
dpdk-next-eventdev-4c3f55cc23ea01712a255e356d6cd61f886045c1.tar.xz
net/ifc: add LM mode parameter
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 "sw-live-migration=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 <xiao.w.wang@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'drivers/net/ifc')
-rw-r--r--drivers/net/ifc/ifcvf_vdpa.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index c0e5035..2f73d3c 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -8,6 +8,7 @@
#include <sys/ioctl.h>
#include <sys/epoll.h>
#include <linux/virtio_net.h>
+#include <stdbool.h>
#include <rte_malloc.h>
#include <rte_memory.h>
@@ -31,9 +32,11 @@
#endif
#define IFCVF_VDPA_MODE "vdpa"
+#define IFCVF_SW_FALLBACK_LM "sw-live-migration"
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) {