From owner-dev-commits-src-all@freebsd.org Mon Jul 26 16:13:59 2021 Return-Path: Delivered-To: dev-commits-src-all@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 9705266F98C; Mon, 26 Jul 2021 16:13:59 +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 4GYQ3B6qLZz3pd9; Mon, 26 Jul 2021 16:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0C5111A44E; Mon, 26 Jul 2021 16:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16QGDus7006117; Mon, 26 Jul 2021 16:13:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16QGDuNY006116; Mon, 26 Jul 2021 16:13:56 GMT (envelope-from git) Date: Mon, 26 Jul 2021 16:13:56 GMT Message-Id: <202107261613.16QGDuNY006116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 0ebff67cab8b - stable/13 - mlx5en: Wait for all TLS connections to terminate when unloading driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ebff67cab8b78e73f7a166fcabad3244edf812f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2021 16:13:59 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0ebff67cab8b78e73f7a166fcabad3244edf812f commit 0ebff67cab8b78e73f7a166fcabad3244edf812f Author: Hans Petter Selasky AuthorDate: 2021-06-16 13:01:58 +0000 Commit: Hans Petter Selasky CommitDate: 2021-07-26 16:04:33 +0000 mlx5en: Wait for all TLS connections to terminate when unloading driver. The driver expects all TLS tags to be returned to the driver before it can free the UMA zone where the TLS tags reside. Reviewed by: kib Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 3a934ba7a30831dda104e9faad9412f9743c9bae) --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 2 +- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index 3e63b9e660f1..1a92e5aa222a 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -288,7 +288,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, priv = ifp->if_softc; - if (priv->tls.init == 0) + if (priv->gone != 0 || priv->tls.init == 0) return (EOPNOTSUPP); /* allocate new tag from zone, if any */ diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 02417f5f931c..d9860c24114b 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -4715,6 +4715,16 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vpriv) pause("W", hz); } #endif + +#ifdef KERN_TLS + /* wait for all TLS tags to get freed */ + while (priv->tls.init != 0 && + uma_zone_get_cur(priv->tls.zone) != 0) { + mlx5_en_err(priv->ifp, + "Waiting for all TLS connections to terminate\n"); + pause("W", hz); + } +#endif /* wait for all unlimited send tags to complete */ mlx5e_priv_wait_for_completion(priv, mdev->priv.eq_table.num_comp_vectors);