All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Shani Peretz <shperetz@nvidia.com>
Cc: dev@dpdk.org, stephen@networkplumber.org,
	Parav Pandit <parav@nvidia.com>,
	 Xueming Li <xuemingl@nvidia.com>,
	Nipun Gupta <nipun.gupta@amd.com>,
	Nikhil Agarwal <nikhil.agarwal@amd.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Rosen Xu <rosen.xu@intel.com>, Chenbo Xia <chenbox@nvidia.com>,
	Tomasz Duszynski <tduszynski@marvell.com>,
	Chengwen Feng <fengchengwen@huawei.com>,
	Long Li <longli@microsoft.com>, Wei Hu <weh@microsoft.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Kevin Laatz <kevin.laatz@intel.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: Re: [PATCH v5 2/4] lib: fix comparison between devices
Date: Thu, 06 Feb 2025 12:25:38 +0100	[thread overview]
Message-ID: <3823222.VQhiAETyHQ@thomas> (raw)
In-Reply-To: <20250206000838.23428-3-shperetz@nvidia.com>

06/02/2025 01:08, Shani Peretz:
> DPDK supports multiple formats for specifying buses,
> (such as "0000:08:00.0" and "08:00.0" for PCI).
> This flexibility can lead to inconsistencies when using one
> format while running testpmd, then attempts to use the other
> format in a later command, resulting in a failure.
> 
> The issue arises from the find_device function, which compares
> the user-provided string directly with the device->name in
> the rte_device structure.
> If we want to accurately compare these names, we'll need to bring both
> sides to the same representation by invoking the parse function
> on the user input.
> 
> The proposed solution is to utilize the parse function implemented
> by each bus. When comparing names, we will call parse on the supplied
> string as well as on the device name itself and compare the results.
> As part of the change the parse function will now return the size of the
> parsed address.
> 
> This will allow consistent comparisons between different representations
> of same devices.
> 
> In addition, fixed vdev test to use the rte_cmp_dev_name function
> instead of the custom one.
> 
> Fixes: a3ee360f4440 ("eal: add hotplug add/remove device")
> 
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>

I like how it looks safer.

Acked-by: Thomas Monjalon <thomas@monjalon.net>



  parent reply	other threads:[~2025-02-06 11:25 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 20:01 [PATCH] eal/common: fix inconsistent representation of PCI numbers Shani Peretz
2024-07-01 22:00 ` Stephen Hemminger
2024-07-08 16:51 ` [PATCH v3] " Shani Peretz
2024-07-12 13:49   ` David Marchand
2024-07-12 17:55     ` Thomas Monjalon
2025-01-29  8:54   ` [PATCH v4] bus: " Shani Peretz
2025-01-29  9:45     ` Bruce Richardson
2025-01-29 16:25     ` Stephen Hemminger
2025-02-05 16:36       ` Shani Peretz
2025-02-05 16:42         ` Stephen Hemminger
2025-02-05 17:37           ` Shani Peretz
2025-02-05 18:46             ` Stephen Hemminger
2025-02-05 20:16               ` Shani Peretz
2025-02-06  0:40                 ` Stephen Hemminger
2025-01-29 17:17     ` Stephen Hemminger
2025-01-29 18:06       ` Bruce Richardson
2025-02-05  1:55         ` fengchengwen
2025-02-06  0:08     ` [PATCH v5 0/4] fix comparison between devices Shani Peretz
2025-02-06  0:08       ` [PATCH v5 1/4] bus/pci: fix registration of PCI device Shani Peretz
2025-02-06 11:22         ` Thomas Monjalon
2025-02-06  0:08       ` [PATCH v5 2/4] lib: fix comparison between devices Shani Peretz
2025-02-06  7:55         ` Hemant Agrawal
2025-02-06 11:25         ` Thomas Monjalon [this message]
2025-02-10  1:18         ` Xu, Rosen
2025-02-11 17:48         ` Stephen Hemminger
2025-02-11 17:54           ` Bruce Richardson
2025-02-11 18:04             ` Stephen Hemminger
2025-02-19 13:26               ` Shani Peretz
2025-02-06  0:08       ` [PATCH v5 3/4] app/test: add tests to find devices Shani Peretz
2025-02-06  1:03         ` Stephen Hemminger
2025-02-06  0:08       ` [PATCH v5 4/4] lib: change find device and cmp dev name functions Shani Peretz
2025-02-06 10:54         ` [PATCH v6 1/4] bus/pci: fix registration of PCI device Shani Peretz
2025-02-06 10:54           ` [PATCH v6 2/4] lib: fix comparison between devices Shani Peretz
2025-02-06 10:54           ` [PATCH v6 3/4] app/test: add tests to find devices Shani Peretz
2025-02-06 10:54           ` [PATCH v6 4/4] lib: change find device and cmp dev name functions Shani Peretz
2025-02-11 17:04           ` [PATCH v6 1/4] bus/pci: fix registration of PCI device Bruce Richardson
2025-02-12  0:39           ` Stephen Hemminger
2025-02-12 16:38           ` [PATCH v7 " Shani Peretz
2025-02-12 16:38             ` [PATCH v7 2/4] lib: fix comparison between devices Shani Peretz
2025-02-19 16:50               ` Stephen Hemminger
2025-02-20 18:33               ` Stephen Hemminger
2025-03-06 16:26                 ` Shani Peretz
2025-03-17 14:11                   ` Stephen Hemminger
2025-04-30 11:12                     ` Shani Peretz
2025-04-30 15:59                       ` Stephen Hemminger
2025-04-30 17:17                         ` Shani Peretz
2025-07-08  8:37               ` [PATCH v8 0/1] fix inconsistent representation of PCI device name Shani Peretz
2025-07-08  8:37                 ` [PATCH v8 1/1] app/testpmd: canonicalize short PCI name format Shani Peretz
2025-07-09 17:38                   ` Stephen Hemminger
2025-07-13  6:34                   ` [PATCH v9 0/1] fix inconsistent representation of PCI device name Shani Peretz
2025-07-13  6:34                     ` [PATCH v9 1/1] app/testpmd: canonicalize short PCI name format Shani Peretz
2025-07-22  4:00                       ` Stephen Hemminger
2025-02-12 16:38             ` [PATCH v7 3/4] app/test: add tests to find devices Shani Peretz
2025-02-19 16:47               ` Stephen Hemminger
2025-04-02 14:22               ` Stephen Hemminger
2025-02-12 16:38             ` [PATCH v7 4/4] lib: change find device and cmp dev name functions Shani Peretz
2025-02-19 16:44             ` [PATCH v7 1/4] bus/pci: fix registration of PCI device Stephen Hemminger
2025-02-19 16:48             ` Stephen Hemminger
2025-02-24 20:38             ` Stephen Hemminger
2024-10-04 22:21 ` [PATCH] eal/common: fix inconsistent representation of PCI numbers Stephen Hemminger

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=3823222.VQhiAETyHQ@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=kevin.laatz@intel.com \
    --cc=longli@microsoft.com \
    --cc=nikhil.agarwal@amd.com \
    --cc=nipun.gupta@amd.com \
    --cc=parav@nvidia.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=rosen.xu@intel.com \
    --cc=sachin.saxena@nxp.com \
    --cc=shperetz@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=tduszynski@marvell.com \
    --cc=weh@microsoft.com \
    --cc=xuemingl@nvidia.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.