From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DD79D378E for ; Thu, 23 Jul 2015 18:33:14 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 23 Jul 2015 09:33:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,531,1432623600"; d="scan'208";a="611604524" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga003.jf.intel.com with ESMTP; 23 Jul 2015 09:33:13 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 23 Jul 2015 17:33:12 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.22]) by irsmsx112.ger.corp.intel.com ([10.108.20.5]) with mapi id 14.03.0224.002; Thu, 23 Jul 2015 17:33:11 +0100 From: "Iremonger, Bernard" To: Thomas Monjalon , "dev@dpdk.org" Thread-Topic: [dpdk-dev] management of non-PCI devices Thread-Index: AQHQxV56vaV1/zFfx0mbqPlt7XnNVZ3pOn3w Date: Thu, 23 Jul 2015 16:33:11 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C219F33BD9@IRSMSX108.ger.corp.intel.com> References: <2330484.OMtusG3QG9@xps13> In-Reply-To: <2330484.OMtusG3QG9@xps13> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] management of non-PCI devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 16:33:15 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Thursday, July 23, 2015 4:43 PM > To: dev@dpdk.org > Subject: [dpdk-dev] management of non-PCI devices >=20 > As noticed when reviewing the changes for hotplugging ring PMD, > http://dpdk.org/ml/archives/dev/2015-July/021872.html > a driver is considered in ethdev and EAL as a PCI driver: >=20 > * Each Ethernet driver acts as a PCI driver and is represented by a gene= ric > * *eth_driver* structure that holds: > * - An *rte_pci_driver* structure (which must be the first field). > * - The *eth_dev_init* function invoked for each matching PCI device. > * - The *eth_dev_uninit* function invoked for each matching PCI device. > * - The size of the private data to allocate for each matching device. > */ > struct eth_driver { > struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. = */ > eth_dev_init_t eth_dev_init; /**< Device init function. */ > eth_dev_uninit_t eth_dev_uninit; /**< Device uninit function. */ > unsigned int dev_private_size; /**< Size of device private data. *= / > }; >=20 > So the non PCI drivers don't use rte_eth_driver_register(). > Then a difference is made with these flags: > enum pmd_type { > PMD_VDEV =3D 0, > PMD_PDEV =3D 1, > }; >=20 > With this kind of weird things: > static struct rte_driver rte_virtio_driver =3D { > .type =3D PMD_PDEV, > .init =3D rte_virtio_pmd_init, > }; > Because virtio is a virtual device with a virtual PCI address. >=20 > All these things are not normal and make EAL code more and more difficult= to > maintain. That's why we must stop accepting new code using these > workarounds and start working on a refactoring. >=20 > Comments welcome Hi Thomas, While refactoring the EAL may well be necessary, the ring PMD patch has bee= n coded using the existing 2.1 EAL. The ring PMD already uses struct eth_driver, this has not been added in the= ring PMD patch. In the existing code the eth_driver is malloc'ed, in the patch it has been = changed to static.=20 The ring PMD patch should be accepted as it conforms to the 2.1 EAL and has= been reviewed, tested and acked in time for 2.1-rc1.=20 Regards, Bernard. =20