All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Chen <chen.zhang@intel.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Zhang Chen <chen.zhang@intel.com>,
	qemu-dev <qemu-devel@nongnu.org>,
	Li Zhijian <lizhijian@cn.fujitsu.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: [PATCH V4 2/3] net/filter: Remove vnet_hdr from filter-rewriter
Date: Wed, 27 Oct 2021 02:17:29 +0800	[thread overview]
Message-ID: <20211026181730.3102184-3-chen.zhang@intel.com> (raw)
In-Reply-To: <20211026181730.3102184-1-chen.zhang@intel.com>

Make the vnet header a necessary part of filter transfer protocol.
So we need remove the module switch here.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 net/filter-rewriter.c | 26 +-------------------------
 qemu-options.hx       |  6 +++---
 2 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index cb3a96cde1..acc09f20fa 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -34,7 +34,6 @@ struct RewriterState {
     NetQueue *incoming_queue;
     /* hashtable to save connection */
     GHashTable *connection_track_table;
-    bool vnet_hdr;
     bool failover_mode;
 };
 
@@ -266,9 +265,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
 
     iov_to_buf(iov, iovcnt, 0, buf, size);
 
-    if (s->vnet_hdr) {
-        vnet_hdr_len = nf->netdev->vnet_hdr_len;
-    }
+    vnet_hdr_len = nf->netdev->vnet_hdr_len;
 
     pkt = packet_new_nocopy(buf, size, vnet_hdr_len);
 
@@ -395,27 +392,10 @@ static void colo_rewriter_setup(NetFilterState *nf, Error **errp)
     s->incoming_queue = qemu_new_net_queue(qemu_netfilter_pass_to_next, nf);
 }
 
-static bool filter_rewriter_get_vnet_hdr(Object *obj, Error **errp)
-{
-    RewriterState *s = FILTER_REWRITER(obj);
-
-    return s->vnet_hdr;
-}
-
-static void filter_rewriter_set_vnet_hdr(Object *obj,
-                                         bool value,
-                                         Error **errp)
-{
-    RewriterState *s = FILTER_REWRITER(obj);
-
-    s->vnet_hdr = value;
-}
-
 static void filter_rewriter_init(Object *obj)
 {
     RewriterState *s = FILTER_REWRITER(obj);
 
-    s->vnet_hdr = false;
     s->failover_mode = FAILOVER_MODE_OFF;
 }
 
@@ -423,10 +403,6 @@ static void colo_rewriter_class_init(ObjectClass *oc, void *data)
 {
     NetFilterClass *nfc = NETFILTER_CLASS(oc);
 
-    object_class_property_add_bool(oc, "vnet_hdr_support",
-                                   filter_rewriter_get_vnet_hdr,
-                                   filter_rewriter_set_vnet_hdr);
-
     nfc->setup = colo_rewriter_setup;
     nfc->cleanup = colo_rewriter_cleanup;
     nfc->receive_iov = colo_rewriter_receive_iov;
diff --git a/qemu-options.hx b/qemu-options.hx
index 38c03812a7..6d3b7ab8a0 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4958,12 +4958,12 @@ SRST
         id can not be the same. we can just use indev or outdev, but at
         least one of indev or outdev need to be specified.
 
-    ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
+    ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx[,position=head|tail|id=<id>][,insert=behind|before]``
         Filter-rewriter is a part of COLO project.It will rewrite tcp
         packet to secondary from primary to keep secondary tcp
         connection,and rewrite tcp packet to primary from secondary make
-        tcp packet can be handled by client.if it has the
-        vnet\_hdr\_support flag, we can parse packet with vnet header.
+        tcp packet can be handled by client. Filter-rewriter support
+        parse packet with vnet header.
 
         usage: colo secondary: -object
         filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
-- 
2.25.1



  parent reply	other threads:[~2021-10-26 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 18:17 [PATCH V4 0/3] net/filter: Optimize filters vnet_hdr support Zhang Chen
2021-10-26 18:17 ` [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector Zhang Chen
2021-10-27  4:45   ` Jason Wang
2021-10-27  6:19     ` Zhang, Chen
2021-10-27  6:24       ` Jason Wang
2021-10-27  6:40         ` Zhang, Chen
2021-10-27  6:45           ` Jason Wang
2021-10-27  6:50             ` Zhang, Chen
2021-10-27  7:19             ` Markus Armbruster
2021-10-26 18:17 ` Zhang Chen [this message]
2021-10-26 18:17 ` [PATCH V4 3/3] net/colo-compare.c: Remove vnet_hdr and check in payload from colo-compare 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=20211026181730.3102184-3-chen.zhang@intel.com \
    --to=chen.zhang@intel.com \
    --cc=armbru@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    /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.