qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Vasile Catalin-B50542 <catalin.vasile@freescale.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] net devices
Date: Wed, 25 Feb 2015 13:26:57 +0000	[thread overview]
Message-ID: <20150225132657.GA2922@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <54ED7FC0.1010808@freescale.com>

[-- 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 --]

      reply	other threads:[~2015-02-25 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25  7:54 [Qemu-devel] net devices Vasile Catalin-B50542
2015-02-25 13:26 ` Stefan Hajnoczi [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=20150225132657.GA2922@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=catalin.vasile@freescale.com \
    --cc=qemu-devel@nongnu.org \
    /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 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).