From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22024A04B7; Wed, 2 Sep 2020 11:07:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3102C1C07B; Wed, 2 Sep 2020 11:07:24 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 693A64C99 for ; Wed, 2 Sep 2020 11:07:22 +0200 (CEST) IronPort-SDR: C2TrvwvS8BYX3Im5913oBiMOd/I2fTelNzzU9LycwNnM9/AMHXK+vqr0qAk6jwZKpPpRgKNEHw HQSd+xetbXsg== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="154857636" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="154857636" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 02:07:19 -0700 IronPort-SDR: dXkD/J6yKMHmdd9gLwUscV2GSWLazFFC7tOEejf40cCzgOxqF97x1xHkiTJoZUJKFlDkLnfGuP 1Wl5Q4ZrmOqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="301757185" Received: from unknown (HELO silpixa00400629.ir.intel.com) ([10.237.214.135]) by orsmga006.jf.intel.com with ESMTP; 02 Sep 2020 02:07:17 -0700 From: Savinay Dharmappa To: cristian.dumitrescu@intel.com, jasvinder.singh@intel.com, dev@dpdk.org Cc: savinay.dharmappa@intel.com Date: Wed, 2 Sep 2020 10:07:09 +0100 Message-Id: <1599037631-199836-2-git-send-email-savinay.dharmappa@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599037631-199836-1-git-send-email-savinay.dharmappa@intel.com> References: <1594837677-313175-3-git-send-email-savinay.dharmappa@intel.com> <1599037631-199836-1-git-send-email-savinay.dharmappa@intel.com> Subject: [dpdk-dev] [PATCH v1 2/4] example/ip_pipeline: subport bandwidth dynmaic conf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ip_pipeline application uses the new apis introduced as part of dynamic configuration of subport bandwidth to configure the deafult subport bandwidth profile while buidling the hirerachical scheduler Signed-off-by: Savinay Dharmappa --- examples/ip_pipeline/cli.c | 10 ++++++---- examples/ip_pipeline/tmgr.c | 28 +++++++++++++++++++++++++--- examples/ip_pipeline/tmgr.h | 3 ++- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index d79699e..e192275 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -406,7 +406,8 @@ cmd_tmgr_subport_profile(char **tokens, char *out, size_t out_size) { - struct rte_sched_subport_params p; + struct rte_sched_subport_params params; + struct rte_sched_subport_profile_params p; int status, i; if (n_tokens != 35) { @@ -440,7 +441,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(¶ms.n_pipes_per_subport_enabled, + tokens[20]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "n_pipes_per_subport"); return; } @@ -451,12 +453,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(¶ms.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(&p, ¶ms); 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 91ccbf6..c609102 100644 --- a/examples/ip_pipeline/tmgr.c +++ b/examples/ip_pipeline/tmgr.c @@ -11,6 +11,9 @@ static struct rte_sched_subport_params subport_profile[TMGR_SUBPORT_PROFILE_MAX]; +static struct rte_sched_subport_profile_params + profile_params[TMGR_SUBPORT_PROFILE_MAX]; + static uint32_t n_subport_profiles; static struct rte_sched_pipe_params @@ -44,15 +47,20 @@ tmgr_port_find(const char *name) } int -tmgr_subport_profile_add(struct rte_sched_subport_params *p) +tmgr_subport_profile_add(struct rte_sched_subport_profile_params *p, + struct rte_sched_subport_params *params) { /* Check input params */ - if (p == NULL || - p->n_pipes_per_subport_enabled == 0) + if (p == NULL || params == NULL || + params->n_pipes_per_subport_enabled == 0) return -1; /* Save profile */ memcpy(&subport_profile[n_subport_profiles], + params, + sizeof(*params)); + + memcpy(&profile_params[n_subport_profiles], p, sizeof(*p)); @@ -103,6 +111,9 @@ 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 = profile_params; + p.n_max_subport_profiles = TMGR_SUBPORT_PROFILE_MAX; p.n_pipes_per_subport = TMGR_PIPE_SUBPORT_MAX; s = rte_sched_port_config(&p); @@ -126,6 +137,13 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params) return NULL; } + status = rte_sched_subport_profile_config(s, i, 0); + + if (status) { + rte_sched_port_free(s); + return NULL; + } + for (j = 0; j < subport_profile[0].n_pipes_per_subport_enabled; j++) { status = rte_sched_pipe_config( s, @@ -182,6 +200,10 @@ tmgr_subport_config(const char *port_name, subport_id, &subport_profile[subport_profile_id]); + if (!status) + status = rte_sched_subport_profile_config(port->s, subport_id, + subport_profile_id); + return status; } diff --git a/examples/ip_pipeline/tmgr.h b/examples/ip_pipeline/tmgr.h index ee50cf7..b19fb23 100644 --- a/examples/ip_pipeline/tmgr.h +++ b/examples/ip_pipeline/tmgr.h @@ -48,7 +48,8 @@ struct tmgr_port_params { }; int -tmgr_subport_profile_add(struct rte_sched_subport_params *p); +tmgr_subport_profile_add(struct rte_sched_subport_profile_params *p, + struct rte_sched_subport_params *params); int tmgr_pipe_profile_add(struct rte_sched_pipe_params *p); -- 2.7.4