From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B2D8A0562; Tue, 4 May 2021 15:15:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87D72410DB; Tue, 4 May 2021 15:15:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 30F3F40147; Tue, 4 May 2021 15:15:33 +0200 (CEST) IronPort-SDR: nFbHTsXIPozSF6yeebhXSkNJsrFSYtN6K62gopPBjFr9K1PmGN8mqQe7XJYfgd9UEvvxqsf8UL KvmCxpRjjXYA== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="195922135" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="195922135" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 06:15:32 -0700 IronPort-SDR: 8qtt2FD4QDy7aqmG7NPBhHYu0CPuHvLlIPCwjrA7z6zQV7s7EyQUCYV5cLtI9y5uKdO6CZykVs sgrmnUxjGFQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="406105545" Received: from silpixa00399126.ir.intel.com ([10.237.223.78]) by orsmga002.jf.intel.com with ESMTP; 04 May 2021 06:15:31 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: kevin.laatz@intel.com, sunil.pai.g@intel.com, jiayu.hu@intel.com, Bruce Richardson , stable@dpdk.org Date: Tue, 4 May 2021 14:14:51 +0100 Message-Id: <20210504131458.593429-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210504131458.593429-1-bruce.richardson@intel.com> References: <20210318182042.43658-1-bruce.richardson@intel.com> <20210504131458.593429-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 05/12] raw/ioat: fix script for configuring small number of queues 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 Sender: "dev" The dpdk_idxd_cfg.py script included with the driver for convenience did not work properly where the number of queues to be configured was less than the number of groups or engines. This was because there would be configured groups/engines not assigned to queues. Fix this by limiting the engine and group counts to be no bigger than the number of queues. Fixes: 01863b9d2354 ("raw/ioat: include example configuration script") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- drivers/raw/ioat/dpdk_idxd_cfg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/raw/ioat/dpdk_idxd_cfg.py b/drivers/raw/ioat/dpdk_idxd_cfg.py index bce4bb5bd4..56e44063e4 100755 --- a/drivers/raw/ioat/dpdk_idxd_cfg.py +++ b/drivers/raw/ioat/dpdk_idxd_cfg.py @@ -39,15 +39,15 @@ def configure_dsa(dsa_id, queues): max_queues = dsa_dir.read_int("max_work_queues") max_tokens = dsa_dir.read_int("max_tokens") - # we want one engine per group - nb_groups = min(max_engines, max_groups) - for grp in range(nb_groups): - dsa_dir.write_values({f"engine{dsa_id}.{grp}/group_id": grp}) - nb_queues = min(queues, max_queues) if queues > nb_queues: print(f"Setting number of queues to max supported value: {max_queues}") + # we want one engine per group, and no more engines than queues + nb_groups = min(max_engines, max_groups, nb_queues) + for grp in range(nb_groups): + dsa_dir.write_values({f"engine{dsa_id}.{grp}/group_id": grp}) + # configure each queue for q in range(nb_queues): wq_dir = SysfsDir(os.path.join(dsa_dir.path, f"wq{dsa_id}.{q}")) -- 2.30.2