Skip to content

Add packet capture support on macvtap device

Vlad Yasevich netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Change from RFC from the cover letter

- moved to the rx_handler approach.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2macvtap: Add support of packet capture on macvtap device.drivers/net/macvtap.c+32 -272 replies
2/2macvlan: Remove custom recieve and forward handlersdrivers/net/macvlan.c drivers/net/macvtap.c include/linux/if_macvlan.h+7 -200 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] Add packet capture support on macvtap device

Change from RFC:
- moved to the rx_handler approach.

This series adds support for packet capturing on macvtap device. The initial approach was to simply export the capturing code as a function from the core network. While simple, it was not a very architecturally clean approach.

The new appraoch is to provide macvtap with its rx_handler which can
is attached to the macvtap device itself. Macvlan will simply requeue
the packet with an updated skb->dev. BTW, macvlan layer already does this for macvlan devices. So, now macvtap and macvlan have almost the same exact input path.

I've toyed with short-circuting the input path for macvtap by returning RX_HANDLER_ANOTHER, but that just made the code more complicated and didn't provide any kind of measurable gain (at least according to netperf and perf runs on the host).

To see if there was a performance regression, I ran 1, 2 and 4 netperf STREAM and MAERTS tests agains the VM from both remote host and another
guest on the same system. The command ran was

    netperf -H $host -t $test -l 20 -i 10 -I 95 -c -C

The numbers I was getting with the new code were consistently very slightly (1-2%) better then the old code. I don't consider this an improvement, but it's not a regression! :)

Running 'perf record' on the host didn't show any new hot spots and cpu utilization stayed about the same. This was better then I expected from simply looking at the code.

Vlad Yasevich (2):
macvtap: Add support of packet capture on macvtap device.
macvlan: Remove custom recieve and forward handlers

 drivers/net/macvlan.c      | 17 ++++---------
 drivers/net/macvtap.c      | 63 +++++++++++++++++++++++++---------------------
 include/linux/if_macvlan.h |  7 +-----
 3 files changed, 41 insertions(+), 46 deletions(-)
Signature · 1 line
1.8.4.2