DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ifcvf: remove live migration
@ 2018-04-25 11:59 Xiao Wang
  2018-04-25 15:05 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Wang @ 2018-04-25 11:59 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Xiao Wang

Live migration feature will be based on future development on ifc driver,
including port representor implementation and potential change in QEMU
and vhost user lib.

This patch removes live migration in ifcvf driver, if possible we could
squash this patch into 7c9f28370437 ("net/ifcvf: add ifcvf vdpa driver"),
and remove the live migration segment in that commit log.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 doc/guides/nics/ifcvf.rst    |  4 +---
 drivers/net/ifc/base/ifcvf.c | 31 ------------------------
 drivers/net/ifc/base/ifcvf.h |  6 -----
 drivers/net/ifc/ifcvf_vdpa.c | 57 +++-----------------------------------------
 4 files changed, 4 insertions(+), 94 deletions(-)

diff --git a/doc/guides/nics/ifcvf.rst b/doc/guides/nics/ifcvf.rst
index d7e76353c..48f9adf1d 100644
--- a/doc/guides/nics/ifcvf.rst
+++ b/doc/guides/nics/ifcvf.rst
@@ -8,8 +8,7 @@ The IFCVF vDPA (vhost data path acceleration) driver provides support for the
 Intel FPGA 100G VF (IFCVF). IFCVF's datapath is virtio ring compatible, it
 works as a HW vhost backend which can send/receive packets to/from virtio
 directly by DMA. Besides, it supports dirty page logging and device state
-report/restore. This driver enables its vDPA functionality with live migration
-feature.
+report/restore, this driver enables its vDPA functionality.
 
 
 Pre-Installation Configuration
@@ -71,7 +70,6 @@ Features
 Features of the IFCVF driver are:
 
 - Compatibility with virtio 0.95 and 1.0.
-- Live migration.
 
 
 Prerequisites
diff --git a/drivers/net/ifc/base/ifcvf.c b/drivers/net/ifc/base/ifcvf.c
index bbeed30e8..4b22d9ed1 100644
--- a/drivers/net/ifc/base/ifcvf.c
+++ b/drivers/net/ifc/base/ifcvf.c
@@ -278,37 +278,6 @@ ifcvf_stop_hw(struct ifcvf_hw *hw)
 	ifcvf_reset(hw);
 }
 
-void
-ifcvf_enable_logging(struct ifcvf_hw *hw, u64 log_base, u64 log_size)
-{
-	u8 *lm_cfg;
-
-	lm_cfg = hw->lm_cfg;
-
-	*(u32 *)(lm_cfg + IFCVF_LM_BASE_ADDR_LOW) =
-		log_base & IFCVF_32_BIT_MASK;
-
-	*(u32 *)(lm_cfg + IFCVF_LM_BASE_ADDR_HIGH) =
-		(log_base >> 32) & IFCVF_32_BIT_MASK;
-
-	*(u32 *)(lm_cfg + IFCVF_LM_END_ADDR_LOW) =
-		(log_base + log_size) & IFCVF_32_BIT_MASK;
-
-	*(u32 *)(lm_cfg + IFCVF_LM_END_ADDR_HIGH) =
-		((log_base + log_size) >> 32) & IFCVF_32_BIT_MASK;
-
-	*(u32 *)(lm_cfg + IFCVF_LM_LOGGING_CTRL) = IFCVF_LM_ENABLE_PF;
-}
-
-void
-ifcvf_disable_logging(struct ifcvf_hw *hw)
-{
-	u8 *lm_cfg;
-
-	lm_cfg = hw->lm_cfg;
-	*(u32 *)(lm_cfg + IFCVF_LM_LOGGING_CTRL) = IFCVF_LM_DISABLE;
-}
-
 void
 ifcvf_notify_queue(struct ifcvf_hw *hw, u16 qid)
 {
diff --git a/drivers/net/ifc/base/ifcvf.h b/drivers/net/ifc/base/ifcvf.h
index 77a2bfa83..badacb615 100644
--- a/drivers/net/ifc/base/ifcvf.h
+++ b/drivers/net/ifc/base/ifcvf.h
@@ -142,12 +142,6 @@ ifcvf_start_hw(struct ifcvf_hw *hw);
 void
 ifcvf_stop_hw(struct ifcvf_hw *hw);
 
-void
-ifcvf_enable_logging(struct ifcvf_hw *hw, u64 log_base, u64 log_size);
-
-void
-ifcvf_disable_logging(struct ifcvf_hw *hw);
-
 void
 ifcvf_notify_queue(struct ifcvf_hw *hw, u16 qid);
 
diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index 26d70be18..c6627c23a 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -280,12 +280,8 @@ static void
 vdpa_ifcvf_stop(struct ifcvf_internal *internal)
 {
 	struct ifcvf_hw *hw = &internal->hw;
-	uint32_t i, j;
+	uint32_t i;
 	int vid;
-	uint64_t features, pfn;
-	uint64_t log_base, log_size;
-	uint32_t size;
-	uint8_t *log_buf;
 
 	vid = internal->vid;
 	ifcvf_stop_hw(hw);
@@ -293,24 +289,6 @@ vdpa_ifcvf_stop(struct ifcvf_internal *internal)
 	for (i = 0; i < hw->nr_vring; i++)
 		rte_vhost_set_vring_base(vid, i, hw->vring[i].last_avail_idx,
 				hw->vring[i].last_used_idx);
-
-	rte_vhost_get_negotiated_features(vid, &features);
-	if (RTE_VHOST_NEED_LOG(features)) {
-		ifcvf_disable_logging(hw);
-		rte_vhost_get_log_base(internal->vid, &log_base, &log_size);
-		/*
-		 * IFCVF marks dirty memory pages for only packet buffer,
-		 * SW helps to mark the used ring as dirty after device stops.
-		 */
-		log_buf = (uint8_t *)(uintptr_t)log_base;
-		size = hw->vring[i].size * 8 + 4;
-		for (i = 0; i < hw->nr_vring; i++) {
-			pfn = hw->vring[i].used / PAGE_SIZE;
-			for (j = 0; j <= size / PAGE_SIZE; j++)
-				__sync_fetch_and_or_8(&log_buf[(pfn + j) / 8],
-						 1 << ((pfn + j) % 8));
-		}
-	}
 }
 
 #define MSIX_IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + \
@@ -570,34 +548,6 @@ ifcvf_dev_close(int vid)
 	return 0;
 }
 
