From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 416F55A95 for ; Thu, 29 Oct 2015 15:32:34 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 29 Oct 2015 07:32:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,214,1444719600"; d="scan'208";a="674341564" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga003.jf.intel.com with ESMTP; 29 Oct 2015 07:32:33 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.138]) by irsmsx105.ger.corp.intel.com ([169.254.7.75]) with mapi id 14.03.0248.002; Thu, 29 Oct 2015 14:32:30 +0000 From: "Iremonger, Bernard" To: "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v5 21/28] librte_ether: remove branches on pci_dev Thread-Index: AQHREkBA5ooqpMlC7UCA6OJ4pZ+yBp6CiE8g Date: Thu, 29 Oct 2015 14:32:29 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C219F758D9@IRSMSX108.ger.corp.intel.com> References: <1445621793-3630-1-git-send-email-bernard.iremonger@intel.com> <1445621793-3630-22-git-send-email-bernard.iremonger@intel.com> <20151029115141.GA10272@bricha3-MOBL3> In-Reply-To: <20151029115141.GA10272@bricha3-MOBL3> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 14:32:34 -0000 Hi Bruce, > > /* 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 =3D=3D 1) { > > - const struct rte_pci_driver *pci_drv =3D &dev->driver- > >pci_drv; > > - > > - if (!(pci_drv->drv_flags & RTE_PCI_DRV_INTR_LSC)) { > > + if ((dev_conf->intr_conf.lsc =3D=3D 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); >=20 > 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 undefin= ed > behaviour here. (printf may catch the NULL and print it as "(null)" rathe= r than > crashing, but it's still wrong!) >=20 > /Bruce It would be safer to set dev->data->drv_name to the PMD driver name. Regards, Bernard.