Re: [ovs-dev] [PATCH 01/20] datapath: Fix netdev_master_upper_dev_link for 4.14
On 2/2/2018 10:17 AM, Pravin Shelar wrote: On Tue, Jan 30, 2018 at 3:40 PM, Greg Rosewrote: 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 --- acinclude.m4| 3 +++ datapath/linux/compat/include/linux/netdevice.h | 15 ++- datapath/vport-netdev.c | 9 - 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index c04c2c6..768c20c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -795,6 +795,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 diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index 3c3cf42..c460332 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -101,13 +101,26 @@ 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 +#else +#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 #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 697c442..e2d8eaf 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -112,8 +112,15 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name) } rtnl_lock(); +#ifdef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH err = netdev_master_upper_dev_link(vport->dev, - get_dpdev(vport->dp), NULL, NULL); + get_dpdev(vport->dp), + NULL, NULL); +#else + err = netdev_master_upper_dev_link(vport->dev, + get_dpdev(vport->dp), + NULL, NULL, NULL); +#endif Since the parameters are pretty much the same, this (#ifdef) can be moved to compat code. OK, noted. Thanks, - Greg if (err) goto error_unlock; -- 1.8.3.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 01/20] datapath: Fix netdev_master_upper_dev_link for 4.14
On Tue, Jan 30, 2018 at 3:40 PM, Greg Rosewrote: > 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 > --- > acinclude.m4| 3 +++ > datapath/linux/compat/include/linux/netdevice.h | 15 ++- > datapath/vport-netdev.c | 9 - > 3 files changed, 25 insertions(+), 2 deletions(-) > > diff --git a/acinclude.m4 b/acinclude.m4 > index c04c2c6..768c20c 100644 > --- a/acinclude.m4 > +++ b/acinclude.m4 > @@ -795,6 +795,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 > diff --git a/datapath/linux/compat/include/linux/netdevice.h > b/datapath/linux/compat/include/linux/netdevice.h > index 3c3cf42..c460332 100644 > --- a/datapath/linux/compat/include/linux/netdevice.h > +++ b/datapath/linux/compat/include/linux/netdevice.h > @@ -101,13 +101,26 @@ 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 > +#else > +#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 > #endif > > #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) > diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c > index 697c442..e2d8eaf 100644 > --- a/datapath/vport-netdev.c > +++ b/datapath/vport-netdev.c > @@ -112,8 +112,15 @@ struct vport *ovs_netdev_link(struct vport *vport, const > char *name) > } > > rtnl_lock(); > +#ifdef HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH > err = netdev_master_upper_dev_link(vport->dev, > - get_dpdev(vport->dp), NULL, NULL); > + get_dpdev(vport->dp), > + NULL, NULL); > +#else > + err = netdev_master_upper_dev_link(vport->dev, > + get_dpdev(vport->dp), > + NULL, NULL, NULL); > +#endif Since the parameters are pretty much the same, this (#ifdef) can be moved to compat code. > if (err) > goto error_unlock; > > -- > 1.8.3.1 > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev