DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Ilya Maximets <i.maximets@samsung.com>
Subject: [dpdk-dev] [PATCH] vhost: suppress error if numa is not available
Date: Thu, 09 Aug 2018 19:09:38 +0300	[thread overview]
Message-ID: <1533830978-23518-1-git-send-email-i.maximets@samsung.com> (raw)
In-Reply-To: <CGME20180809160856eucas1p2e22900aa2de83e9b17f5843151557d7b@eucas1p2.samsung.com>

It's a common case that 'get_mempolicy' fails on systems
without NUMA support. No need to flag an error in log for
this situation.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 lib/librte_vhost/vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 3c9be10..91026b3 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -8,6 +8,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #ifdef RTE_LIBRTE_VHOST_NUMA
+#include <numa.h>
 #include <numaif.h>
 #endif
 
@@ -480,7 +481,7 @@ rte_vhost_get_numa_node(int vid)
 	int numa_node;
 	int ret;
 
-	if (dev == NULL)
+	if (dev == NULL || numa_available() != 0)
 		return -1;
 
 	ret = get_mempolicy(&numa_node, NULL, 0, dev,
-- 
2.7.4

       reply	other threads:[~2018-08-09 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180809160856eucas1p2e22900aa2de83e9b17f5843151557d7b@eucas1p2.samsung.com>
2018-08-09 16:09 ` Ilya Maximets [this message]
2018-08-10  3:03   ` Tiwei Bie
2018-08-10  7:24     ` Ilya Maximets
     [not found]   ` <CGME20180810072408eucas1p2ab45e26b6540bdf5634efad9080391d5@eucas1p2.samsung.com>
2018-08-10  7:24     ` [dpdk-dev] [PATCH v2] vhost: suppress error if NUMA " Ilya Maximets
2018-08-10 16:30       ` Maxime Coquelin
2018-08-10 16:38       ` Maxime Coquelin

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=1533830978-23518-1-git-send-email-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /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).