X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=app%2Ftest-pmd%2Fcmdline_tm.c;h=d40a427d88ff6c0900be63c12f2e626517321177;hb=6e7cbd63706f3435b9d9a2057a37db1da01db9a7;hp=4acef98f7338d330574a45bb18b8c4857d4cae12;hpb=055c52583a2794da8ba1e85a48cce3832372b12f;p=deb_dpdk.git diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index 4acef98f..d40a427d 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -1599,12 +1599,6 @@ static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; - /* Port status */ - if (port_is_started(port_id)) { - printf(" Port %u not stopped (error)\n", port_id); - return; - } - memset(&np, 0, sizeof(struct rte_tm_node_params)); /* Node parameters */ @@ -1630,10 +1624,12 @@ static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result, np.shaper_profile_id = res->shaper_profile_id; np.n_shared_shapers = n_shared_shapers; - if (np.n_shared_shapers) + if (np.n_shared_shapers) { np.shared_shaper_id = &shared_shaper_id[0]; - else - np.shared_shaper_id = NULL; + } else { + free(shared_shaper_id); + shared_shaper_id = NULL; + } np.nonleaf.n_sp_priorities = res->n_sp_priorities; np.stats_mask = res->stats_mask; @@ -1759,12 +1755,6 @@ static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; - /* Port status */ - if (port_is_started(port_id)) { - printf(" Port %u not stopped (error)\n", port_id); - return; - } - memset(&np, 0, sizeof(struct rte_tm_node_params)); /* Node parameters */ @@ -1791,10 +1781,12 @@ static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result, np.shaper_profile_id = res->shaper_profile_id; np.n_shared_shapers = n_shared_shapers; - if (np.n_shared_shapers) + if (np.n_shared_shapers) { np.shared_shaper_id = &shared_shaper_id[0]; - else - np.shared_shaper_id = NULL; + } else { + free(shared_shaper_id); + shared_shaper_id = NULL; + } np.leaf.cman = res->cman_mode; np.leaf.wred.wred_profile_id = res->wred_profile_id;