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 57EE858D8 for ; Tue, 1 Sep 2015 14:37:32 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 01 Sep 2015 05:37:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,448,1437462000"; d="scan'208";a="780279507" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 01 Sep 2015 05:37:30 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by IRSMSX103.ger.corp.intel.com ([169.254.3.251]) with mapi id 14.03.0224.002; Tue, 1 Sep 2015 13:37:29 +0100 From: "Ananyev, Konstantin" To: "Iremonger, Bernard" , Thomas Monjalon Thread-Topic: [RFC PATCH 1/6] librte_ether: add fields from rte_pci_driver to rte_eth_dev and rte_eth_dev_data. Thread-Index: AQHQ5KrMt7b+LB3DbkmFXlolpp0phZ4nm0VQ Date: Tue, 1 Sep 2015 12:37:29 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836A818B6@irsmsx105.ger.corp.intel.com> References: <1440690041-32391-2-git-send-email-bernard.iremonger@intel.com> <3040981.rvdZqrEcfG@xps13> <8CEF83825BEC744B83065625E567D7C219F49A14@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C219F49A14@IRSMSX108.ger.corp.intel.com> Accept-Language: en-IE, 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] [RFC PATCH 1/6] librte_ether: add fields from rte_pci_driver to rte_eth_dev and rte_eth_dev_data. 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: Tue, 01 Sep 2015 12:37:32 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Iremonger, Bernard > Sent: Tuesday, September 01, 2015 12:39 PM > To: Thomas Monjalon > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC PATCH 1/6] librte_ether: add fields from rte= _pci_driver to rte_eth_dev and rte_eth_dev_data. >=20 > Hi THomas, >=20 > >=20 > > > @@ -424,7 +425,10 @@ rte_eth_dev_socket_id(uint8_t port_id) { > > > if (!rte_eth_dev_is_valid_port(port_id)) > > > return -1; > > > - return rte_eth_devices[port_id].pci_dev->numa_node; > > > + if (rte_eth_devices[port_id].dev_type =3D=3D RTE_ETH_DEV_PCI) > > > + return rte_eth_devices[port_id].pci_dev->numa_node; > > > + else > > > + return rte_eth_devices[port_id].data->numa_node; > > > > Clearly not the way to go. > > We should remove the special cases (PCI, PDEV, VDEV) instead of adding > > more checks. >=20 > The dev_type field is not new, just using it now to distinguish between P= CI and non PCI devices. >=20 > I have moved some of the RTE_PCI_DRV flags to a new dev_flags field in st= ruct rte_eth_dev{}, > These flags are independent of the driver type (PCI or non PCI). > Do you have view on this new dev_flags field and macros? What looks strange here to me, I that we now we duplicate some fields here? Let say for PCI devices numa_node would be precent in pci_dev and in data, = right? If there are some fields that are common for all device types (PCI, VDEV, e= tc) why not to create some unified structure for them that would be used by all device types and = remove subsequent fields from pci_dev? Or alternatively create a union of structs (one struct per device type)? Then, as was pointed before, we wouldn't these branches by device_type at a= ll. Konstantin >=20 > Regards, >=20 > Bernard. >=20 >=20