All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Connecting netdev to emulated nics.
@ 2015-10-15  6:36 sai pavan
  2015-10-15  9:14 ` Jason Wang
  0 siblings, 1 reply; 8+ messages in thread
From: sai pavan @ 2015-10-15  6:36 UTC (permalink / raw)
  To: jasowang, qemu-devel@nongnu.org Developers

Hi,

I am debugging an issue, where through one of the nics I am not able
to connect to dtcp.
So to dig in deep, i was going thought net.c files, and ended-up
understanding little.

So can i know how does a netdev connects to nic.

nd_table[] has some pointers for netdev devices. Where are this
actually instantiated ? I am missing that part of the code.

How do the netdevs and nic's have 1-1 connections.

And if my SOC has more than 1 sysbus type ethernet chips. How can i
connect each one of them from command line ?


Regards,
Sai Pavan

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-15  6:36 [Qemu-devel] Connecting netdev to emulated nics sai pavan
@ 2015-10-15  9:14 ` Jason Wang
  2015-10-16  5:15   ` sai pavan
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Wang @ 2015-10-15  9:14 UTC (permalink / raw)
  To: sai pavan, qemu-devel@nongnu.org Developers



On 10/15/2015 02:36 PM, sai pavan wrote:
> Hi,
>
> I am debugging an issue, where through one of the nics I am not able
> to connect to dtcp.
> So to dig in deep, i was going thought net.c files, and ended-up
> understanding little.
>
> So can i know how does a netdev connects to nic.
>
> nd_table[] has some pointers for netdev devices. Where are this
> actually instantiated ? I am missing that part of the code.
>
> How do the netdevs and nic's have 1-1 connections.

You may want to have a look at set_netdev().

>
> And if my SOC has more than 1 sysbus type ethernet chips. How can i
> connect each one of them from command line ?

You can do this by using hubport as nic's peer e.g:

-netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0

>
> Regards,
> Sai Pavan

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-15  9:14 ` Jason Wang
@ 2015-10-16  5:15   ` sai pavan
  2015-10-16  7:37     ` Jason Wang
  0 siblings, 1 reply; 8+ messages in thread
From: sai pavan @ 2015-10-16  5:15 UTC (permalink / raw)
  To: Jason Wang, crosthwaite.peter; +Cc: qemu-devel@nongnu.org Developers

+Peter

Hi Jason,

On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 10/15/2015 02:36 PM, sai pavan wrote:
>> Hi,
>>
>> I am debugging an issue, where through one of the nics I am not able
>> to connect to dtcp.
>> So to dig in deep, i was going thought net.c files, and ended-up
>> understanding little.
>>
>> So can i know how does a netdev connects to nic.
>>
>> nd_table[] has some pointers for netdev devices. Where are this
>> actually instantiated ? I am missing that part of the code.
>>
>> How do the netdevs and nic's have 1-1 connections.
>
> You may want to have a look at set_netdev().
Thanks this helped to see more regarding netdev.

one more question, there are 4 Ethernet Controllers in the soc im working on
https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223

Each having configure nic and netdev internally. But only one can
automatically connect to dhcp. Each one is assigned default mac
address, Do each of the mac needs to be pre-registered with internal
dhcp.?

Regards,
Sai Pavan

