From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A4D99695D for ; Wed, 25 Apr 2018 14:00:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 05:00:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,326,1520924400"; d="scan'208";a="49812970" Received: from dpdk-xiao-1.sh.intel.com ([10.67.111.90]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2018 05:00:28 -0700 From: Xiao Wang To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Xiao Wang Date: Wed, 25 Apr 2018 19:59:53 +0800 Message-Id: <20180425115953.187338-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/ifcvf: remove live migration 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: , X-List-Received-Date: Wed, 25 Apr 2018 12:00:31 -0000 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 --- 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