DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Shani Peretz <shperetz@nvidia.com>
Cc: <dev@dpdk.org>, <mkashani@nvidia.com>, <jblunck@infradead.org>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Chenbo Xia <chenbox@nvidia.com>,
	Nipun Gupta <nipun.gupta@amd.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: Re: [PATCH] eal/common: fix inconsistent representation of PCI numbers
Date: Mon, 1 Jul 2024 15:00:36 -0700	[thread overview]
Message-ID: <20240701150036.200131e9@hermes.local> (raw)
In-Reply-To: <20240701200117.6349-1-shperetz@nvidia.com>

On Mon, 1 Jul 2024 23:01:17 +0300
Shani Peretz <shperetz@nvidia.com> wrote:

> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -501,6 +501,15 @@ rte_pci_dump(FILE *f)
>  		pci_dump_one_device(f, dev);
>  	}
>  }
> +static int
> +pci_cmp_name(const struct rte_device *dev1, const void *name2)

Blank line between functions please

> +{
> +	const struct rte_pci_device *dev = RTE_DEV_TO_PCI_CONST(dev1);
> +	char name2_addr[sizeof(struct rte_pci_addr)] = {0};

This should just be a rte_pci_addr type, not char.
And don't need to initialize it.

> +	dev1->bus->parse(name2, (void *)&name2_addr);

If it was the correct type, cast would not be needed.

> +
> +	return memcmp(&name2_addr, &(dev->addr), sizeof(struct rte_pci_addr));

Use existing rte_pci_addr_cmp()

> +}

  reply	other threads:[~2024-07-01 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 20:01 Shani Peretz
2024-07-01 22:00 ` Stephen Hemminger [this message]
2024-07-08 16:51 ` [PATCH v3] " Shani Peretz
2024-07-12 13:49   ` David Marchand
2024-07-12 17:55     ` Thomas Monjalon
2024-10-04 22:21 ` [PATCH] " 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=20240701150036.200131e9@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=jblunck@infradead.org \
    --cc=mkashani@nvidia.com \
    --cc=nipun.gupta@amd.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=shperetz@nvidia.com \
    --cc=thomas@monjalon.net \
    /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 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).