diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:36:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:01 -0400 |
commit | 12eef41f8b72b6e11e36b48c78849c17e49781c8 (patch) | |
tree | 3a8bd77d77c7542e19d200d3abf25fc07f0d8f51 /drivers/infiniband/hw/ipath/ipath_keys.c | |
parent | fba75200ad92892bf32d8d6f1443c6f1e4f48676 (diff) |
[PATCH] IB/ipath: rC receive interrupt performance changes
This patch separates QP state used for sending and receiving RC packets so the
processing in the receive interrupt handler can be done mostly without locks
being held. ACK packets are now sent without requiring synchronization with
the send tasklet.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_keys.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_keys.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c index e9d5d7e983bb..46773c673a1a 100644 --- a/drivers/infiniband/hw/ipath/ipath_keys.c +++ b/drivers/infiniband/hw/ipath/ipath_keys.c | |||
@@ -121,6 +121,7 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, | |||
121 | struct ib_sge *sge, int acc) | 121 | struct ib_sge *sge, int acc) |
122 | { | 122 | { |
123 | struct ipath_mregion *mr; | 123 | struct ipath_mregion *mr; |
124 | unsigned n, m; | ||
124 | size_t off; | 125 | size_t off; |
125 | int ret; | 126 | int ret; |
126 | 127 | ||
@@ -152,20 +153,22 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, | |||
152 | } | 153 | } |
153 | 154 | ||
154 | off += mr->offset; | 155 | off += mr->offset; |
155 | isge->mr = mr; | 156 | m = 0; |
156 | isge->m = 0; | 157 | n = 0; |
157 | isge->n = 0; | 158 | while (off >= mr->map[m]->segs[n].length) { |
158 | while (off >= mr->map[isge->m]->segs[isge->n].length) { | 159 | off -= mr->map[m]->segs[n].length; |
159 | off -= mr->map[isge->m]->segs[isge->n].length; | 160 | n++; |
160 | isge->n++; | 161 | if (n >= IPATH_SEGSZ) { |
161 | if (isge->n >= IPATH_SEGSZ) { | 162 | m++; |
162 | isge->m++; | 163 | n = 0; |
163 | isge->n = 0; | ||
164 | } | 164 | } |
165 | } | 165 | } |
166 | isge->vaddr = mr->map[isge->m]->segs[isge->n].vaddr + off; | 166 | isge->mr = mr; |
167 | isge->length = mr->map[isge->m]->segs[isge->n].length - off; | 167 | isge->vaddr = mr->map[m]->segs[n].vaddr + off; |
168 | isge->length = mr->map[m]->segs[n].length - off; | ||
168 | isge->sge_length = sge->length; | 169 | isge->sge_length = sge->length; |
170 | isge->m = m; | ||
171 | isge->n = n; | ||
169 | 172 | ||
170 | ret = 1; | 173 | ret = 1; |
171 | 174 | ||
@@ -190,6 +193,7 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, | |||
190 | struct ipath_lkey_table *rkt = &dev->lk_table; | 193 | struct ipath_lkey_table *rkt = &dev->lk_table; |
191 | struct ipath_sge *sge = &ss->sge; | 194 | struct ipath_sge *sge = &ss->sge; |
192 | struct ipath_mregion *mr; | 195 | struct ipath_mregion *mr; |
196 | unsigned n, m; | ||
193 | size_t off; | 197 | size_t off; |
194 | int ret; | 198 | int ret; |
195 | 199 | ||
@@ -207,20 +211,22 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, | |||
207 | } | 211 | } |
208 | 212 | ||
209 | off += mr->offset; | 213 | off += mr->offset; |
210 | sge->mr = mr; | 214 | m = 0; |
211 | sge->m = 0; | 215 | n = 0; |
212 | sge->n = 0; | 216 | while (off >= mr->map[m]->segs[n].length) { |
213 | while (off >= mr->map[sge->m]->segs[sge->n].length) { | 217 | off -= mr->map[m]->segs[n].length; |
214 | off -= mr->map[sge->m]->segs[sge->n].length; | 218 | n++; |
215 | sge->n++; | 219 | if (n >= IPATH_SEGSZ) { |
216 | if (sge->n >= IPATH_SEGSZ) { | 220 | m++; |
217 | sge->m++; | 221 | n = 0; |
218 | sge->n = 0; | ||
219 | } | 222 | } |
220 | } | 223 | } |
221 | sge->vaddr = mr->map[sge->m]->segs[sge->n].vaddr + off; | 224 | sge->mr = mr; |
222 | sge->length = mr->map[sge->m]->segs[sge->n].length - off; | 225 | sge->vaddr = mr->map[m]->segs[n].vaddr + off; |
226 | sge->length = mr->map[m]->segs[n].length - off; | ||
223 | sge->sge_length = len; | 227 | sge->sge_length = len; |
228 | sge->m = m; | ||
229 | sge->n = n; | ||
224 | ss->sg_list = NULL; | 230 | ss->sg_list = NULL; |
225 | ss->num_sge = 1; | 231 | ss->num_sge = 1; |
226 | 232 | ||