>
>>
>> And if my SOC has more than 1 sysbus type ethernet chips. How can i
>> connect each one of them from command line ?
>
> You can do this by using hubport as nic's peer e.g:
>
> -netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0
>
>>
>> Regards,
>> Sai Pavan
>

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-16  5:15   ` sai pavan
@ 2015-10-16  7:37     ` Jason Wang
  2015-10-16 12:24       ` sai pavan
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Wang @ 2015-10-16  7:37 UTC (permalink / raw)
  To: sai pavan, crosthwaite.peter; +Cc: qemu-devel@nongnu.org Developers



On 10/16/2015 01:15 PM, sai pavan wrote:
> +Peter
>
> Hi Jason,
>
> On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>>
>> On 10/15/2015 02:36 PM, sai pavan wrote:
>>> Hi,
>>>
>>> I am debugging an issue, where through one of the nics I am not able
>>> to connect to dtcp.
>>> So to dig in deep, i was going thought net.c files, and ended-up
>>> understanding little.
>>>
>>> So can i know how does a netdev connects to nic.
>>>
>>> nd_table[] has some pointers for netdev devices. Where are this
>>> actually instantiated ? I am missing that part of the code.
>>>
>>> How do the netdevs and nic's have 1-1 connections.
>> You may want to have a look at set_netdev().
> Thanks this helped to see more regarding netdev.
>
> one more question, there are 4 Ethernet Controllers in the soc im working on
> https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223
>
> Each having configure nic and netdev internally. But only one can
> automatically connect to dhcp. Each one is assigned default mac
> address, Do each of the mac needs to be pre-registered with internal
> dhcp.?

I think this is because if you don't specify any net clients on cli,
qemu will use default network configuration that has a hub with two
ports, first ports is connected to a nic and second port were connected
to userspace network
(http://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)
which implements dhcp. You can see the network topology through "info
networks" commands.

E.g if you want to let all nics to be connected to the user networking,
you may want to use:

-net nic -net nic -net nic -net nic -net user

in your cli.

>
> Regards,
> Sai Pavan
>
>>> And if my SOC has more than 1 sysbus type ethernet chips. How can i
>>> connect each one of them from command line ?
>> You can do this by using hubport as nic's peer e.g:
>>
>> -netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0
>>
>>> Regards,
>>> Sai Pavan

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-16  7:37     ` Jason Wang
@ 2015-10-16 12:24       ` sai pavan
  2015-10-16 15:18         ` Peter Crosthwaite
  2015-10-20  2:49         ` Jason Wang
  0 siblings, 2 replies; 8+ messages in thread
From: sai pavan @ 2015-10-16 12:24 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel@nongnu.org Developers, crosthwaite.peter

Hi Jason,

On Fri, Oct 16, 2015 at 1:07 PM, Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 10/16/2015 01:15 PM, sai pavan wrote:
>> +Peter
>>
>> Hi Jason,
>>
>> On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>>>
>>> On 10/15/2015 02:36 PM, sai pavan wrote:
>>>> Hi,
>>>>
>>>> I am debugging an issue, where through one of the nics I am not able
>>>> to connect to dtcp.
>>>> So to dig in deep, i was going thought net.c files, and ended-up
>>>> understanding little.
>>>>
>>>> So can i know how does a netdev connects to nic.
>>>>
>>>> nd_table[] has some pointers for netdev devices. Where are this
>>>> actually instantiated ? I am missing that part of the code.
>>>>
>>>> How do the netdevs and nic's have 1-1 connections.
>>> You may want to have a look at set_netdev().
>> Thanks this helped to see more regarding netdev.
>>
>> one more question, there are 4 Ethernet Controllers in the soc im working on
>> https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223
>>
>> Each having configure nic and netdev internally. But only one can
>> automatically connect to dhcp. Each one is assigned default mac
>> address, Do each of the mac needs to be pre-registered with internal
>> dhcp.?
>
> I think this is because if you don't specify any net clients on cli,
> qemu will use default network configuration that has a hub with two
> ports, first ports is connected to a nic and second port were connected
> to userspace network
> (http://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)
> which implements dhcp. You can see the network topology through "info
> networks" commands.
>
> E.g if you want to let all nics to be connected to the user networking,
> you may want to use:
>
> -net nic -net nic -net nic -net nic -net user
>
> in your cli.
Cool, This worked. Thanks !!

Another question, is a way we can connect a particular device to hub,
not connecting all ?

Thanks,
Sai Pavan
>
>>
>> Regards,
>> Sai Pavan
>>
>>>> And if my SOC has more than 1 sysbus type ethernet chips. How can i
>>>> connect each one of them from command line ?
>>> You can do this by using hubport as nic's peer e.g:
>>>
>>> -netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0
>>>
>>>> Regards,
>>>> Sai Pavan
>

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-16 12:24       ` sai pavan
@ 2015-10-16 15:18         ` Peter Crosthwaite
  2015-10-20  3:01           ` Jason Wang
  2015-10-20  2:49         ` Jason Wang
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Crosthwaite @ 2015-10-16 15:18 UTC (permalink / raw)
  To: sai pavan; +Cc: Jason Wang, qemu-devel@nongnu.org Developers, Peter Crosthwaite

On Fri, Oct 16, 2015 at 5:24 AM, sai pavan <saipavanboddu@gmail.com> wrote:
> Hi Jason,
>
> On Fri, Oct 16, 2015 at 1:07 PM, Jason Wang <jasowang@redhat.com> wrote:
>>
>>
>> On 10/16/2015 01:15 PM, sai pavan wrote:
>>> +Peter
>>>
>>> Hi Jason,
>>>
>>> On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>>>>
>>>> On 10/15/2015 02:36 PM, sai pavan wrote:
>>>>> Hi,
>>>>>
>>>>> I am debugging an issue, where through one of the nics I am not able
>>>>> to connect to dtcp.
>>>>> So to dig in deep, i was going thought net.c files, and ended-up
>>>>> understanding little.
>>>>>
>>>>> So can i know how does a netdev connects to nic.
>>>>>
>>>>> nd_table[] has some pointers for netdev devices. Where are this
>>>>> actually instantiated ? I am missing that part of the code.
>>>>>
>>>>> How do the netdevs and nic's have 1-1 connections.
>>>> You may want to have a look at set_netdev().
>>> Thanks this helped to see more regarding netdev.
>>>
>>> one more question, there are 4 Ethernet Controllers in the soc im working on
>>> https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223
>>>
>>> Each having configure nic and netdev internally. But only one can
>>> automatically connect to dhcp. Each one is assigned default mac
>>> address, Do each of the mac needs to be pre-registered with internal
>>> dhcp.?
>>
>> I think this is because if you don't specify any net clients on cli,
>> qemu will use default network configuration that has a hub with two
>> ports, first ports is connected to a nic and second port were connected
>> to userspace network
>> (http://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)
>> which implements dhcp. You can see the network topology through "info
>> networks" commands.
>>
>> E.g if you want to let all nics to be connected to the user networking,
>> you may want to use:
>>
>> -net nic -net nic -net nic -net nic -net user
>>

Is there a long form of this CLI that does not rely on positional arguments?

Regards,
Peter

>> in your cli.
> Cool, This worked. Thanks !!
>
> Another question, is a way we can connect a particular device to hub,
> not connecting all ?
>
> Thanks,
> Sai Pavan
>>
>>>
>>> Regards,
>>> Sai Pavan
>>>
>>>>> And if my SOC has more than 1 sysbus type ethernet chips. How can i
>>>>> connect each one of them from command line ?
>>>> You can do this by using hubport as nic's peer e.g:
>>>>
>>>> -netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0
>>>>
>>>>> Regards,
>>>>> Sai Pavan
>>

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-16 12:24       ` sai pavan
  2015-10-16 15:18         ` Peter Crosthwaite
@ 2015-10-20  2:49         ` Jason Wang
  1 sibling, 0 replies; 8+ messages in thread
