linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: openvswitch: Remove unnecessary skb_nfct()
@ 2021-05-08  2:27 Yejune Deng
  2021-05-10 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Yejune Deng @ 2021-05-08  2:27 UTC (permalink / raw)
  To: pshelar, davem; +Cc: netdev, linux-kernel, Yejune Deng

There is no need add 'if (skb_nfct(skb))' assignment, the
nf_conntrack_put() would check it.

Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
---
 net/openvswitch/conntrack.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index cadb6a2..1b5eae5 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -967,8 +967,7 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key,
 
 		/* Associate skb with specified zone. */
 		if (tmpl) {
-			if (skb_nfct(skb))
-				nf_conntrack_put(skb_nfct(skb));
+			nf_conntrack_put(skb_nfct(skb));
 			nf_conntrack_get(&tmpl->ct_general);
 			nf_ct_set(skb, tmpl, IP_CT_NEW);
 		}
@@ -1329,11 +1328,9 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb,
 
 int ovs_ct_clear(struct sk_buff *skb, struct sw_flow_key *key)
 {
-	if (skb_nfct(skb)) {
-		nf_conntrack_put(skb_nfct(skb));
-		nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
-		ovs_ct_fill_key(skb, key, false);
-	}
+	nf_conntrack_put(skb_nfct(skb));
+	nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
+	ovs_ct_fill_key(skb, key, false);
 
 	return 0;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: openvswitch: Remove unnecessary skb_nfct()
  2021-05-08  2:27 [PATCH] net: openvswitch: Remove unnecessary skb_nfct() Yejune Deng
@ 2021-05-10 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-10 21:20 UTC (permalink / raw)
  To: Yejune Deng; +Cc: pshelar, davem, netdev, linux-kernel, yejunedeng

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat,  8 May 2021 10:27:07 +0800 you wrote:
> There is no need add 'if (skb_nfct(skb))' assignment, the
> nf_conntrack_put() would check it.
> 
> Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
> ---
>  net/openvswitch/conntrack.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

Here is the summary with links:
  - net: openvswitch: Remove unnecessary skb_nfct()
    https://git.kernel.org/netdev/net-next/c/d2792e91de2b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-10 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  2:27 [PATCH] net: openvswitch: Remove unnecessary skb_nfct() Yejune Deng
2021-05-10 21:20 ` patchwork-bot+netdevbpf

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).