From: Pravin B Shelar <pshelar@ovn.org>
To: netdev@vger.kernel.org
Cc: Pravin B Shelar <pshelar@ovn.org>
Subject: [PATCH net-next 3/4] geneve: Remove redundant socket checks.
Date: Thu, 17 Nov 2016 23:10:28 -0800 [thread overview]
Message-ID: <1479453029-29619-4-git-send-email-pshelar@ovn.org> (raw)
In-Reply-To: <1479453029-29619-1-git-send-email-pshelar@ovn.org>
Geneve already has check for device socket in route
lookup function. So no need to check it in xmit
function.
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
---
drivers/net/geneve.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 9a4351c..8e6c659 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -785,14 +785,11 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct geneve_sock *gs4 = rcu_dereference(geneve->sock4);
const struct ip_tunnel_key *key = &info->key;
struct rtable *rt;
- int err = -EINVAL;
struct flowi4 fl4;
__u8 tos, ttl;
__be16 sport;
__be16 df;
-
- if (!gs4)
- return err;
+ int err;
rt = geneve_get_v4_rt(skb, dev, &fl4, info);
if (IS_ERR(rt))
@@ -828,13 +825,10 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
struct geneve_sock *gs6 = rcu_dereference(geneve->sock6);
const struct ip_tunnel_key *key = &info->key;
struct dst_entry *dst = NULL;
- int err = -EINVAL;
struct flowi6 fl6;
__u8 prio, ttl;
__be16 sport;
-
- if (!gs6)
- return err;
+ int err;
dst = geneve_get_v6_dst(skb, dev, &fl6, info);
if (IS_ERR(dst))
--
1.8.3.1
next prev parent reply other threads:[~2016-11-18 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 7:10 [PATCH net-next 0/4] geneve: Use LWT more effectively Pravin B Shelar
2016-11-18 7:10 ` [PATCH net-next 1/4] geneve: Unify LWT and netdev handling Pravin B Shelar
2016-11-18 8:40 ` kbuild test robot
2016-11-18 7:10 ` [PATCH net-next 2/4] geneve: Merge ipv4 and ipv6 geneve_build_skb() Pravin B Shelar
2016-11-18 7:10 ` Pravin B Shelar [this message]
2016-11-18 7:10 ` [PATCH net-next 4/4] geneve: Optimize geneve device lookup Pravin B Shelar
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=1479453029-29619-4-git-send-email-pshelar@ovn.org \
--to=pshelar@ovn.org \
--cc=netdev@vger.kernel.org \
/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