From nobody Mon Sep 11 22:35:37 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 4Rl1kx4lBKz4sTq0; Mon, 11 Sep 2023 22:35:37 +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 4Rl1kx3qRlz3g25; Mon, 11 Sep 2023 22:35:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694471737; 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=5zFeMeRfMVsuQLXSga11p0P+yHsb+UHSC2igjtA/hdY=; b=f24LYYlGgSWZstOgkxr00wfZDYGWe0uRcKSlMgRMhP06fx5utWHLGbmZrEG9hPm5sHchMV l5YNyIQtcLqxTgM5Z4U4dfwhM0Ycics0V7peAp362Ru4KSJ8NJmwTAjesLhx+5Sp5ZW8rJ xba32/eya5lgJUyXLEUiJMLkEObHzb8ZIeEJgx0H5jbQO4v6oOTvwDzOE8kLuQxsOuOxDF sQrsf8JeFM1390O4I71kihQII5lzQC8CnpQ2SyrOBWZBo6kWhSJ1p12DBeELFGIMdXXfUJ ZPdNIz2Blsx1szZ4TK7Xab1d4/6OpgZLJVeLXpolQ3LNDGDcG+GsWvw5LvAuTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694471737; a=rsa-sha256; cv=none; b=SsDFiqX1sC9wE5Vg3bFiUGoo+zkykwIjiuDW9LdWW3DhHAub/VmkHFqxmu5lZrqRaxCoEs g9VbuJg8KebSXSsnKO6jpfvU6ArAi1SPQONbT727wKlAID8TWnV7OgAFMEO13/sKsC6AJH WhZ+G1qLWU4geR5FRCyC4Lp+hnjFZK5relS5ptH5vSyWC913kIZCUalDN/1EI6h8tjHAkS CFn9YrMntm755DD7AnWURMy6+t7GN9/Q485wKfuMx+Oah268s80pagOdhF9Jfa1as6Qo+g H2yeJ+rRQILHLJGdoHbxOaGFSqzCzBkIg6fl2t2rBC1ptYBEEfFGOxw2TrOvQA== 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=1694471737; 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=5zFeMeRfMVsuQLXSga11p0P+yHsb+UHSC2igjtA/hdY=; b=JgGcfHo5rsKwWCgCqMLOOZ98MGtGMXFyd9LGQWrZ+BrYW22m6vzRqySbD1Qt8s085iOgrN oUdfgCoXY8NRttVZIGkXEmwg+Y4b4fu6GrPGNCE1c5BQLWgwC4pj9hAvj1BK/SwsHb5dpu pMo8CkTuWTTW+rJuo1ySHehxdsT5yb2HY62nv5lDeLJaVQBNPcCC9bQPzoYbln9Zs29yLl xepJTN3oGtsbByllZFqTx7fJKj8LxV5I44nZngNEuh9YKHJ7QImB4TbFh9Jz6veDxe4CQU vgJ8Z+z+Ttct1dhZWMpSYo2PxEyf/RrDMBLMvRGXxM2iIWKEJjdjQ4lIszCB4A== 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 4Rl1kx2pPKz168s; Mon, 11 Sep 2023 22:35:37 +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 38BMZbIh056878; Mon, 11 Sep 2023 22:35:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38BMZb6G056875; Mon, 11 Sep 2023 22:35:37 GMT (envelope-from git) Date: Mon, 11 Sep 2023 22:35:37 GMT Message-Id: <202309112235.38BMZb6G056875@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: 08647a110843 - stable/13 - iavf: Add explicit ifdi_needs_reset for 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: 08647a110843ab7f4b09917413ed9cb1c3d4a7ca Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=08647a110843ab7f4b09917413ed9cb1c3d4a7ca commit 08647a110843ab7f4b09917413ed9cb1c3d4a7ca Author: Kevin Bowling AuthorDate: 2023-08-24 20:36:00 +0000 Commit: Kevin Bowling CommitDate: 2023-09-11 22:34:20 +0000 iavf: Add explicit ifdi_needs_reset for VLAN changes In rS360398, a new iflib device method was added with default of opt out for VLAN events needing an interface reset. iavf(4) was the original need for this, because VLAN filter changes currently have negative interactions with Malicious Driver Detection. Add iavf_if_needs_restart and explicitly enable VLAN re-init. Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558 (cherry picked from commit 1d6c12c511ae2a394d3ca1998a10f3d3bd25d313) --- sys/dev/iavf/if_iavf_iflib.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 5ae1b9308c1e..ef3a36674a55 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -74,6 +74,7 @@ static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); static void iavf_if_init(if_ctx_t ctx); static void iavf_if_stop(if_ctx_t ctx); +static bool iavf_if_needs_restart(if_ctx_t, enum iflib_restart_event); static int iavf_allocate_pci_resources(struct iavf_sc *); static void iavf_free_pci_resources(struct iavf_sc *); @@ -170,6 +171,7 @@ static device_method_t iavf_if_methods[] = { DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), + DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), DEVMETHOD_END }; @@ -1497,6 +1499,25 @@ iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt) } } +/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (true); + default: + return (false); + } +} + /** * iavf_free_pci_resources - Free PCI resources * @sc: device softc