Thread (1 message) 1 message, 1 author, 2012-05-24
DORMANTno replies

[PATCH 18/21] dataptah: remove ttl and tos from tnl_mutable_config

From: Simon Horman <hidden>
Date: 2012-05-24 09:09:11
Subsystem: the rest · Maintainer: Linus Torvalds

tun_key should always be present and correct in ovs_tnl_send()

It ought to be possible to handle the ttl entirely
in user-space. This is not implemented yet. However, the
TNL_F_TOS_INHERIT is currently never set.

Cc: Kyle Mestery <redacted>
Signed-off-by: Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
---
 datapath/tunnel.c | 10 ++--------
 datapath/tunnel.h |  4 ----
 2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index ba18055..39aa2af 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -900,10 +900,8 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb)
 
 	if (mutable->flags & TNL_F_TOS_INHERIT)
 		tos = inner_tos;
-	else if (OVS_CB(skb)->tun_key)
-		tos = OVS_CB(skb)->tun_key->ipv4_tos;
 	else
-		tos = mutable->tos;
+		tos = OVS_CB(skb)->tun_key->ipv4_tos;
 
 	/* Route lookup */
 	rt = find_route(vport, port_key_get_net(&mutable->key),
@@ -940,11 +938,7 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb)
 		dst_hold(unattached_dst);
 	}
 
-	/* TTL */
-	if (OVS_CB(skb)->tun_key)
-		ttl = OVS_CB(skb)->tun_key->ipv4_ttl;
-	else
-		ttl = mutable->ttl;
+	ttl = OVS_CB(skb)->tun_key->ipv4_ttl;
 	if (!ttl)
 		ttl = ip4_dst_hoplimit(&rt_dst(rt));
 	if (mutable->flags & TNL_F_TTL_INHERIT) {
diff --git a/datapath/tunnel.h b/datapath/tunnel.h
index ed3b4ec..330df27 100644
--- a/datapath/tunnel.h
+++ b/datapath/tunnel.h
@@ -99,8 +99,6 @@ static inline void port_key_set_net(struct port_lookup_key *key, struct net *net
  * (e.g. ICMP fragmentation needed messages).
  * @out_key: Key to use on output, 0 if this tunnel has no fixed output key.
  * @flags: TNL_F_* flags.
- * @tos: IPv4 TOS value to use for tunnel, 0 if no fixed TOS.
- * @ttl: IPv4 TTL value to use for tunnel, 0 if no fixed TTL.
  */
 struct tnl_mutable_config {
 	struct port_lookup_key key;
@@ -115,8 +113,6 @@ struct tnl_mutable_config {
 	/* Configured via OVS_TUNNEL_ATTR_* attributes. */
 	__be64	out_key;
 	u32	flags;
-	u8	tos;
-	u8	ttl;
 };
 
 struct tnl_ops {
-- 
1.7.10.2.484.gcd07cc5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help