From owner-svn-src-head@freebsd.org Wed Dec 5 13:48:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C537B13142A8; Wed, 5 Dec 2018 13:48:40 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67F23730DE; Wed, 5 Dec 2018 13:48:40 +0000 (UTC) (envelope-from slavash@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 49F0A1529E; Wed, 5 Dec 2018 13:48:40 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB5DmewF082135; Wed, 5 Dec 2018 13:48:40 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB5DmeXk082134; Wed, 5 Dec 2018 13:48:40 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201812051348.wB5DmeXk082134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Wed, 5 Dec 2018 13:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341570 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 341570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67F23730DE X-Spamd-Result: default: False [-0.69 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.54)[-0.543,0]; NEURAL_HAM_SHORT(-0.08)[-0.077,0]; NEURAL_HAM_LONG(-0.07)[-0.072,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2018 13:48:41 -0000 Author: slavash Date: Wed Dec 5 13:48:39 2018 New Revision: 341570 URL: https://svnweb.freebsd.org/changeset/base/341570 Log: mlx5ib: Make sure the congestion work timer does not escape the drain procedure. If the mlx5_ib_read_cong_stats() function was running when mlx5ib was unloaded, because this function unconditionally restarts the timer, the timer can still be pending after the delayed work has been cancelled. To fix this simply loop on the delayed work cancel procedure as long as it returns non-zero. Submitted by: hselasky@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Wed Dec 5 13:48:10 2018 (r341569) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Wed Dec 5 13:48:39 2018 (r341570) @@ -393,7 +393,8 @@ void mlx5_ib_cleanup_congestion(struct mlx5_ib_dev *dev) { - cancel_delayed_work_sync(&dev->congestion.dwork); + while (cancel_delayed_work_sync(&dev->congestion.dwork)) + ; sysctl_ctx_free(&dev->congestion.ctx); sx_destroy(&dev->congestion.lock); }