From owner-svn-src-all@freebsd.org Fri Jan 27 10:56:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ECC8CC4D1F; Fri, 27 Jan 2017 10:56:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4E2F51725; Fri, 27 Jan 2017 10:56:04 +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 v0RAu3E5043024; Fri, 27 Jan 2017 10:56:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0RAu3iC043023; Fri, 27 Jan 2017 10:56:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701271056.v0RAu3iC043023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 27 Jan 2017 10:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312878 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 10:56:04 -0000 Author: hselasky Date: Fri Jan 27 10:56:03 2017 New Revision: 312878 URL: https://svnweb.freebsd.org/changeset/base/312878 Log: Fix command completion with callback scenario. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Jan 27 10:47:53 2017 (r312877) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Fri Jan 27 10:56:03 2017 (r312878) @@ -723,6 +723,9 @@ static void complete_command(struct mlx5 struct mlx5_cmd *cmd = ent->cmd; struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, cmd); + mlx5_cmd_cbk_t callback; + void *context; + s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; @@ -744,6 +747,8 @@ static void complete_command(struct mlx5 spin_unlock_irqrestore(&stats->lock, flags); } + callback = ent->callback; + context = ent->context; err = ent->ret; if (!err) err = mlx5_copy_from_msg(ent->uout, @@ -754,7 +759,7 @@ static void complete_command(struct mlx5 free_msg(dev, ent->in); free_cmd(ent); - ent->callback(err, ent->context); + callback(err, context); } else { complete(&ent->done); }