diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-01-30 17:31:33 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-20 13:08:08 -0500 |
commit | 4885bf64bc2eb242ebebe67077cfe3688283b586 (patch) | |
tree | ed40e3eb7c05e923919f1e8ef2a9186b32c916a4 /drivers/infiniband/hw/mthca/mthca_provider.h | |
parent | 33b9b3ee9709b19c4f02ab91571d53540d05c3d1 (diff) |
IB/mthca: Add device-specific support for resizing CQs
Add low-level driver support for resizing CQs (both kernel and
userspace) to mthca.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.h')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_provider.h | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h index 1e73947b4702..2e7f52136965 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.h +++ b/drivers/infiniband/hw/mthca/mthca_provider.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
4 | * Copyright (c) 2005 Mellanox Technologies. All rights reserved. | 4 | * Copyright (c) 2005 Mellanox Technologies. All rights reserved. |
5 | * | 5 | * |
6 | * This software is available to you under a choice of one of two | 6 | * This software is available to you under a choice of one of two |
@@ -164,9 +164,11 @@ struct mthca_ah { | |||
164 | * - wait_event until ref count is zero | 164 | * - wait_event until ref count is zero |
165 | * | 165 | * |
166 | * It is the consumer's responsibilty to make sure that no QP | 166 | * It is the consumer's responsibilty to make sure that no QP |
167 | * operations (WQE posting or state modification) are pending when the | 167 | * operations (WQE posting or state modification) are pending when a |
168 | * QP is destroyed. Also, the consumer must make sure that calls to | 168 | * QP is destroyed. Also, the consumer must make sure that calls to |
169 | * qp_modify are serialized. | 169 | * qp_modify are serialized. Similarly, the consumer is responsible |
170 | * for ensuring that no CQ resize operations are pending when a CQ | ||
171 | * is destroyed. | ||
170 | * | 172 | * |
171 | * Possible optimizations (wait for profile data to see if/where we | 173 | * Possible optimizations (wait for profile data to see if/where we |
172 | * have locks bouncing between CPUs): | 174 | * have locks bouncing between CPUs): |
@@ -176,25 +178,40 @@ struct mthca_ah { | |||
176 | * send queue and one for the receive queue) | 178 | * send queue and one for the receive queue) |
177 | */ | 179 | */ |
178 | 180 | ||
181 | struct mthca_cq_buf { | ||
182 | union mthca_buf queue; | ||
183 | struct mthca_mr mr; | ||
184 | int is_direct; | ||
185 | }; | ||
186 | |||
187 | struct mthca_cq_resize { | ||
188 | struct mthca_cq_buf buf; | ||
189 | int cqe; | ||
190 | enum { | ||
191 | CQ_RESIZE_ALLOC, | ||
192 | CQ_RESIZE_READY, | ||
193 | CQ_RESIZE_SWAPPED | ||
194 | } state; | ||
195 | }; | ||
196 | |||
179 | struct mthca_cq { | 197 | struct mthca_cq { |
180 | struct ib_cq ibcq; | 198 | struct ib_cq ibcq; |
181 | spinlock_t lock; | 199 | spinlock_t lock; |
182 | atomic_t refcount; | 200 | atomic_t refcount; |
183 | int cqn; | 201 | int cqn; |
184 | u32 cons_index; | 202 | u32 cons_index; |
185 | int is_direct; | 203 | struct mthca_cq_buf buf; |
186 | int is_kernel; | 204 | struct mthca_cq_resize *resize_buf; |
205 | int is_kernel; | ||
187 | 206 | ||
188 | /* Next fields are Arbel only */ | 207 | /* Next fields are Arbel only */ |
189 | int set_ci_db_index; | 208 | int set_ci_db_index; |
190 | __be32 *set_ci_db; | 209 | __be32 *set_ci_db; |
191 | int arm_db_index; | 210 | int arm_db_index; |
192 | __be32 *arm_db; | 211 | __be32 *arm_db; |
193 | int arm_sn; | 212 | int arm_sn; |
194 | 213 | ||
195 | union mthca_buf queue; | 214 | wait_queue_head_t wait; |
196 | struct mthca_mr mr; | ||
197 | wait_queue_head_t wait; | ||
198 | }; | 215 | }; |
199 | 216 | ||
200 | struct mthca_srq { | 217 | struct mthca_srq { |