linux-rdma / perftest

Infiniband Verbs Performance Tests
Other
593 stars 283 forks source link

Implementation bug with payload modification #202

Closed ozawawi closed 1 year ago

ozawawi commented 1 year ago

The README specifies that for payload modification a text file that contains pattern of 0x00000001,0x00000002,0x00000003 should be supplied with the ----payload_file_path option. However, the current method of parsing the file results in an incorrect payload_len in this line of code.

This is caused because the content of the file is parsed byte by byte and casted to char in this line. To get the payload_len, the current method is using strlen which would interpret zeros like the one between the brackets here 0x0000(00)01 as the null character and so payload_len becomes incorrect.

Finally, this line ends up writing only a subset of the payload file to the buffer.

sshaulnv commented 1 year ago

Thanks for your contribution. we made a fix: https://github.com/linux-rdma/perftest/commit/a416f72011da640345ea95f7f3963afbec24ed69