[v2,4/5] net/mlx5/hws: support IP version matching for non relaxed
Checks
Commit Message
Enable matching on IP version explicitly for non relaxed mode.
This will add support for the user cases where he needs to
match on ip version explicitly, for such case to have outer
ipv6 and inner ipv4 packets, etc.
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -539,6 +539,14 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
return rte_errno;
}
+ if (m->version) {
+ fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+ fc->item_idx = item_idx;
+ fc->tag_set = &mlx5dr_definer_ipv4_version_set;
+ fc->tag_mask_set = &mlx5dr_definer_ones_set;
+ DR_CALC_SET(fc, eth_l2, l3_type, inner);
+ }
+
if (m->fragment_offset) {
fc = &cd->fc[DR_CALC_FNAME(IP_FRAG, inner)];
fc->item_idx = item_idx;
@@ -628,6 +636,14 @@ mlx5dr_definer_conv_item_ipv6(struct mlx5dr_definer_conv_data *cd,
DR_CALC_SET(fc, eth_l4, ip_fragmented, inner);
}
+ if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, version)) {
+ fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+ fc->item_idx = item_idx;
+ fc->tag_set = &mlx5dr_definer_ipv6_version_set;
+ fc->tag_mask_set = &mlx5dr_definer_ones_set;
+ DR_CALC_SET(fc, eth_l2, l3_type, inner);
+ }
+
if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, tos)) {
fc = &cd->fc[DR_CALC_FNAME(IP_TOS, inner)];
fc->item_idx = item_idx;