diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-07 16:12:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-10 15:30:41 -0400 |
commit | 15e473046cb6e5d18a4d0057e61d76315230382b (patch) | |
tree | 893d2df5d46a6ce156933ac57a1398f0ad22b889 /net/openvswitch/datapath.c | |
parent | 9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (diff) |
netlink: Rename pid to portid to avoid confusion
It is a frequent mistake to confuse the netlink port identifier with a
process identifier. Try to reduce this confusion by renaming fields
that hold port identifiers portid instead of pid.
I have carefully avoided changing the structures exported to
userspace to avoid changing the userspace API.
I have successfully built an allyesconfig kernel with this change.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 105a0b5adc51..56327e877ed9 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -225,7 +225,7 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) | |||
225 | upcall.cmd = OVS_PACKET_CMD_MISS; | 225 | upcall.cmd = OVS_PACKET_CMD_MISS; |
226 | upcall.key = &key; | 226 | upcall.key = &key; |
227 | upcall.userdata = NULL; | 227 | upcall.userdata = NULL; |
228 | upcall.pid = p->upcall_pid; | 228 | upcall.portid = p->upcall_portid; |
229 | ovs_dp_upcall(dp, skb, &upcall); | 229 | ovs_dp_upcall(dp, skb, &upcall); |
230 | consume_skb(skb); | 230 | consume_skb(skb); |
231 | stats_counter = &stats->n_missed; | 231 | stats_counter = &stats->n_missed; |
@@ -261,7 +261,7 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb, | |||
261 | int dp_ifindex; | 261 | int dp_ifindex; |
262 | int err; | 262 | int err; |
263 | 263 | ||
264 | if (upcall_info->pid == 0) { | 264 | if (upcall_info->portid == 0) { |
265 | err = -ENOTCONN; | 265 | err = -ENOTCONN; |
266 | goto err; | 266 | goto err; |
267 | } | 267 | } |
@@ -395,7 +395,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex, | |||
395 | 395 | ||
396 | skb_copy_and_csum_dev(skb, nla_data(nla)); | 396 | skb_copy_and_csum_dev(skb, nla_data(nla)); |
397 | 397 | ||
398 | err = genlmsg_unicast(net, user_skb, upcall_info->pid); | 398 | err = genlmsg_unicast(net, user_skb, upcall_info->portid); |
399 | 399 | ||
400 | out: | 400 | out: |
401 | kfree_skb(nskb); | 401 | kfree_skb(nskb); |
@@ -780,7 +780,7 @@ static struct genl_multicast_group ovs_dp_flow_multicast_group = { | |||
780 | 780 | ||
781 | /* Called with genl_lock. */ | 781 | /* Called with genl_lock. */ |
782 | static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp, | 782 | static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp, |
783 | struct sk_buff *skb, u32 pid, | 783 | struct sk_buff *skb, u32 portid, |
784 | u32 seq, u32 flags, u8 cmd) | 784 | u32 seq, u32 flags, u8 cmd) |
785 | { | 785 | { |
786 | const int skb_orig_len = skb->len; | 786 | const int skb_orig_len = skb->len; |
@@ -795,7 +795,7 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp, | |||
795 | sf_acts = rcu_dereference_protected(flow->sf_acts, | 795 | sf_acts = rcu_dereference_protected(flow->sf_acts, |
796 | lockdep_genl_is_held()); | 796 | lockdep_genl_is_held()); |
797 | 797 | ||
798 | ovs_header = genlmsg_put(skb, pid, seq, &dp_flow_genl_family, flags, cmd); | 798 | ovs_header = genlmsg_put(skb, portid, seq, &dp_flow_genl_family, flags, cmd); |
799 | if (!ovs_header) | 799 | if (!ovs_header) |
800 | return -EMSGSIZE; | 800 | return -EMSGSIZE; |
801 | 801 | ||
@@ -879,7 +879,7 @@ static struct sk_buff *ovs_flow_cmd_alloc_info(struct sw_flow *flow) | |||
879 | 879 | ||
880 | static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow, | 880 | static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow, |
881 | struct datapath *dp, | 881 | struct datapath *dp, |
882 | u32 pid, u32 seq, u8 cmd) | 882 | u32 portid, u32 seq, u8 cmd) |
883 | { | 883 | { |
884 | struct sk_buff *skb; | 884 | struct sk_buff *skb; |
885 | int retval; | 885 | int retval; |
@@ -888,7 +888,7 @@ static struct sk_buff *ovs_flow_cmd_build_info(struct sw_flow *flow, | |||
888 | if (!skb) | 888 | if (!skb) |
889 | return ERR_PTR(-ENOMEM); | 889 | return ERR_PTR(-ENOMEM); |
890 | 890 | ||
891 | retval = ovs_flow_cmd_fill_info(flow, dp, skb, pid, seq, 0, cmd); | 891 | retval = ovs_flow_cmd_fill_info(flow, dp, skb, portid, seq, 0, cmd); |
892 | BUG_ON(retval < 0); | 892 | BUG_ON(retval < 0); |
893 | return skb; | 893 | return skb; |
894 | } | 894 | } |
@@ -970,7 +970,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info) | |||
970 | flow->hash = ovs_flow_hash(&key, key_len); | 970 | flow->hash = ovs_flow_hash(&key, key_len); |
971 | ovs_flow_tbl_insert(table, flow); | 971 | ovs_flow_tbl_insert(table, flow); |
972 | 972 | ||
973 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, | 973 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid, |
974 | info->snd_seq, | 974 | info->snd_seq, |
975 | OVS_FLOW_CMD_NEW); | 975 | OVS_FLOW_CMD_NEW); |
976 | } else { | 976 | } else { |
@@ -1008,7 +1008,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info) | |||
1008 | ovs_flow_deferred_free_acts(old_acts); | 1008 | ovs_flow_deferred_free_acts(old_acts); |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, | 1011 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid, |
1012 | info->snd_seq, OVS_FLOW_CMD_NEW); | 1012 | info->snd_seq, OVS_FLOW_CMD_NEW); |
1013 | 1013 | ||
1014 | /* Clear stats. */ | 1014 | /* Clear stats. */ |
@@ -1020,7 +1020,7 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info) | |||
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | if (!IS_ERR(reply)) | 1022 | if (!IS_ERR(reply)) |
1023 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1023 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1024 | ovs_dp_flow_multicast_group.id, info->nlhdr, | 1024 | ovs_dp_flow_multicast_group.id, info->nlhdr, |
1025 | GFP_KERNEL); | 1025 | GFP_KERNEL); |
1026 | else | 1026 | else |
@@ -1061,7 +1061,7 @@ static int ovs_flow_cmd_get(struct sk_buff *skb, struct genl_info *info) | |||
1061 | if (!flow) | 1061 | if (!flow) |
1062 | return -ENOENT; | 1062 | return -ENOENT; |
1063 | 1063 | ||
1064 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_pid, | 1064 | reply = ovs_flow_cmd_build_info(flow, dp, info->snd_portid, |
1065 | info->snd_seq, OVS_FLOW_CMD_NEW); | 1065 | info->snd_seq, OVS_FLOW_CMD_NEW); |
1066 | if (IS_ERR(reply)) | 1066 | if (IS_ERR(reply)) |
1067 | return PTR_ERR(reply); | 1067 | return PTR_ERR(reply); |
@@ -1103,13 +1103,13 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1103 | 1103 | ||
1104 | ovs_flow_tbl_remove(table, flow); | 1104 | ovs_flow_tbl_remove(table, flow); |
1105 | 1105 | ||
1106 | err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_pid, | 1106 | err = ovs_flow_cmd_fill_info(flow, dp, reply, info->snd_portid, |
1107 | info->snd_seq, 0, OVS_FLOW_CMD_DEL); | 1107 | info->snd_seq, 0, OVS_FLOW_CMD_DEL); |
1108 | BUG_ON(err < 0); | 1108 | BUG_ON(err < 0); |
1109 | 1109 | ||
1110 | ovs_flow_deferred_free(flow); | 1110 | ovs_flow_deferred_free(flow); |
1111 | 1111 | ||
1112 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1112 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1113 | ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL); | 1113 | ovs_dp_flow_multicast_group.id, info->nlhdr, GFP_KERNEL); |
1114 | return 0; | 1114 | return 0; |
1115 | } | 1115 | } |
@@ -1137,7 +1137,7 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1137 | break; | 1137 | break; |
1138 | 1138 | ||
1139 | if (ovs_flow_cmd_fill_info(flow, dp, skb, | 1139 | if (ovs_flow_cmd_fill_info(flow, dp, skb, |
1140 | NETLINK_CB(cb->skb).pid, | 1140 | NETLINK_CB(cb->skb).portid, |
1141 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 1141 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
1142 | OVS_FLOW_CMD_NEW) < 0) | 1142 | OVS_FLOW_CMD_NEW) < 0) |
1143 | break; | 1143 | break; |
@@ -1191,13 +1191,13 @@ static struct genl_multicast_group ovs_dp_datapath_multicast_group = { | |||
1191 | }; | 1191 | }; |
1192 | 1192 | ||
1193 | static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb, | 1193 | static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb, |
1194 | u32 pid, u32 seq, u32 flags, u8 cmd) | 1194 | u32 portid, u32 seq, u32 flags, u8 cmd) |
1195 | { | 1195 | { |
1196 | struct ovs_header *ovs_header; | 1196 | struct ovs_header *ovs_header; |
1197 | struct ovs_dp_stats dp_stats; | 1197 | struct ovs_dp_stats dp_stats; |
1198 | int err; | 1198 | int err; |
1199 | 1199 | ||
1200 | ovs_header = genlmsg_put(skb, pid, seq, &dp_datapath_genl_family, | 1200 | ovs_header = genlmsg_put(skb, portid, seq, &dp_datapath_genl_family, |
1201 | flags, cmd); | 1201 | flags, cmd); |
1202 | if (!ovs_header) | 1202 | if (!ovs_header) |
1203 | goto error; | 1203 | goto error; |
@@ -1222,7 +1222,7 @@ error: | |||
1222 | return -EMSGSIZE; | 1222 | return -EMSGSIZE; |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid, | 1225 | static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 portid, |
1226 | u32 seq, u8 cmd) | 1226 | u32 seq, u8 cmd) |
1227 | { | 1227 | { |
1228 | struct sk_buff *skb; | 1228 | struct sk_buff *skb; |
@@ -1232,7 +1232,7 @@ static struct sk_buff *ovs_dp_cmd_build_info(struct datapath *dp, u32 pid, | |||
1232 | if (!skb) | 1232 | if (!skb) |
1233 | return ERR_PTR(-ENOMEM); | 1233 | return ERR_PTR(-ENOMEM); |
1234 | 1234 | ||
1235 | retval = ovs_dp_cmd_fill_info(dp, skb, pid, seq, 0, cmd); | 1235 | retval = ovs_dp_cmd_fill_info(dp, skb, portid, seq, 0, cmd); |
1236 | if (retval < 0) { | 1236 | if (retval < 0) { |
1237 | kfree_skb(skb); | 1237 | kfree_skb(skb); |
1238 | return ERR_PTR(retval); | 1238 | return ERR_PTR(retval); |
@@ -1311,7 +1311,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1311 | parms.options = NULL; | 1311 | parms.options = NULL; |
1312 | parms.dp = dp; | 1312 | parms.dp = dp; |
1313 | parms.port_no = OVSP_LOCAL; | 1313 | parms.port_no = OVSP_LOCAL; |
1314 | parms.upcall_pid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]); | 1314 | parms.upcall_portid = nla_get_u32(a[OVS_DP_ATTR_UPCALL_PID]); |
1315 | 1315 | ||
1316 | vport = new_vport(&parms); | 1316 | vport = new_vport(&parms); |
1317 | if (IS_ERR(vport)) { | 1317 | if (IS_ERR(vport)) { |
@@ -1322,7 +1322,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1322 | goto err_destroy_ports_array; | 1322 | goto err_destroy_ports_array; |
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | reply = ovs_dp_cmd_build_info(dp, info->snd_pid, | 1325 | reply = ovs_dp_cmd_build_info(dp, info->snd_portid, |
1326 | info->snd_seq, OVS_DP_CMD_NEW); | 1326 | info->snd_seq, OVS_DP_CMD_NEW); |
1327 | err = PTR_ERR(reply); | 1327 | err = PTR_ERR(reply); |
1328 | if (IS_ERR(reply)) | 1328 | if (IS_ERR(reply)) |
@@ -1332,7 +1332,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1332 | list_add_tail(&dp->list_node, &ovs_net->dps); | 1332 | list_add_tail(&dp->list_node, &ovs_net->dps); |
1333 | rtnl_unlock(); | 1333 | rtnl_unlock(); |
1334 | 1334 | ||
1335 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1335 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1336 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | 1336 | ovs_dp_datapath_multicast_group.id, info->nlhdr, |
1337 | GFP_KERNEL); | 1337 | GFP_KERNEL); |
1338 | return 0; | 1338 | return 0; |
@@ -1394,7 +1394,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1394 | if (IS_ERR(dp)) | 1394 | if (IS_ERR(dp)) |
1395 | return err; | 1395 | return err; |
1396 | 1396 | ||
1397 | reply = ovs_dp_cmd_build_info(dp, info->snd_pid, | 1397 | reply = ovs_dp_cmd_build_info(dp, info->snd_portid, |
1398 | info->snd_seq, OVS_DP_CMD_DEL); | 1398 | info->snd_seq, OVS_DP_CMD_DEL); |
1399 | err = PTR_ERR(reply); | 1399 | err = PTR_ERR(reply); |
1400 | if (IS_ERR(reply)) | 1400 | if (IS_ERR(reply)) |
@@ -1402,7 +1402,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1402 | 1402 | ||
1403 | __dp_destroy(dp); | 1403 | __dp_destroy(dp); |
1404 | 1404 | ||
1405 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1405 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1406 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | 1406 | ovs_dp_datapath_multicast_group.id, info->nlhdr, |
1407 | GFP_KERNEL); | 1407 | GFP_KERNEL); |
1408 | 1408 | ||
@@ -1419,7 +1419,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1419 | if (IS_ERR(dp)) | 1419 | if (IS_ERR(dp)) |
1420 | return PTR_ERR(dp); | 1420 | return PTR_ERR(dp); |
1421 | 1421 | ||
1422 | reply = ovs_dp_cmd_build_info(dp, info->snd_pid, | 1422 | reply = ovs_dp_cmd_build_info(dp, info->snd_portid, |
1423 | info->snd_seq, OVS_DP_CMD_NEW); | 1423 | info->snd_seq, OVS_DP_CMD_NEW); |
1424 | if (IS_ERR(reply)) { | 1424 | if (IS_ERR(reply)) { |
1425 | err = PTR_ERR(reply); | 1425 | err = PTR_ERR(reply); |
@@ -1428,7 +1428,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1428 | return 0; | 1428 | return 0; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1431 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1432 | ovs_dp_datapath_multicast_group.id, info->nlhdr, | 1432 | ovs_dp_datapath_multicast_group.id, info->nlhdr, |
1433 | GFP_KERNEL); | 1433 | GFP_KERNEL); |
1434 | 1434 | ||
@@ -1444,7 +1444,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info) | |||
1444 | if (IS_ERR(dp)) | 1444 | if (IS_ERR(dp)) |
1445 | return PTR_ERR(dp); | 1445 | return PTR_ERR(dp); |
1446 | 1446 | ||
1447 | reply = ovs_dp_cmd_build_info(dp, info->snd_pid, | 1447 | reply = ovs_dp_cmd_build_info(dp, info->snd_portid, |
1448 | info->snd_seq, OVS_DP_CMD_NEW); | 1448 | info->snd_seq, OVS_DP_CMD_NEW); |
1449 | if (IS_ERR(reply)) | 1449 | if (IS_ERR(reply)) |
1450 | return PTR_ERR(reply); | 1450 | return PTR_ERR(reply); |
@@ -1461,7 +1461,7 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1461 | 1461 | ||
1462 | list_for_each_entry(dp, &ovs_net->dps, list_node) { | 1462 | list_for_each_entry(dp, &ovs_net->dps, list_node) { |
1463 | if (i >= skip && | 1463 | if (i >= skip && |
1464 | ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).pid, | 1464 | ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).portid, |
1465 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 1465 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
1466 | OVS_DP_CMD_NEW) < 0) | 1466 | OVS_DP_CMD_NEW) < 0) |
1467 | break; | 1467 | break; |
@@ -1521,13 +1521,13 @@ struct genl_multicast_group ovs_dp_vport_multicast_group = { | |||
1521 | 1521 | ||
1522 | /* Called with RTNL lock or RCU read lock. */ | 1522 | /* Called with RTNL lock or RCU read lock. */ |
1523 | static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, | 1523 | static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, |
1524 | u32 pid, u32 seq, u32 flags, u8 cmd) | 1524 | u32 portid, u32 seq, u32 flags, u8 cmd) |
1525 | { | 1525 | { |
1526 | struct ovs_header *ovs_header; | 1526 | struct ovs_header *ovs_header; |
1527 | struct ovs_vport_stats vport_stats; | 1527 | struct ovs_vport_stats vport_stats; |
1528 | int err; | 1528 | int err; |
1529 | 1529 | ||
1530 | ovs_header = genlmsg_put(skb, pid, seq, &dp_vport_genl_family, | 1530 | ovs_header = genlmsg_put(skb, portid, seq, &dp_vport_genl_family, |
1531 | flags, cmd); | 1531 | flags, cmd); |
1532 | if (!ovs_header) | 1532 | if (!ovs_header) |
1533 | return -EMSGSIZE; | 1533 | return -EMSGSIZE; |
@@ -1537,7 +1537,7 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, | |||
1537 | if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) || | 1537 | if (nla_put_u32(skb, OVS_VPORT_ATTR_PORT_NO, vport->port_no) || |
1538 | nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) || | 1538 | nla_put_u32(skb, OVS_VPORT_ATTR_TYPE, vport->ops->type) || |
1539 | nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) || | 1539 | nla_put_string(skb, OVS_VPORT_ATTR_NAME, vport->ops->get_name(vport)) || |
1540 | nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_pid)) | 1540 | nla_put_u32(skb, OVS_VPORT_ATTR_UPCALL_PID, vport->upcall_portid)) |
1541 | goto nla_put_failure; | 1541 | goto nla_put_failure; |
1542 | 1542 | ||
1543 | ovs_vport_get_stats(vport, &vport_stats); | 1543 | ovs_vport_get_stats(vport, &vport_stats); |
@@ -1559,7 +1559,7 @@ error: | |||
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | /* Called with RTNL lock or RCU read lock. */ | 1561 | /* Called with RTNL lock or RCU read lock. */ |
1562 | struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid, | 1562 | struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid, |
1563 | u32 seq, u8 cmd) | 1563 | u32 seq, u8 cmd) |
1564 | { | 1564 | { |
1565 | struct sk_buff *skb; | 1565 | struct sk_buff *skb; |
@@ -1569,7 +1569,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 pid, | |||
1569 | if (!skb) | 1569 | if (!skb) |
1570 | return ERR_PTR(-ENOMEM); | 1570 | return ERR_PTR(-ENOMEM); |
1571 | 1571 | ||
1572 | retval = ovs_vport_cmd_fill_info(vport, skb, pid, seq, 0, cmd); | 1572 | retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd); |
1573 | if (retval < 0) { | 1573 | if (retval < 0) { |
1574 | kfree_skb(skb); | 1574 | kfree_skb(skb); |
1575 | return ERR_PTR(retval); | 1575 | return ERR_PTR(retval); |
@@ -1661,21 +1661,21 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1661 | parms.options = a[OVS_VPORT_ATTR_OPTIONS]; | 1661 | parms.options = a[OVS_VPORT_ATTR_OPTIONS]; |
1662 | parms.dp = dp; | 1662 | parms.dp = dp; |
1663 | parms.port_no = port_no; | 1663 | parms.port_no = port_no; |
1664 | parms.upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); | 1664 | parms.upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); |
1665 | 1665 | ||
1666 | vport = new_vport(&parms); | 1666 | vport = new_vport(&parms); |
1667 | err = PTR_ERR(vport); | 1667 | err = PTR_ERR(vport); |
1668 | if (IS_ERR(vport)) | 1668 | if (IS_ERR(vport)) |
1669 | goto exit_unlock; | 1669 | goto exit_unlock; |
1670 | 1670 | ||
1671 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, | 1671 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, |
1672 | OVS_VPORT_CMD_NEW); | 1672 | OVS_VPORT_CMD_NEW); |
1673 | if (IS_ERR(reply)) { | 1673 | if (IS_ERR(reply)) { |
1674 | err = PTR_ERR(reply); | 1674 | err = PTR_ERR(reply); |
1675 | ovs_dp_detach_port(vport); | 1675 | ovs_dp_detach_port(vport); |
1676 | goto exit_unlock; | 1676 | goto exit_unlock; |
1677 | } | 1677 | } |
1678 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1678 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1679 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | 1679 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); |
1680 | 1680 | ||
1681 | exit_unlock: | 1681 | exit_unlock: |
@@ -1707,9 +1707,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1707 | if (err) | 1707 | if (err) |
1708 | goto exit_unlock; | 1708 | goto exit_unlock; |
1709 | if (a[OVS_VPORT_ATTR_UPCALL_PID]) | 1709 | if (a[OVS_VPORT_ATTR_UPCALL_PID]) |
1710 | vport->upcall_pid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); | 1710 | vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); |
1711 | 1711 | ||
1712 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, | 1712 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, |
1713 | OVS_VPORT_CMD_NEW); | 1713 | OVS_VPORT_CMD_NEW); |
1714 | if (IS_ERR(reply)) { | 1714 | if (IS_ERR(reply)) { |
1715 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, | 1715 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, |
@@ -1717,7 +1717,7 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1717 | goto exit_unlock; | 1717 | goto exit_unlock; |
1718 | } | 1718 | } |
1719 | 1719 | ||
1720 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1720 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1721 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | 1721 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); |
1722 | 1722 | ||
1723 | exit_unlock: | 1723 | exit_unlock: |
@@ -1743,7 +1743,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1743 | goto exit_unlock; | 1743 | goto exit_unlock; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, | 1746 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, |
1747 | OVS_VPORT_CMD_DEL); | 1747 | OVS_VPORT_CMD_DEL); |
1748 | err = PTR_ERR(reply); | 1748 | err = PTR_ERR(reply); |
1749 | if (IS_ERR(reply)) | 1749 | if (IS_ERR(reply)) |
@@ -1751,7 +1751,7 @@ static int ovs_vport_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
1751 | 1751 | ||
1752 | ovs_dp_detach_port(vport); | 1752 | ovs_dp_detach_port(vport); |
1753 | 1753 | ||
1754 | genl_notify(reply, genl_info_net(info), info->snd_pid, | 1754 | genl_notify(reply, genl_info_net(info), info->snd_portid, |
1755 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); | 1755 | ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); |
1756 | 1756 | ||
1757 | exit_unlock: | 1757 | exit_unlock: |
@@ -1773,7 +1773,7 @@ static int ovs_vport_cmd_get(struct sk_buff *skb, struct genl_info *info) | |||
1773 | if (IS_ERR(vport)) | 1773 | if (IS_ERR(vport)) |
1774 | goto exit_unlock; | 1774 | goto exit_unlock; |
1775 | 1775 | ||
1776 | reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, | 1776 | reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, |
1777 | OVS_VPORT_CMD_NEW); | 1777 | OVS_VPORT_CMD_NEW); |
1778 | err = PTR_ERR(reply); | 1778 | err = PTR_ERR(reply); |
1779 | if (IS_ERR(reply)) | 1779 | if (IS_ERR(reply)) |
@@ -1808,7 +1808,7 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1808 | hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) { | 1808 | hlist_for_each_entry_rcu(vport, n, &dp->ports[i], dp_hash_node) { |
1809 | if (j >= skip && | 1809 | if (j >= skip && |
1810 | ovs_vport_cmd_fill_info(vport, skb, | 1810 | ovs_vport_cmd_fill_info(vport, skb, |
1811 | NETLINK_CB(cb->skb).pid, | 1811 | NETLINK_CB(cb->skb).portid, |
1812 | cb->nlh->nlmsg_seq, | 1812 | cb->nlh->nlmsg_seq, |
1813 | NLM_F_MULTI, | 1813 | NLM_F_MULTI, |
1814 | OVS_VPORT_CMD_NEW) < 0) | 1814 | OVS_VPORT_CMD_NEW) < 0) |