From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bernard.iremonger@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id C3157379E
 for <dev@dpdk.org>; Tue,  1 Sep 2015 13:38:34 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga103.fm.intel.com with ESMTP; 01 Sep 2015 04:38:34 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.17,448,1437462000"; d="scan'208";a="759923440"
Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66])
 by orsmga001.jf.intel.com with ESMTP; 01 Sep 2015 04:38:32 -0700
Received: from irsmsx108.ger.corp.intel.com ([169.254.11.12]) by
 IRSMSX152.ger.corp.intel.com ([169.254.6.220]) with mapi id 14.03.0224.002;
 Tue, 1 Sep 2015 12:38:32 +0100
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
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: AQHQ4/ag7MZC/qLfPkyLr0TMnOm6dJ4nhFxQ
Date: Tue, 1 Sep 2015 11:38:31 +0000
Message-ID: <8CEF83825BEC744B83065625E567D7C219F49A14@IRSMSX108.ger.corp.intel.com>
References: <1440690041-32391-2-git-send-email-bernard.iremonger@intel.com>
 <3040981.rvdZqrEcfG@xps13>
In-Reply-To: <3040981.rvdZqrEcfG@xps13>
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" <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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Sep 2015 11:38:35 -0000

Hi THomas,

<snip>

> > @@ -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;
>=20
> Clearly not the way to go.
> We should remove the special cases (PCI, PDEV, VDEV) instead of adding
> more checks.

The dev_type field is not new, just using it now to distinguish between PCI=
 and non PCI devices.

I have moved some of the RTE_PCI_DRV flags to a new dev_flags field in stru=
ct 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?

Regards,

Bernard.

 =20