datapath: Rearrange ovs_key_lens.
authorBen Pfaff <blp@nicira.com>
Fri, 11 Nov 2011 18:28:48 +0000 (10:28 -0800)
committerBen Pfaff <blp@nicira.com>
Sat, 12 Nov 2011 20:03:21 +0000 (12:03 -0800)
This seems clearer to me.  It should not cause any behavioral change.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/flow.c

index 152d9be749725f967eae0503d77a739a2252488d..9786c378a6e8da188991aa76aa5fa57ecf8036e7 100644 (file)
@@ -844,12 +844,11 @@ void flow_tbl_remove(struct flow_table *table, struct sw_flow *flow)
 
 /* The size of the argument for each %OVS_KEY_ATTR_* Netlink attribute.  */
 const u32 ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = {
-       [OVS_KEY_ATTR_PRIORITY] = 4,
-       [OVS_KEY_ATTR_TUN_ID] = 8,
-       [OVS_KEY_ATTR_IN_PORT] = 4,
+       [OVS_KEY_ATTR_PRIORITY] = sizeof(u32),
+       [OVS_KEY_ATTR_IN_PORT] = sizeof(u32),
        [OVS_KEY_ATTR_ETHERNET] = sizeof(struct ovs_key_ethernet),
        [OVS_KEY_ATTR_8021Q] = sizeof(struct ovs_key_8021q),
-       [OVS_KEY_ATTR_ETHERTYPE] = 2,
+       [OVS_KEY_ATTR_ETHERTYPE] = sizeof(__be16),
        [OVS_KEY_ATTR_IPV4] = sizeof(struct ovs_key_ipv4),
        [OVS_KEY_ATTR_IPV6] = sizeof(struct ovs_key_ipv6),
        [OVS_KEY_ATTR_TCP] = sizeof(struct ovs_key_tcp),
@@ -858,6 +857,9 @@ const u32 ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = {
        [OVS_KEY_ATTR_ICMPV6] = sizeof(struct ovs_key_icmpv6),
        [OVS_KEY_ATTR_ARP] = sizeof(struct ovs_key_arp),
        [OVS_KEY_ATTR_ND] = sizeof(struct ovs_key_nd),
+
+       /* Not upstream. */
+       [OVS_KEY_ATTR_TUN_ID] = sizeof(__be64),
 };
 
 /**