qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] net devices
@ 2015-02-25  7:54 Vasile Catalin-B50542
  2015-02-25 13:26 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Vasile Catalin-B50542 @ 2015-02-25  7:54 UTC (permalink / raw)
  To: qemu-devel

I'm looking through the qemu sources and I'm trying to understand how 
net devices work.
What is considered a net_client inside qemu sources?
I'm asking about this because I came upon two functions which (because 
of their name) sound like
they should be doing the same thing. The functions' name are:
1. qemu_new_nic()
2. qemu_new_net_client()
More specifically I'm looking through the virtio-net vhost-net sources.

Cata

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

* Re: [Qemu-devel] net devices
  2015-02-25  7:54 [Qemu-devel] net devices Vasile Catalin-B50542
@ 2015-02-25 13:26 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2015-02-25 13:26 UTC (permalink / raw)
  To: Vasile Catalin-B50542; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]

On Wed, Feb 25, 2015 at 09:54:40AM +0200, Vasile Catalin-B50542 wrote:
> I'm looking through the qemu sources and I'm trying to understand how net
> devices work.
> What is considered a net_client inside qemu sources?
> I'm asking about this because I came upon two functions which (because of
> their name) sound like
> they should be doing the same thing. The functions' name are:
> 1. qemu_new_nic()
> 2. qemu_new_net_client()
> More specifically I'm looking through the virtio-net vhost-net sources.

NetClientState is the concept send/receive packet abstraction.  Both
netdevs (tap, socket, ...) and NICs need to use NetClientState to
transmit packets.

A NICState has one or more NetClientStates (for multi-queue NICs).
These NetClientStates have a NetClientOptionsKind of
NET_CLIENT_OPTIONS_KIND_NIC to distinguish them from the -netdevs like
tap, socket, etc.

Emulated NICs use qemu_new_nic() while netdevs use
qemu_new_net_client().

NICs and netdev vary slightly in their removal behavior, so you'll see
code that checks the NetClientState type to see whether it is
NET_CLIENT_OPTIONS_KIND_NIC.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-02-25 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25  7:54 [Qemu-devel] net devices Vasile Catalin-B50542
2015-02-25 13:26 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).