From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5p7F-0007rM-Td for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5p7A-0004Rl-SQ for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:09 -0500 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]:50979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5p7A-0004Rc-GO for qemu-devel@nongnu.org; Tue, 30 Dec 2014 00:13:04 -0500 Received: by mail-pd0-f177.google.com with SMTP id ft15so18525282pdb.36 for ; Mon, 29 Dec 2014 21:13:03 -0800 (PST) From: sfeldma@gmail.com Date: Mon, 29 Dec 2014 21:14:01 -0800 Message-Id: <1419916451-49258-1-git-send-email-sfeldma@gmail.com> Subject: [Qemu-devel] [PATCH 00/10] rocker: add new rocker ethernet switch device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, jiri@resnulli.us, roopa@cumulusnetworks.com, john.fastabend@gmail.com From: Scott Feldman [This is a collaboration between myself and Jiri Pirko]. This patch set adds a new ethernet switch device, called rocker. Rocker is intended to emulate HW features of switch ASICs found in today's data-center-class switch/routers. The original motivation in creating a new device is to accelerate device driver development for ethernet switches in the Linux kernel. A device driver for rocker already exists in the Linux 3.18 kernel and loads against this device. Basic L2 switching (bridging) functionality is offloaded to the device. Work continues to enable offloading of L3 routing functions and ACLs, as well as support for a flow-based modes, such as OpenVSwitch with OpenFlow. Future support for terminating L2-over-L3 tunnels is also planned. The core network processing functions are based on the spec of a real device: Broadcom's OF-DPA. Specifically, rocker borrows OF-DPA's network processing pipeline comprised of flow match and action tables. Only the OF-DPA spec was used in constructing rocker. The rocker developers do not have access to the real OF-DPA's software source code, so this is a clean-room, ground-up development. Each rocker device is a PCI device with a memory-mapped register space and MSI-X interrupts for command and event processing, as well as CPU-bound I/O. Each device can support up to 62 "front-panel" ports, which present themselves as -netdev attachment points. The device is programmed using OF-DPA flow and group tables to setup the flow pipeline. The programming defines the forwarding path for packets ingressing on 'front-panel' ports. The forwarding path can look at L2/L3/L4 packet header to forward the packet to its destination. For the performance path, packets would ingress and egress only on the device, and not be passed up to the device driver (or host OS). The slow path for control packets will forward packets to the CPU via the device driver for host OS processing. A QMP/HMP interface is added to give inside into the device's internal port configuration and flow/group tables. A test directory is included with some basic sanity tests to verify the device and driver. Scott Feldman (10): pci: move REDHAT_SDHCI device ID to make room for Rocker net: add MAC address string printer virtio-net: use qemu_mac_strdup_printf rocker: add register programming guide pci: add rocker device ID pci: add network device class 'other' for network switches rocker: add new rocker switch device qmp: add rocker device support rocker: add tests MAINTAINERS: add rocker MAINTAINERS | 6 + default-configs/pci.mak | 1 + docs/specs/pci-ids.txt | 3 +- hmp-commands.hx | 56 + hmp.c | 303 +++++ hmp.h | 4 + hw/net/Makefile.objs | 3 + hw/net/rocker/reg_guide.txt | 957 +++++++++++++ hw/net/rocker/rocker.c | 1440 ++++++++++++++++++++ hw/net/rocker/rocker.h | 76 ++ hw/net/rocker/rocker_desc.c | 379 ++++++ hw/net/rocker/rocker_desc.h | 57 + hw/net/rocker/rocker_fp.c | 243 ++++ hw/net/rocker/rocker_fp.h | 54 + hw/net/rocker/rocker_hw.h | 475 +++++++ hw/net/rocker/rocker_of_dpa.c | 2644 ++++++++++++++++++++++++++++++++++++ hw/net/rocker/rocker_of_dpa.h | 25 + hw/net/rocker/rocker_tlv.h | 247 ++++ hw/net/rocker/rocker_world.c | 108 ++ hw/net/rocker/rocker_world.h | 63 + hw/net/rocker/test/README | 5 + hw/net/rocker/test/all | 19 + hw/net/rocker/test/bridge | 43 + hw/net/rocker/test/bridge-stp | 52 + hw/net/rocker/test/bridge-vlan | 52 + hw/net/rocker/test/bridge-vlan-stp | 64 + hw/net/rocker/test/port | 22 + hw/net/rocker/test/tut.dot | 8 + hw/net/virtio-net.c | 12 +- include/hw/pci/pci.h | 3 +- include/hw/pci/pci_ids.h | 1 + include/net/net.h | 1 + net/net.c | 7 + qapi-schema.json | 51 + qmp-commands.hx | 24 + 35 files changed, 7497 insertions(+), 11 deletions(-) create mode 100644 hw/net/rocker/reg_guide.txt create mode 100644 hw/net/rocker/rocker.c create mode 100644 hw/net/rocker/rocker.h create mode 100644 hw/net/rocker/rocker_desc.c create mode 100644 hw/net/rocker/rocker_desc.h create mode 100644 hw/net/rocker/rocker_fp.c create mode 100644 hw/net/rocker/rocker_fp.h create mode 100644 hw/net/rocker/rocker_hw.h create mode 100644 hw/net/rocker/rocker_of_dpa.c create mode 100644 hw/net/rocker/rocker_of_dpa.h create mode 100644 hw/net/rocker/rocker_tlv.h create mode 100644 hw/net/rocker/rocker_world.c create mode 100644 hw/net/rocker/rocker_world.h create mode 100644 hw/net/rocker/test/README create mode 100755 hw/net/rocker/test/all create mode 100755 hw/net/rocker/test/bridge create mode 100755 hw/net/rocker/test/bridge-stp create mode 100755 hw/net/rocker/test/bridge-vlan create mode 100755 hw/net/rocker/test/bridge-vlan-stp create mode 100755 hw/net/rocker/test/port create mode 100644 hw/net/rocker/test/tut.dot -- 1.7.10.4