From nobody Sun Dec 03 08:22:37 2023 X-Original-To: dev-commits-src-main@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 4SjftP4F96z52XGb; Sun, 3 Dec 2023 08:22:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SjftP3QxNz3Pnh; Sun, 3 Dec 2023 08:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701591757; 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=1mbebAKQ/9Pc/iH87GuXwHZXtqwi9foGUDAXzFGPLHk=; b=rXJGSH7UycVTg/ElsMaUjjD0fkmoc8TtOo856Fub8Ykgja7VQOT2z9qRb8jn7eC8CRbali 0PysEprVJ8EX4U5mRqzzohV23RiJJLef08fGzxmMWqd5vP48lHLyVjzCqpji653RcCd6O5 rpZko71geqy10PoBrDb6Um/4PJT9bLCVb1pbgRZBp6H0UX19XskucDuF4Rd1uHLsI9RsLd uReMoc31Y9wWdb3acDPDgV8L9+TbRD1YQmJvZ4VarPZKD77O4qhT1UBWCpdvCxPcwW+RDX vps9Ox6MfX8B605hbllBCUCQ7LD2yDxpOp1rshITFMpl8GeGwdFZyKFK7iktww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701591757; 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=1mbebAKQ/9Pc/iH87GuXwHZXtqwi9foGUDAXzFGPLHk=; b=CgzU7u7rKaSZszIAkwBMKH/r55hdWfadhHqPA6qWzNk107m5ZiWP/ngmsNLAt0b85rsaf+ UsIMJXimocNTKrK4aiBhHdYhJzS7TEL7R9LojOWcNUjcBjVKDzzmStIoP8ah4b8ZZCehCm 9FUWA/k0hvdZG7AqWtNoxhIjB0AtFBnoQqwfq48MeDeMdrpvkNRhhbFhD+1LAXmf0zj0xy w6uJfZB5M+SJp9NZioOe1LzrYeKO3Qhih+MdShs5d7uCdjfB0Y7rHtOppbZLfjBC2oSZLT n6rPZw+uTdh0RApanog6IQOMddcfqEdIdLpsp7KWpEnyxcwPipDJv+E8g8iGnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701591757; a=rsa-sha256; cv=none; b=CVNtbEvkDrzKwIbirJ5EUvdstu5GLSu1eJayaTG9n4bvlabzkYvyH+gZWiT489bP4LRUUu be+Furl0p6GzhoClI5raEnq3PNqSjYzZtV0rQvwAN3IXlXiVoGmhKCsY3nulszYPQroJvv yf5pb6wFmqlxi+40+GXV753teHI8EpxRdSnIrM2e0IxO6nZdeymBXLNRjxsHlJgxOKbb5B 1vPw/gv+BJCHNoWtfGcwawbQpqYsBZGt0x3wwbD2wf0FGQft8hUqnztdqgqL5VBwOrn6ry h7GamXBak81pQ9xGA/5/WIdfXuxUXp9VCH4lQE+KKatZ3+FQHz7TfKkbWWzYEA== 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 4SjftP2TvvzrYY; Sun, 3 Dec 2023 08:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B38MboU085783; Sun, 3 Dec 2023 08:22:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B38MbDQ085780; Sun, 3 Dec 2023 08:22:37 GMT (envelope-from git) Date: Sun, 3 Dec 2023 08:22:37 GMT Message-Id: <202312030822.3B38MbDQ085780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0cd90ee598ce - main - mlx5: Fix HCA cap 2 query List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0cd90ee598cef68cef72db8b912241868d1067d0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd90ee598cef68cef72db8b912241868d1067d0 commit 0cd90ee598cef68cef72db8b912241868d1067d0 Author: Patrisious Haddad AuthorDate: 2023-05-11 09:48:26 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-03 08:21:44 +0000 mlx5: Fix HCA cap 2 query Previously we were trying to set hca_cap_2 without checking if sw_vhca_id_valid max value, which is the only settable value inside hca_cap_2, and seeing that we dont have driver support for sw_vhca_id yet there is no need to set hca_cap_2 at all, it is enough to query it. Fixes: 7b959396ca6fae5635260131eedb9bc19f2726a3 ("mlx5: Introduce new destination type TABLE_TYPE") MFC after: 3 days --- sys/dev/mlx5/mlx5_core/mlx5_main.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index efaf726e19e5..f6dc1158f085 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -561,39 +561,15 @@ static int handle_hca_cap_atomic(struct mlx5_core_dev *dev) static int handle_hca_cap_2(struct mlx5_core_dev *dev) { - void *set_ctx; - void *set_hca_cap; - int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in); int err; if (MLX5_CAP_GEN_MAX(dev, hca_cap_2)) { err = mlx5_core_get_caps(dev, MLX5_CAP_GENERAL_2); if (err) return err; - } else { - return 0; } - /* To be added if sw_vhca support was added */ - /*if (!MLX5_CAP_GEN_2_MAX(dev, sw_vhca_id_valid) || - !(dev->priv.sw_vhca_id > 0)) - return 0;*/ - - set_ctx = kzalloc(set_sz, GFP_KERNEL); - if (!set_ctx) - return -ENOMEM; - - MLX5_SET(set_hca_cap_in, set_ctx, op_mod, - MLX5_CAP_GENERAL_2 << 1); - set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability); - memcpy(set_hca_cap, dev->hca_caps_cur[MLX5_CAP_GENERAL_2], - MLX5_ST_SZ_BYTES(cmd_hca_cap_2)); - //MLX5_SET(cmd_hca_cap_2, set_hca_cap, sw_vhca_id_valid, 1); - - err = set_caps(dev, set_ctx, set_sz); - - kfree(set_ctx); - return err; + return 0; } static int set_hca_ctrl(struct mlx5_core_dev *dev)