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 2EE7DA0546; Fri, 30 Apr 2021 17:07:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E5A684116A; Fri, 30 Apr 2021 17:07:05 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 992FF410DF; Fri, 30 Apr 2021 17:06:58 +0200 (CEST) IronPort-SDR: iHgSjhXi4EsJ18iFP1VcuDCPHARIwFBP69a3IVIzMORzJhnOiPOtStqpFNOCW5UwF6sSy3t5NA 03Yf7Al1t6IA== X-IronPort-AV: E=McAfee;i="6200,9189,9970"; a="261240831" X-IronPort-AV: E=Sophos;i="5.82,263,1613462400"; d="scan'208";a="261240831" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2021 08:06:58 -0700 IronPort-SDR: xHTAlRq8q/o5JjA0AkTxkkzh0xqEkO9pzO6IyXiijW+mdugm4BaoQ0AFYfH4p9xPk0OqDMvYuU kMtvwOoKb/Fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,263,1613462400"; d="scan'208";a="456011341" Received: from silpixa00399126.ir.intel.com ([10.237.223.78]) by FMSMGA003.fm.intel.com with ESMTP; 30 Apr 2021 08:06:56 -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: Fri, 30 Apr 2021 16:06:30 +0100 Message-Id: <20210430150637.362610-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210430150637.362610-1-bruce.richardson@intel.com> References: <20210318182042.43658-1-bruce.richardson@intel.com> <20210430150637.362610-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 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