qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	lersek@redhat.com, Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	Zhi Yong Wu <wuzhy@cn.ibm.com>
Subject: [Qemu-devel] [PATCH 00/16] net: Move legacy QEMU VLAN code into net/hub.c
Date: Fri, 20 Jul 2012 13:01:33 +0100	[thread overview]
Message-ID: <1342785709-3152-1-git-send-email-stefanha@linux.vnet.ibm.com> (raw)

[These patches are based on Laszlo Ersek's net OptsVisitor series.]

The QEMU net subsystem has the concept of separate network segments, called
"VLANs".  Each VLAN is a broadcast domain so all net clients connected to the
same VLAN can communicate with each other.

Today this feature is mostly used with the "dump" backend, which saves packet
captures to .pcap files.  It can still come in useful in other rare cases.

This patch series moves the VLAN code out of net.c and into net/hub.c.  The
idea is to introduce a software network hub along with hub port net clients.
This way we can implement the same semantics of QEMU VLANs using just -netdev
peer.  Then -netdev peer becomes the single method of connecting net clients.

The end result of this series is that the net subsystem core is simplified.
Now is a good time to do this because it saves us from modeling QEMU VLANs when
we convert the net subsystem to QOM.

Please note that this series preserves command-line compatibility with the QEMU
VLAN feature.  No existing QEMU command-lines should break.

I have tested the following configurations:
 * -net user -net nic,model=virtio
 * -net user,vlan=1 -net nic,model=virtio,vlan=1
 * -net user,vlan=1 -net nic,model=virtio,vlan=1 -net user,vlan=2 -net nic,model=virtio,vlan=2
 * -netdev user,id=netdev0 -device virtio-net-pci,netdev=netdev0
 * -netdev user,id=netdev0 -device virtio-net-pci,netdev=netdev0 -net user,vlan=2 -net nic,model=virtio,vlan=2

Stefan Hajnoczi (11):
  net: Add a hub net client
  net: Use hubs for the vlan feature
  net: Look up 'vlan' net clients using hubs
  hub: Check that hubs are configured correctly
  net: Drop vlan argument to qemu_new_net_client()
  net: Remove vlan code from net.c
  net: Remove VLANState
  net: Rename non_vlan_clients to net_clients
  net: Rename VLANClientState to NetClientState
  net: Rename vc local variables to nc
  net: Rename qemu_del_vlan_client() to qemu_del_net_client()

Zhi Yong Wu (5):
  net: Convert qdev_prop_vlan to peer with hub
  net: Make "info network" output more readable info
  net: cleanup deliver/deliver_iov func pointers
  net: determine if packets can be sent before net queue deliver
    packets
  hub: add the support for hub own flow control

 hw/cadence_gem.c        |    8 +-
 hw/dp8393x.c            |    7 +-
 hw/e1000.c              |   10 +-
 hw/eepro100.c           |    8 +-
 hw/etraxfs_eth.c        |    8 +-
 hw/exynos4_boards.c     |    2 +-
 hw/highbank.c           |    2 +-
 hw/integratorcp.c       |    2 +-
 hw/kzm.c                |    2 +-
 hw/lan9118.c            |    8 +-
 hw/lance.c              |    2 +-
 hw/mcf5208.c            |    2 +-
 hw/mcf_fec.c            |    7 +-
 hw/milkymist-minimac2.c |    6 +-
 hw/mips_mipssim.c       |    2 +-
 hw/mips_r4k.c           |    2 +-
 hw/mipsnet.c            |    6 +-
 hw/musicpal.c           |    6 +-
 hw/ne2000-isa.c         |    2 +-
 hw/ne2000.c             |    8 +-
 hw/ne2000.h             |    4 +-
 hw/opencores_eth.c      |    8 +-
 hw/pcnet-pci.c          |    4 +-
 hw/pcnet.c              |    6 +-
 hw/pcnet.h              |    6 +-
 hw/qdev-properties.c    |   50 ++--
 hw/qdev.c               |    2 -
 hw/qdev.h               |    7 +-
 hw/rtl8139.c            |   10 +-
 hw/smc91c111.c          |    6 +-
 hw/spapr_llan.c         |    4 +-
 hw/stellaris_enet.c     |    6 +-
 hw/usb/dev-network.c    |    8 +-
 hw/vexpress.c           |    2 +-
 hw/vhost_net.c          |   24 +-
 hw/vhost_net.h          |    2 +-
 hw/virtio-net.c         |   12 +-
 hw/xen_nic.c            |    7 +-
 hw/xgmac.c              |    6 +-
 hw/xilinx_axienet.c     |    6 +-
 hw/xilinx_ethlite.c     |    6 +-
 hw/xtensa_lx60.c        |    2 +-
 net.c                   |  618 ++++++++++++++---------------------------------
 net.h                   |   86 +++----
 net/Makefile.objs       |    2 +-
 net/dump.c              |   27 ++-
 net/dump.h              |    2 +-
 net/hub.c               |  357 +++++++++++++++++++++++++++
 net/hub.h               |   31 +++
 net/queue.c             |   38 ++-
 net/queue.h             |   25 +-
 net/slirp.c             |   34 ++-
 net/slirp.h             |    2 +-
 net/socket.c            |   64 ++---
 net/socket.h            |    2 +-
 net/tap-win32.c         |   26 +-
 net/tap.c               |   44 ++--
 net/tap.h               |   20 +-
 net/vde.c               |   16 +-
 net/vde.h               |    2 +-
 qapi-schema.json        |   30 ++-
 qemu-common.h           |    3 +-
 slirp/if.c              |    5 -
 slirp/libslirp.h        |    1 -
 64 files changed, 927 insertions(+), 796 deletions(-)
 create mode 100644 net/hub.c
 create mode 100644 net/hub.h

-- 
1.7.10.4

             reply	other threads:[~2012-07-20 12:02 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 12:01 Stefan Hajnoczi [this message]
2012-07-20 12:01 ` [Qemu-devel] [PATCH 01/16] net: Add a hub net client Stefan Hajnoczi
2012-07-23 12:45   ` Laszlo Ersek
2012-07-23 13:49     ` Stefan Hajnoczi
2012-07-23 14:05       ` Laszlo Ersek
2012-07-23 14:52         ` Stefan Hajnoczi
2012-07-23 15:16           ` Laszlo Ersek
2012-07-23 15:23             ` Stefan Hajnoczi
2012-07-23 16:33               ` Andreas Färber
2012-07-23 17:11                 ` Markus Armbruster
2012-07-23 19:01                 ` Blue Swirl
2012-07-20 12:01 ` [Qemu-devel] [PATCH 02/16] net: Use hubs for the vlan feature Stefan Hajnoczi
2012-07-23 13:55   ` Laszlo Ersek
2012-07-23 14:56     ` Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 03/16] net: Look up 'vlan' net clients using hubs Stefan Hajnoczi
2012-07-23 15:04   ` Laszlo Ersek
2012-07-23 15:21     ` Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 04/16] hub: Check that hubs are configured correctly Stefan Hajnoczi
2012-07-23 19:15   ` Laszlo Ersek
2012-07-20 12:01 ` [Qemu-devel] [PATCH 05/16] net: Drop vlan argument to qemu_new_net_client() Stefan Hajnoczi
2012-07-23 19:35   ` Laszlo Ersek
2012-07-20 12:01 ` [Qemu-devel] [PATCH 06/16] net: Convert qdev_prop_vlan to peer with hub Stefan Hajnoczi
2012-07-23 20:07   ` Laszlo Ersek
2012-07-24 10:49     ` Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 07/16] net: Remove vlan code from net.c Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 08/16] net: Remove VLANState Stefan Hajnoczi
2012-07-23 20:57   ` Laszlo Ersek
2012-07-24 10:33     ` Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 09/16] net: Rename non_vlan_clients to net_clients Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 10/16] net: Rename VLANClientState to NetClientState Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 11/16] net: Rename vc local variables to nc Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 12/16] net: Rename qemu_del_vlan_client() to qemu_del_net_client() Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 13/16] net: Make "info network" output more readable info Stefan Hajnoczi
2012-07-23 21:54   ` Laszlo Ersek
2012-07-24 10:26     ` Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 14/16] net: cleanup deliver/deliver_iov func pointers Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 15/16] net: determine if packets can be sent before net queue deliver packets Stefan Hajnoczi
2012-07-20 12:01 ` [Qemu-devel] [PATCH 16/16] hub: add the support for hub own flow control Stefan Hajnoczi
2012-07-23 22:27   ` Laszlo Ersek
2012-07-24  6:42     ` Paolo Bonzini

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=1342785709-3152-1-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wuzhy@cn.ibm.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 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).