aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-03-17 12:58:47 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-17 12:58:47 -0400
commit86feff3f3eb643cc5735d414e46a8201a8c67b8f (patch)
tree45e344303aec36f5c30456e0c7f3c38161ace7a5 /net/openvswitch/datapath.c
parent1f9061d27d3d2028805549c4a306324a48209057 (diff)
parent4490108b4a5ada14c7be712260829faecc814ae5 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Conflicts: net/openvswitch/vport-internal_dev.c Jesse Gross says: ==================== A couple of minor enhancements for net-next/3.10. The largest is an extension to allow variable length metadata to be passed to userspace with packets. There is a merge conflict in net/openvswitch/vport-internal_dev.c: A existing commit modifies internal_dev_mac_addr() and a new commit deletes it. The new one is correct, so you can just remove that function. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e87a26506dba..43b4ac1bcd10 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -369,8 +369,8 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
369 len = sizeof(struct ovs_header); 369 len = sizeof(struct ovs_header);
370 len += nla_total_size(skb->len); 370 len += nla_total_size(skb->len);
371 len += nla_total_size(FLOW_BUFSIZE); 371 len += nla_total_size(FLOW_BUFSIZE);
372 if (upcall_info->cmd == OVS_PACKET_CMD_ACTION) 372 if (upcall_info->userdata)
373 len += nla_total_size(8); 373 len += NLA_ALIGN(upcall_info->userdata->nla_len);
374 374
375 user_skb = genlmsg_new(len, GFP_ATOMIC); 375 user_skb = genlmsg_new(len, GFP_ATOMIC);
376 if (!user_skb) { 376 if (!user_skb) {
@@ -387,8 +387,9 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
387 nla_nest_end(user_skb, nla); 387 nla_nest_end(user_skb, nla);
388 388
389 if (upcall_info->userdata) 389 if (upcall_info->userdata)
390 nla_put_u64(user_skb, OVS_PACKET_ATTR_USERDATA, 390 __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
391 nla_get_u64(upcall_info->userdata)); 391 nla_len(upcall_info->userdata),
392 nla_data(upcall_info->userdata));
392 393
393 nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len); 394 nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len);
394 395
@@ -543,7 +544,7 @@ static int validate_userspace(const struct nlattr *attr)
543{ 544{
544 static const struct nla_policy userspace_policy[OVS_USERSPACE_ATTR_MAX + 1] = { 545 static const struct nla_policy userspace_policy[OVS_USERSPACE_ATTR_MAX + 1] = {
545 [OVS_USERSPACE_ATTR_PID] = {.type = NLA_U32 }, 546 [OVS_USERSPACE_ATTR_PID] = {.type = NLA_U32 },
546 [OVS_USERSPACE_ATTR_USERDATA] = {.type = NLA_U64 }, 547 [OVS_USERSPACE_ATTR_USERDATA] = {.type = NLA_UNSPEC },
547 }; 548 };
548 struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; 549 struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1];
549 int error; 550 int error;
@@ -1627,7 +1628,7 @@ static struct vport *lookup_vport(struct net *net,
1627 1628
1628 vport = ovs_vport_rtnl_rcu(dp, port_no); 1629 vport = ovs_vport_rtnl_rcu(dp, port_no);
1629 if (!vport) 1630 if (!vport)
1630 return ERR_PTR(-ENOENT); 1631 return ERR_PTR(-ENODEV);
1631 return vport; 1632 return vport;
1632 } else 1633 } else
1633 return ERR_PTR(-EINVAL); 1634 return ERR_PTR(-EINVAL);