aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-05-18 11:32:39 -0400
committerRoland Dreier <roland@purestorage.com>2014-05-27 14:52:58 -0400
commit5c273b16771eaeb3957d365bb3695b92aff037cf (patch)
treeac1b0f6d3a79f978647034fe11d1196f2439e020
parent8524867b9c3d11e38de084f47e2128f43e74610a (diff)
mlx5_core: Simplify signature handover wqe for interleaved buffers
No need for repetition format pattern in case the data and protection are already interleaved in the memory domain since the pattern already exists. A single key entry is sufficient and may save some extra fetch ops. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 74ee4a474e68..00b5563acab7 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2131,9 +2131,13 @@ static int set_sig_data_segment(struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
2131 int ret; 2131 int ret;
2132 int wqe_size; 2132 int wqe_size;
2133 2133
2134 if (!wr->wr.sig_handover.prot) { 2134 if (!wr->wr.sig_handover.prot ||
2135 (data_key == wr->wr.sig_handover.prot->lkey &&
2136 data_va == wr->wr.sig_handover.prot->addr &&
2137 data_len == wr->wr.sig_handover.prot->length)) {
2135 /** 2138 /**
2136 * Source domain doesn't contain signature information 2139 * Source domain doesn't contain signature information
2140 * or data and protection are interleaved in memory.
2137 * So need construct: 2141 * So need construct:
2138 * ------------------ 2142 * ------------------
2139 * | data_klm | 2143 * | data_klm |
@@ -2187,23 +2191,13 @@ static int set_sig_data_segment(struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
2187 data_sentry->bcount = cpu_to_be16(block_size); 2191 data_sentry->bcount = cpu_to_be16(block_size);
2188 data_sentry->key = cpu_to_be32(data_key); 2192 data_sentry->key = cpu_to_be32(data_key);
2189 data_sentry->va = cpu_to_be64(data_va); 2193 data_sentry->va = cpu_to_be64(data_va);
2194 data_sentry->stride = cpu_to_be16(block_size);
2195
2190 prot_sentry->bcount = cpu_to_be16(prot_size); 2196 prot_sentry->bcount = cpu_to_be16(prot_size);
2191 prot_sentry->key = cpu_to_be32(prot_key); 2197 prot_sentry->key = cpu_to_be32(prot_key);
2198 prot_sentry->va = cpu_to_be64(prot_va);
2199 prot_sentry->stride = cpu_to_be16(prot_size);
2192 2200
2193 if (prot_key == data_key && prot_va == data_va) {
2194 /**
2195 * The data and protection are interleaved
2196 * in a single memory region
2197 **/
2198 prot_sentry->va = cpu_to_be64(data_va + block_size);
2199 prot_sentry->stride = cpu_to_be16(block_size + prot_size);
2200 data_sentry->stride = prot_sentry->stride;
2201 } else {
2202 /* The data and protection are two different buffers */
2203 prot_sentry->va = cpu_to_be64(prot_va);
2204 data_sentry->stride = cpu_to_be16(block_size);
2205 prot_sentry->stride = cpu_to_be16(prot_size);
2206 }
2207 wqe_size = ALIGN(sizeof(*sblock_ctrl) + sizeof(*data_sentry) + 2201 wqe_size = ALIGN(sizeof(*sblock_ctrl) + sizeof(*data_sentry) +
2208 sizeof(*prot_sentry), 64); 2202 sizeof(*prot_sentry), 64);
2209 } 2203 }