* [PATCH nft] src: evaluate: Show error for fanout without balance
@ 2016-04-07 9:36 Shivani Bhardwaj
2016-04-07 17:13 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Shivani Bhardwaj @ 2016-04-07 9:36 UTC (permalink / raw)
To: netfilter-devel
The idea of fanout option is to improve the performance by indexing CPU
ID to map packets to the queues. This is used for load balancing.
Fanout option is not required when there is a single queue specified.
According to iptables, queue balance should be specified in order to use
fanout, following that, throw an error in nftables if the range of
queues for load balancing is not specified with the fanout option.
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
src/evaluate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/evaluate.c b/src/evaluate.c
index 473f014..f3fe13d 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2000,6 +2000,11 @@ static int stmt_evaluate_queue(struct eval_ctx *ctx, struct stmt *stmt)
if (!expr_is_constant(stmt->queue.queue))
return expr_error(ctx->msgs, stmt->queue.queue,
"queue number is not constant");
+ if (stmt->queue.queue->ops->type != EXPR_RANGE &&
+ (stmt->queue.flags & NFT_QUEUE_FLAG_CPU_FANOUT))
+ return expr_error(ctx->msgs, stmt->queue.queue,
+ "fanout requires queue num range"
+ " to be specified");
}
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nft] src: evaluate: Show error for fanout without balance
2016-04-07 9:36 [PATCH nft] src: evaluate: Show error for fanout without balance Shivani Bhardwaj
@ 2016-04-07 17:13 ` Pablo Neira Ayuso
2016-04-07 17:18 ` Shivani Bhardwaj
0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2016-04-07 17:13 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: netfilter-devel
On Thu, Apr 07, 2016 at 03:06:40PM +0530, Shivani Bhardwaj wrote:
> The idea of fanout option is to improve the performance by indexing CPU
> ID to map packets to the queues. This is used for load balancing.
> Fanout option is not required when there is a single queue specified.
>
> According to iptables, queue balance should be specified in order to use
> fanout, following that, throw an error in nftables if the range of
> queues for load balancing is not specified with the fanout option.
Curious, how does iptables behave when you pass fanout and a single
queue?
Could you also include how the nft error output looks like after your
patch in your description?
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nft] src: evaluate: Show error for fanout without balance
2016-04-07 17:13 ` Pablo Neira Ayuso
@ 2016-04-07 17:18 ` Shivani Bhardwaj
0 siblings, 0 replies; 3+ messages in thread
From: Shivani Bhardwaj @ 2016-04-07 17:18 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Development Mailing list
On Thu, Apr 7, 2016 at 10:43 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Thu, Apr 07, 2016 at 03:06:40PM +0530, Shivani Bhardwaj wrote:
>> The idea of fanout option is to improve the performance by indexing CPU
>> ID to map packets to the queues. This is used for load balancing.
>> Fanout option is not required when there is a single queue specified.
>>
>> According to iptables, queue balance should be specified in order to use
>> fanout, following that, throw an error in nftables if the range of
>> queues for load balancing is not specified with the fanout option.
>
> Curious, how does iptables behave when you pass fanout and a single
> queue?
>
It throws an error:
$ sudo iptables -A FORWARD -j NFQUEUE --queue-num 0 --queue-cpu-fanout
iptables v1.6.0: NFQUEUE: option "--queue-cpu-fanout" also requires
"--queue-balance".
Try `iptables -h' or 'iptables --help' for more information.
Since, queue-balance is done as queue num with a range in nftables, I
thought it should follow the same routine as iptables.
> Could you also include how the nft error output looks like after your
> patch in your description?
>
Yes I'll do that.
Thanks.
> Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-07 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 9:36 [PATCH nft] src: evaluate: Show error for fanout without balance Shivani Bhardwaj
2016-04-07 17:13 ` Pablo Neira Ayuso
2016-04-07 17:18 ` Shivani Bhardwaj
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).