Agree with NACK. This type of string matching won't scale. THe better way is to encapsulate required behavior in feature flags. I started that with drv_flags, and that seems natural home for such device specific stuff.
On Sun, Sep 28, 2014 at 5:36 AM, Neil Horman <nhorman at tuxdriver.com> wrote: > On Sun, Sep 28, 2014 at 11:27:16AM +0800, Ding Heng wrote: > > As different PMDs support different features, application may want > > to know the NIC type of a port, then decide how to use that port. > > Add a new field in struct rte_eth_dev, users are able to get > > device type now. > > > > Signed-off-by: Ding Heng <hengx.ding at intel.com> > Nack. This patch embodies PMD specific information in a common library, > which > really isn't necessecary. It implies that developers who maintain PMDs > outside > of the core dpdk still need to do some maintenence in the core for all the > dpdk > features to work. Its also a layering violation. The core shouldn't > have to > know any specifics about a driver to initalize it, even its name. > > If an application wants to know what type of driver a NIC is, > the application can just interrogate the pci drivers name field directly. > > Neil > >