DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: remove unneeded GENEVE option length assert
@ 2022-11-09  1:40 Suanming Mou
  2022-11-09  7:27 ` Slava Ovsiienko
  2022-11-09  8:26 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Suanming Mou @ 2022-11-09  1:40 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko; +Cc: dev, rasland

In order to share flow items translate code, flow items translation
of spec and mask was split individually.

In that case, the assert for GENEVE option length with mask becomes
invalid, since the length in mask is bitmask. And as memcpy around
the assert already checks the GENEVE option length, the assert looks
redundant.

This commit removes the unneeded GENEVE option length assert.

Fixes: cd4ab742064a ("net/mlx5: split flow item matcher and value translation")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index acd7ea8b79..7808a28787 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9616,13 +9616,9 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
 		memcpy(&opt_data_key, data,
 			RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),
 				sizeof(opt_data_key)));
-		MLX5_ASSERT((uint32_t)(geneve_opt_v->option_len * 4) <=
-				sizeof(opt_data_key));
 		memcpy(&opt_data_mask, geneve_opt_m->data,
 			RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),
 				sizeof(opt_data_mask)));
-		MLX5_ASSERT((uint32_t)(geneve_opt_v->option_len * 4) <=
-				sizeof(opt_data_mask));
 		MLX5_SET(fte_match_set_misc3, misc3_v,
 				geneve_tlv_option_0_data,
 			rte_be_to_cpu_32(opt_data_key & opt_data_mask));
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-09  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  1:40 [PATCH] net/mlx5: remove unneeded GENEVE option length assert Suanming Mou
2022-11-09  7:27 ` Slava Ovsiienko
2022-11-09  8:26 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).