From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 29 Oct 2015 04:51:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,214,1444719600"; d="scan'208";a="838359153" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by fmsmga002.fm.intel.com with SMTP; 29 Oct 2015 04:51:42 -0700 Received: by (sSMTP sendmail emulation); Thu, 29 Oct 2015 11:51:41 +0025 Date: Thu, 29 Oct 2015 11:51:41 +0000 From: Bruce Richardson To: Bernard Iremonger 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 Content-Disposition: inline In-Reply-To: <1445621793-3630-22-git-send-email-bernard.iremonger@intel.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 21/28] librte_ether: remove branches on pci_dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 11:51:45 -0000 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