crypto: hisilicon - fix to return sub-optimal device when best device has no qps
authorZhou Wang <wangzhou1@hisilicon.com>
Sat, 26 Oct 2019 03:00:16 +0000 (11:00 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Nov 2019 05:42:47 +0000 (13:42 +0800)
commit700f7d0d29c795c36517dcd3541e4432a76c2efc
treefd10d926f7904cf8446f7d2b0a5209ff49ae58dd
parentf0c8b6a1e1454f1645463e8ffb3e027fc597867c
crypto: hisilicon - fix to return sub-optimal device when best device has no qps

Currently find_zip_device() finds zip device which has the min NUMA
distance with current CPU.

This patch modifies find_zip_device to return sub-optimal device when best
device has no qps. This patch sorts all devices by NUMA distance, then
finds the best zip device which has free qp.

Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Shukun Tan <tanshukun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/qm.c
drivers/crypto/hisilicon/qm.h
drivers/crypto/hisilicon/zip/zip_main.c