Skip to contentSkip to conversation

net/iavf: remove dead code in TM node parameter check

PATCH Applied Sergei Iashin 2 participants 2 messages Apr 8 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: remove dead code in TM node parameter check

The non-leaf validation in iavf_node_param_check() unconditionally rejects a non-NULL wfq_weight_mode pointer at the top of the block. The else-if clause below re-tests the same pointer, which is guaranteed NULL at that point, making the branch unreachable dead code.

Remove the dead else-if block. No functional change.

Fixes 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC mapping")
---
 drivers/net/intel/iavf/iavf_tm.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/intel/iavf/iavf_tm.c +0 -6
index 1d12196ba6..efdbb45b62 100644
@@ -178,12 +178,6 @@ iavf_node_param_check(struct iavf_info *vf, uint32_t node_id,
 				RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
 			error->message = "SP priority not supported";
 			return -EINVAL;
-		} else if (params->nonleaf.wfq_weight_mode &&
-			   !(*params->nonleaf.wfq_weight_mode)) {
-			error->type =
-				RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
-			error->message = "WFP should be byte mode";
-			return -EINVAL;
 		}
 
 		return 0;
Signature · 1 line
2.39.5
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 7 lines · Sergei Iashin

The non-leaf validation in iavf_node_param_check() unconditionally rejects a non-NULL wfq_weight_mode pointer at the top of the block. The else-if clause below re-tests the same pointer, which is guaranteed NULL at that point, making the branch unreachable dead code.

Remove the dead else-if block. No functional change.

Quoted 8 lines
Fixes 44d0a720a538 ("net/iavf: query QoS capabilities and set queue TC mapping")
---
 drivers/net/intel/iavf/iavf_tm.c | 6 ------
 1 file changed, 6 deletions(-)

Applied to dpdk-next-net-intel

Thanks,
/Bruce