From patchwork Fri May 15 11:01:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunjian Wang X-Patchwork-Id: 70328 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A9F3A00C3; Fri, 15 May 2020 13:02:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 921CD1DB0B; Fri, 15 May 2020 13:02:11 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 73F361DB08 for ; Fri, 15 May 2020 13:02:08 +0200 (CEST) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BBA04650C6EF9D1DEA8C for ; Fri, 15 May 2020 19:02:03 +0800 (CST) Received: from localhost (10.173.251.152) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Fri, 15 May 2020 19:01:55 +0800 From: wangyunjian To: CC: , , , Yunjian Wang Date: Fri, 15 May 2020 19:01:54 +0800 Message-ID: <1589540514-26972-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.173.251.152] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA 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" From: Yunjian Wang As all vfio_cfgs need to map all dpdk segments for DMA, but now only default_vfio_cfg map it. This patch changes rte_vfio_setup_device() as a default map, so that IOMMU progrming does notneed to map dpdk segments separately. Signed-off-by: Yunjian Wang --- lib/librte_eal/linux/eal_vfio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c index d26e1649a..46160c328 100644 --- a/lib/librte_eal/linux/eal_vfio.c +++ b/lib/librte_eal/linux/eal_vfio.c @@ -807,10 +807,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, * after registering callback, to prevent races */ rte_mcfg_mem_read_lock(); - if (vfio_cfg == default_vfio_cfg) - ret = t->dma_map_func(vfio_container_fd); - else - ret = 0; + ret = t->dma_map_func(vfio_container_fd); if (ret) { RTE_LOG(ERR, EAL, " %s DMA remapping failed, error %i (%s)\n",