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 B5831606A31A for ; Mon, 30 Nov 2026 21:56:25 +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=cP0qcOJM Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5706F40E4D; Mon, 30 Nov 2026 22:52:50 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTPS id 1A81D40B9B for ; Mon, 30 Nov 2026 22:52:31 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-8b68e59ab33so8049284b3a.2 for ; Mon, 30 Nov 2026 13:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796075549; x=1796680349; 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=Ava+aO1T0Uf0vC87Di8UIUEs78giPModfduF4DoRXho=; b=cP0qcOJMnCUlEFobPtxF9wSbjSlab29zIcsM7aRexlWqxtwDcijGV3wd6BlHdb5iDN c/ZCfUd4/Vxzi3V37Kb/guEUFZlGhuSdnWhLV6BF8a98BtTSCzwfDIwlSxRfb7f0ymuY gol7n3/5eKiq1wSEN0zR/yDQgcSqKfDGqMwEgMnIgyZjdHPlpo5RNHzIRykiK9AxXkkM BoAE21x36wcjqH/Y/0laVQcQO060e3B6hvRAyZnO2EeHjIpMA0s817j8oDdwyCSBOzzx BGaq2V+78IkOI920dJbpANDEsJOFqQb5VG9tgJ9FwfAmjKRqLfeNN3gvEGdR/WUG/e7B 7vYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796075549; x=1796680349; 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=Ava+aO1T0Uf0vC87Di8UIUEs78giPModfduF4DoRXho=; b=OXv/IKTReBRt11o4T7rC/S/m7sGZPO2N1pfyLp1zuf2C9nSYyJsL4ZUQQLvvrgnhCg fr2ox+DkWC6E2wzrebcf60mIqvrqX/ZWp/CCMG1VYkIxvPp8/aadVozPMABZ4jPKG6dF mL4maTaVkKEH1NhBQtuhyLoxSM8v1zCOpvGH9fX1jRVym8qvIYrYxoAYEqpM6vangX10 /15/G+/EB1TKDB+v7VVtTzUOycUA5M6sRRIa8Z76SJ5LS5rLShPJTSmZvqLwZOJo0U8E q32U676Xwzvw8HscrOWsch+rgmsWXlSpovhxggSL5WeBfmca9vupYsJ7Lfmp+++G+FfL SIYA== X-Gm-Message-State: APuU4Z8Qr3zP0ZKLQb3SRToP1ONXRgFbBUspZaoYrDVSFZiB36KQz6VJ 9utsCLDK2yzhwpYTV6vHeFWQoJndROmn5jlcmd154mBe6x6uKMJa4FuHRddiFCK5cY/ofasFUiv /VNWc2go= X-Gm-Gg: AZFdTZfyEJ0kMXJmKeBjn0cXJZJeORjgMSeEZgQ7PIfPBBNwt6EPFx23KasQ9zhJ0by +8ST5pSArTTAj5N+5qK2OeM1I3jY31WhR1x3CoxergrNn8iSP7llWQZxnu+ReoCsRVwzluco8U9 z74Zgie8hn4xkZ36g0K0uUmbD2Q8vvnNAPf0EH4LrxxXXQkH3GZ/IIt8CKegA+4yUjBx8jCRima fZjlJxrf36SX/jClbAjMENN5/HDnnFuEUpJzE1qXWttj8e0UM3NUsW2t0fOin38PSOm1ekmzohf g+WNXevZXX1w19g2LNcZeSP5eKrz+5CT/QG0pv9HZPu5Q7D7er/Yo8njkQuzFDukgXKgmOwm9tJ vSrsyqqH5bzryvj/uWsMY/NzS5QHUtWkIBuLhbrWj5JMO3bPfTBdIfr4tAp9Sob7ndiuH7GqKVF OiKgRHYqHxpCHqcYeIGPSGRDODVdbpHcgPoHo5bCyyPfstx3n7bfaCSG+huIeEV/tts2wybskH2 tsDptdEiUENIPEfnmNrInGehONklH8yIqiaUBLStJKlAy/dslcmv4QZxvWbOm7X6GMUPWGu/mM4 ohzennEhdTRVusj1qHarzA60rILmbCFx8/nXyH8o2ZjkfDnPRUeK1AuV0Cb0YnQZ+EKx X-Received: by 2002:a05:6a00:10d3:b0:89f:6989:cb9b with SMTP id d2e1a72fcca58-8c87bfa1ebemr32613899b3a.27.1796075549548; Mon, 30 Nov 2026 13:52:29 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c872e45756sm18561940b3a.27.2026.11.30.13.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 13:52:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 37/38] efd: mark configuration dependent vector selection Date: Mon, 30 Nov 2026 13:49:43 -0800 Message-ID: <20261130215203.886245-38-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130215203.886245-1-stephen@networkplumber.org> References: <20261129205006.1440292-1-stephen@networkplumber.org> <20261130215203.886245-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=-16.8 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 The AVX2 and NEON lookup functions are only selected when RTE_EFD_VALUE_NUM_BITS is large enough to make the vectorised version worthwhile. That value is a user settable knob documented in rte_efd.h as being between 1 and 32, and defaults to 8. At the default the NEON comparison is false, so clang on Arm reports the assignment as unreachable. The AVX2 comparison is true at the default but would report the same on a build with RTE_EFD_VALUE_NUM_BITS of 3 or less. Parenthesizing the constant tells clang the comparison is configuration dependent. A preprocessor guard would stop compiling the selection in the default build, and the generated code is unchanged either way. Signed-off-by: Stephen Hemminger --- lib/efd/rte_efd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index 9d5969e151..6c89d3dade 100644 --- a/lib/efd/rte_efd.c +++ b/lib/efd/rte_efd.c @@ -659,7 +659,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, * For less than 4 bits, scalar function performs better * than vectorised version */ - if (RTE_EFD_VALUE_NUM_BITS > 3 + if (RTE_EFD_VALUE_NUM_BITS > (3) && rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) table->lookup_fn = EFD_LOOKUP_AVX2; @@ -670,7 +670,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, * For less than or equal to 16 bits, scalar function performs better * than vectorised version */ - if (RTE_EFD_VALUE_NUM_BITS > 16 && + if (RTE_EFD_VALUE_NUM_BITS > (16) && rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON) && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) table->lookup_fn = EFD_LOOKUP_NEON; -- 2.53.0