DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8
@ 2020-04-13 14:58 Christos Ricudis
  2020-04-13 15:14 ` Andrew Rybchenko
  2020-04-13 16:18 ` [dpdk-dev] [PATCH v2] " Christos Ricudis
  0 siblings, 2 replies; 6+ messages in thread
From: Christos Ricudis @ 2020-04-13 14:58 UTC (permalink / raw)
  To: dev; +Cc: Christos Ricudis

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 <ricudis@niometrics.com>
---
 usertools/dpdk-devbind.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index b1d1498..8ec1703 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -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 <name>_str
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8
  2020-04-13 14:58 [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8 Christos Ricudis
@ 2020-04-13 15:14 ` Andrew Rybchenko
  2020-04-13 15:36   ` Christos Rikoudis
  2020-04-13 16:18 ` [dpdk-dev] [PATCH v2] " Christos Ricudis
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2020-04-13 15:14 UTC (permalink / raw)
  To: Christos Ricudis, dev

On 4/13/20 5:58 PM, Christos Ricudis wrote:
> 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 <ricudis@niometrics.com>
> ---
>  usertools/dpdk-devbind.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
> index b1d1498..8ec1703 100755
> --- a/usertools/dpdk-devbind.py
> +++ b/usertools/dpdk-devbind.py
> @@ -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 <name>_str
> 


Is similar fix required in line 214 as well?

 name, value = line.decode('utf-8').split("\t", 1)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8
  2020-04-13 15:14 ` Andrew Rybchenko
@ 2020-04-13 15:36   ` Christos Rikoudis
  0 siblings, 0 replies; 6+ messages in thread
From: Christos Rikoudis @ 2020-04-13 15:36 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Christos Rikoudis, dev


> On 13 Apr 2020, at 11:14 PM, Andrew Rybchenko <arybchenko@solarflare.com> wrote:
> 
> On 4/13/20 5:58 PM, Christos Ricudis wrote:
>> 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 <ricudis@niometrics.com>
>> ---
>> usertools/dpdk-devbind.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
>> index b1d1498..8ec1703 100755
>> --- a/usertools/dpdk-devbind.py
>> +++ b/usertools/dpdk-devbind.py
>> @@ -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 <name>_str
>> 
> 
> 
> Is similar fix required in line 214 as well?
> 
> name, value = line.decode('utf-8').split("\t", 1)

Apparently yes, though the above patch was enough to fix our usage of dpdk-devbind. 

Same string appears in output of lspci -vmmks. I will update the patch and resubmit. 

Thanks for your help!

$ lspci -vmmks 28:00.0
Slot:   28:00.0
Class:  Ethernet controller
Vendor: Mellanox Technologies
Device: MT27800 Family [ConnectX-5]
SVendor:        Mellanox Technologies
SDevice:        ConnectX®-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT
PhySlot:        2
Driver: mlx5_core
Module: mlx5_core
NUMANode:       0

Christos Rikoudis
Senior Software Engineer
  <https://niometrics.com/>
Mail: ricudis@niometrics.com | Mobile: +65 9893 3659 | Office: +65 6396 9159 | Fax: +65 6396 7908

Niometrics Pte. Ltd. (Reg. No. 200909012M) | 600 North Bridge Road, #12-04, Parkview Square, Singapore 188778

niometrics.com <https://niometrics.com/>
We support email encryption via GPG suite <https://gpgtools.org/>
CONFIDENTIALITY NOTICE: This message (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error please contact the sender (by return email) immediately and delete this message. Any unauthorised use or dissemination of this message in whole or in parts is strictly prohibited.

DISCLAIMER: The information contained in this email, attachment, document and/or presentation have been researched by us with due care and all and any evaluations or assessments stated herein represent our personal opinions. We advise you that some of the available information may not have been independently verified and may be based on statements by third persons. No representation or warranty, expressed or implied, is made as to, and no reliance should be placed on, the fairness, accuracy, completeness or correctness of this information or opinions contained herein. Certain statements contained herein may be statements of future expectations and other forward-looking statements that are based on our current personal views and assumptions and involve known and unknown risks and uncertainties that cause actual results, performance or events to differ materially from those expressed or implied in such statements. None of our team shall assume any liability whatsoever (in negligence or otherwise) for any loss howsoever arising from any use of this email, attachment and/or presentation or the statements contained herein as to unverified third person statements, any statements of future expectations and other forward-looking statements, or the fairness, accuracy, completeness or correctness of statements contained herein, or otherwise arising in connection with this email, attachment, document and/or presentation.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] usertools: decode PCI device name as UTF-8
  2020-04-13 14:58 [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8 Christos Ricudis
  2020-04-13 15:14 ` Andrew Rybchenko
@ 2020-04-13 16:18 ` Christos Ricudis
  2020-04-13 16:19   ` Andrew Rybchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Christos Ricudis @ 2020-04-13 16:18 UTC (permalink / raw)
  To: dev; +Cc: arybchenko, Christos Ricudis

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 <ricudis@niometrics.com>
---
 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 <name>_str
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] usertools: decode PCI device name as UTF-8
  2020-04-13 16:18 ` [dpdk-dev] [PATCH v2] " Christos Ricudis
@ 2020-04-13 16:19   ` Andrew Rybchenko
  2020-05-24 17:10     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2020-04-13 16:19 UTC (permalink / raw)
  To: Christos Ricudis, dev

On 4/13/20 7:18 PM, Christos Ricudis wrote:
> 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 <ricudis@niometrics.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] usertools: decode PCI device name as UTF-8
  2020-04-13 16:19   ` Andrew Rybchenko
@ 2020-05-24 17:10     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2020-05-24 17:10 UTC (permalink / raw)
  To: Christos Ricudis; +Cc: dev, Andrew Rybchenko

13/04/2020 18:19, Andrew Rybchenko:
> On 4/13/20 7:18 PM, Christos Ricudis wrote:
> > 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 <ricudis@niometrics.com>
> 
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-24 17:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 14:58 [dpdk-dev] [PATCH] usertools: decode PCI device name as UTF-8 Christos Ricudis
2020-04-13 15:14 ` Andrew Rybchenko
2020-04-13 15:36   ` Christos Rikoudis
2020-04-13 16:18 ` [dpdk-dev] [PATCH v2] " Christos Ricudis
2020-04-13 16:19   ` Andrew Rybchenko
2020-05-24 17:10     ` Thomas Monjalon

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).