Add HWS support of IPv4 fragment packet id field matching.
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 11 ++++++++++-
drivers/net/mlx5/hws/mlx5dr_definer.h | 2 ++
2 files changed, 12 insertions(+), 1 deletion(-)
@@ -171,6 +171,7 @@ struct mlx5dr_definer_conv_data {
X(SET, ipv4_version, STE_IPV4, rte_ipv4_hdr) \
X(SET_BE16, ipv4_frag, v->fragment_offset, rte_ipv4_hdr) \
X(SET_BE16, ipv4_len, v->total_length, rte_ipv4_hdr) \
+ X(SET_BE16, ipv4_identification, v->packet_id, rte_ipv4_hdr) \
X(SET, ip_fragmented, !!v->fragment_offset, rte_ipv4_hdr) \
X(SET_BE16, ipv6_payload_len, v->hdr.payload_len, rte_flow_item_ipv6) \
X(SET, ipv6_proto, v->hdr.proto, rte_flow_item_ipv6) \
@@ -1026,7 +1027,7 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
if (!m)
return 0;
- if (m->packet_id || m->hdr_checksum ||
+ if (m->hdr_checksum ||
(l && (l->next_proto_id || l->type_of_service))) {
rte_errno = ENOTSUP;
return rte_errno;
@@ -1060,6 +1061,14 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
DR_CALC_SET(fc, eth_l3, protocol_next_header, inner);
}
+ if (m->packet_id) {
+ fc = &cd->fc[DR_CALC_FNAME(IP_ID, inner)];
+ fc->item_idx = item_idx;
+ fc->is_range = l && l->packet_id;
+ fc->tag_set = &mlx5dr_definer_ipv4_identification_set;
+ DR_CALC_SET(fc, eth_l3, identification, inner);
+ }
+
if (m->total_length) {
fc = &cd->fc[DR_CALC_FNAME(IP_LEN, inner)];
fc->item_idx = item_idx;
@@ -75,6 +75,8 @@ enum mlx5dr_definer_fname {
MLX5DR_DEFINER_FNAME_IP_VERSION_I,
MLX5DR_DEFINER_FNAME_IP_FRAG_O,
MLX5DR_DEFINER_FNAME_IP_FRAG_I,
+ MLX5DR_DEFINER_FNAME_IP_ID_O,
+ MLX5DR_DEFINER_FNAME_IP_ID_I,
MLX5DR_DEFINER_FNAME_IP_LEN_O,
MLX5DR_DEFINER_FNAME_IP_LEN_I,
MLX5DR_DEFINER_FNAME_IP_TOS_O,