RDMA/cxgb4: Don't hang threads forever waiting on WR replies
In c4iw_wait_for_reply(), if a FW6_MSG WR reply is not received after C4IW_WR_TO seconds, fail the WR operation and mark the device as fatally dead. Further, if the device is marked fatally dead, then fail the WR wait immediately. Also change the timeout to 60 seconds. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
Родитель
c62e689631
Коммит
1fc8190dd6
|
@ -196,7 +196,7 @@ static inline int c4iw_num_stags(struct c4iw_rdev *rdev)
|
||||||
return (int)(rdev->lldi.vr->stag.size >> 5);
|
return (int)(rdev->lldi.vr->stag.size >> 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define C4IW_WR_TO (30*HZ)
|
#define C4IW_WR_TO (60*HZ)
|
||||||
|
|
||||||
struct c4iw_wr_wait {
|
struct c4iw_wr_wait {
|
||||||
struct completion completion;
|
struct completion completion;
|
||||||
|
@ -220,22 +220,21 @@ static inline int c4iw_wait_for_reply(struct c4iw_rdev *rdev,
|
||||||
u32 hwtid, u32 qpid,
|
u32 hwtid, u32 qpid,
|
||||||
const char *func)
|
const char *func)
|
||||||
{
|
{
|
||||||
unsigned to = C4IW_WR_TO;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
do {
|
|
||||||
ret = wait_for_completion_timeout(&wr_waitp->completion, to);
|
|
||||||
if (!ret) {
|
|
||||||
printk(KERN_ERR MOD "%s - Device %s not responding - "
|
|
||||||
"tid %u qpid %u\n", func,
|
|
||||||
pci_name(rdev->lldi.pdev), hwtid, qpid);
|
|
||||||
if (c4iw_fatal_error(rdev)) {
|
if (c4iw_fatal_error(rdev)) {
|
||||||
wr_waitp->ret = -EIO;
|
wr_waitp->ret = -EIO;
|
||||||
break;
|
goto out;
|
||||||
}
|
}
|
||||||
to = to << 2;
|
|
||||||
|
ret = wait_for_completion_timeout(&wr_waitp->completion, C4IW_WR_TO);
|
||||||
|
if (!ret) {
|
||||||
|
PDBG("%s - Device %s not responding (disabling device) - tid %u qpid %u\n",
|
||||||
|
func, pci_name(rdev->lldi.pdev), hwtid, qpid);
|
||||||
|
rdev->flags |= T4_FATAL_ERROR;
|
||||||
|
wr_waitp->ret = -EIO;
|
||||||
}
|
}
|
||||||
} while (!ret);
|
out:
|
||||||
if (wr_waitp->ret)
|
if (wr_waitp->ret)
|
||||||
PDBG("%s: FW reply %d tid %u qpid %u\n",
|
PDBG("%s: FW reply %d tid %u qpid %u\n",
|
||||||
pci_name(rdev->lldi.pdev), wr_waitp->ret, hwtid, qpid);
|
pci_name(rdev->lldi.pdev), wr_waitp->ret, hwtid, qpid);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче