From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@163.com>
Cc: fw@strlen.de, netfilter-devel@vger.kernel.org,
Liping Zhang <liping.zhang@spreadtrum.com>
Subject: Re: [PATCH nf-next V2] netfilter: nft_queue: add _SREG_QNUM attr to select the queue number
Date: Thu, 22 Sep 2016 17:11:07 +0200 [thread overview]
Message-ID: <20160922151107.GA17587@salvia> (raw)
In-Reply-To: <1473867706-50854-1-git-send-email-zlpnobody@163.com>
On Wed, Sep 14, 2016 at 11:41:46PM +0800, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> Currently, the user can specify the queue numbers by _QUEUE_NUM and
> _QUEUE_TOTAL attributes, this is enough in most situations.
>
> But acctually, it is not very flexible, for example:
> tcp dport 80 mapped to queue0
> tcp dport 81 mapped to queue1
> tcp dport 82 mapped to queue2
> In order to do this thing, we must add 3 nft rules, and more
> mapping meant more rules ...
>
> So take one register to select the queue number, then we can add one
> simple rule to mapping queues, maybe like this:
> queue num tcp dport map { 80:0, 81:1, 82:2 ... }
>
> Florian Westphal also proposed wider usage scenarios:
> queue num jhash ip saddr . ip daddr mod ...
> queue num meta cpu ...
> queue num meta mark ...
>
> The last point is how to load a queue number from sreg, although we can
> use *(u16*)®s->data[reg] to load the queue number, just like nat expr
> to load its l4port do.
>
> But we will cooperate with hash expr, meta cpu, meta mark expr and so on.
> They all store the result to u32 type, so cast it to u16 pointer and
> dereference it will generate wrong result in the big endian system.
>
> So just keep it simple, we treat queue number as u32 type, although u16
> type is already enough.
Applied, thanks Liping.
prev parent reply other threads:[~2016-09-22 15:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 15:41 [PATCH nf-next V2] netfilter: nft_queue: add _SREG_QNUM attr to select the queue number Liping Zhang
2016-09-22 15:11 ` Pablo Neira Ayuso [this message]
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=20160922151107.GA17587@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=liping.zhang@spreadtrum.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=zlpnobody@163.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 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.