diff options
author | Nick Child <[email protected]> | 2024-08-07 16:18:05 -0500 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-08-09 22:09:18 -0700 |
commit | d95f749a0b5e42a30d7025d19c15a11c1a570e72 (patch) | |
tree | da213d12f9c0b27c4693fcc17a4a7189db197f85 /tools/perf/scripts/python/futex-contention.py | |
parent | b41b45ecee6ba74bd590b113be9f349c6b818b46 (diff) |
ibmvnic: Reduce memcpys in tx descriptor generation
Previously when creating the header descriptors, the driver would:
1. allocate a temporary buffer on the stack (in build_hdr_descs_arr)
2. memcpy the header info into the temporary buffer (in build_hdr_data)
3. memcpy the temp buffer into a local variable (in create_hdr_descs)
4. copy the local variable into the return buffer (in create_hdr_descs)
Since, there is no opportunity for errors during this process, the temp
buffer is not needed and work can be done on the return buffer directly.
Repurpose build_hdr_data() to only calculate the header lengths. Rename
it to get_hdr_lens().
Edit create_hdr_descs() to read from the skb directly and copy directly
into the returned useful buffer.
The process now involves less memory and write operations while
also being more readable.
Signed-off-by: Nick Child <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/futex-contention.py')
0 files changed, 0 insertions, 0 deletions