[PATCH 0/2] vhost: add port mirroring function in the vhost lib

Maxime Coquelin maxime.coquelin at redhat.com
Wed May 3 11:36:48 CEST 2023


Hi Cheng,

On 4/21/23 03:09, Cheng Jiang wrote:
> Similar to the port mirroring function on the switch or router, this
> patch set implements such function on the Vhost lib. When
> data is sent to a front-end, it will also send the data to its mirror
> front-end. When data is received from a front-end, it will also send
> the data to its mirror front-end.

Why not just keeping mirroring in the switch/router?
I am really not convinced this is the way to go:
1. API is too complex
2. It requires async support
3. There is too much code duplication, it increases  virtio-net.c by
    30%, and it is without packed ring support.
4. If mirror port is down for any reason, packets to/from the original
    port are dropped.
5. It seems to assume negotiated features of the two ports are
    identical, e.g. Virtio-net header length? If so, that's not a
    manageable solution.

Regards,
Maxime

> 
> Cheng Jiang (2):
>    vhost: add ingress API for port mirroring datapath
>    vhost: add egress API for port mirroring datapath
> 
>   lib/vhost/rte_vhost_async.h |   17 +
>   lib/vhost/version.map       |    3 +
>   lib/vhost/virtio_net.c      | 1266 +++++++++++++++++++++++++++++++++++
>   3 files changed, 1286 insertions(+)
> 
> --
> 2.35.1
> 



More information about the dev mailing list