From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL9sG-0004AS-Ni for qemu-devel@nongnu.org; Mon, 18 Jan 2016 08:29:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL9sD-0000Ex-Gw for qemu-devel@nongnu.org; Mon, 18 Jan 2016 08:29:36 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:34132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL9sD-0000E5-77 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 08:29:33 -0500 Received: by mail-wm0-x22d.google.com with SMTP id u188so104103253wmu.1 for ; Mon, 18 Jan 2016 05:29:32 -0800 (PST) References: <1452522868-25550-1-git-send-email-peter.maydell@linaro.org> <1452522868-25550-5-git-send-email-peter.maydell@linaro.org> From: Eric Auger Message-ID: <569CE8AC.8010105@linaro.org> Date: Mon, 18 Jan 2016 14:29:16 +0100 MIME-Version: 1.0 In-Reply-To: <1452522868-25550-5-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 5/5] hw/arm/virt: Support legacy -nic command line syntax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org, ashoks@broadcom.com Cc: Alex Williamson , "eric.auger@st.com" , Christoffer Dall Hi, How is it supposed to live with Passthrough'ed NIC? Current way to instantiate a VFIO platform NIC looks like: -device vfio-amd-xgbe,host=e0900000.xgmac where vfio-amd-xgbe is the name of the VFIO AMD XGBE platform QEMU device and e0900000.xgmac is the name of the device in /sys/bus/platform/devices. Before that commit I was able to instantiate this VFIO device and got networking working, testing it with ping. Now ping don't work anymore. I Guess I now use this other default NIC? Curiously it does not seem to prevent networking with upstreamed Calxeda Midway device and I did not figure why yet? Thank you in advance Best Regards Eric On 01/11/2016 03:34 PM, Peter Maydell wrote: > From: Ashok Kumar > > Support the legacy -nic syntax for creating PCI network devices > as well as the new-style -device options. This makes life easier > for people moving from x86 KVM virtualization to ARM KVM virtualization > and expecting their network configuration options to work the same > way for both setups. > > We use "virtio" as the default NIC model if the user doesn't specify one. > > Signed-off-by: Ashok Kumar > Message-id: 1452091659-17698-1-git-send-email-ashoks@broadcom.com > Reviewed-by: Peter Maydell > [PMM: expanded and clarified commit message] > Signed-off-by: Peter Maydell > --- > hw/arm/virt.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index acc1fcb..fd52b76 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -808,6 +808,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, > DeviceState *dev; > char *nodename; > int i; > + PCIHostState *pci; > > dev = qdev_create(NULL, TYPE_GPEX_HOST); > qdev_init_nofail(dev); > @@ -847,6 +848,19 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, > sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]); > } > > + pci = PCI_HOST_BRIDGE(dev); > + if (pci->bus) { > + for (i = 0; i < nb_nics; i++) { > + NICInfo *nd = &nd_table[i]; > + > + if (!nd->model) { > + nd->model = g_strdup("virtio"); > + } > + > + pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); > + } > + } > + > nodename = g_strdup_printf("/pcie@%" PRIx64, base); > qemu_fdt_add_subnode(vbi->fdt, nodename); > qemu_fdt_setprop_string(vbi->fdt, nodename, >