All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
@ 2016-01-06 14:47 Ashok Kumar
  2016-01-06 18:10 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Ashok Kumar @ 2016-01-06 14:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ashok Kumar

virtio model is used for default case.

Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
---
 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,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
  2016-01-06 14:47 [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus Ashok Kumar
@ 2016-01-06 18:10 ` Peter Maydell
  2016-01-07  5:53   ` Ashok Kumar
       [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2016-01-06 18:10 UTC (permalink / raw)
  To: Ashok Kumar; +Cc: QEMU Developers

On 6 January 2016 at 14:47, Ashok Kumar <ashoks@broadcom.com> wrote:
> virtio model is used for default case.
>
> Signed-off-by: Ashok Kumar <ashoks@broadcom.com>

Could you explain why you think this needs to be done?
Virtio networking works OK for me...

I guess from the patch that this is adding support for
the legacy '-net' way of configuring networking, but do
we need that if we never supported it in the first place?
(If virt is the only PCI machine which doesn't support
-net syntax that would probably be a strong argument for
supporting it.)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
  2016-01-06 18:10 ` Peter Maydell
@ 2016-01-07  5:53   ` Ashok Kumar
       [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Ashok Kumar @ 2016-01-07  5:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On Wed, Jan 06, 2016 at 06:10:15PM +0000, Peter Maydell wrote:
Hi,

> On 6 January 2016 at 14:47, Ashok Kumar <ashoks@broadcom.com> wrote:
> > virtio model is used for default case.
> >
> > Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
> 
> Could you explain why you think this needs to be done?
Yes, for -net. Honestly, I didn't know this is obsolete and the
only syntax I knew for networking. 

> Virtio networking works OK for me...
I tried the new syntax now and it is working fine.

> 
> I guess from the patch that this is adding support for
> the legacy '-net' way of configuring networking, but do
> we need that if we never supported it in the first place?
> (If virt is the only PCI machine which doesn't support
> -net syntax that would probably be a strong argument for
> supporting it.)
Fine with me. But there are some documentation for e.g [1] which says "-net" is
still supported.

[1] http://www.linux-kvm.org/page/Networking#Compatibility

Thanks,
Ashok
> 
> thanks
> -- PMM
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
       [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2016-01-07 14:47     ` Peter Maydell
  2016-01-07 15:21       ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2016-01-07 14:47 UTC (permalink / raw)
  To: Ashok Kumar; +Cc: Paolo Bonzini, Jason Wang, QEMU Developers, Stefan Hajnoczi

On 7 January 2016 at 05:53, Ashok Kumar <ashoks@broadcom.com> wrote:
> On Wed, Jan 06, 2016 at 06:10:15PM +0000, Peter Maydell wrote:
>> I guess from the patch that this is adding support for
>> the legacy '-net' way of configuring networking, but do
>> we need that if we never supported it in the first place?
>> (If virt is the only PCI machine which doesn't support
>> -net syntax that would probably be a strong argument for
>> supporting it.)
> Fine with me. But there are some documentation for e.g [1] which says "-net" is
> still supported.
>
> [1] http://www.linux-kvm.org/page/Networking#Compatibility

I've cc'd the networking maintainer and some other people
who might have an opinion. Basically the question is
"should we support the legacy -net syntax for new board models
which didn't exist back when -net was the only option and
have never supported -net" ?

The argument for "don't support it" is that -net is legacy and
if there aren't any legacy command lines to support then we
should avoid extending the scope of legacy behaviour.

The argument for "do support it" is consistency -- we don't
document that -net is only for certain boards, and users
will expect that network config options that work on some machines
(including x86 PC and many of the ARM embedded board models)
will also work on the ARM virt board.

I think my current inclination is to say that virt should
support -net, because I would prefer to avoid having yet
another speedbump in the path of people trying to move to
using KVM-on-ARM based on their previous experience with
KVM-on-x86.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
  2016-01-07 14:47     ` Peter Maydell
@ 2016-01-07 15:21       ` Paolo Bonzini
  2016-01-11  2:54         ` Jason Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2016-01-07 15:21 UTC (permalink / raw)
  To: Peter Maydell, Ashok Kumar; +Cc: Jason Wang, QEMU Developers, Stefan Hajnoczi



On 07/01/2016 15:47, Peter Maydell wrote:
> I think my current inclination is to say that virt should
> support -net, because I would prefer to avoid having yet
> another speedbump in the path of people trying to move to
> using KVM-on-ARM based on their previous experience with
> KVM-on-x86.

I agree.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
  2016-01-07 15:21       ` Paolo Bonzini
@ 2016-01-11  2:54         ` Jason Wang
  2016-01-11 13:24           ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2016-01-11  2:54 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell, Ashok Kumar
  Cc: QEMU Developers, Stefan Hajnoczi



On 01/07/2016 11:21 PM, Paolo Bonzini wrote:
>
> On 07/01/2016 15:47, Peter Maydell wrote:
>> I think my current inclination is to say that virt should
>> support -net, because I would prefer to avoid having yet
>> another speedbump in the path of people trying to move to
>> using KVM-on-ARM based on their previous experience with
>> KVM-on-x86.
> I agree.
>
> Paolo

+1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
  2016-01-11  2:54         ` Jason Wang
@ 2016-01-11 13:24           ` Peter Maydell
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2016-01-11 13:24 UTC (permalink / raw)
  To: Jason Wang; +Cc: Paolo Bonzini, Stefan Hajnoczi, QEMU Developers, Ashok Kumar

On 11 January 2016 at 02:54, Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 01/07/2016 11:21 PM, Paolo Bonzini wrote:
>>
>> On 07/01/2016 15:47, Peter Maydell wrote:
>>> I think my current inclination is to say that virt should
>>> support -net, because I would prefer to avoid having yet
>>> another speedbump in the path of people trying to move to
>>> using KVM-on-ARM based on their previous experience with
>>> KVM-on-x86.

>> I agree.
>
> +1

OK, we seem to have a consensus. I'm going to apply this patch
to target-arm.next, with an expanded commit message:

    hw/arm/virt: Support legacy -nic command line syntax

    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.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-11 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06 14:47 [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus Ashok Kumar
2016-01-06 18:10 ` Peter Maydell
2016-01-07  5:53   ` Ashok Kumar
     [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
2016-01-07 14:47     ` Peter Maydell
2016-01-07 15:21       ` Paolo Bonzini
2016-01-11  2:54         ` Jason Wang
2016-01-11 13:24           ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.