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 6E8F8A0577; Mon, 6 Apr 2020 11:32:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 502791BED9; Mon, 6 Apr 2020 11:32:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 48DDF1BED8 for ; Mon, 6 Apr 2020 11:32:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0369Tmg2001871; Mon, 6 Apr 2020 02:32:48 -0700 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=NBVRy+EzvOTlM4FXq4IwU1BI479MsY0Pw82quZyBIDY=; b=AZaIndQSwTNvUdGArH7x2ThcH7YQveMcYpxL3+XQ4hUoxyj3In92Np6InHk0k5ePcr4j 90ySGq8nGjIHv7pJ/7XmmIhqhsl/wyHVyY07oPlNWI94p0lMW6D1E85kM2x5JxWd+hgZ vGLZ4QYGuV7wOVlnRDltVqQ0OxjUAQqJvGz/0hv8RSmhKKVd9qCQgRsB1i6wV4NAZqxO N4PWEAqyRjgjC788E76GnZYHEiVBGnMyQsUM8j9QiB4Xn9enBPWWItbSksQ6TQodZaGp HwJYM4Nh8B+Hkmc+hLCFsYeQvH+2D0tpfi8AXV19JXZHWufq+Uo08hQ08LDp8IOmCRXm 5A== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 306srm50nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 02:32:48 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 6 Apr 2020 02:32:46 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 6 Apr 2020 02:32:46 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 6 Apr 2020 02:32:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ldfhcr8GqNq3TlJeTfe+JHbbHrcRTaenasreohoF+7PKpaJ7GBMNtW1KNrQuJG0TJgIlKQEsSKNlWcSy077leqgGDqQ7m8/Ww3yG+KUCzLKxazZIles6E9xkci6dP7heDzqo3BKCoZ9lDjYUiv7TqgSQGEOkotTjWQxl4JpxGqaaLOGkY5nIGtphwTJMZsI1D9TZmAR62cFVSsaFQbyHY0swROsuHxMk+FYYGOiSskQ9hf9S8i+kXd7GRU1Njl9JHygWwKnm4gjBMlpqAaAVV9jgKaKPcLMoPDfAM4l8aPGUR3mWikbOdCQ5yQHxVU/Nu8XQ01xKo/rokbEidEuzGg== 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=NBVRy+EzvOTlM4FXq4IwU1BI479MsY0Pw82quZyBIDY=; b=HyuI48x406jPRT+06cONeFkGLuVwsdPhln07IdHCsabmNKOkedNBguaQIE+BfIIszoPqCPgoShz5r+iVM8IXZV54KWod3Xrk6dnv7jGdhjunnRI28bME+CoarQDXydeIGiTOW7oiHRsbU4p+mOs3CcngW140KzJAkdxhowsHAD4rfSyCvL4nfXXlDgjGTkJ4bV7+ctE/BNDkHPx3Nxwu8v2pSOD7cmCosX+mrbI7rCa84rJF7H9Anlfha9xZs9C01oSup2x77kbUs9MnSEjIR7pnNgHDD6m1b2Q5cj3sm1/EB1fS6i2YvCk2HfpaCiIBitGT8oteBFHS/jLDy6Ujlg== 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=NBVRy+EzvOTlM4FXq4IwU1BI479MsY0Pw82quZyBIDY=; b=okvm9lovGxiUrjJdDH2uxadxu6QK3yaFUV8J7YQJB5YNQHCbaGnWbuyqaygAU25zJJBuCoU9dv3M8EN8XOFQ4kadiNBBgK9fZhxkOV/pb2+MmFNWADWKx9FSM7ekOf7xz9EfgqIo/vMXgV1yoi+7dWtQmG1tpdnGhRcbtsh+Bfs= Received: from BY5PR18MB3105.namprd18.prod.outlook.com (2603:10b6:a03:1a4::30) by BY5PR18MB3297.namprd18.prod.outlook.com (2603:10b6:a03:1a1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.19; Mon, 6 Apr 2020 09:32:44 +0000 Received: from BY5PR18MB3105.namprd18.prod.outlook.com ([fe80::10c9:84e8:e169:12ef]) by BY5PR18MB3105.namprd18.prod.outlook.com ([fe80::10c9:84e8:e169:12ef%5]) with mapi id 15.20.2878.018; Mon, 6 Apr 2020 09:32:43 +0000 From: Sunil Kumar Kori To: Stephen Hemminger , Jerin Jacob Kollanukkaran , "dev@dpdk.org" , David Marchand Thread-Topic: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning to allowed devices Thread-Index: AQHV0DZKpw74+THH9UiObz8P25Cnrqf38ULAgDb+awCAESDzMIAsOorg Date: Mon, 6 Apr 2020 09:32:43 +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-Mentions: david.marchand@redhat.com X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [171.76.165.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3334e971-e928-4698-e15b-08d7da0d7595 x-ms-traffictypediagnostic: BY5PR18MB3297: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0365C0E14B x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR18MB3105.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(376002)(366004)(346002)(136003)(396003)(39850400004)(478600001)(33656002)(71200400001)(76116006)(110136005)(52536014)(66556008)(81166006)(55016002)(26005)(7696005)(186003)(2906002)(8936002)(316002)(86362001)(64756008)(66446008)(81156014)(5660300002)(6506007)(9686003)(66946007)(66476007)(8676002); DIR:OUT; SFP:1101; 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: 8Bi/UML8k2RsVKdg/XNj6ARx1vF3W9PPfL5muPS93R11/5qynKWZdUHfL4cyA9RpXwV2F73ArGdnTSh4nFpr2V/7j0bN4Dwq5fp2u0f5r+o5RC0JWJZ347nU/rBQdBCgZPzqgnsaG7ThJ0FG/yYe01NjlG386LWJ5pxr4Nbxqx+PM+xduixi0pA3sfuwTHiYbleeirOqYmcuAiNCyTHJi4YwdN5evFWvXVVMdUFmP2ESmP6eg8FZuHJe7zpjg+Szu0UModZ/EZ22B6zPLgzP2Qw0ArhkO65NG17lFdQZWWfkVh9tYVBwbXahKWXutoxpoQ31M5jWATanSf2NVFSo41LYUIaYv80wai7lV+mE1hK06oeNroP8cBntQKDvv3bZk9cWmAhRNIUQbVjtPqgULrYK9ajxDj7PyLeYNUBYmH/ntSnHZR5So98idrFQdFFA x-ms-exchange-antispam-messagedata: qlKFsUm4ySoF50qGvZuRv1xegY2SubnQ+uhYoDnaHSVGJj81MPucx887EVP9phQ4UiAwUEdnrdAQLptX1NN7sNOdabezxJQcTMvVi+QKVvPHhfa98iwQKzEZ1FAwqUHV5Lyz9O0HCW+osT/zP1FHog== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3334e971-e928-4698-e15b-08d7da0d7595 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2020 09:32:43.6032 (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: 66uZGC1eicxhLimrkPyDg4QtNlG114etA6G+r32H6Y853NXAx+Pw158VhILA+81JmrOJs8qyZXulJqjNKvmb6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3297 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_05:2020-04-03, 2020-04-06 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,=20 It looks like there is no comment/objection on following patch and it can = be merged.=20 I would request to @David Marchand, please take care of this towards the me= rging process for 20.05. Regards Sunil Kumar Kori >-----Original Message----- >From: Sunil Kumar Kori >Sent: Monday, March 9, 2020 11:37 AM >To: 'Stephen Hemminger' ; Jerin Jacob >Kollanukkaran ; 'dev@dpdk.org' >Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus scanning= to >allowed devices > >Hello Stephen, > >Please provide ack on below change if there is no concern so that it can b= e >accepted on 20.05. > >Regards >Sunil Kumar Kori > >>-----Original Message----- >>From: Sunil Kumar Kori >>Sent: Thursday, February 27, 2020 2:00 PM >>To: Stephen Hemminger ; Jerin Jacob >>Kollanukkaran ; dev@dpdk.org >>Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] bus/pci: restricted bus >>scanning to allowed devices >> >>Hello All, >> >>Is there any thought on this ? Otherwise it can be merged. >> >>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 that 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 >suggest. >>>>> >>>>>> +/** >>>>>> + * 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