From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:31:38 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 5503F67472B; Mon, 20 Sep 2021 00:31:38 +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 4HCQV21YD7z3l3D; Mon, 20 Sep 2021 00:31:38 +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 158B326D11; Mon, 20 Sep 2021 00:31:38 +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 18K0Vcsp034786; Mon, 20 Sep 2021 00:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0VcPi034785; Mon, 20 Sep 2021 00:31:38 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:31:38 GMT Message-Id: <202109200031.18K0VcPi034785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a2e4c22a0e1a - stable/13 - bsd.lib.mk: add conditions for building _pie.a archives MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a2e4c22a0e1abf2983b86fdc6c214da84618ca75 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: Mon, 20 Sep 2021 00:31:38 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e4c22a0e1abf2983b86fdc6c214da84618ca75 commit a2e4c22a0e1abf2983b86fdc6c214da84618ca75 Author: Ed Maste AuthorDate: 2021-09-12 16:45:50 +0000 Commit: Ed Maste CommitDate: 2021-09-20 00:29:53 +0000 bsd.lib.mk: add conditions for building _pie.a archives As with other .a targets, build _pie.a archives only if LIB is set. At present we build _pie.a only for INTERNALLIBs, and none of them include bsd.lib.mk without setting LIB. However, we might want to build _pie.a for non-INTERNALLIBs in the future. Reviewed by: arichardson MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31920 (cherry picked from commit 7c0226cad3f36a05832f9c5216dfa3dadb91c92d) --- share/mk/bsd.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index db54055b7ae0..bbeaee82883b 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -380,7 +380,7 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS} .endif # !defined(INTERNALLIB) -.if defined(INTERNALLIB) && ${MK_PIE} != "no" +.if defined(INTERNALLIB) && ${MK_PIE} != "no" && defined(LIB) && !empty(LIB) PIEOBJS+= ${OBJS:.o=.pieo} DEPENDOBJS+= ${PIEOBJS} CLEANFILES+= ${PIEOBJS} From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:32:36 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 8DABC674792; Mon, 20 Sep 2021 00:32:36 +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 4HCQW83H7Lz3lSw; Mon, 20 Sep 2021 00:32:36 +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 5093226F01; Mon, 20 Sep 2021 00:32:36 +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 18K0Wa8c034981; Mon, 20 Sep 2021 00:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0Wasn034980; Mon, 20 Sep 2021 00:32:36 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:32:36 GMT Message-Id: <202109200032.18K0Wasn034980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 95ea87898f23 - stable/12 - bsd.lib.mk: add conditions for building _pie.a archives MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 95ea87898f2365015e1a8473e5c50e5126844648 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: Mon, 20 Sep 2021 00:32:36 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=95ea87898f2365015e1a8473e5c50e5126844648 commit 95ea87898f2365015e1a8473e5c50e5126844648 Author: Ed Maste AuthorDate: 2021-09-12 16:45:50 +0000 Commit: Ed Maste CommitDate: 2021-09-20 00:31:35 +0000 bsd.lib.mk: add conditions for building _pie.a archives As with other .a targets, build _pie.a archives only if LIB is set. At present we build _pie.a only for INTERNALLIBs, and none of them include bsd.lib.mk without setting LIB. However, we might want to build _pie.a for non-INTERNALLIBs in the future. Reviewed by: arichardson MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31920 (cherry picked from commit 7c0226cad3f36a05832f9c5216dfa3dadb91c92d) --- share/mk/bsd.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 3d7fe4a13343..1b98ad36280e 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -358,7 +358,7 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS} .endif # !defined(INTERNALLIB) -.if defined(INTERNALLIB) && ${MK_PIE} != "no" +.if defined(INTERNALLIB) && ${MK_PIE} != "no" && defined(LIB) && !empty(LIB) PIEOBJS+= ${OBJS:.o=.pieo} DEPENDOBJS+= ${PIEOBJS} CLEANFILES+= ${PIEOBJS} From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:48:20 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 DD67E6748AF; Mon, 20 Sep 2021 00:48:20 +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 4HCQsJ5qZfz3q8s; Mon, 20 Sep 2021 00:48:20 +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 A3DF726B59; Mon, 20 Sep 2021 00:48:20 +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 18K0mKxB048405; Mon, 20 Sep 2021 00:48:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0mKXd048404; Mon, 20 Sep 2021 00:48:20 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:48:20 GMT Message-Id: <202109200048.18K0mKXd048404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ecab307389ee - stable/13 - amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ecab307389eed81c7c3dd803954aa97a2bf04305 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: Mon, 20 Sep 2021 00:48:20 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ecab307389eed81c7c3dd803954aa97a2bf04305 commit ecab307389eed81c7c3dd803954aa97a2bf04305 Author: Konstantin Belousov AuthorDate: 2021-09-11 18:19:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-20 00:47:20 +0000 amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI (cherry picked from commit e99255c8a6cae324aeede7f5013d080a2d361e3f) --- sys/x86/acpica/acpi_wakeup.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index b4bbe660bea4..ef52ccc3aef6 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -164,16 +164,22 @@ acpi_wakeup_cpus(struct acpi_softc *sc) int cpu; u_char mpbiosreason; - /* save the current value of the warm-start vector */ - mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); - outb(CMOS_REG, BIOS_RESET); - mpbiosreason = inb(CMOS_DATA); - - /* setup a vector to our boot code */ - *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; - *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; - outb(CMOS_REG, BIOS_RESET); - outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ +#ifdef __amd64__ + if (!efi_boot) { +#endif + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ +#ifdef __amd64__ + } +#endif /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { @@ -197,11 +203,17 @@ acpi_wakeup_cpus(struct acpi_softc *sc) pmap_remap_lowptdi(false); #endif - /* restore the warmstart vector */ - *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; +#ifdef __amd64__ + if (!efi_boot) { +#endif + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; - outb(CMOS_REG, BIOS_RESET); - outb(CMOS_DATA, mpbiosreason); + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +#ifdef __amd64__ + } +#endif } #endif From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:48:21 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 E4A41674B8A; Mon, 20 Sep 2021 00:48:21 +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 4HCQsK63ddz3q4g; Mon, 20 Sep 2021 00:48:21 +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 B0CFF270B6; Mon, 20 Sep 2021 00:48:21 +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 18K0mLRq048429; Mon, 20 Sep 2021 00:48:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0mLx0048428; Mon, 20 Sep 2021 00:48:21 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:48:21 GMT Message-Id: <202109200048.18K0mLx0048428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 70f86bbf09a1 - stable/13 - x86 acpi_install_wakeup_handler(): style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70f86bbf09a171bba2616dd6e1cabae83655d5ff 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: Mon, 20 Sep 2021 00:48:22 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=70f86bbf09a171bba2616dd6e1cabae83655d5ff commit 70f86bbf09a171bba2616dd6e1cabae83655d5ff Author: Konstantin Belousov AuthorDate: 2021-09-11 18:26:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-20 00:47:20 +0000 x86 acpi_install_wakeup_handler(): style (cherry picked from commit ceca8ac1ce47e1f87ba09463aa84eb1c879c37d9) --- sys/x86/acpica/acpi_wakeup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index ef52ccc3aef6..17946ede45d0 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -423,12 +423,12 @@ freepages: void acpi_install_wakeup_handler(struct acpi_softc *sc) { - static void *wakeaddr; - void *wakepages[ACPI_WAKEPAGES]; + static void *wakeaddr; + void *wakepages[ACPI_WAKEPAGES]; #ifdef __amd64__ - uint64_t *pt5, *pt4, *pt3, *pt2; - vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; - int i; + uint64_t *pt5, *pt4, *pt3, *pt2; + vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; + int i; #endif if (wakeaddr != NULL) From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:48:23 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 486636748B0; Mon, 20 Sep 2021 00:48:23 +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 4HCQsM0nk2z3q8x; Mon, 20 Sep 2021 00:48:23 +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 D080426F53; Mon, 20 Sep 2021 00:48:22 +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 18K0mMqp048453; Mon, 20 Sep 2021 00:48:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0mM99048452; Mon, 20 Sep 2021 00:48:22 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:48:22 GMT Message-Id: <202109200048.18K0mM99048452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1a377b8415fa - stable/13 - amd64 acpi_wakeup: map 1:1 whole low 4G for the trampoline page table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a377b8415faae300cc325f870148ed112422ce6 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: Mon, 20 Sep 2021 00:48:23 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1a377b8415faae300cc325f870148ed112422ce6 commit 1a377b8415faae300cc325f870148ed112422ce6 Author: Konstantin Belousov AuthorDate: 2021-09-11 18:36:38 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-20 00:47:20 +0000 amd64 acpi_wakeup: map 1:1 whole low 4G for the trampoline page table PR: 258432 (cherry picked from commit db2ba218d9fe6a541a4f537a641cce95f952fd98) --- sys/x86/acpica/acpi_wakeup.c | 77 +++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index 17946ede45d0..68e0892a31e6 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -99,7 +99,7 @@ static void acpi_wakeup_cpus(struct acpi_softc *); #endif #ifdef __amd64__ -#define ACPI_WAKEPAGES 5 +#define ACPI_WAKEPAGES 8 #else #define ACPI_WAKEPAGES 1 #endif @@ -426,8 +426,8 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) static void *wakeaddr; void *wakepages[ACPI_WAKEPAGES]; #ifdef __amd64__ - uint64_t *pt5, *pt4, *pt3, *pt2; - vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; + uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; + vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; #endif @@ -443,15 +443,21 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) #ifdef __amd64__ if (la57) { - pt5 = wakepages[4]; + pt5 = wakepages[7]; pt5pa = vtophys(pt5); } pt4 = wakepages[1]; pt3 = wakepages[2]; - pt2 = wakepages[3]; + pt2_0 = wakepages[3]; + pt2_1 = wakepages[4]; + pt2_2 = wakepages[5]; + pt2_3 = wakepages[6]; pt4pa = vtophys(pt4); pt3pa = vtophys(pt3); - pt2pa = vtophys(pt2); + pt2_0pa = vtophys(pt2_0); + pt2_1pa = vtophys(pt2_1); + pt2_2pa = vtophys(pt2_2); + pt2_3pa = vtophys(pt2_3); #endif bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); @@ -473,31 +479,44 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) #ifndef __amd64__ WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); #else /* __amd64__ */ - /* Create the initial 1GB replicated page tables */ - for (i = 0; i < NPTEPG; i++) { - if (la57) { - pt5[i] = (uint64_t)pt4pa; - pt5[i] |= PG_V | PG_RW | PG_U; - } - - /* - * Each slot of the level 4 pages points - * to the same level 3 page - */ - pt4[i] = (uint64_t)pt3pa; - pt4[i] |= PG_V | PG_RW | PG_U; - - /* - * Each slot of the level 3 pages points - * to the same level 2 page - */ - pt3[i] = (uint64_t)pt2pa; - pt3[i] |= PG_V | PG_RW | PG_U; + /* Create 1:1 mapping for the low 4G */ + if (la57) { + bcopy(kernel_pmap->pm_pmltop, pt5, PAGE_SIZE); + pt5[0] = (uint64_t)pt4pa; + pt5[0] |= PG_V | PG_RW | PG_U; + } else { + bcopy(kernel_pmap->pm_pmltop, pt4, PAGE_SIZE); + } - /* The level 2 page slots are mapped with 2MB pages for 1GB. */ - pt2[i] = i * NBPDR; - pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; + pt4[0] = (uint64_t)pt3pa; + pt4[0] |= PG_V | PG_RW | PG_U; + + pt3[0] = (uint64_t)pt2_0pa; + pt3[0] |= PG_V | PG_RW | PG_U; + pt3[1] = (uint64_t)pt2_1pa; + pt3[1] |= PG_V | PG_RW | PG_U; + pt3[2] = (uint64_t)pt2_2pa; + pt3[2] |= PG_V | PG_RW | PG_U; + pt3[3] = (uint64_t)pt2_3pa; + pt3[3] |= PG_V | PG_RW | PG_U; + + for (i = 0; i < NPDEPG; i++) { + pt2_0[i] = (pd_entry_t)i * NBPDR; + pt2_0[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + for (i = 0; i < NPDEPG; i++) { + pt2_1[i] = (pd_entry_t)NBPDP + i * NBPDR; + pt2_1[i] |= PG_V | PG_RW | PG_PS | PG_U; } + for (i = 0; i < NPDEPG; i++) { + pt2_2[i] = (pd_entry_t)2 * NBPDP + i * NBPDR; + pt2_2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + for (i = 0; i < NPDEPG; i++) { + pt2_3[i] = (pd_entry_t)3 * NBPDP + i * NBPDR; + pt2_3[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + #endif /* !__amd64__ */ if (bootverbose) From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:48:24 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 5CBDF674B7D; Mon, 20 Sep 2021 00:48:24 +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 4HCQsN0dCYz3q90; Mon, 20 Sep 2021 00:48:24 +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 E1EBE26B5A; Mon, 20 Sep 2021 00:48:23 +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 18K0mNOQ048477; Mon, 20 Sep 2021 00:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0mNvo048476; Mon, 20 Sep 2021 00:48:23 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:48:23 GMT Message-Id: <202109200048.18K0mNvo048476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: de1aeb942830 - stable/13 - x86: duplicate acpi_wakeup.c per i386 and amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: de1aeb9428301529d58d03fdde9d32afc81533b8 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: Mon, 20 Sep 2021 00:48:24 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de1aeb9428301529d58d03fdde9d32afc81533b8 commit de1aeb9428301529d58d03fdde9d32afc81533b8 Author: Konstantin Belousov AuthorDate: 2021-09-12 19:24:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-20 00:47:21 +0000 x86: duplicate acpi_wakeup.c per i386 and amd64 (cherry picked from commit 2b6eec531a1b52621223316f7c2940ed1e293886) --- sys/{x86 => amd64}/acpica/acpi_wakeup.c | 87 +------ sys/conf/files.amd64 | 1 + sys/conf/files.i386 | 1 + sys/conf/files.x86 | 1 - sys/i386/acpica/acpi_wakeup.c | 391 ++++++++++++++++++++++++++++++++ 5 files changed, 394 insertions(+), 87 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c similarity index 86% rename from sys/x86/acpica/acpi_wakeup.c rename to sys/amd64/acpica/acpi_wakeup.c index 68e0892a31e6..fba9532e9a64 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -32,12 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#if defined(__amd64__) -#define DEV_APIC -#else -#include "opt_apic.h" -#endif - #include #include #include @@ -60,10 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef DEV_APIC #include #include -#endif #ifdef SMP #include #include @@ -98,11 +90,7 @@ static int acpi_wakeup_ap(struct acpi_softc *, int); static void acpi_wakeup_cpus(struct acpi_softc *); #endif -#ifdef __amd64__ #define ACPI_WAKEPAGES 8 -#else -#define ACPI_WAKEPAGES 1 -#endif #define WAKECODE_FIXUP(offset, type, val) do { \ type *addr; \ @@ -144,13 +132,8 @@ acpi_wakeup_ap(struct acpi_softc *sc, int cpu) } #define WARMBOOT_TARGET 0 -#ifdef __amd64__ #define WARMBOOT_OFF (KERNBASE + 0x0467) #define WARMBOOT_SEG (KERNBASE + 0x0469) -#else /* __i386__ */ -#define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) -#define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) -#endif #define CMOS_REG (0x70) #define CMOS_DATA (0x71) @@ -164,9 +147,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc) int cpu; u_char mpbiosreason; -#ifdef __amd64__ if (!efi_boot) { -#endif /* save the current value of the warm-start vector */ mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); outb(CMOS_REG, BIOS_RESET); @@ -177,9 +158,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc) *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ -#ifdef __amd64__ } -#endif /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { @@ -193,27 +172,13 @@ acpi_wakeup_cpus(struct acpi_softc *sc) } } -#ifdef __i386__ - /* - * Remove the identity mapping of low memory for all CPUs and sync - * the TLB for the BSP. The APs are now spinning in - * cpususpend_handler() and we will release them soon. Then each - * will invalidate its TLB. - */ - pmap_remap_lowptdi(false); -#endif - -#ifdef __amd64__ if (!efi_boot) { -#endif /* restore the warmstart vector */ *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, mpbiosreason); -#ifdef __amd64__ } -#endif } #endif @@ -222,10 +187,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; struct pcb *pcb; -#ifdef __amd64__ struct pcpu *pc; int i; -#endif if (sc->acpi_wakeaddr == 0ul) return (-1); /* couldn't alloc wake memory */ @@ -244,18 +207,13 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) pcb = &susppcbs[0]->sp_pcb; if (savectx(pcb)) { -#ifdef __amd64__ fpususpend(susppcbs[0]->sp_fpususpend); -#else - npxsuspend(susppcbs[0]->sp_fpususpend); -#endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { device_printf(sc->acpi_dev, "Failed to suspend APs\n"); return (0); /* couldn't sleep */ } #endif -#ifdef __amd64__ hw_ibrs_ibpb_active = 0; hw_ssb_active = 0; cpu_stdext_feature3 = 0; @@ -263,36 +221,16 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) pc = pcpu_find(i); pc->pc_ibpb_set = 0; } -#endif WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); -#ifdef __amd64__ WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & ~(EFER_LMA)); -#else - if ((amd_feature & AMDID_NX) != 0) - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); - WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); -#endif WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); -#ifdef __i386__ - /* - * Map some low memory with virt == phys for ACPI wakecode - * to use to jump to high memory after enabling paging. This - * is the same as for similar jump in locore, except the - * jump is a single instruction, and we know its address - * more precisely so only need a single PTD, and we have to - * be careful to use the kernel map (PTD[0] is for curthread - * which may be a user thread in deprecated APIs). - */ - pmap_remap_lowptdi(true); -#endif - /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); @@ -317,11 +255,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) * this point. */ cnresume(); -#ifdef __amd64__ fpuresume(susppcbs[0]->sp_fpususpend); -#else - npxresume(susppcbs[0]->sp_fpususpend); -#endif } return (1); /* wakeup successfully */ @@ -343,9 +277,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); -#ifdef DEV_APIC lapic_xapic_mode(); -#endif #ifdef SMP if (!CPU_EMPTY(&suspcpus)) acpi_wakeup_cpus(sc); @@ -357,10 +289,8 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, resume_cpus(suspcpus); #endif mca_resume(); -#ifdef __amd64__ if (vmm_resume_p != NULL) vmm_resume_p(); -#endif intr_resume(/*suspend_cancelled*/false); AcpiSetFirmwareWakingVector(0, 0); @@ -390,11 +320,7 @@ acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) */ for (i = 0; i < ACPI_WAKEPAGES; i++) { wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT -#ifdef __i386__ - | M_EXEC -#endif - , 0x500, 0xa0000, PAGE_SIZE, 0ul); + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); if (wakepages[i] == NULL) { printf("%s: can't alloc wake memory\n", __func__); goto freepages; @@ -425,11 +351,9 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) { static void *wakeaddr; void *wakepages[ACPI_WAKEPAGES]; -#ifdef __amd64__ uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; -#endif if (wakeaddr != NULL) return; @@ -441,7 +365,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; sc->acpi_wakephys = vtophys(wakeaddr); -#ifdef __amd64__ if (la57) { pt5 = wakepages[7]; pt5pa = vtophys(pt5); @@ -458,7 +381,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) pt2_1pa = vtophys(pt2_1); pt2_2pa = vtophys(pt2_2); pt2_3pa = vtophys(pt2_3); -#endif bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); @@ -467,18 +389,13 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) sc->acpi_wakephys + bootgdt); WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, sc->acpi_wakephys + wakeup_32); -#ifdef __amd64__ WAKECODE_FIXUP((wakeup_sw64 + 1), uint32_t, sc->acpi_wakephys + wakeup_64); WAKECODE_FIXUP(wakeup_pagetables, uint32_t, la57 ? (pt5pa | 0x1) : pt4pa); -#endif /* Save pointers to some global data. */ WAKECODE_FIXUP(wakeup_ret, void *, resumectx); -#ifndef __amd64__ - WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); -#else /* __amd64__ */ /* Create 1:1 mapping for the low 4G */ if (la57) { bcopy(kernel_pmap->pm_pmltop, pt5, PAGE_SIZE); @@ -517,8 +434,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) pt2_3[i] |= PG_V | PG_RW | PG_PS | PG_U; } -#endif /* !__amd64__ */ - if (bootverbose) device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index b1593006e110..55456b2d1b90 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -73,6 +73,7 @@ ia32_assym.h standard \ clean "ia32_assym.h" # amd64/acpica/acpi_machdep.c optional acpi +amd64/acpica/acpi_wakeup.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/amd64/acpica/acpi_wakecode.S assym.inc" \ compile-with "${NORMAL_S}" \ diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 926451976372..5c65ad53cea4 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -132,6 +132,7 @@ dev/vmd/vmd.c optional vmd dev/acpi_support/acpi_wmi_if.m standard dev/wbwd/wbwd.c optional wbwd i386/acpica/acpi_machdep.c optional acpi +i386/acpica/acpi_wakeup.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.inc" \ compile-with "${NORMAL_S}" \ diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index 7df289375cd3..fba4cb1eb863 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -301,7 +301,6 @@ libkern/x86/crc32_sse42.c standard # x86/acpica/OsdEnvironment.c optional acpi x86/acpica/acpi_apm.c optional acpi -x86/acpica/acpi_wakeup.c optional acpi x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios x86/bios/vpd.c optional vpd diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c new file mode 100644 index 000000000000..682e9613962f --- /dev/null +++ b/sys/i386/acpica/acpi_wakeup.c @@ -0,0 +1,391 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2001 Takanori Watanabe + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_apic.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DEV_APIC +#include +#include +#endif +#ifdef SMP +#include +#include +#endif + +#include + +#include + +#include "acpi_wakecode.h" +#include "acpi_wakedata.h" + +/* Make sure the code is less than a page and leave room for the stack. */ +CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); + +extern int acpi_resume_beep; +extern int acpi_reset_video; +extern int acpi_susp_bounce; + +#ifdef SMP +extern struct susppcb **susppcbs; +static cpuset_t suspcpus; +#else +static struct susppcb **susppcbs; +#endif + +static void *acpi_alloc_wakeup_handler(void **); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *); +#endif + +#define ACPI_WAKEPAGES 1 + +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(sc->acpi_wakeaddr + (offset)); \ + *addr = val; \ +} while (0) + +static void +acpi_stop_beep(void *arg) +{ + + if (acpi_resume_beep != 0) + timer_spkr_release(); +} + +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + struct pcb *pcb; + int vector = (sc->acpi_wakephys >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + pcb = &susppcbs[cpu]->sp_pcb; + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); + + ipi_startup(apic_id, vector); + + /* Wait up to 5 seconds for it to resume. */ + for (ms = 0; ms < 5000; ms++) { + if (!CPU_ISSET(cpu, &suspended_cpus)) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) +#define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) + +static void +acpi_wakeup_cpus(struct acpi_softc *sc) +{ + uint32_t mpbioswarmvec; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, &suspcpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* + * Remove the identity mapping of low memory for all CPUs and sync + * the TLB for the BSP. The APs are now spinning in + * cpususpend_handler() and we will release them soon. Then each + * will invalidate its TLB. + */ + pmap_remap_lowptdi(false); + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +} +#endif + +int +acpi_sleep_machdep(struct acpi_softc *sc, int state) +{ + ACPI_STATUS status; + struct pcb *pcb; + + if (sc->acpi_wakeaddr == 0ul) + return (-1); /* couldn't alloc wake memory */ + +#ifdef SMP + suspcpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &suspcpus); +#endif + + if (acpi_resume_beep != 0) + timer_spkr_acquire(); + + AcpiSetFirmwareWakingVector(sc->acpi_wakephys, 0); + + intr_suspend(); + + pcb = &susppcbs[0]->sp_pcb; + if (savectx(pcb)) { + npxsuspend(susppcbs[0]->sp_fpususpend); +#ifdef SMP + if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { + device_printf(sc->acpi_dev, "Failed to suspend APs\n"); + return (0); /* couldn't sleep */ + } +#endif + + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); + + if ((amd_feature & AMDID_NX) != 0) + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); + + /* + * Map some low memory with virt == phys for ACPI wakecode + * to use to jump to high memory after enabling paging. This + * is the same as for similar jump in locore, except the + * jump is a single instruction, and we know its address + * more precisely so only need a single PTD, and we have to + * be careful to use the kernel map (PTD[0] is for curthread + * which may be a user thread in deprecated APIs). + */ + pmap_remap_lowptdi(true); + + /* Call ACPICA to enter the desired sleep state */ + if (state == ACPI_STATE_S4 && sc->acpi_s4bios) + status = AcpiEnterSleepStateS4bios(); + else + status = AcpiEnterSleepState(state); + if (ACPI_FAILURE(status)) { + device_printf(sc->acpi_dev, + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); + return (0); /* couldn't sleep */ + } + + if (acpi_susp_bounce) + resumectx(pcb); + + for (;;) + ia32_pause(); + } else { + /* + * Re-initialize console hardware as soon as possibe. + * No console output (e.g. printf) is allowed before + * this point. + */ + cnresume(); + npxresume(susppcbs[0]->sp_fpususpend); + } + + return (1); /* wakeup successfully */ +} + +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, + int intr_enabled) +{ + + if (sleep_result == -1) + return (sleep_result); + + if (!intr_enabled) { + /* Wakeup MD procedures in interrupt disabled context */ + if (sleep_result == 1) { + ucode_reload(); + pmap_init_pat(); + initializecpu(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); +#ifdef DEV_APIC + lapic_xapic_mode(); +#endif +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + acpi_wakeup_cpus(sc); +#endif + } + +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + resume_cpus(suspcpus); +#endif + mca_resume(); + intr_resume(/*suspend_cancelled*/false); + + AcpiSetFirmwareWakingVector(0, 0); + } else { + /* Wakeup MD procedures in interrupt enabled context */ + if (sleep_result == 1 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + } + + return (sleep_result); +} + +static void * +acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) +{ + int i; + + memset(wakepages, 0, ACPI_WAKEPAGES * sizeof(*wakepages)); + + /* + * Specify the region for our wakeup code. We want it in the low 1 MB + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. + */ + for (i = 0; i < ACPI_WAKEPAGES; i++) { + wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, + M_NOWAIT | M_EXEC, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (wakepages[i] == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + goto freepages; + } + } + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + goto freepages; + } + susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { + susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); + susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); + } + + return (wakepages); + +freepages: + for (i = 0; i < ACPI_WAKEPAGES; i++) + if (wakepages[i] != NULL) + contigfree(wakepages[i], PAGE_SIZE, M_DEVBUF); + return (NULL); +} + +void +acpi_install_wakeup_handler(struct acpi_softc *sc) +{ + static void *wakeaddr; + void *wakepages[ACPI_WAKEPAGES]; + + if (wakeaddr != NULL) + return; + + if (acpi_alloc_wakeup_handler(wakepages) == NULL) + return; + + wakeaddr = wakepages[0]; + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); + + bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); + + /* Patch GDT base address, ljmp targets. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + sc->acpi_wakephys + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + sc->acpi_wakephys + wakeup_32); + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_ret, void *, resumectx); + WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", + (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); +} From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:48:25 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 727DD674B8D; Mon, 20 Sep 2021 00:48:25 +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 4HCQsP1wBDz3qBt; Mon, 20 Sep 2021 00:48:25 +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 110EC26B5B; Mon, 20 Sep 2021 00:48:25 +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 18K0mOhO048508; Mon, 20 Sep 2021 00:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0mOfG048507; Mon, 20 Sep 2021 00:48:24 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:48:24 GMT Message-Id: <202109200048.18K0mOfG048507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f604ea06307b - stable/13 - amd64 wakeup: rework trampoline page allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f604ea06307b84e71c5a4710cec0166aaa060b4b 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: Mon, 20 Sep 2021 00:48:25 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f604ea06307b84e71c5a4710cec0166aaa060b4b commit f604ea06307b84e71c5a4710cec0166aaa060b4b Author: Konstantin Belousov AuthorDate: 2021-09-12 19:41:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-20 00:47:21 +0000 amd64 wakeup: rework trampoline page allocation (cherry picked from commit 1c56781cc915d1d2957e5b53717513193476d777) --- sys/amd64/acpica/acpi_wakeup.c | 79 +++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index fba9532e9a64..0f04ccb6f2fc 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -82,7 +83,6 @@ static cpuset_t suspcpus; static struct susppcb **susppcbs; #endif -static void *acpi_alloc_wakeup_handler(void **); static void acpi_stop_beep(void *); #ifdef SMP @@ -90,7 +90,7 @@ static int acpi_wakeup_ap(struct acpi_softc *, int); static void acpi_wakeup_cpus(struct acpi_softc *); #endif -#define ACPI_WAKEPAGES 8 +#define ACPI_WAKEPT_PAGES 7 #define WAKECODE_FIXUP(offset, type, val) do { \ type *addr; \ @@ -304,27 +304,35 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, return (sleep_result); } -static void * -acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) +static void +acpi_alloc_wakeup_handler(void **wakeaddr, + void *wakept_pages[ACPI_WAKEPT_PAGES]) { - int i; + vm_page_t wakept_m[ACPI_WAKEPT_PAGES]; + int i; - memset(wakepages, 0, ACPI_WAKEPAGES * sizeof(*wakepages)); + *wakeaddr = NULL; + memset(wakept_pages, 0, ACPI_WAKEPT_PAGES * sizeof(*wakept_pages)); + memset(wakept_m, 0, ACPI_WAKEPT_PAGES * sizeof(*wakept_m)); /* - * Specify the region for our wakeup code. We want it in the low 1 MB - * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA - * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), - * and ROM area (0xa0000 and above). The temporary page tables must be - * page-aligned. + * Specify the region for our wakeup code. We want it in the + * low 1 MB region, excluding real mode IVT (0-0x3ff), BDA + * (0x400-0x4ff), EBDA (less than 128KB, below 0xa0000, must + * be excluded by SMAP and DSDT), and ROM area (0xa0000 and + * above). */ - for (i = 0; i < ACPI_WAKEPAGES; i++) { - wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); - if (wakepages[i] == NULL) { - printf("%s: can't alloc wake memory\n", __func__); - goto freepages; - } + *wakeaddr = contigmalloc(PAGE_SIZE, M_DEVBUF, + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (*wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + goto freepages; + } + + for (i = 0; i < ACPI_WAKEPT_PAGES - (la57 ? 0 : 1); i++) { + wakept_m[i] = pmap_page_alloc_below_4g(true); + wakept_pages[i] = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS( + wakept_m[i])); } if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, EVENTHANDLER_PRI_LAST) == NULL) { @@ -336,45 +344,46 @@ acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); } - - return (wakepages); + return; freepages: - for (i = 0; i < ACPI_WAKEPAGES; i++) - if (wakepages[i] != NULL) - contigfree(wakepages[i], PAGE_SIZE, M_DEVBUF); - return (NULL); + if (*wakeaddr != NULL) + contigfree(*wakeaddr, PAGE_SIZE, M_DEVBUF); + for (i = 0; i < ACPI_WAKEPT_PAGES; i++) { + if (wakept_m[i] != NULL) + vm_page_free(wakept_m[i]); + } + *wakeaddr = NULL; } void acpi_install_wakeup_handler(struct acpi_softc *sc) { static void *wakeaddr; - void *wakepages[ACPI_WAKEPAGES]; + void *wakept_pages[ACPI_WAKEPT_PAGES]; uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; if (wakeaddr != NULL) return; - - if (acpi_alloc_wakeup_handler(wakepages) == NULL) + acpi_alloc_wakeup_handler(&wakeaddr, wakept_pages); + if (wakeaddr == NULL) return; - wakeaddr = wakepages[0]; sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; sc->acpi_wakephys = vtophys(wakeaddr); if (la57) { - pt5 = wakepages[7]; + pt5 = wakept_pages[6]; pt5pa = vtophys(pt5); } - pt4 = wakepages[1]; - pt3 = wakepages[2]; - pt2_0 = wakepages[3]; - pt2_1 = wakepages[4]; - pt2_2 = wakepages[5]; - pt2_3 = wakepages[6]; + pt4 = wakept_pages[0]; + pt3 = wakept_pages[1]; + pt2_0 = wakept_pages[2]; + pt2_1 = wakept_pages[3]; + pt2_2 = wakept_pages[4]; + pt2_3 = wakept_pages[5]; pt4pa = vtophys(pt4); pt3pa = vtophys(pt3); pt2_0pa = vtophys(pt2_0); From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 00:57:20 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 CBFD4674D2B; Mon, 20 Sep 2021 00:57:20 +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 4HCR3h5NHLz3s1P; Mon, 20 Sep 2021 00:57:20 +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 97C242730D; Mon, 20 Sep 2021 00:57:20 +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 18K0vKOq061430; Mon, 20 Sep 2021 00:57:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K0vKpK061429; Mon, 20 Sep 2021 00:57:20 GMT (envelope-from git) Date: Mon, 20 Sep 2021 00:57:20 GMT Message-Id: <202109200057.18K0vKpK061429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 9b8da0026ba3 - stable/13 - targ(4): Remove D_NEEDGIANT. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b8da0026ba398c892c087296030a4cae2d5a338 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: Mon, 20 Sep 2021 00:57:20 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=9b8da0026ba398c892c087296030a4cae2d5a338 commit 9b8da0026ba398c892c087296030a4cae2d5a338 Author: Alexander Motin AuthorDate: 2021-08-21 15:20:54 +0000 Commit: Alexander Motin CommitDate: 2021-09-20 00:57:17 +0000 targ(4): Remove D_NEEDGIANT. I don't believe this code needs Giant, if ever needed. MFC after: 1 month (cherry picked from commit f3dcedd3de27b1a8f493c8256103e8a7fb93f5a4) --- sys/cam/scsi/scsi_target.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index b2874f49f13f..dd06ca7d64ba 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -115,7 +115,6 @@ static struct filterops targread_filtops = { static struct cdevsw targ_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = targopen, .d_read = targread, .d_write = targwrite, From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 01:29:36 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 9DC1D6752A9; Mon, 20 Sep 2021 01:29:36 +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 4HCRmw3xRqz4WNv; Mon, 20 Sep 2021 01:29:36 +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 67192272E7; Mon, 20 Sep 2021 01:29:36 +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 18K1Taaf001756; Mon, 20 Sep 2021 01:29:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18K1Ta0W001755; Mon, 20 Sep 2021 01:29:36 GMT (envelope-from git) Date: Mon, 20 Sep 2021 01:29:36 GMT Message-Id: <202109200129.18K1Ta0W001755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f8c4000ca683 - stable/13 - libprocstat: extend zfs_defs hack for .pieo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8c4000ca683e3f4762be683e041519f1398777d 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: Mon, 20 Sep 2021 01:29:36 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c4000ca683e3f4762be683e041519f1398777d commit f8c4000ca683e3f4762be683e041519f1398777d Author: Ed Maste AuthorDate: 2021-09-12 23:04:31 +0000 Commit: Ed Maste CommitDate: 2021-09-20 01:28:26 +0000 libprocstat: extend zfs_defs hack for .pieo By default _pie.a archives are built only for INTERNALLIBs, so there is usually no need for zfs_defs.pieo to exist. However, some experimental work builds _pie.a archives for everything. Extend the existing set of zfs_defs hacks to build zfs_defs.pieo as well. Reviewed by: arichardson MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31924 (cherry picked from commit b9df18d6e8917a9bfb62babb7cf9efeca23aa2fc) --- lib/libprocstat/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile index 2e60a7b0dc4d..e8ca072066d5 100644 --- a/lib/libprocstat/Makefile +++ b/lib/libprocstat/Makefile @@ -64,6 +64,8 @@ zfs/zfs_defs.o: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o zfs/zfs_defs.pico: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico +zfs/zfs_defs.pieo: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pieo zfs/zfs_defs.po: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po .endif From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 20:22:42 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 9B0A16AD290; Mon, 20 Sep 2021 20:22:42 +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 4HCwwL43PFz3ByK; Mon, 20 Sep 2021 20:22:42 +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 612E61719A; Mon, 20 Sep 2021 20:22:42 +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 18KKMgmN021799; Mon, 20 Sep 2021 20:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KKMg8V021798; Mon, 20 Sep 2021 20:22:42 GMT (envelope-from git) Date: Mon, 20 Sep 2021 20:22:42 GMT Message-Id: <202109202022.18KKMg8V021798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0f28c893a8b7 - stable/12 - Remove unnecessary WITNESS check in x86 bus_dma MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0f28c893a8b7b24e778e849acf699ac35c5117d0 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: Mon, 20 Sep 2021 20:22:42 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0f28c893a8b7b24e778e849acf699ac35c5117d0 commit 0f28c893a8b7b24e778e849acf699ac35c5117d0 Author: Jason A. Harmening AuthorDate: 2020-06-03 00:16:36 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-20 20:22:29 +0000 Remove unnecessary WITNESS check in x86 bus_dma When I did some bus_dma cleanup in r320528, I brought forward some sketchy WITNESS checks from the prior x86 busdma wrappers, instead of recognizing them as technical debt and just dropping them. Two of these were removed in r346351 and r346851, but one remains in bounce_bus_dmamem_alloc(). This check could be constrained to only apply in the BUS_DMA_NOWAIT case, but it's cleaner to simply remove it and rely on the checks already present in the sleepable allocation paths used by this function. While here, remove another unnecessary witness check in bus_dma_tag_create (the tag is always allocated with M_NOWAIT), and fix a couple of typos. Reported by: cem Reviewed by: kib, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25107 (cherry picked from commit 1dccf71b4b6dca1a912f3085918239559498c508) --- sys/x86/x86/busdma_bounce.c | 4 +--- sys/x86/x86/busdma_machdep.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index d25f29ff8e38..462ab66888e2 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -406,8 +406,6 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, vm_memattr_t attr; int mflags; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - if (flags & BUS_DMA_NOWAIT) mflags = M_NOWAIT; else @@ -491,7 +489,7 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, } /* - * Free a piece of memory and it's allociated dmamap, that was allocated + * Free a piece of memory and its associated dmamap, that was allocated * via bus_dmamem_alloc. Make the same choice for free/contigfree. */ static void diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c index 152fec591417..e0286c9d6f96 100644 --- a/sys/x86/x86/busdma_machdep.c +++ b/sys/x86/x86/busdma_machdep.c @@ -223,8 +223,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, struct bus_dma_tag_common *tc; int error; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - if (parent == NULL) { error = bus_dma_bounce_impl.tag_create(parent, alignment, boundary, lowaddr, highaddr, filter, filterarg, maxsize, From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 20:50:41 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 A6F426AD85C; Mon, 20 Sep 2021 20:50:41 +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 4HCxXd3Nwjz3D6w; Mon, 20 Sep 2021 20:50:41 +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 5612517786; Mon, 20 Sep 2021 20:50:41 +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 18KKoff2057410; Mon, 20 Sep 2021 20:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KKofB9057409; Mon, 20 Sep 2021 20:50:41 GMT (envelope-from git) Date: Mon, 20 Sep 2021 20:50:41 GMT Message-Id: <202109202050.18KKofB9057409@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: 6583e845436e - stable/13 - ixl(4): Add tunable to override Flow Control settings 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: 6583e845436e45024316b4fdaa47d6a0d25fb37a 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: Mon, 20 Sep 2021 20:50:41 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=6583e845436e45024316b4fdaa47d6a0d25fb37a commit 6583e845436e45024316b4fdaa47d6a0d25fb37a Author: Krzysztof Galazka AuthorDate: 2021-04-05 18:08:33 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 20:42:13 +0000 ixl(4): Add tunable to override Flow Control settings Add flow_control to hw.ixl tunables tree to let override initial flow control configuration for all interfaces. Keep using configuration set by NVM by default. Reviewed by: erj@, gallatin@ Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D29338 (cherry picked from commit 20a52706c814ccfd91c65586404abd2a1563a330) --- sys/dev/ixl/if_ixl.c | 19 +++++++++++++++++++ sys/dev/ixl/ixl_pf_iflib.c | 2 +- sys/dev/ixl/ixl_pf_main.c | 40 +++++++++++++++++++++++----------------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index c700af889cf1..3b49da5d76b9 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -304,6 +304,10 @@ TUNABLE_INT("hw.ixl.tx_itr", &ixl_tx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, tx_itr, CTLFLAG_RDTUN, &ixl_tx_itr, 0, "TX Interrupt Rate"); +static int ixl_flow_control = -1; +SYSCTL_INT(_hw_ixl, OID_AUTO, flow_control, CTLFLAG_RDTUN, + &ixl_flow_control, 0, "Initial Flow Control setting"); + #ifdef IXL_IW int ixl_enable_iwarp = 0; TUNABLE_INT("hw.ixl.enable_iwarp", &ixl_enable_iwarp); @@ -1892,5 +1896,20 @@ ixl_save_pf_tunables(struct ixl_pf *pf) pf->rx_itr = IXL_ITR_8K; } else pf->rx_itr = ixl_rx_itr; + + pf->fc = -1; + if (ixl_flow_control != -1) { + if (ixl_flow_control < 0 || ixl_flow_control > 3) { + device_printf(dev, + "Invalid flow_control value of %d set!\n", + ixl_flow_control); + device_printf(dev, + "flow_control must be between %d and %d, " + "inclusive\n", 0, 3); + device_printf(dev, + "Using default configuration instead\n"); + } else + pf->fc = ixl_flow_control; + } } diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 23d9f30299a9..68a174889c41 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -1094,7 +1094,7 @@ ixl_sysctl_set_flowcntl(SYSCTL_HANDLER_ARGS) aq_error = i40e_set_fc(hw, &fc_aq_err, TRUE); if (aq_error) { device_printf(dev, - "%s: Error setting new fc mode %d; fc_err %#x\n", + "%s: Error setting Flow Control mode %d; fc_err %#x\n", __func__, aq_error, fc_aq_err); return (EIO); } diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index b546701608f1..896da955843a 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -3169,27 +3169,28 @@ ixl_set_link(struct ixl_pf *pf, bool enable) config.phy_type = 0; config.phy_type_ext = 0; + config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX); + + switch (pf->fc) { + case I40E_FC_FULL: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_RX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_TX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; + break; + default: + break; + } + if (enable) { config.phy_type = phy_type; config.phy_type_ext = phy_type_ext; - config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | - I40E_AQ_PHY_FLAG_PAUSE_RX); - - switch (pf->fc) { - case I40E_FC_FULL: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | - I40E_AQ_PHY_FLAG_PAUSE_RX; - break; - case I40E_FC_RX_PAUSE: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; - break; - case I40E_FC_TX_PAUSE: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; - break; - default: - break; - } } aq_error = i40e_aq_set_phy_config(hw, &config, NULL); @@ -4594,6 +4595,11 @@ ixl_attach_get_link_status(struct ixl_pf *pf) /* Determine link state */ hw->phy.get_link_info = TRUE; i40e_get_link_status(hw, &pf->link_up); + + /* Flow Control mode not set by user, read current FW settings */ + if (pf->fc == -1) + pf->fc = hw->fc.current_mode; + return (0); } From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 20:50:42 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 A888C6AD7B1; Mon, 20 Sep 2021 20:50:42 +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 4HCxXf4QGTz3D6x; Mon, 20 Sep 2021 20:50:42 +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 78BB2174B4; Mon, 20 Sep 2021 20:50:42 +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 18KKog8c057434; Mon, 20 Sep 2021 20:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KKogVo057433; Mon, 20 Sep 2021 20:50:42 GMT (envelope-from git) Date: Mon, 20 Sep 2021 20:50:42 GMT Message-Id: <202109202050.18KKogVo057433@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: 6f6013102be0 - stable/13 - ixl(4): Fix reporting of unqualified transceivers 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: 6f6013102be03f914bd2471236ff098c961c9717 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: Mon, 20 Sep 2021 20:50:42 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6013102be03f914bd2471236ff098c961c9717 commit 6f6013102be03f914bd2471236ff098c961c9717 Author: Krzysztof Galazka AuthorDate: 2021-08-20 21:12:28 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 20:42:55 +0000 ixl(4): Fix reporting of unqualified transceivers When link_active_on_if_down flag is disabled and link is brought down with ifconfig, FW reports a false positive link event about an unqualified transceiver. The condition used in the driver to filter out those false positive events was incorrect and caused that unqualified module event to also not be reported when the event was valid. Change the condition to rely on IFF_UP flag instead of link_active_on_if_down and bump driver version to 2.3.1-k. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: stallamr@netapp.com, erj@ Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D30733 (cherry picked from commit c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8) --- sys/dev/ixl/if_ixl.c | 2 +- sys/dev/ixl/ixl_pf_iflib.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 3b49da5d76b9..f620771e93b1 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -49,7 +49,7 @@ *********************************************************************/ #define IXL_DRIVER_VERSION_MAJOR 2 #define IXL_DRIVER_VERSION_MINOR 3 -#define IXL_DRIVER_VERSION_BUILD 0 +#define IXL_DRIVER_VERSION_BUILD 1 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 68a174889c41..6ea20389c547 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -403,20 +403,23 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) { struct i40e_hw *hw = &pf->hw; device_t dev = iflib_get_dev(pf->vsi.ctx); - struct i40e_aqc_get_link_status *status = - (struct i40e_aqc_get_link_status *)&e->desc.params.raw; - - /* Request link status from adapter */ + struct i40e_link_status *link_info = &hw->phy.link_info; + + /* Driver needs to re-enable delivering of link status events + * by FW after each event reception. Call i40e_get_link_status + * to do that. To not lose information about link state changes, + * which happened between receiving an event and the call, + * do not rely on status from event but use most recent + * status information retrieved by the call. */ hw->phy.get_link_info = TRUE; i40e_get_link_status(hw, &pf->link_up); /* Print out message if an unqualified module is found */ - if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && + if ((link_info->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && - (atomic_load_32(&pf->state) & - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && - (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && - (!(status->link_info & I40E_AQ_LINK_UP))) + (if_getflags(pf->vsi.ifp) & IFF_UP) && + (!(link_info->an_info & I40E_AQ_QUALIFIED_MODULE)) && + (!(link_info->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " "an unqualified module was detected!\n"); From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 20:50:43 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 C4A526AD3D4; Mon, 20 Sep 2021 20:50:43 +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 4HCxXg57Xfz3D74; Mon, 20 Sep 2021 20:50:43 +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 89BC21770A; Mon, 20 Sep 2021 20:50:43 +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 18KKoh1N057458; Mon, 20 Sep 2021 20:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KKoh1H057457; Mon, 20 Sep 2021 20:50:43 GMT (envelope-from git) Date: Mon, 20 Sep 2021 20:50:43 GMT Message-Id: <202109202050.18KKoh1H057457@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: 3917b3c7e5e1 - stable/13 - ixl(4): Fix 2.5 and 5G speeds reporting and update shared code 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: 3917b3c7e5e18cccd3216bc3925efb0bc1e8affe 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: Mon, 20 Sep 2021 20:50:43 -0000 The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=3917b3c7e5e18cccd3216bc3925efb0bc1e8affe commit 3917b3c7e5e18cccd3216bc3925efb0bc1e8affe Author: Krzysztof Galazka AuthorDate: 2021-09-13 20:39:59 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 20:43:29 +0000 ixl(4): Fix 2.5 and 5G speeds reporting and update shared code Fix 2.5 and 5G speeds reporting and update shared code with recent changes: - Update expected FW API versions for X710 and X722 adapters - Define pointers related to Preservation Rules Module - Add definitions for Shadow RAM pointers to new modules: 5th and 6th FPA, and Preservation Rules Module. - Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know opcode for parser aborted packets. - Add the new filter types needed for custom cloud filters. - Add support for Minimum Rollback Revision - Fix RX_ONLY mode for unicast promiscuous on VLAN - Add EEE LPI status check for X722 adapters - Fix PHY type identifiers for 2.5G and 5G adapters - Fix update link data for X722 - Increase the timeout value for PF reset to give PF more time to finish reset if it is loaded with filters. - Added support for Min Rollback Revision for 4 more X722 modules - Fix reporting of Active Optical Cable media type - Add flags and fields for double VLAN processing - Fix potentially uninitialized variables in NVM code Reviewed by: kbowling@, mike.jakubik@gmail.com Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D31565 (cherry picked from commit abf774528d7e497460510b0026db85e30f054142) --- sys/dev/ixl/i40e_adminq.c | 6 +- sys/dev/ixl/i40e_adminq_cmd.h | 71 +++++++++++++-- sys/dev/ixl/i40e_common.c | 206 ++++++++++++++++++++++++++---------------- sys/dev/ixl/i40e_dcb.c | 10 +- sys/dev/ixl/i40e_lan_hmc.c | 2 +- sys/dev/ixl/i40e_nvm.c | 13 ++- sys/dev/ixl/i40e_prototype.h | 10 +- sys/dev/ixl/i40e_register.h | 3 + sys/dev/ixl/i40e_type.h | 17 ++-- sys/dev/ixl/if_ixl.c | 4 +- 10 files changed, 234 insertions(+), 108 deletions(-) diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c index d25798d23bd1..efca7f1e61ff 100644 --- a/sys/dev/ixl/i40e_adminq.c +++ b/sys/dev/ixl/i40e_adminq.c @@ -646,8 +646,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { struct i40e_adminq_info *aq = &hw->aq; enum i40e_status_code ret_code; - u16 cfg_ptr, oem_hi, oem_lo; - u16 eetrack_lo, eetrack_hi; + u16 oem_hi = 0, oem_lo = 0; + u16 eetrack_hi = 0; + u16 eetrack_lo = 0; + u16 cfg_ptr = 0; int retry = 0; /* verify input for valid configuration */ diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h index 6161805a7cf0..564a076761d0 100644 --- a/sys/dev/ixl/i40e_adminq_cmd.h +++ b/sys/dev/ixl/i40e_adminq_cmd.h @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000A +#define I40E_FW_API_VERSION_MINOR_X722 0x000C +#define I40E_FW_API_VERSION_MINOR_X710 0x000E #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -267,7 +267,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, - i40e_aqc_opc_nvm_progress = 0x0706, + i40e_aqc_opc_nvm_update_in_process = 0x0706, + i40e_aqc_opc_rollback_revision_update = 0x0707, i40e_aqc_opc_oem_post_update = 0x0720, i40e_aqc_opc_thermal_sensor = 0x0721, @@ -467,6 +468,7 @@ struct i40e_aqc_list_capabilities_element_resp { #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS 0x0067 #define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 @@ -793,6 +795,7 @@ struct i40e_aqc_set_switch_config { #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT 0x0004 +#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN 0x0008 __le16 valid_flags; /* The ethertype in switch_tag is dropped on ingress and used * internally by the switch. Set this to zero for the default @@ -929,7 +932,7 @@ struct i40e_aqc_vsi_properties_data { u8 sec_reserved; /* VLAN section */ __le16 pvid; /* VLANS include priority bits */ - __le16 fcoe_pvid; + __le16 outer_vlan; u8 port_vlan_flags; #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00 #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \ @@ -945,7 +948,24 @@ struct i40e_aqc_vsi_properties_data { #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08 #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18 - u8 pvlan_reserved[3]; + u8 outer_vlan_flags; +#define I40E_AQ_VSI_OVLAN_MODE_SHIFT 0x00 +#define I40E_AQ_VSI_OVLAN_MODE_MASK (0x03 << \ + I40E_AQ_VSI_OVLAN_MODE_SHIFT) +#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED 0x01 +#define I40E_AQ_VSI_OVLAN_MODE_TAGGED 0x02 +#define I40E_AQ_VSI_OVLAN_MODE_ALL 0x03 +#define I40E_AQ_VSI_OVLAN_INSERT_PVID 0x04 +#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT 0x03 +#define I40E_AQ_VSI_OVLAN_EMOD_MASK (0x03 <<\ + I40E_AQ_VSI_OVLAN_EMOD_SHIFT) +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL 0x00 +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP 0x01 +#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL 0x02 +#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING 0x03 +#define I40E_AQ_VSI_OVLAN_CTRL_ENA 0x04 + + u8 pvlan_reserved[2]; /* ingress egress up sections */ __le32 ingress_table; /* bitmap, 3 bits per up */ #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0 @@ -1247,7 +1267,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; @@ -1433,6 +1453,8 @@ struct i40e_aqc_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +#define I40E_AQC_ADD_CLOUD_FILTER_OIP1 0x0010 +#define I40E_AQC_ADD_CLOUD_FILTER_OIP2 0x0012 /* 0x000D reserved */ /* 0x000E reserved */ /* 0x000F reserved */ @@ -1940,8 +1962,10 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_25GBASE_AOC = 0x23, I40E_PHY_TYPE_25GBASE_ACC = 0x24, - I40E_PHY_TYPE_2_5GBASE_T = 0x30, - I40E_PHY_TYPE_5GBASE_T = 0x31, + I40E_PHY_TYPE_2_5GBASE_T = 0x26, + I40E_PHY_TYPE_5GBASE_T = 0x27, + I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30, + I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31, I40E_PHY_TYPE_MAX, I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, I40E_PHY_TYPE_EMPTY = 0xFE, @@ -2411,6 +2435,16 @@ struct i40e_aqc_nvm_config_data_feature { I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); +/* NVM Update in Process (direct 0x0706) */ +struct i40e_aqc_nvm_update_in_process { + u8 command; +#define I40E_AQ_UPDATE_FLOW_END 0x0 +#define I40E_AQ_UPDATE_FLOW_START 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process); + struct i40e_aqc_nvm_config_data_immediate_field { __le32 field_id; __le32 field_value; @@ -2420,6 +2454,27 @@ struct i40e_aqc_nvm_config_data_immediate_field { I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { + u8 optin_mode; /* bool */ +#define I40E_AQ_RREV_OPTIN_MODE 0x01 + u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 +#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION 5 +#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION 6 +#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION 7 +#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION 8 + u8 reserved1[2]; + u32 min_rrev; + u8 reserved2[8]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update); + /* OEM Post Update (indirect 0x0720) * no command data struct used */ diff --git a/sys/dev/ixl/i40e_common.c b/sys/dev/ixl/i40e_common.c index 4325901c0920..332893938c19 100644 --- a/sys/dev/ixl/i40e_common.c +++ b/sys/dev/ixl/i40e_common.c @@ -1251,12 +1251,15 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_40GBASE_LR4: case I40E_PHY_TYPE_25GBASE_LR: case I40E_PHY_TYPE_25GBASE_SR: + case I40E_PHY_TYPE_10GBASE_AOC: + case I40E_PHY_TYPE_25GBASE_AOC: + case I40E_PHY_TYPE_40GBASE_AOC: media = I40E_MEDIA_TYPE_FIBER; break; case I40E_PHY_TYPE_100BASE_TX: case I40E_PHY_TYPE_1000BASE_T: - case I40E_PHY_TYPE_2_5GBASE_T: - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: case I40E_PHY_TYPE_10GBASE_T: media = I40E_MEDIA_TYPE_BASET; break; @@ -1265,10 +1268,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_10GBASE_SFPP_CU: - case I40E_PHY_TYPE_40GBASE_AOC: - case I40E_PHY_TYPE_10GBASE_AOC: case I40E_PHY_TYPE_25GBASE_CR: - case I40E_PHY_TYPE_25GBASE_AOC: case I40E_PHY_TYPE_25GBASE_ACC: media = I40E_MEDIA_TYPE_DA; break; @@ -1316,7 +1316,7 @@ static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, return I40E_ERR_RESET_FAILED; } -#define I40E_PF_RESET_WAIT_COUNT 200 +#define I40E_PF_RESET_WAIT_COUNT 1000 /** * i40e_pf_reset - Reset the PF * @hw: pointer to the hardware structure @@ -1563,7 +1563,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx) **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1576,20 +1575,6 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; @@ -1610,7 +1595,6 @@ u32 i40e_led_get(struct i40e_hw *hw) **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & ~I40E_LED_MODE_VALID) { @@ -1627,20 +1611,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } if (I40E_IS_X710TL_DEVICE(hw->device_id)) { u32 pin_func = 0; @@ -2053,6 +2023,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw, hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; + /* 'Get Link Status' response data structure from X722 FW has + * different format and does not contain this information + */ if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE && hw->mac.type != I40E_MAC_X722) { __le32 tmp; @@ -2251,6 +2224,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_hw_ver_ge + * @hw: pointer to the hw struct + * @maj: api major value + * @min: api minor value + * + * Assert whether current HW api version is greater/equal than provided. + **/ +static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min) +{ + if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) + return TRUE; + return FALSE; +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2376,18 +2365,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2519,11 +2506,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); @@ -2633,7 +2626,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, } /** - * i40e_get_vsi_params - get VSI configuration info + * i40e_aq_get_vsi_params - get VSI configuration info * @hw: pointer to the hw struct * @vsi_ctx: pointer to a vsi context struct * @cmd_details: pointer to command details structure or NULL @@ -2893,7 +2886,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up) } /** - * i40e_updatelink_status - update status of the HW network link + * i40e_update_link_info - update status of the HW network link * @hw: pointer to the hw struct **/ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) @@ -2906,10 +2899,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) return status; /* extra checking needed to ensure link info to user is timely */ - if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && - ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || - !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) { - status = i40e_aq_get_phy_capabilities(hw, FALSE, false, + if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && + ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || + !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) || + hw->mac.type == I40E_MAC_X722) { + status = i40e_aq_get_phy_capabilities(hw, FALSE, + hw->mac.type == + I40E_MAC_X722, &abilities, NULL); if (status) return status; @@ -3666,6 +3662,64 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, return status; } +/** + * i40e_aq_nvm_update_in_process + * @hw: pointer to the hw struct + * @update_flow_state: True indicates that update flow starts, FALSE that ends + * @cmd_details: pointer to command details structure or NULL + * + * Indicate NVM update in process. + **/ +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_nvm_update_in_process *cmd = + (struct i40e_aqc_nvm_update_in_process *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_nvm_update_in_process); + + cmd->command = I40E_AQ_UPDATE_FLOW_END; + + if (update_flow_state) + cmd->command |= I40E_AQ_UPDATE_FLOW_START; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_aq_min_rollback_rev_update - triggers an ow after update + * @hw: pointer to the hw struct + * @mode: opt-in mode, 1b for single module update, 0b for bulk update + * @module: module to be updated. Ignored if mode is 0b + * @min_rrev: value of the new minimal version. Ignored if mode is 0b + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + /** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct @@ -3998,7 +4052,13 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, p->wr_csr_prot |= (u64)logical_id << 32; i40e_debug(hw, I40E_DEBUG_INIT, "HW Capability: wr_csr_prot = 0x%llX\n\n", - (p->wr_csr_prot & 0xffff)); + (unsigned long long)(p->wr_csr_prot & 0xffff)); + break; + case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS: + p->dis_unused_ports = (bool)number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: dis_unused_ports = %d\n\n", + p->dis_unused_ports); break; case I40E_AQ_CAP_ID_NVM_MGMT: if (number & I40E_NVM_MGMT_SEC_REV_DISABLED) @@ -4193,28 +4253,6 @@ i40e_aq_update_nvm_exit: return status; } -/** - * i40e_aq_nvm_progress - * @hw: pointer to the hw struct - * @progress: pointer to progress returned from AQ - * @cmd_details: pointer to command details structure or NULL - * - * Gets progress of flash rearrangement process - **/ -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, - struct i40e_asq_cmd_details *cmd_details) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - - DEBUGFUNC("i40e_aq_nvm_progress"); - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - *progress = desc.params.raw[0]; - return status; -} - /** * i40e_aq_get_lldp_mib * @hw: pointer to the hw struct @@ -4593,7 +4631,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, } /** - * i40e_aq_get_switch_resource_alloc (0x0204) + * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations * @hw: pointer to the hw struct * @num_entries: pointer to u8 to store the number of resource entries returned * @buf: pointer to a user supplied buffer. This buffer must be large enough @@ -6705,7 +6743,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num) } /** - * i40e_blink_phy_led + * i40e_blink_phy_link_led * @hw: pointer to the HW structure * @time: time how long led will blinks in secs * @interval: gap between LED on and off in msecs @@ -6942,15 +6980,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) { enum i40e_status_code ret = I40E_SUCCESS; + bool eee_mrvl_phy; + bool eee_bcm_phy; u32 val; stat->rx_lpi_status = 0; stat->tx_lpi_status = 0; - if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { + eee_bcm_phy = + (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); + eee_mrvl_phy = + hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; + + if (eee_bcm_phy || eee_mrvl_phy) { + // read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE, @@ -7542,7 +7588,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, } /** - * i40e_aq_opc_set_ns_proxy_table_entry + * i40e_aq_set_ns_proxy_table_entry * @hw: pointer to the HW structure * @ns_proxy_table_entry: pointer to NS table entry command struct * @cmd_details: pointer to command details diff --git a/sys/dev/ixl/i40e_dcb.c b/sys/dev/ixl/i40e_dcb.c index b2f0b5c0acad..a02cbc80d361 100644 --- a/sys/dev/ixl/i40e_dcb.c +++ b/sys/dev/ixl/i40e_dcb.c @@ -265,7 +265,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv, } /** - * i40e_parse_ieee_etsrec_tlv + * i40e_parse_ieee_tlv * @tlv: IEEE 802.1Qaz TLV * @dcbcfg: Local store to update ETS REC data * @@ -345,9 +345,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv, * |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7| * --------------------------------- */ - for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) + for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { etscfg->tcbwtable[i] = buf[offset++]; + if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT) + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT; + else + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS; + } + /* Number of TCs supported (1 octet) */ etscfg->maxtcs = buf[offset]; } diff --git a/sys/dev/ixl/i40e_lan_hmc.c b/sys/dev/ixl/i40e_lan_hmc.c index c280393ef1c8..eb2c44c92067 100644 --- a/sys/dev/ixl/i40e_lan_hmc.c +++ b/sys/dev/ixl/i40e_lan_hmc.c @@ -546,7 +546,7 @@ configure_lan_hmc_out: } /** - * i40e_delete_hmc_object - remove hmc objects + * i40e_delete_lan_hmc_object - remove hmc objects * @hw: pointer to the HW structure * @info: pointer to i40e_hmc_delete_obj_info struct * diff --git a/sys/dev/ixl/i40e_nvm.c b/sys/dev/ixl/i40e_nvm.c index 20ba63a05b4e..58e5c1a0cdd9 100644 --- a/sys/dev/ixl/i40e_nvm.c +++ b/sys/dev/ixl/i40e_nvm.c @@ -35,7 +35,7 @@ #include "i40e_prototype.h" /** - * i40e_init_nvm_ops - Initialize NVM function pointers + * i40e_init_nvm - Initialize NVM function pointers * @hw: pointer to the HW structure * * Setup the function pointers and the NVM info structure. Should be called @@ -108,7 +108,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, if (ret_code) i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire type %d failed time_left=%llu ret=%d aq_err=%d\n", - access, time_left, ret_code, hw->aq.asq_last_status); + access, (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); if (ret_code && time_left) { /* Poll until the current NVM owner timeouts */ @@ -130,7 +131,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, hw->nvm.hw_semaphore_timeout = 0; i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire timed out, wait %llu ms before trying again. status=%d aq_err=%d\n", - time_left, ret_code, hw->aq.asq_last_status); + (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); } } @@ -782,10 +784,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw) DEBUGFUNC("i40e_update_nvm_checksum"); ret_code = i40e_calc_nvm_checksum(hw, &checksum); - le_sum = CPU_TO_LE16(checksum); - if (ret_code == I40E_SUCCESS) + if (ret_code == I40E_SUCCESS) { + le_sum = CPU_TO_LE16(checksum); ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, 1, &le_sum, TRUE); + } return ret_code; } diff --git a/sys/dev/ixl/i40e_prototype.h b/sys/dev/ixl/i40e_prototype.h index 23ce2edb22a3..2febf9d6662d 100644 --- a/sys/dev/ixl/i40e_prototype.h +++ b/sys/dev/ixl/i40e_prototype.h @@ -268,6 +268,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw, void *buff, u16 buff_size, struct i40e_asq_cmd_details *cmd_details); @@ -279,7 +283,11 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, u32 offset, u16 length, void *data, bool last_command, u8 preservation_flags, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, +enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, + u8 rearrange_nvm, + struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, u8 mib_type, void *buff, u16 buff_size, diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h index 6c57d0a25f7e..ffc6a7e506a6 100644 --- a/sys/dev/ixl/i40e_register.h +++ b/sys/dev/ixl/i40e_register.h @@ -232,6 +232,9 @@ #define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT) #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00 /* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT) #define I40E_GLDCB_GENC 0x00083044 /* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0 #define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT) diff --git a/sys/dev/ixl/i40e_type.h b/sys/dev/ixl/i40e_type.h index 699576ff5b43..f34002d7dc35 100644 --- a/sys/dev/ixl/i40e_type.h +++ b/sys/dev/ixl/i40e_type.h @@ -347,12 +347,8 @@ struct i40e_phy_info { I40E_PHY_TYPE_OFFSET) #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \ I40E_PHY_TYPE_OFFSET) -/* Offset for 2.5G/5G PHY Types value to bit number conversion */ -#define I40E_PHY_TYPE_OFFSET2 (-10) -#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) -#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) +#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) +#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T) #define I40E_HW_CAP_MAX_GPIO 30 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO 0 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C 1 @@ -443,6 +439,7 @@ struct i40e_hw_capabilities { u32 enabled_tcmap; u32 maxtc; u64 wr_csr_prot; + bool dis_unused_ports; bool apm_wol_support; enum i40e_acpi_programming_method acpi_prog_method; bool proxy_support; @@ -975,7 +972,8 @@ enum i40e_rx_l2_ptype { I40E_RX_PTYPE_GRENAT4_MAC_PAY3 = 58, I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4 = 87, I40E_RX_PTYPE_GRENAT6_MAC_PAY3 = 124, - I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153 + I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153, + I40E_RX_PTYPE_PARSER_ABORTED = 255 }; struct i40e_rx_ptype_decoded { @@ -1551,6 +1549,9 @@ struct i40e_hw_port_stats { #define I40E_SR_CONFIGURATION_METADATA_PTR 0x4D #define I40E_SR_IMMEDIATE_VALUES_PTR 0x4E #define I40E_SR_5TH_FREE_PROVISION_AREA_PTR 0x50 +#define I40E_SR_PRESERVATION_RULES_PTR 0x70 +#define I40E_FPK_SR_5TH_FREE_PROVISION_AREA_PTR 0x71 +#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR 0x71 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */ #define I40E_SR_VPD_MODULE_MAX_SIZE 1024 @@ -1720,6 +1721,8 @@ struct i40e_lldp_variables { #define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT) #define I40E_VERIFY_TAG_SHIFT 31 #define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT) #define I40E_FLEX_50_SHIFT 13 #define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index f620771e93b1..e7e6e31a7fca 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1514,11 +1514,11 @@ ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr) ifmr->ifm_active |= IFM_1000_T; break; /* 2.5 G */ - case I40E_PHY_TYPE_2_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_2500_T; break; /* 5 G */ - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_5000_T; break; /* 10 G */ From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:29 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 65A7B6AF415; Mon, 20 Sep 2021 23:22:29 +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 4HD0vn2Lhbz3jsX; Mon, 20 Sep 2021 23:22:29 +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 30DCA1970B; Mon, 20 Sep 2021 23:22:29 +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 18KNMTue061351; Mon, 20 Sep 2021 23:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMTsu061350; Mon, 20 Sep 2021 23:22:29 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:29 GMT Message-Id: <202109202322.18KNMTsu061350@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: 643f587c95dd - stable/12 - ixl(4): Add ability to control link state on ifconfig down 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/12 X-Git-Reftype: branch X-Git-Commit: 643f587c95ddc07dd5dc32ff5a2bdb0bd72e8df9 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: Mon, 20 Sep 2021 23:22:29 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=643f587c95ddc07dd5dc32ff5a2bdb0bd72e8df9 commit 643f587c95ddc07dd5dc32ff5a2bdb0bd72e8df9 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:38:51 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 21:30:13 +0000 ixl(4): Add ability to control link state on ifconfig down Add sysctl link_active_on_if_down, which allows user to control if interface is kept in active state when it is brought down with ifconfig. Set it to enabled by default to preserve backwards compatibility. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28028 (cherry picked from commit 21802a127d83e8a8c721d69b697e7ddb223d7797) --- sys/dev/ixl/if_ixl.c | 18 +++++++ sys/dev/ixl/ixl_pf.h | 7 +++ sys/dev/ixl/ixl_pf_iflib.c | 2 + sys/dev/ixl/ixl_pf_main.c | 131 ++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 156 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index e988ab1ddc22..09107dbaf2a5 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -771,6 +771,12 @@ ixl_if_attach_post(if_ctx_t ctx) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* + * Driver may have been reloaded. Ensure that the link state + * is consistent with current settings. + */ + ixl_set_link(pf, (pf->state & IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0); + hw->phy.get_link_info = true; i40e_get_link_status(hw, &pf->link_up); ixl_update_link_status(pf); @@ -959,6 +965,8 @@ ixl_if_init(if_ctx_t ctx) return; } + ixl_set_link(pf, true); + /* Reconfigure multicast filters in HW */ ixl_if_multi_set(ctx); @@ -1001,6 +1009,7 @@ void ixl_if_stop(if_ctx_t ctx) { struct ixl_pf *pf = iflib_get_softc(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); struct ixl_vsi *vsi = &pf->vsi; INIT_DEBUGOUT("ixl_if_stop: begin\n"); @@ -1017,6 +1026,15 @@ ixl_if_stop(if_ctx_t ctx) ixl_disable_rings_intr(vsi); ixl_disable_rings(pf, vsi, &pf->qtag); + + /* + * Don't set link state if only reconfiguring + * e.g. on MTU change. + */ + if ((if_getflags(ifp) & IFF_UP) == 0 && + (atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) == 0) + ixl_set_link(pf, false); } static int diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 0521ae5a4bc5..cfae026e9eb7 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -88,6 +88,7 @@ enum ixl_pf_state { IXL_PF_STATE_EMP_RESET_REQ = (1 << 8), IXL_PF_STATE_FW_LLDP_DISABLED = (1 << 9), IXL_PF_STATE_EEE_ENABLED = (1 << 10), + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN = (1 << 11), }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ @@ -227,6 +228,11 @@ struct ixl_pf { "\t0 - disable\n" \ "\t1 - enable\n" +#define IXL_SYSCTL_HELP_SET_LINK_ACTIVE \ +"\nKeep link active after setting interface down:\n" \ +"\t0 - disable\n" \ +"\t1 - enable\n" + #define IXL_SYSCTL_HELP_READ_I2C \ "\nRead a byte from I2C bus\n" \ "Input: 32-bit value\n" \ @@ -351,6 +357,7 @@ void ixl_pf_reset_stats(struct ixl_pf *); void ixl_get_bus_info(struct ixl_pf *pf); int ixl_aq_get_link_status(struct ixl_pf *, struct i40e_aqc_get_link_status *); +void ixl_set_link(struct ixl_pf *, bool); int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); int ixl_handle_i2c_eeprom_read_cmd(struct ixl_pf *, struct ifreq *ifr); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 4351f65ee5ab..6d80bb472b72 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -413,6 +413,8 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) /* Print out message if an unqualified module is found */ if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && + (atomic_load_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && (!(status->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index c563eca63605..7fd4d78ef40e 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -60,6 +60,7 @@ static int ixl_sysctl_pf_tx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_pf_rx_itr(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS); /* Debug Sysctls */ static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); @@ -383,6 +384,9 @@ retry: break; } + /* Keep link active by default */ + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + /* Print a subset of the capability information. */ device_printf(dev, "PF-ID[%d]: VFs %d, MSI-X %d, VF MSI-X %d, QPs %d, %s\n", @@ -2283,6 +2287,12 @@ ixl_add_device_sysctls(struct ixl_pf *pf) CTLFLAG_RD | CTLFLAG_MPSAFE, &pf->stats.rx_lpi_count, "RX LPI count"); + SYSCTL_ADD_PROC(ctx, ctx_list, OID_AUTO, + "link_active_on_if_down", + CTLTYPE_INT | CTLFLAG_RWTUN, + pf, 0, ixl_sysctl_set_link_active, "I", + IXL_SYSCTL_HELP_SET_LINK_ACTIVE); + /* Add sysctls meant to print debug information, but don't list them * in "sysctl -a" output. */ debug_node = SYSCTL_ADD_NODE(ctx, ctx_list, @@ -2302,7 +2312,13 @@ ixl_add_device_sysctls(struct ixl_pf *pf) pf, 0, ixl_sysctl_link_status, "A", IXL_SYSCTL_HELP_LINK_STATUS); SYSCTL_ADD_PROC(ctx, debug_list, - OID_AUTO, "phy_abilities", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "phy_abilities_init", + CTLTYPE_STRING | CTLFLAG_RD, + pf, 1, ixl_sysctl_phy_abilities, "A", "Initial PHY Abilities"); + + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "phy_abilities", + CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_phy_abilities, "A", "PHY Abilities"); SYSCTL_ADD_PROC(ctx, debug_list, @@ -2872,6 +2888,95 @@ ixl_find_i2c_interface(struct ixl_pf *pf) return (-1); } +void +ixl_set_link(struct ixl_pf *pf, bool enable) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + u32 phy_type, phy_type_ext; + + /* Get initial capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, TRUE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + phy_type = abilities.phy_type; + phy_type_ext = abilities.phy_type_ext; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + /* Prepare new config */ + memset(&config, 0, sizeof(config)); + config.link_speed = abilities.link_speed; + config.abilities = abilities.abilities; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + config.fec_config = abilities.fec_cfg_curr_mod_ext_info + & I40E_AQ_PHY_FEC_CONFIG_MASK; + config.phy_type = 0; + config.phy_type_ext = 0; + + if (enable) { + config.phy_type = phy_type; + config.phy_type_ext = phy_type_ext; + + config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX); + + switch (pf->fc) { + case I40E_FC_FULL: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_RX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_TX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; + break; + default: + break; + } + } + + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } + + aq_error = i40e_aq_set_link_restart_an(hw, enable, NULL); + if (aq_error) { + device_printf(dev, + "%s: Error set link config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return; + } +} + static char * ixl_phy_type_string(u32 bit_pos, bool ext) { @@ -3030,7 +3135,7 @@ ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS) } status = i40e_aq_get_phy_capabilities(hw, - FALSE, FALSE, &abilities, NULL); + FALSE, arg2 != 0, &abilities, NULL); if (status) { device_printf(dev, "%s: i40e_aq_get_phy_capabilities() status %s, aq error %s\n", @@ -4215,6 +4320,28 @@ ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) return (0); } +static int +ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + int error, state; + + state = !!(atomic_load_acq_32(&pf->state) & + IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + error = sysctl_handle_int(oidp, &state, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (state == 0) + atomic_clear_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + else + atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + + return (0); +} + + int ixl_attach_get_link_status(struct ixl_pf *pf) { From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:30 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 AB25C6AF711; Mon, 20 Sep 2021 23:22:30 +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 4HD0vp3kjdz3jf3; Mon, 20 Sep 2021 23:22:30 +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 539851970C; Mon, 20 Sep 2021 23:22:30 +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 18KNMUDN061375; Mon, 20 Sep 2021 23:22:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMUe5061374; Mon, 20 Sep 2021 23:22:30 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:30 GMT Message-Id: <202109202322.18KNMUe5061374@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: 9fb4d2769549 - stable/12 - ixl(4): Report RX errors as sum of all RX error counters 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/12 X-Git-Reftype: branch X-Git-Commit: 9fb4d27695499501572335700418ca40b20cb6b1 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: Mon, 20 Sep 2021 23:22:30 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=9fb4d27695499501572335700418ca40b20cb6b1 commit 9fb4d27695499501572335700418ca40b20cb6b1 Author: Krzysztof Galazka AuthorDate: 2021-03-03 01:33:11 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 21:31:03 +0000 ixl(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. There is no HW counter for frames with invalid L3/L4 checksums so add a SW one. Also add a "rx_errors" sysctl with a copy of netstat IERRORS counter value to make it easier accessible from scripts. Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27639 (cherry picked from commit 9f99061ef9c95b171fc92d34026222bb5e052337) --- sys/dev/ixl/ixl.h | 1 + sys/dev/ixl/ixl_pf_main.c | 15 +++++++++++++-- sys/dev/ixl/ixl_txrx.c | 16 +++++++++------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 65e92c470a6c..b3052b52eadd 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -387,6 +387,7 @@ struct rx_ring { u64 rx_packets; u64 rx_bytes; u64 desc_errs; + u64 csum_errs; }; /* diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 7fd4d78ef40e..782d51ac696d 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -780,6 +780,11 @@ ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_ vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); + /* Copy of netstat RX errors counter for validation purposes */ + SYSCTL_ADD_UQUAD(&vsi->sysctl_ctx, vsi_list, OID_AUTO, "rx_errors", + CTLFLAG_RD, &vsi->ierrors, + "RX packet errors"); + if (queues_sysctls) ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); } @@ -1998,7 +2003,7 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) struct ixl_pf *pf; struct ifnet *ifp; struct i40e_eth_stats *es; - u64 tx_discards; + u64 tx_discards, csum_errs; struct i40e_hw_port_stats *nsd; @@ -2011,6 +2016,11 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + csum_errs = 0; + for (int i = 0; i < vsi->num_rx_queues; i++) + csum_errs += vsi->rx_queues[i].rxr.csum_errs; + nsd->checksum_error = csum_errs; + /* Update ifnet stats */ IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + @@ -2024,7 +2034,8 @@ ixl_update_vsi_stats(struct ixl_vsi *vsi) IXL_SET_OMCASTS(vsi, es->tx_multicast); IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + - nsd->rx_undersize + nsd->rx_oversize + nsd->rx_fragments + + nsd->checksum_error + nsd->rx_length_errors + + nsd->rx_undersize + nsd->rx_fragments + nsd->rx_oversize + nsd->rx_jabber); IXL_SET_OERRORS(vsi, es->tx_errors); IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c index 7f092d47aec3..15204b7996e5 100644 --- a/sys/dev/ixl/ixl_txrx.c +++ b/sys/dev/ixl/ixl_txrx.c @@ -51,7 +51,7 @@ #endif /* Local Prototypes */ -static void ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype); static int ixl_isc_txd_encap(void *arg, if_pkt_info_t pi); static void ixl_isc_txd_flush(void *arg, uint16_t txqid, qidx_t pidx); @@ -720,7 +720,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->rx_packets++; if ((if_getcapenable(vsi->ifp) & IFCAP_RXCSUM) != 0) - ixl_rx_checksum(ri, status, error, ptype); + rxr->csum_errs += ixl_rx_checksum(ri, status, error, ptype); ri->iri_flowid = le32toh(cur->wb.qword0.hi_dword.rss); ri->iri_rsstype = ixl_ptype_to_hash(ptype); ri->iri_vtag = vtag; @@ -737,7 +737,7 @@ ixl_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * doesn't spend time verifying the checksum. * *********************************************************************/ -static void +static u8 ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) { struct i40e_rx_ptype_decoded decoded; @@ -746,7 +746,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* No L3 or L4 checksum was calculated */ if (!(status & (1 << I40E_RX_DESC_STATUS_L3L4P_SHIFT))) - return; + return (0); decoded = decode_rx_desc_ptype(ptype); @@ -756,7 +756,7 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) if (status & (1 << I40E_RX_DESC_STATUS_IPV6EXADD_SHIFT)) { ri->iri_csum_flags = 0; - return; + return (1); } } @@ -764,17 +764,19 @@ ixl_rx_checksum(if_rxd_info_t ri, u32 status, u32 error, u8 ptype) /* IPv4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_IPE_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L3_VALID; ri->iri_csum_flags |= CSUM_L4_CALC; /* L4 checksum error */ if (error & (1 << I40E_RX_DESC_ERROR_L4E_SHIFT)) - return; + return (1); ri->iri_csum_flags |= CSUM_L4_VALID; ri->iri_csum_data |= htons(0xffff); + + return (0); } /* Set Report Status queue fields to 0 */ From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:31 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 AC3D06AF3A7; Mon, 20 Sep 2021 23:22:31 +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 4HD0vq4MnZz3jsb; Mon, 20 Sep 2021 23:22:31 +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 7730319786; Mon, 20 Sep 2021 23:22:31 +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 18KNMVwX061399; Mon, 20 Sep 2021 23:22:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMVfl061398; Mon, 20 Sep 2021 23:22:31 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:31 GMT Message-Id: <202109202322.18KNMVfl061398@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: 5574b12aac2b - stable/12 - ix(4): Report RX errors as sum of all RX error counters 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/12 X-Git-Reftype: branch X-Git-Commit: 5574b12aac2bdfe66ec1d9564f932eeec9ac213c 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: Mon, 20 Sep 2021 23:22:31 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=5574b12aac2bdfe66ec1d9564f932eeec9ac213c commit 5574b12aac2bdfe66ec1d9564f932eeec9ac213c Author: Piotr Pietruszewski AuthorDate: 2021-03-03 01:21:58 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 21:31:33 +0000 ix(4): Report RX errors as sum of all RX error counters HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. Also, add new "rx_errs" sysctl in the dev.ix.N.mac_stats tree. This is to provide an another way to display the sum of RX errors. Signed-off-by: Piotr Pietruszewski Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27191 (cherry picked from commit afb1aa4e6df245d38fd2ba683fa521d5dabe8392) --- sys/dev/ixgbe/if_ix.c | 19 ++++++++++++++++++- sys/dev/ixgbe/ixgbe.h | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 655f9a0b52b4..362bb7fe0cbc 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1535,7 +1535,22 @@ ixgbe_update_stats_counters(struct adapter *adapter) IXGBE_SET_OMCASTS(adapter, stats->mptc); IXGBE_SET_COLLISIONS(adapter, 0); IXGBE_SET_IQDROPS(adapter, total_missed_rx); - IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->rlec); + + /* + * Aggregate following types of errors as RX errors: + * - CRC error count, + * - illegal byte error count, + * - checksum error count, + * - missed packets count, + * - length error count, + * - undersized packets count, + * - fragmented packets count, + * - oversized packets count, + * - jabber count. + */ + IXGBE_SET_IERRORS(adapter, stats->crcerrs + stats->illerrc + stats->xec + + stats->mpc[0] + stats->rlec + stats->ruc + stats->rfc + stats->roc + + stats->rjc); } /* ixgbe_update_stats_counters */ /************************************************************************ @@ -1625,6 +1640,8 @@ ixgbe_add_hw_stats(struct adapter *adapter) CTLFLAG_RD, NULL, "MAC Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); + SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rx_errs", + CTLFLAG_RD, &adapter->ierrors, IXGBE_SYSCTL_DESC_RX_ERRS); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "crc_errs", CTLFLAG_RD, &stats->crcerrs, "CRC Errors"); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "ill_errs", diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 63aa2047cc1e..3403e0ba6ed2 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -538,6 +538,18 @@ struct adapter { "\t2 - tx pause\n" \ "\t3 - tx and rx pause" +#define IXGBE_SYSCTL_DESC_RX_ERRS \ + "\nSum of the following RX errors counters:\n" \ + " * CRC errors,\n" \ + " * illegal byte error count,\n" \ + " * checksum error count,\n" \ + " * missed packet count,\n" \ + " * length error count,\n" \ + " * undersized packets count,\n" \ + " * fragmented packets count,\n" \ + " * oversized packets count,\n" \ + " * jabber count." + /* Workaround to make 8.0 buildable */ #if __FreeBSD_version >= 800000 && __FreeBSD_version < 800504 static __inline int From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:33 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 335946AF54C; Mon, 20 Sep 2021 23:22:33 +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 4HD0vr6KqZz3jWH; Mon, 20 Sep 2021 23:22:32 +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 A9E5919787; Mon, 20 Sep 2021 23:22:32 +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 18KNMWki061423; Mon, 20 Sep 2021 23:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMW3m061422; Mon, 20 Sep 2021 23:22:32 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:32 GMT Message-Id: <202109202322.18KNMW3m061422@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: 52323cdab724 - stable/12 - ice_ddp: Update package file to 1.3.19.0 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/12 X-Git-Reftype: branch X-Git-Commit: 52323cdab7242ae651357bb51b9658e2b5193795 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: Mon, 20 Sep 2021 23:22:33 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=52323cdab7242ae651357bb51b9658e2b5193795 commit 52323cdab7242ae651357bb51b9658e2b5193795 Author: Eric Joyner AuthorDate: 2021-02-23 01:43:54 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 22:08:16 +0000 ice_ddp: Update package file to 1.3.19.0 This package is intended to be used with ice(4) version 0.28.1-k. That update will happen in a forthcoming commit. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation (cherry picked from commit a7ac518bff64d48cf262c60c4dc57eef34e74a07) --- sys/conf/files.amd64 | 8 ++++---- sys/conf/files.arm64 | 12 ++++++------ sys/contrib/dev/ice/LICENSE | 2 +- .../dev/ice/{ice-1.3.16.0.pkg => ice-1.3.19.0.pkg} | Bin 659716 -> 614660 bytes sys/modules/ice_ddp/Makefile | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index c49728bff1aa..abcf387a10eb 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -288,8 +288,8 @@ dev/ice/ice_sriov.c optional ice pci \ dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ - no-implicit-rule before-depend local \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ + no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ dependency "ice_ddp.fw" \ @@ -297,8 +297,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.19.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.19.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index ea1fdaf59e8c..d082b032fe69 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -258,18 +258,18 @@ dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ - no-implicit-rule before-depend local \ +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ + no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ dependency "ice_ddp.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ice_ddp.fwo" -ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.19.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.19.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/iicbus/sy8106a.c optional sy8106a fdt diff --git a/sys/contrib/dev/ice/LICENSE b/sys/contrib/dev/ice/LICENSE index 7daf627fc7a0..7faadfc55aac 100644 --- a/sys/contrib/dev/ice/LICENSE +++ b/sys/contrib/dev/ice/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2006-2018, Intel Corporation. +Copyright (c) 2006-2021, Intel Corporation. All rights reserved. Redistribution. Redistribution and use in binary form, without diff --git a/sys/contrib/dev/ice/ice-1.3.16.0.pkg b/sys/contrib/dev/ice/ice-1.3.19.0.pkg similarity index 79% rename from sys/contrib/dev/ice/ice-1.3.16.0.pkg rename to sys/contrib/dev/ice/ice-1.3.19.0.pkg index ec5caecb3a72..32e2603bc131 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.16.0.pkg and b/sys/contrib/dev/ice/ice-1.3.19.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index e6f45ae3820b..38337a106368 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.16.0.pkg:ice_ddp:0x01031000 +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.19.0.pkg:ice_ddp:0x01031300 .include From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:35 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 3FA376AF263; Mon, 20 Sep 2021 23:22:35 +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 4HD0vv0vWFz3jrk; Mon, 20 Sep 2021 23:22:35 +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 EA31C19789; Mon, 20 Sep 2021 23:22:34 +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 18KNMYXA061478; Mon, 20 Sep 2021 23:22:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMYco061477; Mon, 20 Sep 2021 23:22:34 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:34 GMT Message-Id: <202109202322.18KNMYco061477@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: a89887d57b96 - stable/12 - ixl(4): Add tunable to override Flow Control settings 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/12 X-Git-Reftype: branch X-Git-Commit: a89887d57b965e7749e05488f8e8dae7911b3fc3 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: Mon, 20 Sep 2021 23:22:35 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a89887d57b965e7749e05488f8e8dae7911b3fc3 commit a89887d57b965e7749e05488f8e8dae7911b3fc3 Author: Krzysztof Galazka AuthorDate: 2021-04-05 18:08:33 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 22:11:14 +0000 ixl(4): Add tunable to override Flow Control settings Add flow_control to hw.ixl tunables tree to let override initial flow control configuration for all interfaces. Keep using configuration set by NVM by default. Reviewed by: erj@, gallatin@ Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D29338 (cherry picked from commit 20a52706c814ccfd91c65586404abd2a1563a330) --- sys/dev/ixl/if_ixl.c | 19 +++++++++++++++++++ sys/dev/ixl/ixl_pf_iflib.c | 2 +- sys/dev/ixl/ixl_pf_main.c | 40 +++++++++++++++++++++++----------------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 09107dbaf2a5..0da7679ee6b3 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -305,6 +305,10 @@ TUNABLE_INT("hw.ixl.tx_itr", &ixl_tx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, tx_itr, CTLFLAG_RDTUN, &ixl_tx_itr, 0, "TX Interrupt Rate"); +static int ixl_flow_control = -1; +SYSCTL_INT(_hw_ixl, OID_AUTO, flow_control, CTLFLAG_RDTUN, + &ixl_flow_control, 0, "Initial Flow Control setting"); + #ifdef IXL_IW int ixl_enable_iwarp = 0; TUNABLE_INT("hw.ixl.enable_iwarp", &ixl_enable_iwarp); @@ -1881,5 +1885,20 @@ ixl_save_pf_tunables(struct ixl_pf *pf) pf->rx_itr = IXL_ITR_8K; } else pf->rx_itr = ixl_rx_itr; + + pf->fc = -1; + if (ixl_flow_control != -1) { + if (ixl_flow_control < 0 || ixl_flow_control > 3) { + device_printf(dev, + "Invalid flow_control value of %d set!\n", + ixl_flow_control); + device_printf(dev, + "flow_control must be between %d and %d, " + "inclusive\n", 0, 3); + device_printf(dev, + "Using default configuration instead\n"); + } else + pf->fc = ixl_flow_control; + } } diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 6d80bb472b72..bf3527bce4ba 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -1129,7 +1129,7 @@ ixl_sysctl_set_flowcntl(SYSCTL_HANDLER_ARGS) aq_error = i40e_set_fc(hw, &fc_aq_err, TRUE); if (aq_error) { device_printf(dev, - "%s: Error setting new fc mode %d; fc_err %#x\n", + "%s: Error setting Flow Control mode %d; fc_err %#x\n", __func__, aq_error, fc_aq_err); return (EIO); } diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 782d51ac696d..00ab9a84ce97 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -2946,27 +2946,28 @@ ixl_set_link(struct ixl_pf *pf, bool enable) config.phy_type = 0; config.phy_type_ext = 0; + config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX); + + switch (pf->fc) { + case I40E_FC_FULL: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | + I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_RX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; + break; + case I40E_FC_TX_PAUSE: + config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; + break; + default: + break; + } + if (enable) { config.phy_type = phy_type; config.phy_type_ext = phy_type_ext; - config.abilities &= ~(I40E_AQ_PHY_FLAG_PAUSE_TX | - I40E_AQ_PHY_FLAG_PAUSE_RX); - - switch (pf->fc) { - case I40E_FC_FULL: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX | - I40E_AQ_PHY_FLAG_PAUSE_RX; - break; - case I40E_FC_RX_PAUSE: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_RX; - break; - case I40E_FC_TX_PAUSE: - config.abilities |= I40E_AQ_PHY_FLAG_PAUSE_TX; - break; - default: - break; - } } aq_error = i40e_aq_set_phy_config(hw, &config, NULL); @@ -4374,6 +4375,11 @@ ixl_attach_get_link_status(struct ixl_pf *pf) /* Determine link state */ hw->phy.get_link_info = TRUE; i40e_get_link_status(hw, &pf->link_up); + + /* Flow Control mode not set by user, read current FW settings */ + if (pf->fc == -1) + pf->fc = hw->fc.current_mode; + return (0); } From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:34 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 333606AF58F; Mon, 20 Sep 2021 23:22:34 +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 4HD0vs71qjz3jWL; Mon, 20 Sep 2021 23:22:33 +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 D0AD219788; Mon, 20 Sep 2021 23:22:33 +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 18KNMXl9061447; Mon, 20 Sep 2021 23:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMXAO061446; Mon, 20 Sep 2021 23:22:33 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:33 GMT Message-Id: <202109202322.18KNMXAO061446@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: 5d38d78f3550 - stable/12 - ice(4): Update to version 0.28.1-k 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/12 X-Git-Reftype: branch X-Git-Commit: 5d38d78f355013eba79eee3addf15a7ad59707c9 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: Mon, 20 Sep 2021 23:22:34 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=5d38d78f355013eba79eee3addf15a7ad59707c9 commit 5d38d78f355013eba79eee3addf15a7ad59707c9 Author: Eric Joyner AuthorDate: 2021-02-23 01:45:09 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 22:09:29 +0000 ice(4): Update to version 0.28.1-k This updates the driver to align with the version included in the "Intel Ethernet Adapter Complete Driver Pack", version 25.6. There are no major functional changes; this mostly contains bug fixes and changes to prepare for new features. This version of the driver uses the previously committed ice_ddp package 1.3.19.0. Signed-off-by: Eric Joyner Tested by: jeffrey.e.pieper@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28640 (cherry picked from commit d08b8680e12ad692736c84238dcf45c70c228914) --- sys/conf/files.amd64 | 2 + sys/conf/files.arm64 | 2 + sys/dev/ice/ice_adminq_cmd.h | 107 ++-- sys/dev/ice/ice_alloc.h | 2 +- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 135 ++--- sys/dev/ice/ice_common.h | 17 +- sys/dev/ice/ice_common_sysctls.h | 2 +- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 2 +- sys/dev/ice/ice_controlq.h | 6 +- sys/dev/ice/ice_dcb.c | 40 +- sys/dev/ice/ice_dcb.h | 2 +- sys/dev/ice/ice_devids.h | 2 +- sys/dev/ice/ice_drv_info.h | 27 +- sys/dev/ice/ice_features.h | 2 +- sys/dev/ice/ice_flex_pipe.c | 57 +- sys/dev/ice/ice_flex_pipe.h | 2 +- sys/dev/ice/ice_flex_type.h | 11 +- sys/dev/ice/ice_flow.c | 243 +++++---- sys/dev/ice/ice_flow.h | 36 +- sys/dev/ice/ice_hw_autogen.h | 2 +- sys/dev/ice/ice_iflib.h | 2 +- sys/dev/ice/ice_iflib_recovery_txrx.c | 2 +- sys/dev/ice/ice_iflib_sysctls.h | 2 +- sys/dev/ice/ice_iflib_txrx.c | 2 +- sys/dev/ice/ice_lan_tx_rx.h | 2 +- sys/dev/ice/ice_lib.c | 56 +- sys/dev/ice/ice_lib.h | 2 +- sys/dev/ice/ice_nvm.c | 954 +++++++++++++++++++++++++++++----- sys/dev/ice/ice_nvm.h | 24 +- sys/dev/ice/ice_opts.h | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/ice/ice_osdep.h | 2 +- sys/dev/ice/ice_protocol_type.h | 27 +- sys/dev/ice/ice_resmgr.c | 2 +- sys/dev/ice/ice_resmgr.h | 2 +- sys/dev/ice/ice_rss.h | 2 +- sys/dev/ice/ice_sbq_cmd.h | 2 +- sys/dev/ice/ice_sched.c | 562 ++++++++++++-------- sys/dev/ice/ice_sched.h | 31 +- sys/dev/ice/ice_sriov.c | 407 ++++++++++++++- sys/dev/ice/ice_sriov.h | 23 +- sys/dev/ice/ice_status.h | 2 +- sys/dev/ice/ice_strings.c | 2 +- sys/dev/ice/ice_switch.c | 70 ++- sys/dev/ice/ice_switch.h | 4 +- sys/dev/ice/ice_type.h | 266 ++++++++-- sys/dev/ice/ice_vlan_mode.c | 72 +++ sys/dev/ice/ice_vlan_mode.h | 60 +++ sys/dev/ice/if_ice_iflib.c | 2 +- sys/dev/ice/virtchnl.h | 287 +++++++++- sys/dev/ice/virtchnl_inline_ipsec.h | 16 +- sys/modules/ice/Makefile | 2 +- 54 files changed, 2881 insertions(+), 717 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index abcf387a10eb..ee7d8fc2f072 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -287,6 +287,8 @@ dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vlan_mode.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index d082b032fe69..1eaf553973e5 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -258,6 +258,8 @@ dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vlan_mode.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 8d8c025fdd37..9179b0ce1226 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -166,6 +166,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 +#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 #define ICE_AQC_CAPS_NVM_MGMT 0x0080 u8 major_ver; @@ -1449,6 +1450,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2) #define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3) #define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4) +#define ICE_AQ_LINK_MODULE_POWER_UNSUPPORTED BIT(5) u8 link_info; #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ #define ICE_AQ_LINK_FAULT BIT(1) @@ -1496,7 +1498,7 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_CFG_PACING_TYPE_FIXED ICE_AQ_CFG_PACING_TYPE_M /* External Device Power Ability */ u8 power_desc; -#define ICE_AQ_PWR_CLASS_M 0x3 +#define ICE_AQ_PWR_CLASS_M 0x3F #define ICE_AQ_LINK_PWR_BASET_LOW_HIGH 0 #define ICE_AQ_LINK_PWR_BASET_HIGH 1 #define ICE_AQ_LINK_PWR_QSFP_CLASS_1 0 @@ -1860,7 +1862,9 @@ struct ice_aqc_mdio { #define ICE_AQC_MDIO_DEV_M (0x1F << ICE_AQC_MDIO_DEV_S) #define ICE_AQC_MDIO_CLAUSE_22 BIT(5) #define ICE_AQC_MDIO_CLAUSE_45 BIT(6) - u8 rsvd; + u8 mdio_bus_address; +#define ICE_AQC_MDIO_BUS_ADDR_S 0 +#define ICE_AQC_MDIO_BUS_ADDR_M (0x1F << ICE_AQC_MDIO_BUS_ADDR_S) __le16 offset; __le16 data; /* Input in write cmd, output in read cmd. */ u8 rsvd1[4]; @@ -2001,6 +2005,22 @@ struct ice_aqc_sff_eeprom { __le32 addr_low; }; +/* SW Set GPIO command (indirect 0x6EF) + * SW Get GPIO command (indirect 0x6F0) + */ +struct ice_aqc_sw_gpio { + __le16 gpio_ctrl_handle; +#define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S 0 +#define ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_M (0x3FF << ICE_AQC_SW_GPIO_CONTROLLER_HANDLE_S) + u8 gpio_num; +#define ICE_AQC_SW_GPIO_NUMBER_S 0 +#define ICE_AQC_SW_GPIO_NUMBER_M (0x1F << ICE_AQC_SW_GPIO_NUMBER_S) + u8 gpio_params; +#define ICE_AQC_SW_GPIO_PARAMS_DIRECTION BIT(1) +#define ICE_AQC_SW_GPIO_PARAMS_VALUE BIT(0) + u8 rsvd[12]; +}; + /* NVM Read command (indirect 0x0701) * NVM Erase commands (direct 0x0702) * NVM Write commands (indirect 0x0703) @@ -2027,6 +2047,9 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_REVERT_LAST_ACTIV BIT(6) /* Write Activate only */ #define ICE_AQC_NVM_ACTIV_SEL_MASK MAKEMASK(0x7, 3) #define ICE_AQC_NVM_FLASH_ONLY BIT(7) +#define ICE_AQC_NVM_POR_FLAG 0 /* Used by NVM Write completion on ARQ */ +#define ICE_AQC_NVM_PERST_FLAG 1 +#define ICE_AQC_NVM_EMPR_FLAG 2 __le16 module_typeid; __le16 length; #define ICE_AQC_NVM_ERASE_LEN 0xFFFF @@ -2056,32 +2079,22 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LLDP_STATUS_M_LEN 4 /* In Bits */ #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */ -/* The result of netlist NVM read comes in a TLV format. The actual data - * (netlist header) starts from word offset 1 (byte 2). The FW strips - * out the type field from the TLV header so all the netlist fields - * should adjust their offset value by 1 word (2 bytes) in order to map - * their correct location. +#define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 + +/* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the + * type field is excluded from the section when reading and writing from + * a module using the module_typeid field with these AQ commands. */ -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_MOD_ID 0x11B -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN_OFFSET 1 -#define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN 2 /* In bytes */ -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET 2 -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN 2 /* In bytes */ -#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M MAKEMASK(0x3FF, 0) -#define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET 5 -#define ICE_AQC_NVM_NETLIST_ID_BLK_LEN 0x30 /* In words */ - -/* netlist ID block field offsets (word offsets) */ -#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_LOW 2 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MAJOR_VER_HIGH 3 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_LOW 4 -#define ICE_AQC_NVM_NETLIST_ID_BLK_MINOR_VER_HIGH 5 -#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_LOW 6 -#define ICE_AQC_NVM_NETLIST_ID_BLK_TYPE_HIGH 7 -#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_LOW 8 -#define ICE_AQC_NVM_NETLIST_ID_BLK_REV_HIGH 9 -#define ICE_AQC_NVM_NETLIST_ID_BLK_SHA_HASH 0xA -#define ICE_AQC_NVM_NETLIST_ID_BLK_CUST_VER 0x2F +struct ice_aqc_nvm_minsrev { + __le16 length; + __le16 validity; +#define ICE_AQC_NVM_MINSREV_NVM_VALID BIT(0) +#define ICE_AQC_NVM_MINSREV_OROM_VALID BIT(1) + __le16 nvm_minsrev_l; + __le16 nvm_minsrev_h; + __le16 orom_minsrev_l; + __le16 orom_minsrev_h; +}; /* Used for 0x0704 as well as for 0x0705 commands */ struct ice_aqc_nvm_cfg { @@ -2114,7 +2127,7 @@ struct ice_aqc_nvm_checksum { u8 rsvd2[12]; }; -/** +/* * Send to PF command (indirect 0x0801) ID is only used by PF * * Send to VF command (indirect 0x0802) ID is only used by PF @@ -2541,6 +2554,7 @@ struct ice_pkg_ver { }; #define ICE_PKG_NAME_SIZE 32 +#define ICE_SEG_ID_SIZE 28 #define ICE_SEG_NAME_SIZE 28 struct ice_aqc_get_pkg_info { @@ -2589,6 +2603,35 @@ struct ice_aqc_set_health_status_config { u8 reserved[15]; }; +#define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_STRICT 0x101 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_TYPE 0x102 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_QUAL 0x103 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_COMM 0x104 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_CONFLICT 0x105 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT 0x106 +#define ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED 0x107 +#define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT 0x108 +#define ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG 0x10B +#define ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS 0x10C +#define ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE 0x10D +#define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_MOD_LIMITED 0x10F +#define ICE_AQC_HEALTH_STATUS_ERR_PARALLEL_FAULT 0x110 +#define ICE_AQC_HEALTH_STATUS_INFO_PORT_SPEED_PHY_LIMITED 0x111 +#define ICE_AQC_HEALTH_STATUS_ERR_NETLIST_TOPO 0x112 +#define ICE_AQC_HEALTH_STATUS_ERR_NETLIST 0x113 +#define ICE_AQC_HEALTH_STATUS_ERR_TOPO_CONFLICT 0x114 +#define ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS 0x115 +#define ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME 0x116 +#define ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT 0x117 +#define ICE_AQC_HEALTH_STATUS_INFO_RECOVERY 0x500 +#define ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS 0x501 +#define ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH 0x502 +#define ICE_AQC_HEALTH_STATUS_ERR_OROM_AUTH 0x503 +#define ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH 0x504 +#define ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT 0x505 +#define ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT 0x506 +#define ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB 0x509 + /* Get Health Status codes (indirect 0xFF21) */ struct ice_aqc_get_supported_health_status_codes { __le16 health_code_count; @@ -2630,8 +2673,8 @@ struct ice_aqc_clear_health_status { * @opcode: AQ command opcode * @datalen: length in bytes of indirect/external data buffer * @retval: return value from firmware - * @cookie_h: opaque data high-half - * @cookie_l: opaque data low-half + * @cookie_high: opaque data high-half + * @cookie_low: opaque data low-half * @params: command-specific parameters * * Descriptor format for commands the driver posts on the Admin Transmit Queue @@ -2920,6 +2963,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_gpio = 0x06EC, ice_aqc_opc_get_gpio = 0x06ED, ice_aqc_opc_sff_eeprom = 0x06EE, + ice_aqc_opc_sw_set_gpio = 0x06EF, + ice_aqc_opc_sw_get_gpio = 0x06F0, /* NVM commands */ ice_aqc_opc_nvm_read = 0x0701, diff --git a/sys/dev/ice/ice_alloc.h b/sys/dev/ice/ice_alloc.h index 1d9b9169eb02..b281958be793 100644 --- a/sys/dev/ice/ice_alloc.h +++ b/sys/dev/ice/ice_alloc.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 7c8cf6cb90f5..a7f729060b78 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -423,7 +423,7 @@ ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) { u16 i; - for (i = pos; i < num_bits; i++) + for (i = pos; i < pos + num_bits; i++) ice_set_bit(i, dst); } diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index 20689f4893d4..5e2e4340c75c 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -265,7 +265,7 @@ ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type, return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); } -/* +/** * ice_is_media_cage_present * @pi: port information structure * @@ -704,13 +704,14 @@ static void ice_get_itr_intrl_gran(struct ice_hw *hw) void ice_print_rollback_msg(struct ice_hw *hw) { char nvm_str[ICE_NVM_VER_LEN] = { 0 }; - struct ice_nvm_info *nvm = &hw->nvm; struct ice_orom_info *orom; + struct ice_nvm_info *nvm; - orom = &nvm->orom; + orom = &hw->flash.orom; + nvm = &hw->flash.nvm; SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", - nvm->major_ver, nvm->minor_ver, nvm->eetrack, orom->major, + nvm->major, nvm->minor, nvm->eetrack, orom->major, orom->build, orom->patch); ice_warn(hw, "Firmware rollback mode detected. Current version is NVM: %s, FW: %d.%d. Device may exhibit limited functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware rollback mode\n", @@ -805,8 +806,7 @@ enum ice_status ice_init_hw(struct ice_hw *hw) ICE_AQC_REPORT_TOPO_CAP, pcaps, NULL); ice_free(hw, pcaps); if (status) - ice_debug(hw, ICE_DBG_PHY, "%s: Get PHY capabilities failed, continuing anyway\n", - __func__); + ice_debug(hw, ICE_DBG_PHY, "Get PHY capabilities failed, continuing anyway\n"); /* Initialize port_info struct with link information */ status = ice_aq_get_link_info(hw->port_info, false, NULL, NULL); @@ -850,6 +850,9 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_fltr_mgmt_struct; ice_init_lock(&hw->tnl_lock); + + ice_init_vlan_mode_ops(hw); + return ICE_SUCCESS; err_unroll_fltr_mgmt_struct: @@ -1701,7 +1704,7 @@ ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries, if (!buf) return ICE_ERR_PARAM; - if (buf_size < (num_entries * sizeof(buf->elem[0]))) + if (buf_size < FLEX_ARRAY_SIZE(buf, elem, num_entries)) return ICE_ERR_PARAM; ice_fill_dflt_direct_cmd_desc(&desc, opc); @@ -1982,6 +1985,16 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, case ICE_AQC_CAPS_NVM_VER: break; case ICE_AQC_CAPS_NVM_MGMT: + caps->sec_rev_disabled = + (number & ICE_NVM_MGMT_SEC_REV_DISABLED) ? + true : false; + ice_debug(hw, ICE_DBG_INIT, "%s: sec_rev_disabled = %d\n", prefix, + caps->sec_rev_disabled); + caps->update_disabled = + (number & ICE_NVM_MGMT_UPDATE_DISABLED) ? + true : false; + ice_debug(hw, ICE_DBG_INIT, "%s: update_disabled = %d\n", prefix, + caps->update_disabled); caps->nvm_unified_update = (number & ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT) ? true : false; @@ -2389,26 +2402,25 @@ void ice_set_safe_mode_caps(struct ice_hw *hw) { struct ice_hw_func_caps *func_caps = &hw->func_caps; struct ice_hw_dev_caps *dev_caps = &hw->dev_caps; - u32 valid_func, rxq_first_id, txq_first_id; - u32 msix_vector_first_id, max_mtu; + struct ice_hw_common_caps cached_caps; u32 num_funcs; /* cache some func_caps values that should be restored after memset */ - valid_func = func_caps->common_cap.valid_functions; - txq_first_id = func_caps->common_cap.txq_first_id; - rxq_first_id = func_caps->common_cap.rxq_first_id; - msix_vector_first_id = func_caps->common_cap.msix_vector_first_id; - max_mtu = func_caps->common_cap.max_mtu; + cached_caps = func_caps->common_cap; /* unset func capabilities */ memset(func_caps, 0, sizeof(*func_caps)); +#define ICE_RESTORE_FUNC_CAP(name) \ + func_caps->common_cap.name = cached_caps.name + /* restore cached values */ - func_caps->common_cap.valid_functions = valid_func; - func_caps->common_cap.txq_first_id = txq_first_id; - func_caps->common_cap.rxq_first_id = rxq_first_id; - func_caps->common_cap.msix_vector_first_id = msix_vector_first_id; - func_caps->common_cap.max_mtu = max_mtu; + ICE_RESTORE_FUNC_CAP(valid_functions); + ICE_RESTORE_FUNC_CAP(txq_first_id); + ICE_RESTORE_FUNC_CAP(rxq_first_id); + ICE_RESTORE_FUNC_CAP(msix_vector_first_id); + ICE_RESTORE_FUNC_CAP(max_mtu); + ICE_RESTORE_FUNC_CAP(nvm_unified_update); /* one Tx and one Rx queue in safe mode */ func_caps->common_cap.num_rxq = 1; @@ -2419,22 +2431,22 @@ void ice_set_safe_mode_caps(struct ice_hw *hw) func_caps->guar_num_vsi = 1; /* cache some dev_caps values that should be restored after memset */ - valid_func = dev_caps->common_cap.valid_functions; - txq_first_id = dev_caps->common_cap.txq_first_id; - rxq_first_id = dev_caps->common_cap.rxq_first_id; - msix_vector_first_id = dev_caps->common_cap.msix_vector_first_id; - max_mtu = dev_caps->common_cap.max_mtu; + cached_caps = dev_caps->common_cap; num_funcs = dev_caps->num_funcs; /* unset dev capabilities */ memset(dev_caps, 0, sizeof(*dev_caps)); +#define ICE_RESTORE_DEV_CAP(name) \ + dev_caps->common_cap.name = cached_caps.name + /* restore cached values */ - dev_caps->common_cap.valid_functions = valid_func; - dev_caps->common_cap.txq_first_id = txq_first_id; - dev_caps->common_cap.rxq_first_id = rxq_first_id; - dev_caps->common_cap.msix_vector_first_id = msix_vector_first_id; - dev_caps->common_cap.max_mtu = max_mtu; + ICE_RESTORE_DEV_CAP(valid_functions); + ICE_RESTORE_DEV_CAP(txq_first_id); + ICE_RESTORE_DEV_CAP(rxq_first_id); + ICE_RESTORE_DEV_CAP(msix_vector_first_id); + ICE_RESTORE_DEV_CAP(max_mtu); + ICE_RESTORE_DEV_CAP(nvm_unified_update); dev_caps->num_funcs = num_funcs; /* one Tx and one Rx queue per function in safe mode */ @@ -2480,7 +2492,7 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_manage_mac_write); cmd->flags = flags; - ice_memcpy(cmd->mac_addr, mac_addr, ETH_ALEN, ICE_NONDMA_TO_DMA); + ice_memcpy(cmd->mac_addr, mac_addr, ETH_ALEN, ICE_NONDMA_TO_NONDMA); return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); } @@ -2816,6 +2828,11 @@ enum ice_status ice_update_link_info(struct ice_port_info *pi) status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, pcaps, NULL); + if (status == ICE_SUCCESS) + ice_memcpy(li->module_type, &pcaps->module_type, + sizeof(li->module_type), + ICE_NONDMA_TO_NONDMA); + ice_free(hw, pcaps); } @@ -3379,7 +3396,7 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_sff_eeprom); cmd = &desc.params.read_write_sff_param; - desc.flags = CPU_TO_LE16(ICE_AQ_FLAG_RD | ICE_AQ_FLAG_BUF); + desc.flags = CPU_TO_LE16(ICE_AQ_FLAG_RD); cmd->lport_num = (u8)(lport & 0xff); cmd->lport_num_valid = (u8)((lport >> 8) & 0x01); cmd->i2c_bus_addr = CPU_TO_LE16(((bus_addr >> 1) & @@ -3399,23 +3416,33 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, /** * __ice_aq_get_set_rss_lut * @hw: pointer to the hardware structure - * @vsi_id: VSI FW index - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer - * @glob_lut_idx: global LUT index + * @params: RSS LUT parameters * @set: set true to set the table, false to get the table * * Internal function to get (0x0B05) or set (0x0B03) RSS look up table */ static enum ice_status -__ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut, - u16 lut_size, u8 glob_lut_idx, bool set) +__ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *params, bool set) { + u16 flags = 0, vsi_id, lut_type, lut_size, glob_lut_idx, vsi_handle; struct ice_aqc_get_set_rss_lut *cmd_resp; struct ice_aq_desc desc; enum ice_status status; - u16 flags = 0; + u8 *lut; + + if (!params) + return ICE_ERR_PARAM; + + vsi_handle = params->vsi_handle; + lut = params->lut; + + if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) + return ICE_ERR_PARAM; + + lut_size = params->lut_size; + lut_type = params->lut_type; + glob_lut_idx = params->global_lut_id; + vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); cmd_resp = &desc.params.get_set_rss_lut; @@ -3492,43 +3519,27 @@ ice_aq_get_set_rss_lut_exit: /** * ice_aq_get_rss_lut * @hw: pointer to the hardware structure - * @vsi_handle: software VSI handle - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer + * @get_params: RSS LUT parameters used to specify which RSS LUT to get * * get the RSS lookup table, PF or VSI type */ enum ice_status -ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, - u8 *lut, u16 lut_size) +ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params) { - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) - return ICE_ERR_PARAM; - - return __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle), - lut_type, lut, lut_size, 0, false); + return __ice_aq_get_set_rss_lut(hw, get_params, false); } /** * ice_aq_set_rss_lut * @hw: pointer to the hardware structure - * @vsi_handle: software VSI handle - * @lut_type: LUT table type - * @lut: pointer to the LUT buffer provided by the caller - * @lut_size: size of the LUT buffer + * @set_params: RSS LUT parameters used to specify how to set the RSS LUT * * set the RSS lookup table, PF or VSI type */ enum ice_status -ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, - u8 *lut, u16 lut_size) +ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params) { - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) - return ICE_ERR_PARAM; - - return __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle), - lut_type, lut, lut_size, 0, true); + return __ice_aq_get_set_rss_lut(hw, set_params, true); } /** diff --git a/sys/dev/ice/ice_common.h b/sys/dev/ice/ice_common.h index 84a39b7e9b8a..3a28816fb131 100644 --- a/sys/dev/ice/ice_common.h +++ b/sys/dev/ice/ice_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,11 +117,9 @@ ice_write_tx_drbell_q_ctx(struct ice_hw *hw, u32 tx_drbell_q_index); enum ice_status -ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut, - u16 lut_size); +ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params); enum ice_status -ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut, - u16 lut_size); +ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params); enum ice_status ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle, struct ice_aqc_get_set_rss_keys *keys); @@ -240,13 +238,6 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, struct ice_sq_cd *cd); enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle); void ice_replay_post(struct ice_hw *hw); -void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw); -void ice_sched_replay_agg(struct ice_hw *hw); -enum ice_status ice_sched_replay_tc_node_bw(struct ice_port_info *pi); -enum ice_status ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle); -enum ice_status ice_sched_replay_root_node_bw(struct ice_port_info *pi); -enum ice_status -ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx); struct ice_q_ctx * ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle); void @@ -277,7 +268,7 @@ enum ice_status ice_get_cur_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); enum ice_status ice_get_dflt_lldp_persist_status(struct ice_hw *hw, u32 *lldp_status); -enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw); +enum ice_status ice_get_netlist_ver_info(struct ice_hw *hw, struct ice_netlist_info *netlist); enum ice_status ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, struct ice_sq_cd *cd); diff --git a/sys/dev/ice/ice_common_sysctls.h b/sys/dev/ice/ice_common_sysctls.h index 82ead3fcfecc..17c2fce72ee7 100644 --- a/sys/dev/ice/ice_common_sysctls.h +++ b/sys/dev/ice/ice_common_sysctls.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common_txrx.h b/sys/dev/ice/ice_common_txrx.h index 8fb3d49288d8..d5e6182c2212 100644 --- a/sys/dev/ice/ice_common_txrx.h +++ b/sys/dev/ice/ice_common_txrx.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index 3caab15e0e41..ee8d7f5c3e8f 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.h b/sys/dev/ice/ice_controlq.h index 0da6b025fc8c..947f1d6d1767 100644 --- a/sys/dev/ice/ice_controlq.h +++ b/sys/dev/ice/ice_controlq.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,8 +60,8 @@ enum ice_ctl_q { ICE_CTL_Q_MAILBOX, }; -/* Control Queue timeout settings - max delay 250ms */ -#define ICE_CTL_Q_SQ_CMD_TIMEOUT 2500 /* Count 2500 times */ +/* Control Queue timeout settings - max delay 1s */ +#define ICE_CTL_Q_SQ_CMD_TIMEOUT 10000 /* Count 10000 times */ #define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */ #define ICE_CTL_Q_ADMIN_INIT_TIMEOUT 10 /* Count 10 times */ #define ICE_CTL_Q_ADMIN_INIT_MSEC 100 /* Check every 100msec */ diff --git a/sys/dev/ice/ice_dcb.c b/sys/dev/ice/ice_dcb.c index b6275c5d07e8..abe0237eb88f 100644 --- a/sys/dev/ice/ice_dcb.c +++ b/sys/dev/ice/ice_dcb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -994,22 +994,27 @@ ice_aq_set_dcb_parameters(struct ice_hw *hw, bool dcb_enable, /** * ice_cee_to_dcb_cfg * @cee_cfg: pointer to CEE configuration struct - * @dcbcfg: DCB configuration struct + * @pi: port information structure * * Convert CEE configuration from firmware to DCB configuration */ static void ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, - struct ice_dcbx_cfg *dcbcfg) + struct ice_port_info *pi) { u32 status, tlv_status = LE32_TO_CPU(cee_cfg->tlv_status); u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift; + u8 i, j, err, sync, oper, app_index, ice_app_sel_type; u16 app_prio = LE16_TO_CPU(cee_cfg->oper_app_prio); - u8 i, err, sync, oper, app_index, ice_app_sel_type; u16 ice_aqc_cee_app_mask, ice_aqc_cee_app_shift; + struct ice_dcbx_cfg *cmp_dcbcfg, *dcbcfg; u16 ice_app_prot_id_type; - /* CEE PG data to ETS config */ + dcbcfg = &pi->qos_cfg.local_dcbx_cfg; + dcbcfg->dcbx_mode = ICE_DCBX_MODE_CEE; + dcbcfg->tlv_status = tlv_status; + + /* CEE PG data */ dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc; /* Note that the FW creates the oper_prio_tc nibbles reversed @@ -1036,10 +1041,16 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, } } - /* CEE PFC data to ETS config */ + /* CEE PFC data */ dcbcfg->pfc.pfcena = cee_cfg->oper_pfc_en; dcbcfg->pfc.pfccap = ICE_MAX_TRAFFIC_CLASS; + /* CEE APP TLV data */ + if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING) + cmp_dcbcfg = &pi->qos_cfg.desired_dcbx_cfg; + else + cmp_dcbcfg = &pi->qos_cfg.remote_dcbx_cfg; + app_index = 0; for (i = 0; i < 3; i++) { if (i == 0) { @@ -1058,6 +1069,18 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_ISCSI_S; ice_app_sel_type = ICE_APP_SEL_TCPIP; ice_app_prot_id_type = ICE_APP_PROT_ID_ISCSI; + + for (j = 0; j < cmp_dcbcfg->numapps; j++) { + u16 prot_id = cmp_dcbcfg->app[j].prot_id; + u8 sel = cmp_dcbcfg->app[j].selector; + + if (sel == ICE_APP_SEL_TCPIP && + (prot_id == ICE_APP_PROT_ID_ISCSI || + prot_id == ICE_APP_PROT_ID_ISCSI_860)) { + ice_app_prot_id_type = prot_id; + break; + } + } } else { /* FIP APP */ ice_aqc_cee_status_mask = ICE_AQC_CEE_FIP_STATUS_M; @@ -1148,11 +1171,8 @@ enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi) ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL); if (ret == ICE_SUCCESS) { /* CEE mode */ - dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; - dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_CEE; - dcbx_cfg->tlv_status = LE32_TO_CPU(cee_cfg.tlv_status); - ice_cee_to_dcb_cfg(&cee_cfg, dcbx_cfg); ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE); + ice_cee_to_dcb_cfg(&cee_cfg, pi); } else if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) { /* CEE mode not enabled try querying IEEE data */ dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; diff --git a/sys/dev/ice/ice_dcb.h b/sys/dev/ice/ice_dcb.h index 88c49c89fbd2..85d6b399cf11 100644 --- a/sys/dev/ice/ice_dcb.h +++ b/sys/dev/ice/ice_dcb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index a110133823df..8611fc170816 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 9ed3e3e2fb0e..340d53e4a671 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,16 +63,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "0.26.16-k"; +const char ice_driver_version[] = "0.28.1-k"; const uint8_t ice_major_version = 0; -const uint8_t ice_minor_version = 26; -const uint8_t ice_patch_version = 16; +const uint8_t ice_minor_version = 28; +const uint8_t ice_patch_version = 1; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 0.26.16-k") + PVID(vendor, devid, name " - 0.28.1-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 0.26.16-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 0.28.1-k") /** * @var ice_vendor_info_array @@ -113,20 +113,11 @@ static pci_vendor_info_t ice_vendor_info_array[] = { PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, ICE_INTEL_VENDOR_ID, 0x0008, 0, "Intel(R) Ethernet Network Adapter E810-C-Q2 for OCP3.0"), + PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, + ICE_INTEL_VENDOR_ID, 0x000D, 0, + "Intel(R) Ethernet Network Adapter E810-L-Q2 for OCP3.0"), PVIDV(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_QSFP, "Intel(R) Ethernet Controller E810-C for QSFP"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0001, 0, - "Intel(R) Ethernet Network Adapter E810-L-1"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0002, 0, - "Intel(R) Ethernet Network Adapter E810-L-2"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0003, 0, - "Intel(R) Ethernet Network Adapter E810-L-1"), - PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, - ICE_INTEL_VENDOR_ID, 0x0004, 0, - "Intel(R) Ethernet Network Adapter E810-L-2"), PVIDV_OEM(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_SFP, ICE_INTEL_VENDOR_ID, 0x0005, 0, "Intel(R) Ethernet Network Adapter E810-XXV-4"), diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index f5ea542d8626..dcb096509f73 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.c b/sys/dev/ice/ice_flex_pipe.c index 6a02239eca5c..e8e4403a23fe 100644 --- a/sys/dev/ice/ice_flex_pipe.c +++ b/sys/dev/ice/ice_flex_pipe.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2020, Intel Corporation +/* Copyright (c) 2021, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1057,6 +1057,13 @@ ice_dwnld_cfg_bufs(struct ice_hw *hw, struct ice_buf *bufs, u32 count) break; } + if (!status) { + status = ice_set_vlan_mode(hw); + if (status) + ice_debug(hw, ICE_DBG_PKG, "Failed to set VLAN mode: err %d\n", + status); + } + ice_release_global_cfg_lock(hw); return status; @@ -1126,34 +1133,40 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) static enum ice_status ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) { - struct ice_global_metadata_seg *meta_seg; struct ice_generic_seg_hdr *seg_hdr; ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); if (!pkg_hdr) return ICE_ERR_PARAM; - meta_seg = (struct ice_global_metadata_seg *) - ice_find_seg_in_pkg(hw, SEGMENT_TYPE_METADATA, pkg_hdr); - if (meta_seg) { - hw->pkg_ver = meta_seg->pkg_ver; - ice_memcpy(hw->pkg_name, meta_seg->pkg_name, - sizeof(hw->pkg_name), ICE_NONDMA_TO_NONDMA); + seg_hdr = (struct ice_generic_seg_hdr *) + ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr); + if (seg_hdr) { + struct ice_meta_sect *meta; + struct ice_pkg_enum state; + + ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM); + + /* Get package information from the Metadata Section */ + meta = (struct ice_meta_sect *) + ice_pkg_enum_section((struct ice_seg *)seg_hdr, &state, + ICE_SID_METADATA); + if (!meta) { + ice_debug(hw, ICE_DBG_INIT, "Did not find ice metadata section in package\n"); + return ICE_ERR_CFG; + } + + hw->pkg_ver = meta->ver; + ice_memcpy(hw->pkg_name, meta->name, sizeof(meta->name), + ICE_NONDMA_TO_NONDMA); ice_debug(hw, ICE_DBG_PKG, "Pkg: %d.%d.%d.%d, %s\n", - meta_seg->pkg_ver.major, meta_seg->pkg_ver.minor, - meta_seg->pkg_ver.update, meta_seg->pkg_ver.draft, - meta_seg->pkg_name); - } else { - ice_debug(hw, ICE_DBG_INIT, "Did not find metadata segment in driver package\n"); - return ICE_ERR_CFG; - } + meta->ver.major, meta->ver.minor, meta->ver.update, + meta->ver.draft, meta->name); - seg_hdr = ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr); - if (seg_hdr) { - hw->ice_pkg_ver = seg_hdr->seg_format_ver; - ice_memcpy(hw->ice_pkg_name, seg_hdr->seg_id, - sizeof(hw->ice_pkg_name), ICE_NONDMA_TO_NONDMA); + hw->ice_seg_fmt_ver = seg_hdr->seg_format_ver; + ice_memcpy(hw->ice_seg_id, seg_hdr->seg_id, + sizeof(hw->ice_seg_id), ICE_NONDMA_TO_NONDMA); *** 4744 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:36 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 65C396AF55C; Mon, 20 Sep 2021 23:22:36 +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 4HD0vw27Fcz3jrr; Mon, 20 Sep 2021 23:22:36 +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 1BA101970E; Mon, 20 Sep 2021 23:22:36 +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 18KNMaoB061502; Mon, 20 Sep 2021 23:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMZg7061501; Mon, 20 Sep 2021 23:22:35 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:35 GMT Message-Id: <202109202322.18KNMZg7061501@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: 6310681f67ef - stable/12 - ixl(4): Fix reporting of unqualified transceivers 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/12 X-Git-Reftype: branch X-Git-Commit: 6310681f67ef80908d6401fb150648073834360d 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: Mon, 20 Sep 2021 23:22:36 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=6310681f67ef80908d6401fb150648073834360d commit 6310681f67ef80908d6401fb150648073834360d Author: Krzysztof Galazka AuthorDate: 2021-08-20 21:12:28 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 22:12:05 +0000 ixl(4): Fix reporting of unqualified transceivers When link_active_on_if_down flag is disabled and link is brought down with ifconfig, FW reports a false positive link event about an unqualified transceiver. The condition used in the driver to filter out those false positive events was incorrect and caused that unqualified module event to also not be reported when the event was valid. Change the condition to rely on IFF_UP flag instead of link_active_on_if_down and bump driver version to 2.3.1-k. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: stallamr@netapp.com, erj@ Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D30733 (cherry picked from commit c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8) --- sys/dev/ixl/if_ixl.c | 2 +- sys/dev/ixl/ixl_pf_iflib.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 0da7679ee6b3..1c6ad5315047 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -49,7 +49,7 @@ *********************************************************************/ #define IXL_DRIVER_VERSION_MAJOR 2 #define IXL_DRIVER_VERSION_MINOR 3 -#define IXL_DRIVER_VERSION_BUILD 0 +#define IXL_DRIVER_VERSION_BUILD 1 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index bf3527bce4ba..abf3a633e6cc 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -403,20 +403,23 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) { struct i40e_hw *hw = &pf->hw; device_t dev = iflib_get_dev(pf->vsi.ctx); - struct i40e_aqc_get_link_status *status = - (struct i40e_aqc_get_link_status *)&e->desc.params.raw; - - /* Request link status from adapter */ + struct i40e_link_status *link_info = &hw->phy.link_info; + + /* Driver needs to re-enable delivering of link status events + * by FW after each event reception. Call i40e_get_link_status + * to do that. To not lose information about link state changes, + * which happened between receiving an event and the call, + * do not rely on status from event but use most recent + * status information retrieved by the call. */ hw->phy.get_link_info = TRUE; i40e_get_link_status(hw, &pf->link_up); /* Print out message if an unqualified module is found */ - if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && + if ((link_info->link_info & I40E_AQ_MEDIA_AVAILABLE) && (pf->advertised_speed) && - (atomic_load_32(&pf->state) & - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 && - (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && - (!(status->link_info & I40E_AQ_LINK_UP))) + (if_getflags(pf->vsi.ifp) & IFF_UP) && + (!(link_info->an_info & I40E_AQ_QUALIFIED_MODULE)) && + (!(link_info->link_info & I40E_AQ_LINK_UP))) device_printf(dev, "Link failed because " "an unqualified module was detected!\n"); From owner-dev-commits-src-branches@freebsd.org Mon Sep 20 23:22:37 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 B17386AF719; Mon, 20 Sep 2021 23:22:37 +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 4HD0vx2yvwz3jrw; Mon, 20 Sep 2021 23:22:37 +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 36C66192E7; Mon, 20 Sep 2021 23:22:37 +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 18KNMbTW061526; Mon, 20 Sep 2021 23:22:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KNMbNY061525; Mon, 20 Sep 2021 23:22:37 GMT (envelope-from git) Date: Mon, 20 Sep 2021 23:22:37 GMT Message-Id: <202109202322.18KNMbNY061525@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: bc2fa5ace223 - stable/12 - ixl(4): Fix 2.5 and 5G speeds reporting and update shared code 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/12 X-Git-Reftype: branch X-Git-Commit: bc2fa5ace223691874c5246b2f00b4e60922b463 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: Mon, 20 Sep 2021 23:22:37 -0000 The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc2fa5ace223691874c5246b2f00b4e60922b463 commit bc2fa5ace223691874c5246b2f00b4e60922b463 Author: Krzysztof Galazka AuthorDate: 2021-09-13 20:39:59 +0000 Commit: Eric Joyner CommitDate: 2021-09-20 22:12:32 +0000 ixl(4): Fix 2.5 and 5G speeds reporting and update shared code Fix 2.5 and 5G speeds reporting and update shared code with recent changes: - Update expected FW API versions for X710 and X722 adapters - Define pointers related to Preservation Rules Module - Add definitions for Shadow RAM pointers to new modules: 5th and 6th FPA, and Preservation Rules Module. - Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know opcode for parser aborted packets. - Add the new filter types needed for custom cloud filters. - Add support for Minimum Rollback Revision - Fix RX_ONLY mode for unicast promiscuous on VLAN - Add EEE LPI status check for X722 adapters - Fix PHY type identifiers for 2.5G and 5G adapters - Fix update link data for X722 - Increase the timeout value for PF reset to give PF more time to finish reset if it is loaded with filters. - Added support for Min Rollback Revision for 4 more X722 modules - Fix reporting of Active Optical Cable media type - Add flags and fields for double VLAN processing - Fix potentially uninitialized variables in NVM code Reviewed by: kbowling@, mike.jakubik@gmail.com Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D31565 (cherry picked from commit abf774528d7e497460510b0026db85e30f054142) --- sys/dev/ixl/i40e_adminq.c | 6 +- sys/dev/ixl/i40e_adminq_cmd.h | 71 +++++++++++++-- sys/dev/ixl/i40e_common.c | 206 ++++++++++++++++++++++++++---------------- sys/dev/ixl/i40e_dcb.c | 10 +- sys/dev/ixl/i40e_lan_hmc.c | 2 +- sys/dev/ixl/i40e_nvm.c | 13 ++- sys/dev/ixl/i40e_prototype.h | 10 +- sys/dev/ixl/i40e_register.h | 3 + sys/dev/ixl/i40e_type.h | 17 ++-- sys/dev/ixl/if_ixl.c | 4 +- 10 files changed, 234 insertions(+), 108 deletions(-) diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c index d25798d23bd1..efca7f1e61ff 100644 --- a/sys/dev/ixl/i40e_adminq.c +++ b/sys/dev/ixl/i40e_adminq.c @@ -646,8 +646,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { struct i40e_adminq_info *aq = &hw->aq; enum i40e_status_code ret_code; - u16 cfg_ptr, oem_hi, oem_lo; - u16 eetrack_lo, eetrack_hi; + u16 oem_hi = 0, oem_lo = 0; + u16 eetrack_hi = 0; + u16 eetrack_lo = 0; + u16 cfg_ptr = 0; int retry = 0; /* verify input for valid configuration */ diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h index 6161805a7cf0..564a076761d0 100644 --- a/sys/dev/ixl/i40e_adminq_cmd.h +++ b/sys/dev/ixl/i40e_adminq_cmd.h @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000A +#define I40E_FW_API_VERSION_MINOR_X722 0x000C +#define I40E_FW_API_VERSION_MINOR_X710 0x000E #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -267,7 +267,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, - i40e_aqc_opc_nvm_progress = 0x0706, + i40e_aqc_opc_nvm_update_in_process = 0x0706, + i40e_aqc_opc_rollback_revision_update = 0x0707, i40e_aqc_opc_oem_post_update = 0x0720, i40e_aqc_opc_thermal_sensor = 0x0721, @@ -467,6 +468,7 @@ struct i40e_aqc_list_capabilities_element_resp { #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS 0x0067 #define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 @@ -793,6 +795,7 @@ struct i40e_aqc_set_switch_config { #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT 0x0004 +#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN 0x0008 __le16 valid_flags; /* The ethertype in switch_tag is dropped on ingress and used * internally by the switch. Set this to zero for the default @@ -929,7 +932,7 @@ struct i40e_aqc_vsi_properties_data { u8 sec_reserved; /* VLAN section */ __le16 pvid; /* VLANS include priority bits */ - __le16 fcoe_pvid; + __le16 outer_vlan; u8 port_vlan_flags; #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00 #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \ @@ -945,7 +948,24 @@ struct i40e_aqc_vsi_properties_data { #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08 #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18 - u8 pvlan_reserved[3]; + u8 outer_vlan_flags; +#define I40E_AQ_VSI_OVLAN_MODE_SHIFT 0x00 +#define I40E_AQ_VSI_OVLAN_MODE_MASK (0x03 << \ + I40E_AQ_VSI_OVLAN_MODE_SHIFT) +#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED 0x01 +#define I40E_AQ_VSI_OVLAN_MODE_TAGGED 0x02 +#define I40E_AQ_VSI_OVLAN_MODE_ALL 0x03 +#define I40E_AQ_VSI_OVLAN_INSERT_PVID 0x04 +#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT 0x03 +#define I40E_AQ_VSI_OVLAN_EMOD_MASK (0x03 <<\ + I40E_AQ_VSI_OVLAN_EMOD_SHIFT) +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL 0x00 +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP 0x01 +#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL 0x02 +#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING 0x03 +#define I40E_AQ_VSI_OVLAN_CTRL_ENA 0x04 + + u8 pvlan_reserved[2]; /* ingress egress up sections */ __le32 ingress_table; /* bitmap, 3 bits per up */ #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0 @@ -1247,7 +1267,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; @@ -1433,6 +1453,8 @@ struct i40e_aqc_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +#define I40E_AQC_ADD_CLOUD_FILTER_OIP1 0x0010 +#define I40E_AQC_ADD_CLOUD_FILTER_OIP2 0x0012 /* 0x000D reserved */ /* 0x000E reserved */ /* 0x000F reserved */ @@ -1940,8 +1962,10 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_25GBASE_AOC = 0x23, I40E_PHY_TYPE_25GBASE_ACC = 0x24, - I40E_PHY_TYPE_2_5GBASE_T = 0x30, - I40E_PHY_TYPE_5GBASE_T = 0x31, + I40E_PHY_TYPE_2_5GBASE_T = 0x26, + I40E_PHY_TYPE_5GBASE_T = 0x27, + I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30, + I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31, I40E_PHY_TYPE_MAX, I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, I40E_PHY_TYPE_EMPTY = 0xFE, @@ -2411,6 +2435,16 @@ struct i40e_aqc_nvm_config_data_feature { I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); +/* NVM Update in Process (direct 0x0706) */ +struct i40e_aqc_nvm_update_in_process { + u8 command; +#define I40E_AQ_UPDATE_FLOW_END 0x0 +#define I40E_AQ_UPDATE_FLOW_START 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process); + struct i40e_aqc_nvm_config_data_immediate_field { __le32 field_id; __le32 field_value; @@ -2420,6 +2454,27 @@ struct i40e_aqc_nvm_config_data_immediate_field { I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { + u8 optin_mode; /* bool */ +#define I40E_AQ_RREV_OPTIN_MODE 0x01 + u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 +#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION 5 +#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION 6 +#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION 7 +#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION 8 + u8 reserved1[2]; + u32 min_rrev; + u8 reserved2[8]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update); + /* OEM Post Update (indirect 0x0720) * no command data struct used */ diff --git a/sys/dev/ixl/i40e_common.c b/sys/dev/ixl/i40e_common.c index 4325901c0920..332893938c19 100644 --- a/sys/dev/ixl/i40e_common.c +++ b/sys/dev/ixl/i40e_common.c @@ -1251,12 +1251,15 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_40GBASE_LR4: case I40E_PHY_TYPE_25GBASE_LR: case I40E_PHY_TYPE_25GBASE_SR: + case I40E_PHY_TYPE_10GBASE_AOC: + case I40E_PHY_TYPE_25GBASE_AOC: + case I40E_PHY_TYPE_40GBASE_AOC: media = I40E_MEDIA_TYPE_FIBER; break; case I40E_PHY_TYPE_100BASE_TX: case I40E_PHY_TYPE_1000BASE_T: - case I40E_PHY_TYPE_2_5GBASE_T: - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: case I40E_PHY_TYPE_10GBASE_T: media = I40E_MEDIA_TYPE_BASET; break; @@ -1265,10 +1268,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_10GBASE_SFPP_CU: - case I40E_PHY_TYPE_40GBASE_AOC: - case I40E_PHY_TYPE_10GBASE_AOC: case I40E_PHY_TYPE_25GBASE_CR: - case I40E_PHY_TYPE_25GBASE_AOC: case I40E_PHY_TYPE_25GBASE_ACC: media = I40E_MEDIA_TYPE_DA; break; @@ -1316,7 +1316,7 @@ static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, return I40E_ERR_RESET_FAILED; } -#define I40E_PF_RESET_WAIT_COUNT 200 +#define I40E_PF_RESET_WAIT_COUNT 1000 /** * i40e_pf_reset - Reset the PF * @hw: pointer to the hardware structure @@ -1563,7 +1563,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx) **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1576,20 +1575,6 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; @@ -1610,7 +1595,6 @@ u32 i40e_led_get(struct i40e_hw *hw) **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & ~I40E_LED_MODE_VALID) { @@ -1627,20 +1611,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } if (I40E_IS_X710TL_DEVICE(hw->device_id)) { u32 pin_func = 0; @@ -2053,6 +2023,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw, hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; + /* 'Get Link Status' response data structure from X722 FW has + * different format and does not contain this information + */ if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE && hw->mac.type != I40E_MAC_X722) { __le32 tmp; @@ -2251,6 +2224,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_hw_ver_ge + * @hw: pointer to the hw struct + * @maj: api major value + * @min: api minor value + * + * Assert whether current HW api version is greater/equal than provided. + **/ +static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min) +{ + if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) + return TRUE; + return FALSE; +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2376,18 +2365,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2519,11 +2506,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); @@ -2633,7 +2626,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, } /** - * i40e_get_vsi_params - get VSI configuration info + * i40e_aq_get_vsi_params - get VSI configuration info * @hw: pointer to the hw struct * @vsi_ctx: pointer to a vsi context struct * @cmd_details: pointer to command details structure or NULL @@ -2893,7 +2886,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up) } /** - * i40e_updatelink_status - update status of the HW network link + * i40e_update_link_info - update status of the HW network link * @hw: pointer to the hw struct **/ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) @@ -2906,10 +2899,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) return status; /* extra checking needed to ensure link info to user is timely */ - if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && - ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || - !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) { - status = i40e_aq_get_phy_capabilities(hw, FALSE, false, + if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && + ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || + !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) || + hw->mac.type == I40E_MAC_X722) { + status = i40e_aq_get_phy_capabilities(hw, FALSE, + hw->mac.type == + I40E_MAC_X722, &abilities, NULL); if (status) return status; @@ -3666,6 +3662,64 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, return status; } +/** + * i40e_aq_nvm_update_in_process + * @hw: pointer to the hw struct + * @update_flow_state: True indicates that update flow starts, FALSE that ends + * @cmd_details: pointer to command details structure or NULL + * + * Indicate NVM update in process. + **/ +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_nvm_update_in_process *cmd = + (struct i40e_aqc_nvm_update_in_process *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_nvm_update_in_process); + + cmd->command = I40E_AQ_UPDATE_FLOW_END; + + if (update_flow_state) + cmd->command |= I40E_AQ_UPDATE_FLOW_START; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_aq_min_rollback_rev_update - triggers an ow after update + * @hw: pointer to the hw struct + * @mode: opt-in mode, 1b for single module update, 0b for bulk update + * @module: module to be updated. Ignored if mode is 0b + * @min_rrev: value of the new minimal version. Ignored if mode is 0b + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + /** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct @@ -3998,7 +4052,13 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, p->wr_csr_prot |= (u64)logical_id << 32; i40e_debug(hw, I40E_DEBUG_INIT, "HW Capability: wr_csr_prot = 0x%llX\n\n", - (p->wr_csr_prot & 0xffff)); + (unsigned long long)(p->wr_csr_prot & 0xffff)); + break; + case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS: + p->dis_unused_ports = (bool)number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: dis_unused_ports = %d\n\n", + p->dis_unused_ports); break; case I40E_AQ_CAP_ID_NVM_MGMT: if (number & I40E_NVM_MGMT_SEC_REV_DISABLED) @@ -4193,28 +4253,6 @@ i40e_aq_update_nvm_exit: return status; } -/** - * i40e_aq_nvm_progress - * @hw: pointer to the hw struct - * @progress: pointer to progress returned from AQ - * @cmd_details: pointer to command details structure or NULL - * - * Gets progress of flash rearrangement process - **/ -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, - struct i40e_asq_cmd_details *cmd_details) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - - DEBUGFUNC("i40e_aq_nvm_progress"); - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - *progress = desc.params.raw[0]; - return status; -} - /** * i40e_aq_get_lldp_mib * @hw: pointer to the hw struct @@ -4593,7 +4631,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, } /** - * i40e_aq_get_switch_resource_alloc (0x0204) + * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations * @hw: pointer to the hw struct * @num_entries: pointer to u8 to store the number of resource entries returned * @buf: pointer to a user supplied buffer. This buffer must be large enough @@ -6705,7 +6743,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num) } /** - * i40e_blink_phy_led + * i40e_blink_phy_link_led * @hw: pointer to the HW structure * @time: time how long led will blinks in secs * @interval: gap between LED on and off in msecs @@ -6942,15 +6980,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) { enum i40e_status_code ret = I40E_SUCCESS; + bool eee_mrvl_phy; + bool eee_bcm_phy; u32 val; stat->rx_lpi_status = 0; stat->tx_lpi_status = 0; - if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { + eee_bcm_phy = + (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); + eee_mrvl_phy = + hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; + + if (eee_bcm_phy || eee_mrvl_phy) { + // read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE, @@ -7542,7 +7588,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, } /** - * i40e_aq_opc_set_ns_proxy_table_entry + * i40e_aq_set_ns_proxy_table_entry * @hw: pointer to the HW structure * @ns_proxy_table_entry: pointer to NS table entry command struct * @cmd_details: pointer to command details diff --git a/sys/dev/ixl/i40e_dcb.c b/sys/dev/ixl/i40e_dcb.c index b2f0b5c0acad..a02cbc80d361 100644 --- a/sys/dev/ixl/i40e_dcb.c +++ b/sys/dev/ixl/i40e_dcb.c @@ -265,7 +265,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv, } /** - * i40e_parse_ieee_etsrec_tlv + * i40e_parse_ieee_tlv * @tlv: IEEE 802.1Qaz TLV * @dcbcfg: Local store to update ETS REC data * @@ -345,9 +345,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv, * |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7| * --------------------------------- */ - for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) + for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { etscfg->tcbwtable[i] = buf[offset++]; + if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT) + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT; + else + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS; + } + /* Number of TCs supported (1 octet) */ etscfg->maxtcs = buf[offset]; } diff --git a/sys/dev/ixl/i40e_lan_hmc.c b/sys/dev/ixl/i40e_lan_hmc.c index c280393ef1c8..eb2c44c92067 100644 --- a/sys/dev/ixl/i40e_lan_hmc.c +++ b/sys/dev/ixl/i40e_lan_hmc.c @@ -546,7 +546,7 @@ configure_lan_hmc_out: } /** - * i40e_delete_hmc_object - remove hmc objects + * i40e_delete_lan_hmc_object - remove hmc objects * @hw: pointer to the HW structure * @info: pointer to i40e_hmc_delete_obj_info struct * diff --git a/sys/dev/ixl/i40e_nvm.c b/sys/dev/ixl/i40e_nvm.c index 20ba63a05b4e..58e5c1a0cdd9 100644 --- a/sys/dev/ixl/i40e_nvm.c +++ b/sys/dev/ixl/i40e_nvm.c @@ -35,7 +35,7 @@ #include "i40e_prototype.h" /** - * i40e_init_nvm_ops - Initialize NVM function pointers + * i40e_init_nvm - Initialize NVM function pointers * @hw: pointer to the HW structure * * Setup the function pointers and the NVM info structure. Should be called @@ -108,7 +108,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, if (ret_code) i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire type %d failed time_left=%llu ret=%d aq_err=%d\n", - access, time_left, ret_code, hw->aq.asq_last_status); + access, (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); if (ret_code && time_left) { /* Poll until the current NVM owner timeouts */ @@ -130,7 +131,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, hw->nvm.hw_semaphore_timeout = 0; i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire timed out, wait %llu ms before trying again. status=%d aq_err=%d\n", - time_left, ret_code, hw->aq.asq_last_status); + (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); } } @@ -782,10 +784,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw) DEBUGFUNC("i40e_update_nvm_checksum"); ret_code = i40e_calc_nvm_checksum(hw, &checksum); - le_sum = CPU_TO_LE16(checksum); - if (ret_code == I40E_SUCCESS) + if (ret_code == I40E_SUCCESS) { + le_sum = CPU_TO_LE16(checksum); ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, 1, &le_sum, TRUE); + } return ret_code; } diff --git a/sys/dev/ixl/i40e_prototype.h b/sys/dev/ixl/i40e_prototype.h index 23ce2edb22a3..2febf9d6662d 100644 --- a/sys/dev/ixl/i40e_prototype.h +++ b/sys/dev/ixl/i40e_prototype.h @@ -268,6 +268,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw, void *buff, u16 buff_size, struct i40e_asq_cmd_details *cmd_details); @@ -279,7 +283,11 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, u32 offset, u16 length, void *data, bool last_command, u8 preservation_flags, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, +enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, + u8 rearrange_nvm, + struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, u8 mib_type, void *buff, u16 buff_size, diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h index 6c57d0a25f7e..ffc6a7e506a6 100644 --- a/sys/dev/ixl/i40e_register.h +++ b/sys/dev/ixl/i40e_register.h @@ -232,6 +232,9 @@ #define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT) #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00 /* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT) #define I40E_GLDCB_GENC 0x00083044 /* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0 #define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT) diff --git a/sys/dev/ixl/i40e_type.h b/sys/dev/ixl/i40e_type.h index 699576ff5b43..f34002d7dc35 100644 --- a/sys/dev/ixl/i40e_type.h +++ b/sys/dev/ixl/i40e_type.h @@ -347,12 +347,8 @@ struct i40e_phy_info { I40E_PHY_TYPE_OFFSET) #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \ I40E_PHY_TYPE_OFFSET) -/* Offset for 2.5G/5G PHY Types value to bit number conversion */ -#define I40E_PHY_TYPE_OFFSET2 (-10) -#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) -#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) +#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) +#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T) #define I40E_HW_CAP_MAX_GPIO 30 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO 0 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C 1 @@ -443,6 +439,7 @@ struct i40e_hw_capabilities { u32 enabled_tcmap; u32 maxtc; u64 wr_csr_prot; + bool dis_unused_ports; bool apm_wol_support; enum i40e_acpi_programming_method acpi_prog_method; bool proxy_support; @@ -975,7 +972,8 @@ enum i40e_rx_l2_ptype { I40E_RX_PTYPE_GRENAT4_MAC_PAY3 = 58, I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4 = 87, I40E_RX_PTYPE_GRENAT6_MAC_PAY3 = 124, - I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153 + I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153, + I40E_RX_PTYPE_PARSER_ABORTED = 255 }; struct i40e_rx_ptype_decoded { @@ -1551,6 +1549,9 @@ struct i40e_hw_port_stats { #define I40E_SR_CONFIGURATION_METADATA_PTR 0x4D #define I40E_SR_IMMEDIATE_VALUES_PTR 0x4E #define I40E_SR_5TH_FREE_PROVISION_AREA_PTR 0x50 +#define I40E_SR_PRESERVATION_RULES_PTR 0x70 +#define I40E_FPK_SR_5TH_FREE_PROVISION_AREA_PTR 0x71 +#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR 0x71 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */ #define I40E_SR_VPD_MODULE_MAX_SIZE 1024 @@ -1720,6 +1721,8 @@ struct i40e_lldp_variables { #define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT) #define I40E_VERIFY_TAG_SHIFT 31 #define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT) #define I40E_FLEX_50_SHIFT 13 #define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 1c6ad5315047..8741eb06ac18 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1525,11 +1525,11 @@ ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr) ifmr->ifm_active |= IFM_1000_T; break; /* 2.5 G */ - case I40E_PHY_TYPE_2_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_2500_T; break; /* 5 G */ - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_5000_T; break; /* 10 G */ From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:32:28 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 C5788673892; Tue, 21 Sep 2021 13:32:28 +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 4HDMmX5BFfz4jV9; Tue, 21 Sep 2021 13:32:28 +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 9265024BC1; Tue, 21 Sep 2021 13:32:28 +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 18LDWSYN021858; Tue, 21 Sep 2021 13:32:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDWSjg021857; Tue, 21 Sep 2021 13:32:28 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:32:28 GMT Message-Id: <202109211332.18LDWSjg021857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 62faf669ac4b - stable/13 - vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 62faf669ac4b779d7444e72ad97ebfefbfaaaf63 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: Tue, 21 Sep 2021 13:32:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=62faf669ac4b779d7444e72ad97ebfefbfaaaf63 commit 62faf669ac4b779d7444e72ad97ebfefbfaaaf63 Author: Konstantin Belousov AuthorDate: 2021-09-14 12:25:37 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-21 13:31:27 +0000 vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments (cherry picked from commit 181bfb42fd01bfa9f4636e803ccb3eeed8ac8ba4) --- sys/vm/vm_page.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index aae45513a44c..dc56ca9bae05 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -552,11 +552,12 @@ vm_offset_t vm_page_startup(vm_offset_t vaddr) { struct vm_phys_seg *seg; + struct vm_domain *vmd; vm_page_t m; char *list, *listend; vm_paddr_t end, high_avail, low_avail, new_end, size; vm_paddr_t page_range __unused; - vm_paddr_t last_pa, pa; + vm_paddr_t last_pa, pa, startp, endp; u_long pagecount; #if MINIDUMP_PAGE_TRACKING u_long vm_page_dump_size; @@ -770,21 +771,20 @@ vm_page_startup(vm_offset_t vaddr) vm_page_init_page(m, pa, segind); /* - * Add the segment to the free lists only if it is covered by - * one of the ranges in phys_avail. Because we've added the - * ranges to the vm_phys_segs array, we can assume that each - * segment is either entirely contained in one of the ranges, - * or doesn't overlap any of them. + * Add the segment's pages that are covered by one of + * phys_avail's ranges to the free lists. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { - struct vm_domain *vmd; - - if (seg->start < phys_avail[i] || - seg->end > phys_avail[i + 1]) + if (seg->end < phys_avail[i] || + seg->start >= phys_avail[i + 1]) continue; - m = seg->first_page; - pagecount = (u_long)atop(seg->end - seg->start); + startp = MAX(seg->start, phys_avail[i]); + m = seg->first_page + atop(seg->start - startp); + endp = MIN(seg->end, phys_avail[i + 1]); + pagecount = (u_long)atop(endp - startp); + if (pagecount == 0) + continue; vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); @@ -796,7 +796,6 @@ vm_page_startup(vm_offset_t vaddr) vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; vmd->vmd_segs |= 1UL << m->segind; - break; } } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:32:30 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 2D618673278; Tue, 21 Sep 2021 13:32:30 +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 4HDMmY75NZz4jXt; Tue, 21 Sep 2021 13:32:29 +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 B42EF24E16; Tue, 21 Sep 2021 13:32:29 +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 18LDWT7Z021882; Tue, 21 Sep 2021 13:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDWTUG021881; Tue, 21 Sep 2021 13:32:29 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:32:29 GMT Message-Id: <202109211332.18LDWTUG021881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6a9e83fec125 - stable/13 - vm_page_startup: correct calculation of the starting page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a9e83fec1256fe3378d78ccf1964bc087111101 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: Tue, 21 Sep 2021 13:32:30 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a9e83fec1256fe3378d78ccf1964bc087111101 commit 6a9e83fec1256fe3378d78ccf1964bc087111101 Author: Konstantin Belousov AuthorDate: 2021-09-17 18:48:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-21 13:31:27 +0000 vm_page_startup: correct calculation of the starting page (cherry picked from commit bd3a668087efb02e8e84315f7cc29d3813270dff) --- sys/vm/vm_page.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index dc56ca9bae05..9ca18129f415 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -775,27 +775,25 @@ vm_page_startup(vm_offset_t vaddr) * phys_avail's ranges to the free lists. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (seg->end < phys_avail[i] || + if (seg->end <= phys_avail[i] || seg->start >= phys_avail[i + 1]) continue; startp = MAX(seg->start, phys_avail[i]); - m = seg->first_page + atop(seg->start - startp); endp = MIN(seg->end, phys_avail[i + 1]); pagecount = (u_long)atop(endp - startp); if (pagecount == 0) continue; + m = seg->first_page + atop(startp - seg->start); vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); vm_phys_enqueue_contig(m, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; - - vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; - vmd->vmd_segs |= 1UL << m->segind; + vmd->vmd_segs |= 1UL << segind; } } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:27 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 2F44C673C29; Tue, 21 Sep 2021 13:48: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 4HDN6z0rt5z4kRG; Tue, 21 Sep 2021 13:48:27 +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 F20D4249DD; Tue, 21 Sep 2021 13:48:26 +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 18LDmQxq035545; Tue, 21 Sep 2021 13:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmQ7n035544; Tue, 21 Sep 2021 13:48:26 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:26 GMT Message-Id: <202109211348.18LDmQ7n035544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fefff1bac5e2 - stable/13 - socket: De-duplicate SBLOCKWAIT() definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fefff1bac5e20aea79a8acdf1536a34dd58e3fa4 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: Tue, 21 Sep 2021 13:48:27 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fefff1bac5e20aea79a8acdf1536a34dd58e3fa4 commit fefff1bac5e20aea79a8acdf1536a34dd58e3fa4 Author: Mark Johnston AuthorDate: 2021-09-14 13:01:32 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:37:21 +0000 socket: De-duplicate SBLOCKWAIT() definitions Sponsored by: The FreeBSD Foundation (cherry picked from commit fa0463c384b652e1e962d5e8e70396e6a876f01b) --- sys/dev/hyperv/hvsock/hv_sock.c | 1 - sys/kern/uipc_socket.c | 2 -- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 2 -- sys/sys/socketvar.h | 2 ++ 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index 00e296fcd335..bdc8974afdbd 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -626,7 +626,6 @@ hvs_trans_disconnect(struct socket *so) return (0); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) struct hvs_callback_arg { struct uio *uio; struct sockbuf *sb; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9f4e2fc64e98..dc7407808535 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1370,8 +1370,6 @@ sodisconnect(struct socket *so) return (error); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) - int sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index a38bdfcbed59..62e12f3b477c 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -1047,8 +1047,6 @@ out: return (error); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) - /* * Send on a socket. If send must go all at once and message is larger than * send buffering, then hard error. Lock against other senders. If must go diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 47033fdabbfa..6452716d36de 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -255,6 +255,8 @@ struct socket { #define SBL_NOINTR 0x00000002 /* Force non-interruptible sleep. */ #define SBL_VALID (SBL_WAIT | SBL_NOINTR) +#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) + /* * Do we need to notify the other side when I/O is possible? */ From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:28 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 5C5A0673767; Tue, 21 Sep 2021 13:48:28 +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 4HDN701zNkz4kZV; Tue, 21 Sep 2021 13:48:28 +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 20282250B3; Tue, 21 Sep 2021 13:48:28 +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 18LDmSGQ035569; Tue, 21 Sep 2021 13:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmStX035568; Tue, 21 Sep 2021 13:48:28 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:28 GMT Message-Id: <202109211348.18LDmStX035568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3c9c3ab05c56 - stable/13 - ip6mrouter: Make the expiration callout MPSAFE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c9c3ab05c5655322515f71e8dcfa535db381ab3 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: Tue, 21 Sep 2021 13:48:28 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3c9c3ab05c5655322515f71e8dcfa535db381ab3 commit 3c9c3ab05c5655322515f71e8dcfa535db381ab3 Author: Mark Johnston AuthorDate: 2021-09-07 15:15:49 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:37:32 +0000 ip6mrouter: Make the expiration callout MPSAFE - Protect the `expire_upcalls` callout with the MFC6 mutex. The callout handler needs this mutex anyway. - Convert the MROUTER6 mutex to a sleepable sx lock. It is only used when configuring the global v6 multicast routing socket, so is only used in system call paths where sleeping is safe. This lets us drain the callout without having to drop the lock. - For all locking macros in the file, convert to using a _LOCKPTR macro. Reported by: mav Sponsored by: The FreeBSD Foundation (cherry picked from commit 353783964c605e9cd71f359444c1230226d5782f) --- sys/netinet6/ip6_mroute.c | 56 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 503c83490940..087e0c5059fd 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -167,16 +167,13 @@ SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 -static struct mtx mrouter6_mtx; -#define MROUTER6_LOCK() mtx_lock(&mrouter6_mtx) -#define MROUTER6_UNLOCK() mtx_unlock(&mrouter6_mtx) -#define MROUTER6_LOCK_ASSERT() do { \ - mtx_assert(&mrouter6_mtx, MA_OWNED); \ - NET_ASSERT_GIANT(); \ -} while (0) -#define MROUTER6_LOCK_INIT() \ - mtx_init(&mrouter6_mtx, "IPv6 multicast forwarding", NULL, MTX_DEF) -#define MROUTER6_LOCK_DESTROY() mtx_destroy(&mrouter6_mtx) +static struct sx mrouter6_mtx; +#define MROUTER6_LOCKPTR() (&mrouter6_mtx) +#define MROUTER6_LOCK() sx_xlock(MROUTER6_LOCKPTR()) +#define MROUTER6_UNLOCK() sx_xunlock(MROUTER6_LOCKPTR()) +#define MROUTER6_LOCK_ASSERT() sx_assert(MROUTER6_LOCKPTR(), SA_XLOCKED +#define MROUTER6_LOCK_INIT() sx_init(MROUTER6_LOCKPTR(), "mrouter6") +#define MROUTER6_LOCK_DESTROY() sx_destroy(MROUTER6_LOCKPTR()) static struct mf6c *mf6ctable[MF6CTBLSIZ]; SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, @@ -185,15 +182,14 @@ SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, "netinet6/ip6_mroute.h)"); static struct mtx mfc6_mtx; -#define MFC6_LOCK() mtx_lock(&mfc6_mtx) -#define MFC6_UNLOCK() mtx_unlock(&mfc6_mtx) -#define MFC6_LOCK_ASSERT() do { \ - mtx_assert(&mfc6_mtx, MA_OWNED); \ - NET_ASSERT_GIANT(); \ -} while (0) -#define MFC6_LOCK_INIT() \ - mtx_init(&mfc6_mtx, "IPv6 multicast forwarding cache", NULL, MTX_DEF) -#define MFC6_LOCK_DESTROY() mtx_destroy(&mfc6_mtx) +#define MFC6_LOCKPTR() (&mfc6_mtx) +#define MFC6_LOCK() mtx_lock(MFC6_LOCKPTR()) +#define MFC6_UNLOCK() mtx_unlock(MFC6_LOCKPTR()) +#define MFC6_LOCK_ASSERT() mtx_assert(MFC6_LOCKPTR(), MA_OWNED) +#define MFC6_LOCK_INIT() mtx_init(MFC6_LOCKPTR(), \ + "IPv6 multicast forwarding cache", \ + NULL, MTX_DEF) +#define MFC6_LOCK_DESTROY() mtx_destroy(MFC6_LOCKPTR()) static u_char n6expire[MF6CTBLSIZ]; @@ -230,12 +226,13 @@ SYSCTL_PROC(_net_inet6_ip6, OID_AUTO, mif6table, "netinet6/ip6_mroute.h)"); static struct mtx mif6_mtx; -#define MIF6_LOCK() mtx_lock(&mif6_mtx) -#define MIF6_UNLOCK() mtx_unlock(&mif6_mtx) -#define MIF6_LOCK_ASSERT() mtx_assert(&mif6_mtx, MA_OWNED) +#define MIF6_LOCKPTR() (&mif6_mtx) +#define MIF6_LOCK() mtx_lock(MIF6_LOCKPTR()) +#define MIF6_UNLOCK() mtx_unlock(MIF6_LOCKPTR()) +#define MIF6_LOCK_ASSERT() mtx_assert(MIF6_LOCKPTR(), MA_OWNED) #define MIF6_LOCK_INIT() \ - mtx_init(&mif6_mtx, "IPv6 multicast interfaces", NULL, MTX_DEF) -#define MIF6_LOCK_DESTROY() mtx_destroy(&mif6_mtx) + mtx_init(MIF6_LOCKPTR(), "IPv6 multicast interfaces", NULL, MTX_DEF) +#define MIF6_LOCK_DESTROY() mtx_destroy(MIF6_LOCKPTR()) #ifdef MRT6DEBUG VNET_DEFINE_STATIC(u_int, mrt6debug) = 0; /* debug level */ @@ -583,11 +580,12 @@ ip6_mrouter_init(struct socket *so, int v, int cmd) V_pim6 = 0;/* used for stubbing out/in pim stuff */ - callout_init(&expire_upcalls_ch, 0); + callout_init_mtx(&expire_upcalls_ch, MFC6_LOCKPTR(), 0); callout_reset(&expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, NULL); MROUTER6_UNLOCK(); + MRT6_DLOG(DEBUG_ANY, "finished"); return (0); @@ -626,8 +624,6 @@ X_ip6_mrouter_done(void) V_pim6 = 0; /* used to stub out/in pim specific code */ - callout_stop(&expire_upcalls_ch); - /* * Free all multicast forwarding cache entries. */ @@ -652,6 +648,8 @@ X_ip6_mrouter_done(void) bzero((caddr_t)mf6ctable, sizeof(mf6ctable)); MFC6_UNLOCK(); + callout_drain(&expire_upcalls_ch); + /* * Reset register interface */ @@ -1315,7 +1313,8 @@ expire_upcalls(void *unused) struct mf6c *mfc, **nptr; u_long i; - MFC6_LOCK(); + MFC6_LOCK_ASSERT(); + for (i = 0; i < MF6CTBLSIZ; i++) { if (n6expire[i] == 0) continue; @@ -1353,7 +1352,6 @@ expire_upcalls(void *unused) } } } - MFC6_UNLOCK(); callout_reset(&expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, NULL); } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:30 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 E162A673AE8; Tue, 21 Sep 2021 13:48:30 +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 4HDN724rmyz4kFj; Tue, 21 Sep 2021 13:48:30 +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 674D6250B5; Tue, 21 Sep 2021 13:48:30 +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 18LDmUus035617; Tue, 21 Sep 2021 13:48:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmUrA035616; Tue, 21 Sep 2021 13:48:30 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:30 GMT Message-Id: <202109211348.18LDmUrA035616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bcc7e68fcf2c - stable/13 - nd6: Make the DAD callout MPSAFE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bcc7e68fcf2c34b5f090f55923adc4debc7cc91d 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: Tue, 21 Sep 2021 13:48:31 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bcc7e68fcf2c34b5f090f55923adc4debc7cc91d commit bcc7e68fcf2c34b5f090f55923adc4debc7cc91d Author: Mark Johnston AuthorDate: 2021-09-07 13:49:47 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:37:52 +0000 nd6: Make the DAD callout MPSAFE Interface addresses with pending duplicate address detection (DAD) live in a global queue. In this case, a callout is associated with each entry. The callout transmits neighbour solicitations until the system decides the address is no longer tentative, or until a duplicate address is discovered. At this point the entry is dequeued and freed. DAD may be manually stopped as well. The callout currently runs (and potentially transmits packets) with Giant held. Reorganize DAD queue locking to interlock properly with the callout: - Configure the callout to acquire the DAD queue lock before running. The lock is dropped before transmitting any packets. Stop protecting the callout with Giant. - When looking up DAD queue entries for an incoming NS or NA, don't bother fiddling with the DAD queue entry reference count. - Split nd6_dad_starttimer() so that the caller is responsible to transmitting a NS if it so desires. - Remove the DAD entry from the queue before stopping the timer. Use a temporary reference to make sure that the entry doesn't get freed by the callout while we're draining. Reported by: mav Reviewed by: bz, hrs Sponsored by: The FreeBSD Foundation (cherry picked from commit 9a94097cd0f46aacf688973d15b3b462c79f0008) --- sys/netinet6/nd6_nbr.c | 116 +++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 30d73f9d71a9..2100700733ad 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -84,9 +84,9 @@ static struct dadq *nd6_dad_find(struct ifaddr *, struct nd_opt_nonce *); static void nd6_dad_add(struct dadq *dp); static void nd6_dad_del(struct dadq *dp); static void nd6_dad_rele(struct dadq *); -static void nd6_dad_starttimer(struct dadq *, int, int); +static void nd6_dad_starttimer(struct dadq *, int); static void nd6_dad_stoptimer(struct dadq *); -static void nd6_dad_timer(struct dadq *); +static void nd6_dad_timer(void *); static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); static void nd6_dad_ns_output(struct dadq *); static void nd6_dad_ns_input(struct ifaddr *, struct nd_opt_nonce *); @@ -1135,26 +1135,31 @@ VNET_DEFINE_STATIC(struct rwlock, dad_rwlock); #define V_dadq VNET(dadq) #define V_dad_rwlock VNET(dad_rwlock) -#define DADQ_RLOCK() rw_rlock(&V_dad_rwlock) -#define DADQ_RUNLOCK() rw_runlock(&V_dad_rwlock) -#define DADQ_WLOCK() rw_wlock(&V_dad_rwlock) -#define DADQ_WUNLOCK() rw_wunlock(&V_dad_rwlock) +#define DADQ_LOCKPTR() (&V_dad_rwlock) +#define DADQ_LOCK_INIT() rw_init(DADQ_LOCKPTR(), "nd6 DAD queue") +#define DADQ_RLOCK() rw_rlock(DADQ_LOCKPTR()) +#define DADQ_RUNLOCK() rw_runlock(DADQ_LOCKPTR()) +#define DADQ_WLOCK() rw_wlock(DADQ_LOCKPTR()) +#define DADQ_WUNLOCK() rw_wunlock(DADQ_LOCKPTR()) + +#define DADQ_LOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_LOCKED); +#define DADQ_RLOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_RLOCKED); +#define DADQ_WLOCK_ASSERT() rw_assert(DADQ_LOCKPTR(), RA_WLOCKED); static void nd6_dad_add(struct dadq *dp) { + DADQ_WLOCK_ASSERT(); - DADQ_WLOCK(); TAILQ_INSERT_TAIL(&V_dadq, dp, dad_list); dp->dad_ondadq = true; - DADQ_WUNLOCK(); } static void nd6_dad_del(struct dadq *dp) { + DADQ_WLOCK_ASSERT(); - DADQ_WLOCK(); if (dp->dad_ondadq) { /* * Remove dp from the dadq and release the dadq's @@ -1162,10 +1167,8 @@ nd6_dad_del(struct dadq *dp) */ TAILQ_REMOVE(&V_dadq, dp, dad_list); dp->dad_ondadq = false; - DADQ_WUNLOCK(); nd6_dad_rele(dp); - } else - DADQ_WUNLOCK(); + } } static struct dadq * @@ -1173,10 +1176,12 @@ nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) { struct dadq *dp; - DADQ_RLOCK(); + DADQ_LOCK_ASSERT(); + TAILQ_FOREACH(dp, &V_dadq, dad_list) { if (dp->dad_ifa != ifa) continue; + /* * Skip if the nonce matches the received one. * +2 in the length is required because of type and @@ -1185,42 +1190,35 @@ nd6_dad_find(struct ifaddr *ifa, struct nd_opt_nonce *n) if (n != NULL && n->nd_opt_nonce_len == (ND_OPT_NONCE_LEN + 2) / 8 && memcmp(&n->nd_opt_nonce[0], &dp->dad_nonce[0], - ND_OPT_NONCE_LEN) == 0) { + ND_OPT_NONCE_LEN) == 0) { dp->dad_ns_lcount++; continue; } - refcount_acquire(&dp->dad_refcnt); break; } - DADQ_RUNLOCK(); return (dp); } static void -nd6_dad_starttimer(struct dadq *dp, int ticks, int send_ns) +nd6_dad_starttimer(struct dadq *dp, int ticks) { + DADQ_WLOCK_ASSERT(); - NET_EPOCH_ASSERT(); - - if (send_ns != 0) - nd6_dad_ns_output(dp); - callout_reset(&dp->dad_timer_ch, ticks, - (void (*)(void *))nd6_dad_timer, (void *)dp); + callout_reset(&dp->dad_timer_ch, ticks, nd6_dad_timer, dp); } static void nd6_dad_stoptimer(struct dadq *dp) { - callout_drain(&dp->dad_timer_ch); } static void nd6_dad_rele(struct dadq *dp) { - if (refcount_release(&dp->dad_refcnt)) { + KASSERT(!dp->dad_ondadq, ("dp %p still on DAD queue", dp)); ifa_free(dp->dad_ifa); free(dp, M_IP6NDP); } @@ -1229,8 +1227,7 @@ nd6_dad_rele(struct dadq *dp) void nd6_dad_init(void) { - - rw_init(&V_dad_rwlock, "nd6 DAD queue"); + DADQ_LOCK_INIT(); TAILQ_INIT(&V_dadq); } @@ -1243,7 +1240,6 @@ nd6_dad_start(struct ifaddr *ifa, int delay) struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - struct epoch_tracker et; KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0, ("starting DAD on non-tentative address %p", ifa)); @@ -1265,12 +1261,13 @@ nd6_dad_start(struct ifaddr *ifa, int delay) (ND_IFINFO(ifa->ifa_ifp)->flags & ND6_IFF_IFDISABLED) != 0) return; + DADQ_WLOCK(); if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* * DAD is already in progress. Let the existing entry * finish it. */ - nd6_dad_rele(dp); + DADQ_WUNLOCK(); return; } @@ -1282,7 +1279,8 @@ nd6_dad_start(struct ifaddr *ifa, int delay) ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); return; } - callout_init(&dp->dad_timer_ch, 0); + callout_init_rw(&dp->dad_timer_ch, DADQ_LOCKPTR(), + CALLOUT_RETURNUNLOCKED); #ifdef VIMAGE dp->dad_vnet = curvnet; #endif @@ -1305,9 +1303,8 @@ nd6_dad_start(struct ifaddr *ifa, int delay) /* Add this to the dadq and add a reference for the dadq. */ refcount_init(&dp->dad_refcnt, 1); nd6_dad_add(dp); - NET_EPOCH_ENTER(et); - nd6_dad_starttimer(dp, delay, 0); - NET_EPOCH_EXIT(et); + nd6_dad_starttimer(dp, delay); + DADQ_WUNLOCK(); } /* @@ -1318,29 +1315,36 @@ nd6_dad_stop(struct ifaddr *ifa) { struct dadq *dp; + DADQ_WLOCK(); dp = nd6_dad_find(ifa, NULL); - if (!dp) { + if (dp == NULL) { + DADQ_WUNLOCK(); /* DAD wasn't started yet */ return; } - nd6_dad_stoptimer(dp); + /* + * Acquire a temporary reference so that we can safely stop the callout. + */ + (void)refcount_acquire(&dp->dad_refcnt); nd6_dad_del(dp); + DADQ_WUNLOCK(); - /* Release this function's reference, acquired by nd6_dad_find(). */ + nd6_dad_stoptimer(dp); nd6_dad_rele(dp); } static void -nd6_dad_timer(struct dadq *dp) +nd6_dad_timer(void *arg) { - CURVNET_SET(dp->dad_vnet); + struct dadq *dp = arg; struct ifaddr *ifa = dp->dad_ifa; struct ifnet *ifp = dp->dad_ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; char ip6buf[INET6_ADDRSTRLEN]; struct epoch_tracker et; + CURVNET_SET(dp->dad_vnet); KASSERT(ia != NULL, ("DAD entry %p with no address", dp)); NET_EPOCH_ENTER(et); @@ -1381,17 +1385,18 @@ nd6_dad_timer(struct dadq *dp) * We have more NS to go. Send NS packet for DAD. */ nd6_dad_starttimer(dp, - (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000, 1); + (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000); + nd6_dad_ns_output(dp); goto done; } else { /* * We have transmitted sufficient number of DAD packets. * See what we've got. */ - if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) + if (dp->dad_ns_icount > 0 || dp->dad_na_icount > 0) { /* We've seen NS or NA, means DAD has failed. */ nd6_dad_duplicated(ifa, dp); - else if (V_dad_enhanced != 0 && + } else if (V_dad_enhanced != 0 && dp->dad_ns_lcount > 0 && dp->dad_ns_lcount > dp->dad_loopbackprobe) { /* @@ -1412,8 +1417,8 @@ nd6_dad_timer(struct dadq *dp) dp->dad_count = dp->dad_ns_ocount + V_nd6_mmaxtries - 1; nd6_dad_starttimer(dp, - (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000, - 1); + (long)ND_IFINFO(ifa->ifa_ifp)->retrans * hz / 1000); + nd6_dad_ns_output(dp); goto done; } else { /* @@ -1439,6 +1444,7 @@ nd6_dad_timer(struct dadq *dp) } err: nd6_dad_del(dp); + DADQ_WUNLOCK(); done: NET_EPOCH_EXIT(et); CURVNET_RESTORE(); @@ -1498,6 +1504,10 @@ nd6_dad_duplicated(struct ifaddr *ifa, struct dadq *dp) } } +/* + * Transmit a neighbour solicitation for the purpose of DAD. Returns with the + * DAD queue unlocked. + */ static void nd6_dad_ns_output(struct dadq *dp) { @@ -1505,11 +1515,15 @@ nd6_dad_ns_output(struct dadq *dp) struct ifnet *ifp = dp->dad_ifa->ifa_ifp; int i; + DADQ_WLOCK_ASSERT(); + dp->dad_ns_tcount++; if ((ifp->if_flags & IFF_UP) == 0) { + DADQ_WUNLOCK(); return; } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + DADQ_WUNLOCK(); return; } @@ -1526,6 +1540,7 @@ nd6_dad_ns_output(struct dadq *dp) * should work well in almost all cases. */ } + DADQ_WUNLOCK(); nd6_ns_output(ifp, NULL, NULL, &ia->ia_addr.sin6_addr, (uint8_t *)&dp->dad_nonce[0]); } @@ -1541,12 +1556,11 @@ nd6_dad_ns_input(struct ifaddr *ifa, struct nd_opt_nonce *ndopt_nonce) /* Ignore Nonce option when Enhanced DAD is disabled. */ if (V_dad_enhanced == 0) ndopt_nonce = NULL; + DADQ_RLOCK(); dp = nd6_dad_find(ifa, ndopt_nonce); - if (dp == NULL) - return; - - dp->dad_ns_icount++; - nd6_dad_rele(dp); + if (dp != NULL) + dp->dad_ns_icount++; + DADQ_RUNLOCK(); } static void @@ -1557,9 +1571,9 @@ nd6_dad_na_input(struct ifaddr *ifa) if (ifa == NULL) panic("ifa == NULL in nd6_dad_na_input"); + DADQ_RLOCK(); dp = nd6_dad_find(ifa, NULL); - if (dp != NULL) { + if (dp != NULL) dp->dad_na_icount++; - nd6_dad_rele(dp); - } + DADQ_RUNLOCK(); } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:29 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 8946E6735F4; Tue, 21 Sep 2021 13:48:29 +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 4HDN712vk9z4khy; Tue, 21 Sep 2021 13:48:29 +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 3B80B250B4; Tue, 21 Sep 2021 13:48:29 +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 18LDmTFS035593; Tue, 21 Sep 2021 13:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmTg6035592; Tue, 21 Sep 2021 13:48:29 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:29 GMT Message-Id: <202109211348.18LDmTg6035592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 76985729102c - stable/13 - debugnet: Include some required headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76985729102cf137b81ca57b1b0dbe61ee41e66d 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: Tue, 21 Sep 2021 13:48:29 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=76985729102cf137b81ca57b1b0dbe61ee41e66d commit 76985729102cf137b81ca57b1b0dbe61ee41e66d Author: Mark Johnston AuthorDate: 2021-09-14 14:53:15 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:37:42 +0000 debugnet: Include some required headers Don't depend on pollution from net/vnet.h. PR: 258496 Sponsored by: The FreeBSD Foundation (cherry picked from commit b1746faad6d690e43ac78ba3a9bca96c767ea729) --- sys/net/debugnet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index 8652597c55db..7a2c98ace65d 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include @@ -53,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:32 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 1DD3E673AE9; Tue, 21 Sep 2021 13:48:32 +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 4HDN736D0nz4kj6; Tue, 21 Sep 2021 13:48:31 +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 9247F24BEC; Tue, 21 Sep 2021 13:48:31 +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 18LDmVxr035641; Tue, 21 Sep 2021 13:48:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmV5u035640; Tue, 21 Sep 2021 13:48:31 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:31 GMT Message-Id: <202109211348.18LDmV5u035640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ca85fb7e0bac - stable/13 - swap_pager: Handle large swap_pager_reserve() requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca85fb7e0bac9ef5f50c79520e3fd8a6e8a26b72 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: Tue, 21 Sep 2021 13:48:32 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ca85fb7e0bac9ef5f50c79520e3fd8a6e8a26b72 commit ca85fb7e0bac9ef5f50c79520e3fd8a6e8a26b72 Author: Mark Johnston AuthorDate: 2021-09-07 18:03:52 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:38:03 +0000 swap_pager: Handle large swap_pager_reserve() requests This interface is used solely by md(4) when the MD_RESERVE flag is specified, as in `mdconfig -a -t swap -s 1G -o reserve`. It pre-allocates swap blocks for the entire object. The number of blocks to be reserved is specified as a vm_size_t, but swp_pager_getswapspace() can allocate at most INT_MAX blocks. vm_size_t also seems like the incorrect type to use here it refers only to the size of the VM object, not the size of a mapping. So: - change the type of "size" in swap_pager_reserve() to vm_pindex_t, and - clamp the requested number of blocks for a single swp_pager_getswapspace() call to INT_MAX. Reported by: syzkaller Reviewed by: dougm, alc, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 686aa9287c6b3658daa2ca0ef1917f2e70a6c07e) --- sys/vm/swap_pager.c | 8 +++++--- sys/vm/swap_pager.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 63f0d22ed705..6d64ff883966 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -977,15 +978,16 @@ swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) * Returns 0 on success, -1 on failure. */ int -swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_size_t size) +swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_pindex_t size) { daddr_t addr, blk, n_free, s_free; - int i, j, n; + vm_pindex_t i, j; + int n; swp_pager_init_freerange(&s_free, &n_free); VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += n) { - n = size - i; + n = MIN(size - i, INT_MAX); blk = swp_pager_getswapspace(&n); if (blk == SWAPBLK_NONE) { swp_pager_meta_free(object, start, i); diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 20ff70acc3d8..6761d4f99ee4 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -78,7 +78,7 @@ void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex); void swap_pager_swap_init(void); int swap_pager_nswapdev(void); -int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); +int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_pindex_t); void swap_pager_status(int *total, int *used); u_long swap_pager_swapped_pages(vm_object_t object); void swapoff_all(void); From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 13:48:33 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 5B35F673D0B; Tue, 21 Sep 2021 13:48:33 +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 4HDN750PKxz4kb1; Tue, 21 Sep 2021 13:48:33 +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 AD70424D6F; Tue, 21 Sep 2021 13:48:32 +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 18LDmWoA035672; Tue, 21 Sep 2021 13:48:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LDmWcH035671; Tue, 21 Sep 2021 13:48:32 GMT (envelope-from git) Date: Tue, 21 Sep 2021 13:48:32 GMT Message-Id: <202109211348.18LDmWcH035671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 32f1d05f783d - stable/13 - sctp: Allow blocking on I/O locks even with non-blocking sockets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32f1d05f783de24f97ec56aca454e52c7d1071bf 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: Tue, 21 Sep 2021 13:48:34 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=32f1d05f783de24f97ec56aca454e52c7d1071bf commit 32f1d05f783de24f97ec56aca454e52c7d1071bf Author: Mark Johnston AuthorDate: 2021-09-14 13:02:05 +0000 Commit: Mark Johnston CommitDate: 2021-09-21 13:38:39 +0000 sctp: Allow blocking on I/O locks even with non-blocking sockets There are two flags to request a non-blocking receive on a socket: MSG_NBIO and MSG_DONTWAIT. They are handled a bit differently in that soreceive_generic() and soreceive_stream() will block on the socket I/O lock when MSG_NBIO is set, but not if MSG_DONTWAIT is set. In general, MSG_NBIO seems to mean, "don't block if there is no data to receive" and MSG_DONTWAIT means "don't go to sleep for any reason". SCTP's soreceive implementation did not allow blocking on the I/O lock if either flag is set, but this violates an assumption in aio_process_sb(), which specifies MSG_NBIO but nonetheless expects to make progress if data is available to read. Change sctp_sorecvmsg() to block on the I/O lock only if MSG_DONTWAIT is not set. Reported by: syzbot+c7d22dbbb9aef509421d@syzkaller.appspotmail.com Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit e6c19aa94da4a799472f8b82f196ffc42d0dbdaf) --- sys/netinet/sctputil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index ad4409f666df..b01ace4d1fb9 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5586,7 +5586,7 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, (uint32_t)uio->uio_resid); } - error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); + error = sblock(&so->so_rcv, SBLOCKWAIT(in_flags)); if (error) { goto release_unlocked; } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 14:46:27 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 B1446674C19; Tue, 21 Sep 2021 14:46: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 4HDPPv4bp7z4s9J; Tue, 21 Sep 2021 14:46:27 +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 7E6EF25DA0; Tue, 21 Sep 2021 14:46: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 18LEkR7M015177; Tue, 21 Sep 2021 14:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LEkRhm015176; Tue, 21 Sep 2021 14:46:27 GMT (envelope-from git) Date: Tue, 21 Sep 2021 14:46:27 GMT Message-Id: <202109211446.18LEkRhm015176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: 78a7d255e45d - stable/13 - ffs: remove unused thread argument from ffs_reload() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 78a7d255e45dc04a389d4d2cc6697828a18245ae 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: Tue, 21 Sep 2021 14:46:27 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=78a7d255e45dc04a389d4d2cc6697828a18245ae commit 78a7d255e45dc04a389d4d2cc6697828a18245ae Author: Robert Wing AuthorDate: 2021-09-04 20:25:10 +0000 Commit: Robert Wing CommitDate: 2021-09-21 14:38:38 +0000 ffs: remove unused thread argument from ffs_reload() Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D31127 (cherry picked from commit 440320b620a29fdc4033a2b9b67eb4401cb903bb) --- sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_suspend.c | 2 +- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 2ea828861b42..c835239986ba 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -89,7 +89,7 @@ int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); -int ffs_reload(struct mount *, struct thread *, int); +int ffs_reload(struct mount *, int); int ffs_sbget(void *, struct fs **, off_t, struct malloc_type *, int (*)(void *, off_t, void **, int)); int ffs_sbput(void *, struct fs *, off_t, int (*)(void *, off_t, void *, diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index a7fef099cd70..d13097109758 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -265,7 +265,7 @@ ffs_susp_dtor(void *data) KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0, ("MNTK_SUSPEND not set")); - error = ffs_reload(mp, curthread, FFSR_FORCE | FFSR_UNSUSPEND); + error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) panic("failed to unsuspend writes on %s", fs->fs_fsmnt); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 047c6f58a8a9..d5f20690793d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -565,7 +565,7 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, td, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) return (error); if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { @@ -876,7 +876,7 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * 7) re-read inode data for all active vnodes. */ int -ffs_reload(struct mount *mp, struct thread *td, int flags) +ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 18:18:27 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 991266787B8; Tue, 21 Sep 2021 18:18: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 4HDV6W3sPFz3ml3; Tue, 21 Sep 2021 18:18:27 +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 65641C31; Tue, 21 Sep 2021 18:18: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 18LIIRqe098064; Tue, 21 Sep 2021 18:18:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LIIRxw098063; Tue, 21 Sep 2021 18:18:27 GMT (envelope-from git) Date: Tue, 21 Sep 2021 18:18:27 GMT Message-Id: <202109211818.18LIIRxw098063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: b2cfac207d60 - stable/13 - compiler-rt: add aarch64 init function for LSE atomics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b2cfac207d60904b3a4738224361b8bf157724bb 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: Tue, 21 Sep 2021 18:18:27 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b2cfac207d60904b3a4738224361b8bf157724bb commit b2cfac207d60904b3a4738224361b8bf157724bb Author: Dimitry Andric AuthorDate: 2021-09-06 19:23:10 +0000 Commit: Dimitry Andric CommitDate: 2021-09-21 18:17:05 +0000 compiler-rt: add aarch64 init function for LSE atomics As reported by Ronald, adding the out-of-line LSE atomics helpers for aarch64 to compiler-rt was not sufficient to link programs using these, as they also require a __aarch64_have_lse_atomics global. This is initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar to the x86 CPU model and feature detection in that file. Since upstream does not yet have a FreeBSD specific implementation for getting the required information, add a simple one that should work for now, while I try to get it sorted with the LLVM people. Reported by: Ronald Klop Fixes: cc55ee8009a5 PR: 257392 (cherry picked from commit efe67f33c322265eb303ec0ab40275100795b22a) --- contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c | 6 ++++++ lib/libcompiler_rt/Makefile.inc | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c b/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c index 51bedd98c3d3..13cfeb05dcb8 100644 --- a/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c +++ b/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c @@ -775,8 +775,14 @@ _Bool __aarch64_have_lse_atomics #define HWCAP_ATOMICS (1 << 8) #endif static void CONSTRUCTOR_ATTRIBUTE init_have_lse_atomics(void) { +#if defined(__FreeBSD__) + unsigned long hwcap; + int result = elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); + __aarch64_have_lse_atomics = result == 0 && (hwcap & HWCAP_ATOMICS) != 0; +#else unsigned long hwcap = getauxval(AT_HWCAP); __aarch64_have_lse_atomics = (hwcap & HWCAP_ATOMICS) != 0; +#endif } #endif // defined(__has_include) #endif // __has_include() diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index aa0a6a6c9e69..06d662e38d82 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -146,8 +146,9 @@ SRCF+= floatundisf SRCF+= floatundixf .endif -# __cpu_model support, only used on x86 -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +# __cpu_model support, only used on aarch64 and x86 +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" SRCF+= cpu_model .endif From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:37 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 E881B67F1C9; Tue, 21 Sep 2021 23:43:37 +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 4HDdKj61ckz4qQQ; Tue, 21 Sep 2021 23:43:37 +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 AE6A65732; Tue, 21 Sep 2021 23:43:37 +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 18LNhb7L047863; Tue, 21 Sep 2021 23:43:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhbdl047862; Tue, 21 Sep 2021 23:43:37 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:37 GMT Message-Id: <202109212343.18LNhbdl047862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 395660129266 - stable/13 - hmt(4): Adapt to recent KPI changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3956601292662dc8cab6e6956a822a6a95823796 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: Tue, 21 Sep 2021 23:43:38 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3956601292662dc8cab6e6956a822a6a95823796 commit 3956601292662dc8cab6e6956a822a6a95823796 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:25:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:35:58 +0000 hmt(4): Adapt to recent KPI changes (cherry picked from commit 9d8ebe5ea1bedee50856aea7537310bc860bfede) --- sys/dev/hid/hmt.c | 133 +++++++++++++++++++++++------------------------------- 1 file changed, 57 insertions(+), 76 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index d04db6954d00..d1b36c424ba8 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -78,105 +78,101 @@ enum hmt_type { }; enum { - HMT_TIP_SWITCH, -#define HMT_SLOT HMT_TIP_SWITCH - HMT_WIDTH, -#define HMT_MAJOR HMT_WIDTH - HMT_HEIGHT, -#define HMT_MINOR HMT_HEIGHT - HMT_ORIENTATION, - HMT_X, - HMT_Y, - HMT_CONTACTID, - HMT_PRESSURE, - HMT_IN_RANGE, - HMT_CONFIDENCE, - HMT_TOOL_X, - HMT_TOOL_Y, - HMT_N_USAGES, + HMT_TIP_SWITCH = ABS_MT_INDEX(ABS_MT_TOOL_TYPE), + HMT_WIDTH = ABS_MT_INDEX(ABS_MT_TOUCH_MAJOR), + HMT_HEIGHT = ABS_MT_INDEX(ABS_MT_TOUCH_MINOR), + HMT_ORIENTATION = ABS_MT_INDEX(ABS_MT_ORIENTATION), + HMT_X = ABS_MT_INDEX(ABS_MT_POSITION_X), + HMT_Y = ABS_MT_INDEX(ABS_MT_POSITION_Y), + HMT_CONTACTID = ABS_MT_INDEX(ABS_MT_TRACKING_ID), + HMT_PRESSURE = ABS_MT_INDEX(ABS_MT_PRESSURE), + HMT_IN_RANGE = ABS_MT_INDEX(ABS_MT_DISTANCE), + HMT_CONFIDENCE = ABS_MT_INDEX(ABS_MT_BLOB_ID), + HMT_TOOL_X = ABS_MT_INDEX(ABS_MT_TOOL_X), + HMT_TOOL_Y = ABS_MT_INDEX(ABS_MT_TOOL_Y), }; -#define HMT_NO_CODE (ABS_MAX + 10) +#define HMT_N_USAGES MT_CNT #define HMT_NO_USAGE -1 struct hmt_hid_map_item { char name[5]; int32_t usage; /* HID usage */ - uint32_t code; /* Evdev event code */ + bool reported; /* Item value is passed to evdev */ bool required; /* Required for MT Digitizers */ }; static const struct hmt_hid_map_item hmt_hid_map[HMT_N_USAGES] = { - [HMT_TIP_SWITCH] = { /* HMT_SLOT */ + [HMT_TIP_SWITCH] = { .name = "TIP", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_SWITCH), - .code = ABS_MT_SLOT, + .reported = false, .required = true, }, - [HMT_WIDTH] = { /* HMT_MAJOR */ + [HMT_WIDTH] = { .name = "WDTH", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_WIDTH), - .code = ABS_MT_TOUCH_MAJOR, + .reported = true, .required = false, }, - [HMT_HEIGHT] = { /* HMT_MINOR */ + [HMT_HEIGHT] = { .name = "HGHT", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_HEIGHT), - .code = ABS_MT_TOUCH_MINOR, + .reported = true, .required = false, }, [HMT_ORIENTATION] = { .name = "ORIE", .usage = HMT_NO_USAGE, - .code = ABS_MT_ORIENTATION, + .reported = true, .required = false, }, [HMT_X] = { .name = "X", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - .code = ABS_MT_POSITION_X, + .reported = true, .required = true, }, [HMT_Y] = { .name = "Y", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - .code = ABS_MT_POSITION_Y, + .reported = true, .required = true, }, [HMT_CONTACTID] = { .name = "C_ID", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTID), - .code = ABS_MT_TRACKING_ID, + .reported = true, .required = true, }, [HMT_PRESSURE] = { .name = "PRES", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_PRESSURE), - .code = ABS_MT_PRESSURE, + .reported = true, .required = false, }, [HMT_IN_RANGE] = { .name = "RANG", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_IN_RANGE), - .code = ABS_MT_DISTANCE, + .reported = true, .required = false, }, [HMT_CONFIDENCE] = { .name = "CONF", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_CONFIDENCE), - .code = HMT_NO_CODE, + .reported = false, .required = false, }, - [HMT_TOOL_X] = { /* Shares HID usage with HMT_X */ + [HMT_TOOL_X] = { /* Shares HID usage with POS_X */ .name = "TL_X", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - .code = ABS_MT_TOOL_X, + .reported = true, .required = false, }, - [HMT_TOOL_Y] = { /* Shares HID usage with HMT_Y */ + [HMT_TOOL_Y] = { /* Shares HID usage with POS_Y */ .name = "TL_Y", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - .code = ABS_MT_TOOL_Y, + .reported = true, .required = false, }, }; @@ -200,7 +196,7 @@ struct hmt_softc { struct evdev_dev *evdev; - uint32_t slot_data[HMT_N_USAGES]; + union evdev_mt_slot slot_data; uint8_t caps[howmany(HMT_N_USAGES, 8)]; uint8_t buttons[howmany(HMT_BTN_MAX, 8)]; uint32_t nconts_per_report; @@ -375,13 +371,6 @@ hmt_attach(device_t dev) sc->cont_count_max = MAX_MT_SLOTS; } - /* Set number of MT protocol type B slots */ - sc->ai[HMT_SLOT] = (struct hid_absinfo) { - .min = 0, - .max = sc->cont_count_max - 1, - .res = 0, - }; - if (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps) sc->do_timestamps = true; #ifdef IICHID_SAMPLING @@ -434,9 +423,11 @@ hmt_attach(device_t dev) } } } + evdev_support_abs(sc->evdev, + ABS_MT_SLOT, 0, sc->cont_count_max - 1, 0, 0, 0); HMT_FOREACH_USAGE(sc->caps, i) { - if (hmt_hid_map[i].code != HMT_NO_CODE) - evdev_support_abs(sc->evdev, hmt_hid_map[i].code, + if (hmt_hid_map[i].reported) + evdev_support_abs(sc->evdev, ABS_MT_FIRST + i, sc->ai[i].min, sc->ai[i].max, 0, 0, sc->ai[i].res); } @@ -480,14 +471,14 @@ hmt_intr(void *context, void *buf, hid_size_t len) { struct hmt_softc *sc = context; size_t usage; - uint32_t *slot_data = sc->slot_data; + union evdev_mt_slot *slot_data; uint32_t cont, btn; uint32_t cont_count; uint32_t width; uint32_t height; uint32_t int_btn = 0; uint32_t left_btn = 0; - int32_t slot; + int slot; uint32_t scan_time; int32_t delta; uint8_t id; @@ -502,10 +493,7 @@ hmt_intr(void *context, void *buf, hid_size_t len) if (sc->iichid_sampling && len == 0) { sc->prev_touch = false; sc->timestamp = 0; - for (slot = 0; slot <= sc->ai[HMT_SLOT].max; slot++) { - evdev_push_abs(sc->evdev, ABS_MT_SLOT, slot); - evdev_push_abs(sc->evdev, ABS_MT_TRACKING_ID, -1); - } + /* EVDEV_FLAG_MT_AUTOREL releases all touches for us */ evdev_sync(sc->evdev); return; } @@ -567,56 +555,49 @@ hmt_intr(void *context, void *buf, hid_size_t len) /* Use protocol Type B for reporting events */ for (cont = 0; cont < cont_count; cont++) { + slot_data = &sc->slot_data; bzero(slot_data, sizeof(sc->slot_data)); HMT_FOREACH_USAGE(sc->caps, usage) { if (sc->locs[cont][usage].size > 0) - slot_data[usage] = hid_get_udata( + slot_data->val[usage] = hid_get_udata( buf, len, &sc->locs[cont][usage]); } - slot = evdev_get_mt_slot_by_tracking_id(sc->evdev, - slot_data[HMT_CONTACTID]); + slot = evdev_mt_id_to_slot(sc->evdev, slot_data->id); #ifdef HID_DEBUG DPRINTFN(6, "cont%01x: data = ", cont); if (hmt_debug >= 6) { HMT_FOREACH_USAGE(sc->caps, usage) { if (hmt_hid_map[usage].usage != HMT_NO_USAGE) - printf("%04x ", slot_data[usage]); + printf("%04x ", slot_data->val[usage]); } - printf("slot = %d\n", (int)slot); + printf("slot = %d\n", slot); } #endif if (slot == -1) { DPRINTF("Slot overflow for contact_id %u\n", - (unsigned)slot_data[HMT_CONTACTID]); + (unsigned)slot_data->id); continue; } - if (slot_data[HMT_TIP_SWITCH] != 0 && + if (slot_data->val[HMT_TIP_SWITCH] != 0 && !(isset(sc->caps, HMT_CONFIDENCE) && - slot_data[HMT_CONFIDENCE] == 0)) { + slot_data->val[HMT_CONFIDENCE] == 0)) { /* This finger is in proximity of the sensor */ sc->touch = true; - slot_data[HMT_SLOT] = slot; - slot_data[HMT_IN_RANGE] = !slot_data[HMT_IN_RANGE]; + slot_data->dist = !slot_data->val[HMT_IN_RANGE]; /* Divided by two to match visual scale of touch */ - width = slot_data[HMT_WIDTH] >> 1; - height = slot_data[HMT_HEIGHT] >> 1; - slot_data[HMT_ORIENTATION] = width > height; - slot_data[HMT_MAJOR] = MAX(width, height); - slot_data[HMT_MINOR] = MIN(width, height); - - HMT_FOREACH_USAGE(sc->caps, usage) - if (hmt_hid_map[usage].code != HMT_NO_CODE) - evdev_push_abs(sc->evdev, - hmt_hid_map[usage].code, - slot_data[usage]); - } else { - evdev_push_abs(sc->evdev, ABS_MT_SLOT, slot); - evdev_push_abs(sc->evdev, ABS_MT_TRACKING_ID, -1); - } + width = slot_data->val[HMT_WIDTH] >> 1; + height = slot_data->val[HMT_HEIGHT] >> 1; + slot_data->ori = width > height; + slot_data->maj = MAX(width, height); + slot_data->min = MIN(width, height); + } else + slot_data = NULL; + + evdev_mt_push_slot(sc->evdev, slot, slot_data); } sc->nconts_todo -= cont_count; From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:39 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 156CF67F5ED; Tue, 21 Sep 2021 23:43:39 +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 4HDdKk6kwVz4qFL; Tue, 21 Sep 2021 23:43:38 +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 C917F5536; Tue, 21 Sep 2021 23:43:38 +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 18LNhcRo047888; Tue, 21 Sep 2021 23:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhc51047886; Tue, 21 Sep 2021 23:43:38 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:38 GMT Message-Id: <202109212343.18LNhc51047886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3f03cc9a8e20 - stable/13 - wmt(4): Adapt to recent KPI changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f03cc9a8e209b5906d8d35491faaf6df28aa8f0 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: Tue, 21 Sep 2021 23:43:39 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3f03cc9a8e209b5906d8d35491faaf6df28aa8f0 commit 3f03cc9a8e209b5906d8d35491faaf6df28aa8f0 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:27:02 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:36:18 +0000 wmt(4): Adapt to recent KPI changes (cherry picked from commit 527b6d60f86953a40136abcf2f38cc4e70118954) --- sys/dev/usb/input/wmt.c | 136 ++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 75 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 8191c6ff9369..661fa622433f 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -94,105 +94,101 @@ enum wmt_input_mode { }; enum { - WMT_TIP_SWITCH, -#define WMT_SLOT WMT_TIP_SWITCH - WMT_WIDTH, -#define WMT_MAJOR WMT_WIDTH - WMT_HEIGHT, -#define WMT_MINOR WMT_HEIGHT - WMT_ORIENTATION, - WMT_X, - WMT_Y, - WMT_CONTACTID, - WMT_PRESSURE, - WMT_IN_RANGE, - WMT_CONFIDENCE, - WMT_TOOL_X, - WMT_TOOL_Y, - WMT_N_USAGES, + WMT_TIP_SWITCH = ABS_MT_INDEX(ABS_MT_TOOL_TYPE), + WMT_WIDTH = ABS_MT_INDEX(ABS_MT_TOUCH_MAJOR), + WMT_HEIGHT = ABS_MT_INDEX(ABS_MT_TOUCH_MINOR), + WMT_ORIENTATION = ABS_MT_INDEX(ABS_MT_ORIENTATION), + WMT_X = ABS_MT_INDEX(ABS_MT_POSITION_X), + WMT_Y = ABS_MT_INDEX(ABS_MT_POSITION_Y), + WMT_CONTACTID = ABS_MT_INDEX(ABS_MT_TRACKING_ID), + WMT_PRESSURE = ABS_MT_INDEX(ABS_MT_PRESSURE), + WMT_IN_RANGE = ABS_MT_INDEX(ABS_MT_DISTANCE), + WMT_CONFIDENCE = ABS_MT_INDEX(ABS_MT_BLOB_ID), + WMT_TOOL_X = ABS_MT_INDEX(ABS_MT_TOOL_X), + WMT_TOOL_Y = ABS_MT_INDEX(ABS_MT_TOOL_Y), }; -#define WMT_NO_CODE (ABS_MAX + 10) +#define WMT_N_USAGES MT_CNT #define WMT_NO_USAGE -1 struct wmt_hid_map_item { char name[5]; int32_t usage; /* HID usage */ - uint32_t code; /* Evdev event code */ + bool reported; /* Item value is passed to evdev */ bool required; /* Required for MT Digitizers */ }; static const struct wmt_hid_map_item wmt_hid_map[WMT_N_USAGES] = { - [WMT_TIP_SWITCH] = { /* WMT_SLOT */ + [WMT_TIP_SWITCH] = { .name = "TIP", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_SWITCH), - .code = ABS_MT_SLOT, + .reported = false, .required = true, }, - [WMT_WIDTH] = { /* WMT_MAJOR */ + [WMT_WIDTH] = { .name = "WDTH", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_WIDTH), - .code = ABS_MT_TOUCH_MAJOR, + .reported = true, .required = false, }, - [WMT_HEIGHT] = { /* WMT_MINOR */ + [WMT_HEIGHT] = { .name = "HGHT", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_HEIGHT), - .code = ABS_MT_TOUCH_MINOR, + .reported = true, .required = false, }, [WMT_ORIENTATION] = { .name = "ORIE", .usage = WMT_NO_USAGE, - .code = ABS_MT_ORIENTATION, + .reported = true, .required = false, }, [WMT_X] = { .name = "X", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - .code = ABS_MT_POSITION_X, + .reported = true, .required = true, }, [WMT_Y] = { .name = "Y", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - .code = ABS_MT_POSITION_Y, + .reported = true, .required = true, }, [WMT_CONTACTID] = { .name = "C_ID", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTID), - .code = ABS_MT_TRACKING_ID, + .reported = true, .required = true, }, [WMT_PRESSURE] = { .name = "PRES", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_TIP_PRESSURE), - .code = ABS_MT_PRESSURE, + .reported = true, .required = false, }, [WMT_IN_RANGE] = { .name = "RANG", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_IN_RANGE), - .code = ABS_MT_DISTANCE, + .reported = true, .required = false, }, [WMT_CONFIDENCE] = { .name = "CONF", .usage = HID_USAGE2(HUP_DIGITIZERS, HUD_CONFIDENCE), - .code = WMT_NO_CODE, + .reported = false, .required = false, }, [WMT_TOOL_X] = { /* Shares HID usage with WMT_X */ .name = "TL_X", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - .code = ABS_MT_TOOL_X, + .reported = true, .required = false, }, [WMT_TOOL_Y] = { /* Shares HID usage with WMT_Y */ .name = "TL_Y", .usage = HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - .code = ABS_MT_TOOL_Y, + .reported = true, .required = false, }, }; @@ -207,6 +203,7 @@ struct wmt_softc { device_t dev; enum wmt_type type; + int32_t cont_count_max; struct mtx mtx; struct wmt_absinfo ai[WMT_N_USAGES]; struct hid_location locs[MAX_MT_SLOTS][WMT_N_USAGES]; @@ -223,7 +220,7 @@ struct wmt_softc { struct usb_xfer *xfer[WMT_N_TRANSFER]; struct evdev_dev *evdev; - uint32_t slot_data[WMT_N_USAGES]; + union evdev_mt_slot slot_data; uint8_t caps[howmany(WMT_N_USAGES, 8)]; uint8_t buttons[howmany(WMT_BTN_MAX, 8)]; uint32_t isize; @@ -361,7 +358,7 @@ wmt_attach(device_t dev) * 'Contact Count Maximum' */ if (cont_count_max > 0) - sc->ai[WMT_SLOT].max = cont_count_max - 1; + sc->cont_count_max = cont_count_max; } else DPRINTF("usbd_req_get_report error=(%s)\n", usbd_errstr(err)); @@ -400,10 +397,10 @@ wmt_attach(device_t dev) } /* Cap contact count maximum to MAX_MT_SLOTS */ - if (sc->ai[WMT_SLOT].max >= MAX_MT_SLOTS) { + if (sc->cont_count_max > MAX_MT_SLOTS) { DPRINTF("Hardware reported %d contacts while only %d is " - "supported\n", (int)sc->ai[WMT_SLOT].max+1, MAX_MT_SLOTS); - sc->ai[WMT_SLOT].max = MAX_MT_SLOTS - 1; + "supported\n", (int)sc->cont_count_max, MAX_MT_SLOTS); + sc->cont_count_max = MAX_MT_SLOTS; } if (/*usb_test_quirk(hw, UQ_MT_TIMESTAMP) ||*/ wmt_timestamps) @@ -456,9 +453,11 @@ wmt_attach(device_t dev) } } } + evdev_support_abs(sc->evdev, + ABS_MT_SLOT, 0, sc->cont_count_max - 1, 0, 0, 0); WMT_FOREACH_USAGE(sc->caps, i) { - if (wmt_hid_map[i].code != WMT_NO_CODE) - evdev_support_abs(sc->evdev, wmt_hid_map[i].code, + if (wmt_hid_map[i].reported) + evdev_support_abs(sc->evdev, ABS_MT_FIRST + i, sc->ai[i].min, sc->ai[i].max, 0, 0, sc->ai[i].res); } @@ -473,7 +472,7 @@ wmt_attach(device_t dev) sc->is_clickpad ? ", click-pad" : ""); device_printf(sc->dev, "%d contacts and [%s%s%s%s%s]. Report range [%d:%d] - [%d:%d]\n", - (int)sc->ai[WMT_SLOT].max + 1, + (int)sc->cont_count_max, isset(sc->caps, WMT_IN_RANGE) ? "R" : "", isset(sc->caps, WMT_CONFIDENCE) ? "C" : "", isset(sc->caps, WMT_WIDTH) ? "W" : "", @@ -504,14 +503,14 @@ static void wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) { size_t usage; - uint32_t *slot_data = sc->slot_data; + union evdev_mt_slot *slot_data; uint32_t cont, btn; uint32_t cont_count; uint32_t width; uint32_t height; uint32_t int_btn = 0; uint32_t left_btn = 0; - int32_t slot; + int slot; uint32_t scan_time; int32_t delta; @@ -558,56 +557,49 @@ wmt_process_report(struct wmt_softc *sc, uint8_t *buf, int len) /* Use protocol Type B for reporting events */ for (cont = 0; cont < cont_count; cont++) { + slot_data = &sc->slot_data; bzero(slot_data, sizeof(sc->slot_data)); WMT_FOREACH_USAGE(sc->caps, usage) { if (sc->locs[cont][usage].size > 0) - slot_data[usage] = hid_get_udata( + slot_data->val[usage] = hid_get_udata( buf, len, &sc->locs[cont][usage]); } - slot = evdev_get_mt_slot_by_tracking_id(sc->evdev, - slot_data[WMT_CONTACTID]); + slot = evdev_mt_id_to_slot(sc->evdev, slot_data->id); #ifdef USB_DEBUG DPRINTFN(6, "cont%01x: data = ", cont); if (wmt_debug >= 6) { WMT_FOREACH_USAGE(sc->caps, usage) { if (wmt_hid_map[usage].usage != WMT_NO_USAGE) - printf("%04x ", slot_data[usage]); + printf("%04x ", slot_data->val[usage]); } - printf("slot = %d\n", (int)slot); + printf("slot = %d\n", slot); } #endif if (slot == -1) { DPRINTF("Slot overflow for contact_id %u\n", - (unsigned)slot_data[WMT_CONTACTID]); + (unsigned)slot_data->id); continue; } - if (slot_data[WMT_TIP_SWITCH] != 0 && + if (slot_data->val[WMT_TIP_SWITCH] != 0 && !(isset(sc->caps, WMT_CONFIDENCE) && - slot_data[WMT_CONFIDENCE] == 0)) { + slot_data->val[WMT_CONFIDENCE] == 0)) { /* This finger is in proximity of the sensor */ sc->touch = true; - slot_data[WMT_SLOT] = slot; - slot_data[WMT_IN_RANGE] = !slot_data[WMT_IN_RANGE]; + slot_data->dist = !slot_data->val[WMT_IN_RANGE]; /* Divided by two to match visual scale of touch */ - width = slot_data[WMT_WIDTH] >> 1; - height = slot_data[WMT_HEIGHT] >> 1; - slot_data[WMT_ORIENTATION] = width > height; - slot_data[WMT_MAJOR] = MAX(width, height); - slot_data[WMT_MINOR] = MIN(width, height); - - WMT_FOREACH_USAGE(sc->caps, usage) - if (wmt_hid_map[usage].code != WMT_NO_CODE) - evdev_push_abs(sc->evdev, - wmt_hid_map[usage].code, - slot_data[usage]); - } else { - evdev_push_abs(sc->evdev, ABS_MT_SLOT, slot); - evdev_push_abs(sc->evdev, ABS_MT_TRACKING_ID, -1); - } + width = slot_data->val[WMT_WIDTH] >> 1; + height = slot_data->val[WMT_HEIGHT] >> 1; + slot_data->ori = width > height; + slot_data->maj = MAX(width, height); + slot_data->min = MIN(width, height); + } else + slot_data = NULL; + + evdev_mt_push_slot(sc->evdev, slot, slot_data); } sc->nconts_todo -= cont_count; @@ -948,13 +940,6 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) if (cont_count_max < 1) cont_count_max = cont; - /* Set number of MT protocol type B slots */ - sc->ai[WMT_SLOT] = (struct wmt_absinfo) { - .min = 0, - .max = cont_count_max - 1, - .res = 0, - }; - /* Report touch orientation if both width and height are supported */ if (isset(sc->caps, WMT_WIDTH) && isset(sc->caps, WMT_HEIGHT)) { setbit(sc->caps, WMT_ORIENTATION); @@ -976,6 +961,7 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) sc->report_id = report_id; sc->nconts_per_report = cont; sc->has_int_button = has_int_button; + sc->cont_count_max = cont_count_max; return (type); } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:40 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 5947F67F49D; Tue, 21 Sep 2021 23:43:40 +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 4HDdKm0mvTz4qN7; Tue, 21 Sep 2021 23:43:40 +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 E8D56580D; Tue, 21 Sep 2021 23:43:39 +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 18LNhd3e047918; Tue, 21 Sep 2021 23:43:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhdaD047917; Tue, 21 Sep 2021 23:43:39 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:39 GMT Message-Id: <202109212343.18LNhdaD047917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: d5ed374c401a - stable/13 - cyapa(4): Adapt to recent evdev KPI changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5ed374c401ad6b7b35f2621f7ab7565b5583e2d 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: Tue, 21 Sep 2021 23:43:40 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ed374c401ad6b7b35f2621f7ab7565b5583e2d commit d5ed374c401ad6b7b35f2621f7ab7565b5583e2d Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:28:05 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:36:40 +0000 cyapa(4): Adapt to recent evdev KPI changes (cherry picked from commit 4836af0d42cf9d299ba9203a835bdcfa797a74c2) --- sys/dev/cyapa/cyapa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cyapa/cyapa.c b/sys/dev/cyapa/cyapa.c index 517ce8d1bab7..39f3349d5217 100644 --- a/sys/dev/cyapa/cyapa.c +++ b/sys/dev/cyapa/cyapa.c @@ -1377,7 +1377,7 @@ cyapa_raw_input(struct cyapa_softc *sc, struct cyapa_regs *regs, int freq) #ifdef EVDEV_SUPPORT if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { for (i = 0; i < nfingers; ++i) { - int32_t slot = evdev_get_mt_slot_by_tracking_id( + int slot = evdev_mt_id_to_slot( sc->evdev, regs->touch[i].id); if (slot == -1) { if (cyapa_debug) From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:41 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 5765D67F1CC; Tue, 21 Sep 2021 23:43:41 +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 4HDdKn1dJJz4qFZ; Tue, 21 Sep 2021 23:43:41 +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 15A13579F; Tue, 21 Sep 2021 23:43:41 +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 18LNhfCB047942; Tue, 21 Sep 2021 23:43:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhfTZ047941; Tue, 21 Sep 2021 23:43:41 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:41 GMT Message-Id: <202109212343.18LNhfTZ047941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: b966556125c8 - stable/13 - psm: Enable touch-tracking for late Synaptics PS/2 touchpads. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b966556125c8dec3f680cfa62dd8746e71fad955 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: Tue, 21 Sep 2021 23:43:41 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b966556125c8dec3f680cfa62dd8746e71fad955 commit b966556125c8dec3f680cfa62dd8746e71fad955 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:29:49 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:38:55 +0000 psm: Enable touch-tracking for late Synaptics PS/2 touchpads. They are true multitouch internally but Synaptics PS/2 protocol limitations do not all allow to export touch identificators. (cherry picked from commit c21171af687e20173b6b39e33db55999ba8d715e) --- sys/dev/atkbdc/psm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f6276ae847aa..78955bf1b228 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -1845,6 +1845,8 @@ psm_register_synaptics(device_t dev) evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, PS2_MOUSE_SYNAPTICS_PRODUCT, 0); evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + if (sc->synhw.capReportsV) + evdev_set_flag(evdev_a, EVDEV_FLAG_MT_TRACK); evdev_support_event(evdev_a, EV_SYN); evdev_support_event(evdev_a, EV_KEY); From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:42 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 7E77F67EF47; Tue, 21 Sep 2021 23:43:42 +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 4HDdKp2sz2z4qSn; Tue, 21 Sep 2021 23:43:42 +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 4214355A9; Tue, 21 Sep 2021 23:43:42 +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 18LNhgBY047966; Tue, 21 Sep 2021 23:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhgJi047965; Tue, 21 Sep 2021 23:43:42 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:42 GMT Message-Id: <202109212343.18LNhgJi047965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 2cc53be8897b - stable/13 - psm: Use evdev autorelease feature for Synaptics and Elantech drivers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cc53be8897bb4ba3e559bb42de0e593966f1cf3 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: Tue, 21 Sep 2021 23:43:42 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2cc53be8897bb4ba3e559bb42de0e593966f1cf3 commit 2cc53be8897bb4ba3e559bb42de0e593966f1cf3 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:30:29 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:39:20 +0000 psm: Use evdev autorelease feature for Synaptics and Elantech drivers (cherry picked from commit 744fcd5ad2a3e572585615df259eb3e2f0b624ef) --- sys/dev/atkbdc/psm.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 78955bf1b228..f27a49f82a71 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -1730,14 +1730,6 @@ psm_push_st_finger(struct psm_softc *sc, const finger_t *f) evdev_push_abs(sc->evdev_a, ABS_TOOL_WIDTH, f->w); } -static void -psm_release_mt_slot(struct evdev_dev *evdev, int32_t slot) -{ - - evdev_push_abs(evdev, ABS_MT_SLOT, slot); - evdev_push_abs(evdev, ABS_MT_TRACKING_ID, -1); -} - static int psm_register(device_t dev, int model_code) { @@ -1845,6 +1837,8 @@ psm_register_synaptics(device_t dev) evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, PS2_MOUSE_SYNAPTICS_PRODUCT, 0); evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + if (sc->synhw.capAdvancedGestures || sc->synhw.capReportsV) + evdev_set_flag(evdev_a, EVDEV_FLAG_MT_AUTOREL); if (sc->synhw.capReportsV) evdev_set_flag(evdev_a, EVDEV_FLAG_MT_TRACK); @@ -1923,6 +1917,7 @@ psm_register_elantech(device_t dev) evdev_set_id(evdev_a, BUS_I8042, PS2_MOUSE_VENDOR, PS2_MOUSE_ELANTECH_PRODUCT, 0); evdev_set_methods(evdev_a, sc, &psm_ev_methods_a); + evdev_set_flag(evdev_a, EVDEV_FLAG_MT_AUTOREL); evdev_support_event(evdev_a, EV_SYN); evdev_support_event(evdev_a, EV_KEY); @@ -3597,12 +3592,9 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms, #ifdef EVDEV_SUPPORT if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE) { - for (id = 0; id < PSM_FINGERS; id++) { + for (id = 0; id < PSM_FINGERS; id++) if (PSM_FINGER_IS_SET(f[id])) psm_push_mt_finger(sc, id, &f[id]); - else - psm_release_mt_slot(sc->evdev_a, id); - } evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); evdev_push_nfingers(sc->evdev_a, nfingers); if (nfingers > 0) @@ -4772,9 +4764,6 @@ proc_elantech(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *ms, evdev_push_abs(sc->evdev_a, ABS_MT_TOUCH_MAJOR, f[id].w * sc->elanhw.dptracex); } - if (sc->elanaction.mask & (1 << id) && - !(mask & (1 << id))) - psm_release_mt_slot(sc->evdev_a, id); } evdev_push_key(sc->evdev_a, BTN_TOUCH, nfingers > 0); evdev_push_nfingers(sc->evdev_a, nfingers); From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:43 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 B686267F5F7; Tue, 21 Sep 2021 23:43:43 +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 4HDdKq4GJMz4q6t; Tue, 21 Sep 2021 23:43:43 +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 6A8BB580E; Tue, 21 Sep 2021 23:43:43 +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 18LNhh1T047990; Tue, 21 Sep 2021 23:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhhS0047989; Tue, 21 Sep 2021 23:43:43 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:43 GMT Message-Id: <202109212343.18LNhhS0047989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 12061cf60579 - stable/13 - hmt(4): Add support for serial packet reporting mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12061cf605795036a43d9d72be4aef4650b425d9 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: Tue, 21 Sep 2021 23:43:43 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=12061cf605795036a43d9d72be4aef4650b425d9 commit 12061cf605795036a43d9d72be4aef4650b425d9 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:31:17 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:39:58 +0000 hmt(4): Add support for serial packet reporting mode In Serial mode, each packet contains information that describes a single physical contact point. Multiple contacts are streamed serially. In this mode, devices report all contact information in a series of packets. The device sends a separate packet for each concurrent contact. Serial packet reporting mode is used by post-2014 eGalax touchscreens. Tested by: Mark Kane (cherry picked from commit 0075742d1834d52b5e24a606aca63ad7e67e81f3) --- sys/dev/hid/hmt.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index d1b36c424ba8..cb7afe7290d0 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -204,6 +204,8 @@ struct hmt_softc { uint8_t report_id; uint32_t max_button; bool has_int_button; + bool has_cont_count; + bool has_scan_time; bool is_clickpad; bool do_timestamps; #ifdef IICHID_SAMPLING @@ -371,7 +373,8 @@ hmt_attach(device_t dev) sc->cont_count_max = MAX_MT_SLOTS; } - if (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps) + if (sc->has_scan_time && + (hid_test_quirk(hw, HQ_MT_TIMESTAMP) || hmt_timestamps)) sc->do_timestamps = true; #ifdef IICHID_SAMPLING if (hid_test_quirk(hw, HQ_IICHID_SAMPLING)) @@ -438,13 +441,14 @@ hmt_attach(device_t dev) } /* Announce information about the touch device */ - device_printf(sc->dev, "Multitouch %s with %d external button%s%s\n", + device_printf(sc->dev, "%s %s with %d external button%s%s\n", + sc->cont_count_max > 1 ? "Multitouch" : "Singletouch", sc->type == HMT_TYPE_TOUCHSCREEN ? "touchscreen" : "touchpad", nbuttons, nbuttons != 1 ? "s" : "", sc->is_clickpad ? ", click-pad" : ""); device_printf(sc->dev, - "%d contacts with [%s%s%s%s%s] properties. Report range [%d:%d] - [%d:%d]\n", - (int)sc->cont_count_max, + "%d contact%s with [%s%s%s%s%s] properties. Report range [%d:%d] - [%d:%d]\n", + (int)sc->cont_count_max, sc->cont_count_max != 1 ? "s" : "", isset(sc->caps, HMT_IN_RANGE) ? "R" : "", isset(sc->caps, HMT_CONFIDENCE) ? "C" : "", isset(sc->caps, HMT_WIDTH) ? "W" : "", @@ -513,6 +517,12 @@ hmt_intr(void *context, void *buf, hid_size_t len) } /* + * "In Serial mode, each packet contains information that describes a + * single physical contact point. Multiple contacts are streamed + * serially. In this mode, devices report all contact information in a + * series of packets. The device sends a separate packet for each + * concurrent contact." + * * "In Parallel mode, devices report all contact information in a * single packet. Each physical contact is represented by a logical * collection that is embedded in the top-level collection." @@ -521,7 +531,10 @@ hmt_intr(void *context, void *buf, hid_size_t len) * report with contactid=0 but contactids are zero-based, find * contactcount first. */ - cont_count = hid_get_udata(buf, len, &sc->cont_count_loc); + if (sc->has_cont_count) + cont_count = hid_get_udata(buf, len, &sc->cont_count_loc); + else + cont_count = 1; /* * "In Hybrid mode, the number of contacts that can be reported in one * report is less than the maximum number of contacts that the device @@ -753,7 +766,6 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, sc->cont_count_loc = hi.loc; break; } - /* Scan time is required but clobbered by evdev */ if (hi.collevel == 1 && hi.usage == HID_USAGE2(HUP_DIGITIZERS, HUD_SCAN_TIME)) { scan_time_found = true; @@ -804,7 +816,7 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, hid_end_parse(hd); /* Check for required HID Usages */ - if (!cont_count_found || !scan_time_found || cont == 0) + if ((!cont_count_found && cont != 1) || cont == 0) return (HMT_TYPE_UNSUPPORTED); for (i = 0; i < HMT_N_USAGES; i++) { if (hmt_hid_map[i].required && isclr(sc->caps, i)) @@ -842,6 +854,8 @@ hmt_hid_parse(struct hmt_softc *sc, const void *d_ptr, hid_size_t d_len, sc->cont_count_max = cont_count_max; sc->nconts_per_report = cont; sc->has_int_button = has_int_button; + sc->has_cont_count = cont_count_found; + sc->has_scan_time = scan_time_found; return (type); } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:45 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 3606567EC5A; Tue, 21 Sep 2021 23:43:45 +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 4HDdKr5XWjz4q74; Tue, 21 Sep 2021 23:43:44 +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 8C74057A0; Tue, 21 Sep 2021 23:43:44 +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 18LNhiGk048014; Tue, 21 Sep 2021 23:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhiBQ048013; Tue, 21 Sep 2021 23:43:44 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:44 GMT Message-Id: <202109212343.18LNhiBQ048013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 1a918f430d0d - stable/13 - hidmap: Implement forbidden flag for hidmap item. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a918f430d0d82fd25eebccb4b47f13d6f9715e3 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: Tue, 21 Sep 2021 23:43:45 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1a918f430d0d82fd25eebccb4b47f13d6f9715e3 commit 1a918f430d0d82fd25eebccb4b47f13d6f9715e3 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:31:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:40:18 +0000 hidmap: Implement forbidden flag for hidmap item. If HID usage is mapped to evdev event by hidmap item marked with this flag than entire driver attachment is blocked. (cherry picked from commit cded1fdb3763ba1f0f3663e605a5e63089dc8e22) --- sys/dev/hid/hidmap.c | 5 ++++- sys/dev/hid/hidmap.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/hid/hidmap.c b/sys/dev/hid/hidmap.c index 46e789fa7cec..c46930214323 100644 --- a/sys/dev/hid/hidmap.c +++ b/sys/dev/hid/hidmap.c @@ -481,7 +481,10 @@ hidmap_probe_hid_descr(void *d_ptr, hid_size_t d_len, uint8_t tlc_index, /* Check that all mandatory usages are present in report descriptor */ if (items != 0) { for (i = 0; i < nitems_map; i++) { - if (map[i].required && isclr(caps, i)) { + KASSERT(!(map[i].required && map[i].forbidden), + ("both required & forbidden item flags are set")); + if ((map[i].required && isclr(caps, i)) || + (map[i].forbidden && isset(caps, i))) { items = 0; break; } diff --git a/sys/dev/hid/hidmap.h b/sys/dev/hid/hidmap.h index 6ac23b3dc4ee..f5ce10069e1a 100644 --- a/sys/dev/hid/hidmap.h +++ b/sys/dev/hid/hidmap.h @@ -98,7 +98,8 @@ struct hidmap_item { bool has_cb:1; bool final_cb:1; bool invert_value:1; - u_int reserved:10; + bool forbidden:1; /* Forbidden by driver */ + u_int reserved:9; }; #define HIDMAP_ANY(_page, _usage, _type, _code) \ From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:47 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 6B82A67F627; Tue, 21 Sep 2021 23:43:47 +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 4HDdKv1kBNz4qD4; Tue, 21 Sep 2021 23:43:47 +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 CF4C6580F; Tue, 21 Sep 2021 23:43:46 +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 18LNhkD2048068; Tue, 21 Sep 2021 23:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhkXs048067; Tue, 21 Sep 2021 23:43:46 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:46 GMT Message-Id: <202109212343.18LNhkXs048067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 29bcf5e7d7a7 - stable/13 - hidbus(4): Add routine to check presence of collection of given usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 29bcf5e7d7a7eb15a692ec1fa2a0e3a3290a4c8e 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: Tue, 21 Sep 2021 23:43:47 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=29bcf5e7d7a7eb15a692ec1fa2a0e3a3290a4c8e commit 29bcf5e7d7a7eb15a692ec1fa2a0e3a3290a4c8e Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:32:57 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:40:53 +0000 hidbus(4): Add routine to check presence of collection of given usage (cherry picked from commit d51e437669e4ac35ac4be366241ae6ba4a16c378) --- sys/dev/hid/hidbus.c | 19 +++++++++++++++++++ sys/dev/hid/hidbus.h | 1 + 2 files changed, 20 insertions(+) diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index 3064f9999f2f..0de0a9bc1114 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -171,6 +171,25 @@ hidbus_locate(const void *desc, hid_size_t size, int32_t u, enum hid_kind k, return (0); } +bool +hidbus_is_collection(const void *desc, hid_size_t size, int32_t usage, + uint8_t tlc_index) +{ + struct hid_data *d; + struct hid_item h; + bool ret = false; + + d = hid_start_parse(desc, size, 0); + HIDBUS_FOREACH_ITEM(d, &h, tlc_index) { + if (h.kind == hid_collection && h.usage == usage) { + ret = true; + break; + } + } + hid_end_parse(d); + return (ret); +} + static device_t hidbus_add_child(device_t dev, u_int order, const char *name, int unit) { diff --git a/sys/dev/hid/hidbus.h b/sys/dev/hid/hidbus.h index 05911fff5732..d4324a2dc394 100644 --- a/sys/dev/hid/hidbus.h +++ b/sys/dev/hid/hidbus.h @@ -152,6 +152,7 @@ int hidbus_locate(const void *desc, hid_size_t size, int32_t u, enum hid_kind k, uint8_t tlc_index, uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id, struct hid_absinfo *ai); +bool hidbus_is_collection(const void *, hid_size_t, int32_t, uint8_t); const struct hid_device_id *hidbus_lookup_id(device_t, const struct hid_device_id *, int); From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:48 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 4EA1C67F177; Tue, 21 Sep 2021 23:43:48 +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 4HDdKw1HMSz4qSw; Tue, 21 Sep 2021 23:43:48 +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 EC3CF5810; Tue, 21 Sep 2021 23:43:47 +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 18LNhlB9048092; Tue, 21 Sep 2021 23:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhlw0048091; Tue, 21 Sep 2021 23:43:47 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:47 GMT Message-Id: <202109212343.18LNhlw0048091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: d4a977ce186c - stable/13 - hpen(4): Add support for legacy MS-compatible single touch protocol MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4a977ce186c7cc22b5317bbeb7ee87608fbc920 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: Tue, 21 Sep 2021 23:43:48 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a977ce186c7cc22b5317bbeb7ee87608fbc920 commit d4a977ce186c7cc22b5317bbeb7ee87608fbc920 Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:33:24 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:41:16 +0000 hpen(4): Add support for legacy MS-compatible single touch protocol It is used by many pre- and post- 2014 eGalax touchscreens. Tested by: Mark Kane (cherry picked from commit a36bdfc2b6525e814388f38c6862cf4b24dc6bee) --- sys/dev/hid/hidmap.h | 2 ++ sys/dev/hid/hpen.c | 89 ++++++++++++++++++++++++++++------------------------ 2 files changed, 50 insertions(+), 41 deletions(-) diff --git a/sys/dev/hid/hidmap.h b/sys/dev/hid/hidmap.h index f5ce10069e1a..628881092639 100644 --- a/sys/dev/hid/hidmap.h +++ b/sys/dev/hid/hidmap.h @@ -62,6 +62,8 @@ typedef int hidmap_cb_t(HIDMAP_CB_ARGS); /* These helpers can be used at any stage of any callbacks */ #define HIDMAP_CB_GET_STATE(...) \ ((hm == NULL) ? HIDMAP_CB_IS_PROBING : hm->cb_state) +#define HIDMAP_CB_GET_DEV(...) \ + (hm == NULL ? NULL : hm->dev) #define HIDMAP_CB_GET_SOFTC(...) \ (hm == NULL ? NULL : device_get_softc(hm->dev)) #define HIDMAP_CB_GET_EVDEV(...) \ diff --git a/sys/dev/hid/hpen.c b/sys/dev/hid/hpen.c index 1d505e14089f..8a86b95b1020 100644 --- a/sys/dev/hid/hpen.c +++ b/sys/dev/hid/hpen.c @@ -72,44 +72,43 @@ static hidmap_cb_t hpen_final_pen_cb; HIDMAP_ABS_CB(HUP_DIGITIZERS, HUD_##usage, &cb) /* Generic map digitizer page map according to hut1_12v2.pdf */ -static const struct hidmap_item hpen_map_digi[] = { +static const struct hidmap_item hpen_map_pen[] = { { HPEN_MAP_ABS_GD(X, ABS_X), .required = true }, { HPEN_MAP_ABS_GD(Y, ABS_Y), .required = true }, { HPEN_MAP_ABS( TIP_PRESSURE, ABS_PRESSURE) }, { HPEN_MAP_ABS( X_TILT, ABS_TILT_X) }, { HPEN_MAP_ABS( Y_TILT, ABS_TILT_Y) }, + { HPEN_MAP_ABS( CONTACTID, 0), .forbidden = true }, + { HPEN_MAP_ABS( CONTACTCOUNT, 0), .forbidden = true }, { HPEN_MAP_ABS_CB(BATTERY_STRENGTH, hpen_battery_strenght_cb) }, { HPEN_MAP_BUT( TOUCH, BTN_TOUCH) }, { HPEN_MAP_BUT( TIP_SWITCH, BTN_TOUCH) }, { HPEN_MAP_BUT( SEC_TIP_SWITCH, BTN_TOUCH) }, - { HPEN_MAP_BUT( IN_RANGE, BTN_TOOL_PEN) }, { HPEN_MAP_BUT( BARREL_SWITCH, BTN_STYLUS) }, { HPEN_MAP_BUT( INVERT, BTN_TOOL_RUBBER) }, { HPEN_MAP_BUT( ERASER, BTN_TOUCH) }, { HPEN_MAP_BUT( TABLET_PICK, BTN_STYLUS2) }, { HPEN_MAP_BUT( SEC_BARREL_SWITCH,BTN_STYLUS2) }, - { HIDMAP_FINAL_CB( &hpen_final_digi_cb) }, + { HIDMAP_FINAL_CB( &hpen_final_pen_cb) }, }; -/* Microsoft-standardized pen support */ -static const struct hidmap_item hpen_map_pen[] = { - { HPEN_MAP_ABS_GD(X, ABS_X), .required = true }, - { HPEN_MAP_ABS_GD(Y, ABS_Y), .required = true }, - { HPEN_MAP_ABS( TIP_PRESSURE, ABS_PRESSURE), .required = true }, - { HPEN_MAP_ABS( X_TILT, ABS_TILT_X) }, - { HPEN_MAP_ABS( Y_TILT, ABS_TILT_Y) }, - { HPEN_MAP_ABS_CB(BATTERY_STRENGTH, hpen_battery_strenght_cb) }, - { HPEN_MAP_BUT( TIP_SWITCH, BTN_TOUCH), .required = true }, - { HPEN_MAP_BUT( IN_RANGE, BTN_TOOL_PEN), .required = true }, - { HPEN_MAP_BUT( BARREL_SWITCH, BTN_STYLUS) }, - { HPEN_MAP_BUT( INVERT, BTN_TOOL_RUBBER), .required = true }, - { HPEN_MAP_BUT( ERASER, BTN_TOUCH), .required = true }, - { HIDMAP_FINAL_CB( &hpen_final_pen_cb) }, +static const struct hidmap_item hpen_map_stylus[] = { + { HPEN_MAP_BUT( IN_RANGE, BTN_TOOL_PEN) }, +}; +static const struct hidmap_item hpen_map_finger[] = { + { HPEN_MAP_BUT( IN_RANGE, BTN_TOOL_FINGER) }, }; static const struct hid_device_id hpen_devs[] = { { HID_TLC(HUP_DIGITIZERS, HUD_DIGITIZER) }, { HID_TLC(HUP_DIGITIZERS, HUD_PEN) }, + { HID_TLC(HUP_DIGITIZERS, HUD_TOUCHSCREEN), + HID_BVP(BUS_USB, USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL) }, +}; + +/* Do not autoload legacy pen driver for all touchscreen */ +static const struct hid_device_id hpen_devs_no_load[] = { + { HID_TLC(HUP_DIGITIZERS, HUD_TOUCHSCREEN) }, }; static int @@ -134,25 +133,18 @@ hpen_battery_strenght_cb(HIDMAP_CB_ARGS) return (0); } -static int -hpen_final_digi_cb(HIDMAP_CB_ARGS) -{ - struct evdev_dev *evdev = HIDMAP_CB_GET_EVDEV(); - - if (HIDMAP_CB_GET_STATE() == HIDMAP_CB_IS_ATTACHING) - evdev_support_prop(evdev, INPUT_PROP_POINTER); - - /* Do not execute callback at interrupt handler and detach */ - return (ENOSYS); -} - static int hpen_final_pen_cb(HIDMAP_CB_ARGS) { struct evdev_dev *evdev = HIDMAP_CB_GET_EVDEV(); - if (HIDMAP_CB_GET_STATE() == HIDMAP_CB_IS_ATTACHING) - evdev_support_prop(evdev, INPUT_PROP_DIRECT); + if (HIDMAP_CB_GET_STATE() == HIDMAP_CB_IS_ATTACHING) { + if (hidbus_get_usage(HIDMAP_CB_GET_DEV()) == + HID_USAGE2(HUP_DIGITIZERS, HUD_DIGITIZER)) + evdev_support_prop(evdev, INPUT_PROP_POINTER); + else + evdev_support_prop(evdev, INPUT_PROP_DIRECT); + } /* Do not execute callback at interrupt handler and detach */ return (ENOSYS); @@ -185,24 +177,39 @@ static int hpen_probe(device_t dev) { struct hidmap *hm = device_get_softc(dev); + const char *desc; + void *d_ptr; + hid_size_t d_len; int error; - bool is_pen; - error = HIDBUS_LOOKUP_DRIVER_INFO(dev, hpen_devs); - if (error != 0) - return (error); + if (HIDBUS_LOOKUP_DRIVER_INFO(dev, hpen_devs_no_load) != 0) { + error = HIDBUS_LOOKUP_DRIVER_INFO(dev, hpen_devs); + if (error != 0) + return (error); + } hidmap_set_dev(hm, dev); - /* Check if report descriptor belongs to a HID tablet device */ - is_pen = hidbus_get_usage(dev) == HID_USAGE2(HUP_DIGITIZERS, HUD_PEN); - error = is_pen - ? HIDMAP_ADD_MAP(hm, hpen_map_pen, NULL) - : HIDMAP_ADD_MAP(hm, hpen_map_digi, NULL); + /* Check if report descriptor belongs to a HID pen device */ + error = HIDMAP_ADD_MAP(hm, hpen_map_pen, NULL); if (error != 0) return (error); - hidbus_set_desc(dev, is_pen ? "Pen" : "Digitizer"); + if (hid_get_report_descr(dev, &d_ptr, &d_len) != 0) + return (ENXIO); + + if (hidbus_is_collection(d_ptr, d_len, + HID_USAGE2(HUP_DIGITIZERS, HUD_FINGER), hidbus_get_index(dev))) { + HIDMAP_ADD_MAP(hm, hpen_map_finger, NULL); + desc = "TouchScreen"; + } else { + HIDMAP_ADD_MAP(hm, hpen_map_stylus, NULL); + desc = "Pen"; + } + if (hidbus_get_usage(dev) == HID_USAGE2(HUP_DIGITIZERS, HUD_DIGITIZER)) + desc = "Digitizer"; + + hidbus_set_desc(dev, desc); return (BUS_PROBE_DEFAULT); } From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:46 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 351F167EC64; Tue, 21 Sep 2021 23:43:46 +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 4HDdKs6Tngz4qCx; Tue, 21 Sep 2021 23:43:45 +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 A0F2457A1; Tue, 21 Sep 2021 23:43:45 +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 18LNhjME048044; Tue, 21 Sep 2021 23:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhjAJ048043; Tue, 21 Sep 2021 23:43:45 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:45 GMT Message-Id: <202109212343.18LNhjAJ048043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 116adffd0f6a - stable/13 - hidmap: Do not forget to initialize bitmap items to unset state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 116adffd0f6ae5c33cab921a338152e01f2ced5a 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: Tue, 21 Sep 2021 23:43:46 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=116adffd0f6ae5c33cab921a338152e01f2ced5a commit 116adffd0f6ae5c33cab921a338152e01f2ced5a Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:32:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:40:37 +0000 hidmap: Do not forget to initialize bitmap items to unset state (cherry picked from commit bbed4b41c9f193996f704b3262126e59810b30c9) --- sys/dev/hid/hidmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hidmap.c b/sys/dev/hid/hidmap.c index c46930214323..d787b298b41d 100644 --- a/sys/dev/hid/hidmap.c +++ b/sys/dev/hid/hidmap.c @@ -451,7 +451,8 @@ hidmap_probe_hid_descr(void *d_ptr, hid_size_t d_len, uint8_t tlc_index, bool do_free = false; if (caps == NULL) { - caps = malloc(HIDMAP_CAPS_SZ(nitems_map), M_DEVBUF, M_WAITOK); + caps = malloc(HIDMAP_CAPS_SZ(nitems_map), M_DEVBUF, + M_WAITOK | M_ZERO); do_free = true; } else bzero (caps, HIDMAP_CAPS_SZ(nitems_map)); From owner-dev-commits-src-branches@freebsd.org Tue Sep 21 23:43:50 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 7908667EF4E; Tue, 21 Sep 2021 23:43:50 +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 4HDdKy0BWpz4qT7; Tue, 21 Sep 2021 23:43:49 +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 29A9C5733; Tue, 21 Sep 2021 23:43:49 +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 18LNhn4M048116; Tue, 21 Sep 2021 23:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNhnaw048115; Tue, 21 Sep 2021 23:43:49 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:43:49 GMT Message-Id: <202109212343.18LNhnaw048115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 470478ff012f - stable/13 - hmt(4): Add support for touchpads with no "button type" or MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 470478ff012fd8a2c083fead60574ec6c798376f 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: Tue, 21 Sep 2021 23:43:50 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=470478ff012fd8a2c083fead60574ec6c798376f commit 470478ff012fd8a2c083fead60574ec6c798376f Author: Vladimir Kondratyev AuthorDate: 2021-09-02 19:33:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-21 23:41:40 +0000 hmt(4): Add support for touchpads with no "button type" or "maximum number of contacts" usages. Assume touchpad to be a clickpad if it has only internal button. Set number of contacts to 5 for touchpads and to 10 for touchscreens. Check for fetched report length to avoid reading of stalled data. Fixes Dell Precision 7550 laptop. Tested by: Shawn Webb PR: 257992 (cherry picked from commit 9d04336b615d16faa631da2824ee719683540276) --- sys/dev/hid/hmt.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c index cb7afe7290d0..dcf360bcffba 100644 --- a/sys/dev/hid/hmt.c +++ b/sys/dev/hid/hmt.c @@ -300,7 +300,7 @@ hmt_attach(device_t dev) const struct hid_device_info *hw = hid_get_device_info(dev); void *d_ptr; uint8_t *fbuf = NULL; - hid_size_t d_len, fsize; + hid_size_t d_len, fsize, rsize; uint32_t cont_count_max; int nbuttons, btn; size_t i; @@ -321,9 +321,10 @@ hmt_attach(device_t dev) /* Fetch and parse "Contact count maximum" feature report */ if (sc->cont_max_rlen > 1) { - err = hid_get_report(dev, fbuf, sc->cont_max_rlen, NULL, + err = hid_get_report(dev, fbuf, sc->cont_max_rlen, &rsize, HID_FEATURE_REPORT, sc->cont_max_rid); - if (err == 0) { + if (err == 0 && (rsize - 1) * 8 >= + sc->cont_max_loc.pos + sc->cont_max_loc.size) { cont_count_max = hid_get_udata(fbuf + 1, sc->cont_max_rlen - 1, &sc->cont_max_loc); /* @@ -334,23 +335,24 @@ hmt_attach(device_t dev) sc->cont_count_max = cont_count_max; } else DPRINTF("hid_get_report error=%d\n", err); - } else - DPRINTF("Feature report %hhu size invalid: %u\n", - sc->cont_max_rid, sc->cont_max_rlen); + } + if (sc->cont_count_max == 0) + sc->cont_count_max = sc->type == HMT_TYPE_TOUCHSCREEN ? 10 : 5; /* Fetch and parse "Button type" feature report */ if (sc->btn_type_rlen > 1 && sc->btn_type_rid != sc->cont_max_rid) { bzero(fbuf, fsize); - err = hid_get_report(dev, fbuf, sc->btn_type_rlen, NULL, + err = hid_get_report(dev, fbuf, sc->btn_type_rlen, &rsize, HID_FEATURE_REPORT, sc->btn_type_rid); - } - if (sc->btn_type_rlen > 1) { - if (err == 0) - sc->is_clickpad = hid_get_udata(fbuf + 1, - sc->btn_type_rlen - 1, &sc->btn_type_loc) == 0; - else + if (err != 0) DPRINTF("hid_get_report error=%d\n", err); } + if (sc->btn_type_rlen > 1 && err == 0 && (rsize - 1) * 8 >= + sc->btn_type_loc.pos + sc->btn_type_loc.size) + sc->is_clickpad = hid_get_udata(fbuf + 1, sc->btn_type_rlen - 1, + &sc->btn_type_loc) == 0; + else + sc->is_clickpad = sc->max_button == 0 && sc->has_int_button; /* Fetch THQA certificate to enable some devices like WaveShare */ if (sc->thqa_cert_rlen > 1 && sc->thqa_cert_rid != sc->cont_max_rid) From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:02:01 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 D81DC6AF1B0; Wed, 22 Sep 2021 10:02: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 4HDv3F5cSMz4pfy; Wed, 22 Sep 2021 10:02:01 +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 A060E157ED; Wed, 22 Sep 2021 10:02:01 +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 18MA21BA068792; Wed, 22 Sep 2021 10:02:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MA21Gs068791; Wed, 22 Sep 2021 10:02:01 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:02:01 GMT Message-Id: <202109221002.18MA21Gs068791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: cae17ea3688a - stable/13 - ports.7: catchup with the package extension name since pkg 1.17 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cae17ea3688ad47271cc2dd1af03100f006ee647 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, 22 Sep 2021 10:02:01 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cae17ea3688ad47271cc2dd1af03100f006ee647 commit cae17ea3688ad47271cc2dd1af03100f006ee647 Author: Baptiste Daroussin AuthorDate: 2021-07-22 08:49:45 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 09:53:04 +0000 ports.7: catchup with the package extension name since pkg 1.17 (cherry picked from commit d6ed0d3d310633ecf9294bc332e93f2766b24ded) --- share/man/man7/ports.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index 797fed0d3ec6..771d2ea239a5 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2021 +.Dd July 22, 2021 .Dt PORTS 7 .Os .Sh NAME @@ -284,7 +284,7 @@ from the system. Make a binary package for the port. The port will be installed if it has not already been. The package is a -.Pa .tbz +.Pa .pkg file that you can use to install the port on other machines with .Xr pkg-add 8 . From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:02:03 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 031666AF49F; Wed, 22 Sep 2021 10:02:03 +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 4HDv3G6YrFz4q2Z; Wed, 22 Sep 2021 10:02:02 +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 BF8921595D; Wed, 22 Sep 2021 10:02:02 +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 18MA22ch069404; Wed, 22 Sep 2021 10:02:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MA22G2069393; Wed, 22 Sep 2021 10:02:02 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:02:02 GMT Message-Id: <202109221002.18MA22G2069393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 037c2f4fe3d0 - stable/13 - libfetch: use more portable getline() interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 037c2f4fe3d0198d5794ed10f6f4086355b8f20c 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, 22 Sep 2021 10:02:03 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=037c2f4fe3d0198d5794ed10f6f4086355b8f20c commit 037c2f4fe3d0198d5794ed10f6f4086355b8f20c Author: Daniel Kolesa AuthorDate: 2021-08-17 14:01:46 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 09:57:35 +0000 libfetch: use more portable getline() interface this is for better portability in order to avoid using a function which is BSD-only or available via libbsd (cherry picked from commit ee3ca711a898cf41330c320826ea1e0e6e451f1d) (cherry picked from commit 635eb7ac7990a2bb29e1992b739617a9db012bf2) --- lib/libfetch/http.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index e61e23b1425a..bcb089dc0fc4 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1526,12 +1526,13 @@ http_get_proxy(struct url * url, const char *flags) static void http_print_html(FILE *out, FILE *in) { - size_t len; - char *line, *p, *q; + ssize_t len = 0; + size_t cap; + char *line = NULL, *p, *q; int comment, tag; comment = tag = 0; - while ((line = fgetln(in, &len)) != NULL) { + while ((len = getline(&line, &cap, in)) >= 0) { while (len && isspace((unsigned char)line[len - 1])) --len; for (p = q = line; q < line + len; ++q) { @@ -1559,6 +1560,8 @@ http_print_html(FILE *out, FILE *in) fwrite(p, q - p, 1, out); fputc('\n', out); } + + free(line); } From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:06:24 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 BB9776AF8B5; Wed, 22 Sep 2021 10:06:24 +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 4HDv8J4ktmz4q9P; Wed, 22 Sep 2021 10:06:24 +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 7E0D615969; Wed, 22 Sep 2021 10:06:24 +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 18MA6OPx073819; Wed, 22 Sep 2021 10:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MA6OKT073817; Wed, 22 Sep 2021 10:06:24 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:06:24 GMT Message-Id: <202109221006.18MA6OKT073817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 869e821404ae - stable/13 - pci_vendors: update to 2021.09.19 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 869e821404ae986ad311a5c5439504224ff378ea 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, 22 Sep 2021 10:06:24 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=869e821404ae986ad311a5c5439504224ff378ea commit 869e821404ae986ad311a5c5439504224ff378ea Author: Baptiste Daroussin AuthorDate: 2021-07-27 16:56:39 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:05:56 +0000 pci_vendors: update to 2021.09.19 (cherry picked from commit 00582fa66051cbdf263a6ce0f10c64ea17a0e9a8) (cherry picked from commit dcd882f30236fdac6ce7f42129462d72a64daf0c) --- share/misc/pci_vendors | 577 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 537 insertions(+), 40 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 9deb7293e596..79866ff1cd29 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2021.05.04 -# Date: 2021-05-04 03:15:01 +# Version: 2021.09.19 +# Date: 2021-09-19 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -683,6 +683,32 @@ 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK + 00a5 Fusion-MPT 24GSAS/PCIe SAS40xx + 1000 4600 MegaRAID 9670W-16i Tri-Mode Storage Adapter + 1000 4610 MegaRAID 9670-24i Tri-Mode Storage Adapter + 1000 4620 MegaRAID 9660-16i Tri-Mode Storage Adapter + 1000 4630 MegaRAID 9660-8i8e Tri-Mode Storage Adapter + 1000 4640 eHBA 9600W-16i Tri-Mode Storage Adapter + 1000 4650 eHBA 9600W-16e Tri-Mode Storage Adapter + 1000 4660 eHBA 9600-24i Tri-Mode Storage Adapter + 1000 4670 eHBA 9600-16i Tri-Mode Storage Adapter + 1000 4680 eHBA 9600-16e Tri-Mode Storage Adapter + 1000 4690 MegaRAID 9620-16i Tri-Mode Storage Adapter + 1000 46a0 MegaRAID 9660-24i Tri-Mode Storage Adapter + 1000 46c0 eHBA 9680W-16e Tri-Mode Storage Adapter + 1000 46d0 eHBA 9600-8i8e Tri-Mode Storage Adapter + 1028 2114 PERC H965 Adapter + 1028 2115 PERC H965 Front + 1028 2117 PERC H965 MX + 1028 213a PERC H965e Adapter + 1028 213b PERC H765 Adapter + 1028 213c PERC H765 Front + 1028 213d PERC H765N Front + 1028 213e PERC H765 MX + 1028 213f PERC H365 Adapter + 1028 2140 PERC H365 Front + 1028 2141 PERC H360 MX + 1028 2142 HBA 465e Adapter 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) # 8 Internal and 8 External port channel 9400 HBA 1000 3040 HBA 9400-8i8e @@ -715,12 +741,18 @@ 00c2 SAS3324 PCI-Express Fusion-MPT SAS-3 00c3 SAS3324 PCI-Express Fusion-MPT SAS-3 00c4 SAS3224 PCI-Express Fusion-MPT SAS-3 +# SAS 9305 16 internal port HBA + 1000 3190 SAS9305-16i +# SAS 9305 24 internal port HBA + 1000 31a0 SAS9305-24i 1170 0002 SAS3224 PCI Express to 12Gb HBA MEZZ CARD 00c5 SAS3316 PCI-Express Fusion-MPT SAS-3 00c6 SAS3316 PCI-Express Fusion-MPT SAS-3 00c7 SAS3316 PCI-Express Fusion-MPT SAS-3 00c8 SAS3316 PCI-Express Fusion-MPT SAS-3 00c9 SAS3216 PCI-Express Fusion-MPT SAS-3 +# 9305 16 external port SAS HBA + 1000 3180 SAS9305-16e 00ce MegaRAID SAS-3 3316 [Intruder] 1000 9371 MegaRAID SAS 9361-16i 1000 9390 MegaRAID SAS 9380-8i8e @@ -771,8 +803,14 @@ 1028 200c HBA355i Front 1028 200d HBA355e Adapter 1028 200e HBA350i MX + 1028 2175 HBA350i Adapter 1d49 0205 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb Internal HBA 1d49 0206 ThinkSystem 440-16e SAS/SATA PCIe Gen4 12Gb HBA + 1d49 0207 ThinkSystem 440-8i SAS/SATA PCIe Gen4 12Gb HBA + 1d49 0208 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb HBA + 1d49 0209 ThinkSystem 440-8e SAS/SATA PCIe Gen4 12Gb HBA + 8086 4050 Storage Controller RS3P4QF160F + 8086 4070 Storage Controller RS3P4GF016F 00e7 Fusion-MPT 12GSAS/PCIe Unsupported SAS38xx # Tampered part 1028 200b HBA355i Adapter Tampered @@ -886,12 +924,17 @@ 1028 1ae1 PERC H755 Front 1028 1ae2 PERC H755N Front 1028 1ae3 PERC H755 MX + 1028 2171 PERC H750 Mini + 1028 2176 PERC H750 Adapter 1d49 060a ThinkSystem RAID 940-8i 4GB Flash PCIe Gen4 12Gb Adapter 1d49 060b ThinkSystem RAID 940-8i 8GB Flash PCIe Gen4 12Gb Adapter 1d49 060c ThinkSystem RAID 940-16i 8GB Flash PCIe Gen4 12Gb Adapter 1d49 060d ThinkSystem RAID 940-16i 8GB Flash PCIe Gen4 12Gb Internal Adapter 1d49 060e ThinkSystem RAID 940-32i 8GB Flash PCIe Gen4 12Gb Adapter 1d49 060f ThinkSystem RAID 940-8e 4GB Flash PCIe Gen4 12Gb Adapter + 1d49 0610 ThinkSystem RAID 940-16i 4GB Flash PCIe Gen4 12Gb Adapter + 8086 4000 RAID Controller RS3P4TF160F + 8086 4020 RAID Controller RS3P4MF088F 10e3 MegaRAID 12GSAS/PCIe Unsupported SAS39xx 1028 1ae0 PERC H755 Adapter - Tampered Device 1028 1ae1 PERC H755 Front - Tampered Device @@ -900,6 +943,12 @@ 10e4 MegaRAID 12GSAS/PCIe Unsupported SAS38xx 10e5 MegaRAID 12GSAS/PCIe SAS38xx 10e6 MegaRAID 12GSAS/PCIe Secure SAS38xx + 1028 2172 PERC H355 Adapter + 1028 2173 PERC H355 Front + 1028 2174 PERC H350 Mini + 1028 2177 PERC H350 Adapter + 1d49 0505 ThinkSystem RAID 540-8i PCIe Gen4 12Gb Adapter + 1d49 0506 ThinkSystem RAID 540-16i PCIe Gen4 12Gb Adapter 10e7 MegaRAID 12GSAS/PCIe Unsupported SAS38xx 1960 MegaRAID 1000 0518 MegaRAID 518 SCSI 320-2 Controller @@ -959,6 +1008,7 @@ 131c Kaveri [Radeon R7 Graphics] 131d Kaveri [Radeon R6 Graphics] 13e9 Ariel + 13fe Cyan Skillfish 1478 Navi 10 XL Upstream Port of PCI Express Switch 1479 Navi 10 XL Downstream Port of PCI Express Switch 154c Kryptos [Radeon RX 350] @@ -985,13 +1035,16 @@ 15df Raven/Raven2/Fenghuang/Renoir Cryptographic Coprocessor 103c 8615 Pavilion Laptop 15-cw1xxx ea50 ce19 mCOM10-L1900 + 15e7 Barcelo 15ff Fenghuang [Zhongshan Subor Z+] 1607 Arden 1636 Renoir + 1637 Renoir Radeon High Definition Audio Controller 1638 Cezanne 163f VanGogh 164c Lucienne 164d Rembrandt + 1681 Rembrandt 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -3474,6 +3527,7 @@ 174b e308 Radeon R9 380X Nitro 4G D5 17af 2006 Radeon R9 380X 6939 Tonga PRO [Radeon R9 285/380] + 1462 2015 Radeon R9 380 Gaming 4G 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 @@ -3487,6 +3541,7 @@ 6985 Lexa XT [Radeon PRO WX 3100] 6986 Polaris12 6987 Lexa [Radeon 540X/550X/630 / RX 640 / E9171 MCM] + 698f Lexa XT [Radeon PRO WX 3100 / Barco MXRT 4700] 6995 Lexa XT [Radeon PRO WX 2100] 699f Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] 1028 1720 Radeon RX 550X @@ -3645,6 +3700,7 @@ 7312 Navi 10 [Radeon Pro W5700] 7314 Navi 10 USB 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] + 1002 0b36 Reference RX 5700 XT 1458 2313 Radeon RX 5700 XT Gaming OC 1682 5701 RX 5700 XT RAW II 1849 5120 Radeon RX 5600 XT @@ -3658,17 +3714,25 @@ 7388 Arcturus GL-XL 738c Arcturus GL-XL [AMD Instinct MI100] 738e Arcturus GL-XL + 73a2 Navi 21 Pro-XTA [Radeon Pro W6900X] + 73a3 Navi 21 GL-XL [Radeon PRO W6800] 73a4 Navi 21 USB + 73ab Navi 21 Pro-XLA [Radeon Pro W6800X/Radeon Pro W6800X Duo] 73af Navi 21 [Radeon RX 6900 XT] 73bf Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] + 1002 0e3a Radeon RX 6900 XT 1eae 6701 XFX Speedster MERC 319 AMD Radeon RX 6800 XT Black 73c3 Navi 22 73c4 Navi 22 USB 73df Navi 22 [Radeon RX 6700/6700 XT / 6800M] 73e0 Navi 23 - 73e1 Navi 23 + 73e1 Navi 23 WKS-XM [Radeon PRO W6600M] + 73e3 Navi 23 WKS-XL [Radeon PRO W6600] 73e4 Navi 23 USB 73ff Navi 23 [Radeon RX 6600/6600 XT/6600M] + 7408 Aldebaran + 740c Aldebaran + 740f Aldebaran 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3828,7 +3892,7 @@ 17aa 21bb Mobility Radeon HD 545v 9555 RV710/M92 [Mobility Radeon HD 4350/4550] 103c 1411 ProBook 4720s GPU (Mobility Radeon HD 4350) - 9557 RV711 GL [FirePro RG220] + 9557 RV711/M93 GL [FirePro RG220] 955f RV710/M92 [Mobility Radeon HD 4330] 9580 RV630 [Radeon HD 2600 PRO] 9581 RV630/M76 [Mobility Radeon HD 2600] @@ -4832,12 +4896,14 @@ 15d0 Raven/Raven2 Root Complex 103c 8615 Pavilion Laptop 15-cw1xxx 1043 876b PRIME B450M-A Motherboard + ea50 ce19 mCOM10-L1900 15d1 Raven/Raven2 IOMMU 103c 8615 Pavilion Laptop 15-cw1xxx 1043 876b PRIME B450M-A Motherboard ea50 ce19 mCOM10-L1900 15d2 Raven/Raven2 PCIe Dummy Host Bridge 15d3 Raven/Raven2 PCIe GPP Bridge [6:0] + ea50 ce19 mCOM10-L1900 15d4 FireFlight USB 3.1 15d5 FireFlight USB 3.1 15da Raven/Raven2 PCIe Dummy Host Bridge @@ -4862,14 +4928,17 @@ ea50 ce19 mCOM10-L1900 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor 17aa 5124 ThinkPad E595 + ea50 ce19 mCOM10-L1900 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx 1043 86c7 PRIME B450M-A Motherboard 17aa 5124 ThinkPad E595 15e4 Raven/Raven2/Renoir Sensor Fusion Hub 15e5 Raven2 USB 3.1 + ea50 ce19 mCOM10-L1900 15e6 Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver 1022 15e4 Raven/Raven2/Renoir Sensor Fusion Hub + ea50 ce19 mCOM10-L1900 15e8 Raven/Raven2 Device 24: Function 0 15e9 Raven/Raven2 Device 24: Function 1 15ea Raven/Raven2 Device 24: Function 2 @@ -4921,14 +4990,19 @@ 1629 Arden PCIe GPP Bridge 162a Arden Internal PCIe GPP Bridge 0 to bus X 162b Arden PCIe Non-Transparent Bridge - 1630 Renoir Root Complex - 1631 Renoir IOMMU + 1630 Renoir/Cezanne Root Complex + 1631 Renoir/Cezanne IOMMU 1632 Renoir PCIe Dummy Host Bridge 1633 Renoir PCIe GPP Bridge - 1634 Renoir PCIe GPP Bridge + 1634 Renoir/Cezanne PCIe GPP Bridge 1635 Renoir Internal PCIe GPP Bridge to Bus 1637 Renoir HD Audio Controller - 1639 Renoir USB 3.1 + 1639 Renoir/Cezanne USB 3.1 + 163a VanGogh USB0 + 163b VanGogh USB1 + 163c VanGogh SecUSB + 163d VanGogh SecureFunction + 163e VanGogh HSP 1641 Renoir 10GbE Controller Port 0 (XGBE0/1) 1642 Renoir WLAN 1643 Renoir BT @@ -5827,7 +5901,7 @@ 0325 315PRO PCI/AGP VGA Display Adapter 0330 330 [Xabre] PCI/AGP VGA Display Adapter 0406 85C501/2 - 0496 85C496 + 0496 SiS85C496 PCI & CPU Memory Controller (PCM) 0530 530 Host 0540 540 Host 0550 550 Host @@ -8646,13 +8720,18 @@ 8717 PEX 8717 16-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch with DMA 8718 PEX 8718 16-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch 8724 PEX 8724 24-Lane, 6-Port PCI Express Gen 3 (8 GT/s) Switch, 19 x 19mm FCBGA + 8725 PEX 8725 24-Lane, 10-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA 8732 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch 8734 PEX 8734 32-lane, 8-Port PCI Express Gen 3 (8.0GT/s) Switch 8747 PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch 8748 PEX 8748 48-Lane, 12-Port PCI Express Gen 3 (8 GT/s) Switch, 27 x 27mm FCBGA -# This is the Non-Transparent-Bridge Virtualized Port as presented by the PLX PEX 8732 chip, the physical bridges show up at 10b5:8732 - 87b0 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch + 8749 PEX 8749 48-Lane, 18-Port PCI Express Gen 3 (8.0 GT/s) Multi-Root Switch with DMA + 87a0 PEX PCI Express Switch NT0 Port Link Interface + 87a1 PEX PCI Express Switch NT1 Port Link Interface + 87b0 PEX PCI Express Switch NT0 Port Virtual Interface 1093 7761 PXIe-8830mc + 87b1 PEX PCI Express Switch NT1 Port Virtual Interface + 87d0 PEX PCI Express Switch DMA interface 9016 PLX 9016 8-port serial controller 9030 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge 10b5 2695 Hilscher CIF50-PB/DPS Profibus @@ -8999,7 +9078,7 @@ 1449 M1449 1451 M1451 1461 M1461 - 1489 M1489 + 1489 M1489 Cache-Memory PCI Controller (CMP) [FinALi 486] CPU to PCI bridge 1511 M1511 [Aladdin] 1512 M1512 [Aladdin] 1513 M1513 [Aladdin] @@ -11993,6 +12072,10 @@ 10de 1141 VCA 6000 17f1 GM200GL [Quadro M6000 24GB] 17fd GM200GL [Tesla M40] + 1ad0 Tegra PCIe x8 Endpoint + 1ad1 Tegra PCIe x4/x8 Endpoint/Root Complex + 1ad2 Tegra PCIe x1 Root Complex + 1ad3 Xavier SATA Controller 1ad6 TU102 USB 3.1 Host Controller 1ad7 TU102 USB Type-C UCSI Controller 1ad8 TU104 USB 3.1 Host Controller @@ -12142,7 +12225,7 @@ 1e04 TU102 [GeForce RTX 2080 Ti] 1e07 TU102 [GeForce RTX 2080 Ti Rev. A] 1462 3715 RTX 2080 Ti GAMING X TRIO - 1e09 CMP 50HX + 1e09 TU102 [CMP 50HX] 1e2d TU102 [GeForce RTX 2080 Ti Engineering Sample] 1e2e TU102 [GeForce RTX 2080 Ti 12GB Engineering Sample] 1e30 TU102GL [Quadro RTX 6000/8000] @@ -12172,6 +12255,7 @@ 1eae TU104M 1eb0 TU104GL [Quadro RTX 5000] 1eb1 TU104GL [Quadro RTX 4000] + 1eb4 TU104GL [T4G] 1eb5 TU104GLM [Quadro RTX 5000 Mobile / Max-Q] 1eb6 TU104GLM [Quadro RTX 4000 Mobile / Max-Q] 1eb8 TU104GL [Tesla T4] @@ -12220,10 +12304,11 @@ 1f9d TU117M [GeForce GTX 1650 Mobile / Max-Q] 1fae TU117GL 1fb0 TU117GLM [Quadro T1000 Mobile] - 1fb1 TU117GLM [Quadro T600 Mobile] + 1fb1 TU117GL [T600] 1fb2 TU117GLM [Quadro T400 Mobile] 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] + 1fba TU117GLM [T600 Mobile] 1fbb TU117GLM [Quadro T500 Mobile] 1fbf TU117GL 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] @@ -12232,10 +12317,13 @@ 20b0 GA100 [A100 SXM4 40GB] 20b1 GA100 [A100 PCIe 40GB] 20b2 GA100 [A100 SXM4 80GB] + 20b5 GA100 [A100 PCIe 80GB] 20b6 GA100GL [PG506-232] 20b7 GA100GL [A30 PCIe] + 20bb GA100 [DRIVE A100 PROD] 20be GA100 [GRID A100A] 20bf GA100 [GRID A100B] + 20c2 GA100 [CMP 170HX] 20f1 GA100 [A100 PCIe 40GB] 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 @@ -12252,13 +12340,14 @@ 21d1 TU116BM [GeForce GTX 1660 Ti Mobile] 2200 GA102 2204 GA102 [GeForce RTX 3090] - 2205 GA102 [GeForce RTX 3080 20GB] + 2205 GA102 [GeForce RTX 3080 Ti 20GB] 2206 GA102 [GeForce RTX 3080] 10de 1467 GA102 [GeForce RTX 3080] 10de 146d GA102 [GeForce RTX 3080 20GB] 1462 3892 RTX 3080 10GB GAMING X TRIO 2208 GA102 [GeForce RTX 3080 Ti] - 220d GA102 + 220d GA102 [CMP 90HX] + 2216 GA102 [GeForce RTX 3080 Lite Hash Rate] 222b GA102 [GeForce RTX 3090 Engineering Sample] 222f GA102 [GeForce RTX 3080 11GB / 12GB Engineering Sample] 2230 GA102GL [RTX A6000] @@ -12268,6 +12357,7 @@ 2237 GA102GL [A10G] 223f GA102GL 228b GA104 High Definition Audio Controller + 2296 Tegra PCIe Endpoint Virtual Network 2302 GA103 2321 GA103 2482 GA104 [GeForce RTX 3070 Ti] @@ -12276,6 +12366,10 @@ 10de 146b GA104 [GeForce RTX 3070] 10de 14ae GA104 [GeForce RTX 3070 16GB] 2486 GA104 [GeForce RTX 3060 Ti] + 2487 GA104 [GeForce RTX 3060] + 2488 GA104 [GeForce RTX 3070 Lite Hash Rate] + 2489 GA104 [GeForce RTX 3060 Ti Lite Hash Rate] + 248a GA104 [CMP 70HX] 249c GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] 249d GA104M [GeForce RTX 3070 Mobile / Max-Q] 249f GA104M @@ -12294,18 +12388,21 @@ 2504 GA106 [GeForce RTX 3060 Lite Hash Rate] 2505 GA106 2520 GA106M [GeForce RTX 3060 Mobile / Max-Q] + 2523 GA106M [GeForce RTX 3050 Ti Mobile / Max-Q] 252f GA106 [GeForce RTX 3060 Engineering Sample] 2560 GA106M [GeForce RTX 3060 Mobile / Max-Q] + 2563 GA106M [GeForce RTX 3050 Ti Mobile / Max-Q] 2583 GA107 [GeForce RTX 3050] 25a0 GA107M [GeForce RTX 3050 Ti Mobile] 25a2 GA107M [GeForce RTX 3050 Mobile] 25a4 GA107 - 25a5 GA107M + 25a5 GA107M [GeForce RTX 3050 Mobile] 25af GA107 [GeForce RTX 3050 Engineering Sample] 25b5 GA107GLM [RTX A4 Mobile] 25b8 GA107GLM [RTX A2000 Mobile] - 25e0 GA107BM - 25e2 GA107BM + 25e0 GA107BM [GeForce RTX 3050 Ti Mobile] + 25e2 GA107BM [GeForce RTX 3050 Mobile] + 25e5 GA107BM [GeForce RTX 3050 Mobile] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -12533,6 +12630,7 @@ 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 1028 06e6 Latitude 11 5175 2-in-1 + 1028 09be Latitude 7410 17aa 224f ThinkPad X1 Carbon 5th Gen 5260 RTS5260 PCI Express Card Reader 5286 RTS5286 PCI Express Card Reader @@ -12690,6 +12788,7 @@ ea50 ce19 mCOM10-L1900 816d RTL811x EHCI host controller ea50 ce19 mCOM10-L1900 + 816e Realtek RealManage BMC 8171 RTL8191SEvA Wireless LAN Controller 8172 RTL8191SEvB Wireless LAN Controller 8173 RTL8192SE Wireless LAN Controller @@ -12718,6 +12817,7 @@ 8812 RTL8812AE 802.11ac PCIe Wireless Network Adapter 8813 RTL8813AE 802.11ac PCIe Wireless Network Adapter 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter + 8852 RTL8852AE 802.11ax PCIe Wireless Network Adapter b723 RTL8723BE PCIe Wireless Network Adapter 10ec 8739 Dell Wireless 1801 17aa b736 Z50-75 @@ -14790,6 +14890,9 @@ 117c 00bc Celerity FC-321P 117c 00bd Celerity FC-322P 117c 00be Celerity FC-324P + 00c5 ExpressNVM PCIe Gen4 Switch + 117c 00c6 ExpressNVM S48F PCIe Gen4 + 117c 00c7 ExpressNVM S468 PCIe Gen4 00e6 ExpressSAS GT 12Gb/s SAS/SATA HBA 117c 00c0 ExpressSAS H1280 GT 117c 00c1 ExpressSAS H1208 GT @@ -15084,6 +15187,7 @@ # Nee Galileo Technology, Inc. 11ab Marvell Technology Group Ltd. 0100 88F3700 [Armada 3700 Family] ARM SoC + 0110 88F8040 PCI Express controller 0146 GT-64010/64010A System Controller 0f53 88E6318 Link Street network controller 11ab MV88SE614x SATA II PCI-E controller @@ -15632,7 +15736,12 @@ 8071 PM8071 Tachyon SPCve 12G eight-port SAS/SATA controller 8072 PM8072 Tachyon SPCv 12G 16-port SAS/SATA controller 8073 PM8073 Tachyon SPCve 12G 16-port SAS/SATA controller - 8531 PM8531 PFX 24xG3 Fanout PCIe Switches + 8531 PM8531 PFX 24xG3 PCIe Fanout Switch + 8532 PM8532 PFX 32xG3 PCIe Fanout Switch + 8533 PM8533 PFX 48xG3 PCIe Fanout Switch + 8534 PM8534 PFX 64xG3 PCIe Fanout Switch + 8535 PM8535 PFX 80xG3 PCIe Fanout Switch + 8536 PM8536 PFX 96xG3 PCIe Fanout Switch 8546 PM8546 B-FEIP PSX 96xG3 PCIe Storage Switch 8562 PM8562 Switchtec PFX-L 32xG3 Fanout-Lite PCIe Gen3 Switch 11f9 I-Cube Inc @@ -15640,7 +15749,8 @@ 11fb Datel Inc 11fc Silicon Magic 11fd High Street Consultants -11fe Pepperl+Fuchs Comtrol, Inc. +# nee Comtrol, Inc. +11fe Pepperl+Fuchs 0001 RocketPort PCI 32-port w/external I/F 0002 RocketPort PCI 8-port w/external I/F 0003 RocketPort PCI 16-port w/external I/F @@ -16135,7 +16245,7 @@ 1268 Tektronix 1269 Thomson-CSF/TTM # MBIM on top of MHI - 00b4 5G Data Card [Cinterion MV31-W] + 00b3 5G Data Card [Cinterion MV31-W] 126a Lexmark International, Inc. 126b Adax, Inc. 126c Northern Telecom @@ -17723,10 +17833,151 @@ 9513 OX16PCI954 (Quad 16950 UART) function 1 (parallel port) 9521 OX16PCI952 (Dual 16950 UART) 9523 OX16PCI952 Integrated Parallel Port - c158 OXPCIe952 Dual 16C950 UART +# Multifunction device with 3 function bits in ID + c000 OXPCIe840 Parallel Port + c004 OXPCIe840 Parallel Port + c006 OXPCIe840 GPIO +# Multifunction device with reset straps and function bits in ID + c100 OXPCIe952 Parallel Port + c101 OXPCIe952 Legacy 950 UART + c104 OXPCIe952 Parallel Port + c105 OXPCIe952 Legacy 950 UART + c106 OXPCIe952 GPIO + c108 OXPCIe952 Parallel Port + c109 OXPCIe952 Legacy 950 UART + c10c OXPCIe952 Parallel Port + c10d OXPCIe952 Legacy 950 UART + c10e OXPCIe952 GPIO + c110 OXPCIe952 Parallel Port + c114 OXPCIe952 Parallel Port + c118 OXPCIe952 Parallel Port + c11b OXPCIe952 Native 950 UART + c11c OXPCIe952 Parallel Port + c11e OXPCIe952 GPIO + c11f OXPCIe952 Native 950 UART + c120 OXPCIe952 Legacy 950 UART + c124 OXPCIe952 Legacy 950 UART + c126 OXPCIe952 GPIO + c128 OXPCIe952 Legacy 950 UART + c12c OXPCIe952 Legacy 950 UART + c12e OXPCIe952 GPIO + c134 OXPCIe952 GPIO + c138 OXPCIe952 Native 950 UART + c13c OXPCIe952 GPIO + c13d OXPCIe952 Native 950 UART + c140 OXPCIe952 Legacy 950 UART #1 + c141 OXPCIe952 Legacy 950 UART #2 + c144 OXPCIe952 Legacy 950 UART #1 + c145 OXPCIe952 Legacy 950 UART #2 + c146 OXPCIe952 GPIO + c148 OXPCIe952 Legacy 950 UART #1 + c149 OXPCIe952 Legacy 950 UART #2 + c14c OXPCIe952 Legacy 950 UART #1 + c14d OXPCIe952 Legacy 950 UART #2 + c14e OXPCIe952 GPIO + c154 OXPCIe952 GPIO + c158 OXPCIe952 Dual Native 950 UART e4bf c504 CP4-SCAT Wireless Technologies Carrier Board e4bf d551 DU1-MUSTANG Dual-Port RS-485 Interface - c308 EX-44016 16-port serial + c15c OXPCIe952 GPIO + c15d OXPCIe952 Dual Native 950 UART +# Multifunction device with 4 function bits in ID + c204 OXPCIe954 GPIO + c208 OXPCIe954 Quad Native 950 UART + c20c OXPCIe954 GPIO + c20d OXPCIe954 Quad Native 950 UART +# Multifunction device with 4 function bits in ID + c304 OXPCIe958 GPIO + c308 OXPCIe958 Quad Native 950 UART + c30c OXPCIe958 GPIO + c30d OXPCIe958 Quad Native 950 UART +# Multifunction device with 8 function bits in ID + c530 OXPCIe200 Dual OHCI USB Controller (ULPI/R-ULPI) + c531 OXPCIe200 Dual EHCI USB Controller (ULPI/R-ULPI) + c534 OXPCIe200 Dual OHCI USB Controller (ULPI/R-ULPI) + c535 OXPCIe200 Dual EHCI USB Controller (ULPI/R-ULPI) + c536 OXPCIe200 GPIO + c538 OXPCIe200 Dual OHCI USB Controller (ULPI/R-ULPI) + c539 OXPCIe200 Dual EHCI USB Controller (ULPI/R-ULPI) + c53b OXPCIe200 Native 950 UART + c53c OXPCIe200 Dual OHCI USB Controller (ULPI/R-ULPI) + c53d OXPCIe200 Dual EHCI USB Controller (ULPI/R-ULPI) + c53e OXPCIe200 GPIO + c53f OXPCIe200 Native 950 UART + c540 OXPCIe200 Dual OHCI USB Controller (R-ULPI) + c541 OXPCIe200 Dual EHCI USB Controller (R-ULPI) + c544 OXPCIe200 Dual OHCI USB Controller (R-ULPI) + c545 OXPCIe200 Dual EHCI USB Controller (R-ULPI) + c546 OXPCIe200 GPIO + c548 OXPCIe200 Dual OHCI USB Controller (R-ULPI) + c549 OXPCIe200 Dual EHCI USB Controller (R-ULPI) + c54b OXPCIe200 Native 950 UART + c54c OXPCIe200 Dual OHCI USB Controller (R-ULPI) + c54d OXPCIe200 Dual EHCI USB Controller (R-ULPI) + c54e OXPCIe200 Dual GPIO + c54f OXPCIe200 Native 950 UART + c560 OXPCIe200 Dual OHCI USB Controller (ULPI/analog) + c561 OXPCIe200 EHCI USB Controller (ULPI) + c564 OXPCIe200 Dual OHCI USB Controller (ULPI/analog) + c565 OXPCIe200 EHCI USB Controller (ULPI) + c566 OXPCIe200 GPIO + c568 OXPCIe200 Dual OHCI USB Controller (ULPI/analog) + c569 OXPCIe200 EHCI USB Controller (ULPI) + c56b OXPCIe200 Native 950 UART + c56c OXPCIe200 Dual OHCI USB Controller (ULPI/analog) + c56d OXPCIe200 EHCI USB Controller (ULPI) + c56e OXPCIe200 GPIO + c56f OXPCIe200 Native 950 UART + c570 OXPCIe200 Dual OHCI USB Controller (R-ULPI/analog) + c571 OXPCIe200 EHCI USB Controller (R-ULPI) + c574 OXPCIe200 Dual OHCI USB Controller (R-ULPI/analog) + c575 OXPCIe200 EHCI USB Controller (R-ULPI) + c576 OXPCIe200 GPIO + c578 OXPCIe200 Dual OHCI USB Controller (R-ULPI/analog) + c579 OXPCIe200 EHCI USB Controller (R-ULPI) + c57b OXPCIe200 Native 950 UART + c57c OXPCIe200 Dual OHCI USB Controller (R-ULPI/analog) + c57d OXPCIe200 EHCI USB Controller (R-ULPI) + c57e OXPCIe200 GPIO + c57f OXPCIe200 Native 950 UART + c5a0 OXPCIe200 OHCI USB Controller (ULPI) + c5a1 OXPCIe200 EHCI USB Controller (ULPI) + c5a2 OXPCIe200 Programmable Memory Interface + c5a4 OXPCIe200 OHCI USB Controller (ULPI) + c5a5 OXPCIe200 EHCI USB Controller (ULPI) + c5a6 OXPCIe200 Programmable Memory Interface & GPIO + c5a8 OXPCIe200 OHCI USB Controller (ULPI) + c5a9 OXPCIe200 EHCI USB Controller (ULPI) + c5aa OXPCIe200 Programmable Memory Interface + c5ab OXPCIe200 Native 950 UART + c5ac OXPCIe200 OHCI USB Controller (ULPI) + c5ad OXPCIe200 EHCI USB Controller (ULPI) + c5ae OXPCIe200 Programmable Memory Interface & GPIO + c5af OXPCIe200 Native 950 UART + c5b0 OXPCIe200 OHCI USB Controller (R-ULPI) + c5b1 OXPCIe200 EHCI USB Controller (R-ULPI) + c5b2 OXPCIe200 Programmable Memory Interface + c5b4 OXPCIe200 OHCI USB Controller (R-ULPI) + c5b5 OXPCIe200 EHCI USB Controller (R-ULPI) + c5b6 OXPCIe200 Programmable Memory Interface & GPIO + c5b8 OXPCIe200 OHCI USB Controller (R-ULPI) + c5b9 OXPCIe200 EHCI USB Controller (R-ULPI) + c5ba OXPCIe200 Programmable Memory Interface + c5bb OXPCIe200 Native 950 UART + c5bc OXPCIe200 OHCI USB Controller (R-ULPI) + c5bd OXPCIe200 EHCI USB Controller (R-ULPI) + c5be OXPCIe200 Programmable Memory Interface & GPIO + c5bf OXPCIe200 Native 950 UART + c5c0 OXPCIe200 OHCI USB Controller (analog) + c5c2 OXPCIe200 Programmable Memory Interface + c5c4 OXPCIe200 OHCI USB Controller (analog) + c5c6 OXPCIe200 Programmable Memory Interface & GPIO + c5c8 OXPCIe200 OHCI USB Controller (analog) + c5ca OXPCIe200 Programmable Memory Interface + c5cb OXPCIe200 Native 950 UART + c5cc OXPCIe200 OHCI USB Controller (analog) + c5ce OXPCIe200 Programmable Memory Interface & GPIO + c5cf OXPCIe200 Native 950 UART 1416 Multiwave Innovation pte Ltd 1417 Convergenet Technologies Inc 1418 Kyushu electronics systems Inc @@ -18488,7 +18739,17 @@ 144d a801 SM963 2.5" NVMe PCIe SSD a808 NVMe SSD Controller SM981/PM981/PM983 1d49 403b Thinksystem U.2 PM983 NVMe SSD - a80a NVMe SSD Controller PM9A1/980PRO + a809 NVMe SSD Controller 980 + a80a NVMe SSD Controller PM9A1/PM9A3/980PRO + 0128 215a DC NVMe PM9A3 RI U.2 960GB + 0128 215b DC NVMe PM9A3 RI U.2 1.92TB + 0128 215c DC NVMe PM9A3 RI U.2 3.84TB + 0128 215d DC NVMe PM9A3 RI U.2 7.68TB + 0128 2166 DC NVMe PM9A3 RI 110M.2 960GB + 0128 2167 DC NVMe PM9A3 RI 110M.2 1.92TB + 0128 2168 DC NVMe PM9A3 RI 80M.2 480GB + 0128 2169 DC NVMe PM9A3 RI 80M.2 960GB + 144d a813 General DC NVMe PM9A3 a820 NVMe SSD Controller 171X 1028 1f95 Express Flash NVMe XS1715 SSD 400GB 1028 1f96 Express Flash NVMe XS1715 SSD 800GB @@ -18568,6 +18829,8 @@ 1028 2131 Ent NVMe v2 AGN RI U.2 7.68TB 1028 2132 Ent NVMe v2 AGN FIPS RI U.2 15.36TB 1028 2133 Ent NVMe v2 AGN RI U.2 15.36TB + a825 NVMe SSD Controller PM173Xa + a826 NVMe SSD Controller PM174X ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -18579,6 +18842,7 @@ 1456 Advanced Hardware Architectures 1457 Nuera Communications Inc 1458 Gigabyte Technology Co., Ltd + 22e8 Ellesmere [Radeon RX 480] 3483 USB 3.0 Controller (VIA VL80x-based xHCI Controller) 1459 DOOIN Electronics 145a Escalate Networks Inc @@ -18598,6 +18862,7 @@ 1462 Micro-Star International Co., Ltd. [MSI] # VIA Driver-inf 3483 MSI USB 3.0 (VIA VL80x-based xHCI USB Controller) + 7c56 Realtek Ethernet controller RTL8111H aaf0 Radeon RX 580 Gaming X 8G 1463 Fast Corporation 1464 Interactive Circuits & Systems Ltd @@ -18693,7 +18958,8 @@ 14a8 FEATRON Technologies Corporation 14a9 HIVERTEC Inc 14aa Advanced MOS Technology Inc -14ab Mentor Graphics Corp. +# nee Mentor Graphics Corp. +14ab Siemens Industry Software Inc. 14ac Novaweb Technologies Inc 14ad Time Space Radio AB 14ae CTI, Inc @@ -19270,9 +19536,12 @@ 14e4 1402 BCM957414A4142CC 10Gb/25Gb Ethernet PCIe 14e4 1404 BCM957414M4142C OCP 2x25G Type1 wRoCE 14e4 4140 NetXtreme E-Series Advanced Dual-port 25Gb SFP28 Network Daughter Card +# BCM957414M4143C + 14e4 4143 NetXtreme-E Single-port 40Gb/50Gb Ethernet OCP 2.0 Adapter (BCM957414M4143C) 14e4 4146 NetXtreme-E Dual-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957414N4140C) 1590 020e Ethernet 25Gb 2-port 631SFP28 Adapter 1590 0211 Ethernet 25Gb 2-port 631FLR-SFP28 Adapter + 1eec 0101 VSE250231S Dual-port 10Gb/25Gb Ethernet PCIe 16d8 BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller 1028 1feb NetXtreme-E 10Gb SFP+ Adapter 14e4 4163 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 2.0 Adapter (BCM957416M4163C) @@ -19331,6 +19600,7 @@ 14e4 d124 NetXtreme-E P2100D BCM57508 2x100G QSFP PCIE 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet + 1028 09d4 PowerEdge XR11/XR12 LOM 14e4 5045 NetXtreme-E BCM57504 4x25G OCP3.0 14e4 5250 NetXtreme-E BCM57504 4x25G KR Mezz 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE @@ -19341,7 +19611,7 @@ 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet Partition 1803 BCM57502 NetXtreme-E RDMA Partition 1804 BCM57504 NetXtreme-E RDMA Partition - 1805 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz RDMA Partition + 1805 BCM57508 NetXtreme-E RDMA Partition 14e4 df24 NetXtreme-E NGM2100D BCM57508 2x100G KR Mezz RDMA Partition 1806 BCM5750X NetXtreme-E Ethernet Virtual Function 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet Virtual Function @@ -19557,6 +19827,7 @@ 441f BCM4361 802.11ac Dual-Band Wireless Network Controller 4420 BCM4361 802.11ac 2.4 GHz Wireless Network Controller 4421 BCM4361 802.11ac 5 GHz Wireless Network Controller + 4425 BRCM4378 Wireless Network Adapter 4430 BCM44xx CardBus iLine32 HomePNA 2.0 4432 BCM4432 CardBus 10/100BaseT 4464 BCM4364 802.11ac Wireless Network Adapter @@ -19635,6 +19906,7 @@ b960 Broadcom BCM56960 Switch ASIC # Tomahawk4 b990 BCM56990 Switch ASIC + c909 BCM78909 Switch ASIC d802 BCM58802 Stingray 50Gb Ethernet SoC 14e4 8021 Stingray Dual-Port 25Gb Ethernet PCIe SmartNIC w16GB DRAM (Part No BCM958802A8046C) 14e4 8023 PS410T-H04 NetXtreme-S 4x10G 10GBaseT PCIe SmartNIC @@ -20331,13 +20603,16 @@ 0252 Amos chiplet 0253 Amos GearBox Manager 0254 Spectrum-4, Flash recovery mode - 0255 Spectrum-4, Secure Flash recovery mode - 0256 Ofek chiplet + 0255 Spectrum-4 RMA + 0256 Abir GearBox 0257 Quantum-2 in Flash Recovery Mode + 0258 Quantum-2 RMA 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image 0281 NPS-600 Flash Recovery + 0357 Abir GearBox in Flash Recovery Mode + 0358 Abir GearBox in RMA 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -20835,7 +21110,7 @@ 0002 SiByte BCM1125H/1250 System-on-a-Chip HyperTransport 0012 SiByte BCM1280/BCM1480 System-on-a-Chip PCI-X 0014 Sibyte BCM1280/BCM1480 System-on-a-Chip HyperTransport -1677 Bernecker + Rainer +1677 B&R Industrial Automation GmbH 104e 5LS172.6 B&R Dual CAN Interface Card 12d7 5LS172.61 B&R Dual CAN Interface Card 20ad 5ACPCI.MFIO-K01 Profibus DP / K-Feldbus / COM @@ -21249,6 +21524,7 @@ 7029 AP342 14-bit, 12-Channel Isolated Simultaneous Conversion Analog Input Module 702a AP226 12-Bit, 8-Channel Isolated Analog Output Module 702b AP236 16-Bit, 8-Channel Isolated Analog Output Module + 702c AP560A Module 4 Independent isolated CAN bus channels 7031 AP441-1: 32-Channel Isolated Digital Input Module 7032 AP441-2: 32-Channel Isolated Digital Input Module 7033 AP441-3: 32-Channel Isolated Digital Input Module @@ -21259,6 +21535,7 @@ 7052 APA7-502 Reconfigurable Artix-7 52,160 Cell FPGA module 24 RS485 channels 7053 APA7-503 Reconfigurable Artix-7 52,160 Cell FPGA module 24 TTL & 12 RS485 channels 7054 APA7-504 Reconfigurable Artix-7 52,160 Cell FPGA module 24 LVDS channels + 7073 AP730 Multi-function I/O Module 16 Digital I/O 8 Differential Analog In 4 Analog Out 16da Advantech Co., Ltd. 0011 INES GPIB-PCI 16df PIKA Technologies Inc. @@ -21371,7 +21648,9 @@ 0004 Octeon (and older) FIPS 0005 Octeon CN38XX Network Processor Pass 3.x 0006 RoHS - 0010 Nitrox XL NPX + 0010 CN15XX/CN16XX [Nitrox PX] + 0011 CNN35XX [Nitrox III] + 0012 CNN55XX [Nitrox V] 0020 Octeon CN31XX Network Processor 0030 Octeon CN30XX Network Processor 0040 Octeon CN58XX Network Processor @@ -21732,6 +22011,8 @@ 6013 R6013 ISA Bridge 6020 R6020 North Bridge 6021 R6021 Host Bridge +# Integrated in the Vortex86DX2 SoC + 6022 R6022 Host Bridge # Found in the Vortex86DX3 SoC 6023 R6023 Host Bridge # Found in the Vortex86EX SoC @@ -22022,6 +22303,7 @@ 18ec 4200 Flexible FlowMon (szedata2) 1x10G 18ec ff00 Testing design 18ec ff01 Boot design + c400 COMBO-400G1 18ee Chenming Mold Ind. Corp. 18f1 Spectrum GmbH 18f4 Napatech A/S @@ -22485,6 +22767,7 @@ 5012 E12 NVMe Controller 5013 PS5013 E13 NVMe Controller 5016 E16 PCIe4 NVMe Controller + 5018 E18 PCIe4 NVMe Controller 1989 Montilio Inc. 0001 RapidFile Bridge 8001 RapidFile @@ -22681,6 +22964,7 @@ 1a22 Ambric Inc. 1a29 Fortinet, Inc. 4338 CP8 Content Processor ASIC + 43a0 CP9 Content Processor ASIC 4e36 NP6 Network Processor 4e37 NP7 Network Processor 1a2b Ascom AG @@ -22799,7 +23083,8 @@ 1ae3 SANBlaze Technology, Inc. 1ae7 First Wise Media GmbH 0520 HFC-S PCI A [X-TENSIONS XC-520] -1ae8 Silicon Software GmbH +# nee Silicon Software GmbH +1ae8 Basler AG # CameraLink frame grabber for Visual Applets 0751 mE5 marathon VCL # CameraLink HS frame grabber @@ -22848,6 +23133,12 @@ 0b61 mE6 Abacus 4TG # CoaXpress frame grabber 0b63 CXP-12 Interface Card 1C +# CoaXpress frame grabber + 0b64 CXP-12 Interface Card 4C +# CoaXpress frame grabber + 0b65 CXP-12 Interface Card 2C +# CoaXpress Thunderbolt frame grabber + 0b66 CXP-12 LightBridge 2C # GigE Vision frame grabber 0e42 microEnable IV AQ4-GE # GigE Vision frame grabber for Visual Applets @@ -22946,6 +23237,7 @@ 1343 ASM1143 USB 3.1 Host Controller 2142 ASM2142 USB 3.1 Host Controller 1462 7a72 H270 PC MATE + 2824 ASM2824 PCIe Gen3 Packet Switch 3242 ASM3242 USB 3.2 Host Controller 1b26 Netcope Technologies, a.s. c132 COMBO-LXT155 @@ -23295,13 +23587,21 @@ 1283 PC300 NVMe Solid State Drive 256GB 1284 PC300 NVMe Solid State Drive 512GB 1285 PC300 NVMe Solid State Drive 1TB - 1327 BC501 NVMe Solid State Drive 512GB + 1327 BC501 NVMe Solid State Drive 1339 BC511 1504 SC300 512GB M.2 2280 SATA Solid State Drive 1527 PC401 NVMe Solid State Drive 256GB 243b PE6110 NVMe Solid State Drive 1c5c 0100 PE6110 NVMe Solid State Drive 2839 PE8000 Series NVMe Solid State Drive + 1028 2143 DC NVMe SED PE8010 RI U.2 960GB + 1028 2144 DC NVMe PE8010 RI U.2 960GB + 1028 2145 DC NVMe SED PE8010 RI U.2 1.92TB + 1028 2146 DC NVMe PE8010 RI U.2 1.92TB + 1028 2147 DC NVMe SED PE8010 RI U.2 3.84TB + 1028 2148 DC NVMe PE8010 RI U.2 3.84TB + 1028 2149 DC NVMe SED PE8010 RI U.2 7.68TB + 1028 214a DC NVMe PE8010 RI U.2 7.68TB 1c5c 0100 PE8000 Series NVMe Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. 000d PBlaze5 520/526 @@ -23354,6 +23654,16 @@ 1cc1 ADATA Technology Co., Ltd. 8201 XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive 1cc4 Union Memory (Shenzhen) + 1203 NVMe SSD Controller UHXXXa series + 1cc4 a121 NVMe SSD UHXXXa series U.2 960GB + 1cc4 a122 NVMe SSD UHXXXa series U.2 1920GB + 1cc4 a123 NVMe SSD UHXXXa series U.2 3840GB + 1cc4 a124 NVMe SSD UHXXXa series U.2 7680GB + 1cc4 a125 NVMe SSD UHXXXa series U.2 15360GB + 1cc4 a211 NVMe SSD UHXXXa series U.2 800GB + 1cc4 a212 NVMe SSD UHXXXa series U.2 1600GB + 1cc4 a213 NVMe SSD UHXXXa series U.2 3200GB + 1cc4 a214 NVMe SSD UHXXXa series U.2 6400GB 17ab NVMe 256G SSD device 1cc5 Embedded Intelligence, Inc. 0100 CAN-PCIe-02 @@ -23396,6 +23706,7 @@ 0100 ExaDISK FX1 1cf0 Akitio 1cf7 Subspace Dynamics +1cfa Corsair Memory, Inc 1d00 Pure Storage 1d05 Tongfang Hongkong Limited 1d0f Amazon.com, Inc. @@ -23473,6 +23784,8 @@ 1d21 Allo 1d22 Baidu Technology 1380 Cloud Storage Device + 3684 Kunlun AI Accelerator + 3685 Kunlun2 AI Accelerator [VF] 1d26 Kalray Inc. 0040 Turbocard2 Accelerator 0080 Open Network Interface Card 80G @@ -23494,6 +23807,9 @@ 1d62 Nebbiolo Technologies 1d65 Imagine Communications Corp. 04de Taurus/McKinley +1d69 Celeno Communications + 2432 CL2432 + 2440 CL2440 1d6a Aquantia Corp. 0001 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 00b1 AQC100 10G Ethernet MAC controller [AQtion] @@ -23533,6 +23849,11 @@ 1017 AR-ARK-FX1 [Arkville 64B Multi-Homed Primary Endpoint] 1018 AR-ARK-FX1 [Arkville 64B Multi-Homed Secondary Endpoint] 1019 AR-ARK-FX1 [Arkville 64B Multi-Homed Tertiary Endpoint] + 101a AR-ARK-SRIOV-FX0 [Arkville 32B Primary Physical Function] + 101b AR-ARK-SRIOV-FX1 [Arkville 64B Primary Physical Function] + 101c AR-ARK-SRIOV-VF [Arkville Virtual Function] + 101d AR-ARK-NIC [Arkville ArkNIC Kernel Path Device] + 101e AR-ARKA-FX1 [Arkville 64B DPDK Data Mover for Agilex R-Tile] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi 1d78 DERA Storage @@ -23561,7 +23882,10 @@ 0100 RK3399 PCI Express Root Port 1808 RK1808 Neural Network Processor Card 3566 RK3568 Remote Signal Processor +1d89 YEESTOR Microelectronics Co., Ltd + 0280 PCIe NVMe SSD 1d8f Enyx +1d92 Abaco Systems Inc. 1d93 YADRO 1d94 Chengdu Haiguang IC Design Co., Ltd. 1450 Root Complex @@ -23597,6 +23921,7 @@ 0001 Colossus GC2 [C2] 0002 Colossus GC1 [S1] 1d97 Shenzhen Longsys Electronics Co., Ltd. + 2263 SM2263EN/SM2263XT-based OEM SSD 1d9b Facebook, Inc. 0010 Networking DOM Engine 0011 IO Bridge @@ -23607,13 +23932,42 @@ 0001 HL-1000 AI Inference Accelerator [Goya] # PCIe accelerator card for Deep Learning training tasks 1000 HL-2000 AI Training Accelerator [Gaudi] +# PCIe accelerator card for Deep Learning training tasks with secured firmware + 1010 HL-2000 AI Training Accelerator [Gaudi secured] +1dad Fungible 1db2 ATP ELECTRONICS INC +1db7 Phytium Technology Co., Ltd. + dc20 [X100 Series] + dc21 VPU Controller [X100 Series] + dc22 DC Controller [X100 Series] + dc23 I2S/DMA Controller [X100 Series] *** 560 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:01 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 455066AF85A; Wed, 22 Sep 2021 10:31: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 4HDvhj0knGz4tCF; Wed, 22 Sep 2021 10:31:01 +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 ED85A15C3B; Wed, 22 Sep 2021 10:31:00 +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 18MAV0QY009164; Wed, 22 Sep 2021 10:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV0r9009163; Wed, 22 Sep 2021 10:31:00 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:00 GMT Message-Id: <202109221031.18MAV0r9009163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 96526cc9edcb - stable/12 - vi.1: Fix a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 96526cc9edcb4d3f4b91cbaec2708cb16d45dae4 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, 22 Sep 2021 10:31:01 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=96526cc9edcb4d3f4b91cbaec2708cb16d45dae4 commit 96526cc9edcb4d3f4b91cbaec2708cb16d45dae4 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2019-12-09 17:58:22 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:21:39 +0000 vi.1: Fix a typo Reviewed by: bcr Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D22734 (cherry picked from commit 2486d00026666397c4f9b42187af6ecf9765bf4b) --- contrib/nvi/docs/man/vi.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/nvi/docs/man/vi.1 b/contrib/nvi/docs/man/vi.1 index 73ebdbdb7e13..a06c9242f8d6 100644 --- a/contrib/nvi/docs/man/vi.1 +++ b/contrib/nvi/docs/man/vi.1 @@ -14,7 +14,7 @@ .\" .\" $Id: vi.1,v 9.0 2013/11/02 12:11:56 zy Exp $ .\" -.Dd November 2, 2013 +.Dd December 9, 2019 .Dt VI 1 .Os .Sh NAME @@ -981,7 +981,7 @@ command. .Cm ;\& .Xc Repeat the last character find -.Pq i.e., the last .Cm F , f , T No or Cm t No command +.Pq i.e., the last Cm F , f , T No or Cm t No command .Ar count times. .Pp From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:02 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 811236AF9C8; Wed, 22 Sep 2021 10:31:02 +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 4HDvhk2ZNLz4sxw; Wed, 22 Sep 2021 10:31:02 +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 24EC215DE0; Wed, 22 Sep 2021 10:31:02 +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 18MAV2g8009188; Wed, 22 Sep 2021 10:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV29W009187; Wed, 22 Sep 2021 10:31:02 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:02 GMT Message-Id: <202109221031.18MAV29W009187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: b4a70dd2a25c - stable/12 - Update nvi to 2.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b4a70dd2a25c8be82bf01048ff068ebe748a32e1 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, 22 Sep 2021 10:31:02 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a70dd2a25c8be82bf01048ff068ebe748a32e1 commit b4a70dd2a25c8be82bf01048ff068ebe748a32e1 Author: Baptiste Daroussin AuthorDate: 2020-09-09 08:38:47 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:25:30 +0000 Update nvi to 2.2.0 Main changes: * Vim-style expandtab option * Provides Turkish translation * Backspace now deletes \ rather than being escaped * T during motion commands is now VI-compatible * Encoding related fixes, such as UTF-8 detection * Fixed a number of memory management issues (cherry picked from commit 110d525ec6188f3c9dc4f54c4bc1cced2f7184cd) --- contrib/nvi/.gitignore | 9 + contrib/nvi/CMakeLists.txt | 190 +++++++++++++++++++ contrib/nvi/LICENSE | 4 - contrib/nvi/README | 10 +- contrib/nvi/catalog/Makefile | 9 +- contrib/nvi/catalog/README | 2 - contrib/nvi/catalog/dump.c | 5 +- contrib/nvi/catalog/tr_TR.ISO8859-9.base | 304 ++++++++++++++++++++++++++++++ contrib/nvi/catalog/tr_TR.ISO8859-9.owner | 1 + contrib/nvi/catalog/tr_TR.UTF-8.base | 304 ++++++++++++++++++++++++++++++ contrib/nvi/catalog/tr_TR.UTF-8.owner | 1 + contrib/nvi/cl/README.signal | 2 - contrib/nvi/cl/cl.h | 2 - contrib/nvi/cl/cl_funcs.c | 4 - contrib/nvi/cl/cl_main.c | 65 ++----- contrib/nvi/cl/cl_read.c | 4 - contrib/nvi/cl/cl_screen.c | 62 +++--- contrib/nvi/cl/cl_term.c | 25 ++- contrib/nvi/common/args.h | 2 - contrib/nvi/common/common.h | 11 +- contrib/nvi/common/conv.c | 13 +- contrib/nvi/common/conv.h | 2 - contrib/nvi/common/cut.c | 34 +--- contrib/nvi/common/cut.h | 2 - contrib/nvi/common/delete.c | 28 ++- contrib/nvi/common/encoding.c | 4 - contrib/nvi/common/exf.c | 106 +++-------- contrib/nvi/common/exf.h | 2 - contrib/nvi/common/extern.h | 1 - contrib/nvi/common/gs.h | 4 - contrib/nvi/common/key.c | 61 ++---- contrib/nvi/common/key.h | 12 +- contrib/nvi/common/line.c | 60 ++---- contrib/nvi/common/log.c | 61 ++---- contrib/nvi/common/log.h | 2 - contrib/nvi/common/main.c | 76 +++----- contrib/nvi/common/mark.c | 35 +--- contrib/nvi/common/mark.h | 2 - contrib/nvi/common/mem.h | 51 ++--- contrib/nvi/common/msg.c | 55 ++---- contrib/nvi/common/msg.h | 2 - contrib/nvi/common/multibyte.h | 36 +++- contrib/nvi/common/options.c | 66 ++----- contrib/nvi/common/options.h | 2 - contrib/nvi/common/options_def.h | 137 +++++++------- contrib/nvi/common/options_f.c | 94 ++------- contrib/nvi/common/put.c | 12 +- contrib/nvi/common/recover.c | 68 ++----- contrib/nvi/common/screen.c | 28 +-- contrib/nvi/common/screen.h | 2 - contrib/nvi/common/search.c | 41 +--- contrib/nvi/common/seq.c | 65 ++----- contrib/nvi/common/seq.h | 2 - contrib/nvi/common/util.c | 76 ++------ contrib/nvi/common/util.h | 2 - contrib/nvi/docs/man/Makefile | 16 -- contrib/nvi/ex/ex.c | 11 +- contrib/nvi/ex/ex.h | 2 - contrib/nvi/ex/ex_abbrev.c | 4 - contrib/nvi/ex/ex_append.c | 4 - contrib/nvi/ex/ex_args.c | 9 +- contrib/nvi/ex/ex_argv.c | 8 +- contrib/nvi/ex/ex_at.c | 10 +- contrib/nvi/ex/ex_bang.c | 11 +- contrib/nvi/ex/ex_cd.c | 4 - contrib/nvi/ex/ex_cmd.c | 4 - contrib/nvi/ex/ex_cscope.c | 63 +++---- contrib/nvi/ex/ex_delete.c | 4 - contrib/nvi/ex/ex_display.c | 4 - contrib/nvi/ex/ex_edit.c | 4 - contrib/nvi/ex/ex_equal.c | 4 - contrib/nvi/ex/ex_file.c | 4 - contrib/nvi/ex/ex_filter.c | 5 +- contrib/nvi/ex/ex_global.c | 14 +- contrib/nvi/ex/ex_init.c | 17 +- contrib/nvi/ex/ex_join.c | 4 - contrib/nvi/ex/ex_map.c | 4 - contrib/nvi/ex/ex_mark.c | 4 - contrib/nvi/ex/ex_mkexrc.c | 4 - contrib/nvi/ex/ex_move.c | 4 - contrib/nvi/ex/ex_open.c | 4 - contrib/nvi/ex/ex_preserve.c | 4 - contrib/nvi/ex/ex_print.c | 6 +- contrib/nvi/ex/ex_put.c | 4 - contrib/nvi/ex/ex_quit.c | 4 - contrib/nvi/ex/ex_read.c | 7 +- contrib/nvi/ex/ex_screen.c | 4 - contrib/nvi/ex/ex_script.c | 11 +- contrib/nvi/ex/ex_set.c | 4 - contrib/nvi/ex/ex_shell.c | 4 - contrib/nvi/ex/ex_shift.c | 33 +++- contrib/nvi/ex/ex_source.c | 9 +- contrib/nvi/ex/ex_stop.c | 4 - contrib/nvi/ex/ex_subst.c | 28 +-- contrib/nvi/ex/ex_tag.c | 41 ++-- contrib/nvi/ex/ex_txt.c | 12 +- contrib/nvi/ex/ex_undo.c | 4 - contrib/nvi/ex/ex_usage.c | 7 +- contrib/nvi/ex/ex_util.c | 4 - contrib/nvi/ex/ex_version.c | 4 - contrib/nvi/ex/ex_visual.c | 4 - contrib/nvi/ex/ex_write.c | 4 - contrib/nvi/ex/ex_yank.c | 4 - contrib/nvi/ex/ex_z.c | 4 - contrib/nvi/ex/extern.h | 1 + contrib/nvi/ex/script.h | 2 - contrib/nvi/ex/tag.h | 2 - contrib/nvi/ex/version.h | 2 +- contrib/nvi/files/config.h.in | 17 ++ contrib/nvi/files/pathnames.h.in | 26 +++ contrib/nvi/files/recover.in | 53 ++++++ contrib/nvi/{docs => }/man/vi.1 | 53 ++++-- contrib/nvi/vi/getc.c | 4 - contrib/nvi/vi/v_at.c | 4 - contrib/nvi/vi/v_ch.c | 13 +- contrib/nvi/vi/v_cmd.c | 4 - contrib/nvi/vi/v_delete.c | 4 - contrib/nvi/vi/v_ex.c | 4 - contrib/nvi/vi/v_increment.c | 4 - contrib/nvi/vi/v_init.c | 25 +-- contrib/nvi/vi/v_itxt.c | 4 - contrib/nvi/vi/v_left.c | 4 - contrib/nvi/vi/v_mark.c | 4 - contrib/nvi/vi/v_match.c | 9 +- contrib/nvi/vi/v_paragraph.c | 9 +- contrib/nvi/vi/v_put.c | 4 - contrib/nvi/vi/v_redraw.c | 4 - contrib/nvi/vi/v_replace.c | 4 - contrib/nvi/vi/v_right.c | 4 - contrib/nvi/vi/v_screen.c | 4 - contrib/nvi/vi/v_scroll.c | 8 +- contrib/nvi/vi/v_search.c | 4 - contrib/nvi/vi/v_section.c | 4 - contrib/nvi/vi/v_sentence.c | 6 +- contrib/nvi/vi/v_status.c | 4 - contrib/nvi/vi/v_txt.c | 97 ++++------ contrib/nvi/vi/v_ulcase.c | 4 - contrib/nvi/vi/v_undo.c | 4 - contrib/nvi/vi/v_util.c | 4 - contrib/nvi/vi/v_word.c | 4 - contrib/nvi/vi/v_xchar.c | 4 - contrib/nvi/vi/v_yank.c | 4 - contrib/nvi/vi/v_z.c | 4 - contrib/nvi/vi/v_zexit.c | 4 - contrib/nvi/vi/vi.c | 12 +- contrib/nvi/vi/vi.h | 4 +- contrib/nvi/vi/vs_line.c | 4 - contrib/nvi/vi/vs_msg.c | 17 +- contrib/nvi/vi/vs_refresh.c | 11 +- contrib/nvi/vi/vs_relative.c | 4 - contrib/nvi/vi/vs_smap.c | 4 - contrib/nvi/vi/vs_split.c | 10 +- usr.bin/vi/Makefile | 5 +- usr.bin/vi/catalog/Makefile | 2 +- usr.bin/vi/config.h | 8 +- usr.bin/vi/pathnames.h | 1 - 156 files changed, 1569 insertions(+), 1632 deletions(-) diff --git a/contrib/nvi/.gitignore b/contrib/nvi/.gitignore new file mode 100644 index 000000000000..aac7860d7299 --- /dev/null +++ b/contrib/nvi/.gitignore @@ -0,0 +1,9 @@ +*.swp +*~ +*.orig +*.core +extern.h +*_def.h +version.h +tags +build/ diff --git a/contrib/nvi/CMakeLists.txt b/contrib/nvi/CMakeLists.txt new file mode 100644 index 000000000000..00f43283f022 --- /dev/null +++ b/contrib/nvi/CMakeLists.txt @@ -0,0 +1,190 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) + +if(USE_ICONV) + check_function_exists(__iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(term.h HAVE_TERM_H) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) diff --git a/contrib/nvi/LICENSE b/contrib/nvi/LICENSE index c79151197da6..f9238465b7c9 100644 --- a/contrib/nvi/LICENSE +++ b/contrib/nvi/LICENSE @@ -1,7 +1,3 @@ -/*- - * $Id: LICENSE,v 8.18 2011/07/10 11:58:35 zy Exp $ - */ - The following are the copyrights and redistribution conditions that apply to this copy of the Vi software. diff --git a/contrib/nvi/README b/contrib/nvi/README index 26fcc167fc6f..8f61a97144be 100644 --- a/contrib/nvi/README +++ b/contrib/nvi/README @@ -1,6 +1,4 @@ -# $Id: README,v 9.2 2015/04/08 17:18:56 zy Exp $ - -This is version 2.1.3 (2015-04-08) of nex/nvi, a reimplementation of the ex/vi +This is version 2.2.0 (2020-08-01) of nex/nvi, a reimplementation of the ex/vi text editors originally distributed as part of the Fourth Berkeley Software Distribution (4BSD), by the University of California, Berkeley. @@ -8,12 +6,12 @@ The directory layout is as follows: LICENSE ....... Copyright, use and redistribution information. README ........ This file. - build ......... Build directory. catalog ....... Message catalogs; see catalog/README. cl ............ Vi interface to the curses(3) library. common ........ Code shared by ex and vi. - docs .......... Ex/vi documentation, both current and historic. ex ............ Ex source code. + files ......... Template files. + man ........... Ex/vi documentation. regex ......... Modified regex library with wide character support. vi ............ Vi source code. @@ -29,7 +27,7 @@ o Nvi was written by Keith Bostic, and the last version is 1.79. After that, The following acknowledgments were written by Keith Bostic: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -o This software is several years old and is the product of many folks' work. +o This software is several years old and is the product of many folks' work. This software was originally derived from software contributed to the University of California, Berkeley by Steve Kirkendall, the diff --git a/contrib/nvi/catalog/Makefile b/contrib/nvi/catalog/Makefile index 11e71cce6d7b..d9f7cc91456d 100644 --- a/contrib/nvi/catalog/Makefile +++ b/contrib/nvi/catalog/Makefile @@ -1,7 +1,5 @@ -# $Id: Makefile,v 9.0 2012/10/19 15:13:11 zy Exp $ - -CAT= dutch english french german polish ru_RU.KOI8-R spanish swedish \ - uk_UA.KOI8-U zh_CN.GB2312 +CAT= dutch english french german polish ru_RU.KOI8-R spanish \ + swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312 FILES= ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c all: dump ${CAT} @@ -33,7 +31,8 @@ ${CAT}: english.base CHK= dutch.check english.check french.check german.check \ polish.check ru_RU.KOI8-R.check spanish.check swedish.check \ - uk_UA.KOI8-U.check zh_CN.GB2312.check + tr_TR.ISO8859-9.check tr_TR.UTF-8.check uk_UA.KOI8-U.check \ + zh_CN.GB2312.check check: ${CHK} ${CHK}: ${CAT} @echo "... $@"; \ diff --git a/contrib/nvi/catalog/README b/contrib/nvi/catalog/README index 42a728afbe2e..14337c7c5981 100644 --- a/contrib/nvi/catalog/README +++ b/contrib/nvi/catalog/README @@ -1,5 +1,3 @@ -# $Id: README,v 9.0 2012/10/19 17:06:15 zy Exp $ - Generally, all non-system error and informational messages in nvi are catalog messages, i.e. they can be tailored to a specific langauge. Command strings, usage strings, system errors and other 'known text' diff --git a/contrib/nvi/catalog/dump.c b/contrib/nvi/catalog/dump.c index b87b29c1af78..74ab53b2f12c 100644 --- a/contrib/nvi/catalog/dump.c +++ b/contrib/nvi/catalog/dump.c @@ -27,10 +27,7 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)dump.c 8.1 (Berkeley) 8/31/94"; -#endif /* not lint */ - +#include #include #include diff --git a/contrib/nvi/catalog/tr_TR.ISO8859-9.base b/contrib/nvi/catalog/tr_TR.ISO8859-9.base new file mode 100644 index 000000000000..a591974e34d8 --- /dev/null +++ b/contrib/nvi/catalog/tr_TR.ISO8859-9.base @@ -0,0 +1,304 @@ +002 "Satýr uzunluðu taþýmý" +003 "%lu numaralý satýr silinemiyor" +004 "%lu numaralý satýra iliþtirilemiyor" +005 "%lu numaralý satýrda ekleme yapýlamýyor" +006 "%lu numaralý satýr kaydedilemiyor" +007 "Son satýr alýnamýyor" +008 "Hata: %lu numaralý satýr okunamýyor" +009 "Günlük dosyasý" +010 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +011 "Geri alýnacak bir deðiþiklik yok" +012 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +013 "Günlükleme gerçekleþtirilmiyor, ileri sarma olanaklý deðil" +014 "Yinelenecek bir deðiþiklik yok" +015 "%s/%d: Günlük kayýt hatasý" +016 "Vi'nin standart girdisi ve çýktýsý bir uçbirim olmalý" +017 "Ým %s: Ayarlanmamýþ" +018 "Ým %s: Satýr silinmiþ" +019 "Ým %s: Ýmleç konumu artýk yok" +020 "Hata: " +021 "yeni dosya +022 "adý deðiþti" +023 "deðiþtirildi" +024 "deðiþtirilmedi" +025 "KÝLÝDÝ AÇILDI" +026 "saltokunur" +027 "satýr %lu/%lu [%ld%%]" +028 "boþ dosya" +029 "%lu. satýr" +030 "%s dosyasý bir ileti kataloðu deðil" +031 "Öntanýmlý %s seçeneði ayarlanamadý" +032 "Kullaným: %s" +033 "set: %s seçeneði yok: 'set all' tüm seçenek deðerlerini verir" +034 "set: [no]%s seçeneði bir deðer almaz" +035 "set: %s seçeneði bir Boole deðeri deðil" +036 "set: %s seçeneði: %s" +037 "set: %s seçeneði: %s: Deðer taþýmý" +038 "set: %s seçeneði: %s izin verilmeyen bir sayý" +039 "set: %s seçeneði bir Boole deðeri deðil" +040 "Ekran sütun sayýsý çok küçük, þundan daha az: %d" +041 "Ekran sütun sayýsý çok büyük, þundan daha çok: %d" +042 "Ekran satýr sayýsý çok küçük, þundan daha az: %d" +043 "Ekran satýr sayýsý çok büyük, þundan daha çok: %d" +044 "Lisp seçeneði eklenmemiþ" +045 "Ýletiler kapatýlmamýþ: %s" +046 "Ýletiler açýlmamýþ: %s" +047 "%s seçeneði iki karakterli öbekler biçiminde olmalý" +053 "Baþlangýç arabelleði boþ" +054 "%s arabelleði boþ" +056 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +057 "Dosya, kurtarma için kopyalanýyor..." +058 "Koruma baþarýsýz oldu: %s" +059 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +060 "Dosya yedeklemesi baþarýsýz oldu: %s" +061 "Dosya, kurtarma için kopyalanýyor..." +062 "%u kullanýcýsý üzerine bilgi bulunamadý" +063 "Kurtarma dosyasý kilitlenemiyor" +065 "Kurtarma dosyasý" +066 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +067 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +068 "Kurtarýlacak %s adýnda sizce okunabilir bir dosya yok" +069 "Bu dosyanýn kurtarabileceðiniz eski sürümleri var" +070 "Kurtarabileceðiniz baþka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boþ, aranacak bir þey yok" +073 "Dizgi bulunamadan dosyanýn sonuna eriþildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadý" +076 "Dizgi bulunamadan dosyanýn baþýna eriþildi" +077 "Arama tamamlandý" +078 "Aranýyor..." +079 "Yazdýrýlamaz karakter bulunmadý" +080 "Bilinmeyen komut adý" +082 "%s: Komut ex kipinde kullanýlamaz" +083 "Sayým sýfýr olmayabilir" +084 "%s: Hatalý satýr belirtimi" +085 "Ýç sözdizim tablo hatasý (%s: %s)" +086 "Kullaným: %s" +087 "%s: Geçici arabellek salýverilmedi" +088 "Bayrak göreli konumu birinci satýrdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deðiþtiðinde çalýþýr" +091 "Global/v komutu dosya/ekran deðiþtiðinde çalýþýr" +092 "Ex komutu baþarýsýz: Sýradaki komutlar çýkarýldý" +093 "Ex komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +094 "Ýkinci adres ilkinden daha küçük" +095 "Bir im adý saðlanmadý" +096 "\\ sonrasýnda / veya ? gelmiyor" +097 "Bir satýr numarasýna yapýlan baþvuru sayýsý sýfýrdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deðeri taþýmý" +100 "Adres deðeri alttaþýmý" +101 "Ýzin verilmeyen adres birleþimi" +102 "Ýzin verilmeyen adres: Dosyada yalnýzca %lu satýr var" +103 "Ýzin verilmeyen adres: Dosya boþ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kýsaltma yok" +106 "Kýsaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kýsaltmalar sekme veya boþluk içeremez" +108 "Kýsaltmalar sonu dýþýnda sözcük/sözcük olmayan karakterleri karýþtýramaz" +109 "\"%s\" bir kýsaltma deðil" +110 "Vi komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +111 "Düzenlenecek baþka dosya yok" +112 "Öncesinde düzenlenecek baþka dosya yok" +113 "Öncesinde geri sarýlacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adý yok" +117 "# yerine geçecek bir dosya adý yok" +118 "Hata: execl: %s" +119 "Girdi/Çýktý hatasý: %s" +120 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +121 "Ev dizini konumu bulunamýyor" +122 "Yeni þimdiki dizin: %s" +123 "Görüntülenecek kesilmiþ arabellek yok" +124 "%s komutu bir global veya v komutunun parçasý olarak kullanýlamaz" +128 "%s: kaynak alýnmýyor: Ýyesi siz veya kök deðil" +129 "%s: kaynak alýnmýyor: Ýyesi siz deðilsiniz" +130 "%s: kaynak alýnmýyor: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan yazýlabilir" +131 "Uç uca eklenecek bir satýr yok" +132 "Girdi eþlem girdisi yok" +133 "Komut eþlem girdisi yok" +134 "%s yeniden eþlemlenemeyebilir" +135 "\"%s\" þu anda eþlemlenmemiþ" +136 "Ým adlarý tek bir karakter olmalýdýr" +137 "%s mevcut, yazýlmamýþ; yok saymak için ! kullanýn" +138 "Yeni exrc dosyasý: %s" +139 "Hedef satýrý taþýma erimi içinde" +140 "'open' komutu 'open' seçeneðinin ayarlý olmasýný gerektirir" +141 "'open' komutu henüz eklenmemiþ" +142 "Bu dosyanýn korunmasý olanaklý deðil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adýna geniþletilmiþ" +145 "Yalnýzca sýradan dosyalar ve adlandýrýlmýþ veri yollarý okunabilir" +146 "%s: Okuma kilidi kullanýlabilir deðildi" +147 "Okunuyor..." +148 "%s: %lu satýr, %lu karakter" +149 "Görüntülenecek arkaplan ekraný yok" +150 "'script' komutu yalnýzca vi kipinde kullanýlabilir" +151 "Çalýþtýrýlacak komut yok" +152 "'shiftwidth' seçeneði 0 olarak ayarlanmýþ" +153 "Sayým taþýmý" +154 "Sayým alttaþýmý" +155 "Düzenli ifade belirtilmiþ; r bayraðý anlamsýz" +156 "#, l ve p bayraklarý vi kipinde c bayraðý ile birlikte kullanýlamaz" +157 "Eþleþme bulunamadý" +158 "Önceden bir etiket girilmemiþ" +159 "Etiket yýðýnýnda %s sayýsýndan az girdi; :display t[ags] kullanýn" +160 "Etiket yýðýnýnda dönülecek bir %s dosyasý yok; :display t[ags] kullanýn" +161 "Sürdürmek için Enter'a basýn:" +162 "%s: Etiket bulunamadý" +163 "%s: %s içinde hasar görmüþ etiket" +164 "%s: Etiketin satýr numarasý dosya sonunu geçmiþ" +165 "Etiket yýðýný boþ" +166 "%s: Arama dizgisi bulunamadý" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleði boþ" +169 "Deðiþikliði onayla? [n]" +170 "Yarýda kesildi" +171 "Öncesinde çalýþtýrýlacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanýn halihazýrda okunmuþ olmasýný gerektirir" +174 "Kullaným: %s" +175 "'visual' komutu 'open' seçeneðinin ayarlanmýþ olmasýný gerektirir" +177 "Boþ dosya" +178 "Öncesinde F, f, T veya t aramasý yok" +179 "%s bulunamadý" +180 "Düzenlenecek dosya yok" +181 "Ýmleç bir sayýda deðil" +182 "Ortaya çýkan sayý çok büyük" +183 "Ortaya çýkan sayý çok küçük" +184 "Bu satýrda eþleþen karakter yok" +185 "Eþleþen karakter bulunamadý" +186 "Deðiþtirilecek karakter yok" +187 "Geçilecek baþka ekran yok" +188 "Arama dizgisinden, satýr ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baþlanan konumda tamamlandý" +191 "Kýsaltma geniþleme sýnýrýný aþtý: Karakterler çýkarýldý" +192 "Ýzin verilmeyen karakter; giriþ için týrnak içine alýn" +193 "Halihazýrda eklemenin baþýnda" +194 "Silinecek baþka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satýr sonunu geçti" +197 "Ýmleç hareket ettirilmedi" +198 "Halihazýrda dosyanýn baþýnda" +199 "Hareket dosyanýn baþýný geçti" +200 "Halihazýrda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazýrda dosya sonunda" +203 "Halihazýrda satýr sonunda" +204 "%s bir vi komutu deðil" +205 "Kullaným: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boþ" +210 "%s bir hareket komutu olarak kullanýlamaz" +211 "Halihazýrda komut kipi içinde" +212 "Ýmleç bir sözcükte deðil" +214 "'windows' seçeneði deðeri çok büyük, en çok %u olabilir" +215 "Ýliþtir" +216 "Deðiþiklik yap" +217 "Komut" +218 "Ekle" +219 "Deðiþtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran baþýný geçti" +222 "Ekran bölünebilmesi için %d satýrdan daha geniþ olmalýdýr" +223 "Arkaplan ekraný yok" +224 "Arkaplanda %s dosyasýný düzenleyen bir ekran yok" +225 "Açýk olan tek ekranýnýzý arkaplana alamazsýnýz" +226 "Ekran yalnýzca %d satýra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askýya alýnamaz" +231 "Yarýda kesildi: Eþlemlenen düðmeler çýkarýldý" +232 "vi: Geçici arabellek salýverilmedi" +233 "Bu uçbirimde %s düðmesi yok" +234 "Yalnýzca bir arabellek belirtilebilir" +235 "Sayý þundan daha büyük: %lu" +236 "Yarýda kesildi" +237 "Geçici dosya oluþturulamýyor" +238 "Uyarý: %s sýradan bir dosya deðil" +239 "%s halihazýrda kilitlenmiþ, oturum saltokunur" +240 "%s: Kaldýr" +241 "%s: Kapat" +242 "%s: Kaldýr" +243 "%s: Kaldýr" +244 "Saltokunur dosya, yazýlmadý; yok saymak için ! kullanýn" +245 "Saltokunur dosya, yazýlmadý" +246 "%s mevcut, yazýlmadý; yok saymak için ! kullanýn" +247 "%s mevcut, yazýlmadý" +248 "Kýsmi dosya, yazýlmadý; yok saymak için ! kullanýn" +249 "Kýsmi dosya, yazýlmadý" +250 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ; yok saymak için ! kullanýn" +251 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ" +252 "%s: Yazým korumasý kullanýlabilir deðildi" +253 "Yazýlýyor..." +254 "%s: UYARI: DOSYA KIRPILMIÞ" +255 "Halihazýrda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satýr, %lu karakter" +257 "%s: %lu satýr, %lu karakter" +258 "%s çok fazla dosya adýna geniþletilmiþ" +259 "%s: Sýradan bir dosya deðil" +260 "%s: Ýyesi siz deðilsiniz" +261 "%s: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan da eriþilebilir" +262 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +263 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için :edit! kullanýn" +264 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +265 "Dosya geçici; çýkarsanýz deðiþiklikler atýlacaktýr" +266 "Dosya saltokunur, deðiþiklikler kendiliðinden yazýlmaz" +267 "Günlük yeniden baþlatýldý" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düðmeye basýn: " +270 "Sürdürmek için herhangi bir düðmeye basýn [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düðmeye basýn [çýkýþ için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baþarýsýz, henüz bir dosya okunmadý." +275 " sürdür?" +276 "Beklenmedik karakter olayý" +277 "Beklenmedik dosya sonu olayý" +278 "Sorgu eþleþmesi bulunamadý" +279 "Beklenmedik yarýda kesme olayý" +281 "Beklenmedik yeniden boyama olayý" +282 "Halihazýrda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +285 "Beklenmedik dizi olayý" +286 "Beklenmedik zaman aþýmý olayý" +288 "Bölünebilmesi için ekran %d sütundan daha geniþ olmalýdýr" +289 "Kabuk geniþletmeleri 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +290 "%s komutu 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +291 "set: %s seçeneði kapatýlamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deðiþtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taþýndý" +298 "kaydýrýldý" +299 "kopyalandý" +300 "satýr" +301 "satýr" +303 "Dosya son yazýmdan bu yana deðiþtirilmiþ." +304 "Kabuk geniþletmesi baþarýsýz" +305 "Bir '%s' düzenleme seçeneði belirtilmedi" +307 "Çalýþtýrýlacak ex komutu yok" +308 "Bir komut çalýþtýrmak için , çýkmak için :q girin" +309 "Yardým için \"cscope help\" kullanýn" +310 "Çalýþan bir cscope baðlantýsý yok" +311 "%s: Bilinmeyen arama türü: Þunlardan bir tanesini kullanýn: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneði hiçbir zaman açýlamaz" +314 "set: %s seçeneði hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ýliþtirildi: %lu satýr, %lu karakter" +316 "Beklenmedik yeniden boyutlandýrma olayý" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alýndý; onlarý listelemek için :display kullanýn" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüþtürmesi desteklenmiyor" +322 "Girdi kodlama dönüþtürmesi desteklenmiyor" +323 "Geçersiz girdi. Kýrpýldý." +324 "%d numaralý satýrda dönüþtürme hatasý" diff --git a/contrib/nvi/catalog/tr_TR.ISO8859-9.owner b/contrib/nvi/catalog/tr_TR.ISO8859-9.owner new file mode 100644 index 000000000000..2739e5bbfd61 --- /dev/null +++ b/contrib/nvi/catalog/tr_TR.ISO8859-9.owner @@ -0,0 +1 @@ +Emir SARI diff --git a/contrib/nvi/catalog/tr_TR.UTF-8.base b/contrib/nvi/catalog/tr_TR.UTF-8.base new file mode 100644 index 000000000000..9c27d4eb7423 --- /dev/null +++ b/contrib/nvi/catalog/tr_TR.UTF-8.base @@ -0,0 +1,304 @@ +002 "Satır uzunluÄŸu taşımı" +003 "%lu numaralı satır silinemiyor" +004 "%lu numaralı satıra iliÅŸtirilemiyor" +005 "%lu numaralı satırda ekleme yapılamıyor" +006 "%lu numaralı satır kaydedilemiyor" +007 "Son satır alınamıyor" +008 "Hata: %lu numaralı satır okunamıyor" +009 "Günlük dosyası" +010 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +011 "Geri alınacak bir deÄŸiÅŸiklik yok" +012 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +013 "Günlükleme gerçekleÅŸtirilmiyor, ileri sarma olanaklı deÄŸil" +014 "Yinelenecek bir deÄŸiÅŸiklik yok" +015 "%s/%d: Günlük kayıt hatası" +016 "Vi'nin standart girdisi ve çıktısı bir uçbirim olmalı" +017 "Ä°m %s: Ayarlanmamış" +018 "Ä°m %s: Satır silinmiÅŸ" +019 "Ä°m %s: Ä°mleç konumu artık yok" +020 "Hata: " +021 "yeni dosya +022 "adı deÄŸiÅŸti" +023 "deÄŸiÅŸtirildi" +024 "deÄŸiÅŸtirilmedi" +025 "KÄ°LÄ°DÄ° AÇILDI" +026 "saltokunur" +027 "satır %lu/%lu [%ld%%]" +028 "boÅŸ dosya" +029 "%lu. satır" +030 "%s dosyası bir ileti kataloÄŸu deÄŸil" +031 "Öntanımlı %s seçeneÄŸi ayarlanamadı" +032 "Kullanım: %s" +033 "set: %s seçeneÄŸi yok: 'set all' tüm seçenek deÄŸerlerini verir" +034 "set: [no]%s seçeneÄŸi bir deÄŸer almaz" +035 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +036 "set: %s seçeneÄŸi: %s" +037 "set: %s seçeneÄŸi: %s: DeÄŸer taşımı" +038 "set: %s seçeneÄŸi: %s izin verilmeyen bir sayı" +039 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +040 "Ekran sütun sayısı çok küçük, ÅŸundan daha az: %d" +041 "Ekran sütun sayısı çok büyük, ÅŸundan daha çok: %d" +042 "Ekran satır sayısı çok küçük, ÅŸundan daha az: %d" +043 "Ekran satır sayısı çok büyük, ÅŸundan daha çok: %d" +044 "Lisp seçeneÄŸi eklenmemiÅŸ" +045 "Ä°letiler kapatılmamış: %s" +046 "Ä°letiler açılmamış: %s" +047 "%s seçeneÄŸi iki karakterli öbekler biçiminde olmalı" +053 "BaÅŸlangıç arabelleÄŸi boÅŸ" +054 "%s arabelleÄŸi boÅŸ" +056 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +057 "Dosya, kurtarma için kopyalanıyor..." +058 "Koruma baÅŸarısız oldu: %s" +059 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +060 "Dosya yedeklemesi baÅŸarısız oldu: %s" +061 "Dosya, kurtarma için kopyalanıyor..." +062 "%u kullanıcısı üzerine bilgi bulunamadı" +063 "Kurtarma dosyası kilitlenemiyor" +065 "Kurtarma dosyası" +066 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +067 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +068 "Kurtarılacak %s adında sizce okunabilir bir dosya yok" +069 "Bu dosyanın kurtarabileceÄŸiniz eski sürümleri var" +070 "KurtarabileceÄŸiniz baÅŸka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boÅŸ, aranacak bir ÅŸey yok" +073 "Dizgi bulunamadan dosyanın sonuna eriÅŸildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadı" +076 "Dizgi bulunamadan dosyanın başına eriÅŸildi" +077 "Arama tamamlandı" +078 "Aranıyor..." +079 "Yazdırılamaz karakter bulunmadı" +080 "Bilinmeyen komut adı" +082 "%s: Komut ex kipinde kullanılamaz" +083 "Sayım sıfır olmayabilir" +084 "%s: Hatalı satır belirtimi" +085 "İç sözdizim tablo hatası (%s: %s)" +086 "Kullanım: %s" +087 "%s: Geçici arabellek salıverilmedi" +088 "Bayrak göreli konumu birinci satırdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +091 "Global/v komutu dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +092 "Ex komutu baÅŸarısız: Sıradaki komutlar çıkarıldı" +093 "Ex komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +094 "Ä°kinci adres ilkinden daha küçük" +095 "Bir im adı saÄŸlanmadı" +096 "\\ sonrasında / veya ? gelmiyor" +097 "Bir satır numarasına yapılan baÅŸvuru sayısı sıfırdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deÄŸeri taşımı" +100 "Adres deÄŸeri alttaşımı" +101 "Ä°zin verilmeyen adres birleÅŸimi" +102 "Ä°zin verilmeyen adres: Dosyada yalnızca %lu satır var" +103 "Ä°zin verilmeyen adres: Dosya boÅŸ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kısaltma yok" +106 "Kısaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kısaltmalar sekme veya boÅŸluk içeremez" +108 "Kısaltmalar sonu dışında sözcük/sözcük olmayan karakterleri karıştıramaz" +109 "\"%s\" bir kısaltma deÄŸil" +110 "Vi komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +111 "Düzenlenecek baÅŸka dosya yok" +112 "Öncesinde düzenlenecek baÅŸka dosya yok" +113 "Öncesinde geri sarılacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adı yok" +117 "# yerine geçecek bir dosya adı yok" +118 "Hata: execl: %s" +119 "Girdi/Çıktı hatası: %s" +120 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +121 "Ev dizini konumu bulunamıyor" +122 "Yeni ÅŸimdiki dizin: %s" +123 "Görüntülenecek kesilmiÅŸ arabellek yok" +124 "%s komutu bir global veya v komutunun parçası olarak kullanılamaz" +128 "%s: kaynak alınmıyor: Ä°yesi siz veya kök deÄŸil" +129 "%s: kaynak alınmıyor: Ä°yesi siz deÄŸilsiniz" +130 "%s: kaynak alınmıyor: Ä°yesi dışında baÅŸka bir kullanıcı tarafından yazılabilir" +131 "Uç uca eklenecek bir satır yok" +132 "Girdi eÅŸlem girdisi yok" +133 "Komut eÅŸlem girdisi yok" +134 "%s yeniden eÅŸlemlenemeyebilir" +135 "\"%s\" ÅŸu anda eÅŸlemlenmemiÅŸ" +136 "Ä°m adları tek bir karakter olmalıdır" +137 "%s mevcut, yazılmamış; yok saymak için ! kullanın" +138 "Yeni exrc dosyası: %s" +139 "Hedef satırı taşıma erimi içinde" +140 "'open' komutu 'open' seçeneÄŸinin ayarlı olmasını gerektirir" +141 "'open' komutu henüz eklenmemiÅŸ" +142 "Bu dosyanın korunması olanaklı deÄŸil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adına geniÅŸletilmiÅŸ" +145 "Yalnızca sıradan dosyalar ve adlandırılmış veri yolları okunabilir" +146 "%s: Okuma kilidi kullanılabilir deÄŸildi" +147 "Okunuyor..." +148 "%s: %lu satır, %lu karakter" +149 "Görüntülenecek arkaplan ekranı yok" +150 "'script' komutu yalnızca vi kipinde kullanılabilir" +151 "Çalıştırılacak komut yok" +152 "'shiftwidth' seçeneÄŸi 0 olarak ayarlanmış" +153 "Sayım taşımı" +154 "Sayım alttaşımı" +155 "Düzenli ifade belirtilmiÅŸ; r bayrağı anlamsız" +156 "#, l ve p bayrakları vi kipinde c bayrağı ile birlikte kullanılamaz" +157 "EÅŸleÅŸme bulunamadı" +158 "Önceden bir etiket girilmemiÅŸ" +159 "Etiket yığınında %s sayısından az girdi; :display t[ags] kullanın" +160 "Etiket yığınında dönülecek bir %s dosyası yok; :display t[ags] kullanın" +161 "Sürdürmek için Enter'a basın:" +162 "%s: Etiket bulunamadı" +163 "%s: %s içinde hasar görmüş etiket" +164 "%s: Etiketin satır numarası dosya sonunu geçmiÅŸ" +165 "Etiket yığını boÅŸ" +166 "%s: Arama dizgisi bulunamadı" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleÄŸi boÅŸ" +169 "DeÄŸiÅŸikliÄŸi onayla? [n]" +170 "Yarıda kesildi" +171 "Öncesinde çalıştırılacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanın halihazırda okunmuÅŸ olmasını gerektirir" +174 "Kullanım: %s" +175 "'visual' komutu 'open' seçeneÄŸinin ayarlanmış olmasını gerektirir" +177 "BoÅŸ dosya" +178 "Öncesinde F, f, T veya t araması yok" +179 "%s bulunamadı" +180 "Düzenlenecek dosya yok" +181 "Ä°mleç bir sayıda deÄŸil" +182 "Ortaya çıkan sayı çok büyük" +183 "Ortaya çıkan sayı çok küçük" +184 "Bu satırda eÅŸleÅŸen karakter yok" +185 "EÅŸleÅŸen karakter bulunamadı" +186 "DeÄŸiÅŸtirilecek karakter yok" +187 "Geçilecek baÅŸka ekran yok" +188 "Arama dizgisinden, satır ofsetinden ve/veya 'z' komutundan sonraki karakterler" *** 6370 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:04 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 A387B6AFB22; Wed, 22 Sep 2021 10:31:04 +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 4HDvhm3BLZz4tKQ; Wed, 22 Sep 2021 10:31:04 +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 44FA915BE6; Wed, 22 Sep 2021 10:31:03 +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 18MAV3dq009212; Wed, 22 Sep 2021 10:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV3Km009211; Wed, 22 Sep 2021 10:31:03 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:03 GMT Message-Id: <202109221031.18MAV3Km009211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 4380eb895aef - stable/12 - Fix vi build on Linux/macOS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4380eb895aef2730bebee95cd6431e1e744f2cb7 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, 22 Sep 2021 10:31:04 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4380eb895aef2730bebee95cd6431e1e744f2cb7 commit 4380eb895aef2730bebee95cd6431e1e744f2cb7 Author: Alex Richardson AuthorDate: 2020-09-21 09:03:42 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:27:39 +0000 Fix vi build on Linux/macOS This absolute include causes a build failure on Linux for me: .../cheri/freebsd/contrib/nvi/cl/../common/common.h:10:10: fatal error: '/usr/include/db.h' file not found This change patches the file to use #include instead until a solution has been found upstream. See also https://github.com/lichray/nvi2/issues/69 Reviewed By: bapt Differential Revision: https://reviews.freebsd.org/D26480 (cherry picked from commit 2bd2b113353d79cc7bdd315c3c76e0fc13218219) --- contrib/nvi/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/nvi/common/common.h b/contrib/nvi/common/common.h index ad559a5a2267..256fe6a0029a 100644 --- a/contrib/nvi/common/common.h +++ b/contrib/nvi/common/common.h @@ -7,7 +7,7 @@ * See the LICENSE file for redistribution information. */ -#include "/usr/include/db.h" /* Only include db1. */ +#include /* Only include db1. */ #include /* May refer to the bundled regex. */ /* From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:09 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 19C5E6AF864; Wed, 22 Sep 2021 10:31: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 4HDvhr1LDpz4tF1; Wed, 22 Sep 2021 10:31:07 +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 853C116015; Wed, 22 Sep 2021 10:31:05 +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 18MAV5YD009267; Wed, 22 Sep 2021 10:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV53V009266; Wed, 22 Sep 2021 10:31:05 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:05 GMT Message-Id: <202109221031.18MAV53V009266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 4365415046a3 - stable/12 - Update nvi to 2.2.0-05ed8b9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4365415046a352c2b93553502ed3a3758da93197 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, 22 Sep 2021 10:31:09 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4365415046a352c2b93553502ed3a3758da93197 commit 4365415046a352c2b93553502ed3a3758da93197 Author: Baptiste Daroussin AuthorDate: 2020-10-01 04:46:23 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:28:14 +0000 Update nvi to 2.2.0-05ed8b9 This version incorporates many fixes in particular a fix for vi -w Another approach was proposed to merge those fixes (see review), I find it easier to track changes if we keep importing snapshot on regular basis PR: 241985 Reported by: fernape Differential Revision: https://reviews.freebsd.org/D26158 (cherry picked from commit 755cc40c21ca63388c6a67ba848a908b429e9391) --- contrib/nvi/CMakeLists.txt | 24 ++++++++++++++-- contrib/nvi/catalog/dump.c | 12 ++++---- contrib/nvi/cl/cl.h | 4 ++- contrib/nvi/cl/cl_read.c | 1 + contrib/nvi/cl/cl_term.c | 6 ++-- contrib/nvi/common/common.h | 10 ++++++- contrib/nvi/common/cut.h | 4 +-- contrib/nvi/common/exf.c | 17 +++++++----- contrib/nvi/common/key.c | 4 +-- contrib/nvi/common/log.c | 4 +-- contrib/nvi/common/main.c | 11 ++++---- contrib/nvi/common/mark.c | 3 +- contrib/nvi/common/mem.h | 60 ++++++++++++++++++++-------------------- contrib/nvi/common/msg.c | 4 +++ contrib/nvi/common/options.c | 20 ++++++++++---- contrib/nvi/common/put.c | 3 +- contrib/nvi/common/recover.c | 9 +++--- contrib/nvi/common/util.c | 10 +++++-- contrib/nvi/ex/ex.c | 9 ++++-- contrib/nvi/ex/ex.h | 8 +++--- contrib/nvi/ex/ex_argv.c | 8 ++++++ contrib/nvi/ex/ex_bang.c | 3 +- contrib/nvi/ex/ex_cscope.c | 10 ++++--- contrib/nvi/ex/ex_filter.c | 3 +- contrib/nvi/ex/ex_global.c | 3 +- contrib/nvi/ex/ex_script.c | 2 ++ contrib/nvi/ex/ex_shell.c | 3 +- contrib/nvi/ex/ex_subst.c | 27 +++++++++--------- contrib/nvi/files/config.h.in | 9 ++++++ contrib/nvi/files/pathnames.h.in | 5 ++-- contrib/nvi/regex/engine.c | 2 +- contrib/nvi/regex/regexec.c | 6 ++-- contrib/nvi/vi/v_itxt.c | 4 +-- contrib/nvi/vi/v_paragraph.c | 10 ++++--- contrib/nvi/vi/v_section.c | 3 +- contrib/nvi/vi/v_sentence.c | 3 +- contrib/nvi/vi/v_txt.c | 11 ++++---- contrib/nvi/vi/vi.c | 4 +-- contrib/nvi/vi/vs_line.c | 10 ++++--- contrib/nvi/vi/vs_msg.c | 13 +++++---- contrib/nvi/vi/vs_refresh.c | 9 ++++-- contrib/nvi/vi/vs_relative.c | 7 +++-- contrib/nvi/vi/vs_smap.c | 4 +-- usr.bin/vi/catalog/Makefile | 3 +- usr.bin/vi/pathnames.h | 5 ++-- 45 files changed, 243 insertions(+), 147 deletions(-) diff --git a/contrib/nvi/CMakeLists.txt b/contrib/nvi/CMakeLists.txt index 00f43283f022..996e0e72de99 100644 --- a/contrib/nvi/CMakeLists.txt +++ b/contrib/nvi/CMakeLists.txt @@ -13,6 +13,7 @@ project(nvi2 C) include(CheckIncludeFiles) include(CheckFunctionExists) +include(CheckStructHasMember) include(CheckCSourceCompiles) mark_as_advanced(CMAKE_INSTALL_PREFIX) @@ -127,6 +128,7 @@ endif() if(USE_WIDECHAR) find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib) # link to the wchar_t awared BSD libregex.a add_library(regex STATIC) @@ -136,13 +138,14 @@ if(USE_WIDECHAR) target_link_libraries(nvi PRIVATE regex) else() find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + find_library(TERMINFO_LIBRARY NAMES tinfo terminfo HINTS /usr/lib) target_compile_options(nvi PRIVATE -Wno-pointer-sign) endif() -target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY}) if(USE_ICONV) - check_function_exists(__iconv ICONV_IN_LIBC) + check_function_exists(iconv ICONV_IN_LIBC) if(NOT ICONV_IN_LIBC) find_path(ICONV_INCLUDE_DIR iconv.h) find_library(ICONV_LIBRARY iconv) @@ -173,9 +176,26 @@ if(USE_ICONV) target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) endif() +check_function_exists(getprogname GETPROGNAME_IN_LIBC) +check_function_exists(strlcpy STRLCPY_IN_LIBC) +if(NOT GETPROGNAME_IN_LIBC OR NOT STRLCPY_IN_LIBC) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBBSD libbsd-overlay) + add_definitions(${LIBBSD_CFLAGS}) + target_link_libraries(nvi PRIVATE ${LIBBSD_LIBRARIES}) +endif() + +check_function_exists(dbopen DBOPEN_IN_LIBC) +if(NOT DBOPEN_IN_LIBC) + target_link_libraries(nvi PRIVATE db1) +endif() + check_include_files(libutil.h HAVE_LIBUTIL_H) check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H) +check_include_files(pty.h HAVE_PTY_H) check_include_files(term.h HAVE_TERM_H) +check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C) configure_file(files/config.h.in config.h) diff --git a/contrib/nvi/catalog/dump.c b/contrib/nvi/catalog/dump.c index 74ab53b2f12c..8390e5022841 100644 --- a/contrib/nvi/catalog/dump.c +++ b/contrib/nvi/catalog/dump.c @@ -36,24 +36,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) { \ +#define TESTD(s) do { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} -#define TESTP { \ +} while (0) +#define TESTP do { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} -#define MOVEC(t) { \ +} while (0) +#define MOVEC(t) do { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} +} while (0) for (;;) { MOVEC('"'); TESTD(s1); diff --git a/contrib/nvi/cl/cl.h b/contrib/nvi/cl/cl.h index 894e5ede7fa9..d230a55a56d7 100644 --- a/contrib/nvi/cl/cl.h +++ b/contrib/nvi/cl/cl.h @@ -10,7 +10,9 @@ #ifdef USE_WIDECHAR #define _XOPEN_SOURCE_EXTENDED #endif -#ifdef HAVE_NCURSES_H +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#elif defined HAVE_NCURSES_H #include #else #include diff --git a/contrib/nvi/cl/cl_read.c b/contrib/nvi/cl/cl_read.c index f5f18fd616f1..ddf3acc1918c 100644 --- a/contrib/nvi/cl/cl_read.c +++ b/contrib/nvi/cl/cl_read.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/contrib/nvi/cl/cl_term.c b/contrib/nvi/cl/cl_term.c index 601460585530..106f37149565 100644 --- a/contrib/nvi/cl/cl_term.c +++ b/contrib/nvi/cl/cl_term.c @@ -424,16 +424,18 @@ cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t *colp, int *changedp) if (row == 0 || col == 0) { if ((p = getenv("TERM")) == NULL) goto noterm; - if (row == 0) + if (row == 0) { if ((rval = tigetnum("lines")) < 0) msgq(sp, M_SYSERR, "tigetnum: lines"); else row = rval; - if (col == 0) + } + if (col == 0) { if ((rval = tigetnum("cols")) < 0) msgq(sp, M_SYSERR, "tigetnum: cols"); else col = rval; + } } /* If nothing else, well, it's probably a VT100. */ diff --git a/contrib/nvi/common/common.h b/contrib/nvi/common/common.h index 256fe6a0029a..dc4155610225 100644 --- a/contrib/nvi/common/common.h +++ b/contrib/nvi/common/common.h @@ -7,7 +7,15 @@ * See the LICENSE file for redistribution information. */ -#include /* Only include db1. */ +#ifndef TCSASOFT +#define TCSASOFT 0 +#endif + +#ifdef __linux__ +#include "/usr/include/db1/db.h" /* Only include db1. */ +#else +#include "/usr/include/db.h" /* Only include db1. */ +#endif #include /* May refer to the bundled regex. */ /* diff --git a/contrib/nvi/common/cut.h b/contrib/nvi/common/cut.h index d220cd8cc69c..a94c3f9ce58d 100644 --- a/contrib/nvi/common/cut.h +++ b/contrib/nvi/common/cut.h @@ -63,13 +63,13 @@ struct _text { /* Text: a linked list of lines. */ * Get named buffer 'name'. * Translate upper-case buffer names to lower-case buffer names. */ -#define CBNAME(sp, cbp, nch) { \ +#define CBNAME(sp, cbp, nch) do { \ CHAR_T L__name; \ L__name = isupper(nch) ? tolower(nch) : (nch); \ SLIST_FOREACH(cbp, sp->gp->cutq, q) \ if (cbp->name == L__name) \ break; \ -} +} while (0) /* Flags to the cut() routine. */ #define CUT_LINEMODE 0x01 /* Cut in line mode. */ diff --git a/contrib/nvi/common/exf.c b/contrib/nvi/common/exf.c index ccfa66ef4089..f9eb2150276d 100644 --- a/contrib/nvi/common/exf.c +++ b/contrib/nvi/common/exf.c @@ -199,7 +199,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags) if (!LF_ISSET(FS_OPENERR)) F_SET(frp, FR_NEWFILE); - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } else { /* * XXX @@ -218,7 +218,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags) ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; if (!S_ISREG(sb.st_mode)) msgq_str(sp, M_ERR, oname, @@ -796,7 +796,7 @@ file_write(SCR *sp, MARK *fm, MARK *tm, char *name, int flags) if (noname && !LF_ISSET(FS_FORCE | FS_APPEND) && ((F_ISSET(ep, F_DEVSET) && (sb.st_dev != ep->mdev || sb.st_ino != ep->minode)) || - timespeccmp(&sb.st_mtimespec, &ep->mtim, !=))) { + timespeccmp(&sb.st_mtim, &ep->mtim, !=))) { msgq_str(sp, M_ERR, name, LF_ISSET(FS_POSSIBLE) ? "250|%s: file modified more recently than this copy; use ! to override" : "251|%s: file modified more recently than this copy"); @@ -887,7 +887,7 @@ success_open: * we re-init the time. That way the user can clean up the disk * and rewrite without having to force it. */ - if (noname) + if (noname) { if (stat(name, &sb)) timepoint_system(&ep->mtim); else { @@ -895,8 +895,9 @@ success_open: ep->mdev = sb.st_dev; ep->minode = sb.st_ino; - ep->mtim = sb.st_mtimespec; + ep->mtim = sb.st_mtim; } + } /* * If the write failed, complain loudly. ex_writefp() has already @@ -925,11 +926,12 @@ success_open: */ if (LF_ISSET(FS_ALL) && !LF_ISSET(FS_APPEND)) { F_CLR(ep, F_MODIFIED); - if (F_ISSET(frp, FR_TMPFILE)) + if (F_ISSET(frp, FR_TMPFILE)) { if (noname) F_SET(frp, FR_TMPEXIT); else F_CLR(frp, FR_TMPEXIT); + } } p = msg_print(sp, name, &nf); @@ -1290,7 +1292,7 @@ file_m1(SCR *sp, int force, int flags) * unless force is also set. Otherwise, we fail unless forced or * there's another open screen on this file. */ - if (F_ISSET(ep, F_MODIFIED)) + if (F_ISSET(ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (!force && file_aw(sp, flags)) return (1); @@ -1300,6 +1302,7 @@ file_m1(SCR *sp, int force, int flags) "263|File modified since last complete write; write or use :edit! to override"); return (1); } + } return (file_m3(sp, force)); } diff --git a/contrib/nvi/common/key.c b/contrib/nvi/common/key.c index 23da0498a757..e71396893fd4 100644 --- a/contrib/nvi/common/key.c +++ b/contrib/nvi/common/key.c @@ -424,12 +424,12 @@ v_event_append(SCR *sp, EVENT *argp) } /* Remove events from the queue. */ -#define QREM(len) { \ +#define QREM(len) do { \ if ((gp->i_cnt -= len) == 0) \ gp->i_next = 0; \ else \ gp->i_next += len; \ -} +} while (0) /* * v_event_get -- diff --git a/contrib/nvi/common/log.c b/contrib/nvi/common/log.c index 5dcd9a2945fc..96b246efad02 100644 --- a/contrib/nvi/common/log.c +++ b/contrib/nvi/common/log.c @@ -69,10 +69,10 @@ static int apply_with(int (*)(SCR *, recno_t, CHAR_T *, size_t), SCR *, recno_t, u_char *, size_t); /* Try and restart the log on failure, i.e. if we run out of memory. */ -#define LOG_ERR { \ +#define LOG_ERR do { \ log_err(sp, __FILE__, __LINE__); \ return (1); \ -} +} while (0) /* offset of CHAR_T string in log needs to be aligned on some systems * because it is passed to db_set as a string diff --git a/contrib/nvi/common/main.c b/contrib/nvi/common/main.c index c0b81960bd55..a7e60f1af806 100644 --- a/contrib/nvi/common/main.c +++ b/contrib/nvi/common/main.c @@ -48,8 +48,8 @@ editor(GS *gp, int argc, char *argv[]) size_t len; u_int flags; int ch, flagchk, lflag, secure, startup, readonly, rval, silent; - char *tag_f, *wsizearg, path[256]; - CHAR_T *w; + char *tag_f, *wsizearg; + CHAR_T *w, path[256]; size_t wlen; /* Initialize the busy routine, if not defined by the screen. */ @@ -242,9 +242,9 @@ editor(GS *gp, int argc, char *argv[]) } if (wsizearg != NULL) { ARGS *av[2], a, b; - (void)snprintf(path, sizeof(path), "window=%s", wsizearg); + (void)SPRINTF(path, SIZE(path), L("window=%s"), wsizearg); a.bp = (CHAR_T *)path; - a.len = strlen(path); + a.len = SIZE(path); b.bp = NULL; b.len = 0; av[0] = &a; @@ -533,7 +533,7 @@ v_obsolete(char *argv[]) argv[0][1] = 'c'; (void)strlcpy(argv[0] + 2, p + 1, len); } - } else if (argv[0][0] == '-') + } else if (argv[0][0] == '-') { if (argv[0][1] == '\0') { argv[0] = strdup("-s"); if (argv[0] == NULL) { @@ -545,6 +545,7 @@ nomem: warn(NULL); argv[0][1] == 't' || argv[0][1] == 'w') && argv[0][2] == '\0') ++argv; + } return (0); } diff --git a/contrib/nvi/common/mark.c b/contrib/nvi/common/mark.c index 9af4612cb22a..86e3cb8ea6d9 100644 --- a/contrib/nvi/common/mark.c +++ b/contrib/nvi/common/mark.c @@ -216,12 +216,13 @@ mark_insdel(SCR *sp, lnop_t op, recno_t lno) abort(); case LINE_DELETE: SLIST_FOREACH(lmp, sp->ep->marks, q) - if (lmp->lno >= lno) + if (lmp->lno >= lno) { if (lmp->lno == lno) { F_SET(lmp, MARK_DELETED); (void)log_mark(sp, lmp); } else --lmp->lno; + } break; case LINE_INSERT: /* diff --git a/contrib/nvi/common/mem.h b/contrib/nvi/common/mem.h index 1e26a6ea6549..d24ec0b50b09 100644 --- a/contrib/nvi/common/mem.h +++ b/contrib/nvi/common/mem.h @@ -17,7 +17,7 @@ /* Increase the size of a malloc'd buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define BINC_GOTO(sp, type, lp, llen, nlen) { \ +#define BINC_GOTO(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -29,12 +29,12 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_GOTOC(sp, lp, llen, nlen) \ BINC_GOTO(sp, char, lp, llen, nlen) #define BINC_GOTOW(sp, lp, llen, nlen) \ BINC_GOTO(sp, CHAR_T, lp, llen, (nlen) * sizeof(CHAR_T)) -#define BINC_RET(sp, type, lp, llen, nlen) { \ +#define BINC_RET(sp, type, lp, llen, nlen) do { \ CHECK_TYPE(type *, lp) \ void *L__bincp; \ if ((nlen) > llen) { \ @@ -46,7 +46,7 @@ */ \ lp = L__bincp; \ } \ -} +} while (0) #define BINC_RETC(sp, lp, llen, nlen) \ BINC_RET(sp, char, lp, llen, nlen) #define BINC_RETW(sp, lp, llen, nlen) \ @@ -57,7 +57,7 @@ * from a malloc'd buffer otherwise. Two versions, one that returns, one * that jumps to an error label. */ -#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -70,12 +70,12 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_GOTOC(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, char, bp, blen, nlen) #define GET_SPACE_GOTOW(sp, bp, blen, nlen) \ GET_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define GET_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define GET_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || F_ISSET(L__gp, G_TMP_INUSE)) { \ @@ -88,7 +88,7 @@ blen = L__gp->tmp_blen; \ F_SET(L__gp, G_TMP_INUSE); \ } \ -} +} while (0) #define GET_SPACE_RETC(sp, bp, blen, nlen) \ GET_SPACE_RET(sp, char, bp, blen, nlen) #define GET_SPACE_RETW(sp, bp, blen, nlen) \ @@ -98,7 +98,7 @@ * Add space to a GET_SPACE returned buffer. Two versions, one that * returns, one that jumps to an error label. */ -#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_GOTO(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -109,12 +109,12 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_GOTO(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_GOTOC(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, char, bp, blen, nlen) #define ADD_SPACE_GOTOW(sp, bp, blen, nlen) \ ADD_SPACE_GOTO(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) -#define ADD_SPACE_RET(sp, type, bp, blen, nlen) { \ +#define ADD_SPACE_RET(sp, type, bp, blen, nlen) do { \ CHECK_TYPE(type *, bp) \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp == NULL || bp == (type *)L__gp->tmp_bp) { \ @@ -125,70 +125,70 @@ F_SET(L__gp, G_TMP_INUSE); \ } else \ BINC_RET(sp, type, bp, blen, nlen); \ -} +} while (0) #define ADD_SPACE_RETC(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, char, bp, blen, nlen) #define ADD_SPACE_RETW(sp, bp, blen, nlen) \ ADD_SPACE_RET(sp, CHAR_T, bp, blen, (nlen) * sizeof(CHAR_T)) /* Free a GET_SPACE returned buffer. */ -#define FREE_SPACE(sp, bp, blen) { \ +#define FREE_SPACE(sp, bp, blen) do { \ GS *L__gp = (sp) == NULL ? NULL : (sp)->gp; \ if (L__gp != NULL && bp == L__gp->tmp_bp) \ F_CLR(L__gp, G_TMP_INUSE); \ else \ free(bp); \ -} -#define FREE_SPACEW(sp, bp, blen) { \ +} while (0) +#define FREE_SPACEW(sp, bp, blen) do { \ CHECK_TYPE(CHAR_T *, bp) \ FREE_SPACE(sp, (char *)bp, blen); \ -} +} while (0) /* * Malloc a buffer, casting the return pointer. Various versions. */ -#define CALLOC(sp, p, nmemb, size) { \ +#define CALLOC(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define CALLOC_GOTO(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_GOTO(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) \ goto alloc_err; \ -} -#define CALLOC_RET(sp, p, nmemb, size) { \ +} while (0) +#define CALLOC_RET(sp, p, nmemb, size) do { \ if ((p = calloc(nmemb, size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) -#define MALLOC(sp, p, size) { \ +#define MALLOC(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ msgq(sp, M_SYSERR, NULL); \ -} -#define MALLOC_GOTO(sp, p, size) { \ +} while (0) +#define MALLOC_GOTO(sp, p, size) do { \ if ((p = malloc(size)) == NULL) \ goto alloc_err; \ -} -#define MALLOC_RET(sp, p, size) { \ +} while (0) +#define MALLOC_RET(sp, p, size) do { \ if ((p = malloc(size)) == NULL) { \ msgq(sp, M_SYSERR, NULL); \ return (1); \ } \ -} +} while (0) /* * Resize a buffer, free any already held memory if we can't get more. * FreeBSD's reallocf(3) does the same thing, but it's not portable yet. */ -#define REALLOC(sp, p, cast, size) { \ +#define REALLOC(sp, p, cast, size) do { \ cast newp; \ if ((newp = realloc(p, size)) == NULL) { \ free(p); \ msgq(sp, M_SYSERR, NULL); \ } \ p = newp; \ -} +} while (0) /* * p2roundup -- diff --git a/contrib/nvi/common/msg.c b/contrib/nvi/common/msg.c index d2463a3ecccd..7499f451be59 100644 --- a/contrib/nvi/common/msg.c +++ b/contrib/nvi/common/msg.c @@ -731,7 +731,11 @@ msg_open(SCR *sp, char *file) * corrupt catalog file. Errno == 0 is not rare; add * EFTYPE, which is seen on FreeBSD, for a good measure. */ +#ifdef EFTYPE if (errno == 0 || errno == EFTYPE) +#else + if (errno == 0) +#endif msgq_str(sp, M_ERR, p, "030|The file %s is not a message catalog"); else diff --git a/contrib/nvi/common/options.c b/contrib/nvi/common/options.c index 25b10fe67012..d5c039f97228 100644 --- a/contrib/nvi/common/options.c +++ b/contrib/nvi/common/options.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "common.h" @@ -312,7 +313,7 @@ opts_init(SCR *sp, int *oargs) argv[1] = &b; /* Set numeric and string default values. */ -#define OI(indx, str) { \ +#define OI(indx, str) do { \ a.len = STRLEN(str); \ if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ (void)MEMCPY(b2, str, a.len+1); \ @@ -320,7 +321,7 @@ opts_init(SCR *sp, int *oargs) optindx = indx; \ goto err; \ } \ -} +} while (0) /* * Indirect global options to global space. Specifically, set up * terminal, lines, columns first, they're used by other options. @@ -366,7 +367,7 @@ opts_init(SCR *sp, int *oargs) OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); OI(O_PATH, b2); - (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); + (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), NVI_PATH_PRESERVE); OI(O_RECDIR, b2); OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); (void)SPRINTF(b2, SIZE(b2), @@ -573,13 +574,14 @@ opts_set(SCR *sp, ARGS *argv[], char *usage) * functions can be expensive. */ isset = !turnoff; - if (!F_ISSET(op, OPT_ALWAYS)) + if (!F_ISSET(op, OPT_ALWAYS)) { if (isset) { if (O_ISSET(sp, offset)) break; } else if (!O_ISSET(sp, offset)) break; + } /* Report to subsystems. */ if ((op->func != NULL && @@ -945,6 +947,7 @@ static int opts_print(SCR *sp, OPTLIST const *op) { int curlen, offset; + const char *p; curlen = 0; offset = op - optlist; @@ -958,8 +961,13 @@ opts_print(SCR *sp, OPTLIST const *op) curlen += ex_printf(sp, WS"=%ld", op->name, O_VAL(sp, offset)); break; case OPT_STR: - curlen += ex_printf(sp, WS"=\"%s\"", op->name, - O_STR(sp, offset) == NULL ? "" : O_STR(sp, offset)); + curlen += ex_printf(sp, WS"=\"", op->name); + p = O_STR(sp, offset); + /* Keep correct count for unprintable character sequences */ + if (p != NULL) + for (; *p != '\0'; ++p) + curlen += ex_puts(sp, unctrl(*p)); + curlen += ex_puts(sp, "\""); break; } return (curlen); diff --git a/contrib/nvi/common/put.c b/contrib/nvi/common/put.c index 26a67ac8711c..f39948808e7d 100644 --- a/contrib/nvi/common/put.c +++ b/contrib/nvi/common/put.c @@ -39,7 +39,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *rp, int append) CHAR_T *bp, *t; CHAR_T *p; - if (cbp == NULL) + if (cbp == NULL) { if (namep == NULL) { cbp = sp->gp->dcbp; if (cbp == NULL) { @@ -56,6 +56,7 @@ put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *rp, int append) return (1); } } + } tp = TAILQ_FIRST(cbp->textq); /* diff --git a/contrib/nvi/common/recover.c b/contrib/nvi/common/recover.c index 89f25a4146e9..120cf4f60b19 100644 --- a/contrib/nvi/common/recover.c +++ b/contrib/nvi/common/recover.c @@ -421,7 +421,7 @@ rcv_mailfile(SCR *sp, int issync, char *cp_path) getprogname(), " -r ", qt); free(qt); free(host); - if (buf == NULL) { + if (len == -1) { msgq(sp, M_SYSERR, NULL); goto err; } @@ -701,7 +701,7 @@ rcv_read(SCR *sp, FREF *frp) /* If we've found more than one, take the most recent. */ (void)fstat(fileno(fp), &sb); if (recp == NULL || - timespeccmp(&rec_mtim, &sb.st_mtimespec, <)) { + timespeccmp(&rec_mtim, &sb.st_mtim, <)) { p = recp; t = pathp; recp = recpath; @@ -710,7 +710,7 @@ rcv_read(SCR *sp, FREF *frp) free(p); free(t); } - rec_mtim = sb.st_mtimespec; + rec_mtim = sb.st_mtim; if (sv_fd != -1) (void)close(sv_fd); sv_fd = dup(fileno(fp)); @@ -813,8 +813,7 @@ rcv_email(SCR *sp, char *fname) { char *buf; - (void)asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname); - if (buf == NULL) { + if (asprintf(&buf, _PATH_SENDMAIL " -odb -t < %s", fname) == -1) { msgq_str(sp, M_ERR, strerror(errno), "071|not sending email: %s"); return; diff --git a/contrib/nvi/common/util.c b/contrib/nvi/common/util.c index 1e87c6293550..8046ce373016 100644 --- a/contrib/nvi/common/util.c +++ b/contrib/nvi/common/util.c @@ -111,8 +111,9 @@ join(char *path1, char *path2) if (path1[0] == '\0' || path2[0] == '/') return strdup(path2); - (void)asprintf(&p, path1[strlen(path1)-1] == '/' ? - "%s%s" : "%s/%s", path1, path2); + if (asprintf(&p, path1[strlen(path1)-1] == '/' ? + "%s%s" : "%s/%s", path1, path2) == -1) + return NULL; return p; } @@ -140,8 +141,13 @@ expanduser(char *str) continue; if (t == p) { /* ~ */ +#ifdef __GLIBC__ + extern char *secure_getenv(const char *); + if ((h = secure_getenv("HOME")) == NULL) { +#else if (issetugid() != 0 || (h = getenv("HOME")) == NULL) { +#endif if (((h = getlogin()) != NULL && (pwd = getpwnam(h)) != NULL) || (pwd = getpwuid(getuid())) != NULL) diff --git a/contrib/nvi/ex/ex.c b/contrib/nvi/ex/ex.c index c93d49717b22..343131537afa 100644 --- a/contrib/nvi/ex/ex.c +++ b/contrib/nvi/ex/ex.c @@ -811,13 +811,14 @@ skip_srch: if (ecp->cmd == &cmds[C_VISUAL_EX] && F_ISSET(sp, SC_VI)) * this isn't a particularly complex trap, and if backslashes were * legal in set commands, this would have to be much more complicated. */ - if (ecp->cmd == &cmds[C_SET]) + if (ecp->cmd == &cmds[C_SET]) { for (p = ecp->cp, len = ecp->clen; len > 0; --len, ++p) if (IS_ESCAPE(sp, ecp, *p) && len > 1) { --len; ++p; } else if (*p == '\\') *p = CH_LITERAL; + } /* * Set the default addresses. It's an error to specify an address for @@ -1254,7 +1255,7 @@ addr_verify: ex_badaddr(sp, ecp->cmd, A_ZERO, NUM_OK); goto err; } - } else if (!db_exist(sp, ecp->addr2.lno)) + } else if (!db_exist(sp, ecp->addr2.lno)) { if (FL_ISSET(ecp->iflags, E_C_COUNT)) { if (db_last(sp, &lno)) goto err; @@ -1263,6 +1264,7 @@ addr_verify: ex_badaddr(sp, NULL, A_EOF, NUM_OK); goto err; } + } /* FALLTHROUGH */ case 1: if (ecp->addr1.lno == 0) { @@ -2117,7 +2119,7 @@ ex_load(SCR *sp) /* If it's a global/v command, fix up the last line. */ if (FL_ISSET(ecp->agv_flags, - AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) + AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) { if (db_exist(sp, ecp->range_lno)) sp->lno = ecp->range_lno; else { @@ -2126,6 +2128,7 @@ ex_load(SCR *sp) if (sp->lno == 0) sp->lno = 1; } + } free(ecp->o_cp); } diff --git a/contrib/nvi/ex/ex.h b/contrib/nvi/ex/ex.h index 5ccf7c6c362b..b2d8ad0f4fef 100644 --- a/contrib/nvi/ex/ex.h +++ b/contrib/nvi/ex/ex.h @@ -55,12 +55,12 @@ extern EXCMDLIST const cmds[]; /* Table of ex commands. */ * at any time, and most of them won't work well if a file hasn't yet been read * in. Historic vi generally took the easy way out and dropped core. */ -#define NEEDFILE(sp, cmdp) { \ +#define NEEDFILE(sp, cmdp) do { \ if ((sp)->ep == NULL) { \ ex_wemsg(sp, (cmdp)->cmd->name, EXM_NOFILEYET); \ return (1); \ } \ -} +} while (0) /* Range structures for global and @ commands. */ typedef struct _range RANGE; @@ -102,12 +102,12 @@ struct _excmd { u_int8_t agv_flags; /* Clear the structure before each ex command. */ -#define CLEAR_EX_CMD(cmdp) { \ +#define CLEAR_EX_CMD(cmdp) do { \ u_int32_t L__f = F_ISSET(cmdp, E_PRESERVE); \ memset(&((cmdp)->buffer), 0, ((char *)&(cmdp)->flags - \ (char *)&((cmdp)->buffer)) + sizeof((cmdp)->flags)); \ F_SET(cmdp, L__f); \ -} +} while (0) CHAR_T buffer; /* Command: named buffer. */ recno_t lineno; /* Command: line number. */ diff --git a/contrib/nvi/ex/ex_argv.c b/contrib/nvi/ex/ex_argv.c index d6f9a8bb8aa5..8b1fd7858fb1 100644 --- a/contrib/nvi/ex/ex_argv.c +++ b/contrib/nvi/ex/ex_argv.c @@ -611,9 +611,17 @@ argv_flt_path(SCR *sp, EXCMD *excp, CHAR_T *path, size_t plen) if (nlen == 0) { if (dp->d_name[0] == '.') continue; +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif } else { +#ifdef HAVE_DIRENT_D_NAMLEN len = dp->d_namlen; +#else + len = strlen(dp->d_name); +#endif if (len < nlen || memcmp(dp->d_name, name, nlen)) continue; } diff --git a/contrib/nvi/ex/ex_bang.c b/contrib/nvi/ex/ex_bang.c index ff2b39bbff9a..c5744708664a 100644 --- a/contrib/nvi/ex/ex_bang.c +++ b/contrib/nvi/ex/ex_bang.c @@ -96,7 +96,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) */ if (cmdp->addrcnt == 0) { msg = NULL; - if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) + if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (file_aw(sp, FS_ALL)) return (0); @@ -105,6 +105,7 @@ ex_bang(SCR *sp, EXCMD *cmdp) msg = msg_cat(sp, "303|File modified since last write.", NULL); + } /* If we're still in a vi screen, move out explicitly. */ INT2CHAR(sp, ap->bp, ap->len+1, np, nlen); diff --git a/contrib/nvi/ex/ex_cscope.c b/contrib/nvi/ex/ex_cscope.c index 629861d55680..74d7f8af95be 100644 --- a/contrib/nvi/ex/ex_cscope.c +++ b/contrib/nvi/ex/ex_cscope.c @@ -261,7 +261,7 @@ cscope_add(SCR *sp, EXCMD *cmdp, CHAR_T *dname) csc->dname = csc->buf; csc->dlen = len; memcpy(csc->dname, np, len); - csc->mtim = sb.st_mtimespec; + csc->mtim = sb.st_mtim; /* Get the search paths for the cscope. */ if (get_paths(sp, csc)) @@ -411,7 +411,8 @@ err: if (to_cs[0] != -1) free(dn); goto nomem; } - (void)asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn); + if (asprintf(&cmd, CSCOPE_CMD_FMT, dn, dbn) == -1) + cmd = NULL; free(dbn); free(dn); if (cmd == NULL) { @@ -812,7 +813,7 @@ csc_file(SCR *sp, CSC *csc, char *name, char **dirp, size_t *dlenp, int *isolder *dirp = *pp; *dlenp = strlen(*pp); *isolderp = timespeccmp( - &sb.st_mtimespec, &csc->mtim, <); + &sb.st_mtim, &csc->mtim, <); return; } free(buf); @@ -843,7 +844,7 @@ csc_help(SCR *sp, char *cmd) { CC const *ccp; - if (cmd != NULL && *cmd != '\0') + if (cmd != NULL && *cmd != '\0') { if ((ccp = lookup_ccmd(cmd)) == NULL) { ex_printf(sp, "%s doesn't match any cscope command\n", cmd); @@ -854,6 +855,7 @@ csc_help(SCR *sp, char *cmd) *** 675 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:06 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 ED8906AFCE0; Wed, 22 Sep 2021 10:31:06 +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 4HDvhp1S49z4tKW; Wed, 22 Sep 2021 10:31:06 +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 613CF15FB3; Wed, 22 Sep 2021 10:31:04 +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 18MAV4GN009236; Wed, 22 Sep 2021 10:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV4vW009235; Wed, 22 Sep 2021 10:31:04 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:04 GMT Message-Id: <202109221031.18MAV4vW009235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: ee3ebf390811 - stable/12 - vi(1): Add URL to the vi/ex reference manual in the man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ee3ebf390811f23f3215770dea037c1e2264a981 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, 22 Sep 2021 10:31:07 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ee3ebf390811f23f3215770dea037c1e2264a981 commit ee3ebf390811f23f3215770dea037c1e2264a981 Author: Fernando Apesteguía AuthorDate: 2020-09-25 10:20:12 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:27:46 +0000 vi(1): Add URL to the vi/ex reference manual in the man page Reported in PR 241985 The manual page references the "vi/ex reference manual" but there is no information about where to find that document. Add a reference to the manual in the SEE ALSO section since the Project hosts a copy of it[1]. Change sent upstream[2] If D26158 gets reviewed and committed, we could close that PR. [1] https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf). [2] https://github.com/lichray/nvi2/pull/85 Submitted by: freebsd@tim.thechases.com Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26163 (cherry picked from commit f1cba2b70cd1f705d7b878e7b8d9f99fe389dc7a) --- contrib/nvi/man/vi.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/nvi/man/vi.1 b/contrib/nvi/man/vi.1 index fcbc1531d9ac..8c75e9e66a33 100644 --- a/contrib/nvi/man/vi.1 +++ b/contrib/nvi/man/vi.1 @@ -12,7 +12,7 @@ .\" that you would have purchased it, or if any company wishes to .\" redistribute it, contributions to the authors would be appreciated. .\" -.Dd November 2, 2013 +.Dd September 25, 2020 .Dt VI 1 .Os .Sh NAME @@ -2743,6 +2743,10 @@ and \*(Gt0 if an error occurs. .Xr ctags 1 , .Xr iconv 1 , .Xr re_format 7 +.Rs +.%T vi/ex reference manual +.%U https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf +.Re .Sh STANDARDS .Nm nex Ns / Ns Nm nvi is close to From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:09 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 C88916AF8F9; Wed, 22 Sep 2021 10:31: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 4HDvhs3WT3z4t8m; Wed, 22 Sep 2021 10:31:09 +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 A8A9615BE8; Wed, 22 Sep 2021 10:31:06 +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 18MAV6uW009291; Wed, 22 Sep 2021 10:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV6kY009290; Wed, 22 Sep 2021 10:31:06 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:06 GMT Message-Id: <202109221031.18MAV6kY009290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: f7419feda999 - stable/12 - Fix buildworld on Linux/macOS after nvi update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f7419feda99979db61a7d24d61c2cfe4ed89e206 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, 22 Sep 2021 10:31:10 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f7419feda99979db61a7d24d61c2cfe4ed89e206 commit f7419feda99979db61a7d24d61c2cfe4ed89e206 Author: Alex Richardson AuthorDate: 2020-10-12 10:42:24 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:28:54 +0000 Fix buildworld on Linux/macOS after nvi update This re-applies r365941 which was lost in the nvi update. (cherry picked from commit 5ce117c698bce69808f214781fe03a2c0f451d9f) --- contrib/nvi/common/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/nvi/common/common.h b/contrib/nvi/common/common.h index dc4155610225..f2cb42fa9b9c 100644 --- a/contrib/nvi/common/common.h +++ b/contrib/nvi/common/common.h @@ -14,7 +14,7 @@ #ifdef __linux__ #include "/usr/include/db1/db.h" /* Only include db1. */ #else -#include "/usr/include/db.h" /* Only include db1. */ +#include /* Only include db1. */ #endif #include /* May refer to the bundled regex. */ From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:12 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 F2ACC6AFF0B; Wed, 22 Sep 2021 10:31:12 +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 4HDvhv3jGVz4tKn; Wed, 22 Sep 2021 10:31:11 +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 E741F1619A; Wed, 22 Sep 2021 10:31: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 18MAV8Xh009341; Wed, 22 Sep 2021 10:31:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV8OE009340; Wed, 22 Sep 2021 10:31:08 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:08 GMT Message-Id: <202109221031.18MAV8OE009340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 4581de213ef4 - stable/12 - import nvi 2.2.0-3bbdfe4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4581de213ef452b0e593a7d87b930d48d64aa71d 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, 22 Sep 2021 10:31:13 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4581de213ef452b0e593a7d87b930d48d64aa71d commit 4581de213ef452b0e593a7d87b930d48d64aa71d Author: Baptiste Daroussin AuthorDate: 2021-05-21 20:50:50 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:29:20 +0000 import nvi 2.2.0-3bbdfe4 (cherry picked from commit 6680e5a52f8abf059bbbd3e0be66d9dce476cdf9) --- contrib/nvi/.gitignore | 5 + contrib/nvi/CMakeLists.txt | 38 +- contrib/nvi/cl/cl.h | 3 - contrib/nvi/cl/cl_read.c | 4 +- contrib/nvi/cl/extern.h | 31 -- contrib/nvi/common/common.h | 6 +- contrib/nvi/common/conv.h | 2 +- contrib/nvi/common/exf.c | 27 ++ contrib/nvi/common/extern.h | 131 ------- contrib/nvi/common/key.h | 6 +- contrib/nvi/common/options.h | 4 + contrib/nvi/common/recover.c | 12 + contrib/nvi/ex/ex.c | 3 +- contrib/nvi/ex/ex_cscope.c | 14 + contrib/nvi/ex/extern.h | 131 ------- contrib/nvi/man/vi.1 | 50 ++- contrib/nvi/vi/extern.h | 145 -------- contrib/nvi/vi/v_increment.c | 4 +- contrib/nvi/vi/vs_line.c | 2 +- usr.bin/vi/Makefile | 5 +- usr.bin/vi/config.h | 9 + {contrib/nvi => usr.bin/vi}/ex/version.h | 2 + {contrib/nvi/ex => usr.bin/vi}/ex_def.h | 0 usr.bin/vi/extern.h | 444 +++++++++++++++++++++++ {contrib/nvi/common => usr.bin/vi}/options_def.h | 0 25 files changed, 607 insertions(+), 471 deletions(-) diff --git a/contrib/nvi/.gitignore b/contrib/nvi/.gitignore index aac7860d7299..2b79229e57e0 100644 --- a/contrib/nvi/.gitignore +++ b/contrib/nvi/.gitignore @@ -7,3 +7,8 @@ extern.h version.h tags build/ + +# Ignore files by the GNU Global source code tagging system. +/GPATH +/GRTAGS +/GTAGS diff --git a/contrib/nvi/CMakeLists.txt b/contrib/nvi/CMakeLists.txt index 996e0e72de99..66d3ca2aafb0 100644 --- a/contrib/nvi/CMakeLists.txt +++ b/contrib/nvi/CMakeLists.txt @@ -13,20 +13,28 @@ project(nvi2 C) include(CheckIncludeFiles) include(CheckFunctionExists) +include(CheckSymbolExists) include(CheckStructHasMember) include(CheckCSourceCompiles) +include(CheckCCompilerFlag) mark_as_advanced(CMAKE_INSTALL_PREFIX) option(USE_WIDECHAR "Enable wide character support" ON) option(USE_ICONV "Enable iconv support" ON) -add_compile_options(-fcolor-diagnostics) +check_c_compiler_flag(-fcolor-diagnostics USE_FCOLOR_DIAGNOSTICS) +if(USE_FCOLOR_DIAGNOSTICS) + add_compile_options(-fcolor-diagnostics) +endif() + add_compile_options($<$:-Wall>) add_compile_options($<$:-Wno-parentheses>) add_compile_options($<$:-Wno-uninitialized>) add_compile_options($<$:-Wmissing-prototypes>) -add_compile_options($<$:-Wsystem-headers>) +if (NOT APPLE) + add_compile_options($<$:-Wsystem-headers>) +endif() add_compile_options($<$:-Wuninitialized>) add_compile_options($<$:-Wno-dangling-else>) add_compile_options(-Wstack-protector -fstack-protector) @@ -126,6 +134,11 @@ if(NOT RESOLV_IN_LIBC) target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) endif() +check_symbol_exists(asprintf "stdio.h" ASPRINTF_IN_STDIO_H) +if(NOT ASPRINTF_IN_STDIO_H) + target_compile_definitions(nvi PRIVATE _GNU_SOURCE) +endif() + if(USE_WIDECHAR) find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) find_library(TERMINFO_LIBRARY NAMES tinfow terminfo HINTS /usr/lib) @@ -142,7 +155,10 @@ else() target_compile_options(nvi PRIVATE -Wno-pointer-sign) endif() -target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY} ${TERMINFO_LIBRARY}) +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) +if(TERMINFO_LIBRARY) + target_link_libraries(nvi PRIVATE ${TERMINFO_LIBRARY}) +endif() if(USE_ICONV) check_function_exists(iconv ICONV_IN_LIBC) @@ -189,6 +205,18 @@ check_function_exists(dbopen DBOPEN_IN_LIBC) if(NOT DBOPEN_IN_LIBC) target_link_libraries(nvi PRIVATE db1) endif() +if (APPLE) + # Avoid using an incompatible db.h installed to /usr/local (since this is + # part of the default search path on macOS) + set(DB_H_GUESS "${CMAKE_OSX_SYSROOT}/usr/include/db.h") + if (NOT EXISTS ${DB_H_GUESS}) + message(FATAL_ERROR "Could not find db.h at the expected path (${DB_H_GUESS}).") + endif() + add_definitions("-DDB_H_ABS_PATH=<${DB_H_GUESS}>") +else() + find_path(DB_INCLUDE_DIR db.h PATH_SUFFIXES db1) + target_include_directories(nvi PRIVATE ${DB_INCLUDE_DIR}) +endif() check_include_files(libutil.h HAVE_LIBUTIL_H) check_include_files(ncurses.h HAVE_NCURSES_H) @@ -196,6 +224,10 @@ check_include_files(ncursesw/ncurses.h HAVE_NCURSESW_NCURSES_H) check_include_files(pty.h HAVE_PTY_H) check_include_files(term.h HAVE_TERM_H) check_struct_has_member("struct dirent" d_namlen dirent.h HAVE_DIRENT_D_NAMLEN LANGUAGE C) +check_struct_has_member("struct stat" st_mtimespec + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C) +check_struct_has_member("struct stat" st_mtim + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C) configure_file(files/config.h.in config.h) diff --git a/contrib/nvi/cl/cl.h b/contrib/nvi/cl/cl.h index d230a55a56d7..a04c9e9f1b0d 100644 --- a/contrib/nvi/cl/cl.h +++ b/contrib/nvi/cl/cl.h @@ -7,9 +7,6 @@ * See the LICENSE file for redistribution information. */ -#ifdef USE_WIDECHAR -#define _XOPEN_SOURCE_EXTENDED -#endif #ifdef HAVE_NCURSESW_NCURSES_H #include #elif defined HAVE_NCURSES_H diff --git a/contrib/nvi/cl/cl_read.c b/contrib/nvi/cl/cl_read.c index ddf3acc1918c..8dc1d3cbebc9 100644 --- a/contrib/nvi/cl/cl_read.c +++ b/contrib/nvi/cl/cl_read.c @@ -317,10 +317,10 @@ cl_resize(SCR *sp, size_t lines, size_t columns) argv[0] = &a; argv[1] = &b; - a.len = SPRINTF(b1, sizeof(b1), L("lines=%lu"), (u_long)lines); + a.len = SPRINTF(b1, SIZE(b1), L("lines=%lu"), (u_long)lines); if (opts_set(sp, argv, NULL)) return (1); - a.len = SPRINTF(b1, sizeof(b1), L("columns=%lu"), (u_long)columns); + a.len = SPRINTF(b1, SIZE(b1), L("columns=%lu"), (u_long)columns); if (opts_set(sp, argv, NULL)) return (1); return (0); diff --git a/contrib/nvi/cl/extern.h b/contrib/nvi/cl/extern.h deleted file mode 100644 index 7b01ccd3f8cf..000000000000 --- a/contrib/nvi/cl/extern.h +++ /dev/null @@ -1,31 +0,0 @@ -int cl_waddstr(SCR *, const CHAR_T *, size_t); -int cl_addstr(SCR *, const char *, size_t); -int cl_attr(SCR *, scr_attr_t, int); -int cl_baud(SCR *, u_long *); -int cl_bell(SCR *); -int cl_clrtoeol(SCR *); -int cl_cursor(SCR *, size_t *, size_t *); -int cl_deleteln(SCR *); -int cl_discard(SCR *, SCR **); -int cl_ex_adjust(SCR *, exadj_t); -int cl_insertln(SCR *); -int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *); -int cl_move(SCR *, size_t, size_t); -int cl_refresh(SCR *, int); -int cl_rename(SCR *, char *, int); -void cl_setname(GS *, char *); -int cl_split(SCR *, SCR *); -int cl_suspend(SCR *, int *); -void cl_usage(void); -int sig_init(GS *, SCR *); -int cl_event(SCR *, EVENT *, u_int32_t, int); -int cl_screen(SCR *, u_int32_t); -int cl_quit(GS *); -int cl_getcap(SCR *, char *, char **); -int cl_term_init(SCR *); -int cl_term_end(GS *); -int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); -int cl_optchange(SCR *, int, char *, u_long *); -int cl_omesg(SCR *, CL_PRIVATE *, int); -int cl_ssize(SCR *, int, size_t *, size_t *, int *); -int cl_putchar(int); diff --git a/contrib/nvi/common/common.h b/contrib/nvi/common/common.h index f2cb42fa9b9c..45f22fb49d1b 100644 --- a/contrib/nvi/common/common.h +++ b/contrib/nvi/common/common.h @@ -11,10 +11,10 @@ #define TCSASOFT 0 #endif -#ifdef __linux__ -#include "/usr/include/db1/db.h" /* Only include db1. */ +#ifdef DB_H_ABS_PATH +#include DB_H_ABS_PATH #else -#include /* Only include db1. */ +#include #endif #include /* May refer to the bundled regex. */ diff --git a/contrib/nvi/common/conv.h b/contrib/nvi/common/conv.h index ee3efb5a8308..4daa8221ff8f 100644 --- a/contrib/nvi/common/conv.h +++ b/contrib/nvi/common/conv.h @@ -28,7 +28,7 @@ typedef int iconv_t; #define KEY_NEEDSWIDE(sp, ch) \ (INTISWIDE(ch) && KEY_LEN(sp, ch) <= 4) #define KEY_COL(sp, ch) \ - (KEY_NEEDSWIDE(sp, ch) ? CHAR_WIDTH(sp, ch) : KEY_LEN(sp, ch)) + (KEY_NEEDSWIDE(sp, ch) ? XCHAR_WIDTH(sp, ch) : KEY_LEN(sp, ch)) enum { IC_FE_CHAR2INT, IC_FE_INT2CHAR, IC_IE_CHAR2INT, IC_IE_TO_UTF16 }; diff --git a/contrib/nvi/common/exf.c b/contrib/nvi/common/exf.c index f9eb2150276d..49e39c242648 100644 --- a/contrib/nvi/common/exf.c +++ b/contrib/nvi/common/exf.c @@ -199,7 +199,14 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags) if (!LF_ISSET(FS_OPENERR)) F_SET(frp, FR_NEWFILE); +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + ep->mtim = sb.st_mtimespec; +#elif defined HAVE_STRUCT_STAT_ST_MTIM ep->mtim = sb.st_mtim; +#else + ep->mtim.tv_sec = sb.st_mtime; + ep->mtim.tv_nsec = 0; +#endif } else { /* * XXX @@ -218,7 +225,14 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags) ep->mdev = sb.st_dev; ep->minode = sb.st_ino; +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + ep->mtim = sb.st_mtimespec; +#elif defined HAVE_STRUCT_STAT_ST_MTIM ep->mtim = sb.st_mtim; +#else + ep->mtim.tv_sec = sb.st_mtime; + ep->mtim.tv_nsec = 0; +#endif if (!S_ISREG(sb.st_mode)) msgq_str(sp, M_ERR, oname, @@ -796,7 +810,13 @@ file_write(SCR *sp, MARK *fm, MARK *tm, char *name, int flags) if (noname && !LF_ISSET(FS_FORCE | FS_APPEND) && ((F_ISSET(ep, F_DEVSET) && (sb.st_dev != ep->mdev || sb.st_ino != ep->minode)) || +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + timespeccmp(&sb.st_mtimespec, &ep->mtim, !=))) { +#elif defined HAVE_STRUCT_STAT_ST_MTIM timespeccmp(&sb.st_mtim, &ep->mtim, !=))) { +#else + sb.st_mtime != ep->mtim.tv_sec)) { +#endif msgq_str(sp, M_ERR, name, LF_ISSET(FS_POSSIBLE) ? "250|%s: file modified more recently than this copy; use ! to override" : "251|%s: file modified more recently than this copy"); @@ -895,7 +915,14 @@ success_open: ep->mdev = sb.st_dev; ep->minode = sb.st_ino; +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + ep->mtim = sb.st_mtimespec; +#elif defined HAVE_STRUCT_STAT_ST_MTIM ep->mtim = sb.st_mtim; +#else + ep->mtim.tv_sec = sb.st_mtime; + ep->mtim.tv_nsec = 0; +#endif } } diff --git a/contrib/nvi/common/extern.h b/contrib/nvi/common/extern.h deleted file mode 100644 index c887696080de..000000000000 --- a/contrib/nvi/common/extern.h +++ /dev/null @@ -1,131 +0,0 @@ -char * codeset(void); -void conv_init(SCR *, SCR *); -int conv_enc(SCR *, int, char *); -void conv_end(SCR *); -int cut(SCR *, CHAR_T *, MARK *, MARK *, int); -int cut_line(SCR *, recno_t, size_t, size_t, CB *); -void cut_close(GS *); -TEXT *text_init(SCR *, const CHAR_T *, size_t, size_t); -void text_lfree(TEXTH *); -void text_free(TEXT *); -int del(SCR *, MARK *, MARK *, int); -int looks_utf8(const char *, size_t); -int looks_utf16(const char *, size_t); -int decode_utf8(const char *); -int decode_utf16(const char *, int); -FREF *file_add(SCR *, char *); -int file_init(SCR *, FREF *, char *, int); -int file_end(SCR *, EXF *, int); -int file_write(SCR *, MARK *, MARK *, char *, int); -int file_m1(SCR *, int, int); -int file_m2(SCR *, int); -int file_m3(SCR *, int); -int file_aw(SCR *, int); -void set_alt_name(SCR *, char *); -lockr_t file_lock(SCR *, char *, int, int); -int v_key_init(SCR *); -void v_key_ilookup(SCR *); -size_t v_key_len(SCR *, ARG_CHAR_T); -char *v_key_name(SCR *, ARG_CHAR_T); -e_key_t v_key_val(SCR *, ARG_CHAR_T); -int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int); -int v_event_get(SCR *, EVENT *, int, u_int32_t); -void v_event_err(SCR *, EVENT *); -int v_event_flush(SCR *, u_int); -int db_eget(SCR *, recno_t, CHAR_T **, size_t *, int *); -int db_get(SCR *, recno_t, u_int32_t, CHAR_T **, size_t *); -int db_delete(SCR *, recno_t); -int db_append(SCR *, int, recno_t, CHAR_T *, size_t); -int db_insert(SCR *, recno_t, CHAR_T *, size_t); -int db_set(SCR *, recno_t, CHAR_T *, size_t); -int db_exist(SCR *, recno_t); -int db_last(SCR *, recno_t *); -int db_rget(SCR *, recno_t, char **, size_t *); -int db_rset(SCR *, recno_t, char *, size_t); -void db_err(SCR *, recno_t); -int log_init(SCR *, EXF *); -int log_end(SCR *, EXF *); -int log_cursor(SCR *); -int log_line(SCR *, recno_t, u_int); -int log_mark(SCR *, LMARK *); -int log_backward(SCR *, MARK *); -int log_setline(SCR *); -int log_forward(SCR *, MARK *); -int editor(GS *, int, char *[]); -void v_end(GS *); -int mark_init(SCR *, EXF *); -int mark_end(SCR *, EXF *); -int mark_get(SCR *, ARG_CHAR_T, MARK *, mtype_t); -int mark_set(SCR *, ARG_CHAR_T, MARK *, int); -int mark_insdel(SCR *, lnop_t, recno_t); -void msgq(SCR *, mtype_t, const char *, ...); -void msgq_wstr(SCR *, mtype_t, const CHAR_T *, const char *); -void msgq_str(SCR *, mtype_t, const char *, const char *); -void mod_rpt(SCR *); -void msgq_status(SCR *, recno_t, u_int); -int msg_open(SCR *, char *); -void msg_close(GS *); -const char *msg_cmsg(SCR *, cmsg_t, size_t *); -const char *msg_cat(SCR *, const char *, size_t *); -char *msg_print(SCR *, const char *, int *); -int opts_init(SCR *, int *); -int opts_set(SCR *, ARGS *[], char *); -int o_set(SCR *, int, u_int, char *, u_long); -int opts_empty(SCR *, int, int); -void opts_dump(SCR *, enum optdisp); -int opts_save(SCR *, FILE *); -OPTLIST const *opts_search(CHAR_T *); -void opts_nomatch(SCR *, CHAR_T *); -int opts_copy(SCR *, SCR *); -void opts_free(SCR *); -int f_altwerase(SCR *, OPTION *, char *, u_long *); -int f_columns(SCR *, OPTION *, char *, u_long *); -int f_lines(SCR *, OPTION *, char *, u_long *); -int f_lisp(SCR *, OPTION *, char *, u_long *); -int f_msgcat(SCR *, OPTION *, char *, u_long *); -int f_print(SCR *, OPTION *, char *, u_long *); -int f_readonly(SCR *, OPTION *, char *, u_long *); -int f_recompile(SCR *, OPTION *, char *, u_long *); -int f_reformat(SCR *, OPTION *, char *, u_long *); -int f_ttywerase(SCR *, OPTION *, char *, u_long *); -int f_w300(SCR *, OPTION *, char *, u_long *); -int f_w1200(SCR *, OPTION *, char *, u_long *); -int f_w9600(SCR *, OPTION *, char *, u_long *); -int f_window(SCR *, OPTION *, char *, u_long *); -int f_encoding(SCR *, OPTION *, char *, u_long *); -int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int); -int rcv_tmp(SCR *, EXF *, char *); -int rcv_init(SCR *); -int rcv_sync(SCR *, u_int); -int rcv_list(SCR *); -int rcv_read(SCR *, FREF *); -int screen_init(GS *, SCR *, SCR **); -int screen_end(SCR *); -SCR *screen_next(SCR *); -int f_search(SCR *, - MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int); -int b_search(SCR *, - MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int); -void search_busy(SCR *, busy_t); -int seq_set(SCR *, CHAR_T *, - size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int); -int seq_delete(SCR *, CHAR_T *, size_t, seq_t); -int seq_free(SEQ *); -SEQ *seq_find - (SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *); -void seq_close(GS *); -int seq_dump(SCR *, seq_t, int); -int seq_save(SCR *, FILE *, char *, seq_t); -int e_memcmp(CHAR_T *, EVENT *, size_t); -void *binc(SCR *, void *, size_t *, size_t); -int nonblank(SCR *, recno_t, size_t *); -char *join(char *, char *); -char *expanduser(char *); -char *quote(char *); -char *v_strdup(SCR *, const char *, size_t); -CHAR_T *v_wstrdup(SCR *, const CHAR_T *, size_t); -enum nresult nget_uslong(u_long *, const CHAR_T *, CHAR_T **, int); -enum nresult nget_slong(long *, const CHAR_T *, CHAR_T **, int); -void timepoint_steady(struct timespec *); -void timepoint_system(struct timespec *); -void TRACE(SCR *, const char *, ...); diff --git a/contrib/nvi/common/key.h b/contrib/nvi/common/key.h index 3e55d3044129..ae0ba92d1ce5 100644 --- a/contrib/nvi/common/key.h +++ b/contrib/nvi/common/key.h @@ -22,8 +22,8 @@ sp->conv.input2int(sp, n, nlen, &(cw), &wlen, &w) #define CONST #define INTISWIDE(c) (wctob(c) == EOF) -#define CHAR_WIDTH(sp, ch) wcwidth(ch) -#define CAN_PRINT(sp, ch) (CHAR_WIDTH(sp, ch) > 0) +#define XCHAR_WIDTH(sp, ch) wcwidth(ch) +#define CAN_PRINT(sp, ch) (XCHAR_WIDTH(sp, ch) > 0) #else #define FILE2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) @@ -37,7 +37,7 @@ (w = n, wlen = nlen, 0) #define CONST const #define INTISWIDE(c) 0 -#define CHAR_WIDTH(sp, ch) 1 +#define XCHAR_WIDTH(sp, ch) 1 #define CAN_PRINT(sp, ch) isprint(ch) #endif #define FILE2INT(sp,n,nlen,w,wlen) \ diff --git a/contrib/nvi/common/options.h b/contrib/nvi/common/options.h index 5ed12d39c342..d723a51217bc 100644 --- a/contrib/nvi/common/options.h +++ b/contrib/nvi/common/options.h @@ -97,4 +97,8 @@ enum optdisp { NO_DISPLAY, ALL_DISPLAY, CHANGED_DISPLAY, SELECT_DISPLAY }; /* Options array. */ extern OPTLIST const optlist[]; +#ifdef O_PATH +#undef O_PATH /* bits/fcntl-linux.h may have defined O_PATH. */ +#endif + #include "options_def.h" diff --git a/contrib/nvi/common/recover.c b/contrib/nvi/common/recover.c index 120cf4f60b19..cf222bfb5200 100644 --- a/contrib/nvi/common/recover.c +++ b/contrib/nvi/common/recover.c @@ -701,7 +701,13 @@ rcv_read(SCR *sp, FREF *frp) /* If we've found more than one, take the most recent. */ (void)fstat(fileno(fp), &sb); if (recp == NULL || +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + timespeccmp(&rec_mtim, &sb.st_mtimespec, <)) { +#elif defined HAVE_STRUCT_STAT_ST_MTIM timespeccmp(&rec_mtim, &sb.st_mtim, <)) { +#else + rec_mtim.tv_sec < sb.st_mtime) { +#endif p = recp; t = pathp; recp = recpath; @@ -710,7 +716,13 @@ rcv_read(SCR *sp, FREF *frp) free(p); free(t); } +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + rec_mtim = sb.st_mtimespec; +#elif defined HAVE_STRUCT_STAT_ST_MTIM rec_mtim = sb.st_mtim; +#else + rec_mtim.tv_sec = sb.st_mtime; +#endif if (sv_fd != -1) (void)close(sv_fd); sv_fd = dup(fileno(fp)); diff --git a/contrib/nvi/ex/ex.c b/contrib/nvi/ex/ex.c index 343131537afa..fd920a8df9a1 100644 --- a/contrib/nvi/ex/ex.c +++ b/contrib/nvi/ex/ex.c @@ -2266,7 +2266,8 @@ ex_comm_search(CHAR_T *name, size_t len) return (NULL); if (cp->name[0] != name[0]) continue; - if (!MEMCMP(name, cp->name, len)) + if (STRLEN(cp->name) >= len && + !MEMCMP(name, cp->name, len)) return (cp); } return (NULL); diff --git a/contrib/nvi/ex/ex_cscope.c b/contrib/nvi/ex/ex_cscope.c index 74d7f8af95be..e07aa64df802 100644 --- a/contrib/nvi/ex/ex_cscope.c +++ b/contrib/nvi/ex/ex_cscope.c @@ -261,7 +261,14 @@ cscope_add(SCR *sp, EXCMD *cmdp, CHAR_T *dname) csc->dname = csc->buf; csc->dlen = len; memcpy(csc->dname, np, len); +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + csc->mtim = sb.st_mtimespec; +#elif defined HAVE_STRUCT_STAT_ST_MTIM csc->mtim = sb.st_mtim; +#else + csc->mtim.tv_sec = sb.st_mtime; + csc->mtim.tv_nsec = 0; +#endif /* Get the search paths for the cscope. */ if (get_paths(sp, csc)) @@ -812,8 +819,15 @@ csc_file(SCR *sp, CSC *csc, char *name, char **dirp, size_t *dlenp, int *isolder free(buf); *dirp = *pp; *dlenp = strlen(*pp); +#if defined HAVE_STRUCT_STAT_ST_MTIMESPEC + *isolderp = timespeccmp( + &sb.st_mtimespec, &csc->mtim, <); +#elif defined HAVE_STRUCT_STAT_ST_MTIM *isolderp = timespeccmp( &sb.st_mtim, &csc->mtim, <); +#else + *isolderp = sb.st_mtime < csc->mtim.tv_sec; +#endif return; } free(buf); diff --git a/contrib/nvi/ex/extern.h b/contrib/nvi/ex/extern.h deleted file mode 100644 index 9d7b1d674c3c..000000000000 --- a/contrib/nvi/ex/extern.h +++ /dev/null @@ -1,131 +0,0 @@ -int ex(SCR **); -int ex_cmd(SCR *); -int ex_range(SCR *, EXCMD *, int *); -int ex_is_abbrev(CHAR_T *, size_t); -int ex_is_unmap(CHAR_T *, size_t); -void ex_badaddr - (SCR *, EXCMDLIST const *, enum badaddr, enum nresult); -int ex_abbr(SCR *, EXCMD *); -int ex_unabbr(SCR *, EXCMD *); -int ex_append(SCR *, EXCMD *); -int ex_change(SCR *, EXCMD *); -int ex_insert(SCR *, EXCMD *); -int ex_next(SCR *, EXCMD *); -int ex_prev(SCR *, EXCMD *); -int ex_rew(SCR *, EXCMD *); -int ex_args(SCR *, EXCMD *); -char **ex_buildargv(SCR *, EXCMD *, char *); -int argv_init(SCR *, EXCMD *); -int argv_exp0(SCR *, EXCMD *, CHAR_T *, size_t); -int argv_exp1(SCR *, EXCMD *, CHAR_T *, size_t, int); -int argv_exp2(SCR *, EXCMD *, CHAR_T *, size_t); -int argv_exp3(SCR *, EXCMD *, CHAR_T *, size_t); -int argv_flt_ex(SCR *, EXCMD *, CHAR_T *, size_t); -int argv_free(SCR *); -int argv_flt_path(SCR *, EXCMD *, CHAR_T *, size_t); -CHAR_T *argv_esc(SCR *, EXCMD *, CHAR_T *, size_t); -CHAR_T *argv_uesc(SCR *, EXCMD *, CHAR_T *, size_t); -int ex_at(SCR *, EXCMD *); -int ex_bang(SCR *, EXCMD *); -int ex_cd(SCR *, EXCMD *); -int ex_cscope(SCR *, EXCMD *); -int cscope_end(SCR *); -int cscope_display(SCR *); -int cscope_search(SCR *, TAGQ *, TAG *); -int ex_delete(SCR *, EXCMD *); -int ex_display(SCR *, EXCMD *); -int ex_edit(SCR *, EXCMD *); -int ex_equal(SCR *, EXCMD *); -int ex_file(SCR *, EXCMD *); -int ex_filter(SCR *, - EXCMD *, MARK *, MARK *, MARK *, CHAR_T *, enum filtertype); -int ex_global(SCR *, EXCMD *); -int ex_v(SCR *, EXCMD *); -int ex_g_insdel(SCR *, lnop_t, recno_t); -int ex_screen_copy(SCR *, SCR *); -int ex_screen_end(SCR *); -int ex_optchange(SCR *, int, char *, u_long *); -int ex_exrc(SCR *); -int ex_run_str(SCR *, char *, CHAR_T *, size_t, int, int); -int ex_join(SCR *, EXCMD *); -int ex_map(SCR *, EXCMD *); -int ex_unmap(SCR *, EXCMD *); -int ex_mark(SCR *, EXCMD *); -int ex_mkexrc(SCR *, EXCMD *); -int ex_copy(SCR *, EXCMD *); -int ex_move(SCR *, EXCMD *); -int ex_open(SCR *, EXCMD *); -int ex_preserve(SCR *, EXCMD *); -int ex_recover(SCR *, EXCMD *); -int ex_list(SCR *, EXCMD *); -int ex_number(SCR *, EXCMD *); -int ex_pr(SCR *, EXCMD *); -int ex_print(SCR *, EXCMD *, MARK *, MARK *, u_int32_t); -int ex_ldisplay(SCR *, const CHAR_T *, size_t, size_t, u_int); -int ex_scprint(SCR *, MARK *, MARK *); -int ex_printf(SCR *, const char *, ...); -int ex_puts(SCR *, const char *); -int ex_fflush(SCR *sp); -int ex_put(SCR *, EXCMD *); -int ex_quit(SCR *, EXCMD *); -int ex_read(SCR *, EXCMD *); -int ex_readfp(SCR *, char *, FILE *, MARK *, recno_t *, int); -int ex_bg(SCR *, EXCMD *); -int ex_fg(SCR *, EXCMD *); -int ex_resize(SCR *, EXCMD *); -int ex_sdisplay(SCR *); -int ex_script(SCR *, EXCMD *); -int sscr_exec(SCR *, recno_t); -int sscr_input(SCR *); -int sscr_end(SCR *); -int ex_set(SCR *, EXCMD *); -int ex_shell(SCR *, EXCMD *); -int ex_exec_proc(SCR *, EXCMD *, char *, const char *, int); -int proc_wait(SCR *, long, const char *, int, int); -int ex_shiftl(SCR *, EXCMD *); -int ex_shiftr(SCR *, EXCMD *); -int ex_retab(SCR *, EXCMD *); -int ex_source(SCR *, EXCMD *); -int ex_stop(SCR *, EXCMD *); -int ex_s(SCR *, EXCMD *); -int ex_subagain(SCR *, EXCMD *); -int ex_subtilde(SCR *, EXCMD *); -int re_compile(SCR *, - CHAR_T *, size_t, CHAR_T **, size_t *, regex_t *, u_int); -void re_error(SCR *, int, regex_t *); -int ex_tag_first(SCR *, CHAR_T *); -int ex_tag_push(SCR *, EXCMD *); -int ex_tag_next(SCR *, EXCMD *); -int ex_tag_prev(SCR *, EXCMD *); -int ex_tag_nswitch(SCR *, TAG *, int); -int ex_tag_Nswitch(SCR *, TAG *, int); -int ex_tag_pop(SCR *, EXCMD *); -int ex_tag_top(SCR *, EXCMD *); -int ex_tag_display(SCR *); -int ex_tag_copy(SCR *, SCR *); -int tagq_free(SCR *, TAGQ *); -int tagq_push(SCR*, TAGQ*, int, int ); -void tag_msg(SCR *, tagmsg_t, char *); -int ex_tagf_alloc(SCR *, char *); -int ex_tag_free(SCR *); -int ex_txt(SCR *, TEXTH *, ARG_CHAR_T, u_int32_t); -int ex_undo(SCR *, EXCMD *); -int ex_help(SCR *, EXCMD *); -int ex_usage(SCR *, EXCMD *); -int ex_viusage(SCR *, EXCMD *); -void ex_cinit(SCR *, EXCMD *, int, int, recno_t, recno_t, int); -int ex_getline(SCR *, FILE *, size_t *); -int ex_ncheck(SCR *, int); -int ex_init(SCR *); -void ex_wemsg(SCR *, CHAR_T *, exm_t); -void ex_emsg(SCR *, char *, exm_t); -int ex_version(SCR *, EXCMD *); -int ex_visual(SCR *, EXCMD *); -int ex_wn(SCR *, EXCMD *); -int ex_wq(SCR *, EXCMD *); -int ex_write(SCR *, EXCMD *); -int ex_xit(SCR *, EXCMD *); -int ex_writefp(SCR *, - char *, FILE *, MARK *, MARK *, u_long *, u_long *, int); -int ex_yank(SCR *, EXCMD *); -int ex_z(SCR *, EXCMD *); diff --git a/contrib/nvi/man/vi.1 b/contrib/nvi/man/vi.1 index 8c75e9e66a33..b6eaf6964bbd 100644 --- a/contrib/nvi/man/vi.1 +++ b/contrib/nvi/man/vi.1 @@ -1809,7 +1809,8 @@ Display buffers, Cscope connections, screens or tags. .Op Ar +cmd .Op Ar file .Xc -Edit a different file. +Edit a different file. The capitalized command opens a new screen below the +current screen. .Pp .It Xo .Cm exu Ns Op Cm sage @@ -1832,7 +1833,8 @@ Display and optionally change the file name. .Xc .Nm vi mode only. -Foreground the specified screen. +Foreground the specified screen. The capitalized command opens a new screen +below the current screen. .Pp .It Xo .Op Ar range @@ -1919,7 +1921,8 @@ Write the abbreviations, editor options and maps to the specified .Op Cm !\& .Op Ar .Xc -Edit the next file from the argument list. +Edit the next file from the argument list. The capitalized command opens a +new screen below the current screen. .\" .Pp .\" .It Xo .\" .Op Ar line @@ -1940,7 +1943,8 @@ option. .Cm rev Ns Op Cm ious Ns .Op Cm !\& .Xc -Edit the previous file from the argument list. +Edit the previous file from the argument list. The capitalized command opens +a new screen below the current screen. .Pp .It Xo .Op Ar range @@ -2103,7 +2107,8 @@ character is usually .Op Cm !\& .Ar tagstring .Xc -Edit the file containing the specified tag. +Edit the file containing the specified tag. The capitalized command opens a +new screen below the current screen. .Pp .It Xo .Cm tagn Ns Op Cm ext Ns @@ -2166,15 +2171,15 @@ Enter .Nm vi . .Pp .It Xo -.Op Cm Vi Ns -.Cm i Ns Op Cm sual Ns +.Cm Vi Ns +.Op Cm sual Ns .Op Cm !\& .Op Ar +cmd .Op Ar file .Xc .Nm vi -mode only. -Edit a new file. +mode only. Edit a different file by opening a new screen below the current +screen. .Pp .It Xo .Cm viu Ns Op Cm sage @@ -2185,6 +2190,14 @@ Display usage for a command. .Pp .It Xo +.Cm vs Ns Op Cm plit +.Op Ar +cmd +.Op Ar file +.Xc +Edit a different file by opening a new screen to the right of the current +screen. +.Pp +.It Xo .Op Ar range .Cm w Ns Op Cm rite Ns .Op Cm !\& @@ -2194,8 +2207,7 @@ command. .It Xo .Op Ar range .Cm w Ns Op Cm rite -.Op Cm !\& -.Op Ar file +.Cm !\& Ns Ar shell-command .Xc .It Xo .Op Ar range @@ -2209,7 +2221,21 @@ command. .Op >> .Op Ar file .Xc -Write the file. +Write the entire file, or +.Ar range . +.Sq !\& +overwrites a different, preexisting file. +.Sq >> +appends to a file that may preexist. Whitespace followed by +.Sq !\& +pipes the file to +.Ar shell-command . +.Cm wn +moves to the next file if writing succeeds. +.Cm wq +exits the editor if writing succeeds, unless there are more files to edit; +.Sq !\& +exits regardless. .Pp .It Xo .Op Ar range diff --git a/contrib/nvi/vi/extern.h b/contrib/nvi/vi/extern.h deleted file mode 100644 index 8e145c6318ef..000000000000 --- a/contrib/nvi/vi/extern.h +++ /dev/null @@ -1,145 +0,0 @@ -int cs_init(SCR *, VCS *); -int cs_next(SCR *, VCS *); -int cs_fspace(SCR *, VCS *); -int cs_fblank(SCR *, VCS *); -int cs_prev(SCR *, VCS *); -int cs_bblank(SCR *, VCS *); -int v_at(SCR *, VICMD *); -int v_chrepeat(SCR *, VICMD *); -int v_chrrepeat(SCR *, VICMD *); -int v_cht(SCR *, VICMD *); -int v_chf(SCR *, VICMD *); -int v_chT(SCR *, VICMD *); -int v_chF(SCR *, VICMD *); -int v_delete(SCR *, VICMD *); -int v_again(SCR *, VICMD *); -int v_exmode(SCR *, VICMD *); -int v_join(SCR *, VICMD *); -int v_shiftl(SCR *, VICMD *); -int v_shiftr(SCR *, VICMD *); -int v_suspend(SCR *, VICMD *); -int v_switch(SCR *, VICMD *); -int v_tagpush(SCR *, VICMD *); -int v_tagpop(SCR *, VICMD *); -int v_filter(SCR *, VICMD *); -int v_ex(SCR *, VICMD *); -int v_ecl_exec(SCR *); -int v_increment(SCR *, VICMD *); -int v_screen_copy(SCR *, SCR *); -int v_screen_end(SCR *); -int v_optchange(SCR *, int, char *, u_long *); -int v_iA(SCR *, VICMD *); -int v_ia(SCR *, VICMD *); -int v_iI(SCR *, VICMD *); -int v_ii(SCR *, VICMD *); -int v_iO(SCR *, VICMD *); -int v_io(SCR *, VICMD *); -int v_change(SCR *, VICMD *); -int v_Replace(SCR *, VICMD *); -int v_subst(SCR *, VICMD *); -int v_left(SCR *, VICMD *); -int v_cfirst(SCR *, VICMD *); -int v_first(SCR *, VICMD *); -int v_ncol(SCR *, VICMD *); -int v_zero(SCR *, VICMD *); -int v_mark(SCR *, VICMD *); -int v_bmark(SCR *, VICMD *); -int v_fmark(SCR *, VICMD *); -int v_emark(SCR *, VICMD *); -int v_match(SCR *, VICMD *); -int v_buildmcs(SCR *, char *); -int v_paragraphf(SCR *, VICMD *); -int v_paragraphb(SCR *, VICMD *); -int v_buildps(SCR *, char *, char *); -int v_Put(SCR *, VICMD *); -int v_put(SCR *, VICMD *); -int v_redraw(SCR *, VICMD *); -int v_replace(SCR *, VICMD *); -int v_right(SCR *, VICMD *); -int v_dollar(SCR *, VICMD *); -int v_screen(SCR *, VICMD *); -int v_lgoto(SCR *, VICMD *); -int v_home(SCR *, VICMD *); -int v_middle(SCR *, VICMD *); -int v_bottom(SCR *, VICMD *); -int v_up(SCR *, VICMD *); -int v_cr(SCR *, VICMD *); -int v_down(SCR *, VICMD *); -int v_hpageup(SCR *, VICMD *); -int v_hpagedown(SCR *, VICMD *); -int v_pagedown(SCR *, VICMD *); -int v_pageup(SCR *, VICMD *); -int v_lineup(SCR *, VICMD *); -int v_linedown(SCR *, VICMD *); -int v_searchb(SCR *, VICMD *); -int v_searchf(SCR *, VICMD *); -int v_searchN(SCR *, VICMD *); -int v_searchn(SCR *, VICMD *); -int v_searchw(SCR *, VICMD *); -int v_correct(SCR *, VICMD *, int); -int v_sectionf(SCR *, VICMD *); -int v_sectionb(SCR *, VICMD *); -int v_sentencef(SCR *, VICMD *); -int v_sentenceb(SCR *, VICMD *); -int v_status(SCR *, VICMD *); -int v_tcmd(SCR *, VICMD *, ARG_CHAR_T, u_int); -int v_txt(SCR *, VICMD *, MARK *, - const CHAR_T *, size_t, ARG_CHAR_T, recno_t, u_long, u_int32_t); -int v_txt_auto(SCR *, recno_t, TEXT *, size_t, TEXT *); -int v_ulcase(SCR *, VICMD *); -int v_mulcase(SCR *, VICMD *); -int v_Undo(SCR *, VICMD *); -int v_undo(SCR *, VICMD *); -void v_eof(SCR *, MARK *); -void v_eol(SCR *, MARK *); -void v_nomove(SCR *); -void v_sof(SCR *, MARK *); -void v_sol(SCR *); -int v_isempty(CHAR_T *, size_t); -void v_emsg(SCR *, char *, vim_t); -int v_wordW(SCR *, VICMD *); -int v_wordw(SCR *, VICMD *); -int v_wordE(SCR *, VICMD *); -int v_worde(SCR *, VICMD *); -int v_wordB(SCR *, VICMD *); -int v_wordb(SCR *, VICMD *); -int v_xchar(SCR *, VICMD *); -int v_Xchar(SCR *, VICMD *); -int v_yank(SCR *, VICMD *); -int v_z(SCR *, VICMD *); -int vs_crel(SCR *, long); -int v_zexit(SCR *, VICMD *); -int vi(SCR **); -int v_curword(SCR *); -int vs_line(SCR *, SMAP *, size_t *, size_t *); -int vs_number(SCR *); -void vs_busy(SCR *, const char *, busy_t); -void vs_home(SCR *); -void vs_update(SCR *, const char *, const CHAR_T *); -void vs_msg(SCR *, mtype_t, char *, size_t); -int vs_ex_resolve(SCR *, int *); -int vs_resolve(SCR *, SCR *, int); -int vs_repaint(SCR *, EVENT *); -int vs_refresh(SCR *, int); -int vs_column(SCR *, size_t *); -size_t vs_screens(SCR *, recno_t, size_t *); -size_t vs_columns(SCR *, CHAR_T *, recno_t, size_t *, size_t *); -size_t vs_rcm(SCR *, recno_t, int); -size_t vs_colpos(SCR *, recno_t, size_t); -int vs_change(SCR *, recno_t, lnop_t); -int vs_sm_fill(SCR *, recno_t, pos_t); -int vs_sm_scroll(SCR *, MARK *, recno_t, scroll_t); -int vs_sm_1up(SCR *); -int vs_sm_1down(SCR *); -int vs_sm_next(SCR *, SMAP *, SMAP *); -int vs_sm_prev(SCR *, SMAP *, SMAP *); -int vs_sm_cursor(SCR *, SMAP **); -int vs_sm_position(SCR *, MARK *, u_long, pos_t); -recno_t vs_sm_nlines(SCR *, SMAP *, recno_t, size_t); -int vs_split(SCR *, SCR *, int); -int vs_vsplit(SCR *, SCR *); -int vs_discard(SCR *, SCR **); -int vs_fg(SCR *, SCR **, CHAR_T *, int); -int vs_bg(SCR *); -int vs_swap(SCR *, SCR **, char *); -int vs_resize(SCR *, long, adj_t); diff --git a/contrib/nvi/vi/v_increment.c b/contrib/nvi/vi/v_increment.c index 6c59836cab7e..2583d9704579 100644 --- a/contrib/nvi/vi/v_increment.c +++ b/contrib/nvi/vi/v_increment.c @@ -198,7 +198,7 @@ nonum: msgq(sp, M_ERR, "181|Cursor not in a number"); /* If we cross 0, signed numbers lose their sign. */ if (lval == 0 && ntype == fmt[SDEC]) ntype = fmt[DEC]; - nlen = SPRINTF(nbuf, sizeof(nbuf), ntype, lval); + nlen = SPRINTF(nbuf, SIZE(nbuf), ntype, lval); } else { if ((nret = nget_uslong(&ulval, t, NULL, base)) != NUM_OK) goto err; @@ -220,7 +220,7 @@ nonum: msgq(sp, M_ERR, "181|Cursor not in a number"); if (base == 16) wlen -= 2; *** 529 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 10:31:11 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 B06F56AFCEA; Wed, 22 Sep 2021 10:31:11 +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 4HDvht3mVgz4t7D; Wed, 22 Sep 2021 10:31:10 +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 CB31F15E36; Wed, 22 Sep 2021 10:31:07 +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 18MAV7A4009315; Wed, 22 Sep 2021 10:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MAV7Pw009314; Wed, 22 Sep 2021 10:31:07 GMT (envelope-from git) Date: Wed, 22 Sep 2021 10:31:07 GMT Message-Id: <202109221031.18MAV7Pw009314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 9fce0d7cec50 - stable/12 - nvi: fix catalog generation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9fce0d7cec501ece2839ae1ef2198e8ae13f8a08 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, 22 Sep 2021 10:31:11 -0000 The branch stable/12 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9fce0d7cec501ece2839ae1ef2198e8ae13f8a08 commit 9fce0d7cec501ece2839ae1ef2198e8ae13f8a08 Author: dankm AuthorDate: 2021-02-26 15:32:01 +0000 Commit: Baptiste Daroussin CommitDate: 2021-09-22 10:29:09 +0000 nvi: fix catalog generation Upstream broke catalog generation with some over-eagre style cleanups. This brings in my pull request. Obtained from: https://github.com/lichray/nvi2/pull/88 Differential Revision: https://reviews.freebsd.org/D28594 (cherry picked from commit 888ae5725257c251319f14f31c2e941717b675f2) --- contrib/nvi/catalog/dump.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/nvi/catalog/dump.c b/contrib/nvi/catalog/dump.c index 8390e5022841..74ab53b2f12c 100644 --- a/contrib/nvi/catalog/dump.c +++ b/contrib/nvi/catalog/dump.c @@ -36,24 +36,24 @@ parse(FILE *fp) { int ch, s1, s2, s3; -#define TESTD(s) do { \ +#define TESTD(s) { \ if ((s = getc(fp)) == EOF) \ return; \ if (!isdigit(s)) \ continue; \ -} while (0) -#define TESTP do { \ +} +#define TESTP { \ if ((ch = getc(fp)) == EOF) \ return; \ if (ch != '|') \ continue; \ -} while (0) -#define MOVEC(t) do { \ +} +#define MOVEC(t) { \ do { \ if ((ch = getc(fp)) == EOF) \ return; \ } while (ch != (t)); \ -} while (0) +} for (;;) { MOVEC('"'); TESTD(s1); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:31 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 EB3AF66AA02; Wed, 22 Sep 2021 13:02:31 +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 4HDz3W3BKjz3DG1; Wed, 22 Sep 2021 13:02:31 +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 32FB717AEE; Wed, 22 Sep 2021 13:02:31 +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 18MD2Vxj013030; Wed, 22 Sep 2021 13:02:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2VeT013029; Wed, 22 Sep 2021 13:02:31 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:31 GMT Message-Id: <202109221302.18MD2VeT013029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 929e8e5605e0 - stable/13 - mlx5/mlx4: Bump driver version to 3.7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 929e8e5605e02e5181b0708cf78abde72411e9cd 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, 22 Sep 2021 13:02:32 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=929e8e5605e02e5181b0708cf78abde72411e9cd commit 929e8e5605e02e5181b0708cf78abde72411e9cd Author: Hans Petter Selasky AuthorDate: 2021-06-16 13:02:03 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 mlx5/mlx4: Bump driver version to 3.7 While at it only output driver version to dmesg(8) when hardware is present. Differential Revision: https://reviews.freebsd.org/D29100 MFC after: 1 week Reviewed by: kib and markj Sponsored by: NVIDIA Networking (cherry picked from commit d2cbfbc57b20700d6eb04dbfc4d636ce6c92997c) --- sys/dev/mlx4/mlx4_core/mlx4.h | 4 ++-- sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_core.h | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_main.c | 7 ++++--- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 16 ---------------- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 18 ------------------ 6 files changed, 10 insertions(+), 43 deletions(-) diff --git a/sys/dev/mlx4/mlx4_core/mlx4.h b/sys/dev/mlx4/mlx4_core/mlx4.h index 8b1afc2838e6..f2cae9c5f38e 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4.h +++ b/sys/dev/mlx4/mlx4_core/mlx4.h @@ -54,9 +54,9 @@ #define DRV_NAME "mlx4_core" #define PFX DRV_NAME ": " #ifndef DRV_VERSION -#define DRV_VERSION "3.6.0" +#define DRV_VERSION "3.7.0" #endif -#define DRV_RELDATE "December 2020" +#define DRV_RELDATE "July 2021" #define MLX4_FS_UDP_UC_EN (1 << 1) #define MLX4_FS_TCP_UC_EN (1 << 2) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c index e992400820c0..635040e723e2 100644 --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c @@ -63,9 +63,9 @@ #define DRV_NAME MLX4_IB_DRV_NAME #ifndef DRV_VERSION -#define DRV_VERSION "3.6.0" +#define DRV_VERSION "3.7.0" #endif -#define DRV_RELDATE "December 2020" +#define DRV_RELDATE "July 2021" #define MLX4_IB_FLOW_MAX_PRIO 0xFFF #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF diff --git a/sys/dev/mlx5/mlx5_core/mlx5_core.h b/sys/dev/mlx5/mlx5_core/mlx5_core.h index a7ce1b31641c..f30f307b04a8 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_core.h +++ b/sys/dev/mlx5/mlx5_core/mlx5_core.h @@ -36,9 +36,9 @@ #define DRIVER_NAME "mlx5_core" #ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.6.0" +#define DRIVER_VERSION "3.7.0" #endif -#define DRIVER_RELDATE "December 2020" +#define DRIVER_RELDATE "July 2021" extern int mlx5_core_debug_mask; diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 7527af524456..5830d4510d7b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2020, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2021, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,8 +55,7 @@ static const char mlx5_version[] = "Mellanox Core driver " DRIVER_VERSION " (" DRIVER_RELDATE ")"; -MODULE_AUTHOR("Eli Cohen "); -MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 core driver"); +MODULE_DESCRIPTION("Mellanox ConnectX-4 and onwards core driver"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_DEPEND(mlx5, linuxkpi, 1, 1, 1); MODULE_DEPEND(mlx5, mlxfw, 1, 1, 1); @@ -1317,6 +1316,8 @@ static int init_one(struct pci_dev *pdev, struct sysctl_oid *current_cap_sysctl_node; struct sysctl_oid *max_cap_sysctl_node; + printk_once("mlx5: %s", mlx5_version); + numa_node = dev_to_node(&pdev->dev); dev = kzalloc_node(sizeof(*dev), GFP_KERNEL, numa_node); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 170fb03be968..cebba31b36e1 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -35,14 +35,6 @@ #include -#ifndef ETH_DRIVER_VERSION -#define ETH_DRIVER_VERSION "3.6.0" -#endif -#define DRIVER_RELDATE "December 2020" - -static const char mlx5e_version[] = "mlx5en: Mellanox Ethernet driver " - ETH_DRIVER_VERSION " (" DRIVER_RELDATE ")\n"; - static int mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs); struct mlx5e_channel_param { @@ -4910,14 +4902,6 @@ mlx5e_cleanup(void) mlx5_unregister_interface(&mlx5e_interface); } -static void -mlx5e_show_version(void __unused *arg) -{ - - printf("%s", mlx5e_version); -} -SYSINIT(mlx5e_show_version, SI_SUB_DRIVERS, SI_ORDER_ANY, mlx5e_show_version, NULL); - module_init_order(mlx5e_init, SI_ORDER_SIXTH); module_exit_order(mlx5e_cleanup, SI_ORDER_SIXTH); diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index d614ec048f60..fd4c0b1acb05 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -50,12 +50,6 @@ #include #include "mlx5_ib.h" -#define DRIVER_NAME "mlx5ib" -#ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.6.0" -#endif -#define DRIVER_RELDATE "December 2020" - MODULE_DESCRIPTION("Mellanox Connect-IB HCA IB driver"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_DEPEND(mlx5ib, linuxkpi, 1, 1, 1); @@ -63,10 +57,6 @@ MODULE_DEPEND(mlx5ib, mlx5, 1, 1, 1); MODULE_DEPEND(mlx5ib, ibcore, 1, 1, 1); MODULE_VERSION(mlx5ib, 1); -static const char mlx5_version[] = - DRIVER_NAME ": Mellanox Connect-IB Infiniband driver " - DRIVER_VERSION " (" DRIVER_RELDATE ")\n"; - enum { MLX5_ATOMIC_SIZE_QP_8BYTES = 1 << 3, }; @@ -3576,13 +3566,5 @@ static void __exit mlx5_ib_cleanup(void) mlx5_ib_odp_cleanup(); } -static void -mlx5_ib_show_version(void __unused *arg) -{ - - printf("%s", mlx5_version); -} -SYSINIT(mlx5_ib_show_version, SI_SUB_DRIVERS, SI_ORDER_ANY, mlx5_ib_show_version, NULL); - module_init_order(mlx5_ib_init, SI_ORDER_SEVENTH); module_exit_order(mlx5_ib_cleanup, SI_ORDER_SEVENTH); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:33 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 13A3366A59E; Wed, 22 Sep 2021 13:02:33 +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 4HDz3X3fLHz3DRD; Wed, 22 Sep 2021 13:02:32 +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 4E58F181CB; Wed, 22 Sep 2021 13:02:32 +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 18MD2WAp013054; Wed, 22 Sep 2021 13:02:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2W88013053; Wed, 22 Sep 2021 13:02:32 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:32 GMT Message-Id: <202109221302.18MD2W88013053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: c203dfe17bc8 - stable/13 - Update the mlx5en(4) manual page. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c203dfe17bc868bb0dbf01c9d99b1ca4b7a51282 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, 22 Sep 2021 13:02:33 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c203dfe17bc868bb0dbf01c9d99b1ca4b7a51282 commit c203dfe17bc868bb0dbf01c9d99b1ca4b7a51282 Author: Hans Petter Selasky AuthorDate: 2021-07-20 16:00:13 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 Update the mlx5en(4) manual page. Differential Revision: https://reviews.freebsd.org/D31228 Reviewed by: kib@ MFC after: 1 week Sponsored by: NVIDIA Networking (cherry picked from commit 575945f10b9e11be0f217117c86dd480de6c5f30) --- share/man/man4/mlx5en.4 | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/share/man/man4/mlx5en.4 b/share/man/man4/mlx5en.4 index f05b74adb0b3..31dcdb4657d4 100644 --- a/share/man/man4/mlx5en.4 +++ b/share/man/man4/mlx5en.4 @@ -1,4 +1,5 @@ .\" Copyright (c) 2015 Mellanox Technologies +.\" Copyright (c) 2021 NVIDIA corporation & affiliates .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd July 20, 2021 .Dt MLX5EN 4 .Os .Sh NAME .Nm mlx5en -.Nd "Mellanox ConnectX-4, ConnectX-4 LX and ConnectX-5 based 100Gb, 50Gb, 40Gb, 25Gb and 10Gb Ethernet adapter driver" +.Nd "NVIDIA Mellanox ConnectX-4/5/6 [Dx/Ex/Lx] based 200Gb, 100Gb, 50Gb, 40Gb, 25Gb and 10Gb ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -37,6 +38,7 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUXKPI" .Cd "options RATELIMIT" +.Cd "options KERN_TLS" .Cd "device xz" .Cd "device mlxfw" .Cd "device firmware" @@ -60,67 +62,63 @@ mlx5en_load="YES" The .Nm driver provides support for PCI Express Ethernet adapters based on -ConnectX-4, ConnectX-4 LX and ConnectX-5. -The driver supports Jumbo Frames, Transmit/Receive checksum offload, +ConnectX-4/5/6 [Dx, Ex and Lx variants]. +The driver supports Jumbo Frames, Transmit and Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), -HW Large Receive Offload (HW LRO), VLAN tag insertion/extraction, -VLAN checksum offload, VLAN TSO, hardware rate limiting (TXRTLMT) -and Receive Side Steering (RSS). -.br -The network interface is named mce. -.br -For further hardware information and questions related to hardware -requirements, see -.Pa http://www.mellanox.com/ . +HW Large Receive Offload (HW LRO), VLAN tag insertion and extraction, +VLAN checksum offload, VLAN TSO, hardware rate limiting (TXRTLMT), +stateless VxLAN hardware offload for receive and transmit, +HW TLS offload for transmit, Receive Side Steering (RSS) and +.Xr NUMA 4 +awareness. +.Pp +The network interface name is +.Dv mce +which corresponds to a PCI function, +.Dv mlx_core , +where +.Dv +is a number starting at zero. +There is at most one network interface per PCI function. .Pp -For more information on configuring this device, see -.Xr ifconfig 8 . +For further information and questions related to hardware +requirements, see +.Pa https://www.mellanox.com . .Sh HARDWARE The .Nm -driver supports 100Gb, 50Gb, 40Gb, 25Gb and 10Gb Ethernet adapters. -ConnectX-5 supports:10/20/25/40/50/56/100Gb/s speeds. -ConnectX-4 supports:10/20/25/40/50/56/100Gb/s speeds. -ConnectX-4 LX supports:10/25/40/50Gb/s speeds (and reduced power consumption) : -.Pp +driver supports 200Gb, 100Gb, 50Gb, 40Gb, 25Gb and 10Gb ethernet adapters. .Bl -bullet -compact +.Pp .It -Mellanox MCX455A-ECAT -.It -Mellanox MCX456A-ECAT -.It -Mellanox MCX415A-CCAT -.It -Mellanox MCX416A-CCAT -.It -Mellanox MCX455A-FCAT -.It -Mellanox MCX456A-FCAT -.It -Mellanox MCX415A-BCAT -.It -Mellanox MCX416A-BCAT -.It -Mellanox MCX4131A-GCAT -.It -Mellanox MCX4131A-BCAT -.It -Mellanox MCX4121A-ACAT +ConnectX-6 supports 10/20/25/40/50/56/100Gb/200Gb/s speeds. .It -Mellanox MCX4111A-ACAT +ConnectX-5 supports 10/20/25/40/50/56/100Gb/s speeds. .It -Mellanox MCX4121A-XCAT +ConnectX-4 supports 10/20/25/40/50/56/100Gb/s speeds. .It -Mellanox MCX4111A-XCAT +ConnectX-4 LX supports 10/25/40/50Gb/s speeds and reduced power consumption. .El +.Sh CONFIGURATION +The +.Nm +network interface is configured using +.Xr ifconfig 8 +and the +.Xr sysctl 8 +tree at +.Dv dev.mce. . +All configurable entries are also tunables, and can be put directly into the +.Xr loader.conf 5 +for persistent configuration. .Sh SUPPORT For general information and support, -go to the Mellanox support website at: -.Pa http://www.mellanox.com/ . +go to the NVIDIA Mellanox networking support website at: +.Pa https://www.mellanox.com . .Pp -If an issue is identified with this driver with a supported adapter, -email all the specific information related to the issue to -.Aq Mt freebsd-drivers@mellanox.com . +If an issue is identified with this driver using a supported adapter, +e-mail all the specific information related to the issue to +.Aq Mt nbu-freebsd-drivers@nvidia.com . .Sh SEE ALSO .Xr ifconfig 8 .Sh HISTORY @@ -133,4 +131,4 @@ device driver first appeared in The .Nm driver was written by -.An Mellanox Technologies . +.An NVIDIA Mellanox networking . From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:34 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 2368366A9E9; Wed, 22 Sep 2021 13:02:34 +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 4HDz3Y5LVgz3DTg; Wed, 22 Sep 2021 13:02:33 +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 78BFA1831F; Wed, 22 Sep 2021 13:02:33 +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 18MD2XQG013078; Wed, 22 Sep 2021 13:02:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2Xws013077; Wed, 22 Sep 2021 13:02:33 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:33 GMT Message-Id: <202109221302.18MD2Xws013077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 5c4a6f277a92 - stable/13 - sound(4): Fix typos. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c4a6f277a92aa827c13bccdef1a2ad6949d6160 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, 22 Sep 2021 13:02:34 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4a6f277a92aa827c13bccdef1a2ad6949d6160 commit 5c4a6f277a92aa827c13bccdef1a2ad6949d6160 Author: Hans Petter Selasky AuthorDate: 2021-07-28 11:25:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 sound(4): Fix typos. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31320 MFC after: 1 week Sponsored by: NVIDIA Networking (cherry picked from commit 132fca6335939b308f230d4942ba15ba2b56ceb7) --- sys/dev/sound/pcm/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 299e4937f8e4..e03529f00b78 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1020,7 +1020,7 @@ pcm_sysinit(device_t dev) { struct snddev_info *d = device_get_softc(dev); - /* XXX: an user should be able to set this with a control tool, the + /* XXX: a user should be able to set this with a control tool, the sysadmin then needs min+max sysctls for this */ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1133,7 +1133,7 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) sysctl_ctx_init(&d->rec_sysctl_ctx); d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", - CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "record channels node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node"); if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:35 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 F12B766A7AD; Wed, 22 Sep 2021 13:02:35 +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 4HDz3b1Npfz3DTn; Wed, 22 Sep 2021 13:02:35 +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 9C70C17FB0; Wed, 22 Sep 2021 13:02:34 +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 18MD2YXw013102; Wed, 22 Sep 2021 13:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2Ymq013101; Wed, 22 Sep 2021 13:02:34 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:34 GMT Message-Id: <202109221302.18MD2Ymq013101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 66e91a9ee19f - stable/13 - Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66e91a9ee19fe09125e5cf535c440c80faf77fa6 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, 22 Sep 2021 13:02:36 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=66e91a9ee19fe09125e5cf535c440c80faf77fa6 commit 66e91a9ee19fe09125e5cf535c440c80faf77fa6 Author: Hans Petter Selasky AuthorDate: 2021-07-20 17:02:41 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s. These two ioctls are not part of the current version of OSS and were considered obsolete. However, their behaviour is not the same as their old one, so this implementation is specific to FreeBSD. Older OSS versions had the MUTE ioctls take and return an integer with a value of 0 or 1, which meant that the _whole_ mixer is unmuted or muted respectively. In my implementation, the ioctl takes and returns a bitmask that tells us which devices are muted. This allows us to mute and unmute only the devices we want, instead of the whole mixer. The bitmask works the same way as in DEVMASK, RECMASK and RECSRC. Integrated the hardware volume feature with the new mute system. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31130 MFC after: 1 week Sponsored by: NVIDIA Networking (cherry picked from commit 0f8dafb45859569aa36b63ca2bb4a1c35c970d1e) --- sys/dev/sound/pcm/mixer.c | 122 +++++++++++++++++++++++++++++++--------------- sys/dev/sound/pcm/mixer.h | 2 + 2 files changed, 84 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 09b0bb8ab148..89e78b036e94 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -51,16 +51,16 @@ struct snd_mixer { KOBJ_FIELDS; void *devinfo; int busy; - int hwvol_muted; int hwvol_mixer; int hwvol_step; int type; device_t dev; - u_int32_t hwvol_mute_level; u_int32_t devs; + u_int32_t mutedevs; u_int32_t recdevs; u_int32_t recsrc; u_int16_t level[32]; + u_int16_t level_muted[32]; u_int8_t parent[32]; u_int32_t child[32]; u_int8_t realdev[32]; @@ -244,7 +244,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d, } static int -mixer_set(struct snd_mixer *m, u_int dev, u_int lev) +mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev) { struct snddev_info *d; u_int l, r, tl, tr; @@ -254,7 +254,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) if (m == NULL || dev >= SOUND_MIXER_NRDEVICES || (0 == (m->devs & (1 << dev)))) - return -1; + return (-1); l = min((lev & 0x00ff), 100); r = min(((lev & 0xff00) >> 8), 100); @@ -262,7 +262,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) d = device_get_softc(m->dev); if (d == NULL) - return -1; + return (-1); /* It is safe to drop this mutex due to Giant. */ if (!(d->flags & SD_F_MPSAFE) && mtx_owned(m->lock) != 0) @@ -270,6 +270,11 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else dropmtx = 0; + /* Allow the volume to be "changed" while muted. */ + if (muted & (1 << dev)) { + m->level_muted[dev] = l | (r << 8); + return (0); + } MIXER_SET_UNLOCK(m, dropmtx); /* TODO: recursive handling */ @@ -287,7 +292,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, tl, tr) < 0) { MIXER_SET_LOCK(m, dropmtx); - return -1; + return (-1); } } else if (child != 0) { for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { @@ -305,8 +310,8 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) realdev = m->realdev[dev]; if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, l, r) < 0) { - MIXER_SET_LOCK(m, dropmtx); - return -1; + MIXER_SET_LOCK(m, dropmtx); + return (-1); } } else { if (dev == SOUND_MIXER_PCM && (d->flags & SD_F_SOFTPCMVOL)) @@ -317,7 +322,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, l, r) < 0) { MIXER_SET_LOCK(m, dropmtx); - return -1; + return (-1); } } @@ -326,16 +331,42 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) m->level[dev] = l | (r << 8); m->modify_counter++; - return 0; + return (0); } static int mixer_get(struct snd_mixer *mixer, int dev) { - if ((dev < SOUND_MIXER_NRDEVICES) && (mixer->devs & (1 << dev))) - return mixer->level[dev]; - else - return -1; + if ((dev < SOUND_MIXER_NRDEVICES) && (mixer->devs & (1 << dev))) { + if (mixer->mutedevs & (1 << dev)) + return (mixer->level_muted[dev]); + else + return (mixer->level[dev]); + } else { + return (-1); + } +} + +void +mix_setmutedevs(struct snd_mixer *mixer, u_int32_t mutedevs) +{ + u_int32_t delta; + + /* Filter out invalid values. */ + mutedevs &= mixer->devs; + delta = (mixer->mutedevs ^ mutedevs) & mixer->devs; + mixer->mutedevs = mutedevs; + + for (int i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (!(delta & (1 << i))) + continue; + if (mutedevs & (1 << i)) { + mixer->level_muted[i] = mixer->level[i]; + mixer_set(mixer, i, 0, 0); + } else { + mixer_set(mixer, i, 0, mixer->level_muted[i]); + } + } } static int @@ -598,6 +629,12 @@ mix_getdevs(struct snd_mixer *m) return m->devs; } +u_int32_t +mix_getmutedevs(struct snd_mixer *m) +{ + return m->mutedevs; +} + u_int32_t mix_getrecdevs(struct snd_mixer *m) { @@ -721,7 +758,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) } } - mixer_set(m, i, v | (v << 8)); + mixer_set(m, i, 0, v | (v << 8)); } mixer_setrecsrc(m, 0); /* Set default input. */ @@ -799,7 +836,7 @@ mixer_uninit(device_t dev) snd_mtxlock(m->lock); for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - mixer_set(m, i, 0); + mixer_set(m, i, 0, 0); mixer_setrecsrc(m, SOUND_MASK_MIC); @@ -836,8 +873,12 @@ mixer_reinit(device_t dev) return i; } - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - mixer_set(m, i, m->level[i]); + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (m->mutedevs & (1 << i)) + mixer_set(m, i, 0, 0); + else + mixer_set(m, i, 0, m->level[i]); + } mixer_setrecsrc(m, m->recsrc); snd_mtxunlock(m->lock); @@ -863,10 +904,8 @@ sysctl_hw_snd_hwvol_mixer(SYSCTL_HANDLER_ARGS) if (dev == -1) { snd_mtxunlock(m->lock); return EINVAL; - } - else if (dev != m->hwvol_mixer) { + } else { m->hwvol_mixer = dev; - m->hwvol_muted = 0; } } snd_mtxunlock(m->lock); @@ -897,14 +936,7 @@ mixer_hwvol_init(device_t dev) void mixer_hwvol_mute_locked(struct snd_mixer *m) { - if (m->hwvol_muted) { - m->hwvol_muted = 0; - mixer_set(m, m->hwvol_mixer, m->hwvol_mute_level); - } else { - m->hwvol_muted++; - m->hwvol_mute_level = mixer_get(m, m->hwvol_mixer); - mixer_set(m, m->hwvol_mixer, 0); - } + mix_setmutedevs(m, m->mutedevs ^ (1 << m->hwvol_mixer)); } void @@ -925,11 +957,8 @@ mixer_hwvol_step_locked(struct snd_mixer *m, int left_step, int right_step) { int level, left, right; - if (m->hwvol_muted) { - m->hwvol_muted = 0; - level = m->hwvol_mute_level; - } else - level = mixer_get(m, m->hwvol_mixer); + level = mixer_get(m, m->hwvol_mixer); + if (level != -1) { left = level & 0xff; right = (level >> 8) & 0xff; @@ -943,7 +972,8 @@ mixer_hwvol_step_locked(struct snd_mixer *m, int left_step, int right_step) right = 0; else if (right > 100) right = 100; - mixer_set(m, m->hwvol_mixer, left | right << 8); + + mixer_set(m, m->hwvol_mixer, m->mutedevs, left | right << 8); } } @@ -976,7 +1006,7 @@ mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right) KASSERT(m != NULL, ("NULL snd_mixer")); snd_mtxlock(m->lock); - ret = mixer_set(m, dev, left | (right << 8)); + ret = mixer_set(m, dev, m->mutedevs, left | (right << 8)); snd_mtxunlock(m->lock); return ((ret != 0) ? ENXIO : 0); @@ -1304,10 +1334,18 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, goto done; } if ((cmd & ~0xff) == MIXER_WRITE(0)) { - if (j == SOUND_MIXER_RECSRC) + switch (j) { + case SOUND_MIXER_RECSRC: ret = mixer_setrecsrc(m, *arg_i); - else - ret = mixer_set(m, j, *arg_i); + break; + case SOUND_MIXER_MUTE: + mix_setmutedevs(m, *arg_i); + ret = 0; + break; + default: + ret = mixer_set(m, j, m->mutedevs, *arg_i); + break; + } snd_mtxunlock(m->lock); return ((ret == 0) ? 0 : ENXIO); } @@ -1318,6 +1356,9 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SOUND_MIXER_STEREODEVS: v = mix_getdevs(m); break; + case SOUND_MIXER_MUTE: + v = mix_getmutedevs(m); + break; case SOUND_MIXER_RECMASK: v = mix_getrecdevs(m); break; @@ -1326,6 +1367,7 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, break; default: v = mixer_get(m, j); + break; } *arg_i = v; snd_mtxunlock(m->lock); @@ -1554,5 +1596,5 @@ mix_set_locked(struct snd_mixer *m, u_int dev, int left, int right) level = (left & 0xFF) | ((right & 0xFF) << 8); - return (mixer_set(m, dev, level)); + return (mixer_set(m, dev, m->mutedevs, level)); } diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h index 8e11d553a3e4..7857609b2895 100644 --- a/sys/dev/sound/pcm/mixer.h +++ b/sys/dev/sound/pcm/mixer.h @@ -60,8 +60,10 @@ device_t mix_get_dev(struct snd_mixer *m); void mix_setdevs(struct snd_mixer *m, u_int32_t v); void mix_setrecdevs(struct snd_mixer *m, u_int32_t v); +void mix_setmutedevs(struct snd_mixer *m, u_int32_t v); u_int32_t mix_getdevs(struct snd_mixer *m); u_int32_t mix_getrecdevs(struct snd_mixer *m); +u_int32_t mix_getmutedevs(struct snd_mixer *m); void mix_setparentchild(struct snd_mixer *m, u_int32_t parent, u_int32_t childs); void mix_setrealdev(struct snd_mixer *m, u_int32_t dev, u_int32_t realdev); u_int32_t mix_getparent(struct snd_mixer *m, u_int32_t dev); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:37 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 30D5266A833; Wed, 22 Sep 2021 13:02:37 +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 4HDz3c30nNz3DK0; Wed, 22 Sep 2021 13:02:36 +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 C154C1814C; Wed, 22 Sep 2021 13:02:35 +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 18MD2ZrG013133; Wed, 22 Sep 2021 13:02:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2ZaC013132; Wed, 22 Sep 2021 13:02:35 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:35 GMT Message-Id: <202109221302.18MD2ZaC013132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 1483b121d028 - stable/13 - sound(4): Implement playback and recording mode sysctl(8). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1483b121d0285bda728833e9690570ec6dbe3982 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, 22 Sep 2021 13:02:37 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=1483b121d0285bda728833e9690570ec6dbe3982 commit 1483b121d0285bda728833e9690570ec6dbe3982 Author: Hans Petter Selasky AuthorDate: 2021-07-28 11:22:52 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 sound(4): Implement playback and recording mode sysctl(8). The dev.pcm..mode sysctl(8) gives information if a sound device supports hardware mixing, playback or recording. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31320 MFC after: 1 week Sponsored by: NVIDIA Networking (cherry picked from commit ed2196e5df0c8b5b81563d2fffdcb32bb7ebe966) --- sys/dev/sound/pcm/sound.c | 23 +++++++++++++++++++++++ sys/dev/sound/pcm/sound.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index e03529f00b78..663ec84f93b6 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1015,10 +1015,28 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, "global clone garbage collector"); #endif +static u_int8_t +pcm_mode_init(struct snddev_info *d) +{ + u_int8_t mode = 0; + + if (d->playcount > 0) + mode |= PCM_MODE_PLAY; + if (d->reccount > 0) + mode |= PCM_MODE_REC; + if (d->mixer_dev != NULL) + mode |= PCM_MODE_MIXER; + + return (mode); +} + static void pcm_sysinit(device_t dev) { struct snddev_info *d = device_get_softc(dev); + u_int8_t mode; + + mode = pcm_mode_init(d); /* XXX: a user should be able to set this with a control tool, the sysadmin then needs min+max sysctls for this */ @@ -1030,6 +1048,11 @@ pcm_sysinit(device_t dev) "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, d, sizeof(d), sysctl_dev_pcm_bitperfect, "I", "bit-perfect playback/recording (0=disable, 1=enable)"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mode", CTLFLAG_RD, NULL, mode, + "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than one" + "mode is supported)"); #ifdef SND_DEBUG SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index cdae5e837cdc..62787a3e689c 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -411,6 +411,10 @@ struct snddev_info { void sound_oss_sysinfo(oss_sysinfo *); int sound_oss_card_info(oss_card_info *); +#define PCM_MODE_MIXER 0x01 +#define PCM_MODE_PLAY 0x02 +#define PCM_MODE_REC 0x04 + #define PCM_LOCKOWNED(d) mtx_owned((d)->lock) #define PCM_LOCK(d) mtx_lock((d)->lock) #define PCM_UNLOCK(d) mtx_unlock((d)->lock) From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 13:02:38 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 8D14C66A566; Wed, 22 Sep 2021 13:02:38 +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 4HDz3d31cDz3DRZ; Wed, 22 Sep 2021 13:02:37 +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 D582418320; Wed, 22 Sep 2021 13:02:36 +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 18MD2aMC013157; Wed, 22 Sep 2021 13:02:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MD2ah1013156; Wed, 22 Sep 2021 13:02:36 GMT (envelope-from git) Date: Wed, 22 Sep 2021 13:02:36 GMT Message-Id: <202109221302.18MD2ah1013156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e4cbb47700bc - stable/13 - Cleanup unused USB enums. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4cbb47700bc91538b69b78c0b5009dfae69176b 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, 22 Sep 2021 13:02:38 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e4cbb47700bc91538b69b78c0b5009dfae69176b commit e4cbb47700bc91538b69b78c0b5009dfae69176b Author: Hans Petter Selasky AuthorDate: 2021-07-15 10:38:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-22 12:59:31 +0000 Cleanup unused USB enums. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/usb_transfer.h | 117 +++------------------------------------------ 1 file changed, 7 insertions(+), 110 deletions(-) diff --git a/sys/dev/usb/usb_transfer.h b/sys/dev/usb/usb_transfer.h index c6b97e1ab3c5..0dd750c33c0d 100644 --- a/sys/dev/usb/usb_transfer.h +++ b/sys/dev/usb/usb_transfer.h @@ -30,119 +30,16 @@ #define _USB_TRANSFER_H_ /* - * Definition of internal USB transfer states: - * =========================================== + * A few words about USB transfer states: + * ====================================== * - * The main reason there are many USB states is that we are allowed to - * cancel USB transfers, then start the USB transfer again and that - * this state transaction cannot always be done in a single atomic - * operation without blocking the calling thread. One reason for this - * is that the USB hardware sometimes needs to wait for DMA - * controllers to finish which is done asynchronously and grows the - * statemachine. - * - * When extending the following statemachine there are basically two - * things you should think about: Which states should be executed or - * modified in case of USB transfer stop and which states should be - * executed or modified in case of USB transfer start. Also respect - * the "can_cancel_immed" flag which basically tells if you can go - * directly from a wait state to the cancelling states. + * USB transfers can have multiple states, because they can be + * cancelled and started again and this cannot always be done + * atomically under a mutex. One reason for this is that the USB + * hardware sometimes needs to wait for DMA controllers to finish + * which is done asynchronously and grows the statemachine. */ -enum { - /* XFER start execute state */ - - /* USB_ST_SETUP = 0 (already defined) */ - - /* XFER transferred execute state */ - - /* USB_ST_TRANSFERRED = 1 (already defined) */ - - /* XFER error execute state */ - - /* USB_ST_ERROR = 2 (already defined) */ - - /* XFER restart after error execute state */ - - USB_ST_RESTART = 8, - - /* XFER transfer idle state */ - - USB_ST_WAIT_SETUP, - - /* Other XFER execute states */ - - USB_ST_PIPE_OPEN = 16, - USB_ST_PIPE_OPEN_ERROR, - USB_ST_PIPE_OPEN_RESTART, - - USB_ST_BDMA_LOAD, - USB_ST_BDMA_LOAD_ERROR, - USB_ST_BDMA_LOAD_RESTART, - - USB_ST_IVAL_DLY, - USB_ST_IVAL_DLY_ERROR, - USB_ST_IVAL_DLY_RESTART, - - USB_ST_PIPE_STALL, - USB_ST_PIPE_STALL_ERROR, - USB_ST_PIPE_STALL_RESTART, - - USB_ST_ENTER, - USB_ST_ENTER_ERROR, - USB_ST_ENTER_RESTART, - - USB_ST_START, - USB_ST_START_ERROR, - USB_ST_START_RESTART, - - USB_ST_PIPE_CLOSE, - USB_ST_PIPE_CLOSE_ERROR, - USB_ST_PIPE_CLOSE_RESTART, - - USB_ST_BDMA_DLY, - USB_ST_BDMA_DLY_ERROR, - USB_ST_BDMA_DLY_RESTART, - - /* XFER transfer wait states */ - - USB_ST_WAIT_PIPE_OPEN = 64, - USB_ST_WAIT_PIPE_OPEN_ERROR, - USB_ST_WAIT_PIPE_OPEN_RESTART, - - USB_ST_WAIT_BDMA_LOAD, - USB_ST_WAIT_BDMA_LOAD_ERROR, - USB_ST_WAIT_BDMA_LOAD_RESTART, - - USB_ST_WAIT_IVAL_DLY, - USB_ST_WAIT_IVAL_DLY_ERROR, - USB_ST_WAIT_IVAL_DLY_RESTART, - - USB_ST_WAIT_PIPE_STALL, - USB_ST_WAIT_PIPE_STALL_ERROR, - USB_ST_WAIT_PIPE_STALL_RESTART, - - USB_ST_WAIT_ENTER, - USB_ST_WAIT_ENTER_ERROR, - USB_ST_WAIT_ENTER_RESTART, - - USB_ST_WAIT_START, - USB_ST_WAIT_START_ERROR, - USB_ST_WAIT_START_RESTART, - - USB_ST_WAIT_PIPE_CLOSE, - USB_ST_WAIT_PIPE_CLOSE_ERROR, - USB_ST_WAIT_PIPE_CLOSE_RESTART, - - USB_ST_WAIT_BDMA_DLY, - USB_ST_WAIT_BDMA_DLY_ERROR, - USB_ST_WAIT_BDMA_DLY_RESTART, - - USB_ST_WAIT_TRANSFERRED, - USB_ST_WAIT_TRANSFERRED_ERROR, - USB_ST_WAIT_TRANSFERRED_RESTART, -}; - /* * The following structure defines the messages that is used to signal * the "done_p" USB process. From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 14:06:03 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 82C3466B753; Wed, 22 Sep 2021 14:06:03 +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 4HF0Sq328Wz3QLx; Wed, 22 Sep 2021 14:06:03 +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 47A6318CE1; Wed, 22 Sep 2021 14:06:03 +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 18ME63wO093331; Wed, 22 Sep 2021 14:06:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ME63M0093330; Wed, 22 Sep 2021 14:06:03 GMT (envelope-from git) Date: Wed, 22 Sep 2021 14:06:03 GMT Message-Id: <202109221406.18ME63M0093330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c91cdb006e6c - stable/13 - grep: fix combination of quiet and count flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c91cdb006e6c83edab702b784c120e51c410e051 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, 22 Sep 2021 14:06:03 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c91cdb006e6c83edab702b784c120e51c410e051 commit c91cdb006e6c83edab702b784c120e51c410e051 Author: Mariusz Zaborski AuthorDate: 2021-07-09 12:09:14 +0000 Commit: Ed Maste CommitDate: 2021-09-22 14:05:39 +0000 grep: fix combination of quiet and count flag When the quiet (-q) flag is provided, we don't expect any output. Currently, the behavior is broken: $ grep -cq flag util.c 1 $ grep -cs flag util.c 55 First of all, we print a number to stdout. Secondly, it just returns 0 or 1 (which is unexpected). GNU grep with c and q flags doesn't print anything. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31108 (cherry picked from commit 24c681a7f6d6c777221fdbd289da64ff65ad8785) --- usr.bin/grep/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index a2520e24de8e..698e347c192e 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -388,7 +388,7 @@ procfile(const char *fn) clearqueue(); grep_close(f); - if (cflag) { + if (cflag && !qflag) { if (!hflag) printf("%s:", pc.ln.file); printf("%u\n", lines); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 14:07:02 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 C77EB66BC96; Wed, 22 Sep 2021 14:07:02 +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 4HF0Ty5KBFz3QTm; Wed, 22 Sep 2021 14:07:02 +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 9781119002; Wed, 22 Sep 2021 14:07:02 +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 18ME72Nl093505; Wed, 22 Sep 2021 14:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ME72sJ093504; Wed, 22 Sep 2021 14:07:02 GMT (envelope-from git) Date: Wed, 22 Sep 2021 14:07:02 GMT Message-Id: <202109221407.18ME72sJ093504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 42368c6b5f92 - stable/12 - grep: fix combination of quiet and count flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 42368c6b5f920cda954621c3c541bfdb754ab0c8 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, 22 Sep 2021 14:07:02 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=42368c6b5f920cda954621c3c541bfdb754ab0c8 commit 42368c6b5f920cda954621c3c541bfdb754ab0c8 Author: Mariusz Zaborski AuthorDate: 2021-07-09 12:09:14 +0000 Commit: Ed Maste CommitDate: 2021-09-22 14:06:39 +0000 grep: fix combination of quiet and count flag When the quiet (-q) flag is provided, we don't expect any output. Currently, the behavior is broken: $ grep -cq flag util.c 1 $ grep -cs flag util.c 55 First of all, we print a number to stdout. Secondly, it just returns 0 or 1 (which is unexpected). GNU grep with c and q flags doesn't print anything. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31108 (cherry picked from commit 24c681a7f6d6c777221fdbd289da64ff65ad8785) --- usr.bin/grep/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 220ffaef7dab..5c7659fd0f28 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -386,7 +386,7 @@ procfile(const char *fn) clearqueue(); grep_close(f); - if (cflag) { + if (cflag && !qflag) { if (!hflag) printf("%s:", pc.ln.file); printf("%u\n", lines); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 14:30:46 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 5E16F66BFB5; Wed, 22 Sep 2021 14:30:46 +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 4HF11L2Gz2z3jhh; Wed, 22 Sep 2021 14:30:46 +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 2F0D4195FB; Wed, 22 Sep 2021 14:30:46 +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 18MEUkS2027988; Wed, 22 Sep 2021 14:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MEUkQJ027987; Wed, 22 Sep 2021 14:30:46 GMT (envelope-from git) Date: Wed, 22 Sep 2021 14:30:46 GMT Message-Id: <202109221430.18MEUkQJ027987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7716178c0b38 - stable/13 - ppbus: Set the lock for pps interface, update to latest api MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7716178c0b389bdea83e8cab31c188ba1151bbfc 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, 22 Sep 2021 14:30:46 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7716178c0b389bdea83e8cab31c188ba1151bbfc commit 7716178c0b389bdea83e8cab31c188ba1151bbfc Author: Warner Losh AuthorDate: 2021-09-01 19:37:27 +0000 Commit: Warner Losh CommitDate: 2021-09-22 14:29:58 +0000 ppbus: Set the lock for pps interface, update to latest api Since we take a lock when we enter the ioctl, we need to set driver_mtx in the pps structure so it can be dropped while sleeping during a call to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature). MFC After: 5 days Sponsored by: Netflix Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D31763 (cherry picked from commit c62aa65b2a7a6492e712a69c58a35347aa441a98) --- sys/dev/ppbus/ppb_base.c | 8 ++++++++ sys/dev/ppbus/ppbconf.h | 1 + sys/dev/ppbus/pps.c | 8 ++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c index 20782385acc0..b399f4cc2d17 100644 --- a/sys/dev/ppbus/ppb_base.c +++ b/sys/dev/ppbus/ppb_base.c @@ -220,6 +220,14 @@ ppb_unlock(device_t bus) mtx_unlock(ppb->ppc_lock); } +struct mtx * +ppb_get_lock(device_t bus) +{ + struct ppb_data *ppb = DEVTOSOFTC(bus); + + return (ppb->ppc_lock); +} + void _ppb_assert_locked(device_t bus, const char *file, int line) { diff --git a/sys/dev/ppbus/ppbconf.h b/sys/dev/ppbus/ppbconf.h index 6a90f5729971..723db73412f8 100644 --- a/sys/dev/ppbus/ppbconf.h +++ b/sys/dev/ppbus/ppbconf.h @@ -259,6 +259,7 @@ extern int ppb_release_bus(device_t, device_t); /* bus related functions */ extern void ppb_lock(device_t); extern void ppb_unlock(device_t); +extern struct mtx *ppb_get_lock(device_t); extern void _ppb_assert_locked(device_t, const char *, int); extern void ppb_init_callout(device_t, struct callout *, int); extern int ppb_sleep(device_t, void *, int, const char *, int); diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c index cf0c1a1c2f07..897ae1b78bd7 100644 --- a/sys/dev/ppbus/pps.c +++ b/sys/dev/ppbus/pps.c @@ -141,9 +141,11 @@ ppsattach(device_t dev) UID_ROOT, GID_WHEEL, 0600, PPS_NAME "%d", unit); sc->devs[0] = d; sc->pps[0].ppscap = PPS_CAPTUREASSERT | PPS_ECHOASSERT; + sc->pps[0].driver_abi = PPS_ABI_VERSION; + sc->pps[0].driver_mtx = ppb_get_lock(ppbus); d->si_drv1 = sc; d->si_drv2 = (void*)0; - pps_init(&sc->pps[0]); + pps_init_abi(&sc->pps[0]); ppb_lock(ppbus); if (ppb_request_bus(ppbus, dev, PPB_DONTWAIT)) { @@ -193,9 +195,11 @@ ppsattach(device_t dev) UID_ROOT, GID_WHEEL, 0600, PPS_NAME "%db%d", unit, i - 1); sc->devs[i] = d; sc->pps[i].ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR; + sc->pps[i].driver_abi = PPS_ABI_VERSION; + sc->pps[i].driver_mtx = ppb_get_lock(ppbus); d->si_drv1 = sc; d->si_drv2 = (void *)(intptr_t)i; - pps_init(&sc->pps[i]); + pps_init_abi(&sc->pps[i]); } ppb_lock(ppbus); } while (0); From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 14:30:47 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 B085766C0C3; Wed, 22 Sep 2021 14:30:47 +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 4HF11M4GBLz3jft; Wed, 22 Sep 2021 14:30:47 +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 5E66D193B7; Wed, 22 Sep 2021 14:30:47 +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 18MEUlP9028012; Wed, 22 Sep 2021 14:30:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MEUl7m028011; Wed, 22 Sep 2021 14:30:47 GMT (envelope-from git) Date: Wed, 22 Sep 2021 14:30:47 GMT Message-Id: <202109221430.18MEUl7m028011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a9d18746f016 - stable/13 - cdefs.h: Remove redundant #ifdefs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a9d18746f016c4acbaba2dec86a32cee5e9c9aa5 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, 22 Sep 2021 14:30:47 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9d18746f016c4acbaba2dec86a32cee5e9c9aa5 commit a9d18746f016c4acbaba2dec86a32cee5e9c9aa5 Author: Warner Losh AuthorDate: 2021-09-07 15:34:02 +0000 Commit: Warner Losh CommitDate: 2021-09-22 14:29:58 +0000 cdefs.h: Remove redundant #ifdefs Remove redunant #ifdef __GNUC__ inside an #if defined(__GNUC__) block. They are nops. Sponsored by: Netflix (cherry picked from commit 1e7b5f950b2d54ddb257d008592563c4d753aa54) --- sys/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 85e9ea227150..30c462f6549b 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -97,16 +97,12 @@ #define __GNUCLIKE_BUILTIN_VAALIST 1 #endif -#if defined(__GNUC__) #define __GNUC_VA_LIST_COMPATIBILITY 1 -#endif /* * Compiler memory barriers, specific to gcc and clang. */ -#if defined(__GNUC__) #define __compiler_membar() __asm __volatile(" " : : : "memory") -#endif #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 #define __GNUCLIKE_MATH_BUILTIN_RELOPS From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 14:30:48 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 C92F566C0C4; Wed, 22 Sep 2021 14:30:48 +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 4HF11N560lz3jfx; Wed, 22 Sep 2021 14:30:48 +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 7DFF219492; Wed, 22 Sep 2021 14:30:48 +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 18MEUmS2028036; Wed, 22 Sep 2021 14:30:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MEUmdk028035; Wed, 22 Sep 2021 14:30:48 GMT (envelope-from git) Date: Wed, 22 Sep 2021 14:30:48 GMT Message-Id: <202109221430.18MEUmdk028035@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5d8f8ab1eb40 - stable/13 - genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d8f8ab1eb4026446883bd0a353d14d8e1175939 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, 22 Sep 2021 14:30:48 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d8f8ab1eb4026446883bd0a353d14d8e1175939 commit 5d8f8ab1eb4026446883bd0a353d14d8e1175939 Author: Warner Losh AuthorDate: 2021-09-07 16:08:51 +0000 Commit: Warner Losh CommitDate: 2021-09-22 14:29:59 +0000 genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations Linux fails to build now because the mkdtemp in the bootstrapped environment wants 6 or more X's. Use 10 out of an abundance of caution. Sponsored by: Netflix Reviewed by: arichards Differential Revision: https://reviews.freebsd.org/D31863 (cherry picked from commit ecfbb2e30241ee460617ad4e0c0be16d9930945a) --- sys/kern/genoffset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/genoffset.sh b/sys/kern/genoffset.sh index f7185e7ae396..aedccfd84c6e 100644 --- a/sys/kern/genoffset.sh +++ b/sys/kern/genoffset.sh @@ -42,7 +42,7 @@ work() echo "#define _OFFSET_INC_" echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))" last= - temp=$(mktemp -d genoffset.XXXXX) + temp=$(mktemp -d genoffset.XXXXXXXXXX) trap "rm -rf ${temp}" EXIT # Note: we need to print symbol values in decimal so the numeric sort works ${NM:='nm'} ${NMFLAGS} -t d "$1" | grep __assym_offset__ | sed -e 's/__/ /g' | sort -k 4 -k 1 -n | From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 15:00:49 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 DBA1766CBC7; Wed, 22 Sep 2021 15:00:49 +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 4HF1h15r4cz3lyw; Wed, 22 Sep 2021 15:00:49 +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 A81D919A29; Wed, 22 Sep 2021 15:00:49 +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 18MF0n5b068534; Wed, 22 Sep 2021 15:00:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MF0nKM068533; Wed, 22 Sep 2021 15:00:49 GMT (envelope-from git) Date: Wed, 22 Sep 2021 15:00:49 GMT Message-Id: <202109221500.18MF0nKM068533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0437d10e359e - stable/13 - direct commit: fix KBI for pci_dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0437d10e359ea1cbefff8d17cd18ca491dbbd5d7 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, 22 Sep 2021 15:00:49 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0437d10e359ea1cbefff8d17cd18ca491dbbd5d7 commit 0437d10e359ea1cbefff8d17cd18ca491dbbd5d7 Author: Warner Losh AuthorDate: 2021-09-22 14:47:12 +0000 Commit: Warner Losh CommitDate: 2021-09-22 15:00:16 +0000 direct commit: fix KBI for pci_dev Move all the new elemenets to the end of the structure for 13. We allocate this inside the linuxkpi code, so the size isn't enccoded in client modules. However, the offsets to the different fields are encoded. Tihs modifies 04456f711853, 40a215e38a4d, and 3a606aadf2e7 and will likely create merge conflicts there (and that's a good thing since the elements need to be moved to the end of the structure when merging). Tweak irq_ent to be binary compatible. Since this is inlined into the clients, all clients have to agree on the irq_ent offsets. Restore visibility to linux_kmem_cache_free_rcu linux_kmem_cache_free_rcu was made static in 10235ad0567f, however client drivers depended on calling it directly. Make it visible again to restore the 13.0-Release KBI for linuxkpi. Bump FreeBSD_version to 1300515 for restoration of 13.0 KBI. Since this commmit changes the linuxkpi KBI (this time back to 13.0 release to restore the status quo of), you'll need to recompile everything that uses it (you needed to earlier as well, but those were silent recompilation events). The plus side is that our packages (built using 13.0) for drm-kmod 5.4 work again on -stable systems. Reviewed by: bz, wulf Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31363 --- sys/compat/linuxkpi/common/include/linux/interrupt.h | 4 +++- sys/compat/linuxkpi/common/include/linux/pci.h | 16 ++++++++++------ sys/compat/linuxkpi/common/include/linux/slab.h | 2 ++ sys/compat/linuxkpi/common/src/linux_slab.c | 8 ++++---- sys/sys/param.h | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index 6770adad2293..066157f9b559 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -52,9 +52,11 @@ struct irq_ent { struct resource *res; void *arg; irqreturn_t (*handler)(int, void *); - irqreturn_t (*thread_handler)(int, void *); void *tag; unsigned int irq; + + /* XXX All new entries must be after this in stable/13 */ + irqreturn_t (*thread_handler)(int, void *); }; void linux_irq_handler(void *); diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 4784799d82b5..1ec7fe75388d 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -237,7 +237,6 @@ struct pci_dev { struct list_head links; struct pci_driver *pdrv; struct pci_bus *bus; - struct pci_dev *root; uint16_t device; uint16_t vendor; uint16_t subsystem_vendor; @@ -246,16 +245,21 @@ struct pci_dev { unsigned int devfn; uint32_t class; uint8_t revision; - bool managed; /* devres "pcim_*(). */ - bool want_iomap_res; bool msi_enabled; - bool msix_enabled; - phys_addr_t rom; - size_t romlen; TAILQ_HEAD(, pci_mmio_region) mmio; + + /* Add all new items at the end of the list in 13 */ + struct pci_dev *root; + phys_addr_t rom; + size_t romlen; + bool managed; /* devres "pcim_*(). */ + bool want_iomap_res; + bool msix_enabled; }; +/* XXX add kassert here on the mmio offset */ + /* We need some meta-struct to keep track of these for devres. */ struct pci_devres { bool enable_io; diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index ecd39d711eb4..23ba8b9c8ae7 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -210,5 +210,7 @@ extern void *lkpi_kmem_cache_zalloc(struct linux_kmem_cache *, gfp_t); extern void lkpi_kmem_cache_free(struct linux_kmem_cache *, void *); extern void linux_kmem_cache_destroy(struct linux_kmem_cache *); void linux_kfree_async(void *); +void linux_kmem_cache_free_rcu_callback(struct rcu_head *head); +void linux_kmem_cache_free_rcu(struct linux_kmem_cache *, void *); #endif /* _LINUX_SLAB_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 5dbd87b66d1a..35a88fd7cf42 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -96,7 +96,7 @@ linux_kmem_ctor(void *mem, int size, void *arg, int flags) return (0); } -static void +void linux_kmem_cache_free_rcu_callback(struct rcu_head *head) { struct linux_kmem_rcu *rcu = @@ -145,8 +145,8 @@ linux_kmem_cache_create(const char *name, size_t size, size_t align, return (c); } -static inline void -lkpi_kmem_cache_free_rcu(struct linux_kmem_cache *c, void *m) +void +linux_kmem_cache_free_rcu(struct linux_kmem_cache *c, void *m) { struct linux_kmem_rcu *rcu = LINUX_KMEM_TO_RCU(c, m); @@ -183,7 +183,7 @@ void lkpi_kmem_cache_free(struct linux_kmem_cache *c, void *m) { if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) - lkpi_kmem_cache_free_rcu(c, m); + linux_kmem_cache_free_rcu(c, m); else if (unlikely(curthread->td_critnest != 0)) lkpi_kmem_cache_free_async(c, m); else diff --git a/sys/sys/param.h b/sys/sys/param.h index ef5eb4206706..c1066baa59f2 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300515 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-branches@freebsd.org Wed Sep 22 23:16:15 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 A2FB4673F7A; Wed, 22 Sep 2021 23:16:15 +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 4HFDgg46hNz3n2R; Wed, 22 Sep 2021 23:16:15 +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 69524203CF; Wed, 22 Sep 2021 23:16:15 +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 18MNGFVM026245; Wed, 22 Sep 2021 23:16:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18MNGFS0026244; Wed, 22 Sep 2021 23:16:15 GMT (envelope-from git) Date: Wed, 22 Sep 2021 23:16:15 GMT Message-Id: <202109222316.18MNGFS0026244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 59a0ec578693 - stable/11 - Update OptionalObsoleteFiles.inc with NTP docs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 59a0ec578693887386ed787d2ee34d37f346eb80 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, 22 Sep 2021 23:16:15 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=59a0ec578693887386ed787d2ee34d37f346eb80 commit 59a0ec578693887386ed787d2ee34d37f346eb80 Author: Ed Maste AuthorDate: 2017-09-15 00:54:37 +0000 Commit: Ed Maste CommitDate: 2021-09-22 23:11:09 +0000 Update OptionalObsoleteFiles.inc with NTP docs The list of files for MK_NTP was incomplete. PR: 218193 Submitted by: brnrd MFC after: 1 week (cherry picked from commit 4154e70ea8dc0ac0d1639374ea3bc7b6c9744b9f) --- tools/build/mk/OptionalObsoleteFiles.inc | 203 +++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index fd0b3586f051..916f0a0703d5 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6961,16 +6961,26 @@ OLD_FILES+=usr/sbin/ntpdate OLD_FILES+=usr/sbin/ntpdc OLD_FILES+=usr/sbin/ntptime OLD_FILES+=usr/sbin/sntp +OLD_FILES+=usr/share/doc/ntp/access.html OLD_FILES+=usr/share/doc/ntp/accopt.html OLD_FILES+=usr/share/doc/ntp/assoc.html OLD_FILES+=usr/share/doc/ntp/audio.html +OLD_FILES+=usr/share/doc/ntp/authentic.html OLD_FILES+=usr/share/doc/ntp/authopt.html +OLD_FILES+=usr/share/doc/ntp/autokey.html +OLD_FILES+=usr/share/doc/ntp/bugs.html OLD_FILES+=usr/share/doc/ntp/build.html +OLD_FILES+=usr/share/doc/ntp/clock.html OLD_FILES+=usr/share/doc/ntp/clockopt.html +OLD_FILES+=usr/share/doc/ntp/cluster.html +OLD_FILES+=usr/share/doc/ntp/comdex.html OLD_FILES+=usr/share/doc/ntp/config.html OLD_FILES+=usr/share/doc/ntp/confopt.html OLD_FILES+=usr/share/doc/ntp/copyright.html OLD_FILES+=usr/share/doc/ntp/debug.html +OLD_FILES+=usr/share/doc/ntp/decode.html +OLD_FILES+=usr/share/doc/ntp/discipline.html +OLD_FILES+=usr/share/doc/ntp/discover.html OLD_FILES+=usr/share/doc/ntp/driver1.html OLD_FILES+=usr/share/doc/ntp/driver10.html OLD_FILES+=usr/share/doc/ntp/driver11.html @@ -6999,34 +7009,227 @@ OLD_FILES+=usr/share/doc/ntp/driver6.html OLD_FILES+=usr/share/doc/ntp/driver7.html OLD_FILES+=usr/share/doc/ntp/driver8.html OLD_FILES+=usr/share/doc/ntp/driver9.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver1.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver10.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver11.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver12.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver16.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver18.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver19.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver20.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver22.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver26.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver27.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver28.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver29.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver3.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver30.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver31.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver32.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver33.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver34.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver35.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver36.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver37.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver38.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver39.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver4.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver40.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver42.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver43.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver44.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver45.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver46.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver5.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver6.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver7.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver8.html +OLD_FILES+=usr/share/doc/ntp/drivers/driver9.html +OLD_FILES+=usr/share/doc/ntp/drivers/icons/home.gif +OLD_FILES+=usr/share/doc/ntp/drivers/icons/mail2.gif +OLD_FILES+=usr/share/doc/ntp/drivers/mx4200data.html +OLD_FILES+=usr/share/doc/ntp/drivers/oncore-shmem.html +OLD_FILES+=usr/share/doc/ntp/drivers/scripts/footer.txt +OLD_FILES+=usr/share/doc/ntp/drivers/scripts/style.css +OLD_FILES+=usr/share/doc/ntp/drivers/tf582_4.html OLD_FILES+=usr/share/doc/ntp/extern.html +OLD_FILES+=usr/share/doc/ntp/filter.html OLD_FILES+=usr/share/doc/ntp/hints.html +OLD_FILES+=usr/share/doc/ntp/hints/a-ux +OLD_FILES+=usr/share/doc/ntp/hints/aix +OLD_FILES+=usr/share/doc/ntp/hints/bsdi +OLD_FILES+=usr/share/doc/ntp/hints/changes +OLD_FILES+=usr/share/doc/ntp/hints/decosf1 +OLD_FILES+=usr/share/doc/ntp/hints/decosf2 +OLD_FILES+=usr/share/doc/ntp/hints/freebsd +OLD_FILES+=usr/share/doc/ntp/hints/hpux +OLD_FILES+=usr/share/doc/ntp/hints/linux +OLD_FILES+=usr/share/doc/ntp/hints/mpeix +OLD_FILES+=usr/share/doc/ntp/hints/notes-xntp-v3 +OLD_FILES+=usr/share/doc/ntp/hints/parse +OLD_FILES+=usr/share/doc/ntp/hints/refclocks +OLD_FILES+=usr/share/doc/ntp/hints/rs6000 +OLD_FILES+=usr/share/doc/ntp/hints/sco.html +OLD_FILES+=usr/share/doc/ntp/hints/sgi +OLD_FILES+=usr/share/doc/ntp/hints/solaris-dosynctodr.html +OLD_FILES+=usr/share/doc/ntp/hints/solaris.html +OLD_FILES+=usr/share/doc/ntp/hints/solaris.xtra.4023118 +OLD_FILES+=usr/share/doc/ntp/hints/solaris.xtra.4095849 +OLD_FILES+=usr/share/doc/ntp/hints/solaris.xtra.S99ntpd +OLD_FILES+=usr/share/doc/ntp/hints/solaris.xtra.patchfreq +OLD_FILES+=usr/share/doc/ntp/hints/sun4 +OLD_FILES+=usr/share/doc/ntp/hints/svr4-dell +OLD_FILES+=usr/share/doc/ntp/hints/svr4_package +OLD_FILES+=usr/share/doc/ntp/hints/todo +OLD_FILES+=usr/share/doc/ntp/hints/vxworks.html +OLD_FILES+=usr/share/doc/ntp/hints/winnt.html +OLD_FILES+=usr/share/doc/ntp/history.html OLD_FILES+=usr/share/doc/ntp/howto.html +OLD_FILES+=usr/share/doc/ntp/huffpuff.html +OLD_FILES+=usr/share/doc/ntp/icons/home.gif +OLD_FILES+=usr/share/doc/ntp/icons/mail2.gif +OLD_FILES+=usr/share/doc/ntp/icons/sitemap.png OLD_FILES+=usr/share/doc/ntp/index.html OLD_FILES+=usr/share/doc/ntp/kern.html +OLD_FILES+=usr/share/doc/ntp/kernpps.html +OLD_FILES+=usr/share/doc/ntp/keygen.html OLD_FILES+=usr/share/doc/ntp/ldisc.html +OLD_FILES+=usr/share/doc/ntp/leap.html OLD_FILES+=usr/share/doc/ntp/measure.html OLD_FILES+=usr/share/doc/ntp/miscopt.html OLD_FILES+=usr/share/doc/ntp/monopt.html +OLD_FILES+=usr/share/doc/ntp/msyslog.html OLD_FILES+=usr/share/doc/ntp/mx4200data.html OLD_FILES+=usr/share/doc/ntp/notes.html +OLD_FILES+=usr/share/doc/ntp/ntp-keygen.html +OLD_FILES+=usr/share/doc/ntp/ntp-wait.html +OLD_FILES+=usr/share/doc/ntp/ntp.conf.html +OLD_FILES+=usr/share/doc/ntp/ntp.keys.html +OLD_FILES+=usr/share/doc/ntp/ntp_conf.html OLD_FILES+=usr/share/doc/ntp/ntpd.html OLD_FILES+=usr/share/doc/ntp/ntpdate.html OLD_FILES+=usr/share/doc/ntp/ntpdc.html +OLD_FILES+=usr/share/doc/ntp/ntpdsim.html +OLD_FILES+=usr/share/doc/ntp/ntpdsim_new.html OLD_FILES+=usr/share/doc/ntp/ntpq.html +OLD_FILES+=usr/share/doc/ntp/ntpsnmpd.html OLD_FILES+=usr/share/doc/ntp/ntptime.html OLD_FILES+=usr/share/doc/ntp/ntptrace.html +OLD_FILES+=usr/share/doc/ntp/orphan.html OLD_FILES+=usr/share/doc/ntp/parsedata.html OLD_FILES+=usr/share/doc/ntp/parsenew.html OLD_FILES+=usr/share/doc/ntp/patches.html +OLD_FILES+=usr/share/doc/ntp/pic/9400n.jpg +OLD_FILES+=usr/share/doc/ntp/pic/alice11.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice13.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice15.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice23.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice31.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice32.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice35.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice38.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice44.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice47.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice51.gif +OLD_FILES+=usr/share/doc/ntp/pic/alice61.gif +OLD_FILES+=usr/share/doc/ntp/pic/barnstable.gif +OLD_FILES+=usr/share/doc/ntp/pic/beaver.gif +OLD_FILES+=usr/share/doc/ntp/pic/boom3.gif +OLD_FILES+=usr/share/doc/ntp/pic/boom3a.gif +OLD_FILES+=usr/share/doc/ntp/pic/boom4.gif +OLD_FILES+=usr/share/doc/ntp/pic/broad.gif +OLD_FILES+=usr/share/doc/ntp/pic/bustardfly.gif +OLD_FILES+=usr/share/doc/ntp/pic/c51.jpg +OLD_FILES+=usr/share/doc/ntp/pic/description.jpg +OLD_FILES+=usr/share/doc/ntp/pic/discipline.gif +OLD_FILES+=usr/share/doc/ntp/pic/dogsnake.gif +OLD_FILES+=usr/share/doc/ntp/pic/driver29.gif +OLD_FILES+=usr/share/doc/ntp/pic/driver43_1.gif +OLD_FILES+=usr/share/doc/ntp/pic/driver43_2.jpg +OLD_FILES+=usr/share/doc/ntp/pic/fg6021.gif +OLD_FILES+=usr/share/doc/ntp/pic/fg6039.jpg +OLD_FILES+=usr/share/doc/ntp/pic/fig_3_1.gif +OLD_FILES+=usr/share/doc/ntp/pic/flatheads.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt1.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt2.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt3.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt4.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt5.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt6.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt7.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt8.gif +OLD_FILES+=usr/share/doc/ntp/pic/flt9.gif +OLD_FILES+=usr/share/doc/ntp/pic/freq1211.gif +OLD_FILES+=usr/share/doc/ntp/pic/gadget.jpg +OLD_FILES+=usr/share/doc/ntp/pic/gps167.jpg +OLD_FILES+=usr/share/doc/ntp/pic/group.gif +OLD_FILES+=usr/share/doc/ntp/pic/hornraba.gif +OLD_FILES+=usr/share/doc/ntp/pic/igclock.gif +OLD_FILES+=usr/share/doc/ntp/pic/neoclock4x.gif +OLD_FILES+=usr/share/doc/ntp/pic/offset1211.gif +OLD_FILES+=usr/share/doc/ntp/pic/oncore_evalbig.gif +OLD_FILES+=usr/share/doc/ntp/pic/oncore_remoteant.jpg +OLD_FILES+=usr/share/doc/ntp/pic/oncore_utplusbig.gif +OLD_FILES+=usr/share/doc/ntp/pic/oz2.gif +OLD_FILES+=usr/share/doc/ntp/pic/panda.gif +OLD_FILES+=usr/share/doc/ntp/pic/pd_om006.gif +OLD_FILES+=usr/share/doc/ntp/pic/pd_om011.gif +OLD_FILES+=usr/share/doc/ntp/pic/peer.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo1a.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo3a.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo4.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo5.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo6.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo7.gif +OLD_FILES+=usr/share/doc/ntp/pic/pogo8.gif +OLD_FILES+=usr/share/doc/ntp/pic/pzf509.jpg +OLD_FILES+=usr/share/doc/ntp/pic/pzf511.jpg +OLD_FILES+=usr/share/doc/ntp/pic/rabbit.gif +OLD_FILES+=usr/share/doc/ntp/pic/radio2.jpg +OLD_FILES+=usr/share/doc/ntp/pic/sheepb.jpg +OLD_FILES+=usr/share/doc/ntp/pic/stack1a.jpg +OLD_FILES+=usr/share/doc/ntp/pic/stats.gif +OLD_FILES+=usr/share/doc/ntp/pic/sx5.gif +OLD_FILES+=usr/share/doc/ntp/pic/thunderbolt.jpg +OLD_FILES+=usr/share/doc/ntp/pic/time1.gif +OLD_FILES+=usr/share/doc/ntp/pic/tonea.gif +OLD_FILES+=usr/share/doc/ntp/pic/tribeb.gif +OLD_FILES+=usr/share/doc/ntp/pic/wingdorothy.gif +OLD_FILES+=usr/share/doc/ntp/poll.html OLD_FILES+=usr/share/doc/ntp/porting.html OLD_FILES+=usr/share/doc/ntp/pps.html OLD_FILES+=usr/share/doc/ntp/prefer.html OLD_FILES+=usr/share/doc/ntp/quick.html +OLD_FILES+=usr/share/doc/ntp/rate.html OLD_FILES+=usr/share/doc/ntp/rdebug.html OLD_FILES+=usr/share/doc/ntp/refclock.html OLD_FILES+=usr/share/doc/ntp/release.html +OLD_FILES+=usr/share/doc/ntp/scripts/accopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/audio.txt +OLD_FILES+=usr/share/doc/ntp/scripts/authopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/clockopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/command.txt +OLD_FILES+=usr/share/doc/ntp/scripts/config.txt +OLD_FILES+=usr/share/doc/ntp/scripts/confopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/external.txt +OLD_FILES+=usr/share/doc/ntp/scripts/footer.txt +OLD_FILES+=usr/share/doc/ntp/scripts/hand.txt +OLD_FILES+=usr/share/doc/ntp/scripts/install.txt +OLD_FILES+=usr/share/doc/ntp/scripts/manual.txt +OLD_FILES+=usr/share/doc/ntp/scripts/misc.txt +OLD_FILES+=usr/share/doc/ntp/scripts/miscopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/monopt.txt +OLD_FILES+=usr/share/doc/ntp/scripts/refclock.txt +OLD_FILES+=usr/share/doc/ntp/scripts/special.txt +OLD_FILES+=usr/share/doc/ntp/scripts/style.css +OLD_FILES+=usr/share/doc/ntp/select.html +OLD_FILES+=usr/share/doc/ntp/sitemap.html +OLD_FILES+=usr/share/doc/ntp/sntp.html +OLD_FILES+=usr/share/doc/ntp/stats.html OLD_FILES+=usr/share/doc/ntp/tickadj.html +OLD_FILES+=usr/share/doc/ntp/warp.html +OLD_FILES+=usr/share/doc/ntp/xleave.html OLD_DIRS+=usr/share/doc/ntp OLD_FILES+=usr/share/examples/etc/ntp.conf OLD_FILES+=usr/share/man/man1/sntp.1.gz From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:03:56 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 7C0146767C4; Thu, 23 Sep 2021 01:03:56 +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 4HFH3w305Jz3wLm; Thu, 23 Sep 2021 01:03:56 +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 401EF219E9; Thu, 23 Sep 2021 01:03:56 +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 18N13uHr073837; Thu, 23 Sep 2021 01:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N13uI4073836; Thu, 23 Sep 2021 01:03:56 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:03:56 GMT Message-Id: <202109230103.18N13uI4073836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 89edde19d3fe - stable/13 - psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89edde19d3fe13dd6596d9278542d27b42767e26 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: Thu, 23 Sep 2021 01:03:56 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=89edde19d3fe13dd6596d9278542d27b42767e26 commit 89edde19d3fe13dd6596d9278542d27b42767e26 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:37:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:57:08 +0000 psm(4): Disable KVM switch "jitter" clamping for absolute touchpads. r123442 introduced solution for clamping of PS/2 mice jitter when using a KVM. Solution is to buffer mouse packets for 0.050ms if mouse activity has not been seen for more than 0.5 seconds. Then flush that data to driver if no validation errors found or drop the entire queue otherwise. While it works well with relative devices it has issues with absolute ones Depending on history buffering may results in delaying of the touch front edge for 0.050ms that affects gesture processing (tap detection). As absolute touchpads usually are built-in devices we can safely disable bufferization and KVM jitter clamping to avoid such a delays. (cherry picked from commit bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa) --- sys/dev/atkbdc/psm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index f27a49f82a71..9b47a7a6b0c5 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -3134,8 +3134,12 @@ next: /* * If we've filled the queue then call the softintr ourselves, * otherwise schedule the interrupt for later. + * Do not postpone interrupts for absolute devices as it + * affects tap detection timings. */ - if (!timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || + if (sc->hw.model == MOUSE_MODEL_SYNAPTICS || + sc->hw.model == MOUSE_MODEL_ELANTECH || + !timeelapsed(&sc->lastsoftintr, psmsecs, psmusecs, &now) || (sc->pqueue_end == sc->pqueue_start)) { if ((sc->state & PSM_SOFTARMED) != 0) { sc->state &= ~PSM_SOFTARMED; From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:03:57 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 C5DA367643A; Thu, 23 Sep 2021 01:03:57 +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 4HFH3x3Xvwz3wNg; Thu, 23 Sep 2021 01:03:57 +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 5990C21957; Thu, 23 Sep 2021 01:03:57 +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 18N13v4C073861; Thu, 23 Sep 2021 01:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N13vdE073860; Thu, 23 Sep 2021 01:03:57 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:03:57 GMT Message-Id: <202109230103.18N13vdE073860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7683f19cbf40 - stable/13 - hkbd(4): Reduce diff with ukbd(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7683f19cbf40cd757bf514617a9dcbe938f2989a 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: Thu, 23 Sep 2021 01:03:57 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7683f19cbf40cd757bf514617a9dcbe938f2989a commit 7683f19cbf40cd757bf514617a9dcbe938f2989a Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:39:05 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:57:34 +0000 hkbd(4): Reduce diff with ukbd(4) (cherry picked from commit 3ef9023f935ff721f72ed44cf26911b9af72dba1) --- sys/dev/hid/hkbd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 55eba6d321ea..729602b12f3a 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -657,7 +657,6 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) uint32_t i; uint8_t id = 0; uint8_t modifiers; - int offset; HKBD_LOCK_ASSERT(sc); @@ -709,13 +708,15 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } else if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { - offset = sc->sc_loc_key[0].count; - if (offset < 0 || offset > len) - offset = len; - while (offset--) { + struct hid_location tmp_loc = sc->sc_loc_key[0]; + /* range check array size */ + if (tmp_loc.count > HKBD_NKEYCODE) + tmp_loc.count = HKBD_NKEYCODE; + while (tmp_loc.count--) { uint32_t key = - hid_get_data(buf + offset, len - offset, - &sc->sc_loc_key[i]); + hid_get_udata(buf, len, &tmp_loc); + /* advance to next location */ + tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); sc->sc_ndata = sc->sc_odata; From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:03:58 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 B3B2967635C; Thu, 23 Sep 2021 01:03:58 +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 4HFH3y4Khdz4Qtn; Thu, 23 Sep 2021 01:03:58 +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 74BFD21A57; Thu, 23 Sep 2021 01:03:58 +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 18N13w4S073887; Thu, 23 Sep 2021 01:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N13wHx073886; Thu, 23 Sep 2021 01:03:58 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:03:58 GMT Message-Id: <202109230103.18N13wHx073886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 1dec30a65a31 - stable/13 - hkbd(4): Use bitstring(3) KPI for key bitmaps processing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1dec30a65a3125ed02f1c83f9b1d22cfd11dbc86 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: Thu, 23 Sep 2021 01:03:58 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1dec30a65a3125ed02f1c83f9b1d22cfd11dbc86 commit 1dec30a65a3125ed02f1c83f9b1d22cfd11dbc86 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:39:46 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:57:57 +0000 hkbd(4): Use bitstring(3) KPI for key bitmaps processing. No functional changes intended. (cherry picked from commit 04918395f18dfb115dc0fe2865780dc607c5dc71) --- sys/dev/hid/hkbd.c | 160 ++++++++++++++++++++--------------------------------- 1 file changed, 61 insertions(+), 99 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 729602b12f3a..65e8b9446e9d 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -116,7 +117,7 @@ SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, #define HKBD_BUFFER_SIZE 64 /* bytes */ #define HKBD_KEY_PRESSED(map, key) ({ \ CTASSERT((key) >= 0 && (key) < HKBD_NKEYCODE); \ - ((map)[(key) / 64] & (1ULL << ((key) % 64))); \ + bit_test(map, key); \ }) #define MOD_EJECT 0x01 @@ -125,10 +126,6 @@ SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, #define MOD_MIN 0xe0 #define MOD_MAX 0xe7 -struct hkbd_data { - uint64_t bitmap[howmany(HKBD_NKEYCODE, 64)]; -}; - struct hkbd_softc { device_t sc_dev; @@ -136,7 +133,7 @@ struct hkbd_softc { keymap_t sc_keymap; accentmap_t sc_accmap; fkeytab_t sc_fkeymap[HKBD_NFKEY]; - uint64_t sc_loc_key_valid[howmany(HKBD_NKEYCODE, 64)]; + bitstr_t bit_decl(sc_loc_key_valid, HKBD_NKEYCODE); struct hid_location sc_loc_apple_eject; struct hid_location sc_loc_apple_fn; struct hid_location sc_loc_key[HKBD_NKEYCODE]; @@ -146,8 +143,8 @@ struct hkbd_softc { struct mtx sc_mtx; struct task sc_task; struct callout sc_callout; - struct hkbd_data sc_ndata; - struct hkbd_data sc_odata; + bitstr_t bit_decl(sc_ndata, HKBD_NKEYCODE); + bitstr_t bit_decl(sc_odata, HKBD_NKEYCODE); struct thread *sc_poll_thread; #ifdef EVDEV_SUPPORT @@ -328,23 +325,19 @@ static const struct evdev_methods hkbd_evdev_methods = { static bool hkbd_any_key_pressed(struct hkbd_softc *sc) { - bool ret = false; - unsigned i; + int result; - for (i = 0; i != howmany(HKBD_NKEYCODE, 64); i++) - ret |= (sc->sc_odata.bitmap[i] != 0); - return (ret); + bit_ffs(sc->sc_odata, HKBD_NKEYCODE, &result); + return (result != -1); } static bool hkbd_any_key_valid(struct hkbd_softc *sc) { - bool ret = false; - unsigned i; + int result; - for (i = 0; i != howmany(HKBD_NKEYCODE, 64); i++) - ret |= (sc->sc_loc_key_valid[i] != 0); - return (ret); + bit_ffs(sc->sc_loc_key_valid, HKBD_NKEYCODE, &result); + return (result != -1); } static bool @@ -487,65 +480,47 @@ hkbd_interrupt(struct hkbd_softc *sc) HKBD_LOCK_ASSERT(sc); - /* Check for key changes, the order is: - * 1. Modifier keys down - * 2. Regular keys up/down - * 3. Modifier keys up + /* + * Check for key changes, the order is: + * 1. Regular keys up + * 2. Modifier keys up + * 3. Modifier keys down + * 4. Regular keys down * * This allows devices which send events changing the state of * both a modifier key and a regular key, to be correctly * translated. */ - for (key = MOD_MIN; key <= MOD_MAX; key++) { - const uint64_t mask = 1ULL << (key % 64); + bit_foreach(sc->sc_odata, HKBD_NKEYCODE, key) { + if (hkbd_is_modifier_key(key) || bit_test(sc->sc_ndata, key)) + continue; + hkbd_put_key(sc, key | KEY_RELEASE); - if (!(sc->sc_odata.bitmap[key / 64] & mask) && - (sc->sc_ndata.bitmap[key / 64] & mask)) { - hkbd_put_key(sc, key | KEY_PRESS); - } + /* clear repeating key, if any */ + if (sc->sc_repeat_key == key) + sc->sc_repeat_key = 0; } - for (key = 0; key != HKBD_NKEYCODE; key++) { - const uint64_t mask = 1ULL << (key % 64); - const uint64_t delta = - sc->sc_odata.bitmap[key / 64] ^ - sc->sc_ndata.bitmap[key / 64]; - - if (hkbd_is_modifier_key(key)) + bit_foreach_at(sc->sc_odata, MOD_MIN, MOD_MAX + 1, key) + if (!bit_test(sc->sc_ndata, key)) + hkbd_put_key(sc, key | KEY_RELEASE); + bit_foreach_at(sc->sc_ndata, MOD_MIN, MOD_MAX + 1, key) + if (!bit_test(sc->sc_odata, key)) + hkbd_put_key(sc, key | KEY_PRESS); + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, key) { + if (hkbd_is_modifier_key(key) || bit_test(sc->sc_odata, key)) continue; + hkbd_put_key(sc, key | KEY_PRESS); - if (mask == 1 && delta == 0) { - key += 63; - continue; /* skip empty areas */ - } else if (delta & mask) { - if (sc->sc_odata.bitmap[key / 64] & mask) { - hkbd_put_key(sc, key | KEY_RELEASE); - - /* clear repeating key, if any */ - if (sc->sc_repeat_key == key) - sc->sc_repeat_key = 0; - } else { - hkbd_put_key(sc, key | KEY_PRESS); - - sc->sc_co_basetime = sbinuptime(); - sc->sc_delay = sc->sc_kbd.kb_delay1; - hkbd_start_timer(sc); - - /* set repeat time for last key */ - sc->sc_repeat_time = now + sc->sc_kbd.kb_delay1; - sc->sc_repeat_key = key; - } - } - } - for (key = MOD_MIN; key <= MOD_MAX; key++) { - const uint64_t mask = 1ULL << (key % 64); + sc->sc_co_basetime = sbinuptime(); + sc->sc_delay = sc->sc_kbd.kb_delay1; + hkbd_start_timer(sc); - if ((sc->sc_odata.bitmap[key / 64] & mask) && - !(sc->sc_ndata.bitmap[key / 64] & mask)) { - hkbd_put_key(sc, key | KEY_RELEASE); - } + /* set repeat time for last key */ + sc->sc_repeat_time = now + sc->sc_kbd.kb_delay1; + sc->sc_repeat_key = key; } /* synchronize old data with new data */ - sc->sc_odata = sc->sc_ndata; + memcpy(sc->sc_odata, sc->sc_ndata, bitstr_size(HKBD_NKEYCODE)); /* check if last key is still pressed */ if (sc->sc_repeat_key != 0) { @@ -679,7 +654,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } /* clear temporary storage */ - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); /* clear modifiers */ modifiers = 0; @@ -696,16 +671,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) modifiers |= MOD_FN; } - for (i = 0; i != HKBD_NKEYCODE; i++) { - const uint64_t valid = sc->sc_loc_key_valid[i / 64]; - const uint64_t mask = 1ULL << (i % 64); - - if (mask == 1 && valid == 0) { - i += 63; - continue; /* skip empty areas */ - } else if (~valid & mask) { - continue; /* location is not valid */ - } else if (id != sc->sc_id_loc_key[i]) { + bit_foreach(sc->sc_loc_key_valid, HKBD_NKEYCODE, i) { + if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { struct hid_location tmp_loc = sc->sc_loc_key[0]; @@ -719,7 +686,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); - sc->sc_ndata = sc->sc_odata; + memcpy(sc->sc_ndata, sc->sc_odata, + bitstr_size(HKBD_NKEYCODE)); return; /* ignore */ } if (modifiers & MOD_FN) @@ -729,7 +697,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) if (key == KEY_NONE || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ - sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); + bit_set(sc->sc_ndata, key); } } else if (hid_get_data(buf, len, &sc->sc_loc_key[i])) { uint32_t key = i; @@ -741,18 +709,13 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) if (key == KEY_NONE || key == KEY_ERROR || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ - sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); + bit_set(sc->sc_ndata, key); } } #ifdef HID_DEBUG DPRINTF("modifiers = 0x%04x\n", modifiers); - for (i = 0; i != HKBD_NKEYCODE; i++) { - const uint64_t valid = sc->sc_ndata.bitmap[i / 64]; - const uint64_t mask = 1ULL << (i % 64); - - if (valid & mask) - DPRINTF("Key 0x%02x pressed\n", i); - } + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, i) + DPRINTF("Key 0x%02x pressed\n", i); #endif hkbd_interrupt(sc); } @@ -795,7 +758,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, sc->sc_flags &= ~HKBD_FLAG_HID_MASK; /* reset detected keys */ - memset(sc->sc_loc_key_valid, 0, sizeof(sc->sc_loc_key_valid)); + memset(sc->sc_loc_key_valid, 0, bitstr_size(HKBD_NKEYCODE)); /* check if there is an ID byte */ sc->sc_kbd_size = hid_report_size_max(ptr, len, @@ -828,7 +791,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, if (flags & HIO_VARIABLE) { DPRINTFN(1, "Ignoring keyboard event control\n"); } else { - sc->sc_loc_key_valid[0] |= 1; + bit_set(sc->sc_loc_key_valid, 0); DPRINTFN(1, "Found keyboard event array\n"); } } @@ -840,8 +803,7 @@ hkbd_parse_hid(struct hkbd_softc *sc, const uint8_t *ptr, uint32_t len, hid_input, tlc_index, 0, &sc->sc_loc_key[key], &flags, &sc->sc_id_loc_key[key], NULL)) { if (flags & HIO_VARIABLE) { - sc->sc_loc_key_valid[key / 64] |= - 1ULL << (key % 64); + bit_set(sc->sc_loc_key_valid, key); DPRINTFN(1, "Found key 0x%02x\n", key); } } @@ -1057,7 +1019,7 @@ hkbd_detach(device_t dev) hidbus_intr_stop(dev); /* release all leftover keys, if any */ - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); /* process releasing of all keys */ HKBD_LOCK(sc); @@ -1305,11 +1267,11 @@ hkbd_read(keyboard_t *kbd, int wait) ++(kbd->kb_count); #ifdef HKBD_EMULATE_ATSCANCODE - keycode = hkbd_atkeycode(usbcode, sc->sc_ndata.bitmap); + keycode = hkbd_atkeycode(usbcode, sc->sc_ndata); if (keycode == NN) { return -1; } - return (hkbd_key2scan(sc, keycode, sc->sc_ndata.bitmap, + return (hkbd_key2scan(sc, keycode, sc->sc_ndata, (usbcode & KEY_RELEASE))); #else /* !HKBD_EMULATE_ATSCANCODE */ return (usbcode); @@ -1375,13 +1337,13 @@ next_code: #ifdef HKBD_EMULATE_ATSCANCODE /* USB key index -> key code -> AT scan code */ - keycode = hkbd_atkeycode(usbcode, sc->sc_ndata.bitmap); + keycode = hkbd_atkeycode(usbcode, sc->sc_ndata); if (keycode == NN) { return (NOKEY); } /* return an AT scan code for the K_RAW mode */ if (sc->sc_mode == K_RAW) { - return (hkbd_key2scan(sc, keycode, sc->sc_ndata.bitmap, + return (hkbd_key2scan(sc, keycode, sc->sc_ndata, (usbcode & KEY_RELEASE))); } #else /* !HKBD_EMULATE_ATSCANCODE */ @@ -1720,8 +1682,8 @@ hkbd_clear_state(keyboard_t *kbd) sc->sc_buffered_char[0] = 0; sc->sc_buffered_char[1] = 0; #endif - memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); - memset(&sc->sc_odata, 0, sizeof(sc->sc_odata)); + memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_odata, 0, bitstr_size(HKBD_NKEYCODE)); sc->sc_repeat_time = 0; sc->sc_repeat_key = 0; } @@ -1865,7 +1827,7 @@ hkbd_set_typematic(keyboard_t *kbd, int code) #ifdef HKBD_EMULATE_ATSCANCODE static uint32_t -hkbd_atkeycode(int usbcode, const uint64_t *bitmap) +hkbd_atkeycode(int usbcode, const bitstr_t *bitmap) { uint32_t keycode; @@ -1892,7 +1854,7 @@ hkbd_atkeycode(int usbcode, const uint64_t *bitmap) } static int -hkbd_key2scan(struct hkbd_softc *sc, int code, const uint64_t *bitmap, int up) +hkbd_key2scan(struct hkbd_softc *sc, int code, const bitstr_t *bitmap, int up) { static const int scan[] = { /* 89 */ From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:04:01 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 F2A2E67680C; Thu, 23 Sep 2021 01:04:00 +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 4HFH405zJPz4Qst; Thu, 23 Sep 2021 01:04:00 +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 AC329219EA; Thu, 23 Sep 2021 01:04:00 +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 18N140x8073939; Thu, 23 Sep 2021 01:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N140IF073938; Thu, 23 Sep 2021 01:04:00 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:04:00 GMT Message-Id: <202109230104.18N140IF073938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 9faebc1e664d - stable/13 - hkbd(4): Fix build on 32bit platforms MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9faebc1e664d675d2f1f6dc54e9735c39aa8b0e7 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: Thu, 23 Sep 2021 01:04:01 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9faebc1e664d675d2f1f6dc54e9735c39aa8b0e7 commit 9faebc1e664d675d2f1f6dc54e9735c39aa8b0e7 Author: Vladimir Kondratyev AuthorDate: 2021-09-09 22:49:26 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:59:37 +0000 hkbd(4): Fix build on 32bit platforms (cherry picked from commit 38d2e9314b127b3466e8ae4120e21fe1ad076dfc) --- sys/dev/hid/hkbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index bfd8e12df746..ad9b3dde3d37 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -301,8 +301,8 @@ static void hkbd_timeout(void *); static int hkbd_set_leds(struct hkbd_softc *, uint8_t); static int hkbd_set_typematic(keyboard_t *, int); #ifdef HKBD_EMULATE_ATSCANCODE -static uint32_t hkbd_atkeycode(int, const uint64_t *); -static int hkbd_key2scan(struct hkbd_softc *, int, const uint64_t *, int); +static uint32_t hkbd_atkeycode(int, const bitstr_t *); +static int hkbd_key2scan(struct hkbd_softc *, int, const bitstr_t *, int); #endif static uint32_t hkbd_read_char(keyboard_t *, int); static void hkbd_clear_state(keyboard_t *); From owner-dev-commits-src-branches@freebsd.org Thu Sep 23 01:04:00 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 F273D6762F4; Thu, 23 Sep 2021 01:03: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 4HFH3z5JyTz3wLv; Thu, 23 Sep 2021 01:03: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 825A7218D1; Thu, 23 Sep 2021 01:03: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 18N13xk1073915; Thu, 23 Sep 2021 01:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18N13xOp073914; Thu, 23 Sep 2021 01:03:59 GMT (envelope-from git) Date: Thu, 23 Sep 2021 01:03:59 GMT Message-Id: <202109230103.18N13xOp073914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 510b003ff412 - stable/13 - hkbd(4): Fix key repeats on multireport keyboards MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 510b003ff41291599cab3e45d463f3a3bf77d6eb 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: Thu, 23 Sep 2021 01:04:00 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=510b003ff41291599cab3e45d463f3a3bf77d6eb commit 510b003ff41291599cab3e45d463f3a3bf77d6eb Author: Vladimir Kondratyev AuthorDate: 2021-09-09 21:40:13 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-09-23 00:58:58 +0000 hkbd(4): Fix key repeats on multireport keyboards Currently hkbd counts all key states to be "Up" at the start of interrupt callback. That results in generation of "Key Up" event for each key that has been downed before but is not listed in current report while is still downed. Fix that with clearing of temporary key data storage bits only for keys contained in processed report. Reported by: Greg V Obtained from: sysutils/iichid (cherry picked from commit 598f0580f6822e2492231d055f49465a5b55d270) --- sys/dev/hid/hkbd.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 65e8b9446e9d..bfd8e12df746 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -143,8 +143,12 @@ struct hkbd_softc { struct mtx sc_mtx; struct task sc_task; struct callout sc_callout; + /* All reported keycodes */ bitstr_t bit_decl(sc_ndata, HKBD_NKEYCODE); bitstr_t bit_decl(sc_odata, HKBD_NKEYCODE); + /* Keycodes reported in array fields only */ + bitstr_t bit_decl(sc_ndata0, HKBD_NKEYCODE); + bitstr_t bit_decl(sc_odata0, HKBD_NKEYCODE); struct thread *sc_poll_thread; #ifdef EVDEV_SUPPORT @@ -520,6 +524,7 @@ hkbd_interrupt(struct hkbd_softc *sc) } /* synchronize old data with new data */ + memcpy(sc->sc_odata0, sc->sc_ndata0, bitstr_size(HKBD_NKEYCODE)); memcpy(sc->sc_odata, sc->sc_ndata, bitstr_size(HKBD_NKEYCODE)); /* check if last key is still pressed */ @@ -654,7 +659,14 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) } /* clear temporary storage */ - memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); + if (bit_test(sc->sc_loc_key_valid, 0) && id == sc->sc_id_loc_key[0]) { + bit_foreach(sc->sc_ndata0, HKBD_NKEYCODE, i) + bit_clear(sc->sc_ndata, i); + memset(&sc->sc_ndata0, 0, bitstr_size(HKBD_NKEYCODE)); + } + bit_foreach(sc->sc_ndata, HKBD_NKEYCODE, i) + if (id == sc->sc_id_loc_key[i]) + bit_clear(sc->sc_ndata, i); /* clear modifiers */ modifiers = 0; @@ -686,6 +698,8 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) tmp_loc.pos += tmp_loc.size; if (key == KEY_ERROR) { DPRINTF("KEY_ERROR\n"); + memcpy(sc->sc_ndata0, sc->sc_odata0, + bitstr_size(HKBD_NKEYCODE)); memcpy(sc->sc_ndata, sc->sc_odata, bitstr_size(HKBD_NKEYCODE)); return; /* ignore */ @@ -698,6 +712,7 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) continue; /* set key in bitmap */ bit_set(sc->sc_ndata, key); + bit_set(sc->sc_ndata0, key); } } else if (hid_get_data(buf, len, &sc->sc_loc_key[i])) { uint32_t key = i; @@ -1684,6 +1699,8 @@ hkbd_clear_state(keyboard_t *kbd) #endif memset(&sc->sc_ndata, 0, bitstr_size(HKBD_NKEYCODE)); memset(&sc->sc_odata, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_ndata0, 0, bitstr_size(HKBD_NKEYCODE)); + memset(&sc->sc_odata0, 0, bitstr_size(HKBD_NKEYCODE)); sc->sc_repeat_time = 0; sc->sc_repeat_key = 0; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:08:41 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 07EC56AF94B; Fri, 24 Sep 2021 00:08:41 +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 4HFsnh6pP9z4vBY; Fri, 24 Sep 2021 00:08:40 +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 C588446BA; Fri, 24 Sep 2021 00:08:40 +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 18O08eCp009437; Fri, 24 Sep 2021 00:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O08e6K009436; Fri, 24 Sep 2021 00:08:40 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:08:40 GMT Message-Id: <202109240008.18O08e6K009436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: ed03973908e5 - stable/13 - VOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed03973908e5b9cfe41a156f8b78445c332fc864 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: Fri, 24 Sep 2021 00:08:41 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ed03973908e5b9cfe41a156f8b78445c332fc864 commit ed03973908e5b9cfe41a156f8b78445c332fc864 Author: Rick Macklem AuthorDate: 2021-09-08 00:35:26 +0000 Commit: Rick Macklem CommitDate: 2021-09-24 00:04:29 +0000 VOP_COPY_FILE_RANGE: Add a COPY_FILE_RANGE_TIMEO1SEC flag Although it is not specified in the RFCs, the concept that the NFSv4 server should reply to an RPC request within a reasonable time is accepted practice within the NFSv4 community. Without this patch, the NFSv4.2 server attempts to reply to a Copy operation within 1second by limiting the copy to vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at best, given the large variation in I/O subsystem performance. This patch adds a kernel only flag COPY_FILE_RANGE_TIMEO1SEC that the NFSv4.2 can specify, which tells VOP_COPY_FILE_RANGE() to return after approximately 1 second with a partial result and implements this in vn_generic_copy_file_range(), used by vop_stdcopyfilerange(). Modifying the NFSv4.2 server to set this flag will be done in a separate patch. Also under consideration is exposing the COPY_FILE_RANGE_TIMEO1SEC to userland for use on the FreeBSD copy_file_range(2) syscall. Although this technically does change the VFS/VOP KAPI, I do not think the MFC will cause problems. (cherry picked from commit c5128c48df3c2f3828432aff2ea536bb9c887e14) --- sys/kern/vfs_vnops.c | 31 +++++++++++++++++++++++++++++-- sys/sys/vnode.h | 4 ++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8f5442bf3429..8ff78b9d6319 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3142,6 +3142,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, size_t copylen, len, rem, savlen; char *dat; long holein, holeout; + struct timespec curts, endts; holein = holeout = 0; savlen = len = *lenp; @@ -3238,7 +3239,15 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, * in the inner loop where the data copying is done. * Note that some file systems such as NFSv3, NFSv4.0 and NFSv4.1 may * support holes on the server, but do not support FIOSEEKHOLE. + * The kernel flag COPY_FILE_RANGE_TIMEO1SEC is used to indicate + * that this function should return after 1second with a partial + * completion. */ + if ((flags & COPY_FILE_RANGE_TIMEO1SEC) != 0) { + getnanouptime(&endts); + endts.tv_sec++; + } else + timespecclear(&endts); holetoeof = eof = false; while (len > 0 && error == 0 && !eof && interrupted == 0) { endoff = 0; /* To shut up compilers. */ @@ -3307,8 +3316,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, *inoffp += xfer; *outoffp += xfer; len -= xfer; - if (len < savlen) + if (len < savlen) { interrupted = sig_intr(); + if (timespecisset(&endts) && + interrupted == 0) { + getnanouptime(&curts); + if (timespeccmp(&curts, + &endts, >=)) + interrupted = + EINTR; + } + } } } copylen = MIN(len, endoff - startoff); @@ -3371,8 +3389,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, *outoffp += xfer; copylen -= xfer; len -= xfer; - if (len < savlen) + if (len < savlen) { interrupted = sig_intr(); + if (timespecisset(&endts) && + interrupted == 0) { + getnanouptime(&curts); + if (timespeccmp(&curts, + &endts, >=)) + interrupted = + EINTR; + } + } } } xfer = blksize; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 8336fd859781..4a2581cb3db3 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -613,6 +613,10 @@ typedef void vop_getpages_iodone_t(void *, vm_page_t *, int, int); #define VN_OPEN_NAMECACHE 0x00000004 #define VN_OPEN_INVFS 0x00000008 +/* copy_file_range kernel flags */ +#define COPY_FILE_RANGE_KFLAGS 0xff000000 +#define COPY_FILE_RANGE_TIMEO1SEC 0x01000000 /* Return after 1sec. */ + /* * Public vnode manipulation functions. */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:02 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 6F6BD6AFCFF; Fri, 24 Sep 2021 00:40:02 +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 4HFtTt2PLPz3FDc; Fri, 24 Sep 2021 00:40:02 +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 32EF85102; Fri, 24 Sep 2021 00:40:02 +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 18O0e21s050558; Fri, 24 Sep 2021 00:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e2DJ050553; Fri, 24 Sep 2021 00:40:02 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:02 GMT Message-Id: <202109240040.18O0e2DJ050553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fc58a6f8e6b4 - stable/13 - buffer pager: allow get_blksize method to return error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc58a6f8e6b4781ff1c6fd770ab96f9215a3d104 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: Fri, 24 Sep 2021 00:40:02 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fc58a6f8e6b4781ff1c6fd770ab96f9215a3d104 commit fc58a6f8e6b4781ff1c6fd770ab96f9215a3d104 Author: Konstantin Belousov AuthorDate: 2021-09-16 23:53:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 buffer pager: allow get_blksize method to return error (cherry picked from commit 197a4f29f39e6ae6215a6dbd28ef449d305e6d49) --- sys/fs/cd9660/cd9660_vnops.c | 5 +++-- sys/fs/fuse/fuse_vnops.c | 5 +++-- sys/fs/msdosfs/msdosfs_vnops.c | 5 +++-- sys/fs/nfsclient/nfs_clbio.c | 5 +++-- sys/kern/vfs_bio.c | 16 ++++++++++------ sys/sys/buf.h | 2 +- sys/ufs/ffs/ffs_vnops.c | 5 +++-- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 500ff79716be..0ddf73548e3f 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -858,12 +858,13 @@ cd9660_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn) +cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { struct iso_node *ip; ip = VTOI(vp); - return (blksize(ip->i_mnt, ip, lbn)); + *sz = blksize(ip->i_mnt, ip, lbn); + return (0); } static int diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index adb297b6aacb..1216c1252f2b 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -2199,7 +2199,7 @@ fuse_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn) +fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { off_t filesize; int blksz, err; @@ -2217,7 +2217,8 @@ fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn) } else { blksz = biosize; } - return (blksz); + *sz = blksz; + return (0); } /* diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 421afc3ec290..dda45ddda2a4 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1861,10 +1861,11 @@ msdosfs_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn) +msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { - return (VTODE(vp)->de_pmp->pm_bpcluster); + *sz = VTODE(vp)->de_pmp->pm_bpcluster; + return (0); } static int diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index ff9f446ff1ef..10a76f0a4b83 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -94,7 +94,7 @@ ncl_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) +ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { struct nfsnode *np; u_quad_t nsize; @@ -111,7 +111,8 @@ ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) bcount = 0; else if ((off_t)(lbn + 1) * biosize > nsize) bcount = nsize - (off_t)lbn * biosize; - return (bcount); + *sz = bcount; + return (0); } int diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 8519afe96633..74dc2feb9ea6 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -5177,8 +5177,8 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int count, struct mount *mp; daddr_t lbn, lbnp; vm_ooffset_t la, lb, poff, poffe; - long bsize; - int bo_bs, br_flags, error, i, pgsin, pgsin_a, pgsin_b; + long bo_bs, bsize; + int br_flags, error, i, pgsin, pgsin_a, pgsin_b; bool redo, lpart; object = vp->v_object; @@ -5195,7 +5195,10 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int count, */ la += PAGE_SIZE; lpart = la > object->un_pager.vnp.vnp_size; - bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); + error = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex)), + &bo_bs); + if (error != 0) + return (VM_PAGER_ERROR); /* * Calculate read-ahead, behind and total pages. @@ -5251,9 +5254,10 @@ again: goto next_page; lbnp = lbn; - bsize = get_blksize(vp, lbn); - error = bread_gb(vp, lbn, bsize, curthread->td_ucred, - br_flags, &bp); + error = get_blksize(vp, lbn, &bsize); + if (error == 0) + error = bread_gb(vp, lbn, bsize, + curthread->td_ucred, br_flags, &bp); if (error != 0) goto end_pages; if (bp->b_rcred == curthread->td_ucred) { diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 2997560b9ab3..86f5fbef7c92 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -595,7 +595,7 @@ void bwait(struct buf *, u_char, const char *); void bdone(struct buf *); typedef daddr_t (vbg_get_lblkno_t)(struct vnode *, vm_ooffset_t); -typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t); +typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t, long *); int vfs_bio_getpages(struct vnode *vp, struct vm_page **ma, int count, int *rbehind, int *rahead, vbg_get_lblkno_t get_lblkno, vbg_get_blksize_t get_blksize); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index e834a6b4f50a..7b2c70af54c9 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1935,10 +1935,11 @@ ffs_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn) +ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { - return (blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn)); + *sz = blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn); + return (0); } static int From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:03 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 9E8406AFFF7; Fri, 24 Sep 2021 00:40:03 +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 4HFtTv3Q8sz3FBh; Fri, 24 Sep 2021 00:40:03 +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 544474EBF; Fri, 24 Sep 2021 00:40:03 +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 18O0e3X6050770; Fri, 24 Sep 2021 00:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e3vv050767; Fri, 24 Sep 2021 00:40:03 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:03 GMT Message-Id: <202109240040.18O0e3vv050767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e79a18dadf83 - stable/13 - procctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e79a18dadf83b7bdcab1c2ba8b43b9a508810d22 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: Fri, 24 Sep 2021 00:40:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e79a18dadf83b7bdcab1c2ba8b43b9a508810d22 commit e79a18dadf83b7bdcab1c2ba8b43b9a508810d22 Author: Edward Tomasz Napierala AuthorDate: 2021-07-01 08:11:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 procctl(2): add PROC_NO_NEW_PRIVS_CTL, PROC_NO_NEW_PRIVS_STATUS (cherry picked from commit db8d680ebe9b12c7d9e0eb8bf9940fcef709f5ec) --- lib/libc/sys/procctl.2 | 27 ++++++++++++++++++++++++++- sys/compat/freebsd32/freebsd32_misc.c | 3 +++ sys/kern/kern_exec.c | 5 +++-- sys/kern/kern_fork.c | 2 +- sys/kern/kern_procctl.c | 32 ++++++++++++++++++++++++++++++++ sys/sys/proc.h | 1 + sys/sys/procctl.h | 5 +++++ 7 files changed, 71 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 index f85825d8cc6f..432ed5919a81 100644 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2020 +.Dd July 1, 2021 .Dt PROCCTL 2 .Os .Sh NAME @@ -564,6 +564,31 @@ Stack gaps are enabled in the process after Stack gaps are disabled in the process after .Xr execve 2 . .El +.It Dv PROC_NO_NEW_PRIVS_CTL +Allows one to ignore the SUID and SGID bits on the program +images activated by +.Xr execve 2 +in the specified process and its future descendants. +The +.Fa data +parameter must point to the integer variable holding the following +value: +.Bl -tag -width PROC_NO_NEW_PRIVS_ENABLE +.It Dv PROC_NO_NEW_PRIVS_ENABLE +Request SUID and SGID bits to be ignored. +.El +.Pp +It is not possible to disable it once it has been enabled. +.It Dv PROC_NO_NEW_PRIVS_STATUS +Returns the current status of SUID/SGID enablement for the target process. +The +.Fa data +parameter must point to the integer variable, where one of the +following values is written: +.Bl -tag -width PROC_NO_NEW_PRIVS_DISABLE +.It Dv PROC_NO_NEW_PRIVS_ENABLE +.It Dv PROC_NO_NEW_PRIVS_DISABLE +.El .El .Sh x86 MACHINE-SPECIFIC REQUESTS .Bl -tag -width PROC_KPTI_STATUS diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index d258afa2352d..cefae53b69df 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3631,6 +3631,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: + case PROC_NO_NEW_PRIVS_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); if (error != 0) return (error); @@ -3664,6 +3665,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_NO_NEW_PRIVS_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -3695,6 +3697,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_NO_NEW_PRIVS_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 491e5332c834..0611eedcec73 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -776,8 +776,9 @@ interpret: signotify(td); } - if (imgp->sysent->sv_setid_allowed != NULL && - !(*imgp->sysent->sv_setid_allowed)(td, imgp)) + if ((imgp->sysent->sv_setid_allowed != NULL && + !(*imgp->sysent->sv_setid_allowed)(td, imgp)) || + (p->p_flag2 & P2_NO_NEW_PRIVS) != 0) execve_nosetid(imgp); /* diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0d0659b432fe..7a80f7de85d8 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -492,7 +492,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE | P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE | P2_TRAPCAP | - P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC); + P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC | P2_NO_NEW_PRIVS); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index b2694fd0c32c..68fa4bc0c3ac 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -419,6 +419,27 @@ trapcap_status(struct thread *td, struct proc *p, int *data) return (0); } +static int +no_new_privs_ctl(struct thread *td, struct proc *p, int state) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + + if (state != PROC_NO_NEW_PRIVS_ENABLE) + return (EINVAL); + p->p_flag2 |= P2_NO_NEW_PRIVS; + return (0); +} + +static int +no_new_privs_status(struct thread *td, struct proc *p, int *data) +{ + + *data = (p->p_flag2 & P2_NO_NEW_PRIVS) != 0 ? + PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE; + return (0); +} + static int protmax_ctl(struct thread *td, struct proc *p, int state) { @@ -601,6 +622,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_STACKGAP_CTL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: + case PROC_NO_NEW_PRIVS_CTL: error = copyin(uap->data, &flags, sizeof(flags)); if (error != 0) return (error); @@ -632,6 +654,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_NO_NEW_PRIVS_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -662,6 +685,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_NO_NEW_PRIVS_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; @@ -711,6 +735,10 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data) return (trapcap_ctl(td, p, *(int *)data)); case PROC_TRAPCAP_STATUS: return (trapcap_status(td, p, data)); + case PROC_NO_NEW_PRIVS_CTL: + return (no_new_privs_ctl(td, p, *(int *)data)); + case PROC_NO_NEW_PRIVS_STATUS: + return (no_new_privs_status(td, p, data)); default: return (EINVAL); } @@ -741,6 +769,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_TRAPCAP_STATUS: case PROC_PDEATHSIG_CTL: case PROC_PDEATHSIG_STATUS: + case PROC_NO_NEW_PRIVS_CTL: + case PROC_NO_NEW_PRIVS_STATUS: if (idtype != P_PID) return (EINVAL); } @@ -773,6 +803,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_REAP_KILL: case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: + case PROC_NO_NEW_PRIVS_CTL: sx_slock(&proctree_lock); tree_locked = true; break; @@ -789,6 +820,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_STACKGAP_STATUS: case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: + case PROC_NO_NEW_PRIVS_STATUS: tree_locked = false; break; default: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 138e763f2f11..15e175bf5aad 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -824,6 +824,7 @@ struct proc { after exec */ #define P2_ITSTOPPED 0x00002000 #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ +#define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h index 90fb149830dc..cc0279fb0d08 100644 --- a/sys/sys/procctl.h +++ b/sys/sys/procctl.h @@ -63,6 +63,8 @@ #define PROC_PROTMAX_STATUS 16 /* query implicit PROT_MAX status */ #define PROC_STACKGAP_CTL 17 /* en/dis stack gap on MAP_STACK */ #define PROC_STACKGAP_STATUS 18 /* query stack gap */ +#define PROC_NO_NEW_PRIVS_CTL 19 /* disable setuid/setgid */ +#define PROC_NO_NEW_PRIVS_STATUS 20 /* query suid/sgid disabled status */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -141,6 +143,9 @@ struct procctl_reaper_kill { #define PROC_STACKGAP_ENABLE_EXEC 0x0004 #define PROC_STACKGAP_DISABLE_EXEC 0x0008 +#define PROC_NO_NEW_PRIVS_ENABLE 1 +#define PROC_NO_NEW_PRIVS_DISABLE 2 + #ifndef _KERNEL __BEGIN_DECLS int procctl(idtype_t, id_t, int, void *); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:05 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 C1A046B014A; Fri, 24 Sep 2021 00:40:05 +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 4HFtTx4HHqz3Dy5; Fri, 24 Sep 2021 00:40:05 +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 740554EC0; Fri, 24 Sep 2021 00:40:05 +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 18O0e5Ou051196; Fri, 24 Sep 2021 00:40:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e5l0051194; Fri, 24 Sep 2021 00:40:05 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:05 GMT Message-Id: <202109240040.18O0e5l0051194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9ebc7d49be17 - stable/13 - Style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ebc7d49be1754d8a8dd815b38579349bfcf1b0b 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: Fri, 24 Sep 2021 00:40:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ebc7d49be1754d8a8dd815b38579349bfcf1b0b commit 9ebc7d49be1754d8a8dd815b38579349bfcf1b0b Author: Konstantin Belousov AuthorDate: 2021-09-01 23:23:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 Style (cherry picked from commit 1349891a0eed79625faafa5ad354d65ff9ea6012) --- usr.bin/proccontrol/proccontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 9f185de025c1..8b34ecbb06d4 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -178,7 +178,8 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, &arg); break; case MODE_NO_NEW_PRIVS: - error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, &arg); + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, + &arg); break; #ifdef PROC_KPTI_CTL case MODE_KPTI: @@ -349,7 +350,8 @@ main(int argc, char *argv[]) case MODE_NO_NEW_PRIVS: arg = enable ? PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE; - error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, &arg); + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, + &arg); break; #ifdef PROC_KPTI_CTL case MODE_KPTI: From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:04 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 E6A656AFFF8; Fri, 24 Sep 2021 00:40:04 +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 4HFtTw5TJPz3FMh; Fri, 24 Sep 2021 00:40:04 +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 6144D4F9A; Fri, 24 Sep 2021 00:40:04 +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 18O0e4WC050985; Fri, 24 Sep 2021 00:40:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e4Db050982; Fri, 24 Sep 2021 00:40:04 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:04 GMT Message-Id: <202109240040.18O0e4Db050982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 425641290023 - stable/13 - proccontrol(1): implement 'nonewprivs' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 42564129002352e1ff622125edc5d038aa15d4c4 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: Fri, 24 Sep 2021 00:40:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=42564129002352e1ff622125edc5d038aa15d4c4 commit 42564129002352e1ff622125edc5d038aa15d4c4 Author: Edward Tomasz Napierala AuthorDate: 2021-07-02 07:49:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 proccontrol(1): implement 'nonewprivs' (cherry picked from commit acb1f1269c6f4ff89a0d28ba742f6687e9ef779d) --- usr.bin/proccontrol/proccontrol.1 | 5 ++++- usr.bin/proccontrol/proccontrol.c | 23 ++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index 4445bb5f9f8e..b4ed6c268a6a 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2019 +.Dd July 2, 2021 .Dt PROCCONTROL 1 .Os .Sh NAME @@ -69,6 +69,9 @@ Controls the signalling of capability mode access violations. .It Ar protmax Controls the implicit PROT_MAX application for .Xr mmap 2 . +.It Ar nonewprivs +Controls disabling the setuid and sgid bits for +.Xr execve 2 . .It Ar kpti Controls the KPTI enable, AMD64 only. .It Ar la48 diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index edcc23a3cb34..9f185de025c1 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -45,6 +45,7 @@ enum { MODE_TRAPCAP, MODE_PROTMAX, MODE_STACKGAP, + MODE_NO_NEW_PRIVS, #ifdef PROC_KPTI_CTL MODE_KPTI, #endif @@ -84,7 +85,7 @@ usage(void) { fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|" - "stackgap"KPTI_USAGE LA_USAGE") [-q] " + "stackgap|nonewprivs"KPTI_USAGE LA_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -113,6 +114,8 @@ main(int argc, char *argv[]) mode = MODE_TRAPCAP; else if (strcmp(optarg, "stackgap") == 0) mode = MODE_STACKGAP; + else if (strcmp(optarg, "nonewprivs") == 0) + mode = MODE_NO_NEW_PRIVS; #ifdef PROC_KPTI_CTL else if (strcmp(optarg, "kpti") == 0) mode = MODE_KPTI; @@ -174,6 +177,9 @@ main(int argc, char *argv[]) case MODE_STACKGAP: error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, &arg); break; + case MODE_NO_NEW_PRIVS: + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); @@ -264,6 +270,16 @@ main(int argc, char *argv[]) break; } break; + case MODE_NO_NEW_PRIVS: + switch (arg) { + case PROC_NO_NEW_PRIVS_ENABLE: + printf("enabled\n"); + break; + case PROC_NO_NEW_PRIVS_DISABLE: + printf("disabled\n"); + break; + } + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: switch (arg & ~PROC_KPTI_STATUS_ACTIVE) { @@ -330,6 +346,11 @@ main(int argc, char *argv[]) PROC_STACKGAP_DISABLE_EXEC); error = procctl(P_PID, pid, PROC_STACKGAP_CTL, &arg); break; + case MODE_NO_NEW_PRIVS: + arg = enable ? PROC_NO_NEW_PRIVS_ENABLE : + PROC_NO_NEW_PRIVS_DISABLE; + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: arg = enable ? PROC_KPTI_CTL_ENABLE_ON_EXEC : From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:08 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 485F06B060B; Fri, 24 Sep 2021 00:40:08 +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 4HFtV001Byz3Dvw; Fri, 24 Sep 2021 00:40:07 +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 A6F654F27; Fri, 24 Sep 2021 00:40:07 +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 18O0e7PI051627; Fri, 24 Sep 2021 00:40:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e7ST051624; Fri, 24 Sep 2021 00:40:07 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:07 GMT Message-Id: <202109240040.18O0e7ST051624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 492a76bcd6d5 - stable/13 - proccontrol(1): Add wxmap control MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 492a76bcd6d50ae8fea4ed770af53cbc7d1c82b3 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: Fri, 24 Sep 2021 00:40:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=492a76bcd6d50ae8fea4ed770af53cbc7d1c82b3 commit 492a76bcd6d50ae8fea4ed770af53cbc7d1c82b3 Author: Konstantin Belousov AuthorDate: 2021-09-01 23:27:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 proccontrol(1): Add wxmap control (cherry picked from commit ac8af1938085dae0df32db3229c9d5cb659b90a4) --- usr.bin/proccontrol/proccontrol.1 | 4 +++- usr.bin/proccontrol/proccontrol.c | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index b4ed6c268a6a..09ec49431293 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2021 +.Dd September 2, 2021 .Dt PROCCONTROL 1 .Os .Sh NAME @@ -72,6 +72,8 @@ Controls the implicit PROT_MAX application for .It Ar nonewprivs Controls disabling the setuid and sgid bits for .Xr execve 2 . +.It Ar wxmap +Controls the write exclusive execute mode for mappings. .It Ar kpti Controls the KPTI enable, AMD64 only. .It Ar la48 diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 8b34ecbb06d4..d9237c4c6b33 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -46,6 +46,7 @@ enum { MODE_PROTMAX, MODE_STACKGAP, MODE_NO_NEW_PRIVS, + MODE_WXMAP, #ifdef PROC_KPTI_CTL MODE_KPTI, #endif @@ -85,7 +86,7 @@ usage(void) { fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|" - "stackgap|nonewprivs"KPTI_USAGE LA_USAGE") [-q] " + "stackgap|nonewprivs|wxmap"KPTI_USAGE LA_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -116,6 +117,8 @@ main(int argc, char *argv[]) mode = MODE_STACKGAP; else if (strcmp(optarg, "nonewprivs") == 0) mode = MODE_NO_NEW_PRIVS; + else if (strcmp(optarg, "wxmap") == 0) + mode = MODE_WXMAP; #ifdef PROC_KPTI_CTL else if (strcmp(optarg, "kpti") == 0) mode = MODE_KPTI; @@ -181,6 +184,9 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, &arg); break; + case MODE_WXMAP: + error = procctl(P_PID, pid, PROC_WXMAP_STATUS, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); @@ -281,6 +287,17 @@ main(int argc, char *argv[]) break; } break; + case MODE_WXMAP: + if ((arg & PROC_WX_MAPPINGS_PERMIT) != 0) + printf("enabled"); + else + printf("disabled"); + if ((arg & PROC_WX_MAPPINGS_DISALLOW_EXEC) != 0) + printf(", disabled on exec"); + if ((arg & PROC_WXORX_ENFORCE) != 0) + printf(", wxorx enforced"); + printf("\n"); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: switch (arg & ~PROC_KPTI_STATUS_ACTIVE) { @@ -353,6 +370,11 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, &arg); break; + case MODE_WXMAP: + arg = enable ? PROC_WX_MAPPINGS_PERMIT : + PROC_WX_MAPPINGS_DISALLOW_EXEC; + error = procctl(P_PID, pid, PROC_WXMAP_CTL, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: arg = enable ? PROC_KPTI_CTL_ENABLE_ON_EXEC : From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:40:07 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 0FB486B0522; Fri, 24 Sep 2021 00:40:07 +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 4HFtTy5SgMz3FKX; Fri, 24 Sep 2021 00:40:06 +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 8E51C4E2E; Fri, 24 Sep 2021 00:40:06 +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 18O0e6wG051412; Fri, 24 Sep 2021 00:40:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0e6Bu051408; Fri, 24 Sep 2021 00:40:06 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:40:06 GMT Message-Id: <202109240040.18O0e6Bu051408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d4a478c2703d - stable/13 - procctl(2): Add PROC_WXMAP_CTL/STATUS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4a478c2703d71b7cbbfc4e7d281b96dde2497d6 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: Fri, 24 Sep 2021 00:40:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a478c2703d71b7cbbfc4e7d281b96dde2497d6 commit d4a478c2703d71b7cbbfc4e7d281b96dde2497d6 Author: Konstantin Belousov AuthorDate: 2021-09-02 00:59:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-24 00:26:59 +0000 procctl(2): Add PROC_WXMAP_CTL/STATUS (cherry picked from commit 796a8e1ad1ae3f7b8e4c9f97bebbef5d7d5a2c16) --- lib/libc/sys/procctl.2 | 64 ++++++++++++++++++++++++++++- sys/compat/freebsd32/freebsd32_misc.c | 3 ++ sys/kern/imgact_elf.c | 7 +++- sys/kern/kern_fork.c | 3 +- sys/kern/kern_procctl.c | 76 +++++++++++++++++++++++++++++++++++ sys/sys/proc.h | 2 + sys/sys/procctl.h | 6 +++ 7 files changed, 157 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 index 432ed5919a81..4308520b8974 100644 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2021 +.Dd September 2, 2021 .Dt PROCCTL 2 .Os .Sh NAME @@ -589,6 +589,62 @@ following values is written: .It Dv PROC_NO_NEW_PRIVS_ENABLE .It Dv PROC_NO_NEW_PRIVS_DISABLE .El +.It Dv PROC_WXMAP_CTL +Controls the 'write exclusive against execution' permissions for the +mappings in the process address space. +It overrides the global settings established by the +.Dv kern.elf{32/64}.allow_wx +sysctl, +and the corresponding bit in the ELF control note, see +.Xr elfctl 1 . +.Pp +The +.Fa data +parameter must point to the integer variable holding one of the +following values: +.Bl -tag -width PROC_WX_MAPPINGS_DISALLOW_EXEC +.It Dv PROC_WX_MAPPINGS_PERMIT +Enable creation of mappings that have both write and execute +protection attributes, in the specified process' address space. +.It Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +In the new address space created by +.Xr execve 2 , +disallow creation of mappings that have both write and execute +permissions. +.El +.Pp +Once creation of writeable and executable mappings is allowed, +it is impossible (and pointless) to disallow it. +The only way to ensure the absence of such mappings after they +were enabled in a given process, is to set the +.Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +flag and +.Xr execve 2 +an image. +.It Dv PROC_WXMAP_STATUS +Returns the current status of the 'write exclusive against execution' +enforcement for the specified process. +The +.Dv data +parameter must point to the integer variable, where one of the +following values is written: +.Bl -tag -width PROC_WX_MAPPINGS_DISALLOW_EXEC +.It Dv PROC_WX_MAPPINGS_PERMIT +Creation of simultaneously writable and executable mapping is permitted, +otherwise the process cannot create such mappings. +.It Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +After +.Xr execve 2 , +the new address space should disallow creation of simultaneously +writable and executable mappings. +.El +.Pp +Additionally, if the address space of the process disallows +creation of simultaneously writable and executable mappings and +it is guaranteed that no such mapping was created since address space +creation, the +.Dv PROC_WXORX_ENFORCE +flag is set in the returned value. .El .Sh x86 MACHINE-SPECIFIC REQUESTS .Bl -tag -width PROC_KPTI_STATUS @@ -638,6 +694,12 @@ feature, as it is bypassable both by the kernel and privileged processes, and via other system mechanisms. As such, it should not be utilized to reliably protect cryptographic keying material or other confidential data. +.Pp +Note that processes can trivially bypass the 'no simultaneously +writable and executable mappings' policy by first marking some mapping +as writeable and write code to it, then removing write and adding +execute permission. +This may be legitimately required by some programs, such as JIT compilers. .Sh RETURN VALUES If an error occurs, a value of -1 is returned and .Va errno diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index cefae53b69df..c5bf67a72afd 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3632,6 +3632,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: case PROC_NO_NEW_PRIVS_CTL: + case PROC_WXMAP_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); if (error != 0) return (error); @@ -3666,6 +3667,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -3698,6 +3700,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 9d039b914fb5..057c583324bb 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1219,7 +1219,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) */ if (imgp->credential_setid) { PROC_LOCK(imgp->proc); - imgp->proc->p_flag2 &= ~(P2_ASLR_ENABLE | P2_ASLR_DISABLE); + imgp->proc->p_flag2 &= ~(P2_ASLR_ENABLE | P2_ASLR_DISABLE | + P2_WXORX_DISABLE | P2_WXORX_ENABLE_EXEC); PROC_UNLOCK(imgp->proc); } if ((sv->sv_flags & SV_ASLR) == 0 || @@ -1242,7 +1243,9 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) imgp->map_flags |= MAP_ASLR_IGNSTART; } - if (!__elfN(allow_wx) && (fctl0 & NT_FREEBSD_FCTL_WXNEEDED) == 0) + if ((!__elfN(allow_wx) && (fctl0 & NT_FREEBSD_FCTL_WXNEEDED) == 0 && + (imgp->proc->p_flag2 & P2_WXORX_DISABLE) == 0) || + (imgp->proc->p_flag2 & P2_WXORX_ENABLE_EXEC) != 0) imgp->map_flags |= MAP_WXORX; error = exec_new_vmspace(imgp, sv); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 7a80f7de85d8..b2d58e804123 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -492,7 +492,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE | P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE | P2_TRAPCAP | - P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC | P2_NO_NEW_PRIVS); + P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC | P2_NO_NEW_PRIVS | + P2_WXORX_DISABLE | P2_WXORX_ENABLE_EXEC); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 68fa4bc0c3ac..53626caa0fd9 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -591,6 +591,71 @@ stackgap_status(struct thread *td, struct proc *p, int *data) return (0); } +static int +wxmap_ctl(struct thread *td, struct proc *p, int state) +{ + struct vmspace *vm; + vm_map_t map; + + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((p->p_flag & P_WEXIT) != 0) + return (ESRCH); + + switch (state) { + case PROC_WX_MAPPINGS_PERMIT: + p->p_flag2 |= P2_WXORX_DISABLE; + _PHOLD(p); + PROC_UNLOCK(p); + vm = vmspace_acquire_ref(p); + if (vm != NULL) { + map = &vm->vm_map; + vm_map_lock(map); + map->flags &= ~MAP_WXORX; + vm_map_unlock(map); + vmspace_free(vm); + } + PROC_LOCK(p); + _PRELE(p); + break; + case PROC_WX_MAPPINGS_DISALLOW_EXEC: + p->p_flag2 |= P2_WXORX_ENABLE_EXEC; + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +wxmap_status(struct thread *td, struct proc *p, int *data) +{ + struct vmspace *vm; + int d; + + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((p->p_flag & P_WEXIT) != 0) + return (ESRCH); + + d = 0; + if ((p->p_flag2 & P2_WXORX_DISABLE) != 0) + d |= PROC_WX_MAPPINGS_PERMIT; + if ((p->p_flag2 & P2_WXORX_ENABLE_EXEC) != 0) + d |= PROC_WX_MAPPINGS_DISALLOW_EXEC; + _PHOLD(p); + PROC_UNLOCK(p); + vm = vmspace_acquire_ref(p); + if (vm != NULL) { + if ((vm->vm_map.flags & MAP_WXORX) != 0) + d |= PROC_WXORX_ENFORCE; + vmspace_free(vm); + } + PROC_LOCK(p); + _PRELE(p); + *data = d; + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct procctl_args { idtype_t idtype; @@ -623,6 +688,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: case PROC_NO_NEW_PRIVS_CTL: + case PROC_WXMAP_CTL: error = copyin(uap->data, &flags, sizeof(flags)); if (error != 0) return (error); @@ -655,6 +721,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -686,6 +753,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; @@ -739,6 +807,10 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data) return (no_new_privs_ctl(td, p, *(int *)data)); case PROC_NO_NEW_PRIVS_STATUS: return (no_new_privs_status(td, p, data)); + case PROC_WXMAP_CTL: + return (wxmap_ctl(td, p, *(int *)data)); + case PROC_WXMAP_STATUS: + return (wxmap_status(td, p, data)); default: return (EINVAL); } @@ -771,6 +843,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_PDEATHSIG_STATUS: case PROC_NO_NEW_PRIVS_CTL: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_CTL: + case PROC_WXMAP_STATUS: if (idtype != P_PID) return (EINVAL); } @@ -821,6 +895,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_CTL: + case PROC_WXMAP_STATUS: tree_locked = false; break; default: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 15e175bf5aad..ffb723576e2e 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -825,6 +825,8 @@ struct proc { #define P2_ITSTOPPED 0x00002000 #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ #define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ +#define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */ +#define P2_WXORX_ENABLE_EXEC 0x00020000 /* WXORX enabled after exec */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h index cc0279fb0d08..0fcb62e94bb9 100644 --- a/sys/sys/procctl.h +++ b/sys/sys/procctl.h @@ -65,6 +65,8 @@ #define PROC_STACKGAP_STATUS 18 /* query stack gap */ #define PROC_NO_NEW_PRIVS_CTL 19 /* disable setuid/setgid */ #define PROC_NO_NEW_PRIVS_STATUS 20 /* query suid/sgid disabled status */ +#define PROC_WXMAP_CTL 21 /* control W^X */ +#define PROC_WXMAP_STATUS 22 /* query W^X */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -146,6 +148,10 @@ struct procctl_reaper_kill { #define PROC_NO_NEW_PRIVS_ENABLE 1 #define PROC_NO_NEW_PRIVS_DISABLE 2 +#define PROC_WX_MAPPINGS_PERMIT 0x0001 +#define PROC_WX_MAPPINGS_DISALLOW_EXEC 0x0002 +#define PROC_WXORX_ENFORCE 0x80000000 + #ifndef _KERNEL __BEGIN_DECLS int procctl(idtype_t, id_t, int, void *); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:57:21 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 0B5FC6B083C; Fri, 24 Sep 2021 00:57:21 +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 4HFtsr6w7tz3FbZ; Fri, 24 Sep 2021 00:57:20 +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 C97D0527E; Fri, 24 Sep 2021 00:57:20 +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 18O0vKP4075355; Fri, 24 Sep 2021 00:57:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0vKcV075354; Fri, 24 Sep 2021 00:57:20 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:57:20 GMT Message-Id: <202109240057.18O0vKcV075354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ac8994cf5bc5 - stable/13 - readelf: include notes (-n) and unwind (-u) in --all/-a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac8994cf5bc56c5b865302f79a0efb3b580ef70b 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: Fri, 24 Sep 2021 00:57:21 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ac8994cf5bc56c5b865302f79a0efb3b580ef70b commit ac8994cf5bc56c5b865302f79a0efb3b580ef70b Author: Ed Maste AuthorDate: 2021-09-17 12:06:27 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:57:10 +0000 readelf: include notes (-n) and unwind (-u) in --all/-a This matches the GNU and LLVM versions of readelf. As markj noted in the review -u is not actually implemented yet and has no effect. The option is accepted and just ignored. Reported by: andrew Reviewed by: andrew, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32003 (cherry picked from commit f161abf9f2cd7fdd28543f9774de82c89675477c) --- contrib/elftoolchain/readelf/readelf.1 | 4 +++- contrib/elftoolchain/readelf/readelf.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 67344d5359b4..108b62775712 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3753 2019-06-28 01:13:13Z emaste $ .\" -.Dd October 31, 2020 +.Dd September 17, 2021 .Dt READELF 1 .Os .Sh NAME @@ -76,8 +76,10 @@ Turn on the following flags: .Fl h , .Fl I , .Fl l , +.Fl n , .Fl r , .Fl s , +.Fl u , .Fl A , .Fl S and diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 81e6897cf3cd..d5f9205e354d 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -7788,7 +7788,7 @@ main(int argc, char **argv) break; case 'a': re->options |= RE_AA | RE_D | RE_G | RE_H | RE_II | - RE_L | RE_R | RE_SS | RE_S | RE_VV; + RE_L | RE_N | RE_R | RE_SS | RE_S | RE_U | RE_VV; break; case 'c': re->options |= RE_C; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:57:22 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 471D16B0936; Fri, 24 Sep 2021 00:57:22 +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 4HFtst0fT2z3FxZ; Fri, 24 Sep 2021 00:57:22 +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 E27C04C68; Fri, 24 Sep 2021 00:57:21 +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 18O0vL3o075379; Fri, 24 Sep 2021 00:57:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0vLAP075378; Fri, 24 Sep 2021 00:57:21 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:57:21 GMT Message-Id: <202109240057.18O0vLAP075378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 04676c953a90 - stable/13 - readelf: document that -u / --unwind is not yet implemented MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04676c953a902e3fb6d6afa490784136b1cc694b 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: Fri, 24 Sep 2021 00:57:22 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=04676c953a902e3fb6d6afa490784136b1cc694b commit 04676c953a902e3fb6d6afa490784136b1cc694b Author: Ed Maste AuthorDate: 2021-09-17 13:59:41 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:57:10 +0000 readelf: document that -u / --unwind is not yet implemented ELF tool chain readelf accepts -u / --unwind but just ignores the option. This was previously undocumented, which could be confusing for someone encountering `readelf -u` (in a script or GNU readelf example). Reported by: markj (in D32003) MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8) --- contrib/elftoolchain/readelf/readelf.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 108b62775712..c4f3408e814a 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -43,6 +43,7 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details +.Op Fl u | Fl -unwind .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | @@ -118,6 +119,8 @@ Print additional information about sections, such as the flags fields in section headers. Implies .Fl S . +.It Fl u | Fl -unwind +Not yet implemented (option accepted but ignored). .It Fl v | Fl -version Prints a version identifier for .Nm From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:58:29 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 96BE36B0AA8; Fri, 24 Sep 2021 00:58:29 +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 4HFtv93qHbz3GFX; Fri, 24 Sep 2021 00:58:29 +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 62D03540B; Fri, 24 Sep 2021 00:58:29 +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 18O0wT31075586; Fri, 24 Sep 2021 00:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0wTak075585; Fri, 24 Sep 2021 00:58:29 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:58:29 GMT Message-Id: <202109240058.18O0wTak075585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: cd6569d47ce5 - stable/12 - readelf: include notes (-n) and unwind (-u) in --all/-a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cd6569d47ce58726aba476598790df7cbb8c1826 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: Fri, 24 Sep 2021 00:58:29 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cd6569d47ce58726aba476598790df7cbb8c1826 commit cd6569d47ce58726aba476598790df7cbb8c1826 Author: Ed Maste AuthorDate: 2021-09-17 12:06:27 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:58:14 +0000 readelf: include notes (-n) and unwind (-u) in --all/-a This matches the GNU and LLVM versions of readelf. As markj noted in the review -u is not actually implemented yet and has no effect. The option is accepted and just ignored. Reported by: andrew Reviewed by: andrew, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32003 (cherry picked from commit f161abf9f2cd7fdd28543f9774de82c89675477c) --- contrib/elftoolchain/readelf/readelf.1 | 4 +++- contrib/elftoolchain/readelf/readelf.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 67344d5359b4..108b62775712 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3753 2019-06-28 01:13:13Z emaste $ .\" -.Dd October 31, 2020 +.Dd September 17, 2021 .Dt READELF 1 .Os .Sh NAME @@ -76,8 +76,10 @@ Turn on the following flags: .Fl h , .Fl I , .Fl l , +.Fl n , .Fl r , .Fl s , +.Fl u , .Fl A , .Fl S and diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index a3b7e7a6bcac..a647f2e7961d 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -7778,7 +7778,7 @@ main(int argc, char **argv) break; case 'a': re->options |= RE_AA | RE_D | RE_G | RE_H | RE_II | - RE_L | RE_R | RE_SS | RE_S | RE_VV; + RE_L | RE_N | RE_R | RE_SS | RE_S | RE_U | RE_VV; break; case 'c': re->options |= RE_C; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:58:30 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 CC53C6B0AA9; Fri, 24 Sep 2021 00:58:30 +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 4HFtvB4xrzz3GPg; Fri, 24 Sep 2021 00:58:30 +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 86CF54C69; Fri, 24 Sep 2021 00:58:30 +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 18O0wUBJ075610; Fri, 24 Sep 2021 00:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0wUkA075609; Fri, 24 Sep 2021 00:58:30 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:58:30 GMT Message-Id: <202109240058.18O0wUkA075609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8c495a9f4998 - stable/12 - readelf: document that -u / --unwind is not yet implemented MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8c495a9f4998e0a995705cab3446aa4f303a302d 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: Fri, 24 Sep 2021 00:58:31 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8c495a9f4998e0a995705cab3446aa4f303a302d commit 8c495a9f4998e0a995705cab3446aa4f303a302d Author: Ed Maste AuthorDate: 2021-09-17 13:59:41 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:58:14 +0000 readelf: document that -u / --unwind is not yet implemented ELF tool chain readelf accepts -u / --unwind but just ignores the option. This was previously undocumented, which could be confusing for someone encountering `readelf -u` (in a script or GNU readelf example). Reported by: markj (in D32003) MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8) --- contrib/elftoolchain/readelf/readelf.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 108b62775712..c4f3408e814a 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -43,6 +43,7 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details +.Op Fl u | Fl -unwind .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | @@ -118,6 +119,8 @@ Print additional information about sections, such as the flags fields in section headers. Implies .Fl S . +.It Fl u | Fl -unwind +Not yet implemented (option accepted but ignored). .It Fl v | Fl -version Prints a version identifier for .Nm From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:59:21 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 E58836B0CCF; Fri, 24 Sep 2021 00:59:21 +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 4HFtw969dtz3GPF; Fri, 24 Sep 2021 00:59:21 +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 B44715481; Fri, 24 Sep 2021 00:59:21 +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 18O0xLnt075801; Fri, 24 Sep 2021 00:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0xLWn075800; Fri, 24 Sep 2021 00:59:21 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:59:21 GMT Message-Id: <202109240059.18O0xLWn075800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9d29bc0f475e - stable/12 - usr.bin/grep: Fix Address OOB read error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9d29bc0f475e878490f8c57b72beb4b7e0c38e02 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: Fri, 24 Sep 2021 00:59:22 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9d29bc0f475e878490f8c57b72beb4b7e0c38e02 commit 9d29bc0f475e878490f8c57b72beb4b7e0c38e02 Author: Alex Richardson AuthorDate: 2021-01-19 11:35:07 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:58:14 +0000 usr.bin/grep: Fix Address OOB read error I found this when compiling all the bootstrap tools with -fsanitize=addres: ==65590==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62d000008400 at pc 0x000000473053 bp 0x7ffc1c7dd910 sp 0x7ffc1c7dd0b8 READ of size 32769 at 0x62d000008400 thread T0 #0 0x473052 in regexec (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) #1 0x4c9cf3 in procline /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:539:8 #2 0x4c8687 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:379:18 #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8 0x62d000008400 is located 0 bytes to the right of 32768-byte region [0x62d000000400,0x62d000008400) allocated by thread T0 here: #0 0x493d5d in malloc (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x493d5d) #1 0x4cad75 in grep_malloc /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:656:13 #2 0x4c8129 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8 SUMMARY: AddressSanitizer: heap-buffer-overflow (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) in regexec Reviewed By: kevans MFC after: 1 week (cherry picked from commit 81c3f64110bb76e24d6062eafd7206c10f676d6f) --- usr.bin/grep/file.c | 11 +++++++---- usr.bin/grep/queue.c | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index ebcbd706b828..e390af9cc800 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -98,7 +98,6 @@ char * grep_fgetln(struct file *f, struct parsec *pc) { unsigned char *p; - char *ret; size_t len; size_t off; ptrdiff_t diff; @@ -116,12 +115,15 @@ grep_fgetln(struct file *f, struct parsec *pc) /* Look for a newline in the remaining part of the buffer */ if ((p = memchr(bufpos, fileeol, bufrem)) != NULL) { ++p; /* advance over newline */ - ret = bufpos; len = p - bufpos; + if (grep_lnbufgrow(len + 1)) + goto error; + memcpy(lnbuf, bufpos, len); bufrem -= len; bufpos = p; pc->ln.len = len; - return (ret); + lnbuf[len] = '\0'; + return (lnbuf); } /* We have to copy the current buffered data to the line buffer */ @@ -148,7 +150,7 @@ grep_fgetln(struct file *f, struct parsec *pc) ++p; diff = p - bufpos; len += diff; - if (grep_lnbufgrow(len)) + if (grep_lnbufgrow(len + 1)) goto error; memcpy(lnbuf + off, bufpos, diff); bufrem -= diff; @@ -156,6 +158,7 @@ grep_fgetln(struct file *f, struct parsec *pc) break; } pc->ln.len = len; + lnbuf[len] = '\0'; return (lnbuf); error: diff --git a/usr.bin/grep/queue.c b/usr.bin/grep/queue.c index ac15185f0694..9babdbf74af8 100644 --- a/usr.bin/grep/queue.c +++ b/usr.bin/grep/queue.c @@ -95,12 +95,14 @@ enqueue(struct str *x) rotated = true; free(item->dat); } - item->dat = grep_malloc(sizeof(char) * x->len); + /* len + 1 for NUL-terminator */ + item->dat = grep_malloc(sizeof(char) * x->len + 1); item->len = x->len; item->line_no = x->line_no; item->boff = x->boff; item->off = x->off; memcpy(item->dat, x->dat, x->len); + item->dat[x->len] = '\0'; item->file = x->file; return (rotated); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 00:59:23 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 139156B0D8B; Fri, 24 Sep 2021 00:59:23 +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 4HFtwB6qTjz3GQ8; Fri, 24 Sep 2021 00:59:22 +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 C8DB35482; Fri, 24 Sep 2021 00:59:22 +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 18O0xMDB075832; Fri, 24 Sep 2021 00:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O0xMp5075831; Fri, 24 Sep 2021 00:59:22 GMT (envelope-from git) Date: Fri, 24 Sep 2021 00:59:22 GMT Message-Id: <202109240059.18O0xMp5075831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: be94e7783975 - stable/12 - Fix -Wpointer-sign warnings in usr.bin/grep MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: be94e77839751408d87f53e5e371a0d06b17072f 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: Fri, 24 Sep 2021 00:59:23 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=be94e77839751408d87f53e5e371a0d06b17072f commit be94e77839751408d87f53e5e371a0d06b17072f Author: Alex Richardson AuthorDate: 2020-09-21 09:03:37 +0000 Commit: Ed Maste CommitDate: 2021-09-24 00:58:14 +0000 Fix -Wpointer-sign warnings in usr.bin/grep Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D26479 (cherry picked from commit 86ce5365215ab252e0d1904b410381c96cfc4076) --- usr.bin/grep/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index e390af9cc800..8577572c2887 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -55,12 +55,12 @@ __FBSDID("$FreeBSD$"); #define MAXBUFSIZ (32 * 1024) #define LNBUFBUMP 80 -static unsigned char *buffer; -static unsigned char *bufpos; +static char *buffer; +static char *bufpos; static size_t bufrem; static size_t fsiz; -static unsigned char *lnbuf; +static char *lnbuf; static size_t lnbuflen; static inline int @@ -97,7 +97,7 @@ grep_lnbufgrow(size_t newlen) char * grep_fgetln(struct file *f, struct parsec *pc) { - unsigned char *p; + char *p; size_t len; size_t off; ptrdiff_t diff; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:02:07 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 E99B46B0976; Fri, 24 Sep 2021 01:02:07 +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 4HFtzM6FMnz3GZk; Fri, 24 Sep 2021 01:02:07 +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 B6B935692; Fri, 24 Sep 2021 01:02:07 +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 18O127sp088297; Fri, 24 Sep 2021 01:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O127vj088296; Fri, 24 Sep 2021 01:02:07 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:02:07 GMT Message-Id: <202109240102.18O127vj088296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 217324224472 - stable/11 - readelf: include notes (-n) and unwind (-u) in --all/-a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 2173242244729494c1a0f9a4b0b667ada7e5abeb 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: Fri, 24 Sep 2021 01:02:08 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2173242244729494c1a0f9a4b0b667ada7e5abeb commit 2173242244729494c1a0f9a4b0b667ada7e5abeb Author: Ed Maste AuthorDate: 2021-09-17 12:06:27 +0000 Commit: Ed Maste CommitDate: 2021-09-24 01:00:55 +0000 readelf: include notes (-n) and unwind (-u) in --all/-a This matches the GNU and LLVM versions of readelf. As markj noted in the review -u is not actually implemented yet and has no effect. The option is accepted and just ignored. Reported by: andrew Reviewed by: andrew, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32003 (cherry picked from commit f161abf9f2cd7fdd28543f9774de82c89675477c) --- contrib/elftoolchain/readelf/readelf.1 | 4 +++- contrib/elftoolchain/readelf/readelf.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 67344d5359b4..108b62775712 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3753 2019-06-28 01:13:13Z emaste $ .\" -.Dd October 31, 2020 +.Dd September 17, 2021 .Dt READELF 1 .Os .Sh NAME @@ -76,8 +76,10 @@ Turn on the following flags: .Fl h , .Fl I , .Fl l , +.Fl n , .Fl r , .Fl s , +.Fl u , .Fl A , .Fl S and diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 078800e74ae4..dfeab20b70b3 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -7775,7 +7775,7 @@ main(int argc, char **argv) break; case 'a': re->options |= RE_AA | RE_D | RE_G | RE_H | RE_II | - RE_L | RE_R | RE_SS | RE_S | RE_VV; + RE_L | RE_N | RE_R | RE_SS | RE_S | RE_U | RE_VV; break; case 'c': re->options |= RE_C; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:02:09 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 2EDA76B0E2A; Fri, 24 Sep 2021 01:02: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 4HFtzP0J7fz3Gfp; Fri, 24 Sep 2021 01:02:09 +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 DF98552C6; Fri, 24 Sep 2021 01:02: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 18O128Rx088321; Fri, 24 Sep 2021 01:02:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O128VR088320; Fri, 24 Sep 2021 01:02:08 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:02:08 GMT Message-Id: <202109240102.18O128VR088320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1f9c81f259f3 - stable/11 - readelf: document that -u / --unwind is not yet implemented MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 1f9c81f259f35b8b751e5b79752990858fa26799 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: Fri, 24 Sep 2021 01:02:09 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1f9c81f259f35b8b751e5b79752990858fa26799 commit 1f9c81f259f35b8b751e5b79752990858fa26799 Author: Ed Maste AuthorDate: 2021-09-17 13:59:41 +0000 Commit: Ed Maste CommitDate: 2021-09-24 01:01:17 +0000 readelf: document that -u / --unwind is not yet implemented ELF tool chain readelf accepts -u / --unwind but just ignores the option. This was previously undocumented, which could be confusing for someone encountering `readelf -u` (in a script or GNU readelf example). Reported by: markj (in D32003) MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8) --- contrib/elftoolchain/readelf/readelf.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 108b62775712..c4f3408e814a 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -43,6 +43,7 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details +.Op Fl u | Fl -unwind .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | @@ -118,6 +119,8 @@ Print additional information about sections, such as the flags fields in section headers. Implies .Fl S . +.It Fl u | Fl -unwind +Not yet implemented (option accepted but ignored). .It Fl v | Fl -version Prints a version identifier for .Nm From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:04 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 9B26B6B140E; Fri, 24 Sep 2021 01:35:04 +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 4HFvjN2b8dz3JLc; Fri, 24 Sep 2021 01:35:04 +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 3599D586F; Fri, 24 Sep 2021 01:35:04 +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 18O1Z4fL029059; Fri, 24 Sep 2021 01:35:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z4Zl029058; Fri, 24 Sep 2021 01:35:04 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:04 GMT Message-Id: <202109240135.18O1Z4Zl029058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: fd225bef9f18 - stable/13 - e1000: Update copyrights and readme 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fd225bef9f18ef281018375463a46eff3bfd7cc1 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: Fri, 24 Sep 2021 01:35:04 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fd225bef9f18ef281018375463a46eff3bfd7cc1 commit fd225bef9f18ef281018375463a46eff3bfd7cc1 Author: Kevin Bowling AuthorDate: 2021-09-16 11:35:45 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:19:09 +0000 e1000: Update copyrights and readme Copyrights in sync with "cid-gigabit.2020.06.05.tar.gz released by ND" (from DPDK). README from the latest em-7.7.8 on intel.com Approved by: imp MFC after: 1 week (cherry picked from commit 702cac6c6bf20ca43db26c38185f65fc9ed1935e) --- sys/dev/e1000/LICENSE | 41 ++- sys/dev/e1000/README | 547 ++++++++++++++++++++------------------ sys/dev/e1000/e1000_80003es2lan.c | 40 +-- sys/dev/e1000/e1000_80003es2lan.h | 40 +-- sys/dev/e1000/e1000_82540.c | 40 +-- sys/dev/e1000/e1000_82541.c | 40 +-- sys/dev/e1000/e1000_82541.h | 40 +-- sys/dev/e1000/e1000_82542.c | 40 +-- sys/dev/e1000/e1000_82543.c | 40 +-- sys/dev/e1000/e1000_82543.h | 40 +-- sys/dev/e1000/e1000_82571.c | 40 +-- sys/dev/e1000/e1000_82571.h | 40 +-- sys/dev/e1000/e1000_82575.c | 40 +-- sys/dev/e1000/e1000_82575.h | 40 +-- sys/dev/e1000/e1000_api.c | 40 +-- sys/dev/e1000/e1000_api.h | 40 +-- sys/dev/e1000/e1000_defines.h | 40 +-- sys/dev/e1000/e1000_hw.h | 40 +-- sys/dev/e1000/e1000_i210.c | 40 +-- sys/dev/e1000/e1000_i210.h | 40 +-- sys/dev/e1000/e1000_ich8lan.c | 40 +-- sys/dev/e1000/e1000_ich8lan.h | 40 +-- sys/dev/e1000/e1000_mac.c | 40 +-- sys/dev/e1000/e1000_mac.h | 40 +-- sys/dev/e1000/e1000_manage.c | 40 +-- sys/dev/e1000/e1000_manage.h | 40 +-- sys/dev/e1000/e1000_mbx.c | 40 +-- sys/dev/e1000/e1000_mbx.h | 40 +-- sys/dev/e1000/e1000_nvm.c | 40 +-- sys/dev/e1000/e1000_nvm.h | 40 +-- sys/dev/e1000/e1000_osdep.c | 40 +-- sys/dev/e1000/e1000_osdep.h | 40 +-- sys/dev/e1000/e1000_phy.c | 40 +-- sys/dev/e1000/e1000_phy.h | 40 +-- sys/dev/e1000/e1000_regs.h | 40 +-- sys/dev/e1000/e1000_vf.c | 40 +-- sys/dev/e1000/e1000_vf.h | 40 +-- 37 files changed, 1007 insertions(+), 981 deletions(-) diff --git a/sys/dev/e1000/LICENSE b/sys/dev/e1000/LICENSE index f70a7cbd4a1d..51a32a819633 100644 --- a/sys/dev/e1000/LICENSE +++ b/sys/dev/e1000/LICENSE @@ -1,31 +1,30 @@ $FreeBSD$ - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/sys/dev/e1000/README b/sys/dev/e1000/README index c0abeacccf4a..d734be75e758 100644 --- a/sys/dev/e1000/README +++ b/sys/dev/e1000/README @@ -1,9 +1,8 @@ $FreeBSD$ -FreeBSD* Driver for Intel Network Connection -============================================= - -May 30, 2007 +FreeBSD* Driver for Intel(R) Ethernet +===================================== +August 7, 2019 Contents ======== @@ -11,396 +10,424 @@ Contents - Overview - Identifying Your Adapter - Building and Installation -- Speed and Duplex Configuration -- Additional Configurations -- Known Limitations +- Additional Features and Configurations +- Known Issues/Troubleshooting - Support - License Overview ======== - -This file describes the FreeBSD* driver for Intel Network Connection. -This driver has been developed for use with FreeBSD, Release 7.x. +This file describes the FreeBSD* driver for Intel(R) Ethernet. This driver has +been developed for use with all community-supported versions of FreeBSD. For questions related to hardware requirements, refer to the documentation -supplied with your Gigabit adapter. All hardware requirements listed +supplied with your Intel Ethernet Adapter. All hardware requirements listed apply to use with FreeBSD. Identifying Your Adapter ======================== +This release includes two gigabit FreeBSD base Drivers for Intel(R) Ethernet. +These drivers are em and igb. -For information on how to identify your adapter, go to the Adapter & -Driver ID Guide at: - -http://support.intel.com/support/network/sb/cs-012904.htm - - -For the latest Intel network drivers for FreeBSD, see: +- The igb driver supports all 82575 and 82576-based gigabit network connections. +- The em driver supports all other gigabit network connections. +- Gigabit devices base on the Intel(R) Ethernet Controller X722 are supported by + the ixl driver. -http://downloadfinder.intel.com/scripts-df-external/support_intel.aspx - - -NOTE: Mobile adapters are not fully supported. NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100 support. +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +http://www.intel.com/support + + Building and Installation ========================= +NOTE: This driver package is to be used only as a standalone archive and the +user should not attempt to incorporate it into the kernel source tree. -NOTE: The driver can be installed as a dynamic loadable kernel module or - compiled into the kernel. You must have kernel sources installed in - order to compile the driver module. - -In the instructions below, x.x.x is the driver version as indicated in the -name of the driver tar file. +In the instructions below, x.x.x is the driver version as indicated in the name +of the driver tar file. 1. Move the base driver tar file to the directory of your choice. For example, use /home/username/em or /usr/local/src/em. 2. Untar/unzip the archive: - tar xzvf em-x.x.x.tar.gz - - This will create an em-x.x.x directory. - -3. To create a loadable module, perform the following steps. - NOTE: To compile the driver into the kernel, go directly to step 4. - - a. To compile the module - - cd em-x.x.x - make - - b. To install the compiled module to the system directory: - - make install - - c. If you want the driver to load automatically when the system is booted: + # tar xzf em-x.x.x.tar.gz - 1. Edit /boot/loader.conf, and add the following line: +This will create the em-x.x.x directory. - if_em_load="YES" +3. To install man page: -4. To compile the driver into the kernel, enter: + # cd em-x.x.x + # gzip -c em.4 > /usr/share/man/man4/em.4.gz - cd em-x.x.x/src - cp *.[ch] /usr/src/sys/dev/em +4. To load the driver onto a running system: - Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in - /usr/src/sys/i386/conf, and ensure the following line is present: - - device em - - Compile and install the kernel. The system must be rebooted for the - kernel updates to take effect. For additional information on compiling - the kernel, consult the FreeBSD operating system documentation. + # cd em-x.x.x/src + # make + # kldload ./if_em.ko 5. To assign an IP address to the interface, enter the following: - ifconfig em + # ifconfig em 6. Verify that the interface works. Enter the following, where is the IP address for another machine on the same subnet as the interface that is being tested: - ping - -7. To configure the IP address to remain after reboot, edit /etc/rc.conf, - and create the appropriate ifconfig_ementry: - - ifconfig_em="" + # ping - Example usage: +7. If you want the driver to load automatically when the system is booted: - ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" + # cd em-x.x.x/src + # make + # make install - NOTE: For assistance, see the ifconfig man page. +Edit /boot/loader.conf, and add the following line: + if_em_load="YES" +Edit /etc/rc.conf, and create the appropriate ifconfig_em entry: -Speed and Duplex Configuration -============================== - -By default, the adapter auto-negotiates the speed and duplex of the -connection. If there is a specific need, the ifconfig utility can be used to -configure the speed and duplex settings on the adapter. Example usage: + ifconfig_em="" - ifconfig em media 100baseTX mediaopt - full-duplex +Example usage: + ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" - NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is - not specified and you are not running at gigabit speed, the driver - defaults to half-duplex. + NOTE: For assistance, see the ifconfig man page. -If the interface is currently forced to 100 full duplex, in order to change -to half duplex you must use this command: - ifconfig em media 100baseTX -mediaopt - full-duplex +Additional Features and Configurations +====================================== +Speed and Duplex Configuration +------------------------------ +In addressing speed and duplex configuration issues, you need to distinguish +between copper-based adapters and fiber-based adapters. -This driver supports the following media type options: +In the default mode, an Intel(R) Ethernet Network Adapter using copper +connections will attempt to auto-negotiate with its link partner to determine +the best setting. If the adapter cannot establish link with the link partner +using auto-negotiation, you may need to manually configure the adapter and link +partner to identical settings to establish link and pass packets. This should +only be needed when attempting to link with an older switch that does not +support auto-negotiation or one that has been forced to a specific speed or +duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds +and higher cannot be forced. Use the autonegotiation advertising setting to +manually set devices for 1 Gbps and higher. - autoselect - Enables auto-negotiation for speed and duplex. +Caution: Only experienced network administrators should force speed and duplex +or change autonegotiation advertising manually. The settings at the switch must +always match the adapter settings. Adapter performance may suffer or your +adapter may not operate if you configure the adapter differently from your +switch. - 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +An Intel(R) Ethernet Network Adapter using fiber-based connections, however, +will not attempt to auto-negotiate with its link partner since those adapters +operate only in full duplex and only at their native speed. - 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +By default, the adapter auto-negotiates the speed and duplex of the connection. +If there is a specific need, the ifconfig utility can be used to configure the +speed and duplex settings on the adapter. - 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +Example usage: - 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +# ifconfig emX media 100baseTX mediaopt full-duplex -For more information on the ifconfig utility, see the ifconfig man page. +NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is not +specified and you are not running at gigabit speed, the driver defaults to +half-duplex. +If the interface is currently forced to 100 full duplex, you must use this +command to change to half duplex: -Additional Configurations -========================= +# ifconfig emX media 100baseTX -mediaopt full-duplex -The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on -all but the 82542-based adapters. For specific adapters, refer to the -Identifying Your Adapter section. +This driver supports the following media type options: - Jumbo Frames - ------------ - To enable Jumbo Frames, use the ifconfig utility to set the Maximum - Transport Unit (MTU) frame size above its default of 1500 bytes. +Media Type Description +---------- ----------- +autoselect Enables auto-negotiation for speed and duplex. +10baseT/UTP Sets speed to 10 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +100baseTX Sets speed to 100 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +1000baseTX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. +1000baseSX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. - The Jumbo Frames MTU range for Intel Adapters is 1500 to 16110. To modify - the setting, enter the following: +For more information on the ifconfig utility, see the ifconfig man page. - ifconfig em mtu 9000 +Jumbo Frames +------------ +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. + +Use the ifconfig command to increase the MTU size. For example, enter the +following where X is the interface number: + +# ifconfig emX mtu 9000 + +To confirm an interface's MTU value, use the ifconfig command. + +To confirm the MTU used between two specific devices, use: + +# route get + +NOTE: The maximum MTU setting for Jumbo Frames is 16110. This value coincides +with the maximum Jumbo Frames size of 16132 bytes. + +NOTE: Using Jumbo frames at 10 or 100 Mbps is not supported and may result in +poor performance or loss of link. + +NOTE: Packet loss may have a greater impact on throughput when you use jumbo +frames. If you observe a drop in performance after enabling jumbo frames, +enabling flow control may mitigate the issue. + +NOTE: Some Intel gigabit adapters that support Jumbo Frames have a frame size +limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. The +adapters with this limitation are based on the Intel(R) 82571EB, 82572EI, +82573L, 82566, 82562, and 80003ES2LAN controller. These correspond to the +following product names: + Intel(R) PRO/1000 PT Server Adapter + Intel(R) PRO/1000 PT Desktop Adapter + Intel(R) PRO/1000 PT Network Connection + Intel(R) PRO/1000 PT Dual Port Server Adapter + Intel(R) PRO/1000 PT Dual Port Network Connection + Intel(R) PRO/1000 PT Quad Port Server Adapter + Intel(R) PRO/1000 PF Quad Port Server Adapter + Intel(R) PRO/1000 PF Server Adapter + Intel(R) PRO/1000 PF Network Connection + Intel(R) PRO/1000 PF Dual Port Server Adapter + Intel(R) PRO/1000 PB Server Connection + Intel(R) PRO/1000 PL Network Connection + Intel(R) PRO/1000 EB Network Connection with I/O Acceleration + Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration + Intel(R) 82566DM-2 Gigabit Network Connection + Intel(R) 82574L Gigabit Network Connection + Intel(R) Gigabit CT Desktop Adapter + Intel(R) 82567LM-4 Gigabit Network Connection + Intel(R) 82567LM-3 Gigabit Network Connection + Intel(R) 82567LF-3 Gigabit Network Connection - To confirm the MTU used between two specific devices, use: +NOTE: The following adapters limit Jumbo Frames sized packets to a maximum of +4088 bytes: + - Intel(R) 82578DM Gigabit Network Connection + - Intel(R) 82577LM Gigabit Network Connection +- The following adapters do not support Jumbo Frames: + - Intel(R) PRO/1000 Gigabit Server Adapter + - Intel(R) PRO/1000 PM Network Connection + - Intel(R) 82562G 10/100 Network Connection + - Intel(R) 82562G-2 10/100 Network Connection + - Intel(R) 82562GT 10/100 Network Connection + - Intel(R) 82562GT-2 10/100 Network Connection + - Intel(R) 82562V 10/100 Network Connection + - Intel(R) 82562V-2 10/100 Network Connection + - Intel(R) 82566DC Gigabit Network Connection + - Intel(R) 82566DC-2 Gigabit Network Connection + - Intel(R) 82566DM Gigabit Network Connection + - Intel(R) 82566MC Gigabit Network Connection + - Intel(R) 82566MM Gigabit Network Connection + - Intel(R) 82567V-3 Gigabit Network Connection + - Intel(R) 82577LC Gigabit Network Connection + - Intel(R) 82578DC Gigabit Network Connection +- Jumbo Frames cannot be configured on an 82579-based Network device if + MACSec is enabled on the system. - route get - Notes: +VLANS +----- +To create a new VLAN interface: - - Only enable Jumbo Frames if your network infrastructure supports them. +# ifconfig create - - To enable Jumbo Frames, increase the MTU size on the interface beyond - 1500. +To associate the VLAN interface with a physical interface and assign a VLAN ID, +IP address, and netmask: - - The Jumbo Frames setting on the switch must be set to at least 22 bytes - larger than that of the MTU. +# ifconfig netmask vlan +vlandev - - The maximum MTU setting for Jumbo Frames is 16110. This value coincides - with the maximum Jumbo Frames size of 16128. +Example: - - Some Intel gigabit adapters that support Jumbo Frames have a frame size - limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. - The adapters with this limitation are based on the Intel(R) 82571EB, - 82572EI, 82573L, 82566, 82562, and 80003ES2LAN controller. These - correspond to the following product names: - Intel(R) PRO/1000 PT Server Adapter - Intel(R) PRO/1000 PT Desktop Adapter - Intel(R) PRO/1000 PT Network Connection - Intel(R) PRO/1000 PT Dual Port Server Adapter - Intel(R) PRO/1000 PT Dual Port Network Connection - Intel(R) PRO/1000 PT Quad Port Server Adapter - Intel(R) PRO/1000 PF Quad Port Server Adapter - Intel(R) PRO/1000 PF Server Adapter - Intel(R) PRO/1000 PF Network Connection - Intel(R) PRO/1000 PF Dual Port Server Adapter - Intel(R) PRO/1000 PB Server Connection - Intel(R) PRO/1000 PL Network Connection - Intel(R) PRO/1000 EB Network Connection with I/O Acceleration - Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration - Intel(R) 82566DM-2 Gigabit Network Connection +# ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - - Adapters based on the Intel(R) 82542 and 82573V/E controller do not - support Jumbo Frames. These correspond to the following product names: - Intel(R) PRO/1000 Gigabit Server Adapter - Intel(R) PRO/1000 PM Network Connection +In this example, all packets will be marked on egress with 802.1Q VLAN tags, +specifying a VLAN ID of 10. - - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or - loss of link. +To remove a VLAN interface: - - The following adapters do not support Jumbo Frames: - Intel(R) 82562V 10/100 Network Connection - Intel(R) 82566DM Gigabit Network Connection - Intel(R) 82566DC Gigabit Network Connection - Intel(R) 82566MM Gigabit Network Connection - Intel(R) 82566MC Gigabit Network Connection - Intel(R) 82562GT 10/100 Network Connection - Intel(R) 82562G 10/100 Network Connection - Intel(R) 82566DC-2 Gigabit Network Connection - Intel(R) 82562V-2 10/100 Network Connection - Intel(R) 82562G-2 10/100 Network Connection - Intel(R) 82562GT-2 10/100 Network Connection +# ifconfig destroy - VLANs - ----- - To create a new VLAN interface: - ifconfig create +Polling +------- +NOTES: +- Device Polling is only valid for non-SMP kernels. +- The driver has to be built into the kernel for Device Polling to be + enabled in the driver. - To associate the VLAN interface with a physical interface and - assign a VLAN ID, IP address, and netmask: +To enable polling in the driver, add the following options to the kernel +configuration, and then recompile the kernel: - ifconfig netmask vlan - vlandev + options DEVICE_POLLING + options HZ=1000 - Example: +At runtime use: + ifconfig emX polling (to turn polling on) +and: + ifconfig emX -polling (to turn it off) - ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - In this example, all packets will be marked on egress with 802.1Q VLAN - tags, specifying a VLAN ID of 10. +Checksum Offload +---------------- +Checksum offloading is not supported on 82542 Gigabit adapters. - To remove a VLAN interface: +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. - Intel Network Connection ifconfig destroy +Checksum offloading can be enabled or disabled using ifconfig. Both transmit +and receive offloading will be either enabled or disabled together. You cannot +enable/disable one without the other. +To enable checksum offloading: - Polling - ------- +# ifconfig emX rxcsum - To enable polling in the driver, add the following options to the kernel - configuration, and then recompile the kernel: +To disable checksum offloading: - options DEVICE_POLLING - options HZ=1000 +# ifconfig emX -rxcsum - At runtime use: - ifconfig emX polling (to turn polling on) - and: - ifconfig emX -polling (to turn it off) +To confirm the current setting: +# ifconfig emX - Checksum Offload - ---------------- - Checksum offloading is not supported on 82542 Gigabit adapters. +Look for the presence or absence of the following line: + options=3 - Checksum offloading supports both TCP and UDP packets and is - supported for both transmit and receive. +See the ifconfig man page for further information. - Checksum offloading can be enabled or disabled using ifconfig. - Both transmit and receive offloading will be either enabled or - disabled together. You cannot enable/disable one without the other. - To enable checksum offloading: +TSO +--- +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. TSO can be disabled +and enabled using the ifconfig utility or sysctl. - ifconfig rxcsum +NOTE: TSO requires Tx checksum, if Tx checksum is disabled, TSO will also be +disabled. - To disable checksum offloading: +NOTE: By default only PCI-Express adapters are ENABLED to do TSO. Others can be +enabled by the user at their own risk. TSO is not supported on 82547 or +82544-based adapters, as well as older adapters. - ifconfig -rxcsum +To enable/disable TSO in the stack: - To confirm the current setting: +# sysctl net.inet.tcp.tso=0 (or 1 to enable it) - ifconfig +Doing this disables/enables TSO in the stack and affects all installed adapters. - Look for the presence or absence of the following line: +To disable BOTH TSO IPv4 and IPv6: - options=3 +# ifconfig em -tso - See the ifconfig man page for further information. +To enable BOTH TSO IPv4 and IPv6: +# ifconfig em tso - TSO - --- - The FreeBSD driver offers support for TSO (TCP Segmentation Offload). +You can also enable/disable IPv4 TSO or IPv6 TSO individually. Simply replace +tso|-tso in the above command with tso4 or tso6. For example, to disable +TSO IPv4: - You can enable/disable it in two ways/places: +# ifconfig em -tso4 - - sysctl net.inet.tcp.tso=0 (or 1 to enable it) +To disable TSO IPv6: - Doing this disables TSO in the stack and will affect all adapters. +# ifconfig em -tso6 - - ifconfig emX -tso - Doing this will disable TSO only for this adapter. +MSI-X +----- +MSI or MSI-X can be turned off by an entry in /etc/sysctl.conf - To enable: + hw.em.enable_msi=0 - - ifconfig emX tso +Unload and reload the driver. - NOTES: By default only PCI-Express adapters are ENABLED to do TSO. Others - can be enabled by the user at their own risk - TSO is not supported on 82547 and 82544-based adapters, as well as older adapters. +Known Issues/Troubleshooting +============================ -Known Limitations -================= +Detected Tx Unit Hang in Quad Port Adapters +------------------------------------------- +In some cases ports 3 and 4 don't pass traffic and report 'Detected Tx Unit +Hang' followed by 'NETDEV WATCHDOG: emX: transmit timed out' errors. Ports 1 +and 2 do not show any errors and will pass traffic. - Detected Tx Unit Hang in Quad Port Adapters - ------------------------------------------- +This issue may be resolved by updating to the latest kernel and BIOS. You +should use an OS that fully supports Message Signaled Interrupts (MSI) and make +sure that MSI is enabled in your system's BIOS. - In some cases ports 3 and 4 wont pass traffic. Ports 1 and 2 don't show - any errors and will pass traffic. - This issue MAY be resolved by updating to the latest BIOS. You can - check your system's BIOS by downloading the Linux Firmware Developer Kit - that can be obtained at http://www.linuxfirmwarekit.org/ +There are known performance issues with this driver when running UDP traffic +with Jumbo Frames. +---------------------------------------------------------------------------- - There are known performance issues with this driver when running UDP traffic - with Jumbo Frames. - ---------------------------------------------------------------------------- +82541/82547 can't link or is slow to link with some link partners +----------------------------------------------------------------- +There is a known compatibility issue where time to link is slow or link is not +established between 82541/82547 controllers and some switches. Known switches +include: + Planex FXG-08TE + I-O Data ETG-SH8 - 82541/82547 can't link or is slow to link with some link partners - ----------------------------------------------------------------- +The driver can be compiled with the following changes: - There is a known compatibility issue where time to link is slow or link is not - established between 82541/82547 controllers and some switches. Known switches - include: - Planex FXG-08TE - I-O Data ETG-SH8 - Netgear GS105v3 + Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - The driver can be compiled with the following changes: +For example, change from: - Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - For example, change from: + #define EM_MASTER_SLAVE e1000_ms_hw_default - #define EM_MASTER_SLAVE e1000_ms_hw_default - to: - #define EM_MASTER_SLAVE 2 +to: - Use one of the following options: - 1 = Master mode - 2 = Slave mode - 3 = Auto master/slave - Setting 2 is recommended. + #define EM_MASTER_SLAVE 2 - Recompile the module: - a. To compile the module - cd em-x.x.x - make clean - make +Use one of the following options: + 1 = Master mode + 2 = Slave mode + 3 = Auto master/slave +Setting 2 is recommended. - b. To install the compiled module in system directory: - make install +Recompile the module: + a. To compile the module + cd em-x.x.x + make clean + make + b. To install the compiled module in system directory: + make install Support ======= +For general information, go to the Intel support website at: +http://www.intel.com/support/ -For general information and support, go to the Intel support website at: +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to freebsd@intel.com - http://support.intel.com -If an issue is identified, support is through email only at: -freebsd@intel.com +Copyright(c) 1999-2019 Intel Corporation. -License -======= - -This software program is released under the terms of a license agreement -between you ('Licensee') and Intel. Do not use or load this software or any -associated materials (collectively, the 'Software') until you have carefully -read the full terms and conditions of the LICENSE located in this software -package. By loading or using the Software, you agree to the terms of this -Agreement. If you do not agree with the terms of this Agreement, do not -install or use the Software. +Trademarks +========== +Intel is a trademark or registered trademark of Intel Corporation or its +subsidiaries in the United States and/or other countries. * Other names and brands may be claimed as the property of others. diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 5c0220adfc6f..50fdfab54685 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index cbf0eafa9407..9e6de14757d7 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index adc944a8ebb4..720798260f8a 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c *** 1823 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:05 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 9C5B06B11DC; Fri, 24 Sep 2021 01:35:05 +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 4HFvjP3dj7z3JTm; Fri, 24 Sep 2021 01:35:05 +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 57F4A5A52; Fri, 24 Sep 2021 01:35:05 +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 18O1Z56x029085; Fri, 24 Sep 2021 01:35:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z5uc029084; Fri, 24 Sep 2021 01:35:05 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:05 GMT Message-Id: <202109240135.18O1Z5uc029084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8788094ab129 - stable/13 - e1000: support flashless i211 PBA 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8788094ab129dc5efc99214b918ec7e9f5120dbe 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: Fri, 24 Sep 2021 01:35:05 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8788094ab129dc5efc99214b918ec7e9f5120dbe commit 8788094ab129dc5efc99214b918ec7e9f5120dbe Author: Guinan Sun AuthorDate: 2020-07-06 08:11:59 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:19:25 +0000 e1000: support flashless i211 PBA Add support to print PBA when using flashless. Signed-off-by: Todd Fujinaka Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d3c41d90dfd5b39dec14c74cf53086f4e6634aed) MFC after: 1 week (cherry picked from commit de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce) --- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_nvm.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..27e564d7841b 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -461,7 +461,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else - mac->ops.init_hw = e1000_init_hw_82575; + mac->ops.init_hw = e1000_init_hw_82575; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; /* physical interface link setup */ diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index ecc7b013febb..f46444cf38b9 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -776,8 +776,9 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, DEBUGFUNC("e1000_read_pba_string_generic"); - if ((hw->mac.type >= e1000_i210) && - !e1000_get_flash_presence_i210(hw)) { + if ((hw->mac.type == e1000_i210 || + hw->mac.type == e1000_i211) && + !e1000_get_flash_presence_i210(hw)) { DEBUGOUT("Flashless no PBA string\n"); return -E1000_ERR_NVM_PBA_SECTION; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:07 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 EE7B76B1058; Fri, 24 Sep 2021 01:35:07 +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 4HFvjR5b1tz3JX8; Fri, 24 Sep 2021 01:35:07 +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 9EB405758; Fri, 24 Sep 2021 01:35:07 +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 18O1Z75v029133; Fri, 24 Sep 2021 01:35:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z7A3029132; Fri, 24 Sep 2021 01:35:07 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:07 GMT Message-Id: <202109240135.18O1Z7A3029132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f72caa3ea943 - stable/13 - e1000: expose xMDIO methods 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f72caa3ea943bdb54bfc8112c8c7b6e6a59dd97d 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: Fri, 24 Sep 2021 01:35:08 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f72caa3ea943bdb54bfc8112c8c7b6e6a59dd97d commit f72caa3ea943bdb54bfc8112c8c7b6e6a59dd97d Author: Guinan Sun AuthorDate: 2020-07-06 08:12:00 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:19:54 +0000 e1000: expose xMDIO methods Move read and write xmdio methods to e1000_phy. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b14d20f1b2bb0e6d95f19963c5d7f55374e0ead9) MFC after: 1 week (cherry picked from commit da24467c7a162691a14f2f74d90ff8dedb816cfc) --- sys/dev/e1000/e1000_i210.c | 71 --------------------------------------------- sys/dev/e1000/e1000_i210.h | 4 --- sys/dev/e1000/e1000_phy.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_phy.h | 5 ++++ 4 files changed, 77 insertions(+), 75 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 88806891566f..c0055aa0df71 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -600,77 +600,6 @@ out: return ret_val; } -/** - * __e1000_access_xmdio_reg - Read/write XMDIO register - * @hw: pointer to the HW structure - * @address: XMDIO address to program - * @dev_addr: device address to program - * @data: pointer to value to read/write from/to the XMDIO address - * @read: boolean flag to indicate read or write - **/ -static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, - u8 dev_addr, u16 *data, bool read) -{ - s32 ret_val; - - DEBUGFUNC("__e1000_access_xmdio_reg"); - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | - dev_addr); - if (ret_val) - return ret_val; - - if (read) - ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); - else - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); - if (ret_val) - return ret_val; - - /* Recalibrate the device back to 0 */ - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); - if (ret_val) - return ret_val; - - return ret_val; -} - -/** - * e1000_read_xmdio_reg - Read XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be read from the EMI address - **/ -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, TRUE); -} - -/** - * e1000_write_xmdio_reg - Write XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be written to the XMDIO address - **/ -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, FALSE); -} - /** * e1000_pll_workaround_i210 * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index d1ef4edf6261..9ad9e28c363b 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,10 +44,6 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 *data); -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 data); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index 3215ed33d115..d22bcb7149c1 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -4251,3 +4251,75 @@ bool e1000_is_mphy_ready(struct e1000_hw *hw) return ready; } + +/** + * __e1000_access_xmdio_reg - Read/write XMDIO register + * @hw: pointer to the HW structure + * @address: XMDIO address to program + * @dev_addr: device address to program + * @data: pointer to value to read/write from/to the XMDIO address + * @read: boolean flag to indicate read or write + **/ +static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, + u8 dev_addr, u16 *data, bool read) +{ + s32 ret_val; + + DEBUGFUNC("__e1000_access_xmdio_reg"); + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | + dev_addr); + if (ret_val) + return ret_val; + + if (read) + ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); + else + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); + if (ret_val) + return ret_val; + + /* Recalibrate the device back to 0 */ + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); + if (ret_val) + return ret_val; + + return ret_val; +} + +/** + * e1000_read_xmdio_reg - Read XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be read from the EMI address + **/ +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) +{ + DEBUGFUNC("e1000_read_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, true); +} + +/** + * e1000_write_xmdio_reg - Write XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be written to the XMDIO address + **/ +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) +{ + DEBUGFUNC("e1000_write_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, + false); +} diff --git a/sys/dev/e1000/e1000_phy.h b/sys/dev/e1000/e1000_phy.h index a13413e98638..38c8f9b466ce 100644 --- a/sys/dev/e1000/e1000_phy.h +++ b/sys/dev/e1000/e1000_phy.h @@ -122,6 +122,11 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, bool line_override); bool e1000_is_mphy_ready(struct e1000_hw *hw); +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 *data); +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 data); + #define E1000_MAX_PHY_ADDR 8 /* IGP01E1000 Specific Registers */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:07 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 0451F6B1055; Fri, 24 Sep 2021 01:35:07 +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 4HFvjQ6MCqz3JR9; Fri, 24 Sep 2021 01:35:06 +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 812155757; Fri, 24 Sep 2021 01:35:06 +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 18O1Z6I2029109; Fri, 24 Sep 2021 01:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z6ol029108; Fri, 24 Sep 2021 01:35:06 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:06 GMT Message-Id: <202109240135.18O1Z6ol029108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 3d3c15f6b962 - stable/13 - e1000: add missing device ID 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d3c15f6b962ed04418da8dadefe67b706252071 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: Fri, 24 Sep 2021 01:35:07 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3d3c15f6b962ed04418da8dadefe67b706252071 commit 3d3c15f6b962ed04418da8dadefe67b706252071 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:19:38 +0000 e1000: add missing device ID Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII flashless automotive device. Signed-off-by: Kamil Bednarczyk Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (586d770bfefc01d4af97c0ddf17c960c3e49ec22) MFC after: 1 week (cherry picked from commit 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882) --- sys/dev/e1000/e1000_api.c | 1 + sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/if_em.c | 1 + 3 files changed, 3 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index a36b228e075f..6e0f51ab7ffa 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -383,6 +383,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: + case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index a08630618662..95973e29dbf0 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -209,6 +209,7 @@ struct e1000_hw; #define E1000_DEV_ID_I210_SGMII 0x1538 #define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B #define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C +#define E1000_DEV_ID_I210_SGMII_FLASHLESS 0x15F6 #define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40 #define E1000_DEV_ID_I354_SGMII 0x1F41 diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 79361174311d..f09e8dd79b0c 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -233,6 +233,7 @@ static pci_vendor_info_t igb_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) I210 (OEM)"), PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) I210 Flashless (Copper)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) I210 Flashless (SERDES)"), + PVID(0x8086, E1000_DEV_ID_I210_SGMII_FLASHLESS, "Intel(R) I210 Flashless (SGMII)"), PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) I210 (Fiber)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) I210 (SERDES)"), PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) I210 (SGMII)"), From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:10 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 3A0246B136A; Fri, 24 Sep 2021 01:35:10 +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 4HFvjV0ds5z3JZX; Fri, 24 Sep 2021 01:35:10 +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 D8B625A54; Fri, 24 Sep 2021 01:35:09 +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 18O1Z9Qu029190; Fri, 24 Sep 2021 01:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z976029189; Fri, 24 Sep 2021 01:35:09 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:09 GMT Message-Id: <202109240135.18O1Z976029189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1704007555f9 - stable/13 - e1000: fix minor issues and improve code style 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1704007555f9be9e70af5d46979915330f153d62 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: Fri, 24 Sep 2021 01:35:10 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1704007555f9be9e70af5d46979915330f153d62 commit 1704007555f9be9e70af5d46979915330f153d62 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:20:43 +0000 e1000: fix minor issues and improve code style Fix typo in piece of code of NVM access for SPT. And cleans up the remaining instances in the shared code where it was not adhering to the Linux code standard. Wrong description was found in the mentioned file, so fix them. Remove shadowing variable declarations. Relating to operands in bitwise operations having different sizes. Unreachable code since *clock_in_i2c_* always return success. Don't return unused s32 and don't check for constants. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Vitaly Lifshits Signed-off-by: Robert Konklewski Signed-off-by: Doug Dziggel Signed-off-by: Todd Fujinaka Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b8592c89c8fbc871d22313dcac0b86c89a7d5a62) MFC after: 1 week (cherry picked from commit 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756) --- sys/dev/e1000/e1000_80003es2lan.c | 1 - sys/dev/e1000/e1000_82575.c | 16 +++++----------- sys/dev/e1000/e1000_i210.c | 8 +++----- sys/dev/e1000/e1000_ich8lan.c | 40 ++++++++++++++++++++------------------- sys/dev/e1000/e1000_mac.c | 2 +- sys/dev/e1000/e1000_nvm.c | 2 +- sys/dev/e1000/e1000_phy.c | 5 ++++- 7 files changed, 35 insertions(+), 39 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 50fdfab54685..db6f1aeb65fb 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1168,7 +1168,6 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw) /** * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up * @hw: pointer to the HW structure - * @duplex: current duplex setting * * Configure the KMRN interface by applying last minute quirks for * 10/100 operation. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 296a72542914..b252a4c7ff1d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -104,10 +104,10 @@ static void e1000_clear_vfta_i350(struct e1000_hw *hw); static void e1000_i2c_start(struct e1000_hw *hw); static void e1000_i2c_stop(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); static s32 e1000_clock_out_i2c_byte(struct e1000_hw *hw, u8 data); static s32 e1000_get_i2c_ack(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); static s32 e1000_clock_out_i2c_bit(struct e1000_hw *hw, bool data); static void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); static void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); @@ -3238,9 +3238,7 @@ s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset, if (status != E1000_SUCCESS) goto fail; - status = e1000_clock_in_i2c_byte(hw, data); - if (status != E1000_SUCCESS) - goto fail; + e1000_clock_in_i2c_byte(hw, data); status = e1000_clock_out_i2c_bit(hw, nack); if (status != E1000_SUCCESS) @@ -3404,7 +3402,7 @@ static void e1000_i2c_stop(struct e1000_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -3416,8 +3414,6 @@ static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) e1000_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return E1000_SUCCESS; } /** @@ -3506,7 +3502,7 @@ static s32 e1000_get_i2c_ack(struct e1000_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) { u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); @@ -3524,8 +3520,6 @@ static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(E1000_I2C_T_LOW); - - return E1000_SUCCESS; } /** diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index c0055aa0df71..c6ca38f0f917 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,7 +195,7 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { - eewr = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) | + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; @@ -281,9 +281,9 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, switch (offset) { case NVM_MAC_ADDR: ret_val = e1000_read_invm_word_i210(hw, (u8)offset, &data[0]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+1, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 1, &data[1]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+2, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 2, &data[2]); if (ret_val != E1000_SUCCESS) DEBUGOUT("MAC Addr not found in iNVM\n"); @@ -561,8 +561,6 @@ void e1000_init_function_pointers_i210(struct e1000_hw *hw) { e1000_init_function_pointers_82575(hw); hw->nvm.ops.init_params = e1000_init_nvm_params_i210; - - return; } /** diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 39e5ad518617..3a912dc3870e 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -841,7 +841,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) /** * __e1000_access_emi_reg_locked - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write * @@ -1619,8 +1619,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) if (hw->mac.type >= e1000_pch_lpt) { - u16 phy_reg; - hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg); phy_reg &= ~I217_PLL_CLOCK_GATE_MASK; @@ -2474,7 +2472,7 @@ release: /** * e1000_configure_k1_ich8lan - Configure K1 power state * @hw: pointer to the HW structure - * @enable: K1 state to configure + * @k1_enable: K1 state to configure * * Configure the K1 power state based on the provided parameter. * Assumes semaphore already acquired. @@ -2622,6 +2620,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) /** * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -2943,6 +2942,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) /** * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -3550,8 +3550,9 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, for (i = 0; i < words; i += 2) { if (words - i == 1) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = + dev_spec->shadow_ram[offset + i].value; } else { offset_to_read = act_offset + i - ((act_offset + i) % 2); @@ -3568,8 +3569,8 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, } } else { offset_to_read = act_offset + i; - if (!(dev_spec->shadow_ram[offset+i].modified) || - !(dev_spec->shadow_ram[offset+i+1].modified)) { + if (!(dev_spec->shadow_ram[offset + i].modified) || + !(dev_spec->shadow_ram[offset + i + 1].modified)) { ret_val = e1000_read_flash_dword_ich8lan(hw, offset_to_read, @@ -3577,15 +3578,16 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, if (ret_val) break; } - if (dev_spec->shadow_ram[offset+i].modified) - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) + data[i] = + dev_spec->shadow_ram[offset + i].value; else - data[i] = (u16) (dword & 0xFFFF); - if (dev_spec->shadow_ram[offset+i].modified) - data[i+1] = - dev_spec->shadow_ram[offset+i+1].value; + data[i] = (u16)(dword & 0xFFFF); + if (dev_spec->shadow_ram[offset + i + 1].modified) + data[i + 1] = + dev_spec->shadow_ram[offset + i + 1].value; else - data[i+1] = (u16) (dword >> 16 & 0xFFFF); + data[i + 1] = (u16)(dword >> 16 & 0xFFFF); } } @@ -3639,8 +3641,8 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, ret_val = E1000_SUCCESS; for (i = 0; i < words; i++) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = dev_spec->shadow_ram[offset + i].value; } else { ret_val = e1000_read_flash_word_ich8lan(hw, act_offset + i, @@ -4045,8 +4047,8 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, nvm->ops.acquire(hw); for (i = 0; i < words; i++) { - dev_spec->shadow_ram[offset+i].modified = TRUE; - dev_spec->shadow_ram[offset+i].value = data[i]; + dev_spec->shadow_ram[offset + i].modified = TRUE; + dev_spec->shadow_ram[offset + i].value = data[i]; } nvm->ops.release(hw); diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index bda2ad65e3dc..e0d078d924f9 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -2362,7 +2362,7 @@ e1000_release_swfw_sync(struct e1000_hw *hw, u16 mask) ; /* Empty */ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); - swfw_sync &= ~mask; + swfw_sync &= (u32)~mask; E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); e1000_put_hw_semaphore(hw); diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 46c00e1d64b3..86a1e772fb13 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -578,7 +578,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) } for (i = 0; i < words; i++) { - eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) + + eerd = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) + E1000_NVM_RW_REG_START; E1000_WRITE_REG(hw, E1000_EERD, eerd); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d73e3a10ae13..d84b6120dd31 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -621,7 +621,7 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data) * lane and update whole word */ data_local = i2ccmd & 0xFF00; - data_local |= data; + data_local |= (u32)data; i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) | E1000_I2CCMD_OPCODE_WRITE | data_local); @@ -3094,6 +3094,7 @@ s32 e1000_determine_phy_address(struct e1000_hw *hw) /** * e1000_get_phy_addr_for_bm_page - Retrieve PHY page address * @page: page to access + * @reg: register to access * * Returns the phy address for the page requested. **/ @@ -3531,6 +3532,7 @@ void e1000_power_down_phy_copper(struct e1000_hw *hw) * @offset: register offset to be read * @data: pointer to the read data * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then reads the PHY register at offset * and stores the retrieved information in data. Release any acquired @@ -3641,6 +3643,7 @@ s32 e1000_read_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 *data) * @offset: register offset to write to * @data: data to write at register offset * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then writes the data to PHY register * at the offset. Release any acquired semaphores before exiting. From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:09 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 420A46B168A; Fri, 24 Sep 2021 01:35: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 4HFvjT12yBz3JP1; Fri, 24 Sep 2021 01:35:08 +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 B51E55A53; Fri, 24 Sep 2021 01:35: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 18O1Z8Rx029163; Fri, 24 Sep 2021 01:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1Z8TU029162; Fri, 24 Sep 2021 01:35:08 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:08 GMT Message-Id: <202109240135.18O1Z8TU029162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b67aeb0b070d - stable/13 - e1000: add function parameter descriptions 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b67aeb0b070d6559e7d1c060494958c640916e44 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: Fri, 24 Sep 2021 01:35:09 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b67aeb0b070d6559e7d1c060494958c640916e44 commit b67aeb0b070d6559e7d1c060494958c640916e44 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:02 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:20:16 +0000 e1000: add function parameter descriptions Add function parameter descriptions to address gcc 7 warnings. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1bf35d435c9764e83be76042fa6489dd127b6c40) MFC after: 1 week (cherry picked from commit 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427) --- sys/dev/e1000/e1000_82575.c | 11 +++++------ sys/dev/e1000/e1000_mac.c | 8 ++++++++ sys/dev/e1000/e1000_mbx.c | 4 ++++ sys/dev/e1000/e1000_nvm.c | 7 +++++++ sys/dev/e1000/e1000_phy.c | 6 ++++++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 27e564d7841b..296a72542914 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2702,7 +2702,7 @@ out: /** * __e1000_access_emi_reg - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write **/ @@ -2929,8 +2929,8 @@ out: /** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE based on setting in dev_spec structure. * @@ -2984,8 +2984,8 @@ out: /** * e1000_set_eee_i354 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE legacy mode based on setting in dev_spec structure. * @@ -3641,7 +3641,6 @@ static s32 e1000_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data) /** * e1000_get_i2c_data - Reads the I2C SDA data bit - * @hw: pointer to hardware structure * @i2cctl: Current value of I2CCTL register * * Returns the I2C data bit value diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index 11fbcb62142f..bda2ad65e3dc 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -105,6 +105,8 @@ void e1000_null_mac_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_link_info - No-op function, return 0 * @hw: pointer to the HW structure + * @s: dummy variable + * @d: dummy variable **/ s32 e1000_null_link_info(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *s, u16 E1000_UNUSEDARG *d) @@ -126,6 +128,8 @@ bool e1000_null_mng_mode(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_update_mc - No-op function, return void * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) @@ -137,6 +141,8 @@ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_vfta - No-op function, return void * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable **/ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG a, u32 E1000_UNUSEDARG b) @@ -148,6 +154,8 @@ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_rar_set - No-op function, return 0 * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ int e1000_null_rar_set(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) diff --git a/sys/dev/e1000/e1000_mbx.c b/sys/dev/e1000/e1000_mbx.c index da31185c3476..3fc3811757f7 100644 --- a/sys/dev/e1000/e1000_mbx.c +++ b/sys/dev/e1000/e1000_mbx.c @@ -38,6 +38,7 @@ /** * e1000_null_mbx_check_for_flag - No-op function, return 0 * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG mbx_id) @@ -50,6 +51,9 @@ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_mbx_transact - No-op function, return 0 * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_transact(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG *msg, diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index f46444cf38b9..46c00e1d64b3 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -63,6 +63,9 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw) /** * e1000_null_nvm_read - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_read_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, @@ -85,6 +88,7 @@ void e1000_null_nvm_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_led_default - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *data) @@ -96,6 +100,9 @@ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_nvm - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_write_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d22bcb7149c1..d73e3a10ae13 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -104,6 +104,7 @@ void e1000_init_phy_ops_generic(struct e1000_hw *hw) /** * e1000_null_set_page - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG data) @@ -115,6 +116,8 @@ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_read_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_read_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG *data) @@ -136,6 +139,7 @@ void e1000_null_phy_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_lplu_state - No-op function, return 0 * @hw: pointer to the HW structure + * @active: dummy variable **/ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, bool E1000_UNUSEDARG active) @@ -147,6 +151,8 @@ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_write_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG data) From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:15 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 DE0AC6B1076; Fri, 24 Sep 2021 01:35:15 +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 4HFvjb5fJwz3JVh; Fri, 24 Sep 2021 01:35:15 +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 83DDA59E0; Fri, 24 Sep 2021 01:35:15 +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 18O1ZF3h029314; Fri, 24 Sep 2021 01:35:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZFBQ029313; Fri, 24 Sep 2021 01:35:15 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:15 GMT Message-Id: <202109240135.18O1ZFBQ029313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 7a3d9ce718f9 - stable/13 - e1000: add PCIm function state 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a3d9ce718f9658b69cbecfbd5935f80a58f00fa 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: Fri, 24 Sep 2021 01:35:16 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7a3d9ce718f9658b69cbecfbd5935f80a58f00fa commit 7a3d9ce718f9658b69cbecfbd5935f80a58f00fa Author: Guinan Sun AuthorDate: 2020-07-06 08:12:07 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:26:35 +0000 e1000: add PCIm function state Added define to pcim function state. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (7ee1a3b273c7f321b50e6ba17c3d9537b1b08347) MFC after: 1 week (cherry picked from commit a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1) --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 4bd575a81671..5b77bd43af1a 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -346,6 +346,7 @@ #define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus spd 50-66MHz */ #define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus spd 66-100MHz */ #define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus spd 100-133MHz*/ +#define E1000_STATUS_PCIM_STATE 0x40000000 /* PCIm function state */ #define SPEED_10 10 #define SPEED_100 100 From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:11 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 95F926B11E7; Fri, 24 Sep 2021 01:35:11 +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 4HFvjW2gymz3JZd; Fri, 24 Sep 2021 01:35:11 +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 F364F59DF; Fri, 24 Sep 2021 01:35:10 +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 18O1ZANr029214; Fri, 24 Sep 2021 01:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZAGf029213; Fri, 24 Sep 2021 01:35:10 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:10 GMT Message-Id: <202109240135.18O1ZAGf029213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 412d4675bbad - stable/13 - e1000: modify HW level time sync mechanisms 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 412d4675bbadb36135373272a298fd67d9c75df2 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: Fri, 24 Sep 2021 01:35:11 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=412d4675bbadb36135373272a298fd67d9c75df2 commit 412d4675bbadb36135373272a298fd67d9c75df2 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:21:03 +0000 e1000: modify HW level time sync mechanisms Add additional configuration space access to allow HW level time sync mechanism. Signed-off-by: Evgeny Efimov Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d53391f1fe2e0eba8818517fdf285f893d95dcc8) MFC after: 1 week (cherry picked from commit d50f362b505e9026fbd33d00dc43e09cac26a209) --- sys/dev/e1000/e1000_ich8lan.c | 18 ++++++++++++++++++ sys/dev/e1000/e1000_ich8lan.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 3a912dc3870e..1d15881f047d 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -4963,6 +4963,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) u16 kum_cfg; u32 ctrl, reg; s32 ret_val; + u16 pci_cfg; DEBUGFUNC("e1000_reset_hw_ich8lan"); @@ -5023,11 +5024,28 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) e1000_gate_hw_phy_config_ich8lan(hw, TRUE); } ret_val = e1000_acquire_swflag_ich8lan(hw); + + /* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function + * may occur during global reset and cause system hang. + * Configuration space access creates the needed delay. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value + * insures configuration space read is done before global reset. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); DEBUGOUT("Issuing a global reset to ich8lan\n"); E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_RST)); /* cannot issue a flush here because it hangs the hardware */ msec_delay(20); + /* Configuration space access improve HW level time sync mechanism. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER + * value to insure configuration space read is done + * before any access to mac register. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); + /* Set Phy Config Counter to 50msec */ if (hw->mac.type == e1000_pch2lan) { reg = E1000_READ_REG(hw, E1000_FEXTNVM3); diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index a467e647636f..12f912ebc6e0 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -327,6 +327,8 @@ #define E1000_SVCR_OFF_TIMER_SHIFT 16 #define E1000_SVT_OFF_HWM_MASK 0x0000001F +#define E1000_PCI_VENDOR_ID_REGISTER 0x00 + void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, bool state); void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:17 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 120926B1077; Fri, 24 Sep 2021 01:35:17 +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 4HFvjc5wjWz3JRT; Fri, 24 Sep 2021 01:35:16 +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 9B9A45A55; Fri, 24 Sep 2021 01:35:16 +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 18O1ZGAP029340; Fri, 24 Sep 2021 01:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZGtN029339; Fri, 24 Sep 2021 01:35:16 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:16 GMT Message-Id: <202109240135.18O1ZGtN029339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 41ff2b03ae8a - stable/13 - e1000: add missing register defines 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 41ff2b03ae8afaab81500336217a9949eb7ef4ad 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: Fri, 24 Sep 2021 01:35:17 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=41ff2b03ae8afaab81500336217a9949eb7ef4ad commit 41ff2b03ae8afaab81500336217a9949eb7ef4ad Author: Guinan Sun AuthorDate: 2020-07-06 08:12:08 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:29:25 +0000 e1000: add missing register defines Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for the nvmupd_validate_offset function to correctly validate the NVM update offset. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2c7fe65ab9a31e6ebf438dad7ccc59bcde83a89f) MFC after: 1 week (cherry picked from commit 09888d4bc1a2c45d121046f79be5c01e4889a67e) --- sys/dev/e1000/e1000_regs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 2b7696ddea62..fe9834405359 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -169,6 +169,8 @@ #define E1000_EMIDATA 0x11 /* Extended Memory Indirect Data */ /* Shadow Ram Write Register - RW */ #define E1000_SRWR 0x12018 +#define E1000_EEC_REG 0x12010 + #define E1000_I210_FLMNGCTL 0x12038 #define E1000_I210_FLMNGDATA 0x1203C #define E1000_I210_FLMNGCNT 0x12040 @@ -179,6 +181,9 @@ #define E1000_I210_FLA 0x1201C +#define E1000_SHADOWINF 0x12068 +#define E1000_FLFWUPDATE 0x12108 + #define E1000_INVM_DATA_REG(_n) (0x12120 + 4*(_n)) #define E1000_INVM_SIZE 64 /* Number of INVM Data Registers */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:18 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 CAB066B107A; Fri, 24 Sep 2021 01:35:18 +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 4HFvjf23zrz3JXp; Fri, 24 Sep 2021 01:35:18 +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 C9DC25ACA; Fri, 24 Sep 2021 01:35:17 +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 18O1ZHLa029364; Fri, 24 Sep 2021 01:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZHKd029363; Fri, 24 Sep 2021 01:35:17 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:17 GMT Message-Id: <202109240135.18O1ZHKd029363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5bff1c805840 - stable/13 - e1000: increase timeout for ME ULP exit 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5bff1c8058404bb3c806aa812560b518e51ef49c 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: Fri, 24 Sep 2021 01:35:19 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5bff1c8058404bb3c806aa812560b518e51ef49c commit 5bff1c8058404bb3c806aa812560b518e51ef49c Author: Guinan Sun AuthorDate: 2020-07-06 08:12:09 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:29:39 +0000 e1000: increase timeout for ME ULP exit Due timing issues in WHL and since recovery by host is not always supported, increased timeout for Manageability Engine(ME) to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (cf1f3ca45d33e793ca581200b4000c39a798113e) MFC after: 1 week (cherry picked from commit e8e3171d992f3255cc8e5a0f59912d07679cc94c) --- sys/dev/e1000/e1000_ich8lan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 1d15881f047d..8ca0fb392805 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1413,6 +1413,7 @@ out: s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) { s32 ret_val = E1000_SUCCESS; + u8 ulp_exit_timeout = 30; u32 mac_reg; u16 phy_reg; int i = 0; @@ -1434,10 +1435,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) E1000_WRITE_REG(hw, E1000_H2ME, mac_reg); } - /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ + if (hw->mac.type == e1000_pch_cnp) + ulp_exit_timeout = 100; + while (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_ULP_CFG_DONE) { - if (i++ == 30) { + if (i++ == ulp_exit_timeout) { ret_val = -E1000_ERR_PHY; goto out; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:15 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 E28D26B170B; Fri, 24 Sep 2021 01:35:15 +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 4HFvjb4zKzz3JXT; Fri, 24 Sep 2021 01:35:15 +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 61D395AC9; Fri, 24 Sep 2021 01:35:14 +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 18O1ZE2b029286; Fri, 24 Sep 2021 01:35:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZEK8029285; Fri, 24 Sep 2021 01:35:14 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:14 GMT Message-Id: <202109240135.18O1ZEK8029285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 3e1476024181 - stable/13 - e1000: expose MAC functions 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e1476024181e2e9fbea8a8d428b9188a8a2d581 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: Fri, 24 Sep 2021 01:35:16 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3e1476024181e2e9fbea8a8d428b9188a8a2d581 commit 3e1476024181e2e9fbea8a8d428b9188a8a2d581 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:06 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:26:21 +0000 e1000: expose MAC functions Now the functions are being accessed outside of the file, we need to properly expose them for silicon families to use. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a) MFC after: 1 week (cherry picked from commit d1c37752e2afb51dfb2e08afe714a799788b6ede) --- sys/dev/e1000/e1000_mac.c | 3 +-- sys/dev/e1000/e1000_mac.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index e0d078d924f9..a13572d8dc18 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -38,7 +38,6 @@ static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw); static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); static void e1000_config_collision_dist_generic(struct e1000_hw *hw); -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); /** * e1000_init_mac_ops_generic - Initialize MAC function pointers @@ -484,7 +483,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) * Sets the receive address array register at index to the address passed * in by addr. **/ -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) { u32 rar_low, rar_high; diff --git a/sys/dev/e1000/e1000_mac.h b/sys/dev/e1000/e1000_mac.h index 1f472d42421e..370f7f9d8a1a 100644 --- a/sys/dev/e1000/e1000_mac.h +++ b/sys/dev/e1000/e1000_mac.h @@ -70,6 +70,7 @@ s32 e1000_led_on_generic(struct e1000_hw *hw); s32 e1000_led_off_generic(struct e1000_hw *hw); void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count); +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); s32 e1000_set_default_fc_generic(struct e1000_hw *hw); s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw); s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:12 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 6FCBB6B141A; Fri, 24 Sep 2021 01:35:12 +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 4HFvjX24Ckz3JM7; Fri, 24 Sep 2021 01:35:12 +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 23F6456EC; Fri, 24 Sep 2021 01:35:12 +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 18O1ZCMW029238; Fri, 24 Sep 2021 01:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZCZ6029237; Fri, 24 Sep 2021 01:35:12 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:12 GMT Message-Id: <202109240135.18O1ZCZ6029237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e4a16771e8f3 - stable/13 - e1000: remove duplicated phy codes 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e4a16771e8f3307effe78ec64db35a09319b655a 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: Fri, 24 Sep 2021 01:35:12 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e4a16771e8f3307effe78ec64db35a09319b655a commit e4a16771e8f3307effe78ec64db35a09319b655a Author: Guinan Sun AuthorDate: 2020-07-06 08:12:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:21:34 +0000 e1000: remove duplicated phy codes Add two files base.c and base.h to reduce the redundancy in the silicon family code. Remove the code duplication from e1000_82575 files. Clean family specific functions from base. Fix up a stray and duplicate function declaration. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (44dddd14059f151f39f7e075b887decfc9a10f11) MFC after: 1 week (cherry picked from commit 6b9d35fac12bf657cd1df8f1521c70704ff62b61) --- sys/conf/files | 2 + sys/dev/e1000/e1000_82575.c | 471 ++++++++++++++---------------------------- sys/dev/e1000/e1000_82575.h | 93 +-------- sys/dev/e1000/e1000_api.h | 1 - sys/dev/e1000/e1000_base.c | 221 ++++++++++++++++++++ sys/dev/e1000/e1000_base.h | 158 ++++++++++++++ sys/dev/e1000/e1000_defines.h | 14 +- sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/e1000_i210.c | 2 +- sys/dev/e1000/e1000_regs.h | 23 ++- sys/dev/e1000/if_em.c | 2 +- sys/dev/e1000/igb_txrx.c | 4 +- sys/modules/em/Makefile | 6 +- 13 files changed, 578 insertions(+), 420 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5f6ec9a5c546..21239c31e83f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1677,6 +1677,8 @@ dev/e1000/e1000_i210.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_base.c optional em \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_manage.c optional em \ diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index b252a4c7ff1d..172e99b02d5c 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -48,8 +48,6 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw); -static void e1000_release_phy_82575(struct e1000_hw *hw); static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw); static void e1000_release_nvm_82575(struct e1000_hw *hw); static s32 e1000_check_for_link_82575(struct e1000_hw *hw); @@ -61,6 +59,7 @@ static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw); static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_reset_hw_82575(struct e1000_hw *hw); +static s32 e1000_init_hw_82575(struct e1000_hw *hw); static s32 e1000_reset_hw_82580(struct e1000_hw *hw); static s32 e1000_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data); @@ -84,10 +83,8 @@ static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, u16 *duplex); static s32 e1000_get_phy_id_82575(struct e1000_hw *hw); static bool e1000_sgmii_active_82575(struct e1000_hw *hw); -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw); static void e1000_config_collision_dist_82575(struct e1000_hw *hw); -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw); static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw); static void e1000_power_up_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw); @@ -156,8 +153,8 @@ static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw) } /** - * e1000_init_phy_params_82575 - Init PHY func ptrs. - * @hw: pointer to the HW structure + * e1000_init_phy_params_82575 - Initialize PHY function ptrs + * @hw: pointer to the HW structure **/ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) { @@ -175,17 +172,17 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82575; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_base; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->reset_delay_us = 100; - phy->ops.acquire = e1000_acquire_phy_82575; + phy->ops.acquire = e1000_acquire_phy_base; phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.get_cfg_done = e1000_get_cfg_done_82575; - phy->ops.release = e1000_release_phy_82575; + phy->ops.release = e1000_release_phy_base; ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -232,76 +229,39 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) case I347AT4_E_PHY_ID: case M88E1112_E_PHY_ID: case M88E1340M_E_PHY_ID: + phy->type = e1000_phy_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + break; case M88E1111_I_PHY_ID: phy->type = e1000_phy_m88; phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.get_info = e1000_get_phy_info_m88; - if (phy->id == I347AT4_E_PHY_ID || - phy->id == M88E1112_E_PHY_ID || - phy->id == M88E1340M_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else if (phy->id == M88E1543_E_PHY_ID || - phy->id == M88E1512_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else - phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; - /* Check if this PHY is confgured for media swap. */ - if (phy->id == M88E1112_E_PHY_ID) { - u16 data; - - ret_val = phy->ops.write_reg(hw, - E1000_M88E1112_PAGE_ADDR, - 2); - if (ret_val) - goto out; - - ret_val = phy->ops.read_reg(hw, - E1000_M88E1112_MAC_CTRL_1, - &data); - if (ret_val) - goto out; - - data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> - E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; - if (data == E1000_M88E1112_AUTO_COPPER_SGMII || - data == E1000_M88E1112_AUTO_COPPER_BASEX) - hw->mac.ops.check_for_link = - e1000_check_for_link_media_swap; - } - if (phy->id == M88E1512_E_PHY_ID) { - ret_val = e1000_initialize_M88E1512_phy(hw); - if (ret_val) - goto out; - } - if (phy->id == M88E1543_E_PHY_ID) { - ret_val = e1000_initialize_M88E1543_phy(hw); - if (ret_val) - goto out; - } break; case IGP03E1000_E_PHY_ID: case IGP04E1000_E_PHY_ID: - phy->type = e1000_phy_igp_3; - phy->ops.check_polarity = e1000_check_polarity_igp; - phy->ops.get_info = e1000_get_phy_info_igp; + phy->type = e1000_phy_igp_3; + phy->ops.check_polarity = e1000_check_polarity_igp; + phy->ops.get_info = e1000_get_phy_info_igp; phy->ops.get_cable_length = e1000_get_cable_length_igp_2; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; break; case I82580_I_PHY_ID: case I350_I_PHY_ID: - phy->type = e1000_phy_82580; - phy->ops.check_polarity = e1000_check_polarity_82577; - phy->ops.force_speed_duplex = - e1000_phy_force_speed_duplex_82577; + phy->type = e1000_phy_82580; + phy->ops.check_polarity = e1000_check_polarity_82577; + phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.get_cable_length = e1000_get_cable_length_82577; - phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; + phy->ops.force_speed_duplex = + e1000_phy_force_speed_duplex_82577; break; case I210_I_PHY_ID: phy->type = e1000_phy_i210; @@ -317,98 +277,49 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } -out: - return ret_val; -} - -/** - * e1000_init_nvm_params_82575 - Init NVM func ptrs. - * @hw: pointer to the HW structure - **/ -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) -{ - struct e1000_nvm_info *nvm = &hw->nvm; - u32 eecd = E1000_READ_REG(hw, E1000_EECD); - u16 size; - - DEBUGFUNC("e1000_init_nvm_params_82575"); - - size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> - E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value - * for setting word_size. - */ - size += NVM_WORD_SIZE_BASE_SHIFT; - - /* Just in case size is out of range, cap it to the largest - * EEPROM size supported - */ - if (size > 15) - size = 15; - - nvm->word_size = 1 << size; - if (hw->mac.type < e1000_i210) { - nvm->opcode_bits = 8; - nvm->delay_usec = 1; + /* Check if this PHY is configured for media swap. */ + switch (phy->id) { + case M88E1112_E_PHY_ID: + { + u16 data; - switch (nvm->override) { - case e1000_nvm_override_spi_large: - nvm->page_size = 32; - nvm->address_bits = 16; - break; - case e1000_nvm_override_spi_small: - nvm->page_size = 8; - nvm->address_bits = 8; - break; - default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; - nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? - 16 : 8; - break; - } - if (nvm->word_size == (1 << 15)) - nvm->page_size = 128; + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 2); + if (ret_val) + goto out; + ret_val = phy->ops.read_reg(hw, E1000_M88E1112_MAC_CTRL_1, + &data); + if (ret_val) + goto out; - nvm->type = e1000_nvm_eeprom_spi; - } else { - nvm->type = e1000_nvm_flash_hw; + data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> + E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; + if (data == E1000_M88E1112_AUTO_COPPER_SGMII || + data == E1000_M88E1112_AUTO_COPPER_BASEX) + hw->mac.ops.check_for_link = + e1000_check_for_link_media_swap; + break; } - - /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_82575; - nvm->ops.release = e1000_release_nvm_82575; - if (nvm->word_size < (1 << 15)) - nvm->ops.read = e1000_read_nvm_eerd; - else - nvm->ops.read = e1000_read_nvm_spi; - - nvm->ops.write = e1000_write_nvm_spi; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.valid_led_default = e1000_valid_led_default_82575; - - /* override generic family function pointers for specific descendants */ - switch (hw->mac.type) { - case e1000_82580: - nvm->ops.validate = e1000_validate_nvm_checksum_82580; - nvm->ops.update = e1000_update_nvm_checksum_82580; + case M88E1512_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1512_phy(hw); break; - case e1000_i350: - case e1000_i354: - nvm->ops.validate = e1000_validate_nvm_checksum_i350; - nvm->ops.update = e1000_update_nvm_checksum_i350; + } + case M88E1543_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1543_phy(hw); break; + } default: - break; + goto out; } - return E1000_SUCCESS; +out: + return ret_val; } /** - * e1000_init_mac_params_82575 - Init MAC func ptrs. - * @hw: pointer to the HW structure + * e1000_init_mac_params_82575 - Init MAC func ptrs. + * @hw: pointer to the HW structure **/ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) { @@ -417,13 +328,16 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) DEBUGFUNC("e1000_init_mac_params_82575"); + /* Initialize function pointer */ + e1000_init_mac_ops_generic(hw); + /* Derives media type */ e1000_get_media_type_82575(hw); - /* Set mta register count */ + /* Set MTA register count */ mac->mta_reg_count = 128; - /* Set uta register count */ + /* Set UTA register count */ mac->uta_reg_count = (hw->mac.type == e1000_82575) ? 0 : 128; - /* Set rar entry count */ + /* Set RAR entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES_82575; if (mac->type == e1000_82576) mac->rar_entry_count = E1000_RAR_ENTRIES_82576; @@ -456,8 +370,8 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if (mac->type >= e1000_82580) mac->ops.reset_hw = e1000_reset_hw_82580; else - mac->ops.reset_hw = e1000_reset_hw_82575; - /* hw initialization */ + mac->ops.reset_hw = e1000_reset_hw_82575; + /* HW initialization */ if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else @@ -493,7 +407,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } if (hw->mac.type >= e1000_82580) mac->ops.validate_mdi_setting = - e1000_validate_mdi_setting_crossover_generic; + e1000_validate_mdi_setting_crossover_generic; /* ID LED init */ mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ @@ -511,6 +425,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) mac->ops.get_link_up_info = e1000_get_link_up_info_82575; /* acquire SW_FW sync */ mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync; + /* release SW_FW sync */ mac->ops.release_swfw_sync = e1000_release_swfw_sync; /* set lan id for port to determine which phy lock to use */ @@ -520,63 +435,102 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } /** - * e1000_init_function_pointers_82575 - Init func ptrs. - * @hw: pointer to the HW structure - * - * Called to initialize all function pointers and parameters. + * e1000_init_nvm_params_82575 - Initialize NVM function ptrs + * @hw: pointer to the HW structure **/ -void e1000_init_function_pointers_82575(struct e1000_hw *hw) +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) { - DEBUGFUNC("e1000_init_function_pointers_82575"); + struct e1000_nvm_info *nvm = &hw->nvm; + u32 eecd = E1000_READ_REG(hw, E1000_EECD); + u16 size; - hw->mac.ops.init_params = e1000_init_mac_params_82575; - hw->nvm.ops.init_params = e1000_init_nvm_params_82575; - hw->phy.ops.init_params = e1000_init_phy_params_82575; - hw->mbx.ops.init_params = e1000_init_mbx_params_pf; -} + DEBUGFUNC("e1000_init_nvm_params_82575"); -/** - * e1000_acquire_phy_82575 - Acquire rights to access PHY - * @hw: pointer to the HW structure - * - * Acquire access rights to the correct PHY. - **/ -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw) -{ - u16 mask = E1000_SWFW_PHY0_SM; + size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> + E1000_EECD_SIZE_EX_SHIFT); + /* Added to a constant, "size" becomes the left-shift value + * for setting word_size. + */ + size += NVM_WORD_SIZE_BASE_SHIFT; - DEBUGFUNC("e1000_acquire_phy_82575"); + /* Just in case size is out of range, cap it to the largest + * EEPROM size supported + */ + if (size > 15) + size = 15; - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + nvm->word_size = 1 << size; + if (hw->mac.type < e1000_i210) { + nvm->opcode_bits = 8; + nvm->delay_usec = 1; + + switch (nvm->override) { + case e1000_nvm_override_spi_large: + nvm->page_size = 32; + nvm->address_bits = 16; + break; + case e1000_nvm_override_spi_small: + nvm->page_size = 8; + nvm->address_bits = 8; + break; + default: + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? + 16 : 8; + break; + } + if (nvm->word_size == (1 << 15)) + nvm->page_size = 128; + + nvm->type = e1000_nvm_eeprom_spi; + } else { + nvm->type = e1000_nvm_flash_hw; + } + + /* Function Pointers */ + nvm->ops.acquire = e1000_acquire_nvm_82575; + nvm->ops.release = e1000_release_nvm_82575; + if (nvm->word_size < (1 << 15)) + nvm->ops.read = e1000_read_nvm_eerd; + else + nvm->ops.read = e1000_read_nvm_spi; + + nvm->ops.write = e1000_write_nvm_spi; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.valid_led_default = e1000_valid_led_default_82575; + + /* override generic family function pointers for specific descendants */ + switch (hw->mac.type) { + case e1000_82580: + nvm->ops.validate = e1000_validate_nvm_checksum_82580; + nvm->ops.update = e1000_update_nvm_checksum_82580; + break; + case e1000_i350: + nvm->ops.validate = e1000_validate_nvm_checksum_i350; + nvm->ops.update = e1000_update_nvm_checksum_i350; + break; + default: + break; + } - return hw->mac.ops.acquire_swfw_sync(hw, mask); + return E1000_SUCCESS; } /** - * e1000_release_phy_82575 - Release rights to access PHY + * e1000_init_function_pointers_82575 - Init func ptrs. * @hw: pointer to the HW structure * - * A wrapper to release access rights to the correct PHY. + * Called to initialize all function pointers and parameters. **/ -static void e1000_release_phy_82575(struct e1000_hw *hw) +void e1000_init_function_pointers_82575(struct e1000_hw *hw) { - u16 mask = E1000_SWFW_PHY0_SM; - - DEBUGFUNC("e1000_release_phy_82575"); - - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + DEBUGFUNC("e1000_init_function_pointers_82575"); - hw->mac.ops.release_swfw_sync(hw, mask); + hw->mac.ops.init_params = e1000_init_mac_params_82575; + hw->nvm.ops.init_params = e1000_init_nvm_params_82575; + hw->phy.ops.init_params = e1000_init_phy_params_82575; + hw->mbx.ops.init_params = e1000_init_mbx_params_pf; } /** @@ -1401,16 +1355,15 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) } /** - * e1000_init_hw_82575 - Initialize hardware - * @hw: pointer to the HW structure + * e1000_init_hw_82575 - Initialize hardware + * @hw: pointer to the HW structure * - * This inits the hardware readying it for operation. + * This inits the hardware readying it for operation. **/ -s32 e1000_init_hw_82575(struct e1000_hw *hw) +STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; - u16 i, rar_count = mac->rar_entry_count; DEBUGFUNC("e1000_init_hw_82575"); @@ -1425,27 +1378,12 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) DEBUGOUT("Initializing the IEEE VLAN\n"); mac->ops.clear_vfta(hw); - /* Setup the receive address */ - e1000_init_rx_addrs_generic(hw, rar_count); - - /* Zero out the Multicast HASH table */ - DEBUGOUT("Zeroing the MTA\n"); - for (i = 0; i < mac->mta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); - - /* Zero out the Unicast HASH table */ - DEBUGOUT("Zeroing the UTA\n"); - for (i = 0; i < mac->uta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_UTA, i, 0); - - /* Setup link and flow control */ - ret_val = mac->ops.setup_link(hw); + ret_val = e1000_init_hw_base(hw); /* Set the default MTU size */ hw->dev_spec._82575.mtu = 1500; - /* - * Clear all of the statistics registers (clear on read). It is + /* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link. @@ -1454,7 +1392,6 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) return ret_val; } - /** * e1000_setup_copper_link_82575 - Configure copper link settings * @hw: pointer to the HW structure @@ -1465,9 +1402,9 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) **/ static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw) { + u32 phpm_reg; u32 ctrl; s32 ret_val; - u32 phpm_reg; DEBUGFUNC("e1000_setup_copper_link_82575"); @@ -1889,7 +1826,7 @@ static bool e1000_sgmii_active_82575(struct e1000_hw *hw) * Inits recommended HW defaults after a reset when there is no EEPROM * detected. This is only for the 82575. **/ -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw) +s32 e1000_reset_init_script_82575(struct e1000_hw *hw) { DEBUGFUNC("e1000_reset_init_script_82575"); @@ -1967,27 +1904,6 @@ static void e1000_config_collision_dist_82575(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } -/** - * e1000_power_down_phy_copper_82575 - Remove link during PHY power down - * @hw: pointer to the HW structure - * - * In the case of a PHY power down to save power, or to turn off link during a - * driver unload, or wake on lan is not enabled, remove the link. - **/ -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw) -{ - struct e1000_phy_info *phy = &hw->phy; - - if (!(phy->ops.check_reset_block)) - return; - - /* If the management interface is not enabled, then power down */ - if (!(e1000_enable_mng_pass_thru(hw) || phy->ops.check_reset_block(hw))) - e1000_power_down_phy_copper(hw); - - return; -} - /** * e1000_clear_hw_cntrs_82575 - Clear device specific hardware counters * @hw: pointer to the HW structure @@ -2053,85 +1969,6 @@ static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw) E1000_READ_REG(hw, E1000_SCVPC); } -/** - * e1000_rx_fifo_flush_82575 - Clean rx fifo after Rx enable - * @hw: pointer to the HW structure - * - * After Rx enable, if manageability is enabled then there is likely some - * bad data at the start of the fifo and possibly in the DMA fifo. This - * function clears the fifos and flushes any packets that came in as rx was - * being enabled. - **/ -void e1000_rx_fifo_flush_82575(struct e1000_hw *hw) -{ - u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; - int i, ms_wait; - - DEBUGFUNC("e1000_rx_fifo_flush_82575"); - - /* disable IPv6 options as per hardware errata */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_IPV6_EX_DIS; - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - if (hw->mac.type != e1000_82575 || - !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) - return; - - /* Disable all Rx queues */ - for (i = 0; i < 4; i++) { - rxdctl[i] = E1000_READ_REG(hw, E1000_RXDCTL(i)); - E1000_WRITE_REG(hw, E1000_RXDCTL(i), - rxdctl[i] & ~E1000_RXDCTL_QUEUE_ENABLE); - } - /* Poll all queues to verify they have shut down */ - for (ms_wait = 0; ms_wait < 10; ms_wait++) { - msec_delay(1); - rx_enabled = 0; - for (i = 0; i < 4; i++) - rx_enabled |= E1000_READ_REG(hw, E1000_RXDCTL(i)); - if (!(rx_enabled & E1000_RXDCTL_QUEUE_ENABLE)) - break; - } - - if (ms_wait == 10) - DEBUGOUT("Queue disable timed out after 10ms\n"); - - /* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all - * incoming packets are rejected. Set enable and wait 2ms so that - * any packet that was coming in as RCTL.EN was set is flushed - */ - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); - - rlpml = E1000_READ_REG(hw, E1000_RLPML); - E1000_WRITE_REG(hw, E1000_RLPML, 0); - - rctl = E1000_READ_REG(hw, E1000_RCTL); - temp_rctl = rctl & ~(E1000_RCTL_EN | E1000_RCTL_SBP); - temp_rctl |= E1000_RCTL_LPE; - - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl); - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl | E1000_RCTL_EN); - E1000_WRITE_FLUSH(hw); - msec_delay(2); - - /* Enable Rx queues that were previously enabled and restore our - * previous state - */ - for (i = 0; i < 4; i++) - E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl[i]); - E1000_WRITE_REG(hw, E1000_RCTL, rctl); - E1000_WRITE_FLUSH(hw); - - E1000_WRITE_REG(hw, E1000_RLPML, rlpml); - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - /* Flush receive errors generated by workaround */ - E1000_READ_REG(hw, E1000_ROC); - E1000_READ_REG(hw, E1000_RNBC); - E1000_READ_REG(hw, E1000_MPC); -} - /** * e1000_set_pcie_completion_timeout - set pci-e completion timeout * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..d6665bfe64dd 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -56,9 +56,7 @@ #define E1000_RAR_ENTRIES_I350 32 #define E1000_SW_SYNCH_MB 0x00000100 #define E1000_STAT_DEV_RST_SET 0x00100000 -#define E1000_CTRL_DEV_RST 0x20000000 -#ifdef E1000_BIT_FIELDS struct e1000_adv_data_desc { __le64 buffer_addr; /* Address of the descriptor's data buffer */ union { @@ -121,7 +119,6 @@ struct e1000_adv_context_desc { } fields; } l4_setup; }; -#endif /* SRRCTL bit definitions */ #define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */ @@ -181,46 +178,12 @@ struct e1000_adv_context_desc { /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */ #define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */ #define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */ -#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */ #define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */ #define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */ #define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */ #define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */ #define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */ #define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */ -#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */ - -/* Receive Descriptor - Advanced */ -union e1000_adv_rx_desc { - struct { - __le64 pkt_addr; /* Packet buffer address */ - __le64 hdr_addr; /* Header buffer address */ - } read; - struct { - struct { - union { - __le32 data; - struct { - __le16 pkt_info; /*RSS type, Pkt type*/ - /* Split Header, header buffer len */ - __le16 hdr_info; - } hs_rss; - } lo_dword; - union { - __le32 rss; /* RSS Hash */ - struct { - __le16 ip_id; /* IP id */ - __le16 csum; /* Packet Checksum */ - } csum_ip; - } hi_dword; - } lower; - struct { - __le32 status_error; /* ext status/error */ - __le16 length; /* Packet length */ - __le16 vlan; /* VLAN tag */ - } upper; - } wb; /* writeback */ -}; #define E1000_RXDADV_RSSTYPE_MASK 0x0000000F #define E1000_RXDADV_RSSTYPE_SHIFT 12 @@ -229,7 +192,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_SPLITHEADER_EN 0x00001000 #define E1000_RXDADV_SPH 0x8000 #define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */ -#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */ #define E1000_RXDADV_ERR_HBO 0x00800000 /* RSS Hash results */ @@ -278,20 +240,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000 -/* Transmit Descriptor - Advanced */ -union e1000_adv_tx_desc { - struct { - __le64 buffer_addr; /* Address of descriptor's data buf */ - __le32 cmd_type_len; - __le32 olinfo_status; - } read; - struct { - __le64 rsvd; /* Reserved */ - __le32 nxtseq_seed; - __le32 status; - } wb; -}; - /* Adv Transmit Descriptor Config Masks */ #define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */ #define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ @@ -314,33 +262,6 @@ union e1000_adv_tx_desc { #define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */ #define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ -/* Context descriptors */ -struct e1000_adv_tx_context_desc { - __le32 vlan_macip_lens; - __le32 seqnum_seed; - __le32 type_tucmd_mlhl; - __le32 mss_l4len_idx; -}; - -#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ -#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */ -#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ -#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */ -#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */ -#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ -#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */ -#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */ -/* IPSec Encrypt Enable for ESP */ -#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000 -/* Req requires Markers and CRC */ -#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000 -#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ -#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ -/* Adv ctxt IPSec SA IDX mask */ -#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF -/* Adv ctxt IPSec ESP len mask */ -#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF - /* Additional Transmit Descriptor Control definitions */ #define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */ #define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. wbk flushing */ @@ -380,11 +301,6 @@ struct e1000_adv_tx_context_desc { #define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ #define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ -/* ETQF register bit definitions */ -#define E1000_ETQF_FILTER_ENABLE (1 << 26) -#define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_1588 (1 << 30) -#define E1000_ETQF_QUEUE_ENABLE (1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -395,10 +311,6 @@ struct e1000_adv_tx_context_desc { */ #define E1000_ETQF_FILTER_EAPOL 0 -#define E1000_FTQF_VF_BP 0x00008000 -#define E1000_FTQF_1588_TIME_STAMP 0x08000000 -#define E1000_FTQF_MASK 0xF0000000 -#define E1000_FTQF_MASK_PROTO_BP 0x10000000 #define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000 #define E1000_FTQF_MASK_DEST_ADDR_BP 0x40000000 #define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000 @@ -474,13 +386,14 @@ struct e1000_adv_tx_context_desc { #define ALL_QUEUES 0xFFFF +s32 e1000_reset_init_script_82575(struct e1000_hw *hw); +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); + /* Rx packet buffer size defines */ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); -s32 e1000_init_hw_82575(struct e1000_hw *hw); enum e1000_promisc_type { e1000_promisc_disabled = 0, /* all promisc modes disabled */ diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index 7e052910e7d0..db4caac37e97 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -46,7 +46,6 @@ extern void e1000_init_function_pointers_82541(struct e1000_hw *hw); extern void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_82575(struct e1000_hw *hw); -extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw); extern void e1000_init_function_pointers_vf(struct e1000_hw *hw); extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw); extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_base.c b/sys/dev/e1000/e1000_base.c new file mode 100644 index 000000000000..e12a5fbecf25 --- /dev/null +++ b/sys/dev/e1000/e1000_base.c @@ -0,0 +1,221 @@ +/****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause + + Copyright (c) 2001-2020, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_hw.h" +#include "e1000_82575.h" +#include "e1000_mac.h" +#include "e1000_base.h" +#include "e1000_manage.h" + +/** + * e1000_acquire_phy_base - Acquire rights to access PHY + * @hw: pointer to the HW structure + * + * Acquire access rights to the correct PHY. + **/ +s32 e1000_acquire_phy_base(struct e1000_hw *hw) +{ + u16 mask = E1000_SWFW_PHY0_SM; + + DEBUGFUNC("e1000_acquire_phy_base"); + + if (hw->bus.func == E1000_FUNC_1) + mask = E1000_SWFW_PHY1_SM; + else if (hw->bus.func == E1000_FUNC_2) + mask = E1000_SWFW_PHY2_SM; + else if (hw->bus.func == E1000_FUNC_3) + mask = E1000_SWFW_PHY3_SM; + + return hw->mac.ops.acquire_swfw_sync(hw, mask); +} + +/** + * e1000_release_phy_base - Release rights to access PHY *** 510 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:13 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 CA7376B10D5; Fri, 24 Sep 2021 01:35:13 +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 4HFvjY3B7cz3JZx; Fri, 24 Sep 2021 01:35:13 +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 414865AC8; Fri, 24 Sep 2021 01:35:13 +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 18O1ZD8V029262; Fri, 24 Sep 2021 01:35:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZDEu029261; Fri, 24 Sep 2021 01:35:13 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:13 GMT Message-Id: <202109240135.18O1ZDEu029261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b06245701c17 - stable/13 - e1000: update for i210 slow system clock 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b06245701c17eac47a8cd8675f70e82f889ec6e8 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: Fri, 24 Sep 2021 01:35:13 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b06245701c17eac47a8cd8675f70e82f889ec6e8 commit b06245701c17eac47a8cd8675f70e82f889ec6e8 Author: Guinan Sun AuthorDate: 2020-07-06 08:11:56 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:23:06 +0000 e1000: update for i210 slow system clock This code is required for the update for system clock. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (3f0188c8f29847038bc9f306b2570ace57e3811c) MFC after: 1 week (cherry picked from commit 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9) --- sys/dev/e1000/e1000_i210.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 0bdad37e56d3..cd85a8c3172a 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -612,6 +612,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) u16 nvm_word, phy_word, pci_word, tmp_nvm; int i; + /* Get PHY semaphore */ + hw->phy.ops.acquire(hw); /* Get and set needed register values */ wuc = E1000_READ_REG(hw, E1000_WUC); mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG); @@ -626,8 +628,11 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ - e1000_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE | - E1000_PHY_PLL_FREQ_REG), &phy_word); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); + usec_delay(20); + e1000_read_phy_reg_mdic(hw, E1000_PHY_PLL_FREQ_REG, &phy_word); + usec_delay(20); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0); if ((phy_word & E1000_PHY_PLL_UNCONF) != E1000_PHY_PLL_UNCONF) { ret_val = E1000_SUCCESS; @@ -661,6 +666,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) } /* restore MDICNFG setting */ E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg); + /* Release PHY semaphore */ + hw->phy.ops.release(hw); return ret_val; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:21 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 6E5256B13D9; Fri, 24 Sep 2021 01:35:21 +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 4HFvjh1cbsz3JPW; Fri, 24 Sep 2021 01:35:20 +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 0722156ED; Fri, 24 Sep 2021 01:35:20 +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 18O1ZJLD029414; Fri, 24 Sep 2021 01:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZJKs029413; Fri, 24 Sep 2021 01:35:19 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:19 GMT Message-Id: <202109240135.18O1ZJKs029413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 270d34d745b1 - stable/13 - e1000: expose FEXTNVM registers and masks 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 270d34d745b1a2d4a5f2e485caf32d446bbd715c 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: Fri, 24 Sep 2021 01:35:21 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=270d34d745b1a2d4a5f2e485caf32d446bbd715c commit 270d34d745b1a2d4a5f2e485caf32d446bbd715c Author: Guinan Sun AuthorDate: 2020-07-06 08:12:16 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:30:29 +0000 e1000: expose FEXTNVM registers and masks Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for future use. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (6d208ec099cd870a73c6b444b350a82c7a26c5e4) MFC after: 1 week (cherry picked from commit de965d042fa4d341cec3fa7cacac0f30f224bde4) --- sys/dev/e1000/e1000_ich8lan.h | 3 ++- sys/dev/e1000/e1000_regs.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index 12f912ebc6e0..caff11cbb899 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -113,11 +113,12 @@ #define E1000_FEXTNVM7_DISABLE_PB_READ 0x00040000 #define E1000_FEXTNVM7_SIDE_CLK_UNGATE 0x00000004 #define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020 +#define E1000_FEXTNVM8_UNBIND_DPG_FROM_MPHY 0x00000400 #define E1000_FEXTNVM9_IOSFSB_CLKGATE_DIS 0x00000800 #define E1000_FEXTNVM9_IOSFSB_CLKREQ_DIS 0x00001000 #define E1000_FEXTNVM11_DISABLE_PB_READ 0x00000200 #define E1000_FEXTNVM11_DISABLE_MULR_FIX 0x00002000 - +#define E1000_FEXTNVM12_DONT_WAK_DPG_CLKREQ 0x00001000 /* bit24: RXDCTL thresholds granularity: 0 - cache lines, 1 - descriptors */ #define E1000_RXDCTL_THRESH_UNIT_DESC 0x01000000 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index fe9834405359..01009d969620 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -66,8 +66,10 @@ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ +#define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ #define E1000_FEXTNVM9 0x5BB4 /* Future Extended NVM 9 - RW */ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ +#define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:22 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 52BD06B107E; Fri, 24 Sep 2021 01:35:22 +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 4HFvjj5FtDz3JbK; Fri, 24 Sep 2021 01:35:21 +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 2EFFD5BD4; Fri, 24 Sep 2021 01:35:21 +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 18O1ZLJq029440; Fri, 24 Sep 2021 01:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZLCn029439; Fri, 24 Sep 2021 01:35:21 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:21 GMT Message-Id: <202109240135.18O1ZLCn029439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 86b4f2f60efc - stable/13 - e1000: introduce DPGFR register 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 86b4f2f60efc10b1cb5b2bc97a93ebddb543dea1 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: Fri, 24 Sep 2021 01:35:22 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=86b4f2f60efc10b1cb5b2bc97a93ebddb543dea1 commit 86b4f2f60efc10b1cb5b2bc97a93ebddb543dea1 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:19 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:31:07 +0000 e1000: introduce DPGFR register Defined DPGFR, Dynamic Power Gate Force Control Register. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1469e5aceffbdcebe834292aadb40b1bd1602867) MFC after: 1 week (cherry picked from commit 7fb2111413c799414c86d7bfdcc72bc1c6302726) --- sys/dev/e1000/e1000_regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 01009d969620..27c456a432e8 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -71,6 +71,7 @@ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ #define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ +#define E1000_DPGFR 0x00FAC /* Dynamic Power Gate Force Control Register */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ #define E1000_VET 0x00038 /* VLAN Ether Type - RW */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:19 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 6D9976B11FA; Fri, 24 Sep 2021 01:35:19 +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 4HFvjg1kfJz3Jfq; Fri, 24 Sep 2021 01:35:19 +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 E6BDF5A56; Fri, 24 Sep 2021 01:35:18 +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 18O1ZIZt029390; Fri, 24 Sep 2021 01:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZIYp029388; Fri, 24 Sep 2021 01:35:18 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:18 GMT Message-Id: <202109240135.18O1ZIYp029388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b81b96fee23b - stable/13 - e1000: add missed define for VFTA 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b81b96fee23b622be5e901543c97d50e68aae6c4 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: Fri, 24 Sep 2021 01:35:19 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b81b96fee23b622be5e901543c97d50e68aae6c4 commit b81b96fee23b622be5e901543c97d50e68aae6c4 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:30:12 +0000 e1000: add missed define for VFTA VLAN filtering using the VFTA (VLAN Filter Table Array) and should be initialized prior to setting rx mode. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc9933953c90e99970aa867c38f9c6e6c5d0488d) MFC after: 1 week (cherry picked from commit a8bb4ab7cfb84195ef8af3c788fecdc8830fc960) --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 5b77bd43af1a..e5435eb56dcd 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1386,6 +1386,7 @@ #define E1000_MDIC_ERROR 0x40000000 #define E1000_MDIC_DEST 0x80000000 +#define E1000_VFTA_BLOCK_SIZE 8 /* SerDes Control */ #define E1000_GEN_CTL_READY 0x80000000 #define E1000_GEN_CTL_ADDRESS_SHIFT 8 From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:24 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 677A36B1881; Fri, 24 Sep 2021 01:35:24 +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 4HFvjm19Jcz3JbR; Fri, 24 Sep 2021 01:35:23 +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 6F4375ACC; Fri, 24 Sep 2021 01:35:23 +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 18O1ZNSL029492; Fri, 24 Sep 2021 01:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZN91029491; Fri, 24 Sep 2021 01:35:23 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:23 GMT Message-Id: <202109240135.18O1ZN91029491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: a026f3294083 - stable/13 - e1000: fix timeout for shadow RAM write 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a026f3294083b585bef81c8a01253fdbae50e72a 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: Fri, 24 Sep 2021 01:35:24 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a026f3294083b585bef81c8a01253fdbae50e72a commit a026f3294083b585bef81c8a01253fdbae50e72a Author: Chengwen Feng AuthorDate: 2021-04-21 09:15:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:31:53 +0000 e1000: fix timeout for shadow RAM write This fixes the timed out for shadow RAM write EEWR can't be detected. Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (4a8ab48ec47b3616272e50620b8e1a9599358ea6) MFC after: 1 week (cherry picked from commit f6517a7e69c10c6057d6c990a9f3ea22a2b62398) --- sys/dev/e1000/e1000_i210.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index cd85a8c3172a..d3692db11245 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,6 +195,8 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { + ret_val = -E1000_ERR_NVM; + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:25 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 F3FBC6B171D; Fri, 24 Sep 2021 01:35:24 +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 4HFvjm5v47z3JdJ; Fri, 24 Sep 2021 01:35:24 +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 9EBD859E1; Fri, 24 Sep 2021 01:35:24 +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 18O1ZOMs029518; Fri, 24 Sep 2021 01:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZORb029517; Fri, 24 Sep 2021 01:35:24 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:24 GMT Message-Id: <202109240135.18O1ZORb029517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 713e66e37d99 - stable/13 - e1000: fix multicast setting in VF 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 713e66e37d990e417170c73ae65024557b8f9071 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: Fri, 24 Sep 2021 01:35:25 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=713e66e37d990e417170c73ae65024557b8f9071 commit 713e66e37d990e417170c73ae65024557b8f9071 Author: Yong Wang AuthorDate: 2017-02-21 09:33:23 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:32:35 +0000 e1000: fix multicast setting in VF In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW". And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST". Fix it by moving the second line prior to the first one that mentioned above. Fixes: dffbaf7880a8 ("e1000: revert fix for multicast in VF") Cc: stable@dpdk.org Signed-off-by: Yong Wang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (f58ca2f9ef6) MFC after: 1 week (cherry picked from commit ecf2a89a997ad4a14339b6a2f544e44b422620a0) --- sys/dev/e1000/e1000_vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c index 653ba322a185..4b73bb9709c1 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -419,12 +419,13 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); + msgbuf[0] = E1000_VF_SET_MULTICAST; + if (mc_addr_count > 30) { msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW; mc_addr_count = 30; } - msgbuf[0] = E1000_VF_SET_MULTICAST; msgbuf[0] |= mc_addr_count << E1000_VT_MSGINFO_SHIFT; for (i = 0; i < mc_addr_count; i++) { From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:27 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 0FB356B178D; Fri, 24 Sep 2021 01:35: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 4HFvjp4C58z3JPq; Fri, 24 Sep 2021 01:35:25 +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 CB66859E2; Fri, 24 Sep 2021 01:35:25 +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 18O1ZPw1029542; Fri, 24 Sep 2021 01:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZPZP029541; Fri, 24 Sep 2021 01:35:25 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:25 GMT Message-Id: <202109240135.18O1ZPZP029541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b9fadaa3757f - stable/13 - e1000: clean LTO warnings 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b9fadaa3757fc47c19b7a6b994f34fd8a1dada5e 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: Fri, 24 Sep 2021 01:35:27 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b9fadaa3757fc47c19b7a6b994f34fd8a1dada5e commit b9fadaa3757fc47c19b7a6b994f34fd8a1dada5e Author: Andrzej Ostruszka AuthorDate: 2019-11-07 15:03:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:32:52 +0000 e1000: clean LTO warnings During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: 'link' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (link) { Signed-off-by: Andrzej Ostruszka Approved by: imp Obtained from: DPDK (46136031f19107f4e9b6b3a952cb7f57877a7f0f) MFC after: 1 week (cherry picked from commit 089cdb3990f47be3cd34d1a57567a2e89c917929) --- sys/dev/e1000/e1000_82543.c | 2 +- sys/dev/e1000/e1000_ich8lan.c | 2 +- sys/dev/e1000/e1000_phy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 42c4726fa8c7..49049b8646cd 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1062,7 +1062,7 @@ static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw) { u32 ctrl; s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_82543"); diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 8ca0fb392805..635be03f2900 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -5620,7 +5620,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw) void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) { s32 ret_val; - u16 reg_data; + u16 reg_data = 0; DEBUGFUNC("e1000_gig_downshift_workaround_ich8lan"); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d84b6120dd31..2eae3acbe500 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -1695,7 +1695,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw) s32 e1000_setup_copper_link_generic(struct e1000_hw *hw) { s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_generic"); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:28 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 33FB66B1720; Fri, 24 Sep 2021 01:35:28 +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 4HFvjq5QBYz3JjQ; Fri, 24 Sep 2021 01:35:27 +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 E7B0A59E3; Fri, 24 Sep 2021 01:35:26 +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 18O1ZQWB029568; Fri, 24 Sep 2021 01:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZQDf029567; Fri, 24 Sep 2021 01:35:26 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:26 GMT Message-Id: <202109240135.18O1ZQDf029567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 9e44dd372efa - stable/13 - e1000: prevent ULP flow if cable connected 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e44dd372efaedacbb7b0e2780ae3b56b5a074b5 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: Fri, 24 Sep 2021 01:35:28 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9e44dd372efaedacbb7b0e2780ae3b56b5a074b5 commit 9e44dd372efaedacbb7b0e2780ae3b56b5a074b5 Author: Wenzhuo Lu AuthorDate: 2015-10-16 02:51:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:33:10 +0000 e1000: prevent ULP flow if cable connected Enabling ulp on link down when cable is connect caused an infinite loop of linkup/down indications in the NDIS driver. After discussed, correct flow is to enable ULP only when cable is disconnected. Signed-off-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (4bff263d54d299269966365f9697941eecaa241b) MFC after: 1 week (cherry picked from commit 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93) --- sys/dev/e1000/e1000_ich8lan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 635be03f2900..dd4e85d64aff 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1307,6 +1307,10 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) (E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", i * 50); + if (!(E1000_READ_REG(hw, E1000_FEXT) & + E1000_FEXT_PHY_CABLE_DISCONNECTED)) + return 0; + } ret_val = hw->phy.ops.acquire(hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:24 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 573F06B13E8; Fri, 24 Sep 2021 01:35:24 +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 4HFvjk6jb0z3JdD; Fri, 24 Sep 2021 01:35:22 +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 4B68B5ACB; Fri, 24 Sep 2021 01:35:22 +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 18O1ZMl5029468; Fri, 24 Sep 2021 01:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZM4S029467; Fri, 24 Sep 2021 01:35:22 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:22 GMT Message-Id: <202109240135.18O1ZM4S029467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f2f50e5e2789 - stable/13 - e1000: cleanup pre-processor tags 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f2f50e5e27894c0f464022f301b2208753cc1764 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: Fri, 24 Sep 2021 01:35:24 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f2f50e5e27894c0f464022f301b2208753cc1764 commit f2f50e5e27894c0f464022f301b2208753cc1764 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:20 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:31:34 +0000 e1000: cleanup pre-processor tags The codes has been exposed correctly, so remove pre-processor tags. Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (a50e998a0fd94e5db508710868a3417b1846425c) MFC after: 1 week (cherry picked from commit 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b) --- sys/dev/e1000/e1000_manage.c | 5 +++-- sys/dev/e1000/e1000_regs.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_manage.c b/sys/dev/e1000/e1000_manage.c index 120431d58b0b..b5ad5815d5ee 100644 --- a/sys/dev/e1000/e1000_manage.c +++ b/sys/dev/e1000/e1000_manage.c @@ -34,6 +34,8 @@ /*$FreeBSD$*/ #include "e1000_api.h" +#include "e1000_manage.h" + /** * e1000_calculate_checksum - Calculate checksum for buffer * @buffer: pointer to EEPROM @@ -455,6 +457,7 @@ s32 e1000_host_interface_command(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } + /** * e1000_load_firmware - Writes proxy FW code buffer to host interface * and execute. @@ -573,5 +576,3 @@ s32 e1000_load_firmware(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } - - diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 27c456a432e8..c09856e55275 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -381,6 +381,7 @@ #define E1000_TSCTC 0x040F8 /* TCP Segmentation Context Tx - R/clr */ #define E1000_TSCTFC 0x040FC /* TCP Segmentation Context Tx Fail - R/clr */ #define E1000_IAC 0x04100 /* Interrupt Assertion Count */ +/* Interrupt Cause */ #define E1000_ICRXPTC 0x04104 /* Interrupt Cause Rx Pkt Timer Expire Count */ #define E1000_ICRXATC 0x04108 /* Interrupt Cause Rx Abs Timer Expire Count */ #define E1000_ICTXPTC 0x0410C /* Interrupt Cause Tx Pkt Timer Expire Count */ @@ -503,12 +504,14 @@ #define E1000_WUC 0x05800 /* Wakeup Control - RW */ #define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */ #define E1000_WUS 0x05810 /* Wakeup Status - RO */ +/* Management registers */ #define E1000_MANC 0x05820 /* Management Control - RW */ #define E1000_IPAV 0x05838 /* IP Address Valid - RW */ #define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */ #define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */ #define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */ #define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */ +/* MSI-X Table Register Descriptions */ #define E1000_PBACL 0x05B68 /* MSIx PBA Clear - Read/Write 1's to clear */ #define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */ #define E1000_HOST_IF 0x08800 /* Host Interface */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:35:29 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 0E23F6B13FA; Fri, 24 Sep 2021 01:35:29 +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 4HFvjr1z8qz3Jbc; Fri, 24 Sep 2021 01:35:28 +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 1AA0859E4; Fri, 24 Sep 2021 01:35:28 +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 18O1ZSPt029596; Fri, 24 Sep 2021 01:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ZS0M029595; Fri, 24 Sep 2021 01:35:28 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:35:28 GMT Message-Id: <202109240135.18O1ZS0M029595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 3f45d625bd22 - stable/13 - e1000: Catch up commit with DPDK 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f45d625bd22964c5e7d6605d08f57d6de5a4942 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: Fri, 24 Sep 2021 01:35:29 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3f45d625bd22964c5e7d6605d08f57d6de5a4942 commit 3f45d625bd22964c5e7d6605d08f57d6de5a4942 Author: Kevin Bowling AuthorDate: 2021-09-17 02:30:49 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:33:32 +0000 e1000: Catch up commit with DPDK Various syncs with the e1000 shared code from DPDK: "cid-gigabit.2020.06.05.tar.gz released by ND" Approved by: imp Obtained from: DPDK MFC after: 1 week (cherry picked from commit 984d1616be883bc2c351aff9aa69b1abd7d1214c) --- sys/dev/e1000/e1000_82571.c | 2 +- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_api.c | 15 +++++ sys/dev/e1000/e1000_api.h | 1 + sys/dev/e1000/e1000_defines.h | 33 ++++++++++ sys/dev/e1000/e1000_hw.h | 2 +- sys/dev/e1000/e1000_i210.c | 100 ++++++++++++++++++++++++++++ sys/dev/e1000/e1000_i210.h | 2 + sys/dev/e1000/e1000_nvm.c | 147 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_nvm.h | 19 ++++++ sys/dev/e1000/e1000_regs.h | 3 +- 11 files changed, 322 insertions(+), 4 deletions(-) diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 6fefcc774cbb..8db1fcb921a9 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82573"); + DEBUGFUNC("e1000_get_hw_semaphore_82574"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 172e99b02d5c..29805270f8dc 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1360,7 +1360,7 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) * * This inits the hardware readying it for operation. **/ -STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) +static s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 6e0f51ab7ffa..b28ab77f3794 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1269,6 +1269,21 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } +/** + * e1000_read_pba_num - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) +{ + return e1000_read_pba_num_generic(hw, pba_num); +} + /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index db4caac37e97..c96030b567db 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -97,6 +97,7 @@ s32 e1000_phy_commit(struct e1000_hw *hw); void e1000_power_up_phy(struct e1000_hw *hw); void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index e5435eb56dcd..44281a0fadf6 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1083,11 +1083,44 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 +#define NVM_NEW_DEC_MASK 0x0F00 +#define NVM_HEX_CONV 16 +#define NVM_HEX_TENS 10 + +/* FW version defines */ +/* Offset of "Loader patch ptr" in Firmware Header */ +#define E1000_I350_NVM_FW_LOADER_PATCH_PTR_OFFSET 0x01 +/* Patch generation hour & minutes */ +#define E1000_I350_NVM_FW_VER_WORD1_OFFSET 0x04 +/* Patch generation month & day */ +#define E1000_I350_NVM_FW_VER_WORD2_OFFSET 0x05 +/* Patch generation year */ +#define E1000_I350_NVM_FW_VER_WORD3_OFFSET 0x06 +/* Patch major & minor numbers */ +#define E1000_I350_NVM_FW_VER_WORD4_OFFSET 0x07 + #define NVM_MAC_ADDR 0x0000 #define NVM_SUB_DEV_ID 0x000B #define NVM_SUB_VEN_ID 0x000C diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 59e51e5c322f..90bc652861b5 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -998,7 +998,7 @@ struct e1000_dev_spec_ich8lan { enum e1000_ulp_state ulp_state; bool ulp_capability_disabled; bool during_suspend_flow; - bool during_dpg_exit; + bool smbus_disable; }; struct e1000_dev_spec_82575 { diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index d3692db11245..0d810fecf3bd 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -345,6 +345,105 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, return ret_val; } +/** + * e1000_read_invm_version - Reads iNVM version and image type + * @hw: pointer to the HW structure + * @invm_ver: version structure for the version read + * + * Reads iNVM version and image type. + **/ +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver) +{ + u32 *record = NULL; + u32 *next_record = NULL; + u32 i = 0; + u32 invm_dword = 0; + u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / + E1000_INVM_RECORD_SIZE_IN_BYTES); + u32 buffer[E1000_INVM_SIZE]; + s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; + u16 version = 0; + + DEBUGFUNC("e1000_read_invm_version"); + + /* Read iNVM memory */ + for (i = 0; i < E1000_INVM_SIZE; i++) { + invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i)); + buffer[i] = invm_dword; + } + + /* Read version number */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have first version location used */ + if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { + version = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have second version location used */ + else if ((i == 1) && + ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have odd version location + * used and it is the last one used + */ + else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && + ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && + (i != 1))) { + version = (*next_record & E1000_INVM_VER_FIELD_TWO) + >> 13; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have even version location + * used and it is the last one used + */ + else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && + ((*record & 0x3) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + } + + if (status == E1000_SUCCESS) { + invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) + >> E1000_INVM_MAJOR_SHIFT; + invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; + } + /* Read Image Type */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have image type in first location used */ + if ((i == 1) && ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) { + invm_ver->invm_img_type = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have image type in first location used */ + else if ((((*record & 0x3) == 0) && + ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) || + ((((*record & 0x3) != 0) && (i != 1)))) { + invm_ver->invm_img_type = + (*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23; + status = E1000_SUCCESS; + break; + } + } + return status; +} + /** * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum * @hw: pointer to the HW structure @@ -628,6 +727,7 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) if (ret_val != E1000_SUCCESS) nvm_word = E1000_INVM_DEFAULT_AL; tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; + phy_word = E1000_PHY_PLL_UNCONF; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index 9ad9e28c363b..77414b851a76 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,6 +44,8 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 86a1e772fb13..31bbfcc6981d 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -939,6 +939,41 @@ s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size) return E1000_SUCCESS; } +/** + * e1000_read_pba_num_generic - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + **/ +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num) +{ + s32 ret_val; + u16 nvm_data; + + DEBUGFUNC("e1000_read_pba_num_generic"); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } else if (nvm_data == NVM_PBA_PTR_GUARD) { + DEBUGOUT("NVM Not Supported\n"); + return -E1000_NOT_IMPLEMENTED; + } + *pba_num = (u32)(nvm_data << 16); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } + *pba_num |= nvm_data; + + return E1000_SUCCESS; +} + /** * e1000_read_pba_raw @@ -1241,4 +1276,116 @@ static void e1000_reload_nvm_generic(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } +/** + * e1000_get_fw_version - Get firmware version information + * @hw: pointer to the HW structure + * @fw_vers: pointer to output version structure + * + * unsupported/not present features return 0 in version structure + **/ +void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) +{ + u16 eeprom_verh, eeprom_verl, etrack_test, fw_version; + u8 q, hval, rem, result; + u16 comb_verh, comb_verl, comb_offset; + + memset(fw_vers, 0, sizeof(struct e1000_fw_version)); + + /* basic eeprom version numbers, bits used vary by part and by tool + * used to create the nvm images */ + /* Check which data format we have */ + switch (hw->mac.type) { + case e1000_i211: + e1000_read_invm_version(hw, fw_vers); + return; + case e1000_82575: + case e1000_82576: + case e1000_82580: + case e1000_i354: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* Use this format, unless EETRACK ID exists, + * then use alternate format + */ + if ((etrack_test & NVM_MAJOR_MASK) != NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + fw_vers->eep_minor = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + fw_vers->eep_build = (fw_version & NVM_IMAGE_ID_MASK); + goto etrack_id; + } + break; + case e1000_i210: + if (!(e1000_get_flash_presence_i210(hw))) { + e1000_read_invm_version(hw, fw_vers); + return; + } + /* fall through */ + case e1000_i350: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* find combo image version */ + hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset); + if ((comb_offset != 0x0) && + (comb_offset != NVM_VER_INVALID)) { + + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset + + 1), 1, &comb_verh); + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset), + 1, &comb_verl); + + /* get Option Rom version if it exists and is valid */ + if ((comb_verh && comb_verl) && + ((comb_verh != NVM_VER_INVALID) && + (comb_verl != NVM_VER_INVALID))) { + + fw_vers->or_valid = true; + fw_vers->or_major = + comb_verl >> NVM_COMB_VER_SHFT; + fw_vers->or_build = + (comb_verl << NVM_COMB_VER_SHFT) + | (comb_verh >> NVM_COMB_VER_SHFT); + fw_vers->or_patch = + comb_verh & NVM_COMB_VER_MASK; + } + } + break; + default: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + return; + } + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + + /* check for old style version format in newer images*/ + if ((fw_version & NVM_NEW_DEC_MASK) == 0x0) { + eeprom_verl = (fw_version & NVM_COMB_VER_MASK); + } else { + eeprom_verl = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + } + /* Convert minor value to hex before assigning to output struct + * Val to be converted will not be higher than 99, per tool output + */ + q = eeprom_verl / NVM_HEX_CONV; + hval = q * NVM_HEX_TENS; + rem = eeprom_verl % NVM_HEX_CONV; + result = hval + rem; + fw_vers->eep_minor = result; + +etrack_id: + if ((etrack_test & NVM_MAJOR_MASK) == NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verl); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) + | eeprom_verl; + } else if ((etrack_test & NVM_ETRACK_VALID) == 0) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) | + eeprom_verl; + } +} + diff --git a/sys/dev/e1000/e1000_nvm.h b/sys/dev/e1000/e1000_nvm.h index fc7ceab17e32..86fd5d1e892f 100644 --- a/sys/dev/e1000/e1000_nvm.h +++ b/sys/dev/e1000/e1000_nvm.h @@ -41,6 +41,22 @@ struct e1000_pba { u16 *pba_block; }; +struct e1000_fw_version { + u32 etrack_id; + u16 eep_major; + u16 eep_minor; + u16 eep_build; + + u8 invm_major; + u8 invm_minor; + u8 invm_img_type; + + bool or_valid; + u16 or_major; + u16 or_build; + u16 or_patch; +}; + void e1000_init_nvm_ops_generic(struct e1000_hw *hw); s32 e1000_null_read_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c); @@ -51,6 +67,7 @@ s32 e1000_acquire_nvm_generic(struct e1000_hw *hw); s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg); s32 e1000_read_mac_addr_generic(struct e1000_hw *hw); +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num); s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size); @@ -75,6 +92,8 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw); void e1000_stop_nvm(struct e1000_hw *hw); void e1000_release_nvm_generic(struct e1000_hw *hw); +void e1000_get_fw_version(struct e1000_hw *hw, + struct e1000_fw_version *fw_vers); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index c09856e55275..b3fb854f8adc 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -64,6 +64,7 @@ #define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */ #define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ +#define E1000_FEXTNVM5 0x00014 /* Future Extended NVM 5 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ #define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ @@ -634,7 +635,7 @@ /* ETQF register bit definitions */ #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_QUEUE_ENABLE (1 << 31) +#define E1000_ETQF_QUEUE_ENABLE (1U << 31) #define E1000_ETQF_QUEUE_SHIFT 16 #define E1000_ETQF_QUEUE_MASK 0x00070000 #define E1000_ETQF_ETYPE_MASK 0x0000FFFF From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:28 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 47F3E6B1E60; Fri, 24 Sep 2021 01:41:28 +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 4HFvrm1S8cz3KZH; Fri, 24 Sep 2021 01:41:28 +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 113BE5A68; Fri, 24 Sep 2021 01:41:28 +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 18O1fS9L039210; Fri, 24 Sep 2021 01:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fRnh039209; Fri, 24 Sep 2021 01:41:27 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:27 GMT Message-Id: <202109240141.18O1fRnh039209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0ab1c22db802 - stable/12 - e1000: Update copyrights and readme 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 0ab1c22db802388f63883e3095a7b3afb86db029 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: Fri, 24 Sep 2021 01:41:28 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0ab1c22db802388f63883e3095a7b3afb86db029 commit 0ab1c22db802388f63883e3095a7b3afb86db029 Author: Kevin Bowling AuthorDate: 2021-09-16 11:35:45 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:07 +0000 e1000: Update copyrights and readme Copyrights in sync with "cid-gigabit.2020.06.05.tar.gz released by ND" (from DPDK). README from the latest em-7.7.8 on intel.com Approved by: imp MFC after: 1 week (cherry picked from commit 702cac6c6bf20ca43db26c38185f65fc9ed1935e) --- sys/dev/e1000/LICENSE | 41 ++- sys/dev/e1000/README | 547 ++++++++++++++++++++------------------ sys/dev/e1000/e1000_80003es2lan.c | 40 +-- sys/dev/e1000/e1000_80003es2lan.h | 40 +-- sys/dev/e1000/e1000_82540.c | 40 +-- sys/dev/e1000/e1000_82541.c | 40 +-- sys/dev/e1000/e1000_82541.h | 40 +-- sys/dev/e1000/e1000_82542.c | 40 +-- sys/dev/e1000/e1000_82543.c | 40 +-- sys/dev/e1000/e1000_82543.h | 40 +-- sys/dev/e1000/e1000_82571.c | 40 +-- sys/dev/e1000/e1000_82571.h | 40 +-- sys/dev/e1000/e1000_82575.c | 40 +-- sys/dev/e1000/e1000_82575.h | 40 +-- sys/dev/e1000/e1000_api.c | 40 +-- sys/dev/e1000/e1000_api.h | 40 +-- sys/dev/e1000/e1000_defines.h | 40 +-- sys/dev/e1000/e1000_hw.h | 40 +-- sys/dev/e1000/e1000_i210.c | 40 +-- sys/dev/e1000/e1000_i210.h | 40 +-- sys/dev/e1000/e1000_ich8lan.c | 40 +-- sys/dev/e1000/e1000_ich8lan.h | 40 +-- sys/dev/e1000/e1000_mac.c | 40 +-- sys/dev/e1000/e1000_mac.h | 40 +-- sys/dev/e1000/e1000_manage.c | 40 +-- sys/dev/e1000/e1000_manage.h | 40 +-- sys/dev/e1000/e1000_mbx.c | 40 +-- sys/dev/e1000/e1000_mbx.h | 40 +-- sys/dev/e1000/e1000_nvm.c | 40 +-- sys/dev/e1000/e1000_nvm.h | 40 +-- sys/dev/e1000/e1000_osdep.c | 40 +-- sys/dev/e1000/e1000_osdep.h | 40 +-- sys/dev/e1000/e1000_phy.c | 40 +-- sys/dev/e1000/e1000_phy.h | 40 +-- sys/dev/e1000/e1000_regs.h | 40 +-- sys/dev/e1000/e1000_vf.c | 40 +-- sys/dev/e1000/e1000_vf.h | 40 +-- 37 files changed, 1007 insertions(+), 981 deletions(-) diff --git a/sys/dev/e1000/LICENSE b/sys/dev/e1000/LICENSE index f70a7cbd4a1d..51a32a819633 100644 --- a/sys/dev/e1000/LICENSE +++ b/sys/dev/e1000/LICENSE @@ -1,31 +1,30 @@ $FreeBSD$ - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/sys/dev/e1000/README b/sys/dev/e1000/README index c0abeacccf4a..d734be75e758 100644 --- a/sys/dev/e1000/README +++ b/sys/dev/e1000/README @@ -1,9 +1,8 @@ $FreeBSD$ -FreeBSD* Driver for Intel Network Connection -============================================= - -May 30, 2007 +FreeBSD* Driver for Intel(R) Ethernet +===================================== +August 7, 2019 Contents ======== @@ -11,396 +10,424 @@ Contents - Overview - Identifying Your Adapter - Building and Installation -- Speed and Duplex Configuration -- Additional Configurations -- Known Limitations +- Additional Features and Configurations +- Known Issues/Troubleshooting - Support - License Overview ======== - -This file describes the FreeBSD* driver for Intel Network Connection. -This driver has been developed for use with FreeBSD, Release 7.x. +This file describes the FreeBSD* driver for Intel(R) Ethernet. This driver has +been developed for use with all community-supported versions of FreeBSD. For questions related to hardware requirements, refer to the documentation -supplied with your Gigabit adapter. All hardware requirements listed +supplied with your Intel Ethernet Adapter. All hardware requirements listed apply to use with FreeBSD. Identifying Your Adapter ======================== +This release includes two gigabit FreeBSD base Drivers for Intel(R) Ethernet. +These drivers are em and igb. -For information on how to identify your adapter, go to the Adapter & -Driver ID Guide at: - -http://support.intel.com/support/network/sb/cs-012904.htm - - -For the latest Intel network drivers for FreeBSD, see: +- The igb driver supports all 82575 and 82576-based gigabit network connections. +- The em driver supports all other gigabit network connections. +- Gigabit devices base on the Intel(R) Ethernet Controller X722 are supported by + the ixl driver. -http://downloadfinder.intel.com/scripts-df-external/support_intel.aspx - - -NOTE: Mobile adapters are not fully supported. NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100 support. +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +http://www.intel.com/support + + Building and Installation ========================= +NOTE: This driver package is to be used only as a standalone archive and the +user should not attempt to incorporate it into the kernel source tree. -NOTE: The driver can be installed as a dynamic loadable kernel module or - compiled into the kernel. You must have kernel sources installed in - order to compile the driver module. - -In the instructions below, x.x.x is the driver version as indicated in the -name of the driver tar file. +In the instructions below, x.x.x is the driver version as indicated in the name +of the driver tar file. 1. Move the base driver tar file to the directory of your choice. For example, use /home/username/em or /usr/local/src/em. 2. Untar/unzip the archive: - tar xzvf em-x.x.x.tar.gz - - This will create an em-x.x.x directory. - -3. To create a loadable module, perform the following steps. - NOTE: To compile the driver into the kernel, go directly to step 4. - - a. To compile the module - - cd em-x.x.x - make - - b. To install the compiled module to the system directory: - - make install - - c. If you want the driver to load automatically when the system is booted: + # tar xzf em-x.x.x.tar.gz - 1. Edit /boot/loader.conf, and add the following line: +This will create the em-x.x.x directory. - if_em_load="YES" +3. To install man page: -4. To compile the driver into the kernel, enter: + # cd em-x.x.x + # gzip -c em.4 > /usr/share/man/man4/em.4.gz - cd em-x.x.x/src - cp *.[ch] /usr/src/sys/dev/em +4. To load the driver onto a running system: - Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in - /usr/src/sys/i386/conf, and ensure the following line is present: - - device em - - Compile and install the kernel. The system must be rebooted for the - kernel updates to take effect. For additional information on compiling - the kernel, consult the FreeBSD operating system documentation. + # cd em-x.x.x/src + # make + # kldload ./if_em.ko 5. To assign an IP address to the interface, enter the following: - ifconfig em + # ifconfig em 6. Verify that the interface works. Enter the following, where is the IP address for another machine on the same subnet as the interface that is being tested: - ping - -7. To configure the IP address to remain after reboot, edit /etc/rc.conf, - and create the appropriate ifconfig_ementry: - - ifconfig_em="" + # ping - Example usage: +7. If you want the driver to load automatically when the system is booted: - ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" + # cd em-x.x.x/src + # make + # make install - NOTE: For assistance, see the ifconfig man page. +Edit /boot/loader.conf, and add the following line: + if_em_load="YES" +Edit /etc/rc.conf, and create the appropriate ifconfig_em entry: -Speed and Duplex Configuration -============================== - -By default, the adapter auto-negotiates the speed and duplex of the -connection. If there is a specific need, the ifconfig utility can be used to -configure the speed and duplex settings on the adapter. Example usage: + ifconfig_em="" - ifconfig em media 100baseTX mediaopt - full-duplex +Example usage: + ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" - NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is - not specified and you are not running at gigabit speed, the driver - defaults to half-duplex. + NOTE: For assistance, see the ifconfig man page. -If the interface is currently forced to 100 full duplex, in order to change -to half duplex you must use this command: - ifconfig em media 100baseTX -mediaopt - full-duplex +Additional Features and Configurations +====================================== +Speed and Duplex Configuration +------------------------------ +In addressing speed and duplex configuration issues, you need to distinguish +between copper-based adapters and fiber-based adapters. -This driver supports the following media type options: +In the default mode, an Intel(R) Ethernet Network Adapter using copper +connections will attempt to auto-negotiate with its link partner to determine +the best setting. If the adapter cannot establish link with the link partner +using auto-negotiation, you may need to manually configure the adapter and link +partner to identical settings to establish link and pass packets. This should +only be needed when attempting to link with an older switch that does not +support auto-negotiation or one that has been forced to a specific speed or +duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds +and higher cannot be forced. Use the autonegotiation advertising setting to +manually set devices for 1 Gbps and higher. - autoselect - Enables auto-negotiation for speed and duplex. +Caution: Only experienced network administrators should force speed and duplex +or change autonegotiation advertising manually. The settings at the switch must +always match the adapter settings. Adapter performance may suffer or your +adapter may not operate if you configure the adapter differently from your +switch. - 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +An Intel(R) Ethernet Network Adapter using fiber-based connections, however, +will not attempt to auto-negotiate with its link partner since those adapters +operate only in full duplex and only at their native speed. - 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +By default, the adapter auto-negotiates the speed and duplex of the connection. +If there is a specific need, the ifconfig utility can be used to configure the +speed and duplex settings on the adapter. - 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +Example usage: - 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +# ifconfig emX media 100baseTX mediaopt full-duplex -For more information on the ifconfig utility, see the ifconfig man page. +NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is not +specified and you are not running at gigabit speed, the driver defaults to +half-duplex. +If the interface is currently forced to 100 full duplex, you must use this +command to change to half duplex: -Additional Configurations -========================= +# ifconfig emX media 100baseTX -mediaopt full-duplex -The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on -all but the 82542-based adapters. For specific adapters, refer to the -Identifying Your Adapter section. +This driver supports the following media type options: - Jumbo Frames - ------------ - To enable Jumbo Frames, use the ifconfig utility to set the Maximum - Transport Unit (MTU) frame size above its default of 1500 bytes. +Media Type Description +---------- ----------- +autoselect Enables auto-negotiation for speed and duplex. +10baseT/UTP Sets speed to 10 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +100baseTX Sets speed to 100 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +1000baseTX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. +1000baseSX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. - The Jumbo Frames MTU range for Intel Adapters is 1500 to 16110. To modify - the setting, enter the following: +For more information on the ifconfig utility, see the ifconfig man page. - ifconfig em mtu 9000 +Jumbo Frames +------------ +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. + +Use the ifconfig command to increase the MTU size. For example, enter the +following where X is the interface number: + +# ifconfig emX mtu 9000 + +To confirm an interface's MTU value, use the ifconfig command. + +To confirm the MTU used between two specific devices, use: + +# route get + +NOTE: The maximum MTU setting for Jumbo Frames is 16110. This value coincides +with the maximum Jumbo Frames size of 16132 bytes. + +NOTE: Using Jumbo frames at 10 or 100 Mbps is not supported and may result in +poor performance or loss of link. + +NOTE: Packet loss may have a greater impact on throughput when you use jumbo +frames. If you observe a drop in performance after enabling jumbo frames, +enabling flow control may mitigate the issue. + +NOTE: Some Intel gigabit adapters that support Jumbo Frames have a frame size +limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. The +adapters with this limitation are based on the Intel(R) 82571EB, 82572EI, +82573L, 82566, 82562, and 80003ES2LAN controller. These correspond to the +following product names: + Intel(R) PRO/1000 PT Server Adapter + Intel(R) PRO/1000 PT Desktop Adapter + Intel(R) PRO/1000 PT Network Connection + Intel(R) PRO/1000 PT Dual Port Server Adapter + Intel(R) PRO/1000 PT Dual Port Network Connection + Intel(R) PRO/1000 PT Quad Port Server Adapter + Intel(R) PRO/1000 PF Quad Port Server Adapter + Intel(R) PRO/1000 PF Server Adapter + Intel(R) PRO/1000 PF Network Connection + Intel(R) PRO/1000 PF Dual Port Server Adapter + Intel(R) PRO/1000 PB Server Connection + Intel(R) PRO/1000 PL Network Connection + Intel(R) PRO/1000 EB Network Connection with I/O Acceleration + Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration + Intel(R) 82566DM-2 Gigabit Network Connection + Intel(R) 82574L Gigabit Network Connection + Intel(R) Gigabit CT Desktop Adapter + Intel(R) 82567LM-4 Gigabit Network Connection + Intel(R) 82567LM-3 Gigabit Network Connection + Intel(R) 82567LF-3 Gigabit Network Connection - To confirm the MTU used between two specific devices, use: +NOTE: The following adapters limit Jumbo Frames sized packets to a maximum of +4088 bytes: + - Intel(R) 82578DM Gigabit Network Connection + - Intel(R) 82577LM Gigabit Network Connection +- The following adapters do not support Jumbo Frames: + - Intel(R) PRO/1000 Gigabit Server Adapter + - Intel(R) PRO/1000 PM Network Connection + - Intel(R) 82562G 10/100 Network Connection + - Intel(R) 82562G-2 10/100 Network Connection + - Intel(R) 82562GT 10/100 Network Connection + - Intel(R) 82562GT-2 10/100 Network Connection + - Intel(R) 82562V 10/100 Network Connection + - Intel(R) 82562V-2 10/100 Network Connection + - Intel(R) 82566DC Gigabit Network Connection + - Intel(R) 82566DC-2 Gigabit Network Connection + - Intel(R) 82566DM Gigabit Network Connection + - Intel(R) 82566MC Gigabit Network Connection + - Intel(R) 82566MM Gigabit Network Connection + - Intel(R) 82567V-3 Gigabit Network Connection + - Intel(R) 82577LC Gigabit Network Connection + - Intel(R) 82578DC Gigabit Network Connection +- Jumbo Frames cannot be configured on an 82579-based Network device if + MACSec is enabled on the system. - route get - Notes: +VLANS +----- +To create a new VLAN interface: - - Only enable Jumbo Frames if your network infrastructure supports them. +# ifconfig create - - To enable Jumbo Frames, increase the MTU size on the interface beyond - 1500. +To associate the VLAN interface with a physical interface and assign a VLAN ID, +IP address, and netmask: - - The Jumbo Frames setting on the switch must be set to at least 22 bytes - larger than that of the MTU. +# ifconfig netmask vlan +vlandev - - The maximum MTU setting for Jumbo Frames is 16110. This value coincides - with the maximum Jumbo Frames size of 16128. +Example: - - Some Intel gigabit adapters that support Jumbo Frames have a frame size - limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. - The adapters with this limitation are based on the Intel(R) 82571EB, - 82572EI, 82573L, 82566, 82562, and 80003ES2LAN controller. These - correspond to the following product names: - Intel(R) PRO/1000 PT Server Adapter - Intel(R) PRO/1000 PT Desktop Adapter - Intel(R) PRO/1000 PT Network Connection - Intel(R) PRO/1000 PT Dual Port Server Adapter - Intel(R) PRO/1000 PT Dual Port Network Connection - Intel(R) PRO/1000 PT Quad Port Server Adapter - Intel(R) PRO/1000 PF Quad Port Server Adapter - Intel(R) PRO/1000 PF Server Adapter - Intel(R) PRO/1000 PF Network Connection - Intel(R) PRO/1000 PF Dual Port Server Adapter - Intel(R) PRO/1000 PB Server Connection - Intel(R) PRO/1000 PL Network Connection - Intel(R) PRO/1000 EB Network Connection with I/O Acceleration - Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration - Intel(R) 82566DM-2 Gigabit Network Connection +# ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - - Adapters based on the Intel(R) 82542 and 82573V/E controller do not - support Jumbo Frames. These correspond to the following product names: - Intel(R) PRO/1000 Gigabit Server Adapter - Intel(R) PRO/1000 PM Network Connection +In this example, all packets will be marked on egress with 802.1Q VLAN tags, +specifying a VLAN ID of 10. - - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or - loss of link. +To remove a VLAN interface: - - The following adapters do not support Jumbo Frames: - Intel(R) 82562V 10/100 Network Connection - Intel(R) 82566DM Gigabit Network Connection - Intel(R) 82566DC Gigabit Network Connection - Intel(R) 82566MM Gigabit Network Connection - Intel(R) 82566MC Gigabit Network Connection - Intel(R) 82562GT 10/100 Network Connection - Intel(R) 82562G 10/100 Network Connection - Intel(R) 82566DC-2 Gigabit Network Connection - Intel(R) 82562V-2 10/100 Network Connection - Intel(R) 82562G-2 10/100 Network Connection - Intel(R) 82562GT-2 10/100 Network Connection +# ifconfig destroy - VLANs - ----- - To create a new VLAN interface: - ifconfig create +Polling +------- +NOTES: +- Device Polling is only valid for non-SMP kernels. +- The driver has to be built into the kernel for Device Polling to be + enabled in the driver. - To associate the VLAN interface with a physical interface and - assign a VLAN ID, IP address, and netmask: +To enable polling in the driver, add the following options to the kernel +configuration, and then recompile the kernel: - ifconfig netmask vlan - vlandev + options DEVICE_POLLING + options HZ=1000 - Example: +At runtime use: + ifconfig emX polling (to turn polling on) +and: + ifconfig emX -polling (to turn it off) - ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - In this example, all packets will be marked on egress with 802.1Q VLAN - tags, specifying a VLAN ID of 10. +Checksum Offload +---------------- +Checksum offloading is not supported on 82542 Gigabit adapters. - To remove a VLAN interface: +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. - Intel Network Connection ifconfig destroy +Checksum offloading can be enabled or disabled using ifconfig. Both transmit +and receive offloading will be either enabled or disabled together. You cannot +enable/disable one without the other. +To enable checksum offloading: - Polling - ------- +# ifconfig emX rxcsum - To enable polling in the driver, add the following options to the kernel - configuration, and then recompile the kernel: +To disable checksum offloading: - options DEVICE_POLLING - options HZ=1000 +# ifconfig emX -rxcsum - At runtime use: - ifconfig emX polling (to turn polling on) - and: - ifconfig emX -polling (to turn it off) +To confirm the current setting: +# ifconfig emX - Checksum Offload - ---------------- - Checksum offloading is not supported on 82542 Gigabit adapters. +Look for the presence or absence of the following line: + options=3 - Checksum offloading supports both TCP and UDP packets and is - supported for both transmit and receive. +See the ifconfig man page for further information. - Checksum offloading can be enabled or disabled using ifconfig. - Both transmit and receive offloading will be either enabled or - disabled together. You cannot enable/disable one without the other. - To enable checksum offloading: +TSO +--- +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. TSO can be disabled +and enabled using the ifconfig utility or sysctl. - ifconfig rxcsum +NOTE: TSO requires Tx checksum, if Tx checksum is disabled, TSO will also be +disabled. - To disable checksum offloading: +NOTE: By default only PCI-Express adapters are ENABLED to do TSO. Others can be +enabled by the user at their own risk. TSO is not supported on 82547 or +82544-based adapters, as well as older adapters. - ifconfig -rxcsum +To enable/disable TSO in the stack: - To confirm the current setting: +# sysctl net.inet.tcp.tso=0 (or 1 to enable it) - ifconfig +Doing this disables/enables TSO in the stack and affects all installed adapters. - Look for the presence or absence of the following line: +To disable BOTH TSO IPv4 and IPv6: - options=3 +# ifconfig em -tso - See the ifconfig man page for further information. +To enable BOTH TSO IPv4 and IPv6: +# ifconfig em tso - TSO - --- - The FreeBSD driver offers support for TSO (TCP Segmentation Offload). +You can also enable/disable IPv4 TSO or IPv6 TSO individually. Simply replace +tso|-tso in the above command with tso4 or tso6. For example, to disable +TSO IPv4: - You can enable/disable it in two ways/places: +# ifconfig em -tso4 - - sysctl net.inet.tcp.tso=0 (or 1 to enable it) +To disable TSO IPv6: - Doing this disables TSO in the stack and will affect all adapters. +# ifconfig em -tso6 - - ifconfig emX -tso - Doing this will disable TSO only for this adapter. +MSI-X +----- +MSI or MSI-X can be turned off by an entry in /etc/sysctl.conf - To enable: + hw.em.enable_msi=0 - - ifconfig emX tso +Unload and reload the driver. - NOTES: By default only PCI-Express adapters are ENABLED to do TSO. Others - can be enabled by the user at their own risk - TSO is not supported on 82547 and 82544-based adapters, as well as older adapters. +Known Issues/Troubleshooting +============================ -Known Limitations -================= +Detected Tx Unit Hang in Quad Port Adapters +------------------------------------------- +In some cases ports 3 and 4 don't pass traffic and report 'Detected Tx Unit +Hang' followed by 'NETDEV WATCHDOG: emX: transmit timed out' errors. Ports 1 +and 2 do not show any errors and will pass traffic. - Detected Tx Unit Hang in Quad Port Adapters - ------------------------------------------- +This issue may be resolved by updating to the latest kernel and BIOS. You +should use an OS that fully supports Message Signaled Interrupts (MSI) and make +sure that MSI is enabled in your system's BIOS. - In some cases ports 3 and 4 wont pass traffic. Ports 1 and 2 don't show - any errors and will pass traffic. - This issue MAY be resolved by updating to the latest BIOS. You can - check your system's BIOS by downloading the Linux Firmware Developer Kit - that can be obtained at http://www.linuxfirmwarekit.org/ +There are known performance issues with this driver when running UDP traffic +with Jumbo Frames. +---------------------------------------------------------------------------- - There are known performance issues with this driver when running UDP traffic - with Jumbo Frames. - ---------------------------------------------------------------------------- +82541/82547 can't link or is slow to link with some link partners +----------------------------------------------------------------- +There is a known compatibility issue where time to link is slow or link is not +established between 82541/82547 controllers and some switches. Known switches +include: + Planex FXG-08TE + I-O Data ETG-SH8 - 82541/82547 can't link or is slow to link with some link partners - ----------------------------------------------------------------- +The driver can be compiled with the following changes: - There is a known compatibility issue where time to link is slow or link is not - established between 82541/82547 controllers and some switches. Known switches - include: - Planex FXG-08TE - I-O Data ETG-SH8 - Netgear GS105v3 + Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - The driver can be compiled with the following changes: +For example, change from: - Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - For example, change from: + #define EM_MASTER_SLAVE e1000_ms_hw_default - #define EM_MASTER_SLAVE e1000_ms_hw_default - to: - #define EM_MASTER_SLAVE 2 +to: - Use one of the following options: - 1 = Master mode - 2 = Slave mode - 3 = Auto master/slave - Setting 2 is recommended. + #define EM_MASTER_SLAVE 2 - Recompile the module: - a. To compile the module - cd em-x.x.x - make clean - make +Use one of the following options: + 1 = Master mode + 2 = Slave mode + 3 = Auto master/slave +Setting 2 is recommended. - b. To install the compiled module in system directory: - make install +Recompile the module: + a. To compile the module + cd em-x.x.x + make clean + make + b. To install the compiled module in system directory: + make install Support ======= +For general information, go to the Intel support website at: +http://www.intel.com/support/ -For general information and support, go to the Intel support website at: +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to freebsd@intel.com - http://support.intel.com -If an issue is identified, support is through email only at: -freebsd@intel.com +Copyright(c) 1999-2019 Intel Corporation. -License -======= - -This software program is released under the terms of a license agreement -between you ('Licensee') and Intel. Do not use or load this software or any -associated materials (collectively, the 'Software') until you have carefully -read the full terms and conditions of the LICENSE located in this software -package. By loading or using the Software, you agree to the terms of this -Agreement. If you do not agree with the terms of this Agreement, do not -install or use the Software. +Trademarks +========== +Intel is a trademark or registered trademark of Intel Corporation or its +subsidiaries in the United States and/or other countries. * Other names and brands may be claimed as the property of others. diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 5c0220adfc6f..50fdfab54685 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index cbf0eafa9407..9e6de14757d7 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index d90c8f9b73f1..0296397ee013 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c *** 1823 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:29 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 AF0DE6B2020; Fri, 24 Sep 2021 01:41:29 +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 4HFvrn3QWTz3KcH; Fri, 24 Sep 2021 01:41:29 +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 37F095BE1; Fri, 24 Sep 2021 01:41:29 +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 18O1fT7w039235; Fri, 24 Sep 2021 01:41:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fTEb039234; Fri, 24 Sep 2021 01:41:29 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:29 GMT Message-Id: <202109240141.18O1fTEb039234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 676f29c1333d - stable/12 - e1000: support flashless i211 PBA 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 676f29c1333dd0f141335e5f0ce8fa416734c921 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: Fri, 24 Sep 2021 01:41:29 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=676f29c1333dd0f141335e5f0ce8fa416734c921 commit 676f29c1333dd0f141335e5f0ce8fa416734c921 Author: Guinan Sun AuthorDate: 2020-07-06 08:11:59 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:38 +0000 e1000: support flashless i211 PBA Add support to print PBA when using flashless. Signed-off-by: Todd Fujinaka Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d3c41d90dfd5b39dec14c74cf53086f4e6634aed) MFC after: 1 week (cherry picked from commit de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce) --- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_nvm.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..27e564d7841b 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -461,7 +461,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else - mac->ops.init_hw = e1000_init_hw_82575; + mac->ops.init_hw = e1000_init_hw_82575; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; /* physical interface link setup */ diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 360c95aa8c69..d96ea3bf760a 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -776,8 +776,9 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, DEBUGFUNC("e1000_read_pba_string_generic"); - if ((hw->mac.type >= e1000_i210) && - !e1000_get_flash_presence_i210(hw)) { + if ((hw->mac.type == e1000_i210 || + hw->mac.type == e1000_i211) && + !e1000_get_flash_presence_i210(hw)) { DEBUGOUT("Flashless no PBA string\n"); return -E1000_ERR_NVM_PBA_SECTION; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:30 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 B0FA36B1DDB; Fri, 24 Sep 2021 01:41:30 +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 4HFvrp3hRQz3KfW; Fri, 24 Sep 2021 01:41:30 +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 52BC15879; Fri, 24 Sep 2021 01:41:30 +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 18O1fUd7039259; Fri, 24 Sep 2021 01:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fUJt039258; Fri, 24 Sep 2021 01:41:30 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:30 GMT Message-Id: <202109240141.18O1fUJt039258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 307419416b53 - stable/12 - e1000: add missing device ID 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 307419416b53f3f4e904656bb6b74ff8393b062c 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: Fri, 24 Sep 2021 01:41:31 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=307419416b53f3f4e904656bb6b74ff8393b062c commit 307419416b53f3f4e904656bb6b74ff8393b062c Author: Guinan Sun AuthorDate: 2020-07-06 08:12:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:43 +0000 e1000: add missing device ID Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII flashless automotive device. Signed-off-by: Kamil Bednarczyk Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (586d770bfefc01d4af97c0ddf17c960c3e49ec22) MFC after: 1 week (cherry picked from commit 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882) --- sys/dev/e1000/e1000_api.c | 1 + sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/if_em.c | 1 + 3 files changed, 3 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index a36b228e075f..6e0f51ab7ffa 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -383,6 +383,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: + case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 28bf22394842..a6df2323eb60 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -209,6 +209,7 @@ struct e1000_hw; #define E1000_DEV_ID_I210_SGMII 0x1538 #define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B #define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C +#define E1000_DEV_ID_I210_SGMII_FLASHLESS 0x15F6 #define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40 #define E1000_DEV_ID_I354_SGMII 0x1F41 diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 519c666436d6..b89747f9ab46 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -233,6 +233,7 @@ static pci_vendor_info_t igb_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) I210 (OEM)"), PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) I210 Flashless (Copper)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) I210 Flashless (SERDES)"), + PVID(0x8086, E1000_DEV_ID_I210_SGMII_FLASHLESS, "Intel(R) I210 Flashless (SGMII)"), PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) I210 (Fiber)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) I210 (SERDES)"), PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) I210 (SGMII)"), From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:31 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 D02BD6B1FCA; Fri, 24 Sep 2021 01:41:31 +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 4HFvrq4g7bz3KZR; Fri, 24 Sep 2021 01:41:31 +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 7D7315A6A; Fri, 24 Sep 2021 01:41:31 +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 18O1fVtF039283; Fri, 24 Sep 2021 01:41:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fVhU039282; Fri, 24 Sep 2021 01:41:31 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:31 GMT Message-Id: <202109240141.18O1fVhU039282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5b6342de13a7 - stable/12 - e1000: expose xMDIO methods 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 5b6342de13a7409aeff122fce64551fa6ef6b2c6 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: Fri, 24 Sep 2021 01:41:32 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5b6342de13a7409aeff122fce64551fa6ef6b2c6 commit 5b6342de13a7409aeff122fce64551fa6ef6b2c6 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:00 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:48 +0000 e1000: expose xMDIO methods Move read and write xmdio methods to e1000_phy. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b14d20f1b2bb0e6d95f19963c5d7f55374e0ead9) MFC after: 1 week (cherry picked from commit da24467c7a162691a14f2f74d90ff8dedb816cfc) --- sys/dev/e1000/e1000_i210.c | 71 --------------------------------------------- sys/dev/e1000/e1000_i210.h | 4 --- sys/dev/e1000/e1000_phy.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_phy.h | 5 ++++ 4 files changed, 77 insertions(+), 75 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 88806891566f..c0055aa0df71 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -600,77 +600,6 @@ out: return ret_val; } -/** - * __e1000_access_xmdio_reg - Read/write XMDIO register - * @hw: pointer to the HW structure - * @address: XMDIO address to program - * @dev_addr: device address to program - * @data: pointer to value to read/write from/to the XMDIO address - * @read: boolean flag to indicate read or write - **/ -static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, - u8 dev_addr, u16 *data, bool read) -{ - s32 ret_val; - - DEBUGFUNC("__e1000_access_xmdio_reg"); - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | - dev_addr); - if (ret_val) - return ret_val; - - if (read) - ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); - else - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); - if (ret_val) - return ret_val; - - /* Recalibrate the device back to 0 */ - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); - if (ret_val) - return ret_val; - - return ret_val; -} - -/** - * e1000_read_xmdio_reg - Read XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be read from the EMI address - **/ -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, TRUE); -} - -/** - * e1000_write_xmdio_reg - Write XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be written to the XMDIO address - **/ -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, FALSE); -} - /** * e1000_pll_workaround_i210 * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index d1ef4edf6261..9ad9e28c363b 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,10 +44,6 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 *data); -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 data); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index 3215ed33d115..d22bcb7149c1 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -4251,3 +4251,75 @@ bool e1000_is_mphy_ready(struct e1000_hw *hw) return ready; } + +/** + * __e1000_access_xmdio_reg - Read/write XMDIO register + * @hw: pointer to the HW structure + * @address: XMDIO address to program + * @dev_addr: device address to program + * @data: pointer to value to read/write from/to the XMDIO address + * @read: boolean flag to indicate read or write + **/ +static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, + u8 dev_addr, u16 *data, bool read) +{ + s32 ret_val; + + DEBUGFUNC("__e1000_access_xmdio_reg"); + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | + dev_addr); + if (ret_val) + return ret_val; + + if (read) + ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); + else + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); + if (ret_val) + return ret_val; + + /* Recalibrate the device back to 0 */ + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); + if (ret_val) + return ret_val; + + return ret_val; +} + +/** + * e1000_read_xmdio_reg - Read XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be read from the EMI address + **/ +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) +{ + DEBUGFUNC("e1000_read_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, true); +} + +/** + * e1000_write_xmdio_reg - Write XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be written to the XMDIO address + **/ +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) +{ + DEBUGFUNC("e1000_write_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, + false); +} diff --git a/sys/dev/e1000/e1000_phy.h b/sys/dev/e1000/e1000_phy.h index a13413e98638..38c8f9b466ce 100644 --- a/sys/dev/e1000/e1000_phy.h +++ b/sys/dev/e1000/e1000_phy.h @@ -122,6 +122,11 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, bool line_override); bool e1000_is_mphy_ready(struct e1000_hw *hw); +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 *data); +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 data); + #define E1000_MAX_PHY_ADDR 8 /* IGP01E1000 Specific Registers */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:34 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 111226B2105; Fri, 24 Sep 2021 01:41:34 +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 4HFvrs6cLvz3KjJ; Fri, 24 Sep 2021 01:41:33 +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 C2F5A587A; Fri, 24 Sep 2021 01:41:33 +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 18O1fXqw039334; Fri, 24 Sep 2021 01:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fXZI039332; Fri, 24 Sep 2021 01:41:33 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:33 GMT Message-Id: <202109240141.18O1fXZI039332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e50c8885a492 - stable/12 - e1000: fix minor issues and improve code style 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/stable/12 X-Git-Reftype: branch X-Git-Commit: e50c8885a49294effa63f487108a94c4c1ba8160 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: Fri, 24 Sep 2021 01:41:34 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e50c8885a49294effa63f487108a94c4c1ba8160 commit e50c8885a49294effa63f487108a94c4c1ba8160 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:59 +0000 e1000: fix minor issues and improve code style Fix typo in piece of code of NVM access for SPT. And cleans up the remaining instances in the shared code where it was not adhering to the Linux code standard. Wrong description was found in the mentioned file, so fix them. Remove shadowing variable declarations. Relating to operands in bitwise operations having different sizes. Unreachable code since *clock_in_i2c_* always return success. Don't return unused s32 and don't check for constants. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Vitaly Lifshits Signed-off-by: Robert Konklewski Signed-off-by: Doug Dziggel Signed-off-by: Todd Fujinaka Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b8592c89c8fbc871d22313dcac0b86c89a7d5a62) MFC after: 1 week (cherry picked from commit 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756) --- sys/dev/e1000/e1000_80003es2lan.c | 1 - sys/dev/e1000/e1000_82575.c | 16 +++++----------- sys/dev/e1000/e1000_i210.c | 8 +++----- sys/dev/e1000/e1000_ich8lan.c | 40 ++++++++++++++++++++------------------- sys/dev/e1000/e1000_mac.c | 2 +- sys/dev/e1000/e1000_nvm.c | 2 +- sys/dev/e1000/e1000_phy.c | 5 ++++- 7 files changed, 35 insertions(+), 39 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 50fdfab54685..db6f1aeb65fb 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1168,7 +1168,6 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw) /** * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up * @hw: pointer to the HW structure - * @duplex: current duplex setting * * Configure the KMRN interface by applying last minute quirks for * 10/100 operation. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 296a72542914..b252a4c7ff1d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -104,10 +104,10 @@ static void e1000_clear_vfta_i350(struct e1000_hw *hw); static void e1000_i2c_start(struct e1000_hw *hw); static void e1000_i2c_stop(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); static s32 e1000_clock_out_i2c_byte(struct e1000_hw *hw, u8 data); static s32 e1000_get_i2c_ack(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); static s32 e1000_clock_out_i2c_bit(struct e1000_hw *hw, bool data); static void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); static void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); @@ -3238,9 +3238,7 @@ s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset, if (status != E1000_SUCCESS) goto fail; - status = e1000_clock_in_i2c_byte(hw, data); - if (status != E1000_SUCCESS) - goto fail; + e1000_clock_in_i2c_byte(hw, data); status = e1000_clock_out_i2c_bit(hw, nack); if (status != E1000_SUCCESS) @@ -3404,7 +3402,7 @@ static void e1000_i2c_stop(struct e1000_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -3416,8 +3414,6 @@ static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) e1000_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return E1000_SUCCESS; } /** @@ -3506,7 +3502,7 @@ static s32 e1000_get_i2c_ack(struct e1000_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) { u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); @@ -3524,8 +3520,6 @@ static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(E1000_I2C_T_LOW); - - return E1000_SUCCESS; } /** diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index c0055aa0df71..c6ca38f0f917 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,7 +195,7 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { - eewr = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) | + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; @@ -281,9 +281,9 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, switch (offset) { case NVM_MAC_ADDR: ret_val = e1000_read_invm_word_i210(hw, (u8)offset, &data[0]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+1, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 1, &data[1]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+2, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 2, &data[2]); if (ret_val != E1000_SUCCESS) DEBUGOUT("MAC Addr not found in iNVM\n"); @@ -561,8 +561,6 @@ void e1000_init_function_pointers_i210(struct e1000_hw *hw) { e1000_init_function_pointers_82575(hw); hw->nvm.ops.init_params = e1000_init_nvm_params_i210; - - return; } /** diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index bc5b57394708..4af7c73a0b0c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -841,7 +841,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) /** * __e1000_access_emi_reg_locked - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write * @@ -1619,8 +1619,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) if (hw->mac.type >= e1000_pch_lpt) { - u16 phy_reg; - hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg); phy_reg &= ~I217_PLL_CLOCK_GATE_MASK; @@ -2474,7 +2472,7 @@ release: /** * e1000_configure_k1_ich8lan - Configure K1 power state * @hw: pointer to the HW structure - * @enable: K1 state to configure + * @k1_enable: K1 state to configure * * Configure the K1 power state based on the provided parameter. * Assumes semaphore already acquired. @@ -2622,6 +2620,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) /** * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -2943,6 +2942,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) /** * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -3550,8 +3550,9 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, for (i = 0; i < words; i += 2) { if (words - i == 1) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = + dev_spec->shadow_ram[offset + i].value; } else { offset_to_read = act_offset + i - ((act_offset + i) % 2); @@ -3568,8 +3569,8 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, } } else { offset_to_read = act_offset + i; - if (!(dev_spec->shadow_ram[offset+i].modified) || - !(dev_spec->shadow_ram[offset+i+1].modified)) { + if (!(dev_spec->shadow_ram[offset + i].modified) || + !(dev_spec->shadow_ram[offset + i + 1].modified)) { ret_val = e1000_read_flash_dword_ich8lan(hw, offset_to_read, @@ -3577,15 +3578,16 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, if (ret_val) break; } - if (dev_spec->shadow_ram[offset+i].modified) - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) + data[i] = + dev_spec->shadow_ram[offset + i].value; else - data[i] = (u16) (dword & 0xFFFF); - if (dev_spec->shadow_ram[offset+i].modified) - data[i+1] = - dev_spec->shadow_ram[offset+i+1].value; + data[i] = (u16)(dword & 0xFFFF); + if (dev_spec->shadow_ram[offset + i + 1].modified) + data[i + 1] = + dev_spec->shadow_ram[offset + i + 1].value; else - data[i+1] = (u16) (dword >> 16 & 0xFFFF); + data[i + 1] = (u16)(dword >> 16 & 0xFFFF); } } @@ -3639,8 +3641,8 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, ret_val = E1000_SUCCESS; for (i = 0; i < words; i++) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = dev_spec->shadow_ram[offset + i].value; } else { ret_val = e1000_read_flash_word_ich8lan(hw, act_offset + i, @@ -4045,8 +4047,8 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, nvm->ops.acquire(hw); for (i = 0; i < words; i++) { - dev_spec->shadow_ram[offset+i].modified = TRUE; - dev_spec->shadow_ram[offset+i].value = data[i]; + dev_spec->shadow_ram[offset + i].modified = TRUE; + dev_spec->shadow_ram[offset + i].value = data[i]; } nvm->ops.release(hw); diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index b9754293d454..f5b4ae0f5135 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -2362,7 +2362,7 @@ e1000_release_swfw_sync(struct e1000_hw *hw, u16 mask) ; /* Empty */ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); - swfw_sync &= ~mask; + swfw_sync &= (u32)~mask; E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); e1000_put_hw_semaphore(hw); diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 7bda1213dde4..95f00e4d681f 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -578,7 +578,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) } for (i = 0; i < words; i++) { - eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) + + eerd = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) + E1000_NVM_RW_REG_START; E1000_WRITE_REG(hw, E1000_EERD, eerd); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d73e3a10ae13..d84b6120dd31 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -621,7 +621,7 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data) * lane and update whole word */ data_local = i2ccmd & 0xFF00; - data_local |= data; + data_local |= (u32)data; i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) | E1000_I2CCMD_OPCODE_WRITE | data_local); @@ -3094,6 +3094,7 @@ s32 e1000_determine_phy_address(struct e1000_hw *hw) /** * e1000_get_phy_addr_for_bm_page - Retrieve PHY page address * @page: page to access + * @reg: register to access * * Returns the phy address for the page requested. **/ @@ -3531,6 +3532,7 @@ void e1000_power_down_phy_copper(struct e1000_hw *hw) * @offset: register offset to be read * @data: pointer to the read data * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then reads the PHY register at offset * and stores the retrieved information in data. Release any acquired @@ -3641,6 +3643,7 @@ s32 e1000_read_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 *data) * @offset: register offset to write to * @data: data to write at register offset * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then writes the data to PHY register * at the offset. Release any acquired semaphores before exiting. From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:35 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 CD57C6B2098; Fri, 24 Sep 2021 01:41:35 +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 4HFvrv34Njz3KZk; Fri, 24 Sep 2021 01:41:35 +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 E03055AE8; Fri, 24 Sep 2021 01:41:34 +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 18O1fYIF039361; Fri, 24 Sep 2021 01:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fYU6039360; Fri, 24 Sep 2021 01:41:34 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:34 GMT Message-Id: <202109240141.18O1fYU6039360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 666848af5fb1 - stable/12 - e1000: modify HW level time sync mechanisms 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 666848af5fb13cbcacc596738cc2f2524f0a47ec 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: Fri, 24 Sep 2021 01:41:36 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=666848af5fb13cbcacc596738cc2f2524f0a47ec commit 666848af5fb13cbcacc596738cc2f2524f0a47ec Author: Guinan Sun AuthorDate: 2020-07-06 08:12:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:03 +0000 e1000: modify HW level time sync mechanisms Add additional configuration space access to allow HW level time sync mechanism. Signed-off-by: Evgeny Efimov Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d53391f1fe2e0eba8818517fdf285f893d95dcc8) MFC after: 1 week (cherry picked from commit d50f362b505e9026fbd33d00dc43e09cac26a209) --- sys/dev/e1000/e1000_ich8lan.c | 18 ++++++++++++++++++ sys/dev/e1000/e1000_ich8lan.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 4af7c73a0b0c..4074eb68198c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -4963,6 +4963,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) u16 kum_cfg; u32 ctrl, reg; s32 ret_val; + u16 pci_cfg; DEBUGFUNC("e1000_reset_hw_ich8lan"); @@ -5023,11 +5024,28 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) e1000_gate_hw_phy_config_ich8lan(hw, TRUE); } ret_val = e1000_acquire_swflag_ich8lan(hw); + + /* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function + * may occur during global reset and cause system hang. + * Configuration space access creates the needed delay. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value + * insures configuration space read is done before global reset. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); DEBUGOUT("Issuing a global reset to ich8lan\n"); E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_RST)); /* cannot issue a flush here because it hangs the hardware */ msec_delay(20); + /* Configuration space access improve HW level time sync mechanism. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER + * value to insure configuration space read is done + * before any access to mac register. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); + /* Set Phy Config Counter to 50msec */ if (hw->mac.type == e1000_pch2lan) { reg = E1000_READ_REG(hw, E1000_FEXTNVM3); diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index a467e647636f..12f912ebc6e0 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -327,6 +327,8 @@ #define E1000_SVCR_OFF_TIMER_SHIFT 16 #define E1000_SVT_OFF_HWM_MASK 0x0000001F +#define E1000_PCI_VENDOR_ID_REGISTER 0x00 + void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, bool state); void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:36 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 905966B210F; Fri, 24 Sep 2021 01:41:36 +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 4HFvrw2Whkz3Kcl; Fri, 24 Sep 2021 01:41:36 +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 1648C5A6D; Fri, 24 Sep 2021 01:41:36 +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 18O1faNj039385; Fri, 24 Sep 2021 01:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fZwv039384; Fri, 24 Sep 2021 01:41:35 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:35 GMT Message-Id: <202109240141.18O1fZwv039384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1d9da96e0f48 - stable/12 - e1000: remove duplicated phy codes 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 1d9da96e0f48a92b4201082c18ab2f31d71d8bd8 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: Fri, 24 Sep 2021 01:41:36 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1d9da96e0f48a92b4201082c18ab2f31d71d8bd8 commit 1d9da96e0f48a92b4201082c18ab2f31d71d8bd8 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:09 +0000 e1000: remove duplicated phy codes Add two files base.c and base.h to reduce the redundancy in the silicon family code. Remove the code duplication from e1000_82575 files. Clean family specific functions from base. Fix up a stray and duplicate function declaration. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (44dddd14059f151f39f7e075b887decfc9a10f11) MFC after: 1 week (cherry picked from commit 6b9d35fac12bf657cd1df8f1521c70704ff62b61) --- sys/conf/files | 2 + sys/dev/e1000/e1000_82575.c | 471 ++++++++++++++---------------------------- sys/dev/e1000/e1000_82575.h | 93 +-------- sys/dev/e1000/e1000_api.h | 1 - sys/dev/e1000/e1000_base.c | 221 ++++++++++++++++++++ sys/dev/e1000/e1000_base.h | 158 ++++++++++++++ sys/dev/e1000/e1000_defines.h | 14 +- sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/e1000_i210.c | 2 +- sys/dev/e1000/e1000_regs.h | 23 ++- sys/dev/e1000/if_em.c | 2 +- sys/dev/e1000/igb_txrx.c | 4 +- sys/modules/em/Makefile | 6 +- 13 files changed, 578 insertions(+), 420 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index b014c51127a7..ec54a06e84f1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1691,6 +1691,8 @@ dev/e1000/e1000_i210.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_base.c optional em \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_manage.c optional em \ diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index b252a4c7ff1d..172e99b02d5c 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -48,8 +48,6 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw); -static void e1000_release_phy_82575(struct e1000_hw *hw); static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw); static void e1000_release_nvm_82575(struct e1000_hw *hw); static s32 e1000_check_for_link_82575(struct e1000_hw *hw); @@ -61,6 +59,7 @@ static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw); static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_reset_hw_82575(struct e1000_hw *hw); +static s32 e1000_init_hw_82575(struct e1000_hw *hw); static s32 e1000_reset_hw_82580(struct e1000_hw *hw); static s32 e1000_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data); @@ -84,10 +83,8 @@ static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, u16 *duplex); static s32 e1000_get_phy_id_82575(struct e1000_hw *hw); static bool e1000_sgmii_active_82575(struct e1000_hw *hw); -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw); static void e1000_config_collision_dist_82575(struct e1000_hw *hw); -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw); static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw); static void e1000_power_up_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw); @@ -156,8 +153,8 @@ static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw) } /** - * e1000_init_phy_params_82575 - Init PHY func ptrs. - * @hw: pointer to the HW structure + * e1000_init_phy_params_82575 - Initialize PHY function ptrs + * @hw: pointer to the HW structure **/ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) { @@ -175,17 +172,17 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82575; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_base; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->reset_delay_us = 100; - phy->ops.acquire = e1000_acquire_phy_82575; + phy->ops.acquire = e1000_acquire_phy_base; phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.get_cfg_done = e1000_get_cfg_done_82575; - phy->ops.release = e1000_release_phy_82575; + phy->ops.release = e1000_release_phy_base; ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -232,76 +229,39 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) case I347AT4_E_PHY_ID: case M88E1112_E_PHY_ID: case M88E1340M_E_PHY_ID: + phy->type = e1000_phy_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + break; case M88E1111_I_PHY_ID: phy->type = e1000_phy_m88; phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.get_info = e1000_get_phy_info_m88; - if (phy->id == I347AT4_E_PHY_ID || - phy->id == M88E1112_E_PHY_ID || - phy->id == M88E1340M_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else if (phy->id == M88E1543_E_PHY_ID || - phy->id == M88E1512_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else - phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; - /* Check if this PHY is confgured for media swap. */ - if (phy->id == M88E1112_E_PHY_ID) { - u16 data; - - ret_val = phy->ops.write_reg(hw, - E1000_M88E1112_PAGE_ADDR, - 2); - if (ret_val) - goto out; - - ret_val = phy->ops.read_reg(hw, - E1000_M88E1112_MAC_CTRL_1, - &data); - if (ret_val) - goto out; - - data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> - E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; - if (data == E1000_M88E1112_AUTO_COPPER_SGMII || - data == E1000_M88E1112_AUTO_COPPER_BASEX) - hw->mac.ops.check_for_link = - e1000_check_for_link_media_swap; - } - if (phy->id == M88E1512_E_PHY_ID) { - ret_val = e1000_initialize_M88E1512_phy(hw); - if (ret_val) - goto out; - } - if (phy->id == M88E1543_E_PHY_ID) { - ret_val = e1000_initialize_M88E1543_phy(hw); - if (ret_val) - goto out; - } break; case IGP03E1000_E_PHY_ID: case IGP04E1000_E_PHY_ID: - phy->type = e1000_phy_igp_3; - phy->ops.check_polarity = e1000_check_polarity_igp; - phy->ops.get_info = e1000_get_phy_info_igp; + phy->type = e1000_phy_igp_3; + phy->ops.check_polarity = e1000_check_polarity_igp; + phy->ops.get_info = e1000_get_phy_info_igp; phy->ops.get_cable_length = e1000_get_cable_length_igp_2; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; break; case I82580_I_PHY_ID: case I350_I_PHY_ID: - phy->type = e1000_phy_82580; - phy->ops.check_polarity = e1000_check_polarity_82577; - phy->ops.force_speed_duplex = - e1000_phy_force_speed_duplex_82577; + phy->type = e1000_phy_82580; + phy->ops.check_polarity = e1000_check_polarity_82577; + phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.get_cable_length = e1000_get_cable_length_82577; - phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; + phy->ops.force_speed_duplex = + e1000_phy_force_speed_duplex_82577; break; case I210_I_PHY_ID: phy->type = e1000_phy_i210; @@ -317,98 +277,49 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } -out: - return ret_val; -} - -/** - * e1000_init_nvm_params_82575 - Init NVM func ptrs. - * @hw: pointer to the HW structure - **/ -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) -{ - struct e1000_nvm_info *nvm = &hw->nvm; - u32 eecd = E1000_READ_REG(hw, E1000_EECD); - u16 size; - - DEBUGFUNC("e1000_init_nvm_params_82575"); - - size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> - E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value - * for setting word_size. - */ - size += NVM_WORD_SIZE_BASE_SHIFT; - - /* Just in case size is out of range, cap it to the largest - * EEPROM size supported - */ - if (size > 15) - size = 15; - - nvm->word_size = 1 << size; - if (hw->mac.type < e1000_i210) { - nvm->opcode_bits = 8; - nvm->delay_usec = 1; + /* Check if this PHY is configured for media swap. */ + switch (phy->id) { + case M88E1112_E_PHY_ID: + { + u16 data; - switch (nvm->override) { - case e1000_nvm_override_spi_large: - nvm->page_size = 32; - nvm->address_bits = 16; - break; - case e1000_nvm_override_spi_small: - nvm->page_size = 8; - nvm->address_bits = 8; - break; - default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; - nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? - 16 : 8; - break; - } - if (nvm->word_size == (1 << 15)) - nvm->page_size = 128; + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 2); + if (ret_val) + goto out; + ret_val = phy->ops.read_reg(hw, E1000_M88E1112_MAC_CTRL_1, + &data); + if (ret_val) + goto out; - nvm->type = e1000_nvm_eeprom_spi; - } else { - nvm->type = e1000_nvm_flash_hw; + data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> + E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; + if (data == E1000_M88E1112_AUTO_COPPER_SGMII || + data == E1000_M88E1112_AUTO_COPPER_BASEX) + hw->mac.ops.check_for_link = + e1000_check_for_link_media_swap; + break; } - - /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_82575; - nvm->ops.release = e1000_release_nvm_82575; - if (nvm->word_size < (1 << 15)) - nvm->ops.read = e1000_read_nvm_eerd; - else - nvm->ops.read = e1000_read_nvm_spi; - - nvm->ops.write = e1000_write_nvm_spi; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.valid_led_default = e1000_valid_led_default_82575; - - /* override generic family function pointers for specific descendants */ - switch (hw->mac.type) { - case e1000_82580: - nvm->ops.validate = e1000_validate_nvm_checksum_82580; - nvm->ops.update = e1000_update_nvm_checksum_82580; + case M88E1512_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1512_phy(hw); break; - case e1000_i350: - case e1000_i354: - nvm->ops.validate = e1000_validate_nvm_checksum_i350; - nvm->ops.update = e1000_update_nvm_checksum_i350; + } + case M88E1543_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1543_phy(hw); break; + } default: - break; + goto out; } - return E1000_SUCCESS; +out: + return ret_val; } /** - * e1000_init_mac_params_82575 - Init MAC func ptrs. - * @hw: pointer to the HW structure + * e1000_init_mac_params_82575 - Init MAC func ptrs. + * @hw: pointer to the HW structure **/ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) { @@ -417,13 +328,16 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) DEBUGFUNC("e1000_init_mac_params_82575"); + /* Initialize function pointer */ + e1000_init_mac_ops_generic(hw); + /* Derives media type */ e1000_get_media_type_82575(hw); - /* Set mta register count */ + /* Set MTA register count */ mac->mta_reg_count = 128; - /* Set uta register count */ + /* Set UTA register count */ mac->uta_reg_count = (hw->mac.type == e1000_82575) ? 0 : 128; - /* Set rar entry count */ + /* Set RAR entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES_82575; if (mac->type == e1000_82576) mac->rar_entry_count = E1000_RAR_ENTRIES_82576; @@ -456,8 +370,8 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if (mac->type >= e1000_82580) mac->ops.reset_hw = e1000_reset_hw_82580; else - mac->ops.reset_hw = e1000_reset_hw_82575; - /* hw initialization */ + mac->ops.reset_hw = e1000_reset_hw_82575; + /* HW initialization */ if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else @@ -493,7 +407,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } if (hw->mac.type >= e1000_82580) mac->ops.validate_mdi_setting = - e1000_validate_mdi_setting_crossover_generic; + e1000_validate_mdi_setting_crossover_generic; /* ID LED init */ mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ @@ -511,6 +425,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) mac->ops.get_link_up_info = e1000_get_link_up_info_82575; /* acquire SW_FW sync */ mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync; + /* release SW_FW sync */ mac->ops.release_swfw_sync = e1000_release_swfw_sync; /* set lan id for port to determine which phy lock to use */ @@ -520,63 +435,102 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } /** - * e1000_init_function_pointers_82575 - Init func ptrs. - * @hw: pointer to the HW structure - * - * Called to initialize all function pointers and parameters. + * e1000_init_nvm_params_82575 - Initialize NVM function ptrs + * @hw: pointer to the HW structure **/ -void e1000_init_function_pointers_82575(struct e1000_hw *hw) +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) { - DEBUGFUNC("e1000_init_function_pointers_82575"); + struct e1000_nvm_info *nvm = &hw->nvm; + u32 eecd = E1000_READ_REG(hw, E1000_EECD); + u16 size; - hw->mac.ops.init_params = e1000_init_mac_params_82575; - hw->nvm.ops.init_params = e1000_init_nvm_params_82575; - hw->phy.ops.init_params = e1000_init_phy_params_82575; - hw->mbx.ops.init_params = e1000_init_mbx_params_pf; -} + DEBUGFUNC("e1000_init_nvm_params_82575"); -/** - * e1000_acquire_phy_82575 - Acquire rights to access PHY - * @hw: pointer to the HW structure - * - * Acquire access rights to the correct PHY. - **/ -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw) -{ - u16 mask = E1000_SWFW_PHY0_SM; + size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> + E1000_EECD_SIZE_EX_SHIFT); + /* Added to a constant, "size" becomes the left-shift value + * for setting word_size. + */ + size += NVM_WORD_SIZE_BASE_SHIFT; - DEBUGFUNC("e1000_acquire_phy_82575"); + /* Just in case size is out of range, cap it to the largest + * EEPROM size supported + */ + if (size > 15) + size = 15; - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + nvm->word_size = 1 << size; + if (hw->mac.type < e1000_i210) { + nvm->opcode_bits = 8; + nvm->delay_usec = 1; + + switch (nvm->override) { + case e1000_nvm_override_spi_large: + nvm->page_size = 32; + nvm->address_bits = 16; + break; + case e1000_nvm_override_spi_small: + nvm->page_size = 8; + nvm->address_bits = 8; + break; + default: + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? + 16 : 8; + break; + } + if (nvm->word_size == (1 << 15)) + nvm->page_size = 128; + + nvm->type = e1000_nvm_eeprom_spi; + } else { + nvm->type = e1000_nvm_flash_hw; + } + + /* Function Pointers */ + nvm->ops.acquire = e1000_acquire_nvm_82575; + nvm->ops.release = e1000_release_nvm_82575; + if (nvm->word_size < (1 << 15)) + nvm->ops.read = e1000_read_nvm_eerd; + else + nvm->ops.read = e1000_read_nvm_spi; + + nvm->ops.write = e1000_write_nvm_spi; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.valid_led_default = e1000_valid_led_default_82575; + + /* override generic family function pointers for specific descendants */ + switch (hw->mac.type) { + case e1000_82580: + nvm->ops.validate = e1000_validate_nvm_checksum_82580; + nvm->ops.update = e1000_update_nvm_checksum_82580; + break; + case e1000_i350: + nvm->ops.validate = e1000_validate_nvm_checksum_i350; + nvm->ops.update = e1000_update_nvm_checksum_i350; + break; + default: + break; + } - return hw->mac.ops.acquire_swfw_sync(hw, mask); + return E1000_SUCCESS; } /** - * e1000_release_phy_82575 - Release rights to access PHY + * e1000_init_function_pointers_82575 - Init func ptrs. * @hw: pointer to the HW structure * - * A wrapper to release access rights to the correct PHY. + * Called to initialize all function pointers and parameters. **/ -static void e1000_release_phy_82575(struct e1000_hw *hw) +void e1000_init_function_pointers_82575(struct e1000_hw *hw) { - u16 mask = E1000_SWFW_PHY0_SM; - - DEBUGFUNC("e1000_release_phy_82575"); - - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + DEBUGFUNC("e1000_init_function_pointers_82575"); - hw->mac.ops.release_swfw_sync(hw, mask); + hw->mac.ops.init_params = e1000_init_mac_params_82575; + hw->nvm.ops.init_params = e1000_init_nvm_params_82575; + hw->phy.ops.init_params = e1000_init_phy_params_82575; + hw->mbx.ops.init_params = e1000_init_mbx_params_pf; } /** @@ -1401,16 +1355,15 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) } /** - * e1000_init_hw_82575 - Initialize hardware - * @hw: pointer to the HW structure + * e1000_init_hw_82575 - Initialize hardware + * @hw: pointer to the HW structure * - * This inits the hardware readying it for operation. + * This inits the hardware readying it for operation. **/ -s32 e1000_init_hw_82575(struct e1000_hw *hw) +STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; - u16 i, rar_count = mac->rar_entry_count; DEBUGFUNC("e1000_init_hw_82575"); @@ -1425,27 +1378,12 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) DEBUGOUT("Initializing the IEEE VLAN\n"); mac->ops.clear_vfta(hw); - /* Setup the receive address */ - e1000_init_rx_addrs_generic(hw, rar_count); - - /* Zero out the Multicast HASH table */ - DEBUGOUT("Zeroing the MTA\n"); - for (i = 0; i < mac->mta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); - - /* Zero out the Unicast HASH table */ - DEBUGOUT("Zeroing the UTA\n"); - for (i = 0; i < mac->uta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_UTA, i, 0); - - /* Setup link and flow control */ - ret_val = mac->ops.setup_link(hw); + ret_val = e1000_init_hw_base(hw); /* Set the default MTU size */ hw->dev_spec._82575.mtu = 1500; - /* - * Clear all of the statistics registers (clear on read). It is + /* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link. @@ -1454,7 +1392,6 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) return ret_val; } - /** * e1000_setup_copper_link_82575 - Configure copper link settings * @hw: pointer to the HW structure @@ -1465,9 +1402,9 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) **/ static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw) { + u32 phpm_reg; u32 ctrl; s32 ret_val; - u32 phpm_reg; DEBUGFUNC("e1000_setup_copper_link_82575"); @@ -1889,7 +1826,7 @@ static bool e1000_sgmii_active_82575(struct e1000_hw *hw) * Inits recommended HW defaults after a reset when there is no EEPROM * detected. This is only for the 82575. **/ -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw) +s32 e1000_reset_init_script_82575(struct e1000_hw *hw) { DEBUGFUNC("e1000_reset_init_script_82575"); @@ -1967,27 +1904,6 @@ static void e1000_config_collision_dist_82575(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } -/** - * e1000_power_down_phy_copper_82575 - Remove link during PHY power down - * @hw: pointer to the HW structure - * - * In the case of a PHY power down to save power, or to turn off link during a - * driver unload, or wake on lan is not enabled, remove the link. - **/ -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw) -{ - struct e1000_phy_info *phy = &hw->phy; - - if (!(phy->ops.check_reset_block)) - return; - - /* If the management interface is not enabled, then power down */ - if (!(e1000_enable_mng_pass_thru(hw) || phy->ops.check_reset_block(hw))) - e1000_power_down_phy_copper(hw); - - return; -} - /** * e1000_clear_hw_cntrs_82575 - Clear device specific hardware counters * @hw: pointer to the HW structure @@ -2053,85 +1969,6 @@ static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw) E1000_READ_REG(hw, E1000_SCVPC); } -/** - * e1000_rx_fifo_flush_82575 - Clean rx fifo after Rx enable - * @hw: pointer to the HW structure - * - * After Rx enable, if manageability is enabled then there is likely some - * bad data at the start of the fifo and possibly in the DMA fifo. This - * function clears the fifos and flushes any packets that came in as rx was - * being enabled. - **/ -void e1000_rx_fifo_flush_82575(struct e1000_hw *hw) -{ - u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; - int i, ms_wait; - - DEBUGFUNC("e1000_rx_fifo_flush_82575"); - - /* disable IPv6 options as per hardware errata */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_IPV6_EX_DIS; - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - if (hw->mac.type != e1000_82575 || - !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) - return; - - /* Disable all Rx queues */ - for (i = 0; i < 4; i++) { - rxdctl[i] = E1000_READ_REG(hw, E1000_RXDCTL(i)); - E1000_WRITE_REG(hw, E1000_RXDCTL(i), - rxdctl[i] & ~E1000_RXDCTL_QUEUE_ENABLE); - } - /* Poll all queues to verify they have shut down */ - for (ms_wait = 0; ms_wait < 10; ms_wait++) { - msec_delay(1); - rx_enabled = 0; - for (i = 0; i < 4; i++) - rx_enabled |= E1000_READ_REG(hw, E1000_RXDCTL(i)); - if (!(rx_enabled & E1000_RXDCTL_QUEUE_ENABLE)) - break; - } - - if (ms_wait == 10) - DEBUGOUT("Queue disable timed out after 10ms\n"); - - /* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all - * incoming packets are rejected. Set enable and wait 2ms so that - * any packet that was coming in as RCTL.EN was set is flushed - */ - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); - - rlpml = E1000_READ_REG(hw, E1000_RLPML); - E1000_WRITE_REG(hw, E1000_RLPML, 0); - - rctl = E1000_READ_REG(hw, E1000_RCTL); - temp_rctl = rctl & ~(E1000_RCTL_EN | E1000_RCTL_SBP); - temp_rctl |= E1000_RCTL_LPE; - - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl); - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl | E1000_RCTL_EN); - E1000_WRITE_FLUSH(hw); - msec_delay(2); - - /* Enable Rx queues that were previously enabled and restore our - * previous state - */ - for (i = 0; i < 4; i++) - E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl[i]); - E1000_WRITE_REG(hw, E1000_RCTL, rctl); - E1000_WRITE_FLUSH(hw); - - E1000_WRITE_REG(hw, E1000_RLPML, rlpml); - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - /* Flush receive errors generated by workaround */ - E1000_READ_REG(hw, E1000_ROC); - E1000_READ_REG(hw, E1000_RNBC); - E1000_READ_REG(hw, E1000_MPC); -} - /** * e1000_set_pcie_completion_timeout - set pci-e completion timeout * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..d6665bfe64dd 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -56,9 +56,7 @@ #define E1000_RAR_ENTRIES_I350 32 #define E1000_SW_SYNCH_MB 0x00000100 #define E1000_STAT_DEV_RST_SET 0x00100000 -#define E1000_CTRL_DEV_RST 0x20000000 -#ifdef E1000_BIT_FIELDS struct e1000_adv_data_desc { __le64 buffer_addr; /* Address of the descriptor's data buffer */ union { @@ -121,7 +119,6 @@ struct e1000_adv_context_desc { } fields; } l4_setup; }; -#endif /* SRRCTL bit definitions */ #define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */ @@ -181,46 +178,12 @@ struct e1000_adv_context_desc { /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */ #define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */ #define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */ -#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */ #define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */ #define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */ #define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */ #define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */ #define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */ #define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */ -#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */ - -/* Receive Descriptor - Advanced */ -union e1000_adv_rx_desc { - struct { - __le64 pkt_addr; /* Packet buffer address */ - __le64 hdr_addr; /* Header buffer address */ - } read; - struct { - struct { - union { - __le32 data; - struct { - __le16 pkt_info; /*RSS type, Pkt type*/ - /* Split Header, header buffer len */ - __le16 hdr_info; - } hs_rss; - } lo_dword; - union { - __le32 rss; /* RSS Hash */ - struct { - __le16 ip_id; /* IP id */ - __le16 csum; /* Packet Checksum */ - } csum_ip; - } hi_dword; - } lower; - struct { - __le32 status_error; /* ext status/error */ - __le16 length; /* Packet length */ - __le16 vlan; /* VLAN tag */ - } upper; - } wb; /* writeback */ -}; #define E1000_RXDADV_RSSTYPE_MASK 0x0000000F #define E1000_RXDADV_RSSTYPE_SHIFT 12 @@ -229,7 +192,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_SPLITHEADER_EN 0x00001000 #define E1000_RXDADV_SPH 0x8000 #define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */ -#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */ #define E1000_RXDADV_ERR_HBO 0x00800000 /* RSS Hash results */ @@ -278,20 +240,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000 -/* Transmit Descriptor - Advanced */ -union e1000_adv_tx_desc { - struct { - __le64 buffer_addr; /* Address of descriptor's data buf */ - __le32 cmd_type_len; - __le32 olinfo_status; - } read; - struct { - __le64 rsvd; /* Reserved */ - __le32 nxtseq_seed; - __le32 status; - } wb; -}; - /* Adv Transmit Descriptor Config Masks */ #define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */ #define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ @@ -314,33 +262,6 @@ union e1000_adv_tx_desc { #define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */ #define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ -/* Context descriptors */ -struct e1000_adv_tx_context_desc { - __le32 vlan_macip_lens; - __le32 seqnum_seed; - __le32 type_tucmd_mlhl; - __le32 mss_l4len_idx; -}; - -#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ -#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */ -#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ -#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */ -#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */ -#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ -#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */ -#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */ -/* IPSec Encrypt Enable for ESP */ -#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000 -/* Req requires Markers and CRC */ -#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000 -#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ -#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ -/* Adv ctxt IPSec SA IDX mask */ -#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF -/* Adv ctxt IPSec ESP len mask */ -#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF - /* Additional Transmit Descriptor Control definitions */ #define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */ #define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. wbk flushing */ @@ -380,11 +301,6 @@ struct e1000_adv_tx_context_desc { #define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ #define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ -/* ETQF register bit definitions */ -#define E1000_ETQF_FILTER_ENABLE (1 << 26) -#define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_1588 (1 << 30) -#define E1000_ETQF_QUEUE_ENABLE (1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -395,10 +311,6 @@ struct e1000_adv_tx_context_desc { */ #define E1000_ETQF_FILTER_EAPOL 0 -#define E1000_FTQF_VF_BP 0x00008000 -#define E1000_FTQF_1588_TIME_STAMP 0x08000000 -#define E1000_FTQF_MASK 0xF0000000 -#define E1000_FTQF_MASK_PROTO_BP 0x10000000 #define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000 #define E1000_FTQF_MASK_DEST_ADDR_BP 0x40000000 #define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000 @@ -474,13 +386,14 @@ struct e1000_adv_tx_context_desc { #define ALL_QUEUES 0xFFFF +s32 e1000_reset_init_script_82575(struct e1000_hw *hw); +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); + /* Rx packet buffer size defines */ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); -s32 e1000_init_hw_82575(struct e1000_hw *hw); enum e1000_promisc_type { e1000_promisc_disabled = 0, /* all promisc modes disabled */ diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index 7e052910e7d0..db4caac37e97 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -46,7 +46,6 @@ extern void e1000_init_function_pointers_82541(struct e1000_hw *hw); extern void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_82575(struct e1000_hw *hw); -extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw); extern void e1000_init_function_pointers_vf(struct e1000_hw *hw); extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw); extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_base.c b/sys/dev/e1000/e1000_base.c new file mode 100644 index 000000000000..e12a5fbecf25 --- /dev/null +++ b/sys/dev/e1000/e1000_base.c @@ -0,0 +1,221 @@ +/****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause + + Copyright (c) 2001-2020, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_hw.h" +#include "e1000_82575.h" +#include "e1000_mac.h" +#include "e1000_base.h" +#include "e1000_manage.h" + +/** + * e1000_acquire_phy_base - Acquire rights to access PHY + * @hw: pointer to the HW structure + * + * Acquire access rights to the correct PHY. + **/ +s32 e1000_acquire_phy_base(struct e1000_hw *hw) +{ + u16 mask = E1000_SWFW_PHY0_SM; + + DEBUGFUNC("e1000_acquire_phy_base"); + + if (hw->bus.func == E1000_FUNC_1) + mask = E1000_SWFW_PHY1_SM; + else if (hw->bus.func == E1000_FUNC_2) + mask = E1000_SWFW_PHY2_SM; + else if (hw->bus.func == E1000_FUNC_3) + mask = E1000_SWFW_PHY3_SM; + + return hw->mac.ops.acquire_swfw_sync(hw, mask); +} + +/** + * e1000_release_phy_base - Release rights to access PHY *** 510 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:37 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 B22CC6B1DE7; Fri, 24 Sep 2021 01:41:37 +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 4HFvrx3DDkz3Kvp; Fri, 24 Sep 2021 01:41:37 +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 35F915BE3; Fri, 24 Sep 2021 01:41:37 +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 18O1fbCH039409; Fri, 24 Sep 2021 01:41:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fbQG039408; Fri, 24 Sep 2021 01:41:37 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:37 GMT Message-Id: <202109240141.18O1fbQG039408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: a93454518e3c - stable/12 - e1000: update for i210 slow system clock 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/stable/12 X-Git-Reftype: branch X-Git-Commit: a93454518e3c72ea255be72c09133c1a1f648bfb 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: Fri, 24 Sep 2021 01:41:38 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a93454518e3c72ea255be72c09133c1a1f648bfb commit a93454518e3c72ea255be72c09133c1a1f648bfb Author: Guinan Sun AuthorDate: 2020-07-06 08:11:56 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:19 +0000 e1000: update for i210 slow system clock This code is required for the update for system clock. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (3f0188c8f29847038bc9f306b2570ace57e3811c) MFC after: 1 week (cherry picked from commit 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9) --- sys/dev/e1000/e1000_i210.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 0bdad37e56d3..cd85a8c3172a 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -612,6 +612,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) u16 nvm_word, phy_word, pci_word, tmp_nvm; int i; + /* Get PHY semaphore */ + hw->phy.ops.acquire(hw); /* Get and set needed register values */ wuc = E1000_READ_REG(hw, E1000_WUC); mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG); @@ -626,8 +628,11 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ - e1000_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE | - E1000_PHY_PLL_FREQ_REG), &phy_word); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); + usec_delay(20); + e1000_read_phy_reg_mdic(hw, E1000_PHY_PLL_FREQ_REG, &phy_word); + usec_delay(20); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0); if ((phy_word & E1000_PHY_PLL_UNCONF) != E1000_PHY_PLL_UNCONF) { ret_val = E1000_SUCCESS; @@ -661,6 +666,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) } /* restore MDICNFG setting */ E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg); + /* Release PHY semaphore */ + hw->phy.ops.release(hw); return ret_val; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:41 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 ABF7A6B1DEA; Fri, 24 Sep 2021 01:41:41 +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 4HFvs12MhYz3Kw6; Fri, 24 Sep 2021 01:41:41 +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 98098587B; Fri, 24 Sep 2021 01:41:40 +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 18O1feUJ039487; Fri, 24 Sep 2021 01:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1feAc039486; Fri, 24 Sep 2021 01:41:40 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:40 GMT Message-Id: <202109240141.18O1feAc039486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 355177efed6c - stable/12 - e1000: add missing register defines 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 355177efed6c745049ff22aac58f8dc8dca08cc7 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: Fri, 24 Sep 2021 01:41:42 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=355177efed6c745049ff22aac58f8dc8dca08cc7 commit 355177efed6c745049ff22aac58f8dc8dca08cc7 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:08 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:34 +0000 e1000: add missing register defines Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for the nvmupd_validate_offset function to correctly validate the NVM update offset. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2c7fe65ab9a31e6ebf438dad7ccc59bcde83a89f) MFC after: 1 week (cherry picked from commit 09888d4bc1a2c45d121046f79be5c01e4889a67e) --- sys/dev/e1000/e1000_regs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 2b7696ddea62..fe9834405359 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -169,6 +169,8 @@ #define E1000_EMIDATA 0x11 /* Extended Memory Indirect Data */ /* Shadow Ram Write Register - RW */ #define E1000_SRWR 0x12018 +#define E1000_EEC_REG 0x12010 + #define E1000_I210_FLMNGCTL 0x12038 #define E1000_I210_FLMNGDATA 0x1203C #define E1000_I210_FLMNGCNT 0x12040 @@ -179,6 +181,9 @@ #define E1000_I210_FLA 0x1201C +#define E1000_SHADOWINF 0x12068 +#define E1000_FLFWUPDATE 0x12108 + #define E1000_INVM_DATA_REG(_n) (0x12120 + 4*(_n)) #define E1000_INVM_SIZE 64 /* Number of INVM Data Registers */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:44 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 5D1416B1DF0; Fri, 24 Sep 2021 01:41:44 +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 4HFvs41MNkz3KdC; Fri, 24 Sep 2021 01:41:44 +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 013A25BE4; Fri, 24 Sep 2021 01:41:44 +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 18O1fhh8039559; Fri, 24 Sep 2021 01:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fhuN039558; Fri, 24 Sep 2021 01:41:43 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:43 GMT Message-Id: <202109240141.18O1fhuN039558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f0413f8ec9ba - stable/12 - e1000: expose FEXTNVM registers and masks 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/stable/12 X-Git-Reftype: branch X-Git-Commit: f0413f8ec9ba50c9f8d4299ecd6c442a5d810c5e 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: Fri, 24 Sep 2021 01:41:44 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f0413f8ec9ba50c9f8d4299ecd6c442a5d810c5e commit f0413f8ec9ba50c9f8d4299ecd6c442a5d810c5e Author: Guinan Sun AuthorDate: 2020-07-06 08:12:16 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:48 +0000 e1000: expose FEXTNVM registers and masks Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for future use. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (6d208ec099cd870a73c6b444b350a82c7a26c5e4) MFC after: 1 week (cherry picked from commit de965d042fa4d341cec3fa7cacac0f30f224bde4) --- sys/dev/e1000/e1000_ich8lan.h | 3 ++- sys/dev/e1000/e1000_regs.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index 12f912ebc6e0..caff11cbb899 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -113,11 +113,12 @@ #define E1000_FEXTNVM7_DISABLE_PB_READ 0x00040000 #define E1000_FEXTNVM7_SIDE_CLK_UNGATE 0x00000004 #define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020 +#define E1000_FEXTNVM8_UNBIND_DPG_FROM_MPHY 0x00000400 #define E1000_FEXTNVM9_IOSFSB_CLKGATE_DIS 0x00000800 #define E1000_FEXTNVM9_IOSFSB_CLKREQ_DIS 0x00001000 #define E1000_FEXTNVM11_DISABLE_PB_READ 0x00000200 #define E1000_FEXTNVM11_DISABLE_MULR_FIX 0x00002000 - +#define E1000_FEXTNVM12_DONT_WAK_DPG_CLKREQ 0x00001000 /* bit24: RXDCTL thresholds granularity: 0 - cache lines, 1 - descriptors */ #define E1000_RXDCTL_THRESH_UNIT_DESC 0x01000000 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index fe9834405359..01009d969620 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -66,8 +66,10 @@ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ +#define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ #define E1000_FEXTNVM9 0x5BB4 /* Future Extended NVM 9 - RW */ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ +#define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:40 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 2B05F6B1F70; Fri, 24 Sep 2021 01:41:40 +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 4HFvrz5qNWz3Kjn; Fri, 24 Sep 2021 01:41:39 +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 6F4615A71; Fri, 24 Sep 2021 01:41:39 +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 18O1fdUi039457; Fri, 24 Sep 2021 01:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fdlh039456; Fri, 24 Sep 2021 01:41:39 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:39 GMT Message-Id: <202109240141.18O1fdlh039456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8ee52cd01975 - stable/12 - e1000: add PCIm function state 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 8ee52cd01975207265eafb19189918d71d86f255 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: Fri, 24 Sep 2021 01:41:40 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8ee52cd01975207265eafb19189918d71d86f255 commit 8ee52cd01975207265eafb19189918d71d86f255 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:07 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:29 +0000 e1000: add PCIm function state Added define to pcim function state. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (7ee1a3b273c7f321b50e6ba17c3d9537b1b08347) MFC after: 1 week (cherry picked from commit a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1) --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 512e0da52904..d3aba827c3b5 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -346,6 +346,7 @@ #define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus spd 50-66MHz */ #define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus spd 66-100MHz */ #define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus spd 100-133MHz*/ +#define E1000_STATUS_PCIM_STATE 0x40000000 /* PCIm function state */ #define SPEED_10 10 #define SPEED_100 100 From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:46 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 310B46B2205; Fri, 24 Sep 2021 01:41:46 +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 4HFvs5538Yz3Kmc; Fri, 24 Sep 2021 01:41:45 +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 1A97F5D01; Fri, 24 Sep 2021 01:41:45 +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 18O1fjl3039583; Fri, 24 Sep 2021 01:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fjel039582; Fri, 24 Sep 2021 01:41:45 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:45 GMT Message-Id: <202109240141.18O1fjel039582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e68491e21d7d - stable/12 - e1000: introduce DPGFR register 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/stable/12 X-Git-Reftype: branch X-Git-Commit: e68491e21d7d7671dfc3ad1a322560bd46699dbc 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: Fri, 24 Sep 2021 01:41:46 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e68491e21d7d7671dfc3ad1a322560bd46699dbc commit e68491e21d7d7671dfc3ad1a322560bd46699dbc Author: Guinan Sun AuthorDate: 2020-07-06 08:12:19 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:53 +0000 e1000: introduce DPGFR register Defined DPGFR, Dynamic Power Gate Force Control Register. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1469e5aceffbdcebe834292aadb40b1bd1602867) MFC after: 1 week (cherry picked from commit 7fb2111413c799414c86d7bfdcc72bc1c6302726) --- sys/dev/e1000/e1000_regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 01009d969620..27c456a432e8 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -71,6 +71,7 @@ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ #define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ +#define E1000_DPGFR 0x00FAC /* Dynamic Power Gate Force Control Register */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ #define E1000_VET 0x00038 /* VLAN Ether Type - RW */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:48 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 8C6916B1DF1; Fri, 24 Sep 2021 01:41:48 +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 4HFvs74Pbmz3KdS; Fri, 24 Sep 2021 01:41:47 +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 4868E5762; Fri, 24 Sep 2021 01:41:46 +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 18O1fk77039613; Fri, 24 Sep 2021 01:41:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fkcx039612; Fri, 24 Sep 2021 01:41:46 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:46 GMT Message-Id: <202109240141.18O1fkcx039612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d71c915a636e - stable/12 - e1000: cleanup pre-processor tags 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/stable/12 X-Git-Reftype: branch X-Git-Commit: d71c915a636e39ab924c9bc89c5cce04467d18ef 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: Fri, 24 Sep 2021 01:41:48 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d71c915a636e39ab924c9bc89c5cce04467d18ef commit d71c915a636e39ab924c9bc89c5cce04467d18ef Author: Guinan Sun AuthorDate: 2020-07-06 08:12:20 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:58 +0000 e1000: cleanup pre-processor tags The codes has been exposed correctly, so remove pre-processor tags. Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (a50e998a0fd94e5db508710868a3417b1846425c) MFC after: 1 week (cherry picked from commit 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b) --- sys/dev/e1000/e1000_manage.c | 5 +++-- sys/dev/e1000/e1000_regs.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_manage.c b/sys/dev/e1000/e1000_manage.c index 120431d58b0b..b5ad5815d5ee 100644 --- a/sys/dev/e1000/e1000_manage.c +++ b/sys/dev/e1000/e1000_manage.c @@ -34,6 +34,8 @@ /*$FreeBSD$*/ #include "e1000_api.h" +#include "e1000_manage.h" + /** * e1000_calculate_checksum - Calculate checksum for buffer * @buffer: pointer to EEPROM @@ -455,6 +457,7 @@ s32 e1000_host_interface_command(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } + /** * e1000_load_firmware - Writes proxy FW code buffer to host interface * and execute. @@ -573,5 +576,3 @@ s32 e1000_load_firmware(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } - - diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 27c456a432e8..c09856e55275 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -381,6 +381,7 @@ #define E1000_TSCTC 0x040F8 /* TCP Segmentation Context Tx - R/clr */ #define E1000_TSCTFC 0x040FC /* TCP Segmentation Context Tx Fail - R/clr */ #define E1000_IAC 0x04100 /* Interrupt Assertion Count */ +/* Interrupt Cause */ #define E1000_ICRXPTC 0x04104 /* Interrupt Cause Rx Pkt Timer Expire Count */ #define E1000_ICRXATC 0x04108 /* Interrupt Cause Rx Abs Timer Expire Count */ #define E1000_ICTXPTC 0x0410C /* Interrupt Cause Tx Pkt Timer Expire Count */ @@ -503,12 +504,14 @@ #define E1000_WUC 0x05800 /* Wakeup Control - RW */ #define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */ #define E1000_WUS 0x05810 /* Wakeup Status - RO */ +/* Management registers */ #define E1000_MANC 0x05820 /* Management Control - RW */ #define E1000_IPAV 0x05838 /* IP Address Valid - RW */ #define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */ #define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */ #define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */ #define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */ +/* MSI-X Table Register Descriptions */ #define E1000_PBACL 0x05B68 /* MSIx PBA Clear - Read/Write 1's to clear */ #define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */ #define E1000_HOST_IF 0x08800 /* Host Interface */ From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:33 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 513626B202A; Fri, 24 Sep 2021 01:41:33 +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 4HFvrr5wfxz3KjB; Fri, 24 Sep 2021 01:41:32 +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 9F9235AE5; Fri, 24 Sep 2021 01:41:32 +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 18O1fWmg039307; Fri, 24 Sep 2021 01:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fWGI039306; Fri, 24 Sep 2021 01:41:32 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:32 GMT Message-Id: <202109240141.18O1fWGI039306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: bb436434ee0d - stable/12 - e1000: add function parameter descriptions 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/stable/12 X-Git-Reftype: branch X-Git-Commit: bb436434ee0d8643a061cc2f03c7d2e893be7aad 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: Fri, 24 Sep 2021 01:41:33 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bb436434ee0d8643a061cc2f03c7d2e893be7aad commit bb436434ee0d8643a061cc2f03c7d2e893be7aad Author: Guinan Sun AuthorDate: 2020-07-06 08:12:02 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:38:54 +0000 e1000: add function parameter descriptions Add function parameter descriptions to address gcc 7 warnings. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1bf35d435c9764e83be76042fa6489dd127b6c40) MFC after: 1 week (cherry picked from commit 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427) --- sys/dev/e1000/e1000_82575.c | 11 +++++------ sys/dev/e1000/e1000_mac.c | 8 ++++++++ sys/dev/e1000/e1000_mbx.c | 4 ++++ sys/dev/e1000/e1000_nvm.c | 7 +++++++ sys/dev/e1000/e1000_phy.c | 6 ++++++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 27e564d7841b..296a72542914 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2702,7 +2702,7 @@ out: /** * __e1000_access_emi_reg - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write **/ @@ -2929,8 +2929,8 @@ out: /** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE based on setting in dev_spec structure. * @@ -2984,8 +2984,8 @@ out: /** * e1000_set_eee_i354 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE legacy mode based on setting in dev_spec structure. * @@ -3641,7 +3641,6 @@ static s32 e1000_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data) /** * e1000_get_i2c_data - Reads the I2C SDA data bit - * @hw: pointer to hardware structure * @i2cctl: Current value of I2CCTL register * * Returns the I2C data bit value diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index eeb9da727534..b9754293d454 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -105,6 +105,8 @@ void e1000_null_mac_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_link_info - No-op function, return 0 * @hw: pointer to the HW structure + * @s: dummy variable + * @d: dummy variable **/ s32 e1000_null_link_info(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *s, u16 E1000_UNUSEDARG *d) @@ -126,6 +128,8 @@ bool e1000_null_mng_mode(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_update_mc - No-op function, return void * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) @@ -137,6 +141,8 @@ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_vfta - No-op function, return void * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable **/ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG a, u32 E1000_UNUSEDARG b) @@ -148,6 +154,8 @@ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_rar_set - No-op function, return 0 * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ int e1000_null_rar_set(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) diff --git a/sys/dev/e1000/e1000_mbx.c b/sys/dev/e1000/e1000_mbx.c index da31185c3476..3fc3811757f7 100644 --- a/sys/dev/e1000/e1000_mbx.c +++ b/sys/dev/e1000/e1000_mbx.c @@ -38,6 +38,7 @@ /** * e1000_null_mbx_check_for_flag - No-op function, return 0 * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG mbx_id) @@ -50,6 +51,9 @@ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_mbx_transact - No-op function, return 0 * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_transact(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG *msg, diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index d96ea3bf760a..7bda1213dde4 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -63,6 +63,9 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw) /** * e1000_null_nvm_read - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_read_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, @@ -85,6 +88,7 @@ void e1000_null_nvm_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_led_default - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *data) @@ -96,6 +100,9 @@ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_nvm - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_write_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d22bcb7149c1..d73e3a10ae13 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -104,6 +104,7 @@ void e1000_init_phy_ops_generic(struct e1000_hw *hw) /** * e1000_null_set_page - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG data) @@ -115,6 +116,8 @@ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_read_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_read_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG *data) @@ -136,6 +139,7 @@ void e1000_null_phy_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_lplu_state - No-op function, return 0 * @hw: pointer to the HW structure + * @active: dummy variable **/ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, bool E1000_UNUSEDARG active) @@ -147,6 +151,8 @@ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_write_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG data) From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:39 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 ED9C06B1F6F; Fri, 24 Sep 2021 01:41:38 +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 4HFvry4vbnz3KPQ; Fri, 24 Sep 2021 01:41:38 +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 4FD4F5A6F; Fri, 24 Sep 2021 01:41:38 +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 18O1fcjS039433; Fri, 24 Sep 2021 01:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fc7I039432; Fri, 24 Sep 2021 01:41:38 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:38 GMT Message-Id: <202109240141.18O1fc7I039432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 33753fa9b7ec - stable/12 - e1000: expose MAC functions 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 33753fa9b7ec47ea50b121c1ee602d48332823e6 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: Fri, 24 Sep 2021 01:41:39 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=33753fa9b7ec47ea50b121c1ee602d48332823e6 commit 33753fa9b7ec47ea50b121c1ee602d48332823e6 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:06 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:24 +0000 e1000: expose MAC functions Now the functions are being accessed outside of the file, we need to properly expose them for silicon families to use. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a) MFC after: 1 week (cherry picked from commit d1c37752e2afb51dfb2e08afe714a799788b6ede) --- sys/dev/e1000/e1000_mac.c | 3 +-- sys/dev/e1000/e1000_mac.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index f5b4ae0f5135..f9fb2cbbfe3d 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -38,7 +38,6 @@ static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw); static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); static void e1000_config_collision_dist_generic(struct e1000_hw *hw); -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); /** * e1000_init_mac_ops_generic - Initialize MAC function pointers @@ -484,7 +483,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) * Sets the receive address array register at index to the address passed * in by addr. **/ -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) { u32 rar_low, rar_high; diff --git a/sys/dev/e1000/e1000_mac.h b/sys/dev/e1000/e1000_mac.h index 1f472d42421e..370f7f9d8a1a 100644 --- a/sys/dev/e1000/e1000_mac.h +++ b/sys/dev/e1000/e1000_mac.h @@ -70,6 +70,7 @@ s32 e1000_led_on_generic(struct e1000_hw *hw); s32 e1000_led_off_generic(struct e1000_hw *hw); void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count); +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); s32 e1000_set_default_fc_generic(struct e1000_hw *hw); s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw); s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:48 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 A88A26B2286; Fri, 24 Sep 2021 01:41:48 +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 4HFvs7723wz3KgL; Fri, 24 Sep 2021 01:41:47 +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 6973656FD; Fri, 24 Sep 2021 01:41:47 +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 18O1flpd039637; Fri, 24 Sep 2021 01:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1flbG039636; Fri, 24 Sep 2021 01:41:47 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:47 GMT Message-Id: <202109240141.18O1flbG039636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0f843e051379 - stable/12 - e1000: fix timeout for shadow RAM write 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 0f843e05137962827ec84216e6d3340b765c5497 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: Fri, 24 Sep 2021 01:41:48 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0f843e05137962827ec84216e6d3340b765c5497 commit 0f843e05137962827ec84216e6d3340b765c5497 Author: Chengwen Feng AuthorDate: 2021-04-21 09:15:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:40:03 +0000 e1000: fix timeout for shadow RAM write This fixes the timed out for shadow RAM write EEWR can't be detected. Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (4a8ab48ec47b3616272e50620b8e1a9599358ea6) MFC after: 1 week (cherry picked from commit f6517a7e69c10c6057d6c990a9f3ea22a2b62398) --- sys/dev/e1000/e1000_i210.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index cd85a8c3172a..d3692db11245 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,6 +195,8 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { + ret_val = -E1000_ERR_NVM; + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:42 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 A6F866B2047; Fri, 24 Sep 2021 01:41:42 +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 4HFvs21RRYz3Kg0; Fri, 24 Sep 2021 01:41:42 +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 B328D5761; Fri, 24 Sep 2021 01:41:41 +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 18O1ffbH039511; Fri, 24 Sep 2021 01:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1ff7h039510; Fri, 24 Sep 2021 01:41:41 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:41 GMT Message-Id: <202109240141.18O1ff7h039510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c2e24a65659e - stable/12 - e1000: increase timeout for ME ULP exit 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/stable/12 X-Git-Reftype: branch X-Git-Commit: c2e24a65659ea09cafb093465f61f3708e237dbb 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: Fri, 24 Sep 2021 01:41:43 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c2e24a65659ea09cafb093465f61f3708e237dbb commit c2e24a65659ea09cafb093465f61f3708e237dbb Author: Guinan Sun AuthorDate: 2020-07-06 08:12:09 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:38 +0000 e1000: increase timeout for ME ULP exit Due timing issues in WHL and since recovery by host is not always supported, increased timeout for Manageability Engine(ME) to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (cf1f3ca45d33e793ca581200b4000c39a798113e) MFC after: 1 week (cherry picked from commit e8e3171d992f3255cc8e5a0f59912d07679cc94c) --- sys/dev/e1000/e1000_ich8lan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 4074eb68198c..0311fdb3fef6 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1413,6 +1413,7 @@ out: s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) { s32 ret_val = E1000_SUCCESS; + u8 ulp_exit_timeout = 30; u32 mac_reg; u16 phy_reg; int i = 0; @@ -1434,10 +1435,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) E1000_WRITE_REG(hw, E1000_H2ME, mac_reg); } - /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ + if (hw->mac.type == e1000_pch_cnp) + ulp_exit_timeout = 100; + while (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_ULP_CFG_DONE) { - if (i++ == 30) { + if (i++ == ulp_exit_timeout) { ret_val = -E1000_ERR_PHY; goto out; } From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:43 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 B8FE66B1DEE; Fri, 24 Sep 2021 01:41:43 +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 4HFvs32cHcz3KbB; Fri, 24 Sep 2021 01:41:43 +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 D64E85D00; Fri, 24 Sep 2021 01:41:42 +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 18O1fgiZ039535; Fri, 24 Sep 2021 01:41:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fgi6039534; Fri, 24 Sep 2021 01:41:42 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:42 GMT Message-Id: <202109240141.18O1fgi6039534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: bc167ad657cf - stable/12 - e1000: add missed define for VFTA 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/stable/12 X-Git-Reftype: branch X-Git-Commit: bc167ad657cf9a027ec7538e35fa4119d83d1bac 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: Fri, 24 Sep 2021 01:41:43 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bc167ad657cf9a027ec7538e35fa4119d83d1bac commit bc167ad657cf9a027ec7538e35fa4119d83d1bac Author: Guinan Sun AuthorDate: 2020-07-06 08:12:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:39:43 +0000 e1000: add missed define for VFTA VLAN filtering using the VFTA (VLAN Filter Table Array) and should be initialized prior to setting rx mode. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc9933953c90e99970aa867c38f9c6e6c5d0488d) MFC after: 1 week (cherry picked from commit a8bb4ab7cfb84195ef8af3c788fecdc8830fc960) --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index d3aba827c3b5..30629cce8ddc 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1390,6 +1390,7 @@ #define E1000_MDIC_ERROR 0x40000000 #define E1000_MDIC_DEST 0x80000000 +#define E1000_VFTA_BLOCK_SIZE 8 /* SerDes Control */ #define E1000_GEN_CTL_READY 0x80000000 #define E1000_GEN_CTL_ADDRESS_SHIFT 8 From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:51 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 E2AF66B1DF4; Fri, 24 Sep 2021 01:41:51 +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 4HFvsC2NZMz3L1B; Fri, 24 Sep 2021 01:41:51 +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 E7D9F5D05; Fri, 24 Sep 2021 01:41:50 +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 18O1folu039709; Fri, 24 Sep 2021 01:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1foVE039708; Fri, 24 Sep 2021 01:41:50 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:50 GMT Message-Id: <202109240141.18O1foVE039708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 410ec4c16ab4 - stable/12 - e1000: prevent ULP flow if cable connected 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 410ec4c16ab4ac7e6dff266dd7a5a3659400b760 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: Fri, 24 Sep 2021 01:41:52 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=410ec4c16ab4ac7e6dff266dd7a5a3659400b760 commit 410ec4c16ab4ac7e6dff266dd7a5a3659400b760 Author: Wenzhuo Lu AuthorDate: 2015-10-16 02:51:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:40:19 +0000 e1000: prevent ULP flow if cable connected Enabling ulp on link down when cable is connect caused an infinite loop of linkup/down indications in the NDIS driver. After discussed, correct flow is to enable ULP only when cable is disconnected. Signed-off-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (4bff263d54d299269966365f9697941eecaa241b) MFC after: 1 week (cherry picked from commit 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93) --- sys/dev/e1000/e1000_ich8lan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index b29d53ea4b54..5d0c9fccf626 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1307,6 +1307,10 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) (E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", i * 50); + if (!(E1000_READ_REG(hw, E1000_FEXT) & + E1000_FEXT_PHY_CABLE_DISCONNECTED)) + return 0; + } ret_val = hw->phy.ops.acquire(hw); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:50 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 E738A6B20BC; Fri, 24 Sep 2021 01:41:50 +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 4HFvsB21Rdz3KkV; Fri, 24 Sep 2021 01:41:50 +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 BD6C75D04; Fri, 24 Sep 2021 01:41:49 +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 18O1fnAo039685; Fri, 24 Sep 2021 01:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fnX4039684; Fri, 24 Sep 2021 01:41:49 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:49 GMT Message-Id: <202109240141.18O1fnX4039684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f4d49d0a6cd0 - stable/12 - e1000: clean LTO warnings 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/stable/12 X-Git-Reftype: branch X-Git-Commit: f4d49d0a6cd01a2004dc83fce695270615c6fe74 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: Fri, 24 Sep 2021 01:41:51 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f4d49d0a6cd01a2004dc83fce695270615c6fe74 commit f4d49d0a6cd01a2004dc83fce695270615c6fe74 Author: Andrzej Ostruszka AuthorDate: 2019-11-07 15:03:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:40:13 +0000 e1000: clean LTO warnings During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: 'link' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (link) { Signed-off-by: Andrzej Ostruszka Approved by: imp Obtained from: DPDK (46136031f19107f4e9b6b3a952cb7f57877a7f0f) MFC after: 1 week (cherry picked from commit 089cdb3990f47be3cd34d1a57567a2e89c917929) --- sys/dev/e1000/e1000_82543.c | 2 +- sys/dev/e1000/e1000_ich8lan.c | 2 +- sys/dev/e1000/e1000_phy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index ac81cbd296f2..b9c6e439480a 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1062,7 +1062,7 @@ static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw) { u32 ctrl; s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_82543"); diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 0311fdb3fef6..b29d53ea4b54 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -5620,7 +5620,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw) void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) { s32 ret_val; - u16 reg_data; + u16 reg_data = 0; DEBUGFUNC("e1000_gig_downshift_workaround_ich8lan"); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d84b6120dd31..2eae3acbe500 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -1695,7 +1695,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw) s32 e1000_setup_copper_link_generic(struct e1000_hw *hw) { s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_generic"); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:54 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 B2B6B6B2392; Fri, 24 Sep 2021 01:41:54 +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 4HFvsF41zPz3Kkd; Fri, 24 Sep 2021 01:41:53 +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 19E945D81; Fri, 24 Sep 2021 01:41:52 +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 18O1fqv8039739; Fri, 24 Sep 2021 01:41:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fqUV039738; Fri, 24 Sep 2021 01:41:52 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:52 GMT Message-Id: <202109240141.18O1fqUV039738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5c1c9f08d746 - stable/12 - e1000: Catch up commit with DPDK 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 5c1c9f08d74612a141853b540ddc25212f99a34f 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: Fri, 24 Sep 2021 01:41:54 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5c1c9f08d74612a141853b540ddc25212f99a34f commit 5c1c9f08d74612a141853b540ddc25212f99a34f Author: Kevin Bowling AuthorDate: 2021-09-17 02:30:49 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:40:25 +0000 e1000: Catch up commit with DPDK Various syncs with the e1000 shared code from DPDK: "cid-gigabit.2020.06.05.tar.gz released by ND" Approved by: imp Obtained from: DPDK MFC after: 1 week (cherry picked from commit 984d1616be883bc2c351aff9aa69b1abd7d1214c) --- sys/dev/e1000/e1000_82571.c | 2 +- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_api.c | 15 +++++ sys/dev/e1000/e1000_api.h | 1 + sys/dev/e1000/e1000_defines.h | 33 ++++++++++ sys/dev/e1000/e1000_hw.h | 2 +- sys/dev/e1000/e1000_i210.c | 100 ++++++++++++++++++++++++++++ sys/dev/e1000/e1000_i210.h | 2 + sys/dev/e1000/e1000_nvm.c | 147 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_nvm.h | 19 ++++++ sys/dev/e1000/e1000_regs.h | 3 +- 11 files changed, 322 insertions(+), 4 deletions(-) diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 6fefcc774cbb..8db1fcb921a9 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82573"); + DEBUGFUNC("e1000_get_hw_semaphore_82574"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 172e99b02d5c..29805270f8dc 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1360,7 +1360,7 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) * * This inits the hardware readying it for operation. **/ -STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) +static s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 6e0f51ab7ffa..b28ab77f3794 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1269,6 +1269,21 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } +/** + * e1000_read_pba_num - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) +{ + return e1000_read_pba_num_generic(hw, pba_num); +} + /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index db4caac37e97..c96030b567db 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -97,6 +97,7 @@ s32 e1000_phy_commit(struct e1000_hw *hw); void e1000_power_up_phy(struct e1000_hw *hw); void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 30629cce8ddc..18e905527a88 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1083,11 +1083,44 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 +#define NVM_NEW_DEC_MASK 0x0F00 +#define NVM_HEX_CONV 16 +#define NVM_HEX_TENS 10 + +/* FW version defines */ +/* Offset of "Loader patch ptr" in Firmware Header */ +#define E1000_I350_NVM_FW_LOADER_PATCH_PTR_OFFSET 0x01 +/* Patch generation hour & minutes */ +#define E1000_I350_NVM_FW_VER_WORD1_OFFSET 0x04 +/* Patch generation month & day */ +#define E1000_I350_NVM_FW_VER_WORD2_OFFSET 0x05 +/* Patch generation year */ +#define E1000_I350_NVM_FW_VER_WORD3_OFFSET 0x06 +/* Patch major & minor numbers */ +#define E1000_I350_NVM_FW_VER_WORD4_OFFSET 0x07 + #define NVM_MAC_ADDR 0x0000 #define NVM_SUB_DEV_ID 0x000B #define NVM_SUB_VEN_ID 0x000C diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index f3acfa5cfc79..42dbb2e0717e 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -998,7 +998,7 @@ struct e1000_dev_spec_ich8lan { enum e1000_ulp_state ulp_state; bool ulp_capability_disabled; bool during_suspend_flow; - bool during_dpg_exit; + bool smbus_disable; }; struct e1000_dev_spec_82575 { diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index d3692db11245..0d810fecf3bd 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -345,6 +345,105 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, return ret_val; } +/** + * e1000_read_invm_version - Reads iNVM version and image type + * @hw: pointer to the HW structure + * @invm_ver: version structure for the version read + * + * Reads iNVM version and image type. + **/ +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver) +{ + u32 *record = NULL; + u32 *next_record = NULL; + u32 i = 0; + u32 invm_dword = 0; + u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / + E1000_INVM_RECORD_SIZE_IN_BYTES); + u32 buffer[E1000_INVM_SIZE]; + s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; + u16 version = 0; + + DEBUGFUNC("e1000_read_invm_version"); + + /* Read iNVM memory */ + for (i = 0; i < E1000_INVM_SIZE; i++) { + invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i)); + buffer[i] = invm_dword; + } + + /* Read version number */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have first version location used */ + if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { + version = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have second version location used */ + else if ((i == 1) && + ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have odd version location + * used and it is the last one used + */ + else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && + ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && + (i != 1))) { + version = (*next_record & E1000_INVM_VER_FIELD_TWO) + >> 13; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have even version location + * used and it is the last one used + */ + else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && + ((*record & 0x3) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + } + + if (status == E1000_SUCCESS) { + invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) + >> E1000_INVM_MAJOR_SHIFT; + invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; + } + /* Read Image Type */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have image type in first location used */ + if ((i == 1) && ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) { + invm_ver->invm_img_type = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have image type in first location used */ + else if ((((*record & 0x3) == 0) && + ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) || + ((((*record & 0x3) != 0) && (i != 1)))) { + invm_ver->invm_img_type = + (*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23; + status = E1000_SUCCESS; + break; + } + } + return status; +} + /** * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum * @hw: pointer to the HW structure @@ -628,6 +727,7 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) if (ret_val != E1000_SUCCESS) nvm_word = E1000_INVM_DEFAULT_AL; tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; + phy_word = E1000_PHY_PLL_UNCONF; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index 9ad9e28c363b..77414b851a76 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,6 +44,8 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 95f00e4d681f..ef6f31f30c18 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -939,6 +939,41 @@ s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size) return E1000_SUCCESS; } +/** + * e1000_read_pba_num_generic - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + **/ +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num) +{ + s32 ret_val; + u16 nvm_data; + + DEBUGFUNC("e1000_read_pba_num_generic"); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } else if (nvm_data == NVM_PBA_PTR_GUARD) { + DEBUGOUT("NVM Not Supported\n"); + return -E1000_NOT_IMPLEMENTED; + } + *pba_num = (u32)(nvm_data << 16); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } + *pba_num |= nvm_data; + + return E1000_SUCCESS; +} + /** * e1000_read_pba_raw @@ -1241,4 +1276,116 @@ static void e1000_reload_nvm_generic(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } +/** + * e1000_get_fw_version - Get firmware version information + * @hw: pointer to the HW structure + * @fw_vers: pointer to output version structure + * + * unsupported/not present features return 0 in version structure + **/ +void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) +{ + u16 eeprom_verh, eeprom_verl, etrack_test, fw_version; + u8 q, hval, rem, result; + u16 comb_verh, comb_verl, comb_offset; + + memset(fw_vers, 0, sizeof(struct e1000_fw_version)); + + /* basic eeprom version numbers, bits used vary by part and by tool + * used to create the nvm images */ + /* Check which data format we have */ + switch (hw->mac.type) { + case e1000_i211: + e1000_read_invm_version(hw, fw_vers); + return; + case e1000_82575: + case e1000_82576: + case e1000_82580: + case e1000_i354: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* Use this format, unless EETRACK ID exists, + * then use alternate format + */ + if ((etrack_test & NVM_MAJOR_MASK) != NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + fw_vers->eep_minor = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + fw_vers->eep_build = (fw_version & NVM_IMAGE_ID_MASK); + goto etrack_id; + } + break; + case e1000_i210: + if (!(e1000_get_flash_presence_i210(hw))) { + e1000_read_invm_version(hw, fw_vers); + return; + } + /* fall through */ + case e1000_i350: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* find combo image version */ + hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset); + if ((comb_offset != 0x0) && + (comb_offset != NVM_VER_INVALID)) { + + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset + + 1), 1, &comb_verh); + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset), + 1, &comb_verl); + + /* get Option Rom version if it exists and is valid */ + if ((comb_verh && comb_verl) && + ((comb_verh != NVM_VER_INVALID) && + (comb_verl != NVM_VER_INVALID))) { + + fw_vers->or_valid = true; + fw_vers->or_major = + comb_verl >> NVM_COMB_VER_SHFT; + fw_vers->or_build = + (comb_verl << NVM_COMB_VER_SHFT) + | (comb_verh >> NVM_COMB_VER_SHFT); + fw_vers->or_patch = + comb_verh & NVM_COMB_VER_MASK; + } + } + break; + default: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + return; + } + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + + /* check for old style version format in newer images*/ + if ((fw_version & NVM_NEW_DEC_MASK) == 0x0) { + eeprom_verl = (fw_version & NVM_COMB_VER_MASK); + } else { + eeprom_verl = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + } + /* Convert minor value to hex before assigning to output struct + * Val to be converted will not be higher than 99, per tool output + */ + q = eeprom_verl / NVM_HEX_CONV; + hval = q * NVM_HEX_TENS; + rem = eeprom_verl % NVM_HEX_CONV; + result = hval + rem; + fw_vers->eep_minor = result; + +etrack_id: + if ((etrack_test & NVM_MAJOR_MASK) == NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verl); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) + | eeprom_verl; + } else if ((etrack_test & NVM_ETRACK_VALID) == 0) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) | + eeprom_verl; + } +} + diff --git a/sys/dev/e1000/e1000_nvm.h b/sys/dev/e1000/e1000_nvm.h index fc7ceab17e32..86fd5d1e892f 100644 --- a/sys/dev/e1000/e1000_nvm.h +++ b/sys/dev/e1000/e1000_nvm.h @@ -41,6 +41,22 @@ struct e1000_pba { u16 *pba_block; }; +struct e1000_fw_version { + u32 etrack_id; + u16 eep_major; + u16 eep_minor; + u16 eep_build; + + u8 invm_major; + u8 invm_minor; + u8 invm_img_type; + + bool or_valid; + u16 or_major; + u16 or_build; + u16 or_patch; +}; + void e1000_init_nvm_ops_generic(struct e1000_hw *hw); s32 e1000_null_read_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c); @@ -51,6 +67,7 @@ s32 e1000_acquire_nvm_generic(struct e1000_hw *hw); s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg); s32 e1000_read_mac_addr_generic(struct e1000_hw *hw); +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num); s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size); @@ -75,6 +92,8 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw); void e1000_stop_nvm(struct e1000_hw *hw); void e1000_release_nvm_generic(struct e1000_hw *hw); +void e1000_get_fw_version(struct e1000_hw *hw, + struct e1000_fw_version *fw_vers); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index c09856e55275..b3fb854f8adc 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -64,6 +64,7 @@ #define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */ #define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ +#define E1000_FEXTNVM5 0x00014 /* Future Extended NVM 5 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ #define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ @@ -634,7 +635,7 @@ /* ETQF register bit definitions */ #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_QUEUE_ENABLE (1 << 31) +#define E1000_ETQF_QUEUE_ENABLE (1U << 31) #define E1000_ETQF_QUEUE_SHIFT 16 #define E1000_ETQF_QUEUE_MASK 0x00070000 #define E1000_ETQF_ETYPE_MASK 0x0000FFFF From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 01:41:49 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 815C56B220F; Fri, 24 Sep 2021 01:41:49 +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 4HFvs90WCJz3Kml; Fri, 24 Sep 2021 01:41:49 +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 98324587F; Fri, 24 Sep 2021 01:41:48 +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 18O1fmZW039661; Fri, 24 Sep 2021 01:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18O1fmlA039660; Fri, 24 Sep 2021 01:41:48 GMT (envelope-from git) Date: Fri, 24 Sep 2021 01:41:48 GMT Message-Id: <202109240141.18O1fmlA039660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: df90074502a0 - stable/12 - e1000: fix multicast setting in VF 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/stable/12 X-Git-Reftype: branch X-Git-Commit: df90074502a0034fd54c84da48ce632d4fade6f1 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: Fri, 24 Sep 2021 01:41:49 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df90074502a0034fd54c84da48ce632d4fade6f1 commit df90074502a0034fd54c84da48ce632d4fade6f1 Author: Yong Wang AuthorDate: 2017-02-21 09:33:23 +0000 Commit: Kevin Bowling CommitDate: 2021-09-24 01:40:08 +0000 e1000: fix multicast setting in VF In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW". And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST". Fix it by moving the second line prior to the first one that mentioned above. Fixes: dffbaf7880a8 ("e1000: revert fix for multicast in VF") Cc: stable@dpdk.org Signed-off-by: Yong Wang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (f58ca2f9ef6) MFC after: 1 week (cherry picked from commit ecf2a89a997ad4a14339b6a2f544e44b422620a0) --- sys/dev/e1000/e1000_vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c index 2a52d7dbd814..b17df650265b 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -419,12 +419,13 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); + msgbuf[0] = E1000_VF_SET_MULTICAST; + if (mc_addr_count > 30) { msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW; mc_addr_count = 30; } - msgbuf[0] = E1000_VF_SET_MULTICAST; msgbuf[0] |= mc_addr_count << E1000_VT_MSGINFO_SHIFT; for (i = 0; i < mc_addr_count; i++) { From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 13:32:08 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 0217866DA47; Fri, 24 Sep 2021 13:32:08 +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 4HGCcl6YZ6z4qs4; Fri, 24 Sep 2021 13:32:07 +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 C189317A4B; Fri, 24 Sep 2021 13:32:07 +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 18ODW7s5086955; Fri, 24 Sep 2021 13:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ODW7DU086954; Fri, 24 Sep 2021 13:32:07 GMT (envelope-from git) Date: Fri, 24 Sep 2021 13:32:07 GMT Message-Id: <202109241332.18ODW7DU086954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bd4fbd4e1403 - stable/13 - efi loader: Typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bd4fbd4e1403b8015691e991d65eb754c1617b96 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: Fri, 24 Sep 2021 13:32:08 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd4fbd4e1403b8015691e991d65eb754c1617b96 commit bd4fbd4e1403b8015691e991d65eb754c1617b96 Author: Mark Johnston AuthorDate: 2021-09-21 16:09:55 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 13:00:56 +0000 efi loader: Typo (cherry picked from commit 0e3ce6d082b34154e41e220757c03d66d881a47b) --- stand/efi/loader/arch/amd64/elf64_freebsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c index 8826cf76aa80..7aa5735e0cfc 100644 --- a/stand/efi/loader/arch/amd64/elf64_freebsd.c +++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c @@ -263,7 +263,7 @@ elf64_exec(struct preloaded_file *fp) } } - printf("staging %#lx (%scoping) tramp %p PT4 %p\n", + printf("staging %#lx (%scopying) tramp %p PT4 %p\n", staging, copy_staging == COPY_STAGING_ENABLE ? "" : "not ", trampoline, PT4); printf("Start @ 0x%lx ...\n", ehdr->e_entry); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 13:32:09 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 119CA66D479; Fri, 24 Sep 2021 13:32: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 4HGCcn009Sz4qnG; Fri, 24 Sep 2021 13:32:09 +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 D4FF9173E3; Fri, 24 Sep 2021 13:32: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 18ODW8Hr086982; Fri, 24 Sep 2021 13:32:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ODW8Mu086981; Fri, 24 Sep 2021 13:32:08 GMT (envelope-from git) Date: Fri, 24 Sep 2021 13:32:08 GMT Message-Id: <202109241332.18ODW8Mu086981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cb7bb946f7ac - stable/13 - rpc: Convert an SOLISTENING check to an assertion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cb7bb946f7ac6e9c1a42e028981fa1333ada3664 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: Fri, 24 Sep 2021 13:32:09 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7bb946f7ac6e9c1a42e028981fa1333ada3664 commit cb7bb946f7ac6e9c1a42e028981fa1333ada3664 Author: Mark Johnston AuthorDate: 2021-09-17 16:13:02 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 13:01:07 +0000 rpc: Convert an SOLISTENING check to an assertion Per the comment, this socket should always be a listening socket. Sponsored by: The FreeBSD Foundation (cherry picked from commit 7fabaac2211e7ed1cec9650e46f4e03428411dcf) --- sys/rpc/svc_vc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index d81c0b01d84d..77452d906594 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -328,11 +328,9 @@ svc_vc_accept(struct socket *head, struct socket **sop) int error = 0; short nbio; - /* XXXGL: shouldn't that be an assertion? */ - if (!SOLISTENING(head)) { - error = EINVAL; - goto done; - } + KASSERT(SOLISTENING(head), + ("%s: socket %p is not listening", __func__, head)); + #ifdef MAC error = mac_socket_check_accept(curthread->td_ucred, head); if (error != 0) From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 13:32:10 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 5D80266DE64; Fri, 24 Sep 2021 13:32:10 +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 4HGCcp1Nysz4qs9; Fri, 24 Sep 2021 13:32:10 +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 051A0176F4; Fri, 24 Sep 2021 13:32:10 +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 18ODW9u5087006; Fri, 24 Sep 2021 13:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ODW9eX087005; Fri, 24 Sep 2021 13:32:09 GMT (envelope-from git) Date: Fri, 24 Sep 2021 13:32:09 GMT Message-Id: <202109241332.18ODW9eX087005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e68465ecbf73 - stable/13 - uma: Show the count of free slabs in each per-domain keg's sysctl tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e68465ecbf7371efdab5a7d91838e33f4e5e177b 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: Fri, 24 Sep 2021 13:32:10 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e68465ecbf7371efdab5a7d91838e33f4e5e177b commit e68465ecbf7371efdab5a7d91838e33f4e5e177b Author: Mark Johnston AuthorDate: 2021-09-17 16:13:47 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 13:01:22 +0000 uma: Show the count of free slabs in each per-domain keg's sysctl tree This is useful for measuring the number of pages that could be freed from a NOFREE zone under memory pressure. Sponsored by: The FreeBSD Foundation (cherry picked from commit d6e77cda9be1509ea170142cca3ff0d3b9f12e35) --- sys/vm/uma_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 410d5bb6772b..5dfcd0c860e9 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -2526,7 +2526,10 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) "Total pages currently allocated from VM"); SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "free_items", CTLFLAG_RD, &dom->ud_free_items, 0, - "items free in the slab layer"); + "Items free in the slab layer"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "free_slabs", CTLFLAG_RD, &dom->ud_free_slabs, 0, + "Unused slabs"); } } else SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 13:32:12 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 196B966DA4E; Fri, 24 Sep 2021 13:32:12 +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 4HGCcq2QBxz4qSD; Fri, 24 Sep 2021 13:32:11 +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 206A617A4C; Fri, 24 Sep 2021 13:32:11 +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 18ODWBxX087030; Fri, 24 Sep 2021 13:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ODWB08087029; Fri, 24 Sep 2021 13:32:11 GMT (envelope-from git) Date: Fri, 24 Sep 2021 13:32:11 GMT Message-Id: <202109241332.18ODWB08087029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e9e4f8092c2e - stable/13 - socket: Fix a use-after-free in soclose() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e9e4f8092c2e0ccac922f930072cd14b22ee7c1c 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: Fri, 24 Sep 2021 13:32:12 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e9e4f8092c2e0ccac922f930072cd14b22ee7c1c commit e9e4f8092c2e0ccac922f930072cd14b22ee7c1c Author: Mark Johnston AuthorDate: 2021-09-17 16:26:06 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 13:01:51 +0000 socket: Fix a use-after-free in soclose() After releasing the fd reference to a socket "so", we should avoid testing SOLISTENING(so) since the socket may have been freed. Instead, directly test whether the list of unaccepted sockets is empty. Fixes: f4bb1869ddd2 ("Consistently use the SOLISTENING() macro") Pointy hat: markj Sponsored by: The FreeBSD Foundation (cherry picked from commit dfcef8771484271f2bccdb1dbc088a838441c5a7) --- sys/kern/uipc_socket.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index dc7407808535..13482fce5980 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1176,6 +1176,7 @@ int soclose(struct socket *so) { struct accept_queue lqueue; + struct socket *sp, *tsp; int error = 0; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1210,11 +1211,9 @@ drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + TAILQ_INIT(&lqueue); SOCK_LOCK(so); if (SOLISTENING(so)) { - struct socket *sp; - - TAILQ_INIT(&lqueue); TAILQ_SWAP(&lqueue, &so->sol_incomp, socket, so_list); TAILQ_CONCAT(&lqueue, &so->sol_comp, so_list); @@ -1232,17 +1231,14 @@ drop: KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; sorele(so); - if (SOLISTENING(so)) { - struct socket *sp, *tsp; - - TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { - SOCK_LOCK(sp); - if (sp->so_count == 0) { - SOCK_UNLOCK(sp); - soabort(sp); - } else - /* sp is now in sofree() */ - SOCK_UNLOCK(sp); + TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { + SOCK_LOCK(sp); + if (refcount_load(&sp->so_count) == 0) { + SOCK_UNLOCK(sp); + soabort(sp); + } else { + /* sp is now in sofree() */ + SOCK_UNLOCK(sp); } } CURVNET_RESTORE(); From owner-dev-commits-src-branches@freebsd.org Fri Sep 24 13:32:13 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 0B2D166DF80; Fri, 24 Sep 2021 13:32:13 +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 4HGCcr3CNFz4qc7; Fri, 24 Sep 2021 13:32:12 +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 34B71176F5; Fri, 24 Sep 2021 13:32:12 +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 18ODWC6k087054; Fri, 24 Sep 2021 13:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ODWCJF087053; Fri, 24 Sep 2021 13:32:12 GMT (envelope-from git) Date: Fri, 24 Sep 2021 13:32:12 GMT Message-Id: <202109241332.18ODWCJF087053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5a9ecb0b1505 - stable/13 - socket: Add assertions around naked refcount decrements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a9ecb0b1505b4830c67b586164be7593ba32bf4 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: Fri, 24 Sep 2021 13:32:13 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a9ecb0b1505b4830c67b586164be7593ba32bf4 commit 5a9ecb0b1505b4830c67b586164be7593ba32bf4 Author: Mark Johnston AuthorDate: 2021-09-17 16:26:56 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 13:03:04 +0000 socket: Add assertions around naked refcount decrements Sockets in a listen queue hold a reference to the parent listening socket. Several code paths release this reference manually when moving a child socket out of the queue. Replace comments about the expected post-decrement refcount value with assertions. Use refcount_load() instead of a plain load. No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 6b288408ca32e68c74f6ab12324448ab4862a045) --- sys/kern/uipc_socket.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 13482fce5980..77c23859cf33 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1073,11 +1073,12 @@ void sofree(struct socket *so) { struct protosw *pr = so->so_proto; + bool last __diagused; SOCK_LOCK_ASSERT(so); - if ((so->so_state & SS_NOFDREF) == 0 || so->so_count != 0 || - (so->so_state & SS_PROTOREF) || (so->so_qstate == SQ_COMP)) { + if ((so->so_state & (SS_NOFDREF | SS_PROTOREF)) != SS_NOFDREF || + refcount_load(&so->so_count) != 0 || so->so_qstate == SQ_COMP) { SOCK_UNLOCK(so); return; } @@ -1113,8 +1114,9 @@ sofree(struct socket *so) __func__, so, sol)); TAILQ_REMOVE(&sol->sol_incomp, so, so_list); sol->sol_incqlen--; - /* This is guarenteed not to be the last. */ - refcount_release(&sol->so_count); + last = refcount_release(&sol->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, sol)); so->so_qstate = SQ_NONE; so->so_listen = NULL; } else @@ -1122,7 +1124,7 @@ sofree(struct socket *so) ("%s: so %p not on (in)comp with so_listen", __func__, so)); sorele(sol); - KASSERT(so->so_count == 1, + KASSERT(refcount_load(&so->so_count) == 1, ("%s: so %p count %u", __func__, so, so->so_count)); so->so_count = 0; } @@ -1178,6 +1180,7 @@ soclose(struct socket *so) struct accept_queue lqueue; struct socket *sp, *tsp; int error = 0; + bool last __diagused; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1224,8 +1227,9 @@ drop: sp->so_qstate = SQ_NONE; sp->so_listen = NULL; SOCK_UNLOCK(sp); - /* Guaranteed not to be the last. */ - refcount_release(&so->so_count); + last = refcount_release(&so->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, so)); } } KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); @@ -1237,7 +1241,7 @@ drop: SOCK_UNLOCK(sp); soabort(sp); } else { - /* sp is now in sofree() */ + /* See the handling of queued sockets in sofree(). */ SOCK_UNLOCK(sp); } } @@ -3971,6 +3975,7 @@ soisconnecting(struct socket *so) void soisconnected(struct socket *so) { + bool last __diagused; SOCK_LOCK(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); @@ -4003,8 +4008,9 @@ soisconnected(struct socket *so) sorele(head); return; } - /* Not the last one, as so holds a ref. */ - refcount_release(&head->so_count); + last = refcount_release(&head->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, head)); } again: if ((so->so_options & SO_ACCEPTFILTER) == 0) { From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 00:59:30 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 89E7A677C90; Sat, 25 Sep 2021 00:59:30 +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 4HGVst3Xkqz4gY9; Sat, 25 Sep 2021 00:59:30 +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 5A57520975; Sat, 25 Sep 2021 00:59:30 +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 18P0xUwd095944; Sat, 25 Sep 2021 00:59:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P0xUIF095943; Sat, 25 Sep 2021 00:59:30 GMT (envelope-from git) Date: Sat, 25 Sep 2021 00:59:30 GMT Message-Id: <202109250059.18P0xUIF095943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6955c22001b1 - stable/13 - unix: Fix a use-after-free in unp_drop() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6955c22001b13b0a3315be5f4c957c2a853ad43e 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: Sat, 25 Sep 2021 00:59:30 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6955c22001b13b0a3315be5f4c957c2a853ad43e commit 6955c22001b13b0a3315be5f4c957c2a853ad43e Author: Mark Johnston AuthorDate: 2021-09-18 14:38:39 +0000 Commit: Mark Johnston CommitDate: 2021-09-25 00:59:20 +0000 unix: Fix a use-after-free in unp_drop() We need to load the socket pointer after locking the PCB, otherwise the socket may have been detached and freed by the time that unp_drop() sets so_error. This previously went unnoticed as the socket zone was _NOFREE. Reported by: pho (cherry picked from commit 50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51) --- sys/kern/uipc_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 3d7daac42001..5dca0714c400 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1962,7 +1962,7 @@ unp_shutdown(struct unpcb *unp) static void unp_drop(struct unpcb *unp) { - struct socket *so = unp->unp_socket; + struct socket *so; struct unpcb *unp2; /* @@ -1972,6 +1972,7 @@ unp_drop(struct unpcb *unp) */ UNP_PCB_LOCK(unp); + so = unp->unp_socket; if (so) so->so_error = ECONNRESET; if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) { From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 05:41:02 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 4C7BA67B83F; Sat, 25 Sep 2021 05:41:02 +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 4HGd6k1TSsz3LLk; Sat, 25 Sep 2021 05:41:02 +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 12BE824D1D; Sat, 25 Sep 2021 05:41:02 +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 18P5f1hL078855; Sat, 25 Sep 2021 05:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P5f1uO078854; Sat, 25 Sep 2021 05:41:01 GMT (envelope-from git) Date: Sat, 25 Sep 2021 05:41:01 GMT Message-Id: <202109250541.18P5f1uO078854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 08d4089f57d5 - stable/11 - Update leap-seconds to leap-seconds.3676924800. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 08d4089f57d584aaa0543216cb69a1750a1238d1 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: Sat, 25 Sep 2021 05:41:02 -0000 The branch stable/11 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=08d4089f57d584aaa0543216cb69a1750a1238d1 commit 08d4089f57d584aaa0543216cb69a1750a1238d1 Author: Xin LI AuthorDate: 2021-09-20 05:26:22 +0000 Commit: Xin LI CommitDate: 2021-09-25 05:40:45 +0000 Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800. MFC after: 3 days (cherry picked from commit 7ba7bf48d5bd6ca89f4e81579456b74ee7aa9e4f) --- etc/ntp/leap-seconds | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/ntp/leap-seconds b/etc/ntp/leap-seconds index e897a867e164..cfda3e885e64 100644 --- a/etc/ntp/leap-seconds +++ b/etc/ntp/leap-seconds @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C62 +# File expires on: 28 June 2022 # -#@ 3833827200 +#@ 3865363200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 599d45bf accd4b4f 8b60e46 49b623 7d13b825 From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 05:41:42 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 5CA2C67BE01; Sat, 25 Sep 2021 05:41:42 +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 4HGd7V21f3z3Lb6; Sat, 25 Sep 2021 05:41:42 +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 254ED24AF4; Sat, 25 Sep 2021 05:41:42 +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 18P5fgwQ079879; Sat, 25 Sep 2021 05:41:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P5fgtK079878; Sat, 25 Sep 2021 05:41:42 GMT (envelope-from git) Date: Sat, 25 Sep 2021 05:41:42 GMT Message-Id: <202109250541.18P5fgtK079878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 7cbe2b56f84a - stable/12 - Update leap-seconds to leap-seconds.3676924800. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7cbe2b56f84a29e999588b20e70c0559daddad2e 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: Sat, 25 Sep 2021 05:41:42 -0000 The branch stable/12 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbe2b56f84a29e999588b20e70c0559daddad2e commit 7cbe2b56f84a29e999588b20e70c0559daddad2e Author: Xin LI AuthorDate: 2021-09-20 05:26:22 +0000 Commit: Xin LI CommitDate: 2021-09-25 05:41:33 +0000 Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800. MFC after: 3 days (cherry picked from commit 7ba7bf48d5bd6ca89f4e81579456b74ee7aa9e4f) --- usr.sbin/ntp/ntpd/leap-seconds | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index e897a867e164..cfda3e885e64 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C62 +# File expires on: 28 June 2022 # -#@ 3833827200 +#@ 3865363200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 599d45bf accd4b4f 8b60e46 49b623 7d13b825 From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 05:42:26 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 94A8467B77C; Sat, 25 Sep 2021 05:42:26 +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 4HGd8L3ptmz3LSb; Sat, 25 Sep 2021 05:42:26 +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 632BF24E29; Sat, 25 Sep 2021 05:42:26 +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 18P5gQBd083050; Sat, 25 Sep 2021 05:42:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P5gQGw083049; Sat, 25 Sep 2021 05:42:26 GMT (envelope-from git) Date: Sat, 25 Sep 2021 05:42:26 GMT Message-Id: <202109250542.18P5gQGw083049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 485a546a3a60 - stable/13 - Update leap-seconds to leap-seconds.3676924800. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 485a546a3a60aeb308005a916715e3a1b02352e0 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: Sat, 25 Sep 2021 05:42:26 -0000 The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=485a546a3a60aeb308005a916715e3a1b02352e0 commit 485a546a3a60aeb308005a916715e3a1b02352e0 Author: Xin LI AuthorDate: 2021-09-20 05:26:22 +0000 Commit: Xin LI CommitDate: 2021-09-25 05:42:21 +0000 Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800. MFC after: 3 days (cherry picked from commit 7ba7bf48d5bd6ca89f4e81579456b74ee7aa9e4f) --- usr.sbin/ntp/ntpd/leap-seconds | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index e897a867e164..cfda3e885e64 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C62 +# File expires on: 28 June 2022 # -#@ 3833827200 +#@ 3865363200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 599d45bf accd4b4f 8b60e46 49b623 7d13b825 From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:23 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 4959E67DDAD; Sat, 25 Sep 2021 08:41:23 +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 4HGj6q1Tz8z3m5B; Sat, 25 Sep 2021 08:41:23 +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 1418C270D1; Sat, 25 Sep 2021 08:41:23 +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 18P8fM2U017901; Sat, 25 Sep 2021 08:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fMRW017900; Sat, 25 Sep 2021 08:41:22 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:22 GMT Message-Id: <202109250841.18P8fMRW017900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: a7ce2cf0ff40 - stable/13 - Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7ce2cf0ff40fbd2bbbf4e0e00c32737998712fc 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: Sat, 25 Sep 2021 08:41:23 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=a7ce2cf0ff40fbd2bbbf4e0e00c32737998712fc commit a7ce2cf0ff40fbd2bbbf4e0e00c32737998712fc Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-28 08:01:19 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c This change was missed in r333509 (e6b475e0af). (cherry picked from commit 0939f965d80d00e783b3319a57e7d71e0b3f202e) --- share/man/man4/hwpmc.4 | 2 +- sys/dev/hwpmc/hwpmc_logging.c | 2 +- usr.sbin/pmcstat/pmcstat.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 5777cdd4264d..063313045137 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -426,7 +426,7 @@ The default buffer size is 4KB. .It Va kern.hwpmc.mtxpoolsize Pq integer, read-only The size of the spin mutex pool used by the PMC driver. The default is 32. -.It Va kern.hwpmc.nbuffers Pq integer, read-only +.It Va kern.hwpmc.nbuffers_pcpu Pq integer, read-only The number of log buffers used by .Nm for logging. diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index c13b87f4165f..c16adff8c842 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -86,7 +86,7 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, &pmclog_buffer_size, 0, "size of log buffers in kilobytes"); /* - * kern.hwpmc.nbuffer -- number of global log buffers + * kern.hwpmc.nbuffers_pcpu -- number of global log buffers */ static int pmc_nlogbuffers_pcpu = PMC_NLOGBUFFERS_PCPU; diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 997005cec269..3e2d101ab113 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -1455,7 +1455,7 @@ main(int argc, char **argv) args.pa_verbosity > 0) warnx( "WARNING: at least %u event%s were discarded while running.\n" -"Please consider tuning the \"kern.hwpmc.nbuffers\" tunable.", +"Please consider tuning the \"kern.hwpmc.nbuffers_pcpu\" tunable.", ds_end.pm_buffer_requests_failed - ds_start.pm_buffer_requests_failed, ((ds_end.pm_buffer_requests_failed - From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:24 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 7D6C967DDAF; Sat, 25 Sep 2021 08:41:24 +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 4HGj6r2rZHz3llx; Sat, 25 Sep 2021 08:41:24 +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 36BA5270D3; Sat, 25 Sep 2021 08:41:24 +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 18P8fOxL017925; Sat, 25 Sep 2021 08:41:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fOPW017924; Sat, 25 Sep 2021 08:41:24 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:24 GMT Message-Id: <202109250841.18P8fOPW017924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 8acee856bfc8 - stable/13 - fstyp: bump WARNS to default and work around warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8acee856bfc8cf7ef0e2f622aeea5df830619db3 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: Sat, 25 Sep 2021 08:41:24 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=8acee856bfc8cf7ef0e2f622aeea5df830619db3 commit 8acee856bfc8cf7ef0e2f622aeea5df830619db3 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-17 15:46:08 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 fstyp: bump WARNS to default and work around warnings (cherry picked from commit da0c0e0121574a1d82f417cc7e245ecd5506325c) --- usr.sbin/fstyp/Makefile | 2 -- usr.sbin/fstyp/apfs.c | 2 ++ usr.sbin/fstyp/fstyp.c | 4 ++-- usr.sbin/fstyp/hammer.c | 3 +++ usr.sbin/fstyp/hfsplus.c | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile index 384e2f7dee60..161cd0cf3764 100644 --- a/usr.sbin/fstyp/Makefile +++ b/usr.sbin/fstyp/Makefile @@ -12,8 +12,6 @@ SRCS += zfs.c MAN= fstyp.8 -WARNS?= 2 - .if ${MK_ICONV} == "yes" CFLAGS+= -DWITH_ICONV .endif diff --git a/usr.sbin/fstyp/apfs.c b/usr.sbin/fstyp/apfs.c index 049a9f862f2b..7f8543a5a108 100644 --- a/usr.sbin/fstyp/apfs.c +++ b/usr.sbin/fstyp/apfs.c @@ -100,6 +100,8 @@ fstyp_apfs(FILE *fp, char *label, size_t size) retval = 0; /* No label support yet. */ + (void)size; + (void)label; fail: free(csb); diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c index b39277914aed..91c36d9d9191 100644 --- a/usr.sbin/fstyp/fstyp.c +++ b/usr.sbin/fstyp/fstyp.c @@ -61,7 +61,7 @@ static struct { const char *name; fstyp_function function; bool unmountable; - char *precache_encoding; + const char *precache_encoding; } fstypes[] = { { "apfs", &fstyp_apfs, true, NULL }, { "befs", &fstyp_befs, false, NULL }, @@ -206,7 +206,7 @@ main(int argc, char **argv) #ifdef WITH_ICONV /* Cache iconv conversion data before entering capability mode. */ if (show_label) { - for (i = 0; i < nitems(fstypes); i++) { + for (i = 0; i < (int)nitems(fstypes); i++) { iconv_t cd; if (fstypes[i].precache_encoding == NULL) diff --git a/usr.sbin/fstyp/hammer.c b/usr.sbin/fstyp/hammer.c index 6fdad1d642a4..777f5d312371 100644 --- a/usr.sbin/fstyp/hammer.c +++ b/usr.sbin/fstyp/hammer.c @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include "fstyp.h" +extern int fsvtyp_hammer(const char *blkdevs, char *label, size_t size); +extern int fsvtyp_hammer_partial(const char *blkdevs, char *label, size_t size); + static hammer_volume_ondisk_t read_ondisk(FILE *fp) { diff --git a/usr.sbin/fstyp/hfsplus.c b/usr.sbin/fstyp/hfsplus.c index 71287465e4ff..3a94faf7766f 100644 --- a/usr.sbin/fstyp/hfsplus.c +++ b/usr.sbin/fstyp/hfsplus.c @@ -118,6 +118,8 @@ fstyp_hfsp(FILE *fp, char *label, size_t size) retval = 0; /* No label support yet. */ + (void)size; + (void)label; fail: free(hdr); From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:25 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 C623367DDB4; Sat, 25 Sep 2021 08:41:25 +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 4HGj6s4YXHz3lph; Sat, 25 Sep 2021 08:41:25 +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 605EF27396; Sat, 25 Sep 2021 08:41:25 +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 18P8fPj5017949; Sat, 25 Sep 2021 08:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fPjX017948; Sat, 25 Sep 2021 08:41:25 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:25 GMT Message-Id: <202109250841.18P8fPjX017948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: b2b7eb9e23dc - stable/13 - sh: improve command completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b2b7eb9e23dcb4381780590fb7393b17d19100f5 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: Sat, 25 Sep 2021 08:41:26 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=b2b7eb9e23dcb4381780590fb7393b17d19100f5 commit b2b7eb9e23dcb4381780590fb7393b17d19100f5 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-18 11:26:51 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 sh: improve command completion When multiple matches are found, we keep the provided string on the input line and print unique matches as suggestions. But the multiple matches might be the same command found in different directories, so we should deduplicate the matches first and then decide whether to autocomplete the command or not, based on the number of unique matches. (cherry picked from commit b8ff849cbddfee3404d6550cf98f53d6bb617707) --- bin/sh/histedit.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 8d9e9fc64db3..488a0b355f80 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -530,7 +530,7 @@ static char char *free_path = NULL, *path; const char *dirname; char **matches = NULL; - size_t i = 0, size = 16, j, k; + size_t i = 0, size = 16, uniq; size_t curpos = end - start; if (start > 0 || memchr("/.~", text[0], 3) != NULL) @@ -579,6 +579,21 @@ static char } out: free(free_path); + if (i == 0) { + free(matches); + return (NULL); + } + uniq = 1; + if (i > 1) { + qsort_s(matches + 1, i, sizeof(matches[0]), comparator, + (void *)(intptr_t)curpos); + for (size_t k = 2; k <= i; k++) + if (strcmp(matches[uniq] + curpos, matches[k] + curpos) == 0) + free(matches[k]); + else + matches[++uniq] = matches[k]; + } + matches[uniq + 1] = NULL; /* * matches[0] is special: it's not a real matching file name but a common * prefix for all matching names. It can't be null, unlike any other @@ -588,30 +603,13 @@ out: * string in matches[0] which is the reason to copy the full name of the * only match. */ - if (i == 0) { - free(matches); - return (NULL); - } else if (i == 1) { - matches[0] = strdup(matches[1]); - matches[2] = NULL; - if (matches[0] != NULL) - return (matches); - } else - matches[0] = strdup(text); + matches[0] = strdup(uniq == 1 ? matches[1] : text); if (matches[0] == NULL) { - for (j = 1; j <= i; j++) - free(matches[j]); + for (size_t k = 1; k <= uniq; k++) + free(matches[k]); free(matches); return (NULL); } - qsort_s(matches + 1, i, sizeof(matches[0]), comparator, - (void *)(intptr_t)curpos); - for (j = 1, k = 2; k <= i; k++) - if (strcmp(matches[j] + curpos, matches[k] + curpos) == 0) - free(matches[k]); - else - matches[++j] = matches[k]; - matches[j + 1] = NULL; return (matches); } From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:26 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 CAB4467DC93; Sat, 25 Sep 2021 08:41:26 +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 4HGj6t4bG9z3lP6; Sat, 25 Sep 2021 08:41:26 +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 7C94127398; Sat, 25 Sep 2021 08:41:26 +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 18P8fQ12017975; Sat, 25 Sep 2021 08:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fQWN017974; Sat, 25 Sep 2021 08:41:26 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:26 GMT Message-Id: <202109250841.18P8fQWN017974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 14fb8056ceef - stable/13 - sh: reset sh bindings on bind -e, bind -v MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14fb8056ceef592c6f392f0f678dc45d11b7417e 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: Sat, 25 Sep 2021 08:41:27 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=14fb8056ceef592c6f392f0f678dc45d11b7417e commit 14fb8056ceef592c6f392f0f678dc45d11b7417e Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-19 20:17:01 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 sh: reset sh bindings on bind -e, bind -v Until this change, any bindings set in histedit() were lost on calls to bindcmd(). Only bind -e and bind -v call libedit's keymacro_reset(). Currently you cannot fool libedit/map.c:map_bind() by trying something like bind -le as when p[0] == '-', it does a switch statement on p[1]. (cherry picked from commit 9413dfd331e705a1d7909fe41f06a30e43c442f7) --- bin/sh/histedit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 488a0b355f80..7c366d252743 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -501,6 +501,13 @@ bindcmd(int argc, char **argv) fclose(out); + if (argc > 1 && argv[1][0] == '-' && + memchr("ve", argv[1][1], 2) != NULL) { + Vflag = argv[1][1] == 'v'; + Eflag = !Vflag; + histedit(); + } + INTON; return ret; From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:29 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 D2D1D67DCA7; Sat, 25 Sep 2021 08:41:29 +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 4HGj6x2Nztz3m5j; Sat, 25 Sep 2021 08:41:29 +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 C230C268F5; Sat, 25 Sep 2021 08:41:28 +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 18P8fSMr018028; Sat, 25 Sep 2021 08:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fS52018027; Sat, 25 Sep 2021 08:41:28 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:28 GMT Message-Id: <202109250841.18P8fS52018027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: ece58f7ada40 - stable/13 - diff: don't output carriage returns that were stripped on input MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ece58f7ada409ac68e072cdddcc29e21127aafce 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: Sat, 25 Sep 2021 08:41:30 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=ece58f7ada409ac68e072cdddcc29e21127aafce commit ece58f7ada409ac68e072cdddcc29e21127aafce Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-22 16:05:59 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 diff: don't output carriage returns that were stripped on input --strip-trailing-cr worked as intended for comparison between files, but the characters were still present in final output. (cherry picked from commit af2f0164318455433db95adce07af829285b78ad) --- usr.bin/diff/diffreg.c | 11 ++++++++++- usr.bin/diff/tests/Makefile | 3 ++- usr.bin/diff/tests/diff_test.sh | 10 ++++++++++ usr.bin/diff/tests/strip_o.out | 7 +++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 651ec88df909..113b7b621256 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1273,7 +1273,16 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } col = 0; for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { - if ((c = getc(lb)) == EOF) { + c = getc(lb); + if (flags & D_STRIPCR && c == '\r') { + if ((c = getc(lb)) == '\n') + j++; + else { + ungetc(c, lb); + c = '\r'; + } + } + if (c == EOF) { if (diff_format == D_EDIT || diff_format == D_REVERSE || diff_format == D_NREVERSE) diff --git a/usr.bin/diff/tests/Makefile b/usr.bin/diff/tests/Makefile index 78744d3bed8e..303a37911fbd 100644 --- a/usr.bin/diff/tests/Makefile +++ b/usr.bin/diff/tests/Makefile @@ -26,7 +26,8 @@ ${PACKAGE}FILES+= \ header.out \ header_ns.out \ ifdef.out \ - group-format.out + group-format.out \ + strip_o.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index b9d1698d982e..c311c3bf2fbc 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -9,6 +9,7 @@ atf_test_case group_format atf_test_case side_by_side atf_test_case brief_format atf_test_case b230049 +atf_test_case stripcr_o atf_test_case b252515 atf_test_case Bflag atf_test_case Nflag @@ -68,6 +69,14 @@ b230049_body() b230049_a.in b230049_b.in } +stripcr_o_body() +{ + printf 'a\nX\nc\n' > stripcr_o_X.in + printf 'a\r\nY\r\nc\r\n' > stripcr_o_Y.in + atf_check -o "file:$(atf_get_srcdir)/strip_o.out" -s eq:1 \ + diff -L1 -L2 -u --strip-trailing-cr stripcr_o_X.in stripcr_o_Y.in +} + b252515_body() { printf 'a b\n' > b252515_a.in @@ -266,6 +275,7 @@ atf_init_test_cases() atf_add_test_case side_by_side atf_add_test_case brief_format atf_add_test_case b230049 + atf_add_test_case stripcr_o atf_add_test_case b252515 atf_add_test_case Bflag atf_add_test_case Nflag diff --git a/usr.bin/diff/tests/strip_o.out b/usr.bin/diff/tests/strip_o.out new file mode 100644 index 000000000000..47bbfbd4e921 --- /dev/null +++ b/usr.bin/diff/tests/strip_o.out @@ -0,0 +1,7 @@ +--- 1 ++++ 2 +@@ -1,3 +1,3 @@ + a +-X ++Y + c From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:30 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 E036667DCAD; Sat, 25 Sep 2021 08:41:30 +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 4HGj6y0cDmz3lPH; Sat, 25 Sep 2021 08:41:30 +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 DFD65271B5; Sat, 25 Sep 2021 08:41:29 +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 18P8fTUF018052; Sat, 25 Sep 2021 08:41:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fTiU018051; Sat, 25 Sep 2021 08:41:29 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:29 GMT Message-Id: <202109250841.18P8fTiU018051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: bda949b6efdf - stable/13 - diff: read whole files to determine if they are ASCII text MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bda949b6efdf099846775d3dc595c36561df1cca 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: Sat, 25 Sep 2021 08:41:31 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=bda949b6efdf099846775d3dc595c36561df1cca commit bda949b6efdf099846775d3dc595c36561df1cca Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-22 19:57:13 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff: read whole files to determine if they are ASCII text Before this change, only the first BUFSIZE bytes were checked. (cherry picked from commit 3cbf98e2bee91db9ed9118ff557e02cdd449f49a) --- usr.bin/diff/diffreg.c | 59 +++++++++++++++++++++++++---------------- usr.bin/diff/tests/diff_test.sh | 14 ++++++++++ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 113b7b621256..e728441c2cb2 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -180,6 +180,8 @@ struct context_vec { int d; /* end line in new file */ }; +enum readhash { RH_BINARY, RH_OK, RH_EOF }; + #define MIN_PAD 1 static FILE *opentemp(const char *); static void output(char *, FILE *, char *, FILE *, int); @@ -188,7 +190,7 @@ static void range(int, int, const char *); static void uni_range(int, int); static void dump_context_vec(FILE *, FILE *, int); static void dump_unified_vec(FILE *, FILE *, int); -static void prepare(int, FILE *, size_t, int); +static bool prepare(int, FILE *, size_t, int); static void prune(void); static void equiv(struct line *, int, struct line *, int, int *); static void unravel(int); @@ -206,7 +208,7 @@ static int search(int *, int, int); static int skipline(FILE *); static int isqrt(int); static int stone(int *, int, int *, int *, int); -static int readhash(FILE *, int); +static enum readhash readhash(FILE *, int, unsigned *); static int files_differ(FILE *, FILE *, int); static char *match_function(const long *, int, FILE *); static char *preadline(int, size_t, off_t); @@ -380,14 +382,16 @@ diffreg(char *file1, char *file2, int flags, int capsicum) status |= 1; goto closem; } - if ((flags & D_FORCEASCII) == 0 && - (!asciifile(f1) || !asciifile(f2))) { + if ((flags & D_FORCEASCII) != 0) { + (void)prepare(0, f1, stb1.st_size, flags); + (void)prepare(1, f2, stb2.st_size, flags); + } else if (!asciifile(f1) || !asciifile(f2) || + !prepare(0, f1, stb1.st_size, flags) || + !prepare(1, f2, stb2.st_size, flags)) { rval = D_BINARY; status |= 1; goto closem; } - prepare(0, f1, stb1.st_size, flags); - prepare(1, f2, stb2.st_size, flags); prune(); sort(sfile[0], slen[0]); @@ -511,12 +515,13 @@ splice(char *dir, char *path) return (buf); } -static void +static bool prepare(int i, FILE *fd, size_t filesize, int flags) { struct line *p; - int h; - size_t sz, j; + unsigned h; + size_t sz, j = 0; + enum readhash r; rewind(fd); @@ -525,15 +530,23 @@ prepare(int i, FILE *fd, size_t filesize, int flags) sz = 100; p = xcalloc(sz + 3, sizeof(*p)); - for (j = 0; (h = readhash(fd, flags));) { - if (j == sz) { - sz = sz * 3 / 2; - p = xreallocarray(p, sz + 3, sizeof(*p)); + while ((r = readhash(fd, flags, &h)) != RH_EOF) + switch (r) { + case RH_EOF: /* otherwise clang complains */ + case RH_BINARY: + return (false); + case RH_OK: + if (j == sz) { + sz = sz * 3 / 2; + p = xreallocarray(p, sz + 3, sizeof(*p)); + } + p[++j].value = h; } - p[++j].value = h; - } + len[i] = j; file[i] = p; + + return (true); } static void @@ -1350,8 +1363,8 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) /* * Hash function taken from Robert Sedgewick, Algorithms in C, 3d ed., p 578. */ -static int -readhash(FILE *f, int flags) +static enum readhash +readhash(FILE *f, int flags, unsigned *hash) { int i, t, space; unsigned sum; @@ -1360,6 +1373,9 @@ readhash(FILE *f, int flags) space = 0; for (i = 0;;) { switch (t = getc(f)) { + case '\0': + if ((flags & D_FORCEASCII) == 0) + return (RH_BINARY); case '\r': if (flags & D_STRIPCR) { t = getc(f); @@ -1387,18 +1403,15 @@ readhash(FILE *f, int flags) continue; case EOF: if (i == 0) - return (0); + return (RH_EOF); /* FALLTHROUGH */ case '\n': break; } break; } - /* - * There is a remote possibility that we end up with a zero sum. - * Zero is used as an EOF marker, so return 1 instead. - */ - return (sum == 0 ? 1 : sum); + *hash = sum; + return (RH_OK); } static int diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index c311c3bf2fbc..d96dd8c2a33e 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -18,6 +18,7 @@ atf_test_case conflicting_format atf_test_case label atf_test_case report_identical atf_test_case non_regular_file +atf_test_case binary simple_body() { @@ -264,6 +265,18 @@ non_regular_file_body() diff --label A --label B -u A B } +binary_body() +{ + # the NUL byte has to be after at least BUFSIZ bytes to trick asciifile() + yes 012345678901234567890123456789012345678901234567890 | head -n 174 > A + cp A B + printf '\n\0\n' >> A + printf '\nx\n' >> B + + atf_check -o inline:"Binary files A and B differ\n" -s exit:1 diff A B + atf_check -o inline:"176c\nx\n.\n" -s exit:1 diff -ae A B +} + atf_init_test_cases() { atf_add_test_case simple @@ -284,4 +297,5 @@ atf_init_test_cases() atf_add_test_case label atf_add_test_case report_identical atf_add_test_case non_regular_file + atf_add_test_case binary } From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:34 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 0EDEB67DD67; Sat, 25 Sep 2021 08:41:34 +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 4HGj714435z3lw2; Sat, 25 Sep 2021 08:41:33 +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 5690126F50; Sat, 25 Sep 2021 08:41:33 +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 18P8fXRk018130; Sat, 25 Sep 2021 08:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fXUl018129; Sat, 25 Sep 2021 08:41:33 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:33 GMT Message-Id: <202109250841.18P8fXUl018129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 216bf478e247 - stable/13 - diff3: improve style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 216bf478e24702ddfb310f27da0a51a81c822ed6 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: Sat, 25 Sep 2021 08:41:34 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=216bf478e24702ddfb310f27da0a51a81c822ed6 commit 216bf478e24702ddfb310f27da0a51a81c822ed6 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-20 21:50:20 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff3: improve style (cherry picked from commit 702dda4368dc2d07e8898fcfdddb12d730e6c174) --- usr.bin/diff3/diff3.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index 80d4a202728f..18daa54b2360 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -126,7 +126,7 @@ static int cline[3]; /* # of the last-read line in each file (0-2) */ */ static int last[4]; static int Aflag, eflag, iflag, mflag, Tflag; -static int oflag; /* indicates whether to mark overlaps (-E or -X)*/ +static int oflag; /* indicates whether to mark overlaps (-E or -X) */ static int strip_cr; static char *f1mark, *f2mark, *f3mark; @@ -170,9 +170,9 @@ static struct option longopts[] = { static void usage(void) { - fprintf(stderr, "usage: diff3 [-3aAeEimTxX] [-L lable1] [-L label2] " - "[ -L label3] file1 file2 file3\n"); - exit (2); + fprintf(stderr, "usage: diff3 [-3aAeEimTxX] [-L label1] [-L label2] " + "[-L label3] file1 file2 file3\n"); + exit(2); } static int @@ -186,7 +186,7 @@ readin(int fd, struct diff **dd) f = fdopen(fd, "r"); if (f == NULL) err(2, "fdopen"); - for (i=0; (p = getchange(f)); i++) { + for (i = 0; (p = getchange(f)); i++) { if (i >= szchanges - 1) increase(); a = b = (int)strtoimax(p, &p, 10); @@ -196,7 +196,7 @@ readin(int fd, struct diff **dd) } kind = *p++; c = d = (int)strtoimax(p, &p, 10); - if (*p==',') { + if (*p == ',') { p++; d = (int)strtoimax(p, &p, 10); } @@ -212,8 +212,8 @@ readin(int fd, struct diff **dd) (*dd)[i].new.to = d; } if (i) { - (*dd)[i].old.from = (*dd)[i-1].old.to; - (*dd)[i].new.from = (*dd)[i-1].new.to; + (*dd)[i].old.from = (*dd)[i - 1].old.to; + (*dd)[i].new.from = (*dd)[i - 1].new.to; } fclose(f); return (i); @@ -222,9 +222,9 @@ readin(int fd, struct diff **dd) static int diffexec(const char *diffprog, char **diffargv, int fd[]) { - int pid, pd; + int pd; - switch (pid = pdfork(&pd, PD_CLOEXEC)) { + switch (pdfork(&pd, PD_CLOEXEC)) { case 0: close(fd[0]); if (dup2(fd[1], STDOUT_FILENO) == -1) @@ -396,7 +396,7 @@ prange(struct range *rold) printf("%da\n", rold->from - 1); else { printf("%d", rold->from); - if (rold->to > rold->from+1) + if (rold->to > rold->from + 1) printf(",%d", rold->to - 1); printf("c\n"); } @@ -433,7 +433,7 @@ skip(int i, int from, const char *pr) if ((line = get_line(fp[i], &j)) == NULL) errx(EXIT_FAILURE, "logic error"); if (pr != NULL) - printf("%s%s", Tflag == 1? "\t" : pr, line); + printf("%s%s", Tflag == 1 ? "\t" : pr, line); cline[i]++; } return ((int) n); @@ -455,13 +455,13 @@ duplicate(struct range *r1, struct range *r2) skip(0, r1->from, NULL); skip(1, r2->from, NULL); nchar = 0; - for (nline=0; nline < r1->to - r1->from; nline++) { + for (nline = 0; nline < r1->to - r1->from; nline++) { do { c = getc(fp[0]); d = getc(fp[1]); if (c == -1 && d == -1) break; - if (c == -1 || d== -1) + if (c == -1 || d == -1) errx(EXIT_FAILURE, "logic error"); nchar++; if (c != d) { @@ -482,6 +482,7 @@ repos(int nchar) for (i = 0; i < 2; i++) (void)fseek(fp[i], (long)-nchar, SEEK_CUR); } + /* * collect an editing script for later regurgitation */ @@ -514,7 +515,7 @@ edscript(int n) if (!oflag || !overlap[n]) { prange(&de[n].old); } else { - printf("%da\n", de[n].old.to -1); + printf("%da\n", de[n].old.to - 1); if (Aflag) { printf("%s\n", f2mark); fseek(fp[1], de[n].old.from, SEEK_SET); @@ -529,8 +530,9 @@ edscript(int n) printf("=======\n"); } fseek(fp[2], (long)de[n].new.from, SEEK_SET); - for (k = de[n].new.to - de[n].new.from; k > 0; k-= j) { + for (k = de[n].new.to - de[n].new.from; k > 0; k -= j) { size_t r; + j = k > BUFSIZ ? BUFSIZ : k; r = fread(block, 1, j, fp[2]); if (r == 0) { @@ -759,7 +761,7 @@ main(int argc, char **argv) for (i = 0; i < nke; i++) { status = e[i].data; if (WIFEXITED(status) && WEXITSTATUS(status) >= 2) - errx(2, "diff exited abormally"); + errx(2, "diff exited abnormally"); else if (WIFSIGNALED(status)) errx(2, "diff killed by signal %d", WTERMSIG(status)); From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:28 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 F33F967DD58; Sat, 25 Sep 2021 08:41: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 4HGj6v5j1hz3lvZ; Sat, 25 Sep 2021 08:41:27 +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 A122B27311; Sat, 25 Sep 2021 08:41: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 18P8fRaO018004; Sat, 25 Sep 2021 08:41:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fRD7018003; Sat, 25 Sep 2021 08:41:27 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:27 GMT Message-Id: <202109250841.18P8fRD7018003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: ec5849afc86c - stable/13 - sh: improve command completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ec5849afc86ca6b2df9e7fad5e7d3a1ce92fe714 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: Sat, 25 Sep 2021 08:41:28 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=ec5849afc86ca6b2df9e7fad5e7d3a1ce92fe714 commit ec5849afc86ca6b2df9e7fad5e7d3a1ce92fe714 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-22 16:23:29 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 sh: improve command completion When there are many matches, find the longest common substring starting from the beginning of each command and use that to replace input. As an example: on my system, llv will be autocompleted to llvm- and another will print all matching llvm commands. (cherry picked from commit c866d0c798a20b8f0a92df524f4ddd0d81511c88) --- bin/sh/histedit.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 7c366d252743..f3100221d6ad 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -538,7 +538,7 @@ static char const char *dirname; char **matches = NULL; size_t i = 0, size = 16, uniq; - size_t curpos = end - start; + size_t curpos = end - start, lcstring = -1; if (start > 0 || memchr("/.~", text[0], 3) != NULL) return (NULL); @@ -594,11 +594,20 @@ out: if (i > 1) { qsort_s(matches + 1, i, sizeof(matches[0]), comparator, (void *)(intptr_t)curpos); - for (size_t k = 2; k <= i; k++) - if (strcmp(matches[uniq] + curpos, matches[k] + curpos) == 0) + for (size_t k = 2; k <= i; k++) { + const char *l = matches[uniq] + curpos; + const char *r = matches[k] + curpos; + size_t common = 0; + + while (*l != '\0' && *r != '\0' && *l == *r) + (void)l++, r++, common++; + if (common < lcstring) + lcstring = common; + if (*l == *r) free(matches[k]); else matches[++uniq] = matches[k]; + } } matches[uniq + 1] = NULL; /* @@ -610,7 +619,12 @@ out: * string in matches[0] which is the reason to copy the full name of the * only match. */ - matches[0] = strdup(uniq == 1 ? matches[1] : text); + if (uniq == 1) + matches[0] = strdup(matches[1]); + else if (lcstring != (size_t)-1) + matches[0] = strndup(matches[1], curpos + lcstring); + else + matches[0] = strdup(text); if (matches[0] == NULL) { for (size_t k = 1; k <= uniq; k++) free(matches[k]); From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:31 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 872BB67DCB0; Sat, 25 Sep 2021 08:41:31 +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 4HGj6z1cXFz3mBX; Sat, 25 Sep 2021 08:41:31 +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 0D04427139; Sat, 25 Sep 2021 08:41:31 +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 18P8fUKg018076; Sat, 25 Sep 2021 08:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fUvk018075; Sat, 25 Sep 2021 08:41:30 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:30 GMT Message-Id: <202109250841.18P8fUvk018075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: cc81fdf42549 - stable/13 - Register /usr/tests/usr.bin/diff3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc81fdf42549bfc7cf43c40003bb0426b6218607 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: Sat, 25 Sep 2021 08:41:31 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=cc81fdf42549bfc7cf43c40003bb0426b6218607 commit cc81fdf42549bfc7cf43c40003bb0426b6218607 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-22 10:08:39 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 Register /usr/tests/usr.bin/diff3 I wasn't able to make check to run diff3 tests, but kevans figured out that I was missing diff3 in mtree. (cherry picked from commit f8e50dd2c67baea2bbd75f94218911d5a4d39597) --- etc/mtree/BSD.tests.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index f7965dac2884..b21256c8563c 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -996,6 +996,8 @@ .. diff .. + diff3 + .. dirname .. du From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:33 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 6E92167D66C; Sat, 25 Sep 2021 08:41:33 +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 4HGj704cgQz3lvx; Sat, 25 Sep 2021 08:41:32 +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 33D01271B6; Sat, 25 Sep 2021 08:41:32 +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 18P8fWDY018100; Sat, 25 Sep 2021 08:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fWO3018099; Sat, 25 Sep 2021 08:41:32 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:32 GMT Message-Id: <202109250841.18P8fWO3018099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 4bfbc5fbc93b - stable/13 - diff3: sync with upstream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4bfbc5fbc93bec4f1098b7c7174411ec92404cb0 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: Sat, 25 Sep 2021 08:41:33 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=4bfbc5fbc93bec4f1098b7c7174411ec92404cb0 commit 4bfbc5fbc93bec4f1098b7c7174411ec92404cb0 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-20 21:35:24 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff3: sync with upstream * replace realloc calls with reallocarray calls * fix merging of files that lack newlines Obtained from: OpenBSD (cherry picked from commit 7f7b03f3897f0196e3cc7a3b71c7359cc206ba61) --- usr.bin/diff3/diff3.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index 03cd24283a13..80d4a202728f 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -459,6 +459,8 @@ duplicate(struct range *r1, struct range *r2) do { c = getc(fp[0]); d = getc(fp[1]); + if (c == -1 && d == -1) + break; if (c == -1 || d== -1) errx(EXIT_FAILURE, "logic error"); nchar++; @@ -528,10 +530,17 @@ edscript(int n) } fseek(fp[2], (long)de[n].new.from, SEEK_SET); for (k = de[n].new.to - de[n].new.from; k > 0; k-= j) { + size_t r; j = k > BUFSIZ ? BUFSIZ : k; - if (fread(block, 1, j, fp[2]) != j) + r = fread(block, 1, j, fp[2]); + if (r == 0) { + if (feof(fp[2])) + break; errx(2, "logic error"); - fwrite(block, 1, j, stdout); + } + if (r != j) + j = r; + (void)fwrite(block, 1, j, stdout); } if (!oflag || !overlap[n]) printf(".\n"); @@ -557,22 +566,22 @@ increase(void) newsz = szchanges == 0 ? 64 : 2 * szchanges; incr = newsz - szchanges; - p = realloc(d13, newsz * sizeof(struct diff)); + p = reallocarray(d13, newsz, sizeof(struct diff)); if (p == NULL) err(1, NULL); memset(p + szchanges, 0, incr * sizeof(struct diff)); d13 = p; - p = realloc(d23, newsz * sizeof(struct diff)); + p = reallocarray(d23, newsz, sizeof(struct diff)); if (p == NULL) err(1, NULL); memset(p + szchanges, 0, incr * sizeof(struct diff)); d23 = p; - p = realloc(de, newsz * sizeof(struct diff)); + p = reallocarray(de, newsz, sizeof(struct diff)); if (p == NULL) err(1, NULL); memset(p + szchanges, 0, incr * sizeof(struct diff)); de = p; - q = realloc(overlap, newsz * sizeof(char)); + q = reallocarray(overlap, newsz, sizeof(char)); if (q == NULL) err(1, NULL); memset(q + szchanges, 0, incr * sizeof(char)); From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:35 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 B22C667DF58; Sat, 25 Sep 2021 08:41:35 +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 4HGj725Hg9z3mBp; Sat, 25 Sep 2021 08:41:34 +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 648D3272F6; Sat, 25 Sep 2021 08:41:34 +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 18P8fYnS018154; Sat, 25 Sep 2021 08:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fY4Q018153; Sat, 25 Sep 2021 08:41:34 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:34 GMT Message-Id: <202109250841.18P8fY4Q018153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 000d03450ba0 - stable/13 - diff3.1: update manual page to match code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 000d03450ba0c5ac37f2a83335b6c09ada1dcca9 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: Sat, 25 Sep 2021 08:41:35 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=000d03450ba0c5ac37f2a83335b6c09ada1dcca9 commit 000d03450ba0c5ac37f2a83335b6c09ada1dcca9 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-20 22:50:05 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff3.1: update manual page to match code (cherry picked from commit e8ff95356ceaaa941251056e9d0a4211bf428e06) --- usr.bin/diff3/diff3.1 | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1 index 84985632b8b8..cc4bdf1c8836 100644 --- a/usr.bin/diff3/diff3.1 +++ b/usr.bin/diff3/diff3.1 @@ -38,7 +38,11 @@ .Nd 3-way differential file comparison .Sh SYNOPSIS .Nm diff3 -.Op Fl 3aEeXx +.Op Fl 3aEeiXx +.Op Fl Fl diff-program Ar program +.Op Fl L | Fl Fl label Ar label1 +.Op Fl L | Fl Fl label Ar label2 +.Op Fl L | Fl Fl label Ar label3 .Ar file1 file2 file3 .Sh DESCRIPTION The @@ -60,15 +64,16 @@ new versions. .Pp The options are as follows: .Bl -tag -width "-E, -X" -.It Fl 3 +.It Fl 3 , Fl Fl easy-only Produces an output script suitable for .Xr ed 1 with changes specific only to .Ar file3 . -.It Fl a +.It Fl a , Fl Fl text Treat all files as ASCII. -.It Fl E , X +.It Fl E , Fl Fl show-overlap +.It Fl X Similar to .Fl e and @@ -77,7 +82,7 @@ respectively, but treat overlapping changes (i.e., changes that would be noted with ==== in the normal listing) differently. The overlapping lines from both files will be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>" lines. -.It Fl e +.It Fl e , Fl Fl ed Produces output in a form suitable as an input script for the .Xr ed 1 utility. @@ -99,11 +104,27 @@ and It is useful for backing out changes specific to .Ar file2 only. -.It Fl x +.It Fl i +Appends 'w' and 'q' +.Xr ed 1 +commands. +.It Fl L , Fl Fl label +Defines labels to print instead of file names +.Ar file1 , +.Ar file2 +and +.Ar file3 . +.It Fl x, Fl Fl overlap-only Produces an output script suitable for .Xr ed 1 with changes specific only to all three versions. +.It Fl Fl diff-program Ar program +Use +.Ar program +instead of the default +.Xr diff 1 +to compare files. .El .Pp The From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:37 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 947A467DF59; Sat, 25 Sep 2021 08:41:37 +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 4HGj750kF5z3m8S; Sat, 25 Sep 2021 08:41:36 +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 A972F2739B; Sat, 25 Sep 2021 08:41:36 +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 18P8faAj018202; Sat, 25 Sep 2021 08:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fafY018201; Sat, 25 Sep 2021 08:41:36 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:36 GMT Message-Id: <202109250841.18P8fafY018201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: a8446d4124d0 - stable/13 - diff3: document and test -T MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a8446d4124d0639b0fe49e25642a18a51fde8666 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: Sat, 25 Sep 2021 08:41:38 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=a8446d4124d0639b0fe49e25642a18a51fde8666 commit a8446d4124d0639b0fe49e25642a18a51fde8666 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-23 19:33:27 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff3: document and test -T (cherry picked from commit 9f7a81b133c715f649136dcd0ad004e4180c56c9) --- usr.bin/diff3/diff3.1 | 11 +++++++++-- usr.bin/diff3/tests/1t.out | 14 ++++++++++++++ usr.bin/diff3/tests/Makefile | 1 + usr.bin/diff3/tests/diff3_test.sh | 3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1 index 22e04b6af5e8..2cf1e57cb74e 100644 --- a/usr.bin/diff3/diff3.1 +++ b/usr.bin/diff3/diff3.1 @@ -30,7 +30,7 @@ .\" @(#)diff3.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd August 23, 2021 .Dt DIFF3 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd 3-way differential file comparison .Sh SYNOPSIS .Nm diff3 -.Op Fl 3aEeiXx +.Op Fl 3aEeiTXx .Op Fl Fl diff-program Ar program .Op Fl Fl strip-trailing-cr .Op Fl L | Fl Fl label Ar label1 @@ -115,6 +115,13 @@ Defines labels to print instead of file names .Ar file2 and .Ar file3 . +.It Fl T, Fl Fl initial-tab +In the normal listing, +use a tab instead of two spaces +at the beginning of each line. +In modes that produce an +.Xr ed 1 +script, this option changes nothing. .It Fl x, Fl Fl overlap-only Produces an output script suitable for .Xr ed 1 diff --git a/usr.bin/diff3/tests/1t.out b/usr.bin/diff3/tests/1t.out new file mode 100644 index 000000000000..fc54ce50286f --- /dev/null +++ b/usr.bin/diff3/tests/1t.out @@ -0,0 +1,14 @@ +==== +1:2,3c + which multiple lines + and a few typ0s to fix +2:2,3c + which multiple lines + and a few typos to fix +3:2c + and a few typ0s to fix +====2 +1:4a +3:3a +2:5c + New line diff --git a/usr.bin/diff3/tests/Makefile b/usr.bin/diff3/tests/Makefile index 2ec7fbaab564..b8bea154944b 100644 --- a/usr.bin/diff3/tests/Makefile +++ b/usr.bin/diff3/tests/Makefile @@ -10,6 +10,7 @@ ${PACKAGE}FILES+= \ 2.txt \ 3.txt \ 1.out \ + 1t.out \ 2.out \ 3.out \ 4.out \ diff --git a/usr.bin/diff3/tests/diff3_test.sh b/usr.bin/diff3/tests/diff3_test.sh index f4b5adf95700..64031b023187 100755 --- a/usr.bin/diff3/tests/diff3_test.sh +++ b/usr.bin/diff3/tests/diff3_test.sh @@ -11,6 +11,9 @@ diff3_body() atf_check -o file:$(atf_get_srcdir)/1.out \ diff3 --strip-trailing-cr $(atf_get_srcdir)/1cr.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/1t.out \ + diff3 -T $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/2.out \ diff3 -e $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 08:41:36 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 3DA4667DD6C; Sat, 25 Sep 2021 08:41:36 +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 4HGj736cxYz3lqJ; Sat, 25 Sep 2021 08:41:35 +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 85DE126F51; Sat, 25 Sep 2021 08:41:35 +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 18P8fZVh018178; Sat, 25 Sep 2021 08:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fZxB018177; Sat, 25 Sep 2021 08:41:35 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:35 GMT Message-Id: <202109250841.18P8fZxB018177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: dbabfd7e2676 - stable/13 - diff3: implement --strip-trailing-cr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dbabfd7e26763ac295ed0ee8bc77f3f3b58b6d03 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: Sat, 25 Sep 2021 08:41:36 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=dbabfd7e26763ac295ed0ee8bc77f3f3b58b6d03 commit dbabfd7e26763ac295ed0ee8bc77f3f3b58b6d03 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-21 00:28:58 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:39 +0000 diff3: implement --strip-trailing-cr (cherry picked from commit 54a3415cb69e1ea0e6533ca3fc168deba64f249f) --- usr.bin/diff3/diff3.1 | 3 +++ usr.bin/diff3/diff3.c | 9 ++++++++- usr.bin/diff3/tests/1cr.txt | 6 ++++++ usr.bin/diff3/tests/Makefile | 1 + usr.bin/diff3/tests/diff3_test.sh | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1 index cc4bdf1c8836..22e04b6af5e8 100644 --- a/usr.bin/diff3/diff3.1 +++ b/usr.bin/diff3/diff3.1 @@ -40,6 +40,7 @@ .Nm diff3 .Op Fl 3aEeiXx .Op Fl Fl diff-program Ar program +.Op Fl Fl strip-trailing-cr .Op Fl L | Fl Fl label Ar label1 .Op Fl L | Fl Fl label Ar label2 .Op Fl L | Fl Fl label Ar label3 @@ -125,6 +126,8 @@ Use instead of the default .Xr diff 1 to compare files. +.It Fl Fl strip-trailing-cr +Strip trailing carriage return on input files. .El .Pp The diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index 18daa54b2360..122243a9448f 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -264,6 +264,12 @@ get_line(FILE *b, size_t *n) if ((len = getline(&buf, &bufsize, b)) < 0) return (NULL); + if (strip_cr && len >= 2 && strcmp("\r\n", &(buf[len - 2])) == 0) { + buf[len - 2] = '\n'; + buf[len - 1] = '\0'; + len--; + } + if (n != NULL) *n = len; @@ -599,7 +605,7 @@ main(int argc, char **argv) char *labels[] = { NULL, NULL, NULL }; const char *diffprog = DIFF_PATH; char *file1, *file2, *file3; - char *diffargv[6]; + char *diffargv[7]; int diffargc = 0; int fd13[2], fd23[2]; int pd13, pd23; @@ -657,6 +663,7 @@ main(int argc, char **argv) break; case STRIPCR_OPT: strip_cr = 1; + diffargv[diffargc++] = __DECONST(char *, "--strip-trailing-cr"); break; } } diff --git a/usr.bin/diff3/tests/1cr.txt b/usr.bin/diff3/tests/1cr.txt new file mode 100644 index 000000000000..c24bf241e68a --- /dev/null +++ b/usr.bin/diff3/tests/1cr.txt @@ -0,0 +1,6 @@ +This is a more complete test +which multiple lines +and a few typ0s to fix +also I plan to add few lines + and to remove +other lines diff --git a/usr.bin/diff3/tests/Makefile b/usr.bin/diff3/tests/Makefile index dd75be1ca02a..2ec7fbaab564 100644 --- a/usr.bin/diff3/tests/Makefile +++ b/usr.bin/diff3/tests/Makefile @@ -6,6 +6,7 @@ ATF_TESTS_SH= diff3_test ${PACKAGE}FILES+= \ 1.txt \ + 1cr.txt \ 2.txt \ 3.txt \ 1.out \ diff --git a/usr.bin/diff3/tests/diff3_test.sh b/usr.bin/diff3/tests/diff3_test.sh index 6c479de2e9c0..f4b5adf95700 100755 --- a/usr.bin/diff3/tests/diff3_test.sh +++ b/usr.bin/diff3/tests/diff3_test.sh @@ -8,6 +8,9 @@ diff3_body() atf_check -o file:$(atf_get_srcdir)/1.out \ diff3 $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/1.out \ + diff3 --strip-trailing-cr $(atf_get_srcdir)/1cr.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/2.out \ diff3 -e $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 16:23:51 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 13A5C6AC187; Sat, 25 Sep 2021 16:23:51 +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 4HGvNQ6vVxz4lj0; Sat, 25 Sep 2021 16:23:50 +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 CD1EB55E2; Sat, 25 Sep 2021 16:23:50 +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 18PGNoWq032256; Sat, 25 Sep 2021 16:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PGNoXN032255; Sat, 25 Sep 2021 16:23:50 GMT (envelope-from git) Date: Sat, 25 Sep 2021 16:23:50 GMT Message-Id: <202109251623.18PGNoXN032255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c6bdb5d46872 - stable/13 - EC2: Allow AMI boot mode to be specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c6bdb5d46872386ce4eeab8c47937c73ab7be92e 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: Sat, 25 Sep 2021 16:23:51 -0000 The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c6bdb5d46872386ce4eeab8c47937c73ab7be92e commit c6bdb5d46872386ce4eeab8c47937c73ab7be92e Author: Colin Percival AuthorDate: 2021-09-16 02:15:44 +0000 Commit: Colin Percival CommitDate: 2021-09-25 16:11:48 +0000 EC2: Allow AMI boot mode to be specified The default boot method for amd64 AMIs is BIOS, but at AMI creation time a flag can be set to specify that UEFI should be used instead. This commit adds a variable AMIBOOTMETHOD which, if set to "UEFI", causes the appropriate flag to be set during AMI creation. The only boot method supported by EC2 for arm64 is UEFI. The names of AMIs are also amended to include the boot method; they now look like "FreeBSD 14.0-CURRENT-amd64-20210915 UEFI". Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0) --- release/Makefile.ec2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 58042cba1f88..c82620ea5cd6 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -24,6 +24,16 @@ SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVI .if ${TARGET_ARCH} != "amd64" EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} .endif +.if !defined(AMIBOOTMETHOD) +.if ${TARGET_ARCH} == "amd64" +AMIBOOTMETHOD= BIOS +.else +AMIBOOTMETHOD= UEFI +.endif +.endif +.if ${AMIBOOTMETHOD} == "UEFI" && ${TARGET_ARCH} == "amd64" +BOOTMODEOPT= --uefi +.endif CLEANFILES+= ec2ami @@ -65,9 +75,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @false .endif /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \ - ${EC2ARCH} ${SSMOPTS} --sriov --ena \ + ${EC2ARCH} ${SSMOPTS} ${BOOTMODEOPT} --sriov --ena \ ${.OBJDIR}/ec2.raw \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD}" \ "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 16:23:52 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 42E9B6ABEAC; Sat, 25 Sep 2021 16:23:52 +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 4HGvNS11cKz4lcH; Sat, 25 Sep 2021 16:23:52 +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 EEFF5594E; Sat, 25 Sep 2021 16:23:51 +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 18PGNpG2032281; Sat, 25 Sep 2021 16:23:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PGNp9O032280; Sat, 25 Sep 2021 16:23:51 GMT (envelope-from git) Date: Sat, 25 Sep 2021 16:23:51 GMT Message-Id: <202109251623.18PGNp9O032280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 65f22ccf8247 - stable/13 - EC2: Default to UEFI booting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 65f22ccf824710cb633da9424961ee02fecd7591 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: Sat, 25 Sep 2021 16:23:52 -0000 The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=65f22ccf824710cb633da9424961ee02fecd7591 commit 65f22ccf824710cb633da9424961ee02fecd7591 Author: Colin Percival AuthorDate: 2021-09-16 16:22:42 +0000 Commit: Colin Percival CommitDate: 2021-09-25 16:20:58 +0000 EC2: Default to UEFI booting This reduces the FreeBSD boot time by approximately 5 seconds, roughly equally divided betwenn two factors: * Disk I/O is faster in the EFI loader since it can perform larger I/Os. (The BIOS loader is limited due to the use of bounce buffers in sub-1M memory.) * The EFI console is much faster than the VGA console. Note however that not all EC2 instance types support UEFI; as a general rule the newer instances (based on Amazon's "Nitro" platform) support UEFI but the older instances (based on Xen) do not. Discussed with: re@, freebsd-cloud@, Amazon Relnotes: yes Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit b43d7aa09b3c91fb6b652306db2ac13e1459c497) --- release/Makefile.ec2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index c82620ea5cd6..3a3f6232333d 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -25,12 +25,8 @@ SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVI EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} .endif .if !defined(AMIBOOTMETHOD) -.if ${TARGET_ARCH} == "amd64" -AMIBOOTMETHOD= BIOS -.else AMIBOOTMETHOD= UEFI .endif -.endif .if ${AMIBOOTMETHOD} == "UEFI" && ${TARGET_ARCH} == "amd64" BOOTMODEOPT= --uefi .endif From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 18:14:29 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 B65FC6ADC30; Sat, 25 Sep 2021 18:14:29 +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 4HGxr54mKZz3CW4; Sat, 25 Sep 2021 18:14:29 +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 7900B71C0; Sat, 25 Sep 2021 18:14:29 +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 18PIETkN079831; Sat, 25 Sep 2021 18:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PIETna079830; Sat, 25 Sep 2021 18:14:29 GMT (envelope-from git) Date: Sat, 25 Sep 2021 18:14:29 GMT Message-Id: <202109251814.18PIETna079830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9352de39c3dc - stable/13 - vt: bound buffer access in redraw optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9352de39c3dcc94f2745f939e52388a8e1cc1c05 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: Sat, 25 Sep 2021 18:14:29 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9352de39c3dcc94f2745f939e52388a8e1cc1c05 commit 9352de39c3dcc94f2745f939e52388a8e1cc1c05 Author: Ed Maste AuthorDate: 2021-09-22 18:41:00 +0000 Commit: Ed Maste CommitDate: 2021-09-25 18:14:12 +0000 vt: bound buffer access in redraw optimization PR: 248628 Reported by: oleg Reviewed by: cem, oleg (both earlier) Fixes: ee97b2336aa4 ("Speed up vt(4) by keeping...") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32059 (cherry picked from commit dbc7ca59451561a179f9852642e13ef024169d84) --- sys/dev/vt/hw/fb/vt_fb.c | 6 ++++++ sys/dev/vt/hw/vga/vt_vga.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 01850f789d29..c535d1b753c9 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -355,6 +355,9 @@ vt_fb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg); z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn && (vd->vd_drawn[z] == c) && vd->vd_drawnfg && (vd->vd_drawnfg[z] == fg) && vd->vd_drawnbg && (vd->vd_drawnbg[z] == bg)) @@ -405,6 +408,9 @@ vt_fb_invalidate_text(struct vt_device *vd, const term_rect_t *area) for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col; ++col) { z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn) vd->vd_drawn[z] = 0; if (vd->vd_drawnfg) diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c index 88a9b1c47338..563867399e53 100644 --- a/sys/dev/vt/hw/vga/vt_vga.c +++ b/sys/dev/vt/hw/vga/vt_vga.c @@ -888,6 +888,9 @@ vga_bitblt_text_txtmode(struct vt_device *vd, const struct vt_window *vw, &fg, &bg); z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn && (vd->vd_drawn[z] == c) && vd->vd_drawnfg && (vd->vd_drawnfg[z] == fg) && vd->vd_drawnbg && (vd->vd_drawnbg[z] == bg)) @@ -941,6 +944,9 @@ vga_invalidate_text(struct vt_device *vd, const term_rect_t *area) col < area->tr_end.tp_col; ++col) { z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn) vd->vd_drawn[z] = 0; if (vd->vd_drawnfg) From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 18:14:43 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 CEBE86ADDB0; Sat, 25 Sep 2021 18:14:43 +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 4HGxrM33dTz3CTX; Sat, 25 Sep 2021 18:14:43 +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 3F8AA721D; Sat, 25 Sep 2021 18:14:43 +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 18PIEhfu079970; Sat, 25 Sep 2021 18:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PIEhol079969; Sat, 25 Sep 2021 18:14:43 GMT (envelope-from git) Date: Sat, 25 Sep 2021 18:14:43 GMT Message-Id: <202109251814.18PIEhol079969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e4fcff8ee124 - stable/12 - vt: bound buffer access in redraw optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e4fcff8ee124f8faed2f1fcc1e15b7ae6906d4d7 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: Sat, 25 Sep 2021 18:14:43 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e4fcff8ee124f8faed2f1fcc1e15b7ae6906d4d7 commit e4fcff8ee124f8faed2f1fcc1e15b7ae6906d4d7 Author: Ed Maste AuthorDate: 2021-09-22 18:41:00 +0000 Commit: Ed Maste CommitDate: 2021-09-25 16:32:06 +0000 vt: bound buffer access in redraw optimization PR: 248628 Reported by: oleg Reviewed by: cem, oleg (both earlier) Fixes: ee97b2336aa4 ("Speed up vt(4) by keeping...") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32059 (cherry picked from commit dbc7ca59451561a179f9852642e13ef024169d84) --- sys/dev/vt/hw/fb/vt_fb.c | 6 ++++++ sys/dev/vt/hw/vga/vt_vga.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 62a52dd9e017..5c14be1c15ba 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -354,6 +354,9 @@ vt_fb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg); z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn && (vd->vd_drawn[z] == c) && vd->vd_drawnfg && (vd->vd_drawnfg[z] == fg) && vd->vd_drawnbg && (vd->vd_drawnbg[z] == bg)) @@ -404,6 +407,9 @@ vt_fb_invalidate_text(struct vt_device *vd, const term_rect_t *area) for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col; ++col) { z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn) vd->vd_drawn[z] = 0; if (vd->vd_drawnfg) diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c index 88a9b1c47338..563867399e53 100644 --- a/sys/dev/vt/hw/vga/vt_vga.c +++ b/sys/dev/vt/hw/vga/vt_vga.c @@ -888,6 +888,9 @@ vga_bitblt_text_txtmode(struct vt_device *vd, const struct vt_window *vw, &fg, &bg); z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn && (vd->vd_drawn[z] == c) && vd->vd_drawnfg && (vd->vd_drawnfg[z] == fg) && vd->vd_drawnbg && (vd->vd_drawnbg[z] == bg)) @@ -941,6 +944,9 @@ vga_invalidate_text(struct vt_device *vd, const term_rect_t *area) col < area->tr_end.tp_col; ++col) { z = row * PIXEL_WIDTH(VT_FB_MAX_WIDTH) + col; + if (z >= PIXEL_HEIGHT(VT_FB_MAX_HEIGHT) * + PIXEL_WIDTH(VT_FB_MAX_WIDTH)) + continue; if (vd->vd_drawn) vd->vd_drawn[z] = 0; if (vd->vd_drawnfg) From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 20:44:15 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 641AE668706; Sat, 25 Sep 2021 20:44:15 +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 4HH18v28Ppz3R6P; Sat, 25 Sep 2021 20:44:15 +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 2935C11496; Sat, 25 Sep 2021 20:44:15 +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 18PKiFBu080641; Sat, 25 Sep 2021 20:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PKiF9A080640; Sat, 25 Sep 2021 20:44:15 GMT (envelope-from git) Date: Sat, 25 Sep 2021 20:44:15 GMT Message-Id: <202109252044.18PKiF9A080640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f3410f8798fe - stable/13 - nfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f3410f8798fe7c8ccb30a3baa303506d49726270 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: Sat, 25 Sep 2021 20:44:15 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f3410f8798fe7c8ccb30a3baa303506d49726270 commit f3410f8798fe7c8ccb30a3baa303506d49726270 Author: Rick Macklem AuthorDate: 2021-09-08 21:29:20 +0000 Commit: Rick Macklem CommitDate: 2021-09-25 20:40:53 +0000 nfsd: Use the COPY_FILE_RANGE_TIMEO1SEC flag Although it is not specified in the RFCs, the concept that the NFSv4 server should reply to an RPC request within a reasonable time is accepted practice within the NFSv4 community. Without this patch, the NFSv4.2 server attempts to reply to a Copy operation within 1 second by limiting the copy to vfs.nfs.maxcopyrange bytes (default 10Mbytes). This is crude at best, given the large variation in I/O subsystem performance. This patch uses the COPY_FILE_RANGE_TIMEO1SEC flag added by commit c5128c48df3c to limit the reply time for a Copy operation to approximately 1 second. (cherry picked from commit 103b207536f976cb350558769f5f428e05ec61dc) --- sys/fs/nfsserver/nfs_nfsdserv.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 12181d04f1fa..9bfa6dd3a99b 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -65,7 +65,6 @@ extern int nfsd_debuglevel; extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; -extern int nfs_maxcopyrange; extern uint32_t nfs_srvmaxio; static int nfs_async = 0; @@ -5401,7 +5400,6 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, int cnt, error = 0, ret; off_t inoff, outoff; uint64_t len; - size_t xfer; struct nfsstate inst, outst, *instp = &inst, *outstp = &outst; struct nfslock inlo, outlo, *inlop = &inlo, *outlop = &outlo; nfsquad_t clientid; @@ -5576,21 +5574,10 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = error; } - /* - * Do the actual copy to an upper limit of vfs.nfs.maxcopyrange. - * This limit is applied to ensure that the RPC replies in a - * reasonable time. - */ - if (len > nfs_maxcopyrange) - xfer = nfs_maxcopyrange; - else - xfer = len; - if (nd->nd_repstat == 0) { + if (nd->nd_repstat == 0) nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff, - &xfer, 0, nd->nd_cred, nd->nd_cred, NULL); - if (nd->nd_repstat == 0) - len = xfer; - } + &len, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, + NULL); /* Unlock the ranges. */ if (rl_rcookie != NULL) From owner-dev-commits-src-branches@freebsd.org Sat Sep 25 20:45:42 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 69EAE66866A; Sat, 25 Sep 2021 20:45:42 +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 4HH1BZ2NbLz3R0t; Sat, 25 Sep 2021 20:45:42 +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 326CA11497; Sat, 25 Sep 2021 20:45:42 +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 18PKjguB080854; Sat, 25 Sep 2021 20:45:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18PKjgZ2080853; Sat, 25 Sep 2021 20:45:42 GMT (envelope-from git) Date: Sat, 25 Sep 2021 20:45:42 GMT Message-Id: <202109252045.18PKjgZ2080853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f72cdea25c29 - stable/13 - nfsd: Fix build after commit 103b207536f9 for 32bit arches MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f72cdea25c291a88d1793e88202a847e7a62f74b 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: Sat, 25 Sep 2021 20:45:42 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f72cdea25c291a88d1793e88202a847e7a62f74b commit f72cdea25c291a88d1793e88202a847e7a62f74b Author: Rick Macklem AuthorDate: 2021-09-09 01:55:06 +0000 Commit: Rick Macklem CommitDate: 2021-09-25 20:42:26 +0000 nfsd: Fix build after commit 103b207536f9 for 32bit arches (cherry picked from commit f1c8811d2d250aac5a59bb2109d905139c119925) --- sys/fs/nfsserver/nfs_nfsdserv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 9bfa6dd3a99b..33af169f4e98 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5400,6 +5400,7 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, int cnt, error = 0, ret; off_t inoff, outoff; uint64_t len; + size_t xfer; struct nfsstate inst, outst, *instp = &inst, *outstp = &outst; struct nfslock inlo, outlo, *inlop = &inlo, *outlop = &outlo; nfsquad_t clientid; @@ -5574,10 +5575,14 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __unused int isdgram, nd->nd_repstat = error; } - if (nd->nd_repstat == 0) + xfer = len; + if (nd->nd_repstat == 0) { nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff, - &len, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, + &xfer, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred, NULL); + if (nd->nd_repstat == 0) + len = xfer; + } /* Unlock the ranges. */ if (rl_rcookie != NULL) From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 14:10:42 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 3096667965F; Sun, 26 Sep 2021 14:10:42 +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 4HHSNL0yzhz4SLq; Sun, 26 Sep 2021 14:10:42 +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 01F651F075; Sun, 26 Sep 2021 14:10:42 +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 18QEAfmb072199; Sun, 26 Sep 2021 14:10:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QEAfsE072186; Sun, 26 Sep 2021 14:10:41 GMT (envelope-from git) Date: Sun, 26 Sep 2021 14:10:41 GMT Message-Id: <202109261410.18QEAfsE072186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: d61f95996174 - stable/13 - netmap: monitor: add a flag to distinguish packet direction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d61f95996174d3068357f176532d5fdc946269af 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: Sun, 26 Sep 2021 14:10:42 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=d61f95996174d3068357f176532d5fdc946269af commit d61f95996174d3068357f176532d5fdc946269af Author: Vincenzo Maffione AuthorDate: 2021-03-29 16:32:54 +0000 Commit: Vincenzo Maffione CommitDate: 2021-09-26 14:00:04 +0000 netmap: monitor: add a flag to distinguish packet direction The netmap monitor intercepts any TX/RX packets on the monitored port. However, before this change there was no way to tell whether an intercepted packet was being transmitted or received on the monitored port. A TXMON flag in the netmap slot has been added for this purpose. (cherry picked from commit 660a47cb991d5a7ca69cd8dd9c09a5288d49e405) --- sys/dev/netmap/netmap_monitor.c | 8 ++++++-- sys/net/netmap.h | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c index 1f5ff65b3b81..9e5d57f7ff0f 100644 --- a/sys/dev/netmap/netmap_monitor.c +++ b/sys/dev/netmap/netmap_monitor.c @@ -38,6 +38,8 @@ * the traffic transiting on both the tx and rx corresponding rings in the * monitored adapter. During registration, the user can choose if she wants * to intercept tx only, rx only, or both tx and rx traffic. + * The slots containing traffic intercepted in the tx direction will have + * the NS_TXMON flag set. * * If the monitor is not able to cope with the stream of frames, excess traffic * will be dropped. @@ -590,6 +592,7 @@ netmap_zmon_parent_sync(struct netmap_kring *kring, int flags, enum txrx tx) u_int beg, end, i; u_int lim = kring->nkr_num_slots - 1, mlim; // = mkring->nkr_num_slots - 1; + uint16_t txmon = kring->tx == NR_TX ? NS_TXMON : 0; if (mkring == NULL) { nm_prlim(5, "NULL monitor on %s", kring->name); @@ -659,7 +662,7 @@ netmap_zmon_parent_sync(struct netmap_kring *kring, int flags, enum txrx tx) ms->len = s->len; s->len = tmp; - ms->flags = s->flags; + ms->flags = (s->flags & ~NS_TXMON) | txmon; s->flags |= NS_BUF_CHANGED; beg = nm_next(beg, lim); @@ -726,6 +729,7 @@ static void netmap_monitor_parent_sync(struct netmap_kring *kring, u_int first_new, int new_slots) { u_int j; + uint16_t txmon = kring->tx == NR_TX ? NS_TXMON : 0; for (j = 0; j < kring->n_monitors; j++) { struct netmap_kring *mkring = kring->monitors[j]; @@ -777,7 +781,7 @@ netmap_monitor_parent_sync(struct netmap_kring *kring, u_int first_new, int new_ memcpy(dst, src, copy_len); ms->len = copy_len; - ms->flags = s->flags; + ms->flags = (s->flags & ~NS_TXMON) | txmon; sent++; beg = nm_next(beg, lim); diff --git a/sys/net/netmap.h b/sys/net/netmap.h index c040683651d0..4d091ccc635d 100644 --- a/sys/net/netmap.h +++ b/sys/net/netmap.h @@ -219,6 +219,11 @@ struct netmap_slot { * The 'len' field refers to the individual fragment. */ +#define NS_TXMON 0x0040 + /* (monitor ports only) the packet comes from the TX + * ring of the monitored port + */ + #define NS_PORT_SHIFT 8 #define NS_PORT_MASK (0xff << NS_PORT_SHIFT) /* From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 14:12:23 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 15314679D2D; Sun, 26 Sep 2021 14:12:23 +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 4HHSQH03gnz4SRt; Sun, 26 Sep 2021 14:12:23 +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 D600C1F184; Sun, 26 Sep 2021 14:12:22 +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 18QECMcN074984; Sun, 26 Sep 2021 14:12:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QECMgI074983; Sun, 26 Sep 2021 14:12:22 GMT (envelope-from git) Date: Sun, 26 Sep 2021 14:12:22 GMT Message-Id: <202109261412.18QECMgI074983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 5faf08808d63 - stable/13 - libnetmap: reset errno in nmreq_register_decode() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5faf08808d63ec6724ea7b1bd8a34e2d61095829 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: Sun, 26 Sep 2021 14:12:23 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=5faf08808d63ec6724ea7b1bd8a34e2d61095829 commit 5faf08808d63ec6724ea7b1bd8a34e2d61095829 Author: Vincenzo Maffione AuthorDate: 2021-04-02 14:31:57 +0000 Commit: Vincenzo Maffione CommitDate: 2021-09-26 14:11:59 +0000 libnetmap: reset errno in nmreq_register_decode() The reset is necessary at the beginning of the function, because of the errno logic in the error path (set errno to EINVAL if not set). If errno is already set when calling the function, and the function fails, the previous errno value will be inherited. (cherry picked from commit ab639bb2873034786cd2ec4d2d9c4489fbf6f424) --- lib/libnetmap/nmreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index 7f4b2703d22d..31ddea91f6a5 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -257,6 +257,8 @@ nmreq_register_decode(const char **pifname, struct nmreq_register *r, struct nmc uint16_t nr_ringid; uint64_t nr_flags; + errno = 0; + /* fill the request */ p_state = P_START; From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 15:55:43 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 7288667B259; Sun, 26 Sep 2021 15:55:43 +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 4HHVjW2WXqz4d9R; Sun, 26 Sep 2021 15:55:43 +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 37874205B7; Sun, 26 Sep 2021 15:55:43 +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 18QFthBt008652; Sun, 26 Sep 2021 15:55:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QFthKQ008651; Sun, 26 Sep 2021 15:55:43 GMT (envelope-from git) Date: Sun, 26 Sep 2021 15:55:43 GMT Message-Id: <202109261555.18QFthKQ008651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8694d0b7448d - stable/13 - freebsd32: Provide an ANSI definition for freebsd32_recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8694d0b7448d53f54e8fbc3604308a1c319a30c6 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: Sun, 26 Sep 2021 15:55:43 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8694d0b7448d53f54e8fbc3604308a1c319a30c6 commit 8694d0b7448d53f54e8fbc3604308a1c319a30c6 Author: Mark Johnston AuthorDate: 2021-09-19 17:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-09-26 15:55:01 +0000 freebsd32: Provide an ANSI definition for freebsd32_recvmsg() Fix style in the freebsd32_sendmsg() definition. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4bda16ff184bfca5ee4bf9709a06323d9cf5945b) --- sys/compat/freebsd32/freebsd32_misc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index c5bf67a72afd..a4ae014dbe85 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1400,13 +1400,7 @@ exit: } int -freebsd32_recvmsg(td, uap) - struct thread *td; - struct freebsd32_recvmsg_args /* { - int s; - struct msghdr32 *msg; - int flags; - } */ *uap; +freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; @@ -1551,8 +1545,7 @@ out: } int -freebsd32_sendmsg(struct thread *td, - struct freebsd32_sendmsg_args *uap) +freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 15:55:44 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 A528B67B5AC; Sun, 26 Sep 2021 15:55:44 +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 4HHVjX49wdz4dCk; Sun, 26 Sep 2021 15:55:44 +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 650EF2042D; Sun, 26 Sep 2021 15:55:44 +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 18QFtiw2008676; Sun, 26 Sep 2021 15:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QFtipl008675; Sun, 26 Sep 2021 15:55:44 GMT (envelope-from git) Date: Sun, 26 Sep 2021 15:55:44 GMT Message-Id: <202109261555.18QFtipl008675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bcff2fdf8ee4 - stable/13 - freebsd32: Fix a double copyin in sendmsg() and recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bcff2fdf8ee4b5053a5c7a7221879d2caf046b2b 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: Sun, 26 Sep 2021 15:55:44 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bcff2fdf8ee4b5053a5c7a7221879d2caf046b2b commit bcff2fdf8ee4b5053a5c7a7221879d2caf046b2b Author: Mark Johnston AuthorDate: 2021-09-19 17:45:09 +0000 Commit: Mark Johnston CommitDate: 2021-09-26 15:55:05 +0000 freebsd32: Fix a double copyin in sendmsg() and recvmsg() freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message header twice, once directly and once in freebsd32_copyinmsghdr(). The iovec length from the former is used when copying in msg_iov, but the rest of the kernel uses the iovec length from the latter. When kern_sendit() and kern_recvit() iterate over the iovec to compute the residual for I/O, they can therefore end up walking past the end of the copied in iovec, either resulting in a system call error, userspace memory corruption from uiomove() with invalid iovecs, or a kernel page fault if the copied-in iovec is followed by an unmapped KVA region. Reported by: syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com Reviewed by: kib, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit fea1a98ead918b39280b586773a923e76194400b) --- sys/compat/freebsd32/freebsd32_misc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index a4ae014dbe85..fd5ef9171982 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1403,19 +1403,15 @@ int freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *uiov, *iov; struct mbuf *control = NULL; struct mbuf **controlp; - int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); + error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); @@ -1548,19 +1544,15 @@ int freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *iov; struct mbuf *control = NULL; struct sockaddr *to = NULL; int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 15:56:27 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 AF1AE67B53B; Sun, 26 Sep 2021 15:56: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 4HHVkM4Yx8z4dSq; Sun, 26 Sep 2021 15:56:27 +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 7C7572042E; Sun, 26 Sep 2021 15:56: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 18QFuRtN008853; Sun, 26 Sep 2021 15:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QFuRxH008852; Sun, 26 Sep 2021 15:56:27 GMT (envelope-from git) Date: Sun, 26 Sep 2021 15:56:27 GMT Message-Id: <202109261556.18QFuRxH008852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b87459f1355d - stable/12 - freebsd32: Provide an ANSI definition for freebsd32_recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b87459f1355d6381b102b768f64f559c06719553 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: Sun, 26 Sep 2021 15:56:27 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b87459f1355d6381b102b768f64f559c06719553 commit b87459f1355d6381b102b768f64f559c06719553 Author: Mark Johnston AuthorDate: 2021-09-19 17:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-09-26 15:56:11 +0000 freebsd32: Provide an ANSI definition for freebsd32_recvmsg() Fix style in the freebsd32_sendmsg() definition. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4bda16ff184bfca5ee4bf9709a06323d9cf5945b) --- sys/compat/freebsd32/freebsd32_misc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 2643333c51c2..fea30190e672 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1201,13 +1201,7 @@ exit: } int -freebsd32_recvmsg(td, uap) - struct thread *td; - struct freebsd32_recvmsg_args /* { - int s; - struct msghdr32 *msg; - int flags; - } */ *uap; +freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; @@ -1352,8 +1346,7 @@ out: } int -freebsd32_sendmsg(struct thread *td, - struct freebsd32_sendmsg_args *uap) +freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; From owner-dev-commits-src-branches@freebsd.org Sun Sep 26 15:56:29 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 30D5867B3E3; Sun, 26 Sep 2021 15:56:29 +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 4HHVkP0Chwz4dSx; Sun, 26 Sep 2021 15:56:28 +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 AEF02205B8; Sun, 26 Sep 2021 15:56:28 +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 18QFuSQK008884; Sun, 26 Sep 2021 15:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18QFuSuq008883; Sun, 26 Sep 2021 15:56:28 GMT (envelope-from git) Date: Sun, 26 Sep 2021 15:56:28 GMT Message-Id: <202109261556.18QFuSuq008883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0d2b77383b02 - stable/12 - freebsd32: Fix a double copyin in sendmsg() and recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0d2b77383b021646b91b90a4c2a0816af5688553 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: Sun, 26 Sep 2021 15:56:29 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0d2b77383b021646b91b90a4c2a0816af5688553 commit 0d2b77383b021646b91b90a4c2a0816af5688553 Author: Mark Johnston AuthorDate: 2021-09-19 17:45:09 +0000 Commit: Mark Johnston CommitDate: 2021-09-26 15:56:11 +0000 freebsd32: Fix a double copyin in sendmsg() and recvmsg() freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message header twice, once directly and once in freebsd32_copyinmsghdr(). The iovec length from the former is used when copying in msg_iov, but the rest of the kernel uses the iovec length from the latter. When kern_sendit() and kern_recvit() iterate over the iovec to compute the residual for I/O, they can therefore end up walking past the end of the copied in iovec, either resulting in a system call error, userspace memory corruption from uiomove() with invalid iovecs, or a kernel page fault if the copied-in iovec is followed by an unmapped KVA region. Reported by: syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com Reviewed by: kib, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit fea1a98ead918b39280b586773a923e76194400b) --- sys/compat/freebsd32/freebsd32_misc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index fea30190e672..68a17f4fb004 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1204,19 +1204,15 @@ int freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *uiov, *iov; struct mbuf *control = NULL; struct mbuf **controlp; - int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); + error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); @@ -1349,19 +1345,15 @@ int freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *iov; struct mbuf *control = NULL; struct sockaddr *to = NULL; int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error);