[ovs-dev] lib/tc: Fix flow dump for tunnel id equal zero
diff mbox series

Message ID 20191030124035.38185-1-roid@mellanox.com
State New
Headers show
Series
  • [ovs-dev] lib/tc: Fix flow dump for tunnel id equal zero
Related show

Commit Message

Roi Dayan Oct. 30, 2019, 12:40 p.m. UTC
From: Dmytro Linkin <dmitrolin@mellanox.com>

Tunnel id 0 is not printed unless tunnel flag FLOW_TNL_F_KEY is set.
Fix that by always setting FLOW_TNL_F_KEY when tunnel id is valid.

Fixes: 0227bf092ee6 ("lib/tc: Support optional tunnel id")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
---
 lib/netdev-offload-tc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Horman Nov. 1, 2019, 2:54 p.m. UTC | #1
On Wed, Oct 30, 2019 at 02:40:35PM +0200, Roi Dayan wrote:
> From: Dmytro Linkin <dmitrolin@mellanox.com>
> 
> Tunnel id 0 is not printed unless tunnel flag FLOW_TNL_F_KEY is set.
> Fix that by always setting FLOW_TNL_F_KEY when tunnel id is valid.
> 
> Fixes: 0227bf092ee6 ("lib/tc: Support optional tunnel id")
> Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
> Reviewed-by: Roi Dayan <roid@mellanox.com>

Hi Roi,

this looks fine to me but I am holding off on pushing it
until master passes travis-ci again.

It also seems to backport cleanly to branch-2.11 and I plan
to apply it there too.

If it is suitable for older branches could you please post a
backport/backports?

Thanks

> ---
>  lib/netdev-offload-tc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> index f6d1abb2e695..502e73ad5332 100644
> --- a/lib/netdev-offload-tc.c
> +++ b/lib/netdev-offload-tc.c
> @@ -600,6 +600,7 @@ parse_tc_flower_to_match(struct tc_flower *flower,
>      if (flower->tunnel) {
>          if (flower->mask.tunnel.id) {
>              match_set_tun_id(match, flower->key.tunnel.id);
> +            match->flow.tunnel.flags |= FLOW_TNL_F_KEY;
>          }
>          if (flower->key.tunnel.ipv4.ipv4_dst) {
>              match_set_tun_src(match, flower->key.tunnel.ipv4.ipv4_src);
> -- 
> 2.8.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Simon Horman Nov. 2, 2019, 11:27 a.m. UTC | #2
On Fri, Nov 01, 2019 at 03:54:49PM +0100, Simon Horman wrote:
> On Wed, Oct 30, 2019 at 02:40:35PM +0200, Roi Dayan wrote:
> > From: Dmytro Linkin <dmitrolin@mellanox.com>
> > 
> > Tunnel id 0 is not printed unless tunnel flag FLOW_TNL_F_KEY is set.
> > Fix that by always setting FLOW_TNL_F_KEY when tunnel id is valid.
> > 
> > Fixes: 0227bf092ee6 ("lib/tc: Support optional tunnel id")
> > Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
> > Reviewed-by: Roi Dayan <roid@mellanox.com>
> 
> Hi Roi,
> 
> this looks fine to me but I am holding off on pushing it
> until master passes travis-ci again.
> 
> It also seems to backport cleanly to branch-2.11 and I plan

s/11/12/

> to apply it there too.

I have now pushed this patch to master and branch-2.12.

> 
> If it is suitable for older branches could you please post a
> backport/backports?
> 
> Thanks
> 
> > ---
> >  lib/netdev-offload-tc.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> > index f6d1abb2e695..502e73ad5332 100644
> > --- a/lib/netdev-offload-tc.c
> > +++ b/lib/netdev-offload-tc.c
> > @@ -600,6 +600,7 @@ parse_tc_flower_to_match(struct tc_flower *flower,
> >      if (flower->tunnel) {
> >          if (flower->mask.tunnel.id) {
> >              match_set_tun_id(match, flower->key.tunnel.id);
> > +            match->flow.tunnel.flags |= FLOW_TNL_F_KEY;
> >          }
> >          if (flower->key.tunnel.ipv4.ipv4_dst) {
> >              match_set_tun_src(match, flower->key.tunnel.ipv4.ipv4_src);
> > -- 
> > 2.8.4
> > 
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> > 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Roi Dayan Nov. 3, 2019, 8:08 a.m. UTC | #3
On 2019-11-02 1:27 PM, Simon Horman wrote:
> On Fri, Nov 01, 2019 at 03:54:49PM +0100, Simon Horman wrote:
>> On Wed, Oct 30, 2019 at 02:40:35PM +0200, Roi Dayan wrote:
>>> From: Dmytro Linkin <dmitrolin@mellanox.com>
>>>
>>> Tunnel id 0 is not printed unless tunnel flag FLOW_TNL_F_KEY is set.
>>> Fix that by always setting FLOW_TNL_F_KEY when tunnel id is valid.
>>>
>>> Fixes: 0227bf092ee6 ("lib/tc: Support optional tunnel id")
>>> Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
>>> Reviewed-by: Roi Dayan <roid@mellanox.com>
>>
>> Hi Roi,
>>
>> this looks fine to me but I am holding off on pushing it
>> until master passes travis-ci again.
>>
>> It also seems to backport cleanly to branch-2.11 and I plan
> 
> s/11/12/
> 
>> to apply it there too.
> 
> I have now pushed this patch to master and branch-2.12.
> 
>>
>> If it is suitable for older branches could you please post a
>> backport/backports?

The fix is not relevant for other branches as the original commit
to support tunnel id 0 is also not in other branches.
We treated this as a feature and didn't add to old branches.
Thanks


>>
>> Thanks
>>
>>> ---
>>>  lib/netdev-offload-tc.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
>>> index f6d1abb2e695..502e73ad5332 100644
>>> --- a/lib/netdev-offload-tc.c
>>> +++ b/lib/netdev-offload-tc.c
>>> @@ -600,6 +600,7 @@ parse_tc_flower_to_match(struct tc_flower *flower,
>>>      if (flower->tunnel) {
>>>          if (flower->mask.tunnel.id) {
>>>              match_set_tun_id(match, flower->key.tunnel.id);
>>> +            match->flow.tunnel.flags |= FLOW_TNL_F_KEY;
>>>          }
>>>          if (flower->key.tunnel.ipv4.ipv4_dst) {
>>>              match_set_tun_src(match, flower->key.tunnel.ipv4.ipv4_src);
>>> -- 
>>> 2.8.4
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev@openvswitch.org
>>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-dev&amp;data=02%7C01%7Croid%40mellanox.com%7C1816ea5da15e484648cd08d75f879fc6%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C637082908414787875&amp;sdata=yx%2F%2Braivnd76D6ydg0mGsEEW%2BMiV6uIGawTi%2FYlyciA%3D&amp;reserved=0
>>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.openvswitch.org%2Fmailman%2Flistinfo%2Fovs-dev&amp;data=02%7C01%7Croid%40mellanox.com%7C1816ea5da15e484648cd08d75f879fc6%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C637082908414787875&amp;sdata=yx%2F%2Braivnd76D6ydg0mGsEEW%2BMiV6uIGawTi%2FYlyciA%3D&amp;reserved=0
>>
Simon Horman Nov. 4, 2019, 8:50 a.m. UTC | #4
On Sun, Nov 03, 2019 at 08:08:00AM +0000, Roi Dayan wrote:
> 
> 
> On 2019-11-02 1:27 PM, Simon Horman wrote:
> > On Fri, Nov 01, 2019 at 03:54:49PM +0100, Simon Horman wrote:
> >> On Wed, Oct 30, 2019 at 02:40:35PM +0200, Roi Dayan wrote:
> >>> From: Dmytro Linkin <dmitrolin@mellanox.com>
> >>>
> >>> Tunnel id 0 is not printed unless tunnel flag FLOW_TNL_F_KEY is set.
> >>> Fix that by always setting FLOW_TNL_F_KEY when tunnel id is valid.
> >>>
> >>> Fixes: 0227bf092ee6 ("lib/tc: Support optional tunnel id")
> >>> Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
> >>> Reviewed-by: Roi Dayan <roid@mellanox.com>
> >>
> >> Hi Roi,
> >>
> >> this looks fine to me but I am holding off on pushing it
> >> until master passes travis-ci again.
> >>
> >> It also seems to backport cleanly to branch-2.11 and I plan
> > 
> > s/11/12/
> > 
> >> to apply it there too.
> > 
> > I have now pushed this patch to master and branch-2.12.
> > 
> >>
> >> If it is suitable for older branches could you please post a
> >> backport/backports?
> 
> The fix is not relevant for other branches as the original commit
> to support tunnel id 0 is also not in other branches.
> We treated this as a feature and didn't add to old branches.

Thanks Roi,

got it.

Patch
diff mbox series

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index f6d1abb2e695..502e73ad5332 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -600,6 +600,7 @@  parse_tc_flower_to_match(struct tc_flower *flower,
     if (flower->tunnel) {
         if (flower->mask.tunnel.id) {
             match_set_tun_id(match, flower->key.tunnel.id);
+            match->flow.tunnel.flags |= FLOW_TNL_F_KEY;
         }
         if (flower->key.tunnel.ipv4.ipv4_dst) {
             match_set_tun_src(match, flower->key.tunnel.ipv4.ipv4_src);