" <tc0_rate> <tc1_rate> <tc2_rate> <tc3_rate> <tc4_rate>"
" <tc5_rate> <tc6_rate> <tc7_rate> <tc8_rate>"
" <tc9_rate> <tc10_rate> <tc11_rate> <tc12_rate>\n"
-" <tc_period>\n";
+" <tc_period>\n"
+" pps <n_pipes_per_subport>\n"
+" qsize <qsize_tc0> <qsize_tc1> <qsize_tc2>"
+" <qsize_tc3> <qsize_tc4> <qsize_tc5> <qsize_tc6>"
+" <qsize_tc7> <qsize_tc8> <qsize_tc9> <qsize_tc10>"
+" <qsize_tc11> <qsize_tc12>";
static void
cmd_tmgr_subport_profile(char **tokens,
struct rte_sched_subport_params p;
int status, i;
- if (n_tokens != 19) {
+ if (n_tokens != 35) {
snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
return;
}
return;
}
+ if (strcmp(tokens[19], "pps") != 0) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pps");
+ return;
+ }
+
+ if (parser_read_uint32(&p.n_pipes_per_subport_enabled, tokens[20]) != 0) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
+ return;
+ }
+
+ if (strcmp(tokens[21], "qsize") != 0) {
+ snprintf(out, out_size, MSG_ARG_NOT_FOUND, "qsize");
+ return;
+ }
+
+ for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
+ if (parser_read_uint16(&p.qsize[i], tokens[22 + i]) != 0) {
+ snprintf(out, out_size, MSG_ARG_INVALID, "qsize");
+ return;
+ }
+
status = tmgr_subport_profile_add(&p);
if (status != 0) {
snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
"tmgr <tmgr_name>\n"
" rate <rate>\n"
" spp <n_subports_per_port>\n"
-" pps <n_pipes_per_subport>\n"
-" qsize <qsize_tc0> <qsize_tc1> <qsize_tc2>"
-" <qsize_tc3> <qsize_tc4> <qsize_tc5> <qsize_tc6>"
-" <qsize_tc7> <qsize_tc8> <qsize_tc9> <qsize_tc10>"
-" <qsize_tc11> <qsize_tc12>\n"
" fo <frame_overhead>\n"
" mtu <mtu>\n"
" cpu <cpu_id>\n";
struct tmgr_port_params p;
char *name;
struct tmgr_port *tmgr_port;
- int i;
- if (n_tokens != 28) {
+ if (n_tokens != 12) {
snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
return;
}
return;
}
- if (strcmp(tokens[6], "pps") != 0) {
- snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pps");
- return;
- }
-
- if (parser_read_uint32(&p.n_pipes_per_subport, tokens[7]) != 0) {
- snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
- return;
- }
-
- if (strcmp(tokens[8], "qsize") != 0) {
- snprintf(out, out_size, MSG_ARG_NOT_FOUND, "qsize");
- return;
- }
-
- for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
- if (parser_read_uint16(&p.qsize[i], tokens[9 + i]) != 0) {
- snprintf(out, out_size, MSG_ARG_INVALID, "qsize");
- return;
- }
-
- if (strcmp(tokens[22], "fo") != 0) {
+ if (strcmp(tokens[6], "fo") != 0) {
snprintf(out, out_size, MSG_ARG_NOT_FOUND, "fo");
return;
}
- if (parser_read_uint32(&p.frame_overhead, tokens[23]) != 0) {
+ if (parser_read_uint32(&p.frame_overhead, tokens[7]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "frame_overhead");
return;
}
- if (strcmp(tokens[24], "mtu") != 0) {
+ if (strcmp(tokens[8], "mtu") != 0) {
snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mtu");
return;
}
- if (parser_read_uint32(&p.mtu, tokens[25]) != 0) {
+ if (parser_read_uint32(&p.mtu, tokens[9]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "mtu");
return;
}
- if (strcmp(tokens[26], "cpu") != 0) {
+ if (strcmp(tokens[10], "cpu") != 0) {
snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu");
return;
}
- if (parser_read_uint32(&p.cpu_id, tokens[27]) != 0) {
+ if (parser_read_uint32(&p.cpu_id, tokens[11]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id");
return;
}
tmgr_subport_profile_add(struct rte_sched_subport_params *p)
{
/* Check input params */
- if (p == NULL)
+ if (p == NULL ||
+ p->n_pipes_per_subport_enabled == 0)
return -1;
/* Save profile */
tmgr_port_find(name) ||
(params == NULL) ||
(params->n_subports_per_port == 0) ||
- (params->n_pipes_per_subport == 0) ||
(params->cpu_id >= RTE_MAX_NUMA_NODES) ||
(n_subport_profiles == 0) ||
(n_pipe_profiles == 0))
p.mtu = params->mtu;
p.frame_overhead = params->frame_overhead;
p.n_subports_per_port = params->n_subports_per_port;
- p.n_pipes_per_subport = params->n_pipes_per_subport;
-
- for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
- p.qsize[i] = params->qsize[i];
-
- p.pipe_profiles = pipe_profile;
- p.n_pipe_profiles = n_pipe_profiles;
+ p.n_pipes_per_subport = TMGR_PIPE_SUBPORT_MAX;
s = rte_sched_port_config(&p);
if (s == NULL)
return NULL;
+ subport_profile[0].pipe_profiles = pipe_profile;
+ subport_profile[0].n_pipe_profiles = n_pipe_profiles;
+ subport_profile[0].n_max_pipe_profiles = TMGR_PIPE_PROFILE_MAX;
+
for (i = 0; i < params->n_subports_per_port; i++) {
int status;
return NULL;
}
- for (j = 0; j < params->n_pipes_per_subport; j++) {
+ for (j = 0; j < subport_profile[0].n_pipes_per_subport_enabled; j++) {
status = rte_sched_pipe_config(
s,
i,
strlcpy(tmgr_port->name, name, sizeof(tmgr_port->name));
tmgr_port->s = s;
tmgr_port->n_subports_per_port = params->n_subports_per_port;
- tmgr_port->n_pipes_per_subport = params->n_pipes_per_subport;
/* Node add to list */
TAILQ_INSERT_TAIL(&tmgr_port_list, tmgr_port, node);
port = tmgr_port_find(port_name);
if ((port == NULL) ||
(subport_id >= port->n_subports_per_port) ||
- (pipe_id_first >= port->n_pipes_per_subport) ||
- (pipe_id_last >= port->n_pipes_per_subport) ||
+ (pipe_id_first >=
+ subport_profile[subport_id].n_pipes_per_subport_enabled) ||
+ (pipe_id_last >=
+ subport_profile[subport_id].n_pipes_per_subport_enabled) ||
(pipe_id_first > pipe_id_last) ||
(pipe_profile_id >= n_pipe_profiles))
return -1;