All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] help!
@ 2016-09-28  1:09 zhunxun
  2016-09-28 13:44 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: zhunxun @ 2016-09-28  1:09 UTC (permalink / raw)
  To: qemu

 Hello,recently I study  qemu source code ,and I have some questions ,can you help me ?
 
> 1、what is the meaning of queues in structure NICConf ? I think it is the number of queues to a NIC,and I do not where it is.
> 2、In NICConf init Function,I do not found it initulize the queues of NICConf,relative code is
>
> #define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
>     DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
>     DEFINE_PROP_VLAN("vlan",     _state, _conf.peers),                   \
>     DEFINE_PROP_NETDEV("netdev", _state, _conf.peers),                   \
>     DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1)
>
> 3、when new a NIC,I found conf->peers.ncs is a pointer which point a NetClientState array,I want to know what the array stand for?hub ports?



zhunxun@gmail.com

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

* Re: [Qemu-devel] help!
  2016-09-28  1:09 [Qemu-devel] help! zhunxun
@ 2016-09-28 13:44 ` Markus Armbruster
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2016-09-28 13:44 UTC (permalink / raw)
  To: zhunxun; +Cc: qemu

"zhunxun@gmail.com" <zhunxun@gmail.com> writes:

>  Hello,recently I study  qemu source code ,and I have some questions ,can you help me ?
>  
>> 1、what is the meaning of queues in structure NICConf ? I think it is the number of queues to a NIC,and I do not where it is.

NICConf captures some configuration information common to NIC devices.
NIC device models typically embed it in their state struct, and use
DEFINE_NIC_PROPERTIES() to declare the common qdev properties.  For
example, e1000.c has E1000State member NICConf conf, and uses
DEFINE_NIC_PROPERTIES() in the initializer for its static array of qdev
properties e1000_properties[].  This array gets passed to the qdev core,
where it makes -device e1000,mac=... and so forth work.

>> 2、In NICConf init Function,I do not found it initulize the queues of NICConf,relative code is
>>
>> #define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
>>     DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
>>     DEFINE_PROP_VLAN("vlan",     _state, _conf.peers),                   \
>>     DEFINE_PROP_NETDEV("netdev", _state, _conf.peers),                   \
>>     DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1)

See above.

>> 3、when new a NIC,I found conf->peers.ncs is a pointer which point a NetClientState array,I want to know what the array stand for?hub ports?

Queues.  Easy enough to see: qemu_new_nic() uses this array in a
counting loop running from 0 to queues - 1.

Note that NICPeers member ncs is an array of pointer to NetClientState,
not a pointer to array of NetClientState.

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

end of thread, other threads:[~2016-09-28 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28  1:09 [Qemu-devel] help! zhunxun
2016-09-28 13:44 ` Markus Armbruster

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.