* [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
@ 2016-03-07 10:03 Zhang Chen
2016-03-08 8:04 ` Yang Hongyang
0 siblings, 1 reply; 6+ messages in thread
From: Zhang Chen @ 2016-03-07 10:03 UTC (permalink / raw)
To: qemu devel, Jason Wang
Cc: Li Zhijian, Gui jianfeng, eddie.dong, zhanghailiang,
Dr. David Alan Gilbert, Zhang Chen, Yang Hongyang
This API will iterate the filters attached to netdev
Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
include/net/filter.h | 10 +++++-----
net/filter-buffer.c | 2 +-
net/filter.c | 12 ++++++------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/net/filter.h b/include/net/filter.h
index 5639976..ab00d54 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -67,10 +67,10 @@ ssize_t qemu_netfilter_receive(NetFilterState *nf,
NetPacketSent *sent_cb);
/* pass the packet to the next filter */
-ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
- unsigned flags,
- const struct iovec *iov,
- int iovcnt,
- void *opaque);
+ssize_t qemu_netfilter_iterate(NetClientState *sender,
+ unsigned flags,
+ const struct iovec *iov,
+ int iovcnt,
+ void *opaque);
#endif /* QEMU_NET_FILTER_H */
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index 12ad2e3..a74f8c8 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -114,7 +114,7 @@ static void filter_buffer_setup(NetFilterState *nf, Error **errp)
return;
}
- s->incoming_queue = qemu_new_net_queue(qemu_netfilter_pass_to_next, nf);
+ s->incoming_queue = qemu_new_net_queue(qemu_netfilter_iterate, nf);
if (s->interval) {
timer_init_us(&s->release_timer, QEMU_CLOCK_VIRTUAL,
filter_buffer_release_timer, nf);
diff --git a/net/filter.c b/net/filter.c
index d2a514e..7c504c3 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -50,11 +50,11 @@ static NetFilterState *netfilter_next(NetFilterState *nf,
return next;
}
-ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
- unsigned flags,
- const struct iovec *iov,
- int iovcnt,
- void *opaque)
+ssize_t qemu_netfilter_iterate(NetClientState *sender,
+ unsigned flags,
+ const struct iovec *iov,
+ int iovcnt,
+ void *opaque)
{
int ret = 0;
int direction;
@@ -80,7 +80,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
next = netfilter_next(nf, direction);
while (next) {
/*
- * if qemu_netfilter_pass_to_next been called, means that
+ * if qemu_netfilter_iterate been called, means that
* the packet has been hold by filter and has already retured size
* to the sender, so sent_cb shouldn't be called later, just
* pass NULL to next.
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
2016-03-07 10:03 [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate() Zhang Chen
@ 2016-03-08 8:04 ` Yang Hongyang
2016-03-09 8:02 ` Li Zhijian
0 siblings, 1 reply; 6+ messages in thread
From: Yang Hongyang @ 2016-03-08 8:04 UTC (permalink / raw)
To: Zhang Chen
Cc: zhanghailiang, Li Zhijian, Gui jianfeng, Jason Wang, eddie.dong,
qemu devel, Dr. David Alan Gilbert, Yang Hongyang
[-- Attachment #1: Type: text/plain, Size: 3439 bytes --]
Hi Chen,
What's the motivation that you want to change this name? The function
actually is not
intent to iterate every filter.
On Mon, Mar 7, 2016 at 6:03 PM, Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
wrote:
> This API will iterate the filters attached to netdev
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
> include/net/filter.h | 10 +++++-----
> net/filter-buffer.c | 2 +-
> net/filter.c | 12 ++++++------
> 3 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/include/net/filter.h b/include/net/filter.h
> index 5639976..ab00d54 100644
> --- a/include/net/filter.h
> +++ b/include/net/filter.h
> @@ -67,10 +67,10 @@ ssize_t qemu_netfilter_receive(NetFilterState *nf,
> NetPacketSent *sent_cb);
>
> /* pass the packet to the next filter */
> -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
> - unsigned flags,
> - const struct iovec *iov,
> - int iovcnt,
> - void *opaque);
> +ssize_t qemu_netfilter_iterate(NetClientState *sender,
> + unsigned flags,
> + const struct iovec *iov,
> + int iovcnt,
> + void *opaque);
>
> #endif /* QEMU_NET_FILTER_H */
> diff --git a/net/filter-buffer.c b/net/filter-buffer.c
> index 12ad2e3..a74f8c8 100644
> --- a/net/filter-buffer.c
> +++ b/net/filter-buffer.c
> @@ -114,7 +114,7 @@ static void filter_buffer_setup(NetFilterState *nf,
> Error **errp)
> return;
> }
>
> - s->incoming_queue = qemu_new_net_queue(qemu_netfilter_pass_to_next,
> nf);
> + s->incoming_queue = qemu_new_net_queue(qemu_netfilter_iterate, nf);
> if (s->interval) {
> timer_init_us(&s->release_timer, QEMU_CLOCK_VIRTUAL,
> filter_buffer_release_timer, nf);
> diff --git a/net/filter.c b/net/filter.c
> index d2a514e..7c504c3 100644
> --- a/net/filter.c
> +++ b/net/filter.c
> @@ -50,11 +50,11 @@ static NetFilterState *netfilter_next(NetFilterState
> *nf,
> return next;
> }
>
> -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
> - unsigned flags,
> - const struct iovec *iov,
> - int iovcnt,
> - void *opaque)
> +ssize_t qemu_netfilter_iterate(NetClientState *sender,
> + unsigned flags,
> + const struct iovec *iov,
> + int iovcnt,
> + void *opaque)
> {
> int ret = 0;
> int direction;
> @@ -80,7 +80,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState
> *sender,
> next = netfilter_next(nf, direction);
> while (next) {
> /*
> - * if qemu_netfilter_pass_to_next been called, means that
> + * if qemu_netfilter_iterate been called, means that
> * the packet has been hold by filter and has already retured size
> * to the sender, so sent_cb shouldn't be called later, just
> * pass NULL to next.
> --
> 1.9.1
>
>
>
>
>
--
Thanks,
Yang
[-- Attachment #2: Type: text/html, Size: 4848 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
2016-03-08 8:04 ` Yang Hongyang
@ 2016-03-09 8:02 ` Li Zhijian
2016-03-15 3:08 ` Jason Wang
0 siblings, 1 reply; 6+ messages in thread
From: Li Zhijian @ 2016-03-09 8:02 UTC (permalink / raw)
To: Yang Hongyang, Zhang Chen
Cc: zhanghailiang, Gui jianfeng, Jason Wang, eddie.dong,
Dr. David Alan Gilbert, qemu devel
On 03/08/2016 04:04 PM, Yang Hongyang wrote:
> Hi Chen,
>
> What's the motivation that you want to change this name? The function actually is not
> intent to iterate every filter.
Right. but this function isn't always pass packet to *a* next filter.
Actually, it iterates filters until the packet is stolen(filter receiving handler return non-zero).
In other words, packet could be handled by several filters at this function.
BTW, it's difficult to determine what name is better.
Thanks
Li Zhijian
>
> On Mon, Mar 7, 2016 at 6:03 PM, Zhang Chen <zhangchen.fnst@cn.fujitsu.com <mailto:zhangchen.fnst@cn.fujitsu.com>> wrote:
>
> This API will iterate the filters attached to netdev
>
> Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com <mailto:zhangchen.fnst@cn.fujitsu.com>>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com <mailto:wency@cn.fujitsu.com>>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com <mailto:lizhijian@cn.fujitsu.com>>
> ---
> include/net/filter.h | 10 +++++-----
> net/filter-buffer.c | 2 +-
> net/filter.c | 12 ++++++------
> 3 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/include/net/filter.h b/include/net/filter.h
> index 5639976..ab00d54 100644
> --- a/include/net/filter.h
> +++ b/include/net/filter.h
> @@ -67,10 +67,10 @@ ssize_t qemu_netfilter_receive(NetFilterState *nf,
> NetPacketSent *sent_cb);
>
> /* pass the packet to the next filter */
> -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
> - unsigned flags,
> - const struct iovec *iov,
> - int iovcnt,
> - void *opaque);
> +ssize_t qemu_netfilter_iterate(NetClientState *sender,
> + unsigned flags,
> + const struct iovec *iov,
> + int iovcnt,
> + void *opaque);
>
> #endif /* QEMU_NET_FILTER_H */
> diff --git a/net/filter-buffer.c b/net/filter-buffer.c
> index 12ad2e3..a74f8c8 100644
> --- a/net/filter-buffer.c
> +++ b/net/filter-buffer.c
> @@ -114,7 +114,7 @@ static void filter_buffer_setup(NetFilterState *nf, Error **errp)
> return;
> }
>
> - s->incoming_queue = qemu_new_net_queue(qemu_netfilter_pass_to_next, nf);
> + s->incoming_queue = qemu_new_net_queue(qemu_netfilter_iterate, nf);
> if (s->interval) {
> timer_init_us(&s->release_timer, QEMU_CLOCK_VIRTUAL,
> filter_buffer_release_timer, nf);
> diff --git a/net/filter.c b/net/filter.c
> index d2a514e..7c504c3 100644
> --- a/net/filter.c
> +++ b/net/filter.c
> @@ -50,11 +50,11 @@ static NetFilterState *netfilter_next(NetFilterState *nf,
> return next;
> }
>
> -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
> - unsigned flags,
> - const struct iovec *iov,
> - int iovcnt,
> - void *opaque)
> +ssize_t qemu_netfilter_iterate(NetClientState *sender,
> + unsigned flags,
> + const struct iovec *iov,
> + int iovcnt,
> + void *opaque)
> {
> int ret = 0;
> int direction;
> @@ -80,7 +80,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState *sender,
> next = netfilter_next(nf, direction);
> while (next) {
> /*
> - * if qemu_netfilter_pass_to_next been called, means that
> + * if qemu_netfilter_iterate been called, means that
> * the packet has been hold by filter and has already retured size
> * to the sender, so sent_cb shouldn't be called later, just
> * pass NULL to next.
> --
> 1.9.1
>
>
>
>
>
>
>
> --
> Thanks,
> Yang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
2016-03-09 8:02 ` Li Zhijian
@ 2016-03-15 3:08 ` Jason Wang
2016-03-15 3:33 ` Li Zhijian
0 siblings, 1 reply; 6+ messages in thread
From: Jason Wang @ 2016-03-15 3:08 UTC (permalink / raw)
To: Li Zhijian, Yang Hongyang, Zhang Chen
Cc: Gui jianfeng, eddie.dong, zhanghailiang, Dr. David Alan Gilbert,
qemu devel
On 03/09/2016 04:02 PM, Li Zhijian wrote:
>
>
> On 03/08/2016 04:04 PM, Yang Hongyang wrote:
>> Hi Chen,
>>
>> What's the motivation that you want to change this name? The
>> function actually is not
>> intent to iterate every filter.
>
> Right. but this function isn't always pass packet to *a* next filter.
> Actually, it iterates filters until the packet is stolen(filter
> receiving handler return non-zero).
> In other words, packet could be handled by several filters at this
> function.
>
> BTW, it's difficult to determine what name is better.
>
> Thanks
> Li Zhijian
Right, so I was considering a better function name (though I'm not a
native English speaker).
But I agree qemu_netfilter_iterate() is not perfect too, may need more
thought.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
2016-03-15 3:08 ` Jason Wang
@ 2016-03-15 3:33 ` Li Zhijian
2016-03-15 3:42 ` Jason Wang
0 siblings, 1 reply; 6+ messages in thread
From: Li Zhijian @ 2016-03-15 3:33 UTC (permalink / raw)
To: Jason Wang, Yang Hongyang, Zhang Chen
Cc: Gui jianfeng, eddie.dong, zhanghailiang, Dr. David Alan Gilbert,
qemu devel
On 03/15/2016 11:08 AM, Jason Wang wrote:
>
>
> On 03/09/2016 04:02 PM, Li Zhijian wrote:
>>
>>
>> On 03/08/2016 04:04 PM, Yang Hongyang wrote:
>>> Hi Chen,
>>>
>>> What's the motivation that you want to change this name? The
>>> function actually is not
>>> intent to iterate every filter.
>>
>> Right. but this function isn't always pass packet to *a* next filter.
>> Actually, it iterates filters until the packet is stolen(filter
>> receiving handler return non-zero).
>> In other words, packet could be handled by several filters at this
>> function.
>>
>> BTW, it's difficult to determine what name is better.
>>
>> Thanks
>> Li Zhijian
>
> Right, so I was considering a better function name (though I'm not a
> native English speaker).
>
> But I agree qemu_netfilter_iterate() is not perfect too, may need more
> thought.
>
>
let's drop this patch temporarily ?
Thanks
Li Zhijian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate()
2016-03-15 3:33 ` Li Zhijian
@ 2016-03-15 3:42 ` Jason Wang
0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2016-03-15 3:42 UTC (permalink / raw)
To: Li Zhijian, Yang Hongyang, Zhang Chen
Cc: qemu devel, Gui jianfeng, eddie.dong, zhanghailiang,
Dr. David Alan Gilbert
On 03/15/2016 11:33 AM, Li Zhijian wrote:
>
>
> On 03/15/2016 11:08 AM, Jason Wang wrote:
>>
>>
>> On 03/09/2016 04:02 PM, Li Zhijian wrote:
>>>
>>>
>>> On 03/08/2016 04:04 PM, Yang Hongyang wrote:
>>>> Hi Chen,
>>>>
>>>> What's the motivation that you want to change this name? The
>>>> function actually is not
>>>> intent to iterate every filter.
>>>
>>> Right. but this function isn't always pass packet to *a* next filter.
>>> Actually, it iterates filters until the packet is stolen(filter
>>> receiving handler return non-zero).
>>> In other words, packet could be handled by several filters at this
>>> function.
>>>
>>> BTW, it's difficult to determine what name is better.
>>>
>>> Thanks
>>> Li Zhijian
>>
>> Right, so I was considering a better function name (though I'm not a
>> native English speaker).
>>
>> But I agree qemu_netfilter_iterate() is not perfect too, may need more
>> thought.
>>
>>
> let's drop this patch temporarily ?
>
> Thanks
> Li Zhijian
>
Right, let's change it when we have a better name.
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-15 3:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 10:03 [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate() Zhang Chen
2016-03-08 8:04 ` Yang Hongyang
2016-03-09 8:02 ` Li Zhijian
2016-03-15 3:08 ` Jason Wang
2016-03-15 3:33 ` Li Zhijian
2016-03-15 3:42 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).