OSDN Git Service

net: hns3: refactor flow director configuration
authorJian Shen <shenjian15@huawei.com>
Mon, 22 Mar 2021 03:52:00 +0000 (11:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Mar 2021 20:04:18 +0000 (13:04 -0700)
commitfc4243b8de8b4e7170f07f2660dcab3f8ecda0e9
tree51dc5dfa7d5720d1d55361ddc2965b9411cf3d44
parentae4811913f576d3a891e2ca8a3ad11746f644c69
net: hns3: refactor flow director configuration

Currently, the flow director rule of aRFS is configured in
the IO path. It's time-consuming. So move out the configuration,
and configure it asynchronously. And keep ethtool and tc flower
rule using synchronous way, otherwise the application maybe
unable to know the rule is installed or pending.

Add a state member for each flow director rule to indicate the
rule state. There are 4 states:
TO_ADD: the rule is waiting to add to hardware
TO_DEL: the rule is waiting to remove from hardware
DELETED: the rule has been removed from hardware. It's a middle
        state, used to remove the rule node in the fd_rule_list.
ACTIVE: the rule is already added in hardware

For asynchronous way, when receive a new request to add or delete
flow director rule by aRFS, update the rule list, then request to
schedule the service task to finish the configuration.

For synchronous way, when receive a new request to add or delete
flow director rule by ethtool or tc flower, configure hardware
directly, then update the rule list if success.

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