|
From: | Yang Hongyang |
Subject: | Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support |
Date: | Tue, 22 Sep 2015 17:47:23 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 09/22/2015 05:30 PM, Jason Wang wrote: [...]
if (!nf->netdev_id) { error_setg(errp, "Parameter 'netdev' is required"); @@ -165,9 +174,6 @@ static void netfilter_complete(UserCreatable *uc, Error **errp) error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "netdev", "a network backend id"); return; - } else if (queues > 1) { - error_setg(errp, "Multi queue is not supported"); - return; } if (get_vhost_net(ncs[0])) { @@ -187,6 +193,17 @@ static void netfilter_complete(UserCreatable *uc, Error **errp) } QTAILQ_INSERT_TAIL(&nf->netdev->filters, nf, next); + if (queues > 1) { + /* + * Store the properties of the filter except "type" property. + * When there's multiqueue, we will create a new filter object + * of the same type and same properties. this hashtable is used + * to set newly created object properties. + */ + proptable = g_hash_table_new_full(NULL, NULL, NULL, + proptb_free_val_func); + }I'm thinking whether or not duplicate all the properties in each netfilters is a good method. Maybe we can have a another ojbect with array of pointers to NetFilter objects embedded? Another question is whether or not we need to do this at this level. Maybe we can make the necessary Netfilter multiqueue aware. E.g let buffer filter to have multiqueue also? Then you may only need a single timer?Sorry I don't get it at first. I also thought about make the buffer filter to have multiqueue, but there comes problem, how to distinguish which queue we should go in when receive the packet, we need to add a mechanism to distinguish which queue belongs to which net client's queue, that will be more complex, while current multiqueue implementation of net clients is multiple net clients with the same name, current solution is the simplest solution I can think of...I'm not sure I get this. But there's a queue_index filed in each NetClientState which may help in this case.Ah, I see, thank you. There's another reason I do this in filter abstract layer is that the concrete filter implementation do not need to deal with the multiqueue, will simplify the filter implement a lot, otherwise, every filter need to implement it's own multiqueue support.Probably not, just pointing all queues to a single netfilter object may be sufficient (e.g for dump). And it's much easier for some kind of filter (e.g traffic throttling) if it was multiqueue aware.
I see, will think about doing this other way, thank you!
.
-- Thanks, Yang.
[Prev in Thread] | Current Thread | [Next in Thread] |