This should not be limited to pci . The good news is that with netmdev you start with /sys/class/net and can find what you need. Actually you even do NOT need pci pus information from /sys/bus/pci because netmdev provides what you need in a bus independent manner.
FF Le ven. 27 oct. 2017 à 10:11, Ilias Apalodimas <ilias.apalodi...@linaro.org> a écrit : > Hi Maxim, > > This is exactly what we have in mind for the mediated device design. > > Regards > Ilias > > On 27 October 2017 at 10:25, Maxim Uvarov <maxim.uva...@linaro.org> wrote: > > > yes, discovery is done by other tools like lspci, /proc and /sys > > interfaces. Also udev rules are there to make naming persistent. > > > > For pci it can be: > > > > odp_pktio_open("mdev:eth0") > > > > then you parse /proc/bus/pci/devices to find actual driver used for this > > eth0. And if you have matching mdev pktio driver - open it. > > That looks like very simply and clear. > > > > Maxim. > > > > > > On 27 October 2017 at 01:03, Bill Fischofer <bill.fischo...@linaro.org> > > wrote: > > > > > I think you've captured the distinction correctly. The larger question > is > > > what does ODP itself need to do with this? When an interface name is > > > presented to odp_pktio_open() it is the application's responsibility to > > > provide a name string that can be mapped to the device that should be > > > opened. ODP uses that string to locate / load the driver that's needed > to > > > operate that device. The driver is then responsible to make the actual > > > connection to the device. > > > > > > When a driver gets a "device string" is needs to translate that into > > either > > > an appropriate Linux system call (for mdev) or to a set of PCI Bar or > > other > > > HW register addresses (for dedicated I/O). So if there is a case of a > > > southbound ODP API, it would be to assist with this latter translation. > > > > > > On Thu, Oct 26, 2017 at 12:38 PM, Honnappa Nagarahalli < > > > honnappa.nagaraha...@linaro.org> wrote: > > > > > > > Hi, > > > > I created a document to convert our discussion into pictures. I > > > > will update this as we discuss other concepts like devio/driver etc. > > > > > > > > https://docs.google.com/a/linaro.org/document/d/1nzy-Qp6hYZU38DVi7_ > > > > ZnPiaf3jRqdMN6IQHmfO80Al4/edit?usp=sharing > > > > > > > > Thanks, > > > > Honnappa > > > > > > > > > > -- [image: Linaro] <http://www.linaro.org/> François-Frédéric Ozog | *Director Linaro Networking Group* T: +33.67221.6485 <javascript:void(0);> francois.o...@linaro.org | Skype: ffozog