From 29e091cefeaca39c3565c5671bd904fef6d0bf63 Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Fri, 15 May 2020 19:44:44 +0800 Subject: [PATCH] net/mlx5: fix port action resource initialization After memory optimization, the organization of some resources are changed from pointer based LIST to the index based ILIST. A lot of code parts are touched due to such change. Some static code checking and analysis tool will complain and raise a false warning on the uninitialized value using. E.g. in the port action registering function, the stack variable will be used as the right value with some uninitialized field to initialize variable allocated from heap. But indeed, it is not an error because all the fields set with the uninitialized value will be overwritten in the following code part and the macros. All the fields will be used as the left value explicitly. It makes no sense to clear the stack variable to 0 in this case, and the extra memset will introduce some cycles overhead. It just needs to ignore the false warning from the tool, if any. Fixes: f3faf9ea1185 ("net/mlx5: convert port id action to indexed") Signed-off-by: Bing Zhao Reviewed-by: Matan Azrad Reviewed-by: Suanming Mou Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6f58032561..e481831950 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7832,7 +7832,6 @@ __flow_dv_translate(struct rte_eth_dev *dev, if (flow_dv_translate_action_port_id(dev, action, &port_id, error)) return -rte_errno; - memset(&port_id_resource, 0, sizeof(port_id_resource)); port_id_resource.port_id = port_id; MLX5_ASSERT(!handle->rix_port_id_action); if (flow_dv_port_id_action_resource_register -- 2.20.1