projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9fcd67d
)
IB/cq: Don't process more than the given budget
author
Sagi Grimberg
<
[email protected]
>
Thu, 16 Mar 2017 16:57:00 +0000
(18:57 +0200)
committer
Doug Ledford
<
[email protected]
>
Sat, 25 Mar 2017 02:19:48 +0000
(22:19 -0400)
The caller might not want this overhead.
Reviewed-by: Bart Van Assche <
[email protected]
>
Reviewed-by: Leon Romanovsky <
[email protected]
>
Signed-off-by: Sagi Grimberg <
[email protected]
>
Reviewed-by: Yuval Shaia <
[email protected]
>
Signed-off-by: Doug Ledford <
[email protected]
>
drivers/infiniband/core/cq.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/core/cq.c
b/drivers/infiniband/core/cq.c
index 2746d2eb3d52c4036518b26e2b22038de80bd788..f2ae75fa3128b9101985bb92e882b596404c7ebc 100644
(file)
--- a/
drivers/infiniband/core/cq.c
+++ b/
drivers/infiniband/core/cq.c
@@
-29,7
+29,13
@@
static int __ib_process_cq(struct ib_cq *cq, int budget)
{
int i, n, completed = 0;
- while ((n = ib_poll_cq(cq, IB_POLL_BATCH, cq->wc)) > 0) {
+ /*
+ * budget might be (-1) if the caller does not
+ * want to bound this call, thus we need unsigned
+ * minimum here.
+ */
+ while ((n = ib_poll_cq(cq, min_t(u32, IB_POLL_BATCH,
+ budget - completed), cq->wc)) > 0) {
for (i = 0; i < n; i++) {
struct ib_wc *wc = &cq->wc[i];