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 F08C5A0546; Fri, 30 Apr 2021 13:18:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3E5C41113; Fri, 30 Apr 2021 13:17:53 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id D676D4113B; Fri, 30 Apr 2021 13:17:50 +0200 (CEST) IronPort-SDR: LoHc6phwi23ozVxnVE37/lCQ0eKxo8Y58AtPQ+xHehO1Zfxz3X6ypmP9Mb63nN/A8uF7dsS2lf 1rW/G4cjGOfg== X-IronPort-AV: E=McAfee;i="6200,9189,9969"; a="177410649" X-IronPort-AV: E=Sophos;i="5.82,262,1613462400"; d="scan'208";a="177410649" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2021 04:17:50 -0700 IronPort-SDR: 2xWmVpEA94MHC9h8Y+werUmLfX8bxWNi7RIZ9fsyqMftookw0royjxbrBEjSNFkgVz8ODnIOxs XODUaTETPPdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,262,1613462400"; d="scan'208";a="387325085" Received: from silpixa00399126.ir.intel.com ([10.237.223.78]) by orsmga003.jf.intel.com with ESMTP; 30 Apr 2021 04:17:48 -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 12:17:20 +0100 Message-Id: <20210430111727.12203-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210430111727.12203-1-bruce.richardson@intel.com> References: <20210318182042.43658-1-bruce.richardson@intel.com> <20210430111727.12203-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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