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 CEA37A0C54; Fri, 3 Sep 2021 18:06:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52A0C410D7; Fri, 3 Sep 2021 18:06:28 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 7B50140E78 for ; Fri, 3 Sep 2021 18:06:25 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10096"; a="216315192" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="216315192" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 09:06:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="646884349" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga005.jf.intel.com with ESMTP; 03 Sep 2021 09:05:59 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 3 Sep 2021 09:05:59 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 3 Sep 2021 09:05:59 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Fri, 3 Sep 2021 09:05:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xx6PCfNkFb3uR1EdHhQbv7wijR+wiGIA5GGHQkyhnMszSn5akNNCU9EzjjPKpbZKROMOpetxA+QtsevJbWOQfVhYO2A6+pXt+iIT2EPQmdGfwKRna5C8RmmoXndtUQYj2lviyPJKzAMmoO2QPFQc/atAZrtApHPnFGfVGorvbFL491rGMTkKWuIDqtNkyv+mZT+pK6RyX1Zwfkpr1/5RhdX5blDYvJBXzYz+GF8uMk9tymh3ovxwxMevZMavplDVCi7FJS7W8RVdQ9Zv9uK2tKmGQasLUuyrQZ7IUGxmpEhbn7WOUKQMHEp+EolXMG944PwEOlTkhGonodhiDY2LPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AKMg/P6AdJXyCntjG3zotqix3nBt2a5UaBacJP1ocbY=; b=gYAb2UI8/wDmtLPwPNxXrjJu/1s1m9M/tvVgdsj9hbZ3t4CDQ3LRhob5qWPc6s6LANale8Q9eX2w354pgmBrsLier6PiaQ95etMZY2zYKAN8UHnhaxzGhteUcZYUVrUcjXVgd4uPwIAtzbvS9fxwLyAD1UI7kZbq2jJ/NdsrHAMQBEQLVMh0co88YrWts5vhyUaY2h5tFDOVaOyf2tkj33Zqf+WRKNSTI7lvRL7vc3Bz991iddCUjk+iL2GcVXJRmss9JhsP18OxrsAIaQxNFezEWExSoD/hkqaRYTzNEMxZe71otWvcs8ZVHrDkJVRi1sNdItlsvxukhrGLZc4wlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AKMg/P6AdJXyCntjG3zotqix3nBt2a5UaBacJP1ocbY=; b=mS++SPm6repHIl0r03FjHd42ZDmIJ7ADy0a+2AcT6CKKU/ejClndZeoJOUITCuJRNd+l5AyCpmjsM0ko6shrCr+bLu/MyTndch7kTF4uzgLLQPh9oib73ZW42AMXxM0sP1zTUJJNHMWU3Pv5YpZhwClqcyv/Py4C8UwpWvCGSuU= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) by SJ0PR11MB4893.namprd11.prod.outlook.com (2603:10b6:a03:2ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Fri, 3 Sep 2021 16:05:57 +0000 Received: from SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271]) by SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271%5]) with mapi id 15.20.4478.022; Fri, 3 Sep 2021 16:05:57 +0000 To: Bruce Richardson , CC: , , References: <20210826183301.333442-1-bruce.richardson@intel.com> <20210901163216.120087-1-bruce.richardson@intel.com> <20210901163216.120087-4-bruce.richardson@intel.com> From: Kevin Laatz Message-ID: <2f9c3776-953e-b6c4-745f-8516852fff3f@intel.com> Date: Fri, 3 Sep 2021 17:05:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <20210901163216.120087-4-bruce.richardson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: DB6PR0402CA0005.eurprd04.prod.outlook.com (2603:10a6:4:91::15) To SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) MIME-Version: 1.0 Received: from [192.168.1.15] (109.79.29.175) by DB6PR0402CA0005.eurprd04.prod.outlook.com (2603:10a6:4:91::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Fri, 3 Sep 2021 16:05:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 758a120f-544f-4174-8420-08d96ef4b71d X-MS-TrafficTypeDiagnostic: SJ0PR11MB4893: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r6rItiWRBz5xCmGRkS+Lm508tT8/dOvKU6q28i2I58XduvXvSC0W5+ac97695vQndlufRCuXWQIBNG8qnetBJWq1ba4pRGoIB9QtXjoNjmBfvLW/i5TMooQBwvMcZIrPF5YR7TNQPv7uAD2UwVJWApT45NZPIYCAeraNg7eXCPPu/N1EKwBCfdnDu2VaMudGRBflVcInkwIBiSx1KacBCiesrr/KFrzkaVKimni0F/aCVGuB024bMXxoJRlrdXrMrIodM0VmxZ2xBFdwQ5J8DQuyNlALBTCKsEv9HLWLP0F2CdGz3al9F+6bwj1cBSqdqhPXi6I0R8OdYfWfDOYmh7VFf9Rd5wSFXds2SYDh5o7xRFdA7usd+hsN8/OPt0kAqENaOnjHujWs5cuvTvqJM8GXRFWj8P3Co0tWRzDk3jGOJ1WMPwk6VPP9hpM1+wtKGkKW/3WZ+6STeZQ7f+WGW/MVy3iZCk3ZozBkhc5pF/pFa7qtxs8Yd8i2GsF1gItOy4M1rLIQFDhh2B7EhGDSOylYeuAYYf6HIal1s+CiRxFy3KJGJO6oAhH2ZNxPWmrKhXvvoIQuZcTY7cI0QJ8BgmRj8uL9rqoDop3DRW7NmJjapD9SfjxMJrbA7Hm6CESaljh1IgLwfpYCf3grKf1xwX/ru5MjmjIxKbTC/mQ/pFJnpNXvvV40H4epb0ab58P+oVqjsANC/qmOEWWsQPyilt27H7YNFFiGwY9OFN6hnWw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5055.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(396003)(39860400002)(376002)(8936002)(4326008)(83380400001)(38100700002)(478600001)(2906002)(8676002)(36756003)(66556008)(6486002)(5660300002)(66476007)(6666004)(31686004)(53546011)(86362001)(66946007)(26005)(316002)(44832011)(2616005)(186003)(956004)(16576012)(31696002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXMyT2xVMUJUVnhyVExOd3AyWThpWHZqZXdSaHlUUXJEdFZucjlrZmVFYndH?= =?utf-8?B?RFF5WFBaUnZMNk01N1RZTlFCV2dXRzE0bnRIeDJnV2hrK3NCZkpaU3Z6MmRN?= =?utf-8?B?S296bFBCcmFWQk1QT2xUa2FWY2ZvZGREdnc4cjMyOUZhelE3aXRocE10d3d1?= =?utf-8?B?YkZnWjB3S1F2Z3ZHNHpua0h2WkpNWGxqcjFUT1ZZdEZMRkxJSkJrekttejVH?= =?utf-8?B?VFY0MDR3endwSllvY3lXcngvK3VQVEFtTHJ4aDF4eE9sc256NkVXeWQyeTB0?= =?utf-8?B?UjlJeHdNWGNZWDNxVFEzRFRJYVQ5aHRpRFRQbjRoUFhxbzZKdS9qZW81WWV0?= =?utf-8?B?ZXZxQkZkK3hlT2NDUlp6QXBHUG9xaEZCb3h3blREY0ZxbFJXdVVTbHZqUkpV?= =?utf-8?B?aEx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UhaTHovYzFyZ21K?= =?utf-8?B?YmZWV3l6SGwrRllKQWo2R1lrRzRnSVllcmlTaHZ0SEQ1WE1DUGhMTzJCenZQ?= =?utf-8?B?YWx5NnRvOHZkYlJ1cGxYeVZnMWd1c0E2blNseGE4dTNiWC9ESXVxakpMOStW?= =?utf-8?B?b01QSFlnSEhpOFJ6Y0t1Yy9yWE5jY0s5eDBhcEMvVmZ5ZU5hcnZ0ODFlZ3lL?= =?utf-8?B?c0tJMi9GeWZwV0liUzgxYmd2RkFoaEdtS1dGWkRnSGlUZFJJOXJsdFRwdHdP?= =?utf-8?B?RU5HeUZPZlQ3LzFtUWJDVUdPbDFhZXdFdUovcmZYQ01pSWdrNE1FcFhxcDRH?= =?utf-8?B?RkZhbENKdFExVjdzR2trNFBiMlhiSjYxcWxJUlhZclVIQ0FrL05BenFubmN0?= =?utf-8?B?ZmRLNGRKam1CZEVvL3Q5OWE3dDc0ZU94SEV0dFppcHNjZWtVN2l2VmFabjF1?= =?utf-8?Q?3Ck5nNILV2k1nFTpLDGz+mbNsX1LGU03RmBCLMI?= X-MS-Exchange-CrossTenant-Network-Message-Id: 758a120f-544f-4174-8420-08d96ef4b71d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5055.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2021 16:05:57.4011 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dxdgq/eyjtECADDUA+40U5szibLYe+RzL9n5Glfm7U35fX1KVBQIe7sn8ZmtEo6q0+EegSeEyz+PljcuyiDCrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4893 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 3/6] app/test: add basic dmadev copy tests 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" On 01/09/2021 17:32, Bruce Richardson wrote: > For each dmadev instance, perform some basic copy tests to validate that > functionality. > > Signed-off-by: Bruce Richardson > --- > app/test/test_dmadev.c | 174 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 174 insertions(+) > + > +static int > +test_enqueue_copies(int dev_id, uint16_t vchan) > +{ > + unsigned int i; > + uint16_t id; > + > + /* test doing a single copy */ > + do { > + struct rte_mbuf *src, *dst; > + char *src_data, *dst_data; > + > + src = rte_pktmbuf_alloc(pool); > + dst = rte_pktmbuf_alloc(pool); > + src_data = rte_pktmbuf_mtod(src, char *); > + dst_data = rte_pktmbuf_mtod(dst, char *); > + > + for (i = 0; i < COPY_LEN; i++) > + src_data[i] = rte_rand() & 0xFF; > + > + id = rte_dmadev_copy(dev_id, vchan, src->buf_iova + src->data_off, > + dst->buf_iova + dst->data_off, COPY_LEN, RTE_DMA_OP_FLAG_SUBMIT); Could use the rte_mbuf APIs to get the struct members here and throughout the other tests in this set. No strong opinion on this either way. > + if (id != id_count) { > + PRINT_ERR("Error with rte_dmadev_copy, got %u, expected %u\n", > + id, id_count); > + return -1; > + } > + > + /* give time for copy to finish, then check it was done */ > + await_hw(dev_id, vchan); > + > + for (i = 0; i < COPY_LEN; i++) { > + if (dst_data[i] != src_data[i]) { > + PRINT_ERR("Data mismatch at char %u [Got %02x not %02x]\n", i, > + dst_data[i], src_data[i]); > + rte_dmadev_dump(dev_id, stderr); > + return -1; > + } > + } > + > + /* now check completion works */ > + if (rte_dmadev_completed(dev_id, vchan, 1, &id, NULL) != 1) { > + PRINT_ERR("Error with rte_dmadev_completed\n"); > + return -1; > + } > + if (id != id_count) { > + PRINT_ERR("Error:incorrect job id received, %u [expected %u]\n", > + id, id_count); > + return -1; > + } > + > + rte_pktmbuf_free(src); > + rte_pktmbuf_free(dst); > + > + /* now check completion works */ This comment doesn't match with the check being done. > + if (rte_dmadev_completed(dev_id, 0, 1, NULL, NULL) != 0) { > + PRINT_ERR("Error with rte_dmadev_completed in empty check\n"); > + return -1; > + } > + id_count++; > + > + } while (0); > + Apart from minor comments above, LGTM. Reviewed-by: Kevin Laatz