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 E0ECAA055A; Thu, 27 Feb 2020 09:30:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A62A1BF76; Thu, 27 Feb 2020 09:30:28 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 36B0937AF for ; Thu, 27 Feb 2020 09:30:26 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01R8LVY2016765; Thu, 27 Feb 2020 00:30:25 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=FF851FVFPBRWZNJhDr28GY8vdLCu7U1I1uuzdam7mQ8=; b=oD3h/a+7DHGRKZTer6uk4W5QpTg/N70Ib1mHJ7A0dwWnLB5JQ2h5hU0zfXwN2av6oulV a7e8Gz2WLRrv1uNwBTNCtMB1RYhYZlbfwI0Q9C5EDt6DxqYYYqwiX8zfKuwYqlX2jBC+ cJFXkZ+FMmOGorMbr6ih7l8eRCj6ELXjvVZSCk7z9lDCwudGRF5R3/BBl4SE4BLTx4Dn UB0ij08pfseauvzBWNW427pB5DDxu2LZ9u3pvqcPHxrjYE1gZt3TDIa0OQP7y9Q0llfy GjsuvdZIioxvrHNQClB+NDs7ZI5gYaNwmFcqfmTr1iWW5sqdyUQmuwOOihCMuUIOCNIH rw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2ydcm17hyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 27 Feb 2020 00:30:25 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 Feb 2020 00:30:24 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 27 Feb 2020 00:30:24 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJ4arV6crrhvD6QbQ2FeQbZle07jTKcJEM6Zaas0qNx9/NxaB9bu4ObnBBP0qewZuz0uvb87updFVOT5pis6TCa0VM74yJldOQZVjDpsstt3CilIHwKq82kfprfUgwMf1wsvfID+T9sRY8R7uy7MkF/vTda88zgzMW0uuAQPfHjPa+N8mB2KRDv0q+7DratXcjpsOydZ2PtrXwULLBrIflrkfp1stk0GkUf2BEl5qf6VCeNqJaRQVD2SUEoPjyHDZq/16x2FdjYS+0vlwMz+QqGyeA6+GbF8P6uSArXCYyl7iMAkbS6V11/oaykDil2XjFp2p8DSiw/PBtCZNE20uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FF851FVFPBRWZNJhDr28GY8vdLCu7U1I1uuzdam7mQ8=; b=RBenCHQ/xz8g8G0Rohc6wPE6FirqYF/bitmr2KV7L9QXxq7yp4Vmks0L9nFvNPeY+9VaoTe0t/BFKAim9rJ5JjBfPT9/eVbvxM4dld9i/V3YMeT4OQMfCeF2kSab4Nqrmr+28islWlnCDdr3tys55BA029D/stYRm9yxAfkM4z6ReJUMzWbETKnQym4B38UyHPZ6jz9Pb01xrAzomr8yj0JMtPgU7qYRzQ5igNe6S4LBjK5c+q5tveA6FyyVTldPUf26jajjtf+0XvnN9IdYtShS3z5BUY73oaU2Lcd4n+X4Px4eWEeB3Vqk4aRByiQ+HVCkoNG6YD7WicJczrUxpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FF851FVFPBRWZNJhDr28GY8vdLCu7U1I1uuzdam7mQ8=; b=hQWrUWeoSvPR5Ngp4gDxDm/MsUR4rJJmJm2IyzZ37Gf48tPmMQyhTTFjznodYv6wFdXDov+qhSY75QRnW9nmeyN7DyAToWBqofPu4v23ZUTT/UTIjeby40BRVr+AOuHsKe5zPA75L9e/+9oj+S3LKppyoxz6Hfjy8Oh1KY4S0rU= Received: from CH2PR18MB3270.namprd18.prod.outlook.com (2603:10b6:610:16::12) by CH2PR18MB3143.namprd18.prod.outlook.com (2603:10b6:610:16::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.21; Thu, 27 Feb 2020 08:30:22 +0000 Received: from CH2PR18MB3270.namprd18.prod.outlook.com ([fe80::f054:7249:789c:1320]) by CH2PR18MB3270.namprd18.prod.outlook.com ([fe80::f054:7249:789c:1320%3]) with mapi id 15.20.2750.021; Thu, 27 Feb 2020 08:30:22 +0000 From: Sunil Kumar Kori To: Stephen Hemminger , Jerin Jacob Kollanukkaran , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning to allowed devices Thread-Index: AQHV0DZKpw74+THH9UiObz8P25Cnrqf38ULAgDb+awA= Date: Thu, 27 Feb 2020 08:30:22 +0000 Message-ID: References: <20191216075501.15669-1-skori@marvell.com> <20191216081317.30f10c9d@hermes.lan> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f227729-5f23-4dfc-c26b-08d7bb5f4960 x-ms-traffictypediagnostic: CH2PR18MB3143: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 03264AEA72 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(136003)(376002)(366004)(39850400004)(189003)(199004)(71200400001)(5660300002)(2906002)(86362001)(7696005)(8936002)(52536014)(66946007)(76116006)(110136005)(55016002)(66446008)(8676002)(81166006)(81156014)(9686003)(66556008)(6506007)(64756008)(33656002)(66476007)(316002)(478600001)(55236004)(26005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR18MB3143; H:CH2PR18MB3270.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Sl1cfJxs6CihogwR52gGcurSQLJ+OHPzvT3ZudMaK1ZeR/+Wn2EzbUpbXG2+FiNClKOdDG0j80YBXkQpoOnSxUlPfxdlSNhGb7xuwv36duyO4TdiuB+gm0O1S+ibsUvMgfUIUTu7gGE1Gm6Qssc76zYK+BVKH/lITzIKIjc9sqGh9bPr66mBoF3dzjX61AZGGJIF4L22vRs1Z/T7c7ZEej6yUoCMKtL4RL2dJAsLwTsceIP3o1zpleOoMMvS4+8PRiQCj8J3yIm0wePxWFB1uV9H8r8Gnqd4w47EAD8TzVEqSar9S6bZzGO0KMkzCkCYW4oPXCplpMfHkhDpP9MwhbiIjTDUrfUbIfDnUCxdPFuG5xnh+4HjsTQFSAyd+XrcN7FJsAfsLNFSfdvBX5f6wk1rpZ03LzeAadGmQ9TQGybvtcSgZmlmo4St6nBtkzXz x-ms-exchange-antispam-messagedata: y78CUUNVZUtC2kEqJktjQJCVEeKv7KW9WZ6955MsOlnAWM4b3/QxIUXQXb9c5NZGmY0QXOoC1nUHdLwt8+2YWAx5M2XanVjoT+itLXODGVqS7+mmxl4LoDpYudXk6RfwnJu22rpXFcGgKsdQnOf7cA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1f227729-5f23-4dfc-c26b-08d7bb5f4960 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2020 08:30:22.2810 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2jRncp5mK+yJ4YiXLNWPZ57qJtmrSPSg4dqK0VbCf8cNcK/JMgv/i+ixH/zQO61AegXC2p4D1ExCZeHsHRTtdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3143 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-27_02:2020-02-26, 2020-02-27 signatures=0 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning to allowed devices 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" Hello All,=20 Is there any thought on this ? Otherwise it can be merged.=20 Regards Sunil Kumar Kori >-----Original Message----- >From: Sunil Kumar Kori >Sent: Thursday, January 23, 2020 2:13 PM >To: Stephen Hemminger ; Jerin Jacob >Kollanukkaran >Subject: FW: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning= to >allowed devices > >Hello Stephen, > >Can you please look into this patch or provide your thought in this ? So t= hat it >can be merged within 20.02 release. > >Regards >Sunil Kumar Kori > >-----Original Message----- >From: Sunil Kumar Kori >Sent: Tuesday, January 21, 2020 2:09 PM >To: Sunil Kumar Kori ; Stephen Hemminger > >Cc: dev@dpdk.org >Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning= to >allowed devices > >Hello Stephen, >Any suggestions ? > >Regards >Sunil Kumar Kori > >>-----Original Message----- >>From: dev On Behalf Of Sunil Kumar Kori >>Sent: Tuesday, December 17, 2019 4:30 PM >>To: Stephen Hemminger >>Cc: dev@dpdk.org >>Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus >>scanning to allowed devices >> >> >> >>Regards >>Sunil Kumar Kori >> >>>-----Original Message----- >>>From: Stephen Hemminger >>>Sent: Monday, December 16, 2019 9:43 PM >>>To: Sunil Kumar Kori >>>Cc: dev@dpdk.org >>>Subject: [EXT] Re: [dpdk-dev] [PATCH] bus/pci: restricted bus scanning >>>to allowed devices >>> >>>External Email >>> >>>---------------------------------------------------------------------- >>>> /* Create dummy pci device to get devargs */ >>>> + dummy_dev.addr.domain =3D >>>matches[i].pc_sel.pc_domain; >>>> + dummy_dev.addr.bus =3D matches[i].pc_sel.pc_bus; >>>> + dummy_dev.addr.devid =3D matches[i].pc_sel.pc_dev; >>>> + dummy_dev.addr.function =3D >>>matches[i].pc_sel.pc_func; >>>> + dummy_dev.device.devargs =3D >>>> + >>> pci_devargs_lookup(&dummy_dev); >>>> + >>>> + /* Check that device should be ignored or not */ >>>> + if (pci_ignore_device(&dummy_dev)) >>>> + continue; >>> >>>It seems that you are creating dummy_dev as an alternative to passing >>>just the PCI bus/device/function. Wouldn't be easier to just use BDF >>>instead. Dummy arguments on the stack can lead to more corner cases in >>>the future if device subsystem changes. >>Agreed and initially I have implemented using BDF only instead of using >>dummy device. >>But using that approach, I was not able to use existing APIs to get >>devargs and ignore device. >>I had to write almost same functions to solve the purpose. So just to >>avoid having replica of same code, I followed this approach. Please sugge= st. >>> >>>> +/** >>>> + * Get the devargs of a PCI device. >>>> + * >>>> + * @param pci_dev >>>> + * PCI device to be validated >>>> + * @return >>>> + * devargs on succes, NULL otherwise >>>> + */ >>>> +struct rte_devargs *pci_devargs_lookup(struct rte_pci_device >>>> +*pci_dev); >>> >>>Must be marked experimental (or internal). >>>The pci_device should be marked const. >>Okay but If I go with BDF one then this change is not required anyway. >>> >>> >>>> + >>>> +/** >>>> + * Validate whether a pci device should be ignored or not. >>>> + * >>>> + * @param pci_dev >>>> + * PCI device to be validated >>>> + * @return >>>> + * 1 if device is to be ignored, 0 otherwise >>>> + */ >>>> +bool pci_ignore_device(const struct rte_pci_device *pci_dev); >>> >>>ditto >>ditto