Hi Bruce,

<snip>

> >  /* attach the new physical device, then store port_id of the device
> > */ @@ -1143,14 +1141,11 @@ rte_eth_dev_configure(uint8_t port_id,
> uint16_t nb_rx_q, uint16_t nb_tx_q,
> >      * If link state interrupt is enabled, check that the
> >      * device supports it.
> >      */
> > -   if (dev_conf->intr_conf.lsc == 1) {
> > -           const struct rte_pci_driver *pci_drv = &dev->driver-
> >pci_drv;
> > -
> > -           if (!(pci_drv->drv_flags & RTE_PCI_DRV_INTR_LSC)) {
> > +   if ((dev_conf->intr_conf.lsc == 1) &&
> > +           (!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC))) {
> >                     PMD_DEBUG_TRACE("driver %s does not support
> lsc\n",
> > -                                   pci_drv->name);
> > +                                   dev->data->drv_name);
> 
> Is this safe to do? From your previous patches for the vdevs, you appear to
> be setting the drv_name field to NULL for those vdevs, leading to undefined
> behaviour here. (printf may catch the NULL and print it as "(null)" rather 
> than
> crashing, but it's still wrong!)
> 
> /Bruce

It would be safer to set dev->data->drv_name to the PMD driver name.

Regards,

Bernard.




Reply via email to