diff mbox series

[ovs-dev,V3,20/40] datapath: Use correct tunnel receive for ip6gre

Message ID 1526690988-29912-21-git-send-email-gvrose8192@gmail.com
State Accepted
Headers show
Series Add ERSPAN support | expand

Commit Message

Gregory Rose May 19, 2018, 12:49 a.m. UTC
During backports of ip6 gre I used ovs_ip_tunnel_rcv() for the
ip6gre_rcv() function but that is wrong because it processes ipv4
tunnels.  Use the correct backported ip6 tunnel receive in ip6
tunnel.c ip6_tnl_rcv().

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip6_gre.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

William Tu May 21, 2018, 10:48 p.m. UTC | #1
On Fri, May 18, 2018 at 5:49 PM, Greg Rose <gvrose8192@gmail.com> wrote:
> During backports of ip6 gre I used ovs_ip_tunnel_rcv() for the
> ip6gre_rcv() function but that is wrong because it processes ipv4
> tunnels.  Use the correct backported ip6 tunnel receive in ip6
> tunnel.c ip6_tnl_rcv().
>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---

LGTM
Acked-by: William Tu <u9012063@gmail.com>

>  datapath/linux/compat/ip6_gre.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
> index 1e2f46a..085d04f 100644
> --- a/datapath/linux/compat/ip6_gre.c
> +++ b/datapath/linux/compat/ip6_gre.c
> @@ -603,8 +603,7 @@ static int ip6gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
>
>                 }
>
> -               skb_reset_mac_header(skb);
> -               ovs_ip_tunnel_rcv(tunnel->dev, skb, tun_dst);
> +               ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, false);
>                 kfree(tun_dst);

nit: I notice that we are freeing tun_dst here, instead of
freeing it in __ip6_tnl_rcv. Looks OK to me, although it's
different from the upstream kernel version,

>                 return PACKET_RCVD;
>         }
> --
> 1.8.3.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Gregory Rose May 21, 2018, 11:04 p.m. UTC | #2
On 5/21/2018 3:48 PM, William Tu wrote:
> On Fri, May 18, 2018 at 5:49 PM, Greg Rose <gvrose8192@gmail.com> wrote:
>> During backports of ip6 gre I used ovs_ip_tunnel_rcv() for the
>> ip6gre_rcv() function but that is wrong because it processes ipv4
>> tunnels.  Use the correct backported ip6 tunnel receive in ip6
>> tunnel.c ip6_tnl_rcv().
>>
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>> ---
> LGTM
> Acked-by: William Tu <u9012063@gmail.com>
>
>>   datapath/linux/compat/ip6_gre.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
>> index 1e2f46a..085d04f 100644
>> --- a/datapath/linux/compat/ip6_gre.c
>> +++ b/datapath/linux/compat/ip6_gre.c
>> @@ -603,8 +603,7 @@ static int ip6gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
>>
>>                  }
>>
>> -               skb_reset_mac_header(skb);
>> -               ovs_ip_tunnel_rcv(tunnel->dev, skb, tun_dst);
>> +               ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, false);
>>                  kfree(tun_dst);
> nit: I notice that we are freeing tun_dst here, instead of
> freeing it in __ip6_tnl_rcv. Looks OK to me, although it's
> different from the upstream kernel version,

Yes, I did some work on the ip6_tnl_rcv() function in 
../compat/ip6_tunnel.c to keep it consistent with the
way the ipv4 tunnel code works.  It could use some work on making it 
more adhere more closely to upstream.

Thanks,

- Greg

>
>>                  return PACKET_RCVD;
>>          }
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index 1e2f46a..085d04f 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -603,8 +603,7 @@  static int ip6gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
 
 		}
 
-		skb_reset_mac_header(skb);
-		ovs_ip_tunnel_rcv(tunnel->dev, skb, tun_dst);
+		ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, false);
 		kfree(tun_dst);
 		return PACKET_RCVD;
 	}