Return-Path: Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 52730C002A for ; Fri, 12 May 2023 15:51:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2C952415A8 for ; Fri, 12 May 2023 15:51:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2C952415A8 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=C1dCIvmI X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -4.402 X-Spam-Level: X-Spam-Status: No, score=-4.402 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pHm-sYRWjCFb for ; Fri, 12 May 2023 15:51:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org DAEE54018B Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by smtp2.osuosl.org (Postfix) with ESMTPS id DAEE54018B for ; Fri, 12 May 2023 15:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683906677; x=1715442677; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=I7zj1IpB1doOHyWsEfgD3kwwTVf1x3XQNZmDrkkn+cE=; b=C1dCIvmIdirFKcQvgz5SuZJcFa90p5THSlgUqvZdEX7Ui58jPrKvXDTg u+aRyzXV03chrQ9i6BLS44tBb/kOFT80fepR64FclFvnhQzkkrr+RY1ix n9Tw7Pj27Dojyi2OgV4RDTZkAD+9Vvljt0o7+S9/ZkNc6ClkWAGquZviS lMJ1T9Mj/TUH+/0tgMo1Zp9tODZQHR0ei28FxMjaSDf5Hknmin8ejX7fu DaXYn6v8fYWzPPa1Ehy4sEza0iVLHJBXYMZzwgc14edT8lLrxlbNtjfSU TKk4X2ED0ml5BS3OQQjOWKiQdgsxlpwxlrCx0DjgLRTbjyKzRNHIPk05O Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10708"; a="414191935" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="414191935" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 08:51:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10708"; a="730862507" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="730862507" Received: from djiang5-mobl3.amr.corp.intel.com (HELO [10.213.160.55]) ([10.213.160.55]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 08:51:16 -0700 Message-ID: Date: Fri, 12 May 2023 08:51:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.10.0 Content-Language: en-US To: Rex Zhang , fenghua.yu@intel.com, ramesh.thomas@intel.com, tony.zhu@intel.com, accel-config@lists.linuxfoundation.org References: <20230512053123.16960-1-rex.zhang@intel.com> <20230512053123.16960-2-rex.zhang@intel.com> From: Dave Jiang In-Reply-To: <20230512053123.16960-2-rex.zhang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Accel-config] [PATCH v3 2/2] accel-config/test: Fix bug about finding a mismatched wq X-BeenThere: accel-config@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: accel-config List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2023 15:51:19 -0000 On 5/11/23 10:31 PM, Rex Zhang wrote: > When both DSA wq and IAA wq are enabled, the test code would find > the first available wq for submitting descriptors. If the DSA wq > is prior to IAA wq, the IAA test code would use DSA wq. It's incorrect. > For fixing this bug, jump over the wq with mismatched device type. > > Signed-off-by: Rex Zhang Simple ans straight forward. Reviewed-by: Dave Jiang > --- > test/accel_test.c | 4 ++++ > test/accel_test.h | 1 + > test/dsa_test.c | 1 + > test/iaa_test.c | 1 + > 4 files changed, 7 insertions(+) > > diff --git a/test/accel_test.c b/test/accel_test.c > index 7bbe780..61d9944 100644 > --- a/test/accel_test.c > +++ b/test/accel_test.c > @@ -125,6 +125,10 @@ static struct accfg_wq *acctest_get_wq(struct acctest_context *ctx, > enum accfg_wq_mode mode; > enum accfg_wq_type type; > > + /* Make sure iaa_test will not use dsa wq, vice versa*/ > + if (accfg_device_get_type(device) != ctx->dev_type) > + continue; > + > /* Get a workqueue that's enabled */ > wstate = accfg_wq_get_state(wq); > if (wstate != ACCFG_WQ_ENABLED) > diff --git a/test/accel_test.h b/test/accel_test.h > index 3b41a78..f152850 100644 > --- a/test/accel_test.h > +++ b/test/accel_test.h > @@ -160,6 +160,7 @@ struct acctest_context { > unsigned int wq_max_batch_size; > unsigned long wq_max_xfer_size; > int ats_disable; > + enum accfg_device_type dev_type; > > int is_batch; > int is_evl_test; > diff --git a/test/dsa_test.c b/test/dsa_test.c > index a4aad29..31cb964 100644 > --- a/test/dsa_test.c > +++ b/test/dsa_test.c > @@ -897,6 +897,7 @@ int main(int argc, char *argv[]) > } > > dsa = acctest_init(tflags); > + dsa->dev_type = ACCFG_DEVICE_DSA; > > if (!dsa) > return -ENOMEM; > diff --git a/test/iaa_test.c b/test/iaa_test.c > index a1f529d..c682009 100644 > --- a/test/iaa_test.c > +++ b/test/iaa_test.c > @@ -643,6 +643,7 @@ int main(int argc, char *argv[]) > } > > iaa = acctest_init(tflags); > + iaa->dev_type = ACCFG_DEVICE_IAX; > > if (!iaa) > return -ENOMEM;