DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Rogelio Domínguez Hernández" <rogelio.dominguez@gmail.com>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org,
	"Rogelio Domínguez Hernández" <rogelio.dominguez@gmail.com>
Subject: [PATCH] usertools/devbind: support all possible values sysfs flag
Date: Tue, 12 Nov 2024 07:15:48 -0600	[thread overview]
Message-ID: <20241112131548.102992-1-rogelio.dominguez@gmail.com> (raw)

This patch adds support for 'y' and 'Y' values when reading
vfio-pci unsafe_noiommu_mode flag.

Possible values were taken from linux kernel
(sysfs__read_bool() in tools/lib/api/fs/fs.c)

Signed-off-by: Rogelio Domínguez Hernández <rogelio.dominguez@gmail.com>
---
 usertools/dpdk-devbind.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 80c35f9ab6..548898d59e 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -490,7 +490,8 @@ def check_noiommu_mode():
 
     try:
         with open(filename, "r") as f:
-            if f.read(1) == "1":
+            value = f.read(1)
+            if value == "1" or value == "y" or value == "Y":
                 return
     except OSError as err:
         sys.exit(f"Error: failed to check unsafe noiommu mode - Cannot open {filename}: {err}")
-- 
2.45.2


             reply	other threads:[~2024-11-12 13:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 13:15 Rogelio Domínguez Hernández [this message]
2024-11-12 14:00 ` Robin Jarry
2024-11-12 14:07 ` [PATCH v2] usertools/devbind: support all possible values in " Rogelio Domínguez Hernández
2024-11-12 14:08   ` Robin Jarry

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=20241112131548.102992-1-rogelio.dominguez@gmail.com \
    --to=rogelio.dominguez@gmail.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.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).