From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DF56A04B6; Mon, 12 Oct 2020 23:54:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6CEE1D9D9; Mon, 12 Oct 2020 23:54:54 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 107531D9D7 for ; Mon, 12 Oct 2020 23:54:53 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D3A15510; Mon, 12 Oct 2020 17:54:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 12 Oct 2020 17:54:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= CFM55GLPMZdG3R10Yo7EUkSjMfF4oNGNdMNcFP5TgAA=; b=L6j3ueUtHEe8F0dX WH1H82tai56VitQpr3h/AComwCt7/xapqKzU+b4tyslCgyBG0OEbagH5uBA2c+xJ wX8y83pIu1bP015OrjpNYaEx323Hydd4wAYQG6ILzJZ7Ts1MlMNVUPMxxVzn25ZK zxyDx4rlxEw5XCCoJdy1zhMfIFC1o30Hd1/W6363uBgLqphK4bqt2ZD9xegrCfNS J5Mv7NJ9KyVuxugbR6f4QZy8thN7cG586KESahEEIbQqitQt0QY7G6jjoMloOYGL JCNi2SUx2LlkixO4yILljne/zHlOqBq6mhJXe42eCMGl86MhgDRehQu2BWfykKRe xo309Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=CFM55GLPMZdG3R10Yo7EUkSjMfF4oNGNdMNcFP5Tg AA=; b=jVeiGH/D1YZGpiondkw+lZTi6zqJhj83iO8KFVws4HJh0R/lDOt4ofEwB gvUBb979KTHkhjahR5qH+U1kQyBktSytB9prRo/DFysdI1509kchpCF8MPLfzJcN Xrej1BdRHTx/cg3YwRG6JO072jEaDl600qXldS66mpB/oedMkKdmb60xp30GLlAm Eq5HfNTRvkJS8A+jMBZLoDwrQSu8NTQJruVItLHHb1BPD00J5Q+WkG9a/zaxTBjr 4DJiSQgPzwna0Z86qih/3/3W6UCUjL6cwKDalwwRJQ8vIoFgjlSPC///tDdS42Q7 7pfjNBJJJPWJLCJLpwgrlo9dT3eiA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrheekgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeekteehtdeivefhieegjeelgedufeejheekkeetueevieeuvdevuedt jeevheevteenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 64F393064610; Mon, 12 Oct 2020 17:54:49 -0400 (EDT) From: Thomas Monjalon To: "Harris, James R" Cc: "dev@dpdk.org" , "david.marchand@redhat.com" , "Richardson, Bruce" , "Yigit, Ferruh" Date: Mon, 12 Oct 2020 23:54:48 +0200 Message-ID: <2267861.r8P0VLOyel@thomas> In-Reply-To: References: <20200821220650.7901-1-james.r.harris@intel.com> <3148596.31tV2P40R3@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] pci/linux: copy new id for inserted device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 12/10/2020 22:58, Harris, James R: >=20 > =EF=BB=BFOn 10/7/20, 8:06 AM, "Thomas Monjalon" wro= te: >=20 > Hi Jim, >=20 > Sorry I see nobody reviewed your patch. >=20 > Jim Harris wrote: > > + memcpy(&dev2->id, &dev->id, sizeof(dev2->id)); > [...] > > + memcmp(&dev2->id, &dev->id, sizeof(dev2->id))) >=20 > Why using memcpy and memcmp instead of simple assignment and comparis= on? >=20 > 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. >=20 > I'm happy to send a v2 with a direct assignment/comparison though if that= is preferred. Yes please, direct assignment is preferred. Thanks