Skip to content

Commit

Permalink
Merge pull request #10297 from iyastreb/perf-test-tag-bw-fix-v1.18
Browse files Browse the repository at this point in the history
PERF: Fix integer overflow: use size_t instead of unsigned for buffer size v1.18.x
  • Loading branch information
yosefe authored Nov 14, 2024
2 parents dce0816 + 9de9179 commit 233b133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/tools/perf/lib/ucp_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class ucp_perf_test_runner {
}

UCS_F_ALWAYS_INLINE ucs_status_t send_daemon_req(void *buffer,
unsigned length)
size_t length)
{
ucp_ep_h ep = m_perf.ucp.ep;
ucp_request_param_t param = {
Expand All @@ -491,7 +491,7 @@ class ucp_perf_test_runner {
}

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

ucs_status_t UCS_F_ALWAYS_INLINE
recv(ucp_worker_h worker, ucp_ep_h ep, void *buffer, unsigned length,
recv(ucp_worker_h worker, ucp_ep_h ep, void *buffer, size_t length,
ucp_datatype_t datatype, psn_t sn)
{
void *request;
Expand Down Expand Up @@ -914,7 +914,7 @@ class ucp_perf_test_runner {

private:
ucs_status_t UCS_F_ALWAYS_INLINE
recv_stream_data(ucp_ep_h ep, unsigned length, ucp_datatype_t datatype)
recv_stream_data(ucp_ep_h ep, size_t length, ucp_datatype_t datatype)
{
void *data;
size_t data_length;
Expand All @@ -933,7 +933,7 @@ class ucp_perf_test_runner {
}

ucs_status_t UCS_F_ALWAYS_INLINE
recv_stream(ucp_ep_h ep, void *buf, unsigned length, ucp_datatype_t datatype)
recv_stream(ucp_ep_h ep, void *buf, size_t length, ucp_datatype_t datatype)
{
ssize_t total = 0;
void *rreq;
Expand Down
10 changes: 5 additions & 5 deletions src/tools/perf/lib/uct_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class uct_perf_test_runner {
}

ucs_status_t UCS_F_ALWAYS_INLINE
send(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, unsigned length,
send(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, size_t length,
uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp)
{
uint64_t am_short_hdr;
Expand Down Expand Up @@ -351,7 +351,7 @@ class uct_perf_test_runner {
}

void UCS_F_ALWAYS_INLINE
send_b(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, unsigned length,
send_b(uct_ep_h ep, psn_t sn, psn_t prev_sn, void *buffer, size_t length,
uint64_t remote_addr, uct_rkey_t rkey, uct_completion_t *comp)
{
ucs_status_t status;
Expand Down Expand Up @@ -486,7 +486,7 @@ class uct_perf_test_runner {
volatile psn_t *recv_sn,
ucs_memory_type_t recv_mem_type,
const ucx_perf_allocator_t *recv_allocator,
unsigned length, unsigned peer_index)
size_t length, unsigned peer_index)
{
unsigned long remote_addr;
psn_t sn, send_sn;
Expand Down Expand Up @@ -571,7 +571,7 @@ class uct_perf_test_runner {
volatile psn_t *recv_sn,
ucs_memory_type_t recv_mem_type,
const ucx_perf_allocator_t *recv_allocator,
unsigned length, unsigned peer_index)
size_t length, unsigned peer_index)
{
unsigned long remote_addr;
psn_t sn, send_sn;
Expand Down Expand Up @@ -644,7 +644,7 @@ class uct_perf_test_runner {
ucs_memory_type_t recv_mem_type;
volatile psn_t *recv_sn;
unsigned my_index;
unsigned length;
size_t length;
unsigned group_size;
unsigned peer_index;

Expand Down

0 comments on commit 233b133

Please sign in to comment.