From patchwork Thu Aug 10 12:21:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 130079 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 D712D43026; Thu, 10 Aug 2023 14:21:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEF0543264; Thu, 10 Aug 2023 14:21:26 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3C99843254 for ; Thu, 10 Aug 2023 14:21:25 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37AAUcbs010098; Thu, 10 Aug 2023 05:21:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=mI/tWqSYZILFID7AQfN8n52y57ZN97yYEO+YUhoZ/rg=; b=BtQGJq45nKG95KZLvITHPEPjLGp2KcYJR/2gGNzHNwriO+TQb5nLAudfaxFetn+/gq/H o2alcu+Q66vS3k4x6Yc4yvfYObJrU6CQssmu7lU+uSQciOdnNWJ/8Emz2PSDnBcKajqy haLSjg4+xY7Pmi4MJx67nW6EsMVNdIpJwpGa6TfqWfHwuMN11/MkCDb35QEvLX4rHmgY dgg9lkN0uEyju00Z1WFmIRRrfliKL6Bpp5QSchAI3t2rjbKd/5vISblhi01vBfZ1dkuO R0hfDBO5jcS39p/HW3v1wK6SZQMo7bex09WVpgz6x3ei1DZKfcWlAkHsRCcHlBQx1iAs Ew== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3scx718b87-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 05:21:23 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 10 Aug 2023 05:21:22 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 10 Aug 2023 05:21:22 -0700 Received: from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34]) by maili.marvell.com (Postfix) with ESMTP id 6E6625B6933; Thu, 10 Aug 2023 05:21:20 -0700 (PDT) From: Gowrishankar Muthukrishnan To: CC: , Chengwen Feng , "Vamsi Attunuru" , Gowrishankar Muthukrishnan Subject: [PATCH 2/4] test/dma: run tests according to PMD Date: Thu, 10 Aug 2023 17:51:09 +0530 Message-ID: <20230810122111.2329-3-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20230810122111.2329-1-gmuthukrishn@marvell.com> References: <20230810122111.2329-1-gmuthukrishn@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: RDOuTJ1IQjmFeuXieq5uyr9re35lEoq3 X-Proofpoint-ORIG-GUID: RDOuTJ1IQjmFeuXieq5uyr9re35lEoq3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-10_10,2023-08-10_01,2023-05-22_02 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 Run tests according to PMD configured. Signed-off-by: Gowrishankar Muthukrishnan --- app/test/meson.build | 7 +++- app/test/test_dmadev.c | 87 +++++++++++++++++++++++++++++++----------- 2 files changed, 71 insertions(+), 23 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 66897c14a3..de671b665f 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -319,7 +319,12 @@ driver_test_names = [ 'cryptodev_sw_snow3g_autotest', 'cryptodev_sw_zuc_autotest', 'cryptodev_uadk_autotest', - 'dmadev_autotest', + 'dmadev_dpaa_autotest', + 'dmadev_dpaa2_autotest', + 'dmadev_hisilicon_autotest', + 'dmadev_idxd_autotest', + 'dmadev_ioat_autotest', + 'dmadev_skeleton_autotest', ] dump_test_names = [] diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index abe970baaf..5e72e8535c 100644 --- a/app/test/test_dmadev.c +++ b/app/test/test_dmadev.c @@ -1025,40 +1025,83 @@ test_dmadev_instance(int16_t dev_id) } static int -test_apis(void) +test_dma(const char *pmd) +{ + int16_t devs[UINT8_MAX]; + uint8_t nb_devs; + int i; + + if (rte_dma_count_avail() == 0) + return TEST_SKIPPED; + + nb_devs = rte_dma_get_dev_list_by_driver(pmd, devs, UINT8_MAX); + if (nb_devs == 0) + ERR_RETURN("Error, No device found for pmd %s\n", pmd); + + printf("\n### Test dmadev infrastructure using %s driver\n", pmd); + if (test_dma_api(devs[0]) < 0) + ERR_RETURN("Error, test failure for %d device\n", devs[0]); + + for (i = 0; i < nb_devs; i++) + if (test_dmadev_instance(devs[i]) < 0) + ERR_RETURN("Error, test failure for %d device\n", devs[i]); + + return 0; +} + +static int +test_skeleton_dma(void) { const char *pmd = "dma_skeleton"; - int id; - int ret; - /* attempt to create skeleton instance - ignore errors due to one being already present */ + /* Attempt to create skeleton instance - ignore errors due to one being already present */ rte_vdev_init(pmd, NULL); - id = rte_dma_get_dev_id_by_name(pmd); - if (id < 0) - return TEST_SKIPPED; - printf("\n### Test dmadev infrastructure using skeleton driver\n"); - ret = test_dma_api(id); + return test_dma(pmd); +} - return ret; +static int +test_dpaa_dma(void) +{ + const char *pmd = "dpaa_qdma"; + + return test_dma(pmd); } static int -test_dma(void) +test_dpaa2_dma(void) { - int i; + const char *pmd = "dpaa2_qdma"; - /* basic sanity on dmadev infrastructure */ - if (test_apis() < 0) - ERR_RETURN("Error performing API tests\n"); + return test_dma(pmd); +} - if (rte_dma_count_avail() == 0) - return TEST_SKIPPED; +static int +test_hisilicon_dma(void) +{ + const char *pmd = "dma_hisilicon"; - RTE_DMA_FOREACH_DEV(i) - if (test_dmadev_instance(i) < 0) - ERR_RETURN("Error, test failure for device %d\n", i); + return test_dma(pmd); +} - return 0; +static int +test_idxd_dma(void) +{ + const char *pmd = "dmadev_idxd_pci"; + + return test_dma(pmd); +} + +static int +test_ioat_dma(void) +{ + const char *pmd = "dmadev_ioat"; + + return test_dma(pmd); } -REGISTER_TEST_COMMAND(dmadev_autotest, test_dma); +REGISTER_TEST_COMMAND(dmadev_skeleton_autotest, test_skeleton_dma); +REGISTER_TEST_COMMAND(dmadev_dpaa_autotest, test_dpaa_dma); +REGISTER_TEST_COMMAND(dmadev_dpaa2_autotest, test_dpaa2_dma); +REGISTER_TEST_COMMAND(dmadev_hisilicon_autotest, test_hisilicon_dma); +REGISTER_TEST_COMMAND(dmadev_idxd_autotest, test_idxd_dma); +REGISTER_TEST_COMMAND(dmadev_ioat_autotest, test_ioat_dma);