All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Chen <chen.zhang@intel.com>
To: "Jason Wang" <jasowang@redhat.com>,
	qemu-dev <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>
Cc: Zhang Chen <chen.zhang@intel.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Yuri Benditovich <yuri.benditovich@daynix.com>,
	Andrew Melnychenko <andrew@daynix.com>
Subject: [RFC PATCH 08/12] qapi: Add FilterUbpfProperties and qemu-options
Date: Fri, 17 Jun 2022 15:36:26 +0800	[thread overview]
Message-ID: <20220617073630.535914-9-chen.zhang@intel.com> (raw)
In-Reply-To: <20220617073630.535914-1-chen.zhang@intel.com>

Add filter-ubpf related QOM and qemu-options.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 qapi/qom.json   | 18 ++++++++++++++++++
 qemu-options.hx |  6 ++++++
 2 files changed, 24 insertions(+)

diff --git a/qapi/qom.json b/qapi/qom.json
index 6a653c6636..820a5218e8 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -444,6 +444,22 @@
   'base': 'NetfilterProperties',
   'data': { '*vnet_hdr_support': 'bool' } }
 
+##
+# @FilterUbpfProperties:
+#
+# Properties for filter-ubpf objects.
+#
+# @ip-mode: if true, IP packet handle mode is enabled(default: true).
+#
+# @ubpf-handler: The filename where the userspace ebpf packets handler.
+#
+# Since: 7.1
+##
+{ 'struct': 'FilterUbpfProperties',
+  'base': 'NetfilterProperties',
+  'data': { '*ip-mode': 'bool',
+            '*ubpf-handler': 'str' } }
+
 ##
 # @InputBarrierProperties:
 #
@@ -845,6 +861,7 @@
     'filter-redirector',
     'filter-replay',
     'filter-rewriter',
+    'filter-ubpf',
     'input-barrier',
     { 'name': 'input-linux',
       'if': 'CONFIG_LINUX' },
@@ -911,6 +928,7 @@
       'filter-redirector':          'FilterRedirectorProperties',
       'filter-replay':              'NetfilterProperties',
       'filter-rewriter':            'FilterRewriterProperties',
+      'filter-ubpf':                'FilterUbpfProperties',
       'input-barrier':              'InputBarrierProperties',
       'input-linux':                { 'type': 'InputLinuxProperties',
                                       'if': 'CONFIG_LINUX' },
diff --git a/qemu-options.hx b/qemu-options.hx
index 60cf188da4..3dfb858867 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -5080,6 +5080,12 @@ SRST
         stored. The file format is libpcap, so it can be analyzed with
         tools such as tcpdump or Wireshark.
 
+    ``-object filter-ubpf,id=id,netdev=dev,ubpf-handler=filename[,ip-mode][,position=head|tail|id=<id>][,insert=behind|before]``
+        filter-ubpf is the userspace ebpf network traffic handler on netdev dev
+        from the userspace ebpf handler file specified by filename.
+        If disable ip_mode, the loaded ebpf program will handle raw
+        network packet.
+
     ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
         Colo-compare gets packet from primary\_in chardevid and
         secondary\_in, then compare whether the payload of primary packet
-- 
2.25.1



  parent reply	other threads:[~2022-06-17  8:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17  7:36 [RFC PATCH 00/12] Introduce QEMU userspace ebpf support Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU Zhang Chen
2022-06-17  8:05   ` Daniel P. Berrangé
2022-06-20  5:59     ` Zhang, Chen
2022-06-20  8:11       ` Daniel P. Berrangé
2022-06-20  8:46         ` Thomas Huth
2022-06-20  9:29           ` Zhang, Chen
2022-06-20  9:43             ` Thomas Huth
2022-06-20 10:29               ` Zhang, Chen
2022-06-20 10:37                 ` Daniel P. Berrangé
2022-06-22  9:21                   ` Zhang, Chen
2022-06-20 10:00             ` Daniel P. Berrangé
2022-06-20 10:22               ` Zhang, Chen
2022-06-17  7:36 ` [RFC PATCH 02/12] meson: Add ubpf build config and misc Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 03/12] ebpf/uBPF: Introduce userspace ebpf data structure Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 04/12] ebpf/uBPF: Introduce ubpf initialize functions Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 05/12] ebpf/uBPF: Add qemu_prepare_ubpf to load ebpf binary Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 06/12] ebpf/uBPF: Add qemu_ubpf_run_once excute real ebpf program Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 07/12] net/filter: Introduce filter-ubpf module Zhang Chen
2022-06-17  7:36 ` Zhang Chen [this message]
2022-06-20  7:45   ` [RFC PATCH 08/12] qapi: Add FilterUbpfProperties and qemu-options Markus Armbruster
2022-06-20  9:40     ` Zhang, Chen
2022-06-17  7:36 ` [RFC PATCH 09/12] softmmu/vl.c: Add filter-ubpf for netdev as other netfilters Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 10/12] net/filter-ubpf.c: run the ubpf program to handle network packet Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 11/12] docs/devel: Add userspace-ebpf.rst Zhang Chen
2022-06-17  7:36 ` [RFC PATCH 12/12] test/qtest: Add ubpf basic test case Zhang Chen
2022-06-17  9:34   ` Thomas Huth
2022-06-20  9:31     ` Zhang, Chen
2022-06-20  9:51       ` Thomas Huth
2022-06-29 10:43 ` [RFC PATCH 00/12] Introduce QEMU userspace ebpf support Andrew Melnichenko
2022-07-01  6:14   ` Zhang, Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220617073630.535914-9-chen.zhang@intel.com \
    --to=chen.zhang@intel.com \
    --cc=andrew@daynix.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=yuri.benditovich@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.