All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Jim Harris <james.r.harris@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] pci/linux: copy new id for inserted device
Date: Tue, 13 Oct 2020 10:40:34 +0200	[thread overview]
Message-ID: <7220007.vanevMHQ6d@thomas> (raw)
In-Reply-To: <20201012220136.6618-1-james.r.harris@intel.com>

13/10/2020 00:01, Jim Harris:
> When a device is inserted into an existing BDF slot
> that has not been probed, we must overwrite the old
> PCI ID with the ID of the new function. Otherwise
> we may not probe the function with the correct driver,
> if at all.
> 
> Signed-off-by: Jim Harris <james.r.harris@intel.com>
> ---
> --- a/drivers/bus/pci/linux/pci.c
> +++ b/drivers/bus/pci/linux/pci.c
> @@ -352,6 +352,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
>  				if (!rte_dev_is_probed(&dev2->device)) {
>  					dev2->kdrv = dev->kdrv;
>  					dev2->max_vfs = dev->max_vfs;
> +					dev2->id = dev->id;

This simple assignment looks nicer than memcpy.
Thanks for this change.

[...]
>  					if (dev2->kdrv != dev->kdrv ||
> -						dev2->max_vfs != dev->max_vfs)
> +						dev2->max_vfs != dev->max_vfs ||
> +						dev2->id != dev->id)

Unfortunately comparison of structs is not supported.
It seems your original memcmp is right.



  reply	other threads:[~2020-10-13  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 22:06 [dpdk-dev] [PATCH] pci/linux: copy new id for inserted device Jim Harris
2020-08-24 21:10 ` [dpdk-dev] [PATCH v2] " Jim Harris
2020-10-07 15:05   ` Thomas Monjalon
2020-10-12 20:58     ` Harris, James R
2020-10-12 21:54       ` Thomas Monjalon
2020-10-12 22:01   ` [dpdk-dev] [PATCH v3] " Jim Harris
2020-10-13  8:40     ` Thomas Monjalon [this message]
2020-10-13 14:06     ` [dpdk-dev] [PATCH v4] " Jim Harris
2020-10-13 17:03     ` [dpdk-dev] [PATCH v5] " Jim Harris
2020-10-13 21:02       ` Thomas Monjalon

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=7220007.vanevMHQ6d@thomas \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.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.