Skip to content

Commit 233b133

Browse files
authored
Merge pull request #10297 from iyastreb/perf-test-tag-bw-fix-v1.18
PERF: Fix integer overflow: use size_t instead of unsigned for buffer size v1.18.x
2 parents dce0816 + 9de9179 commit 233b133

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/tools/perf/lib/ucp_tests.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class ucp_perf_test_runner {
469469
}
470470

471471
UCS_F_ALWAYS_INLINE ucs_status_t send_daemon_req(void *buffer,
472-
unsigned length)
472+
size_t length)
473473
{
474474
ucp_ep_h ep = m_perf.ucp.ep;
475475
ucp_request_param_t param = {
@@ -491,7 +491,7 @@ class ucp_perf_test_runner {
491491
}
492492

493493
ucs_status_t UCS_F_ALWAYS_INLINE
494-
send(ucp_ep_h ep, void *buffer, unsigned length, ucp_datatype_t datatype,
494+
send(ucp_ep_h ep, void *buffer, size_t length, ucp_datatype_t datatype,
495495
psn_t sn, uint64_t remote_addr, ucp_rkey_h rkey, bool get_info = false)
496496
{
497497
ucp_request_param_t *param = get_info ? &m_send_get_info_params :
@@ -570,7 +570,7 @@ class ucp_perf_test_runner {
570570
}
571571

572572
ucs_status_t UCS_F_ALWAYS_INLINE
573-
recv(ucp_worker_h worker, ucp_ep_h ep, void *buffer, unsigned length,
573+
recv(ucp_worker_h worker, ucp_ep_h ep, void *buffer, size_t length,
574574
ucp_datatype_t datatype, psn_t sn)
575575
{
576576
void *request;
@@ -914,7 +914,7 @@ class ucp_perf_test_runner {
914914

915915
private:
916916
ucs_status_t UCS_F_ALWAYS_INLINE
917-
recv_stream_data(ucp_ep_h ep, unsigned length, ucp_datatype_t datatype)
917+
recv_stream_data(ucp_ep_h ep, size_t length, ucp_datatype_t datatype)
918918
{
919919
void *data;
920920
size_t data_length;
@@ -933,7 +933,7 @@ class ucp_perf_test_runner {
933933
}
934934

935935
ucs_status_t UCS_F_ALWAYS_INLINE
936-
recv_stream(ucp_ep_h ep, void *buf, unsigned length, ucp_datatype_t datatype)
936+
recv_stream(ucp_ep_h ep, void *buf, size_t length, ucp_datatype_t datatype)
937937
{
938938
ssize_t total = 0;
939939
void *rreq;

src/tools/perf/lib/uct_tests.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class uct_perf_test_runner {
232232
}
233233

234234
ucs_status_t UCS_F_ALWAYS_INLINE
235-
send(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, unsigned length,
235+
send(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, size_t length,
236236
uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp)
237237
{
238238
uint64_t am_short_hdr;
@@ -351,7 +351,7 @@ class uct_perf_test_runner {
351351
}
352352

353353
void UCS_F_ALWAYS_INLINE
354-
send_b(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, unsigned length,
354+
send_b(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, size_t length,
355355
uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp)
356356
{
357357
ucs_status_t status;
@@ -486,7 +486,7 @@ class uct_perf_test_runner {
486486
volatile psn_t *recv_sn,
487487
ucs_memory_type_t recv_mem_type,
488488
const ucx_perf_allocator_t *recv_allocator,
489-
unsigned length, unsigned peer_index)
489+
size_t length, unsigned peer_index)
490490
{
491491
unsigned long remote_addr;
492492
psn_t sn, send_sn;
@@ -571,7 +571,7 @@ class uct_perf_test_runner {
571571
volatile psn_t *recv_sn,
572572
ucs_memory_type_t recv_mem_type,
573573
const ucx_perf_allocator_t *recv_allocator,
574-
unsigned length, unsigned peer_index)
574+
size_t length, unsigned peer_index)
575575
{
576576
unsigned long remote_addr;
577577
psn_t sn, send_sn;
@@ -644,7 +644,7 @@ class uct_perf_test_runner {
644644
ucs_memory_type_t recv_mem_type;
645645
volatile psn_t *recv_sn;
646646
unsigned my_index;
647-
unsigned length;
647+
size_t length;
648648
unsigned group_size;
649649
unsigned peer_index;
650650

0 commit comments

Comments
 (0)