From patchwork Thu Oct 10 12:36:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 60884 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 544771E95C; Thu, 10 Oct 2019 14:37:30 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 69E691E959 for ; Thu, 10 Oct 2019 14:37:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2019 05:37:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,280,1566889200"; d="scan'208";a="223945325" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.223.218]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2019 05:37:26 -0700 From: Ciara Power To: bruce.richardson@intel.com Cc: dev@dpdk.org, Ciara Power Date: Thu, 10 Oct 2019 13:36:02 +0100 Message-Id: <20191010123603.58007-2-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010123603.58007-1-ciara.power@intel.com> References: <20191010123603.58007-1-ciara.power@intel.com> Subject: [dpdk-dev] [PATCH 1/2] raw/ioat: fix rawdev state to stopped after test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 ioat rawdev was initially started during the test, however was never stopped. This would cause issues when running the test again, as the device cannot be configured when in a running state. The device is now stopped after the test has completed, or if the test is terminated due to error. Fixes: 849470d522ed ("raw/ioat: add configure, start and stop functions") Cc: bruce.richardson@intel.com Signed-off-by: Ciara Power Acked-by: Bruce Richardson --- drivers/raw/ioat/ioat_rawdev_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c index f6c7dbb80..6aad79486 100644 --- a/drivers/raw/ioat/ioat_rawdev_test.c +++ b/drivers/raw/ioat/ioat_rawdev_test.c @@ -220,6 +220,7 @@ ioat_rawdev_test(uint16_t dev_id) } printf("\n"); + rte_rawdev_stop(dev_id); rte_mempool_free(pool); free(snames); free(stats); @@ -227,6 +228,7 @@ ioat_rawdev_test(uint16_t dev_id) return 0; err: + rte_rawdev_stop(dev_id); rte_mempool_free(pool); free(snames); free(stats); From patchwork Thu Oct 10 12:36:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Power, Ciara" X-Patchwork-Id: 60885 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B44D1E994; Thu, 10 Oct 2019 14:37:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 037221E994 for ; Thu, 10 Oct 2019 14:37:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2019 05:37:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,280,1566889200"; d="scan'208";a="223945356" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.223.218]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2019 05:37:32 -0700 From: Ciara Power To: bruce.richardson@intel.com Cc: dev@dpdk.org, Ciara Power Date: Thu, 10 Oct 2019 13:36:03 +0100 Message-Id: <20191010123603.58007-3-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010123603.58007-1-ciara.power@intel.com> References: <20191010123603.58007-1-ciara.power@intel.com> Subject: [dpdk-dev] [PATCH 2/2] raw/ioat: fix initial ring size check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When running the ioat_rawdev_autotest, the ring size was initially required to be 0. This prevented the test being run multiple times, as the ring size is modified to a non-zero value when running the first test. A global variable is now used to track the expected ring size, and is used in the initial value check. This enables the test to be run more than once. Fixes: 849470d522ed ("raw/ioat: add configure, start and stop functions") Cc: bruce.richardson@intel.com Reported-by: Yinan Wang Signed-off-by: Ciara Power Acked-by: Bruce Richardson --- drivers/raw/ioat/ioat_rawdev_test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c index 6aad79486..e99f97ec4 100644 --- a/drivers/raw/ioat/ioat_rawdev_test.c +++ b/drivers/raw/ioat/ioat_rawdev_test.c @@ -11,6 +11,7 @@ int ioat_rawdev_test(uint16_t dev_id); /* pre-define to keep compiler happy */ static struct rte_mempool *pool; +static unsigned short expected_ring_size; static int test_enqueue_copies(int dev_id) @@ -148,9 +149,9 @@ ioat_rawdev_test(uint16_t dev_id) unsigned int i; rte_rawdev_info_get(dev_id, &info); - if (p.ring_size != 0) { - printf("Error, initial ring size is non-zero (%d)\n", - (int)p.ring_size); + if (p.ring_size != expected_ring_size) { + printf("Error, initial ring size is not as expected (Actual: %d, Expected: %d)\n", + (int)p.ring_size, expected_ring_size); return -1; } @@ -165,6 +166,7 @@ ioat_rawdev_test(uint16_t dev_id) IOAT_TEST_RINGSIZE, (int)p.ring_size); return -1; } + expected_ring_size = p.ring_size; if (rte_rawdev_start(dev_id) != 0) { printf("Error with rte_rawdev_start()\n");