From nobody Wed Jul 13 01:25:27 2022 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 AC4311CFE513; Wed, 13 Jul 2022 01:25:27 +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 4LjKgW4QsPz3mw2; Wed, 13 Jul 2022 01:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657675527; 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=HEyZJPOK3jk80Q5RHfHwyjF/uVp3Ga1OBJU5gbZWPkQ=; b=jnMgzOzcK2BgD7fu51+XnpOlBp9AG9rhJyP8myM4ka2HjPIf6wAhdfXjnKNrkuhFowlUCH S7wUVGzyhcSKH271PxErnS0xlpAkphODTqHWf+OLDOouysXcjLdNyNrylWn5/Vq3aeoWUB Ecr0DIcoAXLoixow+K5WHnjvoiZ36+60uPXAdYC1u1ikcZSyRc61CCJOwFEeLhVMFEw9/w VX/GXzcRT1Ef+TqAeqfrjq123M7Kf9dOAAy+ohzAHiN4Cet3RXXRFF8a7DKpu4Hfd0ca8+ wp5VZ2BQpeOij6Oxdk1JGR2ypWo8vAoK/eT6lhoGa2Y7/iiw2zzIzVxVGDYiuA== 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 4LjKgW3RTxz14mC; Wed, 13 Jul 2022 01:25:27 +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 26D1PRE3004477; Wed, 13 Jul 2022 01:25:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26D1PRC3004476; Wed, 13 Jul 2022 01:25:27 GMT (envelope-from git) Date: Wed, 13 Jul 2022 01:25:27 GMT Message-Id: <202207130125.26D1PRC3004476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: e706512a2b64 - main - ixl(4): Fix SR-IOV panics 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e706512a2b64fa2741144caf056c9fe923b60004 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657675527; 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=HEyZJPOK3jk80Q5RHfHwyjF/uVp3Ga1OBJU5gbZWPkQ=; b=GPs61rxfX/Q4qLXyT4FsBWzg/o2Kq7BXGwybkHcKNS83olOzDvZWq+PPHQC2z0/nGxziNH 1p88zJ7zpRNQvHpRuhj2gp1xZmBaBIPvM2Fz95eV9Ad7UW2EHhjTQTXFQkp0ZDcj8wQKky YBOWfJmaX1ONkceZxN2B0f6an6BRDT/ojMVCAPJg7H2f7PYq42xLvp+PKp4FOrSsBDdmQV TJRloAF77BwLA2VGyEfJAk/SdYSNb0ArBPt3UPZ4k0X4MYa34DQpX1qiGzQhQrEmvaJFih uEFxPVirSzZChJxQO5sSgvl5/txDoJ6U7Ll3rHEDGirPbk1QHp+5oxBbjQpHhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657675527; a=rsa-sha256; cv=none; b=lShV80M0IsUwgCMgEL9khX8CQe2VAatKuhQsr7DgX6eN99uDMAhkFAB/tCuR09CRGDuoL3 fNVlq3vc4qvbgh/RMHQUoMXZMVAP9F5/z/IvRfa8xMOwOMxvbpLsmSCKfUMqBRSkECt1BJ wnOO4/KIoNwX3oru3Zu4YKwnLsYVwCT58zksDomXpgybfAF+Llm7cGptLP+bkES4Mf+Tx0 /LenmuT8G3PuJl6iWCghdjd47mu+4JSxFHJRzXUId8j+o5Ex+ieYGlyfn80UZ6Krosqo/9 rdoSjUCeprOSNTtMlODl9RrEBNTwj8oslvlpPYF0v4x3IXfKKJq0ytECb0ki4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e706512a2b64fa2741144caf056c9fe923b60004 commit e706512a2b64fa2741144caf056c9fe923b60004 Author: Yan Ka Chiu AuthorDate: 2022-07-13 01:16:29 +0000 Commit: Eric Joyner CommitDate: 2022-07-13 01:17:03 +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@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35649 --- 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 8b01ec8a718f..0b1604cc4918 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);