Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
47 stars 5 forks source link

Implement l2fwd-like app #1165

Open dpino opened 5 years ago

dpino commented 5 years ago

A new attempt at implementing this feature. Fixes https://github.com/Igalia/snabb/issues/209

First thing, I think we don't need a copycat of DPDK's l2fwd. Basically what we need is the ability of forward packets to a port and see how many are back. Useful for checking performance of a VM, for example.

So I implemented this feature in two parts:

In this manner, we can run the l2fwd app inside the VM and the host, running packetblaster, will print out the stats (easier to collect).

Example of use:

$ sudo taskset -c 2 ./snabb l2fwd --pciaddr 02:00.0
$ sudo taskset -c 11 ./snabb packetblaster l2fwd from-inet-and-b4-500.pcap 82:00.0
Warming up for 15 seconds...Done
Running for 1 seconds
Device: 82:00.0
Packets sent: 2.3148 MPPS (9.6294 Gbps)
Packets received: 2.3148 MPPS (9.6294 Gbps)
Packet difference: 0

It's pending to support virtio and tap interfaces in the l2fwd app and test it.

dpino commented 5 years ago

Added support for VirtioNet driver. Performance is good. Beware of binding SnabbNFV to the right NUMA node.

(guest) $ sudo ./snabb l2fwd --virtio 0000:00:08.0
(host) $ $ sudo taskset -c 2 ./snabb packetblaster l2fwd from-inet-and-b4-500.pcap 0000:02:00.0                                                      
Warming up for 15 seconds...Done            
Running for 1 seconds
Device: 02:00.0
Packets sent: 2.3149 MPPS (9.6293 Gbps)
Packets received: 2.2672 MPPS (9.4311 Gbps)
Packet difference: 47,680
dpino commented 5 years ago

Should I add the scripts to run SnabbNFV and QEMU somewhere? (perhaps in program/l2fwd/scripts).