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 F3554A00C5; Wed, 16 Feb 2022 17:09:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E53FC410FF; Wed, 16 Feb 2022 17:09:32 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id E079940150; Wed, 16 Feb 2022 17:09:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645027771; x=1676563771; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uSBsEdJ227f5pPe3zyuctcmrVBvM0pd0xy3gNXYg12Q=; b=KSEtns9xn10mUGn1IsNEbVBcYQJKXimcqovt2os/kbZEnlsV8doUESfD CsIwDrRWR9jPUxoIIhtJN0oCNP0m1hSOXdDB+gpi5Mz2N3dNVQE31JVNX 1ezAHYnmo9BWJMMjDlSuXyDQuECelGl8MZl8ot9tomibuXi1sILgGpr1/ CMEWMvmed9USqmvPChMOIs0O1bUxuxl5D0fNtQwTSiJv6GMU0iuDLWbhO 9uuInpXi7+XNJFZlh0BAqLmgKaicO2CMzYko9rjFl4dRYAo5b0TUcaVtn nvhOqrCKoHj1ha8qas9d+a9RtDYqrQfdMF6NJupYiL1vfz++834/BKnHC A==; X-IronPort-AV: E=McAfee;i="6200,9189,10260"; a="275236466" X-IronPort-AV: E=Sophos;i="5.88,374,1635231600"; d="scan'208";a="275236466" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 08:06:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,374,1635231600"; d="scan'208";a="704363183" Received: from silpixa00401026.ir.intel.com ([10.243.22.62]) by orsmga005.jf.intel.com with ESMTP; 16 Feb 2022 08:06:30 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , kevin.laatz@intel.com, stable@dpdk.org, Chengwen Feng , Conor Walsh Subject: [PATCH 1/3] app/test: fix missing checks for DMA device capacity Date: Wed, 16 Feb 2022 16:06:07 +0000 Message-Id: <20220216160610.475242-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220216160610.475242-1-bruce.richardson@intel.com> References: <20220216160610.475242-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 For some DMA HW devices, e.g. those using the idxd driver, the maximum burst size is configurable, which can lead to test failures if the value is set too small. Add explicit check for this to give reasonable error messages for devices which need their config adjusted. Fixes: 1b86a66a30c2 ("test/dma: add more comprehensive copy tests") Fixes: 8fa5d2683940 ("test/dma: add burst capacity test") Cc: kevin.laatz@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- app/test/test_dmadev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index db5aff701c..2b097e0f47 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -775,6 +775,9 @@ test_dmadev_instance(int16_t dev_id) if (rte_dma_stats_get(dev_id, vchan, &stats) != 0) ERR_RETURN("Error with rte_dma_stats_get()\n"); + if (rte_dma_burst_capacity(dev_id, vchan) < 32) + ERR_RETURN("Error: Device does not have sufficient burst capacity to run tests"); + if (stats.completed != 0 || stats.submitted != 0 || stats.errors != 0) ERR_RETURN("Error device stats are not all zero: completed = %"PRIu64", " "submitted = %"PRIu64", errors = %"PRIu64"\n", @@ -796,7 +799,10 @@ test_dmadev_instance(int16_t dev_id) goto err; /* run some burst capacity tests */ - if (runtest("burst capacity", test_burst_capacity, 1, dev_id, vchan, CHECK_ERRS) < 0) + if (rte_dma_burst_capacity(dev_id, vchan) < 64) + printf("DMA Dev %u: insufficient burst capacity (64 required), skipping tests\n", + dev_id); + else if (runtest("burst capacity", test_burst_capacity, 1, dev_id, vchan, CHECK_ERRS) < 0) goto err; /* to test error handling we can provide null pointers for source or dest in copies. This -- 2.32.0