Copilot commented on code in PR #3569:
URL: https://github.com/apache/brpc/pull/3569#discussion_r4175756090
##########
src/brpc/rdma/rdma_endpoint.cpp:
##########
@@ -1128,7 +1156,28 @@ int RdmaEndpoint::PostRecv(uint32_t num, bool zerocopy) {
return 0;
}
-static ibv_qp* AllocateQp(ibv_cq* send_cq, ibv_cq* recv_cq, uint32_t sq_size,
uint32_t rq_size) {
+// Inline size to request: on the first try, size capped at the vendor's first
+// known limit; after a refusal, the vendor's next smaller known limit, else
+// one step smaller.
+static uint32_t InlineDataToRequest(uint32_t vendor_id, uint32_t size,
+ bool refused) {
+ for (const auto& known : KNOWN_INLINE_LIMITS) {
+ if (known.vendor_id == vendor_id &&
+ (!refused || known.max_inline < size)) {
+ return std::min(known.max_inline, size);
Review Comment:
This device-dependent fallback has no automated coverage, so regressions in
the vendor ordering, 16-byte descent, zero-inline fallback, or returned granted
size would only be caught on specific RDMA hardware. Please add unit tests
using a stubbed `IbvCreateQp` that records requested sizes and returns
controlled failures/successes for Mellanox, Intel, Alibaba, and unknown
vendors; the repository requires new behavior to include unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]