|SUCCESS| net/iavf: remove dead code in TM node parameter check
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed Apr 8 13:05:25 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/162940
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-04-08
Commit: <sha not provided in patch>
Author: Sergei Iashin <yashin.sergey at gmail.com>
Subject: [PATCH] net/iavf: remove dead code in TM node parameter check
This patch removes unreachable dead code from the iavf_node_param_check()
function. The nonleaf validation block unconditionally rejects a non-NULL
wfq_weight_mode pointer, then an else-if clause re-tests the same pointer
which is guaranteed to be NULL, making that branch unreachable.
> diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c
> index 1d12196ba6..efdbb45b62 100644
> --- a/drivers/net/intel/iavf/iavf_tm.c
> +++ b/drivers/net/intel/iavf/iavf_tm.c
> @@ -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;
Does the removal of this code block change the validation behavior for
WFQ weight mode? Looking at the original code flow, there appears to be
a prior check that rejects non-NULL wfq_weight_mode. Can you confirm
this by showing the preceding context in iavf_node_param_check() that
validates wfq_weight_mode?
The error message says "WFP should be byte mode" but the condition
checks for !(*params->nonleaf.wfq_weight_mode), which appears to reject
when the dereferenced mode is zero/false. Is zero/false supposed to
represent byte mode in the RTE_TM API? If so, does removing this code
eliminate a legitimate validation that WFQ mode must be byte mode?
Without seeing the full function context, it's unclear whether this is
truly dead code or whether the logic should be restructured rather than
deleted.
More information about the test-report
mailing list