From patchwork Mon Apr 26 09:52:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 92157 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 D32EBA0548; Mon, 26 Apr 2021 11:53:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D92B411C2; Mon, 26 Apr 2021 11:53:24 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 04E6D4119B; Mon, 26 Apr 2021 11:53:17 +0200 (CEST) IronPort-SDR: ZQNTwDt0iuwEaElVhfw6s23bgHSjwG5N0XTo0joKTCxP4wn4x63ua+Q5sbZaqu8/yLHLznXvMw XF23ES85UXpg== X-IronPort-AV: E=McAfee;i="6200,9189,9965"; a="183442903" X-IronPort-AV: E=Sophos;i="5.82,252,1613462400"; d="scan'208";a="183442903" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2021 02:53:16 -0700 IronPort-SDR: FdFWIbmufXpf65T1lPYVFEMMJX8LWp4IR7a/NvNkseDbHLSw5xopSnszqjBSm7IHEkb/UaeTYL 25O22PY5PLhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,252,1613462400"; d="scan'208";a="429336917" Received: from silpixa00399126.ir.intel.com ([10.237.223.81]) by orsmga008.jf.intel.com with ESMTP; 26 Apr 2021 02:53:15 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: kevin.laatz@intel.com, jiayu.hu@intel.com, Bruce Richardson , stable@dpdk.org Date: Mon, 26 Apr 2021 10:52:52 +0100 Message-Id: <20210426095259.225354-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210426095259.225354-1-bruce.richardson@intel.com> References: <20210318182042.43658-2-bruce.richardson@intel.com> <20210426095259.225354-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 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}"))