]> git.droids-corp.org - dpdk.git/commit
dma/hisilicon: enhance CQ scan robustness
authorChengwen Feng <fengchengwen@huawei.com>
Fri, 27 May 2022 03:40:54 +0000 (11:40 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Jun 2022 10:40:25 +0000 (12:40 +0200)
commite03c601acb4d483a7305fb9ad15e13f6645b02e2
treeabf3941c5ccc7f85542567adf5dc953e811e2dcc
parentf25265f004aa6e7c3cb8658c9e5edf3c73ee802f
dma/hisilicon: enhance CQ scan robustness

The CQ (completion queue) descriptors were updated by hardware, and then
scanned by driver to retrieve hardware completion status.

This patch enhances robustness by following:
1. replace while (true) with a finite loop to avoid potential dead loop.
2. check the csq_head field in CQ descriptor to avoid status array
overflows.

Fixes: 2db4f0b82360 ("dma/hisilicon: add data path")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
drivers/dma/hisilicon/hisi_dmadev.c