From patchwork Fri Aug 9 15:24:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 143051 X-Patchwork-Delegate: david.marchand@redhat.com 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 B014A4577A; Fri, 9 Aug 2024 17:25:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3C4D4300B; Fri, 9 Aug 2024 17:25:53 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 031B34025F for ; Fri, 9 Aug 2024 17:25:52 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-70d1fb6c108so1748735b3a.3 for ; Fri, 09 Aug 2024 08:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1723217151; x=1723821951; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m1k9BA+x0j9zQdUqvXd2Lf1PWPyF+I7fseNcuSuXM8Q=; b=2uaOOiQpKGoThrlp+XVdxQ90CM7y+exGexwIa5Uz0VDxzaZ8ov6hiAFOZ+Sm3RMFFN /6CrUaEVIrAjfy1a2UzER6QydqATR1skvDJ4i1LMZqdZ5Zkw0SFsLuZpnyjp+xoftXCf mkPdbUTxO0Is66V31+iBPD7BsCwsNKhYw68lG6GAcPCuI6EmvJQjYNcgzeg7n/+4Oc31 6BNOZ0MsEyh37HWaMQbZfNy4HXNaz4E1D/Bw1K+9z63MsjAwZZ+BeUv+GKa/LkKSgB9D dphoiXVmas1EwVOLS8FiJgd8vnnVIQy5qPHPmNTL1GbMeod6iACjQuD6IZHakceE9TIF HFyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723217151; x=1723821951; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m1k9BA+x0j9zQdUqvXd2Lf1PWPyF+I7fseNcuSuXM8Q=; b=CfcpdPQC2Is4zDTWNBTfUlnNn5PnTWpojqoQ/xEJ4Q+hUVnMM+NX4FT5L/XsWpTX/T /rApkEjE0fb2baBRFu3q/u9qA8hvk0eyNPACWKKaf/2XOhopjSraB235u3HnwXHCIqub y2EaFX0fZSHDXQyAxvjga/rhRUKZBtgX1RxxlF3gObyB4O/ZC9uRX3nweotH7O8t/n3p tWFe/Jp0624BFQtYfcuPrJvUTN+KmG9fP7SVXd07RdV/giNSlSyaq6YbPcsTwdPyUHDf JWWvCzdyOto4aaCHVldREkl5Sx6BAKj67IX6Z46yKEcjbX3nnyUIDQhG46BnnZptc4qt zCPA== X-Gm-Message-State: AOJu0Yz2eZx/cPeluMoHaeZqa6oz5TtQb/jfiVL5F2ITcRX/Xge+6jbS VgvjMRzOkH+SYb1b8CQEgSNLBBqTOK1X1nOp/8w/kiGP8orxBkKOKXotSnO8YYCYdvHsq6zzDEO S X-Google-Smtp-Source: AGHT+IEQIXqys9ssehFn/bBu321Zarpfv7V6FmelbeFRZX1S5QhlCr4QAouwdYfa+BjJrGbiy9Pp2g== X-Received: by 2002:a05:6a20:9c9a:b0:1c6:9fe9:c425 with SMTP id adf61e73a8af0-1c8a00e2d3bmr2619231637.45.1723217151150; Fri, 09 Aug 2024 08:25:51 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d1c9c5e64fsm3154091a91.0.2024.08.09.08.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 08:25:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 1/3] eal: add missing parameter check to rte_eal_alarm_set on Windows Date: Fri, 9 Aug 2024 08:24:27 -0700 Message-ID: <20240809152540.9568-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240809152540.9568-1-stephen@networkplumber.org> References: <20240808194756.167664-1-stephen@networkplumber.org> <20240809152540.9568-1-stephen@networkplumber.org> MIME-Version: 1.0 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 Both Linux and FreeBSD, check parameters to rte_eal_alarm_set, but Windows missed this. And the test was "fixed" instead. This reverts commit a089d320338d708f5b7126dab5fd6861c82e6347. Windows EAL should have been fixed rather than papering over the bug. Signed-off-by: Stephen Hemminger --- app/test/test_alarm.c | 4 ---- lib/eal/windows/eal_alarm.c | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index 70e97a3109..b4034339b8 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -10,7 +10,6 @@ #include "test.h" -#ifndef RTE_EXEC_ENV_WINDOWS static volatile int flag; static void @@ -19,7 +18,6 @@ test_alarm_callback(void *cb_arg) flag = 1; printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); } -#endif static int test_alarm(void) @@ -29,7 +27,6 @@ test_alarm(void) return 0; #endif -#ifndef RTE_EXEC_ENV_WINDOWS /* check if it will fail to set alarm with wrong us value */ printf("check if it will fail to set alarm with wrong ms values\n"); if (rte_eal_alarm_set(0, test_alarm_callback, @@ -42,7 +39,6 @@ test_alarm(void) printf("should not be successful with (UINT64_MAX-1) us value\n"); return -1; } -#endif /* check if it will fail to set alarm with null callback parameter */ printf("check if it will fail to set alarm with null callback parameter\n"); diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c index 052af4b21b..09a02a1cbf 100644 --- a/lib/eal/windows/eal_alarm.c +++ b/lib/eal/windows/eal_alarm.c @@ -92,6 +92,13 @@ rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg) LARGE_INTEGER deadline; int ret; + /* Check parameters, including that us won't cause a uint64_t overflow */ + if (us < 1 || us > (UINT64_MAX - US_PER_S)) { + EAL_LOG(ERR, "Invalid alarm interval"); + ret = -EINVAL; + goto exit; + } + if (cb_fn == NULL) { EAL_LOG(ERR, "NULL callback"); ret = -EINVAL; From patchwork Fri Aug 9 15:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 143052 X-Patchwork-Delegate: david.marchand@redhat.com 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 5BB064577A; Fri, 9 Aug 2024 17:26:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3750A43245; Fri, 9 Aug 2024 17:25:55 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id D139743003 for ; Fri, 9 Aug 2024 17:25:52 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2cb4c4de4cbso1678771a91.1 for ; Fri, 09 Aug 2024 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1723217152; x=1723821952; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KI75ES28RmRSZwX5pwgOkPVl4wZrL3lPSfKfOonm2PY=; b=Gd9BEzYCRQfmUNDeaN5v3qksJhHcZ5xiZrgduDSAYR1SOYpnHmKk4rc0VWcB4M8XbL /rTZHc7liSDeGY4KMbuuhC7A4BDO/eHJqGYrZQo8fuliZUez9qjgmIu/spT2nggCX+on HKuluqJbhzTR07GCBt9QmkqMs2gnAGsAPCsTZ2bvn5PG95CVuemc80vLJPcK2HfcdJby JqM6euwYIJMA9AX9kg7qeXhfFSSD7brIi/ixolvlNRAbF2qjXMfX/expzA1o5efkVelG KY9uD7GIZsY5zptEhwE60CcEPsj5I0ouYSytWuLmsQtYahpOcrK+BhcLTpr9dGOdGncM NoMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723217152; x=1723821952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KI75ES28RmRSZwX5pwgOkPVl4wZrL3lPSfKfOonm2PY=; b=uMTi9wiVLxcRZBcTFubh4qCtOz4LFp1IfdZsrumbyU2O/cYh3+20VXNIT3MUGrT+GJ yMRcegk8eDgyCS0+t69SpKwmx8/H92ZW+rZbAqOSuqkOBVHmUb50PktsVx1AltEi0Peb pehTVH4ukYC3Mnd5HFrFyBzPhXwfbA3/SITJkVokTud3wlbkjhRYiAJM4xf5tMmMJb6x uZyFSk7Tz8vRCMD5pi1GaJb1Kkd6EPlElj8EyQmTINmECbz7WJdMprTwAW3y55rOMdye F0LYWdqxvTs1ni/QRRrKuLeWVMiGV8+ROk0yhU+TYL6trwZBHyvVUZpoavG7Wu0IveKB Mfag== X-Gm-Message-State: AOJu0YwLL8oWhLzjoBIBOsuNDvXhUCLSe/wuitSf3cA8oTIMcKsgCsN4 2z5fTb1VtskhIt17oYX5o3sQUiz4yx0xj0mtPRCxLuR9BxqzN3jJD325z+ownddo5bmmwKWbDFh t X-Google-Smtp-Source: AGHT+IEh3Djn5clvCPRarJMdl/H+RRKJfBowvDTiT6YSvCHIXzJHqwWFTPJruUtsvlA850YTFfxEFQ== X-Received: by 2002:a17:90b:4a42:b0:2c8:a8f:c97 with SMTP id 98e67ed59e1d1-2d1e8078a15mr2014496a91.37.1723217151943; Fri, 09 Aug 2024 08:25:51 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d1c9c5e64fsm3154091a91.0.2024.08.09.08.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 08:25:51 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 2/3] test: support alarm test on FreeBSD Date: Fri, 9 Aug 2024 08:24:28 -0700 Message-ID: <20240809152540.9568-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240809152540.9568-1-stephen@networkplumber.org> References: <20240808194756.167664-1-stephen@networkplumber.org> <20240809152540.9568-1-stephen@networkplumber.org> MIME-Version: 1.0 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 Yes the alarm API is supported on FreeBSD. Signed-off-by: Stephen Hemminger --- app/test/test_alarm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index b4034339b8..0cdfad1374 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -22,11 +22,6 @@ test_alarm_callback(void *cb_arg) static int test_alarm(void) { -#ifdef RTE_EXEC_ENV_FREEBSD - printf("The alarm API is not supported on FreeBSD\n"); - return 0; -#endif - /* check if it will fail to set alarm with wrong us value */ printf("check if it will fail to set alarm with wrong ms values\n"); if (rte_eal_alarm_set(0, test_alarm_callback, From patchwork Fri Aug 9 15:24:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 143053 X-Patchwork-Delegate: david.marchand@redhat.com 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 966FC4577A; Fri, 9 Aug 2024 17:26:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 368B243009; Fri, 9 Aug 2024 17:25:58 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id B2FAC43005 for ; Fri, 9 Aug 2024 17:25:53 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2cb64529a36so1736725a91.0 for ; Fri, 09 Aug 2024 08:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1723217153; x=1723821953; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AFPwhFa3YFnr9rcvKxwkq+8yJC9M+hmv5EdlXmdwNf8=; b=YmMoDjaSrLVZA9DfYOHNi7RL56D2ElrTSnrJSa/FQ+DJV1a/hzqwVWVo0Ijwp1PGQ5 fwNviER3AaHwpSsu35L52lpfxohBBPDEnYnIR+Sd5am1Xo+v7y20cRLoFBcSSa/7SU9w NTz0WgaQvGSFm/GEHpR/GgGhYdNrZzN2J3lME9hL+3mwpwWjGAUr1itkr3o47kBX9MXt j+BDN/43TBBwPf223jknuyy+CtxsgjujUfHkApDtSJRCl42cbLNAt2clhbkojNnvGZ7x EJ6atraiDnT+SknsxtLqFOov2hfaAfZI75UPHrqfWwJwTNQ2B07AtI7ozIqH7EJSRW0O f8Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723217153; x=1723821953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AFPwhFa3YFnr9rcvKxwkq+8yJC9M+hmv5EdlXmdwNf8=; b=glsF4sT08zQECRpEdILFnaodGwRcD4C87jh3Jo7Q8DdUFBiAIUq4GLNnb/quf6mLYj LbLNyti6rZciF6jbR4YqjjU4vyr+KDfzqS3oZSf26ZZUxbt3i80IwlzimuWTtpcIL0D0 g35cQ+DlTn/iIX0onl1WuKpEcdy5OYW2Ah/4Anhi8MZlIFVvLVq/O/1+a1Mvr2xfplcU XmctZye59XMhfqwskua0KyVeTL9hax9OTUBSzJkGN0VdUU3BqGvcw6l4B3yuAjdrAYbl gegQTW5NO1R7XrkkIeyaYXJNQ7bHtMwHkYUIzIhEjrl/9ieRc7fO70D0roIQOo1mN1c1 24Lg== X-Gm-Message-State: AOJu0YxZg4CRDNs2CIkko87C3W+rbmuyC+sYBxrXe/Hcm+EekZ4trKbh TNNhTk+RBzD424EcgGAKhXhWxcbEN1JytWxaIRWy8eYd0R68oq5LD8T7/ft/cRjC+pjkxLsucrf B X-Google-Smtp-Source: AGHT+IHHA+Nao+jL+xUUmnodJMv+N25afwOt0A0VKkAXhMfM2Cp/Q4k7IhQRij0b5nd1gHFFFFDdjQ== X-Received: by 2002:a17:90a:6fa4:b0:2cb:f9e:3bfb with SMTP id 98e67ed59e1d1-2d1e805124cmr1859330a91.32.1723217152710; Fri, 09 Aug 2024 08:25:52 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d1c9c5e64fsm3154091a91.0.2024.08.09.08.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 08:25:52 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 3/3] test/alarm: rewrite the alarm test Date: Fri, 9 Aug 2024 08:24:29 -0700 Message-ID: <20240809152540.9568-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240809152540.9568-1-stephen@networkplumber.org> References: <20240808194756.167664-1-stephen@networkplumber.org> <20240809152540.9568-1-stephen@networkplumber.org> MIME-Version: 1.0 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 The alarm test had several issues: - only negative tests were done, no positive test to make sure API worked - the set/cancel test had too short an interval and the alarm might expire - the test should have used the standard TEST macros. Signed-off-by: Stephen Hemminger --- app/test/test_alarm.c | 78 ++++++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 27 deletions(-) diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index 0cdfad1374..9ed8c6f72c 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -3,53 +3,77 @@ */ #include +#include #include -#include #include +#include +#include +#include +#include #include "test.h" -static volatile int flag; +#ifndef US_PER_SEC +#define US_PER_SEC 1000000u +#endif static void test_alarm_callback(void *cb_arg) { - flag = 1; - printf("Callback setting flag - OK. [cb_arg = %p]\n", cb_arg); + RTE_ATOMIC(bool) *triggered = cb_arg; + + rte_atomic_store_explicit(triggered, 1, rte_memory_order_release); } + static int test_alarm(void) { - /* check if it will fail to set alarm with wrong us value */ - printf("check if it will fail to set alarm with wrong ms values\n"); - if (rte_eal_alarm_set(0, test_alarm_callback, - NULL) >= 0) { - printf("should not be successful with 0 us value\n"); - return -1; - } - if (rte_eal_alarm_set(UINT64_MAX - 1, test_alarm_callback, - NULL) >= 0) { - printf("should not be successful with (UINT64_MAX-1) us value\n"); - return -1; - } + RTE_ATOMIC(bool) triggered = false; + RTE_ATOMIC(bool) later = false; + int ret; + + /* check if it will fail to set alarm with wrong us values */ + TEST_ASSERT_FAIL(rte_eal_alarm_set(0, test_alarm_callback, NULL), + "Expected rte_eal_alarm_set to fail with 0 us value"); + + /* check it if will fail with a very large timeout value */ + TEST_ASSERT_FAIL(rte_eal_alarm_set(UINT64_MAX - 1, test_alarm_callback, NULL), + "Expected rte_eal_alarm_set to fail with (UINT64_MAX-1) us value"); /* check if it will fail to set alarm with null callback parameter */ - printf("check if it will fail to set alarm with null callback parameter\n"); - if (rte_eal_alarm_set(10 /* ms */, NULL, NULL) >= 0) { - printf("should not be successful to set alarm with null callback parameter\n"); - return -1; - } + TEST_ASSERT_FAIL(rte_eal_alarm_set(US_PER_SEC, NULL, NULL), + "Expected rte_eal_alarm_set to fail with null callback parameter"); /* check if it will fail to remove alarm with null callback parameter */ - printf("check if it will fail to remove alarm with null callback parameter\n"); - if (rte_eal_alarm_cancel(NULL, NULL) == 0) { - printf("should not be successful to remove alarm with null callback parameter"); - return -1; - } + TEST_ASSERT_FAIL(rte_eal_alarm_cancel(NULL, NULL), + "Expected rte_eal_alarm_cancel to fail with null callback parameter"); + + /* check if can set a alarm for one second */ + TEST_ASSERT_SUCCESS(rte_eal_alarm_set(US_PER_SEC, test_alarm_callback, &triggered), + "Setting one second alarm failed"); + + /* set a longer alarm that will be canceled. */ + TEST_ASSERT_SUCCESS(rte_eal_alarm_set(10 * US_PER_SEC, test_alarm_callback, &later), + "Setting ten second alarm failed"); + + /* wait for alarm to happen */ + while (rte_atomic_load_explicit(&triggered, rte_memory_order_acquire) == false) + rte_delay_us_sleep(US_PER_SEC / 10); + + TEST_ASSERT(!rte_atomic_load_explicit(&later, rte_memory_order_acquire), + "Only one alarm should have fired."); + + ret = rte_eal_alarm_cancel(test_alarm_callback, &triggered); + TEST_ASSERT(ret == 0 && rte_errno == ENOENT, + "Canceling alarm after run ret %d: %s", ret, rte_strerror(rte_errno)); + + ret = rte_eal_alarm_cancel(test_alarm_callback, &later); + TEST_ASSERT(ret == 1, "Canceling ten second alarm failed %d: %s", + ret, rte_strerror(rte_errno)); return 0; } -REGISTER_TEST_COMMAND(alarm_autotest, test_alarm); +REGISTER_FAST_TEST(alarm_autotest, true, true, test_alarm);