On Mon, 15 Mar 2021 20:23:47 +0800 Huazhong Tan wrote:
From: Jian Shen shenjian15@huawei.com
Currently, there are 3 flow director work modes in HNS3 driver, include EP(ethtool), tc flower and aRFS. The flow director rules are configured synchronously and need holding spin lock. With this limitation, all the commands with firmware are also needed to use spin lock.
To eliminate the limitation, configure flow director rules asynchronously. The rules are still kept in the fd_rule_list with below states. TO_ADD: the rule is waiting to add to hardware TO_DEL: the rule is waiting to remove from hardware ADDING: the rule is adding to hardware ACTIVE: the rule is already added in hardware
When receive a new request to add or delete flow director rule, check whether the rule location is existent, update the rule content and state, and request to schedule the service task to finish the configuration.
Signed-off-by: Jian Shen shenjian15@huawei.com Signed-off-by: Huazhong Tan tanhuazhong@huawei.com
How is the application supposed to know if the ethtool rule was already installed or installation is still pending?
With the firmware bloat on all devices this sort of async mechanism seems to be popping up in more and more drivers but IMHO we shouldn't weaken the semantics without amending the kernel <> user space API.