ip_gre: Add support to collect tunnel metadata.
authorPravin B Shelar <pshelar@nicira.com>
Sat, 8 Aug 2015 06:51:42 +0000 (23:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2015 21:03:54 +0000 (14:03 -0700)
Following patch create new tunnel flag which enable
tunnel metadata collection on given device.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_tunnels.h
include/uapi/linux/if_tunnel.h
net/ipv4/ip_gre.c
net/ipv4/ip_tunnel.c
net/ipv4/ipip.c
net/ipv6/sit.c

index 4798441..984dbfa 100644 (file)
@@ -82,6 +82,8 @@ struct ip_tunnel_dst {
        __be32                           saddr;
 };
 
+struct metadata_dst;
+
 struct ip_tunnel {
        struct ip_tunnel __rcu  *next;
        struct hlist_node hash_node;
@@ -115,6 +117,7 @@ struct ip_tunnel {
        unsigned int            prl_count;      /* # of entries in PRL */
        int                     ip_tnl_net_id;
        struct gro_cells        gro_cells;
+       bool                    collect_md;
 };
 
 #define TUNNEL_CSUM            __cpu_to_be16(0x01)
@@ -149,6 +152,7 @@ struct tnl_ptk_info {
 struct ip_tunnel_net {
        struct net_device *fb_tunnel_dev;
        struct hlist_head tunnels[IP_TNL_HASH_SIZE];
+       struct ip_tunnel __rcu *collect_md_tun;
 };
 
 struct ip_tunnel_encap_ops {
@@ -235,7 +239,8 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
                                   __be32 key);
 
 int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
-                 const struct tnl_ptk_info *tpi, bool log_ecn_error);
+                 const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst,
+                 bool log_ecn_error);
 int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
                         struct ip_tunnel_parm *p);
 int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/ipip.c
Simple merge
diff --cc net/ipv6/sit.c
Simple merge