Received: from eggs.gnu.org ([2001:4830:134:3::10]:48386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK2z1-0005RU-CM for qemu-devel@nongnu.org; Wed, 20 Aug 2014 06:19:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK2ys-0007nj-L2 for qemu-devel@nongnu.org; Wed, 20 Aug 2014 06:19:11 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK2ys-0007na-DO for qemu-devel@nongnu.org; Wed, 20 Aug 2014 06:19:02 -0400 Message-ID: <1408529923.14053.113.camel@abi.no.oracle.com> From: Knut Omang Date: Wed, 20 Aug 2014 12:18:43 +0200 In-Reply-To: <33183CC9F5247A488A2544077AF1902086D61845@SZXEMA503-MBS.china.huawei.com> References: <1408517610.25437.103.camel@ori.omang.mine.nu> <1408525048.13594.49.camel@localhost.localdomain> <33183CC9F5247A488A2544077AF1902086D61845@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: Juan Quintela , Alexey Kardashevskiy , "Michael S.Tsirkin" , "qemu-devel@nongnu.org" , Markus Armbruster , Igor Mammedov , Paolo Bonzini , Marcel Apfelbaum , Isaku Yamahata On Wed, 2014-08-20 at 09:02 +0000, Gonglei (Arei) wrote: > > > static int ioh3420_initfn(PCIDevice *d) > > > { > > > + PCIBridge* br = PCI_BRIDGE(d); > > > PCIEPort *p = PCIE_PORT(d); > > > PCIESlot *s = PCIE_SLOT(d); > > > + uint8_t *exp_cap; > > > int rc; > > > char tmp[100]; > > > sprintf(tmp, "pcie_port.%d", s->slot); > > > @@ -121,6 +123,10 @@ static int ioh3420_initfn(PCIDevice *d) > > > if (rc < 0) { > > > goto err_msi; > > > } > > > + /* Support ARI forwarding */ > > > + exp_cap = d->config + d->exp.exp_cap; > > > + pci_word_test_and_set_mask(exp_cap + PCI_EXP_DEVCAP2, > > PCI_EXP_DEVCAP2_ARI); > > > + > > Hi, > > > > I think is better to move the implementation to a function, say > > pcie_cap_ari_init > > and place it into hw/pci/pcie.c so other devices like downstream ports can use > > it. > > > Yes, good idea. And I noticed a function ioh3420_init(), but not be called. > Maybe it is useful. Yes, I noticed too - I would guess this is something left over from an earlier stage of the qdev APIs - Isaku, should I add a patch to remove it while at this? > Best regards, > -Gonglei >