From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 64A59A0096 for ; Sat, 16 Mar 2019 21:27:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DCDA11A4; Sat, 16 Mar 2019 21:27:46 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 08561201 for ; Sat, 16 Mar 2019 21:27:44 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2GKKNkU022067; Sat, 16 Mar 2019 13:27:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=e90M+ecDm37uqcnqlgVl2bc2BUSN9qHZNhntdy8tQfk=; b=qFVtxwLH99vlWjlu9Z6TjT5WPIP73TyrGvZsHTMenC8UN+VMOYHpFa+GDjHhcj2DdV8u rKiRX7OYXeWEw52dummsQYmlOhhshSjW9ctNn6gLTEyRj+Vfd4vg91P1EMs1VilGWLtO +mZqVV+xTQgiVQ6HIpSJtAXk7myxJn14pJ1UR/nj+Hiynxu+9i540BmUeSNZXZ17iaA7 iTzmrMcwYVYJ6j+6OFVFGsqrINFQq7qQOAL/+3qAzjDf7WHcH0CjAnnNJ1k/kZvxzT4Z MeR5ZjNzQ1ivWkFurF/63MLBy/I7E3yk8O+JLuJckQy+R8utgY3iow2nkT3Q6e3CH2al 5A== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2r90njgwbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 16 Mar 2019 13:27:44 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 16 Mar 2019 13:27:42 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.54) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sat, 16 Mar 2019 13:27:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e90M+ecDm37uqcnqlgVl2bc2BUSN9qHZNhntdy8tQfk=; b=e67OMK1NhQTxHDx79LqxFALVKlKYwwD/pIRnRN5bUHkIRLFLGep6fzS8nSb1Z/FoDy0VaydAXuG4CjF0xOj+JCYGuN/dj6hAR66GPdfeQl8fHcgLJUWjqLhHffrT6w3kdYx6NE1rPA8pLEPVaNW8XkIRGfphqma7zE5EWzLpxVc= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.14) by CY4PR1801MB2008.namprd18.prod.outlook.com (10.171.255.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.22; Sat, 16 Mar 2019 20:27:36 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::286d:5e93:974e:8bfa]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::286d:5e93:974e:8bfa%2]) with mapi id 15.20.1709.011; Sat, 16 Mar 2019 20:27:36 +0000 From: Pavan Nikhilesh Bhagavatula To: Jerin Jacob Kollanukkaran , "erik.g.carrillo@intel.com" CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula Thread-Topic: [dpdk-dev] [PATCH 1/2] eventdev: check timer adapter status before start Thread-Index: AQHU3DaxKTqc3GIuyUG5w6OO5kz3/w== Date: Sat, 16 Mar 2019 20:27:36 +0000 Message-ID: <20190316202709.11346-1-pbhagavatula@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0026.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::12) To CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7a::14) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [115.113.156.3] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c53964da-a412-4629-d2fa-08d6aa4dd3df x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:CY4PR1801MB2008; x-ms-traffictypediagnostic: CY4PR1801MB2008: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; CY4PR1801MB2008; 23:tjWHUUSF4094WzwewCorP5QlPy2mJbG6ss2R2?= =?iso-8859-1?Q?EkPC46VKYvTZXpVbkaeU6GkzT0uKLC3weYRJ+/UO6YdUkgDTMFQEcutttK?= =?iso-8859-1?Q?MvA0HIwwF44fkDoiPwdbD45j5sKnr5ugpiPeN8IYkMw+EMDeIQ1Ofuxmqm?= =?iso-8859-1?Q?EWxxidpMDr6hhuUFvvR9bVMpfmiuJSpkNA22tE5YzjmzWq16iZ6ofiYvLK?= =?iso-8859-1?Q?CFzADutFuLx9smlwzZRDpOj0sB9OoWiBobevXPnNilyNEoF6vpSlAN/2QR?= =?iso-8859-1?Q?1LZ6WSoq3IWuK1u2Wvkm/KzngA1kaxq42uAquCDLViY52RbSrLktFjUVpx?= =?iso-8859-1?Q?rIfn/HJcNs6Qw2JL9UlX6HR8u+U30nH45D+33aaQUii/DV8oFtadkLZeK1?= =?iso-8859-1?Q?cuWagT042Trur741LrWhaWMNVQnosY23UbUfL0SKRPgXFKJCT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D4C35 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(136003)(39830400003)(376002)(366004)(199004)(189003)(476003)(102836004)(305945005)(36756003)(4326008)(55236004)(54906003)(66066001)(6512007)(52116002)(8936002)(386003)(99286004)(256004)(26005)(110136005)(2906002)(14454004)(5660300002)(14444005)(81156014)(478600001)(81166006)(107886003)(1076003)(6486002)(25786009)(2501003)(8676002)(7736002)(6506007)(105586002)(2616005)(316002)(486006)(6116002)(97736004)(53936002)(68736007)(71200400001)(6436002)(71190400001)(3846002)(86362001)(186003)(50226002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB2008; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: If3u4rcwmr0sTVVqRhnOeqb+PS/gud6d75xLjKXj3YwpF+0iWnA7BHGPRNf5o6lxh3yRgfXUkwwVqbt9FyM50zk9gphsytVGDeqUcQPyssOBfgXd4eDlBT70mazA974vzc87LwGB7Vp7wIUvDrimr90H6NwEjWD9Hc/1e8bqdFyXkEuy7NSkpU9eDN50gLRgQX7G3lfcgNPFMko5zV2j08ZxqHxvAB0lqaRMjeV0A6j8oJMtQ06WxQd0SdGE2QI9BWZD94gwoaY4tk1x6zh5Z52oh3mMlj0HYtggU8yRIvWdVQ7+nQw/TOuHPUxlANLrjSPUbSqXjVmJbfpDSTJrnMi2M02uJ1IHgRT/DrWRRjvyPZmVAQnJE/ecJ9BjW7Rk3Ej1EXpyXtLdDrwIN6ieSyGrk09PGdXvYZnUHpG/bPQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c53964da-a412-4629-d2fa-08d6aa4dd3df X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2019 20:27:36.7391 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB2008 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-16_16:, , signatures=0 Subject: [dpdk-dev] [PATCH 1/2] eventdev: check timer adapter status before start 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" Message-ID: <20190316202736.nVsIMbDe_aTTtw_jJ7DOJXFcdmaxlCP9aaRsp9D0I6o@z> From: Pavan Nikhilesh Check if timer adapter is already started before starting it. Update the unit test accordingly. Signed-off-by: Pavan Nikhilesh --- app/test/test_event_timer_adapter.c | 4 ++-- lib/librte_eventdev/rte_event_timer_adapter.c | 6 ++++++ lib/librte_eventdev/rte_event_timer_adapter.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_time= r_adapter.c index a45b7d195..d4b78e093 100644 --- a/app/test/test_event_timer_adapter.c +++ b/app/test/test_event_timer_adapter.c @@ -1015,8 +1015,8 @@ adapter_start(void) TEST_ASSERT_SUCCESS(_timdev_setup(180 * NSECPERSEC, NSECPERSEC / 10), "Failed to start adapter"); - TEST_ASSERT_SUCCESS(rte_event_timer_adapter_start(timdev), - "Failed to repeatedly start adapter"); + TEST_ASSERT_EQUAL(rte_event_timer_adapter_start(timdev), -EALREADY, + "Timer adapter started without call to stop."); =20 return TEST_SUCCESS; } diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eve= ntdev/rte_event_timer_adapter.c index 79070d484..575da041b 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.c +++ b/lib/librte_eventdev/rte_event_timer_adapter.c @@ -261,6 +261,12 @@ rte_event_timer_adapter_start(const struct rte_event_t= imer_adapter *adapter) ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL); FUNC_PTR_OR_ERR_RET(adapter->ops->start, -EINVAL); =20 + if (adapter->data->started) { + EVTIM_LOG_ERR("event timer adapter %"PRIu8" already started", + adapter->data->id); + return -EALREADY; + } + ret =3D adapter->ops->start(adapter); if (ret < 0) return ret; diff --git a/lib/librte_eventdev/rte_event_timer_adapter.h b/lib/librte_eve= ntdev/rte_event_timer_adapter.h index db98dec46..0b10a7ab3 100644 --- a/lib/librte_eventdev/rte_event_timer_adapter.h +++ b/lib/librte_eventdev/rte_event_timer_adapter.h @@ -339,6 +339,7 @@ rte_event_timer_adapter_get_info( * - -EINVAL if adapter identifier invalid * - -ENOENT if software adapter but no service core mapped * - -ENOTSUP if software adapter and more than one service core mapped + * - -EALREADY if adapter has already been started */ int __rte_experimental rte_event_timer_adapter_start( --=20 2.21.0