DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cunming Liang <cunming.liang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] eal/linux: fix negative value for undetermined numa_node
Date: Fri, 31 Jul 2015 09:36:12 +0800	[thread overview]
Message-ID: <1438306572-25434-1-git-send-email-cunming.liang@intel.com> (raw)
In-Reply-To: <D0158A423229094DA7ABF71CF2FA0DA311981B28@shsmsx102.ccr.corp.intel.com>

The patch sets zero as the default value of pci device numa_node
if the socket could not be determined.
It provides the same default value as FreeBSD which has no NUMA support,
and makes the return value of rte_eth_dev_socket_id() be consistent
with the API description.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 0e62f65..f573092 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -325,8 +325,8 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,
 	snprintf(filename, sizeof(filename), "%s/numa_node",
 		 dirname);
 	if (access(filename, R_OK) != 0) {
-		/* if no NUMA support just set node to -1 */
-		dev->numa_node = -1;
+		/* if no NUMA support, set default to 0 */
+		dev->numa_node = 0;
 	} else {
 		if (eal_parse_sysfs_value(filename, &tmp) < 0) {
 			free(dev);
-- 
2.4.3

  reply	other threads:[~2015-07-31  1:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  6:33 [dpdk-dev] [PATCH v1] app/test: fix pmd_perf issue in no NUMA case Cunming Liang
2015-06-08  7:01 ` Jayakumar, Muthurajan
2015-06-22 21:01 ` Thomas Monjalon
2015-06-23  1:45   ` Liang, Cunming
2015-07-31  1:36     ` Cunming Liang [this message]
2015-08-01  3:56       ` [dpdk-dev] [PATCH] eal/linux: fix negative value for undetermined numa_node Matthew Hall
2015-08-03  1:46         ` Liang, Cunming
2015-08-03  5:04           ` Matthew Hall
2015-08-03 17:19             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438306572-25434-1-git-send-email-cunming.liang@intel.com \
    --to=cunming.liang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).