Hi Ben,

As Miklos is on vacation, let me answer your questions.
The 'latest_nw_tos' variable is storing always the updated value of 'nw_tos'. 
It is not always the same as 'flow->nw_tos'. E.g. in xlate_sample_action(), 
'flow' pointer is declared just before calling tnl_port_send(). In case of MPLS 
traffic, '&ctx->xin->flow' doesn't have the correct ToS value (it is 
invalidated at that moment), while updated 'latest_nw_tos' is coming from 'ctx' 
argument.

BR,
Balazs

-----Original Message-----
From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-boun...@openvswitch.org] 
On Behalf Of Ben Pfaff
Sent: 03 August 2017 20:16
To: Miklós Pelyva <miklos.pel...@ericsson.com>
Cc: 'ovs-dev@openvswitch.org' <ovs-dev@openvswitch.org>
Subject: Re: [ovs-dev] [PATCH] tunnel: ToS and TTL inheritance for MPLS 
tunneled traffic

On Fri, Jul 21, 2017 at 01:08:34PM +0000, Miklós Pelyva wrote:
> When a new outermost MPLS label is added to 'flow' the 'flow''s
> Ethernet type is changed to 'mpls_eth_type'. After the new label is
> set, the 'flow''s MPLS stack is updated, and the L3/4 fields are
> cleared to mark them invalid. This results in loosing the values of
> the 'nw_tos' and the 'nw_ttl' fields from the struct 'flow'.
> 
> Hence, it is impossible to use the ToS and TTL 'inherit' feature in
> case of MPLS tunneled traffic, because currently the values to be
> inherited are coming from the cleared (invalidated) variables of
> struct 'flow'.
> 
> To support inheriting the ToS field to the outer tunnel header even
> in the presence of an MPLS shim header, this patch introduces a new
> variable in the context structure, called 'latest_nw_tos', which is
> used for storing the up-to-date 'nw_tos' value during the flow
> translation, and is referred in the 'tnl_port_send()' function.
> 
> Besides, for every MPLS packet the MPLS TTL field is copied to the
> TTL field of the outer tunnel header, if inheritance is configured.
> 
> Two new unit tests are created for checking the ToS and TTL
> inheritance for IP, and non-IP packets sent over MPLS over IP
> tunnels. The ECN inheritance is not applied in that case, because
> the related RFC 5129 does not describe an individual way, just
> options for ECN in MPLS.
> 
> Signed-off-by: Miklos Pelyva <miklos.pel...@ericsson.com>
> Signed-off-by: Jan Scheurich <jan.scheur...@ericsson.com>
> Co-authored-by: Jan Scheurich <jan.scheur...@ericsson.com>

Thanks for working on improving OVS support for MPLS.  It's definitely
an OVS weak spot and we all appreciate the help.

Can you help me better understand the relationship between flow->nw_tos
and latest_nw_tos?  It looks to me like latest_nw_tos is very literally
copied from flow->nw_tos whenever the latter changes.  So, when do they
differ?  If they are always the same, then there's no need to have both.

Thanks,

Ben.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to