History

openvswitch: Unionize ovs_key_ct_label with a u32 array.

Make the array of labels in struct ovs_key_ct_label an union, adding a u32 array of the same byte size as the existing u8 array. It is faster to loop through the labels 32 bits at the time, which is also the alignment of netlink attributes.

Jarno Rajahalme committed 9 years ago

Commit cb80d581 parent 193e3092 files · +14 −9Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/openvswitch.h+6−2
@@ -446,9 +446,13 @@ struct ovs_key_nd { · 445 unmodified lines
446446 __u8 nd_tll[ETH_ALEN];
447447 };
448448
449−#define OVS_CT_LABELS_LEN 16
449+#define OVS_CT_LABELS_LEN_32 4
450+#define OVS_CT_LABELS_LEN (OVS_CT_LABELS_LEN_32 * sizeof(__u32))
450451 struct ovs_key_ct_labels {
451− __u8 ct_labels[OVS_CT_LABELS_LEN];
452+ union {
453+ __u8 ct_labels[OVS_CT_LABELS_LEN];
454+ __u32 ct_labels_32[OVS_CT_LABELS_LEN_32];
455+ };
452456 };
453457
454458 /* OVS_KEY_ATTR_CT_STATE flags */