| Files | Last commit | Last update |
|---|---|---|
Add IPC_V2 data path for UBRing IPC (#3573) * Add IPC_V2 data path for UBRing IPC * Move IPC_V2 ring implementation out of header --------- Co-authored-by: BGQ99 <1132767344@qq.com> | 1 month ago | |
Fix stack argument race in priority bthread scheduling (#3587) | 1 month ago | |
Rewrite RISC-V Zvbc CRC32C with adaptive VLEN and pure-vector folding (#3571) PR3332 introduced a Zvbc vector CRC32C path, but its implementation kept per-lane scalar round-trips (vector->scalar xor->vector) in the hot loop and fixed VLEN=128 (vsetvl_e64m1(2)), so VLEN>=256 cores only used half the width. On Spacemit X100 the Zvbc path measured ~450-600 MB/s, slower than the scalar Zbc path (~1.5 GB/s), making the "Zvbc preferred" dispatch a ~2.5x regression there. Rewrite rv_crc32c_vclmul: - adaptive VLEN: one e64m1 pair at VLEN>=256 (4 lanes) or two pairs at VLEN=128 (4 lanes carried on 2 vectors), so 128-bit cores run the vector path at full width; - pure-vector main loop: vlseg2e64 de-interleaved loads and vclmul_vx broadcast constants (k1..k4), zero scalar extraction; - all-vector reduction: single-element vector vclmul for the 4-to-1 lane merge and Barrett reduction, removing scalar-clmul dependencies (safe on cores with Zvbc but no scalar Zbc, e.g. SG2044); - same fold constants and math as the scalar core -> bit-exact. Correctness on k3: RFC3720 vectors (4 standard PASS), Extend composition, 70 boundary/misalign/large combos, and the official CRC.* gtest suite (5/5 PASSED) all bit-consistent across table/clmul/vclmul. Performance on k3 (X100, VLEN=256, 100-round median, same harness as PR3312): len PR3332 vclmul (MB/s) this (MB/s) speedup 1 KiB 578 5895 10.2x 4 KiB 590 9400 15.9x 64 KiB 600 11502 19.2x 1 MiB 508 11708 23.1x Signed-off-by: Xiaofei Gong <gongxiaofei24@iscas.ac.cn> Signed-off-by: YuanSheng <yuansheng@isrc.iscas.ac.cn> | 1 month ago | |
Fix Maxer default value for floating-point types (#3563) | 1 month ago | |
Refactor NULL with nullptr in json2pb (#3455) | 2 months ago | |
Reject malformed mcpack input instead of CHECK-fatal in parser (#3576) * Reject malformed mcpack input instead of CHECK-fatal in parser The mcpack2pb parser used CHECK(false) to handle malformed input in unbox(), the object/array/isoarray iterators and the value conversion functions. CHECK(false) logs at FATAL level and aborts the process when -crash_on_fatal_log is on, so a single malformed nshead+mcpack request could terminate a server and drop all in-flight requests (CWE-617). Replace the wire-controlled CHECK(false) sites with LOG(ERROR) plus the existing error propagation (set_bad()/return 0, which the generated parsing code checks), and mark the stream bad in unbox() and the truncated as_string()/as_binary() paths so failed parses are reported by stream()->good() as before. The serializer and code-generator CHECKs are untouched since they are not driven by network input. * Avoid wire-controlled eager resize in as_string/as_binary Follow-up to the CHECK(false) hardening: the claimed value size of string/binary fields comes from the wire and can be close to UINT32_MAX. resize(size) before reading allocates that amount up front, so a tiny request could trigger an uncaught std::bad_alloc/std::length_error and still terminate the process. Read in bounded chunks and grow the output only for bytes that are actually present; a short read marks the stream bad as before. * Reject truncated primitive reads in cut_packed_pod The value-returning InputStream::cut_packed_pod<T>() left its result uninitialized when cutn() read fewer than sizeof(T) bytes, which is reachable when the enclosing object declares enough bytes but the real input ends inside a primitive value. The indeterminate value was then consumed or logged (UB), and the parse continued as if the input were complete. Zero-initialize the result, return a zero value and mark the stream bad on a short read, so the generated code fails the parse. The pointer version is unchanged: its callers already check the returned size. * Validate the trailing NUL when reading mcpack strings as_string() skipped the trailing byte with popn(1), which returns 0 on an exhausted stream and leaves it good. A string whose content was present but whose stream ended exactly before the required trailing '\0' (or ended with a non-NUL byte) was therefore accepted as valid. Read the terminator and reject the input when it is missing or not a NUL, marking the stream bad and clearing the output. * Avoid double copy of valid string/binary payload cut_bytes_to_string() copied every byte twice on valid input: once from the input into a stack buffer and once into the destination string. Grow the destination by at most one 8 KiB chunk at a time and cut directly into it, restoring the single-copy behavior of the original resize+cutn path while keeping the bounded allocation. --------- Co-authored-by: brpc-oncall <brpc-oncall@localhost> | 1 month ago | |
fix(build): clean up redundant warning sources (#3385) * fix(build): clean up redundant warning sources Remove redundant pthread linkage from protoc-gen-mcpack targets and quiet compiler warnings from unused rpcz/couchbase code paths and non-x86 iobuf builds. * fix(couchbase): preserve C++11 warning suppression Use brpc's existing ALLOW_UNUSED macro on Couchbase vbucket constants so the declarations keep silencing platform-specific unused-constant warnings without requiring C++17 attributes. | 4 months ago | |
insert_apache_header | 6 years ago |
| Files | Last commit | Last update |
|---|---|---|
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 1 month ago | ||
| 2 months ago | ||
| 1 month ago | ||
| 4 months ago | ||
| 6 years ago |