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 1A209A00E6 for ; Thu, 11 Jul 2019 12:28:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 759CB1BDE0; Thu, 11 Jul 2019 12:27:10 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 17FF41B946 for ; Thu, 11 Jul 2019 12:27:02 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2019 03:27:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,478,1557212400"; d="scan'208";a="317641422" Received: from silpixa00381635.ir.intel.com (HELO silpixa00381635.ger.corp.intel.com) ([10.237.223.4]) by orsmga004.jf.intel.com with ESMTP; 11 Jul 2019 03:27:01 -0700 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, Abraham Tovar , Lukasz Krakowiak Date: Thu, 11 Jul 2019 11:26:57 +0100 Message-Id: <20190711102659.59001-10-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190711102659.59001-1-jasvinder.singh@intel.com> References: <20190625153217.24301-2-jasvinder.singh@intel.com> <20190711102659.59001-1-jasvinder.singh@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 09/11] examples/ip_pipeline: add config flexibility to tm function 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" Update ip pipeline sample app for configuration flexiblity of pipe traffic classes and queues. Signed-off-by: Jasvinder Singh Signed-off-by: Abraham Tovar Signed-off-by: Lukasz Krakowiak --- examples/ip_pipeline/cli.c | 45 +++++++++++++++----------- examples/ip_pipeline/tmgr.c | 2 +- examples/ip_pipeline/tmgr.h | 4 +-- lib/librte_pipeline/rte_table_action.c | 1 - lib/librte_pipeline/rte_table_action.h | 4 +-- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index 309b2936e..b5e8b9bcf 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -377,7 +377,9 @@ cmd_swq(char **tokens, static const char cmd_tmgr_subport_profile_help[] = "tmgr subport profile\n" " \n" -" \n" +" " +" " +" \n" " \n"; static void @@ -389,7 +391,7 @@ cmd_tmgr_subport_profile(char **tokens, struct rte_sched_subport_params p; int status, i; - if (n_tokens != 10) { + if (n_tokens != 19) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } @@ -410,7 +412,7 @@ cmd_tmgr_subport_profile(char **tokens, return; } - if (parser_read_uint32(&p.tc_period, tokens[9]) != 0) { + if (parser_read_uint32(&p.tc_period, tokens[18]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_period"); return; } @@ -425,10 +427,12 @@ cmd_tmgr_subport_profile(char **tokens, static const char cmd_tmgr_pipe_profile_help[] = "tmgr pipe profile\n" " \n" -" \n" +" " +" " +" \n" " \n" " \n" -" \n"; +" \n"; static void cmd_tmgr_pipe_profile(char **tokens, @@ -439,7 +443,7 @@ cmd_tmgr_pipe_profile(char **tokens, struct rte_sched_pipe_params p; int status, i; - if (n_tokens != 27) { + if (n_tokens != 24) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } @@ -460,20 +464,20 @@ cmd_tmgr_pipe_profile(char **tokens, return; } - if (parser_read_uint32(&p.tc_period, tokens[9]) != 0) { + if (parser_read_uint32(&p.tc_period, tokens[18]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_period"); return; } #ifdef RTE_SCHED_SUBPORT_TC_OV - if (parser_read_uint8(&p.tc_ov_weight, tokens[10]) != 0) { + if (parser_read_uint8(&p.tc_ov_weight, tokens[19]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "tc_ov_weight"); return; } #endif - for (i = 0; i < RTE_SCHED_QUEUES_PER_PIPE; i++) - if (parser_read_uint8(&p.wrr_weights[i], tokens[11 + i]) != 0) { + for (i = 0; i < RTE_SCHED_BE_QUEUES_PER_PIPE; i++) + if (parser_read_uint8(&p.wrr_weights[i], tokens[20 + i]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "wrr_weights"); return; } @@ -490,7 +494,10 @@ static const char cmd_tmgr_help[] = " rate \n" " spp \n" " pps \n" -" qsize \n" +" qsize " +" " +" " +" \n" " fo \n" " mtu \n" " cpu \n"; @@ -506,7 +513,7 @@ cmd_tmgr(char **tokens, struct tmgr_port *tmgr_port; int i; - if (n_tokens != 19) { + if (n_tokens != 31) { snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); return; } @@ -548,38 +555,38 @@ cmd_tmgr(char **tokens, return; } - for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) + for (i = 0; i < RTE_SCHED_QUEUES_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[13], "fo") != 0) { + if (strcmp(tokens[25], "fo") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "fo"); return; } - if (parser_read_uint32(&p.frame_overhead, tokens[14]) != 0) { + if (parser_read_uint32(&p.frame_overhead, tokens[26]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "frame_overhead"); return; } - if (strcmp(tokens[15], "mtu") != 0) { + if (strcmp(tokens[27], "mtu") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "mtu"); return; } - if (parser_read_uint32(&p.mtu, tokens[16]) != 0) { + if (parser_read_uint32(&p.mtu, tokens[28]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "mtu"); return; } - if (strcmp(tokens[17], "cpu") != 0) { + if (strcmp(tokens[29], "cpu") != 0) { snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu"); return; } - if (parser_read_uint32(&p.cpu_id, tokens[18]) != 0) { + if (parser_read_uint32(&p.cpu_id, tokens[30]) != 0) { snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id"); return; } diff --git a/examples/ip_pipeline/tmgr.c b/examples/ip_pipeline/tmgr.c index 40cbf1d0a..0a04ca4a6 100644 --- a/examples/ip_pipeline/tmgr.c +++ b/examples/ip_pipeline/tmgr.c @@ -105,7 +105,7 @@ tmgr_port_create(const char *name, struct tmgr_port_params *params) 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++) + for (i = 0; i < RTE_SCHED_QUEUES_PER_PIPE; i++) p.qsize[i] = params->qsize[i]; p.pipe_profiles = pipe_profile; diff --git a/examples/ip_pipeline/tmgr.h b/examples/ip_pipeline/tmgr.h index 0b497e795..aad96097d 100644 --- a/examples/ip_pipeline/tmgr.h +++ b/examples/ip_pipeline/tmgr.h @@ -39,11 +39,11 @@ tmgr_port_find(const char *name); struct tmgr_port_params { uint32_t rate; uint32_t n_subports_per_port; - uint32_t n_pipes_per_subport; - uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; uint32_t frame_overhead; uint32_t mtu; uint32_t cpu_id; + uint32_t n_pipes_per_subport; + uint16_t qsize[RTE_SCHED_QUEUES_PER_PIPE]; }; int diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c index a54ec46bc..47d7efbc1 100644 --- a/lib/librte_pipeline/rte_table_action.c +++ b/lib/librte_pipeline/rte_table_action.c @@ -401,7 +401,6 @@ pkt_work_tm(struct rte_mbuf *mbuf, { struct dscp_table_entry_data *dscp_entry = &dscp_table->entry[dscp]; uint32_t queue_id = data->queue_id | - (dscp_entry->tc << 2) | dscp_entry->tc_queue; rte_mbuf_sched_set(mbuf, queue_id, dscp_entry->tc, (uint8_t)dscp_entry->color); diff --git a/lib/librte_pipeline/rte_table_action.h b/lib/librte_pipeline/rte_table_action.h index 44041b5c9..82bc9d9ac 100644 --- a/lib/librte_pipeline/rte_table_action.h +++ b/lib/librte_pipeline/rte_table_action.h @@ -181,10 +181,10 @@ struct rte_table_action_lb_params { * RTE_TABLE_ACTION_MTR */ /** Max number of traffic classes (TCs). */ -#define RTE_TABLE_ACTION_TC_MAX 4 +#define RTE_TABLE_ACTION_TC_MAX 16 /** Max number of queues per traffic class. */ -#define RTE_TABLE_ACTION_TC_QUEUE_MAX 4 +#define RTE_TABLE_ACTION_TC_QUEUE_MAX 16 /** Differentiated Services Code Point (DSCP) translation table entry. */ struct rte_table_action_dscp_table_entry { -- 2.21.0