From owner-dev-commits-src-branches@freebsd.org Wed Jun 9 16:19:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C7D06500C4; Wed, 9 Jun 2021 16:19:59 +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 4G0XPq3scCz4s5D; Wed, 9 Jun 2021 16:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 6B4801EFD2; Wed, 9 Jun 2021 16:19:59 +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 159GJxGj044905; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 159GJxhd044904; Wed, 9 Jun 2021 16:19:59 GMT (envelope-from git) Date: Wed, 9 Jun 2021 16:19:59 GMT Message-Id: <202106091619.159GJxhd044904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: David Bright Subject: git: fe58db828934 - stable/12 - pciconf: Fix up pciconf -lc output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fe58db828934c40b5d84a6485573e04f6981f8b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 16:19:59 -0000 The branch stable/12 has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=fe58db828934c40b5d84a6485573e04f6981f8b6 commit fe58db828934c40b5d84a6485573e04f6981f8b6 Author: David Bright AuthorDate: 2021-05-24 19:02:43 +0000 Commit: David Bright CommitDate: 2021-06-09 16:19:10 +0000 pciconf: Fix up pciconf -lc output The pciconf command fails to emit newlines when particular ecap field values are seen. Fix them up. This has been seen on several systems at $JOB. The documentation for PCI capabilities says that capability type 0 should not be used once the spec for PCI capabilities was published, but that seems more wishful-thinking than reality. pciconf also chooses not to print fields related to field values that are zero, but it seems several of these fields are zero on actual hardware. Sponsored by: Dell EMC Isilon Submitted by: Robert Herndon (Robert.Herndon@dell.com) (cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514) --- usr.sbin/pciconf/cap.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index f990fdca7313..07f4b63bbcd2 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -854,8 +854,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t sta, mask; printf("AER %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4); mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4); printf(" %d fatal", bitcount32(sta & mask)); @@ -870,8 +872,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t cap1; printf("VC %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4); printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT); if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0) @@ -886,8 +890,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t high, low; printf("Serial %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4); high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4); printf(" %08x%08x\n", high, low); @@ -911,8 +917,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver) uint32_t val; printf("PCIe Sec %d", ver); - if (ver < 1) + if (ver < 1) { + printf("\n"); return; + } val = read_config(fd, &p->pc_sel, ptr + 8, 4); printf(" lane errors %#x\n", val); }