From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B926BA0577; Mon, 13 Apr 2020 18:18:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08BB51BE9C; Mon, 13 Apr 2020 18:18:27 +0200 (CEST) Received: from integrity.niometrics.com (integrity.niometrics.com [42.61.70.122]) by dpdk.org (Postfix) with ESMTP id C77921BE99 for ; Mon, 13 Apr 2020 18:18:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by integrity.niometrics.com (Postfix) with ESMTP id 69B91409CBA9; Tue, 14 Apr 2020 00:18:23 +0800 (+08) DKIM-Filter: OpenDKIM Filter v2.11.0 integrity.niometrics.com 69B91409CBA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niometrics.com; s=default; t=1586794704; bh=a0FP5YdPYaAb8aCjdGQ87pgLtYjrJks1hcoqeS3FZQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y4EwXj947vQ6vKKirqlmMdoGks49Hzi7qTJqajyfmdR6TKFqCDV5RT9mJHyhTVSMa Vh+DrbtnxRt3dF5p4gw3Mh/MVYqPVfffdqgN8VXBXSR9+1m3Lqq4lhUQj+bWysQIyb pdQJCty6wkFJ5FfWwjU50OGT2h17O+ue5OesbJMM= X-Virus-Scanned: amavisd-new at niometrics.com Received: from integrity.niometrics.com ([127.0.0.1]) by localhost (integrity.niometrics.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ODr56QOp9QH5; Tue, 14 Apr 2020 00:18:23 +0800 (+08) Received: from devserver-sg-11.niometrics.com (test-site-3.niometrics.com [192.168.2.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by integrity.niometrics.com (Postfix) with ESMTPSA id 52565409CBA8; Tue, 14 Apr 2020 00:18:22 +0800 (+08) DKIM-Filter: OpenDKIM Filter v2.11.0 integrity.niometrics.com 52565409CBA8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niometrics.com; s=default; t=1586794703; bh=a0FP5YdPYaAb8aCjdGQ87pgLtYjrJks1hcoqeS3FZQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZBP8u7MNdgEiXmp6QptZ230wmeIOTBbe9Q/NnCgGXifE73i0b0zYTnyPx9lrJPtPa NCjqZNOlrh0s+ZTNBLA9Czv2pZ3UUZ82r3NqgBGveMrAN+4jlOJBdt8d3zMo9PKYd/ /D9MhrEPKPPFh+QK1ujHWdMJ14aBd1avr1X2pQVM= From: Christos Ricudis To: dev@dpdk.org Cc: arybchenko@solarflare.com, Christos Ricudis Date: Tue, 14 Apr 2020 00:18:04 +0800 Message-Id: <1586794684-19027-1-git-send-email-ricudis@niometrics.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1586789914-10825-1-git-send-email-ricudis@niometrics.com> References: <1586789914-10825-1-git-send-email-ricudis@niometrics.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=3.5 tests=ALL_TRUSTED, AWL, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on integrity.niometrics.com Subject: [dpdk-dev] [PATCH v2] usertools: decode PCI device name as UTF-8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes the case where a PCI device string identifier contains non-ASCII UTF-8 A particular example is Mellanox Connext-X 5 EN MT27800: 28:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] Subsystem: Mellanox Technologies ConnectX®-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT Signed-off-by: Christos Ricudis --- usertools/dpdk-devbind.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index b1d1498..fad0eaa 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -211,7 +211,7 @@ def get_pci_device_details(dev_id, probe_lspci): for line in extra_info: if len(line) == 0: continue - name, value = line.decode().split("\t", 1) + name, value = line.decode("utf8").split("\t", 1) name = name.strip(":") + "_str" device[name] = value # check for a unix interface name @@ -257,7 +257,7 @@ def get_device_details(devices_type): # Clear previous device's data dev = {} else: - name, value = dev_line.decode().split("\t", 1) + name, value = dev_line.decode("utf8").split("\t", 1) value_list = value.rsplit(' ', 1) if len(value_list) > 1: # String stored in _str -- 1.8.3.1