From: Savinay Dharmappa <savinay.dharmappa@intel.com>
To: cristian.dumitrescu@intel.com, jasvinder.singh@intel.com, dev@dpdk.org
Cc: savinay.dharmappa@intel.com
Subject: [dpdk-dev] [PATCH v5 6/9] example/ip_pipeline: add dynamic config of subport
Date: Wed, 30 Sep 2020 20:24:31 +0100 [thread overview]
Message-ID: <20200930192434.47793-7-savinay.dharmappa@intel.com> (raw)
In-Reply-To: <20200930192434.47793-1-savinay.dharmappa@intel.com>
Modify the ip_pipeline application to build the hierarchical scheduler
with default subport bandwidth profile. It also allows to configure
a subport with different subport bandwidth profile dynamically
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
---
examples/ip_pipeline/cli.c | 17 +++++------
examples/ip_pipeline/tmgr.c | 57 ++++++++++++++++++++++++-------------
examples/ip_pipeline/tmgr.h | 7 ++++-
3 files changed, 52 insertions(+), 29 deletions(-)
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index dafc95ae9..b4d95bb1d 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -406,7 +406,7 @@ cmd_tmgr_subport_profile(char **tokens,
char *out,
size_t out_size)
{
- struct rte_sched_subport_params p;
+ struct tmgr_subport sp;
int status, i;
if (n_tokens != 35) {
@@ -414,23 +414,23 @@ cmd_tmgr_subport_profile(char **tokens,
return;
}
- if (parser_read_uint64(&p.tb_rate, tokens[3]) != 0) {
+ if (parser_read_uint64(&sp.pp.tb_rate, tokens[3]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "tb_rate");
return;
}
- if (parser_read_uint64(&p.tb_size, tokens[4]) != 0) {
+ if (parser_read_uint64(&sp.pp.tb_size, tokens[4]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "tb_size");
return;
}
for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
- if (parser_read_uint64(&p.tc_rate[i], tokens[5 + i]) != 0) {
+ if (parser_read_uint64(&sp.pp.tc_rate[i], tokens[5 + i]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "tc_rate");
return;
}
- if (parser_read_uint64(&p.tc_period, tokens[18]) != 0) {
+ if (parser_read_uint64(&sp.pp.tc_period, tokens[18]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "tc_period");
return;
}
@@ -440,7 +440,8 @@ cmd_tmgr_subport_profile(char **tokens,
return;
}
- if (parser_read_uint32(&p.n_pipes_per_subport_enabled, tokens[20]) != 0) {
+ if (parser_read_uint32(&sp.p.n_pipes_per_subport_enabled,
+ tokens[20]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport");
return;
}
@@ -451,12 +452,12 @@ cmd_tmgr_subport_profile(char **tokens,
}
for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)
- if (parser_read_uint16(&p.qsize[i], tokens[22 + i]) != 0) {
+ if (parser_read_uint16(&sp.p.qsize[i], tokens[22 + i]) != 0) {
snprintf(out, out_size, MSG_ARG_INVALID, "qsize");
return;
}
- status = tmgr_subport_profile_add(&p);
+ status = tmgr_subport_profile_add(&sp);
if (status != 0) {
snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
return;
diff --git a/examples/ip_pipeline/tmgr.c b/examples/ip_pipeline/tmgr.c
index 91ccbf60f..446df8fe2 100644
--- a/examples/ip_pipeline/tmgr.c
+++ b/examples/ip_pipeline/tmgr.c
@@ -8,8 +8,15 @@
#include "tmgr.h"
-static struct rte_sched_subport_params
- subport_profile[TMGR_SUBPORT_PROFILE_MAX];
+struct subport_profile_params {
+ struct rte_sched_subport_params
+ params[TMGR_SUBPORT_PROFILE_MAX];
+
+ struct rte_sched_subport_profile_params
+ profile[TMGR_SUBPORT_PROFILE_MAX];
+};
+
+static struct subport_profile_params subport_profile;
static uint32_t n_subport_profiles;
@@ -44,17 +51,21 @@ tmgr_port_find(const char *name)
}
int
-tmgr_subport_profile_add(struct rte_sched_subport_params *p)
+tmgr_subport_profile_add(struct tmgr_subport *params)
{
/* Check input params */
- if (p == NULL ||
- p->n_pipes_per_subport_enabled == 0)
+ if (params == NULL ||
+ params->p.n_pipes_per_subport_enabled == 0)
return -1;
/* Save profile */
- memcpy(&subport_profile[n_subport_profiles],
- p,
- sizeof(*p));
+ memcpy(&subport_profile.params[n_subport_profiles],
+ ¶ms->p,
+ sizeof(params->p));
+
+ memcpy(&subport_profile.profile[n_subport_profiles],
+ ¶ms->pp,
+ sizeof(params->pp));
n_subport_profiles++;
@@ -103,30 +114,35 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params)
p.mtu = params->mtu;
p.frame_overhead = params->frame_overhead;
p.n_subports_per_port = params->n_subports_per_port;
+ p.n_subport_profiles = n_subport_profiles;
+ p.subport_profiles = subport_profile.profile;
+ p.n_max_subport_profiles = TMGR_SUBPORT_PROFILE_MAX;
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;
+ subport_profile.params[0].pipe_profiles = pipe_profile;
+ subport_profile.params[0].n_pipe_profiles = n_pipe_profiles;
+ subport_profile.params[0].n_max_pipe_profiles = TMGR_PIPE_PROFILE_MAX;
for (i = 0; i < params->n_subports_per_port; i++) {
int status;
- status = rte_sched_subport_config(
+ status = rte_dynamic_sched_subport_config(
s,
i,
- &subport_profile[0]);
+ &subport_profile.params[0], 0);
if (status) {
rte_sched_port_free(s);
return NULL;
}
- for (j = 0; j < subport_profile[0].n_pipes_per_subport_enabled; j++) {
+ for (j = 0; j <
+ subport_profile.params[0].n_pipes_per_subport_enabled; j++) {
+
status = rte_sched_pipe_config(
s,
i,
@@ -177,10 +193,11 @@ tmgr_subport_config(const char *port_name,
return -1;
/* Resource config */
- status = rte_sched_subport_config(
+ status = rte_dynamic_sched_subport_config(
port->s,
subport_id,
- &subport_profile[subport_profile_id]);
+ NULL,
+ subport_profile_id);
return status;
}
@@ -203,10 +220,10 @@ tmgr_pipe_config(const char *port_name,
if ((port == NULL) ||
(subport_id >= port->n_subports_per_port) ||
(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) ||
+ subport_profile.params[subport_id].n_pipes_per_subport_enabled)
+ || (pipe_id_last >=
+ subport_profile.params[subport_id].n_pipes_per_subport_enabled)
+ || (pipe_id_first > pipe_id_last) ||
(pipe_profile_id >= n_pipe_profiles))
return -1;
diff --git a/examples/ip_pipeline/tmgr.h b/examples/ip_pipeline/tmgr.h
index ee50cf7cc..b651ede4a 100644
--- a/examples/ip_pipeline/tmgr.h
+++ b/examples/ip_pipeline/tmgr.h
@@ -31,6 +31,11 @@ struct tmgr_port {
uint32_t n_subports_per_port;
};
+struct tmgr_subport {
+ struct rte_sched_subport_params p;
+ struct rte_sched_subport_profile_params pp;
+};
+
TAILQ_HEAD(tmgr_port_list, tmgr_port);
int
@@ -48,7 +53,7 @@ struct tmgr_port_params {
};
int
-tmgr_subport_profile_add(struct rte_sched_subport_params *p);
+tmgr_subport_profile_add(struct tmgr_subport *sp);
int
tmgr_pipe_profile_add(struct rte_sched_pipe_params *p);
--
2.17.1
next prev parent reply other threads:[~2020-09-30 19:27 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 18:27 [dpdk-dev] [RFC PATCH 0/2] Enable dyynamic configuration of subport bandwidth profile Savinay Dharmappa
2020-07-15 18:27 ` [dpdk-dev] [RFC PATCH 1/2] sched: add dynamic config " Savinay Dharmappa
2020-07-16 8:14 ` Singh, Jasvinder
2020-07-20 11:20 ` Dumitrescu, Cristian
2020-07-20 11:21 ` Dumitrescu, Cristian
2020-09-02 8:56 ` [dpdk-dev] [PATCH v1 1/4] " Savinay Dharmappa
2020-09-02 8:56 ` [dpdk-dev] [PATCH v1 2/4] " Savinay Dharmappa
2020-09-02 8:56 ` [dpdk-dev] [PATCH v1 3/4] " Savinay Dharmappa
2020-09-02 8:56 ` [dpdk-dev] [PATCH v1 4/4] " Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 00/10] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 01/10] sched: add support profile data structure Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 02/10] sched: add subport profile table Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 03/10] sched: add subport profile add and config api Savinay Dharmappa
2020-09-14 14:05 ` Singh, Jasvinder
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 04/10] sched: update the grinder credit update function Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 05/10] sched: update the pipe config api implementation Savinay Dharmappa
2020-09-14 14:26 ` Singh, Jasvinder
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 06/10] example/qos_sched: add dynamic config of subport Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 07/10] example/ip_pipeline: " Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 08/10] drivers/softnic: " Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 09/10] app/test_sched: " Savinay Dharmappa
2020-09-10 18:48 ` [dpdk-dev] [PATCH v2 10/10] sched: remove the redundant code Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 0/9] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 1/9] sched: add support profile data structure Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 2/9] sched: add subport profile table Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 3/9] sched: add subport profile add and config api Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 4/9] sched: update grinder credit and pipe config function Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 5/9] example/qos_sched: add dynamic config of subport Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 6/9] example/ip_pipeline: " Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 7/9] drivers/softnic: " Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 8/9] app/test_sched: " Savinay Dharmappa
2020-09-16 16:43 ` [dpdk-dev] [PATCH v3 9/9] sched: remove the redundant code Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 0/9] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 1/9] sched: add support profile data structure Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 2/9] sched: add subport profile table Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 3/9] sched: add subport profile add and config api Savinay Dharmappa
2020-09-29 21:19 ` Dumitrescu, Cristian
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 4/9] sched: update grinder credit and pipe config function Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 5/9] example/qos_sched: add dynamic config of subport Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 6/9] example/ip_pipeline: " Savinay Dharmappa
2020-09-29 21:23 ` Dumitrescu, Cristian
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 7/9] drivers/softnic: " Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 8/9] app/test_sched: " Savinay Dharmappa
2020-09-17 8:42 ` [dpdk-dev] [PATCH v4 9/9] sched: remove the redundant code Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 0/9] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 1/9] sched: add support profile table Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 2/9] sched: add subport profile add api Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 3/9] sched : add dynamic config of subport bandwidth Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 4/9] sched: update grinder credit and pipe config function Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 5/9] example/qos_sched: add dynamic config of subport Savinay Dharmappa
2020-09-30 19:24 ` Savinay Dharmappa [this message]
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 7/9] drivers/softnic: " Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 8/9] app/test_sched: " Savinay Dharmappa
2020-09-30 19:24 ` [dpdk-dev] [PATCH v5 9/9] sched : remove redundant code Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 0/8] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 1/8] sched: add support profile table Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 2/8] sched: introduce subport profile add function Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 3/8] sched: update subport rate dynamically Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 4/8] example/qos_sched: " Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 5/8] example/ip_pipeline: " Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 6/8] drivers/softnic: " Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 7/8] app/test_sched: " Savinay Dharmappa
2020-10-06 15:27 ` [dpdk-dev] [PATCH v6 8/8] sched: remove redundant code Savinay Dharmappa
2020-10-06 15:52 ` [dpdk-dev] [PATCH v6 0/8] Enable dynamic config of subport bandwidth Dumitrescu, Cristian
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 " Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 1/8] sched: add support profile table Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 2/8] sched: introduce subport profile add function Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 3/8] sched: update subport rate dynamically Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 4/8] example/qos_sched: " Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 5/8] example/ip_pipeline: " Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 6/8] drivers/softnic: " Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 7/8] app/test_sched: " Savinay Dharmappa
2020-10-06 18:02 ` [dpdk-dev] [PATCH v7 8/8] sched: remove redundant code Savinay Dharmappa
2020-10-06 19:05 ` [dpdk-dev] [PATCH v7 0/8] Enable dynamic config of subport bandwidth Dumitrescu, Cristian
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 " Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 1/8] sched: add support profile table Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 2/8] sched: introduce subport profile add function Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 3/8] sched: update subport rate dynamically Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 4/8] example/qos_sched: " Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 5/8] example/ip_pipeline: " Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 6/8] drivers/softnic: " Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 7/8] app/test_sched: " Savinay Dharmappa
2020-10-07 14:09 ` [dpdk-dev] [PATCH v8 8/8] sched: remove redundant code Savinay Dharmappa
2020-10-09 8:28 ` Thomas Monjalon
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 1/8] sched: add support profile table Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 2/8] sched: introduce subport profile add function Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 3/8] sched: update subport rate dynamically Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 4/8] example/qos_sched: " Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 5/8] example/ip_pipeline: " Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 6/8] drivers/softnic: " Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 7/8] app/test_sched: " Savinay Dharmappa
2020-10-09 12:39 ` [dpdk-dev] [PATCH v9 8/8] sched: remove redundant code Savinay Dharmappa
2020-10-11 20:11 ` [dpdk-dev] [PATCH v9 0/8] Enable dynamic config of subport bandwidth Thomas Monjalon
2020-10-12 5:24 ` Dharmappa, Savinay
2020-10-12 23:08 ` Dharmappa, Savinay
2020-10-13 13:56 ` Dharmappa, Savinay
2020-10-13 14:06 ` Thomas Monjalon
2020-10-15 0:17 ` Thomas Monjalon
2020-07-15 18:27 ` [dpdk-dev] [RFC PATCH 2/2] example/qos_sched: subport bandwidth profile config Savinay Dharmappa
2020-07-16 8:14 ` Singh, Jasvinder
2020-09-02 9:07 ` [dpdk-dev] [PATCH v1 1/4] example/qos_sched: subport bandwidth dynmaic conf Savinay Dharmappa
2020-09-02 9:07 ` [dpdk-dev] [PATCH v1 2/4] example/ip_pipeline: " Savinay Dharmappa
2020-09-02 9:07 ` [dpdk-dev] [PATCH v1 3/4] drivers/softnic: subport bandwidth profile config Savinay Dharmappa
2020-09-02 9:07 ` [dpdk-dev] [PATCH v1 4/4] app/test_sched: " Savinay Dharmappa
2020-09-02 10:46 ` [dpdk-dev] [PATCH v1 1/4] example/qos_sched: subport bandwidth dynmaic conf Dharmappa, Savinay
2020-07-16 8:14 ` [dpdk-dev] [RFC PATCH 0/2] Enable dyynamic configuration of subport bandwidth profile Singh, Jasvinder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200930192434.47793-7-savinay.dharmappa@intel.com \
--to=savinay.dharmappa@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).