From nobody Sat Nov 30 00:41:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y0WSq0KcLz5fxhr; Sat, 30 Nov 2024 00:41:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y0WSp6tbqz4Lcy; Sat, 30 Nov 2024 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732927291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eePSRMyweDSImhhGzsAh0/VTFxjQy7Yofe4mGpaky4=; b=Mjh7dmzyrQulDNVhDem0SC/jlwc07hN+dCk4RNKIhVa6hPmCHpPvuinKbZ12y3bSPco+Vp i4JxF37XihlqbO+9Afk98DyHs7dl/FgIfQI+JYA2CCJCaNL+bW2Jvfv+ZWBx1UYJ+VVJN/ 65RTnuYGMPMx+jhgEAkn9lMrIXq649Kv0Wn57QGe5bQXF2N6QB9aZhiK7ketH07G/BOoQG apekYRajrlFZDjKnwNsuk+AQcNF1RL0l//5llJJQWKx9jkhghDqoSXKr3n3bDgTSSDLdrV MqvXkurepl20cW/gexi9jeuCF4+KrW0JsY9xG9a/cVbSwg9xF7TQ05ZjsaBXXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732927291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5eePSRMyweDSImhhGzsAh0/VTFxjQy7Yofe4mGpaky4=; b=G9hdV0a1wBCoalGeqiuIvADDTrkeFL+dJailjEFHjQzhAkzW/P4PO4HN6m14DDmjejZXhP KrW0tqUlCvNr9VwVGv29k4DQ0M6r5kb1dvW3+fF8BGtFfBVr9xGy+VeSDfb4VYH3W7ps2H Fa6FeNfI3iORum9jQK7BZJnPD1sB9IkxOyqNck6gPUTalJwRxPc49isk2j1me0IEglpUft gRu7GX9TGVDnBcKeYnfSMPnBRTwLkgY+FL22CWiDHiIh5FcAJs7RANujyC5GizIZZhqQAE ILznouiENweCW3eMSFv81lEw7sNeChgmlAGewkw4uLUw3hTZ7emT5f9nX4rXPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732927291; a=rsa-sha256; cv=none; b=T59h/l53adMQUuF+LbMyb1XxUur3YV7pQmzLgsgkUtSsU3mS1fLE/C380VRVkI57VthDfv 1qqkDobGG5wvobLKFYlk2o1bOPzHH8uoI3ZRpBkaIKCZqrSWdze4SoLYB3JcygI9mSE3Ai 2ghFbz79AFd7VVEPC15cIHxwP3DHVhk1M2t0OElKN09ozsKz3PjqgCpe+t76xnrR4Yur71 1c8SpcHwgKcLkZwB8+F6UXh3pnhmu47NkRz8wo3i77zUm/6LP2BHWiJXsI8iUHRFlPyagb UqPETr5YczpTvLOkLWwsKtkSIHW0h14LcyZjGsYZxbsey3L1auMYAXYafjNavw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y0WSp6TpMzm5v; Sat, 30 Nov 2024 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AU0fUQn038892; Sat, 30 Nov 2024 00:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AU0fUjs038889; Sat, 30 Nov 2024 00:41:30 GMT (envelope-from git) Date: Sat, 30 Nov 2024 00:41:30 GMT Message-Id: <202411300041.4AU0fUjs038889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b0b932804bf6 - stable/14 - mlx5: Fix handling of port_module_event List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b0b932804bf6022646067e66ce45df7f2f51f3ab Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b932804bf6022646067e66ce45df7f2f51f3ab commit b0b932804bf6022646067e66ce45df7f2f51f3ab Author: Ariel Ehrenberg AuthorDate: 2024-10-31 09:18:26 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-30 00:34:54 +0000 mlx5: Fix handling of port_module_event (cherry picked from commit 253a1fa16b98ac5f73f0820cfdd4f5ad7378757a) --- sys/dev/mlx5/driver.h | 3 ++- sys/dev/mlx5/mlx5_core/mlx5_eq.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 6ebe4171a503..e1c71b8baa1a 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -721,7 +721,8 @@ struct mlx5_core_dev { u32 vsc_addr; u32 issi; struct mlx5_special_contexts special_contexts; - unsigned int module_status[MLX5_MAX_PORTS]; + unsigned int module_status; + unsigned int module_num; struct mlx5_flow_root_namespace *root_ns; struct mlx5_flow_root_namespace *fdb_root_ns; struct mlx5_flow_root_namespace *esw_egress_root_ns; diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eq.c b/sys/dev/mlx5/mlx5_core/mlx5_eq.c index 2d5b53b6482a..e7f282ea576b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eq.c @@ -679,9 +679,9 @@ static const char *mlx5_port_module_event_error_type_to_string(u8 error_type) unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num) { - if (module_num < 0 || module_num >= MLX5_MAX_PORTS) - return 0; /* undefined */ - return dev->module_status[module_num]; + if (module_num != dev->module_num) + return 0; /* module num doesn't equal to what FW reported */ + return dev->module_status; } static void mlx5_port_module_event(struct mlx5_core_dev *dev, @@ -729,8 +729,8 @@ static void mlx5_port_module_event(struct mlx5_core_dev *dev, "Module %u, unknown status %d\n", module_num, module_status); } /* store module status */ - if (module_num < MLX5_MAX_PORTS) - dev->module_status[module_num] = module_status; + dev->module_status = module_status; + dev->module_num = module_num; } static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev,