From: Bing Zhao Date: Fri, 15 May 2020 11:44:44 +0000 (+0800) Subject: net/mlx5: fix port action resource initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=29e091cefeaca39c3565c5671bd904fef6d0bf63;p=dpdk.git 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 --- 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