From patchwork Tue Oct 8 17:31:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Medvedkin X-Patchwork-Id: 145481 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 4210745AE3; Tue, 8 Oct 2024 19:31:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 293C0402A9; Tue, 8 Oct 2024 19:31:52 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 07CD84025C; Tue, 8 Oct 2024 19:31:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728408710; x=1759944710; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=VkhknhICGdRZ1iXQ94OWasInnFcqfTj1CMF9Ocwd1mQ=; b=B0mNSehAXq4WEb2GMKT9jVKde7sOSWdSWAseQV/iBMZq+qeAmtSFgqXB pgVRR9XGkkG94KI4esQyGQYYDxZMgg+F2JCnBbfzQC6UYe5r48EkQI8NR 0NQ7uDPj7mSkJTxt0heGdgks9lc3IE0ww0r0F7ReSDpKewEcPpEx2Ujz7 Ll2Mxr10kp9Cr1r6/MC47Q9Hbl8cMSx1BEGviAeCvEURFFdGs4lO80Eis KbNEc3XKz6NNKSz7pxKMg/L4SGLOsvOt+JDuo/iUDEdtnWU8qI4yHUzF1 eV69rr4y/AWYbUL6B3CfW78tjA9wpPHlAsW95P+aA+G7zrGUlONs8XzwE Q==; X-CSE-ConnectionGUID: rqmW1rjPS+qrFZ2am+Tg0Q== X-CSE-MsgGUID: s+0ZOyL0Tp6aNZG970hDZQ== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="31524637" X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="31524637" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 10:31:38 -0700 X-CSE-ConnectionGUID: SaOsUXLhTaCn68Jga+erOQ== X-CSE-MsgGUID: JH7g/UO8Se29VrgE0X37/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,187,1725346800"; d="scan'208";a="80773260" Received: from unknown (HELO silpixa00401176.ir.intel.com) ([10.243.22.170]) by orviesa003.jf.intel.com with ESMTP; 08 Oct 2024 10:31:37 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: david.marchand@redhat.com, stable@dpdk.org Subject: [PATCH] fib6: add runtime checks for vector lookup Date: Tue, 8 Oct 2024 17:31:36 +0000 Message-Id: <20241008173136.441340-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.34.1 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 AVX512 lookup function requires CPU to support RTE_CPUFLAG_AVX512DQ and RTE_CPUFLAG_AVX512BW. Add runtime checks of these two flags when deciding if vector function can be used. Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6") Cc: stable@dpdk.org Signed-off-by: Vladimir Medvedkin Reviewed-by: David Marchand --- lib/fib/trie.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fib/trie.c b/lib/fib/trie.c index 09470e7287..805e21d090 100644 --- a/lib/fib/trie.c +++ b/lib/fib/trie.c @@ -47,6 +47,8 @@ get_vector_fn(enum rte_fib_trie_nh_sz nh_sz) { #ifdef CC_TRIE_AVX512_SUPPORT if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0) || + (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0) || + (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) <= 0) || (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)) return NULL; switch (nh_sz) {