From patchwork Tue Mar 21 13:13:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 125370 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E92F3427F7; Tue, 21 Mar 2023 14:14:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A24254282D; Tue, 21 Mar 2023 14:14:09 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C97BC410D1; Tue, 21 Mar 2023 14:14:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679404448; x=1710940448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R0t1UhuoJVB8gWWMbjv6h6bfCEXETkDTGa352yVc6c8=; b=Ohv7S1r4DZGhVZeqPMizWlIQvkNMdfam49nOvhOfLHuf37NJM4sNMB+W cXony/rrnecsT8DqNzVWzWAKx56WjhnlYdD8D0mvb6LmpZ654ala8jG/a y05Zxpi+M7M1ap0emONl6dZ/RZmijLlP13lQ9Jm5yM6fqvuBrjpesm6Mu UkdkSIfUxJZDu4/0HsQyJecj4/anJvysvCmN+Isre9bE7mhhGnUZskdAY jgBktBwIpAan3xI/0y9QLtEZpB47VXXG6MQg06du+AtRcAlfLTc8oVdof teyCIOJ2v5BOS0ZuWwlzn1rA5plaQQzk6vG6/NWZBE34kJVOtlwK2iVeR w==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="319325450" X-IronPort-AV: E=Sophos;i="5.98,279,1673942400"; d="scan'208";a="319325450" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 06:14:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="713992897" X-IronPort-AV: E=Sophos;i="5.98,279,1673942400"; d="scan'208";a="713992897" Received: from silpixa00401385.ir.intel.com ([10.237.214.22]) by orsmga001.jf.intel.com with ESMTP; 21 Mar 2023 06:14:03 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org, Cristian Dumitrescu Subject: [PATCH 1/2] examples/qos_sched: fix config entries in wrong sections Date: Tue, 21 Mar 2023 13:13:49 +0000 Message-Id: <20230321131350.122290-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230321131350.122290-1-bruce.richardson@intel.com> References: <20230321131350.122290-1-bruce.richardson@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When specifying the QoS config, the profiles to be used for each pipe within a subport must be specified in the subport section, not in the section for the subport profile itself. Similarly for subport profiles, those should be specified in the port section. Fixes: de3cfa2c9823 ("sched: initial import") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Cristian Dumitrescu --- examples/qos_sched/profile.cfg | 6 +++--- examples/qos_sched/profile_ov.cfg | 6 +++--- examples/qos_sched/profile_pie.cfg | 6 +++--- examples/qos_sched/profile_red.cfg | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) -- 2.37.2 diff --git a/examples/qos_sched/profile.cfg b/examples/qos_sched/profile.cfg index e8de101b6c..00d4c7c1a5 100644 --- a/examples/qos_sched/profile.cfg +++ b/examples/qos_sched/profile.cfg @@ -26,6 +26,8 @@ number of subports per port = 1 number of pipes per subport = 4096 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 +pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 + [subport profile 0] tb rate = 1250000000 ; Bytes per second tb size = 1000000 ; Bytes @@ -46,8 +48,6 @@ tc 12 rate = 1250000000 ; Bytes per second tc period = 10 ; Milliseconds -pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 - ; Pipe configuration [pipe profile 0] tb rate = 305175 ; Bytes per second @@ -71,4 +71,4 @@ tc period = 40 ; Milliseconds tc 12 oversubscription weight = 1 -tc 12 wrr weights = 1 1 1 1 \ No newline at end of file +tc 12 wrr weights = 1 1 1 1 diff --git a/examples/qos_sched/profile_ov.cfg b/examples/qos_sched/profile_ov.cfg index 14c89ae340..b6fe21ee1e 100644 --- a/examples/qos_sched/profile_ov.cfg +++ b/examples/qos_sched/profile_ov.cfg @@ -6,12 +6,14 @@ frame overhead = 24 number of subports per port = 1 +subport 0-8 = 0 + ; Subport configuration [subport 0] number of pipes per subport = 32 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 -subport 0-8 = 0 +pipe 0-31 = 0 ; These pipes are configured with pipe profile 0 [subport profile 0] tb rate = 8400000 ; Bytes per second @@ -32,8 +34,6 @@ tc 11 rate = 8400000 ; Bytes per second tc 12 rate = 8400000 ; Bytes per second tc period = 10 ; Milliseconds -pipe 0-31 = 0 ; These pipes are configured with pipe profile 0 - ; Pipe configuration [pipe profile 0] tb rate = 16800000 ; Bytes per second diff --git a/examples/qos_sched/profile_pie.cfg b/examples/qos_sched/profile_pie.cfg index 241f748b33..bbc09d912b 100644 --- a/examples/qos_sched/profile_pie.cfg +++ b/examples/qos_sched/profile_pie.cfg @@ -21,12 +21,14 @@ frame overhead = 24 number of subports per port = 1 +subport 0-8 = 0 ; These subports are configured with subport profile 0 + ; Subport configuration [subport 0] number of pipes per subport = 4096 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 -subport 0-8 = 0 ; These subports are configured with subport profile 0 +pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 [subport profile 0] tb rate = 1250000000 ; Bytes per second @@ -48,8 +50,6 @@ tc 12 rate = 1250000000 ; Bytes per second tc period = 10 ; Milliseconds -pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 - ; Pipe configuration [pipe profile 0] tb rate = 305175 ; Bytes per second diff --git a/examples/qos_sched/profile_red.cfg b/examples/qos_sched/profile_red.cfg index 4486d2799e..cee1470fd7 100644 --- a/examples/qos_sched/profile_red.cfg +++ b/examples/qos_sched/profile_red.cfg @@ -21,12 +21,14 @@ frame overhead = 24 number of subports per port = 1 +subport 0-8 = 0 ; These subports are configured with subport profile 0 + ; Subport configuration [subport 0] number of pipes per subport = 4096 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 -subport 0-8 = 0 ; These subports are configured with subport profile 0 +pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 [subport profile 0] tb rate = 1250000000 ; Bytes per second @@ -48,8 +50,6 @@ tc 12 rate = 1250000000 ; Bytes per second tc period = 10 ; Milliseconds -pipe 0-4095 = 0 ; These pipes are configured with pipe profile 0 - ; Pipe configuration [pipe profile 0] tb rate = 305175 ; Bytes per second From patchwork Tue Mar 21 13:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 125371 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76973427F7; Tue, 21 Mar 2023 14:14:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E70FE42BFE; Tue, 21 Mar 2023 14:14:10 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 14D26410EF for ; Tue, 21 Mar 2023 14:14:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679404449; x=1710940449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xhVs5n9wMxpcjXelqqmffA8TtDz7+0YhhXjlVTsvkzA=; b=WtQMWi/WdVM83YO0k/hHhXYR2Fo90DT6LqLrA5bMwpZsui1XWnJ4iRWj WyHfRCIEB+q1iAoAxKcWPXp0LZQukXEGQObNUE6MMIpBSynVvuQ7K9Tob XRxETGPhsJ+SB1mwL7AoFF407/2UgWftsvR7meFE4LnDaOC+W6xjybO/2 lc42Nhlt5xVJkofKq4nTn4lV9fG6fpAvW6m2Gbc3i3+J1+8ynx5vWaGKe 3HTI8+lVu6WCXZtrYrTXYZHbxCe0a/vSZo703SfGORzmMbJRcLiIgAKpH lASPTVbGHJYrBrHiqnz9VhZ7alZIEbz6HPfCQAZ8XB0FbgRcu1CIaOKLj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="319325460" X-IronPort-AV: E=Sophos;i="5.98,279,1673942400"; d="scan'208";a="319325460" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 06:14:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="713992926" X-IronPort-AV: E=Sophos;i="5.98,279,1673942400"; d="scan'208";a="713992926" Received: from silpixa00401385.ir.intel.com ([10.237.214.22]) by orsmga001.jf.intel.com with ESMTP; 21 Mar 2023 06:14:07 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Cristian Dumitrescu Subject: [PATCH 2/2] examples/qos_sched: report error if no pipes configured Date: Tue, 21 Mar 2023 13:13:50 +0000 Message-Id: <20230321131350.122290-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230321131350.122290-1-bruce.richardson@intel.com> References: <20230321131350.122290-1-bruce.richardson@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Have the QoS scheduler sample application report an error if no pipes are configured for a subport. Signed-off-by: Bruce Richardson Acked-by: Cristian Dumitrescu --- examples/qos_sched/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 7a27c03b64..d8abae635a 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -233,6 +233,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) struct rte_eth_link link; struct rte_sched_port *port = NULL; uint32_t pipe, subport; + uint32_t pipe_count; int err; err = rte_eth_link_get(portid, &link); @@ -263,6 +264,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t n_pipes_per_subport = subport_params[subport].n_pipes_per_subport_enabled; + pipe_count = 0; for (pipe = 0; pipe < n_pipes_per_subport; pipe++) { if (app_pipe_to_profile[subport][pipe] != -1) { err = rte_sched_pipe_config(port, subport, pipe, @@ -272,8 +274,13 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) "for profile %d, err=%d\n", pipe, app_pipe_to_profile[subport][pipe], err); } + pipe_count++; } } + + if (pipe_count == 0) + rte_exit(EXIT_FAILURE, "Error: invalid config, no pipes enabled for sched subport %u\n", + subport); } return port;