From: Erez Shitrit <[email protected]>
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 <[email protected]>
Acked-by: Matan Azrad <[email protected]>
---
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