aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.h')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index ed0dce9e479f..9dc6fc3fd894 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -59,16 +59,15 @@ enum {
59 59
60 SRP_RQ_SHIFT = 6, 60 SRP_RQ_SHIFT = 6,
61 SRP_RQ_SIZE = 1 << SRP_RQ_SHIFT, 61 SRP_RQ_SIZE = 1 << SRP_RQ_SHIFT,
62 SRP_RQ_MASK = SRP_RQ_SIZE - 1,
63 62
64 SRP_SQ_SIZE = SRP_RQ_SIZE, 63 SRP_SQ_SIZE = SRP_RQ_SIZE,
65 SRP_SQ_MASK = SRP_SQ_SIZE - 1,
66 SRP_RSP_SQ_SIZE = 1, 64 SRP_RSP_SQ_SIZE = 1,
67 SRP_REQ_SQ_SIZE = SRP_SQ_SIZE - SRP_RSP_SQ_SIZE, 65 SRP_REQ_SQ_SIZE = SRP_SQ_SIZE - SRP_RSP_SQ_SIZE,
68 SRP_TSK_MGMT_SQ_SIZE = 1, 66 SRP_TSK_MGMT_SQ_SIZE = 1,
69 SRP_CMD_SQ_SIZE = SRP_REQ_SQ_SIZE - SRP_TSK_MGMT_SQ_SIZE, 67 SRP_CMD_SQ_SIZE = SRP_REQ_SQ_SIZE - SRP_TSK_MGMT_SQ_SIZE,
70 68
71 SRP_TAG_TSK_MGMT = 1 << (SRP_RQ_SHIFT + 1), 69 SRP_TAG_NO_REQ = ~0U,
70 SRP_TAG_TSK_MGMT = 1U << 31,
72 71
73 SRP_FMR_SIZE = 256, 72 SRP_FMR_SIZE = 256,
74 SRP_FMR_POOL_SIZE = 1024, 73 SRP_FMR_POOL_SIZE = 1024,
@@ -113,15 +112,29 @@ struct srp_request {
113 struct list_head list; 112 struct list_head list;
114 struct scsi_cmnd *scmnd; 113 struct scsi_cmnd *scmnd;
115 struct srp_iu *cmd; 114 struct srp_iu *cmd;
116 struct srp_iu *tsk_mgmt;
117 struct ib_pool_fmr *fmr; 115 struct ib_pool_fmr *fmr;
118 struct completion done;
119 short index; 116 short index;
120 u8 cmd_done;
121 u8 tsk_status;
122}; 117};
123 118
124struct srp_target_port { 119struct srp_target_port {
120 /* These are RW in the hot path, and commonly used together */
121 struct list_head free_tx;
122 struct list_head free_reqs;
123 spinlock_t lock;
124 s32 req_lim;
125
126 /* These are read-only in the hot path */
127 struct ib_cq *send_cq ____cacheline_aligned_in_smp;
128 struct ib_cq *recv_cq;
129 struct ib_qp *qp;
130 u32 lkey;
131 u32 rkey;
132 enum srp_target_state state;
133
134 /* Everything above this point is used in the hot path of
135 * command processing. Try to keep them packed into cachelines.
136 */
137
125 __be64 id_ext; 138 __be64 id_ext;
126 __be64 ioc_guid; 139 __be64 ioc_guid;
127 __be64 service_id; 140 __be64 service_id;
@@ -138,24 +151,13 @@ struct srp_target_port {
138 int path_query_id; 151 int path_query_id;
139 152
140 struct ib_cm_id *cm_id; 153 struct ib_cm_id *cm_id;
141 struct ib_cq *recv_cq;
142 struct ib_cq *send_cq;
143 struct ib_qp *qp;
144 154
145 int max_ti_iu_len; 155 int max_ti_iu_len;
146 s32 req_lim;
147 156
148 int zero_req_lim; 157 int zero_req_lim;
149 158
150 unsigned rx_head;
151 struct srp_iu *rx_ring[SRP_RQ_SIZE];
152
153 unsigned tx_head;
154 unsigned tx_tail;
155 struct srp_iu *tx_ring[SRP_SQ_SIZE]; 159 struct srp_iu *tx_ring[SRP_SQ_SIZE];
156 160 struct srp_iu *rx_ring[SRP_RQ_SIZE];
157 struct list_head free_reqs;
158 struct list_head req_queue;
159 struct srp_request req_ring[SRP_CMD_SQ_SIZE]; 161 struct srp_request req_ring[SRP_CMD_SQ_SIZE];
160 162
161 struct work_struct work; 163 struct work_struct work;
@@ -163,16 +165,18 @@ struct srp_target_port {
163 struct list_head list; 165 struct list_head list;
164 struct completion done; 166 struct completion done;
165 int status; 167 int status;
166 enum srp_target_state state;
167 int qp_in_error; 168 int qp_in_error;
169
170 struct completion tsk_mgmt_done;
171 u8 tsk_mgmt_status;
168}; 172};
169 173
170struct srp_iu { 174struct srp_iu {
175 struct list_head list;
171 u64 dma; 176 u64 dma;
172 void *buf; 177 void *buf;
173 size_t size; 178 size_t size;
174 enum dma_data_direction direction; 179 enum dma_data_direction direction;
175 enum srp_iu_type type;
176}; 180};
177 181
178#endif /* IB_SRP_H */ 182#endif /* IB_SRP_H */