netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] geneve: always fill CSUM6_RX configuration
@ 2017-05-18 19:59 Eric Garver
  2017-05-20  1:57 ` Pravin Shelar
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Garver @ 2017-05-18 19:59 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar

CSMU6_RX is relevant for collect_metadata as well. As such leave it
outside of the dev's IPv4/IPv6 checks.

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

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index dec5d563ab19..f557d1dc3f9b 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1311,13 +1311,13 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
 		if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
 			       !(info->key.tun_flags & TUNNEL_CSUM)))
 			goto nla_put_failure;
-
-		if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
-			       !geneve->use_udp6_rx_checksums))
-			goto nla_put_failure;
 #endif
 	}
 
+	if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
+		       !geneve->use_udp6_rx_checksums))
+		goto nla_put_failure;
+
 	if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) ||
 	    nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||
 	    nla_put_be32(skb, IFLA_GENEVE_LABEL, info->key.label))
-- 
2.12.0

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

* Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration
  2017-05-18 19:59 [PATCH net-next] geneve: always fill CSUM6_RX configuration Eric Garver
@ 2017-05-20  1:57 ` Pravin Shelar
  2017-05-20 13:35   ` Eric Garver
  0 siblings, 1 reply; 5+ messages in thread
From: Pravin Shelar @ 2017-05-20  1:57 UTC (permalink / raw)
  To: Eric Garver; +Cc: Linux Kernel Network Developers

On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e@erig.me> wrote:
> CSMU6_RX is relevant for collect_metadata as well. As such leave it
> outside of the dev's IPv4/IPv6 checks.
>
Can you explain it bit? is this flag used with ipv4 tunnels?

> Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> Signed-off-by: Eric Garver <e@erig.me>
> ---
>  drivers/net/geneve.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
> index dec5d563ab19..f557d1dc3f9b 100644
> --- a/drivers/net/geneve.c
> +++ b/drivers/net/geneve.c
> @@ -1311,13 +1311,13 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
>                 if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
>                                !(info->key.tun_flags & TUNNEL_CSUM)))
>                         goto nla_put_failure;
> -
> -               if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
> -                              !geneve->use_udp6_rx_checksums))
> -                       goto nla_put_failure;
>  #endif
>         }
>
> +       if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
> +                      !geneve->use_udp6_rx_checksums))
> +               goto nla_put_failure;
> +
>         if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) ||
>             nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||
>             nla_put_be32(skb, IFLA_GENEVE_LABEL, info->key.label))
> --
> 2.12.0
>

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

* Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration
  2017-05-20  1:57 ` Pravin Shelar
@ 2017-05-20 13:35   ` Eric Garver
  2017-05-21  4:56     ` Pravin Shelar
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Garver @ 2017-05-20 13:35 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: Linux Kernel Network Developers

On Fri, May 19, 2017 at 06:57:46PM -0700, Pravin Shelar wrote:
> On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e@erig.me> wrote:
> > CSMU6_RX is relevant for collect_metadata as well. As such leave it
> > outside of the dev's IPv4/IPv6 checks.
> >
> Can you explain it bit? is this flag used with ipv4 tunnels?

It's used with collect_metadata as both ipv4 and ipv6 sockets will be
created.

openvswitch recently gained support for creating tunnels with rtnetlink.
It sets COLLECT_METADATA and CSUM6_RX. After create, it does a get to
verify the device got created with all the requested configuration. The
verify was failing due to CSUM6_RX not being returned.

Since ip_tunnel_info_af() defaults to returning AF_INET, we fall into
the IPv4 case and CSUM6_RX is never returned. Other relevant areas that
call ip_tunnel_info_af() do so using the info from the skb, not the
geneve_dev.

I hope that made it clear. Thanks for taking a look.

Eric.

> > Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> > Signed-off-by: Eric Garver <e@erig.me>
> > ---
> >  drivers/net/geneve.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
> > index dec5d563ab19..f557d1dc3f9b 100644
> > --- a/drivers/net/geneve.c
> > +++ b/drivers/net/geneve.c
> > @@ -1311,13 +1311,13 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
> >                 if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
> >                                !(info->key.tun_flags & TUNNEL_CSUM)))
> >                         goto nla_put_failure;
> > -
> > -               if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
> > -                              !geneve->use_udp6_rx_checksums))
> > -                       goto nla_put_failure;
> >  #endif
> >         }
> >
> > +       if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
> > +                      !geneve->use_udp6_rx_checksums))
> > +               goto nla_put_failure;
> > +
> >         if (nla_put_u8(skb, IFLA_GENEVE_TTL, info->key.ttl) ||
> >             nla_put_u8(skb, IFLA_GENEVE_TOS, info->key.tos) ||
> >             nla_put_be32(skb, IFLA_GENEVE_LABEL, info->key.label))
> > --
> > 2.12.0
> >

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

* Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration
  2017-05-20 13:35   ` Eric Garver
@ 2017-05-21  4:56     ` Pravin Shelar
  2017-05-22 16:50       ` Eric Garver
  0 siblings, 1 reply; 5+ messages in thread
From: Pravin Shelar @ 2017-05-21  4:56 UTC (permalink / raw)
  To: Eric Garver, Pravin Shelar, Linux Kernel Network Developers

On Sat, May 20, 2017 at 6:35 AM, Eric Garver <e@erig.me> wrote:
> On Fri, May 19, 2017 at 06:57:46PM -0700, Pravin Shelar wrote:
>> On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e@erig.me> wrote:
>> > CSMU6_RX is relevant for collect_metadata as well. As such leave it
>> > outside of the dev's IPv4/IPv6 checks.
>> >
>> Can you explain it bit? is this flag used with ipv4 tunnels?
>
> It's used with collect_metadata as both ipv4 and ipv6 sockets will be
> created.
>
> openvswitch recently gained support for creating tunnels with rtnetlink.
> It sets COLLECT_METADATA and CSUM6_RX. After create, it does a get to
> verify the device got created with all the requested configuration. The
> verify was failing due to CSUM6_RX not being returned.
>
> Since ip_tunnel_info_af() defaults to returning AF_INET, we fall into
> the IPv4 case and CSUM6_RX is never returned. Other relevant areas that
> call ip_tunnel_info_af() do so using the info from the skb, not the
> geneve_dev.
>
ok.
I think ip_tunnel_info_af() check is not right. it does not work in
case of collect_metadata.
Better fix would be check for genene->sock4 and genene->sock6 and
build the netlink skb accordingly.

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

* Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration
  2017-05-21  4:56     ` Pravin Shelar
@ 2017-05-22 16:50       ` Eric Garver
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Garver @ 2017-05-22 16:50 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: Linux Kernel Network Developers

On Sat, May 20, 2017 at 09:56:44PM -0700, Pravin Shelar wrote:
> On Sat, May 20, 2017 at 6:35 AM, Eric Garver <e@erig.me> wrote:
> > On Fri, May 19, 2017 at 06:57:46PM -0700, Pravin Shelar wrote:
> >> On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e@erig.me> wrote:
> >> > CSMU6_RX is relevant for collect_metadata as well. As such leave it
> >> > outside of the dev's IPv4/IPv6 checks.
> >> >
> >> Can you explain it bit? is this flag used with ipv4 tunnels?
> >
> > It's used with collect_metadata as both ipv4 and ipv6 sockets will be
> > created.
> >
> > openvswitch recently gained support for creating tunnels with rtnetlink.
> > It sets COLLECT_METADATA and CSUM6_RX. After create, it does a get to
> > verify the device got created with all the requested configuration. The
> > verify was failing due to CSUM6_RX not being returned.
> >
> > Since ip_tunnel_info_af() defaults to returning AF_INET, we fall into
> > the IPv4 case and CSUM6_RX is never returned. Other relevant areas that
> > call ip_tunnel_info_af() do so using the info from the skb, not the
> > geneve_dev.
> >
> ok.
> I think ip_tunnel_info_af() check is not right. it does not work in
> case of collect_metadata.
> Better fix would be check for genene->sock4 and genene->sock6 and
> build the netlink skb accordingly.

Agreed. That's a better idea.

Lets drop this patch. I'll work on one to look at the actual sockets
instead.

Thanks Pravin.

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18 19:59 [PATCH net-next] geneve: always fill CSUM6_RX configuration Eric Garver
2017-05-20  1:57 ` Pravin Shelar
2017-05-20 13:35   ` Eric Garver
2017-05-21  4:56     ` Pravin Shelar
2017-05-22 16:50       ` Eric Garver

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