From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2DADA00BE; Tue, 7 Jul 2020 21:47:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 492461DE59; Tue, 7 Jul 2020 21:47:49 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90054.outbound.protection.outlook.com [40.107.9.54]) by dpdk.org (Postfix) with ESMTP id 584CA1DE52 for ; Tue, 7 Jul 2020 21:47:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PUQ9gHvhpWCu3RiXZPWU8vsG6d6ASYmx9JmqRK17Uac=; b=UAgmixwJweL55MJO0kYTEdrBrM+vNPEPXlpzj7Tslka+DvzdDA+lJ1qucbRVbg1cSq3l/RqqCFs27OSvnSpP/7OSIJtr0qyBwuy/J+Ctkrf0RcRwEn6o3Ul24u/q4LPwFoxVUxRuo7NBUZ5+FWUQ2aPVHYMHHtCCrffJYviPE/c= Received: from AM4PR07CA0036.eurprd07.prod.outlook.com (2603:10a6:205:1::49) by PR2PR08MB4857.eurprd08.prod.outlook.com (2603:10a6:101:1c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.27; Tue, 7 Jul 2020 19:47:46 +0000 Received: from AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:205:1:cafe::38) by AM4PR07CA0036.outlook.office365.com (2603:10a6:205:1::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.14 via Frontend Transport; Tue, 7 Jul 2020 19:47:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT024.mail.protection.outlook.com (10.152.16.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Tue, 7 Jul 2020 19:47:46 +0000 Received: ("Tessian outbound 4e683f4039d5:v62"); Tue, 07 Jul 2020 19:47:46 +0000 X-CR-MTA-TID: 64aa7808 Received: from 9a3412427ab7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 112A55CD-CF9D-4264-963E-A1BE64EEE905.1; Tue, 07 Jul 2020 19:47:41 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9a3412427ab7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Jul 2020 19:47:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mMnhDCOeJ9zeedYUg6A5TqRV5eRCVjlmJLTlkXStXy3oRHil1myfPPwuVYN3Kg8Wh04P+tujgIv5H4pVxPHKThv20fENxE5yNCpkOQDJteYmcI4vb0PhjJsQqkWwKZV14ZLEUCkdGfAmSogQJMpVsxZdfobzZG2O8YY9sbbVC1GvJpFzniwHRCp2b6G3x+7+dy40n2PcC8eqtZfDyYiAlkFWbGPB/5SncGPcVVmcY2MWSLEjmcVXTvdeRRh3iZFr9swYVXuyH3AW6rCxBJQGCYgpsSD44H46t6KXBM/uKrJlJ2nuv5cm42WZkuhHF91UN+F/G8X+woKzdLM1B/lfPQ== 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-SenderADCheck; bh=PUQ9gHvhpWCu3RiXZPWU8vsG6d6ASYmx9JmqRK17Uac=; b=aalZfFTtjkxBaSWE0TIIFxB4zGaT5jZORTVtBq+/R+F8nGlFd4yzWly/q3xP7/PzKmKvHks8dAt8otWw5GY1BXCRYX/TSg+19uGYDbGesfZVbSLd0dxBfXHEYPp2Kja8ZalLeTpCiOV5/SRL3lWOJ58978cH7uVdlIDJAX4wymutR8RDwc5px4p3oOGW8o7bTGB8iKhKOBvE9pzp5s1ObuQgqxZcKa2oBmhT7hMOT9ZY1D8yhhCnn1umr9xSmqdUpyhmCE+/bJ5KyZaDYuKZoTevMHhh7IMBqMMgZKS6RoZx2yHsgEPCUBuOjHs3r6fAM1H1eP+/pD8l9l7TBP1kcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PUQ9gHvhpWCu3RiXZPWU8vsG6d6ASYmx9JmqRK17Uac=; b=UAgmixwJweL55MJO0kYTEdrBrM+vNPEPXlpzj7Tslka+DvzdDA+lJ1qucbRVbg1cSq3l/RqqCFs27OSvnSpP/7OSIJtr0qyBwuy/J+Ctkrf0RcRwEn6o3Ul24u/q4LPwFoxVUxRuo7NBUZ5+FWUQ2aPVHYMHHtCCrffJYviPE/c= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB8PR08MB5020.eurprd08.prod.outlook.com (2603:10a6:10:e3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Tue, 7 Jul 2020 19:47:40 +0000 Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d]) by DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d%10]) with mapi id 15.20.3153.029; Tue, 7 Jul 2020 19:47:40 +0000 From: Honnappa Nagarahalli To: Andrew Rybchenko , "dev@dpdk.org" CC: Igor Romanov , Harry van Haaren , Honnappa Nagarahalli , nd , nd Thread-Topic: [dpdk-dev] [PATCH v3 2/2] test/service: add test for service active on two lcores Thread-Index: AQHWVEvKveB01c6ZJEaiZ4qgJBSFwKj8hiZA Date: Tue, 7 Jul 2020 19:47:39 +0000 Message-ID: References: <1593873347-13686-1-git-send-email-arybchenko@solarflare.com> <1594118726-8421-1-git-send-email-arybchenko@solarflare.com> <1594118726-8421-2-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1594118726-8421-2-git-send-email-arybchenko@solarflare.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: d55b927b-4550-4458-8401-9cadd3632849.0 x-checkrecipientchecked: true Authentication-Results-Original: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.112.90.121] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8d3e9c52-5a6b-4505-7f5c-08d822ae9f45 x-ms-traffictypediagnostic: DB8PR08MB5020:|PR2PR08MB4857: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:4303;OLM:4303; x-forefront-prvs: 0457F11EAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IwE0p+aNyBrjn8+kJ18C0fEw2KyYumurd358EaUOhDbLjOL7BGuPzSkK1mSf3QRB+CDYcORskBkCUSR45tdp4Ya6cizKuNhi97ci1Pi48q68Ln0abHyl43pJ7gggGGe1vyZZoV4iJ0Fr3Z9J7rmUvO/AYXbCJJ2jSQ0IEE+NMaKWNcL5W2ohBqPiYro4RvhXStT2eOMaW05Qs7G/UeRMjucT1y6ab8oYdoyz0+d4PZrHNSLpMYgc/NAHJfgtpn3Qpi0zIkNxocvz8roXYjDUzOPJLyMQ9rPgV3ZZD+j4QsO6vN/jJgUtQBNPRvB1uLEMTiFriK1pk4ksdEX73rbjkQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2216.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(346002)(366004)(396003)(136003)(52536014)(478600001)(8936002)(110136005)(55016002)(86362001)(54906003)(71200400001)(9686003)(316002)(66446008)(2906002)(66556008)(66946007)(64756008)(76116006)(4326008)(6506007)(53546011)(66476007)(83380400001)(5660300002)(186003)(26005)(33656002)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: QS8/MlGwg7UQXqS1eFh4hsOelAAU4vp+dNKMHbucvZgx0djcDKgF5ziPlNjbXh1m3Swh2V9sxmc8EJLXFqz08sIdVn3zH+gip/JbZDirbkyiKMNA8KHUULjl1d21rX6tDb4pjDDxhwApOiqbfmF/364mgsb0VpxUtn0QEp0B1FrZkDjjbkRqtPVamvrY6VSypVQlT3RZKDdtGhqBJ3/Jeka6tevUtMSDymKykBphWbOw+obmh9Zj6EOqUQlABcYMIbaS9EGYmb+kRHoVVhPtlp4iyin73QY39zNOGuMLxFQhPuttQZd6sSWlNdvXeUDs0jm/K2j6OLXo1wTKs1r18kMa/qi4S/R54uzNduP/4Z+ZnbgIoxRR1wm9VQKKLaZpFXMGHUKB4hYqOL/Q20q2rijoWe/Jpq0aU69EZ2auhi9R9WPqehgRwjPKzwuS3XemiVwacJpp6vmO2rAKi+vfiIP+OhYq8jLZCjd0F9vYHRFX/zwDVftVu45zeQlJ0mZK Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5020 Original-Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none; solarflare.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(46966005)(70586007)(55016002)(82740400003)(33656002)(2906002)(36906005)(8936002)(9686003)(478600001)(47076004)(82310400002)(7696005)(186003)(83380400001)(5660300002)(356005)(81166007)(6506007)(4326008)(316002)(26005)(110136005)(70206006)(54906003)(52536014)(53546011)(86362001)(336012); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: f977018f-a854-41ea-dd42-08d822ae9b72 X-Forefront-PRVS: 0457F11EAF X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pkT/g/u5weyG0Vtei/ZqbzfwWHilzcTVFYKCbghiYg7QBzwWQ6A1OQ8JmjSpnakTIpMKWGOGn6N4izcg9R3uPm+loqCZHo9tS4hh6crA7WaFDKhTgEHAKNt88aNiN0FMOxFXrpjsf7+R+uTfBRapvAoMdYIOwYSamKuZMdFt73XdDkXU+lH28InZq9iT99y8+1e/Us809BGoE8F5WxLNGwaOPM8j3T+GVASmubUQ1gWp8a8gJzbziMZGcUyWskdcT4O0rIzZozt6cLrrkC3Ok3gbryH/95PMOgg2A+FbWylxpA0LO6H323SO3cCm6+6PPyUyRXlguyqMb06erE/IDbC0GzlBzUahQarQ6HA41ssv+lU8V0npij8Eg0sHBj1U/quftHh0lUKOOJ7Ri6NYfA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2020 19:47:46.4001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d3e9c52-5a6b-4505-7f5c-08d822ae9f45 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4857 Subject: Re: [dpdk-dev] [PATCH v3 2/2] test/service: add test for service active on two lcores 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" > -----Original Message----- > From: dev On Behalf Of Andrew Rybchenko > Sent: Tuesday, July 7, 2020 5:45 AM > To: dev@dpdk.org > Cc: Igor Romanov ; Harry van Haaren > > Subject: [dpdk-dev] [PATCH v3 2/2] test/service: add test for service act= ive on > two lcores >=20 > From: Igor Romanov >=20 > The test checks that the service may be active API works when there are t= wo > cores: a non-service lcore and a service one. >=20 > The API notes to take care when checking the status of a running service,= but > the test setup allows for a safe usage in that case. >=20 > Signed-off-by: Igor Romanov > Signed-off-by: Andrew Rybchenko Reviewed-by: Honnappa Nagarahalli > --- > v3: > - skip the test if number of cores is insufficient >=20 > app/test/test_service_cores.c | 54 +++++++++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) >=20 > diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.= c index > 981e212130..4f003ed1af 100644 > --- a/app/test/test_service_cores.c > +++ b/app/test/test_service_cores.c > @@ -910,6 +910,59 @@ service_may_be_active(void) > return unregister_all(); > } >=20 > +/* check service may be active when service is running on a second > +lcore */ static int > +service_active_two_cores(void) > +{ > + if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1) || > + !rte_lcore_is_enabled(2)) > + return TEST_SKIPPED; > + > + const uint32_t sid =3D 0; > + int i; > + > + uint32_t lcore =3D rte_get_next_lcore(/* start core */ -1, > + /* skip master */ 1, > + /* wrap */ 0); > + uint32_t slcore =3D rte_get_next_lcore(/* start core */ lcore, > + /* skip master */ 1, > + /* wrap */ 0); > + > + /* start the service on the second available lcore */ > + TEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 1), > + "Starting valid service failed"); > + TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore), > + "Add service core failed when not in use before"); > + TEST_ASSERT_EQUAL(0, rte_service_map_lcore_set(sid, slcore, 1), > + "Enabling valid service on valid core failed"); > + TEST_ASSERT_EQUAL(0, rte_service_lcore_start(slcore), > + "Service core start after add failed"); > + > + /* ensures core really is running the service function */ > + TEST_ASSERT_EQUAL(1, service_lcore_running_check(), > + "Service core expected to poll service but it didn't"); > + > + /* ensures that service may be active reports running state */ > + TEST_ASSERT_EQUAL(1, rte_service_may_be_active(sid), > + "Service may be active did not report running state"); > + > + /* stop the service */ > + TEST_ASSERT_EQUAL(0, rte_service_runstate_set(sid, 0), > + "Error: Service stop returned non-zero"); > + > + /* give the service 100ms to stop running */ > + for (i =3D 0; i < 100; i++) { > + if (!rte_service_may_be_active(sid)) > + break; > + rte_delay_ms(SERVICE_DELAY); > + } > + > + TEST_ASSERT_EQUAL(0, rte_service_may_be_active(sid), > + "Error: Service not stopped after 100ms"); > + > + return unregister_all(); > +} > + > static struct unit_test_suite service_tests =3D { > .suite_name =3D "service core test suite", > .setup =3D testsuite_setup, > @@ -931,6 +984,7 @@ static struct unit_test_suite service_tests =3D { > TEST_CASE_ST(dummy_register, NULL, > service_app_lcore_mt_safe), > TEST_CASE_ST(dummy_register, NULL, > service_app_lcore_mt_unsafe), > TEST_CASE_ST(dummy_register, NULL, service_may_be_active), > + TEST_CASE_ST(dummy_register, NULL, > service_active_two_cores), > TEST_CASES_END() /**< NULL terminate unit test array */ > } > }; > -- > 2.17.1