Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fedd9e1f authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Doug Ledford
Browse files

IB/cq: Don't process more than the given budget



The caller might not want this overhead.

Reviewed-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 9fcd67d1
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,13 @@ static int __ib_process_cq(struct ib_cq *cq, int budget)
{
{
	int i, n, completed = 0;
	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++) {
		for (i = 0; i < n; i++) {
			struct ib_wc *wc = &cq->wc[i];
			struct ib_wc *wc = &cq->wc[i];