From: Jason Wang @ 2015-10-20  2:49 UTC (permalink / raw)
  To: sai pavan; +Cc: qemu-devel@nongnu.org Developers, crosthwaite.peter



On 10/16/2015 08:24 PM, sai pavan wrote:
> Hi Jason,
>
> On Fri, Oct 16, 2015 at 1:07 PM, Jason Wang <jasowang@redhat.com> wrote:
>> >
>> >
>> > On 10/16/2015 01:15 PM, sai pavan wrote:
>>> >> +Peter
>>> >>
>>> >> Hi Jason,
>>> >>
>>> >> On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>>>> >>>
>>>> >>> On 10/15/2015 02:36 PM, sai pavan wrote:
>>>>> >>>> Hi,
>>>>> >>>>
>>>>> >>>> I am debugging an issue, where through one of the nics I am not able
>>>>> >>>> to connect to dtcp.
>>>>> >>>> So to dig in deep, i was going thought net.c files, and ended-up
>>>>> >>>> understanding little.
>>>>> >>>>
>>>>> >>>> So can i know how does a netdev connects to nic.
>>>>> >>>>
>>>>> >>>> nd_table[] has some pointers for netdev devices. Where are this
>>>>> >>>> actually instantiated ? I am missing that part of the code.
>>>>> >>>>
>>>>> >>>> How do the netdevs and nic's have 1-1 connections.
>>>> >>> You may want to have a look at set_netdev().
>>> >> Thanks this helped to see more regarding netdev.
>>> >>
>>> >> one more question, there are 4 Ethernet Controllers in the soc im working on
>>> >> https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223
>>> >>
>>> >> Each having configure nic and netdev internally. But only one can
>>> >> automatically connect to dhcp. Each one is assigned default mac
>>> >> address, Do each of the mac needs to be pre-registered with internal
>>> >> dhcp.?
>> >
>> > I think this is because if you don't specify any net clients on cli,
>> > qemu will use default network configuration that has a hub with two
>> > ports, first ports is connected to a nic and second port were connected
>> > to userspace network
>> > (http://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)
>> > which implements dhcp. You can see the network topology through "info
>> > networks" commands.
>> >
>> > E.g if you want to let all nics to be connected to the user networking,
>> > you may want to use:
>> >
>> > -net nic -net nic -net nic -net nic -net user
>> >
>> > in your cli.
> Cool, This worked. Thanks !!
>
> Another question, is a way we can connect a particular device to hub,
> not connecting all ?

You can use "vlan" parameter in this case.

> Thanks,
> Sai Pavan

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

* Re: [Qemu-devel] Connecting netdev to emulated nics.
  2015-10-16 15:18         ` Peter Crosthwaite
@ 2015-10-20  3:01           ` Jason Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2015-10-20  3:01 UTC (permalink / raw)
  To: Peter Crosthwaite, sai pavan
  Cc: qemu-devel@nongnu.org Developers, Peter Crosthwaite



On 10/16/2015 11:18 PM, Peter Crosthwaite wrote:
> On Fri, Oct 16, 2015 at 5:24 AM, sai pavan <saipavanboddu@gmail.com> wrote:
>> Hi Jason,
>>
>> On Fri, Oct 16, 2015 at 1:07 PM, Jason Wang <jasowang@redhat.com> wrote:
>>>
>>> On 10/16/2015 01:15 PM, sai pavan wrote:
>>>> +Peter
>>>>
>>>> Hi Jason,
>>>>
>>>> On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang <jasowang@redhat.com> wrote:
>>>>> On 10/15/2015 02:36 PM, sai pavan wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am debugging an issue, where through one of the nics I am not able
>>>>>> to connect to dtcp.
>>>>>> So to dig in deep, i was going thought net.c files, and ended-up
>>>>>> understanding little.
>>>>>>
>>>>>> So can i know how does a netdev connects to nic.
>>>>>>
>>>>>> nd_table[] has some pointers for netdev devices. Where are this
>>>>>> actually instantiated ? I am missing that part of the code.
>>>>>>
>>>>>> How do the netdevs and nic's have 1-1 connections.
>>>>> You may want to have a look at set_netdev().
>>>> Thanks this helped to see more regarding netdev.
>>>>
>>>> one more question, there are 4 Ethernet Controllers in the soc im working on
>>>> https://github.com/qemu/qemu/blob/master/hw/arm/xlnx-zynqmp.c#L223
>>>>
>>>> Each having configure nic and netdev internally. But only one can
>>>> automatically connect to dhcp. Each one is assigned default mac
>>>> address, Do each of the mac needs to be pre-registered with internal
>>>> dhcp.?
>>> I think this is because if you don't specify any net clients on cli,
>>> qemu will use default network configuration that has a hub with two
>>> ports, first ports is connected to a nic and second port were connected
>>> to userspace network
>>> (http://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)
>>> which implements dhcp. You can see the network topology through "info
>>> networks" commands.
>>>
>>> E.g if you want to let all nics to be connected to the user networking,
>>> you may want to use:
>>>
>>> -net nic -net nic -net nic -net nic -net user
>>>
> Is there a long form of this CLI that does not rely on positional arguments?
>
> Regards,
> Peter

I'm not sure I get the question. The reason looks like xlnx-zynqmp.c
relies on the first 4 nics of nd_table[].

>>> in your cli.
>> Cool, This worked. Thanks !!
>>
>> Another question, is a way we can connect a particular device to hub,
>> not connecting all ?
>>
>> Thanks,
>> Sai Pavan
>>>> Regards,
>>>> Sai Pavan
>>>>
>>>>>> And if my SOC has more than 1 sysbus type ethernet chips. How can i
>>>>>> connect each one of them from command line ?
>>>>> You can do this by using hubport as nic's peer e.g:
>>>>>
>>>>> -netdev hubport,id=port0,hubid=hubid -device e1000,netdev=port0
>>>>>
>>>>>> Regards,
>>>>>> Sai Pavan

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

end of thread, other threads:[~2015-10-20  3:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15  6:36 [Qemu-devel] Connecting netdev to emulated nics sai pavan
2015-10-15  9:14 ` Jason Wang
2015-10-16  5:15   ` sai pavan
2015-10-16  7:37     ` Jason Wang
2015-10-16 12:24       ` sai pavan
2015-10-16 15:18         ` Peter Crosthwaite
2015-10-20  3:01           ` Jason Wang
2015-10-20  2:49         ` Jason Wang

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.