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 3814441CA5; Wed, 15 Feb 2023 12:57:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23A2C43008; Wed, 15 Feb 2023 12:57:49 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id ACFC5410DD for ; Wed, 15 Feb 2023 12:57:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676462266; x=1707998266; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=6ag7WfATzQ8z4EwXyHUSp31h1izDuCZEYYLbwvO3+fY=; b=IJBDICvJF0raMgbmCVHPjM1KIWciGS6IYI+meVr+A+nHm27l4yvKgm0G q0a6m/0I82Q8myziZoDyvdmsaorzqOqz3PIa94/MMhK73Q7JmmjfZQWJQ wH+FjMkOA/iD0IdF2E2ksh7Bw20Luxgf7DrsvvZaCP+/vRkhvgsYgM61t 7fZmudJ/MFLpOZzqz4mblNpkFME6RAYWnviHebzEG8hlQ9Ic9d3vB1bRQ ewsvsYvgP0vM964xj7hxahvHcFdWTeXVOP764qtCLRYuSUnJCC9z+QsZ6 3ao6za2j1X5Ayph9i/jMumwmpZSoE2fEZpnNyWUiMKGf/h+RwYDlplKzh A==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="331409065" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="331409065" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 03:57:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="843553746" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="843553746" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 15 Feb 2023 03:57:45 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 15 Feb 2023 03:57:44 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 15 Feb 2023 03:57:44 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 15 Feb 2023 03:57:44 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 15 Feb 2023 03:57:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1ahHRLAhAUdvZrPw5hHo2xyegjSweFC0QnIDAB118rnTpLm/XHuVC3WO680lebGJeILMBcKh6GCQUmL4wOnvZqS2CTXCu6zjySLfBDhDB8ekzai9kTHbbGJgNJPgLKaY3bPakM8roWzqqiaVY3C5u1q+IG0vSR6GfClgzCl62hTheHuPb+MjzRPbZo9b4aw96MUHnQVT2fFgyG3u7xmOih4XPFnvalOUsgaKEaSuwoBkSZo1GFUk8t8tOaqWuTJoS89UlKbeQNNaxmTPv2moLgGrLwlAt19Inm73Q/uLZ/p7NxvjfIBXiSDNKVUYrQgDChcgeHqgHx4n4tdwB9xUQ== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Bzuj4mKwR46gs4Lpk68RYtG0XPRLIvhA694UWhPjgmM=; b=FvWnnCOdH4VOPW4ITn7Yz7OjY2oMY55780WsJAYSZftaJVryu9bbbWM9geYHd0cuw7FT/OuhPzcR1cpO+V/VUOGjwxeQAzX98CDONvhgODg/4uS1tYoch+9ZHayonTHZ3Ia3H1qTiUV+jguICPDvCWnUHPvY6Hz+7lu/7SPjT6W6kRDa7XngzQ7K3hLabsBrR1FFkb8byt+VSBdSg2Q9D9OLK6pOJtR6hz0kB4dGzrDb/xRMaarRohdK1P9AEc0WRVjOUPzDehoxmcZ7xDrL/JKqjY0u5lk2U2zZtnw6vDggHOo5TsMJi8Oz6rTjzP63OUI0xDykWRHRuEEf+7NNZQ== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CY8PR11MB7396.namprd11.prod.outlook.com (2603:10b6:930:87::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Wed, 15 Feb 2023 11:57:35 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def%8]) with mapi id 15.20.6086.024; Wed, 15 Feb 2023 11:57:34 +0000 Date: Wed, 15 Feb 2023 11:57:28 +0000 From: Bruce Richardson To: fengchengwen CC: , Kevin Laatz Subject: Re: [PATCH v2 6/6] test/dmadev: add tests for stopping and restarting dev Message-ID: References: <20230116153714.554470-1-bruce.richardson@intel.com> <20230116173738.562322-1-bruce.richardson@intel.com> <20230116173738.562322-7-bruce.richardson@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0473.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::29) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY8PR11MB7396:EE_ X-MS-Office365-Filtering-Correlation-Id: a96bf3d3-8d42-46bf-8543-08db0f4bd314 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JyF9zyRsEU+jyAZJesMMcs5nfY2q8MGJCSXrj3AVAqzPHY3ikE55BSrl3LWzOqFeN7JOSDfRxXyiDchBVj+8hl1W0CVRRG0qIek1JpZk9aQBVmjuAs/ZajOQnTgvnpGmT70NWcFOhA8dEVCDwdBhSnD/b3Hw9u0OD+Z2fkr/7y7PyoZW94cgqijPRvysM3VO9YPefv2e7+KHGHps+9b7BbkMC69PlT63sMzY26W6F3Tcwx9T9V9aMZhmnnhmPWp/FawHDrDP2zSzPl4206TtVOc3c9k1AzzqmdLjg2FzAWeqLgMp9cAa51qTkKt/xGnWvL3riswITKP6njV78UL0TQYvJBamDW/74BPJwmjVXHfG7cgDb2OLuLCmHqbmJGpa9yOJIWoF35rhALm9hGGB9rfGF7g+In8fyHf/mhkqx34rVXS6PW3Uxbzg4k9yWwG/XNUvUxegu8gdLbe9HogFsMHuIH1K3IiZH4Oq5HzJeOzoGTY7QoBm/4y5Z6kOeo/1+oNak8S+0lhJuucTr97NKLZPOsXWtdMbzoB+st5K5d/JL4UkfQDtnjtHuZsfSoBrl2OsVRIGoBmKo/q3xW9y/VB/jiWfuGSPuLlXmk3/iCpKhV7HzeCliG8R8V0OFd7L5CX0rt8DIeRTGZEEazTkgXonUdmTyRjAEdrrqArXTJq6KcTT2g/plEUwLSv3tXNQ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199018)(66476007)(66946007)(2906002)(86362001)(66556008)(53546011)(6506007)(5660300002)(8676002)(8936002)(6512007)(478600001)(44832011)(82960400001)(107886003)(6916009)(4326008)(41300700001)(6486002)(316002)(6666004)(26005)(38100700002)(186003)(83380400001)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YuqxeOMAWOPbJdL8oU/JXZRv/UwVP/EyfrNa10lAACEdbTut/++PnoQVCxdT?= =?us-ascii?Q?spUtI+DZZ2HLg/p1nybWO9QdRn4MbGsVh7mXM3iiy2fn4EJWceXSIKVeoYfU?= =?us-ascii?Q?E9jTCk+bWwxWwzEJkcRAejUEcSDo5ed+q2+kPFIrZNMzCBYbgcI9JLzyOnh4?= =?us-ascii?Q?GP7VAh1Bj1hyEHapyXNisgdcEu91chqYZXXXw2W5WVRsR88TJ5HW43cJFl/u?= =?us-ascii?Q?G/tp1qryOHKaaQnMEwte69G20xQsetejVwpw4oAIIcgUhQ5XSYmYS446Rd2R?= =?us-ascii?Q?9u8d6jVxXsA2nH3AfbSbinll72kgIIGSozhBPNQPyPHxzb3PBbN4XJG0ZMC8?= =?us-ascii?Q?xJmBBSMWRvWMwVhENddE7vuqWikqNuT51wtqx1vpl4bTsZGyEdzmO+avx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Hr/qOWoDzw5vgxpzlhFOrd0tSwOSj2LEknspAJPkXU?= =?us-ascii?Q?lVC7TbVimGVvvNFjivBmbaLzxe1eigARFGN53XYbFti2PjrOIVXigp6sQVhO?= =?us-ascii?Q?+TvXzEeYSUMIU7SPjvJZeqYXOIN+mqnb1lTKVo8NmqDlvSJRoBnPSaiAk0W4?= =?us-ascii?Q?HiHFu2/SrkGzfdANRnrL+11GiJbNACBWetiCiDold//VDIOzVRmvs19WH5s0?= =?us-ascii?Q?abdtTYyf3LkgVvdjOgLm5X/cxbw2h3xQNCY3OiiIDR61ZH34bBi26a0Ph+i5?= =?us-ascii?Q?TJGmR6SrYu4+JnuF27NkB2HduxYHI3xKxS3p+XQLLMMksJG4Xd1/pTUODB/O?= =?us-ascii?Q?Gw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a96bf3d3-8d42-46bf-8543-08db0f4bd314 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 11:57:34.4152 (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: /5cseKKBNufY1JTPEH2fWiG7CMN0izU9RKUocLXocWS00UKL5H36V+AoG7QgXj5LGDJldRZ0J9NrHJkq4niBM02ibAY12Os70JfoQmDEdlU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7396 X-OriginatorOrg: intel.com 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 On Wed, Feb 15, 2023 at 09:59:06AM +0800, fengchengwen wrote: > On 2023/1/17 1:37, Bruce Richardson wrote: > > Validate device operation when a device is stopped or restarted. > > > > The only complication - and gap in the dmadev ABI specification - is > > what happens to the job ids on restart. Some drivers reset them to 0, > > while others continue where things left off. Take account of both > > possibilities in the test case. > > > > Signed-off-by: Bruce Richardson --- > > app/test/test_dmadev.c | 46 ++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 46 insertions(+) > > > > diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c index > > de787c14e2..8fb73a41e2 100644 --- a/app/test/test_dmadev.c +++ > > b/app/test/test_dmadev.c @@ -304,6 +304,48 @@ > > test_enqueue_copies(int16_t dev_id, uint16_t vchan) || > > do_multi_copies(dev_id, vchan, 0, 0, 1); } > > > > +static int +test_stop_start(int16_t dev_id, uint16_t vchan) +{ + /* > > device is already started on input, should be (re)started on output */ > > + + uint16_t id = 0; + enum rte_dma_status_code status = > > RTE_DMA_STATUS_SUCCESSFUL; + + /* - test stopping a device works > > ok, + * - then do a start-stop without doing a copy + * > > - finally restart the device + * checking for errors at each > > stage, and validating we can still copy at the end. + */ + if > > (rte_dma_stop(dev_id) < 0) + ERR_RETURN("Error stopping > > device\n"); + + if (rte_dma_start(dev_id) < 0) + > > ERR_RETURN("Error restarting device\n"); + if (rte_dma_stop(dev_id) < > > 0) + ERR_RETURN("Error stopping device after restart (no > > jobs executed)\n"); + + if (rte_dma_start(dev_id) < 0) + > > ERR_RETURN("Error restarting device after multiple stop-starts\n"); + + > > /* before doing a copy, we need to know what the next id will be it > > should + * either be: + * - the last completed job before start if > > driver does not reset id on stop + * - or -1 i.e. next job is 0, if > > driver does reset the job ids on stop + */ + if > > (rte_dma_completed_status(dev_id, vchan, 1, &id, &status) != 0) + > > ERR_RETURN("Error with rte_dma_completed_status when no job done\n"); + > > id += 1; /* id_count is next job id */ + if (id != id_count && id != > > 0) + ERR_RETURN("Unexpected next id from device after > > stop-start. Got %u, expected %u or 0\n", + id, > > id_count); > > Hi Bruce, > > Suggest add a warn LOG to identify the id was not reset zero. So that > new driver could detect break ABI specification. > Not sure that that is necessary. The actual ABI, nor the doxygen docs, doesn't specify what happens to the values on doing stop and then start. My thinking was that it should continue numbering as it would be equivalent to suspend and resume, but other drivers appear to treat it as a "reset". I suspect there are advantages and disadvantages to both schemes. Until we decide on what the correct behaviour should be - or decide to allow both - I don't think warning is the right thing to do here. /Bruce