From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal/linux: fix multi-process cannot work Date: Tue, 04 Apr 2017 11:58:39 +0200 Message-ID: <1692898.PdBQoVJhCZ@xps13> References: <1489681724-22114-1-git-send-email-jianfeng.tan@intel.com> <7c01afcd-20a7-f2a0-f230-04e5b04fb3c9@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Sergio Gonzalez Monroy , benjamin.walker@intel.com, stable@dpdk.org To: Jianfeng Tan Return-path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id EFBF8326B for ; Tue, 4 Apr 2017 11:58:41 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id k6so202375210wre.2 for ; Tue, 04 Apr 2017 02:58:41 -0700 (PDT) In-Reply-To: <7c01afcd-20a7-f2a0-f230-04e5b04fb3c9@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-03-29 16:19, Sergio Gonzalez Monroy: > On 16/03/2017 16:28, Jianfeng Tan wrote: > > When binding with vfio-pci, secondary process cannot be started with > > an error message: > > > > cannot find TAILQ entry for PCI device. > > > > It's due to: struct rte_pci_addr is padded with 1 byte for alignment > > by compiler. Then below comparison in commit 2f4adfad0a69 > > ("vfio: add multiprocess support") will fail if the last byte is not > > initialized. > > > > memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr) > > > > And commit cdc242f260e7 ("eal/linux: support running as unprivileged user") > > just triggers this bug by using a stack un-initialized variable. > > > > The fix is to use rte_eal_compare_pci_addr() for pci addr comparison. > > > > Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") > > Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user") > > CC: stable@dpdk.org > > > > Reported-by: Rutkowski, Pawel > > Signed-off-by: Jianfeng Tan > > Acked-by: Sergio Gonzalez Monroy Applied, thanks