DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Harris, James R" <james.r.harris@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
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 20:58:01 +0000
Message-ID: <A545DE05-D5ED-40D5-8A9F-F6D6D6E8D6C4@intel.com> (raw)
In-Reply-To: <3148596.31tV2P40R3@thomas>

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.


  reply	other threads:[~2020-10-12 20:58 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 [this message]
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
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A545DE05-D5ED-40D5-8A9F-F6D6D6E8D6C4@intel.com \
    --to=james.r.harris@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git