From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8FC90FE5; Fri, 31 Mar 2017 18:09:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490976580; x=1522512580; h=from:to:cc:subject:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=9iecSF8oybuELFvhSlabGUcfdDi7nBQygvdcs7VjhCA=; b=iLOU9XYe7cV4FgveKeHcG3gGbSENgpf9nEZtSf/p3wJkNLbFbdwrXYu1 asrZwmbUL8hmWHs2YHOqFt27E95jVg==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 09:09:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,252,1486454400"; d="scan'208";a="83168961" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.221.23]) ([10.237.221.23]) by fmsmga006.fm.intel.com with ESMTP; 31 Mar 2017 09:09:37 -0700 From: Sergio Gonzalez Monroy To: Andrew Rybchenko Cc: Anatoly Burakov , stable@dpdk.org, dev@dpdk.org References: <1490975813-6700-1-git-send-email-arybchenko@solarflare.com> Message-ID: Date: Fri, 31 Mar 2017 17:09:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1490975813-6700-1-git-send-email-arybchenko@solarflare.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] vfio: do not use memcmp() to compare PCI address 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: Fri, 31 Mar 2017 16:09:41 -0000 On 31/03/2017 16:56, Andrew Rybchenko wrote: > PCI address structure has padding which may have garbage. > > Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") > Cc: stable@dpdk.org > > Signed-off-by: Andrew Rybchenko > --- > It is a real bug which I've hit during multi-process debugging. > > lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index 5f478c5..7d8b9fb 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -355,7 +355,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > } else { > /* if we're in a secondary process, just find our tailq entry */ > TAILQ_FOREACH(vfio_res, vfio_res_list, next) { > - if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr))) > + if (rte_eal_compare_pci_addr(&vfio_res->pci_addr, > + &dev->addr)) > continue; > break; > } Different commit, same patch :) http://dpdk.org/dev/patchwork/patch/21828/ Regards, Sergio