+
+ /*
+ * No padding must be inserted by the compiler between attr and spec.
+ * This layout is expected by libibverbs.
+ */
+ assert(((uint8_t *)attr + sizeof(*attr)) == (uint8_t *)spec);
+ priv_flow_attr(priv, attr, sizeof(data), hash_rxq->type);
+ /* The first specification must be Ethernet. */
+ assert(spec->type == IBV_EXP_FLOW_SPEC_ETH);
+ assert(spec->size == sizeof(*spec));
+
+ mac = special_flow_init[flow_type].dst_mac_val;
+ mask = special_flow_init[flow_type].dst_mac_mask;
+ *spec = (struct ibv_exp_flow_spec_eth){
+ .type = IBV_EXP_FLOW_SPEC_ETH,
+ .size = sizeof(*spec),
+ .val = {
+ .dst_mac = {
+ mac[0], mac[1], mac[2],
+ mac[3], mac[4], mac[5],
+ },
+ .vlan_tag = (vlan_enabled ? htons(vlan_id) : 0),
+ },
+ .mask = {
+ .dst_mac = {
+ mask[0], mask[1], mask[2],
+ mask[3], mask[4], mask[5],
+ },
+ .vlan_tag = (vlan_enabled ? htons(0xfff) : 0),
+ },
+ };
+