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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -446,9 +446,13 @@ struct ovs_key_nd { · 445 unmodified lines | ||
| 446 | 446 | __u8 nd_tll[ETH_ALEN]; |
| 447 | 447 | }; |
| 448 | 448 | |
| 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)) | |
| 450 | 451 | 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 | + }; | |
| 452 | 456 | }; |
| 453 | 457 | |
| 454 | 458 | /* OVS_KEY_ATTR_CT_STATE flags */ |