From nobody Sat Dec 31 12:04:17 2022 X-Original-To: dev-commits-src-branches@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 4Nkglj5cr8z2nJgD; Sat, 31 Dec 2022 12:04:17 +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 4Nkglj4yjmz4GvP; Sat, 31 Dec 2022 12:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672488257; 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=Vq1NmEMHcFp1NzU9mXtURIP4I8c3XmIgpf89c0wD0gg=; b=djMKVFMWPK6CkARdMSmtT4eofjy+O0AoFWTBgEFBkaMHDfMDrU9Ea7iCidNj5OVnif0EtS C0FAmVk8NSUkYEn5X7pRdrYy1tjSH1okWqbMdHPTl/gDVWp8olbhrclMKrMJTUa2u9yHx2 U/i982R2eiJk61y/E4dGHyK2GcZoqYpC+/6TMHikR8cWvbtsovCk+opjakUYljdTsDwZ9S 42MkgEljgoV5VbFLqh2oxxXNUUg8bNaUzRDOKkC33uZdnCeo2wmmD0VG14BySedtInLO9R 6BUE71sAu3mySVBLEEXtycyKM/ASX/25ugtLj5xUxnMVtOwmDgtKsrPzCjdSGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672488257; 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=Vq1NmEMHcFp1NzU9mXtURIP4I8c3XmIgpf89c0wD0gg=; b=MOv94wfZVc/8B24htjPiOja/Xd0K63YhrB/0zp8Be+CrFjfmE4rcM36GtvKfEhBx+2H8m4 13r3zjnbFNZcqw5v6LmXJUhYGJedGhXzv0HiRdKvtulTqkiODsHuPyOuPxg9m67o7+zOar 6uQAtYSajxJ06W9TXt55kKsUa9QtSnk2GpJC2DkvXJ1N5kdtJtkgtLElOec/F5M5BLiSmv rIRMxfdD4i3meBHyjvypVa0Gq/PTkWrB+vrkVLz7ctIdhyEdZzmBshA3Qjy0WvOI8T/M54 FMTkPPBgcl24nk/89I/87nZWgskspz7JkXuUIhw2dD7CcA/gcp1jorVOS6K11A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672488257; a=rsa-sha256; cv=none; b=dQ3DkBq7W7YU7f8owkKrwAD4UzOCsXwwbcd/WlTPL4CesjNcfJ7uUa5nWPFy2lUf7TY82Q sRFdAjuiVuA7CIARf44kUruAO+gQJ0iVKri9SkyrEGMalB84Lvu7I/tZ6KECWQzgRV5kJh mF+3G85RnXQh99I5q/KDQ3lu7DRRvOvcRSOEwb5DqxNrWfTvdo2hT10IMCvv3d2X2mwfU9 EfOrWOydPOHEvzhuML8McJqHZ9sH/68VTYo/+POzPOYBa8O5yaUThnOM8DK/SwDVlXE7xa 57WAET/hj9fgttU6JgHAtgra1RRqCVd3kikoYmebXVuqrzHb9K3E1+vCEuGYXg== 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 4Nkglj42bQznd2; Sat, 31 Dec 2022 12:04:17 +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 2BVC4HPF040856; Sat, 31 Dec 2022 12:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BVC4HHF040855; Sat, 31 Dec 2022 12:04:17 GMT (envelope-from git) Date: Sat, 31 Dec 2022 12:04:17 GMT Message-Id: <202212311204.2BVC4HHF040855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 4d97457db1f5 - stable/13 - monitor: fix cb restore when monitored adapter unregisters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4d97457db1f5fd8edb17397c5ecc77a396fa2d7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=4d97457db1f5fd8edb17397c5ecc77a396fa2d7d commit 4d97457db1f5fd8edb17397c5ecc77a396fa2d7d Author: Vincenzo Maffione AuthorDate: 2022-12-24 15:28:45 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-31 12:01:53 +0000 monitor: fix cb restore when monitored adapter unregisters netmap_monitor_stop() called nm_monitor_none() after the head of the zero-copy monitors had been reset, thus thinking that there was nothing left to do. MFC after: 7 days (cherry picked from commit b41818a28a6dba6d33076fbb789442308e57a124) --- sys/dev/netmap/netmap_monitor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c index 9e5d57f7ff0f..6294cc9bdbba 100644 --- a/sys/dev/netmap/netmap_monitor.c +++ b/sys/dev/netmap/netmap_monitor.c @@ -458,6 +458,9 @@ netmap_monitor_stop(struct netmap_adapter *na) struct netmap_zmon_list *z = &kring->zmon_list[t]; u_int j; + if (nm_monitor_none(kring)) + continue; + for (j = 0; j < kring->n_monitors; j++) { struct netmap_kring *mkring = kring->monitors[j]; @@ -470,6 +473,8 @@ netmap_monitor_stop(struct netmap_adapter *na) } kring->monitors[j] = NULL; } + kring->n_monitors = 0; + nm_monitor_dealloc(kring); if (!nm_is_zmon(na)) { /* we are the head of at most one list */ @@ -490,12 +495,7 @@ netmap_monitor_stop(struct netmap_adapter *na) z->prev = NULL; } - if (!nm_monitor_none(kring)) { - - kring->n_monitors = 0; - nm_monitor_dealloc(kring); - nm_monitor_restore_callbacks(kring); - } + nm_monitor_restore_callbacks(kring); } } }