From: Dekel Peled Date: Thu, 15 Oct 2020 14:05:55 +0000 (+0300) Subject: net/mlx5: support match on IPv6 fragment packets X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ad3d227ead7cf6d03ec2942eb53ff626f36f09ee;p=dpdk.git net/mlx5: support match on IPv6 fragment packets This patch adds to MLX5 PMD the support of matching on IPv6 fragmented and non-fragmented packets, using the new field has_frag_ext, added to rte_flow following RFC [1]. [1] https://mails.dpdk.org/archives/dev/2020-August/177257.html Signed-off-by: Dekel Peled Acked-by: Ori Kam --- diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 72bd8d069e..b2e5fcf7f7 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -173,7 +173,7 @@ New Features Updated Mellanox mlx5 driver with new features and improvements, including: - * Added support for matching on fragmented/non-fragmented IPv4 packets. + * Added support for matching on fragmented/non-fragmented IPv4/IPv6 packets. * **Updated Solarflare network PMD.** diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index ff97f783f8..b61a361b15 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5417,6 +5417,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, .proto = 0xff, .hop_limits = 0xff, }, + .has_frag_ext = 1, }; const struct rte_flow_item_ecpri nic_ecpri_mask = { .hdr = { @@ -6734,6 +6735,10 @@ flow_dv_translate_item_ipv6(void *matcher, void *key, ipv6_m->hdr.hop_limits); MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit, ipv6_v->hdr.hop_limits & ipv6_m->hdr.hop_limits); + MLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, + !!(ipv6_m->has_frag_ext)); + MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, + !!(ipv6_v->has_frag_ext & ipv6_m->has_frag_ext)); } /**