From nobody Mon Feb 9 06:31:07 2026 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A523235050; Wed, 30 Apr 2025 09:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746005913; cv=none; b=FXmQs0sGFDeGwNVlvEkA03sARQNbwvK67SjYCl16/sUVg7ZzG5xAC6hKQOTOb57tlypsB7Hl5yJacRD+walJFUug6BVYCl5/OHdkmx8EmEIAbA125ACq8BS4mCBH4TwoZ65i1v+2NW7OI8oijqmTsTnv8SvW5aq/22AGlaP4McM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746005913; c=relaxed/simple; bh=zf60cnGWJmyto7hJniS3i37W9CD8mvZyR+D1yMUdzGM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ik2sh5eNPFQaddtxJ8C7aJv2CpbyHmvEvQQd63XIN21hDWOi1jGZzliuFV9TBzYG5qRKf0TP10O9vUmMvCe69JWyXghyZHDfptoFfYS//HNzaTFZBbaP4QjOYh8Vj/dv1KDv6Jj7X0A6TqNRCffuIYxzU/R4uMAm/dh4xwQSwME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4ZnXFY1MQ9z27hbP; Wed, 30 Apr 2025 17:39:13 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 9899A1400DA; Wed, 30 Apr 2025 17:38:28 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 30 Apr 2025 17:38:27 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , , , Subject: [PATCH net 1/2] net: hibmcge: fix incorrect statistics update issue Date: Wed, 30 Apr 2025 17:31:26 +0800 Message-ID: <20250430093127.2400813-2-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20250430093127.2400813-1-shaojijie@huawei.com> References: <20250430093127.2400813-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemk100013.china.huawei.com (7.202.194.61) Content-Type: text/plain; charset="utf-8" When the user dumps statistics, the hibmcge driver automatically updates all statistics. If the driver is performing the reset operation, the error data of 0xFFFFFFFF is updated. Therefore, if the driver is resetting, the hbg_update_stats_by_info() needs to return directly. Fixes: c0bf9bf31e79 ("net: hibmcge: Add support for dump statistics") Signed-off-by: Jijie Shao --- drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c b/drivers= /net/ethernet/hisilicon/hibmcge/hbg_ethtool.c index 8f1107b85fbb..55520053270a 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_ethtool.c @@ -317,6 +317,9 @@ static void hbg_update_stats_by_info(struct hbg_priv *p= riv, const struct hbg_ethtool_stats *stats; u32 i; =20 + if (test_bit(HBG_NIC_STATE_RESETTING, &priv->state)) + return; + for (i =3D 0; i < info_len; i++) { stats =3D &info[i]; if (!stats->reg) --=20 2.33.0 From nobody Mon Feb 9 06:31:07 2026 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A5AE235055; Wed, 30 Apr 2025 09:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746005912; cv=none; b=Ue9uYRDYVcCu/1TLz03VrcWBJuWcWILXodJAIRM5WqFrIr73C6nwnWrDWXmEj8y36Jx0ubGcOIXpA/qwUMZX5djQNdXabVTKYxrgKuTEHo591i3ZVL57J8nvba52MtSI+KqERO5PBiwLiaCNTigmYzhmFjV57aiZrFurdYIAPrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746005912; c=relaxed/simple; bh=j9Rn5hX6mv7spf3KVf2Y3X9LbA0hK8RNFXlA259jL6k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mjyke7HTF8b3Djja4t2Q8e1AkFVeEbPYdzvtQspSQHaLt7JyGrDFPZQESKLBdYWoKNXXbncUmoHqZsrrIX1wMmwdYRWjsGRaCnNgEd01xl0VLpF2oyQ8NTfzqGZ+FSuiwoA8MzXnmdIB/u8dGGk3N5N/Sgne2RyvYACUIyE6oX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4ZnXCP0tDlz13L8J; Wed, 30 Apr 2025 17:37:21 +0800 (CST) Received: from kwepemk100013.china.huawei.com (unknown [7.202.194.61]) by mail.maildlp.com (Postfix) with ESMTPS id 2C04F1401F4; Wed, 30 Apr 2025 17:38:29 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by kwepemk100013.china.huawei.com (7.202.194.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 30 Apr 2025 17:38:28 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , , , Subject: [PATCH net 2/2] net: hibmcge: fix wrong ndo.open() after reset fail issue. Date: Wed, 30 Apr 2025 17:31:27 +0800 Message-ID: <20250430093127.2400813-3-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20250430093127.2400813-1-shaojijie@huawei.com> References: <20250430093127.2400813-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemk100013.china.huawei.com (7.202.194.61) Content-Type: text/plain; charset="utf-8" If the driver reset fails, it may not work properly. Therefore, the ndo.open() operation should be rejected. In this patch, if a reset failure is detected in ndo.open(), return directly. Fixes: 3f5a61f6d504 ("net: hibmcge: Add reset supported in this module") Signed-off-by: Jijie Shao --- drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/drivers/ne= t/ethernet/hisilicon/hibmcge/hbg_main.c index 2e64dc1ab355..6c98f906bf0d 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c @@ -35,6 +35,9 @@ static int hbg_net_open(struct net_device *netdev) struct hbg_priv *priv =3D netdev_priv(netdev); int ret; =20 + if (test_bit(HBG_NIC_STATE_RESET_FAIL, &priv->state)) + return -EBUSY; + ret =3D hbg_txrx_init(priv); if (ret) return ret; --=20 2.33.0