From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0049.outbound.protection.outlook.com [104.47.1.49]) by dpdk.org (Postfix) with ESMTP id 2A8D5DE3 for ; Wed, 18 Jan 2017 07:17:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Rp7xDoJqwg13FagxPDN29/9r95A7OUFaeh/C1PECAlI=; b=hIzCTyk8Ow1O8oDaopnZuFg06HtH4YAbqw1MrQDy+BaT6UF5KbB1XTuD+zRzZ+qHGCMM/wSgu1sLVgA1IvswLnpiWpKXlFtui1eIAEwNotrLRVBk689YmG+Nbxkc8+Ud0cuS02kdMHN8HhhK/HQig79R8MUVDxMEImZsL6rKS28= Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) by DB5PR0401MB2055.eurprd04.prod.outlook.com (10.166.11.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 18 Jan 2017 06:17:37 +0000 Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) by DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) with mapi id 15.01.0845.014; Wed, 18 Jan 2017 06:17:37 +0000 From: Shreyansh Jain To: Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [PATCH v8 3/9] pci: split match and probe function Thread-Index: AQHScMaCa4UWwXBWzkudW3Nix6tg0qE9UiMAgABv27A= Date: Wed, 18 Jan 2017 06:17:24 +0000 Deferred-Delivery: Wed, 18 Jan 2017 06:16:46 +0000 Message-ID: References: <1484647774-28984-1-git-send-email-shreyansh.jain@nxp.com> <1484660264-6531-1-git-send-email-shreyansh.jain@nxp.com> <1484660264-6531-4-git-send-email-shreyansh.jain@nxp.com> <6385545.1JoApMrEe4@xps13> In-Reply-To: <6385545.1JoApMrEe4@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-originating-ip: [192.88.169.1] x-ms-office365-filtering-correlation-id: 5d160bf0-8fc6-4e6b-361a-08d43f69b2ff x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB5PR0401MB2055; x-microsoft-exchange-diagnostics: 1; DB5PR0401MB2055; 7:vkDBupI1xzMByu/jbGxhKZtL8pBfjoXaIj2nX0rf64SCOIHzIieZZDIXyKfwPf7xBvLiY3hNh6yqTrofORSUjNMjY0MErB5aYLBgckIBJzYRPpRs+8uXMnLZiss3otbgASjxO5PcirAZfU+xn0FZsKEnhCl5L4AAKPqjlsC6vi7snEXEUWvhr4bYob/6D9pBHDkF6sEBBS64K8JeBbpj2HrlTlz1aj0Onh4itwtHujEpSEtCecHpVZiRuH/MEH8Q8pdThI/Gq/07yEh6FCPW+lDKb+YgMxSfM+qOvdVc1eNOSqANkcPjSNBWogZYYxtRdtWYUomlQwtoiYXQHNF9IgTLMsXlyM899TYdbSx8ppR7t9RZGMVFa4dECRE9nE3jeMQRWGiY8ffccPIP5eTp6LNAOuuKvnKF9jwcxOPBsIq9f+lJHJ0vy+SxkM5tkcZVHLdjHNIJic5KgBJ8U+qcAw== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148)(6047074); SRVR:DB5PR0401MB2055; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0401MB2055; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(377424004)(13464003)(189002)(199003)(377454003)(38730400001)(106116001)(3280700002)(68736007)(50986999)(9686003)(105586002)(93886004)(54356999)(66066001)(106356001)(101416001)(6436002)(99286003)(55016002)(86362001)(25786008)(6506006)(33656002)(77096006)(229853002)(7736002)(7696004)(81156014)(8676002)(110136003)(3660700001)(5660300001)(305945005)(6666003)(8936002)(6916009)(53936002)(76176999)(3846002)(2950100002)(81166006)(4326007)(122556002)(2906002)(97736004)(92566002)(74316002)(2900100001)(189998001)(6116002)(102836003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0401MB2055; H:DB5PR0401MB2054.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2017 06:17:37.0385 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0401MB2055 Subject: Re: [dpdk-dev] [PATCH v8 3/9] pci: split match and probe function 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: Wed, 18 Jan 2017 06:17:39 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, January 18, 2017 5:02 AM > To: Shreyansh Jain > Cc: dev@dpdk.org > Subject: Re: [PATCH v8 3/9] pci: split match and probe function >=20 > 2017-01-17 19:07, Shreyansh Jain: > > +static int > > +rte_eal_pci_detach_dev(struct rte_pci_driver *dr, > > + struct rte_pci_device *dev) > > +{ > > + int ret; > > + struct rte_pci_addr *loc; > > + > > + if ((dr =3D=3D NULL) || (dev =3D=3D NULL)) > > + return -EINVAL; > > + > > + ret =3D rte_pci_match(dr, dev); >=20 > I do not understand this function. > The driver should be known by the device at this stage. > Why specifying a driver as parameter? >=20 > I know it is not new in this series, but > pci_detach_all_drivers(struct rte_pci_device *dev) makes no sense to me. >>From what I understand, pci_detach_all_drivers is simply a wrapper over the= PCI driver list, calling rte_eal_pci_detach_dev for each driver. Consideri= ng that all it does is iterate, it is not functionally required. But, let me clarify one more thing: There is a possibility that rte_pci_dev= ice->pci_driver be directly used in case of detach rather than searching fo= r a driver. This is assuming that before 'detach', a pci_device would link = to a valid pci_driver. Is there some caveat in this assumption?