From nobody Mon Mar 06 16:24:13 2023 X-Original-To: dev-commits-src-main@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 4PVkRd70tvz3w5P8; Mon, 6 Mar 2023 16:24:13 +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 4PVkRd69g8z3w6T; Mon, 6 Mar 2023 16:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678119853; 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=+0SkHS2sebVWBgu8qf9RQpaOc8ZkIJoNs+7ts8xBY6s=; b=VCo8ckkrJ04E60bVxnKgDApTf67477nuD27sKSnnjvslnrp/xpuvsJRBtTiq+NZDaPvIpm rTIyDaiL+Idumu04OJeTziAzvA+evsdDyG8m1CbJ90nutLcRpt4GQf39aMkFQfgE6Lajpr Symk5hGWa0w7Eq/fEAiGfsZFA+V4XNHpoTN0odHtpqmN6kBlamApii64r7dxwV7ezRMWyI Wp4TguSg388Rtozx7l989oFg2DuGCeZOU1h6aU4MuC/P+dbgqUnXgRHOm9YMMLXdcPDmx7 qITiCQsTmlkMHBgCFrEBxWGWoMVBUxAgXtLNu4s1WaAUCTK88IXQclKBhTxkQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678119853; 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=+0SkHS2sebVWBgu8qf9RQpaOc8ZkIJoNs+7ts8xBY6s=; b=DLZsw9B+59WmX5Kb4SXFo3HvjQNhZ4fW0rW1L4zvaQlIN5Tq3MHhqd9MzkpxvlE+vyVF6k FsGOok4tB95bvzRS2nUpj8KNsAgPr5kScn+g+PY1rJ+PsPwNwgTkOYnnkup98L0fyH1Nxb ULei7H8+ArgCQfFC2rp7eyBejrzVYLZqIQpIrQLE7NZvXqkd0I04+MpikKfouIOTf0H8gN cC+qknRef5AG6mxGm/rM55LzBc/fPoLImRxGnZ65wyscdNPp0WYVMyyIG0NgOREzqCKXUy 7i8mmNj1LdGmT5tr7xiNm+UQbwzivru6e4mKKf9lfbTTnxiu6ftT/8WO8asclA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678119853; a=rsa-sha256; cv=none; b=ZT7M1I6YbIR7Y/mWdeEG/ZSzTxBF1bmtA1+krMWweU4dOGoeZW7cSk3dDFSN9gde3FTyHd 3s5YMwQlSAGemHueGWPDX4zDFUuwQ8bKFTNLZUtPyFyGUUYBsNIlmATmPJ8PSP3OOqSIuC S65TwfnN+3ND0tkLfC7fOpDeq9eJMTN5vCmAOOqmu2rJz0YX2zYbKf1NqsQjGWqJV35MHQ PlVOPIseRMJeImjYKbopyukQxIJeWQgsyfAXtn0wRPSMYfBgcG8xlCCmZxUEOdg/zrZ+/b AmT1weZ0CTa/QwoCse0VpLwgJso6yXr1JJVsNCU/fiT1srzepx6FABFtncLtJw== 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 4PVkRd5GNQz184s; Mon, 6 Mar 2023 16:24:13 +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 326GODto006713; Mon, 6 Mar 2023 16:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 326GODG6006712; Mon, 6 Mar 2023 16:24:13 GMT (envelope-from git) Date: Mon, 6 Mar 2023 16:24:13 GMT Message-Id: <202303061624.326GODG6006712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 70510800d1ad - main - mlx5: Enter network epoch when using if_foreach() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70510800d1ada1a92dc22bc74e57e9bb4fbaccc3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=70510800d1ada1a92dc22bc74e57e9bb4fbaccc3 commit 70510800d1ada1a92dc22bc74e57e9bb4fbaccc3 Author: Justin Hibbits AuthorDate: 2023-02-21 19:43:53 +0000 Commit: Justin Hibbits CommitDate: 2023-03-06 16:04:15 +0000 mlx5: Enter network epoch when using if_foreach() Summary: IFNET_RLOCK() is not sufficient, the epoch needs entered. Reviewed by: hselasky Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38711 --- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 629ecf3e5755..0b0a4b2019a0 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -3150,18 +3150,19 @@ mlx5_enable_roce_if_cb(if_t ifp, void *arg) static int mlx5_enable_roce(struct mlx5_ib_dev *dev) { + struct epoch_tracker et; VNET_ITERATOR_DECL(vnet_iter); int err; /* Check if mlx5en net device already exists */ VNET_LIST_RLOCK(); + NET_EPOCH_ENTER(et); VNET_FOREACH(vnet_iter) { - IFNET_RLOCK(); CURVNET_SET_QUIET(vnet_iter); if_foreach(mlx5_enable_roce_if_cb, dev); CURVNET_RESTORE(); - IFNET_RUNLOCK(); } + NET_EPOCH_EXIT(et); VNET_LIST_RUNLOCK(); dev->roce.nb.notifier_call = mlx5_netdev_event;