]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:41 +0000 (09:58 +0200)
commitfa5fc634790e269899082c5be981ffd3cf845663
tree9950f6c57220d02437a49495899cc387e7bb3329
parent9bbbf4c214f55d58e7fb331a89fba29b64e4fe23
net: hns3: fix aRFS FD rules leftover after add a user FD rule

[ Upstream commit efe3fa45f770f1d66e2734ee7a3523c75694ff04 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c