[ovs-dev] [PATCH 3/3] tunnel: Set ECN mask bits only when it is matched in the IP header

Finn, Emma emma.finn at intel.com
Thu Oct 15 14:34:01 UTC 2020



> -----Original Message-----
> From: dev <ovs-dev-bounces at openvswitch.org> On Behalf Of Sriharsha
> Basavapatna via dev
> Sent: Friday 10 July 2020 13:07
> To: dev at openvswitch.org
> Subject: [ovs-dev] [PATCH 3/3] tunnel: Set ECN mask bits only when it is
> matched in the IP header
> 
> IP_ECN_MASK is set unconditionally in the mask field for a tunneled flow. Set
> this only when the ECN field is matched.
> 
> Fixes: abcd4402fec4 ("tunnel: Only un-wildcard the ECN bits for IP traffic")
> Signed-off-by: Sriharsha Basavapatna
> <sriharsha.basavapatna at broadcom.com>

Tested with X710 devices. 
Tested-by: Emma Finn <emma.finn at intel.com>

> ---
>  ofproto/tunnel.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 03f0ab765..d0a65b430
> 100644
> --- a/ofproto/tunnel.c
> +++ b/ofproto/tunnel.c
> @@ -455,13 +455,17 @@ tnl_port_send(const struct ofport_dpif *ofport,
> struct flow *flow,
> 
>      /* ECN fields are always inherited. */
>      if (is_ip_any(flow)) {
> -        wc->masks.nw_tos |= IP_ECN_MASK;
> -
>          if (IP_ECN_is_ce(flow->nw_tos)) {
>              flow->tunnel.ip_tos |= IP_ECN_ECT_0;
>          } else {
>              flow->tunnel.ip_tos |= flow->nw_tos & IP_ECN_MASK;
>          }
> +
> +        if (flow->tunnel.ip_tos & IP_ECN_MASK) {
> +            wc->masks.nw_tos |= IP_ECN_MASK;
> +        } else {
> +            wc->masks.nw_tos &= ~IP_ECN_MASK;
> +        }
>      }
> 
>      flow->tunnel.flags &= ~(FLOW_TNL_F_MASK & ~FLOW_TNL_PUB_F_MASK);
> --
> 2.25.0.rc2
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list