From: Weili Qian qianweili@huawei.com
If the CQE status is not updated during packet receiving, the hardware has not processed the packet. In this case, 0 can be returned without checking the hardware status. If a fault occurs, the hardware status will be checked when the user attempts to receive packets next time.
Signed-off-by: Weili Qian qianweili@huawei.com --- v1/drv/hisi_qm_udrv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/v1/drv/hisi_qm_udrv.c b/v1/drv/hisi_qm_udrv.c index ea4b1991..731492b5 100644 --- a/v1/drv/hisi_qm_udrv.c +++ b/v1/drv/hisi_qm_udrv.c @@ -727,8 +727,12 @@ int qm_recv(struct wd_queue *q, void **resp, __u32 num) } }
- if (i) + if (i) { qm_rx_update(info, i); + } else { + wd_unspinlock(&info->rc_lock); + return 0; + }
wd_unspinlock(&info->rc_lock); ret = check_ds_rx_base(info, resp, num, 0);