From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsBuY-0004F0-Me for qemu-devel@nongnu.org; Fri, 20 Jul 2012 08:02:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SsBuJ-0003Tt-Hh for qemu-devel@nongnu.org; Fri, 20 Jul 2012 08:02:22 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:43558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SsBuJ-0003TI-8R for qemu-devel@nongnu.org; Fri, 20 Jul 2012 08:02:07 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Jul 2012 13:02:04 +0100 Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6KC21Gl639008 for ; Fri, 20 Jul 2012 13:02:01 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6KBd8jS024337 for ; Fri, 20 Jul 2012 07:39:08 -0400 From: Stefan Hajnoczi Date: Fri, 20 Jul 2012 13:01:33 +0100 Message-Id: <1342785709-3152-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 00/16] net: Move legacy QEMU VLAN code into net/hub.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , lersek@redhat.com, Stefan Hajnoczi , Zhi Yong Wu [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