@@ -637,6 +637,21 @@ static void cmd_help_long_parsed(void *parsed_result,
"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\n"
" Update a ptype mapping item on a port\n\n"
+ "queue-region set port (port_id) region_id (value) "
+ "queue_startIndex (value) queue_num (value)\n"
+ " Set a queue region on a port\n\n"
+
+ "queue-region set (pf|vf) port (port_id) region_id (value) "
+ "flowtype (value)\n"
+ " Set a flowtype region index on a port\n\n"
+
+ "queue-region set port (port_id) UP (value) TCs (value)\n"
+ " Set the mapping of User Priority to "
+ "Traffic Classes on a port\n\n"
+
+ "queue-region flush port (port_id)\n"
+ " flush all queue region related configuration\n\n"
+
, list_pkt_forwarding_modes()
);
}
@@ -8213,6 +8228,306 @@ cmdline_parse_inst_t cmd_syn_filter = {
NULL,
},
};
+/* *** queue region set *** */
+struct cmd_queue_region_result {
+ cmdline_fixed_string_t cmd;
+ cmdline_fixed_string_t set;
+ cmdline_fixed_string_t port;
+ uint8_t port_id;
+ cmdline_fixed_string_t region;
+ uint8_t region_id;
+ cmdline_fixed_string_t queue_startIndex;
+ uint8_t queue_id;
+ cmdline_fixed_string_t queue_num;
+ uint8_t queue_num_value;
+};
+
+static void
+cmd_queue_region_parsed(void *parsed_result,
+ __attribute__((unused)) struct cmdline *cl,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_queue_region_result *res = parsed_result;
+ struct rte_i40e_rss_region_conf region_conf;
+ int ret = 0;
+
+ memset(®ion_conf, 0, sizeof(region_conf));
+ region_conf.op = RTE_PMD_I40E_QUEUE_REGION_SET;
+ region_conf.region_id = res->region_id;
+ region_conf.queue_num = res->queue_id;
+ region_conf.queue_startIndex = res->queue_num_value;
+
+ ret = rte_pmd_i40e_queue_region_conf(res->port_id, ®ion_conf);
+
+ if (ret < 0)
+ printf("queue region config programming error: (%s)\n",
+ strerror(-ret));
+}
+
+cmdline_parse_token_string_t cmd_queue_region_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result,
+ cmd, "queue-region");
+cmdline_parse_token_string_t cmd_queue_region_set =
+TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result,
+ set, "set");
+cmdline_parse_token_string_t cmd_queue_region_port =
+ TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result, port, "port");
+cmdline_parse_token_num_t cmd_queue_region_port_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_queue_region_result,
+ port_id, UINT8);
+cmdline_parse_token_string_t cmd_queue_region_id =
+ TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result,
+ region, "region_id");
+cmdline_parse_token_num_t cmd_queue_region_index =
+ TOKEN_NUM_INITIALIZER(struct cmd_queue_region_result,
+ region_id, UINT8);
+cmdline_parse_token_string_t cmd_queue_region_queue_startIndex =
+ TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result,
+ queue_startIndex, "queue_startIndex");
+cmdline_parse_token_num_t cmd_queue_region_queue_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_queue_region_result,
+ queue_id, UINT8);
+cmdline_parse_token_string_t cmd_queue_region_queue_num =
+ TOKEN_STRING_INITIALIZER(struct cmd_queue_region_result,
+ queue_num, "queue_num");
+cmdline_parse_token_num_t cmd_queue_region_queue_num_value =
+ TOKEN_NUM_INITIALIZER(struct cmd_queue_region_result,
+ queue_num_value, UINT8);
+
+cmdline_parse_inst_t cmd_queue_region = {
+ .f = cmd_queue_region_parsed,
+ .data = NULL,
+ .help_str = "queue-region set port <port_id> region_id <value> "
+ "queue_startIndex <value> queue_num <value>: Set a queue region",
+ .tokens = {
+ (void *)&cmd_queue_region_cmd,
+ (void *)&cmd_queue_region_set,
+ (void *)&cmd_queue_region_port,
+ (void *)&cmd_queue_region_port_id,
+ (void *)&cmd_queue_region_id,
+ (void *)&cmd_queue_region_index,
+ (void *)&cmd_queue_region_queue_startIndex,
+ (void *)&cmd_queue_region_queue_id,
+ (void *)&cmd_queue_region_queue_num,
+ (void *)&cmd_queue_region_queue_num_value,
+ NULL,
+ },
+};
+
+/* *** queue region and flowtype set *** */
+struct cmd_region_flowtype_result {
+ cmdline_fixed_string_t cmd;
+ cmdline_fixed_string_t set;
+ cmdline_fixed_string_t what;
+ cmdline_fixed_string_t port;
+ uint8_t port_id;
+ cmdline_fixed_string_t region;
+ uint8_t region_id;
+ cmdline_fixed_string_t flowtype;
+ uint8_t flowtype_id;
+};
+
+static void
+cmd_region_flowtype_parsed(void *parsed_result,
+ __attribute__((unused)) struct cmdline *cl,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_region_flowtype_result *res = parsed_result;
+ struct rte_i40e_rss_region_conf region_conf;
+ int ret = 0;
+
+ memset(®ion_conf, 0, sizeof(region_conf));
+
+ if (strcmp(res->what, "pf") == 0)
+ region_conf.op = RTE_PMD_I40E_REGION_FLOWTYPE_PF_SET;
+ else
+ region_conf.op = RTE_PMD_I40E_REGION_FLOWTYPE_VF_SET;
+ region_conf.region_id = res->region_id;
+ region_conf.flowtype = res->flowtype_id;
+
+ ret = rte_pmd_i40e_queue_region_conf(res->port_id, ®ion_conf);
+
+ if (ret < 0)
+ printf("region flowtype config programming error: (%s)\n",
+ strerror(-ret));
+}
+
+cmdline_parse_token_string_t cmd_region_flowtype_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ cmd, "queue-region");
+cmdline_parse_token_string_t cmd_region_flowtype_set =
+TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ set, "set");
+cmdline_parse_token_string_t cmd_region_flowtype_what =
+TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ what, "pf#vf");
+cmdline_parse_token_string_t cmd_region_flowtype_port =
+ TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ port, "port");
+cmdline_parse_token_num_t cmd_region_flowtype_port_index =
+ TOKEN_NUM_INITIALIZER(struct cmd_region_flowtype_result,
+ port_id, UINT8);
+cmdline_parse_token_string_t cmd_region_flowtype_index =
+ TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ region, "region_id");
+cmdline_parse_token_num_t cmd_region_flowtype_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_region_flowtype_result,
+ region_id, UINT8);
+cmdline_parse_token_string_t cmd_region_flowtype_flow_index =
+ TOKEN_STRING_INITIALIZER(struct cmd_region_flowtype_result,
+ flowtype, "flowtype");
+cmdline_parse_token_num_t cmd_region_flowtype_flow_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_region_flowtype_result,
+ flowtype_id, UINT8);
+cmdline_parse_inst_t cmd_region_flowtype = {
+ .f = cmd_region_flowtype_parsed,
+ .data = NULL,
+ .help_str = "queue-region set pf|vf port <port_id> region_id <value> "
+ "flowtype <value>: Set a flowtype region index",
+ .tokens = {
+ (void *)&cmd_region_flowtype_cmd,
+ (void *)&cmd_region_flowtype_set,
+ (void *)&cmd_region_flowtype_what,
+ (void *)&cmd_region_flowtype_port,
+ (void *)&cmd_region_flowtype_port_index,
+ (void *)&cmd_region_flowtype_index,
+ (void *)&cmd_region_flowtype_id,
+ (void *)&cmd_region_flowtype_flow_index,
+ (void *)&cmd_region_flowtype_flow_id,
+ NULL,
+ },
+};
+
+/* *** User Priority (UP) to Traffic Classes (TC) set *** */
+struct cmd_UserPriority_TrafficClasses_result {
+ cmdline_fixed_string_t cmd;
+ cmdline_fixed_string_t set;
+ cmdline_fixed_string_t port;
+ uint8_t port_id;
+ cmdline_fixed_string_t UserPriority;
+ uint8_t UserPriority_id;
+ cmdline_fixed_string_t TrafficClasses;
+ uint8_t TrafficClasses_id;
+};
+
+static void
+cmd_UserPriority_TrafficClasses_parsed(void *parsed_result,
+ __attribute__((unused)) struct cmdline *cl,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_UserPriority_TrafficClasses_result *res = parsed_result;
+ struct rte_i40e_rss_region_conf region_conf;
+ int ret = 0;
+
+ memset(®ion_conf, 0, sizeof(region_conf));
+ region_conf.op = RTE_PMD_I40E_UP_TC_SET;
+ region_conf.UserPriority = res->UserPriority_id;
+ region_conf.TrafficClasses = res->TrafficClasses_id;
+
+ ret = rte_pmd_i40e_queue_region_conf(res->port_id, ®ion_conf);
+
+ if (ret < 0)
+ printf("UserPriority TrafficClasses config programming "
+ "error: (%s)\n", strerror(-ret));
+}
+
+cmdline_parse_token_string_t cmd_UserPriority_TrafficClasses_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ cmd, "queue-region");
+cmdline_parse_token_string_t cmd_UserPriority_TrafficClasses_set =
+TOKEN_STRING_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ set, "set");
+cmdline_parse_token_string_t cmd_UserPriority_TrafficClasses_port =
+ TOKEN_STRING_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ port, "port");
+cmdline_parse_token_num_t cmd_UserPriority_TrafficClasses_port_index =
+ TOKEN_NUM_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ port_id, UINT8);
+cmdline_parse_token_string_t cmd_UserPriority_TrafficClasses_UP =
+ TOKEN_STRING_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ UserPriority, "UP");
+cmdline_parse_token_num_t cmd_UserPriority_TrafficClasses_UP_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ UserPriority_id, UINT8);
+cmdline_parse_token_string_t cmd_UserPriority_TrafficClasses_TCs =
+ TOKEN_STRING_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ TrafficClasses, "TC");
+cmdline_parse_token_num_t cmd_UserPriority_TrafficClasses_TCs_id =
+ TOKEN_NUM_INITIALIZER(struct cmd_UserPriority_TrafficClasses_result,
+ TrafficClasses_id, UINT8);
+
+cmdline_parse_inst_t cmd_UserPriority_TrafficClasses = {
+ .f = cmd_UserPriority_TrafficClasses_parsed,
+ .data = NULL,
+ .help_str = "queue-region set port <port_id> UP <value> "
+ "TCs <value>: Set the mapping of User Priority (UP) "
+ "to Traffic Classes (TC) ",
+ .tokens = {
+ (void *)&cmd_UserPriority_TrafficClasses_cmd,
+ (void *)&cmd_UserPriority_TrafficClasses_set,
+ (void *)&cmd_UserPriority_TrafficClasses_port,
+ (void *)&cmd_UserPriority_TrafficClasses_port_index,
+ (void *)&cmd_UserPriority_TrafficClasses_UP,
+ (void *)&cmd_UserPriority_TrafficClasses_UP_id,
+ (void *)&cmd_UserPriority_TrafficClasses_TCs,
+ (void *)&cmd_UserPriority_TrafficClasses_TCs_id,
+ NULL,
+ },
+};
+
+/* *** flush all queue region related configuration *** */
+struct cmd_flush_queue_region_result {
+ cmdline_fixed_string_t cmd;
+ cmdline_fixed_string_t flush;
+ cmdline_fixed_string_t port;
+ uint8_t port_id;
+};
+
+static void
+cmd_flush_queue_region_parsed(void *parsed_result,
+ __attribute__((unused)) struct cmdline *cl,
+ __attribute__((unused)) void *data)
+{
+ struct cmd_flush_queue_region_result *res = parsed_result;
+ struct rte_i40e_rss_region_conf region_conf;
+ int ret = 0;
+
+ memset(®ion_conf, 0, sizeof(region_conf));
+ region_conf.op = RTE_PMD_I40E_REGION_ALL_FLUSH;
+
+ ret = rte_pmd_i40e_queue_region_conf(res->port_id, ®ion_conf);
+
+ if (ret < 0)
+ printf("queue region config programming error: (%s)\n",
+ strerror(-ret));
+}
+
+cmdline_parse_token_string_t cmd_flush_queue_region_cmd =
+ TOKEN_STRING_INITIALIZER(struct cmd_flush_queue_region_result,
+ cmd, "queue-region");
+cmdline_parse_token_string_t cmd_flush_queue_region_flush =
+TOKEN_STRING_INITIALIZER(struct cmd_flush_queue_region_result,
+ flush, "flush");
+cmdline_parse_token_string_t cmd_flush_queue_region_port =
+ TOKEN_STRING_INITIALIZER(struct cmd_flush_queue_region_result,
+ port, "port");
+cmdline_parse_token_num_t cmd_flush_queue_region_port_index =
+ TOKEN_NUM_INITIALIZER(struct cmd_flush_queue_region_result,
+ port_id, UINT8);
+
+cmdline_parse_inst_t cmd_flush_queue_region = {
+ .f = cmd_flush_queue_region_parsed,
+ .data = NULL,
+ .help_str = "queue-region flush port <port_id> "
+ ": flush all queue region related configuration",
+ .tokens = {
+ (void *)&cmd_flush_queue_region_cmd,
+ (void *)&cmd_flush_queue_region_flush,
+ (void *)&cmd_flush_queue_region_port,
+ (void *)&cmd_flush_queue_region_port_index,
+ NULL,
+ },
+};
/* *** ADD/REMOVE A 2tuple FILTER *** */
struct cmd_2tuple_filter_result {
@@ -14376,6 +14691,10 @@ cmdline_parse_ctx_t main_ctx[] = {
(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
(cmdline_parse_inst_t *)&cmd_ptype_mapping_update,
+ (cmdline_parse_inst_t *)&cmd_queue_region,
+ (cmdline_parse_inst_t *)&cmd_region_flowtype,
+ (cmdline_parse_inst_t *)&cmd_UserPriority_TrafficClasses,
+ (cmdline_parse_inst_t *)&cmd_flush_queue_region,
NULL,
};