All of lore.kernel.org
 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 v2] usertools/devbind: support all possible values in sysfs flag
Date: Tue, 12 Nov 2024 08:07:19 -0600	[thread overview]
Message-ID: <20241112140719.149055-1-rogelio.dominguez@gmail.com> (raw)
In-Reply-To: <20241112131548.102992-1-rogelio.dominguez@gmail.com>

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..e8660098fd 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 in ("1", "y" ,"Y"):
                 return
     except OSError as err:
         sys.exit(f"Error: failed to check unsafe noiommu mode - Cannot open {filename}: {err}")
-- 
2.45.2


  parent reply	other threads:[~2024-11-12 14:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12 13:15 [PATCH] usertools/devbind: support all possible values sysfs flag Rogelio Domínguez Hernández
2024-11-12 14:00 ` Robin Jarry
2024-11-12 14:07 ` Rogelio Domínguez Hernández [this message]
2024-11-12 14:08   ` [PATCH v2] usertools/devbind: support all possible values in " Robin Jarry
2024-11-19 20:29     ` 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=20241112140719.149055-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.