From nobody Wed Jul 03 17:34:45 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 4WDn395thLz5Ppyl; Wed, 03 Jul 2024 17:34:45 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDn395BRbz4Mb2; Wed, 3 Jul 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720028085; 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=+fXZtf9f803BUWmVX9Bouv05loH8iD0bi66dwLDqx+o=; b=B/vL48w0Q5qa3L7UqgAsZXBqlsDrexwYbfcMjUtkTM9f1aIzgvmc9WDgSN+FqqQRi6mn6x 7NyBFu3Q9Hhm//yTzXoFaFeaow1Ji5tSbBtTttSYm+ZEOqL6vLRw/nqwlHJ0ZssAfcOhT+ QYm8BnSIDtTxdtcZm+woOMr04eJZv+daLMqSWXsWk+7uqJ2ZR0CMJ2Tp+DSNv4PxqDFqJw n0PsTIC7mbClhf+exqOPTb8uceZ4jduoAoiEji558SRE5eT2ahOuGTH8cvK1qJpg/iD11X 5eSYrlQczXrbcMsQe9k1tBUZRMbq28AAvx0vpjXpyx/Z4NC1RHAd7y+FfLfxsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720028085; a=rsa-sha256; cv=none; b=t7801SKha47NLitB0zAxAOsC9ff2IcgaG+P17FBdQYyOaDRsBvUNyeMOGIqNRwkag4WOO1 zsZ08NPkPNfNIJ3qlbu9+RZ7zsaF62/IAqO8bmwTLgmnMRsOQL67UPIRBHVxMlGs5gh/1d tc9GeEUxFXnN+FD81qnzh5eK75NmgYE31/s/BfdvTF7NMD9i3kEj32DFQ5tPvP5MtLhhIg ahMiCuCNWdpv1+1Rk3iFnDIF26vRY6k5a7CxnOlXAZrvq4CsccifM66rnuNBd2IOzKQgWr V/Yd4tXP9wsAz7kKU1Itwoys82rM9h64S7pt8/9/Wz4brlmftHKhtDjzXDlrxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720028085; 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=+fXZtf9f803BUWmVX9Bouv05loH8iD0bi66dwLDqx+o=; b=Eqb+x3OUYDJ97m0ySV8dibX12/TkZZigCGf3Gh60rbW+pEDVsHuK9ply6/Nj0PBBLINjs/ i33l27E8c2OQtjxh1efv/Awr5MtS6SXL4DtTgMig/TQNPIwYannundrGSnezaWPCA2qZSo bzrBSdWDopamDs3rJQ5TVnMyR2+lDy37wtm0TMcTaivIJkcYpr3QsZh98Fq+VDmqverfG4 n/zNy3m6BN1aIbVEZInXe6Ym++sK2zBviQEmGPvwk94QMCy5+KihwLuykCS+VDnyAWZczH n90qgbeIdNUQKQ1V8kbwJxG3vF88sOwTD7zBLgT73jUNCDS5hoAYrmPMTp+whg== 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 4WDn394gsnzh6X; Wed, 3 Jul 2024 17:34:45 +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 463HYj4d076802; Wed, 3 Jul 2024 17:34:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463HYjV8076799; Wed, 3 Jul 2024 17:34:45 GMT (envelope-from git) Date: Wed, 3 Jul 2024 17:34:45 GMT Message-Id: <202407031734.463HYjV8076799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 25ef056f74e4 - main - ofed: fix rwq buffer allocation 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: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25ef056f74e40429df6bcbc31d52888b57ff3e2c Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=25ef056f74e40429df6bcbc31d52888b57ff3e2c commit 25ef056f74e40429df6bcbc31d52888b57ff3e2c Author: Ka Ho Ng AuthorDate: 2024-07-03 17:32:06 +0000 Commit: Ka Ho Ng CommitDate: 2024-07-03 17:32:44 +0000 ofed: fix rwq buffer allocation Fixes a wrong rwq->buf_size assignment. The field was assigned 0 upon a successful call to ibv_init_wq. Fixes: a687910fc435 Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45833 --- contrib/ofed/libmlx5/verbs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/ofed/libmlx5/verbs.c b/contrib/ofed/libmlx5/verbs.c index 766751041050..6c296bb69f6f 100644 --- a/contrib/ofed/libmlx5/verbs.c +++ b/contrib/ofed/libmlx5/verbs.c @@ -2077,6 +2077,10 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, if (!rwq) return NULL; + ret = ibv_init_wq(&rwq->wq); + if (ret < 0) + goto err; + rwq->wq_sig = rwq_sig_enabled(context); if (rwq->wq_sig) cmd.drv.flags = MLX5_RWQ_FLAG_SIGNATURE; @@ -2084,13 +2088,9 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, ret = mlx5_calc_rwq_size(ctx, rwq, attr); if (ret < 0) { errno = -ret; - goto err; + goto err_cleanup_wq; } - ret = ibv_init_wq(&rwq->wq); - if (ret < 0) - goto err; - rwq->buf_size = ret; if (mlx5_alloc_rwq_buf(context, rwq, ret)) goto err_cleanup_wq;