IB/mlx4: Fix incorrect cq flushing in error state
authorAriel Nahum <arieln@mellanox.com>
Sun, 9 Aug 2015 08:16:27 +0000 (11:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:26:18 +0000 (19:26 +0200)
commit6a85820d32b8f908e2dd41b75977fb77768118c2
treef113ad8c9711882af02b53f2a30c4fc68ba7cd56
parentc6632eb0bba08cb911f19ef3a96ff7df346c80ae
IB/mlx4: Fix incorrect cq flushing in error state

commit 799cdaf8a98f13d4fba3162e21e1e63f21045010 upstream.

When handling a device internal error, the driver is responsible to
drain the completion queue with flush errors.

In case a completion queue was assigned to multiple send queues, the
driver iterates over the send queues and generates flush errors of
inflight wqes. The driver must correctly pass the wc array with an
offset as a result of the previous send queue iteration. Not doing so
will overwrite previously set completions and return a wrong number
of polled completions which includes ones which were not correctly set.

Fixes: 35f05dabf95a (IB/mlx4: Reset flow support for IB kernel ULPs)
Signed-off-by: Ariel Nahum <arieln@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Cc: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx4/cq.c