From nobody Thu Aug 24 20:52:03 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 4RWwHl2s3Cz4rZHr; Thu, 24 Aug 2023 20:52:03 +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 4RWwHl25D5z3QQj; Thu, 24 Aug 2023 20:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692910323; 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=htWAr9zVKdEjJJPfLxqsBaqH0S8dZOdbqbeYV9soap4=; b=WLiJyR1bKpH7sKofmgAHLxixunHmF2FM8NxvdWIunlV6SuoMRCoK/xwAMps5yupK6LM5fN /SYqLli5/XGs05n3xYp9uJyJWGE0073t4iF233pHEi2rVp1Pnwdi0/RuD5Keb/GgY0rON/ ercO+7Qvz72vjMORajcxzyYkpKlqpKjpw50V0HZz2+66nHQtLk0H+JWLmqth5NAdC4ISJd c91ZhiDkPy7JXiBPLokw/K/KvL1QyrEplPCG+5QtDhNJPNeJe7em/QrZokMh9ptuMkl8ue w8jpOKILzkIZsIDx/PJQBaxl6/AemRZQKsRhh3lm8u0T12SuCH+lHIfn0eM/6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692910323; 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=htWAr9zVKdEjJJPfLxqsBaqH0S8dZOdbqbeYV9soap4=; b=LAJ5I9Z37ERsC6LD3WWkasMxHz0AFyjiEAiO/QQGiidENGO7bhAMUY2ohL0Viu1KygtesF Anr9tJuU3EQDfXxBFU5/8Mv5VXIvNZ/2bodUz5Pomp1xu8IRWxno2U30Om98ILpagvrD5b kTAjFXU+6VsS7tuNXlg6zyrIRWeUkxxQ1O10Fp1sEgKGgPwFk+8zOZ0IiX+8LBnRGgMizB 2iXa1jT3Y+kBcxNafTwyCNMkqPH52cxGH4DI1Q9sK8x9+j7dLJy6UQHUmrcc6tuV31lVJs D3fMuY7cSdOLPF0fWBcfQampNPc05dY9YhzaVGmHRZGYFeOyvZ54N2EwvlJspA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692910323; a=rsa-sha256; cv=none; b=rxvjklOKCEHr2rClvmProBsy55U8bUPVWDyTkh40veYoK18gMiGxQNRvBoXMyeb89B67dc w/SP2ADccb359HNADSJ24cb26JqO0+WThkuMIXHbnV2RCfGTF8hAxp9zAiXPIl870m2voc yuOiRL+8ID+xo5iU0kyPvQg8N7Vy0A96TKDad9aCG6gVUKO7KlYD06twZAoz4kikJN+KJV 2N31IsGOCCBtTpvaj0HgyaOYMlHqjjXsB6tQ7wUff97tctVdBXujTYee/+QsSEqKg24eWc ZBu3gb/BeeIVJCocB9gQYQfX2iKBGChyEpmdeGIRlzSVSznFOtdmQfZoLi4TBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RWwHl1BLGzhjG; Thu, 24 Aug 2023 20:52:03 +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 37OKq3dT039664; Thu, 24 Aug 2023 20:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37OKq3p2039661; Thu, 24 Aug 2023 20:52:03 GMT (envelope-from git) Date: Thu, 24 Aug 2023 20:52:03 GMT Message-Id: <202308242052.37OKq3p2039661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 725e4008efef - main - iflib: invert default restart on VLAN changes 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 725e4008efef32dfbe57b3e21635fa80dde8ee38 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=725e4008efef32dfbe57b3e21635fa80dde8ee38 commit 725e4008efef32dfbe57b3e21635fa80dde8ee38 Author: Kevin Bowling AuthorDate: 2023-08-24 20:42:23 +0000 Commit: Kevin Bowling CommitDate: 2023-08-24 20:48:19 +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. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558 --- 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 4fa275f08e28..8488f72c4cde 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4383,7 +4383,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 */ @@ -4392,9 +4392,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 c59e379ca2c8..a0f0906e30da 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2402,7 +2402,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 */ @@ -2411,9 +2411,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 e8fb5de493ce..17f1f73a526e 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1256,7 +1256,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 */ @@ -1265,9 +1265,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 4a23ef3cdcaf..6fafb303143c 100644 --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -251,6 +251,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 a9c285c4dd31..d52bf66bd110 100644 --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -115,7 +115,7 @@ CODE { static bool null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) { - return (true); + return (false); } };