From owner-dev-commits-src-main@freebsd.org Mon Apr 26 01:01:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D06845F0F1B; Mon, 26 Apr 2021 01:01: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 4FT6695YKZz4n3g; Mon, 26 Apr 2021 01:01: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 B139E1E2B6; Mon, 26 Apr 2021 01:01: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 13Q11L4M038173; Mon, 26 Apr 2021 01:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q11Lpn038172; Mon, 26 Apr 2021 01:01:21 GMT (envelope-from git) Date: Mon, 26 Apr 2021 01:01:21 GMT Message-Id: <202104260101.13Q11Lpn038172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: aad780464fad - main - nfscl: return delegations in the NFS VOP_RECLAIM() 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/main X-Git-Reftype: branch X-Git-Commit: aad780464fad1e32c97316515a4044d661413a6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 01:01:21 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=aad780464fad1e32c97316515a4044d661413a6b commit aad780464fad1e32c97316515a4044d661413a6b Author: Rick Macklem AuthorDate: 2021-04-26 00:57:55 +0000 Commit: Rick Macklem CommitDate: 2021-04-26 00:57:55 +0000 nfscl: return delegations in the NFS VOP_RECLAIM() After a vnode is recycled it can no longer be acquired via vfs_hash_get() and, as such, a delegation for the vnode cannot be recalled. In the unlikely event that a delegation still exists when the vnode is being recycled, return the delegation since it will no longer be recallable. Until you have this patch in your NFSv4 client, you should consider avoiding the use of delegations. MFC after: 2 weeks --- sys/fs/nfs/nfs_var.h | 1 + sys/fs/nfsclient/nfs_clnode.c | 10 ++++++++- sys/fs/nfsclient/nfs_clstate.c | 49 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 0297b52015f8..201c5a5fc2b5 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -604,6 +604,7 @@ void nfscl_lockinit(struct nfsv4lock *); void nfscl_lockexcl(struct nfsv4lock *, void *); void nfscl_lockunlock(struct nfsv4lock *); void nfscl_lockderef(struct nfsv4lock *); +void nfscl_delegreturnvp(vnode_t, NFSPROC_T *); void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *); void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *, int); diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index a59b96bf3c8b..43c2286726f7 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -303,7 +303,7 @@ ncl_reclaim(struct vop_reclaim_args *ap) ncl_releasesillyrename(vp, td); NFSUNLOCKNODE(np); - if (NFS_ISV4(vp) && vp->v_type == VREG) + if (NFS_ISV4(vp) && vp->v_type == VREG) { /* * We can now safely close any remaining NFSv4 Opens for * this file. Most opens will have already been closed by @@ -311,6 +311,14 @@ ncl_reclaim(struct vop_reclaim_args *ap) * called, so we need to do it again here. */ (void) nfsrpc_close(vp, 1, td); + /* + * It it unlikely a delegation will still exist, but + * if one does, it must be returned before calling + * vfs_hash_remove(), since it cannot be recalled once the + * nfs node is no longer available. + */ + nfscl_delegreturnvp(vp, td); + } vfs_hash_remove(vp); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 6cff58331c97..bbc1c6ccbc2f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -152,7 +152,8 @@ static int nfscl_trylock(struct nfsmount *, vnode_t , u_int8_t *, struct ucred *, NFSPROC_T *); static int nfsrpc_reopen(struct nfsmount *, u_int8_t *, int, u_int32_t, struct nfsclopen *, struct nfscldeleg **, struct ucred *, NFSPROC_T *); -static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *); +static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *, + bool); static int nfscl_errmap(struct nfsrv_descript *, u_int32_t); static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *); static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *, @@ -1622,12 +1623,13 @@ nfscl_cleandeleg(struct nfscldeleg *dp) * Free a delegation. */ static void -nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp) +nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp, bool freeit) { TAILQ_REMOVE(hdp, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); - free(dp, M_NFSCLDELEG); + if (freeit) + free(dp, M_NFSCLDELEG); nfsstatsv1.cldelegates--; nfscl_delegcnt--; } @@ -1725,7 +1727,7 @@ nfscl_expireclient(struct nfsclclient *clp, struct nfsmount *nmp, printf("nfsv4 expired locks lost\n"); } nfscl_cleandeleg(dp); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); dp = ndp; } if (!TAILQ_EMPTY(&clp->nfsc_deleg)) @@ -2257,7 +2259,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred, * away. Ouch!! */ nfscl_cleandeleg(dp); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } else { LIST_INSERT_HEAD(&extra_open, nop, nfso_list); } @@ -3280,11 +3282,40 @@ nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T *p) TAILQ_FOREACH_SAFE(dp, &clp->nfsc_deleg, nfsdl_list, ndp) { nfscl_cleandeleg(dp); (void) nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } NFSFREECRED(cred); } +/* + * Return any delegation for this vp. + */ +void +nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) +{ + struct nfsclclient *clp; + struct nfscldeleg *dp; + struct ucred *cred; + struct nfsnode *np; + + np = VTONFS(vp); + cred = newnfs_getcred(); + NFSLOCKCLSTATE(); + clp = VFSTONFS(vp->v_mount)->nm_clp; + dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len); + if (dp != NULL) { + nfscl_cleandeleg(dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, false); + NFSUNLOCKCLSTATE(); + newnfs_copycred(&dp->nfsdl_cred, cred); + nfscl_trydelegreturn(dp, cred, clp->nfsc_nmp, p); + free(dp, M_NFSCLDELEG); + } else + NFSUNLOCKCLSTATE(); + NFSFREECRED(cred); +} + /* * Do a callback RPC. */ @@ -4515,7 +4546,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) *stp = dp->nfsdl_stateid; retcnt = 1; nfscl_cleandeleg(dp); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } if (igotlock) nfsv4_unlock(&clp->nfsc_lock, 0); @@ -4615,7 +4646,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, retcnt++; *gotfdp = 1; nfscl_cleandeleg(dp); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } if (igotlock) { nfsv4_unlock(&clp->nfsc_lock, 0); @@ -4651,7 +4682,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, retcnt++; *gottdp = 1; nfscl_cleandeleg(dp); - nfscl_freedeleg(&clp->nfsc_deleg, dp); + nfscl_freedeleg(&clp->nfsc_deleg, dp, true); } } NFSUNLOCKCLSTATE(); From owner-dev-commits-src-main@freebsd.org Mon Apr 26 01:10:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2FAFA5F1441; Mon, 26 Apr 2021 01:10: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 4FT6JT0qlGz4nmV; Mon, 26 Apr 2021 01:10:17 +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 0EFF81E328; Mon, 26 Apr 2021 01:10: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 13Q1AGaW048055; Mon, 26 Apr 2021 01:10:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q1AGM6048050; Mon, 26 Apr 2021 01:10:16 GMT (envelope-from git) Date: Mon, 26 Apr 2021 01:10:16 GMT Message-Id: <202104260110.13Q1AGM6048050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 4b84b4cca472 - main - zfs: fix non-functional mismerges from vendor/openzfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b84b4cca472e482bc22d5e5c7928be5a1393c84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 01:10:17 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=4b84b4cca472e482bc22d5e5c7928be5a1393c84 commit 4b84b4cca472e482bc22d5e5c7928be5a1393c84 Author: Martin Matuska AuthorDate: 2021-04-26 01:05:13 +0000 Commit: Martin Matuska CommitDate: 2021-04-26 01:05:13 +0000 zfs: fix non-functional mismerges from vendor/openzfs - fix copyright in module/os/freebsd/spl/spl_acl.c - fix mismerge in non-processed module/os/linux/zfs/zfs_uio.c MFC after: 3 days Obtained from: OpenZFS --- sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c index 74c26d03f87f..18188ca0adec 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2008, 2009 Edward Tomasz NapieraƂa + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c b/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c index 3e3fda20c72c..a3d5d5f83b6f 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c @@ -261,9 +261,6 @@ zfs_uio_prefaultpages(ssize_t n, zfs_uio_t *uio) } } - if (iterp && iov_iter_fault_in_readable(iterp, n)) - return (EFAULT); -#endif return (0); } EXPORT_SYMBOL(zfs_uio_prefaultpages); From owner-dev-commits-src-main@freebsd.org Mon Apr 26 05:07:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5BA675F4BA7; Mon, 26 Apr 2021 05:07: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 4FTCYq26pnz4y9B; Mon, 26 Apr 2021 05:07: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 373FC2161B; Mon, 26 Apr 2021 05:07: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 13Q57BuQ059118; Mon, 26 Apr 2021 05:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q57BC4059117; Mon, 26 Apr 2021 05:07:11 GMT (envelope-from git) Date: Mon, 26 Apr 2021 05:07:11 GMT Message-Id: <202104260507.13Q57BC4059117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Patrick Kelsey Subject: git: ca7005f1893d - main - iflib: Improve mapping of TX/RX queues to CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkelsey X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca7005f1893d199b7c28d5b159e1bdbb55e74543 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 05:07:11 -0000 The branch main has been updated by pkelsey: URL: https://cgit.FreeBSD.org/src/commit/?id=ca7005f1893d199b7c28d5b159e1bdbb55e74543 commit ca7005f1893d199b7c28d5b159e1bdbb55e74543 Author: Patrick Kelsey AuthorDate: 2021-04-26 04:25:59 +0000 Commit: Patrick Kelsey CommitDate: 2021-04-26 05:06:34 +0000 iflib: Improve mapping of TX/RX queues to CPUs iflib now supports mapping each (TX,RX) queue pair to the same CPU (default), to separate CPUs, or to a pair of physical and logical CPUs that share the same L2 cache. The mapping mechanism supports unequal numbers of TX and RX queues, with the excess queues always being mapped to consecutive physical CPUs. When the platform cannot distinguish between physical and logical CPUs, all are treated as physical CPUs. See the comment on get_cpuid_for_queue() for the entire matrix. The following device-specific tunables influence the mapping process: dev...iflib.core_offset (existing) dev...iflib.separate_txrx (existing) dev...iflib.use_logical_cores (new) The following new, read-only sysctls provide visibility of the mapping results: dev...iflib.{t,r}xq.cpu When an iflib driver allocates TX softirqs without providing reference RX IRQs, iflib now binds those TX softirqs to CPUs using the above mapping mechanism (that is, treats them as if they were TX IRQs). Previously, such bindings were left up to the grouptaskqueue code and thus fell outside of the iflib CPU mapping strategy. Reviewed by: kbowling Tested by: olivier, pkelsey MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D24094 --- sys/net/iflib.c | 454 +++++++++++++++++++++++++++++++++++-------------------- sys/sys/cpuset.h | 1 + 2 files changed, 294 insertions(+), 161 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index fc0814d0fc19..faf58917c96b 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -195,6 +195,8 @@ struct iflib_ctx { uint16_t ifc_sysctl_core_offset; #define CORE_OFFSET_UNSPECIFIED 0xffff uint8_t ifc_sysctl_separate_txrx; + uint8_t ifc_sysctl_use_logical_cores; + bool ifc_cpus_are_physical_cores; qidx_t ifc_sysctl_ntxds[8]; qidx_t ifc_sysctl_nrxds[8]; @@ -725,7 +727,7 @@ struct cpu_offset { SLIST_ENTRY(cpu_offset) entries; cpuset_t set; unsigned int refcount; - uint16_t offset; + uint16_t next_cpuid; }; static struct mtx cpu_offset_mtx; MTX_SYSINIT(iflib_cpu_offset, &cpu_offset_mtx, "iflib_cpu_offset lock", @@ -4682,41 +4684,291 @@ iflib_rem_pfil(if_ctx_t ctx) pfil_head_unregister(pfil); } + +/* + * Advance forward by n members of the cpuset ctx->ifc_cpus starting from + * cpuid and wrapping as necessary. + */ +static unsigned int +cpuid_advance(if_ctx_t ctx, unsigned int cpuid, unsigned int n) +{ + unsigned int first_valid; + unsigned int last_valid; + + /* cpuid should always be in the valid set */ + MPASS(CPU_ISSET(cpuid, &ctx->ifc_cpus)); + + /* valid set should never be empty */ + MPASS(!CPU_EMPTY(&ctx->ifc_cpus)); + + first_valid = CPU_FFS(&ctx->ifc_cpus) - 1; + last_valid = CPU_FLS(&ctx->ifc_cpus) - 1; + n = n % CPU_COUNT(&ctx->ifc_cpus); + while (n > 0) { + do { + cpuid++; + if (cpuid > last_valid) + cpuid = first_valid; + } while (!CPU_ISSET(cpuid, &ctx->ifc_cpus)); + n--; + } + + return (cpuid); +} + +#if defined(SMP) && defined(SCHED_ULE) +extern struct cpu_group *cpu_top; /* CPU topology */ + +static int +find_child_with_core(int cpu, struct cpu_group *grp) +{ + int i; + + if (grp->cg_children == 0) + return -1; + + MPASS(grp->cg_child); + for (i = 0; i < grp->cg_children; i++) { + if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask)) + return i; + } + + return -1; +} + + +/* + * Find an L2 neighbor of the given CPU or return -1 if none found. This + * does not distinguish among multiple L2 neighbors if the given CPU has + * more than one (it will always return the same result in that case). + */ +static int +find_l2_neighbor(int cpu) +{ + struct cpu_group *grp; + int i; + + grp = cpu_top; + if (grp == NULL) + return -1; + + /* + * Find the smallest CPU group that contains the given core. + */ + i = 0; + while ((i = find_child_with_core(cpu, grp)) != -1) { + /* + * If the smallest group containing the given CPU has less + * than two members, we conclude the given CPU has no + * L2 neighbor. + */ + if (grp->cg_child[i].cg_count <= 1) + return (-1); + grp = &grp->cg_child[i]; + } + + /* Must share L2. */ + if (grp->cg_level > CG_SHARE_L2 || grp->cg_level == CG_SHARE_NONE) + return -1; + + /* + * Select the first member of the set that isn't the reference + * CPU, which at this point is guaranteed to exist. + */ + for (i = 0; i < CPU_SETSIZE; i++) { + if (CPU_ISSET(i, &grp->cg_mask) && i != cpu) + return (i); + } + + /* Should never be reached */ + return (-1); +} + +#else +static int +find_l2_neighbor(int cpu) +{ + + return (-1); +} +#endif + +/* + * CPU mapping behaviors + * --------------------- + * 'separate txrx' refers to the separate_txrx sysctl + * 'use logical' refers to the use_logical_cores sysctl + * 'INTR CPUS' indicates whether bus_get_cpus(INTR_CPUS) succeeded + * + * separate use INTR + * txrx logical CPUS result + * ---------- --------- ------ ------------------------------------------------ + * - - X RX and TX queues mapped to consecutive physical + * cores with RX/TX pairs on same core and excess + * of either following + * - X X RX and TX queues mapped to consecutive cores + * of any type with RX/TX pairs on same core and + * excess of either following + * X - X RX and TX queues mapped to consecutive physical + * cores; all RX then all TX + * X X X RX queues mapped to consecutive physical cores + * first, then TX queues mapped to L2 neighbor of + * the corresponding RX queue if one exists, + * otherwise to consecutive physical cores + * - n/a - RX and TX queues mapped to consecutive cores of + * any type with RX/TX pairs on same core and excess + * of either following + * X n/a - RX and TX queues mapped to consecutive cores of + * any type; all RX then all TX + */ +static unsigned int +get_cpuid_for_queue(if_ctx_t ctx, unsigned int base_cpuid, unsigned int qid, + bool is_tx) +{ + if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + unsigned int core_index; + + if (ctx->ifc_sysctl_separate_txrx) { + /* + * When using separate CPUs for TX and RX, the assignment + * will always be of a consecutive CPU out of the set of + * context CPUs, except for the specific case where the + * context CPUs are phsyical cores, the use of logical cores + * has been enabled, the assignment is for TX, the TX qid + * corresponds to an RX qid, and the CPU assigned to the + * corresponding RX queue has an L2 neighbor. + */ + if (ctx->ifc_sysctl_use_logical_cores && + ctx->ifc_cpus_are_physical_cores && + is_tx && qid < scctx->isc_nrxqsets) { + int l2_neighbor; + unsigned int rx_cpuid; + + rx_cpuid = cpuid_advance(ctx, base_cpuid, qid); + l2_neighbor = find_l2_neighbor(rx_cpuid); + if (l2_neighbor != -1) { + return (l2_neighbor); + } + /* + * ... else fall through to the normal + * consecutive-after-RX assignment scheme. + * + * Note that we are assuming that all RX queue CPUs + * have an L2 neighbor, or all do not. If a mixed + * scenario is possible, we will have to keep track + * separately of how many queues prior to this one + * were not able to be assigned to an L2 neighbor. + */ + } + if (is_tx) + core_index = scctx->isc_nrxqsets + qid; + else + core_index = qid; + } else { + core_index = qid; + } + + return (cpuid_advance(ctx, base_cpuid, core_index)); +} + static uint16_t get_ctx_core_offset(if_ctx_t ctx) { if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; struct cpu_offset *op; - uint16_t qc; - uint16_t ret = ctx->ifc_sysctl_core_offset; + cpuset_t assigned_cpus; + unsigned int cores_consumed; + unsigned int base_cpuid = ctx->ifc_sysctl_core_offset; + unsigned int first_valid; + unsigned int last_valid; + unsigned int i; - if (ret != CORE_OFFSET_UNSPECIFIED) - return (ret); + first_valid = CPU_FFS(&ctx->ifc_cpus) - 1; + last_valid = CPU_FLS(&ctx->ifc_cpus) - 1; - if (ctx->ifc_sysctl_separate_txrx) - qc = scctx->isc_ntxqsets + scctx->isc_nrxqsets; - else - qc = max(scctx->isc_ntxqsets, scctx->isc_nrxqsets); + if (base_cpuid != CORE_OFFSET_UNSPECIFIED) { + /* + * Align the user-chosen base CPU ID to the next valid CPU + * for this device. If the chosen base CPU ID is smaller + * than the first valid CPU or larger than the last valid + * CPU, we assume the user does not know what the valid + * range is for this device and is thinking in terms of a + * zero-based reference frame, and so we shift the given + * value into the valid range (and wrap accordingly) so the + * intent is translated to the proper frame of reference. + * If the base CPU ID is within the valid first/last, but + * does not correspond to a valid CPU, it is advanced to the + * next valid CPU (wrapping if necessary). + */ + if (base_cpuid < first_valid || base_cpuid > last_valid) { + /* shift from zero-based to first_valid-based */ + base_cpuid += first_valid; + /* wrap to range [first_valid, last_valid] */ + base_cpuid = (base_cpuid - first_valid) % + (last_valid - first_valid + 1); + } + if (!CPU_ISSET(base_cpuid, &ctx->ifc_cpus)) { + /* + * base_cpuid is in [first_valid, last_valid], but + * not a member of the valid set. In this case, + * there will always be a member of the valid set + * with a CPU ID that is greater than base_cpuid, + * and we simply advance to it. + */ + while (!CPU_ISSET(base_cpuid, &ctx->ifc_cpus)) + base_cpuid++; + } + return (base_cpuid); + } + + /* + * Determine how many cores will be consumed by performing the CPU + * assignments and counting how many of the assigned CPUs correspond + * to CPUs in the set of context CPUs. This is done using the CPU + * ID first_valid as the base CPU ID, as the base CPU must be within + * the set of context CPUs. + * + * Note not all assigned CPUs will be in the set of context CPUs + * when separate CPUs are being allocated to TX and RX queues, + * assignment to logical cores has been enabled, the set of context + * CPUs contains only physical CPUs, and TX queues are mapped to L2 + * neighbors of CPUs that RX queues have been mapped to - in this + * case we do only want to count how many CPUs in the set of context + * CPUs have been consumed, as that determines the next CPU in that + * set to start allocating at for the next device for which + * core_offset is not set. + */ + CPU_ZERO(&assigned_cpus); + for (i = 0; i < scctx->isc_ntxqsets; i++) + CPU_SET(get_cpuid_for_queue(ctx, first_valid, i, true), + &assigned_cpus); + for (i = 0; i < scctx->isc_nrxqsets; i++) + CPU_SET(get_cpuid_for_queue(ctx, first_valid, i, false), + &assigned_cpus); + CPU_AND(&assigned_cpus, &ctx->ifc_cpus); + cores_consumed = CPU_COUNT(&assigned_cpus); mtx_lock(&cpu_offset_mtx); SLIST_FOREACH(op, &cpu_offsets, entries) { if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) { - ret = op->offset; - op->offset += qc; + base_cpuid = op->next_cpuid; + op->next_cpuid = cpuid_advance(ctx, op->next_cpuid, + cores_consumed); MPASS(op->refcount < UINT_MAX); op->refcount++; break; } } - if (ret == CORE_OFFSET_UNSPECIFIED) { - ret = 0; + if (base_cpuid == CORE_OFFSET_UNSPECIFIED) { + base_cpuid = first_valid; op = malloc(sizeof(struct cpu_offset), M_IFLIB, M_NOWAIT | M_ZERO); if (op == NULL) { device_printf(ctx->ifc_dev, "allocation for cpu offset failed.\n"); } else { - op->offset = qc; + op->next_cpuid = cpuid_advance(ctx, base_cpuid, + cores_consumed); op->refcount = 1; CPU_COPY(&ctx->ifc_cpus, &op->set); SLIST_INSERT_HEAD(&cpu_offsets, op, entries); @@ -4724,7 +4976,7 @@ get_ctx_core_offset(if_ctx_t ctx) } mtx_unlock(&cpu_offset_mtx); - return (ret); + return (base_cpuid); } static void @@ -4855,7 +5107,9 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct if (bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus) != 0) { device_printf(dev, "Unable to fetch CPU list\n"); CPU_COPY(&all_cpus, &ctx->ifc_cpus); - } + ctx->ifc_cpus_are_physical_cores = false; + } else + ctx->ifc_cpus_are_physical_cores = true; MPASS(CPU_COUNT(&ctx->ifc_cpus) > 0); /* @@ -5970,128 +6224,6 @@ iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, return (_iflib_irq_alloc(ctx, irq, rid, filter, handler, arg, name)); } -#ifdef SMP -static int -find_nth(if_ctx_t ctx, int qid) -{ - cpuset_t cpus; - int i, cpuid, eqid, count; - - CPU_COPY(&ctx->ifc_cpus, &cpus); - count = CPU_COUNT(&cpus); - eqid = qid % count; - /* clear up to the qid'th bit */ - for (i = 0; i < eqid; i++) { - cpuid = CPU_FFS(&cpus); - MPASS(cpuid != 0); - CPU_CLR(cpuid-1, &cpus); - } - cpuid = CPU_FFS(&cpus); - MPASS(cpuid != 0); - return (cpuid-1); -} - -#ifdef SCHED_ULE -extern struct cpu_group *cpu_top; /* CPU topology */ - -static int -find_child_with_core(int cpu, struct cpu_group *grp) -{ - int i; - - if (grp->cg_children == 0) - return -1; - - MPASS(grp->cg_child); - for (i = 0; i < grp->cg_children; i++) { - if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask)) - return i; - } - - return -1; -} - -/* - * Find the nth "close" core to the specified core - * "close" is defined as the deepest level that shares - * at least an L2 cache. With threads, this will be - * threads on the same core. If the shared cache is L3 - * or higher, simply returns the same core. - */ -static int -find_close_core(int cpu, int core_offset) -{ - struct cpu_group *grp; - int i; - int fcpu; - cpuset_t cs; - - grp = cpu_top; - if (grp == NULL) - return cpu; - i = 0; - while ((i = find_child_with_core(cpu, grp)) != -1) { - /* If the child only has one cpu, don't descend */ - if (grp->cg_child[i].cg_count <= 1) - break; - grp = &grp->cg_child[i]; - } - - /* If they don't share at least an L2 cache, use the same CPU */ - if (grp->cg_level > CG_SHARE_L2 || grp->cg_level == CG_SHARE_NONE) - return cpu; - - /* Now pick one */ - CPU_COPY(&grp->cg_mask, &cs); - - /* Add the selected CPU offset to core offset. */ - for (i = 0; (fcpu = CPU_FFS(&cs)) != 0; i++) { - if (fcpu - 1 == cpu) - break; - CPU_CLR(fcpu - 1, &cs); - } - MPASS(fcpu); - - core_offset += i; - - CPU_COPY(&grp->cg_mask, &cs); - for (i = core_offset % grp->cg_count; i > 0; i--) { - MPASS(CPU_FFS(&cs)); - CPU_CLR(CPU_FFS(&cs) - 1, &cs); - } - MPASS(CPU_FFS(&cs)); - return CPU_FFS(&cs) - 1; -} -#else -static int -find_close_core(int cpu, int core_offset __unused) -{ - return cpu; -} -#endif - -static int -get_core_offset(if_ctx_t ctx, iflib_intr_type_t type, int qid) -{ - switch (type) { - case IFLIB_INTR_TX: - /* TX queues get cores which share at least an L2 cache with the corresponding RX queue */ - /* XXX handle multiple RX threads per core and more than two core per L2 group */ - return qid / CPU_COUNT(&ctx->ifc_cpus) + 1; - case IFLIB_INTR_RX: - case IFLIB_INTR_RXTX: - /* RX queues get the specified core */ - return qid / CPU_COUNT(&ctx->ifc_cpus); - default: - return -1; - } -} -#else -#define get_core_offset(ctx, type, qid) CPU_FIRST() -#define find_close_core(cpuid, tid) CPU_FIRST() -#define find_nth(ctx, gid) CPU_FIRST() -#endif - /* Just to avoid copy/paste */ static inline int iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, @@ -6099,21 +6231,14 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, const char *name) { device_t dev; - int co, cpuid, err, tid; + unsigned int base_cpuid, cpuid; + int err; dev = ctx->ifc_dev; - co = ctx->ifc_sysctl_core_offset; - if (ctx->ifc_sysctl_separate_txrx && type == IFLIB_INTR_TX) - co += ctx->ifc_softc_ctx.isc_nrxqsets; - cpuid = find_nth(ctx, qid + co); - tid = get_core_offset(ctx, type, qid); - if (tid < 0) { - device_printf(dev, "get_core_offset failed\n"); - return (EOPNOTSUPP); - } - cpuid = find_close_core(cpuid, tid); - err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, dev, irq->ii_res, - name); + base_cpuid = ctx->ifc_sysctl_core_offset; + cpuid = get_cpuid_for_queue(ctx, base_cpuid, qid, type == IFLIB_INTR_TX); + err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, dev, + irq ? irq->ii_res : NULL, name); if (err) { device_printf(dev, "taskqgroup_attach_cpu failed %d\n", err); return (err); @@ -6202,8 +6327,8 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, return (0); if (tqrid != -1) { - err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, - q, name); + err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, q, + name); if (err) return (err); } else { @@ -6216,6 +6341,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, void iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, const char *name) { + device_t dev; struct grouptask *gtask; struct taskqgroup *tqg; gtask_fn_t *fn; @@ -6247,14 +6373,11 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, default: panic("unknown net intr type"); } - if (irq != NULL) { - err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, - q, name); - if (err) - taskqgroup_attach(tqg, gtask, q, ctx->ifc_dev, - irq->ii_res, name); - } else { - taskqgroup_attach(tqg, gtask, q, NULL, NULL, name); + err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, q, name); + if (err) { + dev = ctx->ifc_dev; + taskqgroup_attach(tqg, gtask, q, dev, irq ? irq->ii_res : NULL, + name); } } @@ -6736,6 +6859,9 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "separate_txrx", CTLFLAG_RDTUN, &ctx->ifc_sysctl_separate_txrx, 0, "use separate cores for TX and RX"); + SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "use_logical_cores", + CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, + "try to make use of logical cores for TX and RX"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", @@ -6780,6 +6906,9 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) queue_node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); + SYSCTL_ADD_INT(ctx_list, queue_list, OID_AUTO, "cpu", + CTLFLAG_RD, + &txq->ift_task.gt_cpu, 0, "cpu this queue is bound to"); #if MEMORY_LOGGING SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_dequeued", CTLFLAG_RD, @@ -6862,6 +6991,9 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) queue_node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); + SYSCTL_ADD_INT(ctx_list, queue_list, OID_AUTO, "cpu", + CTLFLAG_RD, + &rxq->ifr_task.gt_cpu, 0, "cpu this queue is bound to"); if (sctx->isc_flags & IFLIB_HAS_RXCQ) { SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_cidx", CTLFLAG_RD, diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index c48a0440d808..1a96bb4766ce 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -65,6 +65,7 @@ #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) +#define CPU_FLS(p) BIT_FLS(CPU_SETSIZE, p) #define CPU_COUNT(p) ((int)BIT_COUNT(CPU_SETSIZE, p)) #define CPUSET_FSET BITSET_FSET(_NCPUWORDS) #define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER From owner-dev-commits-src-main@freebsd.org Mon Apr 26 05:10:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 824B95F4E22; Mon, 26 Apr 2021 05:10: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 4FTCdH3KPTz4y5K; Mon, 26 Apr 2021 05:10: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 60AA5215A3; Mon, 26 Apr 2021 05:10: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 13Q5ABTn062936; Mon, 26 Apr 2021 05:10:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q5ABQH062929; Mon, 26 Apr 2021 05:10:11 GMT (envelope-from git) Date: Mon, 26 Apr 2021 05:10:11 GMT Message-Id: <202104260510.13Q5ABQH062929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 0f6bea61edb4 - main - e1000: Improve device name strings 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/main X-Git-Reftype: branch X-Git-Commit: 0f6bea61edb4d055fe6e340aab3685054a582020 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 05:10:11 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0f6bea61edb4d055fe6e340aab3685054a582020 commit 0f6bea61edb4d055fe6e340aab3685054a582020 Author: Kevin Bowling AuthorDate: 2021-04-21 05:27:48 +0000 Commit: Kevin Bowling CommitDate: 2021-04-26 05:08:54 +0000 e1000: Improve device name strings This is just clerical work to ease bug triage and may be used to set expectations around the ability for anyone in the community to perform testing and development on older parts (this driver covers over 20 years of silicon) Reviewed by: erj Approved by: markj Sponsored by: Pink Floyd - Any Colour You Like (in kind) Differential Revision: https://reviews.freebsd.org/D29872 --- sys/dev/e1000/if_em.c | 366 +++++++++++++++++++++++++------------------------- 1 file changed, 183 insertions(+), 183 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 6f711196c228..cd40d98819d0 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -51,195 +51,195 @@ char em_driver_version[] = "7.6.1-k"; static pci_vendor_info_t em_vendor_info_array[] = { - /* Intel(R) PRO/1000 Network Connection - Legacy em*/ - PVID(0x8086, E1000_DEV_ID_82540EM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82540EM_LOM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82540EP, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82540EP_LOM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82540EP_LP, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82541EI, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541ER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541ER_LOM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541EI_MOBILE, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541GI, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541GI_LF, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82541GI_MOBILE, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82542, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82543GC_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82543GC_COPPER, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82544EI_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82544EI_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82544GC_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82544GC_LOM, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82545EM_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82545EM_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82545GM_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82545GM_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82545GM_SERDES, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82546EB_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546EB_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546EB_QUAD_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_SERDES, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_PCIE, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3, "Intel(R) PRO/1000 Network Connection"), - - PVID(0x8086, E1000_DEV_ID_82547EI, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82547EI_MOBILE, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82547GI, "Intel(R) PRO/1000 Network Connection"), - - /* Intel(R) PRO/1000 Network Connection - em */ - PVID(0x8086, E1000_DEV_ID_82571EB_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_SERDES, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_SERDES_DUAL, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_SERDES_QUAD, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER_LP, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82571PT_QUAD_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82572EI, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82572EI_COPPER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82572EI_FIBER, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82572EI_SERDES, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82573E, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82573E_IAMT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82573L, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82583V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_SPT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_SPT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_DPT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_DPT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IGP_M_AMT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IGP_AMT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IGP_C, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IFE, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IFE_GT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IFE_G, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_IGP_M, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH8_82567V_3, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M_AMT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IGP_AMT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IGP_C, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IFE, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IFE_GT, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_IFE_G, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH9_BM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82574L, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_82574LA, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_LF, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_LF, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_M_HV_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_M_HV_LC, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_D_HV_DM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_D_HV_DC, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH2_LV_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH2_LV_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_LPT_I217_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_LPT_I217_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_LPTLP_I218_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_LPTLP_I218_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_I218_LM2, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_I218_V2, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_I218_LM3, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_I218_V3, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM6, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V6, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM7, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V7, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM8, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM10, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V10, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM11, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V11, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM12, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V12, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM13, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V13, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM14, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V14, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM15, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V15, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM16, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V16, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM17, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V17, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM18, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V18, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM19, "Intel(R) PRO/1000 Network Connection"), - PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V19, "Intel(R) PRO/1000 Network Connection"), + /* Intel(R) - lem-class legacy devices */ + PVID(0x8086, E1000_DEV_ID_82540EM, "Intel(R) Legacy PRO/1000 MT 82540EM"), + PVID(0x8086, E1000_DEV_ID_82540EM_LOM, "Intel(R) Legacy PRO/1000 MT 82540EM (LOM)"), + PVID(0x8086, E1000_DEV_ID_82540EP, "Intel(R) Legacy PRO/1000 MT 82540EP"), + PVID(0x8086, E1000_DEV_ID_82540EP_LOM, "Intel(R) Legacy PRO/1000 MT 82540EP (LOM)"), + PVID(0x8086, E1000_DEV_ID_82540EP_LP, "Intel(R) Legacy PRO/1000 MT 82540EP (Mobile)"), + + PVID(0x8086, E1000_DEV_ID_82541EI, "Intel(R) Legacy PRO/1000 MT 82541EI (Copper)"), + PVID(0x8086, E1000_DEV_ID_82541ER, "Intel(R) Legacy PRO/1000 82541ER"), + PVID(0x8086, E1000_DEV_ID_82541ER_LOM, "Intel(R) Legacy PRO/1000 MT 82541ER"), + PVID(0x8086, E1000_DEV_ID_82541EI_MOBILE, "Intel(R) Legacy PRO/1000 MT 82541EI (Mobile)"), + PVID(0x8086, E1000_DEV_ID_82541GI, "Intel(R) Legacy PRO/1000 MT 82541GI"), + PVID(0x8086, E1000_DEV_ID_82541GI_LF, "Intel(R) Legacy PRO/1000 GT 82541PI"), + PVID(0x8086, E1000_DEV_ID_82541GI_MOBILE, "Intel(R) Legacy PRO/1000 MT 82541GI (Mobile)"), + + PVID(0x8086, E1000_DEV_ID_82542, "Intel(R) Legacy PRO/1000 82542 (Fiber)"), + + PVID(0x8086, E1000_DEV_ID_82543GC_FIBER, "Intel(R) Legacy PRO/1000 F 82543GC (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82543GC_COPPER, "Intel(R) Legacy PRO/1000 T 82543GC (Copper)"), + + PVID(0x8086, E1000_DEV_ID_82544EI_COPPER, "Intel(R) Legacy PRO/1000 XT 82544EI (Copper)"), + PVID(0x8086, E1000_DEV_ID_82544EI_FIBER, "Intel(R) Legacy PRO/1000 XF 82544EI (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82544GC_COPPER, "Intel(R) Legacy PRO/1000 T 82544GC (Copper)"), + PVID(0x8086, E1000_DEV_ID_82544GC_LOM, "Intel(R) Legacy PRO/1000 XT 82544GC (LOM)"), + + PVID(0x8086, E1000_DEV_ID_82545EM_COPPER, "Intel(R) Legacy PRO/1000 MT 82545EM (Copper)"), + PVID(0x8086, E1000_DEV_ID_82545EM_FIBER, "Intel(R) Legacy PRO/1000 MF 82545EM (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82545GM_COPPER, "Intel(R) Legacy PRO/1000 MT 82545GM (Copper)"), + PVID(0x8086, E1000_DEV_ID_82545GM_FIBER, "Intel(R) Legacy PRO/1000 MF 82545GM (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82545GM_SERDES, "Intel(R) Legacy PRO/1000 MB 82545GM (SERDES)"), + + PVID(0x8086, E1000_DEV_ID_82546EB_COPPER, "Intel(R) Legacy PRO/1000 MT 82546EB (Copper)"), + PVID(0x8086, E1000_DEV_ID_82546EB_FIBER, "Intel(R) Legacy PRO/1000 MF 82546EB (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82546EB_QUAD_COPPER, "Intel(R) Legacy PRO/1000 MT 82546EB (Quad Copper"), + PVID(0x8086, E1000_DEV_ID_82546GB_COPPER, "Intel(R) Legacy PRO/1000 MT 82546GB (Copper)"), + PVID(0x8086, E1000_DEV_ID_82546GB_FIBER, "Intel(R) Legacy PRO/1000 MF 82546GB (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82546GB_SERDES, "Intel(R) Legacy PRO/1000 MB 82546GB (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82546GB_PCIE, "Intel(R) Legacy PRO/1000 P 82546GB (PCIe)"), + PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER, "Intel(R) Legacy PRO/1000 GT 82546GB (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3, "Intel(R) Legacy PRO/1000 GT 82546GB (Quad Copper)"), + + PVID(0x8086, E1000_DEV_ID_82547EI, "Intel(R) Legacy PRO/1000 CT 82547EI"), + PVID(0x8086, E1000_DEV_ID_82547EI_MOBILE, "Intel(R) Legacy PRO/1000 CT 82547EI (Mobile)"), + PVID(0x8086, E1000_DEV_ID_82547GI, "Intel(R) Legacy PRO/1000 CT 82547GI"), + + /* Intel(R) - em-class devices */ + PVID(0x8086, E1000_DEV_ID_82571EB_COPPER, "Intel(R) PRO/1000 PT 82571EB/82571GB (Copper)"), + PVID(0x8086, E1000_DEV_ID_82571EB_FIBER, "Intel(R) PRO/1000 PF 82571EB/82571GB (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82571EB_SERDES, "Intel(R) PRO/1000 PB 82571EB (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82571EB_SERDES_DUAL, "Intel(R) PRO/1000 82571EB (Dual Mezzanine)"), + PVID(0x8086, E1000_DEV_ID_82571EB_SERDES_QUAD, "Intel(R) PRO/1000 82571EB (Quad Mezzanine)"), + PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER, "Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_COPPER_LP, "Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82571EB_QUAD_FIBER, "Intel(R) PRO/1000 PF 82571EB (Quad Fiber)"), + PVID(0x8086, E1000_DEV_ID_82571PT_QUAD_COPPER, "Intel(R) PRO/1000 PT 82571PT (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82572EI, "Intel(R) PRO/1000 PT 82572EI (Copper)"), + PVID(0x8086, E1000_DEV_ID_82572EI_COPPER, "Intel(R) PRO/1000 PT 82572EI (Copper)"), + PVID(0x8086, E1000_DEV_ID_82572EI_FIBER, "Intel(R) PRO/1000 PF 82572EI (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82572EI_SERDES, "Intel(R) PRO/1000 82572EI (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82573E, "Intel(R) PRO/1000 82573E (Copper)"), + PVID(0x8086, E1000_DEV_ID_82573E_IAMT, "Intel(R) PRO/1000 82573E AMT (Copper)"), + PVID(0x8086, E1000_DEV_ID_82573L, "Intel(R) PRO/1000 82573L"), + PVID(0x8086, E1000_DEV_ID_82583V, "Intel(R) 82583V"), + PVID(0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_SPT, "Intel(R) 80003ES2LAN (Copper)"), + PVID(0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_SPT, "Intel(R) 80003ES2LAN (SERDES)"), + PVID(0x8086, E1000_DEV_ID_80003ES2LAN_COPPER_DPT, "Intel(R) 80003ES2LAN (Dual Copper)"), + PVID(0x8086, E1000_DEV_ID_80003ES2LAN_SERDES_DPT, "Intel(R) 80003ES2LAN (Dual SERDES)"), + PVID(0x8086, E1000_DEV_ID_ICH8_IGP_M_AMT, "Intel(R) 82566MM ICH8 AMT (Mobile)"), + PVID(0x8086, E1000_DEV_ID_ICH8_IGP_AMT, "Intel(R) 82566DM ICH8 AMT"), + PVID(0x8086, E1000_DEV_ID_ICH8_IGP_C, "Intel(R) 82566DC ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH8_IFE, "Intel(R) 82562V ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH8_IFE_GT, "Intel(R) 82562GT ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH8_IFE_G, "Intel(R) 82562G ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH8_IGP_M, "Intel(R) 82566MC ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH8_82567V_3, "Intel(R) 82567V-3 ICH8"), + PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M_AMT, "Intel(R) 82567LM ICH9 AMT"), + PVID(0x8086, E1000_DEV_ID_ICH9_IGP_AMT, "Intel(R) 82566DM-2 ICH9 AMT"), + PVID(0x8086, E1000_DEV_ID_ICH9_IGP_C, "Intel(R) 82566DC-2 ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M, "Intel(R) 82567LF ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_IGP_M_V, "Intel(R) 82567V ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_IFE, "Intel(R) 82562V-2 ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_IFE_GT, "Intel(R) 82562GT-2 ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_IFE_G, "Intel(R) 82562G-2 ICH9"), + PVID(0x8086, E1000_DEV_ID_ICH9_BM, "Intel(R) 82567LM-4 ICH9"), + PVID(0x8086, E1000_DEV_ID_82574L, "Intel(R) Gigabit CT 82574L"), + PVID(0x8086, E1000_DEV_ID_82574LA, "Intel(R) 82574L-Apple"), + PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_LM, "Intel(R) 82567LM-2 ICH10"), + PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_LF, "Intel(R) 82567LF-2 ICH10"), + PVID(0x8086, E1000_DEV_ID_ICH10_R_BM_V, "Intel(R) 82567V-2 ICH10"), + PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_LM, "Intel(R) 82567LM-3 ICH10"), + PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_LF, "Intel(R) 82567LF-3 ICH10"), + PVID(0x8086, E1000_DEV_ID_ICH10_D_BM_V, "Intel(R) 82567V-4 ICH10"), + PVID(0x8086, E1000_DEV_ID_PCH_M_HV_LM, "Intel(R) 82577LM"), + PVID(0x8086, E1000_DEV_ID_PCH_M_HV_LC, "Intel(R) 82577LC"), + PVID(0x8086, E1000_DEV_ID_PCH_D_HV_DM, "Intel(R) 82578DM"), + PVID(0x8086, E1000_DEV_ID_PCH_D_HV_DC, "Intel(R) 82578DC"), + PVID(0x8086, E1000_DEV_ID_PCH2_LV_LM, "Intel(R) 82579LM"), + PVID(0x8086, E1000_DEV_ID_PCH2_LV_V, "Intel(R) 82579V"), + PVID(0x8086, E1000_DEV_ID_PCH_LPT_I217_LM, "Intel(R) I217-LM LPT"), + PVID(0x8086, E1000_DEV_ID_PCH_LPT_I217_V, "Intel(R) I217-V LPT"), + PVID(0x8086, E1000_DEV_ID_PCH_LPTLP_I218_LM, "Intel(R) I218-LM LPTLP"), + PVID(0x8086, E1000_DEV_ID_PCH_LPTLP_I218_V, "Intel(R) I218-V LPTLP"), + PVID(0x8086, E1000_DEV_ID_PCH_I218_LM2, "Intel(R) I218-LM (2)"), + PVID(0x8086, E1000_DEV_ID_PCH_I218_V2, "Intel(R) I218-V (2)"), + PVID(0x8086, E1000_DEV_ID_PCH_I218_LM3, "Intel(R) I218-LM (3)"), + PVID(0x8086, E1000_DEV_ID_PCH_I218_V3, "Intel(R) I218-V (3)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM, "Intel(R) I219-LM SPT"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) I219-V SPT"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) I219-LM SPT-H(2)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) I219-V SPT-H(2)"), + PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) I219-LM LBG(3)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) I219-LM SPT(4)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) I219-V SPT(4)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) I219-LM SPT(5)"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) I219-V SPT(5)"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM6, "Intel(R) I219-LM CNP(6)"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V6, "Intel(R) I219-V CNP(6)"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM7, "Intel(R) I219-LM CNP(7)"), + PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V7, "Intel(R) I219-V CNP(7)"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM8, "Intel(R) I219-LM ICP(8)"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) I219-V ICP(8)"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) I219-LM ICP(9)"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) I219-V ICP(9)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM10, "Intel(R) I219-LM CMP(10)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V10, "Intel(R) I219-V CMP(10)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM11, "Intel(R) I219-LM CMP(11)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V11, "Intel(R) I219-V CMP(11)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM12, "Intel(R) I219-LM CMP(12)"), + PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V12, "Intel(R) I219-V CMP(12)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM13, "Intel(R) I219-LM TGP(13)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V13, "Intel(R) I219-V TGP(13)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM14, "Intel(R) I219-LM TGP(14)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V14, "Intel(R) I219-V GTP(14)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM15, "Intel(R) I219-LM TGP(15)"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V15, "Intel(R) I219-V TGP(15)"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM16, "Intel(R) I219-LM ADL(16)"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V16, "Intel(R) I219-V ADL(16)"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM17, "Intel(R) I219-LM ADL(17)"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V17, "Intel(R) I219-V ADL(17)"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM18, "Intel(R) I219-LM MTP(18)"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V18, "Intel(R) I219-V MTP(18)"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM19, "Intel(R) I219-LM MTP(19)"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V19, "Intel(R) I219-V MTP(19)"), /* required last entry */ PVID_END }; static pci_vendor_info_t igb_vendor_info_array[] = { - /* Intel(R) PRO/1000 Network Connection - igb */ - PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82575EB_FIBER_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82575GB_QUAD_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_NS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_NS_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_SERDES_QUAD, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_QUAD_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_QUAD_COPPER_ET2, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82576_VF, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_COPPER_DUAL, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_82580_QUAD_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_DH89XXCC_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_DH89XXCC_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_DH89XXCC_SFP, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_DH89XXCC_BACKPLANE, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I350_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I350_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I350_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I350_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I350_VF, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_COPPER_IT, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I211_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I354_BACKPLANE_1GBPS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS, "Intel(R) PRO/1000 PCI-Express Network Driver"), - PVID(0x8086, E1000_DEV_ID_I354_SGMII, "Intel(R) PRO/1000 PCI-Express Network Driver"), + /* Intel(R) - igb-class devices */ + PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 82575EB (Copper)"), + PVID(0x8086, E1000_DEV_ID_82575EB_FIBER_SERDES, "Intel(R) PRO/1000 82575EB (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82575GB_QUAD_COPPER, "Intel(R) PRO/1000 VT 82575GB (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82576, "Intel(R) PRO/1000 82576"), + PVID(0x8086, E1000_DEV_ID_82576_NS, "Intel(R) PRO/1000 82576NS"), + PVID(0x8086, E1000_DEV_ID_82576_NS_SERDES, "Intel(R) PRO/1000 82576NS (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82576_FIBER, "Intel(R) PRO/1000 EF 82576 (Dual Fiber)"), + PVID(0x8086, E1000_DEV_ID_82576_SERDES, "Intel(R) PRO/1000 82576 (Dual SERDES)"), + PVID(0x8086, E1000_DEV_ID_82576_SERDES_QUAD, "Intel(R) PRO/1000 ET 82576 (Quad SERDES)"), + PVID(0x8086, E1000_DEV_ID_82576_QUAD_COPPER, "Intel(R) PRO/1000 ET 82576 (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82576_QUAD_COPPER_ET2, "Intel(R) PRO/1000 ET(2) 82576 (Quad Copper)"), + PVID(0x8086, E1000_DEV_ID_82576_VF, "Intel(R) PRO/1000 82576 Virtual Function"), + PVID(0x8086, E1000_DEV_ID_82580_COPPER, "Intel(R) I340 82580 (Copper)"), + PVID(0x8086, E1000_DEV_ID_82580_FIBER, "Intel(R) I340 82580 (Fiber)"), + PVID(0x8086, E1000_DEV_ID_82580_SERDES, "Intel(R) I340 82580 (SERDES)"), + PVID(0x8086, E1000_DEV_ID_82580_SGMII, "Intel(R) I340 82580 (SGMII)"), + PVID(0x8086, E1000_DEV_ID_82580_COPPER_DUAL, "Intel(R) I340-T2 82580 (Dual Copper)"), + PVID(0x8086, E1000_DEV_ID_82580_QUAD_FIBER, "Intel(R) I340-F4 82580 (Quad Fiber)"), + PVID(0x8086, E1000_DEV_ID_DH89XXCC_SERDES, "Intel(R) DH89XXCC (SERDES)"), + PVID(0x8086, E1000_DEV_ID_DH89XXCC_SGMII, "Intel(R) I347-AT4 DH89XXCC"), + PVID(0x8086, E1000_DEV_ID_DH89XXCC_SFP, "Intel(R) DH89XXCC (SFP)"), + PVID(0x8086, E1000_DEV_ID_DH89XXCC_BACKPLANE, "Intel(R) DH89XXCC (Backplane)"), + PVID(0x8086, E1000_DEV_ID_I350_COPPER, "Intel(R) I350 (Copper)"), + PVID(0x8086, E1000_DEV_ID_I350_FIBER, "Intel(R) I350 (Fiber)"), + PVID(0x8086, E1000_DEV_ID_I350_SERDES, "Intel(R) I350 (SERDES)"), + PVID(0x8086, E1000_DEV_ID_I350_SGMII, "Intel(R) I350 (SGMII)"), + PVID(0x8086, E1000_DEV_ID_I350_VF, "Intel(R) I350 Virtual Function"), + PVID(0x8086, E1000_DEV_ID_I210_COPPER, "Intel(R) I210 (Copper)"), + PVID(0x8086, E1000_DEV_ID_I210_COPPER_IT, "Intel(R) I210 IT (Copper)"), + 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_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)"), + PVID(0x8086, E1000_DEV_ID_I211_COPPER, "Intel(R) I211 (Copper)"), + PVID(0x8086, E1000_DEV_ID_I354_BACKPLANE_1GBPS, "Intel(R) I354 (1.0 GbE Backplane)"), + PVID(0x8086, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS, "Intel(R) I354 (2.5 GbE Backplane)"), + PVID(0x8086, E1000_DEV_ID_I354_SGMII, "Intel(R) I354 (SGMII)"), /* required last entry */ PVID_END }; From owner-dev-commits-src-main@freebsd.org Mon Apr 26 07:24:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B99715F6ED9; Mon, 26 Apr 2021 07:24: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 4FTGc44vVGz53nT; Mon, 26 Apr 2021 07:24: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 9AE2423508; Mon, 26 Apr 2021 07:24: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 13Q7OKrN043485; Mon, 26 Apr 2021 07:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q7OKnn043484; Mon, 26 Apr 2021 07:24:20 GMT (envelope-from git) Date: Mon, 26 Apr 2021 07:24:20 GMT Message-Id: <202104260724.13Q7OKnn043484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 163153c2a080 - main - sctp: small cleanup, no functional change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 163153c2a0809d2710e607463dcb24c7f795e156 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 07:24:20 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=163153c2a0809d2710e607463dcb24c7f795e156 commit 163153c2a0809d2710e607463dcb24c7f795e156 Author: Michael Tuexen AuthorDate: 2021-04-26 00:56:48 +0000 Commit: Michael Tuexen CommitDate: 2021-04-26 00:56:48 +0000 sctp: small cleanup, no functional change MFC: 3 days --- sys/netinet/sctp_input.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 43a2b06d1c79..5b4c3152da0d 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -3412,19 +3412,16 @@ sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chu int len, clen; asoc = &stcb->asoc; - if (TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { - asoc->stream_reset_outstanding = 0; - return (NULL); - } - if (stcb->asoc.str_reset == NULL) { + chk = asoc->str_reset; + if (TAILQ_EMPTY(&asoc->control_send_queue) || + (chk == NULL)) { asoc->stream_reset_outstanding = 0; return (NULL); } - chk = stcb->asoc.str_reset; if (chk->data == NULL) { return (NULL); } - if (bchk) { + if (bchk != NULL) { /* he wants a copy of the chk pointer */ *bchk = chk; } From owner-dev-commits-src-main@freebsd.org Mon Apr 26 09:23:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C5C0D5F9EC9; Mon, 26 Apr 2021 09:23: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 4FTKFv57LHz58mm; Mon, 26 Apr 2021 09:23: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 A2DF5249FF; Mon, 26 Apr 2021 09:23: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 13Q9Nl36006066; Mon, 26 Apr 2021 09:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9Nl2X006065; Mon, 26 Apr 2021 09:23:47 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:23:47 GMT Message-Id: <202104260923.13Q9Nl2X006065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: cd17774d30c6 - main - rc: remove the 'addswap' script. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd17774d30c6cb70643c694ddf5a11f3c795dec8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:23:47 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=cd17774d30c6cb70643c694ddf5a11f3c795dec8 commit cd17774d30c6cb70643c694ddf5a11f3c795dec8 Author: Edward Tomasz Napierala AuthorDate: 2021-04-26 09:17:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-26 09:22:47 +0000 rc: remove the 'addswap' script. It's been unused since 268a55bc98b. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29749 --- ObsoleteFiles.inc | 3 +++ libexec/rc/rc.d/Makefile | 1 - libexec/rc/rc.d/addswap | 24 ------------------------ 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 6f4cf3e2b5da..4b66a3ecbb97 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210426: remove unused libexec/rc.d/addswap +OLD_FILES+=etc/rc.d/addswap + # 20210413: Remove pfctlinput2 OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 7b15cab40bb8..63dc17eceeaf 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -11,7 +11,6 @@ CONFS= DAEMON \ LOGIN \ NETWORKING \ SERVERS \ - addswap \ adjkerntz \ bgfsck \ ${_blacklistd} \ diff --git a/libexec/rc/rc.d/addswap b/libexec/rc/rc.d/addswap deleted file mode 100755 index 1758df8409a8..000000000000 --- a/libexec/rc/rc.d/addswap +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Add additional swap files -# -# $FreeBSD$ -# - -# PROVIDE: addswap -# REQUIRE: FILESYSTEMS kld -# BEFORE: netif -# KEYWORD: nojail shutdown - -. /etc/rc.subr - -name="addswap" -start_cmd=":" -stop_cmd=":" -rcvar= - -set_rcvar_obsolete swapfile -set_rcvar_obsolete geli_swap_flags - -load_rc_config $name -run_rc_command "$1" From owner-dev-commits-src-main@freebsd.org Mon Apr 26 12:28:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BF71C5FE751; Mon, 26 Apr 2021 12:28: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 4FTPLX51Nnz3KHJ; Mon, 26 Apr 2021 12:28: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 9AA5C27528; Mon, 26 Apr 2021 12:28: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 13QCS45W045562; Mon, 26 Apr 2021 12:28:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QCS4HQ045561; Mon, 26 Apr 2021 12:28:04 GMT (envelope-from git) Date: Mon, 26 Apr 2021 12:28:04 GMT Message-Id: <202104261228.13QCS4HQ045561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6fcc8e042ac4 - main - pf: Allow multiple labels to be set on a rule MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fcc8e042ac480f9276177339f7de1ad0f95c1b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 12:28:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6fcc8e042ac480f9276177339f7de1ad0f95c1b0 commit 6fcc8e042ac480f9276177339f7de1ad0f95c1b0 Author: Kristof Provost AuthorDate: 2021-04-20 09:04:48 +0000 Commit: Kristof Provost CommitDate: 2021-04-26 12:14:21 +0000 pf: Allow multiple labels to be set on a rule Allow up to 5 labels to be set on each rule. This offers more flexibility in using labels. For example, it replaces the customer 'schedule' keyword used by pfSense to terminate states according to a schedule. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29936 --- lib/libpfctl/libpfctl.c | 18 ++++++++-- lib/libpfctl/libpfctl.h | 2 +- sbin/pfctl/parse.y | 59 ++++++++++++++++++------------- sbin/pfctl/pfctl.c | 16 ++++++--- sbin/pfctl/pfctl_parser.c | 5 +-- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.h | 1 + sys/netpfil/pf/pf_ioctl.c | 55 ++++++++++++++++++++++++---- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 2 +- 9 files changed, 116 insertions(+), 44 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 86117268a9d0..024244d7bea8 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -301,7 +301,8 @@ static void pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) { const uint64_t *skip; - size_t skipcount; + const char *const *labels; + size_t skipcount, labelcount; rule->nr = nvlist_get_number(nvl, "nr"); @@ -314,7 +315,10 @@ pf_nvrule_to_rule(const nvlist_t *nvl, struct pfctl_rule *rule) for (int i = 0; i < PF_SKIP_COUNT; i++) rule->skip[i].nr = skip[i]; - strlcpy(rule->label, nvlist_get_string(nvl, "label"), PF_RULE_LABEL_SIZE); + labels = nvlist_get_string_array(nvl, "labels", &labelcount); + assert(labelcount <= PF_RULE_MAX_LABEL_COUNT); + for (size_t i = 0; i < labelcount; i++) + strlcpy(rule->label[i], labels[i], PF_RULE_LABEL_SIZE); strlcpy(rule->ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); strlcpy(rule->qname, nvlist_get_string(nvl, "qname"), PF_QNAME_SIZE); strlcpy(rule->pqname, nvlist_get_string(nvl, "pqname"), PF_QNAME_SIZE); @@ -404,6 +408,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, u_int64_t timeouts[PFTM_MAX]; u_int64_t set_prio[2]; nvlist_t *nvl, *nvlr; + size_t labelcount; int ret; nvl = nvlist_create(0); @@ -418,7 +423,14 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, pfctl_nv_add_rule_addr(nvlr, "src", &r->src); pfctl_nv_add_rule_addr(nvlr, "dst", &r->dst); - nvlist_add_string(nvlr, "label", r->label); + labelcount = 0; + while (r->label[labelcount][0] != 0 && + labelcount < PF_RULE_MAX_LABEL_COUNT) { + nvlist_append_string_array(nvlr, "labels", + r->label[labelcount]); + labelcount++; + } + nvlist_add_string(nvlr, "ifname", r->ifname); nvlist_add_string(nvlr, "qname", r->qname); nvlist_add_string(nvlr, "pqname", r->pqname); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 2c498189a6e4..e19187fc2526 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -53,7 +53,7 @@ struct pfctl_rule { struct pf_rule_addr src; struct pf_rule_addr dst; union pf_rule_ptr skip[PF_SKIP_COUNT]; - char label[PF_RULE_LABEL_SIZE]; + char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index e0314241eec3..6acfefbf5ad3 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -241,7 +242,8 @@ static struct filter_opts { } keep; int fragment; int allowopts; - char *label; + char *label[PF_RULE_MAX_LABEL_COUNT]; + int labelcount; struct node_qassign queues; char *tag; char *match_tag; @@ -256,7 +258,8 @@ static struct filter_opts { } filter_opts; static struct antispoof_opts { - char *label; + char *label[PF_RULE_MAX_LABEL_COUNT]; + int labelcount; u_int rtableid; } antispoof_opts; @@ -349,7 +352,7 @@ int expand_skip_interface(struct node_if *); int check_rulestate(int); int getservice(char *); -int rule_label(struct pfctl_rule *, char *); +int rule_label(struct pfctl_rule *, char *s[PF_RULE_MAX_LABEL_COUNT]); int rt_tableid_max(void); void mv_rules(struct pfctl_ruleset *, struct pfctl_ruleset *); @@ -887,7 +890,8 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.match_tag_not = $9.match_tag_not; if (rule_label(&r, $9.label)) YYERROR; - free($9.label); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + free($9.label[i]); r.flags = $9.flags.b1; r.flagset = $9.flags.b2; if (($9.flags.b1 & $9.flags.b2) != $9.flags.b1) { @@ -1333,7 +1337,8 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { } else free(hh); } - free($5.label); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + free($5.label[i]); } ; @@ -1374,11 +1379,11 @@ antispoof_opts_l : antispoof_opts_l antispoof_opt ; antispoof_opt : label { - if (antispoof_opts.label) { - yyerror("label cannot be redefined"); + if (antispoof_opts.labelcount >= PF_RULE_MAX_LABEL_COUNT) { + yyerror("label can only be used %d times", PF_RULE_MAX_LABEL_COUNT); YYERROR; } - antispoof_opts.label = $1; + antispoof_opts.label[antispoof_opts.labelcount++] = $1; } | RTABLE NUMBER { if ($2 < 0 || $2 > rt_tableid_max()) { @@ -2093,7 +2098,8 @@ pfrule : action dir logquick interface route af proto fromto r.match_tag_not = $9.match_tag_not; if (rule_label(&r, $9.label)) YYERROR; - free($9.label); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + free($9.label[i]); r.flags = $9.flags.b1; r.flagset = $9.flags.b2; if (($9.flags.b1 & $9.flags.b2) != $9.flags.b1) { @@ -2531,11 +2537,11 @@ filter_opt : USER uids { filter_opts.allowopts = 1; } | label { - if (filter_opts.label) { - yyerror("label cannot be redefined"); + if (filter_opts.labelcount >= PF_RULE_MAX_LABEL_COUNT) { + yyerror("label can only be used %d times", PF_RULE_MAX_LABEL_COUNT); YYERROR; } - filter_opts.label = $1; + filter_opts.label[filter_opts.labelcount++] = $1; } | qname { if (filter_opts.queues.qname) { @@ -5316,15 +5322,15 @@ expand_rule(struct pfctl_rule *r, sa_family_t af = r->af; int added = 0, error = 0; char ifname[IF_NAMESIZE]; - char label[PF_RULE_LABEL_SIZE]; + char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; char tagname[PF_TAG_NAME_SIZE]; char match_tagname[PF_TAG_NAME_SIZE]; struct pf_pooladdr *pa; struct node_host *h; u_int8_t flags, flagset, keep_state; - if (strlcpy(label, r->label, sizeof(label)) >= sizeof(label)) - errx(1, "expand_rule: strlcpy"); + memcpy(label, r->label, sizeof(r->label)); + assert(sizeof(r->label) == sizeof(label)); if (strlcpy(tagname, r->tagname, sizeof(tagname)) >= sizeof(tagname)) errx(1, "expand_rule: strlcpy"); if (strlcpy(match_tagname, r->match_tagname, sizeof(match_tagname)) >= @@ -5373,17 +5379,17 @@ expand_rule(struct pfctl_rule *r, else memset(r->ifname, '\0', sizeof(r->ifname)); - if (strlcpy(r->label, label, sizeof(r->label)) >= - sizeof(r->label)) - errx(1, "expand_rule: strlcpy"); + memcpy(r->label, label, sizeof(r->label)); if (strlcpy(r->tagname, tagname, sizeof(r->tagname)) >= sizeof(r->tagname)) errx(1, "expand_rule: strlcpy"); if (strlcpy(r->match_tagname, match_tagname, sizeof(r->match_tagname)) >= sizeof(r->match_tagname)) errx(1, "expand_rule: strlcpy"); - expand_label(r->label, PF_RULE_LABEL_SIZE, r->ifname, r->af, - src_host, src_port, dst_host, dst_port, proto->proto); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + expand_label(r->label[i], PF_RULE_LABEL_SIZE, + r->ifname, r->af, src_host, src_port, dst_host, + dst_port, proto->proto); expand_label(r->tagname, PF_TAG_NAME_SIZE, r->ifname, r->af, src_host, src_port, dst_host, dst_port, proto->proto); expand_label(r->match_tagname, PF_TAG_NAME_SIZE, r->ifname, @@ -6273,13 +6279,16 @@ getservice(char *n) } int -rule_label(struct pfctl_rule *r, char *s) +rule_label(struct pfctl_rule *r, char *s[PF_RULE_MAX_LABEL_COUNT]) { - if (s) { - if (strlcpy(r->label, s, sizeof(r->label)) >= - sizeof(r->label)) { + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) { + if (s[i] == NULL) + return (0); + + if (strlcpy(r->label[i], s[i], sizeof(r->label[0])) >= + sizeof(r->label[0])) { yyerror("rule label too long (max %d chars)", - sizeof(r->label)-1); + sizeof(r->label[0])-1); return (-1); } } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 82af047e7571..af2ae6fe3bf0 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -996,11 +996,18 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, goto error; switch (format) { - case PFCTL_SHOW_LABELS: - if (rule.label[0]) { - printf("%s %llu %llu %llu %llu" + case PFCTL_SHOW_LABELS: { + bool show = false; + int i = 0; + + while (rule.label[i][0]) { + printf("%s ", rule.label[i++]); + show = true; + } + + if (show) { + printf("%llu %llu %llu %llu" " %llu %llu %llu %ju\n", - rule.label, (unsigned long long)rule.evaluations, (unsigned long long)(rule.packets[0] + rule.packets[1]), @@ -1013,6 +1020,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, (uintmax_t)rule.states_tot); } break; + } case PFCTL_SHOW_RULES: brace = 0; if (rule.label[0] && (opts & PF_OPT_SHOWALL)) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 422e93460a43..282a0922bec7 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1019,8 +1019,9 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" fragment reassemble"); } - if (r->label[0]) - printf(" label \"%s\"", r->label); + i = 0; + while (r->label[i][0]) + printf(" label \"%s\"", r->label[i++]); if (r->qname[0] && r->pqname[0]) printf(" queue(%s, %s)", r->qname, r->pqname); else if (r->qname[0]) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3a79a281f916..5261bfe3bfb1 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -324,7 +324,7 @@ struct pf_krule { struct pf_rule_addr src; struct pf_rule_addr dst; union pf_krule_ptr skip[PF_SKIP_COUNT]; - char label[PF_RULE_LABEL_SIZE]; + char label[PF_RULE_MAX_LABEL_COUNT][PF_RULE_LABEL_SIZE]; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; char pqname[PF_QNAME_SIZE]; diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 4192b1a5bc95..6df1426c9e0c 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -450,6 +450,7 @@ struct pf_rule { #define PF_SKIP_COUNT 8 union pf_rule_ptr skip[PF_SKIP_COUNT]; #define PF_RULE_LABEL_SIZE 64 +#define PF_RULE_MAX_LABEL_COUNT 5 char label[PF_RULE_LABEL_SIZE]; char ifname[IFNAMSIZ]; char qname[PF_QNAME_SIZE]; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 6158a6c9b0c6..fa78c98eca19 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -992,7 +992,8 @@ pf_hash_rule(MD5_CTX *ctx, struct pf_krule *rule) pf_hash_rule_addr(ctx, &rule->src); pf_hash_rule_addr(ctx, &rule->dst); - PF_MD5_UPD_STR(rule, label); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) + PF_MD5_UPD_STR(rule, label[i]); PF_MD5_UPD_STR(rule, ifname); PF_MD5_UPD_STR(rule, match_tagname); PF_MD5_UPD_HTONS(rule, match_tag, x); /* dup? */ @@ -1556,7 +1557,7 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->skip[i].nr = krule->skip[i].ptr->nr; } - strlcpy(rule->label, krule->label, sizeof(rule->label)); + strlcpy(rule->label, krule->label[0], sizeof(rule->label)); strlcpy(rule->ifname, krule->ifname, sizeof(rule->ifname)); strlcpy(rule->qname, krule->qname, sizeof(rule->qname)); strlcpy(rule->pqname, krule->pqname, sizeof(rule->pqname)); @@ -1977,7 +1978,30 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), &rule->dst)); - PFNV_CHK(pf_nvstring(nvl, "label", rule->label, sizeof(rule->label))); + if (nvlist_exists_string(nvl, "label")) { + PFNV_CHK(pf_nvstring(nvl, "label", rule->label[0], + sizeof(rule->label[0]))); + } else if (nvlist_exists_string_array(nvl, "labels")) { + const char *const *strs; + size_t items; + int ret; + + strs = nvlist_get_string_array(nvl, "labels", &items); + if (items > PF_RULE_MAX_LABEL_COUNT) { + error = E2BIG; + goto errout; + } + + for (size_t i = 0; i < items; i++) { + ret = strlcpy(rule->label[i], strs[i], + sizeof(rule->label[0])); + if (ret >= sizeof(rule->label[0])) { + error = E2BIG; + goto errout; + } + } + } + PFNV_CHK(pf_nvstring(nvl, "ifname", rule->ifname, sizeof(rule->ifname))); PFNV_CHK(pf_nvstring(nvl, "qname", rule->qname, sizeof(rule->qname))); @@ -2151,7 +2175,10 @@ pf_krule_to_nvrule(const struct pf_krule *rule) rule->skip[i].ptr ? rule->skip[i].ptr->nr : -1); } - nvlist_add_string(nvl, "label", rule->label); + for (int i = 0; i < PF_RULE_MAX_LABEL_COUNT; i++) { + nvlist_append_string_array(nvl, "labels", rule->label[i]); + } + nvlist_add_string(nvl, "label", rule->label[0]); nvlist_add_string(nvl, "ifname", rule->ifname); nvlist_add_string(nvl, "qname", rule->qname); nvlist_add_string(nvl, "pqname", rule->pqname); @@ -2284,7 +2311,7 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) bcopy(&rule->src, &krule->src, sizeof(rule->src)); bcopy(&rule->dst, &krule->dst, sizeof(rule->dst)); - strlcpy(krule->label, rule->label, sizeof(rule->label)); + strlcpy(krule->label[0], rule->label, sizeof(rule->label)); strlcpy(krule->ifname, rule->ifname, sizeof(rule->ifname)); strlcpy(krule->qname, rule->qname, sizeof(rule->qname)); strlcpy(krule->pqname, rule->pqname, sizeof(rule->pqname)); @@ -2522,6 +2549,20 @@ errout_unlocked: return (error); } +static bool +pf_label_match(const struct pf_krule *rule, const char *label) +{ + int i = 0; + + while (*rule->label[i]) { + if (strcmp(rule->label[i], label) == 0) + return (true); + i++; + } + + return (false); +} + static int pf_killstates_row(struct pfioc_state_kill *psk, struct pf_idhash *ih) { @@ -2571,8 +2612,8 @@ relock_DIOCKILLSTATES: psk->psk_dst.port[0], psk->psk_dst.port[1], dstport)) continue; - if (psk->psk_label[0] && (! s->rule.ptr->label[0] || - strcmp(psk->psk_label, s->rule.ptr->label))) + if (psk->psk_label[0] && + ! pf_label_match(s->rule.ptr, psk->psk_label)) continue; if (psk->psk_ifname[0] && strcmp(psk->psk_ifname, diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 018f3751ca57..51d940f20c99 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1545,7 +1545,7 @@ pfl_scan_ruleset(const char *path) strlcpy(e->name, path, sizeof(e->name)); if (path[0]) strlcat(e->name, "/", sizeof(e->name)); - strlcat(e->name, rule.label, sizeof(e->name)); + strlcat(e->name, rule.label[0], sizeof(e->name)); e->evals = rule.evaluations; e->bytes[IN] = rule.bytes[IN]; From owner-dev-commits-src-main@freebsd.org Mon Apr 26 12:28:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D26745FE55C; Mon, 26 Apr 2021 12:28: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 4FTPLY5PB4z3KRl; Mon, 26 Apr 2021 12:28: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 AADEE27487; Mon, 26 Apr 2021 12:28: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 13QCS51u045583; Mon, 26 Apr 2021 12:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QCS5Y4045582; Mon, 26 Apr 2021 12:28:05 GMT (envelope-from git) Date: Mon, 26 Apr 2021 12:28:05 GMT Message-Id: <202104261228.13QCS5Y4045582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5632f585355a - main - pf tests: Test killing states with multiple labels MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5632f585355ad380cb9ef932c419e2efdb1fc46b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 12:28:05 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5632f585355ad380cb9ef932c419e2efdb1fc46b commit 5632f585355ad380cb9ef932c419e2efdb1fc46b Author: Kristof Provost AuthorDate: 2021-04-21 14:12:48 +0000 Commit: Kristof Provost CommitDate: 2021-04-26 12:14:21 +0000 pf tests: Test killing states with multiple labels Now that we support having multiple labels on a rule ensure that we can use each rule label to kill states. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29938 --- tests/sys/netpfil/pf/killstate.sh | 79 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index d54858d5452c..dddf844e6231 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -240,9 +240,88 @@ label_cleanup() pft_cleanup } +atf_test_case "multilabel" "cleanup" +multilabel_head() +{ + atf_set descr 'Test killing states with multiple labels by label' + atf_set require.user root + atf_set require.progs scapy +} + +multilabel_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "block all" \ + "pass in proto icmp label foo label bar" + + # Sanity check & establish state + # Note: use pft_ping so we always use the same ID, so pf considers all + # echo requests part of the same flow. + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Change rules to now deny the ICMP traffic + pft_set_rules noflush alcatraz "block all" + + # Established state means we can still ping alcatraz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing a label on a different rules keeps the state + jexec alcatraz pfctl -k label -k baz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing the state with the last label works + jexec alcatraz pfctl -k label -k bar + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + pft_set_rules alcatraz "block all" \ + "pass in proto icmp label foo label bar" + + # Reestablish state + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Change rules to now deny the ICMP traffic + pft_set_rules noflush alcatraz "block all" + + # Killing with the first label works too + jexec alcatraz pfctl -k label -k foo + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a +} + +multilabel_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" atf_add_test_case "label" + atf_add_test_case "multilabel" } From owner-dev-commits-src-main@freebsd.org Mon Apr 26 14:49:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5FBF95E30A8; Mon, 26 Apr 2021 14:49: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 4FTSV32GHMz3j2Z; Mon, 26 Apr 2021 14:49: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 40C561421; Mon, 26 Apr 2021 14:49: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 13QEnlDQ032408; Mon, 26 Apr 2021 14:49:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QEnlSJ032407; Mon, 26 Apr 2021 14:49:47 GMT (envelope-from git) Date: Mon, 26 Apr 2021 14:49:47 GMT Message-Id: <202104261449.13QEnlSJ032407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5f5bf88949df - main - pfsync: Expose PFSYNCF_OK flag to userspace MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f5bf88949df421ec3ccd7e14a999e8d8b9251bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 14:49:47 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f5bf88949df421ec3ccd7e14a999e8d8b9251bf commit 5f5bf88949df421ec3ccd7e14a999e8d8b9251bf Author: Kristof Provost AuthorDate: 2021-04-23 12:24:59 +0000 Commit: Kristof Provost CommitDate: 2021-04-26 12:31:17 +0000 pfsync: Expose PFSYNCF_OK flag to userspace Add 'syncok' field to ifconfig's pfsync interface output. This allows userspace to figure out when pfsync has completed the initial bulk import. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29948 --- sbin/ifconfig/ifpfsync.c | 5 ++++- sys/net/if_pfsync.h | 2 ++ sys/netpfil/pf/if_pfsync.c | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c index 6df38c1ac997..60e3d4360aa3 100644 --- a/sbin/ifconfig/ifpfsync.c +++ b/sbin/ifconfig/ifpfsync.c @@ -206,7 +206,10 @@ pfsync_status(int s) if (preq.pfsyncr_syncdev[0] != '\0' || preq.pfsyncr_syncpeer.s_addr != htonl(INADDR_PFSYNC_GROUP)) { printf("maxupd: %d ", preq.pfsyncr_maxupdates); - printf("defer: %s\n", preq.pfsyncr_defer ? "on" : "off"); + printf("defer: %s\n", + (preq.pfsyncr_defer & PFSYNCF_DEFER) ? "on" : "off"); + printf("\tsyncok: %d\n", + (preq.pfsyncr_defer & PFSYNCF_OK) ? 1 : 0); } } diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h index ccd26c9ac0de..1bf9934d3422 100644 --- a/sys/net/if_pfsync.h +++ b/sys/net/if_pfsync.h @@ -236,6 +236,8 @@ struct pfsyncreq { char pfsyncr_syncdev[IFNAMSIZ]; struct in_addr pfsyncr_syncpeer; int pfsyncr_maxupdates; +#define PFSYNCF_OK 0x00000001 +#define PFSYNCF_DEFER 0x00000002 int pfsyncr_defer; }; diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 06bad556e885..96813fd11dc3 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -215,8 +215,6 @@ struct pfsync_softc { struct ip_moptions sc_imo; struct in_addr sc_sync_peer; uint32_t sc_flags; -#define PFSYNCF_OK 0x00000001 -#define PFSYNCF_DEFER 0x00000002 uint8_t sc_maxupdates; struct ip sc_template; struct mtx sc_mtx; @@ -1375,8 +1373,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } pfsyncr.pfsyncr_syncpeer = sc->sc_sync_peer; pfsyncr.pfsyncr_maxupdates = sc->sc_maxupdates; - pfsyncr.pfsyncr_defer = (PFSYNCF_DEFER == - (sc->sc_flags & PFSYNCF_DEFER)); + pfsyncr.pfsyncr_defer = sc->sc_flags; PFSYNC_UNLOCK(sc); return (copyout(&pfsyncr, ifr_data_get_ptr(ifr), sizeof(pfsyncr))); From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:15:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A78FB5E40A0; Mon, 26 Apr 2021 15:15:55 +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 4FTT4C42fTz3kmd; Mon, 26 Apr 2021 15:15:55 +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 7D92E1926; Mon, 26 Apr 2021 15:15:55 +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 13QFFtHK072759; Mon, 26 Apr 2021 15:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFFt8H072758; Mon, 26 Apr 2021 15:15:55 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:15:55 GMT Message-Id: <202104261515.13QFFt8H072758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 057f145aae9a - main - linuxkpi: Implement the wait_event_interruptible macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 057f145aae9a3528ccd722c8f566d740d5cafcbb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:15:55 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=057f145aae9a3528ccd722c8f566d740d5cafcbb commit 057f145aae9a3528ccd722c8f566d740d5cafcbb Author: Neel Chauhan AuthorDate: 2021-04-26 15:12:18 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:12:18 +0000 linuxkpi: Implement the wait_event_interruptible macro This is needed by the drm-kmod 5.5 update and is similar in logic to the existing wait_event_killable macro. Reviewed by: hselasky, manu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29987 --- sys/compat/linuxkpi/common/include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/wait_bit.h b/sys/compat/linuxkpi/common/include/linux/wait_bit.h index e3dddaade498..711b19da6582 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait_bit.h +++ b/sys/compat/linuxkpi/common/include/linux/wait_bit.h @@ -40,6 +40,9 @@ extern wait_queue_head_t linux_var_waitq; #define wait_var_event_killable(var, cond) \ wait_event_killable(linux_var_waitq, cond) +#define wait_var_event_interruptible(var, cond) \ + wait_event_interruptible(linux_var_waitq, cond) + static inline void clear_and_wake_up_bit(int bit, void *word) { From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:15:57 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8882D5E4100; Mon, 26 Apr 2021 15:15: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 4FTT4D53v5z3kpc; Mon, 26 Apr 2021 15:15: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 A0BA31B25; Mon, 26 Apr 2021 15:15: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 13QFFuU5072780; Mon, 26 Apr 2021 15:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFFuFQ072779; Mon, 26 Apr 2021 15:15:56 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:15:56 GMT Message-Id: <202104261515.13QFFuFQ072779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: ce65353ac1a1 - main - linuxkpi: Implement atomic_dec_and_lock_irqsave() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce65353ac1a17677bef03e96df8da967c9086743 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:15:57 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ce65353ac1a17677bef03e96df8da967c9086743 commit ce65353ac1a17677bef03e96df8da967c9086743 Author: Neel Chauhan AuthorDate: 2021-04-26 15:15:49 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:15:49 +0000 linuxkpi: Implement atomic_dec_and_lock_irqsave() This is needed by the drm-kmod 5.5 update. Reviewed by: hselasky, manu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29988 --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 13 +++++++++++++ sys/sys/param.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 2309794b26ec..7ef474b671dc 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -31,6 +31,7 @@ #ifndef _LINUX_SPINLOCK_H_ #define _LINUX_SPINLOCK_H_ +#include #include #include #include @@ -160,4 +161,16 @@ spin_lock_destroy(spinlock_t *lock) mtx_assert(&(_l)->m, MA_OWNED); \ } while (0) +static inline int +atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, + unsigned long flags) +{ + spin_lock_irqsave(lock, flags); + if (atomic_dec_and_test(cnt)) { + return (1); + } + spin_unlock_irqrestore(lock, flags); + return (0); +} + #endif /* _LINUX_SPINLOCK_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index e4fdb272b7fe..4f80ad5972a4 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 1400010 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400011 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:16:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A032A5E3E6D; Mon, 26 Apr 2021 15:16: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 4FTT5B4DW5z3kkS; Mon, 26 Apr 2021 15:16: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 843B21927; Mon, 26 Apr 2021 15:16: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 13QFGkdO072951; Mon, 26 Apr 2021 15:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFGkjV072950; Mon, 26 Apr 2021 15:16:46 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:16:46 GMT Message-Id: <202104261516.13QFGkjV072950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: c8de6e20150a - main - linuxkpi: Elimiate brackets on return in spinlock.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8de6e20150a3c10575a27532a25b00342a7f452 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:16:46 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c8de6e20150a3c10575a27532a25b00342a7f452 commit c8de6e20150a3c10575a27532a25b00342a7f452 Author: Neel Chauhan AuthorDate: 2021-04-26 15:16:48 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:16:48 +0000 linuxkpi: Elimiate brackets on return in spinlock.h --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 7ef474b671dc..1ad8f8ff1aad 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -167,10 +167,10 @@ atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, { spin_lock_irqsave(lock, flags); if (atomic_dec_and_test(cnt)) { - return (1); + return 1; } spin_unlock_irqrestore(lock, flags); - return (0); + return 0; } #endif /* _LINUX_SPINLOCK_H_ */ From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:18:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DB5365E44A4; Mon, 26 Apr 2021 15:18:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.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 (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTT7G29FJz3l0v; Mon, 26 Apr 2021 15:18:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from amy (j1a01-1-78-205-69-41.fbx.proxad.net [78.205.69.41]) by mx.blih.net (OpenSMTPD) with ESMTPSA id a401260f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 26 Apr 2021 15:18:31 +0000 (UTC) Date: Mon, 26 Apr 2021 17:18:31 +0200 From: Emmanuel Vadot To: Neel Chauhan Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c8de6e20150a - main - linuxkpi: Elimiate brackets on return in spinlock.h Message-Id: <20210426171831.cb9961436fc128c91fe62b04@bidouilliste.com> In-Reply-To: <202104261516.13QFGkjV072950@gitrepo.freebsd.org> References: <202104261516.13QFGkjV072950@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FTT7G29FJz3l0v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:18:34 -0000 On Mon, 26 Apr 2021 15:16:46 GMT Neel Chauhan wrote: > The branch main has been updated by nc (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=c8de6e20150a3c10575a27532a25b00342a7f452 > > commit c8de6e20150a3c10575a27532a25b00342a7f452 > Author: Neel Chauhan > AuthorDate: 2021-04-26 15:16:48 +0000 > Commit: Neel Chauhan > CommitDate: 2021-04-26 15:16:48 +0000 > > linuxkpi: Elimiate brackets on return in spinlock.h > --- > sys/compat/linuxkpi/common/include/linux/spinlock.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h > index 7ef474b671dc..1ad8f8ff1aad 100644 > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > @@ -167,10 +167,10 @@ atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, > { > spin_lock_irqsave(lock, flags); > if (atomic_dec_and_test(cnt)) { > - return (1); > + return 1; > } > spin_unlock_irqrestore(lock, flags); > - return (0); > + return 0; > } > > #endif /* _LINUX_SPINLOCK_H_ */ That's not what Hans said, you didn't needed the brackets ('{' and '}') around the return (1); You need the parentesis around returns value. -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:23:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B15365E4A27; Mon, 26 Apr 2021 15:23:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTTDX4VrQz3lcG; Mon, 26 Apr 2021 15:23:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x22e.google.com with SMTP id l22so57211560ljc.9; Mon, 26 Apr 2021 08:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NyyohRAOZVU2LkctiIY2gyl87KepFLen2ZxRvkwayrM=; b=Qh+VnHCHYGegbvVKo4bqkCLBENXT0RvUeXn8U5wrzWSmQZQXt9oOsTV258z7NTjkv4 QOy6gHwrMWYMZ1mg25ovEko5pzfeuNYXrK32mjNaV7pMoOaYOjlUjtPbtNBrGggMGGh3 dVhLkNbCzvbGKS5FWdl3M94WUtRrVoxULtz2YBkr5BADFkIkb0v/gLIXoRXE1h5+3gfJ eMoPAPmTRQNOHUprLxbhKEKUzktckQ2S8/rbvQ+uz9DmipNbyWWom+iff+h0MnT7tEzU 1ixr7B6cdB4EmTwROaPhBDEmruHE4zjmeYmU3Ufo7C9aKvBZ+QDvQuJIEWJJ+lUYyYOD HBNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NyyohRAOZVU2LkctiIY2gyl87KepFLen2ZxRvkwayrM=; b=eOXOjOoJ3aR5faGIDaLqBWJJtVX6N+E6PCfdHcr63g9/Ud40mnUlTCtWIhdI89iset l5yyYJndndzAPI6q+hk4jBCUMlu7Cd1jRRtWp6YYVG/zBYp0tKfonzSWWfDHfG4wUykt tHPzEw62LFPnIQl5JaFwsC0tNvNJH563oYCWWtVkCdSN/o4z9ijpDJn3obysMOiCYBjI cdOM52xr29VmbXxDp/wqt88QMwsGvc2tYf0cXZ5Uxb0LBtP/IRx2iCAE31MYDPgoth3P F48v6hwa3rbbH8LToqGl7TJIlaGltIY2b5lK9sB6qEPWcJRAECYsXbnjamYKhNKuRHur Z1Xg== X-Gm-Message-State: AOAM533dW17GzoDYpEQ19s/QpDB0Avub3oLWMQZaQg8P1UFJQjNSh4uu egRVl9H6cirCyirok3Orn52K6/d7J1OgR8x6RW6u7Y/p X-Google-Smtp-Source: ABdhPJwuKsXjudoWnlPqJW1ztZ0GrOxJRX3hISKnrMnvAoy5k1hB5ZFh50w9AbkKiuquQFulGStvWeAnOgZXSnix/Ps= X-Received: by 2002:a05:651c:1245:: with SMTP id h5mr13474651ljh.499.1619450586581; Mon, 26 Apr 2021 08:23:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:651c:32e:0:0:0:0 with HTTP; Mon, 26 Apr 2021 08:23:05 -0700 (PDT) In-Reply-To: <202104261515.13QFFuFQ072779@gitrepo.freebsd.org> References: <202104261515.13QFFuFQ072779@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 26 Apr 2021 17:23:05 +0200 Message-ID: Subject: Re: git: ce65353ac1a1 - main - linuxkpi: Implement atomic_dec_and_lock_irqsave() To: Neel Chauhan Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4FTTDX4VrQz3lcG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:23:08 -0000 On 4/26/21, Neel Chauhan wrote: > The branch main has been updated by nc (ports committer): > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ce65353ac1a17677bef03e96df8da967c9086743 > > commit ce65353ac1a17677bef03e96df8da967c9086743 > Author: Neel Chauhan > AuthorDate: 2021-04-26 15:15:49 +0000 > Commit: Neel Chauhan > CommitDate: 2021-04-26 15:15:49 +0000 > > linuxkpi: Implement atomic_dec_and_lock_irqsave() > > This is needed by the drm-kmod 5.5 update. > > Reviewed by: hselasky, manu > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D29988 > --- > sys/compat/linuxkpi/common/include/linux/spinlock.h | 13 +++++++++++++ > sys/sys/param.h | 2 +- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h > b/sys/compat/linuxkpi/common/include/linux/spinlock.h > index 2309794b26ec..7ef474b671dc 100644 > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > @@ -31,6 +31,7 @@ > #ifndef _LINUX_SPINLOCK_H_ > #define _LINUX_SPINLOCK_H_ > > +#include > #include > #include > #include > @@ -160,4 +161,16 @@ spin_lock_destroy(spinlock_t *lock) > mtx_assert(&(_l)->m, MA_OWNED); \ > } while (0) > > +static inline int > +atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, > + unsigned long flags) > +{ > + spin_lock_irqsave(lock, flags); > + if (atomic_dec_and_test(cnt)) { > + return (1); > + } > + spin_unlock_irqrestore(lock, flags); > + return (0); > +} This is likely going to significantly reduce performance. The routine is only expected to grab the lock when transitioning the count to 0. iow, this wants a fcmpset loop akin to what can be found in refcount_release_if_gt > + > #endif /* _LINUX_SPINLOCK_H_ */ > diff --git a/sys/sys/param.h b/sys/sys/param.h > index e4fdb272b7fe..4f80ad5972a4 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 1400010 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1400011 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of > FreeBSD, > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Mon Apr 26 15:25:53 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5769D5E5062; Mon, 26 Apr 2021 15:25:53 +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 4FTTHj24tjz3lg8; Mon, 26 Apr 2021 15:25: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 39FC11C37; Mon, 26 Apr 2021 15:25:53 +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 13QFPrMH086312; Mon, 26 Apr 2021 15:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFPrbg086311; Mon, 26 Apr 2021 15:25:53 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:25:53 GMT Message-Id: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e657f3de6dc29147b5373d2cc2cc47e580931e30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:25:53 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e657f3de6dc29147b5373d2cc2cc47e580931e30 commit e657f3de6dc29147b5373d2cc2cc47e580931e30 Author: Neel Chauhan AuthorDate: 2021-04-26 15:25:33 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:25:33 +0000 linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 1ad8f8ff1aad..83f45b1a2a40 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -166,9 +166,8 @@ atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, unsigned long flags) { spin_lock_irqsave(lock, flags); - if (atomic_dec_and_test(cnt)) { + if (atomic_dec_and_test(cnt)) return 1; - } spin_unlock_irqrestore(lock, flags); return 0; } From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:08:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C577C5E6632; Mon, 26 Apr 2021 16:08: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 4FTVF65FHxz3nhB; Mon, 26 Apr 2021 16:08: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 A6E67248D; Mon, 26 Apr 2021 16:08: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 13QG8gWl039893; Mon, 26 Apr 2021 16:08:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QG8gvu039892; Mon, 26 Apr 2021 16:08:42 GMT (envelope-from git) Date: Mon, 26 Apr 2021 16:08:42 GMT Message-Id: <202104261608.13QG8gvu039892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 402dfb0a8d2c - main - pf: Fix parsing of long table names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 402dfb0a8d2c6417cb9bff4460ef250a42b0aa05 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:08:42 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=402dfb0a8d2c6417cb9bff4460ef250a42b0aa05 commit 402dfb0a8d2c6417cb9bff4460ef250a42b0aa05 Author: Kristof Provost AuthorDate: 2021-04-24 13:55:24 +0000 Commit: Kristof Provost CommitDate: 2021-04-26 16:08:15 +0000 pf: Fix parsing of long table names When parsing the nvlist for a struct pf_addr_wrap we unconditionally tried to parse "ifname". This broke for PF_ADDR_TABLE when the table name was longer than IFNAMSIZ. PF_TABLE_NAME_SIZE is longer than IFNAMSIZ, so this is a valid configuration. Only parse (or return) ifname or tblname for the corresponding pf_addr_wrap type. This manifested as a failure to set rules such as these, where the pfctl optimiser generated an automatic table: pass in proto tcp to 192.168.0.1 port ssh pass in proto tcp to 192.168.0.2 port ssh pass in proto tcp to 192.168.0.3 port ssh pass in proto tcp to 192.168.0.4 port ssh pass in proto tcp to 192.168.0.5 port ssh pass in proto tcp to 192.168.0.6 port ssh pass in proto tcp to 192.168.0.7 port ssh Reported by: Florian Smeets Tested by: Florian Smeets Reviewed by: donner X-MFC-With: 5c11c5a3655842a176124ef2334fcdf830422c8a MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29962 --- lib/libpfctl/libpfctl.c | 15 ++++++++++----- sys/netpfil/pf/pf_ioctl.c | 16 ++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 024244d7bea8..b07fcda9bd5a 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -148,8 +148,10 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, nvlist_add_number(nvl, "type", addr->type); nvlist_add_number(nvl, "iflags", addr->iflags); - nvlist_add_string(nvl, "ifname", addr->v.ifname); - nvlist_add_string(nvl, "tblname", addr->v.tblname); + if (addr->type == PF_ADDR_DYNIFTL) + nvlist_add_string(nvl, "ifname", addr->v.ifname); + if (addr->type == PF_ADDR_TABLE) + nvlist_add_string(nvl, "tblname", addr->v.tblname); pfctl_nv_add_addr(nvl, "addr", &addr->v.a.addr); pfctl_nv_add_addr(nvl, "mask", &addr->v.a.mask); @@ -161,9 +163,12 @@ pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) { addr->type = nvlist_get_number(nvl, "type"); addr->iflags = nvlist_get_number(nvl, "iflags"); - strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), - PF_TABLE_NAME_SIZE); + if (addr->type == PF_ADDR_DYNIFTL) + strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), + IFNAMSIZ); + if (addr->type == PF_ADDR_TABLE) + strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), + PF_TABLE_NAME_SIZE); pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), &addr->v.a.addr); pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), &addr->v.a.mask); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index fa78c98eca19..8176ac82a520 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1784,10 +1784,12 @@ pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) PFNV_CHK(pf_nvuint8(nvl, "type", &addr->type)); PFNV_CHK(pf_nvuint8(nvl, "iflags", &addr->iflags)); - PFNV_CHK(pf_nvstring(nvl, "ifname", addr->v.ifname, - sizeof(addr->v.ifname))); - PFNV_CHK(pf_nvstring(nvl, "tblname", addr->v.tblname, - sizeof(addr->v.tblname))); + if (addr->type == PF_ADDR_DYNIFTL) + PFNV_CHK(pf_nvstring(nvl, "ifname", addr->v.ifname, + sizeof(addr->v.ifname))); + if (addr->type == PF_ADDR_TABLE) + PFNV_CHK(pf_nvstring(nvl, "tblname", addr->v.tblname, + sizeof(addr->v.tblname))); if (! nvlist_exists_nvlist(nvl, "addr")) return (EINVAL); @@ -1827,8 +1829,10 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) nvlist_add_number(nvl, "type", addr->type); nvlist_add_number(nvl, "iflags", addr->iflags); - nvlist_add_string(nvl, "ifname", addr->v.ifname); - nvlist_add_string(nvl, "tblname", addr->v.tblname); + if (addr->type == PF_ADDR_DYNIFTL) + nvlist_add_string(nvl, "ifname", addr->v.ifname); + if (addr->type == PF_ADDR_TABLE) + nvlist_add_string(nvl, "tblname", addr->v.tblname); tmp = pf_addr_to_nvaddr(&addr->v.a.addr); if (tmp == NULL) From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:08:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E03C15E60EB; Mon, 26 Apr 2021 16:08: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 4FTVF75xNtz3nhC; Mon, 26 Apr 2021 16:08: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 BD2992350; Mon, 26 Apr 2021 16:08: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 13QG8hGC039914; Mon, 26 Apr 2021 16:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QG8hiT039913; Mon, 26 Apr 2021 16:08:43 GMT (envelope-from git) Date: Mon, 26 Apr 2021 16:08:43 GMT Message-Id: <202104261608.13QG8hiT039913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 08d77308211f - main - pf tests: Test automatically generated tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08d77308211f823b8532d27790e8fd29eaf75c77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:08:44 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=08d77308211f823b8532d27790e8fd29eaf75c77 commit 08d77308211f823b8532d27790e8fd29eaf75c77 Author: Kristof Provost AuthorDate: 2021-04-26 09:14:44 +0000 Commit: Kristof Provost CommitDate: 2021-04-26 16:08:15 +0000 pf tests: Test automatically generated tables Add a test case where the pfctl optimizer will generate a table automatically. These tables have long names, which we accidentally broke in the nvlist ADDRULE ioctl. Reviewed by: melifaro MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29989 --- tests/sys/netpfil/pf/table.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 9003f61ba189..5f23a2c82aa9 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -146,9 +146,47 @@ pr251414_cleanup() pft_cleanup } +atf_test_case "automatic" "cleanup" +automatic_head() +{ + atf_set descr "Test automatic - optimizer generated - tables" + atf_set require.user root +} + +automatic_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "block in" \ + "pass in proto icmp from 192.0.2.1" \ + "pass in proto icmp from 192.0.2.3" \ + "pass in proto icmp from 192.0.2.4" \ + "pass in proto icmp from 192.0.2.5" \ + "pass in proto icmp from 192.0.2.6" \ + "pass in proto icmp from 192.0.2.7" \ + "pass in proto icmp from 192.0.2.8" \ + "pass in proto icmp from 192.0.2.9" + + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 +} + +automatic_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" atf_add_test_case "v6_counters" atf_add_test_case "pr251414" + atf_add_test_case "automatic" } From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:32:30 2021 Return-Path: Delivered-To: dev-commits-src-main@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 25B575E6DF2; Mon, 26 Apr 2021 16: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 4FTVmZ0f4Kz3qV0; Mon, 26 Apr 2021 16:32: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 09357292D; Mon, 26 Apr 2021 16:32: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 13QGWTEG078980; Mon, 26 Apr 2021 16: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 13QGWTnj078979; Mon, 26 Apr 2021 16:32:29 GMT (envelope-from git) Date: Mon, 26 Apr 2021 16:32:29 GMT Message-Id: <202104261632.13QGWTnj078979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ba7b31b3e967 - main - e1000: Fix register name in reg_dump sysctl 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/main X-Git-Reftype: branch X-Git-Commit: ba7b31b3e967a57c0269330d4e5aacf541d1b479 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:32:30 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ba7b31b3e967a57c0269330d4e5aacf541d1b479 commit ba7b31b3e967a57c0269330d4e5aacf541d1b479 Author: Kevin Bowling AuthorDate: 2021-04-26 16:30:54 +0000 Commit: Kevin Bowling CommitDate: 2021-04-26 16:30:54 +0000 e1000: Fix register name in reg_dump sysctl The correct name of this register is CTRL_EXT. Approved by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29967 --- sys/dev/e1000/if_em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index cd40d98819d0..db022126844a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -653,7 +653,7 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "General Registers\n"); sbuf_printf(sb, "\tCTRL\t %08x\n", regs_buff[0]); sbuf_printf(sb, "\tSTATUS\t %08x\n", regs_buff[1]); - sbuf_printf(sb, "\tCTRL_EXIT\t %08x\n\n", regs_buff[2]); + sbuf_printf(sb, "\tCTRL_EXT\t %08x\n\n", regs_buff[2]); sbuf_printf(sb, "Interrupt Registers\n"); sbuf_printf(sb, "\tICR\t %08x\n\n", regs_buff[3]); From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:37:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6D5885E707B; Mon, 26 Apr 2021 16:37:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTVtM2k1pz3qK4; Mon, 26 Apr 2021 16:37:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D1F0B221B7; Mon, 26 Apr 2021 16:37:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 4b84b4cca472 - main - zfs: fix non-functional mismerges from vendor/openzfs To: Martin Matuska , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104260110.13Q1AGM6048050@gitrepo.freebsd.org> From: John Baldwin Message-ID: <074cf85d-0e00-44ad-1d0e-de4be849a481@FreeBSD.org> Date: Mon, 26 Apr 2021 09:37:26 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <202104260110.13Q1AGM6048050@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:37:31 -0000 On 4/25/21 6:10 PM, Martin Matuska wrote: > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4b84b4cca472e482bc22d5e5c7928be5a1393c84 > > commit 4b84b4cca472e482bc22d5e5c7928be5a1393c84 > Author: Martin Matuska > AuthorDate: 2021-04-26 01:05:13 +0000 > Commit: Martin Matuska > CommitDate: 2021-04-26 01:05:13 +0000 > > zfs: fix non-functional mismerges from vendor/openzfs > > - fix copyright in module/os/freebsd/spl/spl_acl.c Strictly speaking you broke the copyright. This line was explicitly dropped by the copyright holder: commit bce7ee9d412b6410e6d799c4a417617cbb148e09 Author: Edward Tomasz Napierala Date: Wed Oct 28 13:46:11 2020 +0000 Drop "All rights reserved" from all my stuff. This includes Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those people, feel free to make similar change. Reviewed by: emaste, imp, gbe (manpages) Differential Revision: https://reviews.freebsd.org/D26980 Notes: svn path=/head/; revision=367105 It is not ethical (and possibly not legal) to undo the copyright holder's explicit change. If you want to reduce the diff with upstream, then push this local change to remove this line upstream instead. Note that the original commit is in line with a recent-ish change in the Project's license policy to discourage the use of the "All rights reserved" line as antiquated and obsolete, and that it has been dropped from all of the Project's recommended license. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:47:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C481B5E7667 for ; Mon, 26 Apr 2021 16:47:48 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTW6D52Ccz3qjH for ; Mon, 26 Apr 2021 16:47:48 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2b.google.com with SMTP id t94so12454619ybi.3 for ; Mon, 26 Apr 2021 09:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qIso/IGesM5YWOI4ruHu69jBQlRV2Dpjr71o4oovUQM=; b=rrobfrRhuCN/4zNxbwRZ4Synai+4CaUpfl4VMybNEQnFaNGN066o+QGlw2az9Bq64T O/d0Wk5I/YxWPm3eDIx/ZjfXP4Pw/F5FWhb+cqX8ueNWt22tLQan2rRO6G2iTV2cEG3X f6tb5BwQLur/uxCE2C7JA3cf2FzSwrZHhcip8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qIso/IGesM5YWOI4ruHu69jBQlRV2Dpjr71o4oovUQM=; b=Q1+WviKZ2SxBmhP3bVfHEtHGd8yWP4wWskhnE7QqRZ92QC9kPl2gsAM64RPQc26xJk gJRToSpN8nZx03Pmm6y6BucXndH75RXiUCnuI0ea0ChN2A5yUZHgM5jTqdgtjNcEjHyk 88n/5koF5M4PvMD+kIO6Ixoyf5NLA2FkCFNRBkL0SUSgBXgcD35FEm0mqT6T4RuhJ8gy k6/zbb7XQCVPtwP4oFbh/yeThOMsqsRbboeCc/eVOnN4BSuogQHA5VCMLYN/rtHLp1xP 6IhRtDIB8xLpK6Nt+LYquwRWn0fp4OLek026OFnPKXoBOOX5+2YXRpPmUsnG+KHlLevr Emkw== X-Gm-Message-State: AOAM532bBIQFvadDmu2zpd2UqHW3++Ieu1BUvEhLI/5Xn/wiA5nmjIbj CiY9jtxJAQv8CW/f/aLuP6uM08Nf8oK+0TXPVY48dw== X-Google-Smtp-Source: ABdhPJynmr2MVtxFmvIEEJPM13zU51qdlI1p5Vk98xu132IGOyGEHPLzg3cw/L2tsptq3VmZC+LYBoOTSyNKperzAGc= X-Received: by 2002:a25:330a:: with SMTP id z10mr25996374ybz.123.1619455667716; Mon, 26 Apr 2021 09:47:47 -0700 (PDT) MIME-Version: 1.0 References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> In-Reply-To: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> From: Kevin Bowling Date: Mon, 26 Apr 2021 09:47:36 -0700 Message-ID: Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() To: Neel Chauhan Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4FTW6D52Ccz3qjH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:47:48 -0000 Hi Neel, I'm not sure all the context or conversation here but the convention is to not use bare return values, i.e in style(9) "Values in return statements should be enclosed in parentheses." and that's what was asked to be changed on this mailing list. Can you use and link to Phabricator for your src commits? As much as possible it is preferable to get it right in one go, for MFCs, bisection, etc and this kind of churn should be preventable with quick reviews. Feel free to tag me as a reviewer. Regards, Kevin On Mon, Apr 26, 2021 at 8:25 AM Neel Chauhan wrote: > > The branch main has been updated by nc (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=e657f3de6dc29147b5373d2cc2cc47e580931e30 > > commit e657f3de6dc29147b5373d2cc2cc47e580931e30 > Author: Neel Chauhan > AuthorDate: 2021-04-26 15:25:33 +0000 > Commit: Neel Chauhan > CommitDate: 2021-04-26 15:25:33 +0000 > > linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() > --- > sys/compat/linuxkpi/common/include/linux/spinlock.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h > index 1ad8f8ff1aad..83f45b1a2a40 100644 > --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h > +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h > @@ -166,9 +166,8 @@ atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, > unsigned long flags) > { > spin_lock_irqsave(lock, flags); > - if (atomic_dec_and_test(cnt)) { > + if (atomic_dec_and_test(cnt)) > return 1; > - } > spin_unlock_irqrestore(lock, flags); > return 0; > } > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:51:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 17A775E7A34; Mon, 26 Apr 2021 16:51: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 4FTWBw0BTpz3r9D; Mon, 26 Apr 2021 16:51: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 ED57E30CC; Mon, 26 Apr 2021 16:51: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 13QGppMD005956; Mon, 26 Apr 2021 16:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QGppqJ005955; Mon, 26 Apr 2021 16:51:51 GMT (envelope-from git) Date: Mon, 26 Apr 2021 16:51:51 GMT Message-Id: <202104261651.13QGppqJ005955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5eb9c93a20d7 - main - etcupdate: Add -D destdir to usage for 'extract'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5eb9c93a20d7320b24635ed09eba4908951bdeb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:51:52 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5eb9c93a20d7320b24635ed09eba4908951bdeb2 commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2 Author: John Baldwin AuthorDate: 2021-04-26 16:49:34 +0000 Commit: John Baldwin CommitDate: 2021-04-26 16:49:34 +0000 etcupdate: Add -D destdir to usage for 'extract'. Reported by: Mark Millard MFC after: 1 week --- usr.sbin/etcupdate/etcupdate.8 | 1 + usr.sbin/etcupdate/etcupdate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 5f13ed1d6733..3d48e218494c 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -60,6 +60,7 @@ .Op Fl B .Op Fl d Ar workdir .Op Fl s Ar source | Fl t Ar tarball +.Op Fl D Ar destdir .Op Fl L Ar logfile .Op Fl M Ar options .Nm diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 254a72abae08..acfc601b93af 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options] etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] - etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] - [-M options] + etcupdate extract [-B] [-d workdir] [-s source | -t tarball] + [-D destdir] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] From owner-dev-commits-src-main@freebsd.org Mon Apr 26 16:51:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1B15A5E7B8F; Mon, 26 Apr 2021 16:51:58 +0000 (UTC) (envelope-from nc@freebsd.org) Received: from rainpuddle.neelc.org (rainpuddle.neelc.org [IPv6:2001:19f0:8001:fed:5400:2ff:fe73:c622]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4FTWC16jNSz3rHK; Mon, 26 Apr 2021 16:51:57 +0000 (UTC) (envelope-from nc@freebsd.org) Received: from mail.neelc.org (rainpuddle.neelc.org [IPv6:2001:19f0:8001:fed:5400:2ff:fe73:c622]) by rainpuddle.neelc.org (Postfix) with ESMTPSA id 9CD84EB2BD; Mon, 26 Apr 2021 09:51:56 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 26 Apr 2021 09:51:56 -0700 From: Neel Chauhan To: Kevin Bowling Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() In-Reply-To: References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> X-Sender: nc@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FTWC16jNSz3rHK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:51:58 -0000 On 2021-04-26 09:47, Kevin Bowling wrote: > I'm not sure all the context or conversation here but the convention > is to not use bare return values, i.e in style(9) "Values in return > statements should be enclosed in parentheses." and that's what was > asked to be changed on this mailing list. The review: https://reviews.freebsd.org/D29988 I believe I was asked to do this in the review. -Neel > > Can you use and link to Phabricator for your src commits? As much as > possible it is preferable to get it right in one go, for MFCs, > bisection, etc and this kind of churn should be preventable with quick > reviews. Feel free to tag me as a reviewer. Sure, will do next time. > Regards, > Kevin -Neel From owner-dev-commits-src-main@freebsd.org Mon Apr 26 17:43:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9B4055E9D2A; Mon, 26 Apr 2021 17:43: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 4FTXM22BcDz3txh; Mon, 26 Apr 2021 17:43: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 3E2F63B22; Mon, 26 Apr 2021 17:43: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 13QHhwlr073060; Mon, 26 Apr 2021 17:43:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QHhwlp073059; Mon, 26 Apr 2021 17:43:58 GMT (envelope-from git) Date: Mon, 26 Apr 2021 17:43:58 GMT Message-Id: <202104261743.13QHhwlp073059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 099919b76dce - main - newbus: remove support for SINGLETON 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/main X-Git-Reftype: branch X-Git-Commit: 099919b76dce8ae118fea8bc950d2a7157a9c28b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 17:43:58 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=099919b76dce8ae118fea8bc950d2a7157a9c28b commit 099919b76dce8ae118fea8bc950d2a7157a9c28b Author: Warner Losh AuthorDate: 2021-04-26 17:04:15 +0000 Commit: Warner Losh CommitDate: 2021-04-26 17:41:08 +0000 newbus: remove support for SINGLETON Revert rest of de8dd262c43b since it's now unused. jhibbits@ introduced this to give powerpc MMU functions IFUNC like performance while retaining the kobj interface, speeding up operations 10-20%. Since there was only ever one instance of the mmu interface active at any given time, we could cache the looked up results more agressively. powerpc migrated to using IFUNCs to get an even larger performance boost in 45b69dd63e, deleting the two files it was added to in de8dd262c43b. However, there's few, if any, other potential applications of this to the tree today. It's now unused and undocumented. Retire it to eliminate this wart and to preclude the need to document it. Should a simmilar case arise in the future, the code is in git... Discusssed with: jhibbits@ Reviewed by: jhb@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29997 --- sys/tools/makeobjops.awk | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/tools/makeobjops.awk b/sys/tools/makeobjops.awk index c0fb8db10f3e..5a4ccf759960 100644 --- a/sys/tools/makeobjops.awk +++ b/sys/tools/makeobjops.awk @@ -325,18 +325,13 @@ function handle_method (static, doc) line_width, length(prototype))); } printh("{"); - if (singleton) - printh("\tstatic kobjop_t _m;"); - else - printh("\tkobjop_t _m;"); + printh("\tkobjop_t _m;"); if (ret != "void") printh("\t" ret " rc;"); if (!static) firstvar = "((kobj_t)" firstvar ")"; if (prolog != "") printh(prolog); - if (singleton) - printh("\tif (_m == NULL)"); printh("\tKOBJOPLOOKUP(" firstvar "->ops," mname ");"); rceq = (ret != "void") ? "rc = " : ""; printh("\t" rceq "((" mname "_t *) _m)(" varname_list ");"); @@ -458,7 +453,6 @@ for (file_i = 0; file_i < num_files; file_i++) { lastdoc = ""; prolog = ""; epilog = ""; - singleton = 0; while (!error && (getline < src) > 0) { lineno++; @@ -503,8 +497,6 @@ for (file_i = 0; file_i < num_files; file_i++) { prolog = handle_code(); else if (/^EPILOG[ ]*{$/) epilog = handle_code(); - else if (/^SINGLETON/) - singleton = 1; else { debug($0); warnsrc("Invalid line encountered"); From owner-dev-commits-src-main@freebsd.org Mon Apr 26 18:55:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5EA865EBDCE; Mon, 26 Apr 2021 18:55: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 4FTYxd25bpz4SN5; Mon, 26 Apr 2021 18:55: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 3657E4BC9; Mon, 26 Apr 2021 18:55: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 13QItXno065876; Mon, 26 Apr 2021 18:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QItX6x065875; Mon, 26 Apr 2021 18:55:33 GMT (envelope-from git) Date: Mon, 26 Apr 2021 18:55:33 GMT Message-Id: <202104261855.13QItX6x065875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 409ab7e109c6 - main - imgact_elf: Ensure that the return value in parse_notes is initialized 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/main X-Git-Reftype: branch X-Git-Commit: 409ab7e109c692014e3484a74af248dd7a4746e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 18:55:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=409ab7e109c692014e3484a74af248dd7a4746e8 commit 409ab7e109c692014e3484a74af248dd7a4746e8 Author: Mark Johnston AuthorDate: 2021-04-26 18:53:16 +0000 Commit: Mark Johnston CommitDate: 2021-04-26 18:53:16 +0000 imgact_elf: Ensure that the return value in parse_notes is initialized parse_notes relies on the caller-supplied callback to initialize "res". Two callbacks are used in practice, brandnote_cb and note_fctl_cb, and the latter fails to initialize res. Fix it. In the worst case, the bug would cause the inner loop of check_note to examine more program headers than necessary, and the note header usually comes last anyway. Reviewed by: kib Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29986 --- sys/kern/imgact_elf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 245894926ee1..c4aedbe6bbfa 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2736,6 +2736,7 @@ note_fctl_cb(const Elf_Note *note, void *arg0, boolean_t *res) desc = (const Elf32_Word *)p; *arg->has_fctl0 = TRUE; *arg->fctl0 = desc[0]; + *res = TRUE; return (TRUE); } From owner-dev-commits-src-main@freebsd.org Mon Apr 26 19:43:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A1D9C5EE20E; Mon, 26 Apr 2021 19:43: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 4FTb164CLFz4Vjp; Mon, 26 Apr 2021 19: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 834015534; Mon, 26 Apr 2021 19: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 13QJhcBa032625; Mon, 26 Apr 2021 19: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 13QJhcQU032624; Mon, 26 Apr 2021 19:43:38 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:43:38 GMT Message-Id: <202104261943.13QJhcQU032624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 09d83a060f37 - main - pkgbase: Remove package name mangling in generate-ucl.sh 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/main X-Git-Reftype: branch X-Git-Commit: 09d83a060f37ba17b29c0e90f3a0e9aa9c735592 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:43:38 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=09d83a060f37ba17b29c0e90f3a0e9aa9c735592 commit 09d83a060f37ba17b29c0e90f3a0e9aa9c735592 Author: Mark Johnston AuthorDate: 2021-04-26 19:15:31 +0000 Commit: Mark Johnston CommitDate: 2021-04-26 19:16:04 +0000 pkgbase: Remove package name mangling in generate-ucl.sh The mangling was present in the initial revision of the script, but its purpose is not clear. It may have been to avoid defining make(1) variables with a dash in the name, but this is permitted. Furthermore, it results in invalid dependency information if a dependency's name contains an underscore, causing e.g., libcompiler_rt-dev to depend on libcompiler-rt, and resulting in warnings when installing base system packages. Remove the mangling. Reviewed by: manu MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29883 --- release/packages/generate-ucl.sh | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 10d9d3162f9c..95a328d10637 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -31,7 +31,6 @@ main() { shift $(( ${OPTIND} - 1 )) - outname="$(echo ${outname} | tr '-' '_')" vital="false" case "${outname}" in @@ -52,33 +51,33 @@ main() { _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" vital="true" ;; - *_lib32_dev) - outname="${outname%%_lib32_dev}" + *-lib32_dev) + outname="${outname%%-lib32_dev}" _descr="32-bit Libraries, Development Files" pkgdeps="${outname}" ;; - *_lib32_dbg) - outname="${outname%%_lib32_dbg}" + *-lib32_dbg) + outname="${outname%%-lib32_dbg}" _descr="32-bit Libraries, Debugging Symbols" pkgdeps="${outname}" ;; - *_lib32) - outname="${outname%%_lib32}" + *-lib32) + outname="${outname%%-lib32}" _descr="32-bit Libraries" pkgdeps="${outname}" ;; - *_dev) - outname="${outname%%_dev}" + *-dev) + outname="${outname%%-dev}" _descr="Development Files" pkgdeps="${outname}" ;; - *_dbg) - outname="${outname%%_dbg}" + *-dbg) + outname="${outname%%-dbg}" _descr="Debugging Symbols" pkgdeps="${outname}" ;; - *_man) - outname="${outname%%_man}" + *-man) + outname="${outname%%-man}" _descr="Manual Pages" pkgdeps="${outname}" ;; @@ -91,10 +90,6 @@ main() { ;; esac - outname="${outname%%_*}" - - pkgdeps="$(echo ${pkgdeps} | tr '_' '-')" - desc="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESC)" comment="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_COMMENT)" From owner-dev-commits-src-main@freebsd.org Mon Apr 26 20:12:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 258B05EEFB4; Mon, 26 Apr 2021 20:12:34 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [144.76.20.103]) by mx1.freebsd.org (Postfix) with ESMTP id 4FTbfV03GKz4XW1; Mon, 26 Apr 2021 20:12:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 8B77037B8C; Mon, 26 Apr 2021 22:12:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id r7ZahabX58vw; Mon, 26 Apr 2021 22:12:27 +0200 (CEST) Received: from [10.0.7.122] (188-167-101-78.dynamic.chello.sk [188.167.101.78]) by mail.vx.sk (Postfix) with ESMTPSA id 458E237B8B; Mon, 26 Apr 2021 22:12:27 +0200 (CEST) To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104260110.13Q1AGM6048050@gitrepo.freebsd.org> <074cf85d-0e00-44ad-1d0e-de4be849a481@FreeBSD.org> From: Martin Matuska Subject: Re: git: 4b84b4cca472 - main - zfs: fix non-functional mismerges from vendor/openzfs Message-ID: <6b3eca71-95d3-fbcc-f876-106364558cdf@FreeBSD.org> Date: Mon, 26 Apr 2021 22:12:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <074cf85d-0e00-44ad-1d0e-de4be849a481@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Rspamd-Queue-Id: 4FTbfV03GKz4XW1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 20:12:34 -0000 Hi Johh, thank you very much for the notice. I am going submit the change=20 upstream to put this in sync. OpenZFS is now "the source" and this file is part of OpenZFS. We may=20 have local changes but the idea is to push to OpenZFS first, if not=20 absolutely necessary to have it in our tree first. If I as a copyright=20 holder write a webpage with open content and others may use my content,=20 it is unusual for a copyright holder to request changes on a derived=20 site and keep the original webpage unchanged. Martin On 26. 4. 2021 18:37, John Baldwin wrote: > On 4/25/21 6:10 PM, Martin Matuska wrote: >> The branch main has been updated by mm: >> >> URL:=20 >> https://cgit.FreeBSD.org/src/commit/?id=3D4b84b4cca472e482bc22d5e5c792= 8be5a1393c84 >> >> commit 4b84b4cca472e482bc22d5e5c7928be5a1393c84 >> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Martin Matuska >> AuthorDate: 2021-04-26 01:05:13 +0000 >> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Martin Matuska >> CommitDate: 2021-04-26 01:05:13 +0000 >> >> =C2=A0=C2=A0=C2=A0=C2=A0 zfs: fix non-functional mismerges from vendor= /openzfs >> =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 - fix copyright in m= odule/os/freebsd/spl/spl_acl.c > > Strictly speaking you broke the copyright. > > This line was explicitly dropped by the copyright holder: > > commit bce7ee9d412b6410e6d799c4a417617cbb148e09 > Author: Edward Tomasz Napierala > Date:=C2=A0=C2=A0 Wed Oct 28 13:46:11 2020 +0000 > > =C2=A0=C2=A0=C2=A0 Drop "All rights reserved" from all my stuff.=C2=A0 = This includes > =C2=A0=C2=A0=C2=A0 Foundation copyrights, approved by emaste@.=C2=A0 It= does not include > =C2=A0=C2=A0=C2=A0 files which carry other people's copyrights; if you'= re one > =C2=A0=C2=A0=C2=A0 of those people, feel free to make similar change. > =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 em= aste, imp, gbe (manpages) > =C2=A0=C2=A0=C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= =2Eorg/D26980 > > Notes: > =C2=A0=C2=A0=C2=A0 svn path=3D/head/; revision=3D367105 > > It is not ethical (and possibly not legal) to undo the copyright > holder's explicit change.=C2=A0 If you want to reduce the diff with > upstream, then push this local change to remove this line upstream > instead. > > Note that the original commit is in line with a recent-ish change > in the Project's license policy to discourage the use of the > "All rights reserved" line as antiquated and obsolete, and that > it has been dropped from all of the Project's recommended license. > From owner-dev-commits-src-main@freebsd.org Mon Apr 26 20:17:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C91075EF416; Mon, 26 Apr 2021 20:17: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 4FTbm15LtTz4XZj; Mon, 26 Apr 2021 20:17: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 AA7F75A6C; Mon, 26 Apr 2021 20:17: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 13QKHLPf073157; Mon, 26 Apr 2021 20:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QKHL69073156; Mon, 26 Apr 2021 20:17:21 GMT (envelope-from git) Date: Mon, 26 Apr 2021 20:17:21 GMT Message-Id: <202104262017.13QKHL69073156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 9f1dc86c46d6 - main - zfs: restore copyright disclaimer change from 4b84b4cca MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f1dc86c46d69d31a819fa150ce1d91fb987a61b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 20:17:21 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9f1dc86c46d69d31a819fa150ce1d91fb987a61b commit 9f1dc86c46d69d31a819fa150ce1d91fb987a61b Author: Martin Matuska AuthorDate: 2021-04-26 20:03:30 +0000 Commit: Martin Matuska CommitDate: 2021-04-26 20:16:50 +0000 zfs: restore copyright disclaimer change from 4b84b4cca The change will be pull-requested to upstream. X-MFC-with: 4b84b4cca472e482bc22d5e5c7928be5a1393c84 --- sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c index 18188ca0adec..74c26d03f87f 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c @@ -1,6 +1,5 @@ /* * Copyright (c) 2008, 2009 Edward Tomasz NapieraƂa - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-dev-commits-src-main@freebsd.org Mon Apr 26 20:27:09 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D67795EF6DE; Mon, 26 Apr 2021 20:27: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 4FTbzK5nNKz4Y7T; Mon, 26 Apr 2021 20:27: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 B94E85F1A; Mon, 26 Apr 2021 20:27: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 13QKR9PI086109; Mon, 26 Apr 2021 20:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QKR9DU086108; Mon, 26 Apr 2021 20:27:09 GMT (envelope-from git) Date: Mon, 26 Apr 2021 20:27:09 GMT Message-Id: <202104262027.13QKR9DU086108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: c70d1ef15db0 - main - sctp: improve handling of illegal packets containing INIT chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c70d1ef15db0d994eff4a2c4d9feabdc46bff1c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 20:27:09 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c70d1ef15db0d994eff4a2c4d9feabdc46bff1c6 commit c70d1ef15db0d994eff4a2c4d9feabdc46bff1c6 Author: Michael Tuexen AuthorDate: 2021-04-26 08:38:05 +0000 Commit: Michael Tuexen CommitDate: 2021-04-26 08:43:58 +0000 sctp: improve handling of illegal packets containing INIT chunks Stop further processing of a packet when detecting that it contains an INIT chunk, which is too small or is not the only chunk in the packet. Still allow to finish the processing of chunks before the INIT chunk. Thanks to Antoly Korniltsev and Taylor Brandstetter for reporting an issue with the userland stack, which made me aware of this issue. MFC after: 3 days --- sys/netinet/sctp_input.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 5b4c3152da0d..c70358f0af07 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4611,10 +4611,7 @@ process_control_chunks: chunk_buf); if (ch == NULL) { *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); + return (stcb); } num_chunks++; @@ -4648,12 +4645,12 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - /* RFC 4960 requires that no ABORT is sent */ + /* + * RFC 4960bis requires stopping the + * processing of the packet. + */ *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); + return (stcb); } /* Honor our resource limit. */ if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { From owner-dev-commits-src-main@freebsd.org Mon Apr 26 21:11:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 34E115F0E74; Mon, 26 Apr 2021 21:11: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 4FTcyW0rMqz4bL1; Mon, 26 Apr 2021 21:11: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 0F9E16637; Mon, 26 Apr 2021 21:11: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 13QLBUc0049832; Mon, 26 Apr 2021 21:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QLBUnx049831; Mon, 26 Apr 2021 21:11:30 GMT (envelope-from git) Date: Mon, 26 Apr 2021 21:11:30 GMT Message-Id: <202104262111.13QLBUnx049831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 43bbae19483f - main - cxgbe(4): Separate the sw- and hw-specific parts of resource allocations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43bbae19483fbde0a91e61acad8a6e71e334c8b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 21:11:31 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=43bbae19483fbde0a91e61acad8a6e71e334c8b8 commit 43bbae19483fbde0a91e61acad8a6e71e334c8b8 Author: Navdeep Parhar AuthorDate: 2021-04-26 21:03:06 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-26 21:09:59 +0000 cxgbe(4): Separate the sw- and hw-specific parts of resource allocations The driver uses both software resources (locks, callouts, memory for descriptors and for bookkeeping, sysctls, etc.) and hardware resources (VIs, DMA queues, TCAM entries, etc.) to operate the NIC. This commit splits the single *_ALLOCATED flag used to track all these resources into separate *_SW_ALLOCATED and *_HW_ALLOCATED flags. This is the simplified pseudocode that now applies to most queues (foo can be ctrlq/txq/rxq/ofld_txq/ofld_rxq): /* Idempotent */ alloc_foo { if (!SW_ALLOCATED) init_iq/init_eq/init_fl no-fail sw init alloc_iq_fl/alloc_eq/alloc_wrq may-fail sw alloc add_foo_sysctls, etc. no-fail post-alloc items if (!HW_ALLOCATED) alloc_iq_fl_hwq/alloc_eq_hwq hw resource allocation } /* Idempotent */ free_foo { if (!HW_ALLOCATED) free_iq_fl_hwq/free_eq_hwq release hw resources if (!SW_ALLOCATED) free_iq_fl/free_eq/free_wrq release sw resources } The routines that take the driver to FULL_INIT_DONE and VI_INIT_DONE and back are now all idempotent. The quiesce routines pay attention to the HW_ALLOCATED flag and will not wait on the hardware for pidx/cidx updates and other completions if this flag is not set. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 44 +- sys/dev/cxgbe/t4_filter.c | 9 +- sys/dev/cxgbe/t4_main.c | 376 +++++++---- sys/dev/cxgbe/t4_netmap.c | 11 +- sys/dev/cxgbe/t4_sched.c | 13 +- sys/dev/cxgbe/t4_sge.c | 1466 ++++++++++++++++++++++++----------------- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 +- 7 files changed, 1135 insertions(+), 786 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 7bdad292c752..10099fb47bc1 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -241,7 +241,13 @@ struct vi_info { struct mtx tick_mtx; struct callout tick; - struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */ + struct sysctl_ctx_list ctx; + struct sysctl_oid *rxq_oid; + struct sysctl_oid *txq_oid; + struct sysctl_oid *nm_rxq_oid; + struct sysctl_oid *nm_txq_oid; + struct sysctl_oid *ofld_rxq_oid; + struct sysctl_oid *ofld_txq_oid; uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; @@ -355,11 +361,12 @@ CTASSERT(sizeof(struct iq_desc) == IQ_ESIZE); enum { /* iq flags */ - IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ + IQ_SW_ALLOCATED = (1 << 0), /* sw resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ IQ_RX_TIMESTAMP = (1 << 2), /* provide the SGE rx timestamp */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ + IQ_HW_ALLOCATED = (1 << 5), /* fw/hw resources allocated */ /* iq state */ IQS_DISABLED = 0, @@ -403,12 +410,13 @@ struct sge_iq { int8_t intr_pktc_idx; /* packet count threshold index */ uint8_t gen; /* generation bit */ uint8_t intr_params; /* interrupt holdoff parameters */ - uint8_t intr_next; /* XXX: holdoff for next interrupt */ + int8_t cong; /* congestion settings */ uint16_t qsize; /* size (# of entries) of the queue */ uint16_t sidx; /* index of the entry with the status page */ uint16_t cidx; /* consumer index */ uint16_t cntxt_id; /* SGE context id for the iq */ uint16_t abs_id; /* absolute SGE id for the iq */ + int16_t intr_idx; /* interrupt used by the queue */ STAILQ_ENTRY(sge_iq) link; @@ -418,13 +426,14 @@ struct sge_iq { }; enum { + /* eq type */ EQ_CTRL = 1, EQ_ETH = 2, EQ_OFLD = 3, /* eq flags */ - EQ_TYPEMASK = 0x3, /* 2 lsbits hold the type (see above) */ - EQ_ALLOCATED = (1 << 2), /* firmware resources allocated */ + EQ_SW_ALLOCATED = (1 << 0), /* sw resources allocated */ + EQ_HW_ALLOCATED = (1 << 1), /* hw/fw resources allocated */ EQ_ENABLED = (1 << 3), /* open for business */ EQ_QFLUSH = (1 << 4), /* if_qflush in progress */ }; @@ -442,10 +451,12 @@ struct sge_eq { unsigned int flags; /* MUST be first */ unsigned int cntxt_id; /* SGE context id for the eq */ unsigned int abs_id; /* absolute SGE id for the eq */ + uint8_t type; /* EQ_CTRL/EQ_ETH/EQ_OFLD */ + uint8_t doorbells; + uint8_t tx_chan; /* tx channel used by the eq */ struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ - uint8_t doorbells; volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ u_int udb_qid; /* relative qid within the doorbell page */ uint16_t sidx; /* index of the entry with the status page */ @@ -453,9 +464,9 @@ struct sge_eq { uint16_t pidx; /* producer idx (desc idx) */ uint16_t equeqidx; /* EQUEQ last requested at this pidx */ uint16_t dbidx; /* pidx of the most recent doorbell */ - uint16_t iqid; /* iq that gets egr_update for the eq */ - uint8_t tx_chan; /* tx channel used by the eq */ + uint16_t iqid; /* cached iq->cntxt_id (see iq below) */ volatile u_int equiq; /* EQUIQ outstanding */ + struct sge_iq *iq; /* iq that receives egr_update for the eq */ bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -932,7 +943,9 @@ struct adapter { uint16_t iscsicaps; uint16_t fcoecaps; - struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ + struct sysctl_ctx_list ctx; + struct sysctl_oid *ctrlq_oid; + struct sysctl_oid *fwq_oid; struct mtx sc_lock; char lockname[16]; @@ -1211,10 +1224,8 @@ int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); void doom_vi(struct adapter *, struct vi_info *); void end_synchronized_op(struct adapter *, int); int update_mac_settings(struct ifnet *, int); -int adapter_full_init(struct adapter *); -int adapter_full_uninit(struct adapter *); -int vi_full_init(struct vi_info *); -int vi_full_uninit(struct vi_info *); +int adapter_init(struct adapter *); +int vi_init(struct vi_info *); void vi_sysctls(struct vi_info *); int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); int alloc_atid(struct adapter *, void *); @@ -1253,11 +1264,9 @@ struct sge_nm_rxq; void cxgbe_nm_attach(struct vi_info *); void cxgbe_nm_detach(struct vi_info *); void service_nm_rxq(struct sge_nm_rxq *); -int alloc_nm_rxq(struct vi_info *, struct sge_nm_rxq *, int, int, - struct sysctl_oid *); +int alloc_nm_rxq(struct vi_info *, struct sge_nm_rxq *, int, int); int free_nm_rxq(struct vi_info *, struct sge_nm_rxq *); -int alloc_nm_txq(struct vi_info *, struct sge_nm_txq *, int, int, - struct sysctl_oid *); +int alloc_nm_txq(struct vi_info *, struct sge_nm_txq *, int, int); int free_nm_txq(struct vi_info *, struct sge_nm_txq *); #endif @@ -1276,6 +1285,7 @@ int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *, bus_addr_t *, void **); int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t, void *); +void free_fl_buffers(struct adapter *, struct sge_fl *); int t4_setup_adapter_queues(struct adapter *); int t4_teardown_adapter_queues(struct adapter *); int t4_setup_vi_queues(struct vi_info *); diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index 3afab0d1d6b9..cddd2c96a620 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -960,11 +960,10 @@ set_filter(struct adapter *sc, struct t4_filter *t) rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setf"); if (rc) return (rc); - if (!(sc->flags & FULL_INIT_DONE) && - ((rc = adapter_full_init(sc)) != 0)) { - end_synchronized_op(sc, 0); - return (rc); - } + + if (!(sc->flags & FULL_INIT_DONE) && ((rc = adapter_init(sc)) != 0)) + goto done; + if (t->fs.hash) { if (__predict_false(ti->hftid_hash_4t == NULL)) { rc = alloc_hftid_hash(&sc->tids, HASH_NOWAIT); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 1650e15d16a0..9a2a256d5dd2 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -725,10 +725,15 @@ static int fixup_link_config(struct port_info *); static int apply_link_config(struct port_info *); static int cxgbe_init_synchronized(struct vi_info *); static int cxgbe_uninit_synchronized(struct vi_info *); -static void quiesce_txq(struct adapter *, struct sge_txq *); -static void quiesce_wrq(struct adapter *, struct sge_wrq *); -static void quiesce_iq(struct adapter *, struct sge_iq *); -static void quiesce_fl(struct adapter *, struct sge_fl *); +static int adapter_full_init(struct adapter *); +static void adapter_full_uninit(struct adapter *); +static int vi_full_init(struct vi_info *); +static void vi_full_uninit(struct vi_info *); +static int alloc_extra_vi(struct adapter *, struct port_info *, struct vi_info *); +static void quiesce_txq(struct sge_txq *); +static void quiesce_wrq(struct sge_wrq *); +static void quiesce_iq_fl(struct adapter *, struct sge_iq *, struct sge_fl *); +static void quiesce_vi(struct vi_info *); static int t4_alloc_irq(struct adapter *, struct irq *, int rid, driver_intr_t *, void *, char *); static int t4_free_irq(struct adapter *, struct irq *); @@ -1132,6 +1137,13 @@ t4_attach(device_t dev) refcount_init(&sc->vxlan_refcount, 0); + sc->ctrlq_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "ctrlq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "control queues"); + sc->fwq_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "fwq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "firmware event queue"); + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1429,6 +1441,7 @@ t4_attach(device_t dev) for_each_vi(pi, j, vi) { vi->pi = pi; vi->adapter = sc; + vi->first_intr = -1; vi->qsize_rxq = t4_qsize_rxq; vi->qsize_txq = t4_qsize_txq; @@ -1680,9 +1693,7 @@ t4_detach_common(device_t dev) } device_delete_children(dev); - - if (sc->flags & FULL_INIT_DONE) - adapter_full_uninit(sc); + adapter_full_uninit(sc); if ((sc->flags & (IS_VF | FW_OK)) == FW_OK) t4_fw_bye(sc, sc->mbox); @@ -1797,9 +1808,32 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) { struct ifnet *ifp; struct sbuf *sb; + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; struct pfil_head_args pa; struct adapter *sc = vi->adapter; + ctx = device_get_sysctl_ctx(vi->dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(vi->dev)); + vi->rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "rxq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NIC rx queues"); + vi->txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "txq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NIC tx queues"); +#ifdef DEV_NETMAP + vi->nm_rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "nm_rxq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "netmap rx queues"); + vi->nm_txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "nm_txq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "netmap tx queues"); +#endif +#ifdef TCP_OFFLOAD + vi->ofld_rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "ofld_rxq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TOE rx queues"); +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + vi->ofld_txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "ofld_txq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TOE/ETHOFLD tx queues"); +#endif + vi->xact_addr_filt = -1; mtx_init(&vi->tick_mtx, "vi tick", NULL, MTX_DEF); callout_init_mtx(&vi->tick, &vi->tick_mtx, 0); @@ -5536,12 +5570,10 @@ cxgbe_init_synchronized(struct vi_info *vi) if (ifp->if_drv_flags & IFF_DRV_RUNNING) return (0); /* already running */ - if (!(sc->flags & FULL_INIT_DONE) && - ((rc = adapter_full_init(sc)) != 0)) + if (!(sc->flags & FULL_INIT_DONE) && ((rc = adapter_init(sc)) != 0)) return (rc); /* error message displayed already */ - if (!(vi->flags & VI_INIT_DONE) && - ((rc = vi_full_init(vi)) != 0)) + if (!(vi->flags & VI_INIT_DONE) && ((rc = vi_init(vi)) != 0)) return (rc); /* error message displayed already */ rc = update_mac_settings(ifp, XGMAC_ALL); @@ -5836,31 +5868,36 @@ write_global_rss_key(struct adapter *sc) #endif } -int +/* + * Idempotent. + */ +static int adapter_full_init(struct adapter *sc) { int rc, i; ASSERT_SYNCHRONIZED_OP(sc); - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); - KASSERT((sc->flags & FULL_INIT_DONE) == 0, - ("%s: FULL_INIT_DONE already", __func__)); + + if (!(sc->flags & ADAP_SYSCTL_CTX)) { + sysctl_ctx_init(&sc->ctx); + sc->flags |= ADAP_SYSCTL_CTX; + } /* * queues that belong to the adapter (not any particular port). */ rc = t4_setup_adapter_queues(sc); if (rc != 0) - goto done; + return (rc); for (i = 0; i < nitems(sc->tq); i++) { + if (sc->tq[i] != NULL) + continue; sc->tq[i] = taskqueue_create("t4 taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->tq[i]); if (sc->tq[i] == NULL) { - device_printf(sc->dev, - "failed to allocate task queue %d\n", i); - rc = ENOMEM; - goto done; + CH_ERR(sc, "failed to allocate task queue %d\n", i); + return (ENOMEM); } taskqueue_start_threads(&sc->tq[i], 1, PI_NET, "%s tq%d", device_get_nameunit(sc->dev), i); @@ -5875,20 +5912,41 @@ adapter_full_init(struct adapter *sc) callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, C_HARDCLOCK); #endif - sc->flags |= FULL_INIT_DONE; -done: + return (0); +} + +int +adapter_init(struct adapter *sc) +{ + int rc; + + ASSERT_SYNCHRONIZED_OP(sc); + ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + KASSERT((sc->flags & FULL_INIT_DONE) == 0, + ("%s: FULL_INIT_DONE already", __func__)); + + rc = adapter_full_init(sc); if (rc != 0) adapter_full_uninit(sc); + else + sc->flags |= FULL_INIT_DONE; return (rc); } -int +/* + * Idempotent. + */ +static void adapter_full_uninit(struct adapter *sc) { int i; - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + /* Do this before freeing the adapter queues. */ + if (sc->flags & ADAP_SYSCTL_CTX) { + sysctl_ctx_free(&sc->ctx); + sc->flags &= ~ADAP_SYSCTL_CTX; + } t4_teardown_adapter_queues(sc); @@ -5898,8 +5956,6 @@ adapter_full_uninit(struct adapter *sc) } sc->flags &= ~FULL_INIT_DONE; - - return (0); } #ifdef RSS @@ -5967,12 +6023,13 @@ hashen_to_hashconfig(int hashen) } #endif -int +/* + * Idempotent. + */ +static int vi_full_init(struct vi_info *vi) { struct adapter *sc = vi->adapter; - struct ifnet *ifp = vi->ifp; - uint16_t *rss; struct sge_rxq *rxq; int rc, i, j; #ifdef RSS @@ -5982,59 +6039,60 @@ vi_full_init(struct vi_info *vi) #endif ASSERT_SYNCHRONIZED_OP(sc); - KASSERT((vi->flags & VI_INIT_DONE) == 0, - ("%s: VI_INIT_DONE already", __func__)); - sysctl_ctx_init(&vi->ctx); - vi->flags |= VI_SYSCTL_CTX; + if (!(vi->flags & VI_SYSCTL_CTX)) { + sysctl_ctx_init(&vi->ctx); + vi->flags |= VI_SYSCTL_CTX; + } /* * Allocate tx/rx/fl queues for this VI. */ rc = t4_setup_vi_queues(vi); if (rc != 0) - goto done; /* error message displayed already */ + return (rc); /* * Setup RSS for this VI. Save a copy of the RSS table for later use. */ if (vi->nrxq > vi->rss_size) { - if_printf(ifp, "nrxq (%d) > hw RSS table size (%d); " + CH_ALERT(vi, "nrxq (%d) > hw RSS table size (%d); " "some queues will never receive traffic.\n", vi->nrxq, vi->rss_size); } else if (vi->rss_size % vi->nrxq) { - if_printf(ifp, "nrxq (%d), hw RSS table size (%d); " + CH_ALERT(vi, "nrxq (%d), hw RSS table size (%d); " "expect uneven traffic distribution.\n", vi->nrxq, vi->rss_size); } #ifdef RSS if (vi->nrxq != nbuckets) { - if_printf(ifp, "nrxq (%d) != kernel RSS buckets (%d);" + CH_ALERT(vi, "nrxq (%d) != kernel RSS buckets (%d);" "performance will be impacted.\n", vi->nrxq, nbuckets); } #endif - rss = malloc(vi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK); + if (vi->rss == NULL) + vi->rss = malloc(vi->rss_size * sizeof (*vi->rss), M_CXGBE, + M_ZERO | M_WAITOK); for (i = 0; i < vi->rss_size;) { #ifdef RSS j = rss_get_indirection_to_bucket(i); j %= vi->nrxq; rxq = &sc->sge.rxq[vi->first_rxq + j]; - rss[i++] = rxq->iq.abs_id; + vi->rss[i++] = rxq->iq.abs_id; #else for_each_rxq(vi, j, rxq) { - rss[i++] = rxq->iq.abs_id; + vi->rss[i++] = rxq->iq.abs_id; if (i == vi->rss_size) break; } #endif } - rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss, - vi->rss_size); + rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, + vi->rss, vi->rss_size); if (rc != 0) { - free(rss, M_CXGBE); - if_printf(ifp, "rss_config failed: %d\n", rc); - goto done; + CH_ERR(vi, "rss_config failed: %d\n", rc); + return (rc); } #ifdef RSS @@ -6057,40 +6115,52 @@ vi_full_init(struct vi_info *vi) MPASS((extra & hashconfig) == 0); if (extra) { - if_printf(ifp, + CH_ALERT(vi, "global RSS config (0x%x) cannot be accommodated.\n", hashconfig); } if (extra & RSS_HASHTYPE_RSS_IPV4) - if_printf(ifp, "IPv4 2-tuple hashing forced on.\n"); + CH_ALERT(vi, "IPv4 2-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_TCP_IPV4) - if_printf(ifp, "TCP/IPv4 4-tuple hashing forced on.\n"); + CH_ALERT(vi, "TCP/IPv4 4-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_IPV6) - if_printf(ifp, "IPv6 2-tuple hashing forced on.\n"); + CH_ALERT(vi, "IPv6 2-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_TCP_IPV6) - if_printf(ifp, "TCP/IPv6 4-tuple hashing forced on.\n"); + CH_ALERT(vi, "TCP/IPv6 4-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_UDP_IPV4) - if_printf(ifp, "UDP/IPv4 4-tuple hashing forced on.\n"); + CH_ALERT(vi, "UDP/IPv4 4-tuple hashing forced on.\n"); if (extra & RSS_HASHTYPE_RSS_UDP_IPV6) - if_printf(ifp, "UDP/IPv6 4-tuple hashing forced on.\n"); + CH_ALERT(vi, "UDP/IPv6 4-tuple hashing forced on.\n"); #else vi->hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN; #endif - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, rss[0], 0, 0); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0], + 0, 0); if (rc != 0) { - free(rss, M_CXGBE); - if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc); - goto done; + CH_ERR(vi, "rss hash/defaultq config failed: %d\n", rc); + return (rc); } - vi->rss = rss; - vi->flags |= VI_INIT_DONE; -done: + return (0); +} + +int +vi_init(struct vi_info *vi) +{ + int rc; + + ASSERT_SYNCHRONIZED_OP(vi->adapter); + KASSERT((vi->flags & VI_INIT_DONE) == 0, + ("%s: VI_INIT_DONE already", __func__)); + + rc = vi_full_init(vi); if (rc != 0) vi_full_uninit(vi); + else + vi->flags |= VI_INIT_DONE; return (rc); } @@ -6098,118 +6168,149 @@ done: /* * Idempotent. */ -int +static void vi_full_uninit(struct vi_info *vi) { - struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; - int i; - struct sge_rxq *rxq; - struct sge_txq *txq; -#ifdef TCP_OFFLOAD - struct sge_ofld_rxq *ofld_rxq; -#endif -#if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct sge_ofld_txq *ofld_txq; -#endif if (vi->flags & VI_INIT_DONE) { - - /* Need to quiesce queues. */ - - /* XXX: Only for the first VI? */ - if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF)) - quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]); - - for_each_txq(vi, i, txq) { - quiesce_txq(sc, txq); - } - -#if defined(TCP_OFFLOAD) || defined(RATELIMIT) - for_each_ofld_txq(vi, i, ofld_txq) { - quiesce_wrq(sc, &ofld_txq->wrq); - } -#endif - - for_each_rxq(vi, i, rxq) { - quiesce_iq(sc, &rxq->iq); - quiesce_fl(sc, &rxq->fl); - } - -#ifdef TCP_OFFLOAD - for_each_ofld_rxq(vi, i, ofld_rxq) { - quiesce_iq(sc, &ofld_rxq->iq); - quiesce_fl(sc, &ofld_rxq->fl); - } -#endif + quiesce_vi(vi); free(vi->rss, M_CXGBE); free(vi->nm_rss, M_CXGBE); } + /* Do this before freeing the VI queues. */ + if (vi->flags & VI_SYSCTL_CTX) { + sysctl_ctx_free(&vi->ctx); + vi->flags &= ~VI_SYSCTL_CTX; + } + t4_teardown_vi_queues(vi); vi->flags &= ~VI_INIT_DONE; - - return (0); } static void -quiesce_txq(struct adapter *sc, struct sge_txq *txq) +quiesce_txq(struct sge_txq *txq) { struct sge_eq *eq = &txq->eq; struct sge_qstat *spg = (void *)&eq->desc[eq->sidx]; - (void) sc; /* unused */ - -#ifdef INVARIANTS - TXQ_LOCK(txq); - MPASS((eq->flags & EQ_ENABLED) == 0); - TXQ_UNLOCK(txq); -#endif + MPASS(eq->flags & EQ_SW_ALLOCATED); + MPASS(!(eq->flags & EQ_ENABLED)); /* Wait for the mp_ring to empty. */ while (!mp_ring_is_idle(txq->r)) { mp_ring_check_drainage(txq->r, 4096); pause("rquiesce", 1); } + MPASS(txq->txp.npkt == 0); - /* Then wait for the hardware to finish. */ - while (spg->cidx != htobe16(eq->pidx)) - pause("equiesce", 1); - - /* Finally, wait for the driver to reclaim all descriptors. */ - while (eq->cidx != eq->pidx) - pause("dquiesce", 1); + if (eq->flags & EQ_HW_ALLOCATED) { + /* + * Hardware is alive and working normally. Wait for it to + * finish and then wait for the driver to catch up and reclaim + * all descriptors. + */ + while (spg->cidx != htobe16(eq->pidx)) + pause("equiesce", 1); + while (eq->cidx != eq->pidx) + pause("dquiesce", 1); + } else { + /* + * Hardware is unavailable. Discard all pending tx and reclaim + * descriptors directly. + */ + TXQ_LOCK(txq); + while (eq->cidx != eq->pidx) { + struct mbuf *m, *nextpkt; + struct tx_sdesc *txsd; + + txsd = &txq->sdesc[eq->cidx]; + for (m = txsd->m; m != NULL; m = nextpkt) { + nextpkt = m->m_nextpkt; + m->m_nextpkt = NULL; + m_freem(m); + } + IDXINCR(eq->cidx, txsd->desc_used, eq->sidx); + } + spg->pidx = spg->cidx = htobe16(eq->cidx); + TXQ_UNLOCK(txq); + } } static void -quiesce_wrq(struct adapter *sc, struct sge_wrq *wrq) +quiesce_wrq(struct sge_wrq *wrq) { /* XXXTX */ } static void -quiesce_iq(struct adapter *sc, struct sge_iq *iq) +quiesce_iq_fl(struct adapter *sc, struct sge_iq *iq, struct sge_fl *fl) { - (void) sc; /* unused */ - /* Synchronize with the interrupt handler */ while (!atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_DISABLED)) pause("iqfree", 1); + + if (fl != NULL) { + MPASS(iq->flags & IQ_HAS_FL); + + mtx_lock(&sc->sfl_lock); + FL_LOCK(fl); + fl->flags |= FL_DOOMED; + FL_UNLOCK(fl); + callout_stop(&sc->sfl_callout); + mtx_unlock(&sc->sfl_lock); + + KASSERT((fl->flags & FL_STARVING) == 0, + ("%s: still starving", __func__)); + + /* Release all buffers if hardware is no longer available. */ + if (!(iq->flags & IQ_HW_ALLOCATED)) + free_fl_buffers(sc, fl); + } } +/* + * Wait for all activity on all the queues of the VI to complete. It is assumed + * that no new work is being enqueued by the hardware or the driver. That part + * should be arranged before calling this function. + */ static void -quiesce_fl(struct adapter *sc, struct sge_fl *fl) +quiesce_vi(struct vi_info *vi) { - mtx_lock(&sc->sfl_lock); - FL_LOCK(fl); - fl->flags |= FL_DOOMED; - FL_UNLOCK(fl); - callout_stop(&sc->sfl_callout); - mtx_unlock(&sc->sfl_lock); + int i; + struct adapter *sc = vi->adapter; + struct sge_rxq *rxq; + struct sge_txq *txq; +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct sge_ofld_txq *ofld_txq; +#endif + + if (!(vi->flags & VI_INIT_DONE)) + return; + + for_each_txq(vi, i, txq) { + quiesce_txq(txq); + } + +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + for_each_ofld_txq(vi, i, ofld_txq) { + quiesce_wrq(&ofld_txq->wrq); + } +#endif - KASSERT((fl->flags & FL_STARVING) == 0, - ("%s: still starving", __func__)); + for_each_rxq(vi, i, rxq) { + quiesce_iq_fl(sc, &rxq->iq, &rxq->fl); + } + +#ifdef TCP_OFFLOAD + for_each_ofld_rxq(vi, i, ofld_rxq) { + quiesce_iq_fl(sc, &ofld_rxq->iq, &ofld_rxq->fl); + } +#endif } static int @@ -11125,16 +11226,11 @@ toe_capability(struct vi_info *vi, bool enable) * and receive CPLs to/from the TOE even if the ifnet for this * port has never been UP'd administratively. */ - if (!(vi->flags & VI_INIT_DONE)) { - rc = vi_full_init(vi); - if (rc) - return (rc); - } - if (!(pi->vi[0].flags & VI_INIT_DONE)) { - rc = vi_full_init(&pi->vi[0]); - if (rc) - return (rc); - } + if (!(vi->flags & VI_INIT_DONE) && ((rc = vi_init(vi)) != 0)) + return (rc); + if (!(pi->vi[0].flags & VI_INIT_DONE) && + ((rc = vi_init(&pi->vi[0])) != 0)) + return (rc); if (isset(&sc->offload_map, pi->port_id)) { /* TOE is enabled on another VI of this port. */ @@ -11245,7 +11341,7 @@ t4_activate_uld(struct adapter *sc, int id) SLIST_FOREACH(ui, &t4_uld_list, link) { if (ui->uld_id == id) { if (!(sc->flags & FULL_INIT_DONE)) { - rc = adapter_full_init(sc); + rc = adapter_init(sc); if (rc != 0) break; } diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 6078dd89829d..8c5b9f500661 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -125,9 +125,10 @@ static int free_nm_txq_hwq(struct vi_info *, struct sge_nm_txq *); int alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int intr_idx, - int idx, struct sysctl_oid *oid) + int idx) { int rc; + struct sysctl_oid *oid; struct sysctl_oid_list *children; struct sysctl_ctx_list *ctx; char name[16]; @@ -161,7 +162,7 @@ alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int intr_idx, nm_rxq->iq_cntxt_id = INVALID_NM_RXQ_CNTXT_ID; ctx = &vi->ctx; - children = SYSCTL_CHILDREN(oid); + children = SYSCTL_CHILDREN(vi->nm_rxq_oid); snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name, @@ -211,8 +212,7 @@ free_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq) } int -alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq, int iqidx, int idx, - struct sysctl_oid *oid) +alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq, int iqidx, int idx) { int rc; size_t len; @@ -220,7 +220,8 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq, int iqidx, int idx, struct adapter *sc = pi->adapter; struct netmap_adapter *na = NA(vi->ifp); char name[16]; - struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); + struct sysctl_oid *oid; + struct sysctl_oid_list *children = SYSCTL_CHILDREN(vi->nm_txq_oid); len = na->num_tx_desc * EQ_ESIZE + sc->params.sge.spg_len; rc = alloc_ring(sc, len, &nm_txq->desc_tag, &nm_txq->desc_map, diff --git a/sys/dev/cxgbe/t4_sched.c b/sys/dev/cxgbe/t4_sched.c index 99a157eca08c..0cb44e1d4ffb 100644 --- a/sys/dev/cxgbe/t4_sched.c +++ b/sys/dev/cxgbe/t4_sched.c @@ -296,8 +296,8 @@ bind_txq_to_traffic_class(struct adapter *sc, struct sge_txq *txq, int idx) int rc, old_idx; uint32_t fw_mnem, fw_class; - if (!(txq->eq.flags & EQ_ALLOCATED)) - return (EAGAIN); + if (!(txq->eq.flags & EQ_HW_ALLOCATED)) + return (ENXIO); mtx_lock(&sc->tc_lock); if (txq->tc_idx == -2) { @@ -565,16 +565,13 @@ int sysctl_tc(SYSCTL_HANDLER_ARGS) { struct vi_info *vi = arg1; - struct port_info *pi; - struct adapter *sc; + struct adapter *sc = vi->adapter; struct sge_txq *txq; int qidx = arg2, rc, tc_idx; - MPASS(qidx >= 0 && qidx < vi->ntxq); - pi = vi->pi; - sc = pi->adapter; - txq = &sc->sge.txq[vi->first_txq + qidx]; + MPASS(qidx >= vi->first_txq && qidx < vi->first_txq + vi->ntxq); + txq = &sc->sge.txq[qidx]; tc_idx = txq->tc_idx; rc = sysctl_handle_int(oidp, &tc_idx, 0, req); if (rc != 0 || req->newptr == NULL) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 68b5ed812096..93e19f43d2bc 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -234,53 +234,66 @@ static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int eth_rx(struct adapter *, struct sge_rxq *, const struct iq_desc *, u_int); -static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); +static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int, + int, int); static inline void init_fl(struct adapter *, struct sge_fl *, int, int, char *); static inline void init_eq(struct adapter *, struct sge_eq *, int, int, uint8_t, - uint16_t, char *); + struct sge_iq *, char *); static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *, - int, int); -static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *); + struct sysctl_ctx_list *, struct sysctl_oid *); +static void free_iq_fl(struct adapter *, struct sge_iq *, struct sge_fl *); static void add_iq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_iq *); static void add_fl_sysctls(struct adapter *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_fl *); +static int alloc_iq_fl_hwq(struct vi_info *, struct sge_iq *, struct sge_fl *); +static int free_iq_fl_hwq(struct adapter *, struct sge_iq *, struct sge_fl *); static int alloc_fwq(struct adapter *); -static int free_fwq(struct adapter *); -static int alloc_ctrlq(struct adapter *, struct sge_wrq *, int, - struct sysctl_oid *); -static int alloc_rxq(struct vi_info *, struct sge_rxq *, int, int, - struct sysctl_oid *); -static int free_rxq(struct vi_info *, struct sge_rxq *); +static void free_fwq(struct adapter *); +static int alloc_ctrlq(struct adapter *, int); +static void free_ctrlq(struct adapter *, int); +static int alloc_rxq(struct vi_info *, struct sge_rxq *, int, int, int); +static void free_rxq(struct vi_info *, struct sge_rxq *); +static void add_rxq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_rxq *); #ifdef TCP_OFFLOAD static int alloc_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *, int, int, - struct sysctl_oid *); -static int free_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *); + int); +static void free_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *); +static void add_ofld_rxq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_ofld_rxq *); #endif static int ctrl_eq_alloc(struct adapter *, struct sge_eq *); static int eth_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); #if defined(TCP_OFFLOAD) || defined(RATELIMIT) static int ofld_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); #endif -static int alloc_eq(struct adapter *, struct vi_info *, struct sge_eq *); -static int free_eq(struct adapter *, struct sge_eq *); -static int alloc_wrq(struct adapter *, struct vi_info *, struct sge_wrq *, +static int alloc_eq(struct adapter *, struct sge_eq *, struct sysctl_ctx_list *, struct sysctl_oid *); -static int free_wrq(struct adapter *, struct sge_wrq *); -static int alloc_txq(struct vi_info *, struct sge_txq *, int, - struct sysctl_oid *); -static int free_txq(struct vi_info *, struct sge_txq *); +static void free_eq(struct adapter *, struct sge_eq *); +static void add_eq_sysctls(struct adapter *, struct sysctl_ctx_list *, + struct sysctl_oid *, struct sge_eq *); +static int alloc_eq_hwq(struct adapter *, struct vi_info *, struct sge_eq *); +static int free_eq_hwq(struct adapter *, struct vi_info *, struct sge_eq *); +static int alloc_wrq(struct adapter *, struct vi_info *, struct sge_wrq *, + struct sysctl_ctx_list *, struct sysctl_oid *); +static void free_wrq(struct adapter *, struct sge_wrq *); +static void add_wrq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_wrq *); +static int alloc_txq(struct vi_info *, struct sge_txq *, int); *** 2020 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Apr 26 21:23:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 901FA5F125B for ; Mon, 26 Apr 2021 21:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTdD23Mfjz4bq4 for ; Mon, 26 Apr 2021 21:23:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id u20so25890898qku.10 for ; Mon, 26 Apr 2021 14:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kQHQwOddw1ywQA/r//O3ptcq7UcF6Q9W03Y1ivf+L6U=; b=I9WH2lCItIly5p+V0JNzrsLfvVgIZjQN6tXokfs4fnw5hqu6GOHyoQXurO+fp4vdmw Ef0oLHEwf7qaR1870pP/BgHF/LVj6XClcUxQkSDooMFMMSypy0mkuXocQlbpDU5UwnCk ugdmElLKUP+LXIftxwUPX1IeyTYgVI6ONKQjiRNyAXvoW4xziPJoeq3hwY9j+nuRAoyy NLyVZtRZrw489Uho4TJFiOHOP0JsqkE6DarvqofyyjszS+6/S8Fwx3sFDt/3UNKdajDB T0onSFgUxqf6Pnu3dRSW4mYaOK57mrkQjptT2fTpeUtduY2qS70Q72+i5RhVXs5QkMsy j2ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kQHQwOddw1ywQA/r//O3ptcq7UcF6Q9W03Y1ivf+L6U=; b=X4eLmUUJV80GjEfb5lXQyoveHc1re5fHx/wWAb3d1EAGZeZ+F+PXe6eZRTfqXWbXIZ k4GstegrODDKhPOlS7XUUcqIbFaymqQlP0Dd2NQ/ExjnldUfDZeoJ5bp6QgPbEtq3BKf vC9T78jNkTYAmNmfYOTZLRXPMZivNZrx+KkHOTlDRFqSMddg6KaJQMVtToK2Co9GkGTJ abV0kvl9vGap5L7joptJSMsMYpmLG0N1L6PoSBh8dnk8YeUp1i8y54bC9eqNarb4Rjoj asN+c14QRNnxAZYAai80LdWdTspnjKVsu0IoX46dVAaY/G1i2bAiJr8CkG8mMi/2IFIs 3V+w== X-Gm-Message-State: AOAM531COLJ22RnebmfQM2ZKNCOe4kCGo5Ed5qa/zUwuHXrlh/6fBEKK j8s9b3F2somZHE+9EPkOqHyQaS0wtaS7LzNk4Q6OJw== X-Google-Smtp-Source: ABdhPJzbxZ2VRQy9MqrYQVUjF15HbTiPwDrHd2+uhgux7EogoRyPNvFUAOExHJpIxo4HtXRqnmECv3YfafY1h81muz0= X-Received: by 2002:a05:620a:24c5:: with SMTP id m5mr19659799qkn.195.1619472193218; Mon, 26 Apr 2021 14:23:13 -0700 (PDT) MIME-Version: 1.0 References: <202104260110.13Q1AGM6048050@gitrepo.freebsd.org> <074cf85d-0e00-44ad-1d0e-de4be849a481@FreeBSD.org> <6b3eca71-95d3-fbcc-f876-106364558cdf@FreeBSD.org> In-Reply-To: <6b3eca71-95d3-fbcc-f876-106364558cdf@FreeBSD.org> From: Warner Losh Date: Mon, 26 Apr 2021 15:23:01 -0600 Message-ID: Subject: Re: git: 4b84b4cca472 - main - zfs: fix non-functional mismerges from vendor/openzfs To: Martin Matuska Cc: John Baldwin , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4FTdD23Mfjz4bq4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 21:23:14 -0000 On Mon, Apr 26, 2021, 2:12 PM Martin Matuska wrote: > Hi Johh, > > thank you very much for the notice. I am going submit the change > upstream to put this in sync. > > OpenZFS is now "the source" and this file is part of OpenZFS. We may > have local changes but the idea is to push to OpenZFS first, if not > absolutely necessary to have it in our tree first. If I as a copyright > holder write a webpage with open content and others may use my content, > it is unusual for a copyright holder to request changes on a derived > site and keep the original webpage unchanged. > Yea, I think the author just changed the wrong copy of the file to remove all rights reserved, perhaps because he was unaware of the upstream relationship.... Your plan sounds good to me as long as we end back to the author's intent in the fullness of time. Warner Martin > > On 26. 4. 2021 18:37, John Baldwin wrote: > > On 4/25/21 6:10 PM, Martin Matuska wrote: > >> The branch main has been updated by mm: > >> > >> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=4b84b4cca472e482bc22d5e5c7928be5a1393c84 > >> > >> commit 4b84b4cca472e482bc22d5e5c7928be5a1393c84 > >> Author: Martin Matuska > >> AuthorDate: 2021-04-26 01:05:13 +0000 > >> Commit: Martin Matuska > >> CommitDate: 2021-04-26 01:05:13 +0000 > >> > >> zfs: fix non-functional mismerges from vendor/openzfs > >> - fix copyright in module/os/freebsd/spl/spl_acl.c > > > > Strictly speaking you broke the copyright. > > > > This line was explicitly dropped by the copyright holder: > > > > commit bce7ee9d412b6410e6d799c4a417617cbb148e09 > > Author: Edward Tomasz Napierala > > Date: Wed Oct 28 13:46:11 2020 +0000 > > > > Drop "All rights reserved" from all my stuff. This includes > > Foundation copyrights, approved by emaste@. It does not include > > files which carry other people's copyrights; if you're one > > of those people, feel free to make similar change. > > Reviewed by: emaste, imp, gbe (manpages) > > Differential Revision: https://reviews.freebsd.org/D26980 > > > > Notes: > > svn path=/head/; revision=367105 > > > > It is not ethical (and possibly not legal) to undo the copyright > > holder's explicit change. If you want to reduce the diff with > > upstream, then push this local change to remove this line upstream > > instead. > > > > Note that the original commit is in line with a recent-ish change > > in the Project's license policy to discourage the use of the > > "All rights reserved" line as antiquated and obsolete, and that > > it has been dropped from all of the Project's recommended license. > > > > From owner-dev-commits-src-main@freebsd.org Mon Apr 26 22:29:12 2021 Return-Path: Delivered-To: dev-commits-src-main@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 45C0D5F2C66; Mon, 26 Apr 2021 22:29:12 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on0623.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5c::623]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTfh80XxKz4f8d; Mon, 26 Apr 2021 22:29:11 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mV3WrNAHN8SqY6wE2gH+VUk+IEQhh6PIgHmG7OCnvAs9/nnbxa0RB7T7qVlyfulnQIkWa+0kaI41bv6kD1PP4q5v45DdRm9cIOvTAw0C2eyijQanjKQ0C3I7z7/otqUSCtqpCPSBSAyDe+IGXcvz+PHJNlhKMUO5eDGl4pKNYiBdpoNYLPlonqRYucNO9ucXG2FHYwkGcPhJ2ZKFIYaQZ4U/pxfKY7LbrQIJNhYB2Azg5O+dHeu8Z6rnM+ghiBqoAck9eyiDbcDRlY4l15FoQ62vHfaIPLiWGrUBdJucNu5nnoWYvZxSmW6uTWGkR4/TtGwrFFT/9JnjWt0A43IhsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nrVoiMmndexZXuqzc1jRp2GuxJezkCXulQDSh91YtWE=; b=hHS1Ah8cLSBKvn21ySJ+4eevMUFMZZVmefIKygwS78eAN7XPlZCuKok/z5sDd31u/9fkamOStELVhs/y9ZfNuXXejPUCWnrSaE4tsi3AOBRCUfLSvwbZ6n/Nlq8dkuwz+aALZ5JlTlruORdMeh6oZD5AaGCvrddypMKr0Ses6s0pozVF8bKyM22CTBO6g+1/QWUM/KZTes49vZiQs2Lt9tDf6EVbysd8KTV5EermODCNSF2qBpTMQ5o+n96KjR9IxA4g4wo7tlCGc+Mqe5kD7innIIZCRYH5wnGDBOf2R5dx+HdB4ZNlP2r5hUXr3FQtlA+9Ub+1naEar7eL9FMB+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nrVoiMmndexZXuqzc1jRp2GuxJezkCXulQDSh91YtWE=; b=AP+m4xExZX42yppAa79WwgXRcTRAk62qfMynH7PAmMoVXunH6woCKHW9SL7bRo7UpZGKjOzTV//0Bnskx7No4CQMqaXICzc8ffwEClMFcJXLSNCmedsW2p38qgZsvtV8A5S3m8E2KYcnRnBI5ENrs5wzDe98ihaDWYmtaVj+NVS9k7dyu0G0bZywIWWrXUX5eLGYB+/MZ7bbqyiXSsIioayY/3GfrjsxDLeo/2Em/oCMZyUPbPNTjFg5z3z7ThvF14gvh0sWwn2dvvJrSqHzStavLRUVgkqs13PC+pW3/YVgxcJHoWaacbV3sw0JNuWsb5Ekx6Vm3Of6lR02sXDTxA== Received: from YTOPR0101MB0970.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:20::29) by YT1PR01MB2857.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Mon, 26 Apr 2021 22:29:09 +0000 Received: from YTOPR0101MB0970.CANPRD01.PROD.OUTLOOK.COM ([fe80::21d4:df53:c6e9:5ba8]) by YTOPR0101MB0970.CANPRD01.PROD.OUTLOOK.COM ([fe80::21d4:df53:c6e9:5ba8%6]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 22:29:03 +0000 From: Rick Macklem To: Neel Chauhan , Kevin Bowling CC: src-committers , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() Thread-Topic: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() Thread-Index: AQHXOrB0UGsvOu+7hUGes3oAD6tpP6rHAlcAgAABNgCAAFyIbg== Date: Mon, 26 Apr 2021 22:29:03 +0000 Message-ID: References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> , <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> In-Reply-To: <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 119af3ac-e8f9-4b92-dc8c-08d90902b25b x-ms-traffictypediagnostic: YT1PR01MB2857: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Om3aiFmz02mmBkn2f+kPmW21vtGtGP31Y9SNB7l9g/hwFbLqjT6YfshKjltwzkG6SzV3ZW2weLPgbpEEP54Z4jFRoE8vIPrQDMnQaTsCaiXP2yn1kA7CIXD5AqmGvnIyLdeu9v0ii6k9ynVbVKuKTxSRbAVs4oyOF+5xNSSuEVzquTceru9ufQIf9T/8Lz5DtlZX+ZCcw4Cd5bRFREgjsFKX1pTU9lyBphzr0zps4xwCwLD1gi+6l8XEjyTvPdw8TN7AbF7a4sIaE3fiyqbHLdOU20uJZlYikbk87vpEQWwy/pmkuBKHvPRZVt6RNS6T+BSbzJSjEohErn/rX1jmMM6gafbt7za4R3d/LQAdVItKApPHaMJ1g3gRUYKzyNN1JHysxYYN7N6MiO/7pVLrv4Ir8O9Jq2BgXelnn2h5pRlZhIzIgt53A802EzjB5LbU8nkuWhtMNix+0YvWE/7JZP2TvMH/k5VlcrK+fEWPnLtks4Oh9XetrGlA0L+RtFF08hVrATd72ntZ7WAB6EhUwgFKL0XzxAEvLii8Wph3mjvy+8nOR93DDBtNwPdKWo4wbcP15ufGc7k4DA9UlH/F++tK7djPyQLQZ96KE800u7n9LSidOsol47XTOY7x0qr1zp01ffbzQesfQ/qIoiGpqUM8httFjnlsY3YFUYUvLyTt5p3mC6iTxpExTlW5JH0ZfuqyiF/Za8kWiA56LbGL22+yDAbuA7xsbpZVH/tGIGc= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTOPR0101MB0970.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(136003)(366004)(396003)(39860400002)(376002)(346002)(66476007)(71200400001)(33656002)(8676002)(966005)(66556008)(91956017)(54906003)(186003)(5660300002)(86362001)(4326008)(83380400001)(76116006)(478600001)(64756008)(66946007)(66446008)(9686003)(55016002)(786003)(316002)(110136005)(122000001)(6506007)(8936002)(52536014)(38100700002)(7696005)(2906002)(125773002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?Windows-1252?Q?4ONaxj/uo0KgRq5tNdystG6TSE1bZC672sQLUHGcZ/VuS/8gon+yFC3T?= =?Windows-1252?Q?qnKorjm/CmeMp/wzSW5bp52gQWjDSSBvAqNvxRkmFwpsWxeXd2THiSgO?= =?Windows-1252?Q?REGlc9zESPNQV6rX9QcG6Fi3AYsmLl9wyLzbl/UPJew27Q/n8qWCe738?= =?Windows-1252?Q?QQutCSSjfp2M9CDAfAAPJZYHwyiRWvMAXpfOWBoB2lFprupXqEaWcGra?= =?Windows-1252?Q?LFJobYmlZ9haFSQmf0LjTkhKb3JaOY+q3Elp4geRvb95KIHp47cHE7Di?= =?Windows-1252?Q?O5cLbpvaKZyOtmY2AJGPHY8BtcLMwQOcEomL2JnZmcLn5+NNC57rLreC?= =?Windows-1252?Q?FmOWFcdsjgFULNX5CUIDdA+CXGSLCK5+SaRR9dcQcHZyWNcQhenIxU8R?= =?Windows-1252?Q?9BoqAVawUputhuri6eKHL/logMHkzC+v4oKIBPTAtG3oqQuGCZaePE1e?= =?Windows-1252?Q?O63e7ebUxp9q2ZMSeCY2lio3E071coSvdiPp6v/HYMiwS8LUTgtVqyQz?= =?Windows-1252?Q?fRgBneNyaDPcowKAGTSjO/3Uj2D2rBlVlecBe1XNcc7Ox+uuxSXVf2P/?= =?Windows-1252?Q?Tb77f1a1wB6izQDnv6ZVJPGVPDt0ggNC+8QFS6Mg2Ui5risIa2TI2+pV?= =?Windows-1252?Q?4ZNCNc6T2BE80djGg/IweKt2k/Eg8WSL6wi6cK43oSrpMfTWnsx9YASf?= =?Windows-1252?Q?Jpd+wvqKEtnEQFf0QNtJkrvcU+a3huQoXIkgEGjlhdqY71fhSeIvst6H?= =?Windows-1252?Q?4P5S2Mq6dZon+nMvmdA+UINbNy2fARSTrLQM/HdDCztk1k/dcxKUKaeu?= =?Windows-1252?Q?on/KAyLYoGOMaqXZEmp5zp0gdpeRAPmE5cvYeJJv1fW7TJu5qZA+qTN/?= =?Windows-1252?Q?BVcY5zvIkl7c09hb76nOjMsZl30U6yPnQUrYXSGK6XgecSK4UT+MAVRk?= =?Windows-1252?Q?dxpr/ns1dy8fK7IRTFaHhQNvk+BK7MTQfd0Q1wgdpI9GBul9NFkn3NxD?= =?Windows-1252?Q?Gm759S6Amak+EV5goLcPLV133ag81l14cS2GJrvbOTomRn0H0mxdEhRM?= =?Windows-1252?Q?h0KqrLJx5TuNnDT5uvkFZa4uwHQdIvy0NNV7sygbZmKVWaQjkHO04BQ4?= =?Windows-1252?Q?k1EiQT0KDWrhCPCPUICkth20N+5N4rrkIw29ai3W6JfnbpbIqYXU3vkk?= =?Windows-1252?Q?r6qv7Zs/2ILj5iaTRKsjVEOJV0jJlTxCnrrqlLpre9lawev7Syz4Ne+7?= =?Windows-1252?Q?bTV9VqOmkkr4bJhvpMwazatrOWNABMaoNbmYuYhzbtESKjncHRBceg08?= =?Windows-1252?Q?JHdyXKTxf3ltuwZcoXeCh8vM/yAcXZ7/gvIuiRpeil7GyVe2G81mpvTX?= =?Windows-1252?Q?NjznyuHwqn+AsjWX3h5unSkL+wr9s/jYA0FJpF+ItmpdExcdMFtEK2F8?= =?Windows-1252?Q?d6EIRo9dGc/7PPV8kn4ZVpjDqKgxnLZ81Xt4Pwd+nkPn0KYnWc0CwKVo?= =?Windows-1252?Q?zHm50OGk?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTOPR0101MB0970.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 119af3ac-e8f9-4b92-dc8c-08d90902b25b X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2021 22:29:03.5695 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nqPV1Uj3lJ6y++XV/Kj3PBH/XpmLIzWAFE2ZOXu277sDH4cL3harqBsJTTswNPqo6BrKqoWw7LJZsCX5rz28kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB2857 X-Rspamd-Queue-Id: 4FTfh80XxKz4f8d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 22:29:12 -0000 Neel wrote:=0A= >On 2021-04-26 09:47, Kevin Bowling wrote:=0A= >> I'm not sure all the context or conversation here but the convention=0A= >> is to not use bare return values, i.e in style(9) "Values in return=0A= >> statements should be enclosed in parentheses." and that's what was=0A= >> asked to be changed on this mailing list.=0A= Just fyi to everyone, there is this in style(9):=0A= In general code can be considered =93new code=94 when it makes up abou= t 50%=0A= or more of the file(s) involved. This is enough to break precedents i= n=0A= the existing code and use the current style guidelines.=0A= =0A= As such, if the "return 0;" predates this patch series, Neel is correct=0A= to use "return 1;", since that precedent has already been established.=0A= I'll admit I see the above ignored a lot and personally don't care if=0A= the above generality is followed, but it is in style(9) and I do=0A= think a consistent style is preferred over a jumble within a source file.= =0A= =0A= rick=0A= =0A= The review: https://reviews.freebsd.org/D29988=0A= =0A= I believe I was asked to do this in the review.=0A= =0A= -Neel=0A= >=0A= > Can you use and link to Phabricator for your src commits? As much as=0A= > possible it is preferable to get it right in one go, for MFCs,=0A= > bisection, etc and this kind of churn should be preventable with quick=0A= > reviews. Feel free to tag me as a reviewer.=0A= =0A= Sure, will do next time.=0A= =0A= =0A= > Regards,=0A= > Kevin=0A= =0A= -Neel=0A= =0A= From owner-dev-commits-src-main@freebsd.org Mon Apr 26 23:28:15 2021 Return-Path: Delivered-To: dev-commits-src-main@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 73B145F4592; Mon, 26 Apr 2021 23:28: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 4FTh0H2vjNz4hTM; Mon, 26 Apr 2021 23:28: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 5653B10456; Mon, 26 Apr 2021 23:28: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 13QNSFGJ025231; Mon, 26 Apr 2021 23:28:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QNSFf3025230; Mon, 26 Apr 2021 23:28:15 GMT (envelope-from git) Date: Mon, 26 Apr 2021 23:28:15 GMT Message-Id: <202104262328.13QNSFf3025230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 875977314881 - main - nfsd: fix the slot sequence# when a callback fails 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/main X-Git-Reftype: branch X-Git-Commit: 87597731488105dd1ab921a95e39bb62e1abe668 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 23:28:15 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=87597731488105dd1ab921a95e39bb62e1abe668 commit 87597731488105dd1ab921a95e39bb62e1abe668 Author: Rick Macklem AuthorDate: 2021-04-26 23:24:10 +0000 Commit: Rick Macklem CommitDate: 2021-04-26 23:24:10 +0000 nfsd: fix the slot sequence# when a callback fails Commit 4281bfec3628 patched the server so that the callback session slot would be free'd for reuse when a callback attempt fails. However, this can often result in the sequence# for the session slot to be advanced such that the client end will reply NFSERR_SEQMISORDERED. To avoid the NFSERR_SEQMISORDERED client reply, this patch negates the sequence# advance for the case where the callback has failed. The common case is a failed back channel, where the callback cannot be sent to the client, and not advancing the sequence# is correct for this case. For the uncommon case where the client's reply to the callback is lost, not advancing the sequence# will indicate to the client that the next callback is a retry and not a new callback. But, since the FreeBSD server always sets "csa_cachethis" false in the callback sequence operation, a retry and a new callback should be handled the same way by the client, so this should not matter. Until you have this patch in your NFSv4.1/4.2 server, you should consider avoiding the use of delegations. Even with this patch, interoperation with the Linux NFSv4.1/4.2 client in kernel versions prior to 5.3 can result in frequent 15second delays if delegations are enabled. This occurs because, for kernels prior to 5.3, the Linux client does a TCP reconnect every time it sees multiple concurrent callbacks and then it takes 15seconds to recover the back channel after doing so. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonkrpc.c | 4 ++-- sys/fs/nfs/nfs_commonsubs.c | 4 +++- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsserver/nfs_nfsdstate.c | 23 ++++++++++++++++++++--- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index daf8082fa1c3..6e766abcf4b1 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -871,7 +871,7 @@ tryagain: sep->nfsess_slotseq[nd->nd_slotid] += 10; mtx_unlock(&sep->nfsess_mtx); /* And free the slot. */ - nfsv4_freeslot(sep, nd->nd_slotid); + nfsv4_freeslot(sep, nd->nd_slotid, false); } NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = ENXIO; @@ -1108,7 +1108,7 @@ tryagain: if ((nd->nd_flag & ND_NFSV4) != 0) { /* Free the slot, as required. */ if (freeslot != -1) - nfsv4_freeslot(sep, freeslot); + nfsv4_freeslot(sep, freeslot, false); /* * If this op is Putfh, throw its results away. */ diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index a30ee458e06c..539cbbbde7d2 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4811,7 +4811,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsclsession *sep, * Free a session slot. */ void -nfsv4_freeslot(struct nfsclsession *sep, int slot) +nfsv4_freeslot(struct nfsclsession *sep, int slot, bool resetseq) { uint64_t bitval; @@ -4819,6 +4819,8 @@ nfsv4_freeslot(struct nfsclsession *sep, int slot) if (slot > 0) bitval <<= slot; mtx_lock(&sep->nfsess_mtx); + if (resetseq) + sep->nfsess_slotseq[slot]--; if ((bitval & sep->nfsess_slots) == 0) printf("freeing free slot!!\n"); sep->nfsess_slots &= ~bitval; diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 201c5a5fc2b5..f23d56050449 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -355,7 +355,7 @@ void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *, struct nfsclsession *, int); int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *, int *, uint32_t *, uint8_t *); -void nfsv4_freeslot(struct nfsclsession *, int); +void nfsv4_freeslot(struct nfsclsession *, int, bool); struct ucred *nfsrv_getgrpscred(struct ucred *); struct nfsdevice *nfsv4_findmirror(struct nfsmount *); void nfsm_set(struct nfsrv_descript *, u_int); diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 430f09844b83..3aebddad0962 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -4572,7 +4572,8 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, if ((clp->lc_flags & LCL_NFSV41) != 0) { error = ECONNREFUSED; if (procnum != NFSV4PROC_CBNULL) - nfsv4_freeslot(&sep->sess_cbsess, slotpos); + nfsv4_freeslot(&sep->sess_cbsess, slotpos, + true); nfsrv_freesession(sep, NULL); } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, @@ -4604,8 +4605,24 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, error = ECONNREFUSED; } NFSD_DEBUG(4, "aft newnfs_request=%d\n", error); - if (error != 0 && procnum != NFSV4PROC_CBNULL) - nfsv4_freeslot(&sep->sess_cbsess, slotpos); + if (error != 0 && procnum != NFSV4PROC_CBNULL) { + /* + * It is likely that the callback was never + * processed by the client and, as such, + * the sequence# for the session slot needs + * to be backed up by one to avoid a + * NFSERR_SEQMISORDERED error reply. + * For the unlikely case where the callback + * was processed by the client, this will + * make the next callback on the slot + * appear to be a retry. + * Since callbacks never specify that the + * reply be cached, this "apparent retry" + * should not be a problem. + */ + nfsv4_freeslot(&sep->sess_cbsess, slotpos, + true); + } nfsrv_freesession(sep, NULL); } else error = newnfs_request(nd, NULL, clp, &clp->lc_req, From owner-dev-commits-src-main@freebsd.org Mon Apr 26 23:38:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 285345F427F; Mon, 26 Apr 2021 23:38: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 4FThCt0JKSz4j8K; Mon, 26 Apr 2021 23:38: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 ECB437FE3; Mon, 26 Apr 2021 23:38: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 13QNcHK7038284; Mon, 26 Apr 2021 23:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QNcHsi038283; Mon, 26 Apr 2021 23:38:17 GMT (envelope-from git) Date: Mon, 26 Apr 2021 23:38:17 GMT Message-Id: <202104262338.13QNcHsi038283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 61aea7fa3c2a - main - param.h: bump __FreeBSD_version for commit 875977314881 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/main X-Git-Reftype: branch X-Git-Commit: 61aea7fa3c2a567245b36bf664fac0c15573c19e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 23:38:18 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=61aea7fa3c2a567245b36bf664fac0c15573c19e commit 61aea7fa3c2a567245b36bf664fac0c15573c19e Author: Rick Macklem AuthorDate: 2021-04-26 23:35:18 +0000 Commit: Rick Macklem CommitDate: 2021-04-26 23:35:18 +0000 param.h: bump __FreeBSD_version for commit 875977314881 Commit 875977314881 changed the internal KPI between the nfsd and nfscommon modules, so both need to be rebuilt from sources. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 4f80ad5972a4..bbfa48d65efe 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 1400011 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400012 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Mon Apr 26 23:44:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EADA55F499D; Mon, 26 Apr 2021 23:44: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 4FThMJ43gYz4jPR; Mon, 26 Apr 2021 23:44: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 79FA310A1C; Mon, 26 Apr 2021 23:44: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 13QNiiIC051684; Mon, 26 Apr 2021 23:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QNiiJr051683; Mon, 26 Apr 2021 23:44:44 GMT (envelope-from git) Date: Mon, 26 Apr 2021 23:44:44 GMT Message-Id: <202104262344.13QNiiJr051683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 84a0e3f95700 - main - Make fsck_ffs more persistent in creating a lost+found directory. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84a0e3f95700733695115fb2a9d84d6666efe5d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 23:44:45 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=84a0e3f95700733695115fb2a9d84d6666efe5d9 commit 84a0e3f95700733695115fb2a9d84d6666efe5d9 Author: Kirk McKusick AuthorDate: 2021-04-26 23:47:27 +0000 Commit: Kirk McKusick CommitDate: 2021-04-26 23:48:30 +0000 Make fsck_ffs more persistent in creating a lost+found directory. When fsck_ffs is running in interactive mode and finds unlinked files, it offers to either unlink them or place them in a lost+found directory. If the lost+found directory option is requested and no lost+found directory exists, fsck_ffs offers to create one. When creating one, it must allocate an inode and a filesystem block. It attempts to allocate them from the first cylinder group. If the first cylinder group has a bad check hash, it gives up. This change expands the search into later cylinder groups when the first one fails with a bad check hash. Reported by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix --- sbin/fsck_ffs/dir.c | 2 ++ sbin/fsck_ffs/fsutil.c | 6 ++++-- sbin/fsck_ffs/inode.c | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index e88d1650ce5a..e806f113ff16 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -801,6 +801,8 @@ allocdir(ino_t parent, ino_t request, int mode) struct dirtemplate *dirp; ino = allocino(request, IFDIR|mode); + if (ino == 0) + return (0); dirp = &dirhead; dirp->dot_ino = ino; dirp->dotdot_ino = parent; diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index ca19f6726af5..276d543dedc6 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -1048,8 +1048,10 @@ allocblk(long frags) cg = dtog(&sblock, i + j); cgbp = cglookup(cg); cgp = cgbp->b_un.b_cg; - if (!check_cgmagic(cg, cgbp, 0)) - return (0); + if (!check_cgmagic(cg, cgbp, 0)) { + i = (cg + 1) * sblock.fs_fpg - sblock.fs_frag; + continue; + } baseblk = dtogd(&sblock, i + j); for (k = 0; k < frags; k++) { setbmap(i + j + k); diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 020a69dd72f8..d4e5723f559f 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -902,22 +902,29 @@ allocino(ino_t request, int type) union dinode *dp; struct bufarea *cgbp; struct cg *cgp; - int cg; + int cg, anyino; - if (request == 0) + anyino = 0; + if (request == 0) { request = UFS_ROOTINO; - else if (inoinfo(request)->ino_state != USTATE) + anyino = 1; + } else if (inoinfo(request)->ino_state != USTATE) return (0); +retry: for (ino = request; ino < maxino; ino++) if (inoinfo(ino)->ino_state == USTATE) break; - if (ino == maxino) + if (ino >= maxino) return (0); cg = ino_to_cg(&sblock, ino); cgbp = cglookup(cg); cgp = cgbp->b_un.b_cg; - if (!check_cgmagic(cg, cgbp, 0)) - return (0); + if (!check_cgmagic(cg, cgbp, 0)) { + if (anyino == 0) + return (0); + request = (cg + 1) * sblock.fs_ipg; + goto retry; + } setbit(cg_inosused(cgp), ino % sblock.fs_ipg); cgp->cg_cs.cs_nifree--; switch (type & IFMT) { From owner-dev-commits-src-main@freebsd.org Mon Apr 26 23:49:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DC9765F4BC3; Mon, 26 Apr 2021 23:49: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 4FThT95vRsz4jXQ; Mon, 26 Apr 2021 23:49: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 B93241067F; Mon, 26 Apr 2021 23:49: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 13QNnnVR052181; Mon, 26 Apr 2021 23:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QNnn8p052180; Mon, 26 Apr 2021 23:49:49 GMT (envelope-from git) Date: Mon, 26 Apr 2021 23:49:49 GMT Message-Id: <202104262349.13QNnn8p052180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 01bad87a76dd - main - UPDATING: add an entry for commit 875977314881 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/main X-Git-Reftype: branch X-Git-Commit: 01bad87a76ddd9f116d487899f3ea8529a7e776b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 23:49:49 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=01bad87a76ddd9f116d487899f3ea8529a7e776b commit 01bad87a76ddd9f116d487899f3ea8529a7e776b Author: Rick Macklem AuthorDate: 2021-04-26 23:45:26 +0000 Commit: Rick Macklem CommitDate: 2021-04-26 23:47:15 +0000 UPDATING: add an entry for commit 875977314881 --- UPDATING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPDATING b/UPDATING index 198ee4ad207f..2059bbddbdc0 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20210426: + Commit 875977314881 changed the internal KAPI between + the nfsd and nfscommon modules. As such these modules + need to be rebuilt from sources. + Without this patch in your NFSv4.1/4.2 server, enabling + delegations by setting vfs.nfsd.issue_delegations non-zero + is not recommended. + 20210411: Commit 7763814fc9c2 changed the internal KAPI between the krpc and NFS. As such, the krpc, nfscommon and From owner-dev-commits-src-main@freebsd.org Tue Apr 27 00:16:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A78DF5F5800 for ; Tue, 27 Apr 2021 00:16:14 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTj3f454Dz4kQY for ; Tue, 27 Apr 2021 00:16:14 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2c.google.com with SMTP id c195so67136147ybf.9 for ; Mon, 26 Apr 2021 17:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0AyoT9c6dAg2mTff27/Cw7SGcDltvRuduSv/vyknP5c=; b=KF2z7HkqzC0ieMwDyKxVn+TjQLX/FYMkAnOBRG2itE/1G1NqZmnHJwOdgoa8OjAdGc 5x6HFwJOWJcuA4iBwIvudB2Ta+zRCAhSDhe+TxjMbIoz2Jx1pEg59Ea8o3FwW4Z/uhow i029UBgf0thtwcGeql8Tes5pggZrOk4tN2ook= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0AyoT9c6dAg2mTff27/Cw7SGcDltvRuduSv/vyknP5c=; b=l1aLM64U5li02SbIqCms5gLHvgojS5Avrww9hRxRPHgPsSEottw/igpBrxx/w0Yr6W ibEjoQ1Fpluc2ikLuZuxVwjXfgFD+N1cT0bqbeN78Pn9KHtBeaKXZwHjR/M8/RH68ANk sdig8hFZagRJSuzaBeRrxKUb5NEv6xnUwmIxN8wJPiaZxero+WUHa71OcVT9eHvXeD68 SRWzbmtkPczEaI0ywZES68FEV6+vFMu9CoIkGFAo+bp/VDwEVlujUQpp+2sCRblTXlUv 91fuHBaYLZqS+5JTm7Lh/YWBRQBfKCYyXpiygGHAi5XyomQ8nqiYCO+Mz4ZfS50wWV5p ym7Q== X-Gm-Message-State: AOAM530HxZzXm1saLwL+Asm6DugMEAzf9ptV8Z3YvpjKVQ3IDb2hGxGw VnKRqJRXyMFV73M63UIzzKJcWANk+owYLEQUqqQKDg== X-Google-Smtp-Source: ABdhPJxqzpuAiiowJbkm4wut/nAQHOHj73ElTYtE4eGiOoLSB+tS+TjNxG96s2m1wldvWW95J/nMTjQw/MUJvYkEkUM= X-Received: by 2002:a25:680c:: with SMTP id d12mr27131591ybc.87.1619482573294; Mon, 26 Apr 2021 17:16:13 -0700 (PDT) MIME-Version: 1.0 References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> In-Reply-To: From: Kevin Bowling Date: Mon, 26 Apr 2021 17:16:01 -0700 Message-ID: Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() To: Rick Macklem Cc: Neel Chauhan , src-committers , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4FTj3f454Dz4kQY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 00:16:14 -0000 Yup, I don't want to fatigue Neel or the tree with unnecessary churn, he had the parens, someone said something about brackets {} and he removed the parens. Since the function needs a rework per mjg's review, it could be done when that occurs. On Mon, Apr 26, 2021 at 3:29 PM Rick Macklem wrote: > > Neel wrote: > >On 2021-04-26 09:47, Kevin Bowling wrote: > >> I'm not sure all the context or conversation here but the convention > >> is to not use bare return values, i.e in style(9) "Values in return > >> statements should be enclosed in parentheses." and that's what was > >> asked to be changed on this mailing list. > Just fyi to everyone, there is this in style(9): > In general code can be considered =E2=80=9Cnew code=E2=80=9D when it= makes up about 50% > or more of the file(s) involved. This is enough to break precedents= in > the existing code and use the current style guidelines. > > As such, if the "return 0;" predates this patch series, Neel is correct > to use "return 1;", since that precedent has already been established. > I'll admit I see the above ignored a lot and personally don't care if > the above generality is followed, but it is in style(9) and I do > think a consistent style is preferred over a jumble within a source file. > > rick > > The review: https://reviews.freebsd.org/D29988 > > I believe I was asked to do this in the review. > > -Neel > > > > Can you use and link to Phabricator for your src commits? As much as > > possible it is preferable to get it right in one go, for MFCs, > > bisection, etc and this kind of churn should be preventable with quick > > reviews. Feel free to tag me as a reviewer. > > Sure, will do next time. > > > > Regards, > > Kevin > > -Neel > From owner-dev-commits-src-main@freebsd.org Tue Apr 27 00:51:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 06F9E5F64A2; Tue, 27 Apr 2021 00:51: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 4FTjrW6qd8z4m79; Tue, 27 Apr 2021 00:51: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 DD5151143F; Tue, 27 Apr 2021 00:51: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 13R0pdqc040901; Tue, 27 Apr 2021 00:51:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R0pdEl040900; Tue, 27 Apr 2021 00:51:39 GMT (envelope-from git) Date: Tue, 27 Apr 2021 00:51:39 GMT Message-Id: <202104270051.13R0pdEl040900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f5ff282bc025 - main - nfscl: fix the handling of NFSERR_DELAY for Open/LayoutGet RPCs 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/main X-Git-Reftype: branch X-Git-Commit: f5ff282bc025f0395afcef40f5b6e778202c4181 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 00:51:40 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f5ff282bc025f0395afcef40f5b6e778202c4181 commit f5ff282bc025f0395afcef40f5b6e778202c4181 Author: Rick Macklem AuthorDate: 2021-04-27 00:48:21 +0000 Commit: Rick Macklem CommitDate: 2021-04-27 00:48:21 +0000 nfscl: fix the handling of NFSERR_DELAY for Open/LayoutGet RPCs For a pNFS mount, the NFSv4.1/4.2 client uses compound RPCs that have both Open and LayoutGet operations in them. If the pNFS server were tp reply NFSERR_DELAY for one of these compounds, the retry after a delay cannot be handled by newnfs_request(), since there is a reference held on the open state for the Open operation in them. Fix this by adding these RPCs to the "don't do delay here" list in newnfs_request(). This patch is only needed if the mount is using pNFS (the "pnfs" mount option) and probably only matters if the MDS server is issuing delegations as well as pNFS layouts. Found by code inspection. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonkrpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 6e766abcf4b1..49c68da45a69 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1067,7 +1067,9 @@ tryagain: nd->nd_procnum != NFSPROC_WRITE && nd->nd_procnum != NFSPROC_WRITEDS && nd->nd_procnum != NFSPROC_OPEN && + nd->nd_procnum != NFSPROC_OPENLAYGET && nd->nd_procnum != NFSPROC_CREATE && + nd->nd_procnum != NFSPROC_CREATELAYGET && nd->nd_procnum != NFSPROC_OPENCONFIRM && nd->nd_procnum != NFSPROC_OPENDOWNGRADE && nd->nd_procnum != NFSPROC_CLOSE && From owner-dev-commits-src-main@freebsd.org Tue Apr 27 01:39:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 098AC5F988B; Tue, 27 Apr 2021 01:39: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 4FTkw26whdz4pcW; Tue, 27 Apr 2021 01:39: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 E075611C69; Tue, 27 Apr 2021 01:39: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 13R1dkJx004166; Tue, 27 Apr 2021 01:39:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R1dkK6004165; Tue, 27 Apr 2021 01:39:46 GMT (envelope-from git) Date: Tue, 27 Apr 2021 01:39:46 GMT Message-Id: <202104270139.13R1dkK6004165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 689724cb23c2 - main - Clean up fsck_ffs error message output. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 689724cb23c2acf58091c80f27de4823d7cd87ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 01:39:47 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=689724cb23c2acf58091c80f27de4823d7cd87ca commit 689724cb23c2acf58091c80f27de4823d7cd87ca Author: Kirk McKusick AuthorDate: 2021-04-27 01:42:48 +0000 Commit: Kirk McKusick CommitDate: 2021-04-27 01:43:51 +0000 Clean up fsck_ffs error message output. When fsck_ffs is creating a lost+found directory it must allocate an inode and a filesystem block. If it encounters a cylinder group with a bad check hash, it complains twice: once for the inode and again for the filesystem block. This change suppresses the second complaint. Reported by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix --- sbin/fsck_ffs/fsutil.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 276d543dedc6..b13ba4c54bde 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -948,6 +948,7 @@ check_cgmagic(int cg, struct bufarea *cgbp, int request_rebuild) { struct cg *cgp = cgbp->b_un.b_cg; uint32_t cghash, calchash; + static int prevfailcg = -1; /* * Extended cylinder group checks. @@ -973,9 +974,14 @@ check_cgmagic(int cg, struct bufarea *cgbp, int request_rebuild) cgp->cg_initediblk <= sblock.fs_ipg))) { return (1); } + if (prevfailcg == cg) + return (0); + prevfailcg = cg; pfatal("CYLINDER GROUP %d: INTEGRITY CHECK FAILED", cg); - if (!request_rebuild) + if (!request_rebuild) { + printf("\n"); return (0); + } if (!reply("REBUILD CYLINDER GROUP")) { printf("YOU WILL NEED TO RERUN FSCK.\n"); rerun = 1; From owner-dev-commits-src-main@freebsd.org Tue Apr 27 02:02:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 63D7E5FA26C; Tue, 27 Apr 2021 02:02: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 4FTlQb2QzBz4r6c; Tue, 27 Apr 2021 02:02: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 3BC461288B; Tue, 27 Apr 2021 02:02: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 13R22lU8043720; Tue, 27 Apr 2021 02:02:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R22l0O043719; Tue, 27 Apr 2021 02:02:47 GMT (envelope-from git) Date: Tue, 27 Apr 2021 02:02:47 GMT Message-Id: <202104270202.13R22l0O043719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e869d3c60147 - main - Make pkg(7) use environment variables specified in pkg.conf 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/main X-Git-Reftype: branch X-Git-Commit: e869d3c60147bbb226b5ad97d2ef73391aeebafa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 02:02:47 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e869d3c60147bbb226b5ad97d2ef73391aeebafa commit e869d3c60147bbb226b5ad97d2ef73391aeebafa Author: Moritz Schmitt AuthorDate: 2021-04-27 01:59:12 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-27 02:01:49 +0000 Make pkg(7) use environment variables specified in pkg.conf Modify /usr/sbin/pkg to use environment variables specified in pkg.conf. This allows control over underlying libraries like fetch(3), which can be configured by setting HTTP_PROXY. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29820 --- usr.sbin/pkg/config.c | 29 +++++++++++++++++++++++++---- usr.sbin/pkg/config.h | 2 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 6f723254d394..3a9ad63ae407 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "config.h" @@ -134,6 +135,15 @@ static struct config_entry c[] = { NULL, false, false + }, + [PKG_ENV] = { + PKG_CONFIG_OBJECT, + "PKG_ENV", + NULL, + NULL, + NULL, + false, + false, } }; @@ -205,11 +215,11 @@ static void config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) { struct sbuf *buf = sbuf_new_auto(); - const ucl_object_t *cur, *seq; - ucl_object_iter_t it = NULL, itseq = NULL; + const ucl_object_t *cur, *seq, *tmp; + ucl_object_iter_t it = NULL, itseq = NULL, it_obj = NULL; struct config_entry *temp_config; struct config_value *cv; - const char *key; + const char *key, *evkey; int i; size_t j; @@ -224,7 +234,7 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) if (conftype == CONFFILE_PKG) { for (j = 0; j < strlen(key); ++j) - sbuf_putc(buf, key[j]); + sbuf_putc(buf, toupper(key[j])); sbuf_finish(buf); } else if (conftype == CONFFILE_REPO) { if (strcasecmp(key, "url") == 0) @@ -285,6 +295,17 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) temp_config[i].value = strdup(ucl_object_toboolean(cur) ? "yes" : "no"); break; + case PKG_CONFIG_OBJECT: + if (strcmp(c[i].key, "PKG_ENV") == 0) { + while ((tmp = + ucl_iterate_object(cur, &it_obj, true))) { + evkey = ucl_object_key(tmp); + if (evkey != NULL && *evkey != '\0') { + setenv(evkey, ucl_object_tostring_forced(tmp), 1); + } + } + } + break; default: /* Normal string value. */ temp_config[i].value = strdup(ucl_object_tostring(cur)); diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h index afcd728abd92..87efd3c29e94 100644 --- a/usr.sbin/pkg/config.h +++ b/usr.sbin/pkg/config.h @@ -44,6 +44,7 @@ typedef enum { FINGERPRINTS, REPOS_DIR, PUBKEY, + PKG_ENV, CONFIG_SIZE } pkg_config_key; @@ -51,6 +52,7 @@ typedef enum { PKG_CONFIG_STRING=0, PKG_CONFIG_BOOL, PKG_CONFIG_LIST, + PKG_CONFIG_OBJECT } pkg_config_t; typedef enum { From owner-dev-commits-src-main@freebsd.org Tue Apr 27 03:09:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 352A05FC14D; Tue, 27 Apr 2021 03:09: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 4FTmvQ141Pz4tGj; Tue, 27 Apr 2021 03:09: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 1776A131F3; Tue, 27 Apr 2021 03:09: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 13R39LdO024106; Tue, 27 Apr 2021 03:09:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R39Lur024105; Tue, 27 Apr 2021 03:09:21 GMT (envelope-from git) Date: Tue, 27 Apr 2021 03:09:21 GMT Message-Id: <202104270309.13R39Lur024105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) 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/main X-Git-Reftype: branch X-Git-Commit: 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 03:09:22 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b Author: Baptiste Daroussin AuthorDate: 2021-04-27 03:05:13 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-27 03:09:07 +0000 pw(8): use openmemstream instead of sbuf(9) --- usr.sbin/pw/Makefile | 2 +- usr.sbin/pw/pw_conf.c | 86 +++++++++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/usr.sbin/pw/Makefile b/usr.sbin/pw/Makefile index 8db96d90f6e2..353eac132c7d 100644 --- a/usr.sbin/pw/Makefile +++ b/usr.sbin/pw/Makefile @@ -8,7 +8,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ WARNS?= 3 -LIBADD= crypt util sbuf +LIBADD= crypt util .include diff --git a/usr.sbin/pw/pw_conf.c b/usr.sbin/pw/pw_conf.c index c446a663f082..b9b80f85cd48 100644 --- a/usr.sbin/pw/pw_conf.c +++ b/usr.sbin/pw/pw_conf.c @@ -31,9 +31,6 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include -#include - #include #include #include @@ -414,9 +411,11 @@ write_userconfig(struct userconf *cnf, const char *file) { int fd; int i, j; - struct sbuf *buf; + FILE *buffp; FILE *fp; char cfgfile[MAXPATHLEN]; + char *buf; + size_t sz; if (file == NULL) { snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, @@ -431,117 +430,124 @@ write_userconfig(struct userconf *cnf, const char *file) close(fd); return (0); } - - buf = sbuf_new_auto(); + + sz = 0; + buf = NULL; + buffp = open_memstream(&buf, &sz); + if (buffp == NULL) + err(EXIT_FAILURE, "open_memstream()"); + for (i = _UC_NONE; i < _UC_FIELDS; i++) { int quote = 1; - sbuf_clear(buf); + if (buf != NULL) + memset(buf, 0, sz); + rewind(buffp); switch (i) { case _UC_DEFAULTPWD: - sbuf_cat(buf, boolean_str(cnf->default_password)); + fputs(boolean_str(cnf->default_password), buffp); break; case _UC_REUSEUID: - sbuf_cat(buf, boolean_str(cnf->reuse_uids)); + fputs(boolean_str(cnf->reuse_uids), buffp); break; case _UC_REUSEGID: - sbuf_cat(buf, boolean_str(cnf->reuse_gids)); + fputs(boolean_str(cnf->reuse_gids), buffp); break; case _UC_NISPASSWD: - sbuf_cat(buf, cnf->nispasswd ? cnf->nispasswd : ""); + fputs(cnf->nispasswd ? cnf->nispasswd : "", buffp); quote = 0; break; case _UC_DOTDIR: - sbuf_cat(buf, cnf->dotdir ? cnf->dotdir : - boolean_str(0)); + fputs(cnf->dotdir ? cnf->dotdir : boolean_str(0), + buffp); break; case _UC_NEWMAIL: - sbuf_cat(buf, cnf->newmail ? cnf->newmail : - boolean_str(0)); + fputs(cnf->newmail ? cnf->newmail : boolean_str(0), + buffp); break; case _UC_LOGFILE: - sbuf_cat(buf, cnf->logfile ? cnf->logfile : - boolean_str(0)); + fputs(cnf->logfile ? cnf->logfile : boolean_str(0), + buffp); break; case _UC_HOMEROOT: - sbuf_cat(buf, cnf->home); + fputs(cnf->home, buffp); break; case _UC_HOMEMODE: - sbuf_printf(buf, "%04o", cnf->homemode); + fprintf(buffp, "%04o", cnf->homemode); quote = 0; break; case _UC_SHELLPATH: - sbuf_cat(buf, cnf->shelldir); + fputs(cnf->shelldir, buffp); break; case _UC_SHELLS: for (j = 0; j < _UC_MAXSHELLS && system_shells[j] != NULL; j++) - sbuf_printf(buf, "%s\"%s\"", j ? + fprintf(buffp, "%s\"%s\"", j ? "," : "", system_shells[j]); quote = 0; break; case _UC_DEFAULTSHELL: - sbuf_cat(buf, cnf->shell_default ? - cnf->shell_default : bourne_shell); + fputs(cnf->shell_default ? cnf->shell_default : + bourne_shell, buffp); break; case _UC_DEFAULTGROUP: - sbuf_cat(buf, cnf->default_group ? - cnf->default_group : ""); + fputs(cnf->default_group ? cnf->default_group : "", + buffp); break; case _UC_EXTRAGROUPS: for (j = 0; cnf->groups != NULL && j < (int)cnf->groups->sl_cur; j++) - sbuf_printf(buf, "%s\"%s\"", j ? + fprintf(buffp, "%s\"%s\"", j ? "," : "", cnf->groups->sl_str[j]); quote = 0; break; case _UC_DEFAULTCLASS: - sbuf_cat(buf, cnf->default_class ? - cnf->default_class : ""); + fputs(cnf->default_class ? cnf->default_class : "", + buffp); break; case _UC_MINUID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_uid); + fprintf(buffp, "%ju", (uintmax_t)cnf->min_uid); quote = 0; break; case _UC_MAXUID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_uid); + fprintf(buffp, "%ju", (uintmax_t)cnf->max_uid); quote = 0; break; case _UC_MINGID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_gid); + fprintf(buffp, "%ju", (uintmax_t)cnf->min_gid); quote = 0; break; case _UC_MAXGID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_gid); + fprintf(buffp, "%ju", (uintmax_t)cnf->max_gid); quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); + fprintf(buffp, "%jd", (intmax_t)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); + fprintf(buffp, "%jd", (intmax_t)cnf->password_days); quote = 0; break; case _UC_NONE: break; } - sbuf_finish(buf); + fflush(buffp); if (comments[i]) fputs(comments[i], fp); if (*kwds[i]) { if (quote) - fprintf(fp, "%s = \"%s\"\n", kwds[i], - sbuf_data(buf)); + fprintf(fp, "%s = \"%s\"\n", kwds[i], buf); else - fprintf(fp, "%s = %s\n", kwds[i], sbuf_data(buf)); + fprintf(fp, "%s = %s\n", kwds[i], buf); #if debugging - printf("WROTE: %s = %s\n", kwds[i], sbuf_data(buf)); + printf("WROTE: %s = %s\n", kwds[i], buf); #endif } } - sbuf_delete(buf); + fclose(buffp); + free(buf); return (fclose(fp) != EOF); } From owner-dev-commits-src-main@freebsd.org Tue Apr 27 04:13:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8F6605FDD26; Tue, 27 Apr 2021 04:13:58 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTpKy3nnMz3DBp; Tue, 27 Apr 2021 04:13:58 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id E64FC26EBF; Tue, 27 Apr 2021 04:13:57 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.48.21041102 Date: Mon, 26 Apr 2021 21:13:53 -0700 Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) From: Ravi Pokala To: Baptiste Daroussin , , , Message-ID: <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> Thread-Topic: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) References: <202104270309.13R39Lur024105@gitrepo.freebsd.org> In-Reply-To: <202104270309.13R39Lur024105@gitrepo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 04:13:58 -0000 -----Original Message----- From: on behalf of Baptiste Daroussin Date: 2021-04-26, Monday at 20:09 To: , , Subject: git: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b Author: Baptiste Daroussin AuthorDate: 2021-04-27 03:05:13 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-27 03:09:07 +0000 Hi Baptiste, pw(8): use openmemstream instead of sbuf(9) That's the "what", but what's the "why"? Thanks, Ravi (rpokala@) --- usr.sbin/pw/Makefile | 2 +- usr.sbin/pw/pw_conf.c | 86 +++++++++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/usr.sbin/pw/Makefile b/usr.sbin/pw/Makefile index 8db96d90f6e2..353eac132c7d 100644 --- a/usr.sbin/pw/Makefile +++ b/usr.sbin/pw/Makefile @@ -8,7 +8,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ WARNS?= 3 -LIBADD= crypt util sbuf +LIBADD= crypt util .include diff --git a/usr.sbin/pw/pw_conf.c b/usr.sbin/pw/pw_conf.c index c446a663f082..b9b80f85cd48 100644 --- a/usr.sbin/pw/pw_conf.c +++ b/usr.sbin/pw/pw_conf.c @@ -31,9 +31,6 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include -#include - #include #include #include @@ -414,9 +411,11 @@ write_userconfig(struct userconf *cnf, const char *file) { int fd; int i, j; - struct sbuf *buf; + FILE *buffp; FILE *fp; char cfgfile[MAXPATHLEN]; + char *buf; + size_t sz; if (file == NULL) { snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, @@ -431,117 +430,124 @@ write_userconfig(struct userconf *cnf, const char *file) close(fd); return (0); } - - buf = sbuf_new_auto(); + + sz = 0; + buf = NULL; + buffp = open_memstream(&buf, &sz); + if (buffp == NULL) + err(EXIT_FAILURE, "open_memstream()"); + for (i = _UC_NONE; i < _UC_FIELDS; i++) { int quote = 1; - sbuf_clear(buf); + if (buf != NULL) + memset(buf, 0, sz); + rewind(buffp); switch (i) { case _UC_DEFAULTPWD: - sbuf_cat(buf, boolean_str(cnf->default_password)); + fputs(boolean_str(cnf->default_password), buffp); break; case _UC_REUSEUID: - sbuf_cat(buf, boolean_str(cnf->reuse_uids)); + fputs(boolean_str(cnf->reuse_uids), buffp); break; case _UC_REUSEGID: - sbuf_cat(buf, boolean_str(cnf->reuse_gids)); + fputs(boolean_str(cnf->reuse_gids), buffp); break; case _UC_NISPASSWD: - sbuf_cat(buf, cnf->nispasswd ? cnf->nispasswd : ""); + fputs(cnf->nispasswd ? cnf->nispasswd : "", buffp); quote = 0; break; case _UC_DOTDIR: - sbuf_cat(buf, cnf->dotdir ? cnf->dotdir : - boolean_str(0)); + fputs(cnf->dotdir ? cnf->dotdir : boolean_str(0), + buffp); break; case _UC_NEWMAIL: - sbuf_cat(buf, cnf->newmail ? cnf->newmail : - boolean_str(0)); + fputs(cnf->newmail ? cnf->newmail : boolean_str(0), + buffp); break; case _UC_LOGFILE: - sbuf_cat(buf, cnf->logfile ? cnf->logfile : - boolean_str(0)); + fputs(cnf->logfile ? cnf->logfile : boolean_str(0), + buffp); break; case _UC_HOMEROOT: - sbuf_cat(buf, cnf->home); + fputs(cnf->home, buffp); break; case _UC_HOMEMODE: - sbuf_printf(buf, "%04o", cnf->homemode); + fprintf(buffp, "%04o", cnf->homemode); quote = 0; break; case _UC_SHELLPATH: - sbuf_cat(buf, cnf->shelldir); + fputs(cnf->shelldir, buffp); break; case _UC_SHELLS: for (j = 0; j < _UC_MAXSHELLS && system_shells[j] != NULL; j++) - sbuf_printf(buf, "%s\"%s\"", j ? + fprintf(buffp, "%s\"%s\"", j ? "," : "", system_shells[j]); quote = 0; break; case _UC_DEFAULTSHELL: - sbuf_cat(buf, cnf->shell_default ? - cnf->shell_default : bourne_shell); + fputs(cnf->shell_default ? cnf->shell_default : + bourne_shell, buffp); break; case _UC_DEFAULTGROUP: - sbuf_cat(buf, cnf->default_group ? - cnf->default_group : ""); + fputs(cnf->default_group ? cnf->default_group : "", + buffp); break; case _UC_EXTRAGROUPS: for (j = 0; cnf->groups != NULL && j < (int)cnf->groups->sl_cur; j++) - sbuf_printf(buf, "%s\"%s\"", j ? + fprintf(buffp, "%s\"%s\"", j ? "," : "", cnf->groups->sl_str[j]); quote = 0; break; case _UC_DEFAULTCLASS: - sbuf_cat(buf, cnf->default_class ? - cnf->default_class : ""); + fputs(cnf->default_class ? cnf->default_class : "", + buffp); break; case _UC_MINUID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_uid); + fprintf(buffp, "%ju", (uintmax_t)cnf->min_uid); quote = 0; break; case _UC_MAXUID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_uid); + fprintf(buffp, "%ju", (uintmax_t)cnf->max_uid); quote = 0; break; case _UC_MINGID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_gid); + fprintf(buffp, "%ju", (uintmax_t)cnf->min_gid); quote = 0; break; case _UC_MAXGID: - sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_gid); + fprintf(buffp, "%ju", (uintmax_t)cnf->max_gid); quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); + fprintf(buffp, "%jd", (intmax_t)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); + fprintf(buffp, "%jd", (intmax_t)cnf->password_days); quote = 0; break; case _UC_NONE: break; } - sbuf_finish(buf); + fflush(buffp); if (comments[i]) fputs(comments[i], fp); if (*kwds[i]) { if (quote) - fprintf(fp, "%s = \"%s\"\n", kwds[i], - sbuf_data(buf)); + fprintf(fp, "%s = \"%s\"\n", kwds[i], buf); else - fprintf(fp, "%s = %s\n", kwds[i], sbuf_data(buf)); + fprintf(fp, "%s = %s\n", kwds[i], buf); #if debugging - printf("WROTE: %s = %s\n", kwds[i], sbuf_data(buf)); + printf("WROTE: %s = %s\n", kwds[i], buf); #endif } } - sbuf_delete(buf); + fclose(buffp); + free(buf); return (fclose(fp) != EOF); } From owner-dev-commits-src-main@freebsd.org Tue Apr 27 07:01:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E5918622854; Tue, 27 Apr 2021 07:01:26 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTt3B5rHBz3LT6; Tue, 27 Apr 2021 07:01:26 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id e5so29634095wrg.7; Tue, 27 Apr 2021 00:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=eeRnfj8I905ca9dTAOMnUd2ZobeiTU7bX/Ik8CCNPI8=; b=isn5vEt9Ae4+UzO0Lc1bEPwqZ74LWealXRGc8e5mwMRRbjUAjVgnhtofV6eA9oun7l nUIIPR1QljE9dD1x+6f/bCWrxxowLGe/Z/wfFQf0kt8QGB2fw1Vm+hf4sBMcN/8CM8ya DAo/u7s9ePMSoEuuMXLaULnVLlnXu1OQMdtG27EhTRr0nxVcdYUGSMEltLREi76b0e3f oM1+kYhTkwYeqXbWKOrbiDUKJA+o7VWf/r1b8O01GGCqCAVRI/JUCE6pSj3X3Ra6JPL5 NggC8rEpKiDvfyDU0OwheK15wiMmpoLT4BNCLpDblK3/FMYEjatkZFhxYIpYJjhb4oJ9 um4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=eeRnfj8I905ca9dTAOMnUd2ZobeiTU7bX/Ik8CCNPI8=; b=CGZbeoNeqKFzGgs9fnazeKQqPkU9ZtQKP4RBPkBCxc++EA+4BbgjhuL2w0ISCD6wKI E6kjO2HColQ83nDNTrLosoSwiOfcUriaNQsbJWFi8fd0DuMIEaVKXsdaLNA2yiAe3GQF 4+VXw9CzjcjSYy0tRHYrFmfUv31aHOvB+l2N7igZA3SaTWsFXdJVoZP5iAjelKume/7x eS21MR3vcJDuQeVbGgsYKevv6gqg0ydGjj7lbLRxBlJfJfnv6eyxuf9AiTQx2GdQ4dbE ypsB7gl2564P598W5WswWqbfLjVQTikiZCNt0rKixSPVBaKm9PxdcC/+a6knk9iScF+M RmBw== X-Gm-Message-State: AOAM533yM4l7f8ZA2dlAjt3mQ9X3dZQxnW0ija7VkV4lJEwqgaWUNCfL 4X8Fm2JCbi5i2su/dEpEJLjFLTLPP+M= X-Google-Smtp-Source: ABdhPJwgjD4AnnLWBTnaH7pCKOSfeb004M5kiemwZ3OkjfEsoAyLvy2NyNSsWkuE0vWN8Hav8Rd63A== X-Received: by 2002:a05:6000:1785:: with SMTP id e5mr27560248wrg.143.1619506884672; Tue, 27 Apr 2021 00:01:24 -0700 (PDT) Received: from ernst.home (pd9e23d76.dip0.t-ipconnect.de. [217.226.61.118]) by smtp.gmail.com with ESMTPSA id a15sm3318323wrx.9.2021.04.27.00.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 00:01:24 -0700 (PDT) Date: Tue, 27 Apr 2021 09:01:22 +0200 From: Gary Jennejohn To: Kevin Bowling Cc: Rick Macklem , Neel Chauhan , src-committers , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() Message-ID: <20210427070122.302abed2@ernst.home> In-Reply-To: References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FTt3B5rHBz3LT6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 07:01:27 -0000 On Mon, 26 Apr 2021 17:16:01 -0700 Kevin Bowling wrote: > Yup, I don't want to fatigue Neel or the tree with unnecessary churn, > he had the parens, someone said something about brackets {} and he > removed the parens. Since the function needs a rework per mjg's > review, it could be done when that occurs. > I'd say that the misunderstanding was caused by the use of the word brackets in the comment. Looking up bracket on wiktionary gives this definitiotn: 5. Any of the characters "(", ")", "[", "]", "{", "}", "<" and ">", used in pairs to enclose parenthetic remarks, sections of mathematical expressions, etc. (Britain) "(" and ")" specifically, the other forms above requiring adjectives for disambiguation. (US) "[" and "]" specifically - as opposed to the other forms, which have their own technical names. So, if Neel is used to BE he would remove the parens, which he did. I, as an American, would have been looking for [] and been confused by not finding any. So, in future it might be best to explicitly use e.g. {}, [], () in such comments. > On Mon, Apr 26, 2021 at 3:29 PM Rick Macklem wrote: > > > > Neel wrote: > > >On 2021-04-26 09:47, Kevin Bowling wrote: > > >> I'm not sure all the context or conversation here but the convention > > >> is to not use bare return values, i.e in style(9) "Values in return > > >> statements should be enclosed in parentheses." and that's what was > > >> asked to be changed on this mailing list. > > Just fyi to everyone, there is this in style(9): > > In general code can be considered ___new code___ when it makes up about 50% > > or more of the file(s) involved. This is enough to break precedents in > > the existing code and use the current style guidelines. > > > > As such, if the "return 0;" predates this patch series, Neel is correct > > to use "return 1;", since that precedent has already been established. > > I'll admit I see the above ignored a lot and personally don't care if > > the above generality is followed, but it is in style(9) and I do > > think a consistent style is preferred over a jumble within a source file. > > > > rick > > > > The review: https://reviews.freebsd.org/D29988 > > > > I believe I was asked to do this in the review. > > > > -Neel > > > > > > Can you use and link to Phabricator for your src commits? As much as > > > possible it is preferable to get it right in one go, for MFCs, > > > bisection, etc and this kind of churn should be preventable with quick > > > reviews. Feel free to tag me as a reviewer. > > > > Sure, will do next time. > > > > > > > Regards, > > > Kevin > > > > -Neel > > > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" -- Gary Jennejohn From owner-dev-commits-src-main@freebsd.org Tue Apr 27 07:05:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DC392622F3F; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTt8Q60D9z3Ljq; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id A6F9528E0E; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 88F784CF44; Tue, 27 Apr 2021 09:05:57 +0200 (CEST) Date: Tue, 27 Apr 2021 09:05:57 +0200 From: Baptiste Daroussin To: Ravi Pokala Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) Message-ID: <20210427070557.wv3lkor3tscxzdtg@aniel.nours.eu> References: <202104270309.13R39Lur024105@gitrepo.freebsd.org> <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 07:05:58 -0000 On Mon, Apr 26, 2021 at 09:13:53PM -0700, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Baptiste Daroussin > Date: 2021-04-26, Monday at 20:09 > To: , , > Subject: git: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) > > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b > > commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b > Author: Baptiste Daroussin > AuthorDate: 2021-04-27 03:05:13 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-04-27 03:09:07 +0000 > > Hi Baptiste, > > pw(8): use openmemstream instead of sbuf(9) > > That's the "what", but what's the "why"? > > Thanks, > You are right about this. Here the why. I have been the one introducing sbug in pw(8) when I rewrote it, but since the beginning while I found this was better than the solution in place I didn't like adding another external lib just for that. Short after I discovered about open_memstream(3) and figured it could fill the same spot here but keeping the dep only on libc. I was puzzled about pushing this change, and the switch to git reminded me about some uncommit patches sitting on my tree and I ended up pushing it. If people have strong opinion I can revert it back. Things that have not been taken in account in the change, but to answer questions asked privately: - I have performed absolutely no performance benchmark, it does not matter here. - The size of the final binary is smaller: - 76k on amd64 for the new version - 77k for the old version Best regards, Bapt From owner-dev-commits-src-main@freebsd.org Tue Apr 27 07:47:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 19BCF623C79 for ; Tue, 27 Apr 2021 07:47:43 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTv4b03Cwz3NWS for ; Tue, 27 Apr 2021 07:47:42 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb29.google.com with SMTP id z1so68188971ybf.6 for ; Tue, 27 Apr 2021 00:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LREb4jvybnvurd6igzOKu1Qar+KycOTbFuLgUq+Mikw=; b=Pqnfj/3xj1zdISPEginSPYnxM2jlVvxiNWZHWOjptsKtH8d+62mHYhIUcD4SaOtqEH wmJ/lqqgMKOSHrHYSGMGV+KJsjGYgXo2JSSD02RN0CDrS+KtFI3Yy10A5z82ORrZhTdy eDaLqYd+8XwpSokjVPsR2jLx6ng7vRffvQ+AY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LREb4jvybnvurd6igzOKu1Qar+KycOTbFuLgUq+Mikw=; b=i14I3NWmduNxm1mEKwOuCwUHrSwrs6pBvmNP36ih57Mp1PIrNWy8LNkWRalSKEtUeq vBtBu+IZRfTgjB3RtkA8kKkbneEDeKeyNXOCxl2JIU86R9ev4/FcceggTYqiueeKBwdI /X5cyrF6jPvSQA2JFMk4yrILdCZLtEyLcNVls/0vOoAGnsZhEeVPmbWNGvVbP5mMDHlH 476T+rAwSTPm2YeNhJDxf8d32Kdq1CzOd07lpMcM9hFZIf6rRzCf/MhXYtqjUbHyfigb CsDaoeBjBFx3Sb15AyX/MQUcNAq9ymiOFTwbufpDEiEqF0PlB98XxbblBEF8RNLXnide fdag== X-Gm-Message-State: AOAM531ypKJWL2Qojx7RyVWBsiJNTVAoFBu8WveUZChVnQGwvZAS+N49 mF011Vh9+v874N8AAzg2o9RTPCdUbrVKtmzHDHwqxg== X-Google-Smtp-Source: ABdhPJwZhXTHnM1p03xJ0DgX0usykGQYRv2AItER7SDQqQQU1Em2TO7nJxZ3OCH72Q0xviIOe+JpJbWnMgqDWQWP2M8= X-Received: by 2002:a25:680c:: with SMTP id d12mr29165075ybc.87.1619509661971; Tue, 27 Apr 2021 00:47:41 -0700 (PDT) MIME-Version: 1.0 References: <202104261525.13QFPrbg086311@gitrepo.freebsd.org> <9b006e97a64d01d128d81bc09f0891ea@freebsd.org> <20210427070122.302abed2@ernst.home> In-Reply-To: <20210427070122.302abed2@ernst.home> From: Kevin Bowling Date: Tue, 27 Apr 2021 00:47:31 -0700 Message-ID: Subject: Re: git: e657f3de6dc2 - main - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() To: gljennjohn@gmail.com Cc: Neel Chauhan , Rick Macklem , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" , src-committers X-Rspamd-Queue-Id: 4FTv4b03Cwz3NWS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 07:47:43 -0000 On Tue, Apr 27, 2021 at 12:01 AM Gary Jennejohn wrote: > On Mon, 26 Apr 2021 17:16:01 -0700 > Kevin Bowling wrote: > > > Yup, I don't want to fatigue Neel or the tree with unnecessary churn, > > he had the parens, someone said something about brackets {} and he > > removed the parens. Since the function needs a rework per mjg's > > review, it could be done when that occurs. > > > > I'd say that the misunderstanding was caused by the use of the word > brackets in the comment. > > Looking up bracket on wiktionary gives this definitiotn: > > 5. Any of the characters "(", ")", "[", "]", "{", "}", "<" and ">", > used in pairs to enclose parenthetic remarks, sections of mathematical > expressions, etc. > > (Britain) "(" and ")" specifically, the other forms above > requiring adjectives for disambiguation. > > (US) "[" and "]" specifically - as opposed to the other forms, > which have their own technical names. > > So, if Neel is used to BE he would remove the parens, which he did. I, > as an American, would have been looking for [] and been confused by not > finding any. > Thanks for the explanation. > So, in future it might be best to explicitly use e.g. {}, [], () in such > comments. > Seems reasonable and effective. The man page uses precise language and has the symbols. > > On Mon, Apr 26, 2021 at 3:29 PM Rick Macklem > wrote: > > > > > > Neel wrote: > > > >On 2021-04-26 09:47, Kevin Bowling wrote: > > > >> I'm not sure all the context or conversation here but the convention > > > >> is to not use bare return values, i.e in style(9) "Values in return > > > >> statements should be enclosed in parentheses." and that's what was > > > >> asked to be changed on this mailing list. > > > Just fyi to everyone, there is this in style(9): > > > In general code can be considered ___new code___ when it makes up > about 50% > > > or more of the file(s) involved. This is enough to break > precedents in > > > the existing code and use the current style guidelines. > > > > > > As such, if the "return 0;" predates this patch series, Neel is correct > > > to use "return 1;", since that precedent has already been established. > > > I'll admit I see the above ignored a lot and personally don't care if > > > the above generality is followed, but it is in style(9) and I do > > > think a consistent style is preferred over a jumble within a source > file. > > > > > > rick > > > > > > The review: https://reviews.freebsd.org/D29988 > > > > > > I believe I was asked to do this in the review. > > > > > > -Neel > > > > > > > > Can you use and link to Phabricator for your src commits? As much as > > > > possible it is preferable to get it right in one go, for MFCs, > > > > bisection, etc and this kind of churn should be preventable with > quick > > > > reviews. Feel free to tag me as a reviewer. > > > > > > Sure, will do next time. > > > > > > > > > > Regards, > > > > Kevin > > > > > > -Neel > > > > > _______________________________________________ > > dev-commits-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > > To unsubscribe, send any mail to " > dev-commits-src-all-unsubscribe@freebsd.org" > > > -- > Gary Jennejohn > From owner-dev-commits-src-main@freebsd.org Tue Apr 27 08:00:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C1EC762496D; Tue, 27 Apr 2021 08:00: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 4FTvMY58X2z3P7D; Tue, 27 Apr 2021 08:00: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 A3D1D17136; Tue, 27 Apr 2021 08:00: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 13R80fDq021717; Tue, 27 Apr 2021 08:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R80f9l021716; Tue, 27 Apr 2021 08:00:41 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:00:41 GMT Message-Id: <202104270800.13R80f9l021716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: bc5ef45aec3f - main - Fix drace CTF for the rib_head. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc5ef45aec3fa8acf2dd3408cebd207317543a8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:00:41 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=bc5ef45aec3fa8acf2dd3408cebd207317543a8b commit bc5ef45aec3fa8acf2dd3408cebd207317543a8b Author: Alexander V. Chernikov AuthorDate: 2021-04-27 07:47:53 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-27 07:47:53 +0000 Fix drace CTF for the rib_head. 33cb3cb2e321 introduced an `rib_head` structure field under the FIB_ALGO define. This may be problematic for the CTF, as some of the files including `route_var.h` do not have `fib_algo` defined. Make dtrace happy by making the field unconditional. Suggested by: markj --- sys/net/route/route_var.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/net/route/route_var.h b/sys/net/route/route_var.h index f12931476fd3..86fc64493e75 100644 --- a/sys/net/route/route_var.h +++ b/sys/net/route/route_var.h @@ -71,9 +71,7 @@ struct rib_head { struct callout expire_callout; /* Callout for expiring dynamic routes */ time_t next_expire; /* Next expire run ts */ uint32_t rnh_prefixes; /* Number of prefixes */ -#ifdef FIB_ALGO - rt_gen_t rnh_gen_rib; /* rib generation counter */ -#endif + rt_gen_t rnh_gen_rib; /* fib algo: rib generation counter */ uint32_t rib_dying:1; /* rib is detaching */ uint32_t rib_algo_fixed:1;/* fixed algorithm */ struct nh_control *nh_control; /* nexthop subsystem data */ From owner-dev-commits-src-main@freebsd.org Tue Apr 27 08:33:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CF6AB6256EF; Tue, 27 Apr 2021 08:33: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 4FTw505SHWz3Qhx; Tue, 27 Apr 2021 08:33: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 AE733178A6; Tue, 27 Apr 2021 08:33: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 13R8X8kE065628; Tue, 27 Apr 2021 08:33:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R8X8Up065627; Tue, 27 Apr 2021 08:33:08 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:33:08 GMT Message-Id: <202104270833.13R8X8Up065627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 25682e6a495f - main - Fix rtsock sockaddr alignment. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25682e6a495fc6669d799bb64acdaf14d653173e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:33:08 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=25682e6a495fc6669d799bb64acdaf14d653173e commit 25682e6a495fc6669d799bb64acdaf14d653173e Author: Alexander V. Chernikov AuthorDate: 2021-04-27 08:04:19 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-27 08:04:19 +0000 Fix rtsock sockaddr alignment. b31fbebeb3 introduced alloc_sockaddr_aligned() which, in fact, failed to produce aligned addresses. Reported by: Oskar Holmlund MFC after: immediately --- sys/net/rtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index fae15fdf4be6..6930bd167ac1 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1009,7 +1009,7 @@ save_add_notification(struct rib_cmd_info *rc, void *_cbdata) static struct sockaddr * alloc_sockaddr_aligned(struct linear_buffer *lb, int len) { - len |= (sizeof(uint64_t) - 1); + len = roundup2(len, sizeof(uint64_t)); if (lb->offset + len > lb->size) return (NULL); struct sockaddr *sa = (struct sockaddr *)(lb->base + lb->offset); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 08:33:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0AAAA625B84; Tue, 27 Apr 2021 08:33: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 4FTw516cYfz3Qbs; Tue, 27 Apr 2021 08:33: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 D12CF17CB4; Tue, 27 Apr 2021 08:33: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 13R8X9Yf065649; Tue, 27 Apr 2021 08:33:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R8X9T3065648; Tue, 27 Apr 2021 08:33:09 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:33:09 GMT Message-Id: <202104270833.13R8X9T3065648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 439d087d0b55 - main - [fib algo] always commit static routes synchronously. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 439d087d0b55574db81f4a2799a411c1236d95e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:33:10 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=439d087d0b55574db81f4a2799a411c1236d95e3 commit 439d087d0b55574db81f4a2799a411c1236d95e3 Author: Alexander V. Chernikov AuthorDate: 2021-04-27 08:23:29 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-27 08:31:40 +0000 [fib algo] always commit static routes synchronously. Modular fib lookup framework features logic that allows route update batching for the algorithms that cannot easily apply the routing change without rebuilding. As a result, dataplane lookups may return old data until the the sync takes place. With the default sync timeout of 50ms, it is possible that new binary like ping(8) executed exactly after route(8) will still use the old fib data. To address some aspects of the problem, framework executes all rtable changes without RTF_GATEWAY synchronously. To fix the aforementioned problem, this diff extends sync execution for all RTF_STATIC routes (e.g. ones maintained by route(8). This fixes a bunch of tests in the networking space. Reported by: ci, arichardson MFC after: 2 weeks --- sys/net/route/fib_algo.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 5dff2690454d..9fdc80001986 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -667,13 +667,21 @@ need_immediate_sync(struct fib_data *fd, struct rib_cmd_info *rc) switch (rc->rc_cmd) { case RTM_ADD: nh = rc->rc_nh_new; - if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) - return (true); + if (!NH_IS_NHGRP(nh)) { + if (!(nh->nh_flags & NHF_GATEWAY)) + return (true); + if (nhop_get_rtflags(nh) & RTF_STATIC) + return (true); + } break; case RTM_DELETE: nh = rc->rc_nh_old; - if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) - return (true); + if (!NH_IS_NHGRP(nh)) { + if (!(nh->nh_flags & NHF_GATEWAY)) + return (true); + if (nhop_get_rtflags(nh) & RTF_STATIC) + return (true); + } break; } From owner-dev-commits-src-main@freebsd.org Tue Apr 27 09:05:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8056E6268B3; Tue, 27 Apr 2021 09:05: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 4FTwpG3DwXz3j3T; Tue, 27 Apr 2021 09:05: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 5DFA518137; Tue, 27 Apr 2021 09:05: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 13R95QUl007247; Tue, 27 Apr 2021 09:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R95Qxt007246; Tue, 27 Apr 2021 09:05:26 GMT (envelope-from git) Date: Tue, 27 Apr 2021 09:05:26 GMT Message-Id: <202104270905.13R95Qxt007246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: d5b08e13dd6b - main - pfctl: Revert "pfctl: Another set skip fix" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5b08e13dd6beb3436e181ff1f3e034cc8186584 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 09:05:26 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d5b08e13dd6beb3436e181ff1f3e034cc8186584 commit d5b08e13dd6beb3436e181ff1f3e034cc8186584 Author: Kristof Provost AuthorDate: 2021-04-26 08:07:07 +0000 Commit: Kristof Provost CommitDate: 2021-04-27 07:05:14 +0000 pfctl: Revert "pfctl: Another set skip fix" This reverts commit 0c156a3c32cd0d9168570da5686ddc96abcbbc5a. This fix broke using ':network' in tables. MFC after: 1 week --- sbin/pfctl/pfctl_parser.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 282a0922bec7..ce460ab691ca 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1396,26 +1396,6 @@ ifa_exists(char *ifa_name) return (NULL); } -static struct node_host * -if_lookup(char *if_name) -{ - struct node_host *p, *n; - - for (p = iftab; p; p = p->next) { - if (! strcmp(if_name, p->ifname)) { - n = calloc(1, sizeof(struct node_host)); - bcopy(p, n, sizeof(struct node_host)); - - n->next = NULL; - n->tail = n; - - return (n); - } - } - - return (NULL); -} - struct node_host * ifa_grouplookup(char *ifa_name, int flags) { @@ -1439,7 +1419,7 @@ ifa_grouplookup(char *ifa_name, int flags) for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(struct ifg_req); ifg++) { len -= sizeof(struct ifg_req); - if ((n = if_lookup(ifg->ifgrq_member)) == NULL) + if ((n = ifa_lookup(ifg->ifgrq_member, flags)) == NULL) continue; if (h == NULL) h = n; From owner-dev-commits-src-main@freebsd.org Tue Apr 27 09:05:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9A384626A98; Tue, 27 Apr 2021 09:05: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 4FTwpH3sYlz3hs6; Tue, 27 Apr 2021 09:05: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 77C6717F66; Tue, 27 Apr 2021 09:05: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 13R95RrR007275; Tue, 27 Apr 2021 09:05:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R95Re8007274; Tue, 27 Apr 2021 09:05:27 GMT (envelope-from git) Date: Tue, 27 Apr 2021 09:05:27 GMT Message-Id: <202104270905.13R95Re8007274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: daa5350d0e0c - main - pf tests: Test using ':network' in tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 09:05:27 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7 commit daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7 Author: Kristof Provost AuthorDate: 2021-04-25 10:18:48 +0000 Commit: Kristof Provost CommitDate: 2021-04-27 07:05:14 +0000 pf tests: Test using ':network' in tables MFC after: 1 week --- tests/sys/netpfil/pf/table.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 5f23a2c82aa9..2441a3ff84c2 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -183,10 +183,42 @@ automatic_cleanup() pft_cleanup } +atf_test_case "network" "cleanup" +network_head() +{ + atf_set descr 'Test :network' + atf_set require.user root +} + +network_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table const { epair:network }"\ + "block in" \ + "pass in from " + + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 +} + +network_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" atf_add_test_case "v6_counters" atf_add_test_case "pr251414" atf_add_test_case "automatic" + atf_add_test_case "network" } From owner-dev-commits-src-main@freebsd.org Tue Apr 27 11:02:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 983CF5E2F3A; Tue, 27 Apr 2021 11:02: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 4FTzPd3yhLz3pmN; Tue, 27 Apr 2021 11:02: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 7AD7E198E4; Tue, 27 Apr 2021 11:02: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 13RB2j3d066761; Tue, 27 Apr 2021 11:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RB2jlM066760; Tue, 27 Apr 2021 11:02:45 GMT (envelope-from git) Date: Tue, 27 Apr 2021 11:02:45 GMT Message-Id: <202104271102.13RB2jlM066760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 059ec2225c00 - main - sctp: cleanup verification of INIT and INIT-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 059ec2225c00cc18ed9745d733cc9aa0dbd9eaa2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 11:02:45 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=059ec2225c00cc18ed9745d733cc9aa0dbd9eaa2 commit 059ec2225c00cc18ed9745d733cc9aa0dbd9eaa2 Author: Michael Tuexen AuthorDate: 2021-04-27 10:45:14 +0000 Commit: Michael Tuexen CommitDate: 2021-04-27 10:45:43 +0000 sctp: cleanup verification of INIT and INIT-ACK chunks --- sys/netinet/sctp_input.c | 94 ++++++------------------------------------------ 1 file changed, 10 insertions(+), 84 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index c70358f0af07..51041ed67c58 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -98,49 +98,12 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offset, if (stcb == NULL) { SCTP_INP_RLOCK(inp); } - /* validate length */ - if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - /* validate parameters */ + /* Validate parameters */ init = &cp->init; - if (init->initiate_tag == 0) { - /* protocol error... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { - /* invalid parameter... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (init->num_inbound_streams == 0) { - /* protocol error... send abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; - } - if (init->num_outbound_streams == 0) { + if ((ntohl(init->initiate_tag) == 0) || + (ntohl(init->a_rwnd) < SCTP_MIN_RWND) || + (ntohs(init->num_inbound_streams) == 0) || + (ntohs(init->num_outbound_streams) == 0)) { /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, @@ -1277,49 +1240,12 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, "sctp_handle_init_ack: TCB is null\n"); return (-1); } - if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { - /* Invalid length */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } init_ack = &cp->init; - /* validate parameters */ - if (init_ack->initiate_tag == 0) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (init_ack->num_inbound_streams == 0) { - /* protocol error... send an abort */ - op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - return (-1); - } - if (init_ack->num_outbound_streams == 0) { + /* Validate parameters. */ + if ((ntohl(init_ack->initiate_tag) == 0) || + (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) || + (ntohs(init_ack->num_inbound_streams) == 0) || + (ntohs(init_ack->num_outbound_streams) == 0)) { /* protocol error... send an abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, From owner-dev-commits-src-main@freebsd.org Tue Apr 27 11:21:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E1A365E31FF; Tue, 27 Apr 2021 11:21: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 4FTzq261bCz3qZT; Tue, 27 Apr 2021 11:21: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 C1AC01995E; Tue, 27 Apr 2021 11:21: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 13RBLItm089822; Tue, 27 Apr 2021 11:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RBLIS9089821; Tue, 27 Apr 2021 11:21:18 GMT (envelope-from git) Date: Tue, 27 Apr 2021 11:21:18 GMT Message-Id: <202104271121.13RBLIS9089821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 4c1ecf5502e1 - main - Consider the broken card detect flag that comes from 'broken-cd; ' dts property. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c1ecf5502e1b4b20553a2f996b73794cc7e6454 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 11:21:18 -0000 The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=4c1ecf5502e1b4b20553a2f996b73794cc7e6454 commit 4c1ecf5502e1b4b20553a2f996b73794cc7e6454 Author: Ruslan Bukin AuthorDate: 2021-04-27 11:19:05 +0000 Commit: Ruslan Bukin CommitDate: 2021-04-27 11:19:05 +0000 Consider the broken card detect flag that comes from 'broken-cd;' dts property. This fixes operation on Intel Stratix 10 devices. Tested on Terasic DE10-Pro. Reviewed by: manu Sponsored by: UKRI Differential revision: https://reviews.freebsd.org/D29999 --- sys/dev/mmc/host/dwmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index b31bb0d4e68b..bf494027551a 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -480,7 +480,8 @@ dwmmc_card_task(void *arg, int pending __unused) #else DWMMC_LOCK(sc); - if (READ4(sc, SDMMC_CDETECT) == 0) { + if (READ4(sc, SDMMC_CDETECT) == 0 || + (sc->mmc_helper.props & MMC_PROP_BROKEN_CD)) { if (sc->child == NULL) { if (bootverbose) device_printf(sc->dev, "Card inserted\n"); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 11:38:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 417D05E46DD; Tue, 27 Apr 2021 11:38:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FV0C81QxMz3rmK; Tue, 27 Apr 2021 11:38:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 091FD2A7F7; Tue, 27 Apr 2021 11:38:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 90F1B478A3; Tue, 27 Apr 2021 13:38:42 +0200 (CEST) From: "Kristof Provost" To: "Alexander V. Chernikov" , "Li-Wen Hsu" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5d1403a79a3e - main - [rtsock] Enforce netmask/RTF_HOST consistency. Date: Tue, 27 Apr 2021 13:38:41 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: <202104242303.13ON3w5l066307@gitrepo.freebsd.org> References: <202104242303.13ON3w5l066307@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 11:38:44 -0000 On 25 Apr 2021, at 1:03, Alexander V. Chernikov wrote: > The branch main has been updated by melifaro: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D5d1403a79a3e56403fb63c062252a= 23fce81e5f1 > > commit 5d1403a79a3e56403fb63c062252a23fce81e5f1 > Author: Alexander V. Chernikov > AuthorDate: 2021-04-23 21:53:47 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-04-24 22:41:27 +0000 > > [rtsock] Enforce netmask/RTF_HOST consistency. > > Traditionally we had 2 sources of information whether the > added/delete route request targets network or a host route: > netmask (RTA_NETMASK) and RTF_HOST flag. > > The former one is tricky: netmask can be empty or can explicitly > specify the host netmask. Parsing netmask sockaddr requires = > per-family > parsing and that's what rtsock code traditionally avoided. As a = > result, > consistency was not enforced and it was possible to specify = > network with > the RTF_HOST flag and vice versa. > > Continue normalization efforts from D29826 and D29826 and ensure = > that > RTF_HOST flag always reflects host/network data from netmask = > field. > > Differential Revision: https://reviews.freebsd.org/D29958 > MFC after: 2 days I believe this commit triggers a number of regression test failures: = https://ci.freebsd.org/job/FreeBSD-main-amd64-test/18011/#showFailuresLin= k The easiest way to reproduce the problem is to `kldload ipsec ; cd = /usr/tests/sys/netipsec ; kyua test`. Reverting this patch allows the tests to pass again. (There are a few = others that also fail, but the ipsec tests appear to be the most = reliable way to demonstrate the problem.) Best regards, Kristof From owner-dev-commits-src-main@freebsd.org Tue Apr 27 12:42:13 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5A0C25E7F59; Tue, 27 Apr 2021 12:42:13 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500j.mail.yandex.net (forward500j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FV1cP0l91z3wNv; Tue, 27 Apr 2021 12:42:11 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from vla1-840b729f3759.qloud-c.yandex.net (vla1-840b729f3759.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:4d18:0:640:840b:729f]) by forward500j.mail.yandex.net (Yandex) with ESMTP id 1E31B11C5E7D; Tue, 27 Apr 2021 15:26:55 +0300 (MSK) Received: from mail.yandex.ru (mail.yandex.ru [2a02:8084:d6bb:4a80:59f1:7c2c:a252:2fd0]) by vla1-840b729f3759.qloud-c.yandex.net (mxback/Yandex) with HTTP id rQagYZCIoiE1-QrIOTUO0; Tue, 27 Apr 2021 15:26:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1619526414; bh=kPXpkFBYuJo3WIBi7cLtD5BTWuBuvdgI3eIul4YR7ME=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=ME+5kY+IG1VOUXDfMt6UajWUbODzyLnMxXbgDjZs4q/7xSbHvjOk24+wZrBGbWRhx 5Icvs1MOm0/8DYaeo+CFqOXHgHR1/XUTmCyag+Y5L3XR1G+i1utQHECIN9e+8lK+43 BYpxU6PA8Gpaq4JPLthBrsRfK/VD08u8ohVw5ugQ= Received: by vla1-3f9fbb467d83.qloud-c.yandex.net with HTTP; Tue, 27 Apr 2021 15:26:53 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Li-Wen Hsu , Kristof Provost Cc: "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" In-Reply-To: References: <202104242303.13ON3w5l066307@gitrepo.freebsd.org> Subject: Re: git: 5d1403a79a3e - main - [rtsock] Enforce netmask/RTF_HOST consistency. X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 27 Apr 2021 13:26:53 +0100 Message-Id: <11556361619526413@vla1-3f9fbb467d83.qloud-c.yandex.net> X-Rspamd-Queue-Id: 4FV1cP0l91z3wNv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] MIME-Version: 1.0 Content-Type: text/plain X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 12:42:13 -0000 From owner-dev-commits-src-main@freebsd.org Tue Apr 27 13:53:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F2F095F22A4; Tue, 27 Apr 2021 13:53:36 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FV3Bm57c2z4TCY; Tue, 27 Apr 2021 13:53:35 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward102q.mail.yandex.net (forward102q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:516:4e7d]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 28E6550E2484; Tue, 27 Apr 2021 16:53:24 +0300 (MSK) Received: from vla3-eea282d0d1fe.qloud-c.yandex.net (vla3-eea282d0d1fe.qloud-c.yandex.net [IPv6:2a02:6b8:c15:2583:0:640:eea2:82d0]) by forward102q.mail.yandex.net (Yandex) with ESMTP id 258C93A20010; Tue, 27 Apr 2021 16:53:24 +0300 (MSK) Received: from vla1-cde8305024b9.qloud-c.yandex.net (vla1-cde8305024b9.qloud-c.yandex.net [2a02:6b8:c0d:4201:0:640:cde8:3050]) by vla3-eea282d0d1fe.qloud-c.yandex.net (mxback/Yandex) with ESMTP id Ba0hT1UUwx-rNJGbYDR; Tue, 27 Apr 2021 16:53:24 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1619531604; bh=1CT1McwSf2X6jI1mnGk3IHSdZGt5bi8wJk5fmrl8u9Q=; h=To:In-Reply-To:Subject:Cc:From:Message-Id:References:Date; b=eErcu41NJbuOYPVUZvIckyYTL2h+yWq68N8cc11ZyDgT7ew+qz+6oPpYkxoLimqow koivYwocCxPRynMW6T9LGhwv4daKcH/K2nWMesOg7hdyemefXZqEd7p+yejHDe1TcA OOFNOY7xpW1hNuDsBV8FrOPtwHyr6ob1n0xPWC0E= Received: by vla1-cde8305024b9.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id rqCBBPbG2I-rMLSjeKi; Tue, 27 Apr 2021 16:53:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: "Alexander V. Chernikov" Message-Id: <2F6FDB4D-37D8-4161-98B1-95BB6AE924C0@ipfw.ru> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 5d1403a79a3e - main - [rtsock] Enforce netmask/RTF_HOST consistency. Date: Tue, 27 Apr 2021 14:53:19 +0100 In-Reply-To: <11556361619526413@vla1-3f9fbb467d83.qloud-c.yandex.net> Cc: Li-Wen Hsu , Kristof Provost , "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" To: "Alexander V. Chernikov" References: <202104242303.13ON3w5l066307@gitrepo.freebsd.org> <11556361619526413@vla1-3f9fbb467d83.qloud-c.yandex.net> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4FV3Bm57c2z4TCY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 13:53:37 -0000 > On 27 Apr 2021, at 13:26, Alexander V. Chernikov = wrote: >=20 > Ack. Interesting. Will look later today. Thank you for bisecting it - = thought the issue was caused by a different change. Looks like there is no more failures in = https://ci.freebsd.org/job/FreeBSD-main-amd64-test/18039/#showFailuresLink= . In fact, I think = https://cgit.freebsd.org/src/commit/?id=3D439d087d0b55574db81f4a2799a411c1= 236d95e3 is the reason. >=20 > -- > Sent from Yandex.Mail for mobile >=20 > 27.04.2021, 12:38, "Kristof Provost" : > On 25 Apr 2021, at 1:03, Alexander V. Chernikov wrote: >=20 > The branch main has been updated by melifaro: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D5d1403a79a3e56403fb63c062252a23f= ce81e5f1 = >=20 > commit 5d1403a79a3e56403fb63c062252a23fce81e5f1 > Author: Alexander V. Chernikov > > AuthorDate: 2021-04-23 21:53:47 +0000 > Commit: Alexander V. Chernikov > > CommitDate: 2021-04-24 22:41:27 +0000 >=20 > [rtsock] Enforce netmask/RTF_HOST consistency. >=20 > Traditionally we had 2 sources of information whether the > added/delete route request targets network or a host route: > netmask (RTA_NETMASK) and RTF_HOST flag. >=20 > The former one is tricky: netmask can be empty or can explicitly > specify the host netmask. Parsing netmask sockaddr requires per-family > parsing and that's what rtsock code traditionally avoided. As a = result, > consistency was not enforced and it was possible to specify network = with > the RTF_HOST flag and vice versa. >=20 > Continue normalization efforts from D29826 and D29826 and ensure that > RTF_HOST flag always reflects host/network data from netmask field. >=20 > Differential Revision: https://reviews.freebsd.org/D29958 = > MFC after: 2 days >=20 > I believe this commit triggers a number of regression test failures: = https://ci.freebsd.org/job/FreeBSD-main-amd64-test/18011/#showFailuresLink= = > The easiest way to reproduce the problem is to kldload ipsec ; cd = /usr/tests/sys/netipsec ; kyua test. > Reverting this patch allows the tests to pass again. (There are a few = others that also fail, but the ipsec tests appear to be the most = reliable way to demonstrate the problem.) >=20 > Best regards, > Kristof >=20 From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:01:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B09495F7959; Tue, 27 Apr 2021 17:01: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 4FV7Mf445wz4dZN; Tue, 27 Apr 2021 17:01: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 7E9131E172; Tue, 27 Apr 2021 17:01: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 13RH1YHJ048901; Tue, 27 Apr 2021 17:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH1YcS048900; Tue, 27 Apr 2021 17:01:34 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:01:34 GMT Message-Id: <202104271701.13RH1YcS048900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 47bde7925b41 - main - mmccam: Add mmc_sim, a generic sim for mmc driver to use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47bde7925b41887cb639e651289bc96ccb5b1c24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:01:34 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=47bde7925b41887cb639e651289bc96ccb5b1c24 commit 47bde7925b41887cb639e651289bc96ccb5b1c24 Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:52:29 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:00:38 +0000 mmccam: Add mmc_sim, a generic sim for mmc driver to use This adds a generic sim that abstract a lot of what needs to be implemented in a driver for mmccam support. A new interface with three methods is added : - mmc_sim_get_tran_settings: Use to get what the controller supports in term of capabilities, freq etc ... - mmc_sim_set_tran_settings: Use to change the speed/freq/etc of the sdcard host controller - mmc_sim_cam_request: Used for MMCIO requests Differential Revision: https://reviews.freebsd.org/D27485 Reviewed by: kibab --- sys/cam/mmc/mmc_sim.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++ sys/cam/mmc/mmc_sim.h | 43 +++++++++++ sys/cam/mmc/mmc_sim_if.m | 54 +++++++++++++ sys/conf/files | 2 + 4 files changed, 293 insertions(+) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c new file mode 100644 index 000000000000..03269a0b3d4d --- /dev/null +++ b/sys/cam/mmc/mmc_sim.c @@ -0,0 +1,194 @@ +/*- + * Copyright (c) 2020 Emmanuel Vadot + * + * 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 ``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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "mmc_sim_if.h" + +static void +mmc_cam_default_poll(struct cam_sim *sim) +{ + + return; +} + +static void +mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) +{ + struct mmc_sim *mmc_sim; + struct ccb_trans_settings_mmc mmc; + int rv; + + mmc_sim = cam_sim_softc(sim); + + if (mmc_sim == NULL) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + return; + } + + mtx_assert(&mmc_sim->mtx, MA_OWNED); + + switch (ccb->ccb_h.func_code) { + case XPT_PATH_INQ: + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &mmc); + if (rv != 0) { + ccb->ccb_h.status = CAM_REQ_INVALID; + } else { + mmc_path_inq(&ccb->cpi, "Deglitch Networks", + sim, mmc.host_max_data); + } + break; + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INVALID; + else { + cts->protocol = PROTO_MMCSD; + cts->protocol_version = 1; + cts->transport = XPORT_MMCSD; + cts->transport_version = 1; + cts->xport_specific.valid = 0; + ccb->ccb_h.status = CAM_REQ_CMP; + } + break; + } + case XPT_SET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INVALID; + else + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_RESET_BUS: + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_IO: + { + rv = MMC_SIM_CAM_REQUEST(mmc_sim->dev, ccb); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INPROG; + else + ccb->ccb_h.status = CAM_REQ_INVALID; + return; + /* NOTREACHED */ + break; + } + default: + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); + return; +} + +int +mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim) +{ + char sim_name[64], mtx_name[64]; + + mmc_sim->dev = dev; + + if ((mmc_sim->devq = cam_simq_alloc(1)) == NULL) { + goto fail; + } + + snprintf(sim_name, sizeof(sim_name), "%s_sim", name); + snprintf(mtx_name, sizeof(mtx_name), "%s_mtx", name); + + mtx_init(&mmc_sim->mtx, sim_name, NULL, MTX_DEF); + mmc_sim->sim = cam_sim_alloc_dev(mmc_cam_sim_default_action, + mmc_cam_default_poll, + name, mmc_sim, dev, + &mmc_sim->mtx, 1, 1, mmc_sim->devq); + + if (mmc_sim->sim == NULL) { + cam_simq_free(mmc_sim->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + goto fail; + } + + mtx_lock(&mmc_sim->mtx); + if (xpt_bus_register(mmc_sim->sim, dev, 0) != 0) { + device_printf(dev, "cannot register SCSI pass-through bus\n"); + cam_sim_free(mmc_sim->sim, FALSE); + cam_simq_free(mmc_sim->devq); + mtx_unlock(&mmc_sim->mtx); + goto fail; + } + + mtx_unlock(&mmc_sim->mtx); + + return (0); + +fail: + mmc_cam_sim_free(mmc_sim); + return (1); +} + +void +mmc_cam_sim_free(struct mmc_sim *mmc_sim) +{ + + if (mmc_sim->sim != NULL) { + mtx_lock(&mmc_sim->mtx); + xpt_bus_deregister(cam_sim_path(mmc_sim->sim)); + cam_sim_free(mmc_sim->sim, FALSE); + mtx_unlock(&mmc_sim->mtx); + } + + if (mmc_sim->devq != NULL) + cam_simq_free(mmc_sim->devq); +} + +void +mmc_cam_sim_discover(struct mmc_sim *mmc_sim) +{ + + mmccam_start_discovery(mmc_sim->sim); +} diff --git a/sys/cam/mmc/mmc_sim.h b/sys/cam/mmc/mmc_sim.h new file mode 100644 index 000000000000..629144656e51 --- /dev/null +++ b/sys/cam/mmc/mmc_sim.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2020 Emmanuel Vadot + * + * 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 ``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 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$ + */ + +#ifndef __MMC_SIM_H__ +#define __MMC_SIM_H__ + +struct mmc_sim { + struct mmc_cam_sim_softc *sc; + struct mtx mtx; + struct cam_devq *devq; + struct cam_sim *sim; + device_t dev; +}; + +int mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim); +void mmc_cam_sim_free(struct mmc_sim *sim); +void mmc_cam_sim_discover(struct mmc_sim *mmc_sim); + +#endif /* __MMC_SIM_H__ */ diff --git a/sys/cam/mmc/mmc_sim_if.m b/sys/cam/mmc/mmc_sim_if.m new file mode 100644 index 000000000000..f1b88fc05ef5 --- /dev/null +++ b/sys/cam/mmc/mmc_sim_if.m @@ -0,0 +1,54 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Emmanuel Vadot +# +# 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. +# +# $FreeBSD$ + +#include +#include + +#include +#include +#include +#include +#include +#include + +INTERFACE mmc_sim; + +METHOD int get_tran_settings { + device_t dev; + struct ccb_trans_settings_mmc *cts; +}; + +METHOD int set_tran_settings { + device_t dev; + struct ccb_trans_settings_mmc *cts; +}; + +METHOD int cam_request { + device_t dev; + union ccb *ccb; +}; diff --git a/sys/conf/files b/sys/conf/files index 6d7f185e79fe..40b02aba28d6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -121,6 +121,8 @@ cam/ctl/ctl_error.c optional ctl cam/ctl/ctl_util.c optional ctl cam/ctl/scsi_ctl.c optional ctl cam/mmc/mmc_xpt.c optional scbus mmccam +cam/mmc/mmc_sim.c optional scbus mmccam +cam/mmc/mmc_sim_if.m optional scbus mmccam cam/mmc/mmc_da.c optional scbus mmccam da cam/scsi/scsi_da.c optional da cam/scsi/scsi_pass.c optional pass From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:01:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C261E5F795B; Tue, 27 Apr 2021 17:01: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 4FV7Mg4prTz4dRZ; Tue, 27 Apr 2021 17:01: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 963271E633; Tue, 27 Apr 2021 17:01: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 13RH1ZW1048923; Tue, 27 Apr 2021 17:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH1ZH1048922; Tue, 27 Apr 2021 17:01:35 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:01:35 GMT Message-Id: <202104271701.13RH1ZH1048922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 2671bdb540c5 - main - allwinner: aw_mmc: Convert driver to use the mmc_sim interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2671bdb540c582e2d44681e4495916629d033e97 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:01:35 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=2671bdb540c582e2d44681e4495916629d033e97 commit 2671bdb540c582e2d44681e4495916629d033e97 Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:54:25 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:00:42 +0000 allwinner: aw_mmc: Convert driver to use the mmc_sim interface A lot more generic cam related things are done in mmc_sim so this simplify the driver a lot. Differential Revision: https://reviews.freebsd.org/D27486 Reviewed by: imp --- sys/arm/allwinner/aw_mmc.c | 183 ++++++++++----------------------------------- 1 file changed, 40 insertions(+), 143 deletions(-) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index 1c28a882bf46..f63b41f9b73c 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -66,6 +66,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include "mmc_sim_if.h" #endif #define AW_MMC_MEMRES 0 @@ -128,9 +131,7 @@ struct aw_mmc_softc { struct mmc_fdt_helper mmc_helper; #ifdef MMCCAM union ccb * ccb; - struct cam_devq * devq; - struct cam_sim * sim; - struct mtx sim_mtx; + struct mmc_sim mmc_sim; #else struct mmc_request * aw_req; #endif @@ -173,15 +174,11 @@ static void aw_mmc_helper_cd_handler(device_t, bool); static void aw_mmc_print_error(uint32_t); static int aw_mmc_update_ios(device_t, device_t); static int aw_mmc_request(device_t, device_t, struct mmc_request *); + +#ifndef MMCCAM static int aw_mmc_get_ro(device_t, device_t); static int aw_mmc_acquire_host(device_t, device_t); static int aw_mmc_release_host(device_t, device_t); -#ifdef MMCCAM -static void aw_mmc_cam_action(struct cam_sim *, union ccb *); -static void aw_mmc_cam_poll(struct cam_sim *); -static int aw_mmc_cam_settran_settings(struct aw_mmc_softc *, union ccb *); -static int aw_mmc_cam_request(struct aw_mmc_softc *, union ccb *); -static void aw_mmc_cam_handle_mmcio(struct cam_sim *, union ccb *); #endif #define AW_MMC_LOCK(_sc) mtx_lock(&(_sc)->aw_mtx) @@ -203,109 +200,33 @@ SYSCTL_INT(_hw_aw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &aw_mmc_debug, 0, #define AW_MMC_DEBUG_CMD 0x8 #ifdef MMCCAM -static void -aw_mmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) -{ - struct aw_mmc_softc *sc; - - sc = cam_sim_softc(sim); - - aw_mmc_cam_request(sc, ccb); -} - -static void -aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) +static int +aw_mmc_get_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { struct aw_mmc_softc *sc; - sc = cam_sim_softc(sim); - if (sc == NULL) { - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); - return; - } - - mtx_assert(&sc->sim_mtx, MA_OWNED); - - switch (ccb->ccb_h.func_code) { - case XPT_PATH_INQ: - mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, - (sc->aw_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS) / - MMC_SECTOR_SIZE); - break; - - case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts = &ccb->cts; + sc = device_get_softc(dev); - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_GET_TRAN_SETTINGS\n"); - - cts->protocol = PROTO_MMCSD; - cts->protocol_version = 1; - cts->transport = XPORT_MMCSD; - cts->transport_version = 1; - cts->xport_specific.valid = 0; - cts->proto_specific.mmc.host_ocr = sc->aw_host.host_ocr; - cts->proto_specific.mmc.host_f_min = sc->aw_host.f_min; - cts->proto_specific.mmc.host_f_max = sc->aw_host.f_max; - cts->proto_specific.mmc.host_caps = sc->aw_host.caps; - cts->proto_specific.mmc.host_max_data = (sc->aw_mmc_conf->dma_xferlen * - AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; - memcpy(&cts->proto_specific.mmc.ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_SET_TRAN_SETTINGS: - { - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_SET_TRAN_SETTINGS\n"); - aw_mmc_cam_settran_settings(sc, ccb); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_RESET_BUS: - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_RESET_BUS, ACK it...\n"); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - case XPT_MMC_IO: - /* - * Here is the HW-dependent part of - * sending the command to the underlying h/w - * At some point in the future an interrupt comes. - * Then the request will be marked as completed. - */ - ccb->ccb_h.status = CAM_REQ_INPROG; - - aw_mmc_cam_handle_mmcio(sim, ccb); - return; - /* NOTREACHED */ - break; - default: - ccb->ccb_h.status = CAM_REQ_INVALID; - break; - } - xpt_done(ccb); - return; -} + cts->host_ocr = sc->aw_host.host_ocr; + cts->host_f_min = sc->aw_host.f_min; + cts->host_f_max = sc->aw_host.f_max; + cts->host_caps = sc->aw_host.caps; + cts->host_max_data = (sc->aw_mmc_conf->dma_xferlen * + AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; + memcpy(&cts->ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); -static void -aw_mmc_cam_poll(struct cam_sim *sim) -{ - return; + return (0); } static int -aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) +aw_mmc_set_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { + struct aw_mmc_softc *sc; struct mmc_ios *ios; struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; + sc = device_get_softc(dev); ios = &sc->aw_host.ios; - - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; /* Update only requested fields */ @@ -349,10 +270,12 @@ aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) } static int -aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb *ccb) +aw_mmc_cam_request(device_t dev, union ccb *ccb) { + struct aw_mmc_softc *sc; struct ccb_mmcio *mmcio; + sc = device_get_softc(dev); mmcio = &ccb->mmcio; AW_MMC_LOCK(sc); @@ -388,7 +311,7 @@ aw_mmc_helper_cd_handler(device_t dev, bool present) sc = device_get_softc(dev); #ifdef MMCCAM - mmccam_start_discovery(sc->sim); + mmc_cam_sim_discover(&sc->mmc_sim); #else AW_MMC_LOCK(sc); if (present) { @@ -528,31 +451,11 @@ aw_mmc_attach(device_t dev) #ifdef MMCCAM sc->ccb = NULL; - if ((sc->devq = cam_simq_alloc(1)) == NULL) { - goto fail; - } - - mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); - sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, - "aw_mmc_sim", sc, dev, - &sc->sim_mtx, 1, 1, sc->devq); - - if (sc->sim == NULL) { - cam_simq_free(sc->devq); - device_printf(dev, "cannot allocate CAM SIM\n"); - goto fail; - } - mtx_lock(&sc->sim_mtx); - if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { - device_printf(dev, "cannot register SCSI pass-through bus\n"); - cam_sim_free(sc->sim, FALSE); - cam_simq_free(sc->devq); - mtx_unlock(&sc->sim_mtx); + if (mmc_cam_sim_alloc(dev, "aw_mmc", &sc->mmc_sim) != 0) { + device_printf(dev, "cannot alloc cam sim\n"); goto fail; } - - mtx_unlock(&sc->sim_mtx); #endif /* MMCCAM */ return (0); @@ -563,17 +466,6 @@ fail: bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); -#ifdef MMCCAM - if (sc->sim != NULL) { - mtx_lock(&sc->sim_mtx); - xpt_bus_deregister(cam_sim_path(sc->sim)); - cam_sim_free(sc->sim, FALSE); - mtx_unlock(&sc->sim_mtx); - } - - if (sc->devq != NULL) - cam_simq_free(sc->devq); -#endif return (ENXIO); } @@ -608,15 +500,7 @@ aw_mmc_detach(device_t dev) bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); #ifdef MMCCAM - if (sc->sim != NULL) { - mtx_lock(&sc->sim_mtx); - xpt_bus_deregister(cam_sim_path(sc->sim)); - cam_sim_free(sc->sim, FALSE); - mtx_unlock(&sc->sim_mtx); - } - - if (sc->devq != NULL) - cam_simq_free(sc->devq); + mmc_cam_sim_free(&sc->mmc_sim); #endif return (0); @@ -1357,6 +1241,7 @@ aw_mmc_update_clock(struct aw_mmc_softc *sc, uint32_t clkon) return (0); } +#ifndef MMCCAM static int aw_mmc_switch_vccq(device_t bus, device_t child) { @@ -1390,6 +1275,7 @@ aw_mmc_switch_vccq(device_t bus, device_t child) return (0); } +#endif static int aw_mmc_update_ios(device_t bus, device_t child) @@ -1510,6 +1396,7 @@ aw_mmc_update_ios(device_t bus, device_t child) return (0); } +#ifndef MMCCAM static int aw_mmc_get_ro(device_t bus, device_t child) { @@ -1554,6 +1441,7 @@ aw_mmc_release_host(device_t bus, device_t child) return (0); } +#endif static device_method_t aw_mmc_methods[] = { /* Device interface */ @@ -1566,6 +1454,7 @@ static device_method_t aw_mmc_methods[] = { DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), DEVMETHOD(bus_add_child, bus_generic_add_child), +#ifndef MMCCAM /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), DEVMETHOD(mmcbr_request, aw_mmc_request), @@ -1573,6 +1462,14 @@ static device_method_t aw_mmc_methods[] = { DEVMETHOD(mmcbr_switch_vccq, aw_mmc_switch_vccq), DEVMETHOD(mmcbr_acquire_host, aw_mmc_acquire_host), DEVMETHOD(mmcbr_release_host, aw_mmc_release_host), +#endif + +#ifdef MMCCAM + /* MMCCAM interface */ + DEVMETHOD(mmc_sim_get_tran_settings, aw_mmc_get_tran_settings), + DEVMETHOD(mmc_sim_set_tran_settings, aw_mmc_set_tran_settings), + DEVMETHOD(mmc_sim_cam_request, aw_mmc_cam_request), +#endif DEVMETHOD_END }; From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:01:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 277955F79C4; Tue, 27 Apr 2021 17:01: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 4FV7Mk0FD5z4dXk; Tue, 27 Apr 2021 17:01: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 E57CB1E983; Tue, 27 Apr 2021 17:01: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 13RH1bCt048965; Tue, 27 Apr 2021 17:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH1bYR048964; Tue, 27 Apr 2021 17:01:37 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:01:37 GMT Message-Id: <202104271701.13RH1bYR048964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 7cbdf8a05db7 - main - dwmmc: Add \n to a debug printf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cbdf8a05db7da9c78e8ac74542febc646d24abd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:01:38 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbdf8a05db7da9c78e8ac74542febc646d24abd commit 7cbdf8a05db7da9c78e8ac74542febc646d24abd Author: Emmanuel Vadot AuthorDate: 2021-04-22 19:41:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:01:09 +0000 dwmmc: Add \n to a debug printf --- sys/dev/mmc/host/dwmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 6b635f55bd45..f28d842bd801 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -858,7 +858,7 @@ dwmmc_setup_bus(struct dwmmc_softc *sc, int freq) tout = 1000; do { if (tout-- < 0) { - device_printf(sc->dev, "Failed to update clk"); + device_printf(sc->dev, "Failed to update clk\n"); return (1); } } while (READ4(sc, SDMMC_CMD) & SDMMC_CMD_START); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:01:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 114B15F7A5D; Tue, 27 Apr 2021 17:01: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 4FV7Mh6XJ2z4dM2; Tue, 27 Apr 2021 17:01: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 C5B251E81F; Tue, 27 Apr 2021 17:01: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 13RH1aon048944; Tue, 27 Apr 2021 17:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH1ag8048943; Tue, 27 Apr 2021 17:01:36 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:01:36 GMT Message-Id: <202104271701.13RH1ag8048943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: f1cc48e5da50 - main - mmc: dwmmc: Convert driver to use the mmc_sim interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1cc48e5da505004259343392ee4a27b8338fca4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:01:37 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f1cc48e5da505004259343392ee4a27b8338fca4 commit f1cc48e5da505004259343392ee4a27b8338fca4 Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:56:27 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:00:47 +0000 mmc: dwmmc: Convert driver to use the mmc_sim interface A lot more generic cam related things are done in mmc_sim so this simplify the driver a lot. Differential Revision: https://reviews.freebsd.org/D27487 Reviewed by: kibab --- sys/dev/mmc/host/dwmmc.c | 187 +++++++++---------------------------------- sys/dev/mmc/host/dwmmc_var.h | 6 +- 2 files changed, 42 insertions(+), 151 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index bf494027551a..6b635f55bd45 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -76,6 +76,8 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "mmc_sim_if.h" #endif #include "mmcbr_if.h" @@ -151,14 +153,6 @@ static int dma_stop(struct dwmmc_softc *); static void pio_read(struct dwmmc_softc *, struct mmc_command *); static void pio_write(struct dwmmc_softc *, struct mmc_command *); static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present); -#ifdef MMCCAM -static int dwmmc_switch_vccq(device_t, device_t); -static void dwmmc_cam_action(struct cam_sim *, union ccb *); -static void dwmmc_cam_poll(struct cam_sim *); -static int dwmmc_cam_settran_settings(struct dwmmc_softc *, union ccb *); -static int dwmmc_cam_request(struct dwmmc_softc *, union ccb *); -static void dwmmc_cam_handle_mmcio(struct cam_sim *, union ccb *); -#endif static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -476,7 +470,7 @@ dwmmc_card_task(void *arg, int pending __unused) struct dwmmc_softc *sc = arg; #ifdef MMCCAM - mmccam_start_discovery(sc->sim); + mmc_cam_sim_discover(&sc->mmc_sim); #else DWMMC_LOCK(sc); @@ -771,32 +765,11 @@ dwmmc_attach(device_t dev) #ifdef MMCCAM sc->ccb = NULL; - if ((sc->devq = cam_simq_alloc(1)) == NULL) { - goto fail; + if (mmc_cam_sim_alloc(dev, "dw_mmc", &sc->mmc_sim) != 0) { + device_printf(dev, "cannot alloc cam sim\n"); + dwmmc_detach(dev); + return (ENXIO); } - - mtx_init(&sc->sim_mtx, "dwmmcsim", NULL, MTX_DEF); - sc->sim = cam_sim_alloc_dev(dwmmc_cam_action, dwmmc_cam_poll, - "dw_mmc_sim", sc, dev, - &sc->sim_mtx, 1, 1, sc->devq); - - if (sc->sim == NULL) { - cam_simq_free(sc->devq); - device_printf(dev, "cannot allocate CAM SIM\n"); - goto fail; - } - - mtx_lock(&sc->sim_mtx); - if (xpt_bus_register(sc->sim, sc->dev, 0) != 0) { - device_printf(sc->dev, "cannot register SCSI pass-through bus\n"); - cam_sim_free(sc->sim, FALSE); - cam_simq_free(sc->devq); - mtx_unlock(&sc->sim_mtx); - goto fail; - } - -fail: - mtx_unlock(&sc->sim_mtx); #endif /* * Schedule a card detection as we won't get an interrupt @@ -844,6 +817,10 @@ dwmmc_detach(device_t dev) device_printf(sc->dev, "Cannot disable vqmmc regulator\n"); #endif +#ifdef MMCCAM + mmc_cam_sim_free(&sc->mmc_sim); +#endif + return (0); } @@ -1282,6 +1259,7 @@ dwmmc_request(device_t brdev, device_t reqdev, struct mmc_request *req) return (0); } +#ifndef MMCCAM static int dwmmc_get_ro(device_t brdev, device_t reqdev) { @@ -1319,6 +1297,7 @@ dwmmc_release_host(device_t brdev, device_t reqdev) DWMMC_UNLOCK(sc); return (0); } +#endif /* !MMCCAM */ static int dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) @@ -1445,133 +1424,34 @@ dwmmc_switch_vccq(device_t dev, device_t child) return EINVAL; } -static void -dwmmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) -{ - struct dwmmc_softc *sc; - - sc = cam_sim_softc(sim); - - dwmmc_cam_request(sc, ccb); -} - -static void -dwmmc_cam_action(struct cam_sim *sim, union ccb *ccb) +static int +dwmmc_get_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { struct dwmmc_softc *sc; - sc = cam_sim_softc(sim); - if (sc == NULL) { - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); - return; - } - - mtx_assert(&sc->sim_mtx, MA_OWNED); - - switch (ccb->ccb_h.func_code) { - case XPT_PATH_INQ: - /* XXX: correctly calculate maxio here */ - mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MMC_SECTOR_SIZE); - break; - - case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts = &ccb->cts; - - cts->protocol = PROTO_MMCSD; - cts->protocol_version = 1; - cts->transport = XPORT_MMCSD; - cts->transport_version = 1; - cts->xport_specific.valid = 0; - cts->proto_specific.mmc.host_ocr = sc->host.host_ocr; - cts->proto_specific.mmc.host_f_min = sc->host.f_min; - cts->proto_specific.mmc.host_f_max = sc->host.f_max; - cts->proto_specific.mmc.host_caps = sc->host.caps; - /* XXX: correctly calculate host_max_data */ - cts->proto_specific.mmc.host_max_data = 1; - memcpy(&cts->proto_specific.mmc.ios, &sc->host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_SET_TRAN_SETTINGS: - { - dwmmc_cam_settran_settings(sc, ccb); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_RESET_BUS: { - struct ccb_trans_settings_mmc *cts; - - cts = &ccb->cts.proto_specific.mmc; - cts->ios_valid = MMC_PM; - cts->ios.power_mode = power_off; - /* Power off the MMC bus */ - if (dwmmc_cam_settran_settings(sc, ccb) != 0) { - device_printf(sc->dev,"cannot power down the MMC bus\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } - - /* Soft Reset controller and run initialization again */ - if (dwmmc_ctrl_reset(sc, (SDMMC_CTRL_RESET | - SDMMC_CTRL_FIFO_RESET | - SDMMC_CTRL_DMA_RESET)) != 0) { - device_printf(sc->dev, "cannot reset the controller\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } + sc = device_get_softc(dev); - cts->ios_valid = MMC_PM; - cts->ios.power_mode = power_on; - /* Power off the MMC bus */ - if (dwmmc_cam_settran_settings(sc, ccb) != 0) { - device_printf(sc->dev, "cannot power on the MMC bus\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } + cts->host_ocr = sc->host.host_ocr; + cts->host_f_min = sc->host.f_min; + cts->host_f_max = sc->host.f_max; + cts->host_caps = sc->host.caps; + cts->host_max_data = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + memcpy(&cts->ios, &sc->host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_MMC_IO: - /* - * Here is the HW-dependent part of - * sending the command to the underlying h/w - * At some point in the future an interrupt comes. - * Then the request will be marked as completed. - */ - ccb->ccb_h.status = CAM_REQ_INPROG; - - dwmmc_cam_handle_mmcio(sim, ccb); - return; - /* NOTREACHED */ - break; - default: - ccb->ccb_h.status = CAM_REQ_INVALID; - break; - } - xpt_done(ccb); - return; -} - -static void -dwmmc_cam_poll(struct cam_sim *sim) -{ - return; + return (0); } static int -dwmmc_cam_settran_settings(struct dwmmc_softc *sc, union ccb *ccb) +dwmmc_set_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { + struct dwmmc_softc *sc; struct mmc_ios *ios; struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; int res; + sc = device_get_softc(dev); ios = &sc->host.ios; - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; /* Update only requested fields */ @@ -1622,10 +1502,12 @@ dwmmc_cam_settran_settings(struct dwmmc_softc *sc, union ccb *ccb) } static int -dwmmc_cam_request(struct dwmmc_softc *sc, union ccb *ccb) +dwmmc_cam_request(device_t dev, union ccb *ccb) { + struct dwmmc_softc *sc; struct ccb_mmcio *mmcio; + sc = device_get_softc(dev); mmcio = &ccb->mmcio; DWMMC_LOCK(sc); @@ -1653,19 +1535,28 @@ dwmmc_cam_request(struct dwmmc_softc *sc, union ccb *ccb) return (0); } -#endif +#endif /* MMCCAM */ static device_method_t dwmmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, dwmmc_read_ivar), DEVMETHOD(bus_write_ivar, dwmmc_write_ivar), +#ifndef MMCCAM /* mmcbr_if */ DEVMETHOD(mmcbr_update_ios, dwmmc_update_ios), DEVMETHOD(mmcbr_request, dwmmc_request), DEVMETHOD(mmcbr_get_ro, dwmmc_get_ro), DEVMETHOD(mmcbr_acquire_host, dwmmc_acquire_host), DEVMETHOD(mmcbr_release_host, dwmmc_release_host), +#endif + +#ifdef MMCCAM + /* MMCCAM interface */ + DEVMETHOD(mmc_sim_get_tran_settings, dwmmc_get_tran_settings), + DEVMETHOD(mmc_sim_set_tran_settings, dwmmc_set_tran_settings), + DEVMETHOD(mmc_sim_cam_request, dwmmc_cam_request), +#endif DEVMETHOD_END }; diff --git a/sys/dev/mmc/host/dwmmc_var.h b/sys/dev/mmc/host/dwmmc_var.h index 6c7aae79640d..ef7c91fa628e 100644 --- a/sys/dev/mmc/host/dwmmc_var.h +++ b/sys/dev/mmc/host/dwmmc_var.h @@ -41,6 +41,8 @@ #include "opt_mmccam.h" +#include + enum { HWTYPE_NONE, HWTYPE_ALTERA, @@ -58,9 +60,7 @@ struct dwmmc_softc { struct mtx sc_mtx; #ifdef MMCCAM union ccb * ccb; - struct cam_devq * devq; - struct cam_sim * sim; - struct mtx sim_mtx; + struct mmc_sim mmc_sim; #else struct mmc_request *req; #endif From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:03:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0E55F5F7F9D; Tue, 27 Apr 2021 17:03: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 4FV7Pn70FQz4f2D; Tue, 27 Apr 2021 17:03: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 E2CBF1E71C; Tue, 27 Apr 2021 17:03: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 13RH3Pmg051867; Tue, 27 Apr 2021 17:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH3PWh051866; Tue, 27 Apr 2021 17:03:25 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:03:25 GMT Message-Id: <202104271703.13RH3PWh051866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: e017c1c92c99 - main - mmcprobe_done: Style(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e017c1c92c990a78ac99987a008c9eb3d5620941 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:03:26 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e017c1c92c990a78ac99987a008c9eb3d5620941 commit e017c1c92c990a78ac99987a008c9eb3d5620941 Author: Emmanuel Vadot AuthorDate: 2021-04-23 12:50:04 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:03:09 +0000 mmcprobe_done: Style(9) --- sys/cam/mmc/mmc_xpt.c | 332 +++++++++++++++++++++++++------------------------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index d6b3761cb955..ca5d299d22ab 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -856,101 +856,101 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) PROBE_SET_ACTION(softc, PROBE_SDIO_RESET); break; } - case PROBE_SDIO_RESET: - { + case PROBE_SDIO_RESET: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO_RESET: error %d, CCCR CTL register: %08x\n", - err, mmcio->cmd.resp[0])); - PROBE_SET_ACTION(softc, PROBE_SDIO_INIT); - break; - } - case PROBE_SDIO_INIT: - { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO_RESET: error %d, CCCR CTL register: %08x\n", + err, mmcio->cmd.resp[0])); + PROBE_SET_ACTION(softc, PROBE_SDIO_INIT); + break; + } + case PROBE_SDIO_INIT: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; - - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO_INIT: error %d, %08x %08x %08x %08x\n", - err, mmcio->cmd.resp[0], - mmcio->cmd.resp[1], - mmcio->cmd.resp[2], - mmcio->cmd.resp[3])); - - /* - * Error here means that this card is not SDIO, - * so proceed with memory init as if nothing has happened - */ + struct mmc_params *mmcp = &path->device->mmc_ident_data; + + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO_INIT: error %d, %08x %08x %08x %08x\n", + err, mmcio->cmd.resp[0], + mmcio->cmd.resp[1], + mmcio->cmd.resp[2], + mmcio->cmd.resp[3])); + + /* + * Error here means that this card is not SDIO, + * so proceed with memory init as if nothing has happened + */ if (err != MMC_ERR_NONE) { - PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); - break; + PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); + break; } - mmcp->card_features |= CARD_FEATURE_SDIO; - uint32_t ioifcond = mmcio->cmd.resp[0]; - uint32_t io_ocr = ioifcond & R4_IO_OCR_MASK; - - mmcp->sdio_func_count = R4_IO_NUM_FUNCTIONS(ioifcond); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO card: %d functions\n", mmcp->sdio_func_count)); - if (io_ocr == 0) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR invalid, retrying\n")); - break; /* Retry */ - } - - if (io_ocr != 0 && mmcp->io_ocr == 0) { - mmcp->io_ocr = io_ocr; - break; /* Retry, this time with non-0 OCR */ - } - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR: %08x\n", mmcp->io_ocr)); - - if (ioifcond & R4_IO_MEM_PRESENT) { - /* Combo card -- proceed to memory initialization */ - PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); - } else { - /* No memory portion -- get RCA and select card */ - PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); - } - break; - } - case PROBE_MMC_INIT: - { + mmcp->card_features |= CARD_FEATURE_SDIO; + uint32_t ioifcond = mmcio->cmd.resp[0]; + uint32_t io_ocr = ioifcond & R4_IO_OCR_MASK; + + mmcp->sdio_func_count = R4_IO_NUM_FUNCTIONS(ioifcond); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO card: %d functions\n", mmcp->sdio_func_count)); + if (io_ocr == 0) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO OCR invalid, retrying\n")); + break; /* Retry */ + } + + if (io_ocr != 0 && mmcp->io_ocr == 0) { + mmcp->io_ocr = io_ocr; + break; /* Retry, this time with non-0 OCR */ + } + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO OCR: %08x\n", mmcp->io_ocr)); + + if (ioifcond & R4_IO_MEM_PRESENT) { + /* Combo card -- proceed to memory initialization */ + PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); + } else { + /* No memory portion -- get RCA and select card */ + PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); + } + break; + } + case PROBE_MMC_INIT: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; + struct mmc_params *mmcp = &path->device->mmc_ident_data; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("MMC_INIT: error %d, resp %08x\n", err, mmcio->cmd.resp[0])); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("MMC card, OCR %08x\n", mmcio->cmd.resp[0])); - - if (mmcp->card_ocr == 0) { - /* We haven't sent the OCR to the card yet -- do it */ - mmcp->card_ocr = mmcio->cmd.resp[0]; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("-> sending OCR to card\n")); - break; - } - - if (!(mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY)) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card is still powering up\n")); - break; - } - - mmcp->card_features |= CARD_FEATURE_MMC | CARD_FEATURE_MEMORY; - PROBE_SET_ACTION(softc, PROBE_GET_CID); - break; - } + break; + } + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("MMC card, OCR %08x\n", mmcio->cmd.resp[0])); + + if (mmcp->card_ocr == 0) { + /* We haven't sent the OCR to the card yet -- do it */ + mmcp->card_ocr = mmcio->cmd.resp[0]; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("-> sending OCR to card\n")); + break; + } + + if (!(mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY)) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card is still powering up\n")); + break; + } + + mmcp->card_features |= CARD_FEATURE_MMC | CARD_FEATURE_MEMORY; + PROBE_SET_ACTION(softc, PROBE_GET_CID); + break; + } case PROBE_SEND_APP_OP_COND: { mmcio = &done_ccb->mmcio; @@ -961,41 +961,41 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) ("APP_OP_COND: error %d, resp %08x\n", err, mmcio->cmd.resp[0])); PROBE_SET_ACTION(softc, PROBE_MMC_INIT); - break; - } - - if (!(softc->flags & PROBE_FLAG_ACMD_SENT)) { - /* Don't change the state */ - softc->flags |= PROBE_FLAG_ACMD_SENT; - break; - } - - softc->flags &= ~PROBE_FLAG_ACMD_SENT; - if ((mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY) || - (mmcio->cmd.arg & MMC_OCR_VOLTAGE) == 0) { - struct mmc_params *mmcp = &path->device->mmc_ident_data; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card OCR: %08x\n", mmcio->cmd.resp[0])); - if (mmcp->card_ocr == 0) { - mmcp->card_ocr = mmcio->cmd.resp[0]; - /* Now when we know OCR that we want -- send it to card */ - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("-> sending OCR to card\n")); - } else { - /* We already know the OCR and despite of that we - * are processing the answer to ACMD41 -> move on - */ - PROBE_SET_ACTION(softc, PROBE_GET_CID); - } - /* Getting an answer to ACMD41 means the card has memory */ - mmcp->card_features |= CARD_FEATURE_MEMORY; - - /* Standard capacity vs High Capacity memory card */ - if (mmcio->cmd.resp[0] & MMC_OCR_CCS) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card is SDHC\n")); - mmcp->card_features |= CARD_FEATURE_SDHC; - } + break; + } + + if (!(softc->flags & PROBE_FLAG_ACMD_SENT)) { + /* Don't change the state */ + softc->flags |= PROBE_FLAG_ACMD_SENT; + break; + } + + softc->flags &= ~PROBE_FLAG_ACMD_SENT; + if ((mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY) || + (mmcio->cmd.arg & MMC_OCR_VOLTAGE) == 0) { + struct mmc_params *mmcp = &path->device->mmc_ident_data; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card OCR: %08x\n", mmcio->cmd.resp[0])); + if (mmcp->card_ocr == 0) { + mmcp->card_ocr = mmcio->cmd.resp[0]; + /* Now when we know OCR that we want -- send it to card */ + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("-> sending OCR to card\n")); + } else { + /* We already know the OCR and despite of that we + * are processing the answer to ACMD41 -> move on + */ + PROBE_SET_ACTION(softc, PROBE_GET_CID); + } + /* Getting an answer to ACMD41 means the card has memory */ + mmcp->card_features |= CARD_FEATURE_MEMORY; + + /* Standard capacity vs High Capacity memory card */ + if (mmcio->cmd.resp[0] & MMC_OCR_CCS) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card is SDHC\n")); + mmcp->card_features |= CARD_FEATURE_SDHC; + } /* Whether the card supports 1.8V signaling */ if (mmcio->cmd.resp[0] & MMC_OCR_S18A) { @@ -1022,10 +1022,10 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); } - break; + break; } - case PROBE_GET_CID: /* XXX move to mmc_da */ - { + case PROBE_GET_CID: /* XXX move to mmc_da */ + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1033,45 +1033,45 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_GET_CID: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - struct mmc_params *mmcp = &path->device->mmc_ident_data; - memcpy(mmcp->card_cid, mmcio->cmd.resp, 4 * sizeof(uint32_t)); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("CID %08x%08x%08x%08x\n", - mmcp->card_cid[0], - mmcp->card_cid[1], - mmcp->card_cid[2], - mmcp->card_cid[3])); + break; + } + + struct mmc_params *mmcp = &path->device->mmc_ident_data; + memcpy(mmcp->card_cid, mmcio->cmd.resp, 4 * sizeof(uint32_t)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("CID %08x%08x%08x%08x\n", + mmcp->card_cid[0], + mmcp->card_cid[1], + mmcp->card_cid[2], + mmcp->card_cid[3])); if (mmcp->card_features & CARD_FEATURE_MMC) PROBE_SET_ACTION(softc, PROBE_MMC_SET_RELATIVE_ADDR); else PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); - break; - } - case PROBE_SEND_RELATIVE_ADDR: { + break; + } + case PROBE_SEND_RELATIVE_ADDR: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; - uint16_t rca = mmcio->cmd.resp[0] >> 16; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card published RCA: %u\n", rca)); - path->device->mmc_ident_data.card_rca = rca; + struct mmc_params *mmcp = &path->device->mmc_ident_data; + uint16_t rca = mmcio->cmd.resp[0] >> 16; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card published RCA: %u\n", rca)); + path->device->mmc_ident_data.card_rca = rca; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_SEND_RELATIVE_ADDR: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - /* If memory is present, get CSD, otherwise select card */ - if (mmcp->card_features & CARD_FEATURE_MEMORY) - PROBE_SET_ACTION(softc, PROBE_GET_CSD); - else - PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); + break; + } + + /* If memory is present, get CSD, otherwise select card */ + if (mmcp->card_features & CARD_FEATURE_MEMORY) + PROBE_SET_ACTION(softc, PROBE_GET_CSD); + else + PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); break; - } + } case PROBE_MMC_SET_RELATIVE_ADDR: mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1084,7 +1084,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) path->device->mmc_ident_data.card_rca = MMC_PROPOSED_RCA; PROBE_SET_ACTION(softc, PROBE_GET_CSD); break; - case PROBE_GET_CSD: { + case PROBE_GET_CSD: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1092,33 +1092,33 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_GET_CSD: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - struct mmc_params *mmcp = &path->device->mmc_ident_data; - memcpy(mmcp->card_csd, mmcio->cmd.resp, 4 * sizeof(uint32_t)); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("CSD %08x%08x%08x%08x\n", - mmcp->card_csd[0], - mmcp->card_csd[1], - mmcp->card_csd[2], - mmcp->card_csd[3])); - PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); - break; - } - case PROBE_SELECT_CARD: { + break; + } + + struct mmc_params *mmcp = &path->device->mmc_ident_data; + memcpy(mmcp->card_csd, mmcio->cmd.resp, 4 * sizeof(uint32_t)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("CSD %08x%08x%08x%08x\n", + mmcp->card_csd[0], + mmcp->card_csd[1], + mmcp->card_csd[2], + mmcp->card_csd[3])); + PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); + break; + } + case PROBE_SELECT_CARD: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_SEND_RELATIVE_ADDR: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } + break; + } PROBE_SET_ACTION(softc, PROBE_DONE); - break; - } + break; + } default: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_done: invalid action state 0x%x\n", softc->action)); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:03:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7A9925F801A; Tue, 27 Apr 2021 17:03: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 4FV7Pq1FQjz4dwP; Tue, 27 Apr 2021 17:03: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 126781E63C; Tue, 27 Apr 2021 17:03: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 13RH3QWh051889; Tue, 27 Apr 2021 17:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH3QSE051888; Tue, 27 Apr 2021 17:03:26 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:03:26 GMT Message-Id: <202104271703.13RH3QSE051888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 80020d788834 - main - mmccam: probe*: Style(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80020d7888349168627de066b174450712930ee4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:03:27 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=80020d7888349168627de066b174450712930ee4 commit 80020d7888349168627de066b174450712930ee4 Author: Emmanuel Vadot AuthorDate: 2021-04-23 12:51:13 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:03:16 +0000 mmccam: probe*: Style(9) --- sys/cam/mmc/mmc_xpt.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index ca5d299d22ab..847fd7cdb412 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -90,14 +90,14 @@ static void mmc_proto_debug_out(union ccb *ccb); typedef enum { PROBE_RESET, PROBE_IDENTIFY, - PROBE_SDIO_RESET, + PROBE_SDIO_RESET, PROBE_SEND_IF_COND, - PROBE_SDIO_INIT, - PROBE_MMC_INIT, + PROBE_SDIO_INIT, + PROBE_MMC_INIT, PROBE_SEND_APP_OP_COND, - PROBE_GET_CID, - PROBE_GET_CSD, - PROBE_SEND_RELATIVE_ADDR, + PROBE_GET_CID, + PROBE_GET_CSD, + PROBE_SEND_RELATIVE_ADDR, PROBE_MMC_SET_RELATIVE_ADDR, PROBE_SELECT_CARD, PROBE_DONE, @@ -107,16 +107,16 @@ typedef enum { static char *probe_action_text[] = { "PROBE_RESET", "PROBE_IDENTIFY", - "PROBE_SDIO_RESET", + "PROBE_SDIO_RESET", "PROBE_SEND_IF_COND", - "PROBE_SDIO_INIT", - "PROBE_MMC_INIT", + "PROBE_SDIO_INIT", + "PROBE_MMC_INIT", "PROBE_SEND_APP_OP_COND", - "PROBE_GET_CID", - "PROBE_GET_CSD", - "PROBE_SEND_RELATIVE_ADDR", + "PROBE_GET_CID", + "PROBE_GET_CSD", + "PROBE_SEND_RELATIVE_ADDR", "PROBE_MMC_SET_RELATIVE_ADDR", - "PROBE_SELECT_CARD", + "PROBE_SELECT_CARD", "PROBE_DONE", "PROBE_INVALID" }; From owner-dev-commits-src-main@freebsd.org Tue Apr 27 17:07:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 25A785F81EF; Tue, 27 Apr 2021 17:07: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 4FV7W00bG9z4f0m; Tue, 27 Apr 2021 17:07: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 064861E7C7; Tue, 27 Apr 2021 17:07: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 13RH7tLR052625; Tue, 27 Apr 2021 17:07:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RH7teE052624; Tue, 27 Apr 2021 17:07:55 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:07:55 GMT Message-Id: <202104271707.13RH7teE052624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: f77d8d10115b - main - dwc: Use mii_fdt function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f77d8d10115b0863cc3dfd6e1746c02847d6569d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:07:56 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f77d8d10115b0863cc3dfd6e1746c02847d6569d commit f77d8d10115b0863cc3dfd6e1746c02847d6569d Author: Emmanuel Vadot AuthorDate: 2021-04-11 19:34:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-27 17:07:33 +0000 dwc: Use mii_fdt function Use the helper function to get phy mode and configure dwc accordingly. Reviewed by: ian --- sys/dev/dwc/if_dwc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 776d0d0dc392..429e250f48e8 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef EXT_RESOURCES #include @@ -1559,7 +1560,6 @@ dwc_attach(device_t dev) struct ifnet *ifp; int error, i; uint32_t reg; - char *phy_mode; phandle_t node; uint32_t txpbl, rxpbl, pbl; bool nopblx8 = false; @@ -1574,12 +1574,19 @@ dwc_attach(device_t dev) sc->mactype = IF_DWC_MAC_TYPE(dev); node = ofw_bus_get_node(dev); - if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_mode)) { - if (strcmp(phy_mode, "rgmii") == 0) + switch (mii_fdt_get_contype(node)) { + case MII_CONTYPE_RGMII: + case MII_CONTYPE_RGMII_ID: + case MII_CONTYPE_RGMII_RXID: + case MII_CONTYPE_RGMII_TXID: sc->phy_mode = PHY_MODE_RGMII; - if (strcmp(phy_mode, "rmii") == 0) + break; + case MII_CONTYPE_RMII: sc->phy_mode = PHY_MODE_RMII; - OF_prop_free(phy_mode); + break; + default: + device_printf(dev, "Unsupported MII type\n"); + return (ENXIO); } if (OF_getencprop(node, "snps,pbl", &pbl, sizeof(uint32_t)) <= 0) From owner-dev-commits-src-main@freebsd.org Tue Apr 27 18:18:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6DEC15FA43A; Tue, 27 Apr 2021 18:18: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 4FV94N2gHCz4jjC; Tue, 27 Apr 2021 18:18: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 49D491F43C; Tue, 27 Apr 2021 18:18: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 13RIISrc046594; Tue, 27 Apr 2021 18:18:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RIISTP046593; Tue, 27 Apr 2021 18:18:28 GMT (envelope-from git) Date: Tue, 27 Apr 2021 18:18:28 GMT Message-Id: <202104271818.13RIISTP046593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: f17c4e38f52a - main - Move IOMMU code to a separate pmap module and switch ARM System MMU driver to use it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f17c4e38f52a05ecc23888dbe5ddf4ec2f11a74e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 18:18:28 -0000 The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=f17c4e38f52a05ecc23888dbe5ddf4ec2f11a74e commit f17c4e38f52a05ecc23888dbe5ddf4ec2f11a74e Author: Ruslan Bukin AuthorDate: 2021-04-27 17:59:15 +0000 Commit: Ruslan Bukin CommitDate: 2021-04-27 18:16:09 +0000 Move IOMMU code to a separate pmap module and switch ARM System MMU driver to use it. Add ARM Mali Txxx (Midgard), Gxx (Bifrost) GPU page management code. Sponsored by: UKRI --- sys/arm64/arm64/pmap.c | 178 --------- sys/arm64/include/pmap.h | 6 - sys/arm64/iommu/iommu_pmap.c | 895 +++++++++++++++++++++++++++++++++++++++++++ sys/arm64/iommu/iommu_pmap.h | 51 +++ sys/arm64/iommu/iommu_pte.h | 88 +++++ sys/arm64/iommu/smmu.c | 11 +- sys/conf/files.arm64 | 1 + 7 files changed, 1041 insertions(+), 189 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index bb307b79d4c2..a3be232a56bf 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -3688,184 +3688,6 @@ restart: return (KERN_SUCCESS); } -/* - * Add a single SMMU entry. This function does not sleep. - */ -int -pmap_senter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, - vm_prot_t prot, u_int flags) -{ - pd_entry_t *pde; - pt_entry_t new_l3, orig_l3; - pt_entry_t *l3; - vm_page_t mpte; - int lvl; - int rv; - - PMAP_ASSERT_STAGE1(pmap); - KASSERT(va < VM_MAXUSER_ADDRESS, ("wrong address space")); - - va = trunc_page(va); - new_l3 = (pt_entry_t)(pa | ATTR_DEFAULT | - ATTR_S1_IDX(VM_MEMATTR_DEVICE) | L3_PAGE); - if ((prot & VM_PROT_WRITE) == 0) - new_l3 |= ATTR_S1_AP(ATTR_S1_AP_RO); - new_l3 |= ATTR_S1_XN; /* Execute never. */ - new_l3 |= ATTR_S1_AP(ATTR_S1_AP_USER); - new_l3 |= ATTR_S1_nG; /* Non global. */ - - CTR2(KTR_PMAP, "pmap_senter: %.16lx -> %.16lx", va, pa); - - PMAP_LOCK(pmap); - - /* - * In the case that a page table page is not - * resident, we are creating it here. - */ -retry: - pde = pmap_pde(pmap, va, &lvl); - if (pde != NULL && lvl == 2) { - l3 = pmap_l2_to_l3(pde, va); - } else { - mpte = _pmap_alloc_l3(pmap, pmap_l2_pindex(va), NULL); - if (mpte == NULL) { - CTR0(KTR_PMAP, "pmap_enter: mpte == NULL"); - rv = KERN_RESOURCE_SHORTAGE; - goto out; - } - goto retry; - } - - orig_l3 = pmap_load(l3); - KASSERT(!pmap_l3_valid(orig_l3), ("l3 is valid")); - - /* New mapping */ - pmap_store(l3, new_l3); - pmap_resident_count_inc(pmap, 1); - dsb(ishst); - - rv = KERN_SUCCESS; -out: - PMAP_UNLOCK(pmap); - - return (rv); -} - -/* - * Remove a single SMMU entry. - */ -int -pmap_sremove(pmap_t pmap, vm_offset_t va) -{ - pt_entry_t *pte; - int lvl; - int rc; - - PMAP_LOCK(pmap); - - pte = pmap_pte(pmap, va, &lvl); - KASSERT(lvl == 3, - ("Invalid SMMU pagetable level: %d != 3", lvl)); - - if (pte != NULL) { - pmap_resident_count_dec(pmap, 1); - pmap_clear(pte); - rc = KERN_SUCCESS; - } else - rc = KERN_FAILURE; - - PMAP_UNLOCK(pmap); - - return (rc); -} - -/* - * Remove all the allocated L1, L2 pages from SMMU pmap. - * All the L3 entires must be cleared in advance, otherwise - * this function panics. - */ -void -pmap_sremove_pages(pmap_t pmap) -{ - pd_entry_t l0e, *l1, l1e, *l2, l2e; - pt_entry_t *l3, l3e; - vm_page_t m, m0, m1; - vm_offset_t sva; - vm_paddr_t pa; - vm_paddr_t pa0; - vm_paddr_t pa1; - int i, j, k, l; - - PMAP_LOCK(pmap); - - for (sva = VM_MINUSER_ADDRESS, i = pmap_l0_index(sva); - (i < Ln_ENTRIES && sva < VM_MAXUSER_ADDRESS); i++) { - l0e = pmap->pm_l0[i]; - if ((l0e & ATTR_DESCR_VALID) == 0) { - sva += L0_SIZE; - continue; - } - pa0 = l0e & ~ATTR_MASK; - m0 = PHYS_TO_VM_PAGE(pa0); - l1 = (pd_entry_t *)PHYS_TO_DMAP(pa0); - - for (j = pmap_l1_index(sva); j < Ln_ENTRIES; j++) { - l1e = l1[j]; - if ((l1e & ATTR_DESCR_VALID) == 0) { - sva += L1_SIZE; - continue; - } - if ((l1e & ATTR_DESCR_MASK) == L1_BLOCK) { - sva += L1_SIZE; - continue; - } - pa1 = l1e & ~ATTR_MASK; - m1 = PHYS_TO_VM_PAGE(pa1); - l2 = (pd_entry_t *)PHYS_TO_DMAP(pa1); - - for (k = pmap_l2_index(sva); k < Ln_ENTRIES; k++) { - l2e = l2[k]; - if ((l2e & ATTR_DESCR_VALID) == 0) { - sva += L2_SIZE; - continue; - } - pa = l2e & ~ATTR_MASK; - m = PHYS_TO_VM_PAGE(pa); - l3 = (pt_entry_t *)PHYS_TO_DMAP(pa); - - for (l = pmap_l3_index(sva); l < Ln_ENTRIES; - l++, sva += L3_SIZE) { - l3e = l3[l]; - if ((l3e & ATTR_DESCR_VALID) == 0) - continue; - panic("%s: l3e found for va %jx\n", - __func__, sva); - } - - vm_page_unwire_noq(m1); - vm_page_unwire_noq(m); - pmap_resident_count_dec(pmap, 1); - vm_page_free(m); - pmap_clear(&l2[k]); - } - - vm_page_unwire_noq(m0); - pmap_resident_count_dec(pmap, 1); - vm_page_free(m1); - pmap_clear(&l1[j]); - } - - pmap_resident_count_dec(pmap, 1); - vm_page_free(m0); - pmap_clear(&pmap->pm_l0[i]); - } - - KASSERT(pmap->pm_stats.resident_count == 0, - ("Invalid resident count %jd", pmap->pm_stats.resident_count)); - - PMAP_UNLOCK(pmap); -} - /* * Insert the given physical page (p) at * the specified virtual address (v) in the diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index b05fee999c73..61fba1e3c1f8 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -190,12 +190,6 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, int pmap_fault(pmap_t, uint64_t, uint64_t); -/* System MMU (SMMU). */ -int pmap_senter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, vm_prot_t prot, - u_int flags); -int pmap_sremove(pmap_t pmap, vm_offset_t va); -void pmap_sremove_pages(pmap_t pmap); - struct pcb *pmap_switch(struct thread *, struct thread *); extern void (*pmap_clean_stage2_tlbi)(void); diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c new file mode 100644 index 000000000000..354c213569ff --- /dev/null +++ b/sys/arm64/iommu/iommu_pmap.c @@ -0,0 +1,895 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 Ruslan Bukin + * Copyright (c) 2014-2021 Andrew Turner + * Copyright (c) 2014-2016 The FreeBSD Foundation + * All rights reserved. + * + * This work was supported by Innovate UK project 105694, "Digital Security + * by Design (DSbD) Technology Platform Prototype". + * + * 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$"); + +/* + * Manages physical address maps for ARM SMMUv3 and ARM Mali GPU. + */ + +#include "opt_vm.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define IOMMU_PAGE_SIZE 4096 + +#define NL0PG (IOMMU_PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL1PG (IOMMU_PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL2PG (IOMMU_PAGE_SIZE/(sizeof (pd_entry_t))) +#define NL3PG (IOMMU_PAGE_SIZE/(sizeof (pt_entry_t))) + +#define NUL0E IOMMU_L0_ENTRIES +#define NUL1E (NUL0E * NL1PG) +#define NUL2E (NUL1E * NL2PG) + +#define iommu_l0_pindex(v) (NUL2E + NUL1E + ((v) >> IOMMU_L0_SHIFT)) +#define iommu_l1_pindex(v) (NUL2E + ((v) >> IOMMU_L1_SHIFT)) +#define iommu_l2_pindex(v) ((v) >> IOMMU_L2_SHIFT) + +/* This code assumes all L1 DMAP entries will be used */ +CTASSERT((DMAP_MIN_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MIN_ADDRESS); +CTASSERT((DMAP_MAX_ADDRESS & ~IOMMU_L0_OFFSET) == DMAP_MAX_ADDRESS); + +static vm_page_t _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex); +static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct spglist *free); + +/* + * These load the old table data and store the new value. + * They need to be atomic as the System MMU may write to the table at + * the same time as the CPU. + */ +#define pmap_load(table) (*table) +#define pmap_clear(table) atomic_store_64(table, 0) +#define pmap_store(table, entry) atomic_store_64(table, entry) + +/********************/ +/* Inline functions */ +/********************/ + +static __inline pd_entry_t * +pmap_l0(pmap_t pmap, vm_offset_t va) +{ + + return (&pmap->pm_l0[iommu_l0_index(va)]); +} + +static __inline pd_entry_t * +pmap_l0_to_l1(pd_entry_t *l0, vm_offset_t va) +{ + pd_entry_t *l1; + + l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + return (&l1[iommu_l1_index(va)]); +} + +static __inline pd_entry_t * +pmap_l1(pmap_t pmap, vm_offset_t va) +{ + pd_entry_t *l0; + + l0 = pmap_l0(pmap, va); + if ((pmap_load(l0) & ATTR_DESCR_MASK) != IOMMU_L0_TABLE) + return (NULL); + + return (pmap_l0_to_l1(l0, va)); +} + +static __inline pd_entry_t * +pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) +{ + pd_entry_t l1, *l2p; + + l1 = pmap_load(l1p); + + /* + * The valid bit may be clear if pmap_update_entry() is concurrently + * modifying the entry, so for KVA only the entry type may be checked. + */ + KASSERT(va >= VM_MAX_USER_ADDRESS || (l1 & ATTR_DESCR_VALID) != 0, + ("%s: L1 entry %#lx for %#lx is invalid", __func__, l1, va)); + KASSERT((l1 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, + ("%s: L1 entry %#lx for %#lx is a leaf", __func__, l1, va)); + l2p = (pd_entry_t *)PHYS_TO_DMAP(l1 & ~ATTR_MASK); + return (&l2p[iommu_l2_index(va)]); +} + +static __inline pd_entry_t * +pmap_l2(pmap_t pmap, vm_offset_t va) +{ + pd_entry_t *l1; + + l1 = pmap_l1(pmap, va); + if ((pmap_load(l1) & ATTR_DESCR_MASK) != IOMMU_L1_TABLE) + return (NULL); + + return (pmap_l1_to_l2(l1, va)); +} + +static __inline pt_entry_t * +pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) +{ + pd_entry_t l2; + pt_entry_t *l3p; + + l2 = pmap_load(l2p); + + /* + * The valid bit may be clear if pmap_update_entry() is concurrently + * modifying the entry, so for KVA only the entry type may be checked. + */ + KASSERT(va >= VM_MAX_USER_ADDRESS || (l2 & ATTR_DESCR_VALID) != 0, + ("%s: L2 entry %#lx for %#lx is invalid", __func__, l2, va)); + KASSERT((l2 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, + ("%s: L2 entry %#lx for %#lx is a leaf", __func__, l2, va)); + l3p = (pt_entry_t *)PHYS_TO_DMAP(l2 & ~ATTR_MASK); + return (&l3p[iommu_l3_index(va)]); +} + +/* + * Returns the lowest valid pde for a given virtual address. + * The next level may or may not point to a valid page or block. + */ +static __inline pd_entry_t * +pmap_pde(pmap_t pmap, vm_offset_t va, int *level) +{ + pd_entry_t *l0, *l1, *l2, desc; + + l0 = pmap_l0(pmap, va); + desc = pmap_load(l0) & ATTR_DESCR_MASK; + if (desc != IOMMU_L0_TABLE) { + *level = -1; + return (NULL); + } + + l1 = pmap_l0_to_l1(l0, va); + desc = pmap_load(l1) & ATTR_DESCR_MASK; + if (desc != IOMMU_L1_TABLE) { + *level = 0; + return (l0); + } + + l2 = pmap_l1_to_l2(l1, va); + desc = pmap_load(l2) & ATTR_DESCR_MASK; + if (desc != IOMMU_L2_TABLE) { + *level = 1; + return (l1); + } + + *level = 2; + return (l2); +} + +/* + * Returns the lowest valid pte block or table entry for a given virtual + * address. If there are no valid entries return NULL and set the level to + * the first invalid level. + */ +static __inline pt_entry_t * +pmap_pte(pmap_t pmap, vm_offset_t va, int *level) +{ + pd_entry_t *l1, *l2, desc; + pt_entry_t *l3; + + l1 = pmap_l1(pmap, va); + if (l1 == NULL) { + *level = 0; + return (NULL); + } + desc = pmap_load(l1) & ATTR_DESCR_MASK; + if (desc == IOMMU_L1_BLOCK) { + *level = 1; + return (l1); + } + + if (desc != IOMMU_L1_TABLE) { + *level = 1; + return (NULL); + } + + l2 = pmap_l1_to_l2(l1, va); + desc = pmap_load(l2) & ATTR_DESCR_MASK; + if (desc == IOMMU_L2_BLOCK) { + *level = 2; + return (l2); + } + + if (desc != IOMMU_L2_TABLE) { + *level = 2; + return (NULL); + } + + *level = 3; + l3 = pmap_l2_to_l3(l2, va); + if ((pmap_load(l3) & ATTR_DESCR_MASK) != IOMMU_L3_PAGE) + return (NULL); + + return (l3); +} + +static __inline int +pmap_l3_valid(pt_entry_t l3) +{ + + return ((l3 & ATTR_DESCR_MASK) == IOMMU_L3_PAGE); +} + +CTASSERT(IOMMU_L1_BLOCK == IOMMU_L2_BLOCK); + +static __inline void +pmap_resident_count_inc(pmap_t pmap, int count) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + pmap->pm_stats.resident_count += count; +} + +static __inline void +pmap_resident_count_dec(pmap_t pmap, int count) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(pmap->pm_stats.resident_count >= count, + ("pmap %p resident count underflow %ld %d", pmap, + pmap->pm_stats.resident_count, count)); + pmap->pm_stats.resident_count -= count; +} + +/*************************************************** + * Page table page management routines..... + ***************************************************/ +/* + * Schedule the specified unused page table page to be freed. Specifically, + * add the page to the specified list of pages that will be released to the + * physical memory manager after the TLB has been updated. + */ +static __inline void +pmap_add_delayed_free_list(vm_page_t m, struct spglist *free, + boolean_t set_PG_ZERO) +{ + + if (set_PG_ZERO) + m->flags |= PG_ZERO; + else + m->flags &= ~PG_ZERO; + SLIST_INSERT_HEAD(free, m, plinks.s.ss); +} + +/*************************************************** + * Low level mapping routines..... + ***************************************************/ + +/* + * Decrements a page table page's reference count, which is used to record the + * number of valid page table entries within the page. If the reference count + * drops to zero, then the page table page is unmapped. Returns TRUE if the + * page table page was unmapped and FALSE otherwise. + */ +static inline boolean_t +pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +{ + + --m->ref_count; + if (m->ref_count == 0) { + _pmap_unwire_l3(pmap, va, m, free); + return (TRUE); + } else + return (FALSE); +} + +static void +_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* + * unmap the page table page + */ + if (m->pindex >= (NUL2E + NUL1E)) { + /* l1 page */ + pd_entry_t *l0; + + l0 = pmap_l0(pmap, va); + pmap_clear(l0); + } else if (m->pindex >= NUL2E) { + /* l2 page */ + pd_entry_t *l1; + + l1 = pmap_l1(pmap, va); + pmap_clear(l1); + } else { + /* l3 page */ + pd_entry_t *l2; + + l2 = pmap_l2(pmap, va); + pmap_clear(l2); + } + pmap_resident_count_dec(pmap, 1); + if (m->pindex < NUL2E) { + /* We just released an l3, unhold the matching l2 */ + pd_entry_t *l1, tl1; + vm_page_t l2pg; + + l1 = pmap_l1(pmap, va); + tl1 = pmap_load(l1); + l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + pmap_unwire_l3(pmap, va, l2pg, free); + } else if (m->pindex < (NUL2E + NUL1E)) { + /* We just released an l2, unhold the matching l1 */ + pd_entry_t *l0, tl0; + vm_page_t l1pg; + + l0 = pmap_l0(pmap, va); + tl0 = pmap_load(l0); + l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + pmap_unwire_l3(pmap, va, l1pg, free); + } + + /* + * Put page on a list so that it is released after + * *ALL* TLB shootdown is done + */ + pmap_add_delayed_free_list(m, free, TRUE); +} + +static int +iommu_pmap_pinit_levels(pmap_t pmap, int levels) +{ + vm_page_t m; + + /* + * allocate the l0 page + */ + while ((m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) + vm_wait(NULL); + + pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); + pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); + + if ((m->flags & PG_ZERO) == 0) + pagezero(pmap->pm_l0); + + pmap->pm_root.rt_root = 0; + bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); + + MPASS(levels == 3 || levels == 4); + pmap->pm_levels = levels; + + /* + * Allocate the level 1 entry to use as the root. This will increase + * the refcount on the level 1 page so it won't be removed until + * pmap_release() is called. + */ + if (pmap->pm_levels == 3) { + PMAP_LOCK(pmap); + m = _pmap_alloc_l3(pmap, NUL2E + NUL1E); + PMAP_UNLOCK(pmap); + } + pmap->pm_ttbr = VM_PAGE_TO_PHYS(m); + + return (1); +} + +int +iommu_pmap_pinit(pmap_t pmap) +{ + + return (iommu_pmap_pinit_levels(pmap, 4)); +} + +/* + * This routine is called if the desired page table page does not exist. + * + * If page table page allocation fails, this routine may sleep before + * returning NULL. It sleeps only if a lock pointer was given. + * + * Note: If a page allocation fails at page table level two or three, + * one or two pages may be held during the wait, only to be released + * afterwards. This conservative approach is easily argued to avoid + * race conditions. + */ +static vm_page_t +_pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) +{ + vm_page_t m, l1pg, l2pg; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + /* + * Allocate a page table page. + */ + if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { + /* + * Indicate the need to retry. While waiting, the page table + * page may have been allocated. + */ + return (NULL); + } + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + + /* + * Because of AArch64's weak memory consistency model, we must have a + * barrier here to ensure that the stores for zeroing "m", whether by + * pmap_zero_page() or an earlier function, are visible before adding + * "m" to the page table. Otherwise, a page table walk by another + * processor's MMU could see the mapping to "m" and a stale, non-zero + * PTE within "m". + */ + dmb(ishst); + + /* + * Map the pagetable page into the process address space, if + * it isn't already there. + */ + + if (ptepindex >= (NUL2E + NUL1E)) { + pd_entry_t *l0; + vm_pindex_t l0index; + + l0index = ptepindex - (NUL2E + NUL1E); + l0 = &pmap->pm_l0[l0index]; + pmap_store(l0, VM_PAGE_TO_PHYS(m) | IOMMU_L0_TABLE); + } else if (ptepindex >= NUL2E) { + vm_pindex_t l0index, l1index; + pd_entry_t *l0, *l1; + pd_entry_t tl0; + + l1index = ptepindex - NUL2E; + l0index = l1index >> IOMMU_L0_ENTRIES_SHIFT; + + l0 = &pmap->pm_l0[l0index]; + tl0 = pmap_load(l0); + if (tl0 == 0) { + /* recurse for allocating page dir */ + if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index) + == NULL) { + vm_page_unwire_noq(m); + vm_page_free_zero(m); + return (NULL); + } + } else { + l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + l1pg->ref_count++; + } + + l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + l1 = &l1[ptepindex & Ln_ADDR_MASK]; + pmap_store(l1, VM_PAGE_TO_PHYS(m) | IOMMU_L1_TABLE); + } else { + vm_pindex_t l0index, l1index; + pd_entry_t *l0, *l1, *l2; + pd_entry_t tl0, tl1; + + l1index = ptepindex >> Ln_ENTRIES_SHIFT; + l0index = l1index >> IOMMU_L0_ENTRIES_SHIFT; + + l0 = &pmap->pm_l0[l0index]; + tl0 = pmap_load(l0); + if (tl0 == 0) { + /* recurse for allocating page dir */ + if (_pmap_alloc_l3(pmap, NUL2E + l1index) == NULL) { + vm_page_unwire_noq(m); + vm_page_free_zero(m); + return (NULL); + } + tl0 = pmap_load(l0); + l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = &l1[l1index & Ln_ADDR_MASK]; + } else { + l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = &l1[l1index & Ln_ADDR_MASK]; + tl1 = pmap_load(l1); + if (tl1 == 0) { + /* recurse for allocating page dir */ + if (_pmap_alloc_l3(pmap, NUL2E + l1index) + == NULL) { + vm_page_unwire_noq(m); + vm_page_free_zero(m); + return (NULL); + } + } else { + l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + l2pg->ref_count++; + } + } + + l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); + l2 = &l2[ptepindex & Ln_ADDR_MASK]; + pmap_store(l2, VM_PAGE_TO_PHYS(m) | IOMMU_L2_TABLE); + } + + pmap_resident_count_inc(pmap, 1); + + return (m); +} + +/*************************************************** + * Pmap allocation/deallocation routines. + ***************************************************/ + +/* + * Release any resources held by the given physical map. + * Called when a pmap initialized by pmap_pinit is being released. + * Should only be called if the map contains no valid mappings. + */ +void +iommu_pmap_release(pmap_t pmap) +{ + boolean_t rv; + struct spglist free; + vm_page_t m; + + if (pmap->pm_levels != 4) { + KASSERT(pmap->pm_stats.resident_count == 1, + ("pmap_release: pmap resident count %ld != 0", + pmap->pm_stats.resident_count)); + KASSERT((pmap->pm_l0[0] & ATTR_DESCR_VALID) == ATTR_DESCR_VALID, + ("pmap_release: Invalid l0 entry: %lx", pmap->pm_l0[0])); + + SLIST_INIT(&free); + m = PHYS_TO_VM_PAGE(pmap->pm_ttbr); + PMAP_LOCK(pmap); + rv = pmap_unwire_l3(pmap, 0, m, &free); + PMAP_UNLOCK(pmap); + MPASS(rv == TRUE); + vm_page_free_pages_toq(&free, true); + } + + KASSERT(pmap->pm_stats.resident_count == 0, + ("pmap_release: pmap resident count %ld != 0", + pmap->pm_stats.resident_count)); + KASSERT(vm_radix_is_empty(&pmap->pm_root), + ("pmap_release: pmap has reserved page table page(s)")); + + m = PHYS_TO_VM_PAGE(pmap->pm_l0_paddr); + vm_page_unwire_noq(m); + vm_page_free_zero(m); +} + +/*************************************************** + * page management routines. + ***************************************************/ + +/* + * Add a single Mali GPU entry. This function does not sleep. + */ +int +pmap_gpu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + vm_prot_t prot, u_int flags) +{ + pd_entry_t *pde; + pt_entry_t new_l3, orig_l3; + pt_entry_t *l3; + vm_page_t mpte; + pd_entry_t *l1p; + pd_entry_t *l2p; + int lvl; + int rv; + + KASSERT(pmap != kernel_pmap, ("kernel pmap used for GPU")); + KASSERT(va < VM_MAXUSER_ADDRESS, ("wrong address space")); + KASSERT((va & PAGE_MASK) == 0, ("va is misaligned")); + KASSERT((pa & PAGE_MASK) == 0, ("pa is misaligned")); + + new_l3 = (pt_entry_t)(pa | ATTR_SH(ATTR_SH_IS) | IOMMU_L3_BLOCK); + + if ((prot & VM_PROT_WRITE) != 0) + new_l3 |= ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE); + if ((prot & VM_PROT_READ) != 0) + new_l3 |= ATTR_S2_S2AP(ATTR_S2_S2AP_READ); + if ((prot & VM_PROT_EXECUTE) == 0) + new_l3 |= ATTR_S2_XN(ATTR_S2_XN_ALL); + + CTR2(KTR_PMAP, "pmap_gpu_enter: %.16lx -> %.16lx", va, pa); + + PMAP_LOCK(pmap); + + /* + * In the case that a page table page is not + * resident, we are creating it here. + */ +retry: + pde = pmap_pde(pmap, va, &lvl); + if (pde != NULL && lvl == 2) { + l3 = pmap_l2_to_l3(pde, va); + } else { + mpte = _pmap_alloc_l3(pmap, iommu_l2_pindex(va)); + if (mpte == NULL) { + CTR0(KTR_PMAP, "pmap_enter: mpte == NULL"); + rv = KERN_RESOURCE_SHORTAGE; + goto out; + } + + /* + * Ensure newly created l1, l2 are visible to GPU. + * l0 is already visible by similar call in panfrost driver. + * The cache entry for l3 handled below. + */ + + l1p = pmap_l1(pmap, va); + l2p = pmap_l2(pmap, va); + cpu_dcache_wb_range((vm_offset_t)l1p, sizeof(pd_entry_t)); + cpu_dcache_wb_range((vm_offset_t)l2p, sizeof(pd_entry_t)); + + goto retry; + } + + orig_l3 = pmap_load(l3); + KASSERT(!pmap_l3_valid(orig_l3), ("l3 is valid")); + + /* New mapping */ + pmap_store(l3, new_l3); + + cpu_dcache_wb_range((vm_offset_t)l3, sizeof(pt_entry_t)); + + pmap_resident_count_inc(pmap, 1); + dsb(ishst); + + rv = KERN_SUCCESS; +out: + PMAP_UNLOCK(pmap); + + return (rv); +} + +/* + * Remove a single Mali GPU entry. + */ +int +pmap_gpu_remove(pmap_t pmap, vm_offset_t va) +{ + pd_entry_t *pde; + pt_entry_t *pte; + int lvl; + int rc; + + KASSERT((va & PAGE_MASK) == 0, ("va is misaligned")); + KASSERT(pmap != kernel_pmap, ("kernel pmap used for GPU")); + + PMAP_LOCK(pmap); + + pde = pmap_pde(pmap, va, &lvl); + if (pde == NULL || lvl != 2) { + rc = KERN_FAILURE; + goto out; + } + + pte = pmap_l2_to_l3(pde, va); + + pmap_resident_count_dec(pmap, 1); + pmap_clear(pte); + cpu_dcache_wb_range((vm_offset_t)pte, sizeof(pt_entry_t)); + rc = KERN_SUCCESS; + +out: + PMAP_UNLOCK(pmap); + + return (rc); +} + +/* + * Add a single SMMU entry. This function does not sleep. + */ +int +pmap_smmu_enter(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + vm_prot_t prot, u_int flags) +{ + pd_entry_t *pde; + pt_entry_t new_l3, orig_l3; + pt_entry_t *l3; + vm_page_t mpte; + int lvl; + int rv; + + KASSERT(va < VM_MAXUSER_ADDRESS, ("wrong address space")); + + va = trunc_page(va); + new_l3 = (pt_entry_t)(pa | ATTR_DEFAULT | + ATTR_S1_IDX(VM_MEMATTR_DEVICE) | IOMMU_L3_PAGE); + if ((prot & VM_PROT_WRITE) == 0) + new_l3 |= ATTR_S1_AP(ATTR_S1_AP_RO); + new_l3 |= ATTR_S1_XN; /* Execute never. */ + new_l3 |= ATTR_S1_AP(ATTR_S1_AP_USER); + new_l3 |= ATTR_S1_nG; /* Non global. */ + + CTR2(KTR_PMAP, "pmap_senter: %.16lx -> %.16lx", va, pa); + + PMAP_LOCK(pmap); + + /* *** 359 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Apr 27 19:19:02 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B88615FD806; Tue, 27 Apr 2021 19:19: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 4FVBQG4DN2z4nM7; Tue, 27 Apr 2021 19:19: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 6FEA01FF67; Tue, 27 Apr 2021 19:19: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 13RJJ2aM028654; Tue, 27 Apr 2021 19:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RJJ20b028653; Tue, 27 Apr 2021 19:19:02 GMT (envelope-from git) Date: Tue, 27 Apr 2021 19:19:02 GMT Message-Id: <202104271919.13RJJ20b028653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1b00608b264f - main - Merge llvm commits for kernel address and memory sanitizer support 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/main X-Git-Reftype: branch X-Git-Commit: 1b00608b264f1fac846e571e23d8ef7134834638 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 19:19:02 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1b00608b264f1fac846e571e23d8ef7134834638 commit 1b00608b264f1fac846e571e23d8ef7134834638 Author: Dimitry Andric AuthorDate: 2021-04-27 19:18:13 +0000 Commit: Dimitry Andric CommitDate: 2021-04-27 19:18:13 +0000 Merge llvm commits for kernel address and memory sanitizer support Merge commit 99eca1bd9c7a from llvm git (by Mark Johnston): [Driver] Enable kernel address and memory sanitizers on FreeBSD Test Plan: using kernel ASAN and MSAN implementations in FreeBSD Reviewed By: emaste, dim, arichardson Differential Revision: https://reviews.llvm.org/D98286 Merge commit f511dc75e4c1 from llvm git (by Mark Johnston): [asan] Add an offset for the kernel address sanitizer on FreeBSD This is based on a port of the sanitizer runtime to the FreeBSD kernel that has been commited as https://cgit.freebsd.org/src/commit/?id=38da497a4dfcf1979c8c2b0e9f3fa0564035c147 and the following commits. Reviewed By: emaste, dim Differential Revision: https://reviews.llvm.org/D98285 Requested by: markj MFC after: 3 days --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp | 8 +++++++- .../llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp index 6d8e25470e28..baefb1607619 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -459,6 +459,7 @@ bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; } bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); } SanitizerMask FreeBSD::getSupportedSanitizers() const { + const bool IsAArch64 = getTriple().getArch() == llvm::Triple::aarch64; const bool IsX86 = getTriple().getArch() == llvm::Triple::x86; const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64; const bool IsMIPS64 = getTriple().isMIPS64(); @@ -477,8 +478,13 @@ SanitizerMask FreeBSD::getSupportedSanitizers() const { Res |= SanitizerKind::Fuzzer; Res |= SanitizerKind::FuzzerNoLink; } - if (IsX86_64) + if (IsAArch64 || IsX86_64) { + Res |= SanitizerKind::KernelAddress; + Res |= SanitizerKind::KernelMemory; + } + if (IsX86_64) { Res |= SanitizerKind::Memory; + } return Res; } diff --git a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 1557fad4d372..5ce21cc3616a 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -107,6 +107,7 @@ static const uint64_t kMIPS64_ShadowOffset64 = 1ULL << 37; static const uint64_t kAArch64_ShadowOffset64 = 1ULL << 36; static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30; static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46; +static const uint64_t kFreeBSDKasan_ShadowOffset64 = 0xdffff7c000000000; static const uint64_t kNetBSD_ShadowOffset32 = 1ULL << 30; static const uint64_t kNetBSD_ShadowOffset64 = 1ULL << 46; static const uint64_t kNetBSDKasan_ShadowOffset64 = 0xdfff900000000000; @@ -489,9 +490,12 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize, Mapping.Offset = kPPC64_ShadowOffset64; else if (IsSystemZ) Mapping.Offset = kSystemZ_ShadowOffset64; - else if (IsFreeBSD && !IsMIPS64) - Mapping.Offset = kFreeBSD_ShadowOffset64; - else if (IsNetBSD) { + else if (IsFreeBSD && !IsMIPS64) { + if (IsKasan) + Mapping.Offset = kFreeBSDKasan_ShadowOffset64; + else + Mapping.Offset = kFreeBSD_ShadowOffset64; + } else if (IsNetBSD) { if (IsKasan) Mapping.Offset = kNetBSDKasan_ShadowOffset64; else From owner-dev-commits-src-main@freebsd.org Tue Apr 27 21:26:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 26D13622A51; Tue, 27 Apr 2021 21:26: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 4FVFDm0bGBz4vSY; Tue, 27 Apr 2021 21:26: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 0763F2200D; Tue, 27 Apr 2021 21:26: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 13RLPxTj099398; Tue, 27 Apr 2021 21:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RLPx0w099397; Tue, 27 Apr 2021 21:25:59 GMT (envelope-from git) Date: Tue, 27 Apr 2021 21:25:59 GMT Message-Id: <202104272125.13RLPx0w099397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brandon Bergren Subject: git: 6e1abda231bf - main - riscv: Remove old qemu compatibility code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e1abda231bf2a80c010aaff1b99254467420e50 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 21:26:00 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=6e1abda231bf2a80c010aaff1b99254467420e50 commit 6e1abda231bf2a80c010aaff1b99254467420e50 Author: Brandon Bergren AuthorDate: 2021-04-27 16:07:34 +0000 Commit: Brandon Bergren CommitDate: 2021-04-27 21:22:04 +0000 riscv: Remove old qemu compatibility code During early qemu development, the /soc node was marked as compatible with "riscv-virtio-soc" instead of "simple-bus". This was changed in qemu 53f54508dae6 in Sep 2018, and predates the baseline required qemu version (5.0) for riscv by a wide margin. The generic simplebus code handles attachment in all cases nowadays. Sponsored by: Tag1 Consulting, Inc. Reviewed by: jrtc27, mhorne Differential Revision: https://reviews.freebsd.org/D30011 --- sys/conf/files.riscv | 1 - sys/riscv/riscv/soc.c | 112 -------------------------------------------------- 2 files changed, 113 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 7ecea016b9a3..c2d911cd68de 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -59,7 +59,6 @@ riscv/riscv/pmap.c standard riscv/riscv/riscv_console.c optional rcons riscv/riscv/riscv_syscon.c optional ext_resources syscon riscv_syscon fdt riscv/riscv/sbi.c standard -riscv/riscv/soc.c standard riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard riscv/riscv/swtch.S standard diff --git a/sys/riscv/riscv/soc.c b/sys/riscv/riscv/soc.c deleted file mode 100644 index 52d9c64a03de..000000000000 --- a/sys/riscv/riscv/soc.c +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2018 Ruslan Bukin - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * 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 -#include -#include -#include - -#include -#include - -struct soc_softc { - struct simplebus_softc simplebus_sc; - device_t dev; -}; - -static int -soc_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "riscv-virtio-soc")) - return (ENXIO); - - device_set_desc(dev, "RISC-V SoC"); - - return (BUS_PROBE_DEFAULT); -} - -static int -soc_attach(device_t dev) -{ - struct soc_softc *sc; - phandle_t node; - - sc = device_get_softc(dev); - sc->dev = dev; - - node = ofw_bus_get_node(dev); - if (node == -1) - return (ENXIO); - - simplebus_init(dev, node); - - /* - * Allow devices to identify. - */ - bus_generic_probe(dev); - - /* - * Now walk the OFW tree and attach top-level devices. - */ - for (node = OF_child(node); node > 0; node = OF_peer(node)) - simplebus_add_device(dev, node, 0, NULL, -1, NULL); - - return (bus_generic_attach(dev)); -} - -static int -soc_detach(device_t dev) -{ - - return (0); -} - -static device_method_t soc_methods[] = { - DEVMETHOD(device_probe, soc_probe), - DEVMETHOD(device_attach, soc_attach), - DEVMETHOD(device_detach, soc_detach), - DEVMETHOD_END -}; - -DEFINE_CLASS_1(soc, soc_driver, soc_methods, sizeof(struct soc_softc), - simplebus_driver); -static devclass_t soc_devclass; -EARLY_DRIVER_MODULE(soc, simplebus, soc_driver, soc_devclass, 0, 0, - BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); -MODULE_VERSION(soc, 1); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 22:10:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0822B623832; Tue, 27 Apr 2021 22:10: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 4FVGDG6s83z3CnR; Tue, 27 Apr 2021 22:10: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 DE22D223EA; Tue, 27 Apr 2021 22:10: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 13RMAcWs061418; Tue, 27 Apr 2021 22:10:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RMAclk061417; Tue, 27 Apr 2021 22:10:38 GMT (envelope-from git) Date: Tue, 27 Apr 2021 22:10:38 GMT Message-Id: <202104272210.13RMAclk061417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8a0d57baecf7 - main - [fib algo] Delay algo init at fib growth to to allow to reliably use rib KPI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a0d57baecf70aa7f49b0b1468f6264c75d8e6df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 22:10:39 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8a0d57baecf70aa7f49b0b1468f6264c75d8e6df commit 8a0d57baecf70aa7f49b0b1468f6264c75d8e6df Author: Alexander V. Chernikov AuthorDate: 2021-04-25 10:22:45 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-27 22:10:08 +0000 [fib algo] Delay algo init at fib growth to to allow to reliably use rib KPI. Currently, most of the rib(9) KPI does not use rnh pointers, using fibnum and family parameters to determine the rib pointer instead. This works well except for the case when we initialize new rib pointers during fib growth. In that case, there is no mapping between fib/family and the new rib, as an entirely new rib pointer array is populated. Address this by delaying fib algo initialization till after switching to the new pointer array and updating the number of fibs. Set datapath pointer to the dummy function, so the potential callers won't crash the kernel in the brief moment when the rib exists, but no fib algo is attached. This change allows to avoid creating duplicates of existing rib functions, with altered signature. Differential Revision: https://reviews.freebsd.org/D29969 MFC after: 1 week --- sys/net/route/fib_algo.c | 89 ++++++++++++++++++++++++++++++++------------ sys/net/route/route_tables.c | 17 +++++---- sys/net/route/route_var.h | 3 +- 3 files changed, 76 insertions(+), 33 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 9fdc80001986..837ea7c2b43b 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1538,6 +1538,12 @@ SYSCTL_PROC(_net_route_algo_inet6, OID_AUTO, algo, set_algo_inet6_sysctl_handler, "A", "Set IPv6 lookup algo"); #endif +static struct nhop_object * +dummy_lookup(void *algo_data, const struct flm_lookup_key key, uint32_t scopeid) +{ + return (NULL); +} + static void destroy_fdh_epoch(epoch_context_t ctx) { @@ -1556,8 +1562,15 @@ alloc_fib_dp_array(uint32_t num_tables, bool waitok) sz = sizeof(struct fib_dp_header); sz += sizeof(struct fib_dp) * num_tables; fdh = malloc(sz, M_RTABLE, (waitok ? M_WAITOK : M_NOWAIT) | M_ZERO); - if (fdh != NULL) + if (fdh != NULL) { fdh->fdh_num_tables = num_tables; + /* + * Set dummy lookup function ptr always returning NULL, so + * we can delay algo init. + */ + for (uint32_t i = 0; i < num_tables; i++) + fdh->fdh_idx[i].f = dummy_lookup; + } return (fdh); } @@ -1933,19 +1946,18 @@ fib_check_best_algo(struct rib_head *rh, struct fib_lookup_module *orig_flm) * Called when new route table is created. * Selects, allocates and attaches fib algo for the table. */ -int -fib_select_algo_initial(struct rib_head *rh) +static bool +fib_select_algo_initial(struct rib_head *rh, struct fib_dp *dp) { struct fib_lookup_module *flm; struct fib_data *fd = NULL; enum flm_op_result result; struct epoch_tracker et; - int error = 0; flm = fib_check_best_algo(rh, NULL); if (flm == NULL) { RH_PRINTF(LOG_CRIT, rh, "no algo selected"); - return (ENOENT); + return (false); } RH_PRINTF(LOG_INFO, rh, "selected algo %s", flm->flm_name); @@ -1956,29 +1968,58 @@ fib_select_algo_initial(struct rib_head *rh) NET_EPOCH_EXIT(et); RH_PRINTF(LOG_DEBUG, rh, "result=%d fd=%p", result, fd); - if (result == FLM_SUCCESS) { - - /* - * Attach datapath directly to avoid multiple reallocations - * during fib growth - */ - struct fib_dp_header *fdp; - struct fib_dp **pdp; - - pdp = get_family_dp_ptr(rh->rib_family); - if (pdp != NULL) { - fdp = get_fib_dp_header(*pdp); - fdp->fdh_idx[fd->fd_fibnum] = fd->fd_dp; - FD_PRINTF(LOG_INFO, fd, "datapath attached"); - } - } else { - error = EINVAL; + if (result == FLM_SUCCESS) + *dp = fd->fd_dp; + else RH_PRINTF(LOG_CRIT, rh, "unable to setup algo %s", flm->flm_name); - } fib_unref_algo(flm); - return (error); + return (result == FLM_SUCCESS); +} + +/* + * Sets up fib algo instances for the non-initialized RIBs in the @family. + * Allocates temporary datapath index to amortize datapaint index updates + * with large @num_tables. + */ +void +fib_setup_family(int family, uint32_t num_tables) +{ + struct fib_dp_header *new_fdh = alloc_fib_dp_array(num_tables, false); + if (new_fdh == NULL) { + ALGO_PRINTF(LOG_CRIT, "Unable to setup framework for %s", print_family(family)); + return; + } + + for (int i = 0; i < num_tables; i++) { + struct rib_head *rh = rt_tables_get_rnh(i, family); + if (rh->rib_algo_init) + continue; + if (!fib_select_algo_initial(rh, &new_fdh->fdh_idx[i])) + continue; + + rh->rib_algo_init = true; + } + + FIB_MOD_LOCK(); + struct fib_dp **pdp = get_family_dp_ptr(family); + struct fib_dp_header *old_fdh = get_fib_dp_header(*pdp); + + /* Update the items not touched by the new init, from the old data pointer */ + for (int i = 0; i < num_tables; i++) { + if (new_fdh->fdh_idx[i].f == dummy_lookup) + new_fdh->fdh_idx[i] = old_fdh->fdh_idx[i]; + } + + /* Ensure all index writes have completed */ + atomic_thread_fence_rel(); + /* Set new datapath pointer */ + *pdp = &new_fdh->fdh_idx[0]; + + FIB_MOD_UNLOCK(); + + fib_epoch_call(destroy_fdh_epoch, &old_fdh->fdh_epoch_ctx); } /* diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index e3743d55404d..c9a9d6a915eb 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -214,13 +214,6 @@ grow_rtables(uint32_t num_tables) if (rh == NULL) log(LOG_ERR, "unable to create routing table for %d.%d\n", dom->dom_family, i); -#ifdef FIB_ALGO - if (fib_select_algo_initial(rh) != 0) { - log(LOG_ERR, "unable to select algo for table %d.%d\n", - dom->dom_family, i); - // TODO: detach table - } -#endif *prnh = rh; } } @@ -238,9 +231,17 @@ grow_rtables(uint32_t num_tables) atomic_thread_fence_rel(); epoch_wait_preempt(net_epoch_preempt); - /* Finally, set number of fibs to a new value */ + /* Set number of fibs to a new value */ V_rt_numfibs = num_tables; +#ifdef FIB_ALGO + /* Attach fib algo to the new rtables */ + for (dom = domains; dom; dom = dom->dom_next) { + if (dom->dom_rtattach != NULL) + fib_setup_family(dom->dom_family, num_tables); + } +#endif + if (old_rt_tables != NULL) free(old_rt_tables, M_RTABLE); } diff --git a/sys/net/route/route_var.h b/sys/net/route/route_var.h index 86fc64493e75..b29b79c88864 100644 --- a/sys/net/route/route_var.h +++ b/sys/net/route/route_var.h @@ -74,6 +74,7 @@ struct rib_head { rt_gen_t rnh_gen_rib; /* fib algo: rib generation counter */ uint32_t rib_dying:1; /* rib is detaching */ uint32_t rib_algo_fixed:1;/* fixed algorithm */ + uint32_t rib_algo_init:1;/* algo init done */ struct nh_control *nh_control; /* nexthop subsystem data */ CK_STAILQ_HEAD(, rib_subscription) rnh_subscribers;/* notification subscribers */ }; @@ -326,7 +327,7 @@ int rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum); /* lookup_framework.c */ void fib_grow_rtables(uint32_t new_num_tables); -int fib_select_algo_initial(struct rib_head *rh); +void fib_setup_family(int family, uint32_t num_tables); void fib_destroy_rib(struct rib_head *rh); void vnet_fib_init(void); void vnet_fib_destroy(void); From owner-dev-commits-src-main@freebsd.org Tue Apr 27 22:30:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 88A596241DD; Tue, 27 Apr 2021 22:30: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 4FVGfj35Msz3DT0; Tue, 27 Apr 2021 22:30: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 58BA022C63; Tue, 27 Apr 2021 22:30: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 13RMU57S081356; Tue, 27 Apr 2021 22:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RMU5QK081353; Tue, 27 Apr 2021 22:30:05 GMT (envelope-from git) Date: Tue, 27 Apr 2021 22:30:05 GMT Message-Id: <202104272230.13RMU5QK081353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: eea55de7b108 - main - e1000: Rework em_msi_link interrupt filter 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/main X-Git-Reftype: branch X-Git-Commit: eea55de7b10808b86277d7fdbed2d05d3c6db1b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 22:30:05 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=eea55de7b10808b86277d7fdbed2d05d3c6db1b2 commit eea55de7b10808b86277d7fdbed2d05d3c6db1b2 Author: Kevin Bowling AuthorDate: 2021-04-25 08:22:23 +0000 Commit: Kevin Bowling CommitDate: 2021-04-27 22:29:39 +0000 e1000: Rework em_msi_link interrupt filter * Fix 82574 Link Status Changes, carrying the OTHER mask bit around as needed. * Move igb-class LSC re-arming out of FAST back into the handler. * Clarify spurious/other interrupt re-arms in FAST. In MSI-X mode, 82574 and igb-class devices use an interrupt filter to handle Link Status Changes. We want to do LSC re-arms in the handler to take advantage of autoclear (EIAC) single shot behavior. 82574 uses 'Other' in ICR and IMS for LSC interrupt types when in MSI-X mode, so we need to set and re-arm the 'Other' bit during attach and after ICR reads in the FAST handler if not an LSC or after handling on LSC due to autoclearing. This work was primarily done to address the referenced PR, but inspired some clarification and improvement for igb-class devices once the intentions of previous bug fix attempts became clearer. PR: 211219 Reported by: Alexey Tested by: kbowling (I210 lagg), markj (I210) Approved by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29943 --- sys/dev/e1000/if_em.c | 40 ++++++++++++++++++++++++---------------- sys/dev/e1000/if_em.h | 2 -- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index db022126844a..52d20e57519a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1504,6 +1504,7 @@ em_msix_link(void *arg) { struct adapter *adapter = arg; u32 reg_icr; + bool notlink = false; ++adapter->link_irq; MPASS(adapter->hw.back != NULL); @@ -1512,15 +1513,19 @@ em_msix_link(void *arg) if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; - if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { + if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) em_handle_link(adapter->ctx); - } else if (adapter->hw.mac.type == e1000_82574) { - /* Only re-arm 82574 if em_if_update_admin_status() won't. */ - E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | - E1000_IMS_LSC); - } + else + notlink = true; - if (adapter->hw.mac.type == e1000_82574) { + /* Re-arm for other/spurious interrupts */ + if (notlink && adapter->hw.mac.type >= igb_mac_min) { + E1000_WRITE_REG(&adapter->hw, E1000_IMS, E1000_IMS_LSC); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, adapter->link_mask); + } else if (adapter->hw.mac.type == e1000_82574) { + if (notlink) + E1000_WRITE_REG(&adapter->hw, E1000_IMS, E1000_IMS_LSC | + E1000_IMS_OTHER); /* * Because we must read the ICR for this interrupt it may * clear other causes using autoclear, for this reason we @@ -1528,10 +1533,6 @@ em_msix_link(void *arg) */ if (reg_icr) E1000_WRITE_REG(&adapter->hw, E1000_ICS, adapter->ims); - } else { - /* Re-arm unconditionally */ - E1000_WRITE_REG(&adapter->hw, E1000_IMS, E1000_IMS_LSC); - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, adapter->link_mask); } return (FILTER_HANDLED); @@ -1876,9 +1877,13 @@ em_if_update_admin_status(if_ctx_t ctx) if (hw->mac.type < em_mac_min) lem_smartspeed(adapter); - else if (hw->mac.type == e1000_82574 && + else if (hw->mac.type >= igb_mac_min && + adapter->intr_type == IFLIB_INTR_MSIX) { + E1000_WRITE_REG(&adapter->hw, E1000_IMS, E1000_IMS_LSC); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, adapter->link_mask); + } else if (hw->mac.type == e1000_82574 && adapter->intr_type == IFLIB_INTR_MSIX) - E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); + E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC | E1000_IMS_OTHER); } static void @@ -2090,7 +2095,10 @@ em_if_msix_intr_assign(if_ctx_t ctx, int msix) if (adapter->hw.mac.type < igb_mac_min) { adapter->ivars |= (8 | rx_vectors) << 16; adapter->ivars |= 0x80000000; + /* Enable the "Other" interrupt type for link status change */ + adapter->ims |= E1000_IMS_OTHER; } + return (0); fail: iflib_irq_free(ctx, &adapter->irq); @@ -3467,8 +3475,8 @@ em_if_intr_enable(if_ctx_t ctx) struct e1000_hw *hw = &adapter->hw; u32 ims_mask = IMS_ENABLE_MASK; - if (hw->mac.type == e1000_82574) { - E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); + if (adapter->intr_type == IFLIB_INTR_MSIX) { + E1000_WRITE_REG(hw, EM_EIAC, adapter->ims); ims_mask |= adapter->ims; } E1000_WRITE_REG(hw, E1000_IMS, ims_mask); @@ -3480,7 +3488,7 @@ em_if_intr_disable(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; - if (hw->mac.type == e1000_82574) + if (adapter->intr_type == IFLIB_INTR_MSIX) E1000_WRITE_REG(hw, EM_EIAC, 0); E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); } diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index d685b4aedc26..b1f179a3842e 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -341,8 +341,6 @@ #define EM_VFTA_SIZE 128 #define EM_TSO_SIZE 65535 #define EM_TSO_SEG_SIZE 4096 /* Max dma segment size */ -#define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ -#define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 #define EM_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ #define IGB_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \ From owner-dev-commits-src-main@freebsd.org Tue Apr 27 22:36:06 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E19D062481E; Tue, 27 Apr 2021 22:36: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 4FVGnf64xLz3F3M; Tue, 27 Apr 2021 22:36: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 C3B1422F09; Tue, 27 Apr 2021 22:36: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 13RMa6ip091700; Tue, 27 Apr 2021 22:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RMa6VS091699; Tue, 27 Apr 2021 22:36:06 GMT (envelope-from git) Date: Tue, 27 Apr 2021 22:36:06 GMT Message-Id: <202104272236.13RMa6VS091699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: db8c27f49910 - main - nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT 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/main X-Git-Reftype: branch X-Git-Commit: db8c27f499105dcc9872dcc46e88bdd570c24fee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 22:36:06 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=db8c27f499105dcc9872dcc46e88bdd570c24fee commit db8c27f499105dcc9872dcc46e88bdd570c24fee Author: Rick Macklem AuthorDate: 2021-04-27 22:32:35 +0000 Commit: Rick Macklem CommitDate: 2021-04-27 22:32:35 +0000 nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT It was reported that a NFSv4.1 Linux client mount against a FreeBSD12 server was hung, with the TCP connection in CLOSE_WAIT state on the server. When a NFSv4.1/4.2 mount is done and the back channel is bound to the TCP connection, the soclose() is delayed until a new TCP connection is bound to the back channel, due to a reference count being held on the SVCXPRT structure in the krpc for the socket. Without the soclose() call, the socket will remain in CLOSE_WAIT and this somehow caused the Linux client to hang. This patch adds calls to soshutdown(.., SHUT_WR) that are performed when the server side krpc sees that the socket is no longer usable. Since this can be done before the back channel is bound to a new TCP connection, it allows the TCP connection to proceed to CLOSED state. PR: 254590 Reported by: jbreitman@tildenparkcapital.com Reviewed by: tuexen Comments by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29526 --- sys/rpc/svc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index a059096e7b77..be0f08ebca9d 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -203,6 +203,8 @@ svcpool_cleanup(SVCPOOL *pool) mtx_unlock(&grp->sg_lock); } TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { + if (xprt->xp_socket != NULL) + soshutdown(xprt->xp_socket, SHUT_WR); SVC_RELEASE(xprt); } @@ -388,6 +390,8 @@ xprt_unregister(SVCXPRT *xprt) xprt_unregister_locked(xprt); mtx_unlock(&grp->sg_lock); + if (xprt->xp_socket != NULL) + soshutdown(xprt->xp_socket, SHUT_WR); SVC_RELEASE(xprt); } @@ -1078,6 +1082,7 @@ svc_checkidle(SVCGROUP *grp) mtx_unlock(&grp->sg_lock); TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { + soshutdown(xprt->xp_socket, SHUT_WR); SVC_RELEASE(xprt); } mtx_lock(&grp->sg_lock); From owner-dev-commits-src-main@freebsd.org Wed Apr 28 00:33:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 66FFB626B49; Wed, 28 Apr 2021 00:33: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 4FVKPZ27qXz3Kf3; Wed, 28 Apr 2021 00:33:54 +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 3BBD22469C; Wed, 28 Apr 2021 00:33:54 +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 13S0XsR8050484; Wed, 28 Apr 2021 00:33:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S0XsQQ050483; Wed, 28 Apr 2021 00:33:54 GMT (envelope-from git) Date: Wed, 28 Apr 2021 00:33:54 GMT Message-Id: <202104280033.13S0XsQQ050483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f6fec55fe300 - main - nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() 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/main X-Git-Reftype: branch X-Git-Commit: f6fec55fe30088bbefd3efe70b62565399a7b9b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 00:33:54 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f6fec55fe30088bbefd3efe70b62565399a7b9b8 commit f6fec55fe30088bbefd3efe70b62565399a7b9b8 Author: Rick Macklem AuthorDate: 2021-04-28 00:30:16 +0000 Commit: Rick Macklem CommitDate: 2021-04-28 00:30:16 +0000 nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() Commit aad780464fad added a function called nfscl_delegreturnvp() to return delegations during the NFS VOP_RECLAIM(). The function erroneously assumed that nm_clp would be non-NULL. It will be NULL for NFSV4.0 mounts until a regular file is opened. It will also be NULL during vflush() in nfs_unmount() for a forced dismount. This patch adds a check for clp == NULL to fix this. Also, since it makes no sense to call nfscl_delegreturnvp() during a forced dismount, the patch adds a check for that case and does not do the call during forced dismounts. PR: 255436 Reported by: ish@amail.plala.or.jp MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clnode.c | 9 ++++++++- sys/fs/nfsclient/nfs_clstate.c | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index 43c2286726f7..1c0e855ff5a9 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -289,8 +289,10 @@ ncl_reclaim(struct vop_reclaim_args *ap) struct nfsnode *np = VTONFS(vp); struct nfsdmap *dp, *dp2; struct thread *td; + struct mount *mp; td = curthread; + mp = vp->v_mount; /* * If the NLM is running, give it a chance to abort pending @@ -317,7 +319,12 @@ ncl_reclaim(struct vop_reclaim_args *ap) * vfs_hash_remove(), since it cannot be recalled once the * nfs node is no longer available. */ - nfscl_delegreturnvp(vp, td); + MNT_ILOCK(mp); + if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) == 0) { + MNT_IUNLOCK(mp); + nfscl_delegreturnvp(vp, td); + } else + MNT_IUNLOCK(mp); } vfs_hash_remove(vp); diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index bbc1c6ccbc2f..8b5f07b5aa2a 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3300,10 +3300,12 @@ nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p) np = VTONFS(vp); cred = newnfs_getcred(); + dp = NULL; NFSLOCKCLSTATE(); clp = VFSTONFS(vp->v_mount)->nm_clp; - dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, - np->n_fhp->nfh_len); + if (clp != NULL) + dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len); if (dp != NULL) { nfscl_cleandeleg(dp); nfscl_freedeleg(&clp->nfsc_deleg, dp, false); From owner-dev-commits-src-main@freebsd.org Wed Apr 28 01:30:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E7B6A627F13; Wed, 28 Apr 2021 01:30:34 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVLfy6Bl8z3MWh; Wed, 28 Apr 2021 01:30:34 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 2A75931882; Wed, 28 Apr 2021 01:30:34 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.48.21041102 Date: Tue, 27 Apr 2021 18:30:30 -0700 Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) From: Ravi Pokala To: Baptiste Daroussin , Ravi Pokala CC: , , Message-ID: Thread-Topic: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) References: <202104270309.13R39Lur024105@gitrepo.freebsd.org> <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> <20210427070557.wv3lkor3tscxzdtg@aniel.nours.eu> In-Reply-To: <20210427070557.wv3lkor3tscxzdtg@aniel.nours.eu> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 01:30:35 -0000 -----Original Message----- From: Baptiste Daroussin Date: 2021-04-27, Tuesday at 00:05 To: Ravi Pokala Cc: , , Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) On Mon, Apr 26, 2021 at 09:13:53PM -0700, Ravi Pokala wrote: > -----Original Message----- ... > Hi Baptiste, > > pw(8): use openmemstream instead of sbuf(9) > > That's the "what", but what's the "why"? > > Thanks, > You are right about this. Here the why. I have been the one introducing sbug in pw(8) when I rewrote it, but since the beginning while I found this was better than the solution in place I didn't like adding another external lib just for that. Fair enough. Short after I discovered about open_memstream(3) and figured it could fill the same spot here but keeping the dep only on libc. I keep forgetting that open_memstream(3) is even a thing. `grep'ing the src tree, it looks like it's very rarely used. I was puzzled about pushing this change, and the switch to git reminded me about some uncommit patches sitting on my tree and I ended up pushing it. If people have strong opinion I can revert it back. I can't imagine anyone having a problem with this. :-) Thanks for explaining. -Ravi (rpokala@) Things that have not been taken in account in the change, but to answer questions asked privately: - I have performed absolutely no performance benchmark, it does not matter here. - The size of the final binary is smaller: - 76k on amd64 for the new version - 77k for the old version Best regards, Bapt From owner-dev-commits-src-main@freebsd.org Wed Apr 28 01:55:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C3DE16288E6 for ; Wed, 28 Apr 2021 01:55:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVMCD4N04z3NFQ for ; Wed, 28 Apr 2021 01:55:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf29.google.com with SMTP id x27so30076498qvd.2 for ; Tue, 27 Apr 2021 18:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vA3HH6IPYlJp08moCBgdj6QE1TJxSXKfoQeXvWRf4/A=; b=tJMrsfKvsespqDkO/FF39HGeNhwXkut+j800Nxto80lwbVJ/gfsStpXM6IU1ChPG/f OOAmf/DbUa4gdYEZjGRcyktHLeJ+5U5carJ0Pntk5ORpDgr1jhTHT3jCzV5be4fiZRb/ 3MeeilVzBXRQIvze/7IXvSzBfYnF5aRhCoiawmkNw7k3XxiCOkIPTx6ji/e9kIlmC6jE hdzmD3cDbRJAHUX7aOY93lNb+oIJiWhVxtPXXH1vrSf7kYY5UyPH8j00c0Bl4Ix0NNw2 4hUpCbtkNBuQ+bPdWbWtxy83zmWTLdMYSzZyBtcC3q0Wv2UvWAFw3ugBtTQvV5RVambd ql9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vA3HH6IPYlJp08moCBgdj6QE1TJxSXKfoQeXvWRf4/A=; b=GXsMXS/l8GzxoZk0JQAnbC8fMAUkXErFqwS+5kGF3XNbcZ/duJMtGSVAnN0tnPhYTG 01c4OA5Ce3ObchqVf3f3RGCwnpTpLckqz0LtmXqzxi8M1wLSVzt3u1DI+IzPHZOvNCwk JCLTK4yLL0ykI80JkE+seZZBcLICVC7FJwW0wJDP/YMEgkVLbcurkW1Hc+2P3pYiOppA 0xCcuzqlHY8dvPhgWMeMT/E+kDR533HNU1msEklqNes3ZavRf4ynRIRebuZVHusNnhUz DvUeMEruvD/kjBMzqDIXjkX9cFAYXvvezYw0iaJg2ywpp8jYBSzj6ZVZZFjQnol5qx97 TBow== X-Gm-Message-State: AOAM53150sn6Y4cJKffA+0AkCl4+iPAisHVoUGmhnpBoD0x8N0tFu3CL sUuoq1ZBv/7LpQoclG64oZaCeeocu0eWFwqfPGPfHg== X-Google-Smtp-Source: ABdhPJykMrGapL3Ag77TNLhrSul2GejOEfeq7yvPCCUPCU3ClTsZxVJoQ7XA81LD3VSdMCEOe+cIZ2JCcBOhSNN7dMk= X-Received: by 2002:a05:6214:134a:: with SMTP id b10mr26461177qvw.62.1619574902852; Tue, 27 Apr 2021 18:55:02 -0700 (PDT) MIME-Version: 1.0 References: <202104270309.13R39Lur024105@gitrepo.freebsd.org> <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> <20210427070557.wv3lkor3tscxzdtg@aniel.nours.eu> In-Reply-To: From: Warner Losh Date: Tue, 27 Apr 2021 19:54:50 -0600 Message-ID: Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) To: Ravi Pokala Cc: Baptiste Daroussin , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4FVMCD4N04z3NFQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 01:55:04 -0000 On Tue, Apr 27, 2021, 7:30 PM Ravi Pokala wrote: > -----Original Message----- > From: Baptiste Daroussin > Date: 2021-04-27, Tuesday at 00:05 > To: Ravi Pokala > Cc: , , > > Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of > sbuf(9) > > On Mon, Apr 26, 2021 at 09:13:53PM -0700, Ravi Pokala wrote: > > -----Original Message----- > ... > > Hi Baptiste, > > > > pw(8): use openmemstream instead of sbuf(9) > > > > That's the "what", but what's the "why"? > > > > Thanks, > > > You are right about this. Here the why. I have been the one > introducing sbug in > pw(8) when I rewrote it, but since the beginning while I found this > was better > than the solution in place I didn't like adding another external lib > just for > that. > > Fair enough. > > Short after I discovered about open_memstream(3) and figured it could > fill the > same spot here but keeping the dep only on libc. > > I keep forgetting that open_memstream(3) is even a thing. `grep'ing the > src tree, it looks like it's very rarely used. > > I was puzzled about pushing > this change, and the switch to git reminded me about some uncommit > patches > sitting on my tree and I ended up pushing it. > > If people have strong opinion I can revert it back. > > I can't imagine anyone having a problem with this. :-) > Great explanation. Makes sense to me that you'd want to use a more standard way of doing this. Warner Thanks for explaining. > > -Ravi (rpokala@) > > Things that have not been taken in account in the change, but to answer > questions asked privately: > > - I have performed absolutely no performance benchmark, it does not > matter here. > > - The size of the final binary is smaller: > - 76k on amd64 for the new version > - 77k for the old version > > Best regards, > Bapt > > > From owner-dev-commits-src-main@freebsd.org Wed Apr 28 04:59:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7994262B0E7; Wed, 28 Apr 2021 04:59: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 4FVRJQ2vdGz3krM; Wed, 28 Apr 2021 04:59: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 5212927D14; Wed, 28 Apr 2021 04:59: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 13S4xoaf093701; Wed, 28 Apr 2021 04:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S4xoHn093700; Wed, 28 Apr 2021 04:59:50 GMT (envelope-from git) Date: Wed, 28 Apr 2021 04:59:50 GMT Message-Id: <202104280459.13S4xoHn093700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: f33f2365eeef - main - geom_uzip(4): fix a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f33f2365eeefa38730e365bf6813cd0b90c9e9bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 04:59:50 -0000 The branch main has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f33f2365eeefa38730e365bf6813cd0b90c9e9bc commit f33f2365eeefa38730e365bf6813cd0b90c9e9bc Author: Ceri Davies AuthorDate: 2021-04-28 04:55:32 +0000 Commit: Guangyuan Yang CommitDate: 2021-04-28 04:59:03 +0000 geom_uzip(4): fix a typo While I was there, also fixed a whitespace issue reported by mandoc -Tlint. PR: 254338 MFC after: 3 days --- share/man/man4/geom_uzip.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/geom_uzip.4 b/share/man/man4/geom_uzip.4 index 359940bd2cf1..4b8e8d355c81 100644 --- a/share/man/man4/geom_uzip.4 +++ b/share/man/man4/geom_uzip.4 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2019 +.Dd April 28, 2021 .Dt GEOM_UZIP 4 .Os .Sh NAME @@ -53,7 +53,7 @@ The framework provides support for compressed read-only disk images. This allows significant storage savings at the expense of -a some CPU time on each read. +some CPU time on each read. Data written in the GEOM label area allows .Nm to detect compressed images which have been created with @@ -70,7 +70,7 @@ is not limited to supporting only .Xr md 4 images. The image can also reside on a block device. -.Pq For example, a disk, USB flash drive, DVD-ROM, etc. +.Pq For example, a disk, USB flash drive, DVD-ROM, etc . The appropriate device node will appear with the .Pa .uzip suffix. From owner-dev-commits-src-main@freebsd.org Wed Apr 28 06:03:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3A0D562C173; Wed, 28 Apr 2021 06:03: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 4FVSjp12hdz3nGc; Wed, 28 Apr 2021 06:03: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 16481CB5; Wed, 28 Apr 2021 06:03: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 13S63QPo087687; Wed, 28 Apr 2021 06:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S63P0t087686; Wed, 28 Apr 2021 06:03:25 GMT (envelope-from git) Date: Wed, 28 Apr 2021 06:03:25 GMT Message-Id: <202104280603.13S63P0t087686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 83b5cda106a2 - main - cxgbe(4): Add support for NIC suspend/resume and live reset. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83b5cda106a2dc0c8ace1718485c2ef05c5aa62b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 06:03:26 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=83b5cda106a2dc0c8ace1718485c2ef05c5aa62b commit 83b5cda106a2dc0c8ace1718485c2ef05c5aa62b Author: Navdeep Parhar AuthorDate: 2021-04-28 04:33:10 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-28 05:48:51 +0000 cxgbe(4): Add support for NIC suspend/resume and live reset. Add suspend/resume callbacks to the driver and a live reset built around them. This commit covers the basic NIC and future commits will expand this functionality to other stateful parts of the chip. Suspend and resume operate on the chip (the t?nex nexus device) and affect all its ports. It is not possible to suspend/resume or reset individual ports. All these operations can be performed on a running NIC. A reset will look like a link bounce to the networking stack. Here are some ways to exercise this functionality: /* Manual suspend and resume. */ # devctl suspend t6nex0 # devctl resume t6nex0 /* Manual reset. */ # devctl reset t6nex0 /* Manual reset with driver sysctl. */ # sysctl dev.t6nex.0.reset=1 /* Automatic adapter reset on any fatal error. */ # hw.cxgbe.reset_on_fatal_err=1 Suspend disables the adapter (DMA, interrupts, and the port PHYs) and marks the hardware as unavailable to the driver. All ifnets associated with the adapter are still visible to the kernel but operations that require hardware interaction will fail with ENXIO. All ifnets report link-down while the adapter is suspended. Resume will reattach to the card, reconfigure it as before, and recreate the queues servicing the existing ifnets. The ifnets are able to send and receive traffic as soon as the link comes back up. Reset is roughly the same as a suspend and a resume with at least one of these events in between: D0->D3Hot->D0, FLR, PCIe link retrain. MFC after: 1 month Relnotes: yes Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 52 +- sys/dev/cxgbe/t4_clip.c | 2 +- sys/dev/cxgbe/t4_filter.c | 36 +- sys/dev/cxgbe/t4_main.c | 1586 +++++++++++++++++++++++++++++++++++++-------- sys/dev/cxgbe/t4_sched.c | 13 +- sys/dev/cxgbe/t4_tracer.c | 10 + 6 files changed, 1393 insertions(+), 306 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 10099fb47bc1..086918b7dff9 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -165,6 +165,7 @@ enum { IS_VF = (1 << 7), KERN_TLS_ON = (1 << 8), /* HW is configured for KERN_TLS */ CXGBE_BUSY = (1 << 9), + HW_OFF_LIMITS = (1 << 10), /* off limits to all except reset_thread */ /* port flags */ HAS_TRACEQ = (1 << 3), @@ -955,13 +956,26 @@ struct adapter { TAILQ_HEAD(, sge_fl) sfl; struct callout sfl_callout; - struct mtx reg_lock; /* for indirect register access */ + /* + * Driver code that can run when the adapter is suspended must use this + * lock or a synchronized_op and check for HW_OFF_LIMITS before + * accessing hardware. + * + * XXX: could be changed to rwlock. wlock in suspend/resume and for + * indirect register access, rlock everywhere else. + */ + struct mtx reg_lock; struct memwin memwin[NUM_MEMWIN]; /* memory windows */ struct mtx tc_lock; struct task tc_task; + struct task reset_task; + const void *reset_thread; + int num_resets; + int incarnation; + const char *last_op; const void *last_op_thr; int last_op_flags; @@ -1051,24 +1065,34 @@ forwarding_intr_to_fwq(struct adapter *sc) return (sc->intr_count == 1); } +/* Works reliably inside a sync_op or with reg_lock held. */ +static inline bool +hw_off_limits(struct adapter *sc) +{ + return (__predict_false(sc->flags & HW_OFF_LIMITS)); +} + static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); return bus_space_read_4(sc->bt, sc->bh, reg); } static inline void t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); bus_space_write_4(sc->bt, sc->bh, reg, val); } static inline uint64_t t4_read_reg64(struct adapter *sc, uint32_t reg) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); #ifdef __LP64__ return bus_space_read_8(sc->bt, sc->bh, reg); #else @@ -1081,7 +1105,8 @@ t4_read_reg64(struct adapter *sc, uint32_t reg) static inline void t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); #ifdef __LP64__ bus_space_write_8(sc->bt, sc->bh, reg, val); #else @@ -1093,14 +1118,16 @@ t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val) static inline void t4_os_pci_read_cfg1(struct adapter *sc, int reg, uint8_t *val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); *val = pci_read_config(sc->dev, reg, 1); } static inline void t4_os_pci_write_cfg1(struct adapter *sc, int reg, uint8_t val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); pci_write_config(sc->dev, reg, val, 1); } @@ -1108,27 +1135,32 @@ static inline void t4_os_pci_read_cfg2(struct adapter *sc, int reg, uint16_t *val) { + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); *val = pci_read_config(sc->dev, reg, 2); } static inline void t4_os_pci_write_cfg2(struct adapter *sc, int reg, uint16_t val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); pci_write_config(sc->dev, reg, val, 2); } static inline void t4_os_pci_read_cfg4(struct adapter *sc, int reg, uint32_t *val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); *val = pci_read_config(sc->dev, reg, 4); } static inline void t4_os_pci_write_cfg4(struct adapter *sc, int reg, uint32_t val) { - + if (hw_off_limits(sc)) + MPASS(curthread == sc->reset_thread); pci_write_config(sc->dev, reg, val, 4); } diff --git a/sys/dev/cxgbe/t4_clip.c b/sys/dev/cxgbe/t4_clip.c index a93271103998..da7b168721ab 100644 --- a/sys/dev/cxgbe/t4_clip.c +++ b/sys/dev/cxgbe/t4_clip.c @@ -171,7 +171,7 @@ update_clip(struct adapter *sc, void *arg __unused) if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4clip")) return; - if (mtx_initialized(&sc->clip_table_lock)) + if (mtx_initialized(&sc->clip_table_lock) && !hw_off_limits(sc)) update_clip_table(sc); end_synchronized_op(sc, LOCK_HELD); diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index cddd2c96a620..3972111b4897 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -522,6 +522,11 @@ set_filter_mode(struct adapter *sc, uint32_t mode) if (rc) return (rc); + if (hw_off_limits(sc)) { + rc = ENXIO; + goto done; + } + if (sc->tids.ftids_in_use > 0 || /* TCAM filters active */ sc->tids.hpftids_in_use > 0 || /* hi-pri TCAM filters active */ sc->tids.tids_in_use > 0) { /* TOE or hashfilters active */ @@ -568,6 +573,11 @@ set_filter_mask(struct adapter *sc, uint32_t mode) if (rc) return (rc); + if (hw_off_limits(sc)) { + rc = ENXIO; + goto done; + } + if (sc->tids.tids_in_use > 0) { /* TOE or hashfilters active */ rc = EBUSY; goto done; @@ -589,20 +599,27 @@ static inline uint64_t get_filter_hits(struct adapter *sc, uint32_t tid) { uint32_t tcb_addr; + uint64_t hits; tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + tid * TCB_SIZE; - if (is_t4(sc)) { - uint64_t hits; + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + hits = 0; + else if (is_t4(sc)) { + uint64_t t; - read_via_memwin(sc, 0, tcb_addr + 16, (uint32_t *)&hits, 8); - return (be64toh(hits)); + read_via_memwin(sc, 0, tcb_addr + 16, (uint32_t *)&t, 8); + hits = be64toh(t); } else { - uint32_t hits; + uint32_t t; - read_via_memwin(sc, 0, tcb_addr + 24, &hits, 4); - return (be32toh(hits)); + read_via_memwin(sc, 0, tcb_addr + 24, &t, 4); + hits = be32toh(t); } + mtx_unlock(&sc->reg_lock); + + return (hits); } int @@ -961,6 +978,11 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc) return (rc); + if (hw_off_limits(sc)) { + rc = ENXIO; + goto done; + } + if (!(sc->flags & FULL_INIT_DONE) && ((rc = adapter_init(sc)) != 0)) goto done; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9a2a256d5dd2..da9d7565f3a3 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -100,12 +100,20 @@ static int t4_detach(device_t); static int t4_child_location_str(device_t, device_t, char *, size_t); static int t4_ready(device_t); static int t4_read_port_device(device_t, int, device_t *); +static int t4_suspend(device_t); +static int t4_resume(device_t); +static int t4_reset_prepare(device_t, device_t); +static int t4_reset_post(device_t, device_t); static device_method_t t4_methods[] = { DEVMETHOD(device_probe, t4_probe), DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(device_suspend, t4_suspend), + DEVMETHOD(device_resume, t4_resume), DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(bus_reset_prepare, t4_reset_prepare), + DEVMETHOD(bus_reset_post, t4_reset_post), DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -165,8 +173,12 @@ static device_method_t t5_methods[] = { DEVMETHOD(device_probe, t5_probe), DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(device_suspend, t4_suspend), + DEVMETHOD(device_resume, t4_resume), DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(bus_reset_prepare, t4_reset_prepare), + DEVMETHOD(bus_reset_post, t4_reset_post), DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -200,8 +212,12 @@ static device_method_t t6_methods[] = { DEVMETHOD(device_probe, t6_probe), DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(device_suspend, t4_suspend), + DEVMETHOD(device_resume, t4_resume), DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(bus_reset_prepare, t4_reset_prepare), + DEVMETHOD(bus_reset_post, t4_reset_post), DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -596,6 +612,10 @@ static int t4_panic_on_fatal_err = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RWTUN, &t4_panic_on_fatal_err, 0, "panic on fatal errors"); +static int t4_reset_on_fatal_err = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, reset_on_fatal_err, CTLFLAG_RWTUN, + &t4_reset_on_fatal_err, 0, "reset adapter on fatal errors"); + static int t4_tx_vm_wr = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, &t4_tx_vm_wr, 0, "Use VM work requests to transmit packets."); @@ -794,6 +814,7 @@ static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_cpus(SYSCTL_HANDLER_ARGS); +static int sysctl_reset(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls(SYSCTL_HANDLER_ARGS); static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); @@ -829,6 +850,7 @@ static int notify_siblings(device_t, int); static uint64_t vi_get_counter(struct ifnet *, ift_counter); static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); static void enable_vxlan_rx(struct adapter *); +static void reset_adapter(void *, int); struct { uint16_t device; @@ -1137,6 +1159,8 @@ t4_attach(device_t dev) refcount_init(&sc->vxlan_refcount, 0); + TASK_INIT(&sc->reset_task, 0, reset_adapter, sc); + sc->ctrlq_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "ctrlq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "control queues"); @@ -1785,6 +1809,572 @@ t4_detach_common(device_t dev) return (0); } +static inline bool +ok_to_reset(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + struct port_info *pi; + struct vi_info *vi; + int i, j; + const int caps = IFCAP_TOE | IFCAP_TXTLS | IFCAP_NETMAP | IFCAP_TXRTLMT; + + ASSERT_SYNCHRONIZED_OP(sc); + MPASS(!(sc->flags & IS_VF)); + + for_each_port(sc, i) { + pi = sc->port[i]; + for_each_vi(pi, j, vi) { + if (vi->ifp->if_capenable & caps) + return (false); + } + } + + if (atomic_load_int(&t->tids_in_use) > 0) + return (false); + if (atomic_load_int(&t->stids_in_use) > 0) + return (false); + if (atomic_load_int(&t->atids_in_use) > 0) + return (false); + if (atomic_load_int(&t->ftids_in_use) > 0) + return (false); + if (atomic_load_int(&t->hpftids_in_use) > 0) + return (false); + if (atomic_load_int(&t->etids_in_use) > 0) + return (false); + + return (true); +} + +static int +t4_suspend(device_t dev) +{ + struct adapter *sc = device_get_softc(dev); + struct port_info *pi; + struct vi_info *vi; + struct ifnet *ifp; + struct sge_rxq *rxq; + struct sge_txq *txq; + struct sge_wrq *wrq; +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct sge_ofld_txq *ofld_txq; +#endif + int rc, i, j, k; + + CH_ALERT(sc, "suspend requested\n"); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4sus"); + if (rc != 0) + return (ENXIO); + + /* XXX: Can the kernel call suspend repeatedly without resume? */ + MPASS(!hw_off_limits(sc)); + + if (!ok_to_reset(sc)) { + /* XXX: should list what resource is preventing suspend. */ + CH_ERR(sc, "not safe to suspend.\n"); + rc = EBUSY; + goto done; + } + + /* No more DMA or interrupts. */ + t4_shutdown_adapter(sc); + + /* Quiesce all activity. */ + for_each_port(sc, i) { + pi = sc->port[i]; + pi->vxlan_tcam_entry = false; + + PORT_LOCK(pi); + if (pi->up_vis > 0) { + /* + * t4_shutdown_adapter has already shut down all the + * PHYs but it also disables interrupts and DMA so there + * won't be a link interrupt. So we update the state + * manually and inform the kernel. + */ + pi->link_cfg.link_ok = false; + t4_os_link_changed(pi); + } + PORT_UNLOCK(pi); + + for_each_vi(pi, j, vi) { + vi->xact_addr_filt = -1; + if (!(vi->flags & VI_INIT_DONE)) + continue; + + ifp = vi->ifp; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + mtx_lock(&vi->tick_mtx); + vi->flags |= VI_SKIP_STATS; + callout_stop(&vi->tick); + mtx_unlock(&vi->tick_mtx); + callout_drain(&vi->tick); + } + + /* + * Note that the HW is not available. + */ + for_each_txq(vi, k, txq) { + TXQ_LOCK(txq); + txq->eq.flags &= ~(EQ_ENABLED | EQ_HW_ALLOCATED); + TXQ_UNLOCK(txq); + } +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + for_each_ofld_txq(vi, k, ofld_txq) { + ofld_txq->wrq.eq.flags &= ~EQ_HW_ALLOCATED; + } +#endif + for_each_rxq(vi, k, rxq) { + rxq->iq.flags &= ~IQ_HW_ALLOCATED; + } +#if defined(TCP_OFFLOAD) + for_each_ofld_rxq(vi, k, ofld_rxq) { + ofld_rxq->iq.flags &= ~IQ_HW_ALLOCATED; + } +#endif + + quiesce_vi(vi); + } + + if (sc->flags & FULL_INIT_DONE) { + /* Control queue */ + wrq = &sc->sge.ctrlq[i]; + wrq->eq.flags &= ~EQ_HW_ALLOCATED; + quiesce_wrq(wrq); + } + } + if (sc->flags & FULL_INIT_DONE) { + /* Firmware event queue */ + sc->sge.fwq.flags &= ~IQ_HW_ALLOCATED; + quiesce_iq_fl(sc, &sc->sge.fwq, NULL); + } + + /* Mark the adapter totally off limits. */ + mtx_lock(&sc->reg_lock); + sc->flags |= HW_OFF_LIMITS; + sc->flags &= ~(FW_OK | MASTER_PF); + sc->reset_thread = NULL; + mtx_unlock(&sc->reg_lock); + + sc->num_resets++; + CH_ALERT(sc, "suspend completed.\n"); +done: + end_synchronized_op(sc, 0); + return (rc); +} + +struct adapter_pre_reset_state { + u_int flags; + uint16_t nbmcaps; + uint16_t linkcaps; + uint16_t switchcaps; + uint16_t niccaps; + uint16_t toecaps; + uint16_t rdmacaps; + uint16_t cryptocaps; + uint16_t iscsicaps; + uint16_t fcoecaps; + + u_int cfcsum; + char cfg_file[32]; + + struct adapter_params params; + struct t4_virt_res vres; + struct tid_info tids; + struct sge sge; + + int rawf_base; + int nrawf; + +}; + +static void +save_caps_and_params(struct adapter *sc, struct adapter_pre_reset_state *o) +{ + + ASSERT_SYNCHRONIZED_OP(sc); + + o->flags = sc->flags; + + o->nbmcaps = sc->nbmcaps; + o->linkcaps = sc->linkcaps; + o->switchcaps = sc->switchcaps; + o->niccaps = sc->niccaps; + o->toecaps = sc->toecaps; + o->rdmacaps = sc->rdmacaps; + o->cryptocaps = sc->cryptocaps; + o->iscsicaps = sc->iscsicaps; + o->fcoecaps = sc->fcoecaps; + + o->cfcsum = sc->cfcsum; + MPASS(sizeof(o->cfg_file) == sizeof(sc->cfg_file)); + memcpy(o->cfg_file, sc->cfg_file, sizeof(o->cfg_file)); + + o->params = sc->params; + o->vres = sc->vres; + o->tids = sc->tids; + o->sge = sc->sge; + + o->rawf_base = sc->rawf_base; + o->nrawf = sc->nrawf; +} + +static int +compare_caps_and_params(struct adapter *sc, struct adapter_pre_reset_state *o) +{ + int rc = 0; + + ASSERT_SYNCHRONIZED_OP(sc); + + /* Capabilities */ +#define COMPARE_CAPS(c) do { \ + if (o->c##caps != sc->c##caps) { \ + CH_ERR(sc, "%scaps 0x%04x -> 0x%04x.\n", #c, o->c##caps, \ + sc->c##caps); \ + rc = EINVAL; \ + } \ +} while (0) + COMPARE_CAPS(nbm); + COMPARE_CAPS(link); + COMPARE_CAPS(switch); + COMPARE_CAPS(nic); + COMPARE_CAPS(toe); + COMPARE_CAPS(rdma); + COMPARE_CAPS(crypto); + COMPARE_CAPS(iscsi); + COMPARE_CAPS(fcoe); +#undef COMPARE_CAPS + + /* Firmware config file */ + if (o->cfcsum != sc->cfcsum) { + CH_ERR(sc, "config file %s (0x%x) -> %s (0x%x)\n", o->cfg_file, + o->cfcsum, sc->cfg_file, sc->cfcsum); + rc = EINVAL; + } + +#define COMPARE_PARAM(p, name) do { \ + if (o->p != sc->p) { \ + CH_ERR(sc, #name " %d -> %d\n", o->p, sc->p); \ + rc = EINVAL; \ + } \ +} while (0) + COMPARE_PARAM(sge.iq_start, iq_start); + COMPARE_PARAM(sge.eq_start, eq_start); + COMPARE_PARAM(tids.ftid_base, ftid_base); + COMPARE_PARAM(tids.ftid_end, ftid_end); + COMPARE_PARAM(tids.nftids, nftids); + COMPARE_PARAM(vres.l2t.start, l2t_start); + COMPARE_PARAM(vres.l2t.size, l2t_size); + COMPARE_PARAM(sge.iqmap_sz, iqmap_sz); + COMPARE_PARAM(sge.eqmap_sz, eqmap_sz); + COMPARE_PARAM(tids.tid_base, tid_base); + COMPARE_PARAM(tids.hpftid_base, hpftid_base); + COMPARE_PARAM(tids.hpftid_end, hpftid_end); + COMPARE_PARAM(tids.nhpftids, nhpftids); + COMPARE_PARAM(rawf_base, rawf_base); + COMPARE_PARAM(nrawf, nrawf); + COMPARE_PARAM(params.mps_bg_map, mps_bg_map); + COMPARE_PARAM(params.filter2_wr_support, filter2_wr_support); + COMPARE_PARAM(params.ulptx_memwrite_dsgl, ulptx_memwrite_dsgl); + COMPARE_PARAM(params.fr_nsmr_tpte_wr_support, fr_nsmr_tpte_wr_support); + COMPARE_PARAM(params.max_pkts_per_eth_tx_pkts_wr, max_pkts_per_eth_tx_pkts_wr); + COMPARE_PARAM(tids.ntids, ntids); + COMPARE_PARAM(tids.etid_base, etid_base); + COMPARE_PARAM(tids.etid_end, etid_end); + COMPARE_PARAM(tids.netids, netids); + COMPARE_PARAM(params.eo_wr_cred, eo_wr_cred); + COMPARE_PARAM(params.ethoffload, ethoffload); + COMPARE_PARAM(tids.natids, natids); + COMPARE_PARAM(tids.stid_base, stid_base); + COMPARE_PARAM(vres.ddp.start, ddp_start); + COMPARE_PARAM(vres.ddp.size, ddp_size); + COMPARE_PARAM(params.ofldq_wr_cred, ofldq_wr_cred); + COMPARE_PARAM(vres.stag.start, stag_start); + COMPARE_PARAM(vres.stag.size, stag_size); + COMPARE_PARAM(vres.rq.start, rq_start); + COMPARE_PARAM(vres.rq.size, rq_size); + COMPARE_PARAM(vres.pbl.start, pbl_start); + COMPARE_PARAM(vres.pbl.size, pbl_size); + COMPARE_PARAM(vres.qp.start, qp_start); + COMPARE_PARAM(vres.qp.size, qp_size); + COMPARE_PARAM(vres.cq.start, cq_start); + COMPARE_PARAM(vres.cq.size, cq_size); + COMPARE_PARAM(vres.ocq.start, ocq_start); + COMPARE_PARAM(vres.ocq.size, ocq_size); + COMPARE_PARAM(vres.srq.start, srq_start); + COMPARE_PARAM(vres.srq.size, srq_size); + COMPARE_PARAM(params.max_ordird_qp, max_ordird_qp); + COMPARE_PARAM(params.max_ird_adapter, max_ird_adapter); + COMPARE_PARAM(vres.iscsi.start, iscsi_start); + COMPARE_PARAM(vres.iscsi.size, iscsi_size); + COMPARE_PARAM(vres.key.start, key_start); + COMPARE_PARAM(vres.key.size, key_size); +#undef COMPARE_PARAM + + return (rc); +} + +static int +t4_resume(device_t dev) +{ + struct adapter *sc = device_get_softc(dev); + struct adapter_pre_reset_state *old_state = NULL; + struct port_info *pi; + struct vi_info *vi; + struct ifnet *ifp; + struct sge_txq *txq; + int rc, i, j, k; + + CH_ALERT(sc, "resume requested.\n"); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4res"); + if (rc != 0) + return (ENXIO); + MPASS(hw_off_limits(sc)); + MPASS((sc->flags & FW_OK) == 0); + MPASS((sc->flags & MASTER_PF) == 0); + MPASS(sc->reset_thread == NULL); + sc->reset_thread = curthread; + + /* Register access is expected to work by the time we're here. */ + if (t4_read_reg(sc, A_PL_WHOAMI) == 0xffffffff) { + CH_ERR(sc, "%s: can't read device registers\n", __func__); + rc = ENXIO; + goto done; + } + + /* Restore memory window. */ + setup_memwin(sc); + + /* Go no further if recovery mode has been requested. */ + if (TUNABLE_INT_FETCH("hw.cxgbe.sos", &i) && i != 0) { + CH_ALERT(sc, "recovery mode on resume.\n"); + rc = 0; + mtx_lock(&sc->reg_lock); + sc->flags &= ~HW_OFF_LIMITS; + mtx_unlock(&sc->reg_lock); + goto done; + } + + old_state = malloc(sizeof(*old_state), M_CXGBE, M_ZERO | M_WAITOK); + save_caps_and_params(sc, old_state); + + /* Reestablish contact with firmware and become the primary PF. */ + rc = contact_firmware(sc); + if (rc != 0) + goto done; /* error message displayed already */ + MPASS(sc->flags & FW_OK); + + if (sc->flags & MASTER_PF) { + rc = partition_resources(sc); + if (rc != 0) + goto done; /* error message displayed already */ + t4_intr_clear(sc); + } + + rc = get_params__post_init(sc); + if (rc != 0) + goto done; /* error message displayed already */ + + rc = set_params__post_init(sc); + if (rc != 0) + goto done; /* error message displayed already */ + + rc = compare_caps_and_params(sc, old_state); + if (rc != 0) + goto done; /* error message displayed already */ + + for_each_port(sc, i) { + pi = sc->port[i]; + MPASS(pi != NULL); + MPASS(pi->vi != NULL); + MPASS(pi->vi[0].dev == pi->dev); + + rc = -t4_port_init(sc, sc->mbox, sc->pf, 0, i); + if (rc != 0) { + CH_ERR(sc, + "failed to re-initialize port %d: %d\n", i, rc); + goto done; + } + MPASS(sc->chan_map[pi->tx_chan] == i); + + PORT_LOCK(pi); + fixup_link_config(pi); + build_medialist(pi); + PORT_UNLOCK(pi); + for_each_vi(pi, j, vi) { + if (IS_MAIN_VI(vi)) + continue; + rc = alloc_extra_vi(sc, pi, vi); + if (rc != 0) { + CH_ERR(vi, + "failed to re-allocate extra VI: %d\n", rc); + goto done; + } + } + } + + /* + * Interrupts and queues are about to be enabled and other threads will + * want to access the hardware too. It is safe to do so. Note that + * this thread is still in the middle of a synchronized_op. + */ + mtx_lock(&sc->reg_lock); + sc->flags &= ~HW_OFF_LIMITS; + mtx_unlock(&sc->reg_lock); + + if (sc->flags & FULL_INIT_DONE) { + rc = adapter_full_init(sc); + if (rc != 0) { + CH_ERR(sc, "failed to re-initialize adapter: %d\n", rc); + goto done; + } + + if (sc->vxlan_refcount > 0) + enable_vxlan_rx(sc); + + for_each_port(sc, i) { + pi = sc->port[i]; + for_each_vi(pi, j, vi) { + if (!(vi->flags & VI_INIT_DONE)) + continue; + rc = vi_full_init(vi); + if (rc != 0) { + CH_ERR(vi, "failed to re-initialize " + "interface: %d\n", rc); + goto done; + } + + ifp = vi->ifp; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + continue; + /* + * Note that we do not setup multicast addresses + * in the first pass. This ensures that the + * unicast DMACs for all VIs on all ports get an + * MPS TCAM entry. + */ + rc = update_mac_settings(ifp, XGMAC_ALL & + ~XGMAC_MCADDRS); + if (rc != 0) { + CH_ERR(vi, "failed to re-configure MAC: %d\n", rc); + goto done; + } + rc = -t4_enable_vi(sc, sc->mbox, vi->viid, true, + true); + if (rc != 0) { + CH_ERR(vi, "failed to re-enable VI: %d\n", rc); + goto done; + } + for_each_txq(vi, k, txq) { + TXQ_LOCK(txq); + txq->eq.flags |= EQ_ENABLED; + TXQ_UNLOCK(txq); + } + mtx_lock(&vi->tick_mtx); + vi->flags &= ~VI_SKIP_STATS; + callout_schedule(&vi->tick, hz); + mtx_unlock(&vi->tick_mtx); + } + PORT_LOCK(pi); + if (pi->up_vis > 0) { + t4_update_port_info(pi); + fixup_link_config(pi); + build_medialist(pi); + apply_link_config(pi); + if (pi->link_cfg.link_ok) + t4_os_link_changed(pi); + } + PORT_UNLOCK(pi); + } + + /* Now reprogram the L2 multicast addresses. */ + for_each_port(sc, i) { + pi = sc->port[i]; + for_each_vi(pi, j, vi) { + if (!(vi->flags & VI_INIT_DONE)) + continue; + ifp = vi->ifp; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + continue; + rc = update_mac_settings(ifp, XGMAC_MCADDRS); + if (rc != 0) { + CH_ERR(vi, "failed to re-configure MCAST MACs: %d\n", rc); + rc = 0; /* carry on */ + } + } + } + } +done: + if (rc == 0) { + sc->incarnation++; + CH_ALERT(sc, "resume completed.\n"); + } + end_synchronized_op(sc, 0); + free(old_state, M_CXGBE); + return (rc); +} + +static int +t4_reset_prepare(device_t dev, device_t child) +{ + struct adapter *sc = device_get_softc(dev); + + CH_ALERT(sc, "reset_prepare.\n"); + return (0); +} + +static int +t4_reset_post(device_t dev, device_t child) +{ + struct adapter *sc = device_get_softc(dev); + + CH_ALERT(sc, "reset_post.\n"); + return (0); +} + +static void +reset_adapter(void *arg, int pending) +{ + struct adapter *sc = arg; + int rc; + + CH_ALERT(sc, "reset requested.\n"); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4rst1"); + if (rc != 0) + return; + + if (hw_off_limits(sc)) { + CH_ERR(sc, "adapter is suspended, use resume (not reset).\n"); + rc = ENXIO; + goto done; + } + + if (!ok_to_reset(sc)) { + /* XXX: should list what resource is preventing reset. */ + CH_ERR(sc, "not safe to reset.\n"); + rc = EBUSY; + goto done; + } + +done: + end_synchronized_op(sc, 0); + if (rc != 0) + return; /* Error logged already. */ + + mtx_lock(&Giant); + rc = BUS_RESET_CHILD(device_get_parent(sc->dev), sc->dev, 0); + mtx_unlock(&Giant); + if (rc != 0) + CH_ERR(sc, "bus_reset_child failed: %d.\n", rc); + else + CH_ALERT(sc, "bus_reset_child succeeded.\n"); +} + static int cxgbe_probe(device_t dev) { @@ -2072,7 +2662,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) ifp->if_mtu = mtu; if (vi->flags & VI_INIT_DONE) { t4_update_fl_bufsize(ifp); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (!hw_off_limits(sc) && + ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MTU); } end_synchronized_op(sc, 0); @@ -2083,6 +2674,11 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) if (rc) return (rc); + if (hw_off_limits(sc)) { + rc = ENXIO; + goto fail; + } + if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { flags = vi->if_flags; @@ -2106,7 +2702,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4multi"); if (rc) return (rc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (!hw_off_limits(sc) && ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(ifp, XGMAC_MCADDRS); end_synchronized_op(sc, 0); break; @@ -2281,8 +2877,11 @@ fail: rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4i2c"); if (rc) return (rc); - rc = -t4_i2c_rd(sc, sc->mbox, pi->port_id, i2c.dev_addr, *** 1773 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Apr 28 08:16:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9BCA962FA48; Wed, 28 Apr 2021 08:16: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 4FVWgt3xycz3tks; Wed, 28 Apr 2021 08:16: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 7AC1B2334; Wed, 28 Apr 2021 08:16: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 13S8GwbH060678; Wed, 28 Apr 2021 08:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S8GwnC060677; Wed, 28 Apr 2021 08:16:58 GMT (envelope-from git) Date: Wed, 28 Apr 2021 08:16:58 GMT Message-Id: <202104280816.13S8GwnC060677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f9668e42b44f - main - Add rib_walk_from() wrapper for selective rib tree traversal. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f9668e42b44f22c9ab213eb9a4792d5acfcf6903 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 08:16:58 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f9668e42b44f22c9ab213eb9a4792d5acfcf6903 commit f9668e42b44f22c9ab213eb9a4792d5acfcf6903 Author: Alexander V. Chernikov AuthorDate: 2021-04-25 11:59:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-28 08:09:45 +0000 Add rib_walk_from() wrapper for selective rib tree traversal. Provide wrapper for the rnh_walktree_from() rib callback. As currently `struct rib_head` is considered internal to the routing subsystem, this wrapper is necessary to maintain isolation from the external code. Differential Revision: https://reviews.freebsd.org/D29971 MFC after: 1 week --- sys/net/route/route_ctl.h | 6 ++++++ sys/net/route/route_helpers.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index 46dba759f8df..4fe45cc8a970 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -62,6 +62,10 @@ int rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, int flags, int expire_sec); +/* common flags for the functions below */ +#define RIB_FLAG_WLOCK 0x01 /* Need exclusive rnh lock */ +#define RIB_FLAG_LOCKED 0x02 /* Do not explicitly acquire rnh lock */ + enum rib_walk_hook { RIB_WALK_HOOK_PRE, /* Hook is called before iteration */ RIB_WALK_HOOK_POST, /* Hook is called after iteration */ @@ -77,6 +81,8 @@ void rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); void rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); +void rib_walk_from(uint32_t fibnum, int family, uint32_t flags, struct sockaddr *prefix, + struct sockaddr *mask, rib_walktree_f_t *wa_f, void *arg); void rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool report); diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index 782e160ca51b..5d29197cc4fb 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -128,6 +128,38 @@ rib_walk(uint32_t fibnum, int family, bool wlock, rib_walktree_f_t *wa_f, rib_walk_ext(fibnum, family, wlock, wa_f, NULL, arg); } +/* + * Calls @wa_f with @arg for each entry in the table matching @prefix/@mask. + * + * The following flags are supported: + * RIB_FLAG_WLOCK: acquire exclusive lock + * RIB_FLAG_LOCKED: Assumes the table is already locked & skip locking + * + * By default, table is traversed under read lock. + */ +void +rib_walk_from(uint32_t fibnum, int family, uint32_t flags, struct sockaddr *prefix, + struct sockaddr *mask, rib_walktree_f_t *wa_f, void *arg) +{ + RIB_RLOCK_TRACKER; + struct rib_head *rnh = rt_tables_get_rnh(fibnum, family); + + if (rnh == NULL) + return; + + if (flags & RIB_FLAG_WLOCK) + RIB_WLOCK(rnh); + else if (!(flags & RIB_FLAG_LOCKED)) + RIB_RLOCK(rnh); + + rnh->rnh_walktree_from(&rnh->head, prefix, mask, (walktree_f_t *)wa_f, arg); + + if (flags & RIB_FLAG_WLOCK) + RIB_WUNLOCK(rnh); + else if (!(flags & RIB_FLAG_LOCKED)) + RIB_RUNLOCK(rnh); +} + /* * Iterates over all existing fibs in system calling * @hook_f function before/after traversing each fib. From owner-dev-commits-src-main@freebsd.org Wed Apr 28 09:19:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CCD7F5E1788; Wed, 28 Apr 2021 09:19: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 4FVY4Z5S58z4QwR; Wed, 28 Apr 2021 09:19: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 A9FA731C0; Wed, 28 Apr 2021 09:19: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 13S9Jw6r039494; Wed, 28 Apr 2021 09:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S9JwcV039493; Wed, 28 Apr 2021 09:19:58 GMT (envelope-from git) Date: Wed, 28 Apr 2021 09:19:58 GMT Message-Id: <202104280919.13S9JwcV039493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: 01a856c66619 - main - open_memstream(3): fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01a856c666194b77a359eaf2b27ee6a4f9d9945b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 09:19:58 -0000 The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=01a856c666194b77a359eaf2b27ee6a4f9d9945b commit 01a856c666194b77a359eaf2b27ee6a4f9d9945b Author: Yuri Pankov AuthorDate: 2021-04-28 09:18:25 +0000 Commit: Yuri Pankov CommitDate: 2021-04-28 09:18:25 +0000 open_memstream(3): fix typo While here, pet mandoc: .Tn -> .Vt --- lib/libc/stdio/open_memstream.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/open_memstream.3 b/lib/libc/stdio/open_memstream.3 index 8e2c1e9e057f..506b9e229b76 100644 --- a/lib/libc/stdio/open_memstream.3 +++ b/lib/libc/stdio/open_memstream.3 @@ -110,7 +110,7 @@ These multibyte characters are then converted back to wide characters when written into the stream. As a result, the wide-oriented streams maintain an internal multibyte character conversion -state that is cleared on any seek opertion that changes the current position. +state that is cleared on any seek operation that changes the current position. This should have no effect as long as wide-oriented output operations are used on a wide-oriented stream. .Sh RETURN VALUES @@ -119,7 +119,7 @@ Upon successful completion, and .Fn open_wmemstream return a -.Tn FILE +.Vt FILE pointer. Otherwise, .Dv NULL From owner-dev-commits-src-main@freebsd.org Wed Apr 28 11:19:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4EA8F5E658F; Wed, 28 Apr 2021 11:19: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 4FVbkq1k4jz4Y1K; Wed, 28 Apr 2021 11:19: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 2DFB34E4D; Wed, 28 Apr 2021 11:19: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 13SBJlNK099651; Wed, 28 Apr 2021 11:19:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SBJlnN099650; Wed, 28 Apr 2021 11:19:47 GMT (envelope-from git) Date: Wed, 28 Apr 2021 11:19:47 GMT Message-Id: <202104281119.13SBJlnN099650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Thomas Munro Subject: git: 3aaaa2efde89 - main - poll(2): Add POLLRDHUP. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tmunro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 11:19:47 -0000 The branch main has been updated by tmunro: URL: https://cgit.FreeBSD.org/src/commit/?id=3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e commit 3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e Author: Thomas Munro AuthorDate: 2021-04-28 09:31:38 +0000 Commit: Thomas Munro CommitDate: 2021-04-28 11:00:31 +0000 poll(2): Add POLLRDHUP. Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if requested. Triggered when the remote peer shuts down writing or closes its end. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29757 --- lib/libc/sys/poll.2 | 14 +++- sys/kern/uipc_socket.c | 4 +- sys/sys/poll.h | 1 + tests/sys/netinet/socket_afinet.c | 141 ++++++++++++++++++++++++++++++++++++++ usr.bin/truss/syscalls.c | 2 +- 5 files changed, 159 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2 index bea4aac82bd3..fec82db08944 100644 --- a/lib/libc/sys/poll.2 +++ b/lib/libc/sys/poll.2 @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 27, 2019 +.Dd April 27, 2021 .Dt POLL 2 .Os .Sh NAME @@ -126,6 +126,15 @@ POLLOUT should never be present in the .Fa revents bitmask at the same time. +.It POLLRDHUP +Remote peer closed connection, or shut down writing. +Unlike +POLLHUP, +POLLRDHUP +must be present in the +.Fa events +bitmask to be reported. +Applies only to stream sockets. .It POLLNVAL The file descriptor is not open, or in capability mode the file descriptor has insufficient rights. @@ -261,6 +270,9 @@ function conforms to The .Fn ppoll is not specified by POSIX. +The +POLLRDHUP +flag is not specified by POSIX, but is compatible with Linux and illumos. .Sh HISTORY The .Fn poll diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 92a204aafef0..ae678136bade 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3571,9 +3571,11 @@ sopoll_generic(struct socket *so, int events, struct ucred *active_cred, revents |= POLLHUP; } } + if (so->so_rcv.sb_state & SBS_CANTRCVMORE) + revents |= events & POLLRDHUP; if (revents == 0) { if (events & - (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) { + (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND | POLLRDHUP)) { selrecord(td, &so->so_rdsel); so->so_rcv.sb_flags |= SB_SEL; } diff --git a/sys/sys/poll.h b/sys/sys/poll.h index 6805704ca39f..02347ed09a13 100644 --- a/sys/sys/poll.h +++ b/sys/sys/poll.h @@ -71,6 +71,7 @@ struct pollfd { #if __BSD_VISIBLE /* General FreeBSD extension (currently only supported for sockets): */ #define POLLINIGNEOF 0x2000 /* like POLLIN, except ignore EOF */ +#define POLLRDHUP 0x4000 /* half shut down */ #endif /* diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index 54585086da23..985d67d83c99 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -89,12 +90,152 @@ ATF_TC_BODY(socket_afinet_bind_ok, tc) close(sd); } +ATF_TC_WITHOUT_HEAD(socket_afinet_poll_no_rdhup); +ATF_TC_BODY(socket_afinet_poll_no_rdhup, tc) +{ + int ss, ss2, cs, rc; + struct sockaddr_in sin; + struct pollfd pfd; + int one = 1; + + /* Verify that we don't expose POLLRDHUP if not requested. */ + + /* Server setup. */ + ss = socket(PF_INET, SOCK_STREAM, 0); + ATF_CHECK(ss >= 0); + rc = setsockopt(ss, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); + ATF_CHECK_EQ(0, rc); + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_port = htons(6666); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + rc = bind(ss, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + rc = listen(ss, 1); + ATF_CHECK_EQ(0, rc); + + /* Client connects, server accepts. */ + cs = socket(PF_INET, SOCK_STREAM, 0); + ATF_CHECK(cs >= 0); + rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + ss2 = accept(ss, NULL, NULL); + ATF_CHECK(ss2 >= 0); + + /* Server can write, sees only POLLOUT. */ + pfd.fd = ss2; + pfd.events = POLLIN | POLLOUT; + rc = poll(&pfd, 1, 0); + ATF_CHECK_EQ(1, rc); + ATF_CHECK_EQ(POLLOUT, pfd.revents); + + /* Client closes socket! */ + rc = close(cs); + ATF_CHECK_EQ(0, rc); + + /* + * Server now sees POLLIN, but not POLLRDHUP because we didn't ask. + * Need non-zero timeout to wait for the FIN to arrive and trigger the + * socket to become readable. + */ + pfd.fd = ss2; + pfd.events = POLLIN; + rc = poll(&pfd, 1, 60000); + ATF_CHECK_EQ(1, rc); + ATF_CHECK_EQ(POLLIN, pfd.revents); + + close(ss2); + close(ss); +} + +ATF_TC_WITHOUT_HEAD(socket_afinet_poll_rdhup); +ATF_TC_BODY(socket_afinet_poll_rdhup, tc) +{ + int ss, ss2, cs, rc; + struct sockaddr_in sin; + struct pollfd pfd; + char buffer; + int one = 1; + + /* Verify that server sees POLLRDHUP if it asks for it. */ + + /* Server setup. */ + ss = socket(PF_INET, SOCK_STREAM, 0); + ATF_CHECK(ss >= 0); + rc = setsockopt(ss, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); + ATF_CHECK_EQ(0, rc); + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_port = htons(6666); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + rc = bind(ss, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + rc = listen(ss, 1); + ATF_CHECK_EQ(0, rc); + + /* Client connects, server accepts. */ + cs = socket(PF_INET, SOCK_STREAM, 0); + ATF_CHECK(cs >= 0); + rc = connect(cs, (struct sockaddr *)&sin, sizeof(sin)); + ATF_CHECK_EQ(0, rc); + ss2 = accept(ss, NULL, NULL); + ATF_CHECK(ss2 >= 0); + + /* Server can write, so sees POLLOUT. */ + pfd.fd = ss2; + pfd.events = POLLIN | POLLOUT | POLLRDHUP; + rc = poll(&pfd, 1, 0); + ATF_CHECK_EQ(1, rc); + ATF_CHECK_EQ(POLLOUT, pfd.revents); + + /* Client writes two bytes, server reads only one of them. */ + rc = write(cs, "xx", 2); + ATF_CHECK_EQ(2, rc); + rc = read(ss2, &buffer, 1); + ATF_CHECK_EQ(1, rc); + + /* Server can read, so sees POLLIN. */ + pfd.fd = ss2; + pfd.events = POLLIN | POLLOUT | POLLRDHUP; + rc = poll(&pfd, 1, 0); + ATF_CHECK_EQ(1, rc); + ATF_CHECK_EQ(POLLIN | POLLOUT, pfd.revents); + + /* Client closes socket! */ + rc = close(cs); + ATF_CHECK_EQ(0, rc); + + /* + * Server sees Linux-style POLLRDHUP. Note that this is the case even + * though one byte of data remains unread. + * + * This races against the delivery of FIN caused by the close() above. + * Sometimes (more likely when run under truss or if another system + * call is added in between) it hits the path where sopoll_generic() + * immediately sees SBS_CANTRCVMORE, and sometimes it sleeps with flag + * SB_SEL so that it's woken up almost immediately and runs again, + * which is why we need a non-zero timeout here. + */ + pfd.fd = ss2; + pfd.events = POLLRDHUP; + rc = poll(&pfd, 1, 60000); + ATF_CHECK_EQ(1, rc); + ATF_CHECK_EQ(POLLRDHUP, pfd.revents); + + close(ss2); + close(ss); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_afinet); ATF_TP_ADD_TC(tp, socket_afinet_bind_zero); ATF_TP_ADD_TC(tp, socket_afinet_bind_ok); + ATF_TP_ADD_TC(tp, socket_afinet_poll_no_rdhup); + ATF_TP_ADD_TC(tp, socket_afinet_poll_rdhup); return atf_no_error(); } diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index eaea3ad96765..798cd299582c 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -726,7 +726,7 @@ struct xlat { static struct xlat poll_flags[] = { X(POLLSTANDARD) X(POLLIN) X(POLLPRI) X(POLLOUT) X(POLLERR) X(POLLHUP) X(POLLNVAL) X(POLLRDNORM) X(POLLRDBAND) - X(POLLWRBAND) X(POLLINIGNEOF) XEND + X(POLLWRBAND) X(POLLINIGNEOF) X(POLLRDHUP) XEND }; static struct xlat sigaction_flags[] = { From owner-dev-commits-src-main@freebsd.org Wed Apr 28 11:19:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 874325E68C0; Wed, 28 Apr 2021 11:19: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 4FVbkr2RH7z4Y3c; Wed, 28 Apr 2021 11:19: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 42D0C4E4E; Wed, 28 Apr 2021 11:19: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 13SBJmYf099672; Wed, 28 Apr 2021 11:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SBJmde099671; Wed, 28 Apr 2021 11:19:48 GMT (envelope-from git) Date: Wed, 28 Apr 2021 11:19:48 GMT Message-Id: <202104281119.13SBJmde099671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Thomas Munro Subject: git: 18f21f035548 - main - Update tools/regression/poll/sockpoll.c for POLLRDPOLL. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tmunro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18f21f0355481283ceef0ec10e99554f44c205c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 11:19:48 -0000 The branch main has been updated by tmunro: URL: https://cgit.FreeBSD.org/src/commit/?id=18f21f0355481283ceef0ec10e99554f44c205c2 commit 18f21f0355481283ceef0ec10e99554f44c205c2 Author: Thomas Munro AuthorDate: 2021-04-28 11:08:27 +0000 Commit: Thomas Munro CommitDate: 2021-04-28 11:15:39 +0000 Update tools/regression/poll/sockpoll.c for POLLRDPOLL. Add a POLLRDHUP example to this tool, for comparison with other operating systems. Also record current output on FreeBSD and Linux. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29757 --- tools/regression/poll/14/sockpoll.out | 22 +++++++ tools/regression/poll/l/sockpoll.out | 22 +++++++ tools/regression/poll/sockpoll.c | 111 +++++++++++++++++++++++----------- 3 files changed, 121 insertions(+), 34 deletions(-) diff --git a/tools/regression/poll/14/sockpoll.out b/tools/regression/poll/14/sockpoll.out new file mode 100644 index 000000000000..1e60f0e283e0 --- /dev/null +++ b/tools/regression/poll/14/sockpoll.out @@ -0,0 +1,22 @@ +1..18 +ok 1 state initial 0: expected POLLOUT; got POLLOUT +ok 2 state initial 1: expected POLLOUT; got POLLOUT +ok 3 state after large write: expected 0; got 0 +ok 4 state other side after large write: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 5 state other side after close: expected POLLIN | POLLHUP; got POLLIN | POLLHUP +not ok 6 state other side after reading input: expected POLLHUP; got POLLIN | POLLHUP +ok 7 state after shutdown(SHUT_WR): expected POLLOUT; got POLLOUT +ok 8 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 9 state other side after reading EOF: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 10 state after data from other side: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 11 state after writing: expected POLLIN; got POLLIN +ok 12 state after second shutdown: expected POLLIN | POLLHUP; got POLLIN | POLLHUP +not ok 13 state after second shutdown: expected POLLHUP; got POLLIN | POLLHUP +not ok 14 state after close: expected POLLHUP; got POLLIN | POLLHUP +ok 15 state after shutdown(SHUT_RD): expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 16 state other side after shutdown(SHUT_RD): expected POLLOUT; got POLLOUT +not ok 17 state after shutdown(SHUT_WR): expected POLLHUP; got POLLIN | POLLHUP +ok 18 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 19 state other side after shutdown(SHUT_RD): expected POLLOUT; got POLLOUT +ok 20 state other side after write: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 21 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT | POLLRDHUP; got POLLIN | POLLOUT | POLLRDHUP diff --git a/tools/regression/poll/l/sockpoll.out b/tools/regression/poll/l/sockpoll.out new file mode 100644 index 000000000000..cf5627d7953d --- /dev/null +++ b/tools/regression/poll/l/sockpoll.out @@ -0,0 +1,22 @@ +1..18 +ok 1 state initial 0: expected POLLOUT; got POLLOUT +ok 2 state initial 1: expected POLLOUT; got POLLOUT +ok 3 state after large write: expected 0; got 0 +ok 4 state other side after large write: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +not ok 5 state other side after close: expected POLLIN | POLLHUP; got POLLIN | POLLOUT | POLLHUP +not ok 6 state other side after reading input: expected POLLHUP; got POLLIN | POLLOUT | POLLHUP +ok 7 state after shutdown(SHUT_WR): expected POLLOUT; got POLLOUT +ok 8 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 9 state other side after reading EOF: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 10 state after data from other side: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 11 state after writing: expected POLLIN; got POLLIN +not ok 12 state after second shutdown: expected POLLIN | POLLHUP; got POLLIN | POLLOUT | POLLHUP +not ok 13 state after second shutdown: expected POLLHUP; got POLLIN | POLLHUP +not ok 14 state after close: expected POLLHUP; got POLLIN | POLLOUT | POLLHUP | 8 +ok 15 state after shutdown(SHUT_RD): expected POLLIN | POLLOUT; got POLLIN | POLLOUT +ok 16 state other side after shutdown(SHUT_RD): expected POLLOUT; got POLLOUT +not ok 17 state after shutdown(SHUT_WR): expected POLLHUP; got POLLIN | POLLOUT | POLLHUP +not ok 18 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT; got POLLIN | POLLOUT | POLLHUP +ok 19 state other side after shutdown(SHUT_RD): expected POLLOUT; got POLLOUT +ok 20 state other side after write: expected POLLIN | POLLOUT; got POLLIN | POLLOUT +not ok 21 state other side after shutdown(SHUT_WR): expected POLLIN | POLLOUT | POLLRDHUP; got POLLIN | POLLOUT | POLLHUP | POLLRDHUP diff --git a/tools/regression/poll/sockpoll.c b/tools/regression/poll/sockpoll.c index 4bffd29dc6f3..31ebcaf9bcb2 100644 --- a/tools/regression/poll/sockpoll.c +++ b/tools/regression/poll/sockpoll.c @@ -1,61 +1,82 @@ /* $FreeBSD$ */ -#include +#define _GNU_SOURCE /* expose POLLRDHUP when testing on Linux */ + #include #include #include #include +#include #include #include #include +#include #include -static const char * -decode_events(int events) +static void +append(char *out, size_t out_size, const char *s) +{ + size_t size = strlen(out); + + snprintf(out + size, out_size - size, "%s", s); +} + +static void +decode_events(int events, char *out, size_t out_size) { - char *ncresult; - const char *result; - - switch (events) { - case POLLIN: - result = "POLLIN"; - break; - case POLLOUT: - result = "POLLOUT"; - break; - case POLLIN | POLLOUT: - result = "POLLIN | POLLOUT"; - break; - case POLLHUP: - result = "POLLHUP"; - break; - case POLLIN | POLLHUP: - result = "POLLIN | POLLHUP"; - break; - case POLLOUT | POLLHUP: - result = "POLLOUT | POLLHUP"; - break; - case POLLIN | POLLOUT | POLLHUP: - result = "POLLIN | POLLOUT | POLLHUP"; - break; - default: - asprintf(&ncresult, "%#x", events); - result = ncresult; - break; + int unknown; + + out[0] = 0; + + if (events == 0) { + append(out, out_size, "0"); + return; + } + +#define DECODE_FLAG(x) \ + if (events & (x)) { \ + if (out[0] != 0) \ + append(out, out_size, " | "); \ + append(out, out_size, #x); \ + } + + /* Show the expected flags by name. */ + DECODE_FLAG(POLLIN); + DECODE_FLAG(POLLOUT); + DECODE_FLAG(POLLHUP); +#ifndef POLLRDHUP +#define KNOWN_FLAGS (POLLIN | POLLOUT | POLLHUP) +#else + DECODE_FLAG(POLLRDHUP); +#define KNOWN_FLAGS (POLLIN | POLLOUT | POLLHUP | POLLRDHUP); +#endif + + /* Show any unexpected bits as hex. */ + unknown = events & ~KNOWN_FLAGS; + if (unknown != 0) { + char buf[80]; + + snprintf(buf, sizeof(buf), "%s%x", out[0] != 0 ? " | " : "", + unknown); + append(out, out_size, buf); } - return (result); } static void report(int num, const char *state, int expected, int got) { + char expected_str[80]; + char got_str[80]; + + decode_events(expected, expected_str, sizeof(expected_str)); + decode_events(got, got_str, sizeof(got_str)); if (expected == got) printf("ok %-2d ", num); else printf("not ok %-2d", num); printf(" state %s: expected %s; got %s\n", - state, decode_events(expected), decode_events(got)); + state, expected_str, got_str); fflush(stdout); } @@ -198,5 +219,27 @@ main(void) close(fd[0]); close(fd[1]); +#ifdef POLLRDHUP + setup(); + pfd1.events |= POLLRDHUP; + if (shutdown(fd[0], SHUT_RD) == -1) + err(1, "shutdown"); + if (poll(&pfd1, 1, 0) == -1) + err(1, "poll"); + report(num++, "other side after shutdown(SHUT_RD)", POLLOUT, pfd1.revents); + if (write(fd[0], "x", 1) != 1) + err(1, "write"); + if (poll(&pfd1, 1, 0) == -1) + err(1, "poll"); + report(num++, "other side after write", POLLIN | POLLOUT, pfd1.revents); + if (shutdown(fd[0], SHUT_WR) == -1) + err(1, "shutdown"); + if (poll(&pfd1, 1, 0) == -1) + err(1, "poll"); + report(num++, "other side after shutdown(SHUT_WR)", POLLIN | POLLOUT | POLLRDHUP, pfd1.revents); + close(fd[0]); + close(fd[1]); +#endif + return (0); } From owner-dev-commits-src-main@freebsd.org Wed Apr 28 13:08:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 249F35F3341; Wed, 28 Apr 2021 13:08: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 4FVf840PyGz4fTr; Wed, 28 Apr 2021 13:08: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 00C086152; Wed, 28 Apr 2021 13:08: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 13SD8JdA046294; Wed, 28 Apr 2021 13:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SD8Jsh046293; Wed, 28 Apr 2021 13:08:19 GMT (envelope-from git) Date: Wed, 28 Apr 2021 13:08:19 GMT Message-Id: <202104281308.13SD8Jsh046293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 48be5b976e34 - main - tcp: stop spurious rescue retransmissions and potential asserts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48be5b976e34022862da3be69350d60e969d39e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 13:08:20 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=48be5b976e34022862da3be69350d60e969d39e5 commit 48be5b976e34022862da3be69350d60e969d39e5 Author: Richard Scheffenegger AuthorDate: 2021-04-28 12:56:14 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-28 13:01:10 +0000 tcp: stop spurious rescue retransmissions and potential asserts Reported by: pho@ MFC after: 3 days Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29970 --- sys/netinet/tcp_input.c | 1 + sys/netinet/tcp_sack.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9d45c5ab42dc..bdbf28556149 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -506,6 +506,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) } /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; + tp->sackhint.delivered_data = 0; tp->sackhint.prr_out = 0; } diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index bfe40854c76b..0eaeb39af71a 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -872,9 +872,11 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) tcp_seq highdata = tp->snd_max; if (tp->t_flags & TF_SENTFIN) highdata--; - if (th->th_ack != highdata) + if (th->th_ack != highdata) { + tp->snd_fack = th->th_ack; (void)tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, highdata - maxseg), highdata, NULL); + } } (void) tp->t_fb->tfb_tcp_output(tp); } From owner-dev-commits-src-main@freebsd.org Wed Apr 28 14:41:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A693C5F5F42; Wed, 28 Apr 2021 14:41:14 +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 4FVhCG4G3Lz4krK; Wed, 28 Apr 2021 14:41:14 +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 8590E7D08; Wed, 28 Apr 2021 14:41: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 13SEfEHB073726; Wed, 28 Apr 2021 14:41:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SEfElk073725; Wed, 28 Apr 2021 14:41:14 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:41:14 GMT Message-Id: <202104281441.13SEfElk073725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 44bbda649dc6 - main - cap_sysctl.3: Fix bugs in the example 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/main X-Git-Reftype: branch X-Git-Commit: 44bbda649dc6c1cdc5a99641e14c77157967e140 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:41:14 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=44bbda649dc6c1cdc5a99641e14c77157967e140 commit 44bbda649dc6c1cdc5a99641e14c77157967e140 Author: Mark Johnston AuthorDate: 2021-04-28 14:38:52 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:38:52 +0000 cap_sysctl.3: Fix bugs in the example - Correct the type of the sysctl value. - Initialize the oldsize parameter to cap_sysctlbyname() MFC after: 1 week Sponsored by: The FreeBSD Foundation --- lib/libcasper/services/cap_sysctl/cap_sysctl.3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libcasper/services/cap_sysctl/cap_sysctl.3 b/lib/libcasper/services/cap_sysctl/cap_sysctl.3 index 5d840796515e..0a7d009e1c3c 100644 --- a/lib/libcasper/services/cap_sysctl/cap_sysctl.3 +++ b/lib/libcasper/services/cap_sysctl/cap_sysctl.3 @@ -131,8 +131,8 @@ capability to get the value of cap_channel_t *capcas, *capsysctl; const char *name = "kern.trap_enotcap"; void *limit; -int value; size_t size; +bool value; /* Open capability to Casper. */ capcas = cap_init(); @@ -160,6 +160,7 @@ if (cap_sysctl_limit(limit) < 0) err(1, "Unable to set limits"); /* Fetch value. */ +size = sizeof(value); if (cap_sysctlbyname(capsysctl, name, &value, &size, NULL, 0) < 0) err(1, "Unable to get value of sysctl"); From owner-dev-commits-src-main@freebsd.org Wed Apr 28 14:41:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9B5C15F5EEA; Wed, 28 Apr 2021 14:41: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 4FVhD703V1z4l5t; Wed, 28 Apr 2021 14:41: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 BD0327D28; Wed, 28 Apr 2021 14:41: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 13SEfwwP073901; Wed, 28 Apr 2021 14:41:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SEfwPX073900; Wed, 28 Apr 2021 14:41:58 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:41:58 GMT Message-Id: <202104281441.13SEfwPX073900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?B?RmVybmFuZG8gQXBlc3RlZ3XDrWE=?= Subject: git: e444a4c677ee - main - build(7): fix references to svn(1) and svnlite(1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e444a4c677ee3e86038ba2179c4838f5f4b778cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:41:59 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e444a4c677ee3e86038ba2179c4838f5f4b778cd commit e444a4c677ee3e86038ba2179c4838f5f4b778cd Author: Fernando ApesteguĂ­a AuthorDate: 2021-04-23 16:59:19 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2021-04-28 14:38:27 +0000 build(7): fix references to svn(1) and svnlite(1) Replace them with references to Git. PR: 254937 Reported by: m.bueker@berlin.de Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D29949 --- share/man/man7/build.7 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 14ea7df02a76..9591b0365307 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2021 +.Dd April 28, 2021 .Dt BUILD 7 .Os .Sh NAME @@ -40,9 +40,11 @@ normally and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with -.Xr svn 1 -(or -.Xr svnlite 1 ) . +Git +.Po installed from packages with +.Xr pkg 7 +or from +.Xr ports 7 Pc . Directory .Pa /usr/src contains the @@ -873,11 +875,10 @@ manpage first appeared in .Xr cc 1 , .Xr install 1 , .Xr make 1 , -.Xr svn 1 , -.Xr svnlite 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr arch 7 , +.Xr pkg 7 , .Xr ports 7 , .Xr release 7 , .Xr tests 7 , From owner-dev-commits-src-main@freebsd.org Wed Apr 28 14:43:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 42A185F65A8; Wed, 28 Apr 2021 14:43: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 4FVhFx1Q9nz4lB3; Wed, 28 Apr 2021 14:43: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 23BE17864; Wed, 28 Apr 2021 14:43: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 13SEhXFu077329; Wed, 28 Apr 2021 14:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SEhXP1077328; Wed, 28 Apr 2021 14:43:33 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:43:33 GMT Message-Id: <202104281443.13SEhXP1077328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d1e9441583fd - main - pipe: Avoid calling selrecord() on a closing pipe 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/main X-Git-Reftype: branch X-Git-Commit: d1e9441583fd85c7de5f48197d80c287f1a9494b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:43:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d1e9441583fd85c7de5f48197d80c287f1a9494b commit d1e9441583fd85c7de5f48197d80c287f1a9494b Author: Mark Johnston AuthorDate: 2021-04-28 14:42:59 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:43:29 +0000 pipe: Avoid calling selrecord() on a closing pipe pipe_poll() may add the calling thread to the selinfo lists of both ends of a pipe. It is ok to do this for the local end, since we know we hold a reference on the file and so the local end is not closed. It is not ok to do this for the remote end, which may already be closed and have called seldrain(). In this scenario, when the polling thread wakes up, it may end up referencing a freed selinfo. Guard the selrecord() call appropriately. Reviewed by: kib Reported by: syzkaller+KASAN MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30016 --- sys/kern/sys_pipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index fee9d95e179c..d226543c0118 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1494,7 +1494,8 @@ pipe_poll(struct file *fp, int events, struct ucred *active_cred, rpipe->pipe_state |= PIPE_SEL; } - if ((fp->f_flag & FWRITE) != 0) { + if ((fp->f_flag & FWRITE) != 0 && + wpipe->pipe_present == PIPE_ACTIVE) { selrecord(td, &wpipe->pipe_sel); if (SEL_WAITING(&wpipe->pipe_sel)) wpipe->pipe_state |= PIPE_SEL; From owner-dev-commits-src-main@freebsd.org Wed Apr 28 15:06:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4FB765F7181; Wed, 28 Apr 2021 15:06: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 4FVhlz1dRkz4lpr; Wed, 28 Apr 2021 15:06: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 2AB537E6A; Wed, 28 Apr 2021 15:06: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 13SF67iS004901; Wed, 28 Apr 2021 15:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SF679b004900; Wed, 28 Apr 2021 15:06:07 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:06:07 GMT Message-Id: <202104281506.13SF679b004900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: efe7f12cd37b - main - linuxkpi: Implement rcu_replace_pointer() macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efe7f12cd37bf8f2538df387d565e7849112a598 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:06:07 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=efe7f12cd37bf8f2538df387d565e7849112a598 commit efe7f12cd37bf8f2538df387d565e7849112a598 Author: Neel Chauhan AuthorDate: 2021-04-28 15:04:52 +0000 Commit: Neel Chauhan CommitDate: 2021-04-28 15:04:52 +0000 linuxkpi: Implement rcu_replace_pointer() macro This is needed for the drm-kmod 5.5 update. Reviewed by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30025 --- sys/compat/linuxkpi/common/include/linux/rcupdate.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/rcupdate.h b/sys/compat/linuxkpi/common/include/linux/rcupdate.h index a43736e0285f..ea97fecee53b 100644 --- a/sys/compat/linuxkpi/common/include/linux/rcupdate.h +++ b/sys/compat/linuxkpi/common/include/linux/rcupdate.h @@ -97,6 +97,13 @@ (uintptr_t)(v)); \ } while (0) +#define rcu_replace_pointer(rcu, ptr, c) \ +({ \ + typeof(ptr) __tmp = rcu_dereference_protected(rcu, c); \ + rcu_assign_pointer(rcu, ptr); \ + __tmp; \ +}) + #define rcu_swap_protected(rcu, ptr, c) do { \ typeof(ptr) p = rcu_dereference_protected(rcu, c); \ rcu_assign_pointer(rcu, ptr); \ From owner-dev-commits-src-main@freebsd.org Wed Apr 28 15:06:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 955525F70DA; Wed, 28 Apr 2021 15:06: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 4FVhm036dpz4m45; Wed, 28 Apr 2021 15:06: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 5ABAB10350; Wed, 28 Apr 2021 15:06: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 13SF68KF004922; Wed, 28 Apr 2021 15:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SF68iG004921; Wed, 28 Apr 2021 15:06:08 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:06:08 GMT Message-Id: <202104281506.13SF68iG004921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 9781105bea58 - main - linuxkpi: Introduce tasklet_disable_nosync() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9781105bea58b8bce53ba766850c5f023b34c43c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:06:08 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9781105bea58b8bce53ba766850c5f023b34c43c commit 9781105bea58b8bce53ba766850c5f023b34c43c Author: Neel Chauhan AuthorDate: 2021-04-28 15:05:57 +0000 Commit: Neel Chauhan CommitDate: 2021-04-28 15:05:57 +0000 linuxkpi: Introduce tasklet_disable_nosync() This is needed for the drm-kmod 5.5 update. Reviewed by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30024 --- sys/compat/linuxkpi/common/include/linux/interrupt.h | 1 + sys/compat/linuxkpi/common/src/linux_tasklet.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index ca26cd24ffda..fc1241240b39 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -208,6 +208,7 @@ extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *, unsigned long data); extern void tasklet_enable(struct tasklet_struct *); extern void tasklet_disable(struct tasklet_struct *); +extern void tasklet_disable_nosync(struct tasklet_struct *); extern int tasklet_trylock(struct tasklet_struct *); extern void tasklet_unlock(struct tasklet_struct *); extern void tasklet_unlock_wait(struct tasklet_struct *ts); diff --git a/sys/compat/linuxkpi/common/src/linux_tasklet.c b/sys/compat/linuxkpi/common/src/linux_tasklet.c index 5cac8ffd994c..9a4c01737466 100644 --- a/sys/compat/linuxkpi/common/src/linux_tasklet.c +++ b/sys/compat/linuxkpi/common/src/linux_tasklet.c @@ -227,6 +227,13 @@ tasklet_disable(struct tasklet_struct *ts) tasklet_unlock_wait(ts); } +void +tasklet_disable_nosync(struct tasklet_struct *ts) +{ + atomic_inc(&ts->count); + barrier(); +} + int tasklet_trylock(struct tasklet_struct *ts) { From owner-dev-commits-src-main@freebsd.org Wed Apr 28 15:08:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 906AB5F7202; Wed, 28 Apr 2021 15:08: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 4FVhpq3hZqz4mNr; Wed, 28 Apr 2021 15:08: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 719357F79; Wed, 28 Apr 2021 15:08: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 13SF8ZXQ005204; Wed, 28 Apr 2021 15:08:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SF8ZXc005203; Wed, 28 Apr 2021 15:08:35 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:08:35 GMT Message-Id: <202104281508.13SF8ZXc005203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: 341da0077e66 - main - Bump __FreeBSD_version for commits efe7f12 and 9781105 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 341da0077e667973483ade98bb993e70f9e16704 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:08:35 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=341da0077e667973483ade98bb993e70f9e16704 commit 341da0077e667973483ade98bb993e70f9e16704 Author: Neel Chauhan AuthorDate: 2021-04-28 15:07:05 +0000 Commit: Neel Chauhan CommitDate: 2021-04-28 15:07:05 +0000 Bump __FreeBSD_version for commits efe7f12 and 9781105 These commits have added new APIs to linuxkpi. --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index bbfa48d65efe..92161cae13ae 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 1400012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Wed Apr 28 15:19:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7FE3E5F77C2; Wed, 28 Apr 2021 15:19: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 4FVj3T3F5Gz4mhN; Wed, 28 Apr 2021 15:19: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 61DC610788; Wed, 28 Apr 2021 15:19: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 13SFJXOH018457; Wed, 28 Apr 2021 15:19:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFJXeJ018456; Wed, 28 Apr 2021 15:19:33 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:19:33 GMT Message-Id: <202104281519.13SFJXeJ018456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6b146f3b9b66 - main - pf: Error tracing SDTs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b146f3b9b665c9baf6ba2cb038bbee359cb738a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:19:33 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b146f3b9b665c9baf6ba2cb038bbee359cb738a commit 6b146f3b9b665c9baf6ba2cb038bbee359cb738a Author: Kristof Provost AuthorDate: 2021-04-20 09:18:26 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:19:10 +0000 pf: Error tracing SDTs Add additional DTrace static trace points to facilitate debugging failing pf ioctl calls. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 102 +++++++++++++++++++++++++--------------------- sys/netpfil/pf/pf_nv.h | 1 + 2 files changed, 57 insertions(+), 46 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8176ac82a520..4e4f726a5614 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -93,6 +94,12 @@ __FBSDID("$FreeBSD$"); #include #endif +SDT_PROVIDER_DECLARE(pf); +SDT_PROBE_DEFINE3(pf, ioctl, ioctl, error, "int", "int", "int"); +SDT_PROBE_DEFINE3(pf, ioctl, function, error, "char *", "int", "int"); +SDT_PROBE_DEFINE2(pf, ioctl, addrule, error, "int", "int"); +SDT_PROBE_DEFINE2(pf, ioctl, nvchk, error, "int", "int"); + static struct pf_kpool *pf_get_kpool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -260,6 +267,14 @@ pflog_packet_t *pflog_packet_ptr = NULL; extern u_long pf_ioctl_maxcount; +#define ERROUT_FUNCTION(target, x) \ + do { \ + error = (x); \ + SDT_PROBE3(pf, ioctl, function, error, __func__, error, \ + __LINE__); \ + goto target; \ + } while (0) + static void pfattach_vnet(void) { @@ -1962,23 +1977,23 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) struct pf_krule *rule; int error = 0; +#define ERROUT(x) ERROUT_FUNCTION(errout, x) + rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); PFNV_CHK(pf_nvuint32(nvl, "nr", &rule->nr)); - if (! nvlist_exists_nvlist(nvl, "src")) { - error = EINVAL; - goto errout; - } + if (! nvlist_exists_nvlist(nvl, "src")) + ERROUT(EINVAL); + error = pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "src"), &rule->src); if (error != 0) - goto errout; + ERROUT(error); + + if (! nvlist_exists_nvlist(nvl, "dst")) + ERROUT(EINVAL); - if (! nvlist_exists_nvlist(nvl, "dst")) { - error = EINVAL; - goto errout; - } PFNV_CHK(pf_nvrule_addr_to_rule_addr(nvlist_get_nvlist(nvl, "dst"), &rule->dst)); @@ -1991,18 +2006,14 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) int ret; strs = nvlist_get_string_array(nvl, "labels", &items); - if (items > PF_RULE_MAX_LABEL_COUNT) { - error = E2BIG; - goto errout; - } + if (items > PF_RULE_MAX_LABEL_COUNT) + ERROUT(E2BIG); for (size_t i = 0; i < items; i++) { ret = strlcpy(rule->label[i], strs[i], sizeof(rule->label[0])); - if (ret >= sizeof(rule->label[0])) { - error = E2BIG; - goto errout; - } + if (ret >= sizeof(rule->label[0])) + ERROUT(E2BIG); } } @@ -2018,10 +2029,8 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) PFNV_CHK(pf_nvstring(nvl, "overload_tblname", rule->overload_tblname, sizeof(rule->overload_tblname))); - if (! nvlist_exists_nvlist(nvl, "rpool")) { - error = EINVAL; - goto errout; - } + if (! nvlist_exists_nvlist(nvl, "rpool")) + ERROUT(EINVAL); PFNV_CHK(pf_nvpool_to_pool(nvlist_get_nvlist(nvl, "rpool"), &rule->rpool)); @@ -2047,17 +2056,13 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) PFNV_CHK(pf_nvuint16(nvl, "max_mss", &rule->max_mss)); PFNV_CHK(pf_nvuint16(nvl, "scrub_flags", &rule->scrub_flags)); - if (! nvlist_exists_nvlist(nvl, "uid")) { - error = EINVAL; - goto errout; - } + if (! nvlist_exists_nvlist(nvl, "uid")) + ERROUT(EINVAL); PFNV_CHK(pf_nvrule_uid_to_rule_uid(nvlist_get_nvlist(nvl, "uid"), &rule->uid)); - if (! nvlist_exists_nvlist(nvl, "gid")) { - error = EINVAL; - goto errout; - } + if (! nvlist_exists_nvlist(nvl, "gid")) + ERROUT(EINVAL); PFNV_CHK(pf_nvrule_gid_to_rule_gid(nvlist_get_nvlist(nvl, "gid"), &rule->gid)); @@ -2095,10 +2100,8 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) if (nvlist_exists_nvlist(nvl, "divert")) { const nvlist_t *nvldivert = nvlist_get_nvlist(nvl, "divert"); - if (! nvlist_exists_nvlist(nvldivert, "addr")) { - error = EINVAL; - goto errout; - } + if (! nvlist_exists_nvlist(nvldivert, "addr")) + ERROUT(EINVAL); PFNV_CHK(pf_nvaddr_to_addr(nvlist_get_nvlist(nvldivert, "addr"), &rule->divert.addr)); PFNV_CHK(pf_nvuint16(nvldivert, "port", &rule->divert.port)); @@ -2106,16 +2109,12 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) /* Validation */ #ifndef INET - if (rule->af == AF_INET) { - error = EAFNOSUPPORT; - goto errout; - } + if (rule->af == AF_INET) + ERROUT(EAFNOSUPPORT); #endif /* INET */ #ifndef INET6 - if (rule->af == AF_INET6) { - error = EAFNOSUPPORT; - goto errout; - } + if (rule->af == AF_INET6) + ERROUT(EAFNOSUPPORT); #endif /* INET6 */ PFNV_CHK(pf_check_rule_addr(&rule->src)); @@ -2125,6 +2124,7 @@ pf_nvrule_to_krule(const nvlist_t *nvl, struct pf_krule **prule) return (0); +#undef ERROUT errout: pf_krule_free(rule); *prule = NULL; @@ -2412,7 +2412,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, goto errout_unlocked; } -#define ERROUT(x) { error = (x); goto errout; } +#define ERROUT(x) ERROUT_FUNCTION(errout, x) if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -2639,6 +2639,14 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td int error = 0; PF_RULES_RLOCK_TRACKER; +#define ERROUT_IOCTL(target, x) \ + do { \ + error = (x); \ + SDT_PROBE3(pf, ioctl, ioctl, error, cmd, error, __LINE__); \ + goto target; \ + } while (0) + + /* XXX keep in sync with switch() below */ if (securelevel_gt(td->td_ucred, 2)) switch (cmd) { @@ -2793,7 +2801,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td const char *anchor = "", *anchor_call = ""; uint32_t ticket = 0, pool_ticket = 0; -#define ERROUT(x) do { error = (x); goto DIOCADDRULENV_error; } while (0) +#define ERROUT(x) ERROUT_IOCTL(DIOCADDRULENV_error, x) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); @@ -2962,7 +2970,7 @@ DIOCADDRULENV_error: int rs_num, nr; bool clear_counter = false; -#define ERROUT(x) do { error = (x); goto DIOCGETRULENV_error; } while (0) +#define ERROUT(x) ERROUT_IOCTL(DIOCGETRULENV_error, x) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); @@ -3997,7 +4005,7 @@ DIOCGETSTATES_full: kif = pf_kkif_create(M_WAITOK); newpa->kif = NULL; } -#define ERROUT(x) { error = (x); goto DIOCCHANGEADDR_error; } +#define ERROUT(x) ERROUT_IOCTL(DIOCCHANGEADDR_error, x) PF_RULES_WLOCK(); ruleset = pf_find_kruleset(pca->anchor); if (ruleset == NULL) @@ -5129,6 +5137,8 @@ fail: sx_xunlock(&pf_ioctl_lock); CURVNET_RESTORE(); +#undef ERROUT_IOCTL + return (error); } @@ -5337,7 +5347,7 @@ pf_keepcounters(struct pfioc_nv *nv) void *nvlpacked = NULL; int error = 0; -#define ERROUT(x) do { error = (x); goto on_error; } while (0) +#define ERROUT(x) ERROUT_FUNCTION(on_error, x) if (nv->len > pf_ioctl_maxcount) ERROUT(ENOMEM); diff --git a/sys/netpfil/pf/pf_nv.h b/sys/netpfil/pf/pf_nv.h index 0a0f9beeef40..d50f46a1f5cd 100644 --- a/sys/netpfil/pf/pf_nv.h +++ b/sys/netpfil/pf/pf_nv.h @@ -53,6 +53,7 @@ int pf_nvstring(const nvlist_t *, const char *, char *, size_t); #define PFNV_CHK(x) do { \ error = (x); \ + SDT_PROBE2(pf, ioctl, nvchk, error, error, __LINE__); \ if (error != 0) \ goto errout; \ } while (0) From owner-dev-commits-src-main@freebsd.org Wed Apr 28 16:47:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1478C5F9FB0 for ; Wed, 28 Apr 2021 16:47:41 +0000 (UTC) (envelope-from sgscross@minjok.hs.kr) Received: from mail.minjok.hs.kr (mail.minjok.hs.kr [180.81.72.132]) by mx1.freebsd.org (Postfix) with ESMTP id 4FVl175WZXz4s0d for ; Wed, 28 Apr 2021 16:47:39 +0000 (UTC) (envelope-from sgscross@minjok.hs.kr) Received: by mail.minjok.hs.kr (Postfix, from userid 1001) id 020E730ED66C; Thu, 29 Apr 2021 01:47:28 +0900 (KST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.minjok.hs.kr X-Spam-Level: X-Spam-Status: No, score=-97.1 required=20.0 tests=ALL_TRUSTED, FREEMAIL_FORGED_REPLYTO, FREEMAIL_REPLYTO_END_DIGIT, HK_NAME_MR_MRS, MISSING_MID, USER_IN_WELCOMELIST,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.0 Received: from [103.156.90.40] (unknown [103.156.90.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.minjok.hs.kr (Postfix) with ESMTPSA id A1C2930ED655 for ; Thu, 29 Apr 2021 01:47:27 +0900 (KST) Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Description: Mail message body Subject: Response. To: dev-commits-src-main@freebsd.org From: "Mr. G" Date: Wed, 28 Apr 2021 09:47:27 -0700 Reply-To: gp4112316@gmail.com Message-Id: <20210428164728.020E730ED66C@mail.minjok.hs.kr> X-Virus-Scanned: clamav-milter 0.103.0 at mail.minjok.hs.kr X-Virus-Status: Clean X-Rspamd-Queue-Id: 4FVl175WZXz4s0d X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sgscross@minjok.hs.kr designates 180.81.72.132 as permitted sender) smtp.mailfrom=sgscross@minjok.hs.kr X-Spamd-Result: default: False [1.49 / 15.00]; HAS_REPLYTO(0.00)[gp4112316@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:180.81.72.132]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[180.81.72.132:from]; ASN(0.00)[asn:23571, ipnet:180.81.72.0/24, country:KR]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; FREEMAIL_REPLYTO(0.00)[gmail.com]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[180.81.72.132:from:127.0.2.255]; DMARC_NA(0.00)[minjok.hs.kr]; NEURAL_SPAM_LONG(0.69)[0.694]; FROM_NAME_HAS_TITLE(1.00)[mr]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 16:47:41 -0000 Good day, I have a very important transaction I would like to carry out with you. do = write me back on: gp4112316@gmail.com for more details. Best regards, Gary Phys. From owner-dev-commits-src-main@freebsd.org Wed Apr 28 17:34:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1BFAF5FBA0A; Wed, 28 Apr 2021 17:34: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 4FVm2z09kSz4vGL; Wed, 28 Apr 2021 17:34: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 ECE0412483; Wed, 28 Apr 2021 17:34: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 13SHYIHj003940; Wed, 28 Apr 2021 17:34:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SHYIss003939; Wed, 28 Apr 2021 17:34:18 GMT (envelope-from git) Date: Wed, 28 Apr 2021 17:34:18 GMT Message-Id: <202104281734.13SHYIss003939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: fdbcd35a75e5 - main - ixgbe: Improve device name strings 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/main X-Git-Reftype: branch X-Git-Commit: fdbcd35a75e596a78b4c0330eaded476eaa14797 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 17:34:19 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fdbcd35a75e596a78b4c0330eaded476eaa14797 commit fdbcd35a75e596a78b4c0330eaded476eaa14797 Author: Kevin Bowling AuthorDate: 2021-04-21 02:35:14 +0000 Commit: Kevin Bowling CommitDate: 2021-04-28 17:29:59 +0000 ixgbe: Improve device name strings This is just clerical work to ease bug triage and may be used to set expectations around the ability for anyone in the community to perform testing and development on older parts. Approved by: erj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29876 --- sys/dev/ixgbe/if_ix.c | 88 +++++++++++++++++++++++++------------------------- sys/dev/ixgbe/if_ixv.c | 10 +++--- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index a483fe503c7f..489e891cf509 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -61,50 +61,50 @@ char ixgbe_driver_version[] = "4.0.1-k"; ************************************************************************/ static pci_vendor_info_t ixgbe_vendor_info_array[] = { - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_1G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_10G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_BYPASS, "Intel(R) PRO/10GbE PCI-Express Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, "Intel(R) 82598EB AF (Dual Fiber)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, "Intel(R) 82598EB AF (Fiber)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, "Intel(R) 82598EB AT (CX4)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, "Intel(R) 82598EB AT"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, "Intel(R) 82598EB AT2"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, "Intel(R) 82598"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, "Intel(R) 82598EB AF DA (Dual Fiber)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, "Intel(R) 82598EB AT (Dual CX4)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, "Intel(R) 82598EB AF (Dual Fiber LR)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, "Intel(R) 82598EB AF (Dual Fiber SR)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, "Intel(R) 82598EB LOM"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, "Intel(R) X520 82599 (KX4)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, "Intel(R) X520 82599 (KX4 Mezzanine)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, "Intel(R) X520 82599ES (SFI/SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, "Intel(R) X520 82599 (XAUI/BX4)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, "Intel(R) X520 82599 (Dual CX4)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, "Intel(R) X520-T 82599 LOM"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, "Intel(R) X520 82599 (Combined Backplane)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, "Intel(R) X520 82599 (Backplane w/FCoE)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, "Intel(R) X520 82599 (Dual SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, "Intel(R) X520 82599 (Dual SFP+ w/FCoE)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, "Intel(R) X520-1 82599EN (SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, "Intel(R) X520-4 82599 (Quad SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP, "Intel(R) X520-Q1 82599 (QSFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, "Intel(R) X540-AT2"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, "Intel(R) X540-T1"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, "Intel(R) X550-T2"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, "Intel(R) X550-T1"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, "Intel(R) X552 (KR Backplane)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, "Intel(R) X552 (KX4 Backplane)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, "Intel(R) X552/X557-AT (10GBASE-T)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_1G_T, "Intel(R) X552 (1000BASE-T)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, "Intel(R) X552 (SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR, "Intel(R) X553 (KR Backplane)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L, "Intel(R) X553 L (KR Backplane)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP, "Intel(R) X553 (SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N, "Intel(R) X553 N (SFP+)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII, "Intel(R) X553 (1GbE SGMII)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII_L, "Intel(R) X553 L (1GbE SGMII)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_10G_T, "Intel(R) X553/X557-AT (10GBASE-T)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T, "Intel(R) X553 (1GbE)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T_L, "Intel(R) X553 L (1GbE)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_BYPASS, "Intel(R) X540-T2 (Bypass)"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS, "Intel(R) X520 82599 (Bypass)"), /* required last entry */ PVID_END }; diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index ee139430d42b..9744a3347cec 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -59,11 +59,11 @@ char ixv_driver_version[] = "2.0.1-k"; ************************************************************************/ static pci_vendor_info_t ixv_vendor_info_array[] = { - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, "Intel(R) PRO/10GbE Virtual Function Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, "Intel(R) PRO/10GbE Virtual Function Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550_VF, "Intel(R) PRO/10GbE Virtual Function Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_VF, "Intel(R) PRO/10GbE Virtual Function Network Driver"), - PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_VF, "Intel(R) PRO/10GbE Virtual Function Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_VF, "Intel(R) X520 82599 Virtual Function"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_VF, "Intel(R) X540 Virtual Function"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550_VF, "Intel(R) X550 Virtual Function"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_VF, "Intel(R) X552 Virtual Function"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_VF, "Intel(R) X553 Virtual Function"), /* required last entry */ PVID_END }; From owner-dev-commits-src-main@freebsd.org Wed Apr 28 19:43:02 2021 Return-Path: Delivered-To: dev-commits-src-main@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 377725FF3BC; Wed, 28 Apr 2021 19:43: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 4FVpvV0pjKz3J3S; Wed, 28 Apr 2021 19:43: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 0EB2113BD0; Wed, 28 Apr 2021 19:43: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 13SJh1kJ077834; Wed, 28 Apr 2021 19:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJh1nl077833; Wed, 28 Apr 2021 19:43:01 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:43:01 GMT Message-Id: <202104281943.13SJh1nl077833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 164d49a5842d - main - Correct the link of external mirrors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 164d49a5842dcd07823570eaa775e82ed10022d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:43:02 -0000 The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=164d49a5842dcd07823570eaa775e82ed10022d3 commit 164d49a5842dcd07823570eaa775e82ed10022d3 Author: Li-Wen Hsu AuthorDate: 2021-04-28 19:39:18 +0000 Commit: Li-Wen Hsu CommitDate: 2021-04-28 19:39:18 +0000 Correct the link of external mirrors Reported by: 0mp Fixes: 8ef03ce6db33 MFC after: 1 day --- share/man/man7/development.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 6a2d872e506f..a0459ccfad72 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -69,7 +69,7 @@ The push URL is: .Pp There is also a list of public, read-only Git mirrors at: .Pp -.Lk https://docs.FreeBSD.org/en/books/handbook/mirrors/#_external_mirrors +.Lk https://docs.freebsd.org/en/books/handbook/mirrors/#external-mirrors .Pp The .Ql main From owner-dev-commits-src-main@freebsd.org Wed Apr 28 19:53:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1CC5A5FFC2D; Wed, 28 Apr 2021 19:53: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 4FVq7n0Jjcz3JV9; Wed, 28 Apr 2021 19:53: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 F1D16141D3; Wed, 28 Apr 2021 19:53: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 13SJre8p090986; Wed, 28 Apr 2021 19:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJreHf090985; Wed, 28 Apr 2021 19:53:40 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:53:40 GMT Message-Id: <202104281953.13SJreHf090985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 074abaccfaad - main - cache: remove incomplete lockless lockout support during resize 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/main X-Git-Reftype: branch X-Git-Commit: 074abaccfaadef0da6e2695225ce537cb53bb8de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:53:41 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=074abaccfaadef0da6e2695225ce537cb53bb8de commit 074abaccfaadef0da6e2695225ce537cb53bb8de Author: Mateusz Guzik AuthorDate: 2021-04-10 17:20:28 +0000 Commit: Mateusz Guzik CommitDate: 2021-04-28 19:53:25 +0000 cache: remove incomplete lockless lockout support during resize This is already properly handled thanks to 2 step hash replacement. --- sys/kern/vfs_cache.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 68ad0128245b..2aaaecb5cd4d 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -580,9 +580,6 @@ static long cache_lock_vnodes_cel_3_failures; DEBUGNODE_ULONG(vnodes_cel_3_failures, cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); -static void cache_fplookup_lockout(void); -static void cache_fplookup_restore(void); - static void cache_zap_locked(struct namecache *ncp); static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, size_t *buflen); @@ -2771,7 +2768,6 @@ cache_changesize(u_long newmaxvnodes) * None of the namecache entries in the table can be removed * because to do so, they have to be removed from the hash table. */ - cache_fplookup_lockout(); cache_lock_all_vnodes(); cache_lock_all_buckets(); old_nchashtbl = nchashtbl; @@ -2790,7 +2786,6 @@ cache_changesize(u_long newmaxvnodes) cache_changesize_set_new(new_nchashtbl, new_nchash); cache_unlock_all_buckets(); cache_unlock_all_vnodes(); - cache_fplookup_restore(); ncfreetbl(old_nchashtbl); ncfreetbl(temptbl); } @@ -3865,33 +3860,6 @@ syscal_vfs_cache_fast_lookup(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vfs, OID_AUTO, cache_fast_lookup, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, &cache_fast_lookup, 0, syscal_vfs_cache_fast_lookup, "IU", ""); -/* - * Disable lockless lookup and observe all CPUs not executing it. - * - * Used when resizing the hash table. - * - * TODO: no provisions are made to handle tweaking of the knob at the same time - */ -static void -cache_fplookup_lockout(void) -{ - bool on; - - on = atomic_load_char(&cache_fast_lookup_enabled); - if (on) { - atomic_store_char(&cache_fast_lookup_enabled, false); - atomic_thread_fence_rel(); - vfs_smr_synchronize(); - } -} - -static void -cache_fplookup_restore(void) -{ - - cache_fast_lookup_enabled_recalc(); -} - /* * Components of nameidata (or objects it can point to) which may * need restoring in case fast path lookup fails. From owner-dev-commits-src-main@freebsd.org Wed Apr 28 20:23:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D76EF62133F; Wed, 28 Apr 2021 20:23: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 4FVqp05lxVz3L8W; Wed, 28 Apr 2021 20:23: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 B8A20146B2; Wed, 28 Apr 2021 20:23: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 13SKNKR9031222; Wed, 28 Apr 2021 20:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SKNKEw031221; Wed, 28 Apr 2021 20:23:20 GMT (envelope-from git) Date: Wed, 28 Apr 2021 20:23:20 GMT Message-Id: <202104282023.13SKNKEw031221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 41ce0e34ea42 - main - [fib algo] Update fib_gen counter under FIB_MOD_LOCK. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 20:23:20 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8 commit 41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8 Author: Alexander V. Chernikov AuthorDate: 2021-04-28 20:21:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-28 20:23:03 +0000 [fib algo] Update fib_gen counter under FIB_MOD_LOCK. MFC after: 3 days --- sys/net/route/fib_algo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 837ea7c2b43b..3a09408c92b1 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1169,19 +1169,19 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, estimate_nhop_scale(old_fd, fd); fd->fd_rh = rh; - fd->fd_gen = ++fib_gen; fd->fd_family = rh->rib_family; fd->fd_fibnum = rh->rib_fibnum; callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0); fd->fd_vnet = curvnet; fd->fd_flm = flm; - FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd); - FIB_MOD_LOCK(); flm->flm_refcount++; + fd->fd_gen = ++fib_gen; FIB_MOD_UNLOCK(); + FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd); + /* Allocate nhidx -> nhop_ptr table */ size = fd->number_nhops * sizeof(void *); fd->nh_idx = malloc(size, M_RTABLE, M_NOWAIT | M_ZERO); From owner-dev-commits-src-main@freebsd.org Wed Apr 28 23:41:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0D8BC6254D2; Wed, 28 Apr 2021 23: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 4FVwC071B8z3hK5; Wed, 28 Apr 2021 23:41: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 E3C1B1648A; Wed, 28 Apr 2021 23: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 13SNfmBN091921; Wed, 28 Apr 2021 23: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 13SNfm6I091920; Wed, 28 Apr 2021 23:41:48 GMT (envelope-from git) Date: Wed, 28 Apr 2021 23:41:48 GMT Message-Id: <202104282341.13SNfm6I091920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: b9820bca183a - main - cxgbe(4): Do not panic when tx is called with invalid checksum requests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9820bca183aba6c0c03a8b717bedd24da7428da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 23:41:49 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b9820bca183aba6c0c03a8b717bedd24da7428da commit b9820bca183aba6c0c03a8b717bedd24da7428da Author: Navdeep Parhar AuthorDate: 2021-04-28 20:45:58 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-28 21:04:53 +0000 cxgbe(4): Do not panic when tx is called with invalid checksum requests. There is no need to panic in if_transmit if the checksums requested are inconsistent with the frame being transmitted. This typically indicates that the kernel and driver were built with different INET/INET6 options, or there is some other kernel bug. The driver should just throw away the requests that it doesn't understand and move on. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sge.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 93e19f43d2bc..2f6c7e2e7914 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -2652,6 +2652,9 @@ max_nsegs_allowed(struct mbuf *m, bool vm_wr) return (TX_SGL_SEGS); } +static struct timeval txerr_ratecheck = {0}; +static const struct timeval txerr_interval = {3, 0}; + /* * Analyze the mbuf to determine its tx needs. The mbuf passed in may change: * a) caller can assume it's been freed if this function returns with an error. @@ -2803,9 +2806,14 @@ restart: } #endif default: - panic("%s: ethertype 0x%04x unknown. if_cxgbe must be compiled" - " with the same INET/INET6 options as the kernel.", - __func__, eh_type); + if (ratecheck(&txerr_ratecheck, &txerr_interval)) { + log(LOG_ERR, "%s: ethertype 0x%04x unknown. " + "if_cxgbe must be compiled with the same " + "INET/INET6 options as the kernel.\n", __func__, + eh_type); + } + rc = EINVAL; + goto fail; } if (needs_vxlan_csum(m0)) { @@ -2841,10 +2849,15 @@ restart: } #endif default: - panic("%s: VXLAN hw offload requested with unknown " - "ethertype 0x%04x. if_cxgbe must be compiled" - " with the same INET/INET6 options as the kernel.", - __func__, eh_type); + if (ratecheck(&txerr_ratecheck, &txerr_interval)) { + log(LOG_ERR, "%s: VXLAN hw offload requested" + "with unknown ethertype 0x%04x. if_cxgbe " + "must be compiled with the same INET/INET6 " + "options as the kernel.\n", __func__, + eh_type); + } + rc = EINVAL; + goto fail; } #if defined(INET) || defined(INET6) if (needs_inner_tcp_csum(m0)) { From owner-dev-commits-src-main@freebsd.org Thu Apr 29 04:44:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9AF765F61B6; Thu, 29 Apr 2021 04:44:55 +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 4FW2wl43qVz3rPQ; Thu, 29 Apr 2021 04:44:55 +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 7E8A518BA0; Thu, 29 Apr 2021 04:44:55 +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 13T4itVI079497; Thu, 29 Apr 2021 04:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T4itfc079496; Thu, 29 Apr 2021 04:44:55 GMT (envelope-from git) Date: Thu, 29 Apr 2021 04:44:55 GMT Message-Id: <202104290444.13T4itfc079496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f648d757b76d - main - pkg(7): indentation fixes 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/main X-Git-Reftype: branch X-Git-Commit: f648d757b76d70d58bbda7c3ed3ff79261d24d0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 04:44:55 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f648d757b76d70d58bbda7c3ed3ff79261d24d0f commit f648d757b76d70d58bbda7c3ed3ff79261d24d0f Author: Baptiste Daroussin AuthorDate: 2021-04-27 02:07:05 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-29 04:41:34 +0000 pkg(7): indentation fixes Non functional changes --- usr.sbin/pkg/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 3a9ad63ae407..cf21a43b078d 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$"); #include "config.h" struct config_value { - char *value; - STAILQ_ENTRY(config_value) next; + char *value; + STAILQ_ENTRY(config_value) next; }; struct config_entry { From owner-dev-commits-src-main@freebsd.org Thu Apr 29 04:44:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E17D15F6601; Thu, 29 Apr 2021 04:44: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 4FW2wm5CtDz3rZX; Thu, 29 Apr 2021 04:44: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 A2D0418935; Thu, 29 Apr 2021 04:44: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 13T4iuG8079524; Thu, 29 Apr 2021 04:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T4iuDY079523; Thu, 29 Apr 2021 04:44:56 GMT (envelope-from git) Date: Thu, 29 Apr 2021 04:44:56 GMT Message-Id: <202104290444.13T4iuDY079523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: cc9a8a116d19 - main - pkg(7): replace usage of sbuf(9) with open_memstream(3) 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/main X-Git-Reftype: branch X-Git-Commit: cc9a8a116d19daf224222506441e91a3d329160e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 04:44:57 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cc9a8a116d19daf224222506441e91a3d329160e commit cc9a8a116d19daf224222506441e91a3d329160e Author: Baptiste Daroussin AuthorDate: 2021-04-27 02:38:55 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-29 04:41:59 +0000 pkg(7): replace usage of sbuf(9) with open_memstream(3) open_memstream(3) is a standard way to obtain the same feature we do get by using sbuf(9) (aka dynamic size buffer), switching to using it makes pkg(7) more portable, and reduces its number of dependencies. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D30005 --- usr.sbin/pkg/Makefile | 2 +- usr.sbin/pkg/config.c | 33 +++++++++++++++---------- usr.sbin/pkg/pkg.c | 67 +++++++++++++++++++++++++++------------------------ 3 files changed, 56 insertions(+), 46 deletions(-) diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile index 980faafc6b6c..a71f0b2acb86 100644 --- a/usr.sbin/pkg/Makefile +++ b/usr.sbin/pkg/Makefile @@ -25,6 +25,6 @@ MAN= pkg.7 CFLAGS+=-I${SRCTOP}/contrib/libucl/include .PATH: ${SRCTOP}/contrib/libucl/include -LIBADD= archive fetch ucl sbuf crypto ssl util +LIBADD= archive fetch ucl crypto ssl util .include diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index cf21a43b078d..08e206b93511 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -214,7 +213,9 @@ boolstr_to_bool(const char *str) static void config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) { - struct sbuf *buf = sbuf_new_auto(); + FILE *buffp; + char *buf = NULL; + size_t bufsz = 0; const ucl_object_t *cur, *seq, *tmp; ucl_object_iter_t it = NULL, itseq = NULL, it_obj = NULL; struct config_entry *temp_config; @@ -225,39 +226,44 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) /* Temporary config for configs that may be disabled. */ temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); + buffp = open_memstream(&buf, &bufsz); + if (buffp == NULL) + err(EXIT_FAILURE, "open_memstream()"); while ((cur = ucl_iterate_object(obj, &it, true))) { key = ucl_object_key(cur); if (key == NULL) continue; - sbuf_clear(buf); + if (buf != NULL) + memset(buf, 0, bufsz); + rewind(buffp); if (conftype == CONFFILE_PKG) { for (j = 0; j < strlen(key); ++j) - sbuf_putc(buf, toupper(key[j])); - sbuf_finish(buf); + fputc(toupper(key[j]), buffp); + fflush(buffp); } else if (conftype == CONFFILE_REPO) { if (strcasecmp(key, "url") == 0) - sbuf_cpy(buf, "PACKAGESITE"); + fputs("PACKAGESITE", buffp); else if (strcasecmp(key, "mirror_type") == 0) - sbuf_cpy(buf, "MIRROR_TYPE"); + fputs("MIRROR_TYPE", buffp); else if (strcasecmp(key, "signature_type") == 0) - sbuf_cpy(buf, "SIGNATURE_TYPE"); + fputs("SIGNATURE_TYPE", buffp); else if (strcasecmp(key, "fingerprints") == 0) - sbuf_cpy(buf, "FINGERPRINTS"); + fputs("FINGERPRINTS", buffp); else if (strcasecmp(key, "pubkey") == 0) - sbuf_cpy(buf, "PUBKEY"); + fputs("PUBKEY", buffp); else if (strcasecmp(key, "enabled") == 0) { if ((cur->type != UCL_BOOLEAN) || !ucl_object_toboolean(cur)) goto cleanup; } else continue; - sbuf_finish(buf); + fflush(buffp); } for (i = 0; i < CONFIG_SIZE; i++) { - if (strcmp(sbuf_data(buf), c[i].key) == 0) + if (strcmp(buf, c[i].key) == 0) break; } @@ -332,7 +338,8 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) cleanup: free(temp_config); - sbuf_delete(buf); + fclose(buffp); + free(buf); } /*- diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 04232672ac39..8193dc79a430 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -595,7 +594,9 @@ static struct pubkey * read_pubkey(int fd) { struct pubkey *pk; - struct sbuf *sig; + char *sigb; + size_t sigsz; + FILE *sig; char buf[4096]; int r; @@ -604,18 +605,22 @@ read_pubkey(int fd) return (NULL); } - sig = sbuf_new_auto(); + sigsz = 0; + sigb = NULL; + sig = open_memstream(&sigb, &sigsz); + if (sig == NULL) + err(EXIT_FAILURE, "open_memstream()"); while ((r = read(fd, buf, sizeof(buf))) >0) { - sbuf_bcat(sig, buf, r); + fwrite(buf, 1, r, sig); } - sbuf_finish(sig); + fclose(sig); pk = calloc(1, sizeof(struct pubkey)); - pk->siglen = sbuf_len(sig); + pk->siglen = sigsz; pk->sig = calloc(1, pk->siglen); - memcpy(pk->sig, sbuf_data(sig), pk->siglen); - sbuf_delete(sig); + memcpy(pk->sig, sigb, pk->siglen); + free(sigb); return (pk); } @@ -624,16 +629,17 @@ static struct sig_cert * parse_cert(int fd) { int my_fd; struct sig_cert *sc; - FILE *fp; - struct sbuf *buf, *sig, *cert; + FILE *fp, *sigfp, *certfp, *tmpfp; char *line; - size_t linecap; + char *sig, *cert; + size_t linecap, sigsz, certsz; ssize_t linelen; - buf = NULL; sc = NULL; line = NULL; linecap = 0; + sig = cert = NULL; + sigfp = certfp = tmpfp = NULL; if (lseek(fd, 0, 0) == -1) { warn("lseek"); @@ -652,41 +658,38 @@ parse_cert(int fd) { return (NULL); } - sig = sbuf_new_auto(); - cert = sbuf_new_auto(); + sigsz = certsz = 0; + sigfp = open_memstream(&sig, &sigsz); + if (sigfp == NULL) + err(EXIT_FAILURE, "open_memstream()"); + certfp = open_memstream(&cert, &certsz); + if (certfp == NULL) + err(EXIT_FAILURE, "open_memstream()"); while ((linelen = getline(&line, &linecap, fp)) > 0) { if (strcmp(line, "SIGNATURE\n") == 0) { - buf = sig; + tmpfp = sigfp; continue; } else if (strcmp(line, "CERT\n") == 0) { - buf = cert; + tmpfp = certfp; continue; } else if (strcmp(line, "END\n") == 0) { break; } - if (buf != NULL) - sbuf_bcat(buf, line, linelen); + if (tmpfp != NULL) + fwrite(line, 1, linelen, tmpfp); } fclose(fp); - - /* Trim out unrelated trailing newline */ - sbuf_setpos(sig, sbuf_len(sig) - 1); - - sbuf_finish(sig); - sbuf_finish(cert); + fclose(sigfp); + fclose(certfp); sc = calloc(1, sizeof(struct sig_cert)); - sc->siglen = sbuf_len(sig); - sc->sig = calloc(1, sc->siglen); - memcpy(sc->sig, sbuf_data(sig), sc->siglen); - - sc->certlen = sbuf_len(cert); - sc->cert = strdup(sbuf_data(cert)); + sc->siglen = sigsz -1; /* Trim out unrelated trailing newline */ + sc->sig = sig; - sbuf_delete(sig); - sbuf_delete(cert); + sc->certlen = certsz; + sc->cert = cert; return (sc); } From owner-dev-commits-src-main@freebsd.org Thu Apr 29 04:46:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D68A05F647A; Thu, 29 Apr 2021 04:46: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 4FW2yq5jvRz3rSh; Thu, 29 Apr 2021 04:46: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 B6E221874A; Thu, 29 Apr 2021 04:46: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 13T4khG9079755; Thu, 29 Apr 2021 04:46:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T4khVN079754; Thu, 29 Apr 2021 04:46:43 GMT (envelope-from git) Date: Thu, 29 Apr 2021 04:46:43 GMT Message-Id: <202104290446.13T4khVN079754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: a4b5f7ba3e9b - main - pci_vendors: update to 2021.04.26 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/main X-Git-Reftype: branch X-Git-Commit: a4b5f7ba3e9bf8385b6e113c284d1559333048a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 04:46:43 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a4b5f7ba3e9bf8385b6e113c284d1559333048a0 commit a4b5f7ba3e9bf8385b6e113c284d1559333048a0 Author: Baptiste Daroussin AuthorDate: 2021-04-29 04:46:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-04-29 04:46:26 +0000 pci_vendors: update to 2021.04.26 --- share/misc/pci_vendors | 319 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 274 insertions(+), 45 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 35692066d391..1a00db8f19dc 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2021.02.20 -# Date: 2021-02-20 03:15:02 +# Version: 2021.04.26 +# Date: 2021-04-26 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -522,6 +522,7 @@ 1000 3040 9210-8i 1000 3080 9200-8e [LSI SAS 6Gb/s SAS/SATA PCIe x8 External HBA] 1000 30b0 9200-8e [LSI SAS 6Gb/s SAS/SATA PCIe x8 External HBA] + 1014 03ca IBM 6Gb SAS HBA [9212-4i4e] 1028 1f1c 6Gbps SAS HBA Adapter 1028 1f1d PERC H200 Adapter 1028 1f1e PERC H200 Integrated @@ -873,6 +874,14 @@ 1d49 060e ThinkSystem RAID 940-32i 8GB Flash PCIe Gen4 12Gb Adapter 1d49 060f ThinkSystem RAID 940-8e 4GB Flash PCIe Gen4 12Gb Adapter 10e2 MegaRAID 12GSAS/PCIe Secure SAS39xx +# 9560 16 internal port RAID controller + 1000 4000 MegaRAID 9560-16i +# 9560 8 internal port RAID controller + 1000 4010 MegaRAID 9560-8i +# 9580 8 internal & 8 external port RAID controller + 1000 4020 MegaRAID 9580-8i8e +# MegaRAID 9562-16i 9562 16 internal port RAID controller + 1000 40b0 MegaRAID 9562-16i 1028 1ae0 PERC H755 Adapter 1028 1ae1 PERC H755 Front 1028 1ae2 PERC H755N Front @@ -907,6 +916,7 @@ 8086 0523 MegaRAID RAID Controller SRCS16 3050 SAS2008 PCI-Express Fusion-MPT SAS-2 6001 DX1 Multiformat Broadcast HD/SD Encoder/Decoder + c010 PEX88048 50 lane, 50 port, PCI Express Gen 4.0 ExpressFabric Platform c012 PEX880xx PCIe Gen 4 Switch 1d49 0003 ThinkSystem 1611-8P PCIe Gen4 NVMe Switch Adapter 1001 Kolter Electronic @@ -959,6 +969,7 @@ 1561 Anubis 15d8 Picasso 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 3181 ThinkCentre M75n IoT 17aa 5124 ThinkPad E595 ea50 cc10 RXi2-BP 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] @@ -980,6 +991,7 @@ 1638 Cezanne 163f VanGogh 164c Lucienne + 164d Rembrandt 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 103c 168b ProBook 4535s 3150 RV380/M24 [Mobility Radeon X600] @@ -1904,7 +1916,7 @@ 5e6d RV410 [Radeon X700] (Secondary) 148c 2117 Bravo X700 (Secondary) 5f57 R423 [Radeon X800 XT] - 6600 Mars [Radeon HD 8670A/8670M/8750M] + 6600 Mars [Radeon HD 8670A/8670M/8750M / R7 M370] 103c 1952 ProBook 455 G1 6601 Mars [Radeon HD 8730M] 103c 2100 FirePro M4100 @@ -1922,8 +1934,10 @@ 6608 Oland GL [FirePro W2100] 13cc 3d28 MXRT-2600 6609 Oland GL [FirePro W2100 / Barco MXRT 2600] - 6610 Oland XT [Radeon HD 8670 / R7 250/350] + 6610 Oland XT [Radeon HD 8670 / R5 340X OEM / R7 250/350/350X OEM] 1019 0030 Radeon HD 8670 + 1028 0081 Radeon R7 350X OEM + 1028 0083 Radeon R5 340X OEM 1028 2120 Radeon R7 250 1028 2322 Radeon R7 250 1462 2910 Radeon HD 8670 @@ -1933,7 +1947,15 @@ 1642 3c91 Radeon HD 8670 1642 3f09 Radeon R7 350 6611 Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340 / Radeon 520 OEM] + 1028 1001 Radeon R5 430 OEM (1024 MByte) + 1028 1002 Radeon R5 430 OEM (2048 MByte) +# The 'AMD Radeon R5 430' instead of 240/340 is NOT a typo! It's actually correct. + 1028 1711 R5 430 OEM (2048 MByte) 1028 210b Radeon R5 240 OEM +# OEM-card for Dell; verified through AMD's own drivers (*.inf) and a TPU BIOS in database + 1028 2121 Radeon HD 8570 OEM +# OEM-card from Fujitsu; verified through AMD's own drivers (*.inf) + 10cf 1889 Radeon HD 8570 OEM 1642 1869 Radeon 520 OEM 174b 4248 Radeon R7 240 OEM 174b a240 Radeon R7 240 OEM @@ -2203,7 +2225,7 @@ 8086 2111 Radeon HD 6625M 6743 Whistler [Radeon E6760] 6749 Turks GL [FirePro V4900] - 15c3 2b06 MED-X4900 + 15c3 2b06 MED-X4900 (EIZO) 674a Turks GL [FirePro V3900] 13cc 3d22 MXRT-2500 15c3 0106 MED-X3900 @@ -2232,7 +2254,7 @@ 174b 7670 Radeon HD 7670 174b e181 Radeon HD 6670 1787 2309 Radeon HD 6670 - 6759 Turks PRO [Radeon HD 6570/7570/8550] + 6759 Turks PRO [Radeon HD 6570/7570/8550 / R5 230] 103c 3130 Radeon HD 6570 1043 0403 Radeon HD 6570 1462 2500 Radeon HD 6570 @@ -2241,9 +2263,15 @@ 1642 3a67 Radeon HD 6570 1682 3280 Radeon HD 7570 1682 3530 Radeon HD 8550 + 1682 5230 Radeon R5 230 series + 1682 6450 Radeon HD 6450 series 174b 7570 Radeon HD 7570 + 174b 8550 Radeon HD8550 OEM + 174b 8570 Radeon HD8550 OEM 174b e142 Radeon HD 6570 174b e181 Radeon HD 6570 + 1787 a230 Radeon R5 230 series + 1787 a450 Radeon HD 6450 series 1b0a 908f Radeon HD 6570 1b0a 9090 Radeon HD 6570 1b0a 9091 Radeon HD 6570 @@ -2645,6 +2673,7 @@ # https://www.techpowerup.com/vgabios/?manufacturer=Powercolor&model=RX+580 148c 2378 Radeon RX 580 148c 2379 Radeon RX 570 4G [Red Dragon] + 148c 2391 Radeon RX 590 [Red Devil] 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 1682 9587 Radeon RX 590 FATBOY 8GB @@ -3614,24 +3643,32 @@ 174b e329 Radeon R9 FURY 7310 Navi 10 [Radeon Pro W5700X] 7312 Navi 10 [Radeon Pro W5700] + 7314 Navi 10 USB 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 1458 2313 Radeon RX 5700 XT Gaming OC 1682 5701 RX 5700 XT RAW II + 1849 5120 Radeon RX 5600 XT 1da2 e411 Radeon RX 5600 XT 7340 Navi 14 [Radeon RX 5500/5500M / Pro 5500M] 7341 Navi 14 [Radeon Pro W5500] 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] - 7360 Navi 12 [Radeon Pro 5600M] + 7360 Navi 12 [Radeon Pro 5600M / V520] + 7362 Navi 12 [Radeon Pro V520] 7388 Arcturus GL-XL 738c Arcturus GL-XL [AMD Instinct MI100] 738e Arcturus GL-XL + 73a4 Navi 21 USB + 73af Navi 21 [Radeon RX 6900 XT] 73bf Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] 1eae 6701 XFX Speedster MERC 319 AMD Radeon RX 6800 XT Black 73c3 Navi 22 - 73df Navi 22 + 73c4 Navi 22 USB + 73df Navi 22 [Radeon RX 6700/6700 XT / 6800M] 73e0 Navi 23 - 73ff Navi 23 + 73e1 Navi 23 + 73e4 Navi 23 USB + 73ff Navi 23 [Radeon RX 6600/6600 XT/6600M] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -4034,6 +4071,7 @@ ab10 Lexa HDMI Audio ab18 Vega 12 HDMI Audio ab20 Vega 20 HDMI Audio [Radeon VII] + ab28 Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT] ab38 Navi 10 HDMI Audio ac00 Theater 506 World-Wide Analog Decoder ac01 Theater 506 World-Wide Analog Decoder @@ -4937,7 +4975,8 @@ 4c53 1030 PC5 mainboard 4c53 1040 CL7 mainboard 4c53 1060 PC7 mainboard - 2001 79c978 [HomePNA] +# Via AMD's own technical reference on their Am79C978 NICs; https://www.amd.com/system/files/TechDocs/22206.pdf + 2001 Am79C978 PCnet Home (HomePNA) 1/10 PCI Ethernet Adapter [Am79C971 PHY] 1092 0a78 Multimedia Home Network Adapter 1668 0299 ActionLink Home Network Adapter 2003 Am 1771 MBW [Alchemy] @@ -4956,7 +4995,8 @@ 2096 CS5536 [Geode companion] UDC 2097 CS5536 [Geode companion] UOC 209a CS5536 [Geode companion] IDE - 2625 AMD Lance/PCI PCNet/32 + 2625 Am79C973 [Lance/PCI PCNet/32] + 2627 Am79C975 [Lance/PCI PCNet/32] 3000 ELanSC520 Microcontroller 43a0 Hudson PCI to PCI bridge (PCIE port 0) 43a1 Hudson PCI to PCI bridge (PCIE port 1) @@ -6906,6 +6946,7 @@ 0003 Control Video 0004 PlanB Video-In 0007 O'Hare I/O + 000b Apple Camera 000c DOS on Mac 000e Hydra Mac I/O 0010 Heathrow Mac I/O @@ -7133,7 +7174,8 @@ 103c 12dd 4Gb Fibre Channel [AB429A] 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA 103c 7040 FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus Adapter [HPAE311A] - 1077 0137 QLE2460 4 GB PCI-X Host-Bus-Adapter + 1077 0137 QLE2460 Single-Port 4Gbps FC-to-PCI-X/PCIe Host Bus Adapter + 1077 0138 QLE2462 Dual-Port 4Gbps FC-to-PCI-X/PCIe Host Bus Adapter 2532 ISP2532-based 8Gb Fibre Channel to PCI Express HBA 1014 041e FC EN0Y/EN12 PCIe2 LP 8 Gb 4-port Fibre Channel Adapter for POWER 103c 3262 StorageWorks 81Q @@ -10064,7 +10106,7 @@ 0331 NV35 [GeForce FX 5900] 1043 8145 V9950GE 0332 NV35 [GeForce FX 5900XT] - 0333 NV38 [GeForce FX 5950 Ultra] + 0333 NV38 [GeForce FX 5950 Ultra / PCX 5950] 0334 NV35 [GeForce FX 5900ZT] 1462 9373 FX5900ZT-VTD128 (MS-8937) 0338 NV35GL [Quadro FX 3000] @@ -11676,6 +11718,7 @@ 1184 GK104 [GeForce GTX 770] 1185 GK104 [GeForce GTX 660 OEM] 10de 106f GK104 [GeForce GTX 760 OEM] + 1186 GK104 [GeForce GTX 660 Ti] 1187 GK104 [GeForce GTX 760] 1188 GK104 [GeForce GTX 690] 1189 GK104 [GeForce GTX 670] @@ -12147,6 +12190,7 @@ 1f08 TU106 [GeForce RTX 2060 Rev. A] 1f09 TU106 [GeForce GTX 1660 SUPER] 1f0a TU106 [GeForce GTX 1650] + 1f0b TU106 [CMP 40HX] 1f10 TU106M [GeForce RTX 2070 Mobile] 1f11 TU106M [GeForce RTX 2060 Mobile] 1f12 TU106M [GeForce RTX 2060 Max-Q] @@ -12174,15 +12218,21 @@ 1f9c TU117M [GeForce MX450] 1f9d TU117M [GeForce GTX 1650 Mobile / Max-Q] 1fae TU117GL + 1fb0 TU117GLM [Quadro T1000 Mobile] + 1fb1 TU117GLM [Quadro T600 Mobile] + 1fb2 TU117GLM [Quadro T400 Mobile] 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] 1fbb TU117GLM [Quadro T500 Mobile] 1fbf TU117GL 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] + 1fdd TU117BM [GeForce GTX 1650 Mobile Refresh] 1ff9 TU117GLM [Quadro T1000 Mobile] 20b0 GA100 [A100 SXM4 40GB] 20b1 GA100 [A100 PCIe 40GB] 20b2 GA100 [A100 SXM4 80GB] + 20b6 GA100GL [PG506-232] + 20b7 GA100GL [A30 PCIe] 20be GA100 [GRID A100A] 20bf GA100 [GRID A100B] 20f1 GA100 [A100 PCIe 40GB] @@ -12191,6 +12241,7 @@ 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] 2188 TU116 [GeForce GTX 1650] + 2189 TU116 [CMP 30HX] 2191 TU116M [GeForce GTX 1660 Ti Mobile] 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL @@ -12198,21 +12249,27 @@ 21c2 TU116 21c4 TU116 [GeForce GTX 1660 SUPER] 21d1 TU116BM [GeForce GTX 1660 Ti Mobile] + 2200 GA102 2204 GA102 [GeForce RTX 3090] - 2205 GA102 [GeForce RTX 3080 Ti] + 2205 GA102 [GeForce RTX 3080 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] 222b GA102 [GeForce RTX 3090 Engineering Sample] 222f GA102 [GeForce RTX 3080 11GB / 12GB Engineering Sample] 2230 GA102GL [RTX A6000] - 2235 GA102GL [RTX A40] - 2236 GA102GL + 2231 GA102GL [RTX A5000] + 2235 GA102GL [A40] + 2236 GA102GL [A10] + 2237 GA102GL [A10G] 223f GA102GL 228b GA104 High Definition Audio Controller + 2302 GA103 2321 GA103 2482 GA104 [GeForce RTX 3070 Ti] + 2483 GA104 2484 GA104 [GeForce RTX 3070] 10de 146b GA104 [GeForce RTX 3070] 10de 14ae GA104 [GeForce RTX 3070 16GB] @@ -12223,6 +12280,7 @@ 24ac GA104 [GeForce RTX 30x0 Engineering Sample] 24ad GA104 [GeForce RTX 3060 Engineering Sample] 24af GA104 [GeForce RTX 3070 Engineering Sample] + 24b0 GA104GL [RTX A4000] 24b6 GA104 24b8 GA104 24bf GA104 [GeForce RTX 3070 Engineering Sample] @@ -12238,7 +12296,12 @@ 25a0 GA107M [GeForce RTX 3050 Ti Mobile] 25a2 GA107M [GeForce RTX 3050 Mobile] 25a4 GA107 + 25a5 GA107M 25af GA107 [GeForce RTX 3050 Engineering Sample] + 25b5 GA107GLM [RTX A4 Mobile] + 25b8 GA107GLM + 25e0 GA107BM + 25e2 GA107BM 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -12923,6 +12986,7 @@ 3220 RocketRAID 3220 3320 RocketRAID 3320 4310 RocketRaid 4310 + 7505 SSD7505 PCIe Gen4 x16 4-Port M.2 NVMe RAID Controller 1104 RasterOps Corp. 1105 Sigma Designs, Inc. 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder @@ -13060,7 +13124,7 @@ 1296 P4M800 Host Bridge 1308 PT894 Host Bridge 1314 CN700/VN800/P4M800CE/Pro Host Bridge - 1324 CX700/VX700 Host Bridge + 1324 CX700/VX700-Series Error Reporting 1327 P4M890 Host Bridge 1336 K8M890CE Host Bridge 1340 PT900 Host Bridge @@ -13085,7 +13149,7 @@ 2296 P4M800 Host Bridge 2308 PT894 Host Bridge 2314 CN700/VN800/P4M800CE/Pro Host Bridge - 2324 CX700/VX700 Host Bridge + 2324 CX700/VX700-Series Host Interface Control 2327 P4M890 Host Bridge 2336 K8M890CE Host Bridge 2340 PT900 Host Bridge @@ -13100,15 +13164,16 @@ 287d VT8251 PCIE Root Port 287e VT8237/8251 Ultra VLINK Controller 3022 CLE266 - 3038 VT82xx/62xx UHCI USB 1.1 Controller + 3038 VT82xx/62xx/VX700/8x0/900 UHCI USB 1.1 Controller 0925 1234 onboard UHCI USB 1.1 Controller 1019 0985 P6VXA Motherboard 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) 1043 8080 A7V333 motherboard - 1043 808c VT6202 USB2.0 4 port controller + 1043 808c VT62xx USB1.1 4 port controller 1043 80a1 A7V8X-X motherboard 1043 80ed A7V600/K8V-X/A8V Deluxe motherboard 1179 0001 Magnia Z310 + 1234 0925 MVP3 USB Controller 1458 5004 GA-7VAX Mainboard 1462 5901 KT6 Delta-FIS2R (MS-6590) 1462 7020 K8T NEO 2 motherboard @@ -13343,7 +13408,7 @@ 19da a179 ZBOX VD01 3290 K8M890 Host Bridge 3296 P4M800 Host Bridge - 3324 CX700/VX700 Host Bridge + 3324 CX700/VX700-Series DRAM Bus Control 3327 P4M890 Host Bridge 3336 K8M890CE Host Bridge 3337 VT8237A PCI to ISA Bridge @@ -13354,6 +13419,7 @@ 3351 VT3351 Host Bridge 3353 VX800/820 PCI to PCI Bridge 3364 CN896/VN896/P4M900 Host Bridge + 3365 VT630x IEEE 1394 Host Controller [Fire II/M] 3371 CN896/VN896/P4M900 [Chrome 9 HC] 3372 VT8237S PCI to ISA Bridge 337a VT8237A PCI to PCI Bridge @@ -13382,7 +13448,7 @@ 4296 P4M800 Host Bridge 4308 PT894 Host Bridge 4314 CN700/VN800/P4M800CE/Pro Host Bridge - 4324 CX700/VX700 Host Bridge + 4324 CX700/VX700-Series Power Management and Testing Control 4327 P4M890 Host Bridge 4336 K8M890CE Host Bridge 4340 PT900 Host Bridge @@ -13434,7 +13500,7 @@ 7296 P4M800 Host Bridge 7308 PT894 Host Bridge 7314 CN700/VN800/P4M800CE/Pro Host Bridge - 7324 CX700/VX700 Host Bridge + 7324 CX700/VX700-Series North-South Module Interface Control 7327 P4M890 Host Bridge 7336 K8M890CE Host Bridge 7340 PT900 Host Bridge @@ -13447,7 +13513,7 @@ 8231 VT8231 [PCI-to-ISA Bridge] 8235 VT8235 ACPI 8305 VT8363/8365 [KT133/KM133 AGP] - 8324 CX700/VX700 PCI to ISA Bridge + 8324 CX700/VX700-Series Bus Control and Power Management 8353 VX800/VX820 Bus Control and Power Management 8391 VT8371 [KX133 AGP] 8400 MVP4 @@ -13492,7 +13558,7 @@ b168 VT8235 PCI Bridge b188 VT8237/8251 PCI bridge [K8M890/K8T800/K8T890 South] 147b 1407 KV8-MAX3 motherboard - b198 VT8237/VX700 PCI Bridge + b198 VT8237/CX700/VX700-Series PCI to PCI Bridge b213 VPX/VPX2 I/O APIC Interrupt Controller b353 VX855/VX875/VX900 PCI to PCI Bridge b410 VX900 Series PCI Express Root Port 1 @@ -14155,7 +14221,7 @@ 0002 Dual PCI to RapidIO Bridge 000b POET Serial RapidIO Bridge 000d POET PSDMS Device -1135 Fuji Xerox Co Ltd +1135 FUJIFILM Business Innovation Corp. 0001 Printer controller 1136 Momentum Data Systems 0002 PCI-JTAG @@ -15013,6 +15079,7 @@ 11aa Actel # Nee Galileo Technology, Inc. 11ab Marvell Technology Group Ltd. + 0100 88F3700 [Armada 3700 Family] ARM SoC 0146 GT-64010/64010A System Controller 0f53 88E6318 Link Street network controller 11ab MV88SE614x SATA II PCI-E controller @@ -15229,6 +15296,8 @@ 6480 MV64460/64461/64462 System Controller 1775 c200 C2K CompactPCI single board computer 6485 MV64460/64461/64462 System Controller, Revision B + 6820 88F6820 [Armada 385] ARM SoC + 6828 88F6828 [Armada 388] ARM SoC 7042 88SX7042 PCI-e 4-port SATA-II 16b8 434b Tempo SATA E4P 7810 MV78100 [Discovery Innovation] ARM SoC @@ -15244,7 +15313,7 @@ 11ad 0003 LNE100TX 11ad f003 LNE100TX 11ad ffff LNE100TX - 1385 f004 FA310TX + 1385 f004 FA310/TX LAN 10/100 PCI Ethernet Adapter 2646 f002 KNE110TX EtheRx Fast Ethernet c115 LNE100TX [Linksys EtherFast 10/100] 11ad c001 LNE100TX [ver 2.0] @@ -16061,6 +16130,8 @@ 5a4b Telsat Turbo 1268 Tektronix 1269 Thomson-CSF/TTM +# MBIM on top of MHI + 00b4 5G Data Card [Cinterion MV31-W] 126a Lexmark International, Inc. 126b Adax, Inc. 126c Northern Telecom @@ -17607,6 +17678,8 @@ 1414 Microsoft Corporation 0001 MN-120 (ADMtek Centaur-C based) 0002 MN-130 (ADMtek Centaur-P based) +# Virtual Video Card Device for Windows Remote Desktop (RDP) + 008c Basic Render Driver 5353 Hyper-V virtual VGA 5801 XMA Decoder (Xenon) 5802 SATA Controller - CdRom (Xenon) @@ -18475,6 +18548,22 @@ 1028 2097 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 1.92TB 1028 2098 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 3.84TB 1028 2099 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 7.68TB + 1028 2118 Ent NVMe v2 AGN FIPS MU U.2 1.6TB + 1028 2119 Ent NVMe v2 AGN MU U.2 1.6TB + 1028 2120 Ent NVMe v2 AGN FIPS MU U.2 3.2T + 1028 2121 Ent NVMe v2 AGN MU U.2 3.2TB + 1028 2122 Ent NVMe v2 AGN FIPS MU U.2 6.4TB + 1028 2123 Ent NVMe v2 AGN MU U.2 6.4TB + 1028 2124 Ent NVMe v2 AGN FIPS MU U.2 6.4TB + 1028 2125 Ent NVMe v2 AGN MU U.2 12.8TB + 1028 2126 Ent NVMe v2 AGN FIPS RI U.2 1.92TB + 1028 2127 Ent NVMe v2 AGN RI U.2 1.92TB + 1028 2128 Ent NVMe v2 AGN FIPS RI U.2 3.84TB + 1028 2129 Ent NVMe v2 AGN RI U.2 3.84TB + 1028 2130 Ent NVMe v2 AGN FIPS RI U.2 7.68TB + 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 ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -18486,6 +18575,7 @@ 1456 Advanced Hardware Architectures 1457 Nuera Communications Inc 1458 Gigabyte Technology Co., Ltd + 3483 USB 3.0 Controller (VIA VL80x-based xHCI Controller) 1459 DOOIN Electronics 145a Escalate Networks Inc 145b PRAIM SRL @@ -18502,6 +18592,8 @@ e836 M115S Hybrid Analog/DVB PAL/SECAM/NTSC Tuner f436 AVerTV Hybrid+FM 1462 Micro-Star International Co., Ltd. [MSI] +# VIA Driver-inf + 3483 MSI USB 3.0 (VIA VL80x-based xHCI USB Controller) aaf0 Radeon RX 580 Gaming X 8G 1463 Fast Corporation 1464 Interactive Circuits & Systems Ltd @@ -18551,6 +18643,7 @@ 148a OPTO 148b INNOMEDIALOGIC Inc. 148c Tul Corporation / PowerColor + 2391 Radeon RX 590 [Red Devil] 148d DIGICOM Systems, Inc. 1003 HCF 56k Data/Fax Modem 148e OSI Plus Corporation @@ -18652,9 +18745,11 @@ 103c 1240 Myrinet M2L-PCI64/2-3.0 LANai 7.4 (HP OEM) 14c2 DTK Computer 14c3 MEDIATEK Corp. + 7612 MT7612E 802.11acbgn PCI Express Wireless Network Adapter 7630 MT7630e 802.11bgn Wireless Network Adapter # MT7612E too? 7662 MT7662E 802.11ac PCI Express Wireless Network Adapter + 7915 MT7915E 802.11ax PCI Express Wireless Network Adapter 14c4 IWASAKI Information Systems Co Ltd 14c5 Automation Products AB 14c6 Data Race Inc @@ -18923,11 +19018,13 @@ 103c 0890 NC6000 laptop 103c 099c NX6110/NC6120 10cf 1279 LifeBook E8010D - 165f NetXtreme BCM5720 2-port Gigabit Ethernet PCIe + 165f NetXtreme BCM5720 Gigabit Ethernet PCIe 1028 04f7 PowerEdge R320 server 1028 08fd PowerEdge R6515/R7515 LOM 1028 08ff PowerEdge Rx5xx LOM Board 1028 0900 PowerEdge C6525 LOM +# Dell 5720 LOM + 1028 0917 PowerEdge C6520 LOM 103c 1786 NC332T Adapter 103c 193d NC332i Adapter 103c 2133 NC332i Adapter @@ -19160,12 +19257,12 @@ 16d4 BCM57402 NetXtreme-E Ethernet Partition 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller + 14e4 1202 BCM957412M4122C OCP 1x25G Type1 wRoCE 14e4 4120 NetXtreme E-Series Advanced Dual-port 10Gb SFP+ Ethernet Network Daughter Card 14e4 4126 NetXtreme-E Dual-port 10G SFP+ Ethernet OCP 3.0 Adapter (BCM957412N4120C) 152d 8b20 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 152d 8b22 BCM57412 NetXtreme-E 25Gb RDMA Ethernet Controller 16d7 BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller - 14e4 1202 BCM957412M4122C OCP 1x25G Type1 wRoCE 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 @@ -19227,16 +19324,25 @@ 1750 BCM57508 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 14e4 2100 NetXtreme-E Dual-port 100G QSFP56 Ethernet PCIe4.0 x16 Adapter (BCM957508-P2100G) 14e4 5208 NetXtreme-E Dual-port 100G QSFP56 Ethernet OCP 3.0 Adapter (BCM957508-N2100G) + 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1800 BCM57502 NetXtreme-E Ethernet Partition 1801 BCM57504 NetXtreme-E Ethernet Partition 1802 BCM57508 NetXtreme-E Ethernet Partition + 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 RDMA Partition + 1805 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz 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 1807 BCM5750X NetXtreme-E RDMA Virtual Function + 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz RDMA Virtual Function + 1808 BCM5750X NetXtreme-E Ethernet Virtual Function + 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet Virtual Function + 1809 BCM5750X NetXtreme-E RDMA Virtual Function + 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz RDMA Virtual Function 2711 BCM2711 PCIe Bridge 3352 BCM3352 3360 BCM3360 @@ -19439,6 +19545,7 @@ 4410 BCM4413 iLine32 HomePNA 2.0 4411 BCM4413 V.90 56k modem 4412 BCM4412 10/100BaseT + 4415 BCM4359 802.11ac Dual-Band Wireless Network Controller 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 @@ -20000,6 +20107,7 @@ 9260 RCIM-II Real-Time Clock & Interrupt Module 9271 RCIM-III Real-Time Clock & Interrupt Module (PCIe) 9272 Pulse Width Modulator Card + 9273 RCIM-IV Real-Time Clock & Interrupt Module (PCIe) 9277 5 Volt Delta Sigma Converter Card 9278 10 Volt Delta Sigma Converter Card 9287 Analog Output Card @@ -20291,7 +20399,13 @@ 15b3 0021 MCX4421A-ACQN ConnectX-4 Lx EN OCP,2x25G 15b3 0025 ConnectX-4 Lx 25 GbE Dual Port SFP28 rNDC 193d 100a 620F-B +# NIC-ETH540F-LP-2P SFP+ Ethernet Card + 193d 1023 NIC-ETH540F-LP-2P 193d 1031 NIC-ETH640i-Mb-2x25G +# NIC-ETH640F-3S-2P OCP3.0 Card + 193d 1083 NIC-ETH640F-3S-2P +# NIC-ETH540F-3S-2P OCP3.0 2x10G Card + 193d 1084 NIC-ETH540F-3S-2P 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectXÂź-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT @@ -20319,6 +20433,10 @@ 1979 MT2910 Family [ConnectX-7 PCIe Bridge] 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] + 2020 MT2892 Family [ConnectX-6 Dx Emulated PCIe Bridge] + 2021 MT42822 Family [BlueField-2 SoC Emulated PCIe Bridge] + 2023 MT2910 Family [ConnectX-7 Emulated PCIe Bridge] + 2024 MT43244 Family [BlueField-3 SoC Emulated PCIe Bridge] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 1bd4 003a 25G SFP28 SP EO251FM9 Adapter @@ -20735,6 +20853,9 @@ 2086 CryptoServer Se-Series Hardware Security Module c040 CryptoServer CSe-Series Hardware Security Module c051 CryptoServer Se-Series Gen2 Hardware Security Module + c070 u.trust Anchor Hardware Security Module cs7.2 Series + c071 u.trust Anchor Hardware Security Module cs7.3 Series + c072 u.trust Anchor Hardware Security Module cs7.3 Series Virtual Function # nee Atheros Communications, Inc. 168c Qualcomm Atheros 0007 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -21409,8 +21530,10 @@ 8083 GL880 USB 1.1 UHCI controller 8084 GL880 USB 2.0 EHCI controller 9750 GL9750 SD Host Controller + 9755 GL9755 SD Host Controller e763 GL9763E eMMC Controller 17aa Lenovo + 3181 ThinkCentre M75n IoT 402b Intel 82599ES 10Gb 2-port Server Adapter X520-2 17ab Phillips Components 17af Hightech Information System Ltd. @@ -21433,10 +21556,11 @@ 1385 6d00 WPNT511 RangeMax 240 Mbps Wireless CardBus Adapter 1737 0054 WPC54GX4 v1 802.11g Wireless-G Notebook Adapter with SRX400 0105 MSM8998 PCIe Root Complex - 0108 SM8150/SA8195P PCIe Root Complex - 0300 MDM9x35 LTE Modem - 0301 MDM9640 PCIe Root Complex - 0302 MDM9x55 LTE Modem [Snapdragon X12] + 0108 SM8150 PCIe Root Complex + 0109 SA8195P PCIe Root Complex + 0300 MDM9x35 LTE Modem [Snapdragon X7] + 0301 MDM9x45 LTE Modem [Snapdragon X12] + 0302 MDM9x55 LTE Modem [Snapdragon X16] 0400 Datacenter Technologies QDF2432 PCI Express Root Port 0401 Datacenter Technologies QDF2400 PCI Express Root Port 1000 QCS405 PCIe Root Complex @@ -22780,6 +22904,7 @@ 1052 Virtio input # virtio 1.0 1053 Virtio socket + 105a Virtio file system 1110 Inter-VM shared memory 1af4 1100 QEMU Virtual Machine 1af5 Netezza Corp. @@ -22805,8 +22930,10 @@ 1080 ASM1083/1085 PCIe to PCI Bridge 1849 1080 Motherboard 1142 ASM1042A USB 3.0 Host Controller - 1184 ASM1184e PCIe Switch Port - 1849 1184 ASM1184e PCIe Switch + 1182 ASM1182e 2-Port PCIe x1 Gen2 Packet Switch + 1b21 118f ASM1182e 2-Port PCIe x1 Gen2 Packet Switch + 1184 ASM1184e 4-Port PCIe x1 Gen2 Packet Switch + 1849 1184 ASM1184e 4-Port PCIe x1 Gen2 Packet Switch 1242 ASM1142 USB 3.1 Host Controller 1343 ASM1143 USB 3.1 Host Controller 2142 ASM2142 USB 3.1 Host Controller @@ -22877,6 +23004,8 @@ 0601 NumaChip N601 0602 NumaChip N602 1b4b Marvell Technology Group Ltd. +# device 1b4b:0100 reports incorrect vendor id due to hw erratum (correct is 11ab) + 0100 88F3700 [Armada 3700 Family] ARM SoC 0640 88SE9128 SATA III 6Gb/s RAID Controller 2241 88NR2241 Non-Volatile memory controller 1028 2112 BOSS-N1 Monolithic @@ -23020,6 +23149,8 @@ # Kersey 2.5" TCG 1bb1 0152 Nytro 5520 TCG 1bb1 01a1 Nytro XP7102 + 5012 FireCuda 510 SSD + 5016 FireCuda 520 SSD 1bb3 Bluecherry 4304 BC-04120A MPEG4 4 port video encoder / decoder 4309 BC-08240A MPEG4 4 port video encoder / decoder @@ -23034,6 +23165,16 @@ 1bbf Maxeler Technologies Ltd. 0003 MAX3 0004 MAX4 +1bc0 Innodisk Corporation + 1001 PCIe 3TG6-P Controller + 1002 PCIe 3TE6 Controller + 1160 PCIe 3TE2 Controller + 1321 PCIe 4TG-P Controller + 1322 PCIe 4TE Controller + 2262 PCIe 3TG3-P Controller + 5208 PCIe 3TE7 Controller + 5216 PCIe 3TE8 Controller + 5236 PCIe 4TG2-P Controller 1bcf NEC Corporation 001c Vector Engine 1.0 1bd0 Astronics Corporation @@ -23041,9 +23182,17 @@ 1002 PM1553-5 (PC/104+ MIL-STD-1553 Interface Card) 1004 AB3000 Series Rugged Computer 1005 PE1000 (Multi-Protocol PCIe/104 Interface Card) + 1006 webCS Wireless Aircraft Communications Server + 1007 AB3000 Series Rugged Computer (Series N) + 1008 ME1000 mPCIe Avionics Interface Card + 100a NG1 Series Avionics Converter 1101 OmniBus II PCIe Multi-Protocol Interface Card 1102 OmniBusBox II Multi-Protocol Interface Core 1103 OmniBus II cPCIe/PXIe Multi-Protocol Interface Card + 1200 NG3 Series Mil-Std-1553 Interface + 1201 NG3 Series ARINC 429 Interface + 1202 NG3 Series Avionics Discrete & Serial Interface + 1203 NG3 Series Avionics Discrete Interface 1bd4 Inspur Electronic Information Industry Co., Ltd. 0911 Arria10_PCIe_F10A1150 1bee IXXAT Automation GmbH @@ -23076,6 +23225,7 @@ 001b FD720 001c FD922 001d Vega + 001f FD940 1c28 Lite-On IT Corp. / Plextor 0122 M6e PCI Express SSD [Marvell 88SS9183] # previously Fiberblaze @@ -23096,6 +23246,8 @@ 00e1 PacketMover 2x100Gb [Tivoli] 00e3 PacketMover 2x10Gb [Tivoli] 00e5 PacketMover 2x10Gb [Corfu] + 1000 SmartNIC N5010 4x100Gb + 1001 SmartNIC N5011 w/2xE810 4x100Gb a000 FBC2CGG3 Capture 2x40Gb [Mango_02] a001 FBC2CGG3 Capture 2x100Gb [Mango_02] a003 FBC2CGG3 Capture 16x10Gb [Mango] @@ -23167,6 +23319,10 @@ 0001 Hunter PCI Express 1c8c Mobiveil, Inc. 1cb0 Shannon Systems + 8266 Andalusia Series SSD + 1cb0 2021 Andalusia Series OCS U.2 SSD + 1cb0 2121 Andalusia Series ZNS U.2 SSD + 1cb0 2f21 Andalusia Series NVMe U.2 SSD d000 Venice NVMe SSD 1cb0 2010 Venice-E Series OCS U.2 1cb0 2011 Venice Series OCS U.2 @@ -23228,6 +23384,7 @@ 0009 ExaNIC X25 000a ExaNIC X100 000b ExaNIC V9P + 000c ExaNIC V9P-3 0100 ExaDISK FX1 1cf0 Akitio 1cf7 Subspace Dynamics @@ -23391,9 +23548,11 @@ 0101 Codensity D400 SSD 0102 Codensity D408 PCIe Gen4 NVMe SSD 0202 Codensity T408 Video Encoding-Decoding Accelerator -1d87 Fuzhou Rockchip Electronics Co., Ltd +# nee Fuzhou Rockchip Electronics Co., Ltd +1d87 Rockchip Electronics Co., Ltd 0100 RK3399 PCI Express Root Port 1808 RK1808 Neural Network Processor Card + 3566 RK3568 Remote Signal Processor 1d8f Enyx 1d93 YADRO 1d94 Chengdu Haiguang IC Design Co., Ltd. @@ -23512,7 +23671,7 @@ 0000 TSP100 Tensor Streaming Processor 1de1 Tekram Technology Co.,Ltd. 0391 TRM-S1040 [DC-315 / DC-395 series] - 2020 DC-390 + 2020 DC-390 Series SCSI Adapter [AMD Am53C974] 690c 690c dc29 DC290 1de5 Eideticom, Inc @@ -23588,6 +23747,12 @@ 0206 ACE-NIC200 Programmable Network Accelerator 1df3 0000 Maintenance Mode 1df3 0001 ENA2200F + 0207 ACE-NIC50RN Programmable Network Accelerator + 1df3 0000 Maintenance Mode + 1df3 0001 ENA2050RN + 0208 ACE-NIC100RN Programmable Network Accelerator + 1df3 0000 Maintenance Mode + 1df3 0001 ENA2100RN 1df7 opencpi.org 0001 ml605 0002 alst4 @@ -23703,6 +23868,9 @@ 1eae XFX Limited 1eb1 VeriSilicon Inc 1001 Video Accelerator +1ebd Emerge Technologies Company Ltd. + 0101 Seirios 2063 Video Codec +1ed3 Yeston 1ed8 Digiteq Automotive 0101 FG4 PCIe Frame Grabber 1ed9 Myrtle.ai @@ -23789,6 +23957,7 @@ 2010 8142 100VG/AnyLAN 2646 Kingston Technology Company, Inc. 0010 HyperX Predator PCIe AHCI SSD + 2262 KC2000 NVMe SSD 2263 A2000 NVMe SSD 5008 U-SNS8154P3 NVMe SSD 500d OM3PDP3 NVMe SSD @@ -23956,8 +24125,7 @@ 7053 CH353 PCI Dual Serial and Parallel Ports Controller 7073 CH356 PCI Quad Serial and Parallel Ports Controller 7173 CH355 PCI Quad Serial Port Controller -434e CAST Navigation LLC -43b0 Tiger Lake-H PCIe Root Port #9 +434e Cornelis Networks 43bc Tiger Lake-H PCIe Root Port #5 4444 Internext Compression Inc 0016 iTVC16 (CX23416) Video Decoder @@ -24648,6 +24816,7 @@ 8086 0034 Wireless-AC 9560 160MHz 8086 0070 Wi-Fi 6 AX201 160MHz 8086 0074 Wi-Fi 6 AX201 160MHz + 8086 4070 Wireless-AC 9462 80MHz 02f5 Comet Lake PCH-LP SCS3 02f9 Comet Lake Thermal Subsytem 02fc Comet Lake Integrated Sensor Solution @@ -24742,9 +24911,12 @@ 06ab Comet Lake PCH Serial IO SPI Controller #1 06ac Comet Lake PCI Express Root Port #21 06b0 Comet Lake PCI Express Root Port #9 + 06bd Comet Lake PCIe Port #6 06c0 Comet Lake PCI Express Root Port #17 06c8 Comet Lake PCH cAVS + 06d2 Comet Lake SATA AHCI Controller 06e0 Comet Lake HECI Controller + 06e3 Comet Lake Keyboard and Text (KT) Redirection 06e8 Comet Lake PCH Serial IO I2C Controller #0 06e9 Comet Lake PCH Serial IO I2C Controller #1 06ea Comet Lake PCH Serial IO I2C Controller #2 @@ -25243,6 +25415,9 @@ 1028 2103 NVMe RI U.2 3.84TB (P5500) 1028 2104 NVMe RI U.2 7.68TB (P5500) 8086 8008 NVMe Datacenter SSD [3DNAND] SE 2.5" U.2 (P5510) + 8086 8d08 NVMe Datacenter SSD [3DNAND] VE 2.5" U.2 (P5316) + 8086 8d1d NVMe Datacenter SSD [3DNAND] VE E1.L 9.5/18mm (P5316) + 0bd0 Ponte Vecchio 2T 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -26364,6 +26539,8 @@ 18d4 0c07 I350 1Gb 2-port RJ45 OCP Mezz Card MOP41-I-1GT2 193d 1005 360T-B 193d 1007 360T-L +# NIC-ETH360T-3S-4P OCP3.0 4x1G Base-T Card + 193d 1080 NIC-ETH360T-3S-4P 1bd4 001d 1G base-T QP EP014Ti1 Adapter 1bd4 0035 1G base-T QP EP014Ti1 Adapter 8086 0001 Ethernet Server Adapter I350-T4 @@ -26537,6 +26714,8 @@ 17aa 4002 ThinkServer X710-2 AnyFabric for 10GbE SFP+ 193d 1020 NIC-ETH561F-sL-4x10G 193d 1021 NIC-ETH561F-sL-2x10G +# NIC-ETH561F-3S-2P OCP3.0 2x10G SFP+ Card + 193d 1081 NIC-ETH561F-3S-2P 19e5 d11c Ethernet 2-port X710 10Gb SFP+ Adapter SP330 1bd4 0042 10G SFP+ DP EP102Fi4 Adapter 1bd4 0056 Ethernet Network Adapter X710-BM2 for OCP NIC 3.0 @@ -26669,6 +26848,7 @@ 1591 Ethernet Controller E810-C for backplane 1592 Ethernet Controller E810-C for QSFP 1137 02bf E810CQDA2 2x100 GbE QSFP28 PCIe NIC + 193d 1050 NIC-ETH1060F-LP-2P 2x100GbE Ethernet PCIe Card 8086 0001 Ethernet Network Adapter E810-C-Q1 8086 0002 Ethernet Network Adapter E810-C-Q2 8086 0004 Ethernet Network Adapter E810-C-Q2 @@ -26679,6 +26859,7 @@ 8086 000b Ethernet 100G 2P E810-C Adapter 8086 000c Ethernet 100G 2P E810-C OCP 8086 000d Ethernet Network Adapter E810-L-Q2 for OCP 3.0 + 8086 000e Ethernet Network Adapter E810-2C-Q2 1593 Ethernet Controller E810-C for SFP 1137 02c3 E810XXVDA4 4x25/10 GbE SFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-L-2 @@ -26795,6 +26976,8 @@ 1137 02c2 X710T4LG 4x10 GbE RJ45 PCIe NIC 1137 02d9 Ethernet Network Adapter X710-T2L OCP 3.0 1137 02da Ethernet Network Adapter X710-T4L OCP 3.0 +# NIC-ETH565T-3S-2P OCP3.0 2x10G Base-T Card + 193d 1082 NIC-ETH565T-3S-2P 8086 0000 Ethernet Network Adapter X710-TL 8086 0001 Ethernet Network Adapter X710-T4L 8086 0002 Ethernet Network Adapter X710-T4L @@ -28244,6 +28427,7 @@ 1cb8 0002 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, TC6600 Fixed Port 1cb8 0003 Omni-Path HFI Adapter 100 Series, 2 Port, 2 PCIe x16, Earth Simulation QSFP28 1cb8 0004 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16, TC4600E QSFP28 + 434e 0001 Omni-Path HFI 100 Series, 1 Port, OCP 3.0 Adapter 8086 2628 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x16 8086 2629 Omni-Path HFI Adapter 100 Series, 1 Port, PCIe x8 8086 262a Omni-Path HFI Adapter 100 Series, 2 Ports, Split PCIe x16 @@ -28782,6 +28966,20 @@ 8086 3905 NVMe Datacenter SSD [Optane] 15mm 2.5" U.2 (P4800X) 2723 Wi-Fi 6 AX200 8086 2723 Wireless AX200 + 2725 Wi-Fi 6 AX210/AX211/AX411 160MHz + 8086 0020 Wi-Fi 6 AX210 160MHz + 8086 0024 Wi-Fi 6 AX210 160MHz + 8086 0090 Wi-Fi 6 AX211 160MHz + 8086 00b0 Wi-Fi 6 AX411 160MHz + 8086 0310 Wi-Fi 6 AX210 160MHz + 8086 0510 Wi-Fi 6 AX210 160MHz + 8086 0a10 Wi-Fi 6 AX210 160MHz + 8086 2020 Wi-Fi 6 AX210 160MHz + 8086 4020 Wi-Fi 6 AX210 160MHz + 8086 6020 Wi-Fi 6 AX210 160MHz + 8086 6024 Wi-Fi 6 AX210 160MHz + 8086 e020 Wi-Fi 6 AX210 160MHz + 8086 e024 Wi-Fi 6 AX210 160MHz 2770 82945G/GZ/P/PL Memory Controller Hub 1028 01ad OptiPlex GX620 103c 2a3b Pavilion A1512X @@ -31043,7 +31241,7 @@ 4140 NVMe Datacenter SSD [Optane] 1028 2134 NVMe Datacenter SSD [Optane] SED 400GB 2.5" U.2 (P5800X) 1028 2135 NVMe Datacenter SSD [Optane] SED 800GB 2.5" U.2 (P5800X) - 1028 2136 NVMe Datacenter SSD [Optane] SED 1.6GB 2.5" U.2 (P5800X) + 1028 2136 NVMe Datacenter SSD [Optane] SED 1.6TB 2.5" U.2 (P5800X) 1028 2137 NVMe Datacenter SSD [Optane] 400GB 2.5" U.2 (P5800X) 1028 2138 NVMe Datacenter SSD [Optane] 800GB 2.5" U.2 (P5800X) 1028 2139 NVMe Datacenter SSD [Optane] 1.6TB 2.5" U.2 (P5800X) @@ -31139,20 +31337,42 @@ 438b Tiger Lake-H LPC/eSPI Controller 43a3 Tiger Lake-H SMBus Controller 43a4 Tiger Lake-H SPI Controller + 43b0 Tiger Lake-H PCI Express Root Port #9 + 43bc Tiger Lake-H PCI Express Root Port #5 43c8 Tiger Lake-H HD Audio Controller 43e0 Tiger Lake-H Management Engine Interface 43e8 Tiger Lake-H Serial IO I2C Controller #0 43ed Tiger Lake-H USB 3.2 Gen 2x1 xHCI Host Controller 43ef Tiger Lake-H Shared SRAM + 43f0 Tiger Lake PCH CNVi WiFi *** 100 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Apr 29 12:34:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 71EB66267C5; Thu, 29 Apr 2021 12:34: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 4FWFLt2mP9z4cqB; Thu, 29 Apr 2021 12:34: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 519531BC69; Thu, 29 Apr 2021 12:34: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 13TCYkRl092777; Thu, 29 Apr 2021 12:34:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TCYk5K092776; Thu, 29 Apr 2021 12:34:46 GMT (envelope-from git) Date: Thu, 29 Apr 2021 12:34:46 GMT Message-Id: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Gmelin Subject: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0358e3d5184950b4316f105eb292cbafdea208b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 12:34:46 -0000 The branch main has been updated by grembo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cbafdea208b commit a0358e3d5184950b4316f105eb292cbafdea208b Author: Michael Gmelin AuthorDate: 2021-04-29 12:29:04 +0000 Commit: Michael Gmelin CommitDate: 2021-04-29 12:33:56 +0000 Synch index of contrib/bc with what is in workdir after cloning. From a workdir perspective this should be a no-op. See also: https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html --- contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++--------------------- contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | 190 +++++++------- 4 files changed, 713 insertions(+), 713 deletions(-) diff --git a/contrib/bc/bc.vcxproj b/contrib/bc/bc.vcxproj index ba0a7f6f1dd6..2dbbd558618f 100644 --- a/contrib/bc/bc.vcxproj +++ b/contrib/bc/bc.vcxproj @@ -1,278 +1,278 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D5086CFE-052C-4742-B005-E05DB983BBA2} - Win32Proj - - - - Application - true - v142 - - - Application - false - v142 - - - Application - true - v142 - - - Application - false - v142 - - - - - - - - - - - - - - - - - - - - - Building strgen - CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c - gen\strgen.c - $(Configuration)\$(ProjectName)\strgen.exe - - - Generating $(Configuration)\$(ProjectName)/lib.c - START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc - $(Configuration)\$(ProjectName)\lib.c - - - Generating $(Configuration)\$(ProjectName)/lib2.c - START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 - $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc - $(Configuration)\$(ProjectName)\lib2.c - - - Generating $(Configuration)\$(ProjectName)/bc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt - $(Configuration)\$(ProjectName)\bc_help.c - - - Generating $(Configuration)\$(ProjectName)/dc_help.c - START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED - $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt - $(Configuration)\$(ProjectName)\dc_help.c - - - - ClCompile - - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)\$(Configuration)\$(ProjectName)\ - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX86 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - - - MachineX86 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - true - true - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - Disabled - false - /W3 %(AdditionalOptions) - - - MachineX64 - true - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN - $(SolutionDir)\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - false - /W3 %(AdditionalOptions) - Default - - - MachineX64 - false - Console - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) - - - copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" - - - Copying bc to dc... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {D5086CFE-052C-4742-B005-E05DB983BBA2} + Win32Proj + + + + Application + true + v142 + + + Application + false + v142 + + + Application + true + v142 + + + Application + false + v142 + + + + + + + + + + + + + + + + + + + + + Building strgen + CL /Fo:$(Configuration)\$(ProjectName)\ /Fe:$(Configuration)\$(ProjectName)\strgen.exe gen\strgen.c + gen\strgen.c + $(Configuration)\$(ProjectName)\strgen.exe + + + Generating $(Configuration)\$(ProjectName)/lib.c + START $(Configuration)\$(ProjectName)/strgen gen\lib.bc $(Configuration)\$(ProjectName)/lib.c bc_lib bc_lib_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib.bc + $(Configuration)\$(ProjectName)\lib.c + + + Generating $(Configuration)\$(ProjectName)/lib2.c + START $(Configuration)\$(ProjectName)/strgen gen\lib2.bc $(Configuration)\$(ProjectName)/lib2.c bc_lib2 bc_lib2_name BC_ENABLED 1 + $(Configuration)\$(ProjectName)\strgen.exe;gen\lib2.bc + $(Configuration)\$(ProjectName)\lib2.c + + + Generating $(Configuration)\$(ProjectName)/bc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\bc_help.txt $(Configuration)\$(ProjectName)\bc_help.c bc_help "" BC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\bc_help.txt + $(Configuration)\$(ProjectName)\bc_help.c + + + Generating $(Configuration)\$(ProjectName)/dc_help.c + START $(Configuration)\$(ProjectName)/strgen gen\dc_help.txt $(Configuration)\$(ProjectName)\dc_help.c dc_help "" DC_ENABLED + $(Configuration)\$(ProjectName)\strgen.exe;gen\dc_help.txt + $(Configuration)\$(ProjectName)\dc_help.c + + + + ClCompile + + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + true + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)\$(Configuration)\$(ProjectName)\ + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX86 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + + + MachineX86 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + true + true + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + false + /W3 %(AdditionalOptions) + + + MachineX64 + true + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_ENABLE_PROMPT=1;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;EXECSUFFIX=.exe;BUILD_TYPE=HN + $(SolutionDir)\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + MaxSpeed + false + /W3 %(AdditionalOptions) + Default + + + MachineX64 + false + Console + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;bcrypt.lib;ucrt.lib;%(AdditionalDependencies) + + + copy /b "$(SolutionDir)\$(Configuration)\$(ProjectName)\bc.exe" "$(SolutionDir)\$(Configuration)\$(ProjectName)\dc.exe" + + + Copying bc to dc... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/bc/bc.vcxproj.filters b/contrib/bc/bc.vcxproj.filters index bc72b60519e9..141ecb808d08 100644 --- a/contrib/bc/bc.vcxproj.filters +++ b/contrib/bc/bc.vcxproj.filters @@ -1,182 +1,182 @@ -ï»ż - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - - - - - - - - - - - Resource Files - - - Resource Files - - - - - Resource Files - - - Resource Files - - +ï»ż + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + + + + + + + + + + + Resource Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + \ No newline at end of file diff --git a/contrib/bc/bcl.vcxproj b/contrib/bc/bcl.vcxproj index 933c4e93094c..3b79c8b9ef64 100644 --- a/contrib/bc/bcl.vcxproj +++ b/contrib/bc/bcl.vcxproj @@ -1,161 +1,161 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D2CC3DCF-7919-4DEF-839D-E9B897EC3E8E} - Win32Proj - 10.0 - - - - StaticLibrary - true *** 489 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Apr 29 13:10:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4E4F662774B; Thu, 29 Apr 2021 13:10: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 4FWG7w1nBnz4drY; Thu, 29 Apr 2021 13:10: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 3001A1C79C; Thu, 29 Apr 2021 13:10: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 13TDAKIt039920; Thu, 29 Apr 2021 13:10:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDAKI2039916; Thu, 29 Apr 2021 13:10:20 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:10:20 GMT Message-Id: <202104291310.13TDAKI2039916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ac099daf6742 - main - arm: add a release conf for distribution files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac099daf6742ead81ea7ea86351a8ef4e783041b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:10:20 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ac099daf6742ead81ea7ea86351a8ef4e783041b commit ac099daf6742ead81ea7ea86351a8ef4e783041b Author: Mitchell Horne AuthorDate: 2021-04-29 13:10:08 +0000 Commit: Mitchell Horne CommitDate: 2021-04-29 13:10:08 +0000 arm: add a release conf for distribution files We do not currently generate armv7 distribution sets, because we don't build any installer images. However, having such sets available can be useful for quickly installing a base system, particularly in the case of creating an armv7 poudriere jail on arm64. Add a configuration file for the generation of these distribution sets. Reviewed by: manu, imp, gjb MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D29923 --- release/arm/armv7.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release/arm/armv7.conf b/release/arm/armv7.conf new file mode 100644 index 000000000000..174e41615b63 --- /dev/null +++ b/release/arm/armv7.conf @@ -0,0 +1,8 @@ +#!/bin/sh + +# Configuration file for release/release.sh to build arm/armv7 distribution +# images (not system-on-chip (SoC) images). + +TARGET="arm" +TARGET_ARCH="armv7" +KERNEL="GENERIC" From owner-dev-commits-src-main@freebsd.org Thu Apr 29 13:27:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 74DD06283D9; Thu, 29 Apr 2021 13:27: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 4FWGWq2x4Zz4fgB; Thu, 29 Apr 2021 13:27: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 54A771CC50; Thu, 29 Apr 2021 13:27: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 13TDRZLE057369; Thu, 29 Apr 2021 13:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDRZDB057368; Thu, 29 Apr 2021 13:27:35 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:27:35 GMT Message-Id: <202104291327.13TDRZDB057368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: eaabed8ac449 - main - pf: Trivial typo fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eaabed8ac449dbd9a7f4f567e9378bda4636221e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:27:35 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eaabed8ac449dbd9a7f4f567e9378bda4636221e commit eaabed8ac449dbd9a7f4f567e9378bda4636221e Author: Kristof Provost AuthorDate: 2021-04-29 08:34:00 +0000 Commit: Kristof Provost CommitDate: 2021-04-29 13:25:07 +0000 pf: Trivial typo fix PV -> PF MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index d88c0b14e435..8a2082d3e0bb 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include -#define PV_NV_IMPL_UINT(fnname, type, max) \ +#define PF_NV_IMPL_UINT(fnname, type, max) \ int \ pf_nv ## fnname(const nvlist_t *nvl, const char *name, type *val) \ { \ @@ -101,9 +101,9 @@ pf_nvbinary(const nvlist_t *nvl, const char *name, void *data, return (0); } -PV_NV_IMPL_UINT(uint8, uint8_t, UINT8_MAX) -PV_NV_IMPL_UINT(uint16, uint16_t, UINT16_MAX); -PV_NV_IMPL_UINT(uint32, uint32_t, UINT32_MAX) +PF_NV_IMPL_UINT(uint8, uint8_t, UINT8_MAX); +PF_NV_IMPL_UINT(uint16, uint16_t, UINT16_MAX); +PF_NV_IMPL_UINT(uint32, uint32_t, UINT32_MAX); int pf_nvint(const nvlist_t *nvl, const char *name, int *val) From owner-dev-commits-src-main@freebsd.org Thu Apr 29 13:53:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5121C6290D4; Thu, 29 Apr 2021 13:53:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWH5b6V9Pz4gQv; Thu, 29 Apr 2021 13:53:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id c76UltAepycp5c76WlpIrj; Thu, 29 Apr 2021 07:53:20 -0600 X-Authority-Analysis: v=2.4 cv=H864f8Ui c=1 sm=1 tr=0 ts=608aba50 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=8nJEP1OIZ-IA:10 a=3YhXtTcJ-WEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=yWh5RUOQ12QQ51R3MFcA:9 a=wPNLvfGTeEIA:10 a=7CMUNi_NFEAA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 18E3822D5; Thu, 29 Apr 2021 06:53:18 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 13TDrIg3026309; Thu, 29 Apr 2021 06:53:18 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202104291353.13TDrIg3026309@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Gmelin cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. In-reply-to: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> Comments: In-reply-to Michael Gmelin message dated "Thu, 29 Apr 2021 12:34:46 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 29 Apr 2021 06:53:18 -0700 X-CMAE-Envelope: MS4xfICSd8XUQrXzi7CpRwnn23VhS27gdKcZn4wC7pGotFrZSx1H8C41QKG6seI3MCp7VFOiEga46eBBg4hjJ7YfjXHk9l8VAn6/myn0nryC/cvvyoU4v2t+ KIJ3kInBO1r/qGeTh8SBRq0VWd29VwzwewOEJgbvDjEpvZxwCcDMTGGhAvim8aZWYNf8aREC7AnM/xMIYP/ocE6oUWvXaT7GyPVAQ2bPVx2+2WjxVt0tlKdy XLuigtiRTc9pNJSp/yCdDkdj4Gb0m8v6ohulsq92HjL5nu9z+mZzoDbnXDpdXQCVJLy172WeJHiV6fvXg5e1ONv2wuNUurWnVUvGu6HU7cM= X-Rspamd-Queue-Id: 4FWH5b6V9Pz4gQv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:53:24 -0000 In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, Michael Gmelin wr ites: > The branch main has been updated by grembo (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cba > fdea208b > > commit a0358e3d5184950b4316f105eb292cbafdea208b > Author: Michael Gmelin > AuthorDate: 2021-04-29 12:29:04 +0000 > Commit: Michael Gmelin > CommitDate: 2021-04-29 12:33:56 +0000 > > Synch index of contrib/bc with what is in workdir after cloning. > > From a workdir perspective this should be a no-op. > See also: > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.htm > l > --- > contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++------------------- > -- > contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- > contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ > contrib/bc/bcl.vcxproj.filters | 190 +++++++------- > 4 files changed, 713 insertions(+), 713 deletions(-) > Whatever was done here I cannot rebase from main to my local branches. The files remain modified. The only recourse so far was to delete the local branch and start over. I've done this to one inconsequential branch so far but hopefully someone can suggest a solution. git restore the files, git rm the files, rm the files, git stash push, all don't remove them from the branch following rebase. And subsequent rebase to main will fail. main is ok though. What is it that you did to sync the index? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 14:07:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AACC6629838; Thu, 29 Apr 2021 14:07: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 4FWHPz3MJQz4h44; Thu, 29 Apr 2021 14:07: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 662961CF8D; Thu, 29 Apr 2021 14:07: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 13TE7Zu2010235; Thu, 29 Apr 2021 14:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TE7ZAi010234; Thu, 29 Apr 2021 14:07:35 GMT (envelope-from git) Date: Thu, 29 Apr 2021 14:07:35 GMT Message-Id: <202104291407.13TE7ZAi010234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 8e435de92c78 - main - src.libnames.mk: Remove redundant am-utils library definition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e435de92c78fc5cd137c05fb8db238e4b6480f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:07:35 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8e435de92c78fc5cd137c05fb8db238e4b6480f0 commit 8e435de92c78fc5cd137c05fb8db238e4b6480f0 Author: Cy Schubert AuthorDate: 2021-04-22 06:17:08 +0000 Commit: Cy Schubert CommitDate: 2021-04-29 14:07:29 +0000 src.libnames.mk: Remove redundant am-utils library definition r358821 (13f7dbe822d5f447c6137dc0d4ff838fb7050dbe) retired amd(8). This commit cleans up an artifact left in src.libnames.mk. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29914 --- share/mk/src.libnames.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 259a65a7afd4..75eafa374245 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -578,9 +578,6 @@ LIBFIFOLOG?= ${LIBFIFOLOGDIR}/libfifolog${PIE_SUFFIX}.a LIBBSNMPTOOLSDIR= ${_LIB_OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools${PIE_SUFFIX}.a -LIBAMUDIR= ${_LIB_OBJTOP}/usr.sbin/amd/libamu -LIBAMU?= ${LIBAMUDIR}/libamu${PIE_SUFFIX}.a - LIBBE?= ${LIBBEDIR}/libbe${PIE_SUFFIX}.a LIBPMCSTATDIR= ${_LIB_OBJTOP}/lib/libpmcstat From owner-dev-commits-src-main@freebsd.org Thu Apr 29 14:14:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 23CF8629ACB for ; Thu, 29 Apr 2021 14:14:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWHZC0Hcpz4hTS for ; Thu, 29 Apr 2021 14:14:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f49.google.com with SMTP id l189-20020a1cbbc60000b0290140319ad207so9025349wmf.2 for ; Thu, 29 Apr 2021 07:14:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JSWw5nQiOY6TRZoz9cJT6ZuWgb6vW3Ce01tl6I4VzX0=; b=CsgoatNH7iEBnEitTAJSBMflyoMuxtJSAxYS6oXZhCBOUtNAUay7Sy9hHLc4a2G4E6 bLWvMiX/8Vtz1xnMxD0XcKD2XHi1RZazbsh9Sdxq7+HhgRwR9P5jDvtxvagVODoK+J7r qLqQmY5xjBt6bTYRvrtLMxqJt+UJiKnDt3bhzLJf1rizKjkvOk3m1RceBWonmUBABakI 0XYEhpau8w4jacC8RBu4mFP9vDZeeJTEGQEY3/HVuguoSl0A3e6TImVFeCkM5+/UP9mU zl7pnmpGLWdJqKwxLGiiX+1zztR8nPWWSLtfFwb4WwhPTLmKGUUMF3N5Kjmb9iOWhWDb VqBg== X-Gm-Message-State: AOAM533zIEwts3pydqQpz9pcSg7pKRgqw2Ga4S3lHiST4aag6+l4ztyB UmAUiSo/o7GetFopcrYkVsPDoA== X-Google-Smtp-Source: ABdhPJzqQMy3AmXxcv2fy08Iugd1arImVeISV0AZP52bvVyJNZoCh5AuIWlMERInTlhYLpdPA3fQ3Q== X-Received: by 2002:a05:600c:293:: with SMTP id 19mr227657wmk.144.1619705680377; Thu, 29 Apr 2021 07:14:40 -0700 (PDT) Received: from [192.168.150.72] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id c2sm113859wmr.22.2021.04.29.07.14.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Apr 2021 07:14:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. From: Jessica Clarke In-Reply-To: <202104291353.13TDrIg3026309@slippy.cwsent.com> Date: Thu, 29 Apr 2021 15:14:39 +0100 Cc: Michael Gmelin , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4A4F69FA-347D-4EA2-8F6C-E5CFEF054715@freebsd.org> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4FWHZC0Hcpz4hTS X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.128.49:from]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.128.49:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.49:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.49:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:14:44 -0000 On 29 Apr 2021, at 14:53, Cy Schubert wrote: >=20 > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, Michael=20= > Gmelin wr > ites: >> The branch main has been updated by grembo (ports committer): >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Da0358e3d5184950b4316f105eb292cba= >> fdea208b >>=20 >> commit a0358e3d5184950b4316f105eb292cbafdea208b >> Author: Michael Gmelin >> AuthorDate: 2021-04-29 12:29:04 +0000 >> Commit: Michael Gmelin >> CommitDate: 2021-04-29 12:33:56 +0000 >>=20 >> Synch index of contrib/bc with what is in workdir after cloning. >>=20 >> =46rom a workdir perspective this should be a no-op. >> See also: >> = https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.htm >> l >> --- >> contrib/bc/bc.vcxproj | 554 = ++++++++++++++++++++------------------- >> -- >> contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- >> contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ >> contrib/bc/bcl.vcxproj.filters | 190 +++++++------- >> 4 files changed, 713 insertions(+), 713 deletions(-) >>=20 >=20 > Whatever was done here I cannot rebase from main to my local branches. = The=20 > files remain modified. The only recourse so far was to delete the = local=20 > branch and start over. I've done this to one inconsequential branch so = far=20 > but hopefully someone can suggest a solution. >=20 > git restore the files, git rm the files, rm the files, git stash push, = all=20 > don't remove them from the branch following rebase. And subsequent = rebase=20 > to main will fail. main is ok though. >=20 > What is it that you did to sync the index? Given it=E2=80=99s a vcxproj, is this a CRLF vs LF issue? Also, why do we even have these files? Can we not just delete them from = the repo? Big blogs of Visual Studio-generated XML are entirely useless. Jess From owner-dev-commits-src-main@freebsd.org Thu Apr 29 14:30:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 88D3762A3E8; Thu, 29 Apr 2021 14:30:24 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWHwH5WCYz4hTM; Thu, 29 Apr 2021 14:30:23 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id de874774; Thu, 29 Apr 2021 14:30:21 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 401609c4 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Thu, 29 Apr 2021 14:30:18 +0000 (UTC) Date: Thu, 29 Apr 2021 16:29:59 +0200 From: Michael Gmelin To: Cy Schubert Cc: Michael Gmelin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: <20210429162959.16662d66@bsd64.grem.de> In-Reply-To: <202104291353.13TDrIg3026309@slippy.cwsent.com> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWHwH5WCYz4hTM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:30:24 -0000 On Thu, 29 Apr 2021 06:53:18 -0700 Cy Schubert wrote: > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, Michael > Gmelin wr > ites: > > The branch main has been updated by grembo (ports committer): > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cba > > fdea208b > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > Author: Michael Gmelin > > AuthorDate: 2021-04-29 12:29:04 +0000 > > Commit: Michael Gmelin > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > Synch index of contrib/bc with what is in workdir after cloning. > > > > From a workdir perspective this should be a no-op. > > See also: > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.htm > > l > > --- > > contrib/bc/bc.vcxproj | 554 > > ++++++++++++++++++++------------------- -- > > contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- > > contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ > > contrib/bc/bcl.vcxproj.filters | 190 +++++++------- > > 4 files changed, 713 insertions(+), 713 deletions(-) > > > > Whatever was done here I cannot rebase from main to my local > branches. The files remain modified. The only recourse so far was to > delete the local branch and start over. I've done this to one > inconsequential branch so far but hopefully someone can suggest a > solution. Can you show an example of how this fails for you (especially the error messages)? > > git restore the files, git rm the files, rm the files, git stash > push, all don't remove them from the branch following rebase. And > subsequent rebase to main will fail. main is ok though. > > What is it that you did to sync the index? Like in the mail thread linked in the git comment, theoretically a noop: git clone https://git@repo.freebsd.org/src.git cd src touch contrib/bc/*vcx* git commit -a git push It's a problem caused by .gitattributes being checked in after the *vcx* files were checked in (again, see the email thread and "man 1 gitattributes"). If it was for me, I would remove the .gitattributes eol specs, they shouldn't be necessary for our purposes. Best, Michael -- Michael Gmelin From owner-dev-commits-src-main@freebsd.org Thu Apr 29 14:56:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F08A062D259; Thu, 29 Apr 2021 14:56:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWJV03y7Yz4mJd; Thu, 29 Apr 2021 14:56:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id c85El2l1YMrQqc85FlEkCv; Thu, 29 Apr 2021 08:56:06 -0600 X-Authority-Analysis: v=2.4 cv=Nv6yz+RJ c=1 sm=1 tr=0 ts=608ac906 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=3YhXtTcJ-WEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=ias3XygZLv0huwl5YZ4A:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 45D9A2955; Thu, 29 Apr 2021 07:56:03 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 13TEtxEg040285; Thu, 29 Apr 2021 07:55:59 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202104291455.13TEtxEg040285@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Gmelin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. In-reply-to: <20210429162959.16662d66@bsd64.grem.de> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> Comments: In-reply-to Michael Gmelin message dated "Thu, 29 Apr 2021 16:29:59 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Apr 2021 07:55:58 -0700 X-CMAE-Envelope: MS4xfKf9gVODHrEAGrlWATgbaVI1X1H3y+IiqoR+2dxiCjHkO657oM7Mg1x3qeYFwdULyf9u9tsMtHpI8Ohuz4UN6tqTyIkztOrmO0gKPr24xP7BzP7++Y1A 6llmSeiqMsI1CdQQfDnX7VRLFC3scmO/FW++U4WecT5QG9xrZ/HskmKwu7627wFRil43bRC6JrtYtcf4Cd9Xuo5vN8H61aj56oEdKIH855xAkBlAkTDu+RD6 RRK41GBIGoDKw8X+LEKc8xSY2pk8n04xjIJhp1G8/7pWQZQrvJgv2PrbOb8PzMmtYd1uTFwOTGn/Te/4l8RMRFG+u19Z0+mWdYYk3VQSqVU= X-Rspamd-Queue-Id: 4FWJV03y7Yz4mJd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:56:09 -0000 In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin writes: > > > > On Thu, 29 Apr 2021 06:53:18 -0700 > Cy Schubert wrote: > > > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, Michael > > Gmelin wr > > ites: > > > The branch main has been updated by grembo (ports committer): > > > > > > URL: > > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cba > > > fdea208b > > > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > > Author: Michael Gmelin > > > AuthorDate: 2021-04-29 12:29:04 +0000 > > > Commit: Michael Gmelin > > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > > > Synch index of contrib/bc with what is in workdir after cloning. > > > > > > From a workdir perspective this should be a no-op. > > > See also: > > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569 > .htm > > > l > > > --- > > > contrib/bc/bc.vcxproj | 554 > > > ++++++++++++++++++++------------------- -- > > > contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- > > > contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ > > > contrib/bc/bcl.vcxproj.filters | 190 +++++++------- > > > 4 files changed, 713 insertions(+), 713 deletions(-) > > > > > > > Whatever was done here I cannot rebase from main to my local > > branches. The files remain modified. The only recourse so far was to > > delete the local branch and start over. I've done this to one > > inconsequential branch so far but hopefully someone can suggest a > > solution. > > Can you show an example of how this fails for you (especially the error > messages)? slippy$ git pull -r --all Fetching freebsd remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (9/9), done. remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (9/9), 12.42 KiB | 111.00 KiB/s, done. >From https://git.freebsd.org/src 59b3b210a69e..d87ee7b97fe8 stable/13 -> freebsd/stable/13 Already up to date. slippy$ git co komquats Switched to branch 'komquats' slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git rebase main error: cannot rebase: You have unstaged changes. error: Please commit or stash them. slippy$ git stash push -m foobar Saved working directory and index state On komquats: foobar slippy$ git rebase main error: cannot rebase: You have unstaged changes. error: Please commit or stash them. slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git stash push -m foobar Saved working directory and index state On komquats: foobar slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ rm the files, switch branch to main, rebase again, remove the branch, and start over was the only solution. So far this affected only one branch. My other branches are so far unaffected. As no other branch is affected it appears this was local to this one branch. The branch is (was) approximately four months old. Recreating it, which wasn't difficult, resolved the issue. This is the first time I've had any git problems of this nature here at FreeBSD. I've (we've) had many at $JOB because of git-lfs, causing similar looking issues. But that's a whole different kettle of fish. (I'm the only one at $JOB who uses git on a UNIX-like system while everyone else uses Visual Studio.) > > > > > git restore the files, git rm the files, rm the files, git stash > > push, all don't remove them from the branch following rebase. And > > subsequent rebase to main will fail. main is ok though. > > > > What is it that you did to sync the index? > > Like in the mail thread linked in the git comment, theoretically a noop: > > git clone https://git@repo.freebsd.org/src.git > cd src > touch contrib/bc/*vcx* > git commit -a > git push > > It's a problem caused by .gitattributes being checked in after the > *vcx* files were checked in (again, see the email thread and "man > 1 gitattributes"). > > If it was for me, I would remove the .gitattributes eol specs, they > shouldn't be necessary for our purposes. It's probably growing pains. It appears only one branch, probably not surprisingly my most used branch, was the only one affected. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 15:14:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 792E962DBDF for ; Thu, 29 Apr 2021 15:14:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWJtw72Gsz4n2X for ; Thu, 29 Apr 2021 15:14:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x835.google.com with SMTP id d12so11310761qtr.4 for ; Thu, 29 Apr 2021 08:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=C6Y+MmdfF7TK0LjqWYZkx1d86Z6srsjvDultJsEWJ9w=; b=j9MlaBjh6spU7V/orR+r3qYiXwtJv72/lT2LoHni+CSUlU2VyOhKsI0naPKF7tfQyM H7CST8eEv2zGErPs0fWDLtmVxmDXAGWFTF7OgoxqujmZN/0Zy2BDnf9Bey3oqRXigTnj Exy+sSl7It8jY89GNKu+CDoeax8m+5mLeEm0SbKNqPll7UDT2P17KAZAAy8jFs1wDx1l 71oWSUf8x8nH+O66c3hSg1IrHYboqR6dbyokmM+AlWyYDfJDfEeKHacQwI4FK5ChsdLb 5SR5WeBzk359VUD0wPbg/z4BFRP4SvaQNIbM97kn+D4hBIHVeA3RZIvuuRsBvAUeJXiZ EYAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=C6Y+MmdfF7TK0LjqWYZkx1d86Z6srsjvDultJsEWJ9w=; b=tPNxfsNG3B1XunbsGEFpPOT0GTKGVQuDjH2DQs3Ki67Gaft0IK0uXXW3l7nf06rq9H ocZWQp8H1oWiLWutNB7F7tzUUXXHSr62IZYoJIc6Az9/wxapiDb4KdWag/fFUE+ylGg9 efWMM491z7ldy2oqEkvDbDPcBfH4o/tSX/VCMVdWF3S/0mwAqFuRa24ENQ798g1BwqiD EIpPAAYASQ97RpJQlGSO75JIYWScnj4Ss9mtxERN5i0Zp3XLtmiio+c7aJUk8ygkjRTe ME61jf2TUVTJ8T0SonIb/q/OnG5DXDlyQZaaAdZOmKVzc6qT308ncg2l4bzOLG+tNrp3 Z7Tg== X-Gm-Message-State: AOAM533JTrizx8FPsl8U0Xt6T/VCqC+YcBhIa2YvUDM9yGDj/CKBo3aD OoG48q9FRVRdvoIt2dB0xgnFZA== X-Google-Smtp-Source: ABdhPJyBIWmdr4CU70kaFqm/z+DN2VFgOKZ/JfpNf0EJqCdCG9Vud3Mb7rGMR6Kts4GjgLH2OMXx8A== X-Received: by 2002:ac8:5049:: with SMTP id h9mr9766653qtm.304.1619709255749; Thu, 29 Apr 2021 08:14:15 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id g16sm109329qtv.64.2021.04.29.08.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 08:14:15 -0700 (PDT) Date: Thu, 29 Apr 2021 11:14:14 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e86bddea9fe6 - main - pf: Split pf_rule into kernel and user space versions Message-ID: <20210429151414.iao5i7hjmmztfos6@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202101052237.105MbsJW081542@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wxy3ug3xhgreetom" Content-Disposition: inline In-Reply-To: <202101052237.105MbsJW081542@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4FWJtw72Gsz4n2X X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=j9MlaBjh; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::835 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::835:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.222.53:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::835:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::835:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:14:17 -0000 --wxy3ug3xhgreetom Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 05, 2021 at 10:37:54PM +0000, Kristof Provost wrote: > The branch main has been updated by kp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De86bddea9fe62d5093a1942cf2= 1950b3c5ca62e5 >=20 > commit e86bddea9fe62d5093a1942cf21950b3c5ca62e5 > Author: Kristof Provost > AuthorDate: 2020-12-05 13:32:54 +0000 > Commit: Kristof Provost > CommitDate: 2021-01-05 22:35:36 +0000 >=20 > pf: Split pf_rule into kernel and user space versions > =20 > No functional change intended. > =20 > MFC after: 2 weeks > Sponsored by: Orange Business Services > Differential Revision: https://reviews.freebsd.org/D27758 Key Kristof, This commit breaks the security/expiretable port. Specifically, the guarding of the pf_state struct, which expiretable uses directly. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --wxy3ug3xhgreetom Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmCKzUMACgkQ/y5nonf4 4fqxHw/+JoxeWHhMXN82bejtg/mKCTLr+xWLeaIt5OLlLdqvk4LGo1wjTNA6tAqr eKN9kFDHkHaYlx0DQ9RZH3E1nSDjBuTOaoKd0ZJjCIIdsXvmNW0lmJ6htllVHRbT uoNeSlkG2hndzjQEgIDy9EmmSioWUAl1dha6axh/Sxzm+0SoPqtUwqnU82HFrfcJ nQQMNotI5kI6fXSKmw99UjHoF74wG+UUCkgFSh3qsaz2QhHQflJF6j1WS3nNInxP Zg8WiO8Q4OZXB4R3dSd7TgR9djtGp3Ncu0hS2yk17ZfC0jNbIPJ5j5/DIHiOqW6k +5fQKtygWp+tMRmFKx8gK8qDKAAuxywMk2bpFhgiYkJdbyF9a23Hu7ZK1aR+zkzz MB6C2sojVDYeXyve14zetjIsvnElUCNGpfFvzHdquvPK/OQibOgjwS/HavvJ1rKd WDMVAF21hLpYBEGMlw7iPNEkFFIc0iufdz32O3ckS9i3zHaqYOh9AXocREzDA7rT 2qnuYk4Jom6Evh950kW5EyJixFfKI/8WkQIGK1SJpKZRRTT515UWvGI7mzR7cAdM dSxumLFNUmOtW89DJ5txXtsp/UJZ7/f1/Q9HAV8Vxf4+j5nayWd+c+e16pnYKowQ tJi2Sbp6qoK1KOX4hzAvnzXa+8gAgI94Ka7f87PYqHGuZd+j4DM= =q/v1 -----END PGP SIGNATURE----- --wxy3ug3xhgreetom-- From owner-dev-commits-src-main@freebsd.org Thu Apr 29 15:19:03 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4608662DAEF; Thu, 29 Apr 2021 15:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWK0R1Z8fz4nM1; Thu, 29 Apr 2021 15:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 0C45EAF16; Thu, 29 Apr 2021 15:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 0679B15E37; Thu, 29 Apr 2021 17:19:00 +0200 (CEST) From: "Kristof Provost" To: "Shawn Webb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e86bddea9fe6 - main - pf: Split pf_rule into kernel and user space versions Date: Thu, 29 Apr 2021 17:18:59 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <3FE30BC8-EA8D-40E9-9D51-2906A6561B50@FreeBSD.org> In-Reply-To: <20210429151414.iao5i7hjmmztfos6@mutt-hbsd> References: <202101052237.105MbsJW081542@gitrepo.freebsd.org> <20210429151414.iao5i7hjmmztfos6@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:19:03 -0000 On 29 Apr 2021, at 17:14, Shawn Webb wrote: > On Tue, Jan 05, 2021 at 10:37:54PM +0000, Kristof Provost wrote: >> The branch main has been updated by kp: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3De86bddea9fe62d5093a1942cf219= 50b3c5ca62e5 >> >> commit e86bddea9fe62d5093a1942cf21950b3c5ca62e5 >> Author: Kristof Provost >> AuthorDate: 2020-12-05 13:32:54 +0000 >> Commit: Kristof Provost >> CommitDate: 2021-01-05 22:35:36 +0000 >> >> pf: Split pf_rule into kernel and user space versions >> >> No functional change intended. >> >> MFC after: 2 weeks >> Sponsored by: Orange Business Services >> Differential Revision: https://reviews.freebsd.org/D27758 > > Key Kristof, > > This commit breaks the security/expiretable port. Specifically, the > guarding of the pf_state struct, which expiretable uses directly. > Yeah, it=E2=80=99s come up before: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253547 Tl;dr: The expiretable port used a struct it should not have been using. = That part of the code never[*] worked, but it=E2=80=99s not actually used= = anyway. Renato has a patch to fix the port by simply deleting the = offending code. Best regards, Kristof [*] Not in recent memory anyway. At least since 2012. That=E2=80=99s when= the = pf code was moved around in the tree and I=E2=80=99ve not dug further to = see = when this started to be wrong. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 15:21:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2496B62DE7C; Thu, 29 Apr 2021 15:21:45 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWK3X2RYCz4nHC; Thu, 29 Apr 2021 15:21:43 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id 14a432a5; Thu, 29 Apr 2021 15:21:41 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 40dcf863 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Thu, 29 Apr 2021 15:21:41 +0000 (UTC) Date: Thu, 29 Apr 2021 17:21:22 +0200 From: Michael Gmelin To: Cy Schubert Cc: Michael Gmelin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: <20210429172122.1751663f@bsd64.grem.de> In-Reply-To: <202104291455.13TEtxEg040285@slippy.cwsent.com> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWK3X2RYCz4nHC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:21:45 -0000 On Thu, 29 Apr 2021 07:55:58 -0700 Cy Schubert wrote: > In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin > writes: > > > > > > > > On Thu, 29 Apr 2021 06:53:18 -0700 > > Cy Schubert wrote: > > > > > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, > > > Michael Gmelin wr > > > ites: > > > > The branch main has been updated by grembo (ports committer): > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cba > > > > fdea208b > > > > > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > > > Author: Michael Gmelin > > > > AuthorDate: 2021-04-29 12:29:04 +0000 > > > > Commit: Michael Gmelin > > > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > > > > > Synch index of contrib/bc with what is in workdir after > > > > cloning. > > > > From a workdir perspective this should be a no-op. > > > > See also: > > > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569 > > > > > > .htm > > > > l > > > > --- > > > > contrib/bc/bc.vcxproj | 554 > > > > ++++++++++++++++++++------------------- -- > > > > contrib/bc/bc.vcxproj.filters | 362 > > > > +++++++++++++-------------- contrib/bc/bcl.vcxproj | > > > > 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | > > > > 190 +++++++------- 4 files changed, 713 insertions(+), 713 > > > > deletions(-) > > > > > > Whatever was done here I cannot rebase from main to my local > > > branches. The files remain modified. The only recourse so far was > > > to delete the local branch and start over. I've done this to one > > > inconsequential branch so far but hopefully someone can suggest a > > > solution. > > > > Can you show an example of how this fails for you (especially the > > error messages)? > > slippy$ git pull -r --all > Fetching freebsd > remote: Enumerating objects: 9, done. > remote: Counting objects: 100% (9/9), done. > remote: Compressing objects: 100% (9/9), done. > remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0 > Unpacking objects: 100% (9/9), 12.42 KiB | 111.00 KiB/s, done. > From https://git.freebsd.org/src > 59b3b210a69e..d87ee7b97fe8 stable/13 -> freebsd/stable/13 > Already up to date. > slippy$ git co komquats > Switched to branch 'komquats' > slippy$ git st > On branch komquats > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working > directory) modified: contrib/bc/bc.vcxproj > modified: contrib/bc/bc.vcxproj.filters > modified: contrib/bc/bcl.vcxproj > modified: contrib/bc/bcl.vcxproj.filters > > Untracked files: > (use "git add ..." to include in what will be committed) > sys/i386/conf/IPFILTER > usr.sbin/ufdformat/ > > no changes added to commit (use "git add" and/or "git commit -a") > slippy$ git rebase main > error: cannot rebase: You have unstaged changes. > error: Please commit or stash them. > slippy$ git stash push -m foobar > Saved working directory and index state On komquats: foobar > slippy$ git rebase main > error: cannot rebase: You have unstaged changes. > error: Please commit or stash them. > slippy$ git st > On branch komquats > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working > directory) modified: contrib/bc/bc.vcxproj > modified: contrib/bc/bc.vcxproj.filters > modified: contrib/bc/bcl.vcxproj > modified: contrib/bc/bcl.vcxproj.filters > > Untracked files: > (use "git add ..." to include in what will be committed) > sys/i386/conf/IPFILTER > usr.sbin/ufdformat/ > > no changes added to commit (use "git add" and/or "git commit -a") > slippy$ git stash push -m foobar > Saved working directory and index state On komquats: foobar > slippy$ git st > On branch komquats > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working > directory) modified: contrib/bc/bc.vcxproj > modified: contrib/bc/bc.vcxproj.filters > modified: contrib/bc/bcl.vcxproj > modified: contrib/bc/bcl.vcxproj.filters > > Untracked files: > (use "git add ..." to include in what will be committed) > sys/i386/conf/IPFILTER > usr.sbin/ufdformat/ > > no changes added to commit (use "git add" and/or "git commit -a") > slippy$ > > rm the files, switch branch to main, rebase again, remove the branch, > and start over was the only solution. > > So far this affected only one branch. My other branches are so far > unaffected. > > As no other branch is affected it appears this was local to this one > branch. The branch is (was) approximately four months old. Recreating > it, which wasn't difficult, resolved the issue. > > This is the first time I've had any git problems of this nature here > at FreeBSD. I've (we've) had many at $JOB because of git-lfs, causing > similar looking issues. But that's a whole different kettle of fish. > (I'm the only one at $JOB who uses git on a UNIX-like system while > everyone else uses Visual Studio.) > > > > > > > > > git restore the files, git rm the files, rm the files, git stash > > > push, all don't remove them from the branch following rebase. And > > > subsequent rebase to main will fail. main is ok though. > > > > > > What is it that you did to sync the index? > > > > Like in the mail thread linked in the git comment, theoretically a > > noop: > > > > git clone https://git@repo.freebsd.org/src.git > > cd src > > touch contrib/bc/*vcx* > > git commit -a > > git push > > > > It's a problem caused by .gitattributes being checked in after the > > *vcx* files were checked in (again, see the email thread and "man > > 1 gitattributes"). > > > > If it was for me, I would remove the .gitattributes eol specs, they > > shouldn't be necessary for our purposes. > > It's probably growing pains. > > It appears only one branch, probably not surprisingly my most used > branch, was the only one affected. > Hi Cy, To add more details and an explanation of what you experienced: The bc*vcx* project files were first checked in on April 6th in 7e5c51e523, containing CRLF line breaks. Back then, the attributes were: $ git ls-files --eol contrib/bc/bc.vcxproj i/crlf w/crlf attr/ contrib/bc/bc.vcxproj Now, in 8ea9013512 the .gitattributes file was added, containing: *.vcxproj eol=crlf *.vcxproj.filters eol=crlf *.sln eol= crlf This implicitly changed the the files to being "text": $ git ls-files --eol contrib/bc/bc.vcxproj i/crlf w/crlf attr/text eol=crlf contrib/bc/bc.vcxproj But the checked-in files still had CRLF in it (which is incompatible with being text). This introduced problems to the repo as described in https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html (basically, as soon as the files are touched, they appear as changed). You can find a good description of this general problem here: https://marc.info/?l=git&m=154484903528621&w=2 I'm not sure what a real solution to fix history would look like - technically I guess that the files should have been renormalized before committing when .gitattributes was added. As a workaround, adding this line to .git/info/attributes works: contrib/bc/bc*.vcx* -text This should allow you to merge your various branches without issues. Best Michael p.s. @Cy to demonstrate the original problem, try: git checkout a4b5f7ba3e touch contrib/bc/*vcx* git status -s This shows: $ git status -s M contrib/bc/bc.vcxproj M contrib/bc/bc.vcxproj.filters M contrib/bc/bcl.vcxproj M contrib/bc/bcl.vcxproj.filters This might look familiar to you: This is the problem you were seeing while rebasing - because these files were affected by my commit, the effect is the same as "touch contrib/bc/*vcx*" had above. When applying the workaround: echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes the problem disappears: $ git status HEAD detached at a4b5f7ba3e9 nothing to commit, working tree clean Note that this is cached, so if you remove the line from .git/info/attributes, it stays clean until you touch the files again (can be quite confusing). -- Michael Gmelin From owner-dev-commits-src-main@freebsd.org Thu Apr 29 15:25:12 2021 Return-Path: Delivered-To: dev-commits-src-main@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 73C5462E0E1; Thu, 29 Apr 2021 15:25: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 4FWK7X2sTxz4nSW; Thu, 29 Apr 2021 15:25: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 4AE131D9C9; Thu, 29 Apr 2021 15:25: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 13TFPCCn020415; Thu, 29 Apr 2021 15:25:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFPCQR020414; Thu, 29 Apr 2021 15:25:12 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:25:12 GMT Message-Id: <202104291525.13TFPCQR020414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: ee8b757a949a - main - ipmi: support getting address from EFI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee8b757a949a9575c7355ea01f0475e0c526b9e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:25:12 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=ee8b757a949a9575c7355ea01f0475e0c526b9e5 commit ee8b757a949a9575c7355ea01f0475e0c526b9e5 Author: Yinlong Lu AuthorDate: 2021-04-29 10:04:36 +0000 Commit: Eric van Gyzen CommitDate: 2021-04-29 10:20:58 +0000 ipmi: support getting address from EFI The original implementation only supports getting the address from legacy BIOS (by searching for the SMBIOS_SIG pattern in a fixed address space). Try to get the SMBIOS table from EFI through efirt (EFI Runtime Services) firstly. Continue to search in the legacy BIOS if a NULL address is returned from EFI. By this way the ipmi function supports both legacy BIOS and UEFI systems. Reviewed by: dab, vangyzen MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D30007 --- sys/dev/ipmi/ipmi_isa.c | 4 ++++ sys/dev/ipmi/ipmi_pci.c | 4 ++++ sys/dev/ipmi/ipmi_smbios.c | 19 ++++++++++++++++--- sys/dev/ipmi/ipmi_smbus.c | 4 ++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index cdff305b07ec..1123f2849905 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -286,3 +287,6 @@ static driver_t ipmi_isa_driver = { }; DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi_isa, efirt, 1, 1, 1); +#endif diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c index d4598f9db873..13ac4f4b5ede 100644 --- a/sys/dev/ipmi/ipmi_pci.c +++ b/sys/dev/ipmi/ipmi_pci.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -292,3 +293,6 @@ static driver_t ipmi2_pci_driver = { }; DRIVER_MODULE(ipmi2_pci, pci, ipmi2_pci_driver, ipmi_devclass, 0, 0); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi2_pci, efirt, 1, 1, 1); +#endif diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index a1b953365d7c..e26b6f2956ad 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -150,15 +151,27 @@ smbios_ipmi_info(struct smbios_structure_header *h, void *arg) static void ipmi_smbios_probe(struct ipmi_get_info *info) { +#ifdef ARCH_MAY_USE_EFI + struct uuid efi_smbios; + void *addr_efi; +#endif struct smbios_eps *header; void *table; u_int32_t addr; + addr = 0; bzero(info, sizeof(struct ipmi_get_info)); - /* Find the SMBIOS table header. */ - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); +#ifdef ARCH_MAY_USE_EFI + efi_smbios = (struct uuid)EFI_TABLE_SMBIOS; + if (!efi_get_table(&efi_smbios, &addr_efi)) + addr = (vm_paddr_t)addr_efi; +#endif + + if (addr == 0) + /* Find the SMBIOS table header. */ + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); if (addr == 0) return; diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c index 212248f0217e..652e0ea6e665 100644 --- a/sys/dev/ipmi/ipmi_smbus.c +++ b/sys/dev/ipmi/ipmi_smbus.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -131,3 +132,6 @@ static driver_t ipmi_smbus_driver = { DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi_smbus, efirt, 1, 1, 1); +#endif From owner-dev-commits-src-main@freebsd.org Thu Apr 29 15:42:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 63C6A62E6FB; Thu, 29 Apr 2021 15:42: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 4FWKW12Rh7z4pNb; Thu, 29 Apr 2021 15:42: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 46DBF1DA1F; Thu, 29 Apr 2021 15:42: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 13TFg5r6045480; Thu, 29 Apr 2021 15:42:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFg5Og045479; Thu, 29 Apr 2021 15:42:05 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:42:05 GMT Message-Id: <202104291542.13TFg5Og045479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 20e3b9d8bd77 - main - kasan: Use vm_offset_t for the first parameter to kasan_shadow_map() 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/main X-Git-Reftype: branch X-Git-Commit: 20e3b9d8bd778445bb80b2be28d2fdedf7bae37e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:42:05 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20e3b9d8bd778445bb80b2be28d2fdedf7bae37e commit 20e3b9d8bd778445bb80b2be28d2fdedf7bae37e Author: Mark Johnston AuthorDate: 2021-04-29 15:39:02 +0000 Commit: Mark Johnston CommitDate: 2021-04-29 15:39:02 +0000 kasan: Use vm_offset_t for the first parameter to kasan_shadow_map() No functional change intended. Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/pmap.c | 2 +- sys/kern/subr_asan.c | 10 +++++----- sys/sys/asan.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 77c486c0d00a..66617bffa8df 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4890,7 +4890,7 @@ pmap_growkernel(vm_offset_t addr) if (addr - 1 >= vm_map_max(kernel_map)) addr = vm_map_max(kernel_map); if (kernel_vm_end < addr) - kasan_shadow_map((void *)kernel_vm_end, addr - kernel_vm_end); + kasan_shadow_map(kernel_vm_end, addr - kernel_vm_end); while (kernel_vm_end < addr) { pdpe = pmap_pdpe(kernel_pmap, kernel_vm_end); if ((*pdpe & X86_PG_V) == 0) { diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index d0478899e8c7..b812f7bca465 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -97,18 +97,18 @@ static bool kasan_enabled __read_mostly = false; /* -------------------------------------------------------------------------- */ void -kasan_shadow_map(void *addr, size_t size) +kasan_shadow_map(vm_offset_t addr, size_t size) { size_t sz, npages, i; vm_offset_t sva, eva; - KASSERT((vm_offset_t)addr % KASAN_SHADOW_SCALE == 0, - ("%s: invalid address %p", __func__, addr)); + KASSERT(addr % KASAN_SHADOW_SCALE == 0, + ("%s: invalid address %#lx", __func__, addr)); sz = roundup(size, KASAN_SHADOW_SCALE) / KASAN_SHADOW_SCALE; - sva = kasan_md_addr_to_shad((vm_offset_t)addr); - eva = kasan_md_addr_to_shad((vm_offset_t)addr) + sz; + sva = kasan_md_addr_to_shad(addr); + eva = kasan_md_addr_to_shad(addr) + sz; sva = rounddown(sva, PAGE_SIZE); eva = roundup(eva, PAGE_SIZE); diff --git a/sys/sys/asan.h b/sys/sys/asan.h index c86202222c72..caa6643bda68 100644 --- a/sys/sys/asan.h +++ b/sys/sys/asan.h @@ -56,7 +56,7 @@ #define KASAN_EXEC_ARGS_FREED 0xFF void kasan_init(void); -void kasan_shadow_map(void *, size_t); +void kasan_shadow_map(vm_offset_t, size_t); void kasan_mark(const void *, size_t, size_t, uint8_t); #else /* KASAN */ From owner-dev-commits-src-main@freebsd.org Thu Apr 29 16:22:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 83EB36300C0; Thu, 29 Apr 2021 16:22:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.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 mx1.freebsd.org (Postfix) with ESMTPS id 4FWLPq6DLcz4qJp; Thu, 29 Apr 2021 16:22:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13TGMNqq090489 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 29 Apr 2021 19:22:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13TGMNqq090489 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13TGMMXl090488; Thu, 29 Apr 2021 19:22:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Apr 2021 19:22:22 +0300 From: Konstantin Belousov To: Michael Gmelin Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210429172122.1751663f@bsd64.grem.de> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FWLPq6DLcz4qJp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 16:22:40 -0000 On Thu, Apr 29, 2021 at 05:21:22PM +0200, Michael Gmelin wrote: > > > On Thu, 29 Apr 2021 07:55:58 -0700 > Cy Schubert wrote: > > > In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin > > writes: > > > > > > > > > > > > On Thu, 29 Apr 2021 06:53:18 -0700 > > > Cy Schubert wrote: > > > > > > > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, > > > > Michael Gmelin wr > > > > ites: > > > > > The branch main has been updated by grembo (ports committer): > > > > > > > > > > URL: > > > > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292cba > > > > > fdea208b > > > > > > > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > > > > Author: Michael Gmelin > > > > > AuthorDate: 2021-04-29 12:29:04 +0000 > > > > > Commit: Michael Gmelin > > > > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > > > > > > > Synch index of contrib/bc with what is in workdir after > > > > > cloning. > > > > > From a workdir perspective this should be a no-op. > > > > > See also: > > > > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569 > > > > > > > > .htm > > > > > l > > > > > --- > > > > > contrib/bc/bc.vcxproj | 554 > > > > > ++++++++++++++++++++------------------- -- > > > > > contrib/bc/bc.vcxproj.filters | 362 > > > > > +++++++++++++-------------- contrib/bc/bcl.vcxproj | > > > > > 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | > > > > > 190 +++++++------- 4 files changed, 713 insertions(+), 713 > > > > > deletions(-) > > > > > > > > Whatever was done here I cannot rebase from main to my local > > > > branches. The files remain modified. The only recourse so far was > > > > to delete the local branch and start over. I've done this to one > > > > inconsequential branch so far but hopefully someone can suggest a > > > > solution. > > > > > > Can you show an example of how this fails for you (especially the > > > error messages)? > > > > slippy$ git pull -r --all > > Fetching freebsd > > remote: Enumerating objects: 9, done. > > remote: Counting objects: 100% (9/9), done. > > remote: Compressing objects: 100% (9/9), done. > > remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0 > > Unpacking objects: 100% (9/9), 12.42 KiB | 111.00 KiB/s, done. > > From https://git.freebsd.org/src > > 59b3b210a69e..d87ee7b97fe8 stable/13 -> freebsd/stable/13 > > Already up to date. > > slippy$ git co komquats > > Switched to branch 'komquats' > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ > > > > rm the files, switch branch to main, rebase again, remove the branch, > > and start over was the only solution. > > > > So far this affected only one branch. My other branches are so far > > unaffected. > > > > As no other branch is affected it appears this was local to this one > > branch. The branch is (was) approximately four months old. Recreating > > it, which wasn't difficult, resolved the issue. > > > > This is the first time I've had any git problems of this nature here > > at FreeBSD. I've (we've) had many at $JOB because of git-lfs, causing > > similar looking issues. But that's a whole different kettle of fish. > > (I'm the only one at $JOB who uses git on a UNIX-like system while > > everyone else uses Visual Studio.) > > > > > > > > > > > > > git restore the files, git rm the files, rm the files, git stash > > > > push, all don't remove them from the branch following rebase. And > > > > subsequent rebase to main will fail. main is ok though. > > > > > > > > What is it that you did to sync the index? > > > > > > Like in the mail thread linked in the git comment, theoretically a > > > noop: > > > > > > git clone https://git@repo.freebsd.org/src.git > > > cd src > > > touch contrib/bc/*vcx* > > > git commit -a > > > git push > > > > > > It's a problem caused by .gitattributes being checked in after the > > > *vcx* files were checked in (again, see the email thread and "man > > > 1 gitattributes"). > > > > > > If it was for me, I would remove the .gitattributes eol specs, they > > > shouldn't be necessary for our purposes. > > > > It's probably growing pains. > > > > It appears only one branch, probably not surprisingly my most used > > branch, was the only one affected. > > > > Hi Cy, > > To add more details and an explanation of what you experienced: > > The bc*vcx* project files were first checked in on April 6th in > 7e5c51e523, containing CRLF line breaks. > > Back then, the attributes were: > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/ contrib/bc/bc.vcxproj > > Now, in 8ea9013512 the .gitattributes file was added, containing: > > *.vcxproj eol=crlf > *.vcxproj.filters eol=crlf > *.sln eol= crlf > > This implicitly changed the the files to being "text": > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/text eol=crlf contrib/bc/bc.vcxproj > > But the checked-in files still had CRLF in it (which is incompatible > with being text). > > This introduced problems to the repo as described in > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html > (basically, as soon as the files are touched, they appear as changed). > > You can find a good description of this general problem here: > https://marc.info/?l=git&m=154484903528621&w=2 > > I'm not sure what a real solution to fix history would look like > - technically I guess that the files should have been renormalized > before committing when .gitattributes was added. > > As a workaround, adding this line to .git/info/attributes works: > contrib/bc/bc*.vcx* -text > > This should allow you to merge your various branches without issues. > > Best > Michael > > p.s. @Cy to demonstrate the original problem, try: > > git checkout a4b5f7ba3e > touch contrib/bc/*vcx* > git status -s > > This shows: > > $ git status -s > M contrib/bc/bc.vcxproj > M contrib/bc/bc.vcxproj.filters > M contrib/bc/bcl.vcxproj > M contrib/bc/bcl.vcxproj.filters > > This might look familiar to you: This is the problem you were seeing > while rebasing - because these files were affected by my commit, the > effect is the same as "touch contrib/bc/*vcx*" had above. > > When applying the workaround: > > echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes > > the problem disappears: > > $ git status > HEAD detached at a4b5f7ba3e9 > nothing to commit, working tree clean > > Note that this is cached, so if you remove the line from > .git/info/attributes, it stays clean until you touch the files again > (can be quite confusing). So I have the same, on the very living branch I rebased yesterday. Today I cannot: solo% git status ~/work/DEV/src On branch pt_coredump Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/amd64/compile/ no changes added to commit (use "git add" and/or "git commit -a") solo% git checkout . ~/work/DEV/src Updated 4 paths from the index solo% git status ~/work/DEV/src On branch pt_coredump Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/amd64/compile/ no changes added to commit (use "git add" and/or "git commit -a") Whatever brokeness in repo we had before, it did not prevented other people to work with it. Now I cannot even rebase. Requiring all developers to add some attributes to all clones just moves the brokeness into wrong direction. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 16:27:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 65D5F6301A4; Thu, 29 Apr 2021 16:27: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 4FWLWG2Vzfz4qdJ; Thu, 29 Apr 2021 16:27: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 4921A1E385; Thu, 29 Apr 2021 16:27: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 13TGRMtV098594; Thu, 29 Apr 2021 16:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TGRM9j098593; Thu, 29 Apr 2021 16:27:22 GMT (envelope-from git) Date: Thu, 29 Apr 2021 16:27:22 GMT Message-Id: <202104291627.13TGRM9j098593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 420d30f5bdbf - main - kasan.9: A couple of fixups 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/main X-Git-Reftype: branch X-Git-Commit: 420d30f5bdbfc20d83b3c9a7d5b4e90446b922fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 16:27:22 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=420d30f5bdbfc20d83b3c9a7d5b4e90446b922fa commit 420d30f5bdbfc20d83b3c9a7d5b4e90446b922fa Author: Mark Johnston AuthorDate: 2021-04-29 16:26:03 +0000 Commit: Mark Johnston CommitDate: 2021-04-29 16:26:37 +0000 kasan.9: A couple of fixups - Mention GENERIC-KASAN. - Note that the runtime was ported from NetBSD. Sponsored by: The FreeBSD Foundation --- share/man/man9/kasan.9 | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/share/man/man9/kasan.9 b/share/man/man9/kasan.9 index ecc068209913..d675a78f1e29 100644 --- a/share/man/man9/kasan.9 +++ b/share/man/man9/kasan.9 @@ -27,15 +27,22 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2021 +.Dd April 29, 2021 .Dt KASAN 9 .Os .Sh NAME -.Nm kasan -.Nd kernel address sanitizer +.Nm KASAN +.Nd Kernel Address SANitizer .Sh SYNOPSIS -To compile KASAN into the kernel, place the following line in your kernel -configuration file: +The +.Pa GENERIC-KASAN +kernel configuration can be used to compile a KASAN-enabled kernel using +.Pa GENERIC +as a base configuration. +Alternately, to compile +.Nm +into the kernel, place the following line in your +kernel configuration file: .Bd -ragged -offset indent .Cd "options KASAN" .Ed @@ -142,13 +149,16 @@ are equal, .Fa code should be 0. .Sh SEE ALSO +.Xr build 7 , .Xr malloc 9 , .Xr memguard 9 , .Xr redzone 9 , .Xr uma 9 .Sh HISTORY .Nm -first appeared in +was ported from +.Nx +and first appeared in .Fx 14.0 . .Sh BUGS Accesses to kernel memory outside of the kernel map are ignored by the From owner-dev-commits-src-main@freebsd.org Thu Apr 29 16:45:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3D241630785; Thu, 29 Apr 2021 16:45:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWLw05s3fz4r3c; Thu, 29 Apr 2021 16:45:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id c9YPlu6wrycp5c9YQlpxut; Thu, 29 Apr 2021 10:30:19 -0600 X-Authority-Analysis: v=2.4 cv=H864f8Ui c=1 sm=1 tr=0 ts=608adf1b a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=3YhXtTcJ-WEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=gu6fZOg2AAAA:8 a=EkcXrb_YAAAA:8 a=MOUFdkR2jS08RdPvTG0A:9 a=CjuIK1q_8ugA:10 a=YV30ditfemIA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=2RSlZUUhi9gRBrsHwhhZ:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 041DA3CC; Thu, 29 Apr 2021 09:30:16 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 13TGUFYG004840; Thu, 29 Apr 2021 09:30:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202104291630.13TGUFYG004840@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Gmelin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. In-reply-to: <20210429172122.1751663f@bsd64.grem.de> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> Comments: In-reply-to Michael Gmelin message dated "Thu, 29 Apr 2021 17:21:22 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Apr 2021 09:30:15 -0700 X-CMAE-Envelope: MS4xfKUK51TEQxdOxzbbe3156Kj9zFMUXKmV4wwA1glw8pHdDiu4G5QjBo+7UGsymXm+SuYgFxSF6RzieMMon6HO20+0aXhMfVTEj+ym0JDkijBrPMqWNdC7 BO/SatEl1o07He6CNHQvMFwZALtSGTO8/IbmjH8OFVkJRVDQQgyGvzz4mAnh072DbaGEMSKhO0OBemcUjin+RGk/K2sniFXkFyo1ejoem1M1XkUocXAlSkFV L3EMv2P4Sm26gpsmViJCeKfldOMl9jw7/aI/oXypeTcWKq0SiXuGpIJ1mtpqHiZY/XRiF7FCeAkBTBW/zDFv+HGTtQlHLS5ZGlZ11Cw5nmI= X-Rspamd-Queue-Id: 4FWLw05s3fz4r3c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 16:45:21 -0000 In message <20210429172122.1751663f@bsd64.grem.de>, Michael Gmelin writes: > > > > On Thu, 29 Apr 2021 07:55:58 -0700 > Cy Schubert wrote: > > > In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin > > writes: > > > > > > > > > > > > On Thu, 29 Apr 2021 06:53:18 -0700 > > > Cy Schubert wrote: > > > > > > > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, > > > > Michael Gmelin wr > > > > ites: > > > > > The branch main has been updated by grembo (ports committer): > > > > > > > > > > URL: > > > > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292 > cba > > > > > fdea208b > > > > > > > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > > > > Author: Michael Gmelin > > > > > AuthorDate: 2021-04-29 12:29:04 +0000 > > > > > Commit: Michael Gmelin > > > > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > > > > > > > Synch index of contrib/bc with what is in workdir after > > > > > cloning. > > > > > From a workdir perspective this should be a no-op. > > > > > See also: > > > > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/07 > 9569 > > > > > > > > .htm > > > > > l > > > > > --- > > > > > contrib/bc/bc.vcxproj | 554 > > > > > ++++++++++++++++++++------------------- -- > > > > > contrib/bc/bc.vcxproj.filters | 362 > > > > > +++++++++++++-------------- contrib/bc/bcl.vcxproj | > > > > > 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | > > > > > 190 +++++++------- 4 files changed, 713 insertions(+), 713 > > > > > deletions(-) > > > > > > > > Whatever was done here I cannot rebase from main to my local > > > > branches. The files remain modified. The only recourse so far was > > > > to delete the local branch and start over. I've done this to one > > > > inconsequential branch so far but hopefully someone can suggest a > > > > solution. > > > > > > Can you show an example of how this fails for you (especially the > > > error messages)? > > > > slippy$ git pull -r --all > > Fetching freebsd > > remote: Enumerating objects: 9, done. > > remote: Counting objects: 100% (9/9), done. > > remote: Compressing objects: 100% (9/9), done. > > remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0 > > Unpacking objects: 100% (9/9), 12.42 KiB | 111.00 KiB/s, done. > > From https://git.freebsd.org/src > > 59b3b210a69e..d87ee7b97fe8 stable/13 -> freebsd/stable/13 > > Already up to date. > > slippy$ git co komquats > > Switched to branch 'komquats' > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ > > > > rm the files, switch branch to main, rebase again, remove the branch, > > and start over was the only solution. > > > > So far this affected only one branch. My other branches are so far > > unaffected. > > > > As no other branch is affected it appears this was local to this one > > branch. The branch is (was) approximately four months old. Recreating > > it, which wasn't difficult, resolved the issue. > > > > This is the first time I've had any git problems of this nature here > > at FreeBSD. I've (we've) had many at $JOB because of git-lfs, causing > > similar looking issues. But that's a whole different kettle of fish. > > (I'm the only one at $JOB who uses git on a UNIX-like system while > > everyone else uses Visual Studio.) > > > > > > > > > > > > > git restore the files, git rm the files, rm the files, git stash > > > > push, all don't remove them from the branch following rebase. And > > > > subsequent rebase to main will fail. main is ok though. > > > > > > > > What is it that you did to sync the index? > > > > > > Like in the mail thread linked in the git comment, theoretically a > > > noop: > > > > > > git clone https://git@repo.freebsd.org/src.git > > > cd src > > > touch contrib/bc/*vcx* > > > git commit -a > > > git push > > > > > > It's a problem caused by .gitattributes being checked in after the > > > *vcx* files were checked in (again, see the email thread and "man > > > 1 gitattributes"). > > > > > > If it was for me, I would remove the .gitattributes eol specs, they > > > shouldn't be necessary for our purposes. > > > > It's probably growing pains. > > > > It appears only one branch, probably not surprisingly my most used > > branch, was the only one affected. > > > > Hi Cy, > > To add more details and an explanation of what you experienced: > > The bc*vcx* project files were first checked in on April 6th in > 7e5c51e523, containing CRLF line breaks. > > Back then, the attributes were: > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/ contrib/bc/bc.vcxproj > > Now, in 8ea9013512 the .gitattributes file was added, containing: > > *.vcxproj eol=crlf > *.vcxproj.filters eol=crlf > *.sln eol= crlf > > This implicitly changed the the files to being "text": > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/text eol=crlf contrib/bc/bc.vcxproj > > But the checked-in files still had CRLF in it (which is incompatible > with being text). > > This introduced problems to the repo as described in > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html > (basically, as soon as the files are touched, they appear as changed). > > You can find a good description of this general problem here: > https://marc.info/?l=git&m=154484903528621&w=2 > > I'm not sure what a real solution to fix history would look like > - technically I guess that the files should have been renormalized > before committing when .gitattributes was added. > > As a workaround, adding this line to .git/info/attributes works: > contrib/bc/bc*.vcx* -text > > This should allow you to merge your various branches without issues. > > Best > Michael > > p.s. @Cy to demonstrate the original problem, try: > > git checkout a4b5f7ba3e > touch contrib/bc/*vcx* > git status -s > > This shows: > > $ git status -s > M contrib/bc/bc.vcxproj > M contrib/bc/bc.vcxproj.filters > M contrib/bc/bcl.vcxproj > M contrib/bc/bcl.vcxproj.filters > > This might look familiar to you: This is the problem you were seeing > while rebasing - because these files were affected by my commit, the > effect is the same as "touch contrib/bc/*vcx*" had above. > > When applying the workaround: > > echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes > > the problem disappears: > > $ git status > HEAD detached at a4b5f7ba3e9 > nothing to commit, working tree clean > > Note that this is cached, so if you remove the line from > .git/info/attributes, it stays clean until you touch the files again > (can be quite confusing). I blew away my branch and recreated it but luckily I have a daily ZFS snapshot. I'll reproduce the problem using a clone. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 16:45:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 22DF7630645; Thu, 29 Apr 2021 16:45:35 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWLwG429Yz4rGy; Thu, 29 Apr 2021 16:45:34 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id 87333b86; Thu, 29 Apr 2021 16:45:30 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id d0e44cfc (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Thu, 29 Apr 2021 16:45:23 +0000 (UTC) Date: Thu, 29 Apr 2021 18:45:03 +0200 From: Michael Gmelin To: Konstantin Belousov Cc: Michael Gmelin , Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: <20210429184503.06701da5@bsd64.grem.de> In-Reply-To: References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWLwG429Yz4rGy X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 16:45:35 -0000 On Thu, 29 Apr 2021 19:22:22 +0300 Konstantin Belousov wrote: > On Thu, Apr 29, 2021 at 05:21:22PM +0200, Michael Gmelin wrote: > > > > > ... > > So I have the same, on the very living branch I rebased yesterday. > Today I cannot: > > solo% git status > ~/work/DEV/src On branch pt_coredump > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working > directory) modified: contrib/bc/bc.vcxproj > modified: contrib/bc/bc.vcxproj.filters > modified: contrib/bc/bcl.vcxproj > modified: contrib/bc/bcl.vcxproj.filters > > Untracked files: > (use "git add ..." to include in what will be committed) > sys/amd64/compile/ > > no changes added to commit (use "git add" and/or "git commit -a") > solo% git checkout . > ~/work/DEV/src Updated 4 paths from the index > solo% git status > ~/work/DEV/src On branch pt_coredump > Changes not staged for commit: > (use "git add ..." to update what will be committed) > (use "git restore ..." to discard changes in working > directory) modified: contrib/bc/bc.vcxproj > modified: contrib/bc/bc.vcxproj.filters > modified: contrib/bc/bcl.vcxproj > modified: contrib/bc/bcl.vcxproj.filters > > Untracked files: > (use "git add ..." to include in what will be committed) > sys/amd64/compile/ > > no changes added to commit (use "git add" and/or "git commit -a") > > Whatever brokeness in repo we had before, it did not prevented other > people to work with it. Now I cannot even rebase. It would have in the future, as the problem is caused by switching between branches. The moment any of those files changes, we would see the same problem re-appear. Anytime re-indexing happens you would see the problem re-appear. Sooner or later somebody would then commit those files as part of another commit by accident and we are in the same situation again. > > Requiring all developers to add some attributes to all clones just > moves the brokeness into wrong direction. I'm happy to see a better solution applied, I don't know if there is any that won't break rebasing for commits that happened (and that doesn't involve going back to the offending commit and changing history/hashes). Even just removing the files from contrib/bc would cause these issues when switching between branches/rebasing at this point. Essentially, anything that involves commits since 8ea9013512 is somehow affected. IMHO the shorter we keep this period, the better, but again, if you have a better idea, do whatever is necessary. -m -- Michael Gmelin From owner-dev-commits-src-main@freebsd.org Thu Apr 29 16:56:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F3034630C26; Thu, 29 Apr 2021 16:56:04 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWM8N6CkPz4rm3; Thu, 29 Apr 2021 16:56:04 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f1fe900f013fb8dd2403568.dip0.t-ipconnect.de [IPv6:2003:cd:5f1f:e900:f013:fb8d:d240:3568]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id EF765C3B1; Thu, 29 Apr 2021 16:56:03 +0000 (UTC) (envelope-from se@freebsd.org) To: Konstantin Belousov , Michael Gmelin Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> From: Stefan Esser Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: Date: Thu, 29 Apr 2021 18:56:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MGwy98m7YR63CtDEcHtauMVvecsgTjJbw" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 16:56:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MGwy98m7YR63CtDEcHtauMVvecsgTjJbw Content-Type: multipart/mixed; boundary="r1hxZgrtIHIFG1nVLcuFDID8uRl3vVEfj"; protected-headers="v1" From: Stefan Esser To: Konstantin Belousov , Michael Gmelin Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> In-Reply-To: --r1hxZgrtIHIFG1nVLcuFDID8uRl3vVEfj Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 29.04.21 um 18:22 schrieb Konstantin Belousov: > On Thu, Apr 29, 2021 at 05:21:22PM +0200, Michael Gmelin wrote: >> >> On Thu, 29 Apr 2021 07:55:58 -0700 >> Cy Schubert wrote: >> >>> In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin >>> writes: >>>> >>>> On Thu, 29 Apr 2021 06:53:18 -0700 >>>> Cy Schubert wrote: >>>> =20 >>>>> git restore the files, git rm the files, rm the files, git stash >>>>> push, all don't remove them from the branch following rebase. And >>>>> subsequent rebase to main will fail. main is ok though. >>>>> >>>>> What is it that you did to sync the index? =20 >>>> >>>> Like in the mail thread linked in the git comment, theoretically a >>>> noop: >>>> >>>> git clone https://git@repo.freebsd.org/src.git >>>> cd src >>>> touch contrib/bc/*vcx* >>>> git commit -a >>>> git push >>>> >>>> It's a problem caused by .gitattributes being checked in after the >>>> *vcx* files were checked in (again, see the email thread and "man >>>> 1 gitattributes"). >>>> >>>> If it was for me, I would remove the .gitattributes eol specs, they >>>> shouldn't be necessary for our purposes. =20 Sorry, this was my fault. IIRC I had added the files to the commit with "add *" and thus missed .gitattributes, and I did not know about the effect the delayed commit of that missing file would cause. Maybe the best solution is to revert all the commits and then start over with a single commit that includes .gitattributes. The Windows specific files are not relevant for FreeBSD, but I'd rather perform the vendor import and cherry-pick without too many changes to the upstream version. >>> It's probably growing pains. >>> >>> It appears only one branch, probably not surprisingly my most used >>> branch, was the only one affected. I had planned to MFC to stable/13 and 12 this weekend, but will wait for the issue to be settled in the main branch, now. Regards, STefan --r1hxZgrtIHIFG1nVLcuFDID8uRl3vVEfj-- --MGwy98m7YR63CtDEcHtauMVvecsgTjJbw Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmCK5SAFAwAAAAAACgkQR+u171r99USb Vgf+OWC0JmDpMuAzJyVFI3nWBp8JQpI1Or/4Dghet8gLNXinmdBlfgWLkpmOoFXlHExwG7PQlOAh oA9uM1ERZ33GCE2JBiYVhyX4LIEsDqYq8DbC50CkRuogbAZoVvpm1lKJzOChzHXsxd1rkAp7Qs8X +0cdFe4FcmlxOiyIAE8ihkOZPVB/+ur+GL3OBnJTDoP5mV61ejmR2+e+zUryBnP4qSwMKQhcfT0r Yg9gWTgsi9ImHGyknhQaAdIaCs4ayYP1O4RcxbUgcZuVOSqjvltcc+X8X1HIg5B58bt6K5ddiATV 46hsTPqax62Tr09KiaRXIGCLuOZLjjl/di29g96VBg== =au55 -----END PGP SIGNATURE----- --MGwy98m7YR63CtDEcHtauMVvecsgTjJbw-- From owner-dev-commits-src-main@freebsd.org Thu Apr 29 17:45:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C6FD4632088; Thu, 29 Apr 2021 17:45:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWNFP2dGjz4tKY; Thu, 29 Apr 2021 17:45:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id cAUblOaS4uKh3cAUcl67Pm; Thu, 29 Apr 2021 11:30:27 -0600 X-Authority-Analysis: v=2.4 cv=EaOr/NqC c=1 sm=1 tr=0 ts=608aed33 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=3YhXtTcJ-WEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=gu6fZOg2AAAA:8 a=EkcXrb_YAAAA:8 a=r7j9-FYAJdjDD8MJgUkA:9 a=CjuIK1q_8ugA:10 a=YV30ditfemIA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=2RSlZUUhi9gRBrsHwhhZ:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 6F9114D6; Thu, 29 Apr 2021 10:30:24 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 13THUOv6006096; Thu, 29 Apr 2021 10:30:24 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202104291730.13THUOv6006096@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Gmelin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. In-reply-to: <20210429172122.1751663f@bsd64.grem.de> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> Comments: In-reply-to Michael Gmelin message dated "Thu, 29 Apr 2021 17:21:22 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Apr 2021 10:30:24 -0700 X-CMAE-Envelope: MS4xfLL8XmuT9FZ6bdOs6kAHp1qyASLG7de7B23mhMhgF6rfQnVKJKrflrQMNRRdG+UfgE5MBSw6PESHEqOUFu5WTL56BYkSJuVUaEABgvOurHTvEAXLKZd2 3n9AvtbcOiukloqzY5UojXoL/OpsKL9rm8Ym9aHZBj3qheO0+4/ktwbTg70TzCrgGB0KNuabUjD/3sdR3FxkcRt0LUv0kHHeRBZ/lOASgeVKWQ95XNNmPu+0 NVCW6g7BYRVwL2WnGBjDJH5YiBC9NvoBuQ3x/u5xytI7Qe54ksAXJMeWgn73PVM2SopBEcdvobqeXVcRhzDL6jc0FNbp2ZeMstNCWvVdi6o= X-Rspamd-Queue-Id: 4FWNFP2dGjz4tKY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 17:45:29 -0000 In message <20210429172122.1751663f@bsd64.grem.de>, Michael Gmelin writes: > > > > On Thu, 29 Apr 2021 07:55:58 -0700 > Cy Schubert wrote: > > > In message <20210429162959.16662d66@bsd64.grem.de>, Michael Gmelin > > writes: > > > > > > > > > > > > On Thu, 29 Apr 2021 06:53:18 -0700 > > > Cy Schubert wrote: > > > > > > > In message <202104291234.13TCYk5K092776@gitrepo.freebsd.org>, > > > > Michael Gmelin wr > > > > ites: > > > > > The branch main has been updated by grembo (ports committer): > > > > > > > > > > URL: > > > > > https://cgit.FreeBSD.org/src/commit/?id=a0358e3d5184950b4316f105eb292 > cba > > > > > fdea208b > > > > > > > > > > commit a0358e3d5184950b4316f105eb292cbafdea208b > > > > > Author: Michael Gmelin > > > > > AuthorDate: 2021-04-29 12:29:04 +0000 > > > > > Commit: Michael Gmelin > > > > > CommitDate: 2021-04-29 12:33:56 +0000 > > > > > > > > > > Synch index of contrib/bc with what is in workdir after > > > > > cloning. > > > > > From a workdir perspective this should be a no-op. > > > > > See also: > > > > > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/07 > 9569 > > > > > > > > .htm > > > > > l > > > > > --- > > > > > contrib/bc/bc.vcxproj | 554 > > > > > ++++++++++++++++++++------------------- -- > > > > > contrib/bc/bc.vcxproj.filters | 362 > > > > > +++++++++++++-------------- contrib/bc/bcl.vcxproj | > > > > > 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | > > > > > 190 +++++++------- 4 files changed, 713 insertions(+), 713 > > > > > deletions(-) > > > > > > > > Whatever was done here I cannot rebase from main to my local > > > > branches. The files remain modified. The only recourse so far was > > > > to delete the local branch and start over. I've done this to one > > > > inconsequential branch so far but hopefully someone can suggest a > > > > solution. > > > > > > Can you show an example of how this fails for you (especially the > > > error messages)? > > > > slippy$ git pull -r --all > > Fetching freebsd > > remote: Enumerating objects: 9, done. > > remote: Counting objects: 100% (9/9), done. > > remote: Compressing objects: 100% (9/9), done. > > remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0 > > Unpacking objects: 100% (9/9), 12.42 KiB | 111.00 KiB/s, done. > > From https://git.freebsd.org/src > > 59b3b210a69e..d87ee7b97fe8 stable/13 -> freebsd/stable/13 > > Already up to date. > > slippy$ git co komquats > > Switched to branch 'komquats' > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git rebase main > > error: cannot rebase: You have unstaged changes. > > error: Please commit or stash them. > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ git stash push -m foobar > > Saved working directory and index state On komquats: foobar > > slippy$ git st > > On branch komquats > > Changes not staged for commit: > > (use "git add ..." to update what will be committed) > > (use "git restore ..." to discard changes in working > > directory) modified: contrib/bc/bc.vcxproj > > modified: contrib/bc/bc.vcxproj.filters > > modified: contrib/bc/bcl.vcxproj > > modified: contrib/bc/bcl.vcxproj.filters > > > > Untracked files: > > (use "git add ..." to include in what will be committed) > > sys/i386/conf/IPFILTER > > usr.sbin/ufdformat/ > > > > no changes added to commit (use "git add" and/or "git commit -a") > > slippy$ > > > > rm the files, switch branch to main, rebase again, remove the branch, > > and start over was the only solution. > > > > So far this affected only one branch. My other branches are so far > > unaffected. > > > > As no other branch is affected it appears this was local to this one > > branch. The branch is (was) approximately four months old. Recreating > > it, which wasn't difficult, resolved the issue. > > > > This is the first time I've had any git problems of this nature here > > at FreeBSD. I've (we've) had many at $JOB because of git-lfs, causing > > similar looking issues. But that's a whole different kettle of fish. > > (I'm the only one at $JOB who uses git on a UNIX-like system while > > everyone else uses Visual Studio.) > > > > > > > > > > > > > git restore the files, git rm the files, rm the files, git stash > > > > push, all don't remove them from the branch following rebase. And > > > > subsequent rebase to main will fail. main is ok though. > > > > > > > > What is it that you did to sync the index? > > > > > > Like in the mail thread linked in the git comment, theoretically a > > > noop: > > > > > > git clone https://git@repo.freebsd.org/src.git > > > cd src > > > touch contrib/bc/*vcx* > > > git commit -a > > > git push > > > > > > It's a problem caused by .gitattributes being checked in after the > > > *vcx* files were checked in (again, see the email thread and "man > > > 1 gitattributes"). > > > > > > If it was for me, I would remove the .gitattributes eol specs, they > > > shouldn't be necessary for our purposes. > > > > It's probably growing pains. > > > > It appears only one branch, probably not surprisingly my most used > > branch, was the only one affected. > > > > Hi Cy, > > To add more details and an explanation of what you experienced: > > The bc*vcx* project files were first checked in on April 6th in > 7e5c51e523, containing CRLF line breaks. > > Back then, the attributes were: > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/ contrib/bc/bc.vcxproj > > Now, in 8ea9013512 the .gitattributes file was added, containing: > > *.vcxproj eol=crlf > *.vcxproj.filters eol=crlf > *.sln eol= crlf > > This implicitly changed the the files to being "text": > > $ git ls-files --eol contrib/bc/bc.vcxproj > i/crlf w/crlf attr/text eol=crlf contrib/bc/bc.vcxproj > > But the checked-in files still had CRLF in it (which is incompatible > with being text). > > This introduced problems to the repo as described in > https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html > (basically, as soon as the files are touched, they appear as changed). > > You can find a good description of this general problem here: > https://marc.info/?l=git&m=154484903528621&w=2 > > I'm not sure what a real solution to fix history would look like > - technically I guess that the files should have been renormalized > before committing when .gitattributes was added. > > As a workaround, adding this line to .git/info/attributes works: > contrib/bc/bc*.vcx* -text > > This should allow you to merge your various branches without issues. > > Best > Michael > > p.s. @Cy to demonstrate the original problem, try: > > git checkout a4b5f7ba3e > touch contrib/bc/*vcx* > git status -s > > This shows: > > $ git status -s > M contrib/bc/bc.vcxproj > M contrib/bc/bc.vcxproj.filters > M contrib/bc/bcl.vcxproj > M contrib/bc/bcl.vcxproj.filters > > This might look familiar to you: This is the problem you were seeing > while rebasing - because these files were affected by my commit, the > effect is the same as "touch contrib/bc/*vcx*" had above. > > When applying the workaround: > > echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes > > the problem disappears: > > $ git status > HEAD detached at a4b5f7ba3e9 > nothing to commit, working tree clean > > Note that this is cached, so if you remove the line from > .git/info/attributes, it stays clean until you touch the files again > (can be quite confusing). This recreates the problem (after cloning from a snapshot). slippy$ cd ../29 slippy$ git st Refresh index: 100% (86556/86556), done. On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters modified: etc/mtree/BSD.var.dist modified: sys/dev/bge/if_bge.c modified: sys/dev/bge/if_bgereg.h modified: sys/geom/geom.h modified: sys/geom/geom_int.h modified: sys/geom/geom_kern.c modified: sys/geom/geom_subr.c Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters modified: etc/mtree/BSD.var.dist modified: sys/dev/bge/if_bge.c modified: sys/dev/bge/if_bgereg.h modified: sys/geom/geom.h modified: sys/geom/geom_int.h modified: sys/geom/geom_kern.c modified: sys/geom/geom_subr.c Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git restore contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: etc/mtree/BSD.var.dist modified: sys/dev/bge/if_bge.c modified: sys/dev/bge/if_bgereg.h modified: sys/geom/geom.h modified: sys/geom/geom_int.h modified: sys/geom/geom_kern.c modified: sys/geom/geom_subr.c Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git stash list stash@{0}: On komquats: usermod6 stash@{1}: On main: usermods5 stash@{2}: On komquats: usermods4 stash@{3}: On komquats: usermods3 stash@{4}: On komquats: usermods2 stash@{5}: On komquats: usermods slippy$ git stash push -m _buildsys Saved working directory and index state On komquats: _buildsys slippy$ git br * komquats main slippy$ git co main Switched to branch 'main' Your branch is up to date with 'freebsd/main'. slippy$ git pull -r --all Fetching freebsd remote: Enumerating objects: 35, done. remote: Counting objects: 100% (35/35), done. remote: Total 144 (delta 34), reused 34 (delta 34), pack-reused 109 Receiving objects: 100% (144/144), 99.01 KiB | 450.00 KiB/s, done. Resolving deltas: 100% (86/86), completed with 19 local objects. >From https://git.freebsd.org/src a4b5f7ba3e9b..420d30f5bdbf main -> freebsd/main 1a34afa9541e..aa4eb2089751 stable/13 -> freebsd/stable/13 Updating a4b5f7ba3e9b..420d30f5bdbf Fast-forward contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++------------------ --- contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | 190 +++++++------- release/arm/armv7.conf | 8 + share/man/man9/kasan.9 | 22 +- share/mk/src.libnames.mk | 3 - sys/amd64/amd64/pmap.c | 2 +- sys/dev/ipmi/ipmi_isa.c | 4 + sys/dev/ipmi/ipmi_pci.c | 4 + sys/dev/ipmi/ipmi_smbios.c | 19 +- sys/dev/ipmi/ipmi_smbus.c | 4 + sys/kern/subr_asan.c | 10 +- sys/netpfil/pf/pf_nv.c | 8 +- sys/sys/asan.h | 2 +- 15 files changed, 776 insertions(+), 736 deletions(-) create mode 100644 release/arm/armv7.conf slippy$ git br komquats * main slippy$ git co komquats Switched to branch 'komquats' slippy$ git rebase main error: cannot rebase: You have unstaged changes. error: Please commit or stash them. slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ Going back in time through each daily snapshot, my April 26 0230U snapshot first exhibited the problem. My remediation efforts are below: slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git br * komquats main slippy$ git restore contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git stash push -m borked Saved working directory and index state On komquats: borked slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ rm contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters slippy$ git st On branch komquats Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) deleted: contrib/bc/bc.vcxproj deleted: contrib/bc/bc.vcxproj.filters deleted: contrib/bc/bcl.vcxproj deleted: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git rebase main error: cannot rebase: You have unstaged changes. error: Please commit or stash them. slippy$ There is no way to move forward except to rm (not git rm but UNIX rm) the files. Checkout another branch and blow away the affected branch. With the files physically deleted with rm(1) I could switch branches and blow away the affected branch. Without this extreme I can't even switch branches. Lucky for me this branch was a placeholder maintaining a record of what was installed on my laptop vs main, so it's easy to blow away and recreate. But for people with committed changes to a branch this would be a huge problem. My other branches which I rebase much less frequently were unaffected. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 18:08:06 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8A17B63256C; Thu, 29 Apr 2021 18:08:06 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWNlT5prsz4tr3; Thu, 29 Apr 2021 18:08:05 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id 56110534; Thu, 29 Apr 2021 18:08:03 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id d6d11e6e (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Thu, 29 Apr 2021 18:08:00 +0000 (UTC) Date: Thu, 29 Apr 2021 20:07:40 +0200 From: Michael Gmelin To: Cy Schubert Cc: Michael Gmelin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: <20210429200740.5e8bfe5a@bsd64.grem.de> In-Reply-To: <202104291730.13THUOv6006096@slippy.cwsent.com> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> <202104291730.13THUOv6006096@slippy.cwsent.com> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWNlT5prsz4tr3 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 18:08:06 -0000 On Thu, 29 Apr 2021 10:30:24 -0700 Cy Schubert wrote: > Going back in time through each daily snapshot, my April 26 0230U > snapshot first exhibited the problem. Yes, like I wrote, the problem was introduced in 8ea9013512 (which was on April 26th). If you take your snapshot from - let's say - April 27th, you can also easily demonstrate the problem by doing: cp -a /usr/src /usr/srccopy cd /usr/src/srccopy git status Or by doing: cd /usr/src rm .git/index git reset git status or by doing: cd /usr/src touch contrib/bc/*vcx* git status > > My remediation efforts are below: > >> ... > slippy$ > > > There is no way to move forward except to rm (not git rm but UNIX rm) > the files. Checkout another branch and blow away the affected branch. > With the files physically deleted with rm(1) I could switch branches > and blow away the affected branch. Without this extreme I can't even > switch branches. AFAIK there are two options forward: 1. Simply add the files that are shown as changed on your local branch (that's all my commit did, "git commit -a"). 2. Temporarily do: echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes > > Lucky for me this branch was a placeholder maintaining a record of > what was installed on my laptop vs main, so it's easy to blow away > and recreate. But for people with committed changes to a branch this > would be a huge problem. The two things above should work. > > My other branches which I rebase much less frequently were unaffected. > > AFAIK this only affects branches which happen to contain changes since 8ea9013512. If not, I'm afraid some breaking repo-surgery would be required, going back before 8ea9013512 (just doing a revert patch won't accomplish anything different). -m -- Michael Gmelin From owner-dev-commits-src-main@freebsd.org Thu Apr 29 20:20:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B627363573E; Thu, 29 Apr 2021 20:20:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWRgv1z66z3FSG; Thu, 29 Apr 2021 20:20:10 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id cD8plxAG3WLldcD8qlyuMI; Thu, 29 Apr 2021 14:20:09 -0600 X-Authority-Analysis: v=2.4 cv=H8e4f8Ui c=1 sm=1 tr=0 ts=608b14f9 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=3YhXtTcJ-WEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=IuY_kKPIDeSZ4UYW2gEA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 583F979E; Thu, 29 Apr 2021 13:20:06 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 13TKK6a4010861; Thu, 29 Apr 2021 13:20:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202104292020.13TKK6a4010861@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Gmelin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. In-reply-to: <20210429200740.5e8bfe5a@bsd64.grem.de> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> <202104291730.13THUOv6006096@slippy.cwsent.com> <20210429200740.5e8bfe5a@bsd64.grem.de> Comments: In-reply-to Michael Gmelin message dated "Thu, 29 Apr 2021 20:07:40 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Apr 2021 13:20:06 -0700 X-CMAE-Envelope: MS4xfKVoqjPGoYe/EeHRwt1Xu+dKbLfv3TrD9Y9lgAppLjuB8sCYtXNBuiXNyBFxEwC5gOMnHdaMEcC8qXh/srwS8SYw3SUlOOheKmIIcq4xyvrevffTnBRP rhaci2Yf3EyTW73a5jKweAicLr3ewDP9ItqS0/NV1zoWgBQQAv65j+QfaoswtpzWBv7X+ftzVP5L+u4g2TIq4qsXblqnd9mqw2e75I74S3a2wfHDjywIyuCQ 3vxng4Z1BHUqEeIXXHTI/kA43fZ0JUskhKEgViWuFQNMFIjFQPcrXQNoY8JgPjezhEQSjDl5L6Uy+DrHLhnuYykHZn/2aC1z+/ytN8G2/JY= X-Rspamd-Queue-Id: 4FWRgv1z66z3FSG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 20:20:11 -0000 In message <20210429200740.5e8bfe5a@bsd64.grem.de>, Michael Gmelin writes: > > > On Thu, 29 Apr 2021 10:30:24 -0700 > Cy Schubert wrote: > > > Going back in time through each daily snapshot, my April 26 0230U > > snapshot first exhibited the problem. > > Yes, like I wrote, the problem was introduced in 8ea9013512 (which was > on April 26th). > > If you take your snapshot from - let's say - April 27th, you can also > easily demonstrate the problem by doing: > > cp -a /usr/src /usr/srccopy > cd /usr/src/srccopy > git status No luck with this. > > Or by doing: > > cd /usr/src > rm .git/index > git reset > git status No luck with this either: slippy$ pwd /x/test/29 slippy$ rm .git/index slippy$ git reset Unstaged changes after reset: M contrib/bc/bc.vcxproj M contrib/bc/bc.vcxproj.filters M contrib/bc/bcl.vcxproj M contrib/bc/bcl.vcxproj.filters M etc/mtree/BSD.var.dist M sys/dev/bge/if_bge.c M sys/dev/bge/if_bgereg.h M sys/geom/geom.h M sys/geom/geom_int.h M sys/geom/geom_kern.c M sys/geom/geom_subr.c It took 404.90 seconds to enumerate unstaged changes after reset. You can use '--quiet' to avoid this. Set the config setting reset.quiet to true to make this the default. slippy$ git st Refresh index: 100% (86556/86556), done. On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters modified: etc/mtree/BSD.var.dist modified: sys/dev/bge/if_bge.c modified: sys/dev/bge/if_bgereg.h modified: sys/geom/geom.h modified: sys/geom/geom_int.h modified: sys/geom/geom_kern.c modified: sys/geom/geom_subr.c Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ git stash push -m foobar Saved working directory and index state On komquats: foobar slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ > > or by doing: > > cd /usr/src > touch contrib/bc/*vcx* > git status Same slippy$ touch contrib/bc/*vcx* You have new mail. slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ Next I tried committing the following to the branch: slippy$ git br * komquats main slippy$ git ci contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters hint: Waiting for your editor to close the file... Foobar. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch komquats # Changes to be committed: # modified: contrib/bc/bc.vcxproj # modified: contrib/bc/bc.vcxproj.filters # modified: contrib/bc/bcl.vcxproj # modified: contrib/bc/bcl.vcxproj.filters # # Untracked files: # sys/i386/conf/IPFILTER # usr.sbin/ufdformat/ # ~ ~ ~ ~ ~ ~ ~ ~ /x/test/29/.git/COMMIT_EDITMSG: 15 lines, 425 characters [komquats 1155c1951d3c] Foobar. 4 files changed, 713 insertions(+), 713 deletions(-) slippy$ git co main Switched to branch 'main' Your branch is up to date with 'freebsd/main'. slippy$ git co komquats error: Your local changes to the following files would be overwritten by checkout: contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters Please commit your changes or stash them before you switch branches. Aborting slippy$ git st On branch main Your branch is up to date with 'freebsd/main'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ The only solution is to rm the files, checkout main, blow away the branch and recreate it. And that, only before checking out main or main itself hosed. I already did this, the following this morning. This is more an academic exercise on my part: Rollback snapshot. slippy$ git br * komquats main slippy$ git stash push -m my-work Saved working directory and index state On komquats: my-work slippy$ git st On branch komquats Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ nothing added to commit but untracked files present (use "git add" to track) slippy$ git co main Switched to branch 'main' Your branch is up to date with 'freebsd/main'. slippy$ git st On branch main Your branch is up to date with 'freebsd/main'. Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ nothing added to commit but untracked files present (use "git add" to track) slippy$ git pull -r --all Fetching freebsd remote: Enumerating objects: 35, done. remote: Counting objects: 100% (35/35), done. remote: Total 144 (delta 34), reused 34 (delta 34), pack-reused 109 Receiving objects: 100% (144/144), 99.01 KiB | 355.00 KiB/s, done. Resolving deltas: 100% (86/86), completed with 19 local objects. >From https://git.freebsd.org/src a4b5f7ba3e9b..420d30f5bdbf main -> freebsd/main 1a34afa9541e..aa4eb2089751 stable/13 -> freebsd/stable/13 Updating a4b5f7ba3e9b..420d30f5bdbf Fast-forward contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++------------------ --- contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | 190 +++++++------- release/arm/armv7.conf | 8 + share/man/man9/kasan.9 | 22 +- share/mk/src.libnames.mk | 3 - sys/amd64/amd64/pmap.c | 2 +- sys/dev/ipmi/ipmi_isa.c | 4 + sys/dev/ipmi/ipmi_pci.c | 4 + sys/dev/ipmi/ipmi_smbios.c | 19 +- sys/dev/ipmi/ipmi_smbus.c | 4 + sys/kern/subr_asan.c | 10 +- sys/netpfil/pf/pf_nv.c | 8 +- sys/sys/asan.h | 2 +- 15 files changed, 776 insertions(+), 736 deletions(-) create mode 100644 release/arm/armv7.conf slippy$ git co komquats Switched to branch 'komquats' slippy$ git rebase main error: cannot rebase: You have unstaged changes. error: Please commit or stash them. slippy$ git st On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: contrib/bc/bc.vcxproj modified: contrib/bc/bc.vcxproj.filters modified: contrib/bc/bcl.vcxproj modified: contrib/bc/bcl.vcxproj.filters Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") slippy$ rm contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters slippy$ git co main Switched to branch 'main' Your branch is up to date with 'freebsd/main'. slippy$ git st On branch main Your branch is up to date with 'freebsd/main'. Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ nothing added to commit but untracked files present (use "git add" to track) slippy$ git br -d komquats Deleted branch komquats (was 41ce0e34ea42). slippy$ git co -b komquats Switched to a new branch 'komquats' slippy$ git stash pop On branch komquats Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: etc/mtree/BSD.var.dist modified: sys/dev/bge/if_bge.c modified: sys/dev/bge/if_bgereg.h modified: sys/geom/geom.h modified: sys/geom/geom_int.h modified: sys/geom/geom_kern.c modified: sys/geom/geom_subr.c Untracked files: (use "git add ..." to include in what will be committed) sys/i386/conf/IPFILTER usr.sbin/ufdformat/ no changes added to commit (use "git add" and/or "git commit -a") Dropped refs/stash@{0} (33071593e430eeaa3782d582534c057c968776f6) slippy$ I didn't have any committed work in this branch so recreating the branch from scratch was painless. > > > > > My remediation efforts are below: > > > >> ... > > slippy$ > > > > > > There is no way to move forward except to rm (not git rm but UNIX rm) > > the files. Checkout another branch and blow away the affected branch. > > With the files physically deleted with rm(1) I could switch branches > > and blow away the affected branch. Without this extreme I can't even > > switch branches. > > AFAIK there are two options forward: > > 1. Simply add the files that are shown as changed on your local branch > (that's all my commit did, "git commit -a"). > 2. Temporarily do: > echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes Neither of those worked for me. Again this is purely academic now but looking to understand this should it happen again, with committed work. > > > > > Lucky for me this branch was a placeholder maintaining a record of > > what was installed on my laptop vs main, so it's easy to blow away > > and recreate. But for people with committed changes to a branch this > > would be a huge problem. > > The two things above should work. > > > > > My other branches which I rebase much less frequently were unaffected. > > > > > > AFAIK this only affects branches which happen to contain changes > since 8ea9013512. > > If not, I'm afraid some breaking repo-surgery would be required, going > back before 8ea9013512 (just doing a revert patch won't accomplish > anything different). I've saved the entire zfs filesystem tree in a zfs-send stream for more experimentation later. Hopefully my notes above are of some value to someone. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Thu Apr 29 21:28:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 49129636D6E; Thu, 29 Apr 2021 21:28:34 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWTBn3yD9z3Hq7; Thu, 29 Apr 2021 21:28:32 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id ae6e61b1; Thu, 29 Apr 2021 21:28:30 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id ecdb0dff (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Thu, 29 Apr 2021 21:28:29 +0000 (UTC) Date: Thu, 29 Apr 2021 23:28:09 +0200 From: Michael Gmelin To: Cy Schubert Cc: Michael Gmelin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0358e3d5184 - main - Synch index of contrib/bc with what is in workdir after cloning. Message-ID: <20210429232809.7c78e25b@bsd64.grem.de> In-Reply-To: <202104292020.13TKK6a4010861@slippy.cwsent.com> References: <202104291234.13TCYk5K092776@gitrepo.freebsd.org> <202104291353.13TDrIg3026309@slippy.cwsent.com> <20210429162959.16662d66@bsd64.grem.de> <202104291455.13TEtxEg040285@slippy.cwsent.com> <20210429172122.1751663f@bsd64.grem.de> <202104291730.13THUOv6006096@slippy.cwsent.com> <20210429200740.5e8bfe5a@bsd64.grem.de> <202104292020.13TKK6a4010861@slippy.cwsent.com> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FWTBn3yD9z3Hq7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 21:28:34 -0000 On Thu, 29 Apr 2021 13:20:06 -0700 Cy Schubert wrote: > In message <20210429200740.5e8bfe5a@bsd64.grem.de>, Michael Gmelin > writes: > ... > > also easily demonstrate the problem by doing: > > > > cp -a /usr/src /usr/srccopy > > cd /usr/src/srccopy > > git status > > No luck with this. > > > > > Or by doing: > > > > cd /usr/src > > rm .git/index > > git reset > > git status > > No luck with this either: > > > ... > > > > or by doing: > > > > cd /usr/src > > touch contrib/bc/*vcx* > > git status > > Same slippy$ touch contrib/bc/*vcx* > You have new mail. You might have misread my email. The point of these various tests was to demonstrate how the problem came into the tree and why I committed the changed files today. Hence "demonstrate the problem", not "demonstrate the solution to the problem". > Next I tried committing the following to the branch: > > slippy$ git br > * komquats > main > slippy$ git ci contrib/bc/bc.vcxproj contrib/bc/bc.vcxproj.filters > contrib/bc/bcl.vcxproj contrib/bc/bcl.vcxproj.filters > ... > Switched to branch 'main' > Your branch is up to date with 'freebsd/main'. > ... > slippy$ git co komquats > error: Your local changes to the following files would be overwritten > by checkout: > contrib/bc/bc.vcxproj > contrib/bc/bc.vcxproj.filters > contrib/bc/bcl.vcxproj > contrib/bc/bcl.vcxproj.filters > Please commit your changes or stash them before you switch branches. > Aborting If this was on "main" from today (a0358e3d51849 or later), this shouldn't happen (just tested it myself). If it was main from your ZFS snapshot from a few days ago, then I would expect to see this result. > ... > > > > 1. Simply add the files that are shown as changed on your local > > branch (that's all my commit did, "git commit -a"). > > 2. Temporarily do: > > echo "contrib/bc/bc*.vcx* -text" >>.git/info/attributes > > Neither of those worked for me. Again this is purely academic now but > looking to understand this should it happen again, with committed > work. I tested 2. again locally and it works for me. > > I've saved the entire zfs filesystem tree in a zfs-send stream for > more experimentation later. Hopefully my notes above are of some > value to someone. > Any chance you could share that ZFS stream with me? I would like to reproduce your results. Best Michael -- Michael Gmelin From owner-dev-commits-src-main@freebsd.org Fri Apr 30 07:57:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B5D575F4032; Fri, 30 Apr 2021 07:57: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 4FWl803gGjz4Sx0; Fri, 30 Apr 2021 07:57: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 702B2287BB; Fri, 30 Apr 2021 07:57: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 13U7v4Si020886; Fri, 30 Apr 2021 07:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U7v4Yk020885; Fri, 30 Apr 2021 07:57:04 GMT (envelope-from git) Date: Fri, 30 Apr 2021 07:57:04 GMT Message-Id: <202104300757.13U7v4Yk020885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 9de7354bb8e0 - main - sctp: improve consistency in handling chunks with wrong size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9de7354bb8e0c7821aa90db3486605f933c6796d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 07:57:04 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9de7354bb8e0c7821aa90db3486605f933c6796d commit 9de7354bb8e0c7821aa90db3486605f933c6796d Author: Michael Tuexen AuthorDate: 2021-04-28 16:09:11 +0000 Commit: Michael Tuexen CommitDate: 2021-04-28 16:11:06 +0000 sctp: improve consistency in handling chunks with wrong size Just skip the chunk, if no other handling is required by the specification. --- sys/netinet/sctp_input.c | 150 +++++++++++++++++++++++------------------------ 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 51041ed67c58..0790e6f4d2db 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4294,6 +4294,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, int ret; int abort_no_unlock = 0; int ecne_seen = 0; + int abort_flag; /* * How big should this be, and should it be alloc'd? Lets try the @@ -4773,8 +4774,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT_ACK\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ - *offset = length; - return (stcb); + break; } SCTP_STAT_INCR(sctps_recvheartbeatack); if ((netp != NULL) && (*netp != NULL)) { @@ -4800,12 +4800,10 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { - *offset = length; - return (stcb); + break; } if ((netp != NULL) && (*netp != NULL)) { - int abort_flag = 0; - + abort_flag = 0; sctp_handle_shutdown((struct sctp_shutdown_chunk *)ch, stcb, *netp, &abort_flag); if (abort_flag) { @@ -4956,7 +4954,7 @@ process_control_chunks: case SCTP_COOKIE_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE_ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { - return (stcb); + break; } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4975,26 +4973,29 @@ process_control_chunks: break; case SCTP_ECN_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_ECHO\n"); - if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { - /* Its not ours */ - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.ecn_supported == 0) { goto unknown_chunk; } + if (chk_length != sizeof(struct sctp_ecne_chunk)) { + break; + } sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); ecne_seen = 1; break; case SCTP_ECN_CWR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_CWR\n"); - if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.ecn_supported == 0) { goto unknown_chunk; } + if (chk_length != sizeof(struct sctp_cwr_chunk)) { + break; + } sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); break; case SCTP_SHUTDOWN_COMPLETE: @@ -5025,15 +5026,16 @@ process_control_chunks: break; case SCTP_ASCONF_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF_ACK\n"); + if (stcb == NULL) { + break; + } + if (stcb->asoc.asconf_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { - if (stcb->asoc.asconf_supported == 0) { - goto unknown_chunk; - } + if ((netp != NULL) && (*netp != NULL)) { /* He's alive so give him credit */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -5053,61 +5055,58 @@ process_control_chunks: case SCTP_IFORWARD_CUM_TSN: SCTPDBG(SCTP_DEBUG_INPUT3, "%s\n", ch->chunk_type == SCTP_FORWARD_CUM_TSN ? "FORWARD_TSN" : "I_FORWARD_TSN"); + if (stcb == NULL) { + break; + } + if (stcb->asoc.prsctp_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - - if (stcb != NULL) { - int abort_flag = 0; - - if (stcb->asoc.prsctp_supported == 0) { - goto unknown_chunk; - } - if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) || - ((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) { - if (ch->chunk_type == SCTP_FORWARD_CUM_TSN) { - SCTP_SNPRINTF(msg, sizeof(msg), "%s", "FORWARD-TSN chunk received when I-FORWARD-TSN was negotiated"); - } else { - SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-FORWARD-TSN chunk received when FORWARD-TSN was negotiated"); - } - op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); - *offset = length; - return (NULL); - } - *fwd_tsn_seen = 1; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, - SCTP_FROM_SCTP_INPUT + SCTP_LOC_31); - *offset = length; - return (NULL); - } - /* - * For sending a SACK this looks like DATA - * chunks. - */ - stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; - sctp_handle_forward_tsn(stcb, - (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); - if (abort_flag) { - *offset = length; - return (NULL); + if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) || + ((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) { + if (ch->chunk_type == SCTP_FORWARD_CUM_TSN) { + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "FORWARD-TSN chunk received when I-FORWARD-TSN was negotiated"); + } else { + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-FORWARD-TSN chunk received when FORWARD-TSN was negotiated"); } + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); + *offset = length; + return (NULL); + } + *fwd_tsn_seen = 1; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { + /* We are not interested anymore */ + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, + SCTP_FROM_SCTP_INPUT + SCTP_LOC_31); + *offset = length; + return (NULL); + } + /* + * For sending a SACK this looks like DATA chunks. + */ + stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; + abort_flag = 0; + sctp_handle_forward_tsn(stcb, + (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); + if (abort_flag) { + *offset = length; + return (NULL); } break; case SCTP_STREAM_RESET: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_STREAM_RESET\n"); - if ((stcb == NULL) || (chk_length < sizeof(struct sctp_stream_reset_tsn_req))) { - /* Its not ours */ - *offset = length; - return (stcb); + if (stcb == NULL) { + break; } if (stcb->asoc.reconfig_supported == 0) { goto unknown_chunk; } + if (chk_length < sizeof(struct sctp_stream_reset_tsn_req)) { + break; + } if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ *offset = length; @@ -5116,17 +5115,16 @@ process_control_chunks: break; case SCTP_PACKET_DROPPED: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_PACKET_DROPPED\n"); - /* re-get it all please */ + if (stcb == NULL) { + break; + } + if (stcb->asoc.pktdrop_supported == 0) { + goto unknown_chunk; + } if (chk_length < sizeof(struct sctp_pktdrop_chunk)) { - /* Its not ours */ - *offset = length; - return (stcb); + break; } - - if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { - if (stcb->asoc.pktdrop_supported == 0) { - goto unknown_chunk; - } + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, min(chk_length, contiguous)); @@ -5142,7 +5140,7 @@ process_control_chunks: auth_skipped = 1; } /* skip this chunk (temporarily) */ - goto next_chunk; + break; } if (stcb->asoc.auth_supported == 0) { goto unknown_chunk; @@ -5156,7 +5154,7 @@ process_control_chunks: } if (got_auth == 1) { /* skip this chunk... it's already auth'd */ - goto next_chunk; + break; } got_auth = 1; if (sctp_handle_auth(stcb, (struct sctp_auth_chunk *)ch, m, *offset)) { From owner-dev-commits-src-main@freebsd.org Fri Apr 30 08:12:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 613455F5097; Fri, 30 Apr 2021 08:12: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 4FWlTx2Jxjz4TsK; Fri, 30 Apr 2021 08:12: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 426A828CB5; Fri, 30 Apr 2021 08:12: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 13U8CbVo047702; Fri, 30 Apr 2021 08:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U8Cba1047701; Fri, 30 Apr 2021 08:12:37 GMT (envelope-from git) Date: Fri, 30 Apr 2021 08:12:37 GMT Message-Id: <202104300812.13U8Cba1047701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: eecdf5220b1a - main - sctp: use RTO.Initial of 1 second as specified in RFC 4960bis MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eecdf5220b1a559e4b58c3c21daf502e3fbfd1cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 08:12:37 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eecdf5220b1a559e4b58c3c21daf502e3fbfd1cd commit eecdf5220b1a559e4b58c3c21daf502e3fbfd1cd Author: Michael Tuexen AuthorDate: 2021-04-29 22:45:56 +0000 Commit: Michael Tuexen CommitDate: 2021-04-29 22:45:56 +0000 sctp: use RTO.Initial of 1 second as specified in RFC 4960bis --- sys/netinet/sctp_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index 28c543f88045..197b93791944 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -596,7 +596,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ #define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec is ms */ -#define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ +#define SCTP_RTO_INITIAL (1000) /* 1 sec in ms */ #define SCTP_INP_KILL_TIMEOUT 20 /* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ From owner-dev-commits-src-main@freebsd.org Fri Apr 30 08:45:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A4AA05F692A; Fri, 30 Apr 2021 08:45: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 4FWmDG4GLNz4WWN; Fri, 30 Apr 2021 08:45: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 850AF2933F; Fri, 30 Apr 2021 08:45: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 13U8joUq087340; Fri, 30 Apr 2021 08:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U8joDK087339; Fri, 30 Apr 2021 08:45:50 GMT (envelope-from git) Date: Fri, 30 Apr 2021 08:45:50 GMT Message-Id: <202104300845.13U8joDK087339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 055c55abefbe - main - pf: Fix IP checksum on reassembly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 055c55abefbe19fe46a56894595af9c9dad7678c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 08:45:50 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=055c55abefbe19fe46a56894595af9c9dad7678c commit 055c55abefbe19fe46a56894595af9c9dad7678c Author: Kristof Provost AuthorDate: 2021-04-28 10:56:06 +0000 Commit: Kristof Provost CommitDate: 2021-04-30 06:19:46 +0000 pf: Fix IP checksum on reassembly If we reassemble a packet we modify the IP header (to set the length and remove the fragment offset information), but we failed to update the checksum. On certain setups (mostly where we did not re-fragment again afterwards) this could lead to us sending out packets with incorrect checksums. PR: 255432 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30026 --- sys/netpfil/pf/pf_norm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index d7310c7bccb4..6de1efa8ff84 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -794,7 +794,11 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) } ip = mtod(m, struct ip *); + ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_len, + htons(hdrlen + total), 0); ip->ip_len = htons(hdrlen + total); + ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_off, + ip->ip_off & ~(IP_MF|IP_OFFMASK), 0); ip->ip_off &= ~(IP_MF|IP_OFFMASK); if (hdrlen + total > IP_MAXPACKET) { From owner-dev-commits-src-main@freebsd.org Fri Apr 30 08:45:51 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D3F615F67BB; Fri, 30 Apr 2021 08:45: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 4FWmDH5Ww9z4WWQ; Fri, 30 Apr 2021 08:45: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 B119A295B7; Fri, 30 Apr 2021 08:45: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 13U8jpQG087362; Fri, 30 Apr 2021 08:45:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U8jplY087361; Fri, 30 Apr 2021 08:45:51 GMT (envelope-from git) Date: Fri, 30 Apr 2021 08:45:51 GMT Message-Id: <202104300845.13U8jplY087361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 388c0cde1029 - main - pf tests: Test scrub fragment reassemble on interfaces with different MTU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 388c0cde10293d9a3434e99146bf391aec6878a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 08:45:52 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=388c0cde10293d9a3434e99146bf391aec6878a3 commit 388c0cde10293d9a3434e99146bf391aec6878a3 Author: Kristof Provost AuthorDate: 2021-04-27 16:46:03 +0000 Commit: Kristof Provost CommitDate: 2021-04-30 06:19:47 +0000 pf tests: Test scrub fragment reassemble on interfaces with different MTU There's a problem with pf's reassembly code where it produces incorrect checksums when reassembling across interfaces with different MTUs. Test this. PR: 255432 Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30013 --- tests/sys/netpfil/pf/fragmentation.sh | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index e697281b0826..8b57bcf11487 100644 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -141,8 +141,57 @@ v6_cleanup() pft_cleanup } +atf_test_case "mtu_diff" "cleanup" +mtu_diff_head() +{ + atf_set descr 'Test reassembly across different MTUs, PR #255432' + atf_set require.user root +} + +mtu_diff_body() +{ + pft_init + + epair_small=$(vnet_mkepair) + epair_large=$(vnet_mkepair) + + vnet_mkjail first ${epair_small}b ${epair_large}a + vnet_mkjail second ${epair_large}b + + ifconfig ${epair_small}a 192.0.2.1/25 up + jexec first ifconfig ${epair_small}b 192.0.2.2/25 up + + jexec first sysctl net.inet.ip.forwarding=1 + jexec first ifconfig ${epair_large}a 192.0.2.130/25 up + jexec first ifconfig ${epair_large}a mtu 9000 + jexec second ifconfig ${epair_large}b 192.0.2.131/25 up + jexec second ifconfig ${epair_large}b mtu 9000 + jexec second route add default 192.0.2.130 + + route add 192.0.2.128/25 192.0.2.2 + + jexec first pfctl -e + pft_set_rules first \ + "scrub all fragment reassemble" + + # Sanity checks + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.130 + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.131 + + # Large packet that'll get reassembled and sent out in one on the large + # epair + atf_check -s exit:0 -o ignore ping -c 1 -s 8000 192.0.2.131 +} + +mtu_diff_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" atf_add_test_case "v6" + atf_add_test_case "mtu_diff" } From owner-dev-commits-src-main@freebsd.org Fri Apr 30 10:45:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 61AF05FA6B1; Fri, 30 Apr 2021 10:45: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 4FWptK2KHDz4dWp; Fri, 30 Apr 2021 10:45: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 37A902AAF0; Fri, 30 Apr 2021 10:45: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 13UAjTn6045868; Fri, 30 Apr 2021 10:45:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UAjTtT045867; Fri, 30 Apr 2021 10:45:29 GMT (envelope-from git) Date: Fri, 30 Apr 2021 10:45:29 GMT Message-Id: <202104301045.13UAjTtT045867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: eb79855920ff - main - sctp: fix SCTP_PEER_ADDR_PARAMS socket option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb79855920ffa33d6c096221eac9cc9a6d7a484b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 10:45:29 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eb79855920ffa33d6c096221eac9cc9a6d7a484b commit eb79855920ffa33d6c096221eac9cc9a6d7a484b Author: Michael Tuexen AuthorDate: 2021-04-30 10:27:47 +0000 Commit: Michael Tuexen CommitDate: 2021-04-30 10:31:09 +0000 sctp: fix SCTP_PEER_ADDR_PARAMS socket option Ignore spp_pathmtu if it is 0, when setting the IPPROTO_SCTP level socket option SCTP_PEER_ADDR_PARAMS as required by RFC 6458. MFC after: 1 week --- sys/netinet/sctp_usrreq.c | 72 ++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 049368c91b56..49cc6f22cc5a 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -5327,6 +5327,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, return (EINVAL); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && + (paddrp->spp_pathmtu > 0) && ((paddrp->spp_pathmtu < SCTP_SMALLEST_PMTU) || (paddrp->spp_pathmtu > SCTP_LARGEST_PMTU))) { if (stcb) @@ -5371,23 +5372,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_11); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - net->mtu = paddrp->spp_pathmtu; - switch (net->ro._l_addr.sa.sa_family) { + if (paddrp->spp_pathmtu > 0) { + net->mtu = paddrp->spp_pathmtu; + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: - net->mtu += SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; #endif #ifdef INET6 - case AF_INET6: - net->mtu += SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; #endif - default: - break; - } - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); + default: + break; + } + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } } } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -5396,7 +5399,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt > 0) { if (net->dest_state & SCTP_ADDR_PF) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_PF; @@ -5439,7 +5442,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, #endif } else { /************************ASSOC ONLY -- NO NET SPECIFIC SET ******************/ - if (paddrp->spp_pathmaxrxt != 0) { + if (paddrp->spp_pathmaxrxt > 0) { stcb->asoc.def_net_failure = paddrp->spp_pathmaxrxt; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->dest_state & SCTP_ADDR_PF) { @@ -5471,7 +5474,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, net->failure_threshold = paddrp->spp_pathmaxrxt; } } - if (paddrp->spp_flags & SPP_HB_ENABLE) { if (paddrp->spp_hbinterval != 0) { stcb->asoc.heart_beat_delay = paddrp->spp_hbinterval; @@ -5514,26 +5516,30 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_16); } net->dest_state |= SCTP_ADDR_NO_PMTUD; - net->mtu = paddrp->spp_pathmtu; - switch (net->ro._l_addr.sa.sa_family) { + if (paddrp->spp_pathmtu > 0) { + net->mtu = paddrp->spp_pathmtu; + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: - net->mtu += SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; #endif #ifdef INET6 - case AF_INET6: - net->mtu += SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; #endif - default: - break; - } - if (net->mtu < stcb->asoc.smallest_mtu) { - sctp_pathmtu_adjustment(stcb, net->mtu); + default: + break; + } + if (net->mtu < stcb->asoc.smallest_mtu) { + sctp_pathmtu_adjustment(stcb, net->mtu); + } } } - stcb->asoc.default_mtu = paddrp->spp_pathmtu; + if (paddrp->spp_pathmtu > 0) { + stcb->asoc.default_mtu = paddrp->spp_pathmtu; + } sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -5580,7 +5586,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, * set it with the options on the * socket */ - if (paddrp->spp_pathmaxrxt != 0) { + if (paddrp->spp_pathmaxrxt > 0) { inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt; } @@ -5606,7 +5612,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, inp->sctp_ep.default_mtu = 0; sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } else if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { - inp->sctp_ep.default_mtu = paddrp->spp_pathmtu; + if (paddrp->spp_pathmtu > 0) { + inp->sctp_ep.default_mtu = paddrp->spp_pathmtu; + } sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { From owner-dev-commits-src-main@freebsd.org Fri Apr 30 10:46:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 92F2D5FA3E2; Fri, 30 Apr 2021 10:46: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 4FWpvW3p1Tz4dcy; Fri, 30 Apr 2021 10:46: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 754F42AAF1; Fri, 30 Apr 2021 10:46: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 13UAkVCw046078; Fri, 30 Apr 2021 10:46:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UAkVt0046077; Fri, 30 Apr 2021 10:46:31 GMT (envelope-from git) Date: Fri, 30 Apr 2021 10:46:31 GMT Message-Id: <202104301046.13UAkVt0046077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: cd945dc08a86 - main - iflib: Take iri_pad into account when processing small frames MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd945dc08a86a0cfd1637335de04e4c4c5bf70d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 10:46:31 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=cd945dc08a86a0cfd1637335de04e4c4c5bf70d9 commit cd945dc08a86a0cfd1637335de04e4c4c5bf70d9 Author: Marcin Wojtas AuthorDate: 2021-04-27 09:00:15 +0000 Commit: Marcin Wojtas CommitDate: 2021-04-30 10:46:17 +0000 iflib: Take iri_pad into account when processing small frames Drivers can specify padding of received frames with iri_pad field. This can be used to enforce ip alignment by hardware. Iflib ignored that padding when processing small frames, which rendered this feature inoperable. I found it while writing a driver for a NIC that can ip align received packets. Note that this doesn't change behavior of existing drivers as they all set iri_pad to 0. Submitted by: Kornel Duleba Reviewed by: gallatin Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30009 --- sys/net/iflib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index faf58917c96b..01da882f0d12 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2827,11 +2827,13 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) if (pf_rv == PFIL_PASS) { m_init(m, M_NOWAIT, MT_DATA, M_PKTHDR); #ifndef __NO_STRICT_ALIGNMENT - if (!IP_ALIGNED(m)) + if (!IP_ALIGNED(m) && ri->iri_pad == 0) m->m_data += 2; #endif memcpy(m->m_data, *sd.ifsd_cl, ri->iri_len); m->m_len = ri->iri_frags[0].irf_len; + m->m_data += ri->iri_pad; + ri->iri_len -= ri->iri_pad; } } else { m = assemble_segments(rxq, ri, &sd, &pf_rv); From owner-dev-commits-src-main@freebsd.org Fri Apr 30 11:33:25 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D6D3B5FB6AB; Fri, 30 Apr 2021 11:33: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 4FWqxd5jldz4g2H; Fri, 30 Apr 2021 11:33: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 B68FD2B876; Fri, 30 Apr 2021 11:33: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 13UBXPDv011837; Fri, 30 Apr 2021 11:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UBXPQF011836; Fri, 30 Apr 2021 11:33:25 GMT (envelope-from git) Date: Fri, 30 Apr 2021 11:33:25 GMT Message-Id: <202104301133.13UBXPQF011836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e010d20032c8 - main - sctp: update the vtag for INIT and INIT-ACK chunks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e010d20032c8c2a04da103b3402a8d24bd682dd5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 11:33:25 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e010d20032c8c2a04da103b3402a8d24bd682dd5 commit e010d20032c8c2a04da103b3402a8d24bd682dd5 Author: Michael Tuexen AuthorDate: 2021-04-30 11:31:38 +0000 Commit: Michael Tuexen CommitDate: 2021-04-30 11:33:16 +0000 sctp: update the vtag for INIT and INIT-ACK chunks This is needed in case of responding with an ABORT to an INIT-ACK. --- sys/netinet/sctputil.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 5d4b3347a2c9..2c10ab158c83 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4553,7 +4553,7 @@ sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, * if there is return 1, else return 0. */ int -sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill) +sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtag) { struct sctp_chunkhdr *ch; struct sctp_init_chunk *init_chk, chunk_buf; @@ -4574,12 +4574,13 @@ sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill) /* yep, tell them */ return (1); } - if (ch->chunk_type == SCTP_INITIATION) { + if ((ch->chunk_type == SCTP_INITIATION) || + (ch->chunk_type == SCTP_INITIATION_ACK)) { /* need to update the Vtag */ init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - offset, sizeof(*init_chk), (uint8_t *)&chunk_buf); + offset, sizeof(struct sctp_init_chunk), (uint8_t *)&chunk_buf); if (init_chk != NULL) { - *vtagfill = ntohl(init_chk->init.initiate_tag); + *vtag = ntohl(init_chk->init.initiate_tag); } } /* Nope, move to the next chunk */ From owner-dev-commits-src-main@freebsd.org Fri Apr 30 13:29:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F19765FEA09; Fri, 30 Apr 2021 13:29: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 4FWtWb5HB7z4lcW; Fri, 30 Apr 2021 13:29: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 A39662CF12; Fri, 30 Apr 2021 13:29: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 13UDTVpj058707; Fri, 30 Apr 2021 13:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UDTV6G058706; Fri, 30 Apr 2021 13:29:31 GMT (envelope-from git) Date: Fri, 30 Apr 2021 13:29:31 GMT Message-Id: <202104301329.13UDTV6G058706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Oskar Holmlund Subject: git: 7b88cd8bbf37 - main - Add myself(oh) as src committer and mentor(manu). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b88cd8bbf37e8c9c1d76e250ab263cabbb12391 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 13:29:32 -0000 The branch main has been updated by oh: URL: https://cgit.FreeBSD.org/src/commit/?id=7b88cd8bbf37e8c9c1d76e250ab263cabbb12391 commit 7b88cd8bbf37e8c9c1d76e250ab263cabbb12391 Author: Oskar Holmlund AuthorDate: 2021-04-30 12:49:20 +0000 Commit: Oskar Holmlund CommitDate: 2021-04-30 14:03:27 +0000 Add myself(oh) as src committer and mentor(manu). Step 7.1.5 in committers guide. Reviewed by: manu Approved by: manu (mentor) Differential Revision: https://reviews.freebsd.org/D29890 --- share/misc/committers-src.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index ba9df7968c53..fcb6f6b800dd 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -283,6 +283,7 @@ np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] n_hibma [label="Nick Hibma\nn_hibma@FreeBSD.org\n1998/11/26"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] +oh [label="Oskar Holmlund\noh@FreeBSD.org\n2021/04/21"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] oshogbo [label="Mariusz Zaborski\noshogbo@FreeBSD.org\n2015/04/15"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] @@ -714,6 +715,8 @@ kp -> nick lwhsu -> khng +manu -> oh + marcel -> allanjude marcel -> art marcel -> arun From owner-dev-commits-src-main@freebsd.org Fri Apr 30 14:45:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AF68962142D; Fri, 30 Apr 2021 14:45: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 4FWwCP4cTyz4q2J; Fri, 30 Apr 2021 14:45: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 8CC6C2DD43; Fri, 30 Apr 2021 14:45: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 13UEjbD8065860; Fri, 30 Apr 2021 14:45:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UEjb0d065859; Fri, 30 Apr 2021 14:45:37 GMT (envelope-from git) Date: Fri, 30 Apr 2021 14:45:37 GMT Message-Id: <202104301445.13UEjb0d065859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 21fc6a2a10cf - main - amd64: invalidate TLB between page table update and access 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/main X-Git-Reftype: branch X-Git-Commit: 21fc6a2a10cf6fbd294decbb0001473693ec1618 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:45:37 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21fc6a2a10cf6fbd294decbb0001473693ec1618 commit 21fc6a2a10cf6fbd294decbb0001473693ec1618 Author: Konstantin Belousov AuthorDate: 2021-04-16 18:28:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-30 14:43:45 +0000 amd64: invalidate TLB between page table update and access When setting up trampoline mapping for LA57 switcher, it is possible that TLB still has some random mapping at that address. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 66617bffa8df..5a6a1cee8b8c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2168,6 +2168,7 @@ pmap_bootstrap_la57(void *arg __unused) *(u_long *)(v_code + 2 + (la57_trampoline_gdt_desc - la57_trampoline)) = la57_trampoline_gdt - la57_trampoline + VM_PAGE_TO_PHYS(m_code); la57_tramp = (void (*)(uint64_t))VM_PAGE_TO_PHYS(m_code); + invlpg((vm_offset_t)la57_tramp); la57_tramp(KPML5phys); /* From owner-dev-commits-src-main@freebsd.org Fri Apr 30 14:45:40 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2A78462148E; Fri, 30 Apr 2021 14:45: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 4FWwCS0bhTz4pys; Fri, 30 Apr 2021 14:45: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 C15892DB7A; Fri, 30 Apr 2021 14:45: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 13UEjdkd065909; Fri, 30 Apr 2021 14:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UEjdh6065908; Fri, 30 Apr 2021 14:45:39 GMT (envelope-from git) Date: Fri, 30 Apr 2021 14:45:39 GMT Message-Id: <202104301445.13UEjdh6065908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 208256579804 - main - O_PATH: disable kqfilter for fifos 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/main X-Git-Reftype: branch X-Git-Commit: 2082565798041ceb9fb77137f00ea6b0ff50fe5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:45:40 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2082565798041ceb9fb77137f00ea6b0ff50fe5e commit 2082565798041ceb9fb77137f00ea6b0ff50fe5e Author: Konstantin Belousov AuthorDate: 2021-04-28 15:45:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-30 14:43:45 +0000 O_PATH: disable kqfilter for fifos Filter on fifos is real filter for the object, and not a filesystem events filter like EVFILT_VNODE. Reported by: markj using syzkaller Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/vfs_vnops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f715c9828d04..832c717a33b7 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -427,7 +427,10 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, return (error); } if ((fmode & O_PATH) != 0) { - error = VOP_ACCESS(vp, VREAD, cred, td); + if (vp->v_type == VFIFO) + error = EPIPE; + else + error = VOP_ACCESS(vp, VREAD, cred, td); if (error == 0) fp->f_flag |= FKQALLOWED; return (0); From owner-dev-commits-src-main@freebsd.org Fri Apr 30 14:45:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C08FF62148D; Fri, 30 Apr 2021 14:45: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 4FWwCQ4yhyz4pft; Fri, 30 Apr 2021 14:45: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 9BCC52DD44; Fri, 30 Apr 2021 14:45: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 13UEjcRa065888; Fri, 30 Apr 2021 14:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UEjcgg065887; Fri, 30 Apr 2021 14:45:38 GMT (envelope-from git) Date: Fri, 30 Apr 2021 14:45:38 GMT Message-Id: <202104301445.13UEjcgg065887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 72a42ec63b4a - main - amd64: disable LA57 by default for now 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/main X-Git-Reftype: branch X-Git-Commit: 72a42ec63b4a98f812f5f6164415eeb9a55e1933 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:45:38 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72a42ec63b4a98f812f5f6164415eeb9a55e1933 commit 72a42ec63b4a98f812f5f6164415eeb9a55e1933 Author: Konstantin Belousov AuthorDate: 2021-04-28 15:50:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-30 14:43:45 +0000 amd64: disable LA57 by default for now A testing on the real hardware uncovered an issue, and since I do not have access to the machine, disable until the bug can be fixed. Reported by: "Pieper, Jeffrey E" Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/amd64/amd64/pmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 5a6a1cee8b8c..a4046cc1f687 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2080,8 +2080,7 @@ pmap_bootstrap_la57(void *arg __unused) if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) return; - if (!TUNABLE_INT_FETCH("vm.pmap.la57", &la57)) - la57 = 1; + TUNABLE_INT_FETCH("vm.pmap.la57", &la57); if (!la57) return; From owner-dev-commits-src-main@freebsd.org Fri Apr 30 14:45:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 52F13621711; Fri, 30 Apr 2021 14: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 4FWwCV1Qvkz4pg8; Fri, 30 Apr 2021 14: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 191CD2DD45; Fri, 30 Apr 2021 14: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 13UEjfVZ065951; Fri, 30 Apr 2021 14:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UEjfb5065950; Fri, 30 Apr 2021 14:45:41 GMT (envelope-from git) Date: Fri, 30 Apr 2021 14:45:41 GMT Message-Id: <202104301445.13UEjfb5065950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 619fe0958612 - main - ioccom: define ioctl cmd value that can never be valid 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/main X-Git-Reftype: branch X-Git-Commit: 619fe095861274576a2cb45628076968051b1585 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:45:42 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=619fe095861274576a2cb45628076968051b1585 commit 619fe095861274576a2cb45628076968051b1585 Author: Konstantin Belousov AuthorDate: 2021-04-22 19:40:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-30 14:43:45 +0000 ioccom: define ioctl cmd value that can never be valid Its use is for cases where some filler is needed for cmd, or we need an indication that there were no cmd supplied, and so on. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29935 --- sys/sys/ioccom.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/ioccom.h b/sys/sys/ioccom.h index 0329ac358491..13faba046719 100644 --- a/sys/sys/ioccom.h +++ b/sys/sys/ioccom.h @@ -79,6 +79,9 @@ #define IOCPARM_IVAL(x) ((int)(intptr_t)(void *)*(caddr_t *)(void *)(x)) #endif +#define _IOC_INVALID (_IOC_VOID|_IOC_INOUT) /* Never valid cmd value, + use as filler */ + #else #include From owner-dev-commits-src-main@freebsd.org Fri Apr 30 14:45:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 53814621702; Fri, 30 Apr 2021 14:45: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 4FWwCT05Lqz4pvZ; Fri, 30 Apr 2021 14:45: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 E8C192DDC9; Fri, 30 Apr 2021 14:45: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 13UEjeG2065930; Fri, 30 Apr 2021 14:45:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UEjexP065929; Fri, 30 Apr 2021 14:45:40 GMT (envelope-from git) Date: Fri, 30 Apr 2021 14:45:40 GMT Message-Id: <202104301445.13UEjexP065929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 07f229d20c0c - main - connectat(2): clarify that the s argument is socket 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/main X-Git-Reftype: branch X-Git-Commit: 07f229d20c0cd6285c5ddf1df45eb69bbea4445b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:45:41 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=07f229d20c0cd6285c5ddf1df45eb69bbea4445b commit 07f229d20c0cd6285c5ddf1df45eb69bbea4445b Author: Konstantin Belousov AuthorDate: 2021-04-28 15:47:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-30 14:43:45 +0000 connectat(2): clarify that the s argument is socket Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libc/sys/connectat.2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/connectat.2 b/lib/libc/sys/connectat.2 index 1d7e740b89c4..3b90baa0b6f2 100644 --- a/lib/libc/sys/connectat.2 +++ b/lib/libc/sys/connectat.2 @@ -45,7 +45,8 @@ .Sh DESCRIPTION The .Fn connectat -system call initiates a connection on a socket. +system call initiates a connection on the socket +.Fa s . When passed the special value .Dv AT_FDCWD in the From owner-dev-commits-src-main@freebsd.org Fri Apr 30 18:13:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5BDC2625FC5; Fri, 30 Apr 2021 18:13:14 +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 4FX0py22jrz3GcK; Fri, 30 Apr 2021 18:13:14 +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 38C6ECA9; Fri, 30 Apr 2021 18:13: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 13UIDEPw045926; Fri, 30 Apr 2021 18:13:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UIDE1e045925; Fri, 30 Apr 2021 18:13:14 GMT (envelope-from git) Date: Fri, 30 Apr 2021 18:13:14 GMT Message-Id: <202104301813.13UIDE1e045925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: eda28feb2e07 - main - EFI secure boot VECTX related changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eda28feb2e070e21db3d50b3fc177f88380b8fb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 18:13:14 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=eda28feb2e070e21db3d50b3fc177f88380b8fb4 commit eda28feb2e070e21db3d50b3fc177f88380b8fb4 Author: Eric van Gyzen AuthorDate: 2021-04-30 17:53:45 +0000 Commit: Eric van Gyzen CommitDate: 2021-04-30 17:53:45 +0000 EFI secure boot VECTX related changes When VECTX is enabled as a kernel option and non-EFI loaders are built, many reads will fail due to the mis-match of whether LOADER_VERIEXEC_VECTX or not in readin.h. Source that includes bootstrap.h must ensure the kernel option agrees with the compile time CFLAGS in the various make related files. Submitted by: bret_ketchum@dell.com (original revision) Reviewed by: sjg, bdrewery, dab, bret_ketchum@dell.com MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29993 --- stand/efi/boot1/Makefile | 2 ++ stand/efi/fdt/Makefile | 2 ++ stand/efi/libefi/Makefile | 2 ++ stand/fdt/Makefile | 2 ++ stand/ficl.mk | 4 +--- stand/i386/libfirewire/Makefile | 2 ++ stand/i386/libi386/Makefile | 2 ++ stand/liblua/Makefile | 5 ++--- stand/loader.mk | 11 +---------- stand/veriexec.mk | 9 +++++++++ 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/stand/efi/boot1/Makefile b/stand/efi/boot1/Makefile index 39dc4f8e70ad..af03e395b2a5 100644 --- a/stand/efi/boot1/Makefile +++ b/stand/efi/boot1/Makefile @@ -53,6 +53,8 @@ CFLAGS+= -DEFI_UFS_BOOT CFLAGS+= -DEFI_DEBUG .endif +.include "${BOOTSRC}/veriexec.mk" + # Always add MI sources and REGULAR efi loader bits .PATH: ${EFISRC}/loader/arch/${MACHINE} .PATH: ${EFISRC}/loader diff --git a/stand/efi/fdt/Makefile b/stand/efi/fdt/Makefile index 8166f481dc99..7f69ce1b3f11 100644 --- a/stand/efi/fdt/Makefile +++ b/stand/efi/fdt/Makefile @@ -9,6 +9,8 @@ WARNS?= 6 SRCS= efi_fdt.c +.include "${BOOTSRC}/veriexec.mk" + # EFI library headers CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} diff --git a/stand/efi/libefi/Makefile b/stand/efi/libefi/Makefile index e838a5a10ac4..99b31338a75d 100644 --- a/stand/efi/libefi/Makefile +++ b/stand/efi/libefi/Makefile @@ -67,4 +67,6 @@ CFLAGS+= ${FORMAT_EXTENSIONS} CFLAGS+= -DTERM_EMU +.include "${BOOTSRC}/veriexec.mk" + .include diff --git a/stand/fdt/Makefile b/stand/fdt/Makefile index 3eee143a9433..e0fd2dbb4e8d 100644 --- a/stand/fdt/Makefile +++ b/stand/fdt/Makefile @@ -17,4 +17,6 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall +.include "${BOOTSRC}/veriexec.mk" + .include diff --git a/stand/ficl.mk b/stand/ficl.mk index caa4aab951c3..2adbccb34f9d 100644 --- a/stand/ficl.mk +++ b/stand/ficl.mk @@ -17,6 +17,4 @@ CFLAGS+= -fPIC CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} CFLAGS+= -DBF_DICTSIZE=30000 -.if ${MK_LOADER_VERIEXEC} != "no" -CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h -.endif +.include "${BOOTSRC}/veriexec.mk" diff --git a/stand/i386/libfirewire/Makefile b/stand/i386/libfirewire/Makefile index 6a34efd0acb3..bf42c26a918f 100644 --- a/stand/i386/libfirewire/Makefile +++ b/stand/i386/libfirewire/Makefile @@ -8,6 +8,8 @@ LIB= firewire SRCS+= firewire.c fwohci.c dconsole.c SRCS+= dcons.c fwcrom.c +.include "${BOOTSRC}/veriexec.mk" + CFLAGS+= -D_BOOT CFLAGS+= -I${LDRSRC} diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile index 3dea78f16929..1b23cd53d137 100644 --- a/stand/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -17,6 +17,8 @@ CFLAGS+= -I${ZFSSRC} .PATH: ${SYSDIR}/teken SRCS+= teken.c +.include "${BOOTSRC}/veriexec.mk" + BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} diff --git a/stand/liblua/Makefile b/stand/liblua/Makefile index 68fa2da64fdb..385f1493bd38 100644 --- a/stand/liblua/Makefile +++ b/stand/liblua/Makefile @@ -40,8 +40,7 @@ CFLAGS.lutils.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC .endif -.if ${MK_LOADER_VERIEXEC} == "yes" -CFLAGS+= -I${SRCTOP}/lib/libsecureboot/h -DLOADER_VERIEXEC -.endif + +.include "${BOOTSRC}/veriexec.mk" .include diff --git a/stand/loader.mk b/stand/loader.mk index 3a38a9bc9e63..9dda8c6535ea 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -90,16 +90,7 @@ SRCS+= interp_simple.c .error Unknown interpreter ${LOADER_INTERP} .endif -.if ${MK_LOADER_VERIEXEC} != "no" -CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h -.if ${MK_LOADER_VERIEXEC_VECTX} != "no" -CFLAGS+= -DLOADER_VERIEXEC_VECTX -.endif -.endif - -.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} != "no" -CFLAGS+= -DLOADER_VERIEXEC_PASS_MANIFEST -I${SRCTOP}/lib/libsecureboot/h -.endif +.include "${BOOTSRC}/veriexec.mk" .if defined(BOOT_PROMPT_123) CFLAGS+= -DBOOT_PROMPT_123 diff --git a/stand/veriexec.mk b/stand/veriexec.mk new file mode 100644 index 000000000000..930e933be0a9 --- /dev/null +++ b/stand/veriexec.mk @@ -0,0 +1,9 @@ +.if ${MK_LOADER_VERIEXEC} != "no" +CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h +.if ${MK_LOADER_VERIEXEC_VECTX} != "no" +CFLAGS+= -DLOADER_VERIEXEC_VECTX +.endif +.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} != "no" +CFLAGS+= -DLOADER_VERIEXEC_PASS_MANIFEST +.endif +.endif From owner-dev-commits-src-main@freebsd.org Fri Apr 30 18:33:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 547356267A0; Fri, 30 Apr 2021 18:33: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 4FX1Gm1wzdz3HNq; Fri, 30 Apr 2021 18:33: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 34D10D47; Fri, 30 Apr 2021 18:33: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 13UIXq4o071987; Fri, 30 Apr 2021 18:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UIXqjY071986; Fri, 30 Apr 2021 18:33:52 GMT (envelope-from git) Date: Fri, 30 Apr 2021 18:33:52 GMT Message-Id: <202104301833.13UIXqjY071986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 2f32a971b7f9 - main - Wait longer for a previous IPI to be sent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f32a971b7f936170b4d61318238e6cf89f198b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 18:33:52 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=2f32a971b7f936170b4d61318238e6cf89f198b5 commit 2f32a971b7f936170b4d61318238e6cf89f198b5 Author: Eric van Gyzen AuthorDate: 2021-04-26 15:01:17 +0000 Commit: Eric van Gyzen CommitDate: 2021-04-30 18:32:29 +0000 Wait longer for a previous IPI to be sent When sending an IPI, if a previous IPI is still pending delivery, native_lapic_ipi_vectored() waits for the previous IPI to be sent. We've seen a few inexplicable panics with the current timeout of 50 ms. Increase the timeout to 1 second and make it tunable. No hardware specification mentions a timeout in this case; I checked the Intel SDM, Intel MP spec, and Intel x2APIC spec. Linux and illumos wait forever. In Linux, see __default_send_IPI_shortcut() in arch/x86/kernel/apic/ipi.c. In illumos, see apic_send_ipi() in usr/src/uts/i86pc/io/pcplusmp/apic_common.c. However, misbehaving hardware could hang the system if we wait forever. Reviewed by: mav kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29942 --- sys/x86/x86/local_apic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 85c3cfb69277..36010fe38102 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -202,6 +202,7 @@ static u_long lapic_timer_divisor, count_freq; static struct eventtimer lapic_et; #ifdef SMP static uint64_t lapic_ipi_wait_mult; +static int __read_mostly lapic_ds_idle_timeout = 1000000; #endif unsigned int max_apic_id; @@ -212,6 +213,11 @@ SYSCTL_INT(_hw_apic, OID_AUTO, eoi_suppression, CTLFLAG_RD, &lapic_eoi_suppression, 0, ""); SYSCTL_INT(_hw_apic, OID_AUTO, timer_tsc_deadline, CTLFLAG_RD, &lapic_timer_tsc_deadline, 0, ""); +#ifdef SMP +SYSCTL_INT(_hw_apic, OID_AUTO, ds_idle_timeout, CTLFLAG_RWTUN, + &lapic_ds_idle_timeout, 0, + "timeout (in us) for APIC Delivery Status to become Idle (xAPIC only)"); +#endif static void lapic_calibrate_initcount(struct lapic *la); static void lapic_calibrate_deadline(struct lapic *la); @@ -2035,7 +2041,6 @@ native_lapic_ipi_raw(register_t icrlo, u_int dest) } } -#define BEFORE_SPIN 50000 #ifdef DETECT_DEADLOCK #define AFTER_SPIN 50 #endif @@ -2082,7 +2087,7 @@ native_lapic_ipi_vectored(u_int vector, int dest) icrlo |= APIC_DESTMODE_PHY | APIC_TRIGMOD_EDGE | APIC_LEVEL_ASSERT; /* Wait for an earlier IPI to finish. */ - if (!lapic_ipi_wait(BEFORE_SPIN)) { + if (!lapic_ipi_wait(lapic_ds_idle_timeout)) { if (KERNEL_PANICKED()) return; else From owner-dev-commits-src-main@freebsd.org Fri Apr 30 22:58:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 15ABF62C925; Fri, 30 Apr 2021 22:58: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 4FX78H00mtz3lCp; Fri, 30 Apr 2021 22:58: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 E708F4A28; Fri, 30 Apr 2021 22:58: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 13UMwcK5015069; Fri, 30 Apr 2021 22:58:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UMwctD015068; Fri, 30 Apr 2021 22:58:38 GMT (envelope-from git) Date: Fri, 30 Apr 2021 22:58:38 GMT Message-Id: <202104302258.13UMwctD015068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: e245ee2774b3 - main - gicv3_its: Flush cache after allocating ITT memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e245ee2774b3e1d8b1462866a4084cc3e5a806a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 22:58:39 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=e245ee2774b3e1d8b1462866a4084cc3e5a806a8 commit e245ee2774b3e1d8b1462866a4084cc3e5a806a8 Author: Marcin Wojtas AuthorDate: 2021-04-29 09:39:09 +0000 Commit: Marcin Wojtas CommitDate: 2021-04-30 22:58:26 +0000 gicv3_its: Flush cache after allocating ITT memory It has to be zeroed before committing it to device. We do that by allocating it with M_ZERO, but there was no memory barrier or cache flush to ensure its sees it zeroed. This fixes MSIX on LS1028A SoC. Submitted by: Kornel Duleba Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30033 --- sys/arm64/arm64/gicv3_its.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 11cf05b04cfe..8ba7aa3b2047 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1197,6 +1197,10 @@ its_device_get(device_t dev, device_t child, u_int nvecs) return (NULL); } + /* Make sure device sees zeroed ITT. */ + if ((sc->sc_its_flags & ITS_FLAGS_CMDQ_FLUSH) != 0) + cpu_dcache_wb_range(its_dev->itt, its_dev->itt_size); + mtx_lock_spin(&sc->sc_its_dev_lock); TAILQ_INSERT_TAIL(&sc->sc_its_dev_list, its_dev, entry); mtx_unlock_spin(&sc->sc_its_dev_lock); From owner-dev-commits-src-main@freebsd.org Fri Apr 30 22:58:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 11F6362CB3B; Fri, 30 Apr 2021 22:58:55 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FX78b020lz3kth; Fri, 30 Apr 2021 22:58:55 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 31F7329EB1; Fri, 30 Apr 2021 22:58:54 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.48.21041102 Date: Fri, 30 Apr 2021 15:58:49 -0700 Subject: Re: ee8b757a949a - main - ipmi: support getting address from EFI From: Ravi Pokala To: Eric van Gyzen , , , Message-ID: Thread-Topic: ee8b757a949a - main - ipmi: support getting address from EFI References: <202104291525.13TFPCQR020414@gitrepo.freebsd.org> In-Reply-To: <202104291525.13TFPCQR020414@gitrepo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 22:58:55 -0000 -----Original Message----- From: on behalf of Eric van Gyzen Date: 2021-04-29, Thursday at 08:25 To: , , Subject: git: ee8b757a949a - main - ipmi: support getting address from EFI The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=ee8b757a949a9575c7355ea01f0475e0c526b9e5 commit ee8b757a949a9575c7355ea01f0475e0c526b9e5 Author: Yinlong Lu AuthorDate: 2021-04-29 10:04:36 +0000 Commit: Eric van Gyzen CommitDate: 2021-04-29 10:20:58 +0000 ipmi: support getting address from EFI The original implementation only supports getting the address from legacy BIOS (by searching for the SMBIOS_SIG pattern in a fixed address space). Try to get the SMBIOS table from EFI through efirt (EFI Runtime Services) firstly. Continue to search in the legacy BIOS if a NULL address is returned from EFI. By this way the ipmi function supports both legacy BIOS and UEFI systems. I get why the MODULE_DEPEND() was added to ipmi_smbios.c: it's now making an efirt call. But why was it added to the other three files? Thanks, Ravi (rpokala@) Reviewed by: dab, vangyzen MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D30007 --- sys/dev/ipmi/ipmi_isa.c | 4 ++++ sys/dev/ipmi/ipmi_pci.c | 4 ++++ sys/dev/ipmi/ipmi_smbios.c | 19 ++++++++++++++++--- sys/dev/ipmi/ipmi_smbus.c | 4 ++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index cdff305b07ec..1123f2849905 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -286,3 +287,6 @@ static driver_t ipmi_isa_driver = { }; DRIVER_MODULE(ipmi_isa, isa, ipmi_isa_driver, ipmi_devclass, 0, 0); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi_isa, efirt, 1, 1, 1); +#endif diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c index d4598f9db873..13ac4f4b5ede 100644 --- a/sys/dev/ipmi/ipmi_pci.c +++ b/sys/dev/ipmi/ipmi_pci.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -292,3 +293,6 @@ static driver_t ipmi2_pci_driver = { }; DRIVER_MODULE(ipmi2_pci, pci, ipmi2_pci_driver, ipmi_devclass, 0, 0); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi2_pci, efirt, 1, 1, 1); +#endif diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index a1b953365d7c..e26b6f2956ad 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -150,15 +151,27 @@ smbios_ipmi_info(struct smbios_structure_header *h, void *arg) static void ipmi_smbios_probe(struct ipmi_get_info *info) { +#ifdef ARCH_MAY_USE_EFI + struct uuid efi_smbios; + void *addr_efi; +#endif struct smbios_eps *header; void *table; u_int32_t addr; + addr = 0; bzero(info, sizeof(struct ipmi_get_info)); - /* Find the SMBIOS table header. */ - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, - SMBIOS_STEP, SMBIOS_OFF); +#ifdef ARCH_MAY_USE_EFI + efi_smbios = (struct uuid)EFI_TABLE_SMBIOS; + if (!efi_get_table(&efi_smbios, &addr_efi)) + addr = (vm_paddr_t)addr_efi; +#endif + + if (addr == 0) + /* Find the SMBIOS table header. */ + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); if (addr == 0) return; diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c index 212248f0217e..652e0ea6e665 100644 --- a/sys/dev/ipmi/ipmi_smbus.c +++ b/sys/dev/ipmi/ipmi_smbus.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -131,3 +132,6 @@ static driver_t ipmi_smbus_driver = { DRIVER_MODULE(ipmi_smbus, smbus, ipmi_smbus_driver, ipmi_devclass, 0, 0); MODULE_DEPEND(ipmi_smbus, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +#ifdef ARCH_MAY_USE_EFI +MODULE_DEPEND(ipmi_smbus, efirt, 1, 1, 1); +#endif From owner-dev-commits-src-main@freebsd.org Sat May 1 00:58:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D512462FBF3; Sat, 1 May 2021 00:58: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 4FX9pP5kTRz3rXY; Sat, 1 May 2021 00:58: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 B769C62C9; Sat, 1 May 2021 00:58: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 1410wLiE074595; Sat, 1 May 2021 00:58:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410wLgA074594; Sat, 1 May 2021 00:58:21 GMT (envelope-from git) Date: Sat, 1 May 2021 00:58:21 GMT Message-Id: <202105010058.1410wLgA074594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: a6ca7519f89c - main - powerpc64: Optimize radix trap handling a little more MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6ca7519f89c52e9fab205cded0f2bf32d914cd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:58:21 -0000 The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=a6ca7519f89c52e9fab205cded0f2bf32d914cd6 commit a6ca7519f89c52e9fab205cded0f2bf32d914cd6 Author: Justin Hibbits AuthorDate: 2021-05-01 00:58:11 +0000 Commit: Justin Hibbits CommitDate: 2021-05-01 00:58:11 +0000 powerpc64: Optimize radix trap handling a little more Summary: Since PCPU can live in a GPR for a while longer, let it, rather than re-getting it in yet another register. MFSPR is an expensive operation, 12 clock latency on POWER9, so the fewer operations we need, the better. Since the check is tightly coupled to the fetch, by reducing the number of fetch+check, we reduce the stalls, and improve the performance marginally. Buildworld was measured at a ~5-7% improvement on a single run. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D30003 --- sys/powerpc/aim/trap_subr64.S | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index 8e0f43ed0eeb..8ab2c57be7cb 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -56,10 +56,10 @@ /* * User SRs are loaded through a pointer to the current pmap. + * PCPU already in %r3 */ restore_usersrs: - GET_CPUINFO(%r28) - ld %r28,PC_USERSLB(%r28) + ld %r28,PC_USERSLB(%r3) cmpdi %r28, 0 /* If user SLB pointer NULL, exit */ beqlr @@ -84,13 +84,13 @@ restore_usersrs: /* * Kernel SRs are loaded directly from the PCPU fields + * PCPU in %r1 */ restore_kernsrs: - GET_CPUINFO(%r28) - lwz %r29, PC_FLAGS(%r28) + lwz %r29, PC_FLAGS(%r1) mtcr %r29 btlr 0 - addi %r28,%r28,PC_KERNSLB + addi %r28,%r1,PC_KERNSLB ld %r29,16(%r28) /* One past USER_SLB_SLOT */ cmpdi %r29,0 beqlr /* If first kernel entry is invalid, @@ -269,21 +269,21 @@ restore_kernsrs: /* Restore user SRs */ \ GET_CPUINFO(%r3); \ std %r27,(savearea+CPUSAVE_R27)(%r3); \ + lwz %r27,PC_FLAGS(%r3); \ + mtcr %r27; \ + bt 0, 0f; /* Check to skip restoring SRs. */ \ std %r28,(savearea+CPUSAVE_R28)(%r3); \ std %r29,(savearea+CPUSAVE_R29)(%r3); \ std %r30,(savearea+CPUSAVE_R30)(%r3); \ std %r31,(savearea+CPUSAVE_R31)(%r3); \ - lwz %r28,PC_FLAGS(%r3); \ - mtcr %r28; \ - bt 0, 0f; /* Check to skip restoring SRs. */ \ mflr %r27; /* preserve LR */ \ bl restore_usersrs; /* uses r28-r31 */ \ mtlr %r27; \ -0: \ ld %r31,(savearea+CPUSAVE_R31)(%r3); \ ld %r30,(savearea+CPUSAVE_R30)(%r3); \ ld %r29,(savearea+CPUSAVE_R29)(%r3); \ ld %r28,(savearea+CPUSAVE_R28)(%r3); \ +0: \ ld %r27,(savearea+CPUSAVE_R27)(%r3); \ 1: mfsprg2 %r3; /* restore cr */ \ mtcr %r3; \ @@ -778,12 +778,12 @@ realtrap: overwritten) */ bf 17,k_trap /* branch if PSL_PR is false */ GET_CPUINFO(%r1) - ld %r1,PC_CURPCB(%r1) mr %r27,%r28 /* Save LR, r29 */ mtsprg2 %r29 bl restore_kernsrs /* enable kernel mapping */ mfsprg2 %r29 mr %r28,%r27 + ld %r1,PC_CURPCB(%r1) b s_trap /* @@ -839,12 +839,12 @@ s_trap: bf 17,k_trap /* branch if PSL_PR is false */ GET_CPUINFO(%r1) u_trap: - ld %r1,PC_CURPCB(%r1) mr %r27,%r28 /* Save LR, r29 */ mtsprg2 %r29 bl restore_kernsrs /* enable kernel mapping */ mfsprg2 %r29 mr %r28,%r27 + ld %r1,PC_CURPCB(%r1) /* * Now the common trap catching code. From owner-dev-commits-src-main@freebsd.org Sat May 1 08:25:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4D6E762B9C2; Sat, 1 May 2021 08:25: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 4FXMkB1ghKz3kDr; Sat, 1 May 2021 08:25: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 2AA8F1493F; Sat, 1 May 2021 08:25: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 1418PMGI069807; Sat, 1 May 2021 08:25:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1418PM7L069806; Sat, 1 May 2021 08:25:22 GMT (envelope-from git) Date: Sat, 1 May 2021 08:25:22 GMT Message-Id: <202105010825.1418PM7L069806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c78ad207baed - main - Switch the EFI virtual address to a uint64_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c78ad207baed95dc3148632ab882d445acc39034 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 08:25:22 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c78ad207baed95dc3148632ab882d445acc39034 commit c78ad207baed95dc3148632ab882d445acc39034 Author: Andrew Turner AuthorDate: 2021-04-14 08:22:06 +0000 Commit: Andrew Turner CommitDate: 2021-05-01 06:01:20 +0000 Switch the EFI virtual address to a uint64_t It is defined as a uint64_t in the UEFI spec. As it's not used as a pointer by the kernel follow this and define it as the same in the kernel. Reviewed by: kib, manu, imp Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D29759 --- sys/amd64/amd64/efirt_machdep.c | 2 +- sys/amd64/amd64/machdep.c | 2 +- sys/arm/arm/machdep_boot.c | 2 +- sys/arm64/arm64/efirt_machdep.c | 2 +- sys/arm64/arm64/machdep.c | 2 +- sys/dev/efidev/efirt.c | 4 ++-- sys/sys/efi.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c index 1c53caaef601..3c8392bee86f 100644 --- a/sys/amd64/amd64/efirt_machdep.c +++ b/sys/amd64/amd64/efirt_machdep.c @@ -204,7 +204,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) descsz)) { if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { + if (p->md_virt != 0 && p->md_virt != p->md_phys) { if (bootverbose) printf("EFI Runtime entry %d is mapped\n", i); goto fail; diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 0951f3f71a0a..497975f0ee30 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1107,7 +1107,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap, type = types[p->md_type]; else type = ""; - printf("%23s %012lx %12p %08lx ", type, p->md_phys, + printf("%23s %012lx %012lx %08lx ", type, p->md_phys, p->md_virt, p->md_pages); if (p->md_attr & EFI_MD_ATTR_UC) printf("UC "); diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c index b13cf2ef23ea..332e9beb091e 100644 --- a/sys/arm/arm/machdep_boot.c +++ b/sys/arm/arm/machdep_boot.c @@ -442,7 +442,7 @@ arm_add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr, type = types[p->md_type]; else type = ""; - printf("%23s %012llx %12p %08llx ", type, p->md_phys, + printf("%23s %012llx %012llx %08llx ", type, p->md_phys, p->md_virt, p->md_pages); if (p->md_attr & EFI_MD_ATTR_UC) printf("UC "); diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index cd4e5d7bae00..a48fda6d02b8 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -184,7 +184,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) descsz)) { if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { + if (p->md_virt != 0 && p->md_virt != p->md_phys) { if (bootverbose) printf("EFI Runtime entry %d is mapped\n", i); goto fail; diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index c2e0eae188f2..71aa45b47d59 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1046,7 +1046,7 @@ print_efi_map_entry(struct efi_md *p) type = types[p->md_type]; else type = ""; - printf("%23s %012lx %12p %08lx ", type, p->md_phys, + printf("%23s %012lx %012lx %08lx ", type, p->md_phys, p->md_virt, p->md_pages); if (p->md_attr & EFI_MD_ATTR_UC) printf("UC "); diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index f28b9981919c..aa7e9afdb69d 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -126,8 +126,8 @@ efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr) if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (addr >= (uintptr_t)p->md_virt && - addr < (uintptr_t)p->md_virt + p->md_pages * PAGE_SIZE) + if (addr >= p->md_virt && + addr < p->md_virt + p->md_pages * PAGE_SIZE) return (true); } diff --git a/sys/sys/efi.h b/sys/sys/efi.h index 0c0b52afc81d..7f9408d19b39 100644 --- a/sys/sys/efi.h +++ b/sys/sys/efi.h @@ -74,7 +74,7 @@ struct efi_md { #define EFI_MD_TYPE_PERSISTENT 14 /* Persistent memory. */ uint32_t __pad; uint64_t md_phys; - void *md_virt; + uint64_t md_virt; uint64_t md_pages; uint64_t md_attr; #define EFI_MD_ATTR_UC 0x0000000000000001UL From owner-dev-commits-src-main@freebsd.org Sat May 1 08:25:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2CB6F62BB3C; Sat, 1 May 2021 08:25: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 4FXMk90ndyz3k62; Sat, 1 May 2021 08:25: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 0E0A21493E; Sat, 1 May 2021 08:25: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 1418PKw5069784; Sat, 1 May 2021 08:25:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1418PKuC069783; Sat, 1 May 2021 08:25:20 GMT (envelope-from git) Date: Sat, 1 May 2021 08:25:20 GMT Message-Id: <202105010825.1418PKuC069783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 2abd4f858146 - main - Add a way to map arm64 non-posted device memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2abd4f858146a266d48e3c55c2e29376e8b00967 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 08:25:21 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2abd4f858146a266d48e3c55c2e29376e8b00967 commit 2abd4f858146a266d48e3c55c2e29376e8b00967 Author: Andrew Turner AuthorDate: 2021-04-08 11:54:20 +0000 Commit: Andrew Turner CommitDate: 2021-05-01 06:01:20 +0000 Add a way to map arm64 non-posted device memory On arm64 we currently use a non-posted write for device memory, however we should move to use posted writes. This is expected to work on most hardware, however we will need to support a non-posted option for some broken hardware. Reviewed by: imp, manu, bcr (manpage) Differential Revision: https://reviews.freebsd.org/D29722 --- share/man/man9/bus_space.9 | 7 ++++++- sys/arm64/arm64/bus_machdep.c | 6 +++++- sys/arm64/include/bus.h | 1 + sys/arm64/include/vm.h | 5 +++++ usr.bin/vmstat/vmstat.c | 3 +++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/share/man/man9/bus_space.9 b/share/man/man9/bus_space.9 index 80e041dea4eb..9d5ca602acfe 100644 --- a/share/man/man9/bus_space.9 +++ b/share/man/man9/bus_space.9 @@ -52,7 +52,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 2020 +.Dd May 1, 2021 .Dt BUS_SPACE 9 .Os .Sh NAME @@ -876,6 +876,11 @@ call should fail. If this flag is not specified, the system may map the space in whatever way is most convenient. +.It Dv BUS_SPACE_MAP_NONPOSTED +Try to map the space using non-posted device memory. +This is to support buses and devices where mapping with posted device +memory is unsupported or broken. +This flag is currently only available on arm64. .El .Pp Not all combinations of flags make sense or are supported with all diff --git a/sys/arm64/arm64/bus_machdep.c b/sys/arm64/arm64/bus_machdep.c index 69d7c5b591b2..b2136af38cad 100644 --- a/sys/arm64/arm64/bus_machdep.c +++ b/sys/arm64/arm64/bus_machdep.c @@ -99,9 +99,13 @@ static int generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { + vm_memattr_t ma; void *va; - va = pmap_mapdev(bpa, size); + ma = VM_MEMATTR_DEVICE; + if (flags == BUS_SPACE_MAP_NONPOSTED) + ma = VM_MEMATTR_DEVICE_NP; + va = pmap_mapdev_attr(bpa, size, ma); if (va == NULL) return (ENOMEM); *bshp = (bus_space_handle_t)va; diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index a2bd432a5de5..61573b27728d 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -85,6 +85,7 @@ #define BUS_SPACE_MAP_CACHEABLE 0x01 #define BUS_SPACE_MAP_LINEAR 0x02 #define BUS_SPACE_MAP_PREFETCHABLE 0x04 +#define BUS_SPACE_MAP_NONPOSTED 0x08 #define BUS_SPACE_UNRESTRICTED (~0) diff --git a/sys/arm64/include/vm.h b/sys/arm64/include/vm.h index 3df3af24c010..e479aab52e26 100644 --- a/sys/arm64/include/vm.h +++ b/sys/arm64/include/vm.h @@ -36,7 +36,12 @@ #define VM_MEMATTR_WRITE_THROUGH 3 #define VM_MEMATTR_DEVICE_nGnRE 4 +/* + * VM_MEMATTR_DEVICE can be changed to VM_MEMATTR_DEVICE_nGnRE when + * the PCI drivers use VM_MEMATTR_DEVICE_NP for their config space. + */ #define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRnE +#define VM_MEMATTR_DEVICE_NP VM_MEMATTR_DEVICE_nGnRnE #ifdef _KERNEL /* If defined vmstat will try to use both of these in a switch statement */ diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 403dc6e2a054..ba1dc9eef883 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1570,6 +1570,9 @@ display_object(struct kinfo_vmobject *kvo) #ifdef VM_MEMATTR_DEVICE MEMATTR_STR(VM_MEMATTR_DEVICE, "DEV") #endif +#ifdef VM_MEMATTR_DEVICE_NP + MEMATTR_STR(VM_MEMATTR_DEVICE, "NP") +#endif #ifdef VM_MEMATTR_CACHEABLE MEMATTR_STR(VM_MEMATTR_CACHEABLE, "C") #endif From owner-dev-commits-src-main@freebsd.org Sat May 1 13:36:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5BB9962B4D4; Sat, 1 May 2021 13:36: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 4FXVdZ280xz4YhR; Sat, 1 May 2021 13:36: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 387FC18761; Sat, 1 May 2021 13:36: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 141DaoxX080999; Sat, 1 May 2021 13:36:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 141DaoZ8080998; Sat, 1 May 2021 13:36:50 GMT (envelope-from git) Date: Sat, 1 May 2021 13:36:50 GMT Message-Id: <202105011336.141DaoZ8080998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f1957db43d28 - main - Fix building sysctl(8) after c78ad20 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1957db43d28dbae1f82905304bab5be51942342 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 13:36:50 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f1957db43d28dbae1f82905304bab5be51942342 commit f1957db43d28dbae1f82905304bab5be51942342 Author: Andrew Turner AuthorDate: 2021-05-01 11:10:03 +0000 Commit: Andrew Turner CommitDate: 2021-05-01 11:10:03 +0000 Fix building sysctl(8) after c78ad20 In sysctl we parse an efi header on amd64. Fix this after changing the virtual memory type from a void * to a uint64_t in c78ad20. --- sbin/sysctl/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 30d6d94723fa..8d658dc2debe 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -794,8 +794,8 @@ S_efi_map(size_t l2, void *p) type = types[map->md_type]; if (type == NULL) type = ""; - printf("\n%23s %012jx %12p %08jx ", type, - (uintmax_t)map->md_phys, map->md_virt, + printf("\n%23s %012jx %012jx %08jx ", type, + (uintmax_t)map->md_phys, (uintmax_t)map->md_virt, (uintmax_t)map->md_pages); if (map->md_attr & EFI_MD_ATTR_UC) printf("UC "); From owner-dev-commits-src-main@freebsd.org Sat May 1 21:18:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 328ED638B54; Sat, 1 May 2021 21:18: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 4FXhtW0wHvz4v88; Sat, 1 May 2021 21:18: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 1230A1EA86; Sat, 1 May 2021 21:18: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 141LIhOn089806; Sat, 1 May 2021 21:18:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 141LIhLa089805; Sat, 1 May 2021 21:18:43 GMT (envelope-from git) Date: Sat, 1 May 2021 21:18:43 GMT Message-Id: <202105012118.141LIhLa089805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: be48fe60009e - main - powerpc/xive: Remove POWER9 DD1 IRQ bits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be48fe60009ed0b45f5675a26e68df2f50ca382a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 21:18:43 -0000 The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=be48fe60009ed0b45f5675a26e68df2f50ca382a commit be48fe60009ed0b45f5675a26e68df2f50ca382a Author: Justin Hibbits AuthorDate: 2021-04-26 18:04:42 +0000 Commit: Justin Hibbits CommitDate: 2021-05-01 21:18:02 +0000 powerpc/xive: Remove POWER9 DD1 IRQ bits The OPAL_XIVE_*_VIA_IFW flags are used only for POWER9 DD1, which we don't support. Noticed while perusing Linux and skiboot git logs. --- sys/powerpc/powernv/xive.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/powerpc/powernv/xive.c b/sys/powerpc/powernv/xive.c index 15b8920fe267..77467dc9fcd7 100644 --- a/sys/powerpc/powernv/xive.c +++ b/sys/powerpc/powernv/xive.c @@ -170,8 +170,6 @@ struct xive_irq { uint32_t lirq; uint64_t vp; uint64_t flags; -#define OPAL_XIVE_IRQ_EOI_VIA_FW 0x00000020 -#define OPAL_XIVE_IRQ_MASK_VIA_FW 0x00000010 #define OPAL_XIVE_IRQ_SHIFT_BUG 0x00000008 #define OPAL_XIVE_IRQ_LSI 0x00000004 #define OPAL_XIVE_IRQ_STORE_EOI 0x00000002 @@ -598,9 +596,7 @@ xive_eoi(device_t dev, u_int irq, void *priv) } else rirq = priv; - if (rirq->flags & OPAL_XIVE_IRQ_EOI_VIA_FW) - opal_call(OPAL_INT_EOI, irq); - else if (rirq->flags & OPAL_XIVE_IRQ_STORE_EOI) + if (rirq->flags & OPAL_XIVE_IRQ_STORE_EOI) xive_write_mmap8(rirq->eoi_page + XIVE_IRQ_STORE_EOI, 0); else if (rirq->flags & OPAL_XIVE_IRQ_LSI) xive_read_mmap8(rirq->eoi_page + XIVE_IRQ_LOAD_EOI); From owner-dev-commits-src-main@freebsd.org Sun May 2 06:20:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AF5455FA44C; Sun, 2 May 2021 06:20: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 4FXww84dcmz3svX; Sun, 2 May 2021 06:20: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 9230F26108; Sun, 2 May 2021 06:20: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 1426Kux5016692; Sun, 2 May 2021 06:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1426KuK0016691; Sun, 2 May 2021 06:20:56 GMT (envelope-from git) Date: Sun, 2 May 2021 06:20:56 GMT Message-Id: <202105020620.1426KuK0016691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 50d31dbc6e2b - main - less: upgrade to v581.2. 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/main X-Git-Reftype: branch X-Git-Commit: 50d31dbc6e2bc3aa6007edb8cdecbcb84e85d6c0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 06:20:56 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=50d31dbc6e2bc3aa6007edb8cdecbcb84e85d6c0 commit 50d31dbc6e2bc3aa6007edb8cdecbcb84e85d6c0 Merge: be48fe60009e bb457ab74420 Author: Xin LI AuthorDate: 2021-05-02 06:16:08 +0000 Commit: Xin LI CommitDate: 2021-05-02 06:16:08 +0000 less: upgrade to v581.2. MFC after: 1 week contrib/less/NEWS | 2 +- contrib/less/README | 4 ++-- contrib/less/help.c | 2 +- contrib/less/less.nro | 2 +- contrib/less/lessecho.nro | 2 +- contrib/less/lesskey.nro | 2 +- contrib/less/screen.c | 16 ++++++++-------- contrib/less/version.c | 3 ++- 8 files changed, 17 insertions(+), 16 deletions(-) diff --cc contrib/less/README index 0c1acfd5d3f6,000000000000..2acbd00d762a mode 100644,000000..100644 --- a/contrib/less/README +++ b/contrib/less/README @@@ -1,251 -1,0 +1,251 @@@ +************************************************************************** +************************************************************************** +** ** +** The FreeBSD Project has chosen to redistribute and modify Less under ** +** the 'Less License' (as described in the 'LICENSE' file). ** +** ** +************************************************************************** +************************************************************************** + - Less, version 581 ++ Less, version 581.2 + - This is the distribution of less, version 581, released 06 Apr 2021. ++ This is the distribution of less, version 581.2, released 28 Apr 2021. + This program is part of the GNU project (http://www.gnu.org). + + This program is free software. You may redistribute it and/or + modify it under the terms of either: + + 1. The GNU General Public License, as published by the Free + Software Foundation; either version 3, or (at your option) any + later version. A copy of this license is in the file COPYING. + or + 2. The Less License, in the file LICENSE. + + Please report any problems at https://github.com/gwsw/less/issues. + See https://greenwoodsoftware.com/less for the latest info. + Source repository is at https://github.com/gwsw/less.git. + +========================================================================= + +The formatted manual page is in less.man. +The manual page nroff source is in less.nro. +Major changes made since the last posted version are in NEWS. + +======================================================================= +INSTALLATION (Unix & Linux systems only): + +1. Move the distributed source to its own directory and unpack it, + if you have not already done so. + +2. If you are building from a clone of a git repository, + type "make -f Makefile.aut". + If you are building from a numbered release package (a tar or + zip file with a name like less-999.tar.gz or less-999.zip downloaded + from greenwoodsoftware.com, not from github), you should skip this step. + +3. Type "sh configure". + This will generate a Makefile and a defines.h. + Warning: if you have a GNU sed, make sure it is version 2.05 or later. + + The file INSTALL describes the usage of the configure program in + general. In addition, these options to configure are supported: + + --with-editor=program + Specifies the default editor program used by the "v" command. + The default is "vi". + + --with-regex=lib + Specifies the regular expression library used by less for pattern + matching. The default is "auto", which means the configure program + finds a regular expression library automatically. Other values are: + gnu Use the GNU regex library. + pcre Use the PCRE library. + pcre2 Use the PCRE2 library. + posix Use the POSIX-compatible regcomp. + regcmp Use the regcmp library. + re_comp Use the re_comp library. + regcomp Use the V8-compatible regcomp. + regcomp-local Use Henry Spencer's V8-compatible regcomp + (source is supplied with less). + none No regular expressions, only simple string matching. + + --with-secure + Builds a "secure" version of less, with some features disabled + to prevent users from viewing other files, accessing shell + commands, etc. + + +4. It is a good idea to look over the generated Makefile and defines.h + and make sure they look ok. If you know of any peculiarities of + your system that configure might not have detected, you may fix the + Makefile now. Take particular notice of the list of "terminal" + libraries in the LIBS definition in the Makefile; these may need + to be edited. The terminal libraries will be some subset of + -lncurses -lcurses -ltermcap -ltermlib + + If you wish, you may edit defines.h to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page "less.nro" and the help page "less.hlp" + to remove the descriptions of the features which you are removing. + If you edit less.hlp, you should run "make -f Makefile.aut help.c". + +5. Type "make" and watch the fun. + +6. If the make succeeds, it will generate the programs "less", + "lesskey" and "lessecho" in your current directory. Test the + generated programs. + +7. When satisfied that it works, if you wish to install it + in a public place, type "make install". + + The default install destinations are: + Executables (less, lesskey, lessecho) in /usr/local/bin + Documentation (less.nro, lesskey.nro) in /usr/local/man/man1 + If you want to install any of these files elsewhere, define + bindir and/or mandir to the appropriate directories. + + +Note to hackers: comments noting possible improvements are enclosed +in double curly brackets {{ like this }}. + +(Note that the above note was originally written at a time when +"hackers" most commonly meant "enthusiastic and dedicated computer +programmers", not "persons who attempt to circumvent computer security".) + + + +======================================================================= +INSTALLATION (MS-DOS systems only, + with Microsoft C, Borland C, or DJGPP) + +1. Move the distributed source to its own directory. + Depending on your compiler, you may need to convert the source + to have CR-LF rather than LF as line terminators. + +2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE. + If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE. + If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE. + +3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR + are correct. CC should be the name of your C compiler and + LIBDIR should be the directory where the C libraries reside (for + Microsoft C only). If these definitions need to be changed, you can + either modify the definitions directly in MAKEFILE, or set your + environment variables CC and/or LIBDIR to override the definitions + in MAKEFILE. + +4. If you wish, you may edit DEFINES.DS to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page LESS.MAN and the help page HELP.C + to remove the descriptions of the features which you are removing. + +5. Run your "make" program and watch the fun. + If your "make" requires a flag to import environment variables, + you should use that flag. + If your compiler runs out of memory, try running "make -n >cmds.bat" + and then run cmds.bat. + +6. If the make succeeds, it will generate the programs "LESS.EXE" and + "LESSKEY.EXE" in your current directory. Test the generated programs. + +7. When satisfied that it works, you may wish to install LESS.EXE and + LESSKEY.EXE in a directory which is included in your PATH. + + + +======================================================================= +INSTALLATION (Windows-95, Windows-98 and Windows-NT systems only, + with Borland C or Microsoft Visual C++) + +1. Move the distributed source to its own directory. + +2. If you are using Borland C, rename Makefile.wnb to Makefile. + If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.wn to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "make" and watch the fun. + +6. If the make succeeds, it will generate the programs "less.exe" and + "lesskey.exe" in your current directory. Test the generated programs. + +7. When satisfied that it works, if you wish to install it + in a public place, type "make install". + See step 6 of the Unix installation instructions for details + on how to change the default installation directories. + + + +======================================================================= +INSTALLATION (OS/2 systems only, + with EMX C) + +1. Move the distributed source to its own directory. + +2. Rename Makefile.o2e to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.o2 to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "make" and watch the fun. + +6. If the make succeeds, it will generate the programs "less.exe" and + "lesskey.exe" in your current directory. Test the generated programs. + +7. Make sure you have the emx runtime installed. You need the emx DLLs + emx.dll and emxlibcs.dll and also the termcap database, termcap.dat. + Make sure you have termcap.dat either in the default location or + somewhere in a directory listed in the PATH or INIT environment + variables. + +8. When satisfied that it works, you may wish to install less.exe, + lesskey.exe and scrsize.exe in a directory which is included in + your PATH. scrsize.exe is required only if you use a terminal + emulator such as xterm or rxvt. + + + +======================================================================= +INSTALLATION (OS-9 systems only, + with Microware C or Ultra C) + +1. Move the distributed source to its own directory. + +2. If you are using Microware C, rename Makefile.o9c to Makefile. + If you are using Ultra C, rename Makefile.o9u to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.o9 to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "dmake" and watch the fun. + The standard OS-9 "make" will probably not work. If you don't + have dmake, you can get a copy from os9archive.rtsi.com. + +6. If the make succeeds, it will generate the programs "less" and + "lesskey" in your current directory. Test the generated programs. + +7. When satisfied that it works, if you wish to install it + in a public place, type "dmake install". + See step 6 of the Unix installation instructions for details + on how to change the default installation directories. + +======================================================================= +ACKNOWLEDGMENTS: + Some versions of the less distribution are packaged using + Info-ZIP's compression utility. + Info-ZIP's software is free and can be obtained as source + code or executables from various anonymous-ftp sites, + including ftp.uu.net:/pub/archiving/zip. From owner-dev-commits-src-main@freebsd.org Sun May 2 10:56:13 2021 Return-Path: Delivered-To: dev-commits-src-main@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 820BF621357; Sun, 2 May 2021 10:56: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 4FY31n3GMdz4Y7w; Sun, 2 May 2021 10:56: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 62E5518A6; Sun, 2 May 2021 10:56: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 142AuD9F076989; Sun, 2 May 2021 10:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142AuD7x076988; Sun, 2 May 2021 10:56:13 GMT (envelope-from git) Date: Sun, 2 May 2021 10:56:13 GMT Message-Id: <202105021056.142AuD7x076988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fe3822497726 - main - Implement bus_map_resource on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe3822497726ab84a1e3753be41e43e4d51aab0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 10:56:13 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fe3822497726ab84a1e3753be41e43e4d51aab0b commit fe3822497726ab84a1e3753be41e43e4d51aab0b Author: Andrew Turner AuthorDate: 2021-04-10 10:25:39 +0000 Commit: Andrew Turner CommitDate: 2021-05-02 07:35:16 +0000 Implement bus_map_resource on arm64 This will allow us to allocate an unmapped memory resource, then later map it with a specific memory attribute. This is also needed for virtio with the modern PCI attachment. Reviewed by: kib (via D29723) Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D29694 --- sys/arm64/arm64/nexus.c | 77 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 924496ec7f52..cc28d87f002b 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -106,6 +106,8 @@ static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol); static struct resource_list *nexus_get_reslist(device_t, device_t); @@ -135,6 +137,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), @@ -344,10 +347,8 @@ static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_map map; int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; if ((err = rman_activate_resource(r)) != 0) return (err); @@ -355,18 +356,21 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, /* * If this is a memory resource, map it into the kernel. */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + err = nexus_map_resource(bus, child, type, r, NULL, + &map); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } + + rman_set_mapping(r, &map); } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - } else if (type == SYS_RES_IRQ) { + break; + case SYS_RES_IRQ: err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); @@ -420,6 +424,51 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, return (rman_deactivate_resource(r)); } +static int +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t end, length, start; + + /* Resources must be active to be mapped. */ + if ((rman_get_flags(r) & RF_ACTIVE) == 0) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + if (argsp != NULL) + bcopy(argsp, &args, imin(argsp->size, args.size)); + start = rman_get_start(r) + args.offset; + if (args.length == 0) + length = rman_get_size(r); + else + length = args.length; + end = start + length - 1; + if (start > rman_get_end(r) || start < rman_get_start(r)) + return (EINVAL); + if (end > rman_get_end(r) || end < start) + return (EINVAL); + + map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr); + map->r_bustag = &memmap_bus; + map->r_size = length; + + /* + * The handle is the virtual address. + */ + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + #ifdef FDT static device_method_t nexus_fdt_methods[] = { /* Device interface */ From owner-dev-commits-src-main@freebsd.org Sun May 2 10:56:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B7A87621361; Sun, 2 May 2021 10:56:14 +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 4FY31p4JhNz4YdZ; Sun, 2 May 2021 10:56:14 +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 84C2318A7; Sun, 2 May 2021 10:56: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 142AuEGs077010; Sun, 2 May 2021 10:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142AuEUJ077009; Sun, 2 May 2021 10:56:14 GMT (envelope-from git) Date: Sun, 2 May 2021 10:56:14 GMT Message-Id: <202105021056.142AuEUJ077009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 2420f6aed9e3 - main - Enable IPIs on CPU 0 on arm and arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2420f6aed9e355ff65377152ba977b3a5ac441d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 10:56:14 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2420f6aed9e355ff65377152ba977b3a5ac441d1 commit 2420f6aed9e355ff65377152ba977b3a5ac441d1 Author: Andrew Turner AuthorDate: 2021-05-02 07:43:34 +0000 Commit: Andrew Turner CommitDate: 2021-05-02 07:43:34 +0000 Enable IPIs on CPU 0 on arm and arm64 Not all interrupt controllers enable IPIs by default as the Arm GIC specs make it an implementation defined option. As at least two hypervisors have also previously masked the IPIs on boot. As we already enable these IPIs on the non-boot CPUs it is expected this is a safe operation. Differential Revision: https://reviews.freebsd.org/D26975 --- sys/arm64/arm64/mp_machdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 8d5d82879571..3b1a8cc89cab 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -364,6 +364,8 @@ intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, ii->ii_send_arg = isrc; strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); ii->ii_count = intr_ipi_setup_counters(name); + + PIC_ENABLE_INTR(intr_irq_root_dev, isrc); } static void From owner-dev-commits-src-main@freebsd.org Sun May 2 14:22:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B42B9627034; Sun, 2 May 2021 14:22: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 4FY7bY4lC3z4jx7; Sun, 2 May 2021 14:22:17 +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 957D94551; Sun, 2 May 2021 14:22: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 142EMHgQ056285; Sun, 2 May 2021 14:22:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142EMHrL056284; Sun, 2 May 2021 14:22:17 GMT (envelope-from git) Date: Sun, 2 May 2021 14:22:17 GMT Message-Id: <202105021422.142EMHrL056284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Charlie Li Subject: git: c229f4aa0c2d - main - Add myself (vishwin) as a ports committer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vishwin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c229f4aa0c2d1428db975e0ef1a9c7a186d1b3b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 14:22:17 -0000 The branch main has been updated by vishwin (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c229f4aa0c2d1428db975e0ef1a9c7a186d1b3b7 commit c229f4aa0c2d1428db975e0ef1a9c7a186d1b3b7 Author: Charlie Li AuthorDate: 2021-05-02 05:15:14 +0000 Commit: Charlie Li CommitDate: 2021-05-02 14:20:46 +0000 Add myself (vishwin) as a ports committer Following section 7.1 in Committer's Guide. Approved by: arrowd (mentor) Differential Revision: https://reviews.freebsd.org/D30078 --- share/misc/committers-ports.dot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index eda6c33fc82f..fd594645a5d0 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -283,6 +283,7 @@ ultima [label="Richard Gallamore\nultima@FreeBSD.org\n2017/06/07"] uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"] +vishwin [label="Charlie Li\nvishwin@FreeBSD.org\n2021/04/29"] vsevolod [label="Vsevolod Stakhov\nvsevolod@FreeBSD.org\n2005/07/22"] wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"] @@ -328,6 +329,7 @@ araujo -> pgollucci araujo -> samm arrowd -> rhurlin +arrowd -> vishwin arved -> markus arved -> stefan @@ -453,6 +455,8 @@ flo -> jase flo -> jbeich flo -> grembo +fluffy -> vishwin + flz -> garga flz -> johans flz -> laszlof @@ -766,6 +770,7 @@ tcberner -> pkubaj tcberner -> rhurlin tcberner -> rigoletto tcberner -> salvadore +tcberner -> vishwin tcberner -> yuri thierry -> jadawin From owner-dev-commits-src-main@freebsd.org Sun May 2 16:33:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 251E262A252; Sun, 2 May 2021 16:33: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 4FYBVw0Y1Bz4qBS; Sun, 2 May 2021 16:33: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 055F8640D; Sun, 2 May 2021 16:33: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 142GXR66028983; Sun, 2 May 2021 16:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142GXRnY028982; Sun, 2 May 2021 16:33:27 GMT (envelope-from git) Date: Sun, 2 May 2021 16:33:27 GMT Message-Id: <202105021633.142GXRnY028982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 9769f6f80821 - main - usr.bin/patch: remove unneeded header. 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/main X-Git-Reftype: branch X-Git-Commit: 9769f6f808210ddc304bc9e3c55121e6ce4d9075 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 16:33:28 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=9769f6f808210ddc304bc9e3c55121e6ce4d9075 commit 9769f6f808210ddc304bc9e3c55121e6ce4d9075 Author: Xin LI AuthorDate: 2021-05-02 16:27:32 +0000 Commit: Xin LI CommitDate: 2021-05-02 16:27:32 +0000 usr.bin/patch: remove unneeded header. MFC after: 2 weeks --- usr.bin/patch/backupfile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c index ecdca19e2a71..a35e6fd21dc8 100644 --- a/usr.bin/patch/backupfile.c +++ b/usr.bin/patch/backupfile.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "backupfile.h" From owner-dev-commits-src-main@freebsd.org Sun May 2 16:33:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6851F62A06E; Sun, 2 May 2021 16:33: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 4FYBVx1mnpz4ppd; Sun, 2 May 2021 16:33: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 2895F5BF1; Sun, 2 May 2021 16:33: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 142GXT9U029004; Sun, 2 May 2021 16:33:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142GXTdQ029003; Sun, 2 May 2021 16:33:29 GMT (envelope-from git) Date: Sun, 2 May 2021 16:33:29 GMT Message-Id: <202105021633.142GXTdQ029003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: f6b6d216cafb - main - usr.bin/netstat: use roundup2 when rounding up to power of 2. 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/main X-Git-Reftype: branch X-Git-Commit: f6b6d216cafb154a85313a2d1bd34b18b9bfbba8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 16:33:29 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=f6b6d216cafb154a85313a2d1bd34b18b9bfbba8 commit f6b6d216cafb154a85313a2d1bd34b18b9bfbba8 Author: Xin LI AuthorDate: 2021-05-02 16:30:22 +0000 Commit: Xin LI CommitDate: 2021-05-02 16:30:22 +0000 usr.bin/netstat: use roundup2 when rounding up to power of 2. MFC after: 2 weeks --- usr.bin/netstat/common.c | 4 ++-- usr.bin/netstat/nhops.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/netstat/common.c b/usr.bin/netstat/common.c index ac721b3e9ab0..9dbbaeee25ea 100644 --- a/usr.bin/netstat/common.c +++ b/usr.bin/netstat/common.c @@ -114,7 +114,7 @@ prepare_ifmap(size_t *pifmap_size) ifindex = sdl->sdl_index; if (ifindex >= ifmap_size) { - size = roundup(ifindex + 1, 32) * + size = roundup2(ifindex + 1, 32) * sizeof(struct ifmap_entry); if ((ifmap = realloc(ifmap, size)) == NULL) errx(2, "realloc(%d) failed", size); @@ -122,7 +122,7 @@ prepare_ifmap(size_t *pifmap_size) size - ifmap_size * sizeof(struct ifmap_entry)); - ifmap_size = roundup(ifindex + 1, 32); + ifmap_size = roundup2(ifindex + 1, 32); } if (*ifmap[ifindex].ifname != '\0') diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 44006da7f1fe..51bed6e23c0f 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -213,7 +213,7 @@ nhop_map_update(struct nhop_map *map, uint32_t idx, char *gw, char *ifname) else new_size = map->size * 2; if (new_size <= idx) - new_size = roundup(idx + 1, 32); + new_size = roundup2(idx + 1, 32); sz = new_size * (sizeof(struct nhop_entry)); if ((map->ptr = realloc(map->ptr, sz)) == NULL) From owner-dev-commits-src-main@freebsd.org Sun May 2 19:46:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8D46662EBB5; Sun, 2 May 2021 19:46: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 4FYGp63bWNz3FDv; Sun, 2 May 2021 19:46:54 +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 5F4F8109DE; Sun, 2 May 2021 19:46:54 +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 142JksGw079986; Sun, 2 May 2021 19:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142JksVN079985; Sun, 2 May 2021 19:46:54 GMT (envelope-from git) Date: Sun, 2 May 2021 19:46:54 GMT Message-Id: <202105021946.142JksVN079985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: bf7cc0f9cb66 - main - sbin/ipfw: Fix null pointer deference when printing counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf7cc0f9cb6603a6bdd6131c8d1939724ce6e62d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 19:46:54 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=bf7cc0f9cb6603a6bdd6131c8d1939724ce6e62d commit bf7cc0f9cb6603a6bdd6131c8d1939724ce6e62d Author: Lutz Donnerhacke AuthorDate: 2021-04-30 14:12:47 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-05-02 19:28:46 +0000 sbin/ipfw: Fix null pointer deference when printing counters ipfw -[tT] prints statistics of the last access. If the rule was never used, the counter might be not exist. This happens unconditionally on inserting a new rule. Avoid printing statistics in this case. PR: 255491 Reported by: Haisheng Zhouz Reviewed by: ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30046 --- sbin/ipfw/ipfw2.c | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 19f7f331091d..c17fbbca7dfa 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2174,32 +2174,35 @@ show_static_rule(struct cmdline_opts *co, struct format_opts *fo, } bprintf(bp, "%05u ", rule->rulenum); - /* Print counters if enabled */ - if (fo->pcwidth > 0 || fo->bcwidth > 0) { - pr_u64(bp, &cntr->pcnt, fo->pcwidth); - pr_u64(bp, &cntr->bcnt, fo->bcwidth); - } - - /* Print timestamp */ - if (co->do_time == TIMESTAMP_NUMERIC) - bprintf(bp, "%10u ", cntr->timestamp); - else if (co->do_time == TIMESTAMP_STRING) { - char timestr[30]; - time_t t = (time_t)0; - - if (twidth == 0) { - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - twidth = strlen(timestr); + /* only if counters are available */ + if (cntr != NULL) { + /* Print counters if enabled */ + if (fo->pcwidth > 0 || fo->bcwidth > 0) { + pr_u64(bp, &cntr->pcnt, fo->pcwidth); + pr_u64(bp, &cntr->bcnt, fo->bcwidth); } - if (cntr->timestamp > 0) { - t = _long_to_time(cntr->timestamp); - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - bprintf(bp, "%s ", timestr); - } else { - bprintf(bp, "%*s ", twidth, ""); + /* Print timestamp */ + if (co->do_time == TIMESTAMP_NUMERIC) + bprintf(bp, "%10u ", cntr->timestamp); + else if (co->do_time == TIMESTAMP_STRING) { + char timestr[30]; + time_t t = (time_t)0; + + if (twidth == 0) { + strcpy(timestr, ctime(&t)); + *strchr(timestr, '\n') = '\0'; + twidth = strlen(timestr); + } + if (cntr->timestamp > 0) { + t = _long_to_time(cntr->timestamp); + + strcpy(timestr, ctime(&t)); + *strchr(timestr, '\n') = '\0'; + bprintf(bp, "%s ", timestr); + } else { + bprintf(bp, "%*s ", twidth, ""); + } } } From owner-dev-commits-src-main@freebsd.org Sun May 2 23:08:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D14255FD91A; Sun, 2 May 2021 23:08: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 4FYMH65Xktz3R9C; Sun, 2 May 2021 23:08: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 AC86D13837; Sun, 2 May 2021 23:08: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 142N8oau046676; Sun, 2 May 2021 23:08:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142N8o9m046675; Sun, 2 May 2021 23:08:50 GMT (envelope-from git) Date: Sun, 2 May 2021 23:08:50 GMT Message-Id: <202105022308.142N8o9m046675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 4f592683c356 - main - copy_file_range(2): improve copying of a large hole to EOF 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/main X-Git-Reftype: branch X-Git-Commit: 4f592683c356379c5bac56b52807ed4ad54ee647 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 23:08:50 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4f592683c356379c5bac56b52807ed4ad54ee647 commit 4f592683c356379c5bac56b52807ed4ad54ee647 Author: Rick Macklem AuthorDate: 2021-05-02 23:04:27 +0000 Commit: Rick Macklem CommitDate: 2021-05-02 23:04:27 +0000 copy_file_range(2): improve copying of a large hole to EOF PR#255523 reported that a file copy for a file with a large hole to EOF on ZFS ran slowly over NFSv4.2. The problem was that vn_generic_copy_file_range() would loop around reading the hole's data and then see it is all 0s. It was coded this way since UFS always allocates a data block near the end of the file, such that a hole to EOF never exists. This patch modifies vn_generic_copy_file_range() to check for a ENXIO returned from VOP_IOCTL(..FIOSEEKDATA..) and handle that case as a hole to EOF. asomers@ confirms that it works for his ZFS test case. PR: 255523 Tested by: asomers Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30076 --- sys/kern/vfs_vnops.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 832c717a33b7..d4396f67a67b 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3099,13 +3099,13 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) { - struct vattr va; + struct vattr va, inva; struct mount *mp; struct uio io; off_t startoff, endoff, xfer, xfer2; u_long blksize; int error, interrupted; - bool cantseek, readzeros, eof, lastblock; + bool cantseek, readzeros, eof, lastblock, holetoeof; ssize_t aresid; size_t copylen, len, rem, savlen; char *dat; @@ -3122,7 +3122,11 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, goto out; if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0) holein = 0; + if (holein > 0) + error = VOP_GETATTR(invp, &inva, incred); VOP_UNLOCK(invp); + if (error != 0) + goto out; mp = NULL; error = vn_start_write(outvp, &mp, V_WAIT); @@ -3203,7 +3207,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, * Note that some file systems such as NFSv3, NFSv4.0 and NFSv4.1 may * support holes on the server, but do not support FIOSEEKHOLE. */ - eof = false; + holetoeof = eof = false; while (len > 0 && error == 0 && !eof && interrupted == 0) { endoff = 0; /* To shut up compilers. */ cantseek = true; @@ -3212,8 +3216,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, /* * Find the next data area. If there is just a hole to EOF, - * FIOSEEKDATA should fail and then we drop down into the - * inner loop and create the hole on the outvp file. + * FIOSEEKDATA should fail with ENXIO. * (I do not know if any file system will report a hole to * EOF via FIOSEEKHOLE, but I am pretty sure FIOSEEKDATA * will fail for those file systems.) @@ -3222,10 +3225,16 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, * the code just falls through to the inner copy loop. */ error = EINVAL; - if (holein > 0) + if (holein > 0) { error = VOP_IOCTL(invp, FIOSEEKDATA, &startoff, 0, incred, curthread); - if (error == 0) { + if (error == ENXIO) { + startoff = endoff = inva.va_size; + eof = holetoeof = true; + error = 0; + } + } + if (error == 0 && !holetoeof) { endoff = startoff; error = VOP_IOCTL(invp, FIOSEEKHOLE, &endoff, 0, incred, curthread); @@ -3256,11 +3265,12 @@ vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, } if (error == 0 && *outoffp + xfer > - va.va_size && xfer == len) - /* Grow last block. */ + va.va_size && (xfer == len || holetoeof)) { + /* Grow output file (hole at end). */ error = vn_write_outvp(outvp, dat, *outoffp, xfer, blksize, true, false, outcred); + } if (error == 0) { *inoffp += xfer; *outoffp += xfer; From owner-dev-commits-src-main@freebsd.org Sun May 2 23:24:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 834055FDD56; Sun, 2 May 2021 23:24: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 4FYMdM3K9pz3hgY; Sun, 2 May 2021 23:24: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 6461513D3E; Sun, 2 May 2021 23:24: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 142NOdfM073135; Sun, 2 May 2021 23:24:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142NOdXJ073134; Sun, 2 May 2021 23:24:39 GMT (envelope-from git) Date: Sun, 2 May 2021 23:24:39 GMT Message-Id: <202105022324.142NOdXJ073134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 5f2e1835054e - main - sctp: improve error handling in INIT/INIT-ACK processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2e1835054ee84f2e68ebc890d92716a91775b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 23:24:39 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2e1835054ee84f2e68ebc890d92716a91775b7 commit 5f2e1835054ee84f2e68ebc890d92716a91775b7 Author: Michael Tuexen AuthorDate: 2021-05-02 20:38:27 +0000 Commit: Michael Tuexen CommitDate: 2021-05-02 20:41:35 +0000 sctp: improve error handling in INIT/INIT-ACK processing When processing INIT and INIT-ACK information, also during COOKIE processing, delete the current association, when it would end up in an inconsistent state. MFC after: 3 days --- sys/netinet/sctp_input.c | 101 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 29 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 0790e6f4d2db..072322ea074a 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -449,18 +449,24 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t)nat_friendly; /* process the peer's parameters in the INIT-ACK */ - retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); - if (retval < 0) { + if (sctp_process_init((struct sctp_init_chunk *)cp, stcb) < 0) { if (op_err != NULL) { sctp_m_freem(op_err); } - return (retval); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); + *abort_no_unlock = 1; + return (-1); } initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, - src, dst, NULL, stcb->asoc.port))) { + offset + sizeof(struct sctp_init_chunk), + initack_limit, src, dst, NULL, stcb->asoc.port)) < 0) { if (op_err != NULL) { sctp_m_freem(op_err); } @@ -1458,10 +1464,15 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, * the right seq no's. */ /* First we must process the INIT !! */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 3; + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* we have already processed the INIT so no problem */ @@ -1523,16 +1534,20 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, break; } /* end switch */ sctp_stop_all_cookie_timers(stcb); - /* - * We ignore the return code here.. not sure if we should - * somehow abort.. but we do have an existing asoc. This - * really should not fail. - */ - if (sctp_load_addresses_from_init(stcb, m, + if ((ret = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* respond with a COOKIE-ACK */ @@ -1650,17 +1665,31 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, } } /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 9; + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } - if (sctp_load_addresses_from_init(stcb, m, + if ((retval = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || @@ -1874,11 +1903,15 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, asoc->total_flight = 0; asoc->total_flight_count = 0; /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 13; - + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_init() failed\n"); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* @@ -1887,12 +1920,20 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, */ net->hb_responded = 1; - if (sctp_load_addresses_from_init(stcb, m, + if ((retval = sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, stcb->asoc.port)) { + initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; - + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with address parameters"); + SCTPDBG(SCTP_DEBUG_INPUT1, + "Load addresses from INIT causes an abort %d\n", + retval); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); return (NULL); } /* respond with a COOKIE-ACK */ @@ -2047,16 +2088,15 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb); - if (retval < 0) { + if (sctp_process_init(init_cp, stcb) < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); return (NULL); } /* load all addresses */ - if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, - src, dst, init_src, port)) { + if ((retval = sctp_load_addresses_from_init(stcb, m, + init_offset + sizeof(struct sctp_init_chunk), + initack_offset, src, dst, init_src, port)) < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); return (NULL); @@ -2518,6 +2558,9 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, ¬ification, auth_skipped, auth_offset, auth_len, mflowtype, mflowid, vrf_id, port); + if (*stcb == NULL) { + *locked_tcb = NULL; + } } if (*stcb == NULL) { From owner-dev-commits-src-main@freebsd.org Sun May 2 23:45:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 12D3A5FE1EF; Sun, 2 May 2021 23:45: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 4FYN5N748zz3jGW; Sun, 2 May 2021 23:45: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 D4C6714220; Sun, 2 May 2021 23:45: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 142NjSCi099573; Sun, 2 May 2021 23:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 142NjSrG099572; Sun, 2 May 2021 23:45:28 GMT (envelope-from git) Date: Sun, 2 May 2021 23:45:28 GMT Message-Id: <202105022345.142NjSrG099572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 2760658b211c - main - Improve UMA cache reclamation. 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/main X-Git-Reftype: branch X-Git-Commit: 2760658b211c654bce1dbde597bc52b49fde5d7e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 23:45:29 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2760658b211c654bce1dbde597bc52b49fde5d7e commit 2760658b211c654bce1dbde597bc52b49fde5d7e Author: Alexander Motin AuthorDate: 2021-05-02 23:35:28 +0000 Commit: Alexander Motin CommitDate: 2021-05-02 23:45:23 +0000 Improve UMA cache reclamation. When estimating working set size, measure only allocation batches, not free batches. Allocation and free patterns can be very different. For example, ZFS on vm_lowmem event can free to UMA few gigabytes of memory in one call, but it does not mean it will request the same amount back that fast too, in fact it won't. Update working set size on every reclamation call, shrinking caches faster under pressure. Lack of this caused repeating vm_lowmem events squeezing more and more memory out of real consumers only to make it stuck in UMA caches. I saw ZFS drop ARC size in half before previous algorithm after periodic WSS update decided to reclaim UMA caches. Introduce voluntary reclamation of UMA caches not used for a long time. For each zdom track longterm minimal cache size watermark, freeing some unused items every UMA_TIMEOUT after first 15 minutes without cache misses. Freed memory can get better use by other consumers. For example, ZFS won't grow its ARC unless it see free memory, since it does not know it is not really used. And even if memory is not really needed, periodic free during inactivity periods should reduce its fragmentation. Reviewed by: markj, jeff (previous version) MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29790 --- sys/vm/uma_core.c | 179 +++++++++++++++++++++++++++++++++++++----------------- sys/vm/uma_int.h | 3 + 2 files changed, 126 insertions(+), 56 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 6b0add6b6b07..a85b88b24110 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -293,8 +293,10 @@ static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); static void bucket_cache_reclaim(uma_zone_t zone, bool, int); +static bool bucket_cache_reclaim_domain(uma_zone_t, bool, bool, int); static int keg_ctor(void *, int, void *, int); static void keg_dtor(void *, int, void *); +static void keg_drain(uma_keg_t keg, int domain); static int zone_ctor(void *, int, void *, int); static void zone_dtor(void *, int, void *); static inline void item_dtor(uma_zone_t zone, void *item, int size, @@ -700,24 +702,6 @@ zone_domain_highest(uma_zone_t zone, int pref) return (domain); } -/* - * Safely subtract cnt from imax. - */ -static void -zone_domain_imax_sub(uma_zone_domain_t zdom, int cnt) -{ - long new; - long old; - - old = zdom->uzd_imax; - do { - if (old <= cnt) - new = 0; - else - new = old - cnt; - } while (atomic_fcmpset_long(&zdom->uzd_imax, &old, new) == 0); -} - /* * Set the maximum imax value. */ @@ -729,8 +713,16 @@ zone_domain_imax_set(uma_zone_domain_t zdom, int nitems) old = zdom->uzd_imax; do { if (old >= nitems) - break; + return; } while (atomic_fcmpset_long(&zdom->uzd_imax, &old, nitems) == 0); + + /* + * We are at new maximum, so do the last WSS update for the old + * bimin and prepare to measure next allocation batch. + */ + if (zdom->uzd_wss < old - zdom->uzd_bimin) + zdom->uzd_wss = old - zdom->uzd_bimin; + zdom->uzd_bimin = nitems; } /* @@ -741,6 +733,7 @@ static uma_bucket_t zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom, bool reclaim) { uma_bucket_t bucket; + long cnt; int i; bool dtor = false; @@ -768,15 +761,26 @@ zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom, bool reclaim) ("%s: empty bucket in bucket cache", __func__)); zdom->uzd_nitems -= bucket->ub_cnt; - /* - * Shift the bounds of the current WSS interval to avoid - * perturbing the estimate. - */ if (reclaim) { + /* + * Shift the bounds of the current WSS interval to avoid + * perturbing the estimates. + */ + cnt = lmin(zdom->uzd_bimin, bucket->ub_cnt); + atomic_subtract_long(&zdom->uzd_imax, cnt); + zdom->uzd_bimin -= cnt; zdom->uzd_imin -= lmin(zdom->uzd_imin, bucket->ub_cnt); - zone_domain_imax_sub(zdom, bucket->ub_cnt); - } else if (zdom->uzd_imin > zdom->uzd_nitems) - zdom->uzd_imin = zdom->uzd_nitems; + if (zdom->uzd_limin >= bucket->ub_cnt) { + zdom->uzd_limin -= bucket->ub_cnt; + } else { + zdom->uzd_limin = 0; + zdom->uzd_timin = 0; + } + } else if (zdom->uzd_bimin > zdom->uzd_nitems) { + zdom->uzd_bimin = zdom->uzd_nitems; + if (zdom->uzd_imin > zdom->uzd_nitems) + zdom->uzd_imin = zdom->uzd_nitems; + } ZDOM_UNLOCK(zdom); if (dtor) @@ -808,8 +812,18 @@ zone_put_bucket(uma_zone_t zone, int domain, uma_bucket_t bucket, void *udata, */ zdom->uzd_nitems += bucket->ub_cnt; if (__predict_true(zdom->uzd_nitems < zone->uz_bucket_max)) { - if (ws) + if (ws) { zone_domain_imax_set(zdom, zdom->uzd_nitems); + } else { + /* + * Shift the bounds of the current WSS interval to + * avoid perturbing the estimates. + */ + atomic_add_long(&zdom->uzd_imax, bucket->ub_cnt); + zdom->uzd_imin += bucket->ub_cnt; + zdom->uzd_bimin += bucket->ub_cnt; + zdom->uzd_limin += bucket->ub_cnt; + } if (STAILQ_EMPTY(&zdom->uzd_buckets)) zdom->uzd_seq = bucket->ub_seq; @@ -1041,22 +1055,49 @@ uma_timeout(void *unused) } /* - * Update the working set size estimate for the zone's bucket cache. - * The constants chosen here are somewhat arbitrary. With an update period of - * 20s (UMA_TIMEOUT), this estimate is dominated by zone activity over the - * last 100s. + * Update the working set size estimates for the zone's bucket cache. + * The constants chosen here are somewhat arbitrary. */ static void zone_domain_update_wss(uma_zone_domain_t zdom) { - long wss; + long m; - ZDOM_LOCK(zdom); - MPASS(zdom->uzd_imax >= zdom->uzd_imin); - wss = zdom->uzd_imax - zdom->uzd_imin; - zdom->uzd_imax = zdom->uzd_imin = zdom->uzd_nitems; - zdom->uzd_wss = (4 * wss + zdom->uzd_wss) / 5; - ZDOM_UNLOCK(zdom); + ZDOM_LOCK_ASSERT(zdom); + MPASS(zdom->uzd_imax >= zdom->uzd_nitems); + MPASS(zdom->uzd_nitems >= zdom->uzd_bimin); + MPASS(zdom->uzd_bimin >= zdom->uzd_imin); + + /* + * Estimate WSS as modified moving average of biggest allocation + * batches for each period over few minutes (UMA_TIMEOUT of 20s). + */ + zdom->uzd_wss = lmax(zdom->uzd_wss * 3 / 4, + zdom->uzd_imax - zdom->uzd_bimin); + + /* + * Estimate longtime minimum item count as a combination of recent + * minimum item count, adjusted by WSS for safety, and the modified + * moving average over the last several hours (UMA_TIMEOUT of 20s). + * timin measures time since limin tried to go negative, that means + * we were dangerously close to or got out of cache. + */ + m = zdom->uzd_imin - zdom->uzd_wss; + if (m >= 0) { + if (zdom->uzd_limin >= m) + zdom->uzd_limin = m; + else + zdom->uzd_limin = (m + zdom->uzd_limin * 255) / 256; + zdom->uzd_timin++; + } else { + zdom->uzd_limin = 0; + zdom->uzd_timin = 0; + } + + /* To reduce period edge effects on WSS keep half of the imax. */ + atomic_subtract_long(&zdom->uzd_imax, + (zdom->uzd_imax - zdom->uzd_nitems + 1) / 2); + zdom->uzd_imin = zdom->uzd_bimin = zdom->uzd_nitems; } /* @@ -1072,7 +1113,7 @@ zone_timeout(uma_zone_t zone, void *unused) u_int slabs, pages; if ((zone->uz_flags & UMA_ZFLAG_HASH) == 0) - goto update_wss; + goto trim; keg = zone->uz_keg; @@ -1113,14 +1154,18 @@ zone_timeout(uma_zone_t zone, void *unused) KEG_UNLOCK(keg, 0); hash_free(&oldhash); - goto update_wss; + goto trim; } } KEG_UNLOCK(keg, 0); -update_wss: - for (int i = 0; i < vm_ndomains; i++) - zone_domain_update_wss(ZDOM_GET(zone, i)); +trim: + /* Trim caches not used for a long time. */ + for (int i = 0; i < vm_ndomains; i++) { + if (bucket_cache_reclaim_domain(zone, false, false, i) && + (zone->uz_flags & UMA_ZFLAG_CACHE) == 0) + keg_drain(zone->uz_keg, i); + } } /* @@ -1405,12 +1450,13 @@ pcpu_cache_drain_safe(uma_zone_t zone) * requested a drain, otherwise the per-domain caches are trimmed to either * estimated working set size. */ -static void -bucket_cache_reclaim_domain(uma_zone_t zone, bool drain, int domain) +static bool +bucket_cache_reclaim_domain(uma_zone_t zone, bool drain, bool trim, int domain) { uma_zone_domain_t zdom; uma_bucket_t bucket; long target; + bool done = false; /* * The cross bucket is partially filled and not part of @@ -1428,23 +1474,35 @@ bucket_cache_reclaim_domain(uma_zone_t zone, bool drain, int domain) /* * If we were asked to drain the zone, we are done only once - * this bucket cache is empty. Otherwise, we reclaim items in - * excess of the zone's estimated working set size. If the - * difference nitems - imin is larger than the WSS estimate, - * then the estimate will grow at the end of this interval and - * we ignore the historical average. + * this bucket cache is empty. If trim, we reclaim items in + * excess of the zone's estimated working set size. Multiple + * consecutive calls will shrink the WSS and so reclaim more. + * If neither drain nor trim, then voluntarily reclaim 1/4 + * (to reduce first spike) of items not used for a long time. */ ZDOM_LOCK(zdom); - target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - - zdom->uzd_imin); - while (zdom->uzd_nitems > target) { + zone_domain_update_wss(zdom); + if (drain) + target = 0; + else if (trim) + target = zdom->uzd_wss; + else if (zdom->uzd_timin > 900 / UMA_TIMEOUT) + target = zdom->uzd_nitems - zdom->uzd_limin / 4; + else { + ZDOM_UNLOCK(zdom); + return (done); + } + while ((bucket = STAILQ_FIRST(&zdom->uzd_buckets)) != NULL && + zdom->uzd_nitems >= target + bucket->ub_cnt) { bucket = zone_fetch_bucket(zone, zdom, true); if (bucket == NULL) break; bucket_free(zone, bucket, NULL); + done = true; ZDOM_LOCK(zdom); } ZDOM_UNLOCK(zdom); + return (done); } static void @@ -1461,10 +1519,10 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain, int domain) if (domain != UMA_ANYDOMAIN && (zone->uz_flags & UMA_ZONE_ROUNDROBIN) == 0) { - bucket_cache_reclaim_domain(zone, drain, domain); + bucket_cache_reclaim_domain(zone, drain, true, domain); } else { for (i = 0; i < vm_ndomains; i++) - bucket_cache_reclaim_domain(zone, drain, i); + bucket_cache_reclaim_domain(zone, drain, true, i); } } @@ -2611,9 +2669,18 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "imin", CTLFLAG_RD, &zdom->uzd_imin, "minimum item count in this period"); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "bimin", CTLFLAG_RD, &zdom->uzd_bimin, + "Minimum item count in this batch"); SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "wss", CTLFLAG_RD, &zdom->uzd_wss, "Working set size"); + SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "limin", CTLFLAG_RD, &zdom->uzd_limin, + "Long time minimum item count"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "timin", CTLFLAG_RD, &zdom->uzd_timin, 0, + "Time since zero long time minimum item count"); } /* @@ -3642,7 +3709,7 @@ cache_alloc(uma_zone_t zone, uma_cache_t cache, void *udata, int flags) * We lost the race, release this bucket and start over. */ critical_exit(); - zone_put_bucket(zone, domain, bucket, udata, false); + zone_put_bucket(zone, domain, bucket, udata, !new); critical_enter(); return (true); diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index 93910e78165b..d4b43a61f29e 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -445,7 +445,10 @@ struct uma_zone_domain { long uzd_nitems; /* total item count */ long uzd_imax; /* maximum item count this period */ long uzd_imin; /* minimum item count this period */ + long uzd_bimin; /* Minimum item count this batch. */ long uzd_wss; /* working set size estimate */ + long uzd_limin; /* Longtime minimum item count. */ + u_int uzd_timin; /* Time since uzd_limin == 0. */ smr_seq_t uzd_seq; /* Lowest queued seq. */ struct mtx uzd_lock; /* Lock for the domain */ } __aligned(CACHE_LINE_SIZE);