DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ifc: add live migration support
@ 2018-09-10 11:01 Xiao Wang
  2018-09-13 20:39 ` Ye Xiaolong
  2018-09-20 23:55 ` Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: Xiao Wang @ 2018-09-10 11:01 UTC (permalink / raw)
  To: tiwei.bie; +Cc: dev, xiaolong.ye, zhihong.wang, Xiao Wang

IFCVF can help to log dirty page in live migration stage,
each queue's index can be read and configured to support
VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ifc/base/ifcvf.c | 33 +++++++++++++++++++-
 drivers/net/ifc/base/ifcvf.h |  7 +++++
 drivers/net/ifc/ifcvf_vdpa.c | 71 ++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 108 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ifc/base/ifcvf.c b/drivers/net/ifc/base/ifcvf.c
index 4b22d9ed1..3c0b2dff6 100644
--- a/drivers/net/ifc/base/ifcvf.c
+++ b/drivers/net/ifc/base/ifcvf.c
@@ -249,7 +249,7 @@ ifcvf_hw_disable(struct ifcvf_hw *hw)
 		IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg->queue_msix_vector);
 		ring_state = *(u32 *)(hw->lm_cfg + IFCVF_LM_RING_STATE_OFFSET +
 				(i / 2) * IFCVF_LM_CFG_SIZE + (i % 2) * 4);
-		hw->vring[i].last_avail_idx = (u16)ring_state;
+		hw->vring[i].last_avail_idx = (u16)(ring_state >> 16);
 		hw->vring[i].last_used_idx = (u16)(ring_state >> 16);
 	}
 }
@@ -278,6 +278,37 @@ 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_VF;
+}
+
+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 badacb615..f026c70ab 100644
--- a/drivers/net/ifc/base/ifcvf.h
+++ b/drivers/net/ifc/base/ifcvf.h
@@ -49,6 +49,7 @@
 #define IFCVF_LM_DISABLE		0x0
 #define IFCVF_LM_ENABLE_VF		0x1
 #define IFCVF_LM_ENABLE_PF		0x3
+#define IFCVF_LOG_BASE			0x100000000000
 
 #define IFCVF_32_BIT_MASK		0xffffffff
 
@@ -142,6 +143,12 @@ 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 88d814037..3c5430dc0 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -7,6 +7,7 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/epoll.h>
+#include <linux/virtio_net.h>
 
 #include <rte_malloc.h>
 #include <rte_memory.h>
@@ -276,12 +277,30 @@ vdpa_ifcvf_start(struct ifcvf_internal *internal)
 	return ifcvf_start_hw(&internal->hw);
 }
 
+static void
+ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)
+{
+	uint32_t i, size;
+	uint64_t pfn;
+
+	pfn = hw->vring[queue].used / PAGE_SIZE;
+	size = hw->vring[queue].size * sizeof(struct vring_used_elem) +
+			sizeof(__virtio16) * 3;
+
+	for (i = 0; i <= size / PAGE_SIZE; i++)
+		__sync_fetch_and_or_8(&log_buf[(pfn + i) / 8],
+				1 << ((pfn + i) % 8));
+}
+
 static void
 vdpa_ifcvf_stop(struct ifcvf_internal *internal)
 {
 	struct ifcvf_hw *hw = &internal->hw;
 	uint32_t i;
 	int vid;
+	uint64_t features;
+	uint64_t log_base, log_size;
+	uint8_t *log_buf;
 
 	vid = internal->vid;
 	ifcvf_stop_hw(hw);
@@ -289,6 +308,21 @@ 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);
+		rte_vfio_container_dma_unmap(internal->vfio_container_fd,
+				log_base, IFCVF_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;
+		for (i = 0; i < hw->nr_vring; i++)
+			ifcvf_used_ring_log(hw, i, log_buf);
+	}
 }
 
 #define MSIX_IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + \
@@ -548,6 +582,35 @@ 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(vid, &features);
+
+	if (RTE_VHOST_NEED_LOG(features)) {
+		rte_vhost_get_log_base(vid, &log_base, &log_size);
+		rte_vfio_container_dma_map(internal->vfio_container_fd,
+				log_base, IFCVF_LOG_BASE, log_size);
+		ifcvf_enable_logging(&internal->hw, IFCVF_LOG_BASE, log_size);
+	}
+
+	return 0;
+}
+
 static int
 ifcvf_get_vfio_group_fd(int vid)
 {
@@ -664,7 +727,7 @@ struct rte_vdpa_dev_ops ifcvf_ops = {
 	.dev_conf = ifcvf_dev_config,
 	.dev_close = ifcvf_dev_close,
 	.set_vring_state = NULL,
-	.set_features = NULL,
+	.set_features = ifcvf_set_features,
 	.migration_done = NULL,
 	.get_vfio_group_fd = ifcvf_get_vfio_group_fd,
 	.get_vfio_device_fd = ifcvf_get_vfio_device_fd,
@@ -699,7 +762,11 @@ 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 << VIRTIO_NET_F_GUEST_ANNOUNCE) |
+		(1ULL << VIRTIO_NET_F_CTRL_VQ) |
+		(1ULL << VIRTIO_NET_F_STATUS) |
+		(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) |
+		(1ULL << VHOST_F_LOG_ALL);
 
 	internal->dev_addr.pci_addr = pci_dev->addr;
 	internal->dev_addr.type = PCI_ADDR;
-- 
2.15.1

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

* Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
  2018-09-10 11:01 [dpdk-dev] [PATCH] net/ifc: add live migration support Xiao Wang
@ 2018-09-13 20:39 ` Ye Xiaolong
  2018-09-19 14:36   ` Zhang, Qi Z
  2018-09-20 23:55 ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Ye Xiaolong @ 2018-09-13 20:39 UTC (permalink / raw)
  To: Xiao Wang; +Cc: tiwei.bie, dev, zhihong.wang

Reviewed-and-Tested-by: Ye Xiaolong <xiaolong.ye@intel.com>

Thanks,
Xiaolong

On 09/10, Xiao Wang wrote:
>IFCVF can help to log dirty page in live migration stage,
>each queue's index can be read and configured to support
>VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.
>
>Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
>---
> drivers/net/ifc/base/ifcvf.c | 33 +++++++++++++++++++-
> drivers/net/ifc/base/ifcvf.h |  7 +++++
> drivers/net/ifc/ifcvf_vdpa.c | 71 ++++++++++++++++++++++++++++++++++++++++++--
> 3 files changed, 108 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/ifc/base/ifcvf.c b/drivers/net/ifc/base/ifcvf.c
>index 4b22d9ed1..3c0b2dff6 100644
>--- a/drivers/net/ifc/base/ifcvf.c
>+++ b/drivers/net/ifc/base/ifcvf.c
>@@ -249,7 +249,7 @@ ifcvf_hw_disable(struct ifcvf_hw *hw)
> 		IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg->queue_msix_vector);
> 		ring_state = *(u32 *)(hw->lm_cfg + IFCVF_LM_RING_STATE_OFFSET +
> 				(i / 2) * IFCVF_LM_CFG_SIZE + (i % 2) * 4);
>-		hw->vring[i].last_avail_idx = (u16)ring_state;
>+		hw->vring[i].last_avail_idx = (u16)(ring_state >> 16);
> 		hw->vring[i].last_used_idx = (u16)(ring_state >> 16);
> 	}
> }
>@@ -278,6 +278,37 @@ 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_VF;
>+}
>+
>+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 badacb615..f026c70ab 100644
>--- a/drivers/net/ifc/base/ifcvf.h
>+++ b/drivers/net/ifc/base/ifcvf.h
>@@ -49,6 +49,7 @@
> #define IFCVF_LM_DISABLE		0x0
> #define IFCVF_LM_ENABLE_VF		0x1
> #define IFCVF_LM_ENABLE_PF		0x3
>+#define IFCVF_LOG_BASE			0x100000000000
> 
> #define IFCVF_32_BIT_MASK		0xffffffff
> 
>@@ -142,6 +143,12 @@ 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 88d814037..3c5430dc0 100644
>--- a/drivers/net/ifc/ifcvf_vdpa.c
>+++ b/drivers/net/ifc/ifcvf_vdpa.c
>@@ -7,6 +7,7 @@
> #include <fcntl.h>
> #include <sys/ioctl.h>
> #include <sys/epoll.h>
>+#include <linux/virtio_net.h>
> 
> #include <rte_malloc.h>
> #include <rte_memory.h>
>@@ -276,12 +277,30 @@ vdpa_ifcvf_start(struct ifcvf_internal *internal)
> 	return ifcvf_start_hw(&internal->hw);
> }
> 
>+static void
>+ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)
>+{
>+	uint32_t i, size;
>+	uint64_t pfn;
>+
>+	pfn = hw->vring[queue].used / PAGE_SIZE;
>+	size = hw->vring[queue].size * sizeof(struct vring_used_elem) +
>+			sizeof(__virtio16) * 3;
>+
>+	for (i = 0; i <= size / PAGE_SIZE; i++)
>+		__sync_fetch_and_or_8(&log_buf[(pfn + i) / 8],
>+				1 << ((pfn + i) % 8));
>+}
>+
> static void
> vdpa_ifcvf_stop(struct ifcvf_internal *internal)
> {
> 	struct ifcvf_hw *hw = &internal->hw;
> 	uint32_t i;
> 	int vid;
>+	uint64_t features;
>+	uint64_t log_base, log_size;
>+	uint8_t *log_buf;
> 
> 	vid = internal->vid;
> 	ifcvf_stop_hw(hw);
>@@ -289,6 +308,21 @@ 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);
>+		rte_vfio_container_dma_unmap(internal->vfio_container_fd,
>+				log_base, IFCVF_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;
>+		for (i = 0; i < hw->nr_vring; i++)
>+			ifcvf_used_ring_log(hw, i, log_buf);
>+	}
> }
> 
> #define MSIX_IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + \
>@@ -548,6 +582,35 @@ 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(vid, &features);
>+
>+	if (RTE_VHOST_NEED_LOG(features)) {
>+		rte_vhost_get_log_base(vid, &log_base, &log_size);
>+		rte_vfio_container_dma_map(internal->vfio_container_fd,
>+				log_base, IFCVF_LOG_BASE, log_size);
>+		ifcvf_enable_logging(&internal->hw, IFCVF_LOG_BASE, log_size);
>+	}
>+
>+	return 0;
>+}
>+
> static int
> ifcvf_get_vfio_group_fd(int vid)
> {
>@@ -664,7 +727,7 @@ struct rte_vdpa_dev_ops ifcvf_ops = {
> 	.dev_conf = ifcvf_dev_config,
> 	.dev_close = ifcvf_dev_close,
> 	.set_vring_state = NULL,
>-	.set_features = NULL,
>+	.set_features = ifcvf_set_features,
> 	.migration_done = NULL,
> 	.get_vfio_group_fd = ifcvf_get_vfio_group_fd,
> 	.get_vfio_device_fd = ifcvf_get_vfio_device_fd,
>@@ -699,7 +762,11 @@ 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 << VIRTIO_NET_F_GUEST_ANNOUNCE) |
>+		(1ULL << VIRTIO_NET_F_CTRL_VQ) |
>+		(1ULL << VIRTIO_NET_F_STATUS) |
>+		(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) |
>+		(1ULL << VHOST_F_LOG_ALL);
> 
> 	internal->dev_addr.pci_addr = pci_dev->addr;
> 	internal->dev_addr.type = PCI_ADDR;
>-- 
>2.15.1
>

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

* Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
  2018-09-13 20:39 ` Ye Xiaolong
@ 2018-09-19 14:36   ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2018-09-19 14:36 UTC (permalink / raw)
  To: Ye, Xiaolong, Wang, Xiao W; +Cc: Bie, Tiwei, dev, Wang,  Zhihong



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ye Xiaolong
> Sent: Friday, September 14, 2018 4:40 AM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; dev@dpdk.org; Wang, Zhihong
> <zhihong.wang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
> 
> Reviewed-and-Tested-by: Ye Xiaolong <xiaolong.ye@intel.com>
> 
> Thanks,
> Xiaolong
> 
> On 09/10, Xiao Wang wrote:
> >IFCVF can help to log dirty page in live migration stage, each queue's
> >index can be read and configured to support VHOST_USER_GET_VRING_BASE
> >and VHOST_USER_SET_VRING_BASE.
> >
> >Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

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

* Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
  2018-09-10 11:01 [dpdk-dev] [PATCH] net/ifc: add live migration support Xiao Wang
  2018-09-13 20:39 ` Ye Xiaolong
@ 2018-09-20 23:55 ` Ferruh Yigit
  2018-10-02 14:45   ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-09-20 23:55 UTC (permalink / raw)
  To: Xiao Wang, tiwei.bie; +Cc: dev, xiaolong.ye, zhihong.wang, Chao Zhu

On 9/10/2018 12:01 PM, Xiao Wang wrote:
> IFCVF can help to log dirty page in live migration stage,
> each queue's index can be read and configured to support
> VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

<...>

> +static void
> +ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)
> +{
> +	uint32_t i, size;
> +	uint64_t pfn;
> +
> +	pfn = hw->vring[queue].used / PAGE_SIZE;
> +	size = hw->vring[queue].size * sizeof(struct vring_used_elem) +
> +			sizeof(__virtio16) * 3;

Getting a build error for PowerPC [1], can someone from PPC side confirm it please?

[1]
.../drivers/net/ifc/ifcvf_vdpa.c: In function ‘ifcvf_used_ring_log’:
.../drivers/net/ifc/ifcvf_vdpa.c:288:11: error: ‘__virtio16’ undeclared (first
use in this function)
    sizeof(__virtio16) * 3;
           ^~~~~~~~~~

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

* Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
  2018-09-20 23:55 ` Ferruh Yigit
@ 2018-10-02 14:45   ` Ferruh Yigit
  2018-10-08  2:59     ` Wang, Xiao W
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-10-02 14:45 UTC (permalink / raw)
  To: Xiao Wang, tiwei.bie
  Cc: dev, xiaolong.ye, zhihong.wang, Chao Zhu, Thomas Monjalon, Qian Xu

On 9/21/2018 12:55 AM, Ferruh Yigit wrote:
> On 9/10/2018 12:01 PM, Xiao Wang wrote:
>> IFCVF can help to log dirty page in live migration stage,
>> each queue's index can be read and configured to support
>> VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.
>>
>> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> 
> <...>
> 
>> +static void
>> +ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)
>> +{
>> +	uint32_t i, size;
>> +	uint64_t pfn;
>> +
>> +	pfn = hw->vring[queue].used / PAGE_SIZE;
>> +	size = hw->vring[queue].size * sizeof(struct vring_used_elem) +
>> +			sizeof(__virtio16) * 3;
> 
> Getting a build error for PowerPC [1], can someone from PPC side confirm it please?
> 
> [1]
> .../drivers/net/ifc/ifcvf_vdpa.c: In function ‘ifcvf_used_ring_log’:
> .../drivers/net/ifc/ifcvf_vdpa.c:288:11: error: ‘__virtio16’ undeclared (first
> use in this function)
>     sizeof(__virtio16) * 3;
>            ^~~~~~~~~~

Also "__virtio16" seems added into Linux kernel on v3.19. Systems with kernel
version less than this causing build error.

Can we replace "__virtio16" usage with basic types to prevent build error?
If so can you please send this as a fix patch?

Thanks,
ferruh

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

* Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
  2018-10-02 14:45   ` Ferruh Yigit
@ 2018-10-08  2:59     ` Wang, Xiao W
  0 siblings, 0 replies; 6+ messages in thread
From: Wang, Xiao W @ 2018-10-08  2:59 UTC (permalink / raw)
  To: Yigit, Ferruh, Bie, Tiwei
  Cc: dev, Ye, Xiaolong, Wang, Zhihong, Chao Zhu, Thomas Monjalon, Xu, Qian Q

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, October 2, 2018 10:46 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Bie, Tiwei <tiwei.bie@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>; Wang, Zhihong
> <zhihong.wang@intel.com>; Chao Zhu <chaozhu@linux.vnet.ibm.com>;
> Thomas Monjalon <thomas@monjalon.net>; Xu, Qian Q <qian.q.xu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] net/ifc: add live migration support
> 
> On 9/21/2018 12:55 AM, Ferruh Yigit wrote:
> > On 9/10/2018 12:01 PM, Xiao Wang wrote:
> >> IFCVF can help to log dirty page in live migration stage,
> >> each queue's index can be read and configured to support
> >> VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE.
> >>
> >> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> >
> > <...>
> >
> >> +static void
> >> +ifcvf_used_ring_log(struct ifcvf_hw *hw, uint32_t queue, uint8_t *log_buf)
> >> +{
> >> +	uint32_t i, size;
> >> +	uint64_t pfn;
> >> +
> >> +	pfn = hw->vring[queue].used / PAGE_SIZE;
> >> +	size = hw->vring[queue].size * sizeof(struct vring_used_elem) +
> >> +			sizeof(__virtio16) * 3;
> >
> > Getting a build error for PowerPC [1], can someone from PPC side confirm it
> please?
> >
> > [1]
> > .../drivers/net/ifc/ifcvf_vdpa.c: In function ‘ifcvf_used_ring_log’:
> > .../drivers/net/ifc/ifcvf_vdpa.c:288:11: error: ‘__virtio16’ undeclared (first
> > use in this function)
> >     sizeof(__virtio16) * 3;
> >            ^~~~~~~~~~
> 
> Also "__virtio16" seems added into Linux kernel on v3.19. Systems with kernel
> version less than this causing build error.
> 
> Can we replace "__virtio16" usage with basic types to prevent build error?
> If so can you please send this as a fix patch?

Yes, will do that.

BRs,
Xiao

> 
> Thanks,
> ferruh

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

end of thread, other threads:[~2018-10-08  2:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 11:01 [dpdk-dev] [PATCH] net/ifc: add live migration support Xiao Wang
2018-09-13 20:39 ` Ye Xiaolong
2018-09-19 14:36   ` Zhang, Qi Z
2018-09-20 23:55 ` Ferruh Yigit
2018-10-02 14:45   ` Ferruh Yigit
2018-10-08  2:59     ` Wang, Xiao W

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