netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] geneve: fix fill_info when using collect_metadata
@ 2017-05-23 22:37 Eric Garver
  2017-05-24 19:20 ` Pravin Shelar
  2017-05-25 16:51 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Garver @ 2017-05-23 22:37 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar

Since 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") fill_info
does not return UDP_ZERO_CSUM6_RX when using COLLECT_METADATA. This is
because it uses ip_tunnel_info_af() with the device level info, which is
not valid for COLLECT_METADATA.

Fix by checking for the presence of the actual sockets.

Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
Signed-off-by: Eric Garver <e@erig.me>
---
 drivers/net/geneve.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index dec5d563ab19..959fd12d2e67 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1293,7 +1293,7 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
 	if (nla_put_u32(skb, IFLA_GENEVE_ID, vni))
 		goto nla_put_failure;
 
-	if (ip_tunnel_info_af(info) == AF_INET) {
+	if (rtnl_dereference(geneve->sock4)) {
 		if (nla_put_in_addr(skb, IFLA_GENEVE_REMOTE,
 				    info->key.u.ipv4.dst))
 			goto nla_put_failure;
@@ -1302,8 +1302,10 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
 			       !!(info->key.tun_flags & TUNNEL_CSUM)))
 			goto nla_put_failure;
 
+	}
+
 #if IS_ENABLED(CONFIG_IPV6)
-	} else {
+	if (rtnl_dereference(geneve->sock6)) {
 		if (nla_put_in6_addr(skb, IFLA_GENEVE_REMOTE6,
 				     &info->key.u.ipv6.dst))
 			goto nla_put_failure;
@@ -1315,8 +1317,8 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
 		if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
 			       !geneve->use_udp6_rx_checksums))
 			goto nla_put_failure;
-#endif
 	}
+#endif
 
 	if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) ||
 	    nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||
-- 
2.12.0

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

* Re: [PATCH net-next] geneve: fix fill_info when using collect_metadata
  2017-05-23 22:37 [PATCH net-next] geneve: fix fill_info when using collect_metadata Eric Garver
@ 2017-05-24 19:20 ` Pravin Shelar
  2017-05-24 19:58   ` Eric Garver
  2017-05-25 16:51 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Pravin Shelar @ 2017-05-24 19:20 UTC (permalink / raw)
  To: Eric Garver; +Cc: Linux Kernel Network Developers

On Tue, May 23, 2017 at 3:37 PM, Eric Garver <e@erig.me> wrote:
> Since 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") fill_info
> does not return UDP_ZERO_CSUM6_RX when using COLLECT_METADATA. This is
> because it uses ip_tunnel_info_af() with the device level info, which is
> not valid for COLLECT_METADATA.
>
> Fix by checking for the presence of the actual sockets.
>
> Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> Signed-off-by: Eric Garver <e@erig.me>
Thanks for the patch.

Acked-by: Pravin B Shelar <pshelar@ovn.org>


I noticed that the MTU and encal_len calculation in geneve_configure()
also needs to be fixed for collect metadata case. Can you send patch
to fix it?

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

* Re: [PATCH net-next] geneve: fix fill_info when using collect_metadata
  2017-05-24 19:20 ` Pravin Shelar
@ 2017-05-24 19:58   ` Eric Garver
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Garver @ 2017-05-24 19:58 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: Linux Kernel Network Developers

On Wed, May 24, 2017 at 12:20:36PM -0700, Pravin Shelar wrote:
> On Tue, May 23, 2017 at 3:37 PM, Eric Garver <e@erig.me> wrote:
> > Since 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") fill_info
> > does not return UDP_ZERO_CSUM6_RX when using COLLECT_METADATA. This is
> > because it uses ip_tunnel_info_af() with the device level info, which is
> > not valid for COLLECT_METADATA.
> >
> > Fix by checking for the presence of the actual sockets.
> >
> > Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> > Signed-off-by: Eric Garver <e@erig.me>
> Thanks for the patch.
> 
> Acked-by: Pravin B Shelar <pshelar@ovn.org>
> 
> 
> I noticed that the MTU and encal_len calculation in geneve_configure()
> also needs to be fixed for collect metadata case. Can you send patch
> to fix it?

Ah, yes. I'll take a look at those as well.

Eric.

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

* Re: [PATCH net-next] geneve: fix fill_info when using collect_metadata
  2017-05-23 22:37 [PATCH net-next] geneve: fix fill_info when using collect_metadata Eric Garver
  2017-05-24 19:20 ` Pravin Shelar
@ 2017-05-25 16:51 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-25 16:51 UTC (permalink / raw)
  To: e; +Cc: netdev, pshelar

From: Eric Garver <e@erig.me>
Date: Tue, 23 May 2017 18:37:27 -0400

> Since 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") fill_info
> does not return UDP_ZERO_CSUM6_RX when using COLLECT_METADATA. This is
> because it uses ip_tunnel_info_af() with the device level info, which is
> not valid for COLLECT_METADATA.
> 
> Fix by checking for the presence of the actual sockets.
> 
> Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> Signed-off-by: Eric Garver <e@erig.me>

Please target bug fixes at 'net' not 'net-next' unless the bug only
exists in 'net-next'.

I've applied this to 'net' and queued it up for -stable.

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

end of thread, other threads:[~2017-05-25 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 22:37 [PATCH net-next] geneve: fix fill_info when using collect_metadata Eric Garver
2017-05-24 19:20 ` Pravin Shelar
2017-05-24 19:58   ` Eric Garver
2017-05-25 16:51 ` David Miller

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