Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2756894imj; Mon, 11 Feb 2019 08:02:32 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibm93RHe+z0Hs67wr6h648pU4AwzsPy52WDNmKT8kzqnX15WrJ4aObO89ux0beyyvvahhYD X-Received: by 2002:a63:4c04:: with SMTP id z4mr29536665pga.312.1549900952832; Mon, 11 Feb 2019 08:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900952; cv=none; d=google.com; s=arc-20160816; b=E9+XPO7BjTX84msP4vlqZaCVFawydrUkFcnDOivENZovEO3dAYOKDIfBxLoz5QJ6OA 1dKCFk+DvYjVMr+Kv9ir3xNmtYlYfL400fpqQMpHLNKY6OnRkz1gJp4lHzDJyuGU+Hb9 h2TAGkKpQNEKj1qbwGKx8ECOFESbGywhCSux2rGDokCYuN8teS6ezrv56jK2OuV8EIbF zm/bgsHHgQJhYErtx0jSQrugmD2VluSdEsBdz4f26DzqDclq8n4YyE2o3LpmNted4tkW YW9KgY5gMx9kFolIt+MwubbHG/IP/kNohOTetmHPzYjYAYapOvxYnDa4fL85BN2vBeQg CmNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QNYu6Up3dT/v+7t2VKDsQnEbojG3FO+tvmn4WUYs3sU=; b=uWDKm2NIt7rong0Z4Xe7yx666qvFNxfUTfwMxqk/sli/IY/VK01sskscDlbQqrq0px TQHWTKWmvvkIHq4uZAt814yJD63ImnP0EgExPgoYtQ+QkxjWYe9Inz59woHFRyHTiTmf 8crO0NKPvlon9GBe7HJFOEVID2bW4GKkubLiVXd2g+ZjfURmERUctj29HdPiZ7YMgRWo Qb1a3LOlWBMP6BLs7z/qPacgC84SmVPlKfuaEku+nsxidaekCJhWH7svo02U47ryru5R rUu6a3F70SzPaabSg4xo3jv8iZefNiBV/7URU5SrbAeS0ndPZY0sQoW3/tueWW05E7R2 2fNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GLU9BVnq; 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 e6si8038189pgk.201.2019.02.11.08.02.13; Mon, 11 Feb 2019 08:02:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=GLU9BVnq; 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 S1730588AbfBKQBO (ORCPT + 99 others); Mon, 11 Feb 2019 11:01:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:38208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729406AbfBKObW (ORCPT ); Mon, 11 Feb 2019 09:31:22 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F84E20675; Mon, 11 Feb 2019 14:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895481; bh=DMHHeTkG7GrR1RpS7kdsqd43WM2x5UA9fEa1G8kQjDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLU9BVnqEppeDvYNE/UaCo/3Wl2bU1hAzMDNaAkg16pMRGxb6EOP6B2CzmUWZYvjD ZjWx4YekXu3Ij/pG+SD5pafQb1pZQea6jREu5Goow0bJkNiAX9IITqukZIyQd7II7t VTE+uV38zKnHkcJn8Oyu/pgQGbnhy7G0UBGJH/xM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Peng Li , "David S. Miller" , Sasha Levin Subject: [PATCH 4.20 220/352] net: hns3: dont restore rules when flow director is disabled Date: Mon, 11 Feb 2019 15:17:27 +0100 Message-Id: <20190211141901.231893264@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 8edc2285b7285c5fbffe438dc8113260d3e76656 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 ffdd96020860..a7895aefe291 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4339,6 +4339,10 @@ static int hclge_restore_fd_entries(struct hnae3_handle *handle) if (!hnae3_dev_fd_supported(hdev)) return -EOPNOTSUPP; + /* 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) -- 2.19.1