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 8871AA0559; Mon, 16 Mar 2020 17:10:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9A541C0C3; Mon, 16 Mar 2020 17:10:05 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id C7A171C06C for ; Mon, 16 Mar 2020 17:10:03 +0100 (CET) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02GFpY52071469 for ; Mon, 16 Mar 2020 12:10:03 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yrtk6tde5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Mar 2020 12:10:02 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 02GFq0cR073661 for ; Mon, 16 Mar 2020 12:10:02 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yrtk6tddc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Mar 2020 12:10:01 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02GG24iE019802; Mon, 16 Mar 2020 16:10:00 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma05wdc.us.ibm.com with ESMTP id 2yrpw6173j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Mar 2020 16:10:00 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02GG9xxm41615622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Mar 2020 16:09:59 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6EDAC605B; Mon, 16 Mar 2020 16:09:59 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 490BCC6057; Mon, 16 Mar 2020 16:09:59 +0000 (GMT) Received: from Davids-MBP.randomparity.org (unknown [9.211.144.249]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 16 Mar 2020 16:09:58 +0000 (GMT) To: David Marchand Cc: dev References: <20200226195033.33877-1-drc@linux.vnet.ibm.com> From: David Christensen Message-ID: Date: Mon, 16 Mar 2020 09:09:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-16_06:2020-03-12, 2020-03-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=960 phishscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 clxscore=1011 suspectscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003160074 Subject: Re: [dpdk-dev] [PATCH] bus/pci: support iova=va on PowerNV systems 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" >> Bare metal PowerNV systems include a DPDK supported IOMMU that allows >> IOVA=VA support. Test for the platform type and report virtual address >> support if running on a PowerNV system. ... >> >> + >> + char *line = 0; > > Nit: NULL Fixed. >> + /* Check for a PowerNV platform */ >> + while (getline(&line, &len, fp) != -1) { > > From here, you leak line. > Fixed. > > Nit, to avoid multiple level of indent, how about invert the check: > > if (strstr(line, "platform") == NULL) > continue; Fixed. >> + if (strstr(line, "PowerNV") != NULL) { >> + RTE_LOG(DEBUG, EAL, "Running on a PowerNV system\n"); > > Not really helpful, it does not indicate that this system iommu supports VA. This is the advice given by the kernel developer who maintains the IOMMU code for PPC. There's nothing in the /sys filesystem that describes the IOMMU like there is in x86_64 platforms. All POWER systems supported by DPDK have an IOMMU (you can't turn it off). This is true for both bare metal systems like PowerNV (Power Non-Virtualized) as well as virtualized systems like QEMU/KVM and PowerVM LPARs. In the case of virtualized systems the IOMMU has different capabilities and is not currently supported in DPDK. Thus, if I know the platform I'm running on then I know the IOMMU is present and enabled. Dave