From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v5 21/28] librte_ether: remove branches on pci_dev Date: Thu, 29 Oct 2015 11:51:41 +0000 Message-ID: <20151029115141.GA10272@bricha3-MOBL3> References: <1445621793-3630-1-git-send-email-bernard.iremonger@intel.com> <1445621793-3630-22-git-send-email-bernard.iremonger@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Bernard Iremonger Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 01A4C2FDD for ; Thu, 29 Oct 2015 12:51:44 +0100 (CET) Content-Disposition: inline In-Reply-To: <1445621793-3630-22-git-send-email-bernard.iremonger@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Oct 23, 2015 at 06:36:26PM +0100, Bernard Iremonger wrote: > use dev_type to distinguish between vdev's and pdev's. > remove pci_dev branches. > update release notes. > > Signed-off-by: Bernard Iremonger > --- > doc/guides/rel_notes/release_2_2.rst | 3 +++ > lib/librte_ether/rte_ethdev.c | 40 +++++++++++++++--------------------- > 2 files changed, 20 insertions(+), 23 deletions(-) > > /* 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