DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Harris, James R" <james.r.harris@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] pci/linux: copy new id for inserted device
Date: Mon, 12 Oct 2020 23:54:48 +0200	[thread overview]
Message-ID: <2267861.r8P0VLOyel@thomas> (raw)
In-Reply-To: <A545DE05-D5ED-40D5-8A9F-F6D6D6E8D6C4@intel.com>

12/10/2020 22:58, Harris, James R:
> 
> On 10/7/20, 8:06 AM, "Thomas Monjalon" <thomas@monjalon.net> wrote:
> 
>     Hi Jim,
> 
>     Sorry I see nobody reviewed your patch.
> 
>     Jim Harris <james.r.harris@intel.com> wrote:
>     > + memcpy(&dev2->id, &dev->id, sizeof(dev2->id));
>     [...]
>     > + memcmp(&dev2->id, &dev->id, sizeof(dev2->id)))
> 
>     Why using memcpy and memcmp instead of simple assignment and comparison?
> 
> Direct assignment and comparison would work too.  I did see some similar cases though using memcpy for rte_pci_addr (which is similar to rte_pci_id) in linux/pci_uio.c and linux/pci_vfio.c.  It wasn't clear to me if direct assignment/comparison for structures was the norm for DPDK.
> 
> I'm happy to send a v2 with a direct assignment/comparison though if that is preferred.

Yes please, direct assignment is preferred.
Thanks



  reply	other threads:[~2020-10-12 21:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 22:06 [dpdk-dev] [PATCH] " 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 [this message]
2020-10-12 22:01   ` [dpdk-dev] [PATCH v3] " Jim Harris
2020-10-13  8:40     ` Thomas Monjalon
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=2267861.r8P0VLOyel@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --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 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).