On Thu, Dec 17, 2015 at 8:50 PM, Simon Horman
<[email protected]> wrote:
> * The net parameter of newlink and the head parameter of dellink were
> introduced introduced in v2.6.33
> * The head parameter of dellink cannot be used if its not present
>
> Fixes: e23775f20e1a ("datapath: Add support for lwtunnel")
> Signed-off-by: Simon Horman <[email protected]>
> ---
> .travis.yml | 3 +++
> datapath/linux/compat/dev-openvswitch.c | 2 +-
> datapath/linux/compat/geneve.c | 22 ++++++++++++++--------
> datapath/linux/compat/ip_gre.c | 4 ++--
> datapath/linux/compat/lisp.c | 14 ++++++++++----
> datapath/linux/compat/vxlan.c | 23 ++++++++++++++++-------
> 6 files changed, 46 insertions(+), 22 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index ea1d7e7ebea4..90df67454a22 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -32,6 +32,9 @@ env:
> - KERNEL=3.10.92
> - KERNEL=3.4.110
> - KERNEL=3.2.72
> + - KERNEL=2.6.38.8
> + - KERNEL=2.6.37.6
> + - KERNEL=2.6.33.20
> - KERNEL=2.6.32.68
Currently we have kept it insync with kernel versions from kernel.org.
So that we can get compilation test coverage against stable kernel and
keep build matrix in shape. The added kernels are not in use much use
and they are not maintained by linux community. so I do not think we
should add these older kernel to the list.
>
> script: ./.travis/build.sh $OPTS
> diff --git a/datapath/linux/compat/dev-openvswitch.c
> b/datapath/linux/compat/dev-openvswitch.c
> index d7d4224a1cb3..5fe356a1cefd 100644
> --- a/datapath/linux/compat/dev-openvswitch.c
> +++ b/datapath/linux/compat/dev-openvswitch.c
> @@ -103,7 +103,7 @@ int rpl_rtnl_delete_link(struct net_device *dev)
> if (!ops || !ops->dellink)
> return -EOPNOTSUPP;
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
> ops->dellink(dev);
> #else
> {
> diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
> index 297593ce6e1a..38e8abbc0c36 100644
> --- a/datapath/linux/compat/geneve.c
> +++ b/datapath/linux/compat/geneve.c
> @@ -909,15 +909,15 @@ static int geneve_configure(struct net *net, struct
> net_device *dev,
> return 0;
> }
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
> -static int geneve_newlink(struct net_device *dev,
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
> +static int geneve_newlink(struct net *net, struct net_device *dev,
> struct nlattr *tb[], struct nlattr *data[])
> {
> - struct net *net = &init_net;
> #else
> -static int geneve_newlink(struct net *net, struct net_device *dev,
> +static int geneve_newlink(struct net_device *dev,
> struct nlattr *tb[], struct nlattr *data[])
> {
> + struct net *net = &init_net;
> #endif
> __be16 dst_port = htons(GENEVE_UDP_PORT);
> __u8 ttl = 0, tos = 0;
> @@ -947,17 +947,23 @@ static int geneve_newlink(struct net *net, struct
> net_device *dev,
> ttl, tos, dst_port, metadata);
> }
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
> -static void geneve_dellink(struct net_device *dev)
> -#else
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
> static void geneve_dellink(struct net_device *dev, struct list_head *head)
> -#endif
> {
> struct geneve_dev *geneve = netdev_priv(dev);
>
> list_del(&geneve->next);
> unregister_netdevice_queue(dev, head);
> }
> +#else
> +static void geneve_dellink(struct net_device *dev)
> +{
> + struct geneve_dev *geneve = netdev_priv(dev);
> +
> + list_del(&geneve->next);
> + unregister_netdevice(dev);
> +}
> +#endif
>
I do not see reason to define another function body here.
unregister_netdevice_queue() is defined as unregister_netdevice() on
older kernel.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev