diff options
author | Nick Child <nnac123@linux.ibm.com> | 2024-08-08 00:18:05 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-10 08:09:18 +0300 |
commit | d95f749a0b5e42a30d7025d19c15a11c1a570e72 (patch) | |
tree | da213d12f9c0b27c4693fcc17a4a7189db197f85 /include/linux/fpga/fpga-mgr.h | |
parent | b41b45ecee6ba74bd590b113be9f349c6b818b46 (diff) | |
download | linux-d95f749a0b5e42a30d7025d19c15a11c1a570e72.tar.xz |
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 <nnac123@linux.ibm.com>
Link: https://patch.msgid.link/20240807211809.1259563-4-nnac123@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions