From owner-svn-src-stable@freebsd.org Tue Dec 1 12:45:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7360A4A8B1C; Tue, 1 Dec 2020 12:45:48 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ClhfN2pc3z3kMd; Tue, 1 Dec 2020 12:45:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48D6C15F9E; Tue, 1 Dec 2020 12:45:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0B1CjmjD042533; Tue, 1 Dec 2020 12:45:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0B1Cjljw042531; Tue, 1 Dec 2020 12:45:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202012011245.0B1Cjljw042531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 1 Dec 2020 12:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r368220 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 368220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2020 12:45:48 -0000 Author: hselasky Date: Tue Dec 1 12:45:47 2020 New Revision: 368220 URL: https://svnweb.freebsd.org/changeset/base/368220 Log: MFC r367716: Use mlx5core to create/destroy all Dynamically Connected Targets, DCTs. To prevent a hardware memory leak when a DEVX DCT object is destroyed without calling drain DCT before, (e.g. under cleanup flow), need to manage its creation and destruction via mlx5 core. Linux commit: c5ae1954c47d3fd8815bd5a592aba18702c93f33 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_qp.c stable/11/sys/dev/mlx5/qp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_qp.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_qp.c Tue Dec 1 12:45:07 2020 (r368219) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_qp.c Tue Dec 1 12:45:47 2020 (r368220) @@ -349,19 +349,18 @@ EXPORT_SYMBOL_GPL(mlx5_core_xrcd_dealloc); int mlx5_core_create_dct(struct mlx5_core_dev *dev, struct mlx5_core_dct *dct, - u32 *in) + u32 *in, int inlen, + u32 *out, int outlen) { struct mlx5_qp_table *table = &dev->priv.qp_table; - u32 out[MLX5_ST_SZ_DW(create_dct_out)] = {0}; u32 dout[MLX5_ST_SZ_DW(destroy_dct_out)] = {0}; u32 din[MLX5_ST_SZ_DW(destroy_dct_in)] = {0}; - int inlen = MLX5_ST_SZ_BYTES(create_dct_in); int err; init_completion(&dct->drained); MLX5_SET(create_dct_in, in, opcode, MLX5_CMD_OP_CREATE_DCT); - err = mlx5_cmd_exec(dev, in, inlen, &out, sizeof(out)); + err = mlx5_cmd_exec(dev, in, inlen, out, outlen); if (err) { mlx5_core_warn(dev, "create DCT failed, ret %d", err); return err; @@ -387,7 +386,7 @@ int mlx5_core_create_dct(struct mlx5_core_dev *dev, err_cmd: MLX5_SET(destroy_dct_in, din, opcode, MLX5_CMD_OP_DESTROY_DCT); MLX5_SET(destroy_dct_in, din, dctn, dct->dctn); - mlx5_cmd_exec(dev, &din, sizeof(din), &out, sizeof(dout)); + mlx5_cmd_exec(dev, &din, sizeof(din), dout, sizeof(dout)); return err; } Modified: stable/11/sys/dev/mlx5/qp.h ============================================================================== --- stable/11/sys/dev/mlx5/qp.h Tue Dec 1 12:45:07 2020 (r368219) +++ stable/11/sys/dev/mlx5/qp.h Tue Dec 1 12:45:47 2020 (r368220) @@ -586,7 +586,8 @@ int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u3 int mlx5_core_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn); int mlx5_core_create_dct(struct mlx5_core_dev *dev, struct mlx5_core_dct *dct, - u32 *in); + u32 *in, int inlen, + u32 *out, int outlen); int mlx5_core_destroy_dct(struct mlx5_core_dev *dev, struct mlx5_core_dct *dct); int mlx5_core_create_rq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,