From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, wenxu@ucloud.cn,
jiri@resnulli.us, saeedm@mellanox.com, gerlitz.or@gmail.com,
paulb@mellanox.com, netdev@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority
Date: Tue, 30 Jul 2019 16:08:04 -0300 [thread overview]
Message-ID: <20190730190804.GQ6204@localhost.localdomain> (raw)
In-Reply-To: <20190730105417.14538-1-pablo@netfilter.org>
On Tue, Jul 30, 2019 at 12:54:17PM +0200, Pablo Neira Ayuso wrote:
> This patch maps basechain netfilter priorities from -8192 to 8191 to
> hardware priority 0xC000 + 1. tcf_auto_prio() uses 0xC000 if the user
> specifies no priority, then it subtract 1 for each new tcf_proto object.
> This patch uses the hardware priority range from 0xC000 to 0xFFFF for
> netfilter.
This makes more sense, thanks Pablo.
Nit below.
> +u16 nft_chain_offload_priority(struct nft_base_chain *basechain)
> +{
> + u16 prio;
> +
> + if (basechain->ops.priority < NFT_BASECHAIN_OFFLOAD_PRIO_MIN ||
> + basechain->ops.priority > NFT_BASECHAIN_OFFLOAD_PRIO_MAX)
> + return 0;
> +
> + /* map netfilter chain priority to hardware priority. */
> + prio = basechain->ops.priority +
> + NFT_BASECHAIN_OFFLOAD_PRIO_MAX +
> + NFT_BASECHAIN_OFFLOAD_HW_PRIO_BASE;
Weird indent here.
> +
> + return prio;
> +}
next prev parent reply other threads:[~2019-07-30 19:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 10:54 [PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority Pablo Neira Ayuso
2019-07-30 11:18 ` Pablo Neira Ayuso
2019-07-30 11:19 ` Pablo Neira Ayuso
2019-07-30 19:08 ` Marcelo Ricardo Leitner [this message]
2019-07-31 0:21 ` Jakub Kicinski
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=20190730190804.GQ6204@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=gerlitz.or@gmail.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=paulb@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=wenxu@ucloud.cn \
/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).