Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp436115imu; Wed, 19 Dec 2018 22:33:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYVLYIZ8IFxqoTulXY99s0C0mGpcSeAAGkw/YXeqL7XnST/FLFWzMvN8JAWgirhOgLKNvN X-Received: by 2002:a63:6984:: with SMTP id e126mr9192006pgc.143.1545287617594; Wed, 19 Dec 2018 22:33:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545287617; cv=none; d=google.com; s=arc-20160816; b=HuubfdmtVSibkN9pSU3XBhSWBHkBUidr8jRGTI0oQGMAiU1xtEPDOitm8c2mwmx7Ls d5OC80NblA/ZD7zsumnexBwjyMxuM/AjkF+Ou7csVk6PMgOJY/7CdWppmEq+f65LFzGf MZNCbrUy+FSnLHYcOc0Mz/zonGCVVtdGt4Zn5rUNcQczKYLCtOdW7lQeMFIiFli66eGe cCxhwL65sSpnIGa3mFcF8b/cxkLTqqEQOVEGHh3JgEaR9CYq1DTxJjn0WVbBXe8HBG0n ttgV3SkTBIzWHQNdxbgJYQHUnZN2qkXzM7ViCJYTglnuy6OIhrsBFn9cwjz14u4+del2 wyOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=z510oZ4H2HlNlli4S0Z88ACkKvJP/M/1mzJqx6+mFjE=; b=Co/WrjwqYlsLGTJZuDbctWt2osvGtsawq0xSw87x5Q1v2hXaP3mtjX192jXJP0PPq4 P00w0RD5kceh5p1s7tlqFllgm6jDZqWT9nAdJ5GaTqUn6c76lnzhYXtX76XZHgcCdQn4 NlgAB2O+r/0UCtn6Yo84xyKthfBJ2jeFu8f0e7a0JaEPmcXgM38qfO44NYyOl22HJmE+ nX6XJEoTdD9qMHdvh3Qwg573UtdhIu44NvvIQa9uq1m8ACgP4PtHUnwTCVQTxr4z8jBx klO4i7wFWBUm2GZS2MzRF+beXQPffinmxVKZ9HKrBwYp63Hrry9cRJo/Q/iizyHttS+Q lYMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si18309904pfe.63.2018.12.19.22.33.21; Wed, 19 Dec 2018 22:33:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729998AbeLTDQg (ORCPT + 99 others); Wed, 19 Dec 2018 22:16:36 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:16611 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729891AbeLTDQc (ORCPT ); Wed, 19 Dec 2018 22:16:32 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 36D4625310DD; Thu, 20 Dec 2018 11:16:28 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Thu, 20 Dec 2018 11:16:16 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 7/9] net: hns3: don't restore rules when flow director is disabled Date: Thu, 20 Dec 2018 11:52:04 +0800 Message-ID: <1545277926-66432-8-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1545277926-66432-1-git-send-email-lipeng321@huawei.com> References: <1545277926-66432-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen When user disables flow director, all the rules will be disabled. But when reset happens, it will restore all the rules again. It's not reasonable. This patch fixes it by add flow director status check before restore fules. Fixes: 6871af29b3ab ("net: hns3: Add reset handle for flow director") Fixes: c17852a8932f ("net: hns3: Add support for enable/disable flow director") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 9f89858..f7637c0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4808,6 +4808,10 @@ static int hclge_restore_fd_entries(struct hnae3_handle *handle) if (!hnae3_dev_fd_supported(hdev)) return 0; + /* if fd is disabled, should not restore it when reset */ + if (!hdev->fd_cfg.fd_en) + return 0; + hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { ret = hclge_config_action(hdev, HCLGE_FD_STAGE_1, rule); if (!ret) -- 1.9.1