diff mbox series

[ovs-dev,V2,38/41] tunnel: add support for erspan and ip6erspan type.

Message ID 1526608674-12702-39-git-send-email-gvrose8192@gmail.com
State Superseded
Headers show
Series Add ERSPAN support | expand

Commit Message

Gregory Rose May 18, 2018, 1:57 a.m. UTC
From: William Tu <u9012063@gmail.com>

This patch adds support for erspan and ip6erspan.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 lib/odp-util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Gregory Rose May 18, 2018, 3:41 p.m. UTC | #1
On 5/17/2018 6:57 PM, Greg Rose wrote:
> From: William Tu <u9012063@gmail.com>
>
> This patch adds support for erspan and ip6erspan.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
>   lib/odp-util.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index 2109fac..d7b5bcd 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -2882,7 +2882,8 @@ tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key,
>           nl_msg_end_nested(a, vxlan_opts_ofs);
>       }
>       tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
> -    if (tun_key->erspan_ver) {
> +    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
> +        !strcmp(tnl_type, "ip6erspan")) {
>           struct erspan_metadata opts;
>   
>           opts.version = tun_key->erspan_ver;

Ben has reported issues with 'make check' and then I found that 'make 
check  kmod' was failing on every test.

Reverting this patch fixes things.  With 'make check' we reduce the 
error count from 79 to 7.  Interestingly, five of those seven are tunnel 
related:

796: tunnel - Mix Geneve/GRE options                 FAILED (tunnel.at:875)
797: tunnel_push_pop - erspan                        FAILED 
(tunnel-push-pop.at:69)
800: tunnel_push_pop - underlay bridge match         FAILED 
(tunnel-push-pop.at:562)
801: tunnel_push_pop_ipv6 - ip6erspan                FAILED 
(tunnel-push-pop-ipv6.at:56)
802: tunnel_push_pop_ipv6 - action                   FAILED 
(tunnel-push-pop-ipv6.at:296)

The other two failures I can repro on the master branch so they are not 
related to this patch series.

With 'make check kmod' there is only an occasional transient failure on 
one test "87: conntrack - DNAT load balancing ". And that one occurs on 
master as well.

I'm looking at that code but I'm unfamiliar with it and don't know why 
it would cause *every* check-kmod test to fail.  Let's see if we can get 
it fixed up today.

Thanks,

- Greg
Ben Pfaff May 18, 2018, 4:32 p.m. UTC | #2
On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
> The other two failures I can repro on the master branch so they are not
> related to this patch series.

What are the other two failures?  Are they reliable failures or due to
races?

Thanks,

Ben.
Gregory Rose May 18, 2018, 4:57 p.m. UTC | #3
On 5/18/2018 9:32 AM, Ben Pfaff wrote:
> On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
>> The other two failures I can repro on the master branch so they are not
>> related to this patch series.
> What are the other two failures?  Are they reliable failures or due to
> races?
>
> Thanks,
>
> Ben.

This one:

1229: ofproto-dpif - in place modification (vlan)     FAILED 
(ofproto-dpif.at:9009)

and this one:

2535: ovn -- ensure one gw controller restart in HA doesn't bounce the 
master FAILED (ovn.at:9059)

They seem pretty reliable over a few runs.  I'd have to dig into them in 
order to see what the failure cause is and I'm pretty limited on time 
right now.  It Certainly Needs to Be Looked Into.

In fact, I just noticed that Darrell has posted a proposed fix for 1229.

Thanks,

- Greg
William Tu May 18, 2018, 4:59 p.m. UTC | #4
On Fri, May 18, 2018 at 8:41 AM, Gregory Rose <gvrose8192@gmail.com> wrote:
> On 5/17/2018 6:57 PM, Greg Rose wrote:
>>
>> From: William Tu <u9012063@gmail.com>
>>
>> This patch adds support for erspan and ip6erspan.
>>
>> Signed-off-by: William Tu <u9012063@gmail.com>
>> ---
>>   lib/odp-util.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>> index 2109fac..d7b5bcd 100644
>> --- a/lib/odp-util.c
>> +++ b/lib/odp-util.c
>> @@ -2882,7 +2882,8 @@ tun_key_to_attr(struct ofpbuf *a, const struct
>> flow_tnl *tun_key,
>>           nl_msg_end_nested(a, vxlan_opts_ofs);
>>       }
>>       tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>> -    if (tun_key->erspan_ver) {
>> +    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>> +        !strcmp(tnl_type, "ip6erspan")) {
>>           struct erspan_metadata opts;
>>             opts.version = tun_key->erspan_ver;
>
>
> Ben has reported issues with 'make check' and then I found that 'make check
> kmod' was failing on every test.
>
> Reverting this patch fixes things.  With 'make check' we reduce the error
> count from 79 to 7.  Interestingly, five of those seven are tunnel related:
>
> 796: tunnel - Mix Geneve/GRE options                 FAILED (tunnel.at:875)
Thanks, the above should be fixed by

diff --git a/lib/odp-util.c b/lib/odp-util.c
index acc158682840..c2b80c1b62c1 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2884,7 +2884,11 @@ tun_key_to_attr(struct ofpbuf *a, const struct
flow_tnl *tun_key,
                        (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id));
         nl_msg_end_nested(a, vxlan_opts_ofs);
     }
-    tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
+
+    if (!tnl_type || !strcmp(tnl_type, "geneve")) {
+        tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
+    }
+
     if (!tnl_type || !strcmp(tnl_type, "erspan") ||
         !strcmp(tnl_type, "ip6erspan")) {
         struct erspan_metadata opts;

I guess this is due to conflict between the backport and master, about
the commit
commit db535b0d3e26aeac42a0a2e0e2f791215de3640c
Author: William Tu <u9012063@gmail.com>
Date:   Thu May 10 23:35:51 2018 -0700

    tunnel: make tun_key_to_attr aware of tunnel type.

I'm looking into the below failed cases.


> 797: tunnel_push_pop - erspan                        FAILED
> (tunnel-push-pop.at:69)
> 800: tunnel_push_pop - underlay bridge match         FAILED
> (tunnel-push-pop.at:562)
> 801: tunnel_push_pop_ipv6 - ip6erspan                FAILED
> (tunnel-push-pop-ipv6.at:56)
> 802: tunnel_push_pop_ipv6 - action                   FAILED
> (tunnel-push-pop-ipv6.at:296)
>

Thanks,
William
Darrell Ball May 18, 2018, 5:15 p.m. UTC | #5
On 5/18/18, 9:58 AM, "ovs-dev-bounces@openvswitch.org on behalf of Gregory Rose" <ovs-dev-bounces@openvswitch.org on behalf of gvrose8192@gmail.com> wrote:

    On 5/18/2018 9:32 AM, Ben Pfaff wrote:
    > On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
    >> The other two failures I can repro on the master branch so they are not
    >> related to this patch series.
    > What are the other two failures?  Are they reliable failures or due to
    > races?
    >
    > Thanks,
    >
    > Ben.
    
    This one:
    
    1229: ofproto-dpif - in place modification (vlan)     FAILED 
    (ofproto-dpif.at:9009)
    
    and this one:
    
    2535: ovn -- ensure one gw controller restart in HA doesn't bounce the 
    master FAILED (ovn.at:9059)
    
    They seem pretty reliable over a few runs.  I'd have to dig into them in 
    order to see what the failure cause is and I'm pretty limited on time 
    right now.  It Certainly Needs to Be Looked Into.
    
    In fact, I just noticed that Darrell has posted a proposed fix for 1229.

Thanks Greg
Would you mind giving the below patch a check in your environment?
https://patchwork.ozlabs.org/patch/916469/

    
    Thanks,
    
    - Greg
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=P3qys_VoPe-I_rPLCBRrQOhmAsb6biA6e47a2J4wSDs&s=qnlA8lzmYvUAZfBAMZh4UkVTB1OIP3LxVFBygnsiZHU&e=
Darrell Ball May 18, 2018, 5:15 p.m. UTC | #6
On Fri, May 18, 2018 at 9:57 AM, Gregory Rose <gvrose8192@gmail.com> wrote:

> On 5/18/2018 9:32 AM, Ben Pfaff wrote:
>
>> On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
>>
>>> The other two failures I can repro on the master branch so they are not
>>> related to this patch series.
>>>
>> What are the other two failures?  Are they reliable failures or due to
>> races?
>>
>> Thanks,
>>
>> Ben.
>>
>
> This one:
>
> 1229: ofproto-dpif - in place modification (vlan)     FAILED (
> ofproto-dpif.at:9009)
>
> and this one:
>
> 2535: ovn -- ensure one gw controller restart in HA doesn't bounce the
> master FAILED (ovn.at:9059)
>
> They seem pretty reliable over a few runs.  I'd have to dig into them in
> order to see what the failure cause is and I'm pretty limited on time right
> now.  It Certainly Needs to Be Looked Into.
>
> In fact, I just noticed that Darrell has posted a proposed fix for 1229.
>


Thanks Greg

Would you mind giving the patch a check in your environment ?

https://patchwork.ozlabs.org/patch/916469/





>
> Thanks,
>
> - Greg
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Gregory Rose May 18, 2018, 5:26 p.m. UTC | #7
On 5/18/2018 10:15 AM, Darrell Ball wrote:
>
> On 5/18/18, 9:58 AM, "ovs-dev-bounces@openvswitch.org on behalf of Gregory Rose" <ovs-dev-bounces@openvswitch.org on behalf of gvrose8192@gmail.com> wrote:
>
>      On 5/18/2018 9:32 AM, Ben Pfaff wrote:
>      > On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
>      >> The other two failures I can repro on the master branch so they are not
>      >> related to this patch series.
>      > What are the other two failures?  Are they reliable failures or due to
>      > races?
>      >
>      > Thanks,
>      >
>      > Ben.
>      
>      This one:
>      
>      1229: ofproto-dpif - in place modification (vlan)     FAILED
>      (ofproto-dpif.at:9009)
>      
>      and this one:
>      
>      2535: ovn -- ensure one gw controller restart in HA doesn't bounce the
>      master FAILED (ovn.at:9059)
>      
>      They seem pretty reliable over a few runs.  I'd have to dig into them in
>      order to see what the failure cause is and I'm pretty limited on time
>      right now.  It Certainly Needs to Be Looked Into.
>      
>      In fact, I just noticed that Darrell has posted a proposed fix for 1229.
>
> Thanks Greg
> Would you mind giving the below patch a check in your environment?
> https://patchwork.ozlabs.org/patch/916469/
>
>      
>      Thanks,
>      
>      - Greg
>      _______________________________________________
>      dev mailing list
>      dev@openvswitch.org
>      https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=P3qys_VoPe-I_rPLCBRrQOhmAsb6biA6e47a2J4wSDs&s=qnlA8lzmYvUAZfBAMZh4UkVTB1OIP3LxVFBygnsiZHU&e=
>      
>

Sure.

I ran:
for i in {1..10}; do make check TESTSUITEFLAGS="1229"; done

Each loop reported:

## ------------------------------ ##
## openvswitch 2.9.90 test suite. ##
## ------------------------------ ##
1229: ofproto-dpif - in place modification (vlan)     ok

## ------------- ##
## Test results. ##
## ------------- ##

1 test was successful.

Looks good.

You can give your patch the "reviewed-by and "tested-by" tags from me if 
you want.

Thanks,

- Greg
Darrell Ball May 18, 2018, 5:33 p.m. UTC | #8
On Fri, May 18, 2018 at 10:26 AM, Gregory Rose <gvrose8192@gmail.com> wrote:

> On 5/18/2018 10:15 AM, Darrell Ball wrote:
>
>>
>> On 5/18/18, 9:58 AM, "ovs-dev-bounces@openvswitch.org on behalf of
>> Gregory Rose" <ovs-dev-bounces@openvswitch.org on behalf of
>> gvrose8192@gmail.com> wrote:
>>
>>      On 5/18/2018 9:32 AM, Ben Pfaff wrote:
>>      > On Fri, May 18, 2018 at 08:41:54AM -0700, Gregory Rose wrote:
>>      >> The other two failures I can repro on the master branch so they
>> are not
>>      >> related to this patch series.
>>      > What are the other two failures?  Are they reliable failures or
>> due to
>>      > races?
>>      >
>>      > Thanks,
>>      >
>>      > Ben.
>>           This one:
>>           1229: ofproto-dpif - in place modification (vlan)     FAILED
>>      (ofproto-dpif.at:9009)
>>           and this one:
>>           2535: ovn -- ensure one gw controller restart in HA doesn't
>> bounce the
>>      master FAILED (ovn.at:9059)
>>           They seem pretty reliable over a few runs.  I'd have to dig
>> into them in
>>      order to see what the failure cause is and I'm pretty limited on time
>>      right now.  It Certainly Needs to Be Looked Into.
>>           In fact, I just noticed that Darrell has posted a proposed fix
>> for 1229.
>>
>> Thanks Greg
>> Would you mind giving the below patch a check in your environment?
>> https://patchwork.ozlabs.org/patch/916469/
>>
>>           Thanks,
>>           - Greg
>>      _______________________________________________
>>      dev mailing list
>>      dev@openvswitch.org
>>      https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.
>> openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwIGaQ&c=
>> uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=P3qys
>> _VoPe-I_rPLCBRrQOhmAsb6biA6e47a2J4wSDs&s=qnlA8lzmYvUAZfBAMZh
>> 4UkVTB1OIP3LxVFBygnsiZHU&e=
>>
>>
>
> Sure.
>
> I ran:
> for i in {1..10}; do make check TESTSUITEFLAGS="1229"; done
>
> Each loop reported:
>
> ## ------------------------------ ##
> ## openvswitch 2.9.90 test suite. ##
> ## ------------------------------ ##
> 1229: ofproto-dpif - in place modification (vlan)     ok
>
> ## ------------- ##
> ## Test results. ##
> ## ------------- ##
>
> 1 test was successful.
>
> Looks good.
>
> You can give your patch the "reviewed-by and "tested-by" tags from me if
> you want.
>
> Thanks,
>
> - Greg
>

Thanks Greg
I had ran it 1000 iterations myself.

Maybe we can ask Ben to add the tags?

Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>

Darrell



>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
William Tu May 18, 2018, 5:52 p.m. UTC | #9
On Fri, May 18, 2018 at 9:59 AM, William Tu <u9012063@gmail.com> wrote:
> On Fri, May 18, 2018 at 8:41 AM, Gregory Rose <gvrose8192@gmail.com> wrote:
>> On 5/17/2018 6:57 PM, Greg Rose wrote:
>>>
>>> From: William Tu <u9012063@gmail.com>
>>>
>>> This patch adds support for erspan and ip6erspan.
>>>
>>> Signed-off-by: William Tu <u9012063@gmail.com>
>>> ---
>>>   lib/odp-util.c | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>>> index 2109fac..d7b5bcd 100644
>>> --- a/lib/odp-util.c
>>> +++ b/lib/odp-util.c
>>> @@ -2882,7 +2882,8 @@ tun_key_to_attr(struct ofpbuf *a, const struct
>>> flow_tnl *tun_key,
>>>           nl_msg_end_nested(a, vxlan_opts_ofs);
>>>       }
>>>       tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>>> -    if (tun_key->erspan_ver) {
>>> +    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>>> +        !strcmp(tnl_type, "ip6erspan")) {
>>>           struct erspan_metadata opts;
>>>             opts.version = tun_key->erspan_ver;
>>
>>
>> Ben has reported issues with 'make check' and then I found that 'make check
>> kmod' was failing on every test.
>>
>> Reverting this patch fixes things.  With 'make check' we reduce the error
>> count from 79 to 7.  Interestingly, five of those seven are tunnel related:
>>
>> 796: tunnel - Mix Geneve/GRE options                 FAILED (tunnel.at:875)
> Thanks, the above should be fixed by
>
> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index acc158682840..c2b80c1b62c1 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -2884,7 +2884,11 @@ tun_key_to_attr(struct ofpbuf *a, const struct
> flow_tnl *tun_key,
>                         (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id));
>          nl_msg_end_nested(a, vxlan_opts_ofs);
>      }
> -    tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
> +
> +    if (!tnl_type || !strcmp(tnl_type, "geneve")) {
> +        tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
> +    }
> +
>      if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>          !strcmp(tnl_type, "ip6erspan")) {
>          struct erspan_metadata opts;
>
> I guess this is due to conflict between the backport and master, about
> the commit
> commit db535b0d3e26aeac42a0a2e0e2f791215de3640c
> Author: William Tu <u9012063@gmail.com>
> Date:   Thu May 10 23:35:51 2018 -0700
>
>     tunnel: make tun_key_to_attr aware of tunnel type.
>
> I'm looking into the below failed cases.
>
>
>> 797: tunnel_push_pop - erspan                        FAILED
>> (tunnel-push-pop.at:69)
>> 800: tunnel_push_pop - underlay bridge match         FAILED
>> (tunnel-push-pop.at:562)
>> 801: tunnel_push_pop_ipv6 - ip6erspan                FAILED
>> (tunnel-push-pop-ipv6.at:56)
>> 802: tunnel_push_pop_ipv6 - action                   FAILED
>> (tunnel-push-pop-ipv6.at:296)
>>

The reason the above erspan test fails is due to recent change to
tunnel neighbor snoop:

commit 83c2757bd16e86f6a2d5a69e94f890087e8df294
Author: Zoltan Balogh <zoltan.balogh.eth@gmail.com>
Date:   Wed Apr 4 23:57:54 2018 +0200

    xlate: Move tnl_neigh_snoop() to terminate_native_tunnel()

I'm working on the fix.

Thanks,
William
Gregory Rose May 18, 2018, 6:07 p.m. UTC | #10
On 5/18/2018 9:59 AM, William Tu wrote:
> On Fri, May 18, 2018 at 8:41 AM, Gregory Rose <gvrose8192@gmail.com> wrote:
>> On 5/17/2018 6:57 PM, Greg Rose wrote:
>>> From: William Tu <u9012063@gmail.com>
>>>
>>> This patch adds support for erspan and ip6erspan.
>>>
>>> Signed-off-by: William Tu <u9012063@gmail.com>
>>> ---
>>>    lib/odp-util.c | 3 ++-
>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>>> index 2109fac..d7b5bcd 100644
>>> --- a/lib/odp-util.c
>>> +++ b/lib/odp-util.c
>>> @@ -2882,7 +2882,8 @@ tun_key_to_attr(struct ofpbuf *a, const struct
>>> flow_tnl *tun_key,
>>>            nl_msg_end_nested(a, vxlan_opts_ofs);
>>>        }
>>>        tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>>> -    if (tun_key->erspan_ver) {
>>> +    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>>> +        !strcmp(tnl_type, "ip6erspan")) {
>>>            struct erspan_metadata opts;
>>>              opts.version = tun_key->erspan_ver;
>>
>> Ben has reported issues with 'make check' and then I found that 'make check
>> kmod' was failing on every test.
>>
>> Reverting this patch fixes things.  With 'make check' we reduce the error
>> count from 79 to 7.  Interestingly, five of those seven are tunnel related:
>>
>> 796: tunnel - Mix Geneve/GRE options                 FAILED (tunnel.at:875)
> Thanks, the above should be fixed by
>
> diff --git a/lib/odp-util.c b/lib/odp-util.c
> index acc158682840..c2b80c1b62c1 100644
> --- a/lib/odp-util.c
> +++ b/lib/odp-util.c
> @@ -2884,7 +2884,11 @@ tun_key_to_attr(struct ofpbuf *a, const struct
> flow_tnl *tun_key,
>                          (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id));
>           nl_msg_end_nested(a, vxlan_opts_ofs);
>       }
> -    tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
> +
> +    if (!tnl_type || !strcmp(tnl_type, "geneve")) {
> +        tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
> +    }
> +
>       if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>           !strcmp(tnl_type, "ip6erspan")) {
>           struct erspan_metadata opts;
>
> I guess this is due to conflict between the backport and master, about
> the commit
> commit db535b0d3e26aeac42a0a2e0e2f791215de3640c
> Author: William Tu <u9012063@gmail.com>
> Date:   Thu May 10 23:35:51 2018 -0700
>
>      tunnel: make tun_key_to_attr aware of tunnel type.
>
> I'm looking into the below failed cases.
>

I applied the patch but 'check-kmod' tests all still fail.  Or was that 
just intended to fix 'make check' test 796?

- Greg
William Tu May 18, 2018, 8:58 p.m. UTC | #11
On Fri, May 18, 2018 at 10:52 AM, William Tu <u9012063@gmail.com> wrote:
> On Fri, May 18, 2018 at 9:59 AM, William Tu <u9012063@gmail.com> wrote:
>> On Fri, May 18, 2018 at 8:41 AM, Gregory Rose <gvrose8192@gmail.com> wrote:
>>> On 5/17/2018 6:57 PM, Greg Rose wrote:
>>>>
>>>> From: William Tu <u9012063@gmail.com>
>>>>
>>>> This patch adds support for erspan and ip6erspan.
>>>>
>>>> Signed-off-by: William Tu <u9012063@gmail.com>
>>>> ---
>>>>   lib/odp-util.c | 3 ++-
>>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>>>> index 2109fac..d7b5bcd 100644
>>>> --- a/lib/odp-util.c
>>>> +++ b/lib/odp-util.c
>>>> @@ -2882,7 +2882,8 @@ tun_key_to_attr(struct ofpbuf *a, const struct
>>>> flow_tnl *tun_key,
>>>>           nl_msg_end_nested(a, vxlan_opts_ofs);
>>>>       }
>>>>       tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>>>> -    if (tun_key->erspan_ver) {
>>>> +    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>>>> +        !strcmp(tnl_type, "ip6erspan")) {
>>>>           struct erspan_metadata opts;
>>>>             opts.version = tun_key->erspan_ver;
>>>
>>>
>>> Ben has reported issues with 'make check' and then I found that 'make check
>>> kmod' was failing on every test.
>>>
>>> Reverting this patch fixes things.  With 'make check' we reduce the error
>>> count from 79 to 7.  Interestingly, five of those seven are tunnel related:
>>>
>>> 796: tunnel - Mix Geneve/GRE options                 FAILED (tunnel.at:875)
>> Thanks, the above should be fixed by
>>
>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>> index acc158682840..c2b80c1b62c1 100644
>> --- a/lib/odp-util.c
>> +++ b/lib/odp-util.c
>> @@ -2884,7 +2884,11 @@ tun_key_to_attr(struct ofpbuf *a, const struct
>> flow_tnl *tun_key,
>>                         (tun_key->gbp_flags << 16) | ntohs(tun_key->gbp_id));
>>          nl_msg_end_nested(a, vxlan_opts_ofs);
>>      }
>> -    tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>> +
>> +    if (!tnl_type || !strcmp(tnl_type, "geneve")) {
>> +        tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
>> +    }
>> +
>>      if (!tnl_type || !strcmp(tnl_type, "erspan") ||
>>          !strcmp(tnl_type, "ip6erspan")) {
>>          struct erspan_metadata opts;
>>
>> I guess this is due to conflict between the backport and master, about
>> the commit
>> commit db535b0d3e26aeac42a0a2e0e2f791215de3640c
>> Author: William Tu <u9012063@gmail.com>
>> Date:   Thu May 10 23:35:51 2018 -0700
>>
>>     tunnel: make tun_key_to_attr aware of tunnel type.
>>
>> I'm looking into the below failed cases.
>>
>>
>>> 797: tunnel_push_pop - erspan                        FAILED
>>> (tunnel-push-pop.at:69)
>>> 800: tunnel_push_pop - underlay bridge match         FAILED
>>> (tunnel-push-pop.at:562)
>>> 801: tunnel_push_pop_ipv6 - ip6erspan                FAILED
>>> (tunnel-push-pop-ipv6.at:56)
>>> 802: tunnel_push_pop_ipv6 - action                   FAILED
>>> (tunnel-push-pop-ipv6.at:296)

I'm fixing the last "make check" error, the 802 above, some how
we should sent to GRE port (type=3), but translation says IP6GRE
port (type=109)

-Datapath actions:
clone(tnl_push(tnl_port(3),header(size=62,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)),1)
+Datapath actions:
clone(tnl_push(tnl_port(3),header(size=62,type=109,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)),1)

Thanks
William
diff mbox series

Patch

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 2109fac..d7b5bcd 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2882,7 +2882,8 @@  tun_key_to_attr(struct ofpbuf *a, const struct flow_tnl *tun_key,
         nl_msg_end_nested(a, vxlan_opts_ofs);
     }
     tun_metadata_to_geneve_nlattr(tun_key, tun_flow_key, key_buf, a);
-    if (tun_key->erspan_ver) {
+    if (!tnl_type || !strcmp(tnl_type, "erspan") ||
+        !strcmp(tnl_type, "ip6erspan")) {
         struct erspan_metadata opts;
 
         opts.version = tun_key->erspan_ver;