qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: Jason Wang <jasowang@redhat.com>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com,
	lizhijian@cn.fujitsu.com, eddie.dong@intel.com,
	mrhines@linux.vnet.ibm.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 02/11] init/cleanup of netfilter object
Date: Thu, 6 Aug 2015 15:50:43 +0800	[thread overview]
Message-ID: <55C311D3.8010305@cn.fujitsu.com> (raw)
In-Reply-To: <55C3103A.9030605@redhat.com>

On 08/06/2015 03:43 PM, Jason Wang wrote:
> On 08/06/2015 03:35 PM, Yang Hongyang wrote:
>> On 08/06/2015 03:29 PM, Jason Wang wrote:
>>>
>>>
>>> On 08/06/2015 03:22 PM, Yang Hongyang wrote:
>>>> On 08/06/2015 03:07 PM, Jason Wang wrote:
>>>>>
>>>>>
>>>>> On 08/04/2015 04:30 PM, Yang Hongyang wrote:
>>>>>> QTAILQ_ENTRY global_list but used by filter layer, so that we can
>>>>>> manage all filters together.
>>>>>> QTAILQ_ENTRY next used by netdev, filter belongs to the specific
>>>>>> netdev is
>>>>>> in this queue.
>>>>>> This is mostly the same with init/cleanup of netdev object.
>>>>>>
>>>>>> Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
>>>>>> ---
>>>>>>     include/net/filter.h    |  39 +++++++++++++
>>>>>>     include/net/net.h       |   1 +
>>>>>>     include/qemu/typedefs.h |   1 +
>>>>>>     net/filter.c            | 147
>>>>>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>>>     net/net.c               |   1 +
>>>>>>     qapi-schema.json        |  37 ++++++++++++
>>>>>>     6 files changed, 226 insertions(+)
>>>>>>
>>>>>> diff --git a/include/net/filter.h b/include/net/filter.h
>>>>>> index 4242ded..9aafe08 100644
>>>>>> --- a/include/net/filter.h
>>>>>> +++ b/include/net/filter.h
>>>>>> @@ -9,7 +9,46 @@
>>>>>>     #define QEMU_NET_FILTER_H
>>>>>>
>>>>>>     #include "qemu-common.h"
>>>>>> +#include "qemu/typedefs.h"
>>>>>> +
>>>>>> +/* the netfilter chain */
>>>>>> +enum {
>>>>>> +    NET_FILTER_IN,
>>>>>> +    NET_FILTER_OUT,
>>>>>> +    NET_FILTER_ALL,
>>>>>> +};
>>>>>> +
>>>>>> +typedef void (FilterCleanup) (NetFilterState *);
>>>>>> +/*
>>>>>> + * Return:
>>>>>> + *   0: finished handling the packet, we should continue
>>>>>> + *   size: filter stolen this packet, we stop pass this packet
>>>>>> further
>>>>>> + */
>>>>>> +typedef ssize_t (FilterReceiveIOV)(NetFilterState *, NetClientState
>>>>>> *sender,
>>>>>> +                                   unsigned flags, const struct
>>>>>> iovec *, int);
>>>>>
>>>>> Please name all parameters.
>>>>
>>>> Ok, thanks.
>>>>
>>>>>
>>>>>> +
>>>>>> +typedef struct NetFilterInfo {
>>>>>> +    NetFilterOptionsKind type;
>>>>>> +    size_t size;
>>>>>> +    FilterCleanup *cleanup;
>>>>>> +    FilterReceiveIOV *receive_iov;
>>>>>> +} NetFilterInfo;
>>>>>> +
>>>>>> +struct NetFilterState {
>>>>>> +    NetFilterInfo *info;
>>>>>> +    char *model;
>>>>>
>>>>> Looks like model is never used?
>>>>
>>>> It can be used when we want to find filters by model. For example,
>>>> when we need to find all "buffer" filter, and release all buffered
>>>> packets.
>>>
>>> But this is not implemented in this series.
>>
>> true.
>>
>>> And I don't get why you need
>>> a such command. Management should keep track of this.
>>
>> There's a patch in v1 which introduce an API use this, and I dropped that
>> because there's no user currently, but that API I suppose to be used
>> by MC or COLO which can do periodic checkpoint, to release packets.
>> the API is filter_buffer_release_all() IIRC...
>
> I see, let's start with simple case to make review and merging easier.
> You can re-introduce them when it has real users.

So do I need to remove model also?

>
> .
>

-- 
Thanks,
Yang.

  reply	other threads:[~2015-08-06  7:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  8:30 [Qemu-devel] [PATCH v4 00/11] For QEMU 2.5: Add a netfilter object and netbuffer filter Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 01/11] net: add a new object netfilter Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 02/11] init/cleanup of netfilter object Yang Hongyang
2015-08-06  7:07   ` Jason Wang
2015-08-06  7:22     ` Yang Hongyang
2015-08-06  7:29       ` Jason Wang
2015-08-06  7:35         ` Yang Hongyang
2015-08-06  7:43           ` Jason Wang
2015-08-06  7:50             ` Yang Hongyang [this message]
2015-08-06  7:53               ` Jason Wang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 03/11] netfilter: add netfilter_{add|del} commands Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 04/11] net: delete netfilter object when delete netdev Yang Hongyang
2015-08-06  7:09   ` Jason Wang
2015-08-06  7:22     ` Yang Hongyang
2015-08-06  8:44     ` Yang Hongyang
2015-08-06  9:14       ` Jason Wang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 05/11] netfilter: hook packets before net queue send Yang Hongyang
2015-08-06  7:13   ` Jason Wang
2015-08-06  7:28     ` Yang Hongyang
2015-08-06  7:37       ` Jason Wang
2015-08-06  7:58         ` Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 06/11] netfilter: add an API to pass the packet to next filter Yang Hongyang
2015-08-06  7:16   ` Jason Wang
2015-08-06  7:29     ` Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 07/11] net/queue: export qemu_net_queue_append_iov Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 08/11] move out net queue structs define Yang Hongyang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 09/11] netfilter: add a netbuffer filter Yang Hongyang
2015-08-06  7:21   ` Jason Wang
2015-08-06  8:19     ` Yang Hongyang
2015-08-06  9:09       ` Jason Wang
2015-08-06  9:23         ` Yang Hongyang
2015-08-06  9:35           ` Jason Wang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 10/11] filter/buffer: update command description and help Yang Hongyang
2015-08-06  7:22   ` Jason Wang
2015-08-06  7:31     ` Yang Hongyang
2015-08-06  7:39       ` Jason Wang
2015-08-04  8:30 ` [Qemu-devel] [PATCH v4 11/11] tests: add test cases for netfilter object Yang Hongyang

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=55C311D3.8010305@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=eddie.dong@intel.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=mrhines@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=zhang.zhanghailiang@huawei.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 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).