.mask = &(const struct rte_flow_item_eth){
.dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.src.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+ .type = -1,
},
.default_mask = &rte_flow_item_eth_mask,
.mask_sz = sizeof(struct rte_flow_item_eth),
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
},
+ .vtc_flow = -1,
+ .proto = -1,
+ .hop_limits = -1,
},
},
.default_mask = &rte_flow_item_ipv6_mask,
.mask_sz = sizeof(struct rte_flow_item_ipv6),
.convert = mlx5_flow_create_ipv6,
- .dst_sz = sizeof(struct ibv_exp_flow_spec_ipv6),
+ .dst_sz = sizeof(struct ibv_exp_flow_spec_ipv6_ext),
},
[RTE_FLOW_ITEM_TYPE_UDP] = {
.items = ITEMS(RTE_FLOW_ITEM_TYPE_VXLAN),
mask = default_mask;
memcpy(eth->val.dst_mac, spec->dst.addr_bytes, ETHER_ADDR_LEN);
memcpy(eth->val.src_mac, spec->src.addr_bytes, ETHER_ADDR_LEN);
+ eth->val.ether_type = spec->type;
memcpy(eth->mask.dst_mac, mask->dst.addr_bytes, ETHER_ADDR_LEN);
memcpy(eth->mask.src_mac, mask->src.addr_bytes, ETHER_ADDR_LEN);
+ eth->mask.ether_type = mask->type;
/* Remove unwanted bits from values. */
for (i = 0; i < ETHER_ADDR_LEN; ++i) {
eth->val.dst_mac[i] &= eth->mask.dst_mac[i];
eth->val.src_mac[i] &= eth->mask.src_mac[i];
}
+ eth->val.ether_type &= eth->mask.ether_type;
return 0;
}
const struct rte_flow_item_ipv6 *spec = item->spec;
const struct rte_flow_item_ipv6 *mask = item->mask;
struct mlx5_flow *flow = (struct mlx5_flow *)data;
- struct ibv_exp_flow_spec_ipv6 *ipv6;
- unsigned int ipv6_size = sizeof(struct ibv_exp_flow_spec_ipv6);
- unsigned int i;
+ struct ibv_exp_flow_spec_ipv6_ext *ipv6;
+ unsigned int ipv6_size = sizeof(struct ibv_exp_flow_spec_ipv6_ext);
++flow->ibv_attr->num_of_specs;
flow->ibv_attr->priority = 1;
ipv6 = (void *)((uintptr_t)flow->ibv_attr + flow->offset);
- *ipv6 = (struct ibv_exp_flow_spec_ipv6) {
- .type = flow->inner | IBV_EXP_FLOW_SPEC_IPV6,
+ *ipv6 = (struct ibv_exp_flow_spec_ipv6_ext) {
+ .type = flow->inner | IBV_EXP_FLOW_SPEC_IPV6_EXT,
.size = ipv6_size,
};
if (!spec)
RTE_DIM(ipv6->mask.src_ip));
memcpy(ipv6->mask.dst_ip, mask->hdr.dst_addr,
RTE_DIM(ipv6->mask.dst_ip));
- /* Remove unwanted bits from values. */
- for (i = 0; i < RTE_DIM(ipv6->val.src_ip); ++i) {
- ipv6->val.src_ip[i] &= ipv6->mask.src_ip[i];
- ipv6->val.dst_ip[i] &= ipv6->mask.dst_ip[i];
- }
+ ipv6->mask.flow_label = mask->hdr.vtc_flow;
+ ipv6->mask.next_hdr = mask->hdr.proto;
+ ipv6->mask.hop_limit = mask->hdr.hop_limits;
+ ipv6->val.flow_label &= ipv6->mask.flow_label;
+ ipv6->val.next_hdr &= ipv6->mask.next_hdr;
+ ipv6->val.hop_limit &= ipv6->mask.hop_limit;
return 0;
}
ibv_exp_destroy_wq(rte_flow->wq);
if (!rte_flow->rxq && rte_flow->cq)
ibv_destroy_cq(rte_flow->cq);
- rte_free(rte_flow->ibv_attr);
rte_free(rte_flow);
return NULL;
}
}
rte_flow = priv_flow_create_action_queue(priv, flow.ibv_attr,
&action, error);
+ if (!rte_flow)
+ goto exit;
return rte_flow;
exit:
rte_free(flow.ibv_attr);