From 564666e9db0e59e6ed108924f5a0dd3808a46a26 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Mon, 18 Jul 2016 13:53:29 -0700 Subject: [PATCH] dataoath: compat: Do not use upstream fill-meta-data function for compat tunnel upstream dev_fill_metadata_dst() uses upstream tunnel-dst which could be different from OVS defined tun-dst. Therefore use fill-meta-data function from compat layer. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- datapath/linux/compat/dev-openvswitch.c | 2 +- datapath/linux/compat/include/linux/netdevice.h | 2 +- datapath/linux/compat/lisp.c | 2 ++ datapath/linux/compat/stt.c | 2 ++ datapath/vport-geneve.c | 2 ++ datapath/vport-gre.c | 2 ++ datapath/vport-lisp.c | 2 ++ datapath/vport-stt.c | 2 ++ datapath/vport-vxlan.c | 2 ++ datapath/vport.h | 3 ++- 10 files changed, 18 insertions(+), 3 deletions(-) diff --git a/datapath/linux/compat/dev-openvswitch.c b/datapath/linux/compat/dev-openvswitch.c index 1e870431f..1a71206ea 100644 --- a/datapath/linux/compat/dev-openvswitch.c +++ b/datapath/linux/compat/dev-openvswitch.c @@ -60,7 +60,7 @@ int rpl_rtnl_delete_link(struct net_device *dev) return 0; } -#ifndef HAVE_NDO_FILL_METADATA_DST +#ifndef USE_UPSTREAM_TUNNEL int ovs_dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb) { struct ip_tunnel_info *info; diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index f066e91d5..00eaa21e8 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -249,7 +249,7 @@ do { \ #endif -#ifndef HAVE_NDO_FILL_METADATA_DST +#ifndef USE_UPSTREAM_TUNNEL #define dev_fill_metadata_dst ovs_dev_fill_metadata_dst int ovs_dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb); #endif diff --git a/datapath/linux/compat/lisp.c b/datapath/linux/compat/lisp.c index bf65102a2..dd2305947 100644 --- a/datapath/linux/compat/lisp.c +++ b/datapath/linux/compat/lisp.c @@ -510,9 +510,11 @@ static const struct net_device_ops lisp_netdev_ops = { .ndo_change_mtu = lisp_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, +#ifdef USE_UPSTREAM_TUNNEL #ifdef HAVE_NDO_FILL_METADATA_DST .ndo_fill_metadata_dst = lisp_fill_metadata_dst, #endif +#endif }; static void lisp_get_drvinfo(struct net_device *dev, diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 1488afa31..c89951776 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -1845,9 +1845,11 @@ static const struct net_device_ops stt_netdev_ops = { .ndo_change_mtu = stt_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, +#ifdef USE_UPSTREAM_TUNNEL #ifdef HAVE_NDO_FILL_METADATA_DST .ndo_fill_metadata_dst = stt_fill_metadata_dst, #endif +#endif }; static void stt_get_drvinfo(struct net_device *dev, diff --git a/datapath/vport-geneve.c b/datapath/vport-geneve.c index 718b077d5..5821ef481 100644 --- a/datapath/vport-geneve.c +++ b/datapath/vport-geneve.c @@ -116,7 +116,9 @@ static struct vport_ops ovs_geneve_vport_ops = { .create = geneve_create, .destroy = ovs_netdev_tunnel_destroy, .get_options = geneve_get_options, +#ifndef USE_UPSTREAM_TUNNEL .fill_metadata_dst = geneve_fill_metadata_dst, +#endif .send = geneve_xmit, }; diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c index ffe0079ca..32d7d9f79 100644 --- a/datapath/vport-gre.c +++ b/datapath/vport-gre.c @@ -88,7 +88,9 @@ static struct vport_ops ovs_gre_vport_ops = { .type = OVS_VPORT_TYPE_GRE, .create = gre_create, .send = gre_fb_xmit, +#ifndef USE_UPSTREAM_TUNNEL .fill_metadata_dst = gre_fill_metadata_dst, +#endif .destroy = ovs_netdev_tunnel_destroy, }; diff --git a/datapath/vport-lisp.c b/datapath/vport-lisp.c index 25f6932d1..9e894e80a 100644 --- a/datapath/vport-lisp.c +++ b/datapath/vport-lisp.c @@ -116,7 +116,9 @@ static struct vport_ops ovs_lisp_vport_ops = { .create = lisp_create, .destroy = ovs_netdev_tunnel_destroy, .get_options = lisp_get_options, +#ifndef USE_UPSTREAM_TUNNEL .fill_metadata_dst = lisp_fill_metadata_dst, +#endif .send = lisp_xmit, }; diff --git a/datapath/vport-stt.c b/datapath/vport-stt.c index e46bec15d..1c838de76 100644 --- a/datapath/vport-stt.c +++ b/datapath/vport-stt.c @@ -118,7 +118,9 @@ static struct vport_ops ovs_stt_vport_ops = { .create = stt_create, .destroy = ovs_netdev_tunnel_destroy, .get_options = stt_get_options, +#ifndef USE_UPSTREAM_TUNNEL .fill_metadata_dst = stt_fill_metadata_dst, +#endif .send = ovs_stt_xmit, }; diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c index f73a10cce..b830a463f 100644 --- a/datapath/vport-vxlan.c +++ b/datapath/vport-vxlan.c @@ -153,7 +153,9 @@ static struct vport_ops ovs_vxlan_netdev_vport_ops = { .create = vxlan_create, .destroy = ovs_netdev_tunnel_destroy, .get_options = vxlan_get_options, +#ifndef USE_UPSTREAM_TUNNEL .fill_metadata_dst = vxlan_fill_metadata_dst, +#endif .send = vxlan_xmit, }; diff --git a/datapath/vport.h b/datapath/vport.h index c9f46f248..47995be08 100644 --- a/datapath/vport.h +++ b/datapath/vport.h @@ -142,8 +142,9 @@ struct vport_ops { int (*get_options)(const struct vport *, struct sk_buff *); netdev_tx_t (*send)(struct sk_buff *skb); +#ifndef USE_UPSTREAM_TUNNEL int (*fill_metadata_dst)(struct net_device *dev, struct sk_buff *skb); - +#endif struct module *owner; struct list_head list; }; -- 2.20.1