Netdev List
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: wenxu@ucloud.cn
Cc: paulb@mellanox.com, netdev@vger.kernel.org
Subject: Re: [PATCH v2] net/sched: act_ct: add nat mangle action only for NAT-conntrack
Date: Sat, 30 May 2020 09:21:05 -0300	[thread overview]
Message-ID: <20200530122105.GM2491@localhost.localdomain> (raw)
In-Reply-To: <1590818091-3548-1-git-send-email-wenxu@ucloud.cn>

On Sat, May 30, 2020 at 01:54:51PM +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> Currently add nat mangle action with comparing invert and ori tuple.
                                                Nit, "orig" ---^

> It is better to check IPS_NAT_MASK flags first to avoid non necessary
> memcmp for non-NAT conntrack.
> 
> Signed-off-by: wenxu <wenxu@ucloud.cn>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  net/sched/act_ct.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
> index 1a76639..2057735 100644
> --- a/net/sched/act_ct.c
> +++ b/net/sched/act_ct.c
> @@ -199,6 +199,9 @@ static int tcf_ct_flow_table_add_action_nat(struct net *net,
>  	const struct nf_conntrack_tuple *tuple = &ct->tuplehash[dir].tuple;
>  	struct nf_conntrack_tuple target;
>  
> +	if (!(ct->status & IPS_NAT_MASK))
> +		return 0;
> +
>  	nf_ct_invert_tuple(&target, &ct->tuplehash[!dir].tuple);
>  
>  	switch (tuple->src.l3num) {
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2020-05-30 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  5:54 [PATCH v2] net/sched: act_ct: add nat mangle action only for NAT-conntrack wenxu
2020-05-30 12:21 ` Marcelo Ricardo Leitner [this message]
2020-05-31  0:58 ` David Miller

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=20200530122105.GM2491@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulb@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