net: hns3: use mutex vport_lock instead of mutex umv_lock
authorJian Shen <shenjian15@huawei.com>
Fri, 24 Apr 2020 02:23:12 +0000 (10:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Apr 2020 03:29:44 +0000 (20:29 -0700)
commit7d0b345156d0678fbbbf885f991c6d83f23d70f1
tree9d4304cb3ae1c88ced63cc1bba0ad7c5b678fc2b
parentc631c696823cdddbf3c683c3b78812ecba31c350
net: hns3: use mutex vport_lock instead of mutex umv_lock

Currently, the driver use mutex umv_lock to protect the variable
vport->share_umv_size. And there is already a mutex vport_lock
being defined in the driver, which is designed to protect the
resource of vport. So we can use vport_lock instead of umv_lock.

Furthermore, there is a time window for protect share_umv_size
between checking UMV space and doing MAC configuration in the
lin function hclge_add_uc_addr_common(). It should be extended.

This patch uses mutex vport_lock intead of spin lock umv_lock to
protect share_umv_size, and adjusts the mutex's range.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h