net/hns3: fix configure FEC when concurrent with reset
authorChengchang Tang <tangchengchang@huawei.com>
Sat, 10 Apr 2021 01:11:20 +0000 (09:11 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 13 Apr 2021 09:13:41 +0000 (11:13 +0200)
commit6d360284dffe51f852fc373058bfb274b9b8982c
tree6ba307490e2a04cc391e8742da57155b8f7525f7
parent18da3c854bb8105818dc23c36eecf3465596052a
net/hns3: fix configure FEC when concurrent with reset

Currently, after the reset is complete, the PMD restores the FEC
according to the FEC configuration reserved in the driver. If there is a
concurrency between the FEC setup operation and the restore operation
after a reset, the FEC status of the last hardware may be unknown.

This patch adds the step of obtaining the lock when setting the FEC to
avoid concurrency between restore operation and setting operation.

Fixes: 9bf2ea8dbc65 ("net/hns3: support FEC")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/hns3/hns3_ethdev.c