From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F021BC433E0 for ; Wed, 17 Mar 2021 01:48:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3EBB64F8F for ; Wed, 17 Mar 2021 01:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbhCQBsI (ORCPT ); Tue, 16 Mar 2021 21:48:08 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3468 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhCQBrs (ORCPT ); Tue, 16 Mar 2021 21:47:48 -0400 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4F0Y006lB7z5dHZ; Wed, 17 Mar 2021 09:45:52 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.498.0; Wed, 17 Mar 2021 09:47:45 +0800 Received: from [127.0.0.1] (10.69.26.252) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Wed, 17 Mar 2021 09:47:45 +0800 Subject: Re: [PATCH net-next 5/9] net: hns3: refactor flow director configuration To: Jakub Kicinski CC: , , , , , , , Jian Shen References: <1615811031-55209-1-git-send-email-tanhuazhong@huawei.com> <1615811031-55209-6-git-send-email-tanhuazhong@huawei.com> <20210315130027.669b8afa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Huazhong Tan Message-ID: Date: Wed, 17 Mar 2021 09:47:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20210315130027.669b8afa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.69.26.252] X-ClientProxiedBy: dggeme704-chm.china.huawei.com (10.1.199.100) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2021/3/16 4:00, Jakub Kicinski wrote: > On Mon, 15 Mar 2021 20:23:47 +0800 Huazhong Tan wrote: >> From: Jian Shen >> >> 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 >> Signed-off-by: Huazhong Tan > How is the application supposed to know if the ethtool rule was already > installed or installation is still pending? Yes, it's unable for the application to know whether pending or installed. The primitive motivation is to move out the aRFS rule configuration from IO path. To keep consistent, so does the ethtool way. We thought of it before, considered that the time window between the two state is very small. How about keep aRFS asynchronously, and the ethtool synchronously? > 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. > > .