-static int
-ifcvf_set_features(int vid)
-{
-	uint64_t features;
-	int did;
-	struct internal_list *list;
-	struct ifcvf_internal *internal;
-	uint64_t log_base, log_size;
-
-	did = rte_vhost_get_vdpa_device_id(vid);
-	list = find_internal_resource_by_did(did);
-	if (list == NULL) {
-		DRV_LOG(ERR, "Invalid device id: %d", did);
-		return -1;
-	}
-
-	internal = list->internal;
-	rte_vhost_get_negotiated_features(internal->vid, &features);
-
-	if (RTE_VHOST_NEED_LOG(features)) {
-		rte_vhost_get_log_base(internal->vid, &log_base, &log_size);
-		log_base = rte_mem_virt2phy((void *)(uintptr_t)log_base);
-		ifcvf_enable_logging(&internal->hw, log_base, log_size);
-	}
-
-	return 0;
-}
-
 static int
 ifcvf_get_vfio_group_fd(int vid)
 {
@@ -711,7 +661,7 @@ struct rte_vdpa_dev_ops ifcvf_ops = {
 	.dev_conf = ifcvf_dev_config,
 	.dev_close = ifcvf_dev_close,
 	.set_vring_state = NULL,
-	.set_features = ifcvf_set_features,
+	.set_features = NULL,
 	.migration_done = NULL,
 	.get_vfio_group_fd = ifcvf_get_vfio_group_fd,
 	.get_vfio_device_fd = ifcvf_get_vfio_device_fd,
@@ -746,8 +696,7 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	features = ifcvf_get_features(&internal->hw);
 	internal->features = (features &
 		~(1ULL << VIRTIO_F_IOMMU_PLATFORM)) |
-		(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) |
-		(1ULL << VHOST_F_LOG_ALL);
+		(1ULL << VHOST_USER_F_PROTOCOL_FEATURES);
 
 	internal->dev_addr.pci_addr = pci_dev->addr;
 	internal->dev_addr.type = PCI_ADDR;
-- 
2.15.1

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

* Re: [dpdk-dev] [PATCH] net/ifcvf: remove live migration
  2018-04-25 11:59 [dpdk-dev] [PATCH] net/ifcvf: remove live migration Xiao Wang
@ 2018-04-25 15:05 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-04-25 15:05 UTC (permalink / raw)
  To: Xiao Wang; +Cc: dev

On 4/25/2018 12:59 PM, Xiao Wang wrote:
> Live migration feature will be based on future development on ifc driver,
> including port representor implementation and potential change in QEMU
> and vhost user lib.
> 
> This patch removes live migration in ifcvf driver, if possible we could
> squash this patch into 7c9f28370437 ("net/ifcvf: add ifcvf vdpa driver"),
> and remove the live migration segment in that commit log.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Squashed into relevant commit in next-net, thanks.

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

end of thread, other threads:[~2018-04-25 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 11:59 [dpdk-dev] [PATCH] net/ifcvf: remove live migration Xiao Wang
2018-04-25 15:05 ` Ferruh Yigit

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