From nobody Thu Aug 24 20:52:00 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 4RWwHj2nPRz4rZHl; Thu, 24 Aug 2023 20:52:01 +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 4RWwHj0TFmz3QKT; Thu, 24 Aug 2023 20:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692910321; 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=rRCKUhylPibFJqVAJh6H+/UqlA6SUfNmWqT/aFAHXa8=; b=vJHSwKxmUDurRw/bchgkCZz8qOUumb9JvhPHIjnMMDxnUPNN328V/g883Oj4yyW2GPw5n9 at47VMHdokUCo/KcQ24iqvYFSPGnK5wZXb9eZYFY74r7DV395NIt8CJ+Dttl5DWsc6OHuI yABGEDjbJKegPX1mP4qhfy6tebemN95N6sEOIXoNSQ+VNLagwGPXwwaH8LhT+cOU4m4IdZ 2lOhyKvKB+UFxjX00KIA10UxEPsSraq6rr+ggoiW2b1QibRuJRxEeqLCnZzlZ311/IE+Yc f9+qYbNE/pi4vnLcOIJzRyZfb9j3sUIG15gg/Px6u5X157nwQ9sX/cZVj45CrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692910321; 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=rRCKUhylPibFJqVAJh6H+/UqlA6SUfNmWqT/aFAHXa8=; b=lASO1X8CNHANbKYnLcC28c5cVCyDI+95xVEqzo22Y8Z5R4TZ4i7ufyEN1hMZjZ2mXVNnwE jNOjO1zx0a/bvpRL3XUZ+zYeB9VfJJAENbeaH4C6RSjdaUDnEXo2scU8k2eJg4BsXmCFaF tAoTQl5OmiIdLCASSZc90ThriQxP2F9cK2IuhPOyOpG4+LWeOCVyX4ivlNbTjqNjJDbI15 oijiUmLmY9l5zjXUowuA/FzRW5do5LDkNcQEuq7oHQckyF1T7Z516hQ1KSWU0zqooTlTKi kk6gtbZIrINRo5zdamD1ZokBSPs4pQty13yKZY4jhD9JTrSxJyieJbYuu1KckQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692910321; a=rsa-sha256; cv=none; b=mS8SphdNeqg5t4ypG05RwkX+Z2vsUS10tIrvRknmIHjLXjb3qoZALxIjKS7CprSzxHjRpI G2Ng/TLH1TGQ1skVnIb9c4Bb+dqWiRJ5x6OjvYp4H19MCnPgFwgeXfAUQGhSeimzRx+da/ o6PZLkZfGJuFfBF4dc+uRiqWdrdezpxlP+60slXZXfp0XaIpAXVoq1fCNJlYmhzzBlgJHG sVZVK1nGboD08jo7yBQ0a0w4ZX2eAVVxK7i8vsTDcAHrNWUQwJQN8ic+IOAtYlYvVMPRmI HdLLcKltRXlZeZQXfCukDN6mKdRKe9pAUZw9kcrvYHl2gJqY/kKmU9/A2M+3qA== 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 4RWwHh6BNBzhjC; Thu, 24 Aug 2023 20:52:00 +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 37OKq0PR039566; Thu, 24 Aug 2023 20:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37OKq0r5039563; Thu, 24 Aug 2023 20:52:00 GMT (envelope-from git) Date: Thu, 24 Aug 2023 20:52:00 GMT Message-Id: <202308242052.37OKq0r5039563@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: 1d6c12c511ae - main - 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/main X-Git-Reftype: branch X-Git-Commit: 1d6c12c511ae2a394d3ca1998a10f3d3bd25d313 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1d6c12c511ae2a394d3ca1998a10f3d3bd25d313 commit 1d6c12c511ae2a394d3ca1998a10f3d3bd25d313 Author: Kevin Bowling AuthorDate: 2023-08-24 20:36:00 +0000 Commit: Kevin Bowling CommitDate: 2023-08-24 20:46:56 +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. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558 --- 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 b2531b797941..714d34eeebe5 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 *); @@ -169,6 +170,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