* [dpdk-dev] management of non-PCI devices
@ 2015-07-23 15:42 Thomas Monjalon
2015-07-23 16:33 ` Iremonger, Bernard
2015-07-23 16:51 ` Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-07-23 15:42 UTC (permalink / raw)
To: dev
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:
* Each Ethernet driver acts as a PCI driver and is represented by a generic
* *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. */
};
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 = 0,
PMD_PDEV = 1,
};
With this kind of weird things:
static struct rte_driver rte_virtio_driver = {
.type = PMD_PDEV,
.init = rte_virtio_pmd_init,
};
Because virtio is a virtual device with a virtual PCI address.
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.
Comments welcome
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] management of non-PCI devices
2015-07-23 15:42 [dpdk-dev] management of non-PCI devices Thomas Monjalon
@ 2015-07-23 16:33 ` Iremonger, Bernard
2015-07-23 16:51 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Iremonger, Bernard @ 2015-07-23 16:33 UTC (permalink / raw)
To: Thomas Monjalon, dev
> -----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
>
> 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:
>
> * Each Ethernet driver acts as a PCI driver and is represented by a generic
> * *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. */
> };
>
> 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 = 0,
> PMD_PDEV = 1,
> };
>
> With this kind of weird things:
> static struct rte_driver rte_virtio_driver = {
> .type = PMD_PDEV,
> .init = rte_virtio_pmd_init,
> };
> Because virtio is a virtual device with a virtual PCI address.
>
> 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.
>
> Comments welcome
Hi Thomas,
While refactoring the EAL may well be necessary, the ring PMD patch has been 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.
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.
Regards,
Bernard.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] management of non-PCI devices
2015-07-23 15:42 [dpdk-dev] management of non-PCI devices Thomas Monjalon
2015-07-23 16:33 ` Iremonger, Bernard
@ 2015-07-23 16:51 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2015-07-23 16:51 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Thu, 23 Jul 2015 17:42:58 +0200
Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> 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:
>
> * Each Ethernet driver acts as a PCI driver and is represented by a generic
> * *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. */
> };
>
> 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 = 0,
> PMD_PDEV = 1,
> };
>
> With this kind of weird things:
> static struct rte_driver rte_virtio_driver = {
> .type = PMD_PDEV,
> .init = rte_virtio_pmd_init,
> };
> Because virtio is a virtual device with a virtual PCI address.
>
> 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.
>
> Comments welcome
The hyper-v driver which was posted here added a new bus type (vmbus)
and it was not too painful. There were minimal changes to base EAL to
make a union where pci_drv is used.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-23 16:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 15:42 [dpdk-dev] management of non-PCI devices Thomas Monjalon
2015-07-23 16:33 ` Iremonger, Bernard
2015-07-23 16:51 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).