From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id E6465B3D6 for ; Thu, 7 Jan 2016 19:16:42 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id cy9so264469256pac.0 for ; Thu, 07 Jan 2016 10:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=RvGygzxVqBiHp6BEO6ouUWnARAZEhEUmYa4zT1yD0ls=; b=eUMv0McTt7Q1WoKBz8VmaD2pD2VsFarixzBaE9i/u5S8lUHZS6pKF4j4uiy9Lx/+o2 bBdozS6/jAdIBLxIDrOmmTbJzsa8b64XG8f9SCIjRMyuqTT/ijExXUPyOP4IF0OAfH5s +NLwo05rq1/P9splavssPEwmJgM1G7S/VQmEe84WVPMlkwK3oSmN+gVyz+mJN5FEBuma CjAI5m+vWFelzM1VweryPWEnOH/g0HSOMGKrU4Fbytz9CcoPjruJ4VPw9R0gnpQqFVHC Rmv6Y5xipabgM+sg/rqhzu0HcfjaJkREHiV7a6/JmSfjc3DMTpuIhCDRpfb0q9B+LoBM 0ehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=RvGygzxVqBiHp6BEO6ouUWnARAZEhEUmYa4zT1yD0ls=; b=BS06c0E8MZge9wRT/RUfN4Ghczozdi7l/6uHNv1G8N2CuklDjjl0O4IkdosGqr+Ai9 mktcvezlXBPPeNWCtya1qhFBRvn6wK/6iUDpY3nep0gxR7N4PLfv4zR/bpCXOVuS9vTd 06RRjIAy/VspUYvAVsndHHnE24akOdxMY3ip3B44Qxn7swOzRv6DnczUjk9mFsnBLKkI IbQHwo636YiR4kjjL9QhiFwRK1tuEvkbJdBFpTv3Kz5w0GBsSwKd78eiJby/uwmK3Str Nxh/zarCkQLKba3WAboaevWDKukeBFqs+gALw/i6AEqAaRX+QonQrJknK8YSd3g5cR19 aqUQ== X-Gm-Message-State: ALoCoQltaYN57rALBhpm++6zjBD+m2rjhq3Pl6io1Y6ymPDHFUbf+F/TaU/V+IGdNIIM+9zvJl2EtNtWrr8a42BebMT6egyfZA== X-Received: by 10.66.90.166 with SMTP id bx6mr154456349pab.75.1452190601315; Thu, 07 Jan 2016 10:16:41 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id fc6sm160511910pac.44.2016.01.07.10.16.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jan 2016 10:16:41 -0800 (PST) Date: Thu, 7 Jan 2016 10:16:49 -0800 From: Stephen Hemminger To: Santosh Shukla Message-ID: <20160107101649.3a0384d2@xeon-e3> In-Reply-To: <1452184390-5994-5-git-send-email-sshukla@mvista.com> References: <1452184390-5994-1-git-send-email-sshukla@mvista.com> <1452184390-5994-5-git-send-email-sshukla@mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 04/12] linuxapp/vfio: ignore mapping for ioport region X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 18:16:43 -0000 This looks like the right thing to do. Minor nits. > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index 74f91ba..4077eb6 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -760,6 +760,26 @@ pci_vfio_map_resource(struct rte_pci_device *dev) > return -1; > } > > + /* chk for io port region */ > + uint32_t ioport_bar; In general DPDK has followed the kernel practice of putting declarations at the start of function/basic block. It is ok by me, but just noting that the rest of the code doesn't do it. > + ret = pread64(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar), > + VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) > + + PCI_BASE_ADDRESS_0 + i*4); > + > + if (ret != sizeof(ioport_bar)) { > + RTE_LOG(ERR, EAL, > + "Cannot read command (%x) from PCI config" > + "space!\n", PCI_BASE_ADDRESS_0 + i*4); Please dont split the line of a log message string in mid sentence. > + return -1; > + } > + > + if (ioport_bar & PCI_BASE_ADDRESS_SPACE_IO) { > + RTE_LOG(INFO, EAL, "\tIgnore mapping since Its a i/o" > + "port bar (%d) addr : %x\n", i, same here > + ioport_bar); > + continue; > + } > +