From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89AC245CF5; Tue, 12 Nov 2024 15:00:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6634B427AC; Tue, 12 Nov 2024 15:00:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id DA07840649 for ; Tue, 12 Nov 2024 15:00:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731420039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yhZLoR5fdRspN9phaI6Hiaxk1t1fibVyygC1zr4K1Bo=; b=BCb/Z9z4ILt/LZEXOcdlFUO2A4csVYtuUKmC2kqMQDvxyllh/k3kl8lRSqEuQl1LQ9hHsJ wYBKiLQxZ0C93yToMCPul0r9mj9lnXf9iggoWEKfxYRLQq8DoRedykKBaQlykCuSEKwrb1 iUI0NzMaMt/EMIXytIJmfwacp2EBpMw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-2bfjfhsQN1mniPnylx0t1A-1; Tue, 12 Nov 2024 09:00:38 -0500 X-MC-Unique: 2bfjfhsQN1mniPnylx0t1A-1 X-Mimecast-MFC-AGG-ID: 2bfjfhsQN1mniPnylx0t1A Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4317391101aso40895625e9.2 for ; Tue, 12 Nov 2024 06:00:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731420037; x=1732024837; h=in-reply-to:references:user-agent:cc:subject:to:from:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yhZLoR5fdRspN9phaI6Hiaxk1t1fibVyygC1zr4K1Bo=; b=jVXP1OoO5dtuAbK0z/PReAsVpjirj/wSYh4Yn0kLEd2rSVpYlTrK8cgzO6HYN7LOlq XlAf57FDj5H0HPx4bViy/Y8NKMWIndVRachBgnKlIocAvXcislbRIwlDnM9EpOeUO2Wa RT/yj1yWG1nCGafJuQpm2f2rEIlQPmz4ehEBypGn7oh1YItdOw6FAA/xjqBTm+86Sb6Z p3rUMa1iaTDVFuKUHoEWinIlpG3VqzJEpqNruump6YLiv/0KOY/aWPEGTQP94TQ/VnV2 ywz5gvqhxGu0qjZPZB+3mXmrjuEOEa9YI84AestkkldPaibNq23GaL37wvLeD9xmbgNK rgKQ== X-Gm-Message-State: AOJu0YzLSritYvm90PuJYyGL1bqD13Mtft7ZBIP5GxCiZt2oz6LsFH8J Kb62sw1m9TtAocG04rITtTeIeUKmEPt3hoK8urPos/5AAU5GaQmcjPyM/9052F+he30oTQXc4ka TUuPwkN5nKWjmeZVQNaVAJNaqPXUJIzGIQ0q6j+tX X-Received: by 2002:a05:600c:1396:b0:426:6e86:f82 with SMTP id 5b1f17b1804b1-432b7518d6fmr143948805e9.22.1731420035576; Tue, 12 Nov 2024 06:00:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzUoBtqTEBCZe6/TxnSd4azjICnOM/4J0RxGJD9aZ8tyAKOyI77wSjhOuf+fy8oEQ912sH3Q== X-Received: by 2002:a05:600c:1396:b0:426:6e86:f82 with SMTP id 5b1f17b1804b1-432b7518d6fmr143947965e9.22.1731420034741; Tue, 12 Nov 2024 06:00:34 -0800 (PST) Received: from localhost (2a01cb00025433006239e1f47a0b2371.ipv6.abo.wanadoo.fr. [2a01:cb00:254:3300:6239:e1f4:7a0b:2371]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432b05e5d1bsm215089335e9.40.2024.11.12.06.00.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Nov 2024 06:00:34 -0800 (PST) Mime-Version: 1.0 Date: Tue, 12 Nov 2024 15:00:32 +0100 Message-Id: From: "Robin Jarry" To: =?utf-8?q?Rogelio_Dom=C3=ADnguez_Hern=C3=A1ndez?= Subject: Re: [PATCH] usertools/devbind: support all possible values sysfs flag Cc: User-Agent: aerc/0.18.2-101-g95b6f544c5c4 References: <20241112131548.102992-1-rogelio.dominguez@gmail.com> In-Reply-To: <20241112131548.102992-1-rogelio.dominguez@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tae8NPtLFNoDicv_wo2hmDrdP_SDPRZOq_wec5D5e_o_1731420037 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, Rogelio Dom=C3=ADnguez Hern=C3=A1ndez, Nov 12, 2024 at 14:15: > 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=C3=ADnguez Hern=C3=A1ndez > --- > 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(): > =20 > try: > with open(filename, "r") as f: > - if f.read(1) =3D=3D "1": > + value =3D f.read(1) > + if value =3D=3D "1" or value =3D=3D "y" or value =3D=3D "Y": Minor detail, could you rewrite it as: if value in ("1", "y", "Y"): > return > except OSError as err: > sys.exit(f"Error: failed to check unsafe noiommu mode - Cannot o= pen {filename}: {err}") > --=20 > 2.45.2 Thanks!