From: Markus Armbruster <armbru@redhat.com>
To: "zhunxun@gmail.com" <zhunxun@gmail.com>
Cc: qemu <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] help!
Date: Wed, 28 Sep 2016 15:44:56 +0200 [thread overview]
Message-ID: <87intg16lj.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <201609280906524894782@gmail.com> (zhunxun@gmail.com's message of "Wed, 28 Sep 2016 09:09:24 +0800")
"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.
prev parent reply other threads:[~2016-09-28 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-28 1:09 [Qemu-devel] help! zhunxun
2016-09-28 13:44 ` Markus Armbruster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87intg16lj.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhunxun@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.