[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V4 2/3] net/filter: Remove vnet_hdr from filter-rewriter
From: |
Zhang Chen |
Subject: |
[PATCH V4 2/3] net/filter: Remove vnet_hdr from filter-rewriter |
Date: |
Wed, 27 Oct 2021 02:17:29 +0800 |
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
- [PATCH V4 0/3] net/filter: Optimize filters vnet_hdr support, Zhang Chen, 2021/10/26
- [PATCH V4 2/3] net/filter: Remove vnet_hdr from filter-rewriter,
Zhang Chen <=
- [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Zhang Chen, 2021/10/26
- Re: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Jason Wang, 2021/10/27
- RE: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Zhang, Chen, 2021/10/27
- Re: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Jason Wang, 2021/10/27
- RE: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Zhang, Chen, 2021/10/27
- Re: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Jason Wang, 2021/10/27
- RE: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Zhang, Chen, 2021/10/27
- Re: [PATCH V4 1/3] net/filter: Remove vnet_hdr from filter-mirror and filter-redirector, Markus Armbruster, 2021/10/27
[PATCH V4 3/3] net/colo-compare.c: Remove vnet_hdr and check in payload from colo-compare, Zhang Chen, 2021/10/26