" e.g., 'set stat_qmap rx 0 2 5' sets rx queue 2"
" on port 0 to mapping 5.\n\n"
+ "set xstats-hide-zero on|off\n"
+ " Set the option to hide the zero values"
+ " for xstats display.\n"
+
"set port (port_id) vf (vf_id) rx|tx on|off\n"
" Enable/Disable a VF receive/tranmit from a port\n\n"
},
};
+/* *** SET OPTION TO HIDE ZERO VALUES FOR XSTATS DISPLAY *** */
+struct cmd_set_xstats_hide_zero_result {
+ cmdline_fixed_string_t keyword;
+ cmdline_fixed_string_t name;
+ cmdline_fixed_string_t on_off;
+};
+
+static void
+cmd_set_xstats_hide_zero_parsed(void *parsed_result,
+ __attribute__((unused)) struct cmdline *cl,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_set_xstats_hide_zero_result *res;
+ uint16_t on_off = 0;
+
+ res = parsed_result;
+ on_off = !strcmp(res->on_off, "on") ? 1 : 0;
+ set_xstats_hide_zero(on_off);
+}
+
+cmdline_parse_token_string_t cmd_set_xstats_hide_zero_keyword =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_xstats_hide_zero_result,
+ keyword, "set");
+cmdline_parse_token_string_t cmd_set_xstats_hide_zero_name =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_xstats_hide_zero_result,
+ name, "xstats-hide-zero");
+cmdline_parse_token_string_t cmd_set_xstats_hide_zero_on_off =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_xstats_hide_zero_result,
+ on_off, "on#off");
+
+cmdline_parse_inst_t cmd_set_xstats_hide_zero = {
+ .f = cmd_set_xstats_hide_zero_parsed,
+ .data = NULL,
+ .help_str = "set xstats-hide-zero on|off",
+ .tokens = {
+ (void *)&cmd_set_xstats_hide_zero_keyword,
+ (void *)&cmd_set_xstats_hide_zero_name,
+ (void *)&cmd_set_xstats_hide_zero_on_off,
+ NULL,
+ },
+};
+
/* *** CONFIGURE UNICAST HASH TABLE *** */
struct cmd_set_uc_hash_table {
cmdline_fixed_string_t set;
(cmdline_parse_inst_t *)&cmd_stop,
(cmdline_parse_inst_t *)&cmd_mac_addr,
(cmdline_parse_inst_t *)&cmd_set_qmap,
+ (cmdline_parse_inst_t *)&cmd_set_xstats_hide_zero,
(cmdline_parse_inst_t *)&cmd_operate_port,
(cmdline_parse_inst_t *)&cmd_operate_specific_port,
(cmdline_parse_inst_t *)&cmd_operate_attach_port,
}
/* Display xstats */
- for (idx_xstat = 0; idx_xstat < cnt_xstats; idx_xstat++)
+ for (idx_xstat = 0; idx_xstat < cnt_xstats; idx_xstat++) {
+ if (xstats_hide_zero && !xstats[idx_xstat].value)
+ continue;
printf("%s: %"PRIu64"\n",
xstats_names[idx_xstat].name,
xstats[idx_xstat].value);
+ }
free(xstats_names);
free(xstats);
}
}
}
+void
+set_xstats_hide_zero(uint8_t on_off)
+{
+ xstats_hide_zero = on_off;
+}
+
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
extern uint16_t nb_tx_queue_stats_mappings;
extern uint16_t nb_rx_queue_stats_mappings;
+extern uint8_t xstats_hide_zero; /**< Hide zero values for xstats display */
+
/* globals used for configuration */
extern uint16_t verbose_level; /**< Drives messages being displayed, if any. */
extern uint8_t interactive;
void set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value);
+void set_xstats_hide_zero(uint8_t on_off);
+
void set_verbose_level(uint16_t vb_level);
void set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs);
void show_tx_pkt_segments(void);