From patchwork Fri Oct 27 06:09:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 133475 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7A5E43212; Fri, 27 Oct 2023 08:14:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F41B42670; Fri, 27 Oct 2023 08:13:59 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id BB0664029A for ; Fri, 27 Oct 2023 08:13:52 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SGshC47LJzPngv for ; Fri, 27 Oct 2023 14:09:47 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 27 Oct 2023 14:13:50 +0800 From: Jie Hai To: , Yisen Zhuang , Anatoly Burakov , Chengwen Feng , Dongdong Liu CC: , Subject: [PATCH 5/8] net/hns3: remove reset log in secondary Date: Fri, 27 Oct 2023 14:09:43 +0800 Message-ID: <20231027060947.3183983-6-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231027060947.3183983-1-haijie1@huawei.com> References: <20231027060947.3183983-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Dengdui Huang The reset event is checked and done in primary. And the secondary doesn't check and display reset log. There is a patch to remove the check code for secondary. please see commit a8f1f7cf1b42 ("net/hns3: fix crash when secondary process access FW") This patch removes the redundant log print of reset. Fixes: a8f1f7cf1b42 ("net/hns3: fix crash when secondary process access FW") Cc: stable@dpdk.org Signed-off-by: Dengdui Huang --- drivers/net/hns3/hns3_ethdev.c | 11 +++++------ drivers/net/hns3/hns3_ethdev_vf.c | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 964f47f1641e..3bdce1fa4b48 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5512,14 +5512,13 @@ hns3_is_reset_pending(struct hns3_adapter *hns) enum hns3_reset_level reset; /* - * Check the registers to confirm whether there is reset pending. - * Note: This check may lead to schedule reset task, but only primary - * process can process the reset event. Therefore, limit the - * checking under only primary process. + * Only primary can process can process the reset event, + * so don't check reset event in secondary. */ - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - hns3_check_event_cause(hns, NULL); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return false; + hns3_check_event_cause(hns, NULL); reset = hns3_get_reset_level(hns, &hw->reset.pending); if (reset != HNS3_NONE_RESET && hw->reset.level != HNS3_NONE_RESET && hw->reset.level < reset) { diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 007f5d619fbf..5f3422d14e8a 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1715,14 +1715,13 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns) return false; /* - * Check the registers to confirm whether there is reset pending. - * Note: This check may lead to schedule reset task, but only primary - * process can process the reset event. Therefore, limit the - * checking under only primary process. + * Only primary can process can process the reset event, + * so don't check reset event in secondary. */ - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - hns3vf_check_event_cause(hns, NULL); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return false; + hns3vf_check_event_cause(hns, NULL); reset = hns3vf_get_reset_level(hw, &hw->reset.pending); if (hw->reset.level != HNS3_NONE_RESET && reset != HNS3_NONE_RESET && hw->reset.level < reset) {