net/mlx5: fix ESP item validation in Verbs interface
PATCH 1/1 net/mlx5: fix ESP item validation in Verbs interface
while added ESP item support in Verbs interface, mlx5_flow_os_validate_item_esp routine in windows/mlx5_flow_os.c was changed. all changes should be in mlx5_flow_verbs.c only.
If ESP is not supported in verbs, return default "Item not supported error" during item validation stage.
Also, updated mlx5.rst file regarding ESP SPI match support following further debug.
--- doc/guides/nics/mlx5.rst | 4 ++-- drivers/net/mlx5/mlx5_flow_verbs.c | 2 ++ drivers/net/mlx5/windows/mlx5_flow_os.c | 9 ++------- 3 files changed, 6 insertions(+), 9 deletions(-)
doc/guides/nics/mlx5.rst +2 -2
@@ -599,8 +599,8 @@ Limitations - The NIC egress flow rules on representor port are not supported. -- When using DV/verbs flow engine (``dv_flow_en`` = 1/0 respectively), Match on SPI field - in ESP header for group 0 needs MLNX_OFED 5.6+. +- When using DV/verbs flow engine (``dv_flow_en`` = 1/0 respectively), + Match on SPI field in ESP header for group 0 is supported from connectX-7. Statistics
drivers/net/mlx5/mlx5_flow_verbs.c +2 -0
@@ -1330,6 +1330,7 @@ flow_verbs_validate(struct rte_eth_dev *dev,int ret =0 ;switch (items->type) { +#ifdef HAVE_IBV_FLOW_SPEC_ESP case RTE_FLOW_ITEM_TYPE_ESP : ret = mlx5_flow_os_validate_item_esp(items, item_flags, next_protocol,
@@ -1338,6 +1339,7 @@ flow_verbs_validate(struct rte_eth_dev *dev,return ret; last_item =MLX5_FLOW_ITEM_ESP ;break ; +#endif case RTE_FLOW_ITEM_TYPE_VOID :break ;case RTE_FLOW_ITEM_TYPE_ETH :
drivers/net/mlx5/windows/mlx5_flow_os.c +2 -7
@@ -419,8 +419,8 @@ mlx5_flow_os_set_specific_workspace(struct mlx5_flow_workspace *data)int mlx5_flow_os_validate_item_esp (const struct rte_flow_item *item, - uint64_t item_flags __rte_unused, - uint8_t target_protocol __rte_unused, +uint64_t item_flags, +uint8_t target_protocol,struct rte_flow_error *error) {const struct rte_flow_item_esp *mask = item->mask;
@@ -432,11 +432,6 @@ mlx5_flow_os_validate_item_esp(const struct rte_flow_item *item,MLX5_FLOW_LAYER_OUTER_L4 ;int ret; -#ifndef HAVE_IBV_FLOW_SPEC_ESP -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ITEM , item, -"ESP item not supported" ); -#endif if (!(item_flags & l3m)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,
Signature · 1 line
2.21.0
Hi,
Quoted 18 lines
-----Original Message-----
From: Maayan Kashani <[email protected]>
Sent: Sunday, February 5, 2023 5:40 PM
To: [email protected]
Cc: Maayan Kashani <[email protected]>; Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Slava Ovsiienko <[email protected]>
Subject: [PATCH] net/mlx5: fix ESP item validation in Verbs interfacewhile added ESP item support in Verbs interface,
mlx5_flow_os_validate_item_esproutine inwindows/mlx5_flow_os.cwas changed. all changes should be inmlx5_flow_verbs.conly.If ESP is not supported in verbs, return default "Item not supported error" during item validation stage.
Also, updatedmlx5.rstfile regarding ESP SPI match support following further debug.
Quoted 5 lines
Fixes c1d039e ("net/mlx5: support ESP item in Verbs interface")Signed-off-by Maayan Kashani <[email protected]>Acked-by Matan Azrad <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh