From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id A86C991C8 for ; Mon, 31 Aug 2015 16:09:02 +0200 (CEST) Received: by wiclp12 with SMTP id lp12so771237wic.1 for ; Mon, 31 Aug 2015 07:09:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=myuvd0LnCGSOfPYEM5xH4ns0H/kDnS3ZppO98Cg8tT0=; b=lhne3HfHSiLjiue2u3pztpjkfPcB2CID6ko0rQTn7jKwM8DgJ2Bhdn209mGewcluPL u8moqEMMUxZfkkJ0MVvnZeL5x/EXVgoYfD0qADSwLhvzmBgErbdmiJK9IeGGBlSA8w+j oIZ3OulalxgVRQi1QepJcVzMYELcYQ6Cd8RpDqWqdIQqzKVkdVbvpObXfA5PBH2hk0jb 6R1KxqdCJ61p9zw7B7/LGxdBE24FZkzIbdKdqi2tIxNpYv8+xSdYg/dqewMjY34VWCVI IwAMkoH2Jy+NXAUDAbDOiTmH6IRpKOiHm3reFzlMU+0I/760qIBk6VPA1HB+5E3I4f3W KPHQ== X-Gm-Message-State: ALoCoQlI1ZdW92za2IdAquy66Sb+n2ZetRkPafW4lCutjDE9SeRHkrdv/UQjiHG3TpDtRilBwYJg X-Received: by 10.194.173.35 with SMTP id bh3mr22793975wjc.88.1441030142478; Mon, 31 Aug 2015 07:09:02 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id y15sm18236272wib.7.2015.08.31.07.09.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 31 Aug 2015 07:09:01 -0700 (PDT) From: Thomas Monjalon To: Bernard Iremonger Date: Mon, 31 Aug 2015 16:07:51 +0200 Message-ID: <3040981.rvdZqrEcfG@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1440690041-32391-2-git-send-email-bernard.iremonger@intel.com> References: <1440690041-32391-2-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Mon, 31 Aug 2015 14:09:02 -0000 2015-08-27 16:40, Bernard Iremonger: > add dev_flags to rte_eth_dev, add macros for dev_flags. > add numa_node to rte_eth_dev_data. > use dev_type to distinguish between vdev's and pdev's. > remove unused RTE_ETH_DEV_MAX. > > Signed-off-by: Bernard Iremonger [...] > @@ -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 == 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.