Commit e7f9774a authored by Henry Orosco's avatar Henry Orosco Committed by Doug Ledford

i40iw: Optimize inline data copy

Use memcpy for inline data copy in sends
and writes instead of byte by byte copy.
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarHenry Orosco <henry.orosco@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent c38d7e0d
...@@ -430,7 +430,7 @@ static enum i40iw_status_code i40iw_inline_rdma_write(struct i40iw_qp_uk *qp, ...@@ -430,7 +430,7 @@ static enum i40iw_status_code i40iw_inline_rdma_write(struct i40iw_qp_uk *qp,
struct i40iw_inline_rdma_write *op_info; struct i40iw_inline_rdma_write *op_info;
u64 *push; u64 *push;
u64 header = 0; u64 header = 0;
u32 i, wqe_idx; u32 wqe_idx;
enum i40iw_status_code ret_code; enum i40iw_status_code ret_code;
bool read_fence = false; bool read_fence = false;
u8 wqe_size; u8 wqe_size;
...@@ -465,14 +465,12 @@ static enum i40iw_status_code i40iw_inline_rdma_write(struct i40iw_qp_uk *qp, ...@@ -465,14 +465,12 @@ static enum i40iw_status_code i40iw_inline_rdma_write(struct i40iw_qp_uk *qp,
src = (u8 *)(op_info->data); src = (u8 *)(op_info->data);
if (op_info->len <= 16) { if (op_info->len <= 16) {
for (i = 0; i < op_info->len; i++, src++, dest++) memcpy(dest, src, op_info->len);
*dest = *src;
} else { } else {
for (i = 0; i < 16; i++, src++, dest++) memcpy(dest, src, 16);
*dest = *src; src += 16;
dest = (u8 *)wqe + 32; dest = (u8 *)wqe + 32;
for (; i < op_info->len; i++, src++, dest++) memcpy(dest, src, op_info->len - 16);
*dest = *src;
} }
wmb(); /* make sure WQE is populated before valid bit is set */ wmb(); /* make sure WQE is populated before valid bit is set */
...@@ -507,7 +505,7 @@ static enum i40iw_status_code i40iw_inline_send(struct i40iw_qp_uk *qp, ...@@ -507,7 +505,7 @@ static enum i40iw_status_code i40iw_inline_send(struct i40iw_qp_uk *qp,
u8 *dest, *src; u8 *dest, *src;
struct i40iw_post_inline_send *op_info; struct i40iw_post_inline_send *op_info;
u64 header; u64 header;
u32 wqe_idx, i; u32 wqe_idx;
enum i40iw_status_code ret_code; enum i40iw_status_code ret_code;
bool read_fence = false; bool read_fence = false;
u8 wqe_size; u8 wqe_size;
...@@ -540,14 +538,12 @@ static enum i40iw_status_code i40iw_inline_send(struct i40iw_qp_uk *qp, ...@@ -540,14 +538,12 @@ static enum i40iw_status_code i40iw_inline_send(struct i40iw_qp_uk *qp,
src = (u8 *)(op_info->data); src = (u8 *)(op_info->data);
if (op_info->len <= 16) { if (op_info->len <= 16) {
for (i = 0; i < op_info->len; i++, src++, dest++) memcpy(dest, src, op_info->len);
*dest = *src;
} else { } else {
for (i = 0; i < 16; i++, src++, dest++) memcpy(dest, src, 16);
*dest = *src; src += 16;
dest = (u8 *)wqe + 32; dest = (u8 *)wqe + 32;
for (; i < op_info->len; i++, src++, dest++) memcpy(dest, src, op_info->len - 16);
*dest = *src;
} }
wmb(); /* make sure WQE is populated before valid bit is set */ wmb(); /* make sure WQE is populated before valid bit is set */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment