Hi Stephen, > -----Original Message----- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Saturday, February 18, 2017 1:00 > To: Nipun Gupta <nipun.gu...@nxp.com> > Cc: dev@dpdk.org; Hemant Agrawal <hemant.agra...@nxp.com>; > jerin.ja...@caviumnetworks.com; bruce.richard...@intel.com; > gage.e...@intel.com; harry.van.haa...@intel.com > Subject: Re: [dpdk-dev] [PATCH] eventdev: event device to contain rte device > holder > > On Thu, 16 Feb 2017 16:22:29 +0530 > Nipun Gupta <nipun.gu...@nxp.com> wrote: > > > Signed-off-by: Nipun Gupta <nipun.gu...@nxp.com> > > > > rte_device is a generic device which is available to the applications > > and EAL. This patch replaces rte_pci_device in 'struct rte_eventdev' > > and in 'struct rte_event_dev_info' with common rte_device. > > --- > > drivers/event/skeleton/skeleton_eventdev.c | 2 +- > > lib/librte_eventdev/rte_eventdev.c | 6 +++--- > > lib/librte_eventdev/rte_eventdev.h | 6 +++--- > > 3 files changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/event/skeleton/skeleton_eventdev.c > b/drivers/event/skeleton/skeleton_eventdev.c > > index dee0faf..770dce3 100644 > > --- a/drivers/event/skeleton/skeleton_eventdev.c > > +++ b/drivers/event/skeleton/skeleton_eventdev.c > > @@ -383,7 +383,7 @@ > > if (rte_eal_process_type() != RTE_PROC_PRIMARY) > > return 0; > > > > - pci_dev = eventdev->pci_dev; > > + pci_dev = RTE_DEV_TO_PCI(eventdev->dev); > > How will this work when there are more than just PCI devices? > For example, upcoming patches will add rte_vmbus_device. There is no > run time type checking in C.
This is within the device driver. AFAIU, a driver will be based on a single bus and it will get its own device by calling the right conversion function. So, if a new bus like vmbus is there shall be a corresponding RTE_DEV_TO_xyDEV to get the 'devices on vmbus' from 'rte_device'. Thanks, Nipun