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 7DC43A04B6; Tue, 13 Oct 2020 10:40:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 14C071DAA3; Tue, 13 Oct 2020 10:40:40 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 62EEB1DAA1 for ; Tue, 13 Oct 2020 10:40:37 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D9AFD5C01A9; Tue, 13 Oct 2020 04:40:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 13 Oct 2020 04:40:36 -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= 7W0vqKXfABltoNPtTXnd3b/r8zDkVgmxscXm0ST56c4=; b=t936jt/bv6qAhOkN Ci0YPeGPas14LKEVqO/uJk5nLL3V5Ynev7vJEljKv2R9fPnziKVr3C2wEptBiXYT 0011IAwZxRQE4haZefukdHcXdUwjIeRFhEZANvK4qHcA2xJNDkYHqJkcB3l5hto5 kylHfn1Dg3rpicx0mpjNKH098O9QelpVIFqsDtWGXgqo5fuuuQEnKzhbb/8nkiwD HILk4hQchCdfbtTXh7Mv+Wvo9lvpE3RkWnQWLFVj1JAYoPA0tVYws6eh9rZ6if6/ NBJbd/d+q0h74Tr80PBAzJgKJFk3D3C7Pku4bYjJMzLrembQIQ1DJd3evwSVdwPw ISBN8Q== 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=7W0vqKXfABltoNPtTXnd3b/r8zDkVgmxscXm0ST56 c4=; b=evljQT/tryQA8+CkHSGNKla73ZpLrimmZhHkT3QGz0kP75BbPTRhMSoee +PfJvEIrmtr/0inyLGCtxkeEIS/A3Huqonb6PMXU0VD/oGMrhz+RL9++gawfi6jp jP3EZbDpwFnsx/ln4z9yriQZFajtpeAyVxv0TzhIJLxnxPGv7dyVoDecdFlVJPCC jc5ASHJn2IHyH6XT3Dutd8uFc8LjaMuoNuOatxQwQVkkr3BcWem0hOHu2zIFMMxp 2xSXohx3wrwlrV2wfUb0OtKe2JnDBW/Rj1vp5hoYXCE5FZSgk1PSUdYZrAAAJxKf xIo1b0X4j4AVRf87fHvH3Wh/BZTEA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrheelgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih 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 1CB5B3064610; Tue, 13 Oct 2020 04:40:36 -0400 (EDT) From: Thomas Monjalon To: Jim Harris Cc: dev@dpdk.org Date: Tue, 13 Oct 2020 10:40:34 +0200 Message-ID: <7220007.vanevMHQ6d@thomas> In-Reply-To: <20201012220136.6618-1-james.r.harris@intel.com> References: <20200824211038.48932-1-james.r.harris@intel.com> <20201012220136.6618-1-james.r.harris@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] 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" 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 > --- > --- 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.