* [PATCH v3 1/4] config/riscv: detect V extension [not found] <20250919163358.2887335-1-uk7b@foxmail.com> @ 2025-09-19 16:33 ` uk7b 2025-09-19 18:16 ` Thomas Monjalon 2025-09-19 16:33 ` [PATCH v3 2/4] lib/lpm: R-V V rte_lpm_lookupx4 uk7b ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: uk7b @ 2025-09-19 16:33 UTC (permalink / raw) To: dev; +Cc: Sun Yuechi, Thomas Monjalon, Stanislaw Kardach, Bruce Richardson From: Sun Yuechi <sunyuechi@iscas.ac.cn> This patch is derived from "config/riscv: detect presence of Zbc extension with modifications". The RISC-V C api defines architecture extension test macros These let us detect whether the V extension is supported on the compiler and -march we're building with. The C api also defines V intrinsics we can use rather than inline assembly on newer versions of GCC (14.1.0+) and Clang (18.1.0+). If the V extension and intrinsics are both present and we can detect the V extension at runtime, we define a flag, RTE_RISCV_FEATURE_V. Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> --- .mailmap | 1 + config/riscv/meson.build | 25 +++++++++++++++++++++++++ lib/eal/riscv/include/rte_vect.h | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/.mailmap b/.mailmap index 8483d96ec5..21f5d7fb5e 100644 --- a/.mailmap +++ b/.mailmap @@ -1513,6 +1513,7 @@ Sunil Kumar Kori <skori@marvell.com> <skori@mavell.com> <sunil.kori@nxp.com> Sunil Pai G <sunil.pai.g@intel.com> Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com> Sun Jiajia <sunx.jiajia@intel.com> +Sun Yuechi <sunyuechi@iscas.ac.cn> <uk7b@foxmail.com> Sunyang Wu <sunyang.wu@jaguarmicro.com> Surabhi Boob <surabhi.boob@intel.com> Suyang Ju <sju@paloaltonetworks.com> diff --git a/config/riscv/meson.build b/config/riscv/meson.build index 7562c6cb99..e3694cf2e6 100644 --- a/config/riscv/meson.build +++ b/config/riscv/meson.build @@ -119,6 +119,31 @@ foreach flag: arch_config['machine_args'] endif endforeach +# check if we can do buildtime detection of extensions supported by the target +riscv_extension_macros = false +if (cc.get_define('__riscv_arch_test', args: machine_args) == '1') + message('Detected architecture extension test macros') + riscv_extension_macros = true +else + warning('RISC-V architecture extension test macros not available. Build-time detection of extensions not possible') +endif + +# detect extensions +# Requires intrinsics available in GCC 14.1.0+ and Clang 18.1.0+ +if (riscv_extension_macros and + (cc.get_define('__riscv_vector', args: machine_args) != '')) + if ((cc.get_id() == 'gcc' and cc.version().version_compare('>=14.1.0')) + or (cc.get_id() == 'clang' and cc.version().version_compare('>=18.1.0'))) + if (cc.compiles('''#include <riscv_vector.h> + int main(void) { size_t vl = __riscv_vsetvl_e32m1(1); }''', args: machine_args)) + message('Compiling with the V extension') + machine_args += ['-DRTE_RISCV_FEATURE_V'] + endif + else + warning('Detected V extension but cannot use because intrinsics are not available (present in GCC 14.1.0+ and Clang 18.1.0+)') + endif +endif + # apply flags foreach flag: dpdk_flags if flag.length() > 0 diff --git a/lib/eal/riscv/include/rte_vect.h b/lib/eal/riscv/include/rte_vect.h index 6df10fa8ee..a4357e266a 100644 --- a/lib/eal/riscv/include/rte_vect.h +++ b/lib/eal/riscv/include/rte_vect.h @@ -11,6 +11,10 @@ #include "generic/rte_vect.h" #include "rte_common.h" +#ifdef RTE_RISCV_FEATURE_V +#include <riscv_vector.h> +#endif + #ifdef __cplusplus extern "C" { #endif -- 2.51.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/4] config/riscv: detect V extension 2025-09-19 16:33 ` [PATCH v3 1/4] config/riscv: detect V extension uk7b @ 2025-09-19 18:16 ` Thomas Monjalon 2025-09-19 18:52 ` 孙越池 0 siblings, 1 reply; 9+ messages in thread From: Thomas Monjalon @ 2025-09-19 18:16 UTC (permalink / raw) To: Sun Yuechi, uk7b; +Cc: dev, Stanislaw Kardach, Bruce Richardson 19/09/2025 18:33, uk7b@foxmail.com: > From: Sun Yuechi <sunyuechi@iscas.ac.cn> > > This patch is derived from "config/riscv: detect presence of Zbc > extension with modifications". > > The RISC-V C api defines architecture extension test macros > These let us detect whether the V extension is supported on the > compiler and -march we're building with. The C api also defines V > intrinsics we can use rather than inline assembly on newer versions of > GCC (14.1.0+) and Clang (18.1.0+). > > If the V extension and intrinsics are both present and we can detect > the V extension at runtime, we define a flag, RTE_RISCV_FEATURE_V. > > Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> Series merged with style improvements, thanks. Please could you add a cross file in config/riscv/ for rv64gcv and use it in devtools/test-meson-builds.sh so we can test compiling with the vector extension? Another question about RISC-V maintenance in general, what do you think about other pending patches for RISC-V? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: [PATCH v3 1/4] config/riscv: detect V extension 2025-09-19 18:16 ` Thomas Monjalon @ 2025-09-19 18:52 ` 孙越池 2025-09-19 19:08 ` Thomas Monjalon 0 siblings, 1 reply; 9+ messages in thread From: 孙越池 @ 2025-09-19 18:52 UTC (permalink / raw) To: Thomas Monjalon; +Cc: uk7b, dev, Stanislaw Kardach, Bruce Richardson > Please could you add a cross file in config/riscv/ for rv64gcv > and use it in devtools/test-meson-builds.sh so we can test compiling > with the vector extension? Sure, I plan to submit this next week. > Another question about RISC-V maintenance in general, > what do you think about other pending patches for RISC-V? I would like to prioritize merging the hwprobe detection. The related work is already mostly done here: [PATCH v3 0/9] riscv: implement accelerated crc using zbc The next step is to contact the author for a rebase and then review it. After that, the following patch will be handled: [PATCH 0/2] eal/riscv: implement prefetch using zicbop In addition, our team has several riscv v extension optimization patches that we are refining and will submit soon. I would prefer to be added as a maintainer, as this might make communication with other authors more efficient. > -----原始邮件----- > 发件人: "Thomas Monjalon" <thomas@monjalon.net> > 发送时间: 2025-09-20 02:16:22 (星期六) > 收件人: "Sun Yuechi" <sunyuechi@iscas.ac.cn>, uk7b@foxmail.com > 抄送: dev@dpdk.org, "Stanislaw Kardach" <stanislaw.kardach@gmail.com>, "Bruce Richardson" <bruce.richardson@intel.com> > 主题: Re: [PATCH v3 1/4] config/riscv: detect V extension > > 19/09/2025 18:33, uk7b@foxmail.com: > > From: Sun Yuechi <sunyuechi@iscas.ac.cn> > > > > This patch is derived from "config/riscv: detect presence of Zbc > > extension with modifications". > > > > The RISC-V C api defines architecture extension test macros > > These let us detect whether the V extension is supported on the > > compiler and -march we're building with. The C api also defines V > > intrinsics we can use rather than inline assembly on newer versions of > > GCC (14.1.0+) and Clang (18.1.0+). > > > > If the V extension and intrinsics are both present and we can detect > > the V extension at runtime, we define a flag, RTE_RISCV_FEATURE_V. > > > > Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> > > Series merged with style improvements, thanks. > > Please could you add a cross file in config/riscv/ for rv64gcv > and use it in devtools/test-meson-builds.sh so we can test compiling > with the vector extension? > > Another question about RISC-V maintenance in general, > what do you think about other pending patches for RISC-V? > </sunyuechi@iscas.ac.cn></sunyuechi@iscas.ac.cn></bruce.richardson@intel.com></stanislaw.kardach@gmail.com></sunyuechi@iscas.ac.cn></thomas@monjalon.net> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/4] config/riscv: detect V extension 2025-09-19 18:52 ` 孙越池 @ 2025-09-19 19:08 ` Thomas Monjalon 0 siblings, 0 replies; 9+ messages in thread From: Thomas Monjalon @ 2025-09-19 19:08 UTC (permalink / raw) To: 孙越池, uk7b; +Cc: dev, Stanislaw Kardach, Bruce Richardson 19/09/2025 20:52, 孙越池: > > Please could you add a cross file in config/riscv/ for rv64gcv > > and use it in devtools/test-meson-builds.sh so we can test compiling > > with the vector extension? > > Sure, I plan to submit this next week. > > > Another question about RISC-V maintenance in general, > > what do you think about other pending patches for RISC-V? > > I would like to prioritize merging the hwprobe detection. The related work is already mostly done here: > > [PATCH v3 0/9] riscv: implement accelerated crc using zbc > > The next step is to contact the author for a rebase and then review it. After that, the following patch will be handled: > > [PATCH 0/2] eal/riscv: implement prefetch using zicbop > > In addition, our team has several riscv v extension optimization patches that we are refining and will submit soon. > > I would prefer to be added as a maintainer, as this might make communication with other authors more efficient. You are welcome to become a maintainer of the whole arch RISC-V. Please send a patch to add yourself. PS: please could you find a way to have your mails formatted differently? The quoted reply has ">" instead of ">". Also the threading of your patches looks broken. Don't hesitate to join on Slack if you need advices. Thanks ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 2/4] lib/lpm: R-V V rte_lpm_lookupx4 [not found] <20250919163358.2887335-1-uk7b@foxmail.com> 2025-09-19 16:33 ` [PATCH v3 1/4] config/riscv: detect V extension uk7b @ 2025-09-19 16:33 ` uk7b 2025-09-19 16:33 ` [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk uk7b 2025-09-19 16:33 ` [PATCH v3 4/4] riscv: override machine_args only when default uk7b 3 siblings, 0 replies; 9+ messages in thread From: uk7b @ 2025-09-19 16:33 UTC (permalink / raw) To: dev Cc: Sun Yuechi, Thomas Monjalon, Bruce Richardson, Vladimir Medvedkin, Stanislaw Kardach From: Sun Yuechi <sunyuechi@iscas.ac.cn> Implement LPM lookupx4 function for RISC-V architecture using RISC-V Vector Extension instruction set Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> --- MAINTAINERS | 2 ++ lib/lpm/meson.build | 1 + lib/lpm/rte_lpm.h | 2 ++ lib/lpm/rte_lpm_rvv.h | 59 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 lib/lpm/rte_lpm_rvv.h diff --git a/MAINTAINERS b/MAINTAINERS index 0e9357f3a3..9bd97879b6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -341,6 +341,8 @@ M: Stanislaw Kardach <stanislaw.kardach@gmail.com> F: config/riscv/ F: doc/guides/linux_gsg/cross_build_dpdk_for_riscv.rst F: lib/eal/riscv/ +M: sunyuechi <sunyuechi@iscas.ac.cn> +F: lib/**/*rvv* Intel x86 M: Bruce Richardson <bruce.richardson@intel.com> diff --git a/lib/lpm/meson.build b/lib/lpm/meson.build index cff8fed473..c4522eaf0c 100644 --- a/lib/lpm/meson.build +++ b/lib/lpm/meson.build @@ -11,6 +11,7 @@ indirect_headers += files( 'rte_lpm_scalar.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h', + 'rte_lpm_rvv.h', ) deps += ['hash'] deps += ['rcu'] diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h index 6bf8d9d883..edfe77b458 100644 --- a/lib/lpm/rte_lpm.h +++ b/lib/lpm/rte_lpm.h @@ -420,6 +420,8 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], #include "rte_lpm_altivec.h" #elif defined(RTE_ARCH_X86) #include "rte_lpm_sse.h" +#elif defined(RTE_ARCH_RISCV) && defined(RTE_RISCV_FEATURE_V) +#include "rte_lpm_rvv.h" #else #include "rte_lpm_scalar.h" #endif diff --git a/lib/lpm/rte_lpm_rvv.h b/lib/lpm/rte_lpm_rvv.h new file mode 100644 index 0000000000..0d3dc91055 --- /dev/null +++ b/lib/lpm/rte_lpm_rvv.h @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2025 Institute of Software Chinese Academy of Sciences (ISCAS). + */ + +#ifndef _RTE_LPM_RVV_H_ +#define _RTE_LPM_RVV_H_ + +#include <rte_vect.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define RTE_LPM_LOOKUP_SUCCESS 0x01000000 +#define RTE_LPM_VALID_EXT_ENTRY_BITMASK 0x03000000 + +static inline void rte_lpm_lookupx4( + const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], uint32_t defv) +{ + size_t vl = 4; + + const uint32_t *tbl24_p = (const uint32_t *)lpm->tbl24; + uint32_t tbl_entries[4] = { + tbl24_p[((uint32_t)ip[0]) >> 8], + tbl24_p[((uint32_t)ip[1]) >> 8], + tbl24_p[((uint32_t)ip[2]) >> 8], + tbl24_p[((uint32_t)ip[3]) >> 8], + }; + vuint32m1_t vtbl_entry = __riscv_vle32_v_u32m1(tbl_entries, vl); + + vbool32_t mask = __riscv_vmseq_vx_u32m1_b32( + __riscv_vand_vx_u32m1(vtbl_entry, RTE_LPM_VALID_EXT_ENTRY_BITMASK, vl), + RTE_LPM_VALID_EXT_ENTRY_BITMASK, vl); + + vuint32m1_t vtbl8_index = __riscv_vsll_vx_u32m1( + __riscv_vadd_vv_u32m1( + __riscv_vsll_vx_u32m1(__riscv_vand_vx_u32m1(vtbl_entry, 0x00FFFFFF, vl), 8, vl), + __riscv_vand_vx_u32m1( + __riscv_vle32_v_u32m1((const uint32_t *)&ip, vl), 0x000000FF, vl), + vl), + 2, vl); + + vtbl_entry = __riscv_vluxei32_v_u32m1_mu( + mask, vtbl_entry, (const uint32_t *)(lpm->tbl8), vtbl8_index, vl); + + vuint32m1_t vnext_hop = __riscv_vand_vx_u32m1(vtbl_entry, 0x00FFFFFF, vl); + mask = __riscv_vmseq_vx_u32m1_b32( + __riscv_vand_vx_u32m1(vtbl_entry, RTE_LPM_LOOKUP_SUCCESS, vl), 0, vl); + + vnext_hop = __riscv_vmerge_vxm_u32m1(vnext_hop, defv, mask, vl); + + __riscv_vse32_v_u32m1(hop, vnext_hop, vl); +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_LPM_RVV_H_ */ -- 2.51.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk [not found] <20250919163358.2887335-1-uk7b@foxmail.com> 2025-09-19 16:33 ` [PATCH v3 1/4] config/riscv: detect V extension uk7b 2025-09-19 16:33 ` [PATCH v3 2/4] lib/lpm: R-V V rte_lpm_lookupx4 uk7b @ 2025-09-19 16:33 ` uk7b 2025-09-19 17:48 ` Thomas Monjalon 2025-09-19 16:33 ` [PATCH v3 4/4] riscv: override machine_args only when default uk7b 3 siblings, 1 reply; 9+ messages in thread From: uk7b @ 2025-09-19 16:33 UTC (permalink / raw) To: dev; +Cc: Sun Yuechi, Vladimir Medvedkin, Stanislaw Kardach From: Sun Yuechi <sunyuechi@iscas.ac.cn> Implement rte_fib_lookup_bulk function for RISC-V architecture using RISC-V Vector Extension instruction set Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> --- lib/fib/dir24_8.c | 20 ++++++++++++++ lib/fib/dir24_8_rvv.c | 64 +++++++++++++++++++++++++++++++++++++++++++ lib/fib/dir24_8_rvv.h | 26 ++++++++++++++++++ lib/fib/meson.build | 2 ++ 4 files changed, 112 insertions(+) create mode 100644 lib/fib/dir24_8_rvv.c create mode 100644 lib/fib/dir24_8_rvv.h diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c index 2ba7e93511..c652d3ca98 100644 --- a/lib/fib/dir24_8.c +++ b/lib/fib/dir24_8.c @@ -20,6 +20,10 @@ #include "dir24_8_avx512.h" +#elif defined(RTE_RISCV_FEATURE_V) + +#include "dir24_8_rvv.h" + #endif /* CC_AVX512_SUPPORT */ #define DIR24_8_NAMESIZE 64 @@ -88,6 +92,22 @@ get_vector_fn(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr) default: return NULL; } +#elif defined(RTE_RISCV_FEATURE_V) + RTE_SET_USED(be_addr); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_RISCV_ISA_V) <= 0) + return NULL; + switch (nh_sz) { + case RTE_FIB_DIR24_8_1B: + return rte_dir24_8_vec_lookup_bulk_1b; + case RTE_FIB_DIR24_8_2B: + return rte_dir24_8_vec_lookup_bulk_2b; + case RTE_FIB_DIR24_8_4B: + return rte_dir24_8_vec_lookup_bulk_4b; + case RTE_FIB_DIR24_8_8B: + return rte_dir24_8_vec_lookup_bulk_8b; + default: + return NULL; + } #else RTE_SET_USED(nh_sz); RTE_SET_USED(be_addr); diff --git a/lib/fib/dir24_8_rvv.c b/lib/fib/dir24_8_rvv.c new file mode 100644 index 0000000000..9c14ca0481 --- /dev/null +++ b/lib/fib/dir24_8_rvv.c @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2025 Institute of Software Chinese Academy of Sciences (ISCAS). + */ + +#if defined(RTE_RISCV_FEATURE_V) + +#include <rte_vect.h> +#include <rte_fib.h> + +#include "dir24_8.h" +#include "dir24_8_rvv.h" + +#define DECLARE_VECTOR_FN(SFX, NH_SZ) \ +void \ +rte_dir24_8_vec_lookup_bulk_##SFX(void *p, \ + const uint32_t *ips, uint64_t *next_hops, unsigned int n) \ +{ \ + const uint8_t idx_bits = 3 - NH_SZ; \ + const uint32_t idx_mask = (1u << (3 - NH_SZ)) - 1u; \ + const uint64_t e_mask = ~0ULL >> (64 - (8u << NH_SZ)); \ + struct dir24_8_tbl *tbl = (struct dir24_8_tbl *)p; \ + const uint64_t *tbl24 = tbl->tbl24; \ + size_t vl; \ + for (unsigned int i = 0; i < n; i += vl) { \ + vl = __riscv_vsetvl_e32m4(n - i); \ + vuint32m4_t v_ips = __riscv_vle32_v_u32m4(&ips[i], vl); \ + vuint64m8_t vtbl_word = __riscv_vluxei32_v_u64m8(tbl24, \ + __riscv_vsll_vx_u32m4( \ + __riscv_vsrl_vx_u32m4(v_ips, idx_bits + 8, vl), 3, vl), vl); \ + vuint32m4_t v_tbl_index = __riscv_vsrl_vx_u32m4(v_ips, 8, vl); \ + vuint32m4_t v_entry_idx = __riscv_vand_vx_u32m4(v_tbl_index, idx_mask, vl); \ + vuint32m4_t v_shift = __riscv_vsll_vx_u32m4(v_entry_idx, 3 + NH_SZ, vl); \ + vuint64m8_t vtbl_entry = __riscv_vand_vx_u64m8( \ + __riscv_vsrl_vv_u64m8(vtbl_word, \ + __riscv_vwcvtu_x_x_v_u64m8(v_shift, vl), vl), e_mask, vl); \ + vbool8_t mask = __riscv_vmseq_vx_u64m8_b8( \ + __riscv_vand_vx_u64m8(vtbl_entry, 1, vl), 1, vl); \ + if (__riscv_vcpop_m_b8(mask, vl)) { \ + const uint64_t *tbl8 = tbl->tbl8; \ + v_tbl_index = __riscv_vadd_vv_u32m4_mu(mask, v_tbl_index, \ + __riscv_vsll_vx_u32m4( \ + __riscv_vnsrl_wx_u32m4(vtbl_entry, 1, vl), 8, vl), \ + __riscv_vand_vx_u32m4(v_ips, 0xFF, vl), vl); \ + vtbl_word = __riscv_vluxei32_v_u64m8_mu(mask, vtbl_word, tbl8, \ + __riscv_vsll_vx_u32m4( \ + __riscv_vsrl_vx_u32m4(v_tbl_index, idx_bits, vl), 3, vl), \ + vl); \ + v_entry_idx = __riscv_vand_vx_u32m4(v_tbl_index, idx_mask, vl); \ + v_shift = __riscv_vsll_vx_u32m4(v_entry_idx, 3 + NH_SZ, vl); \ + vtbl_entry = __riscv_vand_vx_u64m8( \ + __riscv_vsrl_vv_u64m8(vtbl_word, \ + __riscv_vwcvtu_x_x_v_u64m8(v_shift, vl), vl), e_mask, vl); \ + } \ + __riscv_vse64_v_u64m8(&next_hops[i], \ + __riscv_vsrl_vx_u64m8(vtbl_entry, 1, vl), vl); \ + } \ +} + +DECLARE_VECTOR_FN(1b, 0) +DECLARE_VECTOR_FN(2b, 1) +DECLARE_VECTOR_FN(4b, 2) +DECLARE_VECTOR_FN(8b, 3) + +#endif diff --git a/lib/fib/dir24_8_rvv.h b/lib/fib/dir24_8_rvv.h new file mode 100644 index 0000000000..c75057e266 --- /dev/null +++ b/lib/fib/dir24_8_rvv.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2025 Institute of Software Chinese Academy of Sciences (ISCAS). + */ + +#ifndef _DIR248_RVV_H_ +#define _DIR248_RVV_H_ + +#include "rte_cpuflags.h" + +void +rte_dir24_8_vec_lookup_bulk_1b(void *p, const uint32_t *ips, + uint64_t *next_hops, const unsigned int n); + +void +rte_dir24_8_vec_lookup_bulk_2b(void *p, const uint32_t *ips, + uint64_t *next_hops, const unsigned int n); + +void +rte_dir24_8_vec_lookup_bulk_4b(void *p, const uint32_t *ips, + uint64_t *next_hops, const unsigned int n); + +void +rte_dir24_8_vec_lookup_bulk_8b(void *p, const uint32_t *ips, + uint64_t *next_hops, const unsigned int n); + +#endif /* _DIR248_RVV_H_ */ diff --git a/lib/fib/meson.build b/lib/fib/meson.build index 6992ccc040..573fc50ff1 100644 --- a/lib/fib/meson.build +++ b/lib/fib/meson.build @@ -10,4 +10,6 @@ deps += ['net'] if dpdk_conf.has('RTE_ARCH_X86_64') sources_avx512 += files('dir24_8_avx512.c', 'trie_avx512.c') +elif dpdk_conf.has('RTE_ARCH_RISCV') + sources += files('dir24_8_rvv.c') endif -- 2.51.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk 2025-09-19 16:33 ` [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk uk7b @ 2025-09-19 17:48 ` Thomas Monjalon 2025-09-19 17:59 ` 孙越池 0 siblings, 1 reply; 9+ messages in thread From: Thomas Monjalon @ 2025-09-19 17:48 UTC (permalink / raw) To: Sun Yuechi; +Cc: dev, Vladimir Medvedkin, Stanislaw Kardach, uk7b 19/09/2025 18:33, uk7b@foxmail.com: > From: Sun Yuechi <sunyuechi@iscas.ac.cn> > +#ifndef _DIR248_RVV_H_ > +#define _DIR248_RVV_H_ > + > +#include "rte_cpuflags.h" It should be #include <rte_cpuflags.h> and it should be only where really needed (.c probably). Don't bother doing another version, I'm working on it, and will merge with coding style improvements. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk 2025-09-19 17:48 ` Thomas Monjalon @ 2025-09-19 17:59 ` 孙越池 0 siblings, 0 replies; 9+ messages in thread From: 孙越池 @ 2025-09-19 17:59 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev, Vladimir Medvedkin, Stanislaw Kardach, uk7b Got it, thanks. > -----原始邮件----- > 发件人: "Thomas Monjalon" <thomas@monjalon.net> > 发送时间: 2025-09-20 01:48:18 (星期六) > 收件人: "Sun Yuechi" <sunyuechi@iscas.ac.cn> > 抄送: dev@dpdk.org, "Vladimir Medvedkin" <vladimir.medvedkin@intel.com>, "Stanislaw Kardach" <stanislaw.kardach@gmail.com>, uk7b@foxmail.com > 主题: Re: [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk > > 19/09/2025 18:33, uk7b@foxmail.com: > > From: Sun Yuechi <sunyuechi@iscas.ac.cn> > > +#ifndef _DIR248_RVV_H_ > > +#define _DIR248_RVV_H_ > > + > > +#include "rte_cpuflags.h" > > It should be > #include <rte_cpuflags.h> > and it should be only where really needed (.c probably). > > Don't bother doing another version, I'm working on it, > and will merge with coding style improvements. > > </rte_cpuflags.h></sunyuechi@iscas.ac.cn></stanislaw.kardach@gmail.com></vladimir.medvedkin@intel.com></sunyuechi@iscas.ac.cn></thomas@monjalon.net> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 4/4] riscv: override machine_args only when default [not found] <20250919163358.2887335-1-uk7b@foxmail.com> ` (2 preceding siblings ...) 2025-09-19 16:33 ` [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk uk7b @ 2025-09-19 16:33 ` uk7b 3 siblings, 0 replies; 9+ messages in thread From: uk7b @ 2025-09-19 16:33 UTC (permalink / raw) To: dev; +Cc: Sun Yuechi, Stanislaw Kardach, Bruce Richardson From: Sun Yuechi <sunyuechi@iscas.ac.cn> Support using -Dcpu_instruction_set=rv64gcv to enable V extension. Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn> --- config/riscv/meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config/riscv/meson.build b/config/riscv/meson.build index e3694cf2e6..f93ea3e145 100644 --- a/config/riscv/meson.build +++ b/config/riscv/meson.build @@ -111,13 +111,15 @@ arch_config = arch_config[arch_id] # Concatenate flags respecting priorities. dpdk_flags = flags_common + vendor_config['flags'] + arch_config.get('flags', []) -# apply supported machine args -machine_args = [] # Clear previous machine args -foreach flag: arch_config['machine_args'] - if cc.has_argument(flag) - machine_args += flag - endif -endforeach +if (cpu_instruction_set == 'rv64gc') + # apply supported machine args + machine_args = [] # Clear previous machine args + foreach flag: arch_config['machine_args'] + if cc.has_argument(flag) + machine_args += flag + endif + endforeach +endif # check if we can do buildtime detection of extensions supported by the target riscv_extension_macros = false -- 2.51.0 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-09-19 19:08 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20250919163358.2887335-1-uk7b@foxmail.com> 2025-09-19 16:33 ` [PATCH v3 1/4] config/riscv: detect V extension uk7b 2025-09-19 18:16 ` Thomas Monjalon 2025-09-19 18:52 ` 孙越池 2025-09-19 19:08 ` Thomas Monjalon 2025-09-19 16:33 ` [PATCH v3 2/4] lib/lpm: R-V V rte_lpm_lookupx4 uk7b 2025-09-19 16:33 ` [PATCH v3 3/4] lib/fib: R-V V rte_fib_lookup_bulk uk7b 2025-09-19 17:48 ` Thomas Monjalon 2025-09-19 17:59 ` 孙越池 2025-09-19 16:33 ` [PATCH v3 4/4] riscv: override machine_args only when default uk7b
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).