These flags should always be valid and allows the flags element of tnl_mutable_config to be removed.
The flags in mutable were actually not being set due to a previous patch in this series, so all flag-related features, except outgoing ken and csum which were restored in a previous patch, were disabled. Cc: Kyle Mestery <kmest...@cisco.com> Signed-of-by: Simon Horman <ho...@verge.net.au> --- v5 * Rebase for ovs_tnl_frag_needed() changes, it is no longer aware of tun_key. v4 * No change v3 * Initial post --- datapath/tunnel.c | 11 +++++------ datapath/tunnel.h | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/datapath/tunnel.c b/datapath/tunnel.c index d0f777a..1f1705c 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -488,9 +488,9 @@ static bool check_mtu(struct sk_buff *skb, const struct tnl_mutable_config *mutable, int tun_hlen, const struct rtable *rt, __be16 *frag_offp) { - bool df_inherit = mutable->flags & TNL_F_DF_INHERIT; - bool pmtud = mutable->flags & TNL_F_PMTUD; - __be16 frag_off = mutable->flags & TNL_F_DF_DEFAULT ? htons(IP_DF) : 0; + bool df_inherit = OVS_CB(skb)->tun_key->tun_flags & TNL_F_DF_INHERIT; + bool pmtud = OVS_CB(skb)->tun_key->tun_flags & TNL_F_PMTUD; + __be16 frag_off = OVS_CB(skb)->tun_key->tun_flags & TNL_F_DF_DEFAULT ? htons(IP_DF) : 0; int mtu = 0; unsigned int packet_length = skb->len - ETH_HLEN; @@ -787,7 +787,7 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb) else inner_tos = 0; - if (mutable->flags & TNL_F_TOS_INHERIT) + if (OVS_CB(skb)->tun_key->tun_flags & TNL_F_TOS_INHERIT) tos = inner_tos; else tos = OVS_CB(skb)->tun_key->ipv4_tos; @@ -834,7 +834,7 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb) ttl = OVS_CB(skb)->tun_key->ipv4_ttl; if (!ttl) ttl = ip4_dst_hoplimit(&rt_dst(rt)); - if (mutable->flags & TNL_F_TTL_INHERIT) { + if (OVS_CB(skb)->tun_key->tun_flags & TNL_F_TTL_INHERIT) { if (skb->protocol == htons(ETH_P_IP)) ttl = ip_hdr(skb)->ttl; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) @@ -902,7 +902,6 @@ static int tnl_set_config(struct net *net, { const struct vport *old_vport; - mutable->flags = 0; port_key_set_net(&mutable->key, net); mutable->key.tunnel_type = tnl_ops->tunnel_type; diff --git a/datapath/tunnel.h b/datapath/tunnel.h index 2f657eb..cbfe83a 100644 --- a/datapath/tunnel.h +++ b/datapath/tunnel.h @@ -86,7 +86,6 @@ static inline void port_key_set_net(struct port_lookup_key *key, struct net *net * @seq: Sequence number for distinguishing configuration versions. * @eth_addr: Source address for packets generated by tunnel itself * (e.g. ICMP fragmentation needed messages). - * @flags: TNL_F_* flags. */ struct tnl_mutable_config { struct port_lookup_key key; @@ -95,9 +94,6 @@ struct tnl_mutable_config { unsigned seq; unsigned char eth_addr[ETH_ALEN]; - - /* Configured via OVS_TUNNEL_ATTR_* attributes. */ - u32 flags; }; struct tnl_ops { -- 1.7.10.2.484.gcd07cc5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev