From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLXz4-0007OD-G2 for qemu-devel@nongnu.org; Sat, 10 Nov 2018 13:27:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLXz3-00074R-Qr for qemu-devel@nongnu.org; Sat, 10 Nov 2018 13:27:50 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gLXz3-00072x-If for qemu-devel@nongnu.org; Sat, 10 Nov 2018 13:27:49 -0500 Received: by mail-wr1-x443.google.com with SMTP id y3-v6so5121160wrh.10 for ; Sat, 10 Nov 2018 10:27:49 -0800 (PST) References: <20181108160818.5485-1-yuval.shaia@oracle.com> <20181108160818.5485-14-yuval.shaia@oracle.com> From: Marcel Apfelbaum Message-ID: Date: Sat, 10 Nov 2018 20:27:44 +0200 MIME-Version: 1.0 In-Reply-To: <20181108160818.5485-14-yuval.shaia@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH v2 13/22] hw/pvrdma: Make sure PCI function 0 is vmxnet3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuval Shaia , dmitry.fleytman@gmail.com, jasowang@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, shamir.rabinovitch@oracle.com On 11/8/18 6:08 PM, Yuval Shaia wrote: > Guest driver enforces it, we should also. > > Signed-off-by: Yuval Shaia > --- > hw/rdma/vmw/pvrdma.h | 2 ++ > hw/rdma/vmw/pvrdma_main.c | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h > index b019cb843a..10a3c4fb7c 100644 > --- a/hw/rdma/vmw/pvrdma.h > +++ b/hw/rdma/vmw/pvrdma.h > @@ -20,6 +20,7 @@ > #include "hw/pci/pci.h" > #include "hw/pci/msix.h" > #include "chardev/char-fe.h" > +#include "hw/net/vmxnet3_defs.h" > > #include "../rdma_backend_defs.h" > #include "../rdma_rm_defs.h" > @@ -85,6 +86,7 @@ typedef struct PVRDMADev { > RdmaBackendDev backend_dev; > RdmaDeviceResources rdma_dev_res; > CharBackend mad_chr; > + VMXNET3State *func0; > } PVRDMADev; > #define PVRDMA_DEV(dev) OBJECT_CHECK(PVRDMADev, (dev), PVRDMA_HW_NAME) > > diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c > index ac8c092db0..fa6468d221 100644 > --- a/hw/rdma/vmw/pvrdma_main.c > +++ b/hw/rdma/vmw/pvrdma_main.c > @@ -576,6 +576,9 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp) > return; > } > > + /* Break if not vmxnet3 device in slot 0 */ > + dev->func0 = VMXNET3(pci_get_function_0(pdev)); > + I don't see the error code flow in case VMXNET3 is not func 0. Am I missing something? Thanks, Marcel > memdev_root = object_resolve_path("/objects", NULL); > if (memdev_root) { > object_child_foreach(memdev_root, pvrdma_check_ram_shared, &ram_shared);