From nobody Mon Sep 11 22:35:39 2023 X-Original-To: dev-commits-src-all@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 4Rl1l00TZgz4sTZh; Mon, 11 Sep 2023 22:35:40 +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 4Rl1kz5yH7z3gDG; Mon, 11 Sep 2023 22:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694471739; 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=L+nhcrN7v/QgdMGChKmmgGjdHHRcGsL/kYFZ94WylWQ=; b=hVQlO6ifv79AsmSh9++5RVyzyroq6PHJQfDlpoVasq+yX/t9FmcLBDNs/xHMdiAORIjaWB kyqWxvxa8IdN0DuJU0Q8lfPrIBTED0dia3LcaJPRFqPH536hDtQpw4c7DvIb5Ur672nxKn 6B3D0MJZIzAOOFFkHL6Zil1LYHfXJoeyxz7uKJg4NuvgrDYG+B62br0V7mfq38+DuTnJfE s9AVXlJao4WME1f+zhPuheYDydhY4fme4DBMLCncLJKvQoQj+14c1J1nGEnGYoM+JROEFe 03pqn8PSpwX+zs07CeDkdpGI9crUoFkYnu5hltwPuRm9dYs72IObcGLrU5/UVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694471739; a=rsa-sha256; cv=none; b=Vt09dwFRERlMMd9nssBOZtO+WpeedXCbj8AwdJa6MoSdFsiY/0pONG6gFLT+pVRbM2zD5g rVGtuMDd2AgvcUT0NjHAm23eBtrRYdJH/hjJPhbxFdfex9YXyxWxQpGJ5UzG34rxAVW16R 5VPdIm971298Zj9g8RL2T7CrIQfK3NUjsJ9WhsHzOxpZAGKM8aSWAz1CejMzdoUnjl1E6L Blx8MvpEpCdNNAA79MMyhdSiR3FvTXLGv5LVgTbcJRF6YcIpow5XlpCxUYo6oKlkfMOA/E LOJ2iyw3vCZEo2yGJ+xky7ceT+XZTveW0x2JWsJO52NhPBthqxqBD9XHzAJhEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694471739; 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=L+nhcrN7v/QgdMGChKmmgGjdHHRcGsL/kYFZ94WylWQ=; b=rlX9ucsj5NMuxlSiOdqieQAsmCtSU5LVR96p1o+xDGYf46QZdWDLF1uVnw+URE9I2wgYQ4 VBw6T+lAFgurdBIFvRyvNK1dyRodZYF5mCthqS5y8/+b2LGmUolMGGQlgweIZqfOJ/xqxt rvn0fUGRVNsNnq/Dg56pMikYJpDBXdWyhFc4khfEEjEuxWnZ7AskHmEG+W/7/pIaekP+L6 hv4EKZ84w+spalW20wr41h7JHOlcD4+RqEcTiR1G2LYvWf//cs92Q1AMqkoaormS1eOWjz kQbh3Ns5mO4P3BmqOGY7k3aXw7TUpHF6qgyzUv7tP9Swh4y/Ij46wXGZF0Y4zQ== 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 4Rl1kz5427z16M8; Mon, 11 Sep 2023 22:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38BMZd9x056980; Mon, 11 Sep 2023 22:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38BMZd3B056977; Mon, 11 Sep 2023 22:35:39 GMT (envelope-from git) Date: Mon, 11 Sep 2023 22:35:39 GMT Message-Id: <202309112235.38BMZd3B056977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 6cb4a544e00f - stable/13 - iflib: invert default restart on VLAN changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cb4a544e00f834d3fa956aca61b0f71c04a4ad5 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=6cb4a544e00f834d3fa956aca61b0f71c04a4ad5 commit 6cb4a544e00f834d3fa956aca61b0f71c04a4ad5 Author: Kevin Bowling AuthorDate: 2023-08-24 20:42:23 +0000 Commit: Kevin Bowling CommitDate: 2023-09-11 22:34:21 +0000 iflib: invert default restart on VLAN changes In rS360398, a new iflib device method was added to opt out of VLAN events needing an interface reset. I am switching the default to not requiring a restart for: * VLAN events * unknown events After fixing various bugs, I do not think this would be a common need of hardware and it is undesirable from the user's perspective causing link flaps and much slower VLAN configuration. Currently, there are no other restart events besides VLAN events, and setting the ifdi_needs_restart default to false will alleviate the need to churn every driver if an odd event is added in the future for specific hardware. markj points out this could cause churn in the other direction; I will solve that problem with an event registration system as he mentions in the review should we need it in the future. These drivers will opt into restart and need further inspection or work: * ixv (needs code audit, 61a8231 fixed principal issue; re-init probably not necessary) * axgbe (needs code audit; re-init probably not necessary) * iavf - (needs code audit; interaction with Malicious Driver Detection mentioned in rS360398) * mgb - no VLAN functions are currently implemented. Left a comment. Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558 (cherry picked from commit 725e4008efef32dfbe57b3e21635fa80dde8ee38) --- sys/dev/e1000/if_em.c | 5 ++--- sys/dev/igc/if_igc.c | 5 ++--- sys/dev/ixgbe/if_ix.c | 5 ++--- sys/dev/mgb/if_mgb.c | 1 + sys/net/ifdi_if.m | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 3aae0ef4377e..8cf130048128 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4385,7 +4385,7 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -4394,9 +4394,8 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 4680dd434174..82fb0d72070b 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2403,7 +2403,7 @@ igc_if_get_counter(if_ctx_t ctx, ift_counter cnt) * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -2412,9 +2412,8 @@ igc_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index db54b0edf7be..b1cba9f24929 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1257,7 +1257,7 @@ ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -1266,9 +1266,8 @@ ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c index b2962d5ff3d8..e3806300ed9a 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -252,6 +252,7 @@ static device_method_t mgb_iflib_methods[] = { */ DEVMETHOD(ifdi_vlan_register, mgb_vlan_register), DEVMETHOD(ifdi_vlan_unregister, mgb_vlan_unregister), + DEVMETHOD(ifdi_needs_restart, mgb_if_needs_restart), /* * Needed for WOL support diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m index 6e8661920394..fb36b898c1d0 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -172,7 +172,7 @@ CODE { static bool null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) { - return (true); + return (false); } };