net: hns3: fix aRFS FD rules leftover after add a user FD rule
authorGuojia Liao <liaoguojia@huawei.com>
Tue, 28 Jul 2020 02:16:51 +0000 (10:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jul 2020 19:54:48 +0000 (12:54 -0700)
commitefe3fa45f770f1d66e2734ee7a3523c75694ff04
tree03ba46cb148b75967bbaee4e32a55dbb0b5f6453
parenta6f7bfdc78ddd8d719d108fef973b4e4a5a6ac6b
net: hns3: fix aRFS FD rules leftover after add a user FD rule

When user had created a FD rule, all the aRFS rules should be clear up.
HNS3 process flow as below:
1.get spin lock of fd_ruls_list
2.clear up all aRFS rules
3.release lock
4.get spin lock of fd_ruls_list
5.creat a rules
6.release lock;

There is a short period of time between step 3 and step 4, which would
creatting some new aRFS FD rules if driver was receiving packet.
So refactor the fd_rule_lock to fix it.

Fixes: 441228875706 ("net: hns3: refine the flow director handle")
Signed-off-by: Guojia Liao <liaoguojia@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