diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-03-29 09:46:50 -0400 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2013-03-29 20:54:09 -0400 |
commit | ed661185859cecfcbe3a0e585563525498b3f405 (patch) | |
tree | 90eb00ecc954148eed6cb02498a1a1a4911b16b3 /net/openvswitch | |
parent | c3ff8cfe3e7748a93c4815b76e464d54c7efd241 (diff) |
openvswitch: Move common genl notify code into ovs_notify()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch')
-rw-r--r-- | net/openvswitch/datapath.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 49ee37b83a29..d406503e01b6 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -71,6 +71,13 @@ static int ovs_net_id __read_mostly; | |||
71 | static void rehash_flow_table(struct work_struct *work); | 71 | static void rehash_flow_table(struct work_struct *work); |
72 | static DECLARE_DELAYED_WORK(rehash_flow_wq, rehash_flow_table); | 72 | static DECLARE_DELAYED_WORK(rehash_flow_wq, rehash_flow_table); |
73 | 73 | ||
74 | static void ovs_notify(struct sk_buff *skb, struct genl_info *info, | ||
75 | struct genl_multicast_group *grp) | ||
76 | { | ||
77 | genl_notify(skb, genl_info_net(info), info->snd_portid, | ||
78 | grp->id, info->nlhdr, GFP_KERNEL); | ||
79 | } | ||
80 | |||
74 | /** | 81 | /** |
75 | * DOC: Locking: | 82 | * DOC: Locking: |
76 | * | 83 | * |
@@ -1061,9 +1068,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info) | |||
1061 | } | 1068 | } |
1062 | 1069 | ||
1063 | if (!IS_ERR(reply)) | 1070 | if (!IS_ERR(reply)) |
1064 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1071 | ovs_notify(reply, info, &ovs_dp_flow_multicast_group); |
1065 | ovs_dp_flow_multicast_group.id, info->nlhdr, | ||
1066 | GFP_KERNEL); | ||
1067 | else | 1072 | else |
1068 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, | 1073 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, |
1069 | ovs_dp_flow_multicast_group.id, PTR_ERR(reply)); | 1074 | ovs_dp_flow_multicast_group.id, PTR_ERR(reply)); |
@@ -1150,8 +1155,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1150 | 1155 | ||
1151 | ovs_flow_deferred_free(flow); | 1156 | ovs_flow_deferred_free(flow); |
1152 | 1157 | ||
1153 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1158 | ovs_notify(reply, info, &ovs_dp_flow_multicast_group); |
1154 | ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL); | ||
1155 | return 0; | 1159 | return 0; |
1156 | } | 1160 | } |
1157 | 1161 | ||
@@ -1383,9 +1387,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1383 | list_add_tail(&dp->list_node, &ovs_net->dps); | 1387 | list_add_tail(&dp->list_node, &ovs_net->dps); |
1384 | rtnl_unlock(); | 1388 | rtnl_unlock(); |
1385 | 1389 | ||
1386 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1390 | ovs_notify(reply, info, &ovs_dp_datapath_multicast_group); |
1387 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | ||
1388 | GFP_KERNEL); | ||
1389 | return 0; | 1391 | return 0; |
1390 | 1392 | ||
1391 | err_destroy_local_port: | 1393 | err_destroy_local_port: |
@@ -1453,9 +1455,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1453 | 1455 | ||
1454 | __dp_destroy(dp); | 1456 | __dp_destroy(dp); |
1455 | 1457 | ||
1456 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1458 | ovs_notify(reply, info, &ovs_dp_datapath_multicast_group); |
1457 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | ||
1458 | GFP_KERNEL); | ||
1459 | 1459 | ||
1460 | return 0; | 1460 | return 0; |
1461 | } | 1461 | } |
@@ -1479,9 +1479,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1479 | return 0; | 1479 | return 0; |
1480 | } | 1480 | } |
1481 | 1481 | ||
1482 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1482 | ovs_notify(reply, info, &ovs_dp_datapath_multicast_group); |
1483 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | ||
1484 | GFP_KERNEL); | ||
1485 | 1483 | ||
1486 | return 0; | 1484 | return 0; |
1487 | } | 1485 | } |
@@ -1727,8 +1725,8 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1727 | ovs_dp_detach_port(vport); | 1725 | ovs_dp_detach_port(vport); |
1728 | goto exit_unlock; | 1726 | goto exit_unlock; |
1729 | } | 1727 | } |
1730 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1728 | |
1731 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | 1729 | ovs_notify(reply, info, &ovs_dp_vport_multicast_group); |
1732 | 1730 | ||
1733 | exit_unlock: | 1731 | exit_unlock: |
1734 | rtnl_unlock(); | 1732 | rtnl_unlock(); |
@@ -1769,8 +1767,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1769 | goto exit_unlock; | 1767 | goto exit_unlock; |
1770 | } | 1768 | } |
1771 | 1769 | ||
1772 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1770 | ovs_notify(reply, info, &ovs_dp_vport_multicast_group); |
1773 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | ||
1774 | 1771 | ||
1775 | exit_unlock: | 1772 | exit_unlock: |
1776 | rtnl_unlock(); | 1773 | rtnl_unlock(); |
@@ -1804,8 +1801,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1804 | err = 0; | 1801 | err = 0; |
1805 | ovs_dp_detach_port(vport); | 1802 | ovs_dp_detach_port(vport); |
1806 | 1803 | ||
1807 | genl_notify(reply, genl_info_net(info), info->snd_portid, | 1804 | ovs_notify(reply, info, &ovs_dp_vport_multicast_group); |
1808 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | ||
1809 | 1805 | ||
1810 | exit_unlock: | 1806 | exit_unlock: |
1811 | rtnl_unlock(); | 1807 | rtnl_unlock(); |