From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpFAZ-0005RQ-0W for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpFAT-0001gx-2q for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:45:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpFAS-0001gg-TS for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:45:01 -0400 From: Markus Armbruster References: <201609280906524894782@gmail.com> Date: Wed, 28 Sep 2016 15:44:56 +0200 In-Reply-To: <201609280906524894782@gmail.com> (zhunxun@gmail.com's message of "Wed, 28 Sep 2016 09:09:24 +0800") Message-ID: <87intg16lj.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] help! List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "zhunxun@gmail.com" Cc: qemu "zhunxun@gmail.com" writes: > Hello=EF=BC=8Crecently I study qemu source code ,and I have some questi= ons ,can you help me ? >=20=20 >> 1=E3=80=81what is the meaning of queues in structure NICConf ? I think i= t 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=3D... and so forth work. >> 2=E3=80=81In NICConf init Function=EF=BC=8CI do not found it initulize t= he queues of NICConf=EF=BC=8Crelative 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=E3=80=81when new a NIC,I found conf->peers.ncs is a pointer which poin= t 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.