net/ice: remove unnecessary variable
authorQi Zhang <qi.z.zhang@intel.com>
Wed, 4 Mar 2020 02:05:49 +0000 (10:05 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:41 +0000 (10:21 +0100)
commit31108c69ba5d55a7f35da1b650998be9a19e13dc
tree934a22aca63e9a45de667c1500002190c1df11c0
parentd84612e9bd6b2f106558ffb515d32000288ee73d
net/ice: remove unnecessary variable

Remove unnecessary variable "meta" in ice_flow_create and
ice_flow_validate, it should be defined when really needed:
its ice_parse_engine_create and ice_parse_engine_validate.

A meta data created by parser->parse_pattern_action should be
freed inside parser->engine->create.

During a validate operation, since parser->engine_>create will not
be invoked, it is unnecessary to create a meta during parser, so
NULL will passed to engine->parse_pattern_action and all parser's
parse_pattern_action need to be modified to handle meta = NULL
properly.

With above implementation, the patch also fixes a potential memory
leak in ice_parse_engine_validate, since meta may not be freed.

BTW, an engine without a create op should be regarded as a bug. So
use RTE_ASSERT to replace runtime engine->create == NULL check in
ice_parse_engine_create.

Fixes: 4e27d3ed02bd ("net/ice: fix flow API framework")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/ice_fdir_filter.c
drivers/net/ice/ice_generic_flow.c
drivers/net/ice/ice_hash.c
drivers/net/ice/ice_switch_filter.c