aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2010-11-26 13:22:48 -0500
committerDavid Dillow <dillowda@ornl.gov>2011-01-05 15:24:25 -0500
commitdcb4cb85f4b7caac9769bce464fef16306a4758c (patch)
tree1c21889c8b778415f9a8d46fcf28853eb42ede18 /drivers/infiniband/ulp/srp/ib_srp.h
parent9709f0e05b827049733f439de82a4a1688b37b86 (diff)
IB/srp: allow lockless work posting
Only one CPU at a time will own an RX IU, so using the address of the IU as the work request cookie allows us to avoid taking a lock. We can similarly prepare the TX path for lockless posting by moving the free TX IUs to a list. This also removes the requirement that the queue sizes be a power of 2. Signed-off-by: Bart Van Assche <bvanassche@acm.org> [ broken out, small cleanups, and modified to avoid needing an extra field in the IU by David Dillow] Signed-off-by: David Dillow <dillowda@ornl.gov>
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.h')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index f8b689a644b7..41ecb46adf15 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -59,10 +59,8 @@ 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,
@@ -144,11 +142,9 @@ struct srp_target_port {
144 142
145 int zero_req_lim; 143 int zero_req_lim;
146 144
147 unsigned rx_head;
148 struct srp_iu *rx_ring[SRP_RQ_SIZE]; 145 struct srp_iu *rx_ring[SRP_RQ_SIZE];
149 146
150 unsigned tx_head; 147 struct list_head free_tx;
151 unsigned tx_tail;
152 struct srp_iu *tx_ring[SRP_SQ_SIZE]; 148 struct srp_iu *tx_ring[SRP_SQ_SIZE];
153 149
154 struct list_head free_reqs; 150 struct list_head free_reqs;
@@ -168,6 +164,7 @@ struct srp_target_port {
168}; 164};
169 165
170struct srp_iu { 166struct srp_iu {
167 struct list_head list;
171 u64 dma; 168 u64 dma;
172 void *buf; 169 void *buf;
173 size_t size; 170 size_t size;