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 0D385A04B5; Thu, 10 Sep 2020 20:48:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D02B1C0CA; Thu, 10 Sep 2020 20:48:52 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6DAA6160 for ; Thu, 10 Sep 2020 20:48:49 +0200 (CEST) IronPort-SDR: RX4JxtI9h3YrH2OKA5auenfxAbiaImyUsW6Gm4uB0dVR313gV0G4ElIsqeoUjncSmzNkkWm/yb KHHRUt9OEeSw== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="138130645" X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="138130645" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 11:48:46 -0700 IronPort-SDR: qhYGH3HK4Y7+AexqJMF+KnlgbKWhEr7XkoP6e4sr9cy6iThhmy14Y+5jIYhLGpT6ThRsF1iKAs 09rbhjUTV8uA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="344371069" Received: from silpixa00400629.ir.intel.com ([10.237.214.135]) by orsmga007.jf.intel.com with ESMTP; 10 Sep 2020 11:48:45 -0700 From: Savinay Dharmappa To: jasvinder.singh@intel.com, cristian.dumitrescu@intel.com, dev@dpdk.org Cc: savinay.dharmappa@intel.com Date: Thu, 10 Sep 2020 19:48:28 +0100 Message-Id: <1599763717-135002-2-git-send-email-savinay.dharmappa@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599763717-135002-1-git-send-email-savinay.dharmappa@intel.com> References: <1599037006-3931-1-git-send-email-savinay.dharmappa@intel.com> <1599763717-135002-1-git-send-email-savinay.dharmappa@intel.com> Subject: [dpdk-dev] [PATCH v2 01/10] sched: add support profile data structure 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" Add subport profile data structure to support dynamic configuration of subport bandwidth Signed-off-by: Savinay Dharmappa Signed-off-by: Jasvinder Singh --- lib/librte_sched/rte_sched.c | 11 +++++++++++ lib/librte_sched/rte_sched.h | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 0fa0741..474422b 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include #include #include @@ -101,6 +102,16 @@ enum grinder_state { e_GRINDER_READ_MBUF }; +struct rte_sched_subport_profile { + /* Token bucket (TB) */ + uint64_t tb_period; + uint64_t tb_credits_per_period; + uint64_t tb_size; + + uint64_t tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + uint64_t tc_period; +}; + struct rte_sched_grinder { /* Pipe cache */ uint16_t pcache_qmask[RTE_SCHED_GRINDER_PCACHE_SIZE]; diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index 8a5a93c..39339b7 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -192,6 +192,20 @@ struct rte_sched_subport_params { #endif }; +struct rte_sched_subport_profile_params { + /** Token bucket rate (measured in bytes per second) */ + uint64_t tb_rate; + + /** Token bucket size (measured in credits) */ + uint64_t tb_size; + + /** Traffic class rates (measured in bytes per second) */ + uint64_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + + /** Enforcement period for rates (measured in milliseconds) */ + uint64_t tc_period; +}; + /** Subport statistics */ struct rte_sched_subport_stats { /** Number of packets successfully written */ @@ -254,6 +268,17 @@ struct rte_sched_port_params { /** Number of subports */ uint32_t n_subports_per_port; + /** subport profile table. + * Every pipe is configured using one of the profiles from this table. + */ + struct rte_sched_subport_profile_params *subport_profiles; + + /** Profiles in the pipe profile table */ + uint32_t n_subport_profiles; + + /** Max allowed profiles in the pipe profile table */ + uint32_t n_max_subport_profiles; + /** Maximum number of subport pipes. * This parameter is used to reserve a fixed number of bits * in struct rte_mbuf::sched.queue_id for the pipe_id for all -- 2.7.4