Use newer API which is consistent with upstream. Signed-off-by: Pravin B Shelar <pshe...@ovn.org> --- acinclude.m4 | 1 - datapath/datapath.c | 22 ++++++++-------------- datapath/linux/compat/include/net/genetlink.h | 9 --------- 3 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4 index 345cdae..34c8eb8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -574,7 +574,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_has_listeners]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [mcgrp_offset]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [parallel_ops]) - OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genlmsg_new_unicast]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [netlink_has_listeners(net->genl_sock], [OVS_DEFINE([HAVE_GENL_HAS_LISTENERS_TAKES_NET])]) OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genlmsg_parse]) diff --git a/datapath/datapath.c b/datapath/datapath.c index 2540df1..69e1eeb 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -436,12 +436,6 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, struct sk_buff *nskb = NULL; struct sk_buff *user_skb = NULL; /* to be queued to userspace */ struct nlattr *nla; - struct genl_info info = { -#ifdef HAVE_GENLMSG_NEW_UNICAST - .dst_sk = ovs_dp_get_net(dp)->genl_sock, -#endif - .snd_portid = upcall_info->portid, - }; size_t len; unsigned int hlen; int err, dp_ifindex; @@ -482,7 +476,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, hlen = skb->len; len = upcall_msg_size(upcall_info, hlen - cutlen); - user_skb = genlmsg_new_unicast(len, &info, GFP_ATOMIC); + user_skb = genlmsg_new(len, GFP_ATOMIC); if (!user_skb) { err = -ENOMEM; goto out; @@ -906,7 +900,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(const struct sw_flow_actions *act return NULL; len = ovs_flow_cmd_msg_size(acts, sfid, ufid_flags); - skb = genlmsg_new_unicast(len, info, GFP_KERNEL); + skb = genlmsg_new(len, GFP_KERNEL); if (!skb) return ERR_PTR(-ENOMEM); @@ -1513,9 +1507,9 @@ error: return -EMSGSIZE; } -static struct sk_buff *ovs_dp_cmd_alloc_info(struct genl_info *info) +static struct sk_buff *ovs_dp_cmd_alloc_info(void) { - return genlmsg_new_unicast(ovs_dp_cmd_msg_size(), info, GFP_KERNEL); + return genlmsg_new(ovs_dp_cmd_msg_size(), GFP_KERNEL); } /* Called with rcu_read_lock or ovs_mutex. */ @@ -1568,7 +1562,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID]) goto err; - reply = ovs_dp_cmd_alloc_info(info); + reply = ovs_dp_cmd_alloc_info(); if (!reply) return -ENOMEM; @@ -1689,7 +1683,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info) struct datapath *dp; int err; - reply = ovs_dp_cmd_alloc_info(info); + reply = ovs_dp_cmd_alloc_info(); if (!reply) return -ENOMEM; @@ -1721,7 +1715,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info) struct datapath *dp; int err; - reply = ovs_dp_cmd_alloc_info(info); + reply = ovs_dp_cmd_alloc_info(); if (!reply) return -ENOMEM; @@ -1754,7 +1748,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info) struct datapath *dp; int err; - reply = ovs_dp_cmd_alloc_info(info); + reply = ovs_dp_cmd_alloc_info(); if (!reply) return -ENOMEM; diff --git a/datapath/linux/compat/include/net/genetlink.h b/datapath/linux/compat/include/net/genetlink.h index 2830fa3..c8ee81a 100644 --- a/datapath/linux/compat/include/net/genetlink.h +++ b/datapath/linux/compat/include/net/genetlink.h @@ -96,15 +96,6 @@ static inline int rpl_genl_register_family(struct genl_family *family) #endif -#ifndef HAVE_GENLMSG_NEW_UNICAST -static inline struct sk_buff *genlmsg_new_unicast(size_t payload, - struct genl_info *info, - gfp_t flags) -{ - return genlmsg_new(payload, flags); -} -#endif - #ifndef HAVE_GENL_HAS_LISTENERS static inline int genl_has_listeners(struct genl_family *family, struct net *net, unsigned int group) -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev