From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 634EC7CB9 for ; Mon, 10 Jul 2017 08:32:32 +0200 (CEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6A6T5K9032325 for ; Mon, 10 Jul 2017 02:32:31 -0400 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bjux6rrkv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Jul 2017 02:32:31 -0400 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jul 2017 16:32:28 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Jul 2017 16:32:27 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6A6WQDE16056338 for ; Mon, 10 Jul 2017 16:32:26 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v6A6WIwl010910 for ; Mon, 10 Jul 2017 16:32:18 +1000 Received: from [9.109.222.235] ([9.109.222.235]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v6A6WG2J010864; Mon, 10 Jul 2017 16:32:17 +1000 To: Declan Doherty Cc: dev@dpdk.org, Thomas Monjalon , Ferruh Yigit References: <266cd54d289bfd6e9535a173c9607f0234f8b1b7.1499167396.git.gowrishankar.m@linux.vnet.ibm.com> <2115e096-6c7f-08a1-bec2-1860b5ff11ae@intel.com> From: gowrishankar muthukrishnan Date: Mon, 10 Jul 2017 12:02:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <2115e096-6c7f-08a1-bec2-1860b5ff11ae@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-TM-AS-MML: disable x-cbid: 17071006-1617-0000-0000-000001F440E1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071006-1618-0000-0000-0000483BE047 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-10_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707100116 Subject: Re: [dpdk-dev] [PATCH v2] net/bonding: support bifurcated driver in eal cli using --vdev 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: Mon, 10 Jul 2017 06:32:32 -0000 On Friday 07 July 2017 09:08 PM, Declan Doherty wrote: > On 04/07/2017 12:57 PM, Gowrishankar wrote: >> From: Gowrishankar Muthukrishnan >> >> At present, creating bonding devices using --vdev is broken for PMD like >> mlx5 as it is neither UIO nor VFIO based and hence PMD driver is unknown >> to find_port_id_by_pci_addr(), as below. >> >> testpmd --vdev 'net_bonding0,mode=1,slave=,socket_id=0' >> >> PMD: bond_ethdev_parse_slave_port_kvarg(150) - Invalid slave port value >> () specified >> EAL: Failed to parse slave ports for bonded device net_bonding0 >> >> This patch fixes parsing PCI ID from bonding device params by verifying >> it in RTE PCI bus, rather than checking dev->kdrv. >> >> Changes: >> v2 - revisit fix by iterating rte_pci_bus >> >> Signed-off-by: Gowrishankar Muthukrishnan >> >> --- > ... >> > > Hey Gowrishankar, > > I was having a look at this patch and there is the following > checkpatch error. > > _coding style issues_ > > > WARNING:AVOID_EXTERNS: externs should be avoided in .c files > #48: FILE: drivers/net/bonding/rte_eth_bond_args.c:43: > +extern struct rte_pci_bus rte_pci_bus; > Hi Declan, Thank you for your review. Yes, but I also saw some references like above in older code. > > Looking at bit closer at the issue I think there is a simpler > solution, the bonding driver really shouldn't be parsing the PCI bus > directly, and since PCI devices use the PCI DBF as their name we can > simply replace the all the scanning code with a simple call to > rte_eth_dev_get_port_by_name API. > But you are removing an option to mention ports by PCI addresses right (as I see parse_port_id() completely removed in your patch) ?. IMO, we just need to check if given eth pci id (incase we mention ports ib PCI ID) is one of what EAL scanned in PCI. Also, slaves should not be from any blacklisted PCI ids (as we test with -b or -w). With your patch, it failed to parse params as below. testpmd -l 0,8,16 --socket-mem 512,512 --vdev 'net_bonding0,mode=1,slave=0002:01:00.0,slave=0002:01:00.1,primary=0002:01:00.0,socket_id=0' Configuring Port 0 (socket 1) PMD: net_mlx5: 0x4a7f8f80: TX queues number update: 0 -> 1 PMD: net_mlx5: 0x4a7f8f80: RX queues number update: 0 -> 1 Port 0: E4:1D:2D:C9:C7:56 Configuring Port 1 (socket 1) PMD: net_mlx5: 0x4a7fd000: TX queues number update: 0 -> 1 PMD: net_mlx5: 0x4a7fd000: RX queues number update: 0 -> 1 Port 1: E4:1D:2D:C9:C7:57 Configuring Port 2 (socket 0) EAL: Failed to parse slave ports for bonded device net_bonding0 Fail to configure port 2 EAL: Error - exiting with code: 1 Cause: Start ports failed With my patch, I have tested with -w and -b options in testpmd as well. Please let me know if I am wrong on anything of above. Thanks, Gowrishankar