aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorJoe Stringer <joestringer@nicira.com>2014-10-18 19:14:14 -0400
committerPravin B Shelar <pshelar@nicira.com>2014-11-06 02:52:35 -0500
commit41af73e9c17d5fb549fced2be97faeb4b8606fb8 (patch)
treef2e52b72eee266b9d947e58fb778330ddd023c79 /net/openvswitch/datapath.c
parentd98612b8c1150cb73ecd45e94c62de053f89441c (diff)
openvswitch: Move key_attr_size() to flow_netlink.h.
flow-netlink has netlink related code. Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 4fd8a45e5d56..51017805b40b 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -375,37 +375,12 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
375 return err; 375 return err;
376} 376}
377 377
378static size_t key_attr_size(void)
379{
380 return nla_total_size(4) /* OVS_KEY_ATTR_PRIORITY */
381 + nla_total_size(0) /* OVS_KEY_ATTR_TUNNEL */
382 + nla_total_size(8) /* OVS_TUNNEL_KEY_ATTR_ID */
383 + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_SRC */
384 + nla_total_size(4) /* OVS_TUNNEL_KEY_ATTR_IPV4_DST */
385 + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TOS */
386 + nla_total_size(1) /* OVS_TUNNEL_KEY_ATTR_TTL */
387 + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT */
388 + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_CSUM */
389 + nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_OAM */
390 + nla_total_size(256) /* OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS */
391 + nla_total_size(4) /* OVS_KEY_ATTR_IN_PORT */
392 + nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */
393 + nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */
394 + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */
395 + nla_total_size(4) /* OVS_KEY_ATTR_8021Q */
396 + nla_total_size(0) /* OVS_KEY_ATTR_ENCAP */
397 + nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */
398 + nla_total_size(40) /* OVS_KEY_ATTR_IPV6 */
399 + nla_total_size(2) /* OVS_KEY_ATTR_ICMPV6 */
400 + nla_total_size(28); /* OVS_KEY_ATTR_ND */
401}
402
403static size_t upcall_msg_size(const struct nlattr *userdata, 378static size_t upcall_msg_size(const struct nlattr *userdata,
404 unsigned int hdrlen) 379 unsigned int hdrlen)
405{ 380{
406 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header)) 381 size_t size = NLMSG_ALIGN(sizeof(struct ovs_header))
407 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */ 382 + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */
408 + nla_total_size(key_attr_size()); /* OVS_PACKET_ATTR_KEY */ 383 + nla_total_size(ovs_key_attr_size()); /* OVS_PACKET_ATTR_KEY */
409 384
410 /* OVS_PACKET_ATTR_USERDATA */ 385 /* OVS_PACKET_ATTR_USERDATA */
411 if (userdata) 386 if (userdata)
@@ -678,8 +653,8 @@ static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats,
678static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts) 653static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts)
679{ 654{
680 return NLMSG_ALIGN(sizeof(struct ovs_header)) 655 return NLMSG_ALIGN(sizeof(struct ovs_header))
681 + nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_KEY */ 656 + nla_total_size(ovs_key_attr_size()) /* OVS_FLOW_ATTR_KEY */
682 + nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_MASK */ 657 + nla_total_size(ovs_key_attr_size()) /* OVS_FLOW_ATTR_MASK */
683 + nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */ 658 + nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */
684 + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */ 659 + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */
685 + nla_total_size(8) /* OVS_FLOW_ATTR_USED */ 660 + nla_total_size(8) /* OVS_FLOW_ATTR_USED */