[v2 02/10] net/mlx5/hws: add check for not supported fields in VXLAN
Itamar Gozlan
igozlan at nvidia.com
Sun Feb 18 06:11:16 CET 2024
From: Erez Shitrit <erezsh at nvidia.com>
Don't allow the user to mask over rsvd1 / rsvd2 fields which are not
supported.
Fixes: dbff89ef806f ("net/mlx5/hws: fix tunnel protocol checks")
Signed-off-by: Erez Shitrit <erezsh at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 79d98bbf78..8b8757ecac 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1414,6 +1414,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
struct mlx5dr_definer_fc *fc;
bool inner = cd->tunnel;
+ if (m && (m->rsvd0[0] != 0 || m->rsvd0[1] != 0 || m->rsvd0[2] != 0 ||
+ m->rsvd1 != 0)) {
+ DR_LOG(ERR, "reserved fields are not supported");
+ rte_errno = ENOTSUP;
+ return rte_errno;
+ }
+
if (inner) {
DR_LOG(ERR, "Inner VXLAN item not supported");
rte_errno = ENOTSUP;
--
2.39.3
More information about the dev
mailing list