netfilter: remove an atomic bit operation
Subsystems (3)
PATCH 1/1 netfilter: remove an atomic bit operation
As this ct won't be seen by the others, we don't need to set the IPS_CONFIRMED_BIT in atomic way.
--- net/netfilter/nf_conntrack_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_core.c +1 -1
@@ -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
Tim Gardner
NAKQuoted 21 lines · Changli Gao
As this ct won't be seen by the others, we don't need to set the
IPS_CONFIRMED_BITin atomic way.Signed-off-by Changli Gao<[email protected]>--- net/netfilter/nf_conntrack_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/netfilter/nf_conntrack_core.c +1
-2@@ -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 --
Quoted 3 lines
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
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
Signature · 1 line
Tim Gardner [email protected]
Quoted 27 lines · Tim Gardner
Quoted 12 lines · Changli Gao
As this ct won't be seen by the others, we don't need to set the
IPS_CONFIRMED_BITin atomic way.Signed-off-by Changli Gao<[email protected]>--- net/netfilter/nf_conntrack_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/netfilter/nf_conntrack_core.c +0
-0net/netfilter/nf_conntrack_core.c __nf_conntrack_confirm(struct sk_buff *skb)
Quoted 9 lines
net/netfilter/nf_conntrack_core.c +1
-2@@ -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 -- 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.
Quoted 4 lines
I think you have to use
IPS_CONFIRMEDinstead, e.g.,ct->status |= IPS_CONFIRMED;
Or
__set_bit(IPS_CONFIRMED_BIT, &ct->status);
set_bit() is atomic, while __set_bit() is not
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Eric Dumazet
Quoted 8 lines · Tim Gardner
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_CONFIRMEDinstead, e.g.,
ct->status|=IPS_CONFIRMED;
Quoted 7 lines
Or
__set_bit(IPS_CONFIRMED_BIT,
&ct->status);
set_bit()is atomic, while__set_bit()is not
Oh, you are right. Thanks. My a previous patch accepted by Patrick has the same problem.
Signature · 6 lines
Regards, Changli Gao([email protected]) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html