aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2018-12-17 13:20:39 -0800
committerDoug Ledford <dledford@redhat.com>2018-12-19 15:07:25 -0500
commit882981f4a4112b44376ba21aa4d82dbdd5d8f148 (patch)
tree11ac43baaa3e84fc4fa8d182976c5f9b7773d1f6 /drivers/infiniband/ulp/srp/ib_srp.h
parentRDMA/srp: Rework handling of the maximum information unit length (diff)
downloadlinux-dev-882981f4a4112b44376ba21aa4d82dbdd5d8f148.tar.xz
linux-dev-882981f4a4112b44376ba21aa4d82dbdd5d8f148.zip
RDMA/srp: Add support for immediate data
Request permission to send immediate data during login. If the SRP target grants this request, send the payload of write requests <= 8 KB as immediate data. Cc: Sergey Gorenko <sergeygo@mellanox.com> Cc: Max Gurtovoy <maxg@mellanox.com> Cc: Laurence Oberman <loberman@redhat.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 9a271ae6573b..b2861cd2087a 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -69,6 +69,15 @@ enum {
SRP_MAX_PAGES_PER_MR = 512,
SRP_MAX_ADD_CDB_LEN = 16,
+
+ SRP_MAX_IMM_SGE = 2,
+ SRP_MAX_SGE = SRP_MAX_IMM_SGE + 1,
+ /*
+ * Choose the immediate data offset such that a 32 byte CDB still fits.
+ */
+ SRP_IMM_DATA_OFFSET = sizeof(struct srp_cmd) +
+ SRP_MAX_ADD_CDB_LEN +
+ sizeof(struct srp_imm_buf),
};
enum srp_target_state {
@@ -152,6 +161,7 @@ struct srp_rdma_ch {
};
uint32_t max_it_iu_len;
uint32_t max_ti_iu_len;
+ bool use_imm_data;
/* Everything above this point is used in the hot path of
* command processing. Try to keep them packed into cachelines.
@@ -263,6 +273,8 @@ struct srp_iu {
void *buf;
size_t size;
enum dma_data_direction direction;
+ u32 num_sge;
+ struct ib_sge sge[SRP_MAX_SGE];
struct ib_cqe cqe;
};