All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter
@ 2017-05-15  6:18 Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 1/3] net/filter-mirror.c: Remove duplicate check code Zhang Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Zhang Chen @ 2017-05-15  6:18 UTC (permalink / raw)
  To: qemu devel, Jason Wang; +Cc: Zhang Chen, zhanghailiang, Eric Blake

Fix some duplicate codes and remove unused codes.

v2: Address Eric's comment on patch 3.

Zhang Chen (3):
  net/filter-mirror.c: Remove duplicate check code.
  net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle
  net/filter-rewriter: Remove unused option in filter-rewriter

 net/filter-mirror.c | 35 ++++++++++++++++-------------------
 qemu-options.hx     |  2 +-
 2 files changed, 17 insertions(+), 20 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH RESEND V2 1/3] net/filter-mirror.c: Remove duplicate check code.
  2017-05-15  6:18 [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Zhang Chen
@ 2017-05-15  6:18 ` Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 2/3] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle Zhang Chen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Zhang Chen @ 2017-05-15  6:18 UTC (permalink / raw)
  To: qemu devel, Jason Wang; +Cc: Zhang Chen, zhanghailiang, Eric Blake

The s->outdev have checked in filter_mirror_set_outdev().

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 net/filter-mirror.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index 72fa7c2..fd0322f 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -194,12 +194,6 @@ static void filter_mirror_setup(NetFilterState *nf, Error **errp)
     MirrorState *s = FILTER_MIRROR(nf);
     Chardev *chr;
 
-    if (!s->outdev) {
-        error_setg(errp, "filter mirror needs 'outdev' "
-                   "property set");
-        return;
-    }
-
     chr = qemu_chr_find(s->outdev);
     if (chr == NULL) {
         error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH RESEND V2 2/3] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle
  2017-05-15  6:18 [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 1/3] net/filter-mirror.c: Remove duplicate check code Zhang Chen
@ 2017-05-15  6:18 ` Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 3/3] net/filter-rewriter: Remove unused option in filter-rewriter Zhang Chen
  2017-05-16  6:48 ` [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Jason Wang
  3 siblings, 0 replies; 8+ messages in thread
From: Zhang Chen @ 2017-05-15  6:18 UTC (permalink / raw)
  To: qemu devel, Jason Wang; +Cc: Zhang Chen, zhanghailiang, Eric Blake

Because filter_mirror_receive_iov() and filter_redirector_receive_iov()
both use the filter_mirror_send() to send packet, so I change
filter_mirror_send() to filter_send() that looks more common.
And fix some codestyle.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 net/filter-mirror.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index fd0322f..8b1b069 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -43,9 +43,9 @@ typedef struct MirrorState {
     SocketReadState rs;
 } MirrorState;
 
-static int filter_mirror_send(CharBackend *chr_out,
-                              const struct iovec *iov,
-                              int iovcnt)
+static int filter_send(CharBackend *chr_out,
+                       const struct iovec *iov,
+                       int iovcnt)
 {
     int ret = 0;
     ssize_t size = 0;
@@ -141,9 +141,9 @@ static ssize_t filter_mirror_receive_iov(NetFilterState *nf,
     MirrorState *s = FILTER_MIRROR(nf);
     int ret;
 
-    ret = filter_mirror_send(&s->chr_out, iov, iovcnt);
+    ret = filter_send(&s->chr_out, iov, iovcnt);
     if (ret) {
-        error_report("filter_mirror_send failed(%s)", strerror(-ret));
+        error_report("filter mirror send failed(%s)", strerror(-ret));
     }
 
     /*
@@ -164,9 +164,9 @@ static ssize_t filter_redirector_receive_iov(NetFilterState *nf,
     int ret;
 
     if (qemu_chr_fe_get_driver(&s->chr_out)) {
-        ret = filter_mirror_send(&s->chr_out, iov, iovcnt);
+        ret = filter_send(&s->chr_out, iov, iovcnt);
         if (ret) {
-            error_report("filter_mirror_send failed(%s)", strerror(-ret));
+            error_report("filter redirector send failed(%s)", strerror(-ret));
         }
         return iov_size(iov, iovcnt);
     } else {
@@ -286,8 +286,9 @@ static char *filter_redirector_get_indev(Object *obj, Error **errp)
     return g_strdup(s->indev);
 }
 
-static void
-filter_redirector_set_indev(Object *obj, const char *value, Error **errp)
+static void filter_redirector_set_indev(Object *obj,
+                                        const char *value,
+                                        Error **errp)
 {
     MirrorState *s = FILTER_REDIRECTOR(obj);
 
@@ -302,8 +303,9 @@ static char *filter_mirror_get_outdev(Object *obj, Error **errp)
     return g_strdup(s->outdev);
 }
 
-static void
-filter_mirror_set_outdev(Object *obj, const char *value, Error **errp)
+static void filter_mirror_set_outdev(Object *obj,
+                                     const char *value,
+                                     Error **errp)
 {
     MirrorState *s = FILTER_MIRROR(obj);
 
@@ -323,8 +325,9 @@ static char *filter_redirector_get_outdev(Object *obj, Error **errp)
     return g_strdup(s->outdev);
 }
 
-static void
-filter_redirector_set_outdev(Object *obj, const char *value, Error **errp)
+static void filter_redirector_set_outdev(Object *obj,
+                                         const char *value,
+                                         Error **errp)
 {
     MirrorState *s = FILTER_REDIRECTOR(obj);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH RESEND V2 3/3] net/filter-rewriter: Remove unused option in filter-rewriter
  2017-05-15  6:18 [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 1/3] net/filter-mirror.c: Remove duplicate check code Zhang Chen
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 2/3] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle Zhang Chen
@ 2017-05-15  6:18 ` Zhang Chen
  2017-05-16  6:48 ` [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Jason Wang
  3 siblings, 0 replies; 8+ messages in thread
From: Zhang Chen @ 2017-05-15  6:18 UTC (permalink / raw)
  To: qemu devel, Jason Wang; +Cc: Zhang Chen, zhanghailiang, Eric Blake

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index f806af9..cbec279 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4038,7 +4038,7 @@ Create a filter-redirector we need to differ outdev id from indev id, 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.
 
-@item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},rewriter-mode=@var{mode}[,queue=@var{all|rx|tx}]
+@item -object filter-rewriter,id=@var{id},netdev=@var{netdevid}[,queue=@var{all|rx|tx}]
 
 Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
 secondary from primary to keep secondary tcp connection,and rewrite
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter
  2017-05-15  6:18 [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Zhang Chen
                   ` (2 preceding siblings ...)
  2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 3/3] net/filter-rewriter: Remove unused option in filter-rewriter Zhang Chen
@ 2017-05-16  6:48 ` Jason Wang
  2017-05-16  8:22   ` Zhang Chen
  3 siblings, 1 reply; 8+ messages in thread
From: Jason Wang @ 2017-05-16  6:48 UTC (permalink / raw)
  To: Zhang Chen, qemu devel; +Cc: zhanghailiang



On 2017年05月15日 14:18, Zhang Chen wrote:
> Fix some duplicate codes and remove unused codes.
>
> v2: Address Eric's comment on patch 3.
>
> Zhang Chen (3):
>    net/filter-mirror.c: Remove duplicate check code.
>    net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle
>    net/filter-rewriter: Remove unused option in filter-rewriter
>
>   net/filter-mirror.c | 35 ++++++++++++++++-------------------
>   qemu-options.hx     |  2 +-
>   2 files changed, 17 insertions(+), 20 deletions(-)
>

Hi:

What's the difference compared with V2? I think I should apply this series?

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter
  2017-05-16  6:48 ` [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Jason Wang
@ 2017-05-16  8:22   ` Zhang Chen
  2017-05-16 14:42     ` Eric Blake
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang Chen @ 2017-05-16  8:22 UTC (permalink / raw)
  To: Jason Wang, qemu devel; +Cc: zhangchen.fnst, zhanghailiang



On 05/16/2017 02:48 PM, Jason Wang wrote:
>
>
> On 2017年05月15日 14:18, Zhang Chen wrote:
>> Fix some duplicate codes and remove unused codes.
>>
>> v2: Address Eric's comment on patch 3.
>>
>> Zhang Chen (3):
>>    net/filter-mirror.c: Remove duplicate check code.
>>    net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle
>>    net/filter-rewriter: Remove unused option in filter-rewriter
>>
>>   net/filter-mirror.c | 35 ++++++++++++++++-------------------
>>   qemu-options.hx     |  2 +-
>>   2 files changed, 17 insertions(+), 20 deletions(-)
>>
>
> Hi:
>
> What's the difference compared with V2? I think I should apply this 
> series?

In V2 I forgot remove "," in patch 3/3, Yes, please apply this series.

>
> Thanks
>
>
>

-- 
Thanks
Zhang Chen

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter
  2017-05-16  8:22   ` Zhang Chen
@ 2017-05-16 14:42     ` Eric Blake
  2017-05-17  2:02       ` Zhang Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Blake @ 2017-05-16 14:42 UTC (permalink / raw)
  To: Zhang Chen, Jason Wang, qemu devel; +Cc: zhanghailiang

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

On 05/16/2017 03:22 AM, Zhang Chen wrote:

>>
>> What's the difference compared with V2? I think I should apply this
>> series?
> 
> In V2 I forgot remove "," in patch 3/3, Yes, please apply this series.

If you changed the patches, even just to add a ',', then it's best to
post the resend as "v3", not "RESEND V2".  Also, documenting what
changed between versions, rather than just blindly titling a message
RESEND (or even explaining WHY you are resending without change, such as
to correct an incorrect cc to save people the problem of bounce replies
when replying to the thread), is good netiquette.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter
  2017-05-16 14:42     ` Eric Blake
@ 2017-05-17  2:02       ` Zhang Chen
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang Chen @ 2017-05-17  2:02 UTC (permalink / raw)
  To: Eric Blake, Jason Wang, qemu devel; +Cc: zhangchen.fnst, zhanghailiang



On 05/16/2017 10:42 PM, Eric Blake wrote:
> On 05/16/2017 03:22 AM, Zhang Chen wrote:
>
>>> What's the difference compared with V2? I think I should apply this
>>> series?
>> In V2 I forgot remove "," in patch 3/3, Yes, please apply this series.
> If you changed the patches, even just to add a ',', then it's best to
> post the resend as "v3", not "RESEND V2".  Also, documenting what
> changed between versions, rather than just blindly titling a message
> RESEND (or even explaining WHY you are resending without change, such as
> to correct an incorrect cc to save people the problem of bounce replies
> when replying to the thread), is good netiquette.

OK, I got your point, will send the V3 later.

Thanks
Zhang Chen

>

-- 
Thanks
Zhang Chen

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-05-17  2:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15  6:18 [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Zhang Chen
2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 1/3] net/filter-mirror.c: Remove duplicate check code Zhang Chen
2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 2/3] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle Zhang Chen
2017-05-15  6:18 ` [Qemu-devel] [PATCH RESEND V2 3/3] net/filter-rewriter: Remove unused option in filter-rewriter Zhang Chen
2017-05-16  6:48 ` [Qemu-devel] [PATCH RESEND V2 0/3] Optimize filter-mirror and filter-rewriter Jason Wang
2017-05-16  8:22   ` Zhang Chen
2017-05-16 14:42     ` Eric Blake
2017-05-17  2:02       ` Zhang Chen

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.