[RFC 5/5] qapi: add in/out_netdev to filter-redirector

Cindy Lu posted 5 patches 1 month, 3 weeks ago
There is a newer version of this series
[RFC 5/5] qapi: add in/out_netdev to filter-redirector
Posted by Cindy Lu 1 month, 3 weeks ago
Document the new in_netdev and out_netdev properties in the QAPI
schema for FilterRedirectorProperties:

- in_netdev: Name of an input netdev endpoint captured via AF_PACKET.
  Allows capturing packets directly from a TAP interface, bypassing
  the QEMU network stack.

- out_netdev: Name of an output netdev endpoint injected via AF_PACKET.
  Allows injecting packets directly to a TAP interface.

These properties are mutually exclusive with each other and with
indev/outdev on the same direction. They enable filter-redirector
to work with vhost-net backends for live migration packet mirroring.

Signed-off-by: Cindy Lu <lulu@redhat.com>
---
 qapi/qom.json | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/qapi/qom.json b/qapi/qom.json
index b1fe55944c..a62a824403 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -476,8 +476,15 @@
 #
 # Properties for filter-redirector objects.
 #
-# At least one of @indev or @outdev must be present.  If both are
-# present, they must not refer to the same character device backend.
+# At least one of @indev, @outdev, @in_netdev, or @out_netdev must be
+# present.
+#
+# If both @indev and @outdev are present, they must not refer to the
+# same character device backend.
+#
+# @in_netdev and @out_netdev are Linux AF_PACKET based endpoints.
+# They are mutually exclusive with each other, and also with
+# @indev/@outdev on the same direction.
 #
 # @indev: the name of a character device backend from which packets
 #     are received and redirected to the filtered network device
@@ -485,6 +492,12 @@
 # @outdev: the name of a character device backend to which all
 #     incoming packets are redirected
 #
+# @in_netdev: the name of an input netdev endpoint captured via
+#     AF_PACKET
+#
+# @out_netdev: the name of an output netdev endpoint injected via
+#     AF_PACKET
+#
 # @vnet_hdr_support: if true, vnet header support is enabled
 #     (default: false)
 #
@@ -498,6 +511,8 @@
   'base': 'NetfilterProperties',
   'data': { '*indev': 'str',
             '*outdev': 'str',
+            '*in_netdev': 'str',
+            '*out_netdev': 'str',
             '*vnet_hdr_support': 'bool',
             '*enable_when_stopped': 'bool' } }
 
-- 
2.52.0