diff mbox series

[ovs-dev,v2] ofproto-dpif-xlate: Clear tunnel wc bits if original packet is non-tunnel

Message ID 1651219110-2264-1-git-send-email-wenxu@chinatelecom.cn
State Accepted
Commit d046453b56a9432aac83a2950e7c4083eb3274dd
Headers show
Series [ovs-dev,v2] ofproto-dpif-xlate: Clear tunnel wc bits if original packet is non-tunnel | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

wenxu@chinatelecom.cn April 29, 2022, 7:58 a.m. UTC
From: wenxu <wenxu@chinatelecom.cn>

A packet go through the encap openflow(set_field tun_id/src/dst)
The tunnel wc bits will be set. But it should be clear if the
original packet is non-tunnel. It is not necessary for datapath
wc the tunnel info for match(like the similar logic for vlan).

Signed-off-by: wenxu <wenxu@chinatelecom.cn>
---
 ofproto/ofproto-dpif-xlate.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ilya Maximets Sept. 12, 2022, 3:08 p.m. UTC | #1
On 4/29/22 09:58, wenxu@chinatelecom.cn wrote:
> From: wenxu <wenxu@chinatelecom.cn>
> 
> A packet go through the encap openflow(set_field tun_id/src/dst)
> The tunnel wc bits will be set. But it should be clear if the
> original packet is non-tunnel. It is not necessary for datapath
> wc the tunnel info for match(like the similar logic for vlan).
> 
> Signed-off-by: wenxu <wenxu@chinatelecom.cn>
> ---
>  ofproto/ofproto-dpif-xlate.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied and backported down to 2.17.  Thanks!

Best regards, Ilya Maximets.

> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 17f7e28..6905d30 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -7635,6 +7635,10 @@ xlate_wc_finish(struct xlate_ctx *ctx)
>              ctx->wc->masks.vlans[i].tci = 0;
>          }
>      }
> +    /* Clear tunnel wc bits if original packet is non-tunnel. */
> +    if (!flow_tnl_dst_is_set(&ctx->xin->upcall_flow->tunnel)) {
> +        memset(&ctx->wc->masks.tunnel, 0, sizeof ctx->wc->masks.tunnel);
> +    }
>  }
>  
>  /* Translates the flow, actions, or rule in 'xin' into datapath actions in
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 17f7e28..6905d30 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -7635,6 +7635,10 @@  xlate_wc_finish(struct xlate_ctx *ctx)
             ctx->wc->masks.vlans[i].tci = 0;
         }
     }
+    /* Clear tunnel wc bits if original packet is non-tunnel. */
+    if (!flow_tnl_dst_is_set(&ctx->xin->upcall_flow->tunnel)) {
+        memset(&ctx->wc->masks.tunnel, 0, sizeof ctx->wc->masks.tunnel);
+    }
 }
 
 /* Translates the flow, actions, or rule in 'xin' into datapath actions in