Skip to content

Commit

Permalink
IB/ipath: Fix count of packets received by kernel
Browse files Browse the repository at this point in the history
The loop in ipath_kreceive() that processes packets increments the
loop-index 'i' once too often, because the exit condition does not
depend on it, and is checked after the increment. By adding a check for
!last to the iterator in the for loop, we correct that in a way that is
not so likely to be re-broken by changes in the loop body.

Signed-off-by: Michael Albaugh <micheal.albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael Albaugh authored and Roland Dreier committed May 7, 2008
1 parent 2bfc8e9 commit 2889d1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ void ipath_kreceive(struct ipath_portdata *pd)
}

reloop:
for (last = 0, i = 1; !last; i++) {
for (last = 0, i = 1; !last; i += !last) {
hdr = dd->ipath_f_get_msgheader(dd, rhf_addr);
eflags = ipath_hdrget_err_flags(rhf_addr);
etype = ipath_hdrget_rcv_type(rhf_addr);
Expand Down

0 comments on commit 2889d1e

Please sign in to comment.