From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAEEBA00C5; Thu, 30 Apr 2020 01:29:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 914021D999; Thu, 30 Apr 2020 01:29:53 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id AC9271D98E for ; Thu, 30 Apr 2020 01:29:51 +0200 (CEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03TN3diX046435 for ; Wed, 29 Apr 2020 19:29:50 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mhqa6bxe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Apr 2020 19:29:50 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03TNTQnI016993 for ; Wed, 29 Apr 2020 23:29:50 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma03dal.us.ibm.com with ESMTP id 30mcu7twaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Apr 2020 23:29:49 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03TNTmO028246472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Apr 2020 23:29:48 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A87A3C6059; Wed, 29 Apr 2020 23:29:48 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 756B9C605A; Wed, 29 Apr 2020 23:29:48 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 29 Apr 2020 23:29:48 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: David Christensen Date: Wed, 29 Apr 2020 16:29:30 -0700 Message-Id: <20200429232931.87233-2-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20200429232931.87233-1-drc@linux.vnet.ibm.com> References: <20200429232931.87233-1-drc@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-29_11:2020-04-29, 2020-04-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 adultscore=0 suspectscore=1 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004290164 Subject: [dpdk-dev] [PATCH 1/2] vfio: use ifdef's for ppc64 spapr code 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" Enclose ppc64 specific SPAPR VFIO support with ifdef's. Signed-off-by: David Christensen --- lib/librte_eal/linux/eal_vfio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c index d26e1649a..953397984 100644 --- a/lib/librte_eal/linux/eal_vfio.c +++ b/lib/librte_eal/linux/eal_vfio.c @@ -56,8 +56,10 @@ static struct vfio_config *default_vfio_cfg = &vfio_cfgs[0]; static int vfio_type1_dma_map(int); static int vfio_type1_dma_mem_map(int, uint64_t, uint64_t, uint64_t, int); +#ifdef RTE_ARCH_PPC_64 static int vfio_spapr_dma_map(int); static int vfio_spapr_dma_mem_map(int, uint64_t, uint64_t, uint64_t, int); +#endif static int vfio_noiommu_dma_map(int); static int vfio_noiommu_dma_mem_map(int, uint64_t, uint64_t, uint64_t, int); static int vfio_dma_mem_map(struct vfio_config *vfio_cfg, uint64_t vaddr, @@ -72,6 +74,7 @@ static const struct vfio_iommu_type iommu_types[] = { .dma_map_func = &vfio_type1_dma_map, .dma_user_map_func = &vfio_type1_dma_mem_map }, +#ifdef RTE_ARCH_PPC_64 /* ppc64 IOMMU, otherwise known as spapr */ { .type_id = RTE_VFIO_SPAPR, @@ -79,6 +82,7 @@ static const struct vfio_iommu_type iommu_types[] = { .dma_map_func = &vfio_spapr_dma_map, .dma_user_map_func = &vfio_spapr_dma_mem_map }, +#endif /* IOMMU-less mode */ { .type_id = RTE_VFIO_NOIOMMU, @@ -1407,6 +1411,7 @@ vfio_type1_dma_map(int vfio_container_fd) return rte_memseg_walk(type1_map, &vfio_container_fd); } +#ifdef RTE_ARCH_PPC_64 static int vfio_spapr_dma_do_map(int vfio_container_fd, uint64_t vaddr, uint64_t iova, uint64_t len, int do_map) @@ -1578,7 +1583,6 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd, /* create new DMA window */ ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, create); if (ret) { -#ifdef VFIO_IOMMU_SPAPR_INFO_DDW /* try possible page_shift and levels for workaround */ uint32_t levels; @@ -1588,7 +1592,6 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd, ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, create); } -#endif if (ret) { RTE_LOG(ERR, EAL, " cannot create new DMA window, " "error %i (%s)\n", errno, strerror(errno)); @@ -1747,6 +1750,7 @@ vfio_spapr_dma_map(int vfio_container_fd) return 0; } +#endif /* RTE_ARCH_PPC_64 */ static int vfio_noiommu_dma_map(int __rte_unused vfio_container_fd) -- 2.18.1