X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=app%2Ftest-pmd%2Fcmdline_tm.c;h=bfbd43ca9be0f2a9efb780536a31e145582b6121;hb=5be2325ecec83ab9dd5e25dde6112aed56f3e4f6;hp=af998804959d1aba28c436dac84ca7134d1a6111;hpb=bb52561e539b2a96fafa96099b157622a448d916;p=dpdk.git diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index af99880495..bfbd43ca9b 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -97,7 +97,8 @@ print_err_msg(struct rte_tm_error *error) if (error->cause) snprintf(buf, sizeof(buf), "cause: %p, ", error->cause); - printf("%s: %s%s (error %d)\n", errstr, error->cause ? buf : "", + fprintf(stderr, "%s: %s%s (error %d)\n", + errstr, error->cause ? buf : "", error->message ? error->message : "(no stated reason)", error->type); } @@ -174,7 +175,8 @@ parse_multi_ss_id_str(char *s_str, uint32_t *n_ssp, uint32_t shaper_id[]) /* Check: num of shared shaper */ if (n_shared_shapers >= MAX_NUM_SHARED_SHAPERS) { - printf(" Number of shared shapers exceed the max (error)\n"); + fprintf(stderr, + " Number of shared shapers exceed the max (error)\n"); return -1; } @@ -219,7 +221,7 @@ cmdline_parse_token_string_t cmd_show_port_tm_cap_cap = cap, "cap"); cmdline_parse_token_num_t cmd_show_port_tm_cap_port_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_cap_result, - port_id, UINT16); + port_id, RTE_UINT16); static void cmd_show_port_tm_cap_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -368,10 +370,10 @@ cmdline_parse_token_string_t cmd_show_port_tm_level_cap_cap = cap, "cap"); cmdline_parse_token_num_t cmd_show_port_tm_level_cap_port_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_level_cap_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_show_port_tm_level_cap_level_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_level_cap_result, - level_id, UINT32); + level_id, RTE_UINT32); static void cmd_show_port_tm_level_cap_parsed(void *parsed_result, @@ -518,10 +520,10 @@ cmdline_parse_token_string_t cmd_show_port_tm_node_cap_cap = cap, "cap"); cmdline_parse_token_num_t cmd_show_port_tm_node_cap_port_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_cap_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_show_port_tm_node_cap_node_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_cap_result, - node_id, UINT32); + node_id, RTE_UINT32); static void cmd_show_port_tm_node_cap_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -642,14 +644,14 @@ cmdline_parse_token_string_t cmd_show_port_tm_node_stats_stats = struct cmd_show_port_tm_node_stats_result, stats, "stats"); cmdline_parse_token_num_t cmd_show_port_tm_node_stats_port_id = TOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_stats_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_show_port_tm_node_stats_node_id = TOKEN_NUM_INITIALIZER( struct cmd_show_port_tm_node_stats_result, - node_id, UINT32); + node_id, RTE_UINT32); cmdline_parse_token_num_t cmd_show_port_tm_node_stats_clear = TOKEN_NUM_INITIALIZER( - struct cmd_show_port_tm_node_stats_result, clear, UINT32); + struct cmd_show_port_tm_node_stats_result, clear, RTE_UINT32); static void cmd_show_port_tm_node_stats_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -670,7 +672,7 @@ static void cmd_show_port_tm_node_stats_parsed(void *parsed_result, memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { - printf(" Port %u not started (error)\n", port_id); + fprintf(stderr, " Port %u not started (error)\n", port_id); return; } @@ -761,11 +763,11 @@ cmdline_parse_token_string_t cmd_show_port_tm_node_type_type = cmdline_parse_token_num_t cmd_show_port_tm_node_type_port_id = TOKEN_NUM_INITIALIZER( struct cmd_show_port_tm_node_type_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_show_port_tm_node_type_node_id = TOKEN_NUM_INITIALIZER( struct cmd_show_port_tm_node_type_result, - node_id, UINT32); + node_id, RTE_UINT32); static void cmd_show_port_tm_node_type_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -854,35 +856,35 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_profile = cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_port_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_shaper_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - shaper_id, UINT32); + shaper_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_cmit_tb_rate = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - cmit_tb_rate, UINT64); + cmit_tb_rate, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_cmit_tb_size = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - cmit_tb_size, UINT64); + cmit_tb_size, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_peak_tb_rate = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - peak_tb_rate, UINT64); + peak_tb_rate, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_peak_tb_size = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - peak_tb_size, UINT64); + peak_tb_size, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_pktlen_adjust = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - pktlen_adjust, UINT32); + pktlen_adjust, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_packet_mode = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shaper_profile_result, - pkt_mode, UINT32); + pkt_mode, RTE_UINT32); static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -976,11 +978,11 @@ cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_profile = cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_port_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_shaper_profile_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_shaper_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_shaper_profile_result, - shaper_id, UINT32); + shaper_id, RTE_UINT32); static void cmd_del_port_tm_node_shaper_profile_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -1057,15 +1059,15 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_shaper = cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_port_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shared_shaper_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shared_shaper_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shared_shaper_result, - shared_shaper_id, UINT32); + shared_shaper_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shaper_profile_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_shared_shaper_result, - shaper_profile_id, UINT32); + shaper_profile_id, RTE_UINT32); static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -1085,14 +1087,14 @@ static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result, /* Command type: add */ if ((strcmp(res->cmd_type, "add") == 0) && (port_is_started(port_id))) { - printf(" Port %u not stopped (error)\n", port_id); + fprintf(stderr, " Port %u not stopped (error)\n", port_id); return; } /* Command type: set (update) */ if ((strcmp(res->cmd_type, "set") == 0) && (!port_is_started(port_id))) { - printf(" Port %u not started (error)\n", port_id); + fprintf(stderr, " Port %u not started (error)\n", port_id); return; } @@ -1157,11 +1159,11 @@ cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_shaper = cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_port_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_shared_shaper_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_shared_shaper_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_shared_shaper_result, - shared_shaper_id, UINT32); + shared_shaper_id, RTE_UINT32); static void cmd_del_port_tm_node_shared_shaper_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -1250,11 +1252,11 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_profile = cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_port_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wred_profile_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - wred_profile_id, UINT32); + wred_profile_id, RTE_UINT32); cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_g = TOKEN_STRING_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1262,19 +1264,19 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_g = cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_g, UINT64); + min_th_g, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_g, UINT64); + max_th_g, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - maxp_inv_g, UINT16); + maxp_inv_g, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_g = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - wq_log2_g, UINT16); + wq_log2_g, RTE_UINT16); cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_y = TOKEN_STRING_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1282,19 +1284,19 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_y = cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_y, UINT64); + min_th_y, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_y, UINT64); + max_th_y, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - maxp_inv_y, UINT16); + maxp_inv_y, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_y = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - wq_log2_y, UINT16); + wq_log2_y, RTE_UINT16); cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_r = TOKEN_STRING_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, @@ -1302,19 +1304,19 @@ cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_r = cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - min_th_r, UINT64); + min_th_r, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - max_th_r, UINT64); + max_th_r, RTE_UINT64); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - maxp_inv_r, UINT16); + maxp_inv_r, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_r = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_node_wred_profile_result, - wq_log2_r, UINT16); + wq_log2_r, RTE_UINT16); static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result, @@ -1430,11 +1432,11 @@ cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_profile = cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_port_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_wred_profile_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_wred_profile_id = TOKEN_NUM_INITIALIZER( struct cmd_del_port_tm_node_wred_profile_result, - wred_profile_id, UINT32); + wred_profile_id, RTE_UINT32); static void cmd_del_port_tm_node_wred_profile_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -1512,15 +1514,15 @@ cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_profile = cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_port_id = TOKEN_NUM_INITIALIZER( struct cmd_set_port_tm_node_shaper_profile_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_node_id = TOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_shaper_profile_result, - node_id, UINT32); + node_id, RTE_UINT32); cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_shaper_profile_profile_id = TOKEN_NUM_INITIALIZER( struct cmd_set_port_tm_node_shaper_profile_result, - shaper_profile_id, UINT32); + shaper_profile_id, RTE_UINT32); static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -1539,7 +1541,7 @@ static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result, memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { - printf(" Port %u not started (error)\n", port_id); + fprintf(stderr, " Port %u not started (error)\n", port_id); return; } @@ -1606,31 +1608,31 @@ cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_node = cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_port_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_nonleaf_node_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - node_id, UINT32); + node_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_parent_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - parent_node_id, INT32); + parent_node_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_priority = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - priority, UINT32); + priority, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_weight = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - weight, UINT32); + weight, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_level_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - level_id, UINT32); + level_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_shaper_profile_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - shaper_profile_id, INT32); + shaper_profile_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_n_sp_priorities = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - n_sp_priorities, UINT32); + n_sp_priorities, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_stats_mask = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, - stats_mask, UINT64); + stats_mask, RTE_UINT64); cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_multi_shared_shaper_id = TOKEN_STRING_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result, @@ -1664,14 +1666,15 @@ static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result, shared_shaper_id = (uint32_t *)malloc(MAX_NUM_SHARED_SHAPERS * sizeof(uint32_t)); if (shared_shaper_id == NULL) { - printf(" Memory not allocated for shared shapers (error)\n"); + fprintf(stderr, + " Memory not allocated for shared shapers (error)\n"); return; } /* Parse multi shared shaper id string */ ret = parse_multi_ss_id_str(s_str, &n_shared_shapers, shared_shaper_id); if (ret) { - printf(" Shared shapers params string parse error\n"); + fprintf(stderr, " Shared shapers params string parse error\n"); free(shared_shaper_id); return; } @@ -1767,31 +1770,31 @@ cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_pktmode = cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_port_id = TOKEN_NUM_INITIALIZER( struct cmd_add_port_tm_nonleaf_node_pmode_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - node_id, UINT32); + node_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_parent_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - parent_node_id, INT32); + parent_node_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_priority = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - priority, UINT32); + priority, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_weight = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - weight, UINT32); + weight, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_level_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - level_id, UINT32); + level_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_shaper_profile_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - shaper_profile_id, INT32); + shaper_profile_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_n_sp_priorities = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - n_sp_priorities, UINT32); + n_sp_priorities, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_pmode_stats_mask = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_pmode_result, - stats_mask, UINT64); + stats_mask, RTE_UINT64); cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_pmode_multi_shrd_shpr_id = TOKEN_STRING_INITIALIZER( @@ -1827,14 +1830,15 @@ static void cmd_add_port_tm_nonleaf_node_pmode_parsed(void *parsed_result, shared_shaper_id = (uint32_t *)malloc(MAX_NUM_SHARED_SHAPERS * sizeof(uint32_t)); if (shared_shaper_id == NULL) { - printf(" Memory not allocated for shared shapers (error)\n"); + fprintf(stderr, + " Memory not allocated for shared shapers (error)\n"); return; } /* Parse multi shared shaper id string */ ret = parse_multi_ss_id_str(s_str, &n_shared_shapers, shared_shaper_id); if (ret) { - printf(" Shared shapers params string parse error\n"); + fprintf(stderr, " Shared shapers params string parse error\n"); free(shared_shaper_id); return; } @@ -1930,34 +1934,34 @@ cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_node = struct cmd_add_port_tm_leaf_node_result, node, "node"); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_port_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - node_id, UINT32); + node_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_parent_node_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - parent_node_id, INT32); + parent_node_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_priority = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - priority, UINT32); + priority, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_weight = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - weight, UINT32); + weight, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_level_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - level_id, UINT32); + level_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_shaper_profile_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - shaper_profile_id, INT32); + shaper_profile_id, RTE_INT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_cman_mode = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - cman_mode, UINT32); + cman_mode, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_wred_profile_id = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - wred_profile_id, UINT32); + wred_profile_id, RTE_UINT32); cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_stats_mask = TOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, - stats_mask, UINT64); + stats_mask, RTE_UINT64); cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_multi_shared_shaper_id = TOKEN_STRING_INITIALIZER(struct cmd_add_port_tm_leaf_node_result, @@ -1991,14 +1995,15 @@ static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result, shared_shaper_id = (uint32_t *)malloc(MAX_NUM_SHARED_SHAPERS * sizeof(uint32_t)); if (shared_shaper_id == NULL) { - printf(" Memory not allocated for shared shapers (error)\n"); + fprintf(stderr, + " Memory not allocated for shared shapers (error)\n"); return; } /* Parse multi shared shaper id string */ ret = parse_multi_ss_id_str(s_str, &n_shared_shapers, shared_shaper_id); if (ret) { - printf(" Shared shapers params string parse error\n"); + fprintf(stderr, " Shared shapers params string parse error\n"); free(shared_shaper_id); return; } @@ -2080,10 +2085,10 @@ cmdline_parse_token_string_t cmd_del_port_tm_node_node = struct cmd_del_port_tm_node_result, node, "node"); cmdline_parse_token_num_t cmd_del_port_tm_node_port_id = TOKEN_NUM_INITIALIZER(struct cmd_del_port_tm_node_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_del_port_tm_node_node_id = TOKEN_NUM_INITIALIZER(struct cmd_del_port_tm_node_result, - node_id, UINT32); + node_id, RTE_UINT32); static void cmd_del_port_tm_node_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2101,7 +2106,7 @@ static void cmd_del_port_tm_node_parsed(void *parsed_result, memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (port_is_started(port_id)) { - printf(" Port %u not stopped (error)\n", port_id); + fprintf(stderr, " Port %u not stopped (error)\n", port_id); return; } @@ -2158,19 +2163,21 @@ cmdline_parse_token_string_t cmd_set_port_tm_node_parent_parent = struct cmd_set_port_tm_node_parent_result, parent, "parent"); cmdline_parse_token_num_t cmd_set_port_tm_node_parent_port_id = TOKEN_NUM_INITIALIZER( - struct cmd_set_port_tm_node_parent_result, port_id, UINT16); + struct cmd_set_port_tm_node_parent_result, port_id, + RTE_UINT16); cmdline_parse_token_num_t cmd_set_port_tm_node_parent_node_id = TOKEN_NUM_INITIALIZER( - struct cmd_set_port_tm_node_parent_result, node_id, UINT32); + struct cmd_set_port_tm_node_parent_result, node_id, + RTE_UINT32); cmdline_parse_token_num_t cmd_set_port_tm_node_parent_parent_id = TOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result, - parent_id, UINT32); + parent_id, RTE_UINT32); cmdline_parse_token_num_t cmd_set_port_tm_node_parent_priority = TOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result, - priority, UINT32); + priority, RTE_UINT32); cmdline_parse_token_num_t cmd_set_port_tm_node_parent_weight = TOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result, - weight, UINT32); + weight, RTE_UINT32); static void cmd_set_port_tm_node_parent_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2191,7 +2198,7 @@ static void cmd_set_port_tm_node_parent_parsed(void *parsed_result, memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { - printf(" Port %u not started (error)\n", port_id); + fprintf(stderr, " Port %u not started (error)\n", port_id); return; } @@ -2246,10 +2253,12 @@ cmdline_parse_token_string_t cmd_suspend_port_tm_node_node = struct cmd_suspend_port_tm_node_result, node, "node"); cmdline_parse_token_num_t cmd_suspend_port_tm_node_port_id = TOKEN_NUM_INITIALIZER( - struct cmd_suspend_port_tm_node_result, port_id, UINT16); + struct cmd_suspend_port_tm_node_result, port_id, + RTE_UINT16); cmdline_parse_token_num_t cmd_suspend_port_tm_node_node_id = TOKEN_NUM_INITIALIZER( - struct cmd_suspend_port_tm_node_result, node_id, UINT32); + struct cmd_suspend_port_tm_node_result, node_id, + RTE_UINT32); static void cmd_suspend_port_tm_node_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2311,10 +2320,10 @@ cmdline_parse_token_string_t cmd_resume_port_tm_node_node = struct cmd_resume_port_tm_node_result, node, "node"); cmdline_parse_token_num_t cmd_resume_port_tm_node_port_id = TOKEN_NUM_INITIALIZER( - struct cmd_resume_port_tm_node_result, port_id, UINT16); + struct cmd_resume_port_tm_node_result, port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_resume_port_tm_node_node_id = TOKEN_NUM_INITIALIZER( - struct cmd_resume_port_tm_node_result, node_id, UINT32); + struct cmd_resume_port_tm_node_result, node_id, RTE_UINT32); static void cmd_resume_port_tm_node_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2378,7 +2387,7 @@ cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_commit = cmdline_parse_token_num_t cmd_port_tm_hierarchy_commit_port_id = TOKEN_NUM_INITIALIZER( struct cmd_port_tm_hierarchy_commit_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_clean_on_fail = TOKEN_STRING_INITIALIZER(struct cmd_port_tm_hierarchy_commit_result, clean_on_fail, "yes#no"); @@ -2458,17 +2467,17 @@ cmdline_parse_token_string_t cmd_port_tm_mark_ip_ecn_ip_ecn = ip_ecn, "ip_ecn"); cmdline_parse_token_num_t cmd_port_tm_mark_ip_ecn_port_id = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_ecn_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_ecn_green = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_ecn_result, - green, UINT16); + green, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_ecn_yellow = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_ecn_result, - yellow, UINT16); + yellow, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_ecn_red = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_ecn_result, - red, UINT16); + red, RTE_UINT16); static void cmd_port_tm_mark_ip_ecn_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2545,17 +2554,17 @@ cmdline_parse_token_string_t cmd_port_tm_mark_ip_dscp_ip_dscp = ip_dscp, "ip_dscp"); cmdline_parse_token_num_t cmd_port_tm_mark_ip_dscp_port_id = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_dscp_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_dscp_green = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_dscp_result, - green, UINT16); + green, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_dscp_yellow = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_dscp_result, - yellow, UINT16); + yellow, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_ip_dscp_red = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_ip_dscp_result, - red, UINT16); + red, RTE_UINT16); static void cmd_port_tm_mark_ip_dscp_parsed(void *parsed_result, __rte_unused struct cmdline *cl, @@ -2632,17 +2641,17 @@ cmdline_parse_token_string_t cmd_port_tm_mark_vlan_dei_vlan_dei = vlan_dei, "vlan_dei"); cmdline_parse_token_num_t cmd_port_tm_mark_vlan_dei_port_id = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_vlan_dei_result, - port_id, UINT16); + port_id, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_vlan_dei_green = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_vlan_dei_result, - green, UINT16); + green, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_vlan_dei_yellow = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_vlan_dei_result, - yellow, UINT16); + yellow, RTE_UINT16); cmdline_parse_token_num_t cmd_port_tm_mark_vlan_dei_red = TOKEN_NUM_INITIALIZER(struct cmd_port_tm_mark_vlan_dei_result, - red, UINT16); + red, RTE_UINT16); static void cmd_port_tm_mark_vlan_dei_parsed(void *parsed_result, __rte_unused struct cmdline *cl,