• Jian Shen's avatar
    net: hns3: refactor flow director configuration · fc4243b8
    Jian Shen authored
    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: default avatarJian Shen <shenjian15@huawei.com>
    Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fc4243b8
hclge_main.c 327 KB