[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CE7F160.9050107@canonical.com>
Date: Sat, 20 Nov 2010 09:03:44 -0700
From: Tim Gardner <tim.gardner@...onical.com>
To: Changli Gao <xiaosuo@...il.com>
CC: Patrick McHardy <kaber@...sh.net>,
"David S. Miller" <davem@...emloft.net>,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] netfilter: remove an atomic bit operation
On 11/20/2010 12:55 AM, Changli Gao wrote:
> As this ct won't be seen by the others, we don't need to set the
> IPS_CONFIRMED_BIT in atomic way.
>
> Signed-off-by: Changli Gao<xiaosuo@...il.com>
> ---
> net/netfilter/nf_conntrack_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> index 27a5ea6..c708248 100644
> --- a/net/netfilter/nf_conntrack_core.c
> +++ b/net/netfilter/nf_conntrack_core.c
> @@ -486,7 +486,7 @@ __nf_conntrack_confirm(struct sk_buff *skb)
> ct->timeout.expires += jiffies;
> add_timer(&ct->timeout);
> atomic_inc(&ct->ct_general.use);
> - set_bit(IPS_CONFIRMED_BIT,&ct->status);
> + ct->status |= IPS_CONFIRMED_BIT;
>
> /* Since the lookup is lockless, hash insertion must be done after
> * starting the timer and setting the CONFIRMED bit. The RCU barriers
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
NAK, set_bit() takes a bit number, not a mask. That is, assuming you can
get away with a non-atomic operation on this field. I'll defer to
Patrick on that.
I think you have to use IPS_CONFIRMED instead, e.g.,
ct->status |= IPS_CONFIRMED;
rtg
--
Tim Gardner tim.gardner@...onical.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists