From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C094606A322 for ; Sat, 5 Dec 2026 06:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Rqz5RmzY Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD9F742DD4; Sat, 5 Dec 2026 07:26:49 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTPS id C119D42D80 for ; Sat, 5 Dec 2026 07:26:43 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-cd69954c755so1592768a12.3 for ; Fri, 04 Dec 2026 22:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796452002; x=1797056802; 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:content-type; bh=guZ8S4azmX4NrZUpbSMHrMvCp0ZPWqAiivaQCxy68pQ=; b=Rqz5RmzYL0GLBDzroGBuxr5EAgo/XqzmjE8Nqv7tV6F1NAsVpSZv5EIvZBlZfkSc// 3HbLB5rDG7+CdDr7I6J6QDdp+Sduv5AXZe9lMB9M2X/9KY8Ic2yCrF1yQRAnXuj9/1Xf 0p5BzzZbrflHCvuUn4WVnpZ1O5IS71SKxgAu3emf7b0ygMrL85yJhdoM5rYzKrLBD7zd s2aeUAMONBk4ZAAZnYme3EHmi7vIhrlt1ldMriKnB9boS80zaAfo9fRdxPgTGNVGN/zT cD5MxSXYDHoupfnGvwqrClL9HpqWY46fqahUrxvatCCyE3ZKqb7FuZEAqmzYwijXM7Y1 ylnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796452002; x=1797056802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=guZ8S4azmX4NrZUpbSMHrMvCp0ZPWqAiivaQCxy68pQ=; b=IP5alppY1Yxgmq2Pm0LRNWnI8LSDwOB7il0ZGD1p0eOyQ7MW2Br+C/y3vXec83cdxo VYWjfX/WjzObpdp9C38eF+V/+7hAwquwLQ08TZAyRjl/mI1guephq3dcVaq554OSeaem 68xL2VW2+wWZpsDcGsc9+rGvxTOa2Iyxd670998iaRzJDhrMV890D3u5oKzdNRWERx6j JgD1UpGpFcO8NVkiQZd7TKuTbUxY/A/yBQc0i6RzGvGWvmxWW5SVLfZK+VePG2dbXn/j 9MXgYUrQIr0Kg4uqJjh03Yt2ZO9TxxGjrlcg3+VO8W86hWVAaSKYrm96tZHS3ez1Pd/j NCnA== X-Gm-Message-State: AB4q+uGLnqN3fyp3oiv7rtIUgwSxCDMDo7FqjqAIpOvpL/mSXfwHvfKV dqQmFmJmuXeSQ3c3X7/wUDbJxhULQ8vJ2n2rX9XXQ8dsGrnP/wKStKPr9zNiKTJEADtxD/KXHoq p2u7/ZF4= X-Gm-Gg: AZFdTZd0wnUWiqYsiWAfEz6NxUT49OfbaF1Wb2qhzw+E4irNEOEyOPwxV+ymKINqOdi SOd9se07a0oOehXwk+YLvQB2+WGyBpPEQBC/rUz9BimpBbf7xa+9htuCJ8URcHrb0OSgBdcvmkw upGT97bxv/56ZxZykDhJO9DYvkM0wmieY+QDh3hXEz8F14kWY/nH756c3jLWG15btG7v9BZDa2o 4w1Xxebqisuj1JPj1YhzsdFoUdgbwXnRtPsQflY6Xs0+utSekEFLeTAkQwPSojOo/mQDzAIIRSx SvBfCBjAdcW+h8B4zTXIniUpTNDtr4t1b3uHi8wBx4usCd6QaOe01PahamD9NHclenakhlmmc0M bIytvz1omxp2NWWnZr5DKE2ix1Fv3AdhNTexPjrFhRvk+wkDUb/2uTocN4zYi2rTsjtcp5YjXxu 9z/rdg9NZ/5w7+KQ5tJjiu9q9kh4v4i19nhTBCpc2mXedQwnWXeJq42qNhsIY7TKU3A4OfEpqan JF4m9APIv4pLZz0whhQfOZc0DnGI676CURNjJoe4geqZW8UNxq2uI628/DQ+3jyaKt+OfKc1HwI CLbNePt4Cu42yG/lTEKUgsWSgfDkSyiSipZeRQYig/tay10k1KXeNs6YAaxpB/+FyoKs X-Received: by 2002:a17:90a:d884:b0:3b3:b632:7f1b with SMTP id 98e67ed59e1d1-3b5e0653c7amr4097717a91.12.1796452002299; Fri, 04 Dec 2026 22:26:42 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b6168d3e2fsm1162797a91.2.2026.12.04.22.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 22:26:42 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jerin Jacob Subject: [PATCH v4 59/68] event/octeontx: use kvargs numeric helpers Date: Fri, 4 Dec 2026 22:20:36 -0800 Message-ID: <20261205062551.19553-60-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261205062551.19553-1-stephen@networkplumber.org> References: <20260914054912.755403-1-stephen@networkplumber.org> <20261205062551.19553-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 ssovf_parsekv() open coded the errno, end pointer and range checks, and the value it parsed was only ever used as a boolean. Use rte_kvargs_handle_bool() and make the flag a bool to match. The documented "=1" form still works, and the usual spellings such as "on" and "true" are now accepted as well. The boolean uses rte_kvargs_process_opt(), so that a bare key with no value enables the option. Signed-off-by: Stephen Hemminger --- drivers/event/octeontx/ssovf_evdev.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 957fcab04e..4a56d91bf2 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -3,6 +3,7 @@ */ #include +#include #include #include @@ -23,7 +24,7 @@ #include "timvf_evdev.h" #include "otx_cryptodev_hw_access.h" -static uint8_t timvf_enable_stats; +static bool timvf_enable_stats; RTE_LOG_REGISTER_DEFAULT(otx_logtype_ssovf, NOTICE); @@ -716,24 +717,6 @@ ssovf_close(struct rte_eventdev *dev) return 0; } -static int -ssovf_parsekv(const char *key, const char *value, void *opaque) -{ - uint8_t *flag = opaque; - uint64_t v; - char *end; - - errno = 0; - v = strtoul(value, &end, 0); - if ((errno != 0) || (value == end) || *end != '\0' || v > 1) { - ssovf_log_err("invalid %s value %s", key, value); - return -EINVAL; - } - - *flag = !!v; - return 0; -} - static int ssovf_timvf_caps_get(const struct rte_eventdev *dev, uint64_t flags, uint32_t *caps, const struct event_timer_adapter_ops **ops) @@ -879,8 +862,8 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev) "Ignoring unsupported params supplied '%s'", name); } else { - ret = rte_kvargs_process(kvlist, TIMVF_ENABLE_STATS_ARG, - ssovf_parsekv, + ret = rte_kvargs_process_opt(kvlist, TIMVF_ENABLE_STATS_ARG, + rte_kvargs_handle_bool, &timvf_enable_stats); if (ret != 0) { ssovf_log_err("%s: Error in timvf stats", name); -- 2.53.0