From nobody Wed Jun 05 00:00:24 2024 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 4Vv6zn6hxvz5N1Pt for ; Wed, 05 Jun 2024 00:00:37 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vv6zn4pYBz4KyY for ; Wed, 5 Jun 2024 00:00:37 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-35dc0472b7eso5440906f8f.2 for ; Tue, 04 Jun 2024 17:00:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717545636; x=1718150436; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=msowybomCip97HXh1HQAj4N0q1rr/2IVDSoqc8I8yvs=; b=rBxl4jmX6Q/YKMgXs6GHxoDhDUK/f3HvIWbmtw8Z5kf1sVKDyxHunZSZpn1vxqqGKG pew00EJa0tvbrvMSO3h274z2kJKrax0L9caVC7pKsv3WioIq6wE9t0zW4ETehJ/AjBEB qONsFboOr6o4XnTx7T5pAEe6nY0Ls2g3x3w/VL0Kr6Bz3uvfgfP4JLn4St3v0g42DU2L MRmAWNK81NFrc+Bv88TSTFlQKH9VmJBm9rsAnkS06c1F/7Eo1vwM5nZP8etqig/Z3w2Y cjKpOxaE7d8+sXNNjes6h8F11YjPUJMLvxQc6sO6IMUaNkhsR/Kp+N1i5fXeV9lZkMZt CTQA== X-Forwarded-Encrypted: i=1; AJvYcCX4ZmLNtW+LrKJy4vlzANXs5BMa/9cboqIy1hOE67oZ2UgxWEriYAVMmsIjyGIS9BUnJ0fcBqr9JZy9tjpytBu70NgQyF3NPZngB/Ag28kH5g== X-Gm-Message-State: AOJu0Yx8Tx534Q0OhYsmJDRHdyuK1t6ONwgdd+gTYprEviho5K8YyaGe hREQXEaMPM/y5Sp4qg5neYTCgKRQSbIfRTKQXrkeIKtcIZyvjMFhyhmI76QJBjc= X-Google-Smtp-Source: AGHT+IG1uR/5iuTvleKCiKhVUJ0QLxGlCu00hiu0CsLKE7LHtPueuzbJ3mUd+JZCzRzG19YRb+jtEQ== X-Received: by 2002:adf:e602:0:b0:357:1931:f1e with SMTP id ffacd0b85a97d-35e8ef857d4mr637151f8f.65.1717545635601; Tue, 04 Jun 2024 17:00:35 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04ca48dsm12847679f8f.29.2024.06.04.17.00.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2024 17:00:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: git: 871b33ad65ba - main - pci: Consistently use pci_vf_* for suballocated VF memory resources From: Jessica Clarke In-Reply-To: <202406042352.454NqFVj061328@gitrepo.freebsd.org> Date: Wed, 5 Jun 2024 01:00:24 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <587A0604-BF30-4A90-9B04-FC56C53BBF2A@freebsd.org> References: <202406042352.454NqFVj061328@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3774.500.171.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Vv6zn4pYBz4KyY On 5 Jun 2024, at 00:52, John Baldwin wrote: >=20 > The branch main has been updated by jhb: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D871b33ad65baf07c92cce120a4fc1978= c2ed7b3b >=20 > commit 871b33ad65baf07c92cce120a4fc1978c2ed7b3b > Author: John Baldwin > AuthorDate: 2024-06-04 23:51:37 +0000 > Commit: John Baldwin > CommitDate: 2024-06-04 23:51:37 +0000 >=20 > pci: Consistently use pci_vf_* for suballocated VF memory resources >=20 > Some of the bus resource methods were passing these up to the = parent > which triggered rman mismatch assertions in INVARIANTS kernels. >=20 > Reported by: kp > Reviewed by: imp > Tested by: kp (earlier version) > Differential Revision: https://reviews.freebsd.org/D45406 > --- > sys/dev/pci/pci.c | 118 ++++++++++++++++++++++++++++++++++-- > sys/dev/pci/pci_iov.c | 151 = ++++++++++++++++++++++++++++++++++++++++++++++ > sys/dev/pci/pci_private.h | 19 ++++++ > 3 files changed, 284 insertions(+), 4 deletions(-) >=20 > diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c > index 2cb8b4ce9fcc..2093d6a8b5ef 100644 > --- a/sys/dev/pci/pci.c > +++ b/sys/dev/pci/pci.c > @@ -164,10 +164,18 @@ static device_method_t pci_methods[] =3D { > DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), > DEVMETHOD(bus_delete_resource, pci_delete_resource), > DEVMETHOD(bus_alloc_resource, pci_alloc_resource), > +#ifdef PCI_IOV > + DEVMETHOD(bus_adjust_resource, pci_adjust_resource), > +#else > DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), > +#endif > DEVMETHOD(bus_release_resource, pci_release_resource), > DEVMETHOD(bus_activate_resource, pci_activate_resource), > DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), > +#ifdef PCI_IOV > + DEVMETHOD(bus_map_resource, pci_map_resource), > + DEVMETHOD(bus_unmap_resource, pci_unmap_resource), > +#endif > DEVMETHOD(bus_child_deleted, pci_child_deleted), > DEVMETHOD(bus_child_detached, pci_child_detached), > DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), Would it make sense to instead #ifdef parts of the body of pci_adjust_resource rather than switching which function you=E2=80=99re = using in the first place? I feel that is generally easier to understand, as there=E2=80=99s less conditionality, and it=E2=80=99s more easily = extensible if any other special cases come along. Jess