From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 0A68A2965 for ; Wed, 18 Jul 2018 15:11:30 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id s11-v6so4615975wra.13 for ; Wed, 18 Jul 2018 06:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PG9hOkQUiLygBvUQXhJObmdTrroBKuo0yZk6U20fImw=; b=ULO8cymAtGZ/+3hUfE261f2pjO6TTJhcEhE5ohy2uIrBM2/Hs3He7m1G2sgP93WegA 0JRzHvZ0YcjZ2fzOesLgwAEwAG5VC7QcU2MzH0Ygc1BgHwsITB3wexVXzQOJBqbT32nP /fOWrMK3l87QIJ2q70m2UV9W2rom+K2sVtjpBG4nEOTdcUmoIMndzDX8ZNwXcPBHjB/T BWJiAhmRdLt/M8z6DqvpCHM739Aw7hKQexomg5i+DbcmJyMukcR07NkeBMy6VLgmr0jm M6/DAbry+v9ChokldIod350jHWRtGnV34/xilaChyWja1s7xnwLdRCGjw10GHavcKGQ8 ToBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=PG9hOkQUiLygBvUQXhJObmdTrroBKuo0yZk6U20fImw=; b=EsnTgPUFFFj02pk4en2P2/UO/F6gnO901xv0WLq8Cs+XVEUlT7+hpk2HCfuq4M6dfV 1aemWxes6nVr0PR1eiFaNaRrQwb4JksJJzFuTTiIN4qwt3fLiuJXdyC5IAb7A1WxNc+o 3W7H8Svie3/BQmPR9GFhJloYKR100Jdw0iBiR2flYjqWpXssO0RDmT9k0zUR/dzxD73K PEqbcHu8CuXpA+Bz1ILWDMExpfDrGmLk67vPCO/HixRgP4l4GFeQhk/y5vr85GphC+mJ xvJ1X9poeh8ylXGF09pzFNDGtaho5irArBEBisujK4gaidqI+LKIgFunvbTjQeAPwXmf 65uA== X-Gm-Message-State: AOUpUlGy+WBrih+fH71tc96jPTI7w4MwDSvbSjCh04EY9dh8jvRsPp1F jqxZ3Gq/9TSJlQqC8s8L9Bqn1g== X-Google-Smtp-Source: AAOMgpdq5m+Jrf/qDvwuj4y0I9AyLJlmlkjzO5TbC/RTG4Gwg0G1PKjC+ckvghVNh/zv3WGhZQqHlA== X-Received: by 2002:adf:8362:: with SMTP id 89-v6mr4601850wrd.147.1531919489739; Wed, 18 Jul 2018 06:11:29 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 67-v6sm2165603wmg.34.2018.07.18.06.11.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jul 2018 06:11:28 -0700 (PDT) Date: Wed, 18 Jul 2018 15:11:12 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Qi Zhang Cc: thomas@monjalon.net, anatoly.burakov@intel.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20180718131112.jntryjeaflhonuk5@bidouze.vm.6wind.com> References: <20180712140144.18146-1-qi.z.zhang@intel.com> <20180712140144.18146-3-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180712140144.18146-3-qi.z.zhang@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 2/4] bus/pci: fix PCI address compare 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: , X-List-Received-Date: Wed, 18 Jul 2018 13:11:30 -0000 On Thu, Jul 12, 2018 at 10:01:42PM +0800, Qi Zhang wrote: > When use memcmp to compare two PCI address, sizeof(struct rte_pci_addr) > is 4 bytes aligned, and it is 8. While only 7 byte of struct rte_pci_addr > is valid. So compare the 8th byte will cause the unexpected result, which > happens when repeatedly attach/detach a device. > > Fixes: 94c0776b1bad ("vfio: support hotplug") > Cc: stable@dpdk.org > > Signed-off-by: Qi Zhang Acked-by: Gaetan Rivet > --- > drivers/bus/pci/linux/pci_vfio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c > index aeeaa9ed8..933b95540 100644 > --- a/drivers/bus/pci/linux/pci_vfio.c > +++ b/drivers/bus/pci/linux/pci_vfio.c > @@ -642,7 +642,7 @@ pci_vfio_unmap_resource(struct rte_pci_device *dev) > vfio_res_list = RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list); > /* Get vfio_res */ > TAILQ_FOREACH(vfio_res, vfio_res_list, next) { > - if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr))) > + if (rte_pci_addr_cmp(&vfio_res->pci_addr, &dev->addr)) > continue; > break; > } > -- > 2.13.6 > -- Gaëtan Rivet 6WIND