Skip to content

Commit

Permalink
datapath: Fix netdev_master_upper_dev_link for 4.14
Browse files Browse the repository at this point in the history
An extended netlink ack has been added for 4.14 - add compat layer
changes so that it compiles for all kernels up to and including
4.14.

Signed-off-by: Greg Rose <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
gvrose8192 authored and pshelar committed Feb 12, 2018
1 parent 94c0d9f commit 36d3520
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
3 changes: 3 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
[OVS_DEFINE([HAVE_LIST_IN_NF_HOOK_OPS])])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netfilter/nf_conntrack_common.h],
[IP_CT_UNTRACKED])
OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h],
[netdev_master_upper_dev_link], [extack],
[OVS_DEFINE([HAVE_UPPER_DEV_LINK_EXTACK])])
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
Expand Down
30 changes: 26 additions & 4 deletions datapath/linux/compat/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,36 @@ static inline bool netif_needs_gso(struct sk_buff *skb,
#ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH
static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev,
void *upper_priv, void *upper_info)
void *upper_priv,
void *upper_info, void *extack)
{
return netdev_master_upper_dev_link(dev, upper_dev);
}
#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link

#endif
#endif
#else /* #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH */
static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev,
void *upper_priv,
void *upper_info, void *extack)
{
return netdev_master_upper_dev_link(dev, upper_dev,
upper_priv, upper_info);
}
#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link
#endif /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH */
#else /* #ifndef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */
#ifndef HAVE_UPPER_DEV_LINK_EXTACK
static inline int rpl_netdev_master_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev,
void *upper_priv,
void *upper_info, void *extack)
{
return netdev_master_upper_dev_link(dev, upper_dev, upper_priv,
upper_info);
}
#define netdev_master_upper_dev_link rpl_netdev_master_upper_dev_link
#endif /* #ifndef HAVE_UPPER_DEV_LINK_EXTACK */
#endif /* #else HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV */

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)
#define dev_queue_xmit rpl_dev_queue_xmit
Expand Down
3 changes: 2 additions & 1 deletion datapath/vport-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name)

rtnl_lock();
err = netdev_master_upper_dev_link(vport->dev,
get_dpdev(vport->dp), NULL, NULL);
get_dpdev(vport->dp),
NULL, NULL, NULL);
if (err)
goto error_unlock;

Expand Down

0 comments on commit 36d3520

Please sign in to comment.