From nobody Tue Oct 18 04:55:08 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 4Ms1kj2FD1z4g1G1; Tue, 18 Oct 2022 04:55:09 +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 4Ms1kj0J1fz3Vxw; Tue, 18 Oct 2022 04:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666068909; 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=DhSGvj7GPQiNbaHHHa0fZPGg3/N+6nr/OxbR1Im8dc4=; b=y4d7S0fBhEgANseBwlzpV9We6qRGMcUEm0K98BEinsljewOtjF/zkHCysUgQpPgJw/BylZ 9cfw5l94ZjC0f5iS42kkXWB0J4O3L0xeoJc101fJcpp2miolD1yOJcjSZFMDmg6edGu/Wa /BvTtF/peDt3KtSSHDPn7jHH8RbPR9E+MU577hhCbw29ZPl38qfjp8IRFY5aQLyp9k8Dy5 wcD5VfddsUOXEdUJXAIP2q5fDnk/xH5yYsZVhx7BL4pDdOfxD3zYdIraN3c0y5DXkIPhzo rIPu4Ql5gA4yVysqirgXeUDoPgc18jcHbYkHtC2Cv0gWz2/HbzCge82yQJsGXA== 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 4Ms1kh5xBDz13x6; Tue, 18 Oct 2022 04:55:08 +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 29I4t8h7009565; Tue, 18 Oct 2022 04:55:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29I4t88Z009564; Tue, 18 Oct 2022 04:55:08 GMT (envelope-from git) Date: Tue, 18 Oct 2022 04:55:08 GMT Message-Id: <202210180455.29I4t88Z009564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 95d3300d2211 - stable/13 - ixl(4): Fix SR-IOV panics 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95d3300d22118818bf1aded2672a7c122343ad20 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666068909; 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=DhSGvj7GPQiNbaHHHa0fZPGg3/N+6nr/OxbR1Im8dc4=; b=is455cG7OuF1XBZ96zbhD9nE55DfnBALG5/IewtPbqg913+atTXmV5gwKFP8z6oRPLIA7k VUhGEKd0t+zIBPFlpUI8Ci7WMiA/NGOGUxbsCk/EarqZleD/HP80sdgcDP53BcrF3MSHue Q+9rjLlRUwxazxP9n7XmfvpUbI/QTzcMZdTM/f80Jg+1fG/xK4IPRfxxgO/5Pksu73gt8W dlidWldppC6hZU8ZRXQMjB7lHAYgTK1nvN0jN9aAJSZdi5rSAzzZyOetuC1xBBRG8Z2c95 9mB0aOec+Nn+Te9Ja/GkQvYhvv+Xi/oMrbojHbHQaAsfCrmiMMsYFOfOpaFAlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666068909; a=rsa-sha256; cv=none; b=tsyDwKLQBBAjddkbPVKh7Tgd6LL2XT1ZZ4Wf+u+j/NFdCAu+pfcA3V5OxrPI6sMxdLQaxR 5yuey/FQHiraUSk/E4y8fSmakk6s7mVRxRETPPWTp0uT3yS5la/6WmsG7YmQOwyQ7ceJwe E3aIg9Dhjv8jwu1L84jAv+0BzpSfKM64+dh2rYJKzmQ5O5DlfCEGp0nS/RJrSDHZXoFHhZ ENinqrOFhG39vDyAt5aSTDLxiGnQw79KWXZ9l0u+G0YgGii+Qje+NjVT0QVFGf18HjQHl0 AXlQmFEJL8rCd89bgTs6sVEKbGeF/v1Y+v4+MTAccGoeVkwEF1yBGG5LGV3diQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=95d3300d22118818bf1aded2672a7c122343ad20 commit 95d3300d22118818bf1aded2672a7c122343ad20 Author: Yan Ka Chiu AuthorDate: 2022-07-13 01:16:29 +0000 Commit: Eric Joyner CommitDate: 2022-10-18 04:19:41 +0000 ixl(4): Fix SR-IOV panics The hw and ifp of a vsi will be NULL if such ixl_vsi is allocated for a VF. When ixl_reconfigure_filters called, it is trying to access vsi->ifp and hw->mac.addr and therefore is casuing panic. This commit add checks to determine if vsi is a VF by checking if vsi->hw is NULL, before adding IXL_VLAN_ANY filter (which is already in a VF vsi's filter list) and VLAN filters. (erj's Note: The SR-IOV flows need revisiting; this will help prevent panics for now) Reviewed by: krzysztof.galazka@intel.com, erj@ Differential Revision: https://reviews.freebsd.org/D35649 (cherry picked from commit e706512a2b64fa2741144caf056c9fe923b60004) --- sys/dev/ixl/ixl_pf_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 896da955843a..f783ae5ed31a 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -1114,6 +1114,14 @@ ixl_reconfigure_filters(struct ixl_vsi *vsi) ixl_add_hw_filters(vsi, &tmp, cnt); + /* + * When the vsi is allocated for the VFs, both vsi->hw and vsi->ifp + * will be NULL. Furthermore, the ftl of such vsi already contains + * IXL_VLAN_ANY filter so we can skip that as well. + */ + if (hw == NULL) + return; + /* Filter could be removed if MAC address was changed */ ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY);