From owner-dev-commits-src-all@freebsd.org Mon Apr 26 01:01:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 01:10:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 05:07:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 05:10:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 07:24:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 08:13:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46A615F825A; Mon, 26 Apr 2021 08:13:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTHhw1ZWxz55VB; Mon, 26 Apr 2021 08:13: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 2908123FA2; Mon, 26 Apr 2021 08:13: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 13Q8Da8V009294; Mon, 26 Apr 2021 08:13:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q8DanI009293; Mon, 26 Apr 2021 08:13:36 GMT (envelope-from git) Date: Mon, 26 Apr 2021 08:13:36 GMT Message-Id: <202104260813.13Q8DanI009293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8859f73a0309 - stable/13 - linuxkpi: some style, wrap too long lines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8859f73a030960ffee51dfb64ec292c2eaac421b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 08:13:36 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8859f73a030960ffee51dfb64ec292c2eaac421b commit 8859f73a030960ffee51dfb64ec292c2eaac421b Author: Konstantin Belousov AuthorDate: 2021-03-11 06:08:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-26 07:08:10 +0000 linuxkpi: some style, wrap too long lines (cherry picked from commit 4ce1f6162e9eb576ac40f24b8538f55e83ef5eb4) --- sys/compat/linuxkpi/common/src/linux_current.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 611d10df3383..081eab8edab1 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -236,7 +236,8 @@ linux_current_init(void *arg __unused) linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); } -SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_init, NULL); +SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, + linux_current_init, NULL); static void linux_current_uninit(void *arg __unused) @@ -260,4 +261,5 @@ linux_current_uninit(void *arg __unused) EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); lkpi_alloc_current = linux_alloc_current_noop; } -SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); +SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, + linux_current_uninit, NULL); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 08:13:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8ADE5F8783; Mon, 26 Apr 2021 08:13: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 4FTHhy4dmNz55Xs; Mon, 26 Apr 2021 08:13: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 6D50623FA4; Mon, 26 Apr 2021 08:13: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 13Q8DcjJ009336; Mon, 26 Apr 2021 08:13:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q8DcEr009335; Mon, 26 Apr 2021 08:13:38 GMT (envelope-from git) Date: Mon, 26 Apr 2021 08:13:38 GMT Message-Id: <202104260813.13Q8DcEr009335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e284a6234ffb - stable/13 - linuxkpi: reduce number of stray mm_struct allocations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e284a6234ffb946d083e7239512c27855019f2c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 08:13:38 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e284a6234ffb946d083e7239512c27855019f2c9 commit e284a6234ffb946d083e7239512c27855019f2c9 Author: Konstantin Belousov AuthorDate: 2021-03-11 06:48:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-26 07:10:13 +0000 linuxkpi: reduce number of stray mm_struct allocations (cherry picked from commit fad437ba612a7c19f5cf1633e2d0d1c44d4dd478) --- sys/compat/linuxkpi/common/src/linux_current.c | 85 +++++++++++++++----------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index ef51acc1952e..9bae7ee92e49 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -48,15 +48,35 @@ static eventhandler_tag linuxkpi_thread_dtor_tag; static uma_zone_t linux_current_zone; static uma_zone_t linux_mm_zone; +/* check if another thread already has a mm_struct */ +static struct mm_struct * +find_other_mm(struct proc *p) +{ + struct thread *td; + struct task_struct *ts; + struct mm_struct *mm; + + PROC_LOCK_ASSERT(p, MA_OWNED); + FOREACH_THREAD_IN_PROC(p, td) { + ts = td->td_lkpi_task; + if (ts == NULL) + continue; + mm = ts->mm; + if (mm == NULL) + continue; + /* try to share other mm_struct */ + if (atomic_inc_not_zero(&mm->mm_users)) + return (mm); + } + return (NULL); +} + int linux_alloc_current(struct thread *td, int flags) { struct proc *proc; - struct thread *td_other; struct task_struct *ts; - struct task_struct *ts_other; - struct mm_struct *mm; - struct mm_struct *mm_other; + struct mm_struct *mm, *mm_other; MPASS(td->td_lkpi_task == NULL); @@ -71,14 +91,7 @@ linux_alloc_current(struct thread *td, int flags) panic("linux_alloc_current: failed to allocate task"); return (ENOMEM); } - - mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); - if (mm == NULL) { - if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) - panic("linux_alloc_current: failed to allocate mm"); - uma_zfree(linux_current_zone, mm); - return (ENOMEM); - } + mm = NULL; /* setup new task structure */ atomic_set(&ts->kthread_flags, 0); @@ -93,35 +106,37 @@ linux_alloc_current(struct thread *td, int flags) proc = td->td_proc; - /* check if another thread already has a mm_struct */ PROC_LOCK(proc); - FOREACH_THREAD_IN_PROC(proc, td_other) { - ts_other = td_other->td_lkpi_task; - if (ts_other == NULL) - continue; + mm_other = find_other_mm(proc); - mm_other = ts_other->mm; - if (mm_other == NULL) - continue; + /* use allocated mm_struct as a fallback */ + if (mm_other == NULL) { + PROC_UNLOCK(proc); + mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); + if (mm == NULL) { + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic( + "linux_alloc_current: failed to allocate mm"); + uma_zfree(linux_current_zone, mm); + return (ENOMEM); + } - /* try to share other mm_struct */ - if (atomic_inc_not_zero(&mm_other->mm_users)) { + PROC_LOCK(proc); + mm_other = find_other_mm(proc); + if (mm_other == NULL) { + /* setup new mm_struct */ + init_rwsem(&mm->mmap_sem); + atomic_set(&mm->mm_count, 1); + atomic_set(&mm->mm_users, 1); /* set mm_struct pointer */ + ts->mm = mm; + /* clear pointer to not free memory */ + mm = NULL; + } else { ts->mm = mm_other; - break; } - } - - /* use allocated mm_struct as a fallback */ - if (ts->mm == NULL) { - /* setup new mm_struct */ - init_rwsem(&mm->mmap_sem); - atomic_set(&mm->mm_count, 1); - atomic_set(&mm->mm_users, 1); - /* set mm_struct pointer */ - ts->mm = mm; - /* clear pointer to not free memory */ - mm = NULL; + } else { + ts->mm = mm_other; } /* store pointer to task struct */ From owner-dev-commits-src-all@freebsd.org Mon Apr 26 08:13:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73B285F7FE3; Mon, 26 Apr 2021 08:13: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 4FTHhx2g3pz55VF; Mon, 26 Apr 2021 08:13: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 426CC23FA3; Mon, 26 Apr 2021 08:13: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 13Q8DbSo009315; Mon, 26 Apr 2021 08:13:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q8Dbri009314; Mon, 26 Apr 2021 08:13:37 GMT (envelope-from git) Date: Mon, 26 Apr 2021 08:13:37 GMT Message-Id: <202104260813.13Q8Dbri009314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 389b4dd70e0d - stable/13 - linuxkpi: guarantee allocations of task and mm for interrupt threads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 389b4dd70e0ddf0e4bdd7c3699909838cd0d8171 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 08:13:37 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=389b4dd70e0ddf0e4bdd7c3699909838cd0d8171 commit 389b4dd70e0ddf0e4bdd7c3699909838cd0d8171 Author: Konstantin Belousov AuthorDate: 2021-03-11 06:34:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-26 07:10:07 +0000 linuxkpi: guarantee allocations of task and mm for interrupt threads (cherry picked from commit 165ba13fb806c8596f868981883631a5ee78d6c8) --- sys/compat/linuxkpi/common/src/linux_current.c | 66 ++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 081eab8edab1..ef51acc1952e 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -31,14 +31,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include +#include + +#if defined(__i386__) || defined(__amd64__) +extern u_int first_msi_irq, num_msi_irqs; +#endif static eventhandler_tag linuxkpi_thread_dtor_tag; -static MALLOC_DEFINE(M_LINUX_CURRENT, "linuxcurrent", "LinuxKPI task structure"); +static uma_zone_t linux_current_zone; +static uma_zone_t linux_mm_zone; int linux_alloc_current(struct thread *td, int flags) @@ -52,13 +60,23 @@ linux_alloc_current(struct thread *td, int flags) MPASS(td->td_lkpi_task == NULL); - ts = malloc(sizeof(*ts), M_LINUX_CURRENT, flags | M_ZERO); - if (ts == NULL) + if ((td->td_pflags & TDP_ITHREAD) != 0 || !THREAD_CAN_SLEEP()) { + flags &= ~M_WAITOK; + flags |= M_NOWAIT | M_USE_RESERVE; + } + + ts = uma_zalloc(linux_current_zone, flags | M_ZERO); + if (ts == NULL) { + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic("linux_alloc_current: failed to allocate task"); return (ENOMEM); + } - mm = malloc(sizeof(*mm), M_LINUX_CURRENT, flags | M_ZERO); + mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); if (mm == NULL) { - free(ts, M_LINUX_CURRENT); + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic("linux_alloc_current: failed to allocate mm"); + uma_zfree(linux_current_zone, mm); return (ENOMEM); } @@ -111,7 +129,7 @@ linux_alloc_current(struct thread *td, int flags) PROC_UNLOCK(proc); /* free mm_struct pointer, if any */ - free(mm, M_LINUX_CURRENT); + uma_zfree(linux_mm_zone, mm); return (0); } @@ -132,14 +150,14 @@ linux_get_task_mm(struct task_struct *task) void linux_mm_dtor(struct mm_struct *mm) { - free(mm, M_LINUX_CURRENT); + uma_zfree(linux_mm_zone, mm); } void linux_free_current(struct task_struct *ts) { mmput(ts->mm); - free(ts, M_LINUX_CURRENT); + uma_zfree(linux_current_zone, ts); } static void @@ -229,12 +247,42 @@ linux_task_exiting(struct task_struct *task) return (ret); } +static int lkpi_task_resrv; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, task_struct_reserve, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &lkpi_task_resrv, 0, + "Number of struct task and struct mm to reserve for non-sleepable " + "allocations"); + static void linux_current_init(void *arg __unused) { lkpi_alloc_current = linux_alloc_current; linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); + + TUNABLE_INT_FETCH("compat.linuxkpi.task_struct_reserve", + &lkpi_task_resrv); + if (lkpi_task_resrv == 0) { +#if defined(__i386__) || defined(__amd64__) + /* + * Number of interrupt threads plus per-cpu callout + * SWI threads. + */ + lkpi_task_resrv = first_msi_irq + num_msi_irqs + MAXCPU; +#else + lkpi_task_resrv = 1024; /* XXXKIB arbitrary */ +#endif + } + linux_current_zone = uma_zcreate("lkpicurr", + sizeof(struct task_struct), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + uma_zone_reserve(linux_current_zone, lkpi_task_resrv); + uma_prealloc(linux_current_zone, lkpi_task_resrv); + linux_mm_zone = uma_zcreate("lkpimm", + sizeof(struct task_struct), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + uma_zone_reserve(linux_mm_zone, lkpi_task_resrv); + uma_prealloc(linux_mm_zone, lkpi_task_resrv); } SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_init, NULL); @@ -260,6 +308,8 @@ linux_current_uninit(void *arg __unused) sx_sunlock(&allproc_lock); EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); lkpi_alloc_current = linux_alloc_current_noop; + uma_zdestroy(linux_current_zone); + uma_zdestroy(linux_mm_zone); } SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:11:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 614845F96DB; Mon, 26 Apr 2021 09:11: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 4FTK0H2MXYz57jk; Mon, 26 Apr 2021 09:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4463624C24; Mon, 26 Apr 2021 09:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13Q9Bx3D091124; Mon, 26 Apr 2021 09:11:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9BxOS091123; Mon, 26 Apr 2021 09:11:59 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:11:59 GMT Message-Id: <202104260911.13Q9BxOS091123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 45645b05b887 - stable/13 - Fib algo: extend KPI by allowing algo to set datapath pointers. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 45645b05b887f9bc38b2350ae5334a4e8f47ebbb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:11:59 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=45645b05b887f9bc38b2350ae5334a4e8f47ebbb commit 45645b05b887f9bc38b2350ae5334a4e8f47ebbb Author: Alexander V. Chernikov AuthorDate: 2021-04-15 17:44:11 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:48:14 +0000 Fib algo: extend KPI by allowing algo to set datapath pointers. Some algorithms may require updating datapath and control plane algo pointers after the (batched) updates. Export fib_set_datapath_ptr() to allow setting the new datapath function or data pointer from the algo. Add fib_set_algo_ptr() to allow updating algo control plane pointer from the algo. Add fib_epoch_call() epoch(9) wrapper to simplify freeing old datapath state. Reviewed by: zec Differential Revision: https://reviews.freebsd.org/D29799 MFC after: 1 week (cherry picked from commit e2f79d9e518f885bf875f6613e70af39b7c397de) --- sys/net/route/fib_algo.c | 59 ++++++++++++++++++++++++++++++++---------------- sys/net/route/fib_algo.h | 4 +++- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 03c265d28d09..e2b94e645db3 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -163,7 +163,6 @@ struct fib_data { static bool rebuild_fd(struct fib_data *fd); static void rebuild_fd_callout(void *_data); static void destroy_fd_instance_epoch(epoch_context_t ctx); -static enum flm_op_result attach_datapath(struct fib_data *fd); static bool is_idx_free(struct fib_data *fd, uint32_t index); static void set_algo_fixed(struct rib_head *rh); static bool is_algo_fixed(struct rib_head *rh); @@ -763,8 +762,7 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) */ callout_stop(&fd->fd_callout); - epoch_call(net_epoch_preempt, destroy_fd_instance_epoch, - &fd->fd_epoch_ctx); + fib_epoch_call(destroy_fd_instance_epoch, &fd->fd_epoch_ctx); return (0); } @@ -983,8 +981,10 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, for (int i = 0; i < FIB_MAX_TRIES; i++) { result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); - if ((result == FLM_SUCCESS) && attach) - result = attach_datapath(new_fd); + if ((result == FLM_SUCCESS) && attach) { + if (!fib_set_datapath_ptr(new_fd, &new_fd->fd_dp)) + result = FLM_REBUILD; + } if ((prev_fd != NULL) && (prev_fd != orig_fd)) { schedule_destroy_fd_instance(prev_fd, false); @@ -1254,32 +1254,33 @@ get_fib_dp_header(struct fib_dp *dp) /* * Replace per-family index pool @pdp with a new one which * contains updated callback/algo data from @fd. - * Returns 0 on success. + * Returns true on success. */ -static enum flm_op_result -replace_rtables_family(struct fib_dp **pdp, struct fib_data *fd) +static bool +replace_rtables_family(struct fib_dp **pdp, struct fib_data *fd, struct fib_dp *dp) { struct fib_dp_header *new_fdh, *old_fdh; NET_EPOCH_ASSERT(); FD_PRINTF(LOG_DEBUG, fd, "[vnet %p] replace with f:%p arg:%p", - curvnet, fd->fd_dp.f, fd->fd_dp.arg); + curvnet, dp->f, dp->arg); FIB_MOD_LOCK(); old_fdh = get_fib_dp_header(*pdp); + new_fdh = alloc_fib_dp_array(old_fdh->fdh_num_tables, false); FD_PRINTF(LOG_DEBUG, fd, "OLD FDH: %p NEW FDH: %p", old_fdh, new_fdh); if (new_fdh == NULL) { FIB_MOD_UNLOCK(); FD_PRINTF(LOG_WARNING, fd, "error attaching datapath"); - return (FLM_REBUILD); + return (false); } memcpy(&new_fdh->fdh_idx[0], &old_fdh->fdh_idx[0], old_fdh->fdh_num_tables * sizeof(struct fib_dp)); /* Update relevant data structure for @fd */ - new_fdh->fdh_idx[fd->fd_fibnum] = fd->fd_dp; + new_fdh->fdh_idx[fd->fd_fibnum] = *dp; /* Ensure memcpy() writes have completed */ atomic_thread_fence_rel(); @@ -1288,10 +1289,9 @@ replace_rtables_family(struct fib_dp **pdp, struct fib_data *fd) FIB_MOD_UNLOCK(); FD_PRINTF(LOG_DEBUG, fd, "update %p -> %p", old_fdh, new_fdh); - epoch_call(net_epoch_preempt, destroy_fdh_epoch, - &old_fdh->fdh_epoch_ctx); + fib_epoch_call(destroy_fdh_epoch, &old_fdh->fdh_epoch_ctx); - return (FLM_SUCCESS); + return (true); } static struct fib_dp ** @@ -1309,13 +1309,13 @@ get_family_dp_ptr(int family) /* * Make datapath use fib instance @fd */ -static enum flm_op_result -attach_datapath(struct fib_data *fd) +bool +fib_set_datapath_ptr(struct fib_data *fd, struct fib_dp *dp) { struct fib_dp **pdp; pdp = get_family_dp_ptr(fd->fd_family); - return (replace_rtables_family(pdp, fd)); + return (replace_rtables_family(pdp, fd, dp)); } /* @@ -1343,8 +1343,7 @@ grow_rtables_family(struct fib_dp **pdp, uint32_t new_num_tables) FIB_MOD_UNLOCK(); if (old_fdh != NULL) - epoch_call(net_epoch_preempt, destroy_fdh_epoch, - &old_fdh->fdh_epoch_ctx); + fib_epoch_call(destroy_fdh_epoch, &old_fdh->fdh_epoch_ctx); } /* @@ -1375,6 +1374,26 @@ fib_get_rtable_info(struct rib_head *rh, struct rib_rtable_info *rinfo) #endif } +/* + * Updates pointer to the algo data for the @fd. + */ +void +fib_set_algo_ptr(struct fib_data *fd, void *algo_data) +{ + RIB_WLOCK_ASSERT(fd->fd_rh); + + fd->fd_algo_data = algo_data; +} + +/* + * Calls @callback with @ctx after the end of a current epoch. + */ +void +fib_epoch_call(epoch_callback_t callback, epoch_context_t ctx) +{ + epoch_call(net_epoch_preempt, callback, ctx); +} + /* * Accessor to get rib instance @fd is attached to. */ @@ -1473,7 +1492,7 @@ fib_schedule_release_nhop(struct fib_data *fd, struct nhop_object *nh) nrd = malloc(sizeof(struct nhop_release_data), M_TEMP, M_NOWAIT | M_ZERO); if (nrd != NULL) { nrd->nh = nh; - epoch_call(net_epoch_preempt, release_nhop_epoch, &nrd->ctx); + fib_epoch_call(release_nhop_epoch, &nrd->ctx); } else { /* * Unable to allocate memory. Leak nexthop to maintain guarantee diff --git a/sys/net/route/fib_algo.h b/sys/net/route/fib_algo.h index fe66c7ce53d4..0e9994245ca4 100644 --- a/sys/net/route/fib_algo.h +++ b/sys/net/route/fib_algo.h @@ -105,5 +105,7 @@ uint32_t fib_get_nhop_idx(struct fib_data *fd, struct nhop_object *nh); struct nhop_object **fib_get_nhop_array(struct fib_data *fd); void fib_get_rtable_info(struct rib_head *rh, struct rib_rtable_info *rinfo); struct rib_head *fib_get_rh(struct fib_data *fd); - +bool fib_set_datapath_ptr(struct fib_data *fd, struct fib_dp *dp); +void fib_set_algo_ptr(struct fib_data *fd, void *algo_data); +void fib_epoch_call(epoch_callback_t callback, epoch_context_t ctx); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B121A5F96E0; Mon, 26 Apr 2021 09:12: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 4FTK0J47dmz58DV; Mon, 26 Apr 2021 09:12: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 710E824CCE; Mon, 26 Apr 2021 09:12: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 13Q9C0Ha091145; Mon, 26 Apr 2021 09:12:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C0c9091144; Mon, 26 Apr 2021 09:12:00 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:00 GMT Message-Id: <202104260912.13Q9C0c9091144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 98ea411989e5 - stable/13 - Fix typo in rtsock_common.h 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 98ea411989e5143841ad6652ed4828cc1b5563b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:00 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=98ea411989e5143841ad6652ed4828cc1b5563b5 commit 98ea411989e5143841ad6652ed4828cc1b5563b5 Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:24:42 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:48:35 +0000 Fix typo in rtsock_common.h MFC after: 3 days (cherry picked from commit 37c0f4a2077739e735732374d67525cf6de36d21) --- tests/sys/net/routing/rtsock_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/net/routing/rtsock_common.h b/tests/sys/net/routing/rtsock_common.h index 71476d2b5f3c..ae450ac88ba1 100644 --- a/tests/sys/net/routing/rtsock_common.h +++ b/tests/sys/net/routing/rtsock_common.h @@ -454,7 +454,7 @@ sa_equal_msg_flags(const struct sockaddr *a, const struct sockaddr *b, char *msg b6 = (const struct sockaddr_in6 *)b; if (!IN6_ARE_ADDR_EQUAL(&a6->sin6_addr, &b6->sin6_addr)) { inet_ntop(AF_INET6, &a6->sin6_addr, a_s, sizeof(a_s)); - inet_ntop(AF_INET6, &b6->sin6_addr, a_s, sizeof(a_s)); + inet_ntop(AF_INET6, &b6->sin6_addr, b_s, sizeof(b_s)); snprintf(msg, sz, "addr diff: %s vs %s", a_s, b_s); return 0; } From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 181DB5F98BC; Mon, 26 Apr 2021 09:12: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 4FTK0K64Dwz57rt; Mon, 26 Apr 2021 09:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9374A247F0; Mon, 26 Apr 2021 09:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13Q9C1vD091174; Mon, 26 Apr 2021 09:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C1uT091173; Mon, 26 Apr 2021 09:12:01 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:01 GMT Message-Id: <202104260912.13Q9C1uT091173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 98a3c20696f8 - stable/13 - Improve error reporting in rtsock.c 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 98a3c20696f81e395e7365b5401a39b8e438e1fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:02 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=98a3c20696f81e395e7365b5401a39b8e438e1fd commit 98a3c20696f81e395e7365b5401a39b8e438e1fd Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:36:41 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:48:41 +0000 Improve error reporting in rtsock.c MFC after: 3 days (cherry picked from commit 758c9d54d44f8ce957570b8c2ef6d1b3f28a792d) --- sys/net/rtsock.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index c0996d318fb2..5194a2a15c1e 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -126,6 +126,9 @@ struct ifa_msghdrl32 { #endif /* COMPAT_FREEBSD32 */ +#define RTS_PID_PRINTF(_fmt, ...) \ + printf("rtsock:%s(): PID %d: " _fmt "\n", __func__, curproc->p_pid, ## __VA_ARGS__) + MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); /* NB: these are not modified */ @@ -571,7 +574,7 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) sa_family_t saf; if (V_loif == NULL) { - printf("Unable to add blackhole/reject nhop without loopback"); + RTS_PID_PRINTF("Unable to add blackhole/reject nhop without loopback"); return (ENOTSUP); } info->rti_ifp = V_loif; @@ -1360,7 +1363,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) { struct sockaddr_in *gw_sin = (struct sockaddr_in *)gw; if (gw_sin->sin_len < sizeof(struct sockaddr_in)) { - printf("gw sin_len too small\n"); + RTS_PID_PRINTF("gateway sin_len too small: %d", gw->sa_len); return (EINVAL); } fill_sockaddr_inet(gw_sin, gw_sin->sin_addr); @@ -1372,7 +1375,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) { struct sockaddr_in6 *gw_sin6 = (struct sockaddr_in6 *)gw; if (gw_sin6->sin6_len < sizeof(struct sockaddr_in6)) { - printf("gw sin6_len too small\n"); + RTS_PID_PRINTF("gateway sin6_len too small: %d", gw->sa_len); return (EINVAL); } fill_sockaddr_inet6(gw_sin6, &gw_sin6->sin6_addr, 0); @@ -1386,7 +1389,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) size_t sdl_min_len = offsetof(struct sockaddr_dl, sdl_data); gw_sdl = (struct sockaddr_dl *)gw; if (gw_sdl->sdl_len < sdl_min_len) { - printf("gw sdl_len too small\n"); + RTS_PID_PRINTF("gateway sdl_len too small: %d", gw_sdl->sdl_len); return (EINVAL); } @@ -1433,7 +1436,7 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info) return (EINVAL); } if (mask_sa && mask_sa->sin_len < sizeof(struct sockaddr_in)) { - printf("mask sin_len too small\n"); + RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); return (EINVAL); } fill_sockaddr_inet(dst_sa, dst); @@ -1466,11 +1469,11 @@ cleanup_xaddrs_inet6(struct rt_addrinfo *info) IN6_MASK_ADDR(&dst_sa->sin6_addr, &mask); if (dst_sa->sin6_len < sizeof(struct sockaddr_in6)) { - printf("dst sin6_len too small\n"); + RTS_PID_PRINTF("prefix dst sin6_len too small: %d", dst_sa->sin6_len); return (EINVAL); } if (mask_sa && mask_sa->sin6_len < sizeof(struct sockaddr_in6)) { - printf("mask sin6_len too small\n"); + RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); return (EINVAL); } fill_sockaddr_inet6(dst_sa, &dst_sa->sin6_addr, 0); @@ -2092,9 +2095,9 @@ rt_dispatch(struct mbuf *m, sa_family_t saf) } /* - * Checks if rte can be exported v.r.t jails/vnets. + * Checks if rte can be exported w.r.t jails/vnets. * - * Returns 1 if it can, 0 otherwise. + * Returns true if it can, false otherwise. */ static bool can_export_rte(struct ucred *td_ucred, bool rt_is_host, From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EEA55F9B3D; Mon, 26 Apr 2021 09:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTK0L5xG6z585N; Mon, 26 Apr 2021 09:12: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 A007124B5D; Mon, 26 Apr 2021 09:12: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 13Q9C2df091198; Mon, 26 Apr 2021 09:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C2kA091197; Mon, 26 Apr 2021 09:12:02 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:02 GMT Message-Id: <202104260912.13Q9C2kA091197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6f1e5d9169a9 - stable/13 - Relax rtsock message restrictions. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6f1e5d9169a9cbd65b480cb7c1012c3360d2ba06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:03 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6f1e5d9169a9cbd65b480cb7c1012c3360d2ba06 commit 6f1e5d9169a9cbd65b480cb7c1012c3360d2ba06 Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:49:18 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:48:47 +0000 Relax rtsock message restrictions. Address multiple issues with strict rtsock message validation. D28668 "normalisation" approach was based on the assumption that we always have at least "standard" sockaddr len. It turned out to be false - certain older applications like quagga or routed abuse sin[6]_len field and set it to the offset to the first fully-zero bit in the mask. It is impossible to normalise such sockaddrs without reallocation. With that in mind, change the approach to use a distinct memory buffer for the altered sockaddrs. This allows supporting the older software while maintaining the guarantee on the "standard" sockaddrs. PR: 255273,255089 Differential Revision: https://reviews.freebsd.org/D29826 MFC after: 3 days (cherry picked from commit b31fbebeb3d59af359a3417cddfbcf666b2c56c9) --- sys/net/rtsock.c | 271 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 177 insertions(+), 94 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 5194a2a15c1e..b7a7e5170c74 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -126,6 +126,13 @@ struct ifa_msghdrl32 { #endif /* COMPAT_FREEBSD32 */ +struct linear_buffer { + char *base; /* Base allocated memory pointer */ + uint32_t offset; /* Currently used offset */ + uint32_t size; /* Total buffer size */ +}; +#define SCRATCH_BUFFER_SIZE 1024 + #define RTS_PID_PRINTF(_fmt, ...) \ printf("rtsock:%s(): PID %d: " _fmt "\n", __func__, curproc->p_pid, ## __VA_ARGS__) @@ -177,7 +184,7 @@ static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *plen); static int rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo); -static int cleanup_xaddrs(struct rt_addrinfo *info); +static int cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb); static int sysctl_dumpentry(struct rtentry *rt, void *vw); static int sysctl_dumpnhop(struct rtentry *rt, struct nhop_object *nh, uint32_t weight, struct walkarg *w); @@ -621,7 +628,8 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) * Returns 0 on success. */ static int -fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo *info) +fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fibnum, + struct rt_addrinfo *info) { int error; sa_family_t saf; @@ -641,7 +649,7 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo * return (EINVAL); info->rti_flags = rtm->rtm_flags; - error = cleanup_xaddrs(info); + error = cleanup_xaddrs(info, lb); if (error != 0) return (error); saf = info->rti_info[RTAX_DST]->sa_family; @@ -878,6 +886,45 @@ export_rtaddrs(const struct rtentry *rt, struct sockaddr *dst, #endif } +static int +update_rtm_from_info(struct rt_addrinfo *info, struct rt_msghdr **prtm, + int alloc_len) +{ + struct rt_msghdr *rtm, *orig_rtm = NULL; + struct walkarg w; + int len; + + rtm = *prtm; + /* Check if we need to realloc storage */ + rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); + if (len > alloc_len) { + struct rt_msghdr *tmp_rtm; + + tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); + if (tmp_rtm == NULL) + return (ENOBUFS); + bcopy(rtm, tmp_rtm, rtm->rtm_msglen); + orig_rtm = rtm; + rtm = tmp_rtm; + alloc_len = len; + + /* + * Delay freeing original rtm as info contains + * data referencing it. + */ + } + + w.w_tmem = (caddr_t)rtm; + w.w_tmemsize = alloc_len; + rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); + rtm->rtm_addrs = info->rti_addrs; + + if (orig_rtm != NULL) + free(orig_rtm, M_TEMP); + *prtm = rtm; + return (0); +} + /* * Update sockaddrs, flags, etc in @prtm based on @rc data. @@ -891,11 +938,10 @@ static int update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, int alloc_len, struct rib_cmd_info *rc, struct nhop_object *nh) { - struct walkarg w; union sockaddr_union saun; - struct rt_msghdr *rtm, *orig_rtm = NULL; + struct rt_msghdr *rtm; struct ifnet *ifp; - int error, len; + int error; rtm = *prtm; union sockaddr_union sa_dst, sa_mask; @@ -927,28 +973,8 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, } else if (ifp != NULL) rtm->rtm_index = ifp->if_index; - /* Check if we need to realloc storage */ - rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); - if (len > alloc_len) { - struct rt_msghdr *tmp_rtm; - - tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); - if (tmp_rtm == NULL) - return (ENOBUFS); - bcopy(rtm, tmp_rtm, rtm->rtm_msglen); - orig_rtm = rtm; - rtm = tmp_rtm; - alloc_len = len; - - /* - * Delay freeing original rtm as info contains - * data referencing it. - */ - } - - w.w_tmem = (caddr_t)rtm; - w.w_tmemsize = alloc_len; - rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); + if ((error = update_rtm_from_info(info, prtm, alloc_len)) != 0) + return (error); rtm->rtm_flags = rc->rc_rt->rte_flags | nhop_get_rtflags(nh); if (rtm->rtm_flags & RTF_GWFLAG_COMPAT) @@ -956,11 +982,6 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, (rtm->rtm_flags & ~RTF_GWFLAG_COMPAT); rt_getmetrics(rc->rc_rt, nh, &rtm->rtm_rmx); rtm->rtm_rmx.rmx_weight = rc->rc_nh_weight; - rtm->rtm_addrs = info->rti_addrs; - - if (orig_rtm != NULL) - free(orig_rtm, M_TEMP); - *prtm = rtm; return (0); } @@ -985,6 +1006,17 @@ save_add_notification(struct rib_cmd_info *rc, void *_cbdata) } #endif +static struct sockaddr * +alloc_sockaddr_aligned(struct linear_buffer *lb, int len) +{ + len |= (sizeof(uint64_t) - 1); + if (lb->offset + len > lb->size) + return (NULL); + struct sockaddr *sa = (struct sockaddr *)(lb->base + lb->offset); + lb->offset += len; + return (sa); +} + /*ARGSUSED*/ static int route_output(struct mbuf *m, struct socket *so, ...) @@ -1022,12 +1054,17 @@ route_output(struct mbuf *m, struct socket *so, ...) * buffer aligned on 1k boundaty. */ alloc_len = roundup2(len, 1024); - if ((rtm = malloc(alloc_len, M_TEMP, M_NOWAIT)) == NULL) + int total_len = alloc_len + SCRATCH_BUFFER_SIZE; + if ((rtm = malloc(total_len, M_TEMP, M_NOWAIT)) == NULL) senderr(ENOBUFS); m_copydata(m, 0, len, (caddr_t)rtm); bzero(&info, sizeof(info)); nh = NULL; + struct linear_buffer lb = { + .base = (char *)rtm + alloc_len, + .size = SCRATCH_BUFFER_SIZE, + }; if (rtm->rtm_version != RTM_VERSION) { /* Do not touch message since format is unknown */ @@ -1042,19 +1079,19 @@ route_output(struct mbuf *m, struct socket *so, ...) * caller PID and error value. */ - if ((error = fill_addrinfo(rtm, len, fibnum, &info)) != 0) { + if ((error = fill_addrinfo(rtm, len, &lb, fibnum, &info)) != 0) { senderr(error); } + /* fill_addringo() embeds scope into IPv6 addresses */ +#ifdef INET6 + rti_need_deembed = 1; +#endif saf = info.rti_info[RTAX_DST]->sa_family; /* support for new ARP code */ if (rtm->rtm_flags & RTF_LLDATA) { error = lla_rt_output(rtm, &info); -#ifdef INET6 - if (error == 0) - rti_need_deembed = 1; -#endif goto flush; } @@ -1067,7 +1104,6 @@ route_output(struct mbuf *m, struct socket *so, ...) error = EINVAL; if (error != 0) senderr(error); - /* TODO: rebuild rtm from scratch */ } switch (rtm->rtm_type) { @@ -1079,9 +1115,6 @@ route_output(struct mbuf *m, struct socket *so, ...) } error = rib_action(fibnum, rtm->rtm_type, &info, &rc); if (error == 0) { -#ifdef INET6 - rti_need_deembed = 1; -#endif #ifdef ROUTE_MPATH if (NH_IS_NHGRP(rc.rc_nh_new) || (rc.rc_nh_old && NH_IS_NHGRP(rc.rc_nh_old))) { @@ -1110,12 +1143,7 @@ route_output(struct mbuf *m, struct socket *so, ...) } #endif nh = rc.rc_nh_old; - goto report; } -#ifdef INET6 - /* rt_msg2() will not be used when RTM_DELETE fails. */ - rti_need_deembed = 1; -#endif break; case RTM_GET: @@ -1124,13 +1152,18 @@ route_output(struct mbuf *m, struct socket *so, ...) senderr(error); nh = rc.rc_nh_new; -report: if (!can_export_rte(curthread->td_ucred, info.rti_info[RTAX_NETMASK] == NULL, info.rti_info[RTAX_DST])) { senderr(ESRCH); } + break; + default: + senderr(EOPNOTSUPP); + } + + if (error == 0) { error = update_rtm_from_rc(&info, &rtm, alloc_len, &rc, nh); /* * Note that some sockaddr pointers may have changed to @@ -1147,12 +1180,6 @@ report: #ifdef INET6 rti_need_deembed = 0; #endif - if (error != 0) - senderr(error); - break; - - default: - senderr(EOPNOTSUPP); } flush: @@ -1174,6 +1201,10 @@ flush: bcopy(sin6, info.rti_info[i], sizeof(*sin6)); } + if (update_rtm_from_info(&info, &rtm, alloc_len) != 0) { + if (error != 0) + error = ENOBUFS; + } } } #endif @@ -1350,9 +1381,10 @@ cleanup_xaddrs_lladdr(struct rt_addrinfo *info) } static int -cleanup_xaddrs_gateway(struct rt_addrinfo *info) +cleanup_xaddrs_gateway(struct rt_addrinfo *info, struct linear_buffer *lb) { struct sockaddr *gw = info->rti_info[RTAX_GATEWAY]; + struct sockaddr *sa; if (info->rti_flags & RTF_LLDATA) return (cleanup_xaddrs_lladdr(info)); @@ -1362,11 +1394,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) case AF_INET: { struct sockaddr_in *gw_sin = (struct sockaddr_in *)gw; - if (gw_sin->sin_len < sizeof(struct sockaddr_in)) { + + /* Ensure reads do not go beyoud SA boundary */ + if (SA_SIZE(gw) < offsetof(struct sockaddr_in, sin_zero)) { RTS_PID_PRINTF("gateway sin_len too small: %d", gw->sa_len); return (EINVAL); } - fill_sockaddr_inet(gw_sin, gw_sin->sin_addr); + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_in)); + if (sa == NULL) + return (ENOBUFS); + fill_sockaddr_inet((struct sockaddr_in *)sa, gw_sin->sin_addr); + info->rti_info[RTAX_GATEWAY] = sa; } break; #endif @@ -1392,13 +1430,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) RTS_PID_PRINTF("gateway sdl_len too small: %d", gw_sdl->sdl_len); return (EINVAL); } + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_dl_short)); + if (sa == NULL) + return (ENOBUFS); const struct sockaddr_dl_short sdl = { .sdl_family = AF_LINK, - .sdl_len = sdl_min_len, + .sdl_len = sizeof(struct sockaddr_dl_short), .sdl_index = gw_sdl->sdl_index, }; - memcpy(gw_sdl, &sdl, sdl_min_len); + *((struct sockaddr_dl_short *)sa) = sdl; + info->rti_info[RTAX_GATEWAY] = sa; break; } } @@ -1416,39 +1458,57 @@ remove_netmask(struct rt_addrinfo *info) #ifdef INET static int -cleanup_xaddrs_inet(struct rt_addrinfo *info) +cleanup_xaddrs_inet(struct rt_addrinfo *info, struct linear_buffer *lb) { struct sockaddr_in *dst_sa, *mask_sa; + const int sa_len = sizeof(struct sockaddr_in); + struct in_addr dst, mask; /* Check & fixup dst/netmask combination first */ dst_sa = (struct sockaddr_in *)info->rti_info[RTAX_DST]; mask_sa = (struct sockaddr_in *)info->rti_info[RTAX_NETMASK]; - struct in_addr mask = { - .s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST, - }; - struct in_addr dst = { - .s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)) - }; - - if (dst_sa->sin_len < sizeof(struct sockaddr_in)) { - printf("dst sin_len too small\n"); + /* Ensure reads do not go beyound the buffer size */ + if (SA_SIZE(dst_sa) < offsetof(struct sockaddr_in, sin_zero)) return (EINVAL); - } - if (mask_sa && mask_sa->sin_len < sizeof(struct sockaddr_in)) { - RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); - return (EINVAL); - } + + if ((mask_sa != NULL) && mask_sa->sin_len < sizeof(struct sockaddr_in)) { + /* + * Some older routing software encode mask length into the + * sin_len, thus resulting in "truncated" sockaddr. + */ + int len = mask_sa->sin_len - offsetof(struct sockaddr_in, sin_addr); + if (len >= 0) { + mask.s_addr = 0; + if (len > sizeof(struct in_addr)) + len = sizeof(struct in_addr); + memcpy(&mask, &mask_sa->sin_addr, len); + } else { + RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); + return (EINVAL); + } + } else + mask.s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST; + + dst.s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)); + + /* Construct new "clean" dst/mask sockaddresses */ + if ((dst_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); fill_sockaddr_inet(dst_sa, dst); + info->rti_info[RTAX_DST] = (struct sockaddr *)dst_sa; - if (mask.s_addr != INADDR_BROADCAST) + if (mask.s_addr != INADDR_BROADCAST) { + if ((mask_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); fill_sockaddr_inet(mask_sa, mask); - else + info->rti_info[RTAX_NETMASK] = (struct sockaddr *)mask_sa; + } else remove_netmask(info); /* Check gateway */ if (info->rti_info[RTAX_GATEWAY] != NULL) - return (cleanup_xaddrs_gateway(info)); + return (cleanup_xaddrs_gateway(info, lb)); return (0); } @@ -1456,43 +1516,66 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info) #ifdef INET6 static int -cleanup_xaddrs_inet6(struct rt_addrinfo *info) +cleanup_xaddrs_inet6(struct rt_addrinfo *info, struct linear_buffer *lb) { + struct sockaddr *sa; struct sockaddr_in6 *dst_sa, *mask_sa; - struct in6_addr mask; + struct in6_addr mask, *dst; + const int sa_len = sizeof(struct sockaddr_in6); /* Check & fixup dst/netmask combination first */ dst_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_DST]; mask_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_NETMASK]; - mask = mask_sa ? mask_sa->sin6_addr : in6mask128; - IN6_MASK_ADDR(&dst_sa->sin6_addr, &mask); - if (dst_sa->sin6_len < sizeof(struct sockaddr_in6)) { RTS_PID_PRINTF("prefix dst sin6_len too small: %d", dst_sa->sin6_len); return (EINVAL); } + if (mask_sa && mask_sa->sin6_len < sizeof(struct sockaddr_in6)) { - RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); - return (EINVAL); - } - fill_sockaddr_inet6(dst_sa, &dst_sa->sin6_addr, 0); + /* + * Some older routing software encode mask length into the + * sin6_len, thus resulting in "truncated" sockaddr. + */ + int len = mask_sa->sin6_len - offsetof(struct sockaddr_in6, sin6_addr); + if (len >= 0) { + bzero(&mask, sizeof(mask)); + if (len > sizeof(struct in6_addr)) + len = sizeof(struct in6_addr); + memcpy(&mask, &mask_sa->sin6_addr, len); + } else { + RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); + return (EINVAL); + } + } else + mask = mask_sa ? mask_sa->sin6_addr : in6mask128; - if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) - fill_sockaddr_inet6(mask_sa, &mask, 0); - else + dst = &dst_sa->sin6_addr; + IN6_MASK_ADDR(dst, &mask); + + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, dst, 0); + info->rti_info[RTAX_DST] = sa; + + if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) { + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, &mask, 0); + info->rti_info[RTAX_NETMASK] = sa; + } else remove_netmask(info); /* Check gateway */ if (info->rti_info[RTAX_GATEWAY] != NULL) - return (cleanup_xaddrs_gateway(info)); + return (cleanup_xaddrs_gateway(info, lb)); return (0); } #endif static int -cleanup_xaddrs(struct rt_addrinfo *info) +cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb) { int error = EAFNOSUPPORT; @@ -1511,12 +1594,12 @@ cleanup_xaddrs(struct rt_addrinfo *info) switch (info->rti_info[RTAX_DST]->sa_family) { #ifdef INET case AF_INET: - error = cleanup_xaddrs_inet(info); + error = cleanup_xaddrs_inet(info, lb); break; #endif #ifdef INET6 case AF_INET6: - error = cleanup_xaddrs_inet6(info); + error = cleanup_xaddrs_inet6(info, lb); break; #endif } From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1DC35F96F7; Mon, 26 Apr 2021 09:12: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 4FTK0Q2ByQz58Gp; Mon, 26 Apr 2021 09:12: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 263B524B5E; Mon, 26 Apr 2021 09:12: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 13Q9C5Hh091265; Mon, 26 Apr 2021 09:12:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C5wq091264; Mon, 26 Apr 2021 09:12:05 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:05 GMT Message-Id: <202104260912.13Q9C5wq091264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d2f68847a3ea - stable/13 - [fib algo] Do not print algo attach/detach message on boot 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d2f68847a3ea732e315301ad7e74239445171f14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:06 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d2f68847a3ea732e315301ad7e74239445171f14 commit d2f68847a3ea732e315301ad7e74239445171f14 Author: Alexander V. Chernikov AuthorDate: 2021-04-25 08:51:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:49:33 +0000 [fib algo] Do not print algo attach/detach message on boot MFC after: 1 day (cherry picked from commit c23385612da5dd3195a9b73bfb22bd969dbd26c2) --- sys/net/route/fib_algo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index e2b94e645db3..c93d76c2379b 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -204,7 +204,9 @@ SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, #endif #define _PASS_MSG(_l) (flm_debug_level >= (_l)) -#define ALGO_PRINTF(_fmt, ...) printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__) +#define ALGO_PRINTF(_l, _fmt, ...) if (_PASS_MSG(_l)) { \ + printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__); \ +} #define _ALGO_PRINTF(_fib, _fam, _aname, _gen, _func, _fmt, ...) \ printf("[fib_algo] %s.%u (%s#%u) %s: " _fmt "\n",\ print_family(_fam), _fib, _aname, _gen, _func, ## __VA_ARGS__) @@ -1657,7 +1659,7 @@ fib_module_register(struct fib_lookup_module *flm) { FIB_MOD_LOCK(); - ALGO_PRINTF("attaching %s to %s", flm->flm_name, + ALGO_PRINTF(LOG_INFO, "attaching %s to %s", flm->flm_name, print_family(flm->flm_family)); TAILQ_INSERT_TAIL(&all_algo_list, flm, entries); FIB_MOD_UNLOCK(); @@ -1681,7 +1683,7 @@ fib_module_unregister(struct fib_lookup_module *flm) return (EBUSY); } fib_error_clear_flm(flm); - ALGO_PRINTF("detaching %s from %s", flm->flm_name, + ALGO_PRINTF(LOG_INFO, "detaching %s from %s", flm->flm_name, print_family(flm->flm_family)); TAILQ_REMOVE(&all_algo_list, flm, entries); FIB_MOD_UNLOCK(); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3213D5F9ABC; Mon, 26 Apr 2021 09:12: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 4FTK0P0KbNz580h; Mon, 26 Apr 2021 09:12: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 E1BFD247F2; Mon, 26 Apr 2021 09:12: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 13Q9C4MD091244; Mon, 26 Apr 2021 09:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C4In091243; Mon, 26 Apr 2021 09:12:04 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:04 GMT Message-Id: <202104260912.13Q9C4In091243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 317387218363 - stable/13 - Make gcc happy by initializing error in rib_handle_ifaddr_info(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 317387218363efa38090ca7e33ca8f9b8bfddfc6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:05 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=317387218363efa38090ca7e33ca8f9b8bfddfc6 commit 317387218363efa38090ca7e33ca8f9b8bfddfc6 Author: Alexander V. Chernikov AuthorDate: 2021-04-25 08:44:20 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:49:24 +0000 Make gcc happy by initializing error in rib_handle_ifaddr_info(). (cherry picked from commit a81e2e7890c2fce2a74dbb859e6855e0414a6ea1) --- sys/net/route/route_ifaddrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ifaddrs.c b/sys/net/route/route_ifaddrs.c index 6e264327d66d..853f7f8fbe15 100644 --- a/sys/net/route/route_ifaddrs.c +++ b/sys/net/route/route_ifaddrs.c @@ -100,7 +100,7 @@ rib_handle_ifaddr_one(uint32_t fibnum, int cmd, struct rt_addrinfo *info) int rib_handle_ifaddr_info(uint32_t fibnum, int cmd, struct rt_addrinfo *info) { - int error, last_error = 0; + int error = 0, last_error = 0; bool didwork = false; if (V_rt_add_addr_allfibs == 0) { From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:12:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 688915F9943; Mon, 26 Apr 2021 09:12: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 4FTK0M6fNVz58Dr; Mon, 26 Apr 2021 09:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF92124C26; Mon, 26 Apr 2021 09:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13Q9C3Tv091219; Mon, 26 Apr 2021 09:12:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13Q9C3fd091218; Mon, 26 Apr 2021 09:12:03 GMT (envelope-from git) Date: Mon, 26 Apr 2021 09:12:03 GMT Message-Id: <202104260912.13Q9C3fd091218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: fe04896da3fb - stable/13 - Improve debugging output on routing tests failure. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fe04896da3fbfc6c57154024dee090f365c8f1b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 09:12:04 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=fe04896da3fbfc6c57154024dee090f365c8f1b1 commit fe04896da3fbfc6c57154024dee090f365c8f1b1 Author: Alexander V. Chernikov AuthorDate: 2021-04-23 21:28:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-26 08:49:14 +0000 Improve debugging output on routing tests failure. Most of the routing tests create per-test VNET, making it harder to repeat the failure with CLI tools. Provide an additional route/nexthop data on failure. Differential Revision: https://reviews.freebsd.org/D29957 Reviewed by: kp MFC after: 2 weeks (cherry picked from commit bddae5c8a64dc6b292198945cbe676bb2158d438) --- tests/sys/net/routing/rtsock_print.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/routing/rtsock_print.h b/tests/sys/net/routing/rtsock_print.h index b44fcca25053..20bb1c51bc33 100644 --- a/tests/sys/net/routing/rtsock_print.h +++ b/tests/sys/net/routing/rtsock_print.h @@ -40,7 +40,10 @@ #define RTSOCK_ATF_REQUIRE_MSG(_rtm, _cond, _fmt, ...) do { \ if (!(_cond)) { \ printf("-- CONDITION FAILED, rtm dump --\n\n");\ - rtsock_print_message(_rtm); \ + rtsock_print_message(_rtm); \ + rtsock_print_table(AF_INET); \ + rtsock_print_table(AF_INET6); \ + printf("===================================\n");\ } \ ATF_REQUIRE_MSG(_cond, _fmt, ##__VA_ARGS__); \ } while (0); @@ -381,4 +384,31 @@ rtsock_print_message(struct rt_msghdr *rtm) } } +static void +print_command(char *cmd) +{ + char line[1024]; + + FILE *fp = popen(cmd, "r"); + if (fp != NULL) { + while (fgets(line, sizeof(line), fp) != NULL) + printf("%s", line); + pclose(fp); + } +} + +void +rtsock_print_table(int family) +{ + char cmdbuf[128]; + char *key = (family == AF_INET) ? "4" : "6"; + + snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%srnW", key); + printf("==== %s ===\n", cmdbuf); + print_command(cmdbuf); + snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%sonW", key); + printf("==== %s ===\n", cmdbuf); + print_command(cmdbuf); +} + #endif From owner-dev-commits-src-all@freebsd.org Mon Apr 26 09:23:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 12:28:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 12:28:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 13:39:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CE255E0E8D; Mon, 26 Apr 2021 13:39: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 4FTQxN6yBLz3P7h; Mon, 26 Apr 2021 13:39: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 DD7DB549; Mon, 26 Apr 2021 13:39: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 13QDdqm3039002; Mon, 26 Apr 2021 13:39:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QDdqYH039001; Mon, 26 Apr 2021 13:39:52 GMT (envelope-from git) Date: Mon, 26 Apr 2021 13:39:52 GMT Message-Id: <202104261339.13QDdqYH039001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 061be8f93912 - stable/13 - Fix zgrep --version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 061be8f939129fd5029efe832d1ad3b381edc3b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 13:39:53 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=061be8f939129fd5029efe832d1ad3b381edc3b3 commit 061be8f939129fd5029efe832d1ad3b381edc3b3 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-13 10:12:53 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-26 13:39:54 +0000 Fix zgrep --version "zgrep --version" is expected to print the version information in the same way as "zgrep -V". However, the case handling the --version flag is never reached, so "zgrep --version" prints: zgrep: missing pattern instead of: grep (BSD grep, GNU compatible) 2.6.0-FreeBSD Reviewed by: yuripv Approved by: yuripv (src) Differential Revision: https://reviews.freebsd.org/D29813 (cherry picked from commit 16e0391f8e2124eb85af984204548cf841648db5) --- usr.bin/grep/zgrep.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/grep/zgrep.sh b/usr.bin/grep/zgrep.sh index 105507f23708..bd0e8847e5f6 100755 --- a/usr.bin/grep/zgrep.sh +++ b/usr.bin/grep/zgrep.sh @@ -94,6 +94,9 @@ do silent=1 shift ;; + -V|--version) + exec ${grep} -V + ;; --*) grep_args="${grep_args} $1" shift @@ -128,9 +131,6 @@ do echo "${prg}: the ${1} flag is not currently supported" >&2 exit 1 ;; - -V|--version) - exec ${grep} -V - ;; -*) grep_args="${grep_args} $1" shift From owner-dev-commits-src-all@freebsd.org Mon Apr 26 13:41:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD53E5E0F8D; Mon, 26 Apr 2021 13:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTQyj5VVGz3PP7; Mon, 26 Apr 2021 13:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFC83592; Mon, 26 Apr 2021 13:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QDf15W047367; Mon, 26 Apr 2021 13:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QDf165047366; Mon, 26 Apr 2021 13:41:01 GMT (envelope-from git) Date: Mon, 26 Apr 2021 13:41:01 GMT Message-Id: <202104261341.13QDf165047366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 93c6a3232246 - stable/12 - Fix zgrep --version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 93c6a3232246dd8980cda48adfbe10614665a51f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 13:41:01 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=93c6a3232246dd8980cda48adfbe10614665a51f commit 93c6a3232246dd8980cda48adfbe10614665a51f Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-13 10:12:53 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-26 13:40:59 +0000 Fix zgrep --version "zgrep --version" is expected to print the version information in the same way as "zgrep -V". However, the case handling the --version flag is never reached, so "zgrep --version" prints: zgrep: missing pattern instead of: grep (BSD grep, GNU compatible) 2.6.0-FreeBSD Reviewed by: yuripv Approved by: yuripv (src) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29813 (cherry picked from commit 16e0391f8e2124eb85af984204548cf841648db5) --- usr.bin/grep/zgrep.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/grep/zgrep.sh b/usr.bin/grep/zgrep.sh index 105507f23708..bd0e8847e5f6 100755 --- a/usr.bin/grep/zgrep.sh +++ b/usr.bin/grep/zgrep.sh @@ -94,6 +94,9 @@ do silent=1 shift ;; + -V|--version) + exec ${grep} -V + ;; --*) grep_args="${grep_args} $1" shift @@ -128,9 +131,6 @@ do echo "${prg}: the ${1} flag is not currently supported" >&2 exit 1 ;; - -V|--version) - exec ${grep} -V - ;; -*) grep_args="${grep_args} $1" shift From owner-dev-commits-src-all@freebsd.org Mon Apr 26 13:48:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CACA65E1242; Mon, 26 Apr 2021 13:48: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 4FTR725RZzz3Pmv; Mon, 26 Apr 2021 13:48: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 AE181338; Mon, 26 Apr 2021 13:48: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 13QDmERt052101; Mon, 26 Apr 2021 13:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QDmEMj052100; Mon, 26 Apr 2021 13:48:14 GMT (envelope-from git) Date: Mon, 26 Apr 2021 13:48:14 GMT Message-Id: <202104261348.13QDmEMj052100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 134172279b2e - stable/13 - ports.7: Add an example of setting variables for selected ports MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 134172279b2e88179fa8be4f35b4e4445d266297 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 13:48:14 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=134172279b2e88179fa8be4f35b4e4445d266297 commit 134172279b2e88179fa8be4f35b4e4445d266297 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-01-16 23:10:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-26 13:48:11 +0000 ports.7: Add an example of setting variables for selected ports Reviewed by: crees MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28202 (cherry picked from commit c0e41dff700cf8a4a06000f19bd2342cd6fe284d) --- share/man/man7/ports.7 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index 0ee6ae7ee714..d90a91630e77 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2020 +.Dd April 17, 2021 .Dt PORTS 7 .Os .Sh NAME @@ -631,6 +631,18 @@ shells_zsh_UNSET= DOCS EXAMPLES .Pp These and other options-related variables are documented in .Pa /usr/ports/Mk/bsd.options.mk . +.It Sy Example 5\&: No Setting Xr make 1 Variables for Specific Ports via Xr make.conf 5 +.Pp +The following example shows how to set arbitrary +.Xr make 1 +variables only specific ports: +.Bd -literal -offset 2n +# Set DISABLE_MAKE_JOBS for the lang/rust port: +\&.if ${.CURDIR:M*/lang/rust} +DISABLE_MAKE_JOBS= yes +TRYBROKEN= yes +\&.endif +.Ed .El .Sh SEE ALSO .Xr make 1 , From owner-dev-commits-src-all@freebsd.org Mon Apr 26 14:49:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:15:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:15:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:16:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:18:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:23:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:25:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 15:45:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D77F5E4CE3; Mon, 26 Apr 2021 15:45: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 4FTTjv3gMyz3mYW; Mon, 26 Apr 2021 15:45: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 70C441D79; Mon, 26 Apr 2021 15:45: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 13QFj74Q012920; Mon, 26 Apr 2021 15:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFj77w012919; Mon, 26 Apr 2021 15:45:07 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:45:07 GMT Message-Id: <202104261545.13QFj77w012919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 3e6b8bcf6e8e - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e6b8bcf6e8ee41591e2d27879f0a3baa9ebbb16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:45:07 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3e6b8bcf6e8ee41591e2d27879f0a3baa9ebbb16 commit 3e6b8bcf6e8ee41591e2d27879f0a3baa9ebbb16 Author: Neel Chauhan AuthorDate: 2021-04-26 15:12:18 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:43:37 +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 (cherry picked from commit 057f145aae9a3528ccd722c8f566d740d5cafcbb) --- 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-all@freebsd.org Mon Apr 26 15:45:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6B035E59A5; Mon, 26 Apr 2021 15:45: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 4FTTjw4zqDz3mX2; Mon, 26 Apr 2021 15:45: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 9BC442119; Mon, 26 Apr 2021 15:45: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 13QFj8P5012941; Mon, 26 Apr 2021 15:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFj8vX012940; Mon, 26 Apr 2021 15:45:08 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:45:08 GMT Message-Id: <202104261545.13QFj8vX012940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: da6a8ccfa293 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: da6a8ccfa293c3c831fdde51169754fcb9587657 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:45:08 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=da6a8ccfa293c3c831fdde51169754fcb9587657 commit da6a8ccfa293c3c831fdde51169754fcb9587657 Author: Neel Chauhan AuthorDate: 2021-04-26 15:15:49 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:44:30 +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 (cherry picked from commit ce65353ac1a17677bef03e96df8da967c9086743) --- 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 1930af51f7da..a08ec36f6fcc 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 1300501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Mon Apr 26 15:45:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63B3D5E59B1; Mon, 26 Apr 2021 15:45: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 4FTTjz2J4zz3mTT; Mon, 26 Apr 2021 15:45: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 1738D2188; Mon, 26 Apr 2021 15:45: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 13QFjAml012990; Mon, 26 Apr 2021 15:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFjAYB012989; Mon, 26 Apr 2021 15:45:10 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:45:10 GMT Message-Id: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 9db8b85a942d - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9db8b85a942dd5e73c0c17198835097a30dc1f7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:45:11 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9db8b85a942dd5e73c0c17198835097a30dc1f7c commit 9db8b85a942dd5e73c0c17198835097a30dc1f7c Author: Neel Chauhan AuthorDate: 2021-04-26 15:25:33 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:45:05 +0000 linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() (cherry picked from commit e657f3de6dc29147b5373d2cc2cc47e580931e30) --- 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-all@freebsd.org Mon Apr 26 15:45:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05FEF5E55EF; Mon, 26 Apr 2021 15:45: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 4FTTjx6QJWz3mqX; Mon, 26 Apr 2021 15:45: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 C8B3A2092; Mon, 26 Apr 2021 15:45: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 13QFj9Nl012962; Mon, 26 Apr 2021 15:45:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QFj9oH012961; Mon, 26 Apr 2021 15:45:09 GMT (envelope-from git) Date: Mon, 26 Apr 2021 15:45:09 GMT Message-Id: <202104261545.13QFj9oH012961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 10decb3752ec - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 10decb3752ec3abca302bb81cabd9749c94304fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 15:45:10 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=10decb3752ec3abca302bb81cabd9749c94304fa commit 10decb3752ec3abca302bb81cabd9749c94304fa Author: Neel Chauhan AuthorDate: 2021-04-26 15:16:48 +0000 Commit: Neel Chauhan CommitDate: 2021-04-26 15:44:51 +0000 linuxkpi: Elimiate brackets on return in spinlock.h (cherry picked from commit c8de6e20150a3c10575a27532a25b00342a7f452) --- 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-all@freebsd.org Mon Apr 26 16:02:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 869545E6606 for ; Mon, 26 Apr 2021 16:02:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 4FTV6D384zz3nq7 for ; Mon, 26 Apr 2021 16:02:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x836.google.com with SMTP id g1so254812qtq.6 for ; Mon, 26 Apr 2021 09:02:44 -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=XR/VDl/Qycgc0PemGiiC63ciIZkrshCob6+gu1h4mAo=; b=JgIJToiOknWP4tj/2rrOCafalwUtdFgakJF7kK81DJwqTWRQOIMqjSm/xH25ntuDEX oSnfPKk0JvaMboD8D7Sik8P9PZllEiFL5dePLIzIpbk4I/5nFxzQnBBJ3Lc91Xs3lvOz XEWpP8dIikf27S59BGsnPjftK8HatfpxSNIZTJ0B4w2WnWwSd7iqDMPQPip9J+rmyNHS YRTJNuPm5VVHn+pzyxzR3v4Wd8rkS1WmC1bzY9w1Kpf3eNto9ib6UzxootDGIrohf0WL aIP/d3KmxrUShyGrxGSC0zYX+1O8Z7WIhkna8aOjD5vPosh5ZtgdEXkwsaRF1VbhyG64 hV8A== 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=XR/VDl/Qycgc0PemGiiC63ciIZkrshCob6+gu1h4mAo=; b=XafQ0H8XDgZ3MA9GwmQViS0r6pQnruH/yzAMw0kmpTsvFmUys6jLNmiNXmIXfySjKR +qnDf9SeNJ4B/8gXJll6ftG10P2ktxJGj2W4hvCgGg2ZKANwubZ6CLipWiXFdUGvThhC 5Hgh2EXlA68piwQb0709MU8bh0RlP/IVkOwtScw3NshapnmjhRS8cpY6qhtrstrejhs3 MvecpkI1RJwPwBSp/tbw2dtHBurOw2gMH8Q6AUy4IjERIW63wkDVuG640sd4tfApWNPW DQfnsykKxYOijvGJOYHt1IgWgRlp7+XH6A5RrhzgD5J5Tjq0Q+G8B9G0cToMbHFYwCYZ 5ePQ== X-Gm-Message-State: AOAM533gYPWs9vZbbaYvyTIqVq+5D06BKEEH2v6AL+VeDNL/4ChymCrA 6ylzey231u/NqYpE8QxjyxBh6w== X-Google-Smtp-Source: ABdhPJy5KjoBt7S1AS6CSCTv2hW8izpBeGJR42ANIlTkCq+0tXKL/jVG3tFehpuXZ2IohMTJh8jD7w== X-Received: by 2002:ac8:128a:: with SMTP id y10mr6329629qti.342.1619452963419; Mon, 26 Apr 2021 09:02:43 -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 w67sm371314qkc.79.2021.04.26.09.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 09:02:42 -0700 (PDT) Date: Mon, 26 Apr 2021 12:02:42 -0400 From: Shawn Webb To: Neel Chauhan Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 9db8b85a942d - stable/13 - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() Message-ID: <20210426160242.7nddbshrccusdb5j@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: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t5tgudqqqw2drk3f" Content-Disposition: inline In-Reply-To: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4FTV6D384zz3nq7 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:02:44 -0000 --t5tgudqqqw2drk3f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 26, 2021 at 03:45:10PM +0000, Neel Chauhan wrote: > The branch stable/13 has been updated by nc (ports committer): >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D9db8b85a942dd5e73c0c171988= 35097a30dc1f7c >=20 > commit 9db8b85a942dd5e73c0c17198835097a30dc1f7c > Author: Neel Chauhan > AuthorDate: 2021-04-26 15:25:33 +0000 > Commit: Neel Chauhan > CommitDate: 2021-04-26 15:45:05 +0000 >=20 > linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() > =20 > (cherry picked from commit e657f3de6dc29147b5373d2cc2cc47e580931e30) Hey Neel, Don't commits usually spend some soak time in main before being cherry-picked to stable branches? I'm curious why the lack of soak time here. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --t5tgudqqqw2drk3f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmCG5B8ACgkQ/y5nonf4 4frkTBAAl+5grQIJgZthGS1Si48f6RpLjj5i1Tc9vLycJguhRna0OehkXq7Ajkzq mNrGgpzOXx5ntcK4IBLBcMlOaQsNp9ALqsTNCgSxMBdgIW7WXMTAf2VXnvG4Uw6s 9CV0yFV2a3mA+0RWCGoHV/TVfsRHuhbpNZ6RfwE82hXWckxuCqB8QoRNMgDvXqTS 65bxAqZsLfMsSk9n6lJn7M7k/1j5rWqx85LgO1Srf0NipfAzt4XSbdki6OBLlT56 1lYBpUFkgO9Ll7GWTVLoRT6ddm/VedwMPtq08sESnP/e3I28YEHo7TVzT7YhSiix r2KpZViZoUGHtf5Qn26ngN1mEilQ98afa0Pb8XzUa8IrB7VpzrharwveDd72HOPz BKVOzZVbiF5T61kwxGrwsv2e0/JAjQDdBp1mYUAtZTxraCCxzfeAJFACci1Rcv5s rp+fw1mkp1PHykO9dO8VsqMMiST0nXty/WBw4BbMfaYkzouHB8h7dOR2ojQG2Wtc KnNvbADgRCazppQE2CyDhyiJRrL9weq63FgMaw1fUlxQzzf1RTYgCMHg8w+AK4iw bteCMWdb3xowxbeXREyL+u4vZerFKvLOnn2+AcP7Quwodj+wILUl0C3gcHh0l/kv mUEEHB44GQ398QEsgs8+ruPkvKfNPEmzIdAf7Kz14/KW8LmgF9w= =mcnO -----END PGP SIGNATURE----- --t5tgudqqqw2drk3f-- From owner-dev-commits-src-all@freebsd.org Mon Apr 26 16:08:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:08:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:32:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:37:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:42:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 726DD5E73E8; Mon, 26 Apr 2021 16:42:19 +0000 (UTC) (envelope-from jhb@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 4FTVzv2v4vz3r0G; Mon, 26 Apr 2021 16:42:19 +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 CCA1822309; Mon, 26 Apr 2021 16:42:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 9db8b85a942d - stable/13 - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() To: Shawn Webb , Neel Chauhan Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> <20210426160242.7nddbshrccusdb5j@mutt-hbsd> From: John Baldwin Message-ID: <67e6aa7a-3c1d-1055-d468-b6a366382f04@FreeBSD.org> Date: Mon, 26 Apr 2021 09:42:18 -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: <20210426160242.7nddbshrccusdb5j@mutt-hbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:42:19 -0000 On 4/26/21 9:02 AM, Shawn Webb wrote: > On Mon, Apr 26, 2021 at 03:45:10PM +0000, Neel Chauhan wrote: >> The branch stable/13 has been updated by nc (ports committer): >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=9db8b85a942dd5e73c0c17198835097a30dc1f7c >> >> commit 9db8b85a942dd5e73c0c17198835097a30dc1f7c >> Author: Neel Chauhan >> AuthorDate: 2021-04-26 15:25:33 +0000 >> Commit: Neel Chauhan >> CommitDate: 2021-04-26 15:45:05 +0000 >> >> linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() >> >> (cherry picked from commit e657f3de6dc29147b5373d2cc2cc47e580931e30) > > Hey Neel, > > Don't commits usually spend some soak time in main before being > cherry-picked to stable branches? I'm curious why the lack of soak > time here. I agree. 20 minutes is far too short. The normal minimum is 3 days. You already have feedback on the commits to main that you should probably adjust before merging (specifically Mateusz's quite salient point). Requiring two immediate fixups to the original commit in main is also indicative that the change in question isn't really ready yet. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Mon Apr 26 16:47:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4CB05E77F7 for ; Mon, 26 Apr 2021 16:47:48 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (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 4FTW6D545gz3r7H for ; Mon, 26 Apr 2021 16:47:48 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb32.google.com with SMTP id g38so65653699ybi.12 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=KljJwZ9qxcw18ANbaQQ7vtmAbXF4zw+qhq0/2lBwNd0valcmNAyqkOSDbehGSOB1fR cmtLQRC9XEdbd6jgQ6gW67BCnM1H87yCcckzaXB2xGHzPOLY5P4R9aqAQC0gz5X9IVx6 Xmtc0sYKqk3+1Ec/y26QBreQSU1pvbaZpZeK529Val/JlaGmzpBhtLgPjjSchYIhUmsA C1sD2BsVJ4THEoNx5nI2DDAL1oCEBUGKaN0kXYCq+gWThFwvRjL8gzh57xqydHug+GEo VVb12WPc1TVZYESCX59fNOE7IzOWfpeSpEMUdj5SX2ocGc7HdGol0XJt4xHud6k+FMsD T80A== X-Gm-Message-State: AOAM531ez4bFSjSkWrkbGNY7lzmgpIm4m+fH6r/r49hWT4WtABOgBx7p S8LFirkAVeF45JXemzaLQHk+KJ9Eg4WdBrnrx96o3A== 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: 4FTW6D545gz3r7H 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:49:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E10E95E759E; Mon, 26 Apr 2021 16:49:33 +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 4FTW8F5Zjtz3qlt; Mon, 26 Apr 2021 16:49:33 +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 1DA40EB2A5; Mon, 26 Apr 2021 09:49:26 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 26 Apr 2021 09:49:25 -0700 From: Neel Chauhan To: John Baldwin Cc: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 9db8b85a942d - stable/13 - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() In-Reply-To: <67e6aa7a-3c1d-1055-d468-b6a366382f04@FreeBSD.org> References: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> <20210426160242.7nddbshrccusdb5j@mutt-hbsd> <67e6aa7a-3c1d-1055-d468-b6a366382f04@FreeBSD.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: nc@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FTW8F5Zjtz3qlt 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:49:33 -0000 On 2021-04-26 09:42, John Baldwin wrote: > I agree. 20 minutes is far too short. The normal minimum is 3 days. > You already have feedback on the commits to main that you should > probably adjust before merging (specifically Mateusz's quite salient > point). > Requiring two immediate fixups to the original commit in main is also > indicative that the change in question isn't really ready yet. Sorry about this. I'm new(-ish?) to src. The immediate "fixups" are just formatting changes that were requested, not really bugfixes. -Neel From owner-dev-commits-src-all@freebsd.org Mon Apr 26 16:51:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:51:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 16:57:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0CA5E896C for ; Mon, 26 Apr 2021 16:57:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (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 4FTWKs0THgz3s89 for ; Mon, 26 Apr 2021 16:57:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf33.google.com with SMTP id d1so15973971qvy.11 for ; Mon, 26 Apr 2021 09:57:52 -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=XuNcwb0h/A2WhgK7MzHTqZcy+V9PDnnUk3EsPLDZSfY=; b=dH4vN9rwzz1u78wmQUa0qIAh4aEOW1ARBiKw8YMWR1foB7QKrnW6Ib7roONeE9v1Ox 908Vlq9KLiJtQ8K8ZswhLxhMYrbJK6mgoTAt/r4wV0VMZXlbyjZAIoaFeMt2Jq3/QM1u FU1nPGMyZyHd1I9XvVQKVH6sGuWVDYI2viaAF3hEpj5mZ75pFHRyiCsOIHJNRMARAwPo NkiX76S+nRfB6AMFKSUNmMhqylpZYDSKKuW/6Isii4DzPoWSwjHCtSVFn+v9QJqpQxby /p7CGTXNqWjEOiLOLiEz+ir557mcqD81jDYyoUVtdd9C2vs0b85+xHPWCOEQPHuqjaZj iSDw== 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=XuNcwb0h/A2WhgK7MzHTqZcy+V9PDnnUk3EsPLDZSfY=; b=R+C6UbvLfsiVEnyaTVnZ1qeBIAd7xlp2chjc/dSltw7sgtTavAt1u6EHWSFw2hSBZL wOmKXlUpM/DzEMaEWp2CB9dGZ/zaCMzy8kJTnk0d7Og3hug0rsAk7poqJIkV9xsIkMvR 5yDVHU/rsEkIMAbjj6yy3B9X7lmMP7v8IUnisCA7+sBwq5WQRmXLj+OJjCT8cmCKP5IB obrPp2fKXYE2WXec+HVm4/0HI+HhjBtDC8bC0tvcAbY8ENk2VZwQ+CJc3ZzNRNg9G6id N9d8KpkpC4OKFbvR5UNdBA1V9UOAxoUHq5+585f2VKXulP8X9wTjjvOlNqF/dCmVQVZq +n+Q== X-Gm-Message-State: AOAM533podR+OL9sHsZiudbyWDF+YQiIcQfDMSTPECyM2BsxVflDJ8ca 5gCn66YqDf8WdCt1AbO2YOZVR11uWeXiijUHtecIQw== X-Google-Smtp-Source: ABdhPJyOhgQUTwfnSE5vdpCkQiQbXxwhfeFn7MXS8IYtI5tqG1lz1OqVusrSCU9BsnxNApBVs31asiCSsm1mBaxTXh8= X-Received: by 2002:a0c:9ad7:: with SMTP id k23mr18879256qvf.24.1619456271963; Mon, 26 Apr 2021 09:57:51 -0700 (PDT) MIME-Version: 1.0 References: <202104261545.13QFjAYB012989@gitrepo.freebsd.org> <20210426160242.7nddbshrccusdb5j@mutt-hbsd> <67e6aa7a-3c1d-1055-d468-b6a366382f04@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Mon, 26 Apr 2021 10:57:40 -0600 Message-ID: Subject: Re: git: 9db8b85a942d - stable/13 - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() To: Neel Chauhan Cc: John Baldwin , Shawn Webb , src-committers , "" , dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4FTWKs0THgz3s89 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 16:57:53 -0000 On Mon, Apr 26, 2021 at 10:49 AM Neel Chauhan wrote: > On 2021-04-26 09:42, John Baldwin wrote: > > I agree. 20 minutes is far too short. The normal minimum is 3 days. > > You already have feedback on the commits to main that you should > > probably adjust before merging (specifically Mateusz's quite salient > > point). > > Requiring two immediate fixups to the original commit in main is also > > indicative that the change in question isn't really ready yet. > > Sorry about this. I'm new(-ish?) to src. > > The immediate "fixups" are just formatting changes that were requested, > not really bugfixes. > Only extremely urgent security-related or build-breakage-fixes are to be MFC'd faster than 3 days. At least that's been the rule we've articulated in the past. There's been some flexibility for things that are important, or when racing a release / snapshot schedule (eg a really good reason based on external factors) Warner From owner-dev-commits-src-all@freebsd.org Mon Apr 26 17:43:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 18:55:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 19:00:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE4D25EC067; Mon, 26 Apr 2021 19:00:56 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ3r3ZvRz4Scs; Mon, 26 Apr 2021 19:00:56 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13QJ0rBj099044; Mon, 26 Apr 2021 12:00:53 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13QJ0qHn099043; Mon, 26 Apr 2021 12:00:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104261900.13QJ0qHn099043@gndrsh.dnsmgr.net> Subject: Re: git: 9db8b85a942d - stable/13 - linuxkpi: Remove unneeded {} in atomic_dec_and_lock_irqsave() In-Reply-To: To: Warner Losh Date: Mon, 26 Apr 2021 12:00:52 -0700 (PDT) CC: Neel Chauhan , John Baldwin , Shawn Webb , src-committers , "" , dev-commits-src-branches@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FTZ3r3ZvRz4Scs 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:00:56 -0000 > On Mon, Apr 26, 2021 at 10:49 AM Neel Chauhan wrote: > > > On 2021-04-26 09:42, John Baldwin wrote: > > > I agree. 20 minutes is far too short. The normal minimum is 3 days. > > > You already have feedback on the commits to main that you should > > > probably adjust before merging (specifically Mateusz's quite salient > > > point). > > > Requiring two immediate fixups to the original commit in main is also > > > indicative that the change in question isn't really ready yet. > > > > Sorry about this. I'm new(-ish?) to src. > > > > The immediate "fixups" are just formatting changes that were requested, > > not really bugfixes. > > > > Only extremely urgent security-related or build-breakage-fixes are to be > MFC'd faster than 3 days. > At least that's been the rule we've articulated in the past. There's been > some flexibility for things > that are important, or when racing a release / snapshot schedule (eg a > really good reason based > on external factors) Furthermore the original commit did infact state MFC: 3 days. I was shocked to see the immediate merge, but did flow to the end of the thread before replying. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C1BA5EC517; Mon, 26 Apr 2021 19:03: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 4FTZ761hf8z4SQ0; Mon, 26 Apr 2021 19:03: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 2CC204C33; Mon, 26 Apr 2021 19:03: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 13QJ3kNA079923; Mon, 26 Apr 2021 19:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3khl079922; Mon, 26 Apr 2021 19:03:46 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:46 GMT Message-Id: <202104261903.13QJ3khl079922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8130bdab382d - stable/13 - Handle negative return values from syncache_expand(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8130bdab382da6af59c94d456f2c26f56d86d9d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:46 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8130bdab382da6af59c94d456f2c26f56d86d9d1 commit 8130bdab382da6af59c94d456f2c26f56d86d9d1 Author: John Baldwin AuthorDate: 2021-02-17 21:28:04 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:00 +0000 Handle negative return values from syncache_expand(). These errors do not clear so to NULL, so the existing check was treating these failures as success. The rest of do_pass_establish() then tried to use the listen socket as if it was a connection socket newly created by syncache_expand(). In addition, for negative return values, do not send a RST to the peer. Reported by: Sony Arpita Das @ Chelsio Sponsored by: Chelsio Communications (cherry picked from commit 1deaad936417ed2315476718fbd2648de08585bf) --- sys/dev/cxgbe/tom/t4_listen.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index bd9361d9a165..ba30f2a60120 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -88,7 +88,7 @@ static struct listen_ctx *listen_hash_find(struct adapter *, struct inpcb *); static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *); static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); -static void send_reset_synqe(struct toedev *, struct synq_entry *); +static void send_abort_rpl_synqe(struct toedev *, struct synq_entry *, int); static int alloc_stid(struct adapter *sc, struct listen_ctx *lctx, int isipv6) @@ -391,7 +391,8 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) } static void -send_reset_synqe(struct toedev *tod, struct synq_entry *synqe) +send_abort_rpl_synqe(struct toedev *tod, struct synq_entry *synqe, + int rst_status) { struct adapter *sc = tod->tod_softc; struct wrqe *wr; @@ -419,7 +420,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry *synqe) INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); req->rsvd0 = 0; /* don't have a snd_nxt */ req->rsvd1 = 1; /* no data sent yet */ - req->cmd = CPL_ABORT_SEND_RST; + req->cmd = rst_status; t4_l2t_send(sc, wr, &sc->l2t->l2tab[synqe->params.l2t_idx]); } @@ -1465,6 +1466,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_header *rss, struct in_conninfo inc; struct toepcb *toep; struct epoch_tracker et; + int rstreason; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1491,7 +1493,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_header *rss, if (__predict_false(inp->inp_flags & INP_DROPPED)) { reset: - send_reset_synqe(TOEDEV(ifp), synqe); + send_abort_rpl_synqe(TOEDEV(ifp), synqe, CPL_ABORT_SEND_RST); INP_WUNLOCK(inp); NET_EPOCH_EXIT(et); CURVNET_RESTORE(); @@ -1524,7 +1526,15 @@ reset: so = inp->inp_socket; KASSERT(so != NULL, ("%s: socket is NULL", __func__)); - if (!toe_syncache_expand(&inc, &to, &th, &so) || so == NULL) { + rstreason = toe_syncache_expand(&inc, &to, &th, &so); + if (rstreason < 0) { + free_toepcb(toep); + send_abort_rpl_synqe(TOEDEV(ifp), synqe, CPL_ABORT_NO_RST); + INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); + return (0); + } else if (rstreason == 0 || so == NULL) { free_toepcb(toep); goto reset; } From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D03075EC746; Mon, 26 Apr 2021 19:03: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 4FTZ774T4Jz4SY6; Mon, 26 Apr 2021 19:03: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 7575E49F8; Mon, 26 Apr 2021 19:03: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 13QJ3l16079944; Mon, 26 Apr 2021 19:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3lbV079943; Mon, 26 Apr 2021 19:03:47 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:47 GMT Message-Id: <202104261903.13QJ3lbV079943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cc76018cdd89 - stable/13 - cxgbe(4): Read the rx 'c' channel for a port and make it available. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cc76018cdd89880eea505b02ebd1d01cec247afb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:47 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cc76018cdd89880eea505b02ebd1d01cec247afb commit cc76018cdd89880eea505b02ebd1d01cec247afb Author: Navdeep Parhar AuthorDate: 2021-02-26 02:10:52 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:10 +0000 cxgbe(4): Read the rx 'c' channel for a port and make it available. Sponsored by: Chelsio Communications (cherry picked from commit dfff1de729bd73004404863b7f9e8a9bda7b0f04) --- sys/dev/cxgbe/adapter.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 18 ++++++++++++++++++ sys/dev/cxgbe/t4_main.c | 2 ++ 3 files changed, 21 insertions(+) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 4b2f86d00052..d892fd0e9270 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -306,6 +306,7 @@ struct port_info { uint8_t tx_chan; uint8_t mps_bg_map; /* rx MPS buffer group bitmap */ uint8_t rx_e_chan_map; /* rx TP e-channel bitmap */ + uint8_t rx_c_chan; /* rx TP c-channel */ struct link_config link_cfg; struct ifmedia media; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index b54a71a02ca4..734ab7f33acb 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -6818,6 +6818,23 @@ static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx) return 1 << idx; } +/* + * TP RX c-channel associated with the port. + */ +static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx) +{ + u32 param, val; + int ret; + + param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPCHMAP)); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); + if (!ret) + return (val >> (8 * idx)) & 0xff; + + return 0; +} + /** * t4_get_port_type_description - return Port Type string description * @port_type: firmware Port Type enumeration @@ -9789,6 +9806,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id) p->tx_chan = j; p->mps_bg_map = t4_get_mps_bg_map(adap, j); p->rx_e_chan_map = t4_get_rx_e_chan_map(adap, j); + p->rx_c_chan = t4_get_rx_c_chan(adap, j); p->lport = j; if (!(adap->flags & IS_VF) || diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 18a83df763ab..1ac072c2057c 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7071,6 +7071,8 @@ cxgbe_sysctls(struct port_info *pi) pi->mps_bg_map, "MPS buffer group map"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_e_chan_map", CTLFLAG_RD, NULL, pi->rx_e_chan_map, "TP rx e-channel map"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_c_chan", CTLFLAG_RD, NULL, + pi->rx_c_chan, "TP rx c-channel"); if (sc->flags & IS_VF) return; From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 047235EC4AD; Mon, 26 Apr 2021 19:03: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 4FTZ7952sjz4SYJ; Mon, 26 Apr 2021 19:03: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 97E5E4D34; Mon, 26 Apr 2021 19:03: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 13QJ3nCh079995; Mon, 26 Apr 2021 19:03:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3nli079994; Mon, 26 Apr 2021 19:03:49 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:49 GMT Message-Id: <202104261903.13QJ3nli079994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ea511d5a5b91 - stable/13 - ccr: Add per-port stats of queued and completed requests. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ea511d5a5b91856e74ac320aa4f5fc1ff5063730 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:50 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ea511d5a5b91856e74ac320aa4f5fc1ff5063730 commit ea511d5a5b91856e74ac320aa4f5fc1ff5063730 Author: John Baldwin AuthorDate: 2021-03-12 18:35:32 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:27 +0000 ccr: Add per-port stats of queued and completed requests. Sponsored by: Chelsio Communications (cherry picked from commit 9c5137beb5f28292410888d0770bdf24c15e1312) --- sys/dev/cxgbe/crypto/t4_crypto.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 46ea9d778fe3..8cb5924c6b4c 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -168,6 +168,9 @@ struct ccr_port { int rx_channel_id; int tx_channel_id; u_int active_sessions; + + counter_u64_t stats_queued; + counter_u64_t stats_completed; }; struct ccr_session { @@ -2128,6 +2131,11 @@ ccr_sysctls(struct ccr_softc *sc) SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "active_sessions", CTLFLAG_RD, &sc->ports[i].active_sessions, 0, "Count of active sessions"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "queued", + CTLFLAG_RD, &sc->ports[i].stats_queued, "Requests queued"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "completed", + CTLFLAG_RD, &sc->ports[i].stats_completed, + "Requests completed"); } } @@ -2141,6 +2149,8 @@ ccr_init_port(struct ccr_softc *sc, int port) sc->ports[port].rxq = &sc->adapter->sge.rxq[pi->vi->first_rxq]; sc->ports[port].rx_channel_id = pi->rx_c_chan; sc->ports[port].tx_channel_id = pi->tx_chan; + sc->ports[port].stats_queued = counter_u64_alloc(M_WAITOK); + sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK); _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); sc->port_mask |= 1u << port; @@ -2199,10 +2209,19 @@ ccr_attach(device_t dev) return (0); } +static void +ccr_free_port(struct ccr_softc *sc, int port) +{ + + counter_u64_free(sc->ports[port].stats_queued); + counter_u64_free(sc->ports[port].stats_completed); +} + static int ccr_detach(device_t dev) { struct ccr_softc *sc; + int i; sc = device_get_softc(dev); @@ -2230,6 +2249,9 @@ ccr_detach(device_t dev) counter_u64_free(sc->stats_sglist_error); counter_u64_free(sc->stats_process_error); counter_u64_free(sc->stats_sw_fallback); + for_each_port(sc->adapter, i) { + ccr_free_port(sc, i); + } sglist_free(sc->sg_iv_aad); free(sc->iv_aad_buf, M_CCR); sc->adapter->ccr_softc = NULL; @@ -2827,6 +2849,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hint) s->pending++; #endif counter_u64_add(sc->stats_inflight, 1); + counter_u64_add(s->port->stats_queued, 1); } else counter_u64_add(sc->stats_process_error, 1); @@ -2871,6 +2894,7 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_header *rss, mtx_unlock(&s->lock); #endif counter_u64_add(sc->stats_inflight, -1); + counter_u64_add(s->port->stats_completed, 1); switch (s->mode) { case HASH: From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02EB25EC448; Mon, 26 Apr 2021 19:03: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 4FTZ7C0L3jz4Sq6; Mon, 26 Apr 2021 19:03: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 BA75849F9; Mon, 26 Apr 2021 19:03: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 13QJ3oBO080016; Mon, 26 Apr 2021 19:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3o2U080015; Mon, 26 Apr 2021 19:03:50 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:50 GMT Message-Id: <202104261903.13QJ3o2U080015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c0b22e146845 - stable/13 - ccr: Disable requests on port 1 when needed to workaround a firmware bug. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c0b22e146845852f99e9e74594589d988251022c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:52 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c0b22e146845852f99e9e74594589d988251022c commit c0b22e146845852f99e9e74594589d988251022c Author: John Baldwin AuthorDate: 2021-03-12 18:35:56 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:32 +0000 ccr: Disable requests on port 1 when needed to workaround a firmware bug. Completions for crypto requests on port 1 can sometimes return a stale cookie value due to a firmware bug. Disable requests on port 1 by default on affected firmware. Sponsored by: Chelsio Communications (cherry picked from commit 5fe0cd6503d34d23c98e9e1ff7bf10340218a5ec) --- sys/dev/cxgbe/crypto/t4_crypto.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 8cb5924c6b4c..cdd14fcee2f9 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -2153,7 +2153,15 @@ ccr_init_port(struct ccr_softc *sc, int port) sc->ports[port].stats_completed = counter_u64_alloc(M_WAITOK); _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); - sc->port_mask |= 1u << port; + + /* + * Completions for crypto requests on port 1 can sometimes + * return a stale cookie value due to a firmware bug. Disable + * requests on port 1 by default on affected firmware. + */ + if (sc->adapter->params.fw_vers >= FW_VERSION32(1, 25, 4, 0) || + port == 0) + sc->port_mask |= 1u << port; } static int From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F7D25EC5A0; Mon, 26 Apr 2021 19:03: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 4FTZ7C6zMXz4Svf; Mon, 26 Apr 2021 19:03: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 DDA004AEC; Mon, 26 Apr 2021 19:03: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 13QJ3pa7080037; Mon, 26 Apr 2021 19:03:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3pPo080036; Mon, 26 Apr 2021 19:03:51 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:51 GMT Message-Id: <202104261903.13QJ3pPo080036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: efe985058d5d - stable/13 - Fix a typo in a comment: frame -> framework. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: efe985058d5d2e6255944aa5863817f91f06d81d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:52 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=efe985058d5d2e6255944aa5863817f91f06d81d commit efe985058d5d2e6255944aa5863817f91f06d81d Author: John Baldwin AuthorDate: 2021-03-16 22:33:20 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:37 +0000 Fix a typo in a comment: frame -> framework. Sponsored by: Chelsio Communications (cherry picked from commit 86e352c934e5af49866d13a79ddb7c6fbf090cb9) --- sys/opencrypto/cryptodev_if.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/cryptodev_if.m b/sys/opencrypto/cryptodev_if.m index 1d767be3f4e4..ceb2564b8af5 100644 --- a/sys/opencrypto/cryptodev_if.m +++ b/sys/opencrypto/cryptodev_if.m @@ -100,7 +100,7 @@ METHOD int newsession { * @brief Destroy a crypto session object * * The crypto framework invokes this method when tearing down a crypto - * session. After this callback returns, the frame will explicitly + * session. After this callback returns, the framework will explicitly * zero and free the drvier's per-session memory object. If the * driver requires additional actions to destroy a session, it should * perform those in this method. If the driver does not require From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7A275EC520; Mon, 26 Apr 2021 19:03: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 4FTZ783mzCz4Sf3; Mon, 26 Apr 2021 19:03: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 6FDCD4E81; Mon, 26 Apr 2021 19:03: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 13QJ3mNs079967; Mon, 26 Apr 2021 19:03:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3miZ079966; Mon, 26 Apr 2021 19:03:48 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:48 GMT Message-Id: <202104261903.13QJ3miZ079966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9cdd43808ccd - stable/13 - ccr: Set the RX channel ID correctly in work requests. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9cdd43808ccdb1c1d579bcf57394196318e91efa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:48 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9cdd43808ccdb1c1d579bcf57394196318e91efa commit 9cdd43808ccdb1c1d579bcf57394196318e91efa Author: John Baldwin AuthorDate: 2021-03-12 18:35:05 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:15 +0000 ccr: Set the RX channel ID correctly in work requests. These fixes are only relevant for requests on the second port. In some cases, the crypto completion data, completion message, and receive descriptor could be written in the wrong order. - Add a separate rx_channel_id that is a copy of the port's rx_c_chan and use it when an RX channel ID is required in crypto requests instead of using the tx_channel_id. - Set the correct rx_channel_id in the CPL_RX_PHYS_ADDR used to write the crypto result. - Set the FID to the first rx queue ID on the adapter rather than the queue ID of the first rx queue for the port. - While here, use tx_chan to set the tx_channel_id though this is identical to the previous value. Reported by: Chelsio QA Sponsored by: Chelsio Communications (cherry picked from commit 8f885fd1f38159a06db82d680fa259f358e9f872) --- sys/dev/cxgbe/crypto/t4_crypto.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 8861e710cfd2..46ea9d778fe3 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -165,6 +165,7 @@ struct ccr_session_blkcipher { struct ccr_port { struct sge_wrq *txq; struct sge_rxq *rxq; + int rx_channel_id; int tx_channel_id; u_int active_sessions; }; @@ -207,6 +208,7 @@ struct ccr_softc { bool detaching; struct ccr_port ports[MAX_NPORTS]; u_int port_mask; + int first_rxq_id; /* * Pre-allocate a dummy output buffer for the IV and AAD for @@ -333,6 +335,7 @@ ccr_write_phys_dsgl(struct ccr_session *s, void *dst, int nsegs) cpl->rss_hdr_int.opcode = CPL_RX_PHYS_ADDR; cpl->rss_hdr_int.qid = htobe16(s->port->rxq->iq.abs_id); cpl->rss_hdr_int.hash_val = 0; + cpl->rss_hdr_int.channel = s->port->rx_channel_id; sgl = (struct phys_sge_pairs *)(cpl + 1); j = 0; for (i = 0; i < sg->sg_nseg; i++) { @@ -423,12 +426,12 @@ ccr_populate_wreq(struct ccr_softc *sc, struct ccr_session *s, V_FW_CRYPTO_LOOKASIDE_WR_LEN16(wr_len / 16)); crwr->wreq.session_id = 0; crwr->wreq.rx_chid_to_rx_q_id = htobe32( - V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(s->port->tx_channel_id) | + V_FW_CRYPTO_LOOKASIDE_WR_RX_CHID(s->port->rx_channel_id) | V_FW_CRYPTO_LOOKASIDE_WR_LCB(0) | V_FW_CRYPTO_LOOKASIDE_WR_PHASH(0) | V_FW_CRYPTO_LOOKASIDE_WR_IV(IV_NOP) | V_FW_CRYPTO_LOOKASIDE_WR_FQIDX(0) | - V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) | + V_FW_CRYPTO_LOOKASIDE_WR_TX_CH(0) | /* unused in firmware */ V_FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID(s->port->rxq->iq.abs_id)); crwr->wreq.key_addr = 0; crwr->wreq.pld_size_hash_size = htobe32( @@ -440,7 +443,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct ccr_session *s, V_ULP_TXPKT_DATAMODIFY(0) | V_ULP_TXPKT_CHANNELID(s->port->tx_channel_id) | V_ULP_TXPKT_DEST(0) | - V_ULP_TXPKT_FID(s->port->rxq->iq.abs_id) | V_ULP_TXPKT_RO(1)); + V_ULP_TXPKT_FID(sc->first_rxq_id) | V_ULP_TXPKT_RO(1)); crwr->ulptx.len = htobe32( ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16)); @@ -525,7 +528,7 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(0)); @@ -685,7 +688,7 @@ ccr_blkcipher(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -986,7 +989,7 @@ ccr_eta(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1293,7 +1296,7 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1768,7 +1771,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->tx_channel_id) | + V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -2131,11 +2134,13 @@ ccr_sysctls(struct ccr_softc *sc) static void ccr_init_port(struct ccr_softc *sc, int port) { + struct port_info *pi; + pi = sc->adapter->port[port]; sc->ports[port].txq = &sc->adapter->sge.ctrlq[port]; - sc->ports[port].rxq = - &sc->adapter->sge.rxq[sc->adapter->port[port]->vi->first_rxq]; - sc->ports[port].tx_channel_id = port; + sc->ports[port].rxq = &sc->adapter->sge.rxq[pi->vi->first_rxq]; + sc->ports[port].rx_channel_id = pi->rx_c_chan; + sc->ports[port].tx_channel_id = pi->tx_chan; _Static_assert(sizeof(sc->port_mask) * NBBY >= MAX_NPORTS - 1, "Too many ports to fit in port_mask"); sc->port_mask |= 1u << port; @@ -2163,6 +2168,12 @@ ccr_attach(device_t dev) sc->cid = cid; sc->adapter->ccr_softc = sc; + /* + * The FID must be the first RXQ for port 0 regardless of + * which port is used to service the request. + */ + sc->first_rxq_id = sc->adapter->sge.rxq[0].iq.abs_id; + mtx_init(&sc->lock, "ccr", NULL, MTX_DEF); sc->iv_aad_buf = malloc(MAX_AAD_LEN, M_CCR, M_WAITOK); sc->sg_iv_aad = sglist_build(sc->iv_aad_buf, MAX_AAD_LEN, M_WAITOK); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 986925EC5B2; Mon, 26 Apr 2021 19:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7K2HM7z4Sfg; Mon, 26 Apr 2021 19:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 626E549FC; Mon, 26 Apr 2021 19:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ3ubX080239; Mon, 26 Apr 2021 19:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3uZP080238; Mon, 26 Apr 2021 19:03:56 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:56 GMT Message-Id: <202104261903.13QJ3uZP080238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bcd7b64748d8 - stable/13 - cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bcd7b64748d85d043ef5e4031b3f2f44f6186b4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:57 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bcd7b64748d85d043ef5e4031b3f2f44f6186b4e commit bcd7b64748d85d043ef5e4031b3f2f44f6186b4e Author: John Baldwin AuthorDate: 2021-03-22 16:59:09 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:57 +0000 cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED. This avoids mixing the use of two different enums which modern C compilers warn about. Sponsored by: Chelsio Communications (cherry picked from commit 017902fc5f07114e7baba94bb4720c8b41ddea0f) --- sys/dev/cxgbe/tom/t4_ddp.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index a901efc11894..b0d53dd63997 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -609,12 +609,7 @@ handle_ddp_indicate(struct toepcb *toep) ddp_queue_toep(toep); } -enum { - DDP_BUF0_INVALIDATED = 0x2, - DDP_BUF1_INVALIDATED -}; - -CTASSERT(DDP_BUF0_INVALIDATED == CPL_COOKIE_DDP0); +CTASSERT(CPL_COOKIE_DDP0 + 1 == CPL_COOKIE_DDP1); static int do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -635,12 +630,12 @@ do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) toep = lookup_tid(sc, tid); inp = toep->inp; switch (cpl->cookie) { - case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF0_INVALIDATED): - case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF1_INVALIDATED): + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP0): + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP1): /* * XXX: This duplicates a lot of code with handle_ddp_data(). */ - db_idx = G_COOKIE(cpl->cookie) - DDP_BUF0_INVALIDATED; + db_idx = G_COOKIE(cpl->cookie) - CPL_COOKIE_DDP0; MPASS(db_idx < nitems(toep->ddp.db)); INP_WLOCK(inp); DDP_LOCK(toep); @@ -1845,7 +1840,7 @@ t4_aio_cancel_active(struct kaiocb *job) V_TF_DDP_BUF1_VALID(1); t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_RX_DDP_FLAGS, valid_flag, 0, 1, - i + DDP_BUF0_INVALIDATED); + CPL_COOKIE_DDP0 + i); toep->ddp.db[i].cancel_pending = 1; CTR2(KTR_CXGBE, "%s: request %p marked pending", __func__, job); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE5C35EC4C8; Mon, 26 Apr 2021 19:03: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 4FTZ7G3TMyz4SqF; Mon, 26 Apr 2021 19:03: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 2C11347E1; Mon, 26 Apr 2021 19:03: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 13QJ3su4080160; Mon, 26 Apr 2021 19:03:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3sub080159; Mon, 26 Apr 2021 19:03:54 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:54 GMT Message-Id: <202104261903.13QJ3sub080159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 278db4ba3c49 - stable/13 - cxgbei: Move some function prototypes to cxgbei.h. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 278db4ba3c49ce8e08c5062d3610aff5bec20753 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:54 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=278db4ba3c49ce8e08c5062d3610aff5bec20753 commit 278db4ba3c49ce8e08c5062d3610aff5bec20753 Author: John Baldwin AuthorDate: 2021-03-22 16:58:54 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:47 +0000 cxgbei: Move some function prototypes to cxgbei.h. Sponsored by: Chelsio Communications (cherry picked from commit 45eed2331e8f796a6c315374d85a9485a29e2536) --- sys/dev/cxgbe/cxgbei/cxgbei.c | 5 ----- sys/dev/cxgbe/cxgbei/cxgbei.h | 4 ++++ sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index fb5843b0b51a..4acdc726e75c 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -96,11 +96,6 @@ static int worker_thread_count; static struct cxgbei_worker_thread_softc *cwt_softc; static struct proc *cxgbei_proc; -/* XXXNP some header instead. */ -struct icl_pdu *icl_cxgbei_new_pdu(int); -void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); -void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); - static void free_ci_counters(struct cxgbei_data *ci) { diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 798a1cf49665..b0369b974136 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -127,4 +127,8 @@ u_int cxgbei_select_worker_thread(struct icl_cxgbei_conn *); /* icl_cxgbei.c */ int icl_cxgbei_mod_load(void); int icl_cxgbei_mod_unload(void); +struct icl_pdu *icl_cxgbei_new_pdu(int); +void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); +void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); + #endif diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 5588d3cb9511..6b25568e112b 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -124,11 +124,7 @@ static volatile u_int icl_cxgbei_ncons; #define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) #define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) -struct icl_pdu *icl_cxgbei_new_pdu(int); -void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); - static icl_conn_new_pdu_t icl_cxgbei_conn_new_pdu; -icl_conn_pdu_free_t icl_cxgbei_conn_pdu_free; static icl_conn_pdu_data_segment_length_t icl_cxgbei_conn_pdu_data_segment_length; static icl_conn_pdu_append_data_t icl_cxgbei_conn_pdu_append_data; From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE53E5EC4DB; Mon, 26 Apr 2021 19:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7M4Ympz4SqW; Mon, 26 Apr 2021 19:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CBCA4AEE; Mon, 26 Apr 2021 19:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ3wt0080281; Mon, 26 Apr 2021 19:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3wsF080280; Mon, 26 Apr 2021 19:03:58 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:58 GMT Message-Id: <202104261903.13QJ3wsF080280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4e4ec8a9cc26 - stable/13 - cxgbe: Add a struct sge_ofld_txq type. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e4ec8a9cc264ee3de9b34fa9273af0c20466bc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:00 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4e4ec8a9cc264ee3de9b34fa9273af0c20466bc4 commit 4e4ec8a9cc264ee3de9b34fa9273af0c20466bc4 Author: John Baldwin AuthorDate: 2021-03-26 22:05:31 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:06 +0000 cxgbe: Add a struct sge_ofld_txq type. This type mirrors struct sge_ofld_rxq and holds state for TCP offload transmit queues. Currently it only holds a work queue but will include additional state in future changes. Sponsored by: Chelsio Communications (cherry picked from commit 077ba6a845fab8f1d3bd83e07f61730f202a46fc) --- sys/dev/cxgbe/adapter.h | 11 ++++-- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 10 +++--- sys/dev/cxgbe/iw_cxgbe/qp.c | 6 ++-- sys/dev/cxgbe/offload.h | 2 +- sys/dev/cxgbe/t4_main.c | 15 ++++---- sys/dev/cxgbe/t4_sge.c | 75 ++++++++++++++++++++++++++++----------- sys/dev/cxgbe/tom/t4_cpl_io.c | 25 +++++++------ sys/dev/cxgbe/tom/t4_listen.c | 9 ++--- sys/dev/cxgbe/tom/t4_tls.c | 8 ++--- sys/dev/cxgbe/tom/t4_tom.h | 6 ++-- 10 files changed, 107 insertions(+), 60 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index d892fd0e9270..8f87627d959c 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -678,8 +678,8 @@ struct wrq_cookie { }; /* - * wrq: SGE egress queue that is given prebuilt work requests. Both the control - * and offload tx queues are of this type. + * wrq: SGE egress queue that is given prebuilt work requests. Control queues + * are of this type. */ struct sge_wrq { struct sge_eq eq; /* MUST be first */ @@ -713,6 +713,11 @@ struct sge_wrq { } __aligned(CACHE_LINE_SIZE); +/* ofld_txq: SGE egress queue + miscellaneous items */ +struct sge_ofld_txq { + struct sge_wrq wrq; +} __aligned(CACHE_LINE_SIZE); + #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { /* Items used by the driver rx ithread are in this cacheline. */ @@ -793,7 +798,7 @@ struct sge { struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ - struct sge_wrq *ofld_txq; /* TOE tx queues */ + struct sge_ofld_txq *ofld_txq; /* TOE tx queues */ struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ struct sge_nm_txq *nm_txq; /* netmap tx queues */ struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 6292dfc8dc75..94963f13b601 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -551,7 +551,7 @@ send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -843,8 +843,8 @@ no_ddp: goto no_ddp; } - rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, prsv, - (vm_offset_t)csio->data_ptr, csio->dxfer_len); + rc = t4_write_page_pods_for_buf(sc, &toep->ofld_txq->wrq, toep->tid, + prsv, (vm_offset_t)csio->data_ptr, csio->dxfer_len); if (rc != 0) { t4_free_page_pods(prsv); uma_zfree(prsv_zone, prsv); @@ -957,8 +957,8 @@ no_ddp: goto no_ddp; } - rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, - prsv, buf, xferlen); + rc = t4_write_page_pods_for_buf(sc, &toep->ofld_txq->wrq, + toep->tid, prsv, buf, xferlen); if (rc != 0) { t4_free_page_pods(prsv); uma_zfree(prsv_zone, prsv); diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c index 43acb246e7bc..f999254a748c 100644 --- a/sys/dev/cxgbe/iw_cxgbe/qp.c +++ b/sys/dev/cxgbe/iw_cxgbe/qp.c @@ -1127,7 +1127,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe, CTR4(KTR_IW_CXGBE, "%s qhp %p qid 0x%x tid %u", __func__, qhp, qhp->wq.sq.qid, qhp->ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return; wqe = wrtod(wr); @@ -1259,7 +1259,7 @@ rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp, struct c4iw_ep *ep) CTR5(KTR_IW_CXGBE, "%s qhp %p qid 0x%x ep %p tid %u", __func__, qhp, qhp->wq.sq.qid, ep, ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return (0); wqe = wrtod(wr); @@ -1353,7 +1353,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp) CTR5(KTR_IW_CXGBE, "%s qhp %p qid 0x%x ep %p tid %u", __func__, qhp, qhp->wq.sq.qid, ep, ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return (0); wqe = wrtod(wr); diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index 968902cb10da..e264882fb5b4 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -96,7 +96,7 @@ struct cxgbe_rate_tag { int etid; struct mbufq pending_tx, pending_fwack; int plen; - struct sge_wrq *eo_txq; + struct sge_ofld_txq *eo_txq; uint32_t ctrl0; uint16_t iqid; int8_t schedcl; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 1ac072c2057c..138da5ee3427 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1331,7 +1331,7 @@ t4_attach(device_t dev) s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; s->neq += s->nofldtxq; - s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), + s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_ofld_txq), M_CXGBE, M_ZERO | M_WAITOK); } #endif @@ -6085,7 +6085,7 @@ vi_full_uninit(struct vi_info *vi) struct sge_ofld_rxq *ofld_rxq; #endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif if (vi->flags & VI_INIT_DONE) { @@ -6102,7 +6102,7 @@ vi_full_uninit(struct vi_info *vi) #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { - quiesce_wrq(sc, ofld_txq); + quiesce_wrq(sc, &ofld_txq->wrq); } #endif @@ -10653,6 +10653,9 @@ clear_stats(struct adapter *sc, u_int port_id) struct sge_rxq *rxq; struct sge_txq *txq; struct sge_wrq *wrq; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct sge_ofld_txq *ofld_txq; +#endif #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; #endif @@ -10740,9 +10743,9 @@ clear_stats(struct adapter *sc, u_int port_id) } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - for_each_ofld_txq(vi, i, wrq) { - wrq->tx_wrs_direct = 0; - wrq->tx_wrs_copied = 0; + for_each_ofld_txq(vi, i, ofld_txq) { + ofld_txq->wrq.tx_wrs_direct = 0; + ofld_txq->wrq.tx_wrs_copied = 0; } #endif #ifdef TCP_OFFLOAD diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index d16f17c45614..dbe2eadb4fcc 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -270,6 +270,11 @@ 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 *); +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) +static int alloc_ofld_txq(struct vi_info *, struct sge_ofld_txq *, int, + struct sysctl_oid *); +static int free_ofld_txq(struct vi_info *, struct sge_ofld_txq *); +#endif static void oneseg_dma_callback(void *, bus_dma_segment_t *, int, int); static inline void ring_fl_db(struct adapter *, struct sge_fl *); static int refill_fl(struct adapter *, struct sge_fl *, int); @@ -1099,7 +1104,7 @@ t4_setup_vi_queues(struct vi_info *vi) struct sge_ofld_rxq *ofld_rxq; #endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif #ifdef DEV_NETMAP int saved_idx; @@ -1218,26 +1223,20 @@ t4_setup_vi_queues(struct vi_info *vi) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queues for TOE/ETHOFLD"); for_each_ofld_txq(vi, i, ofld_txq) { - struct sysctl_oid *oid2; - snprintf(name, sizeof(name), "%s ofld_txq%d", device_get_nameunit(vi->dev), i); if (vi->nofldrxq > 0) { iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq); - init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, + init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, sc->sge.ofld_rxq[iqidx].iq.cntxt_id, name); } else { iqidx = vi->first_rxq + (i % vi->nrxq); - init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, + init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, sc->sge.rxq[iqidx].iq.cntxt_id, name); } - snprintf(name, sizeof(name), "%d", i); - oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); - - rc = alloc_wrq(sc, vi, ofld_txq, oid2); + rc = alloc_ofld_txq(vi, ofld_txq, i, oid); if (rc != 0) goto done; } @@ -1259,9 +1258,7 @@ t4_teardown_vi_queues(struct vi_info *vi) struct sge_rxq *rxq; struct sge_txq *txq; #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; @@ -1299,7 +1296,7 @@ t4_teardown_vi_queues(struct vi_info *vi) } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { - free_wrq(sc, ofld_txq); + free_ofld_txq(vi, ofld_txq); } #endif @@ -4480,6 +4477,44 @@ free_txq(struct vi_info *vi, struct sge_txq *txq) return (0); } +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) +static int +alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, + struct sysctl_oid *oid) +{ + struct adapter *sc = vi->adapter; + struct sysctl_oid_list *children; + char name[16]; + int rc; + + children = SYSCTL_CHILDREN(oid); + + snprintf(name, sizeof(name), "%d", idx); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); + + rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); + if (rc != 0) + return (rc); + + return (rc); +} + +static int +free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) +{ + struct adapter *sc = vi->adapter; + int rc; + + rc = free_wrq(sc, &ofld_txq->wrq); + if (rc != 0) + return (rc); + + bzero(ofld_txq, sizeof(*ofld_txq)); + return (0); +} +#endif + static void oneseg_dma_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -6115,7 +6150,7 @@ send_etid_flowc_wr(struct cxgbe_rate_tag *cst, struct port_info *pi, MPASS((cst->flags & (EO_FLOWC_PENDING | EO_FLOWC_RPL_PENDING)) == EO_FLOWC_PENDING); - flowc = start_wrq_wr(cst->eo_txq, ETID_FLOWC_LEN16, &cookie); + flowc = start_wrq_wr(&cst->eo_txq->wrq, ETID_FLOWC_LEN16, &cookie); if (__predict_false(flowc == NULL)) return (ENOMEM); @@ -6137,7 +6172,7 @@ send_etid_flowc_wr(struct cxgbe_rate_tag *cst, struct port_info *pi, flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_SCHEDCLASS; flowc->mnemval[5].val = htobe32(cst->schedcl); - commit_wrq_wr(cst->eo_txq, flowc, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, flowc, &cookie); cst->flags &= ~EO_FLOWC_PENDING; cst->flags |= EO_FLOWC_RPL_PENDING; @@ -6157,7 +6192,7 @@ send_etid_flush_wr(struct cxgbe_rate_tag *cst) mtx_assert(&cst->lock, MA_OWNED); - flowc = start_wrq_wr(cst->eo_txq, ETID_FLUSH_LEN16, &cookie); + flowc = start_wrq_wr(&cst->eo_txq->wrq, ETID_FLUSH_LEN16, &cookie); if (__predict_false(flowc == NULL)) CXGBE_UNIMPLEMENTED(__func__); @@ -6167,7 +6202,7 @@ send_etid_flush_wr(struct cxgbe_rate_tag *cst) flowc->flowid_len16 = htobe32(V_FW_WR_LEN16(ETID_FLUSH_LEN16) | V_FW_WR_FLOWID(cst->etid)); - commit_wrq_wr(cst->eo_txq, flowc, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, flowc, &cookie); cst->flags |= EO_FLUSH_RPL_PENDING; MPASS(cst->tx_credits >= ETID_FLUSH_LEN16); @@ -6352,7 +6387,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) MPASS(cst->ncompl > 0); return; } - wr = start_wrq_wr(cst->eo_txq, next_credits, &cookie); + wr = start_wrq_wr(&cst->eo_txq->wrq, next_credits, &cookie); if (__predict_false(wr == NULL)) { /* XXX: wishful thinking, not a real assertion. */ MPASS(cst->ncompl > 0); @@ -6363,7 +6398,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) compl = cst->ncompl == 0 || cst->tx_nocompl >= cst->tx_total / 2; ETHER_BPF_MTAP(cst->com.ifp, m); write_ethofld_wr(cst, wr, m, compl); - commit_wrq_wr(cst->eo_txq, wr, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, wr, &cookie); if (compl) { cst->ncompl++; cst->tx_nocompl = 0; diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index f1d4ce6825cc..14a8181b57ef 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -108,7 +108,7 @@ send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -202,7 +202,8 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) fw_flowc_mnemval); flowclen16 = howmany(flowclen, 16); if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || - (wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq)) == NULL) { + (wr = alloc_wrqe(roundup2(flowclen, 16), + &toep->ofld_txq->wrq)) == NULL) { if (tc_idx >= 0) t4_release_cl_rl(sc, port_id, tc_idx); return (ENOMEM); @@ -266,7 +267,7 @@ send_reset(struct adapter *sc, struct toepcb *toep, uint32_t snd_nxt) KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %d.", __func__, tid)); - wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*req), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -491,7 +492,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, tid)); - wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*req), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -823,7 +824,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) /* Immediate data tx */ wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), - toep->ofld_txq); + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -841,7 +842,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1018,7 +1020,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) /* Immediate data tx */ wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), - toep->ofld_txq); + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1036,7 +1038,8 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) /* DSGL tx */ wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1351,13 +1354,13 @@ done: } void -send_abort_rpl(struct adapter *sc, struct sge_wrq *ofld_txq, int tid, +send_abort_rpl(struct adapter *sc, struct sge_ofld_txq *ofld_txq, int tid, int rst_status) { struct wrqe *wr; struct cpl_abort_rpl *cpl; - wr = alloc_wrqe(sizeof(*cpl), ofld_txq); + wr = alloc_wrqe(sizeof(*cpl), &ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -1397,7 +1400,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) const struct cpl_abort_req_rss *cpl = (const void *)(rss + 1); unsigned int tid = GET_TID(cpl); struct toepcb *toep = lookup_tid(sc, tid); - struct sge_wrq *ofld_txq = toep->ofld_txq; + struct sge_ofld_txq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; struct epoch_tracker et; diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index ba30f2a60120..126af9a1f20f 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -350,7 +350,7 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) struct port_info *pi = vi->pi; struct wrqe *wr; struct fw_flowc_wr *flowc; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; const int flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -362,7 +362,7 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; - wr = alloc_wrqe(roundup2(flowclen, 16), ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -411,7 +411,8 @@ send_abort_rpl_synqe(struct toedev *tod, struct synq_entry *synqe, if (!(synqe->flags & TPF_FLOWC_WR_SENT)) send_flowc_wr_synqe(sc, synqe); - wr = alloc_wrqe(sizeof(*req), &sc->sge.ofld_txq[synqe->params.txq_idx]); + wr = alloc_wrqe(sizeof(*req), + &sc->sge.ofld_txq[synqe->params.txq_idx].wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -885,7 +886,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss_header *rss, struct synq_entry *synqe = lookup_tid(sc, tid); struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 4016a4f1995a..fff42386fab7 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -70,7 +70,7 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, { struct adapter *sc = td_adapter(toep->td); - t4_set_tcb_field(sc, toep->ofld_txq, toep, word, mask, val, 0, 0); + t4_set_tcb_field(sc, &toep->ofld_txq->wrq, toep, word, mask, val, 0, 0); } /* TLS and DTLS common routines */ @@ -518,7 +518,7 @@ tls_program_key_id(struct toepcb *toep, struct tls_key_context *k_ctx) keyid = get_keyid(tls_ofld, k_ctx->l_p_key); } - wr = alloc_wrqe(len, toep->ofld_txq); + wr = alloc_wrqe(len, &toep->ofld_txq->wrq); if (wr == NULL) { free_keyid(toep, keyid); return (ENOMEM); @@ -1596,7 +1596,7 @@ t4_push_tls_records(struct adapter *sc, struct toepcb *toep, int drop) ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; } - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1907,7 +1907,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 41187aa27e2d..628857cfae17 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -185,7 +185,7 @@ struct toepcb { int refcount; struct vnet *vnet; struct vi_info *vi; /* virtual interface */ - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; struct sge_wrq *ctrlq; struct l2t_entry *l2te; /* L2 table entry used by this connection */ @@ -396,7 +396,7 @@ void aiotx_init_toep(struct toepcb *); int t4_aio_queue_aiotx(struct socket *, struct kaiocb *); void t4_init_cpl_io_handlers(void); void t4_uninit_cpl_io_handlers(void); -void send_abort_rpl(struct adapter *, struct sge_wrq *, int , int); +void send_abort_rpl(struct adapter *, struct sge_ofld_txq *, int , int); void send_flowc_wr(struct toepcb *, struct tcpcb *); void send_reset(struct adapter *, struct toepcb *, uint32_t); int send_rx_credits(struct adapter *, struct toepcb *, int); @@ -422,7 +422,7 @@ int t4_alloc_page_pods_for_buf(struct ppod_region *, vm_offset_t, int, struct ppod_reservation *); int t4_write_page_pods_for_ps(struct adapter *, struct sge_wrq *, int, struct pageset *); -int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int tid, +int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int, struct ppod_reservation *, vm_offset_t, int); void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:04:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D51455EC5C1; Mon, 26 Apr 2021 19:04: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 4FTZ7S6HrNz4Sqr; Mon, 26 Apr 2021 19:04: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 3A66C4AEF; Mon, 26 Apr 2021 19:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ43Hb080371; Mon, 26 Apr 2021 19:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ43K5080370; Mon, 26 Apr 2021 19:04:03 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:04:03 GMT Message-Id: <202104261904.13QJ43K5080370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 57d9ae2a4489 - stable/13 - cxgbe: Ignore doomed virtual interfaces when updating the clip table. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 57d9ae2a4489a9cab23c52a2ca0b1602d1237234 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:06 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57d9ae2a4489a9cab23c52a2ca0b1602d1237234 commit 57d9ae2a4489a9cab23c52a2ca0b1602d1237234 Author: John Baldwin AuthorDate: 2021-04-12 21:36:40 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:28 +0000 cxgbe: Ignore doomed virtual interfaces when updating the clip table. A doomed VI does not have a valid ifnet. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications (cherry picked from commit 45d5c28439f2464dd5022abb0dd53f9da649686c) --- sys/dev/cxgbe/t4_clip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/cxgbe/t4_clip.c b/sys/dev/cxgbe/t4_clip.c index ff34e811b82f..1472ae926617 100644 --- a/sys/dev/cxgbe/t4_clip.c +++ b/sys/dev/cxgbe/t4_clip.c @@ -215,6 +215,9 @@ update_clip_table(struct adapter *sc) last_vnet = (uintptr_t)(-1); for_each_port(sc, i) for_each_vi(sc->port[i], j, vi) { + if (IS_DOOMED(vi)) + continue; + if (last_vnet == (uintptr_t)vi->ifp->if_vnet) continue; From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 396F45EC8BB; Mon, 26 Apr 2021 19:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7H661Mz4Sw1; Mon, 26 Apr 2021 19:03: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 45F594E83; Mon, 26 Apr 2021 19:03: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 13QJ3tqn080215; Mon, 26 Apr 2021 19:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3t6D080214; Mon, 26 Apr 2021 19:03:55 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:55 GMT Message-Id: <202104261903.13QJ3t6D080214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 345bf0b368fb - stable/13 - cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 345bf0b368fbb89b74467f711d4004dec7c5c597 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:56 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=345bf0b368fbb89b74467f711d4004dec7c5c597 commit 345bf0b368fbb89b74467f711d4004dec7c5c597 Author: John Baldwin AuthorDate: 2021-03-22 16:59:02 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:52 +0000 cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi(). Sponsored by: Chelsio Communications (cherry picked from commit 8855ed61b5b7de94744fc415e5f049fee342d6b5) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 6b25568e112b..72626e60b58e 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -575,18 +575,14 @@ send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) } static void -set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, int hcrc, int dcrc) +set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, u_int ulp_submode) { - uint64_t val = ULP_MODE_ISCSI; + uint64_t val; - if (hcrc) - val |= ULP_CRC_HEADER << 4; - if (dcrc) - val |= ULP_CRC_DATA << 4; - - CTR4(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, CRC hdr=%d data=%d", - __func__, toep->tid, hcrc, dcrc); + CTR3(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, submode=%#x", + __func__, toep->tid, ulp_submode); + val = V_TCB_ULP_TYPE(ULP_MODE_ISCSI) | V_TCB_ULP_RAW(ulp_submode); t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_ULP_TYPE, V_TCB_ULP_TYPE(M_TCB_ULP_TYPE) | V_TCB_ULP_RAW(M_TCB_ULP_RAW), val, 0, 0); @@ -698,8 +694,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) toep->ulpcb = icc; send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); - set_ulp_mode_iscsi(icc->sc, toep, ic->ic_header_crc32c, - ic->ic_data_crc32c); + set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); error = 0; } INP_WUNLOCK(inp); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:03:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 269DF5EC7A2; Mon, 26 Apr 2021 19:03: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 4FTZ7F0Wkwz4SYY; Mon, 26 Apr 2021 19:03: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 0367749FA; Mon, 26 Apr 2021 19:03: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 13QJ3q4K080065; Mon, 26 Apr 2021 19:03:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3qAW080064; Mon, 26 Apr 2021 19:03:52 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:52 GMT Message-Id: <202104261903.13QJ3qAW080064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 483bcffad704 - stable/13 - cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 483bcffad7042fdd2c5e4edbb5e1498a5de94cce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:03:53 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=483bcffad7042fdd2c5e4edbb5e1498a5de94cce commit 483bcffad7042fdd2c5e4edbb5e1498a5de94cce Author: John Baldwin AuthorDate: 2021-03-22 16:58:28 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:01:40 +0000 cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp(). Sponsored by: Chelsio Communications (cherry picked from commit 52c11c3f744c8a68fb71a1343e8ffb4a9f70072a) --- sys/dev/cxgbe/cxgbei/cxgbei.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index bf5bb7b9ad62..fb5843b0b51a 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -412,12 +412,14 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); + CURVNET_SET(so->so_vnet); NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); icl_cxgbei_conn_pdu_free(NULL, ip); #ifdef INVARIANTS From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:04:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 911795EC452; Mon, 26 Apr 2021 19:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7L2vMLz4SsM; Mon, 26 Apr 2021 19:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75E944AED; Mon, 26 Apr 2021 19:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ3vN8080260; Mon, 26 Apr 2021 19:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3vqS080259; Mon, 26 Apr 2021 19:03:57 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:57 GMT Message-Id: <202104261903.13QJ3vqS080259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d6ee411d428e - stable/13 - cxgbei: Enter network epoch and set vnet around t4_push_pdus(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d6ee411d428e3d6097d8c51762d00ac2f6222f3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:00 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d6ee411d428e3d6097d8c51762d00ac2f6222f3b commit d6ee411d428e3d6097d8c51762d00ac2f6222f3b Author: John Baldwin AuthorDate: 2021-03-22 16:59:16 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:02 +0000 cxgbei: Enter network epoch and set vnet around t4_push_pdus(). Sponsored by: Chelsio Communications (cherry picked from commit 90c74b2b6004bc50f89378ac689fd179aa2d2ad6) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 72626e60b58e..6292dfc8dc75 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -369,6 +369,7 @@ icl_cxgbei_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip, void icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) { + struct epoch_tracker et; struct icl_cxgbei_conn *icc = ic_to_icc(ic); struct icl_cxgbei_pdu *icp = ip_to_icp(ip); struct socket *so = ic->ic_socket; @@ -397,6 +398,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) * already. */ inp = sotoinpcb(so); + CURVNET_SET(toep->vnet); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || __predict_false((toep->flags & TPF_ATTACHED) == 0)) @@ -406,6 +409,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) t4_push_pdus(icc->sc, toep, 0); } INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); } static struct icl_conn * From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:04:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2ECE5EC5BE; Mon, 26 Apr 2021 19:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7R21TZz4Syj; Mon, 26 Apr 2021 19:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 051BA47E2; Mon, 26 Apr 2021 19:04: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 13QJ41xS080350; Mon, 26 Apr 2021 19:04:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ413n080349; Mon, 26 Apr 2021 19:04:01 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:04:01 GMT Message-Id: <202104261904.13QJ413n080349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0d4d5e9fe0c6 - stable/13 - iscsi: Kick threads out of iscsi_ioctl() during unload. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0d4d5e9fe0c684a5aeda62638d7b29b0f10009cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:04 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0d4d5e9fe0c684a5aeda62638d7b29b0f10009cd commit 0d4d5e9fe0c684a5aeda62638d7b29b0f10009cd Author: John Baldwin AuthorDate: 2021-04-12 20:56:16 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:21 +0000 iscsi: Kick threads out of iscsi_ioctl() during unload. iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to sleep forever if iscsi.ko is unloaded while iscsid is running. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications (cherry picked from commit 89df484739efe93b52da467f35255ae538bb946b) --- sys/dev/iscsi/iscsi.c | 11 +++++++++++ sys/dev/iscsi/iscsi.h | 1 + 2 files changed, 12 insertions(+) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 4367f780d84b..13a35c371c40 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1333,6 +1333,11 @@ iscsi_ioctl_daemon_wait(struct iscsi_softc *sc, } if (is == NULL) { + if (sc->sc_unloading) { + sx_sunlock(&sc->sc_lock); + return (ENXIO); + } + /* * No session requires attention from iscsid(8); wait. */ @@ -2560,6 +2565,12 @@ static int iscsi_unload(void) { + /* Awaken any threads asleep in iscsi_ioctl(). */ + sx_xlock(&sc->sc_lock); + sc->sc_unloading = true; + cv_signal(&sc->sc_cv); + sx_xunlock(&sc->sc_lock); + if (sc->sc_cdev != NULL) { ISCSI_DEBUG("removing device node"); destroy_dev(sc->sc_cdev); diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index 80ac9d877107..793b7529c7c0 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -132,6 +132,7 @@ struct iscsi_softc { TAILQ_HEAD(, iscsi_session) sc_sessions; struct cv sc_cv; unsigned int sc_last_session_id; + bool sc_unloading; eventhandler_tag sc_shutdown_pre_eh; eventhandler_tag sc_shutdown_post_eh; }; From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:04:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E22095EC7E4; Mon, 26 Apr 2021 19:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTZ7N5N8jz4SsP; Mon, 26 Apr 2021 19:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B15444D35; Mon, 26 Apr 2021 19:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ3xkE080302; Mon, 26 Apr 2021 19:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ3xSY080301; Mon, 26 Apr 2021 19:03:59 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:03:59 GMT Message-Id: <202104261903.13QJ3xSY080301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 27395a69d100 - stable/13 - cxgbe: Make the TOE TLS stats per-queue instead of per-port. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 27395a69d10063fe604576daa491e64d95c209fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:01 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=27395a69d10063fe604576daa491e64d95c209fc commit 27395a69d10063fe604576daa491e64d95c209fc Author: John Baldwin AuthorDate: 2021-03-26 22:05:44 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:12 +0000 cxgbe: Make the TOE TLS stats per-queue instead of per-port. This avoids some atomics by using counter_u64 for TX and relying on existing single-threading (single ithread per rxq) for RX. Sponsored by: Chelsio Communications (cherry picked from commit fe496dc02a9a276d940e72bbd155dc256a34076f) --- sys/dev/cxgbe/adapter.h | 8 ++++---- sys/dev/cxgbe/t4_main.c | 17 ++++------------- sys/dev/cxgbe/t4_sge.c | 20 ++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tls.c | 12 ++++++------ 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 8f87627d959c..d9a23009a156 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -317,10 +317,6 @@ struct port_info { u_int tx_parse_error; int fcs_reg; uint64_t fcs_base; - u_long tx_toe_tls_records; - u_long tx_toe_tls_octets; - u_long rx_toe_tls_records; - u_long rx_toe_tls_octets; struct callout tick; }; @@ -655,6 +651,8 @@ iq_to_rxq(struct sge_iq *iq) struct sge_ofld_rxq { struct sge_iq iq; /* MUST be first */ struct sge_fl fl; /* MUST follow iq */ + u_long rx_toe_tls_records; + u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); static inline struct sge_ofld_rxq * @@ -716,6 +714,8 @@ struct sge_wrq { /* ofld_txq: SGE egress queue + miscellaneous items */ struct sge_ofld_txq { struct sge_wrq wrq; + counter_u64_t tx_toe_tls_records; + counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 138da5ee3427..06188187f9dc 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7199,19 +7199,6 @@ cxgbe_sysctls(struct port_info *pi) #undef T4_REGSTAT #undef T4_PORTSTAT - - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_records", - CTLFLAG_RD, &pi->tx_toe_tls_records, - "# of TOE TLS records transmitted"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_octets", - CTLFLAG_RD, &pi->tx_toe_tls_octets, - "# of payload octets in transmitted TOE TLS records"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", - CTLFLAG_RD, &pi->rx_toe_tls_records, - "# of TOE TLS records received"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_octets", - CTLFLAG_RD, &pi->rx_toe_tls_octets, - "# of payload octets in received TOE TLS records"); } static int @@ -10746,6 +10733,8 @@ clear_stats(struct adapter *sc, u_int port_id) for_each_ofld_txq(vi, i, ofld_txq) { ofld_txq->wrq.tx_wrs_direct = 0; ofld_txq->wrq.tx_wrs_copied = 0; + counter_u64_zero(ofld_txq->tx_toe_tls_records); + counter_u64_zero(ofld_txq->tx_toe_tls_octets); } #endif #ifdef TCP_OFFLOAD @@ -10753,6 +10742,8 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->fl.cl_allocated = 0; ofld_rxq->fl.cl_recycled = 0; ofld_rxq->fl.cl_fast_recycled = 0; + ofld_rxq->rx_toe_tls_records = 0; + ofld_rxq->rx_toe_tls_octets = 0; } #endif diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index dbe2eadb4fcc..5015d3b63a63 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -3952,6 +3952,13 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, + "# of TOE TLS records received"); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_octets, + "# of payload octets in received TOE TLS records"); + return (rc); } @@ -4492,11 +4499,21 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); + children = SYSCTL_CHILDREN(oid); rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); if (rc != 0) return (rc); + ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, + "# of TOE TLS records transmitted"); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_toe_tls_octets", CTLFLAG_RD, &ofld_txq->tx_toe_tls_octets, + "# of payload octets in transmitted TOE TLS records"); + return (rc); } @@ -4510,6 +4527,9 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) if (rc != 0) return (rc); + counter_u64_free(ofld_txq->tx_toe_tls_records); + counter_u64_free(ofld_txq->tx_toe_tls_octets); + bzero(ofld_txq, sizeof(*ofld_txq)); return (0); } diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index fff42386fab7..bbd905d8acc3 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -1664,8 +1664,8 @@ t4_push_tls_records(struct adapter *sc, struct toepcb *toep, int drop) } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, plen); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, plen); t4_l2t_send(sc, wr, toep->l2te); } @@ -1966,8 +1966,8 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, m->m_len); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, m->m_len); t4_l2t_send(sc, wr, toep->l2te); } @@ -2003,7 +2003,7 @@ do_tls_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_octets, len); + toep->ofld_rxq->rx_toe_tls_octets += len; KASSERT(len == G_CPL_TLS_DATA_LENGTH(be32toh(cpl->length_pkd)), ("%s: payload length mismatch", __func__)); @@ -2070,7 +2070,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_records, 1); + toep->ofld_rxq->rx_toe_tls_records++; KASSERT(len == G_CPL_RX_TLS_CMP_LENGTH(be32toh(cpl->pdulength_length)), ("%s: payload length mismatch", __func__)); From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:04:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BBDA5EC5BB; Mon, 26 Apr 2021 19:04: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 4FTZ7P55ccz4T47; Mon, 26 Apr 2021 19:04:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D55E64D36; Mon, 26 Apr 2021 19:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13QJ40Im080323; Mon, 26 Apr 2021 19:04:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13QJ408B080322; Mon, 26 Apr 2021 19:04:00 GMT (envelope-from git) Date: Mon, 26 Apr 2021 19:04:00 GMT Message-Id: <202104261904.13QJ408B080322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c2e295647ea5 - stable/13 - cxgbe: Add counters for iSCSI PDUs transmitted via TOE. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c2e295647ea5da560f68462c4924cbb7e9414b3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 19:04:02 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c2e295647ea5da560f68462c4924cbb7e9414b3e commit c2e295647ea5da560f68462c4924cbb7e9414b3e Author: John Baldwin AuthorDate: 2021-04-12 20:56:04 +0000 Commit: John Baldwin CommitDate: 2021-04-26 19:02:16 +0000 cxgbe: Add counters for iSCSI PDUs transmitted via TOE. Sponsored by: Chelsio Communications (cherry picked from commit 568e69e4eb0ad1a5c69d8ea4592a4314bd6b6679) --- sys/dev/cxgbe/adapter.h | 2 ++ sys/dev/cxgbe/t4_main.c | 2 ++ sys/dev/cxgbe/t4_sge.c | 10 ++++++++++ sys/dev/cxgbe/tom/t4_cpl_io.c | 3 +++ 4 files changed, 17 insertions(+) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index d9a23009a156..7bf4efae09c0 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -714,6 +714,8 @@ struct sge_wrq { /* ofld_txq: SGE egress queue + miscellaneous items */ struct sge_ofld_txq { struct sge_wrq wrq; + counter_u64_t tx_iscsi_pdus; + counter_u64_t tx_iscsi_octets; counter_u64_t tx_toe_tls_records; counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 06188187f9dc..3fde57786d13 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10733,6 +10733,8 @@ clear_stats(struct adapter *sc, u_int port_id) for_each_ofld_txq(vi, i, ofld_txq) { ofld_txq->wrq.tx_wrs_direct = 0; ofld_txq->wrq.tx_wrs_copied = 0; + counter_u64_zero(ofld_txq->tx_iscsi_pdus); + counter_u64_zero(ofld_txq->tx_iscsi_octets); counter_u64_zero(ofld_txq->tx_toe_tls_records); counter_u64_zero(ofld_txq->tx_toe_tls_octets); } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 5015d3b63a63..a8d16352268e 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4505,8 +4505,16 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, if (rc != 0) return (rc); + ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_iscsi_octets = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_iscsi_pdus", CTLFLAG_RD, &ofld_txq->tx_iscsi_pdus, + "# of iSCSI PDUs transmitted"); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_iscsi_octets", CTLFLAG_RD, &ofld_txq->tx_iscsi_octets, + "# of payload octets in transmitted iSCSI PDUs"); SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "# of TOE TLS records transmitted"); @@ -4527,6 +4535,8 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) if (rc != 0) return (rc); + counter_u64_free(ofld_txq->tx_iscsi_pdus); + counter_u64_free(ofld_txq->tx_iscsi_octets); counter_u64_free(ofld_txq->tx_toe_tls_records); counter_u64_free(ofld_txq->tx_toe_tls_octets); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 14a8181b57ef..e12354a0b1eb 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -1092,6 +1092,9 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) } toep->txsd_avail--; + counter_u64_add(toep->ofld_txq->tx_iscsi_pdus, 1); + counter_u64_add(toep->ofld_txq->tx_iscsi_octets, plen); + t4_l2t_send(sc, wr, toep->l2te); } From owner-dev-commits-src-all@freebsd.org Mon Apr 26 19:43:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 20:12:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 20:17:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 20:27:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 21:11:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 21:23:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F6925F12D0 for ; Mon, 26 Apr 2021 21:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 4FTdD22Vmpz4c3X for ; Mon, 26 Apr 2021 21:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id 8so24321066qkv.8 for ; Mon, 26 Apr 2021 14:23:14 -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=PJOdGjVwxQZaURdL1mCKGe/0dZeubAKTYBG/Si8X7PaAsB+lbtxVpc919Muljx8lqc 2eOrDhR+xw+X9BWjfzWrJpjHmgUJKjP+ggmiEDNqs2XhRmcHvy1SAunDJig7olsXiXt3 AcHOn2YLTQGXz4coVxsTLRbSdOvenyq2GnNtrgkEUkn3h5BtCeMx/VP9+qfMbtrTL2mn nMmiNsJLFxJ9wVzgDp6hiK9FdR/ge23fcZ0xpQweLI+Fb9WBiwpfF9FrUZhmti5eJaNt MOQ04ERDSydeIALPIWngi2ZnpZtv+fA2lsqdVcNmdhrxn927MjQ6j963uQEOJpHDNGRi hz+g== X-Gm-Message-State: AOAM532Vd20iWG+Imt2h0r5FYTJM7ZjjMJzc+IoxJ/lL5VUA5QENGfu2 mPq5Wy0D/TNNWXWnxIE8cQGYOS0njLKDn4URdqvGXw== 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: 4FTdD22Vmpz4c3X 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 22:29:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 22:53:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70AA95F306B; Mon, 26 Apr 2021 22:53:57 +0000 (UTC) (envelope-from neel@neelc.org) Received: from rainpuddle.neelc.org (rainpuddle.neelc.org [66.42.69.219]) (using TLSv1.3 with cipher TLS_AES_256_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 4FTgDh39XHz4g2X; Mon, 26 Apr 2021 22:53:56 +0000 (UTC) (envelope-from neel@neelc.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 97644EB2A5; Mon, 26 Apr 2021 15:53:48 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 26 Apr 2021 15:53:48 -0700 From: Neel Chauhan To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: An apology about my commits User-Agent: Roundcube Webmail/1.4.11 Message-ID: <6ae37bda99dfc279faff0ed0d50e3bfe@neelc.org> X-Sender: neel@neelc.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FTgDh39XHz4g2X X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=neelc.org; spf=pass (mx1.freebsd.org: domain of neel@neelc.org designates 66.42.69.219 as permitted sender) smtp.mailfrom=neel@neelc.org X-Spamd-Result: default: False [-3.80 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEFALL_USER(0.00)[neel]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.42.69.219:from]; R_SPF_ALLOW(-0.20)[+a]; SPAMHAUS_ZRD(0.00)[66.42.69.219:from:127.0.2.255]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[neelc.org,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:20473, ipnet:66.42.64.0/20, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-branches] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2021 22:53:57 -0000 Hi src committers, I hope all is well with you. I am really sorry about me prematurely pushing these MFC'ing these linuxkpi commits to stable/13 instead of waiting out the three-day minimum: https://cgit.freebsd.org/src/commit/?id=057f145aae9a3528ccd722c8f566d740d5cafcbb https://cgit.freebsd.org/src/commit/?id=ce65353ac1a17677bef03e96df8da967c9086743 https://cgit.freebsd.org/src/commit/?id=c8de6e20150a3c10575a27532a25b00342a7f452 https://cgit.freebsd.org/src/commit/?id=e657f3de6dc29147b5373d2cc2cc47e580931e30 Personally, I feel very guilty about prematurely pushing these commits to stable/13 and even feared losing my commit bit at times. Going forward, I will respect the 3 day waiting period for future src commits. I hope you all have a great day. Thank You, Neel Chauhan (nc@) From owner-dev-commits-src-all@freebsd.org Mon Apr 26 23:28:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 23:38:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 23:44:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Mon Apr 26 23:49:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 00:16:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA57B5F545B for ; Tue, 27 Apr 2021 00:16:14 +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 4FTj3f47dhz4knV for ; Tue, 27 Apr 2021 00:16:14 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2b.google.com with SMTP id z1so67133798ybf.6 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=H7eHW4DHvbO1EF6ZoRZq51yT2Z37ctqciGlMIp84gbrUDd25ATj6aONUW4bkJct96t Rirwa/P/tkyT/VtSlkAvT5HO+MFl+kjaEX+iiWteiv7bpg9QF3kHWOmVzdvXoN1hmluy OqkkGAxIIg8bSWNwOEQrRU42fjxv7wAbm2USAjaEpc4q0wrRxstAfxzdf8ITJUJZXeha MZXey8yzFSr6fvuld5UFg+WXmI+BfGAWax4WvRb1stfAJ+SEv7CEpoL2EK1YPo4uq9FT Os3ePTxW+rm+Y2PbGTj4OD+Zn3JURzoIVkG0E549l9I0wCrYlDxU9rCzWvLxU6dAEUHZ LT/g== X-Gm-Message-State: AOAM530UPMrYV5oVxxgcQv2pBkXNaktB6WEpnSWiJIEjf/nJwmUdVJz9 OB1wYfhW1Q/IR3sP0rYokJHfXrbu2+MdVSbYPG/KYQ== 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: 4FTj3f47dhz4knV 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 00:51:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 01:09:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71BC25F6EBB; Tue, 27 Apr 2021 01:09:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTkF02r90z4mms; Tue, 27 Apr 2021 01:09:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 542C811C06; Tue, 27 Apr 2021 01:09:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13R19Oau058754; Tue, 27 Apr 2021 01:09:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R19Oie058753; Tue, 27 Apr 2021 01:09:24 GMT (envelope-from git) Date: Tue, 27 Apr 2021 01:09:24 GMT Message-Id: <202104270109.13R19Oie058753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Nathan Whitehorn Subject: git: 3d9fd6ad1c11 - stable/13 - Allocate extra inodes in makefs when leaving free space in UFS images. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d9fd6ad1c11bfd9c8928b4df0f612c2e9c238ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 01:09:24 -0000 The branch stable/13 has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=3d9fd6ad1c11bfd9c8928b4df0f612c2e9c238ee commit 3d9fd6ad1c11bfd9c8928b4df0f612c2e9c238ee Author: Nathan Whitehorn AuthorDate: 2021-04-06 17:43:29 +0000 Commit: Nathan Whitehorn CommitDate: 2021-04-27 01:08:48 +0000 Allocate extra inodes in makefs when leaving free space in UFS images. By default, makefs(8) has very few spare inodes in its output images, which is fine for static filesystems, but not so great for VM images where many more files will be added. Make makefs(8) use the same default settings as newfs(8) when creating images with free space -- there isn't much point to leaving free space on the image if you can't put files there. If no free space is requested, use current behavior of a minimal number of available inodes. Reviewed by: manu MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29492 (cherry picked from commit afb6a168f8ee08ac74769464726c396fbef83d0b) --- usr.sbin/makefs/ffs.c | 8 +++++++- usr.sbin/makefs/ffs.h | 2 ++ usr.sbin/makefs/ffs/mkfs.c | 18 +++++++++++++++++- usr.sbin/makefs/makefs.8 | 5 ++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index 4dfb37889b53..7916d6a59ead 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -190,6 +190,7 @@ ffs_prep_opts(fsinfo_t *fsopts) ffs_opts->fsize= -1; ffs_opts->cpg= -1; ffs_opts->density= -1; + ffs_opts->min_inodes= false; ffs_opts->minfree= -1; ffs_opts->optimization= -1; ffs_opts->maxcontig= -1; @@ -266,6 +267,11 @@ ffs_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) printf("ffs_makefs: image %s directory %s root %p\n", image, dir, root); + /* if user wants no free space, use minimum number of inodes */ + if (fsopts->minsize == 0 && fsopts->freeblockpc == 0 && + fsopts->freeblocks == 0) + ((ffs_opt_t *)fsopts->fs_specific)->min_inodes = true; + /* validate tree and options */ TIMER_START(start); ffs_validate(dir, root, fsopts); @@ -424,7 +430,7 @@ ffs_validate(const char *dir, fsnode *root, fsinfo_t *fsopts) if (fsopts->roundup > 0) fsopts->size = roundup(fsopts->size, fsopts->roundup); - /* calculate density if necessary */ + /* calculate density to just fit inodes if no free space */ if (ffs_opts->density == -1) ffs_opts->density = fsopts->size / fsopts->inodes + 1; diff --git a/usr.sbin/makefs/ffs.h b/usr.sbin/makefs/ffs.h index 8b4fbc33dc83..e1dda429ff26 100644 --- a/usr.sbin/makefs/ffs.h +++ b/usr.sbin/makefs/ffs.h @@ -44,6 +44,7 @@ #include #include +#include typedef struct { char label[MAXVOLLEN]; /* volume name/label */ @@ -52,6 +53,7 @@ typedef struct { int cpg; /* cylinders per group */ int cpgflg; /* cpg was specified by user */ int density; /* bytes per inode */ + bool min_inodes; /* allocate minimum number of inodes */ int ntracks; /* number of tracks */ int nsectors; /* number of sectors */ int rpm; /* rpm */ diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index ff3c1d594b4e..a22a604fe501 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -117,10 +117,13 @@ static int avgfpdir; /* expected number of files per directory */ struct fs * ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) { - int fragsperinode, optimalfpg, origdensity, minfpg, lastminfpg; + int fragsperinode, optimalfpg, origdensity, mindensity; + int minfpg, lastminfpg; int32_t csfrags; uint32_t i, cylno; long long sizepb; + ino_t maxinum; + int minfragsperinode; /* minimum ratio of frags to inodes */ void *space; int size; int nprintcols, printcolwidth; @@ -312,7 +315,20 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) * can put into each cylinder group. If this is too big, we reduce * the density until it fits. */ + maxinum = (((int64_t)(1)) << 32) - INOPB(&sblock); + minfragsperinode = 1 + fssize / maxinum; + mindensity = minfragsperinode * fsize; + if (density == 0) + density = MAX(2, minfragsperinode) * fsize; + if (density < mindensity) { + origdensity = density; + density = mindensity; + fprintf(stderr, "density increased from %d to %d\n", + origdensity, density); + } origdensity = density; + if (!ffs_opts->min_inodes) + density = MIN(density, MAX(2, minfragsperinode) * fsize); for (;;) { fragsperinode = MAX(numfrags(&sblock, density), 1); minfpg = fragsperinode * INOPB(&sblock); diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index 8c4fbcb7b322..4a4c69b06946 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -312,7 +312,10 @@ Expected number of files per directory. .It Sy bsize Block size. .It Sy density -Bytes per inode. +Bytes per inode. If unset, will allocate the minimum number of inodes to +represent the filesystem if no free space has been requested (free blocks +or minimum size set); otherwise the larger of the newfs defaults or what +is required by the free inode parameters if set. .It Sy fsize Fragment size. .It Sy label From owner-dev-commits-src-all@freebsd.org Tue Apr 27 01:09:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B94695F6FFC; Tue, 27 Apr 2021 01:09: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 4FTkF13wNGz4mbP; Tue, 27 Apr 2021 01:09: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 76CAE116F1; Tue, 27 Apr 2021 01:09: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 13R19PAm058775; Tue, 27 Apr 2021 01:09:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R19Pqp058774; Tue, 27 Apr 2021 01:09:25 GMT (envelope-from git) Date: Tue, 27 Apr 2021 01:09:25 GMT Message-Id: <202104270109.13R19Pqp058774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Nathan Whitehorn Subject: git: 0658ecb05dea - stable/13 - Use makefs(8) in release VM-image generation instead of md(4) and newfs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0658ecb05dea7f3069c900238d41b3a07a9c1cad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 01:09:25 -0000 The branch stable/13 has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=0658ecb05dea7f3069c900238d41b3a07a9c1cad commit 0658ecb05dea7f3069c900238d41b3a07a9c1cad Author: Nathan Whitehorn AuthorDate: 2021-02-25 02:16:56 +0000 Commit: Nathan Whitehorn CommitDate: 2021-04-27 01:08:59 +0000 Use makefs(8) in release VM-image generation instead of md(4) and newfs. Using makefs instead reduces the privileges needed to build VM images, simplifies the script (no need to copy files to a fresh image at the end), and improves portability by allowing generation of cross-endian images. As a result of the last, this patch also adds support for generation of powerpc64 and powerpc64le VM images. No other changes to the output. Tested and working for both amd64 and powerpc64 targets. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D28912 (cherry picked from commit 1ca8842f3ad9725863c9affc044d1974a51818a9) --- release/scripts/mk-vmimage.sh | 2 - release/tools/vmimage.subr | 177 ++++++++++++++++++------------------------ 2 files changed, 77 insertions(+), 102 deletions(-) diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh index cf795e04655b..d5985ceb0d25 100755 --- a/release/scripts/mk-vmimage.sh +++ b/release/scripts/mk-vmimage.sh @@ -93,8 +93,6 @@ main() { . "${VMCONFIG}" fi - ROOTLABEL="gpt" - vm_create_base vm_install_base vm_extra_install_base diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 7bd971013656..6e0c1ea633e2 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -12,70 +12,17 @@ scriptdir=$(dirname $(realpath $0)) export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" trap "cleanup" INT QUIT TRAP ABRT TERM -write_partition_layout() { - if [ -z "${NOSWAP}" ]; then - SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" - fi - - BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/stand -V .OBJDIR)" - BOOTFILES="$(realpath ${BOOTFILES})" - - case "${TARGET}:${TARGET_ARCH}" in - amd64:amd64 | i386:i386) - ESP=yes - SCHEME=gpt - BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ - -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - arm64:aarch64 | riscv:riscv64*) - ESP=yes - SCHEME=gpt - BOOTPARTS= - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - powerpc:powerpc*) - ESP=no - SCHEME=apm - BOOTPARTS="-p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs" - ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" - ;; - *) - echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 - exit 1 - ;; - esac - - if [ ${ESP} = "yes" ]; then - # Create an ESP - espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi - BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" - - # Add this to fstab, requires temporarily remounting the fs - mddev=$(mdconfig -f ${VMBASE}) - mount /dev/${mddev} ${DESTDIR} - mkdir -p ${DESTDIR}/boot/efi - echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ - >> ${DESTDIR}/etc/fstab - umount ${DESTDIR} - mdconfig -d -u ${mddev} - fi - - mkimg -s ${SCHEME} -f ${VMFORMAT} \ - ${BOOTPARTS} \ - ${SWAPOPT} \ - ${ROOTFSPART} \ - -o ${VMIMAGE} - - if [ ${ESP} = "yes" ]; then - rm ${espfilename} - fi - - return 0 -} +# Platform-specific large-scale setup +# Most platforms use GPT, so put that as default, then special cases +PARTSCHEME=gpt +ROOTLABEL="gpt" +case "${TARGET}:${TARGET_ARCH}" in + powerpc:powerpc*) + PARTSCHEME=mbr + ROOTLABEL="ufs" + NOSWAP=yes # Can't label swap partition with MBR, so no swap + ;; +esac err() { printf "${@}\n" @@ -87,10 +34,6 @@ cleanup() { if [ -c "${DESTDIR}/dev/null" ]; then umount_loop ${DESTDIR}/dev 2>/dev/null fi - umount_loop ${DESTDIR} - if [ ! -z "${mddev}" ]; then - mdconfig -d -u ${mddev} - fi return 0 } @@ -100,42 +43,12 @@ vm_create_base() { # written to the formatted disk image with mkimg(1). mkdir -p ${DESTDIR} - truncate -s ${VMSIZE} ${VMBASE} - mddev=$(mdconfig -f ${VMBASE}) - newfs -L rootfs /dev/${mddev} - mount /dev/${mddev} ${DESTDIR} return 0 } vm_copy_base() { - # Creates a new UFS root filesystem and copies the contents of the - # current root filesystem into it. This produces a "clean" disk - # image without any remnants of files which were created temporarily - # during image-creation and have since been deleted (e.g., downloaded - # package archives). - - mkdir -p ${DESTDIR}/old - mdold=$(mdconfig -f ${VMBASE}) - mount /dev/${mdold} ${DESTDIR}/old - - truncate -s ${VMSIZE} ${VMBASE}.tmp - mkdir -p ${DESTDIR}/new - mdnew=$(mdconfig -f ${VMBASE}.tmp) - newfs -L rootfs /dev/${mdnew} - mount /dev/${mdnew} ${DESTDIR}/new - - tar -cf- -C ${DESTDIR}/old . | tar -xUf- -C ${DESTDIR}/new - - umount_loop /dev/${mdold} - rmdir ${DESTDIR}/old - mdconfig -d -u ${mdold} - - umount_loop /dev/${mdnew} - rmdir ${DESTDIR}/new - tunefs -n enable /dev/${mdnew} - mdconfig -d -u ${mdnew} - mv ${VMBASE}.tmp ${VMBASE} + # Defunct } vm_install_base() { @@ -276,7 +189,71 @@ vm_create_disk() { echo "Creating image... Please wait." echo - write_partition_layout || return 1 + if [ -z "${NOSWAP}" ]; then + SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" + fi + + BOOTFILES="$(env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + WITH_UNIFIED_OBJDIR=yes \ + make -C ${WORLDDIR}/stand -V .OBJDIR)" + BOOTFILES="$(realpath ${BOOTFILES})" + + case "${TARGET}:${TARGET_ARCH}" in + amd64:amd64 | i386:i386) + ESP=yes + BOOTPARTS="-b ${BOOTFILES}/i386/pmbr/pmbr \ + -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot" + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" + MAKEFSARGS="-B little" + ;; + arm64:aarch64 | riscv:riscv64*) + ESP=yes + BOOTPARTS= + ROOTFSPART="-p freebsd-ufs/rootfs:=${VMBASE}" + MAKEFSARGS="-B little" + ;; + powerpc:powerpc*) + ESP=no + BOOTPARTS="-p prepboot:=${BOOTFILES}/powerpc/boot1.chrp/boot1.elf -a 1" + ROOTFSPART="-p freebsd:=${VMBASE}" + if [ ${TARGET_ARCH} = powerpc64le ]; then + MAKEFSARGS="-B little" + else + MAKEFSARGS="-B big" + fi + ;; + *) + echo "vmimage.subr: unsupported target '${TARGET}:${TARGET_ARCH}'" >&2 + exit 1 + ;; + esac + + if [ ${ESP} = "yes" ]; then + # Create an ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi + BOOTPARTS="${BOOTPARTS} -p efi/efiesp:=${espfilename}" + + # Add this to fstab + mkdir -p ${DESTDIR}/boot/efi + echo "/dev/${ROOTLABEL}/efiesp /boot/efi msdosfs rw 2 2" \ + >> ${DESTDIR}/etc/fstab + fi + + echo "Building filesystem... Please wait." + makefs ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ + -s ${VMSIZE} ${VMBASE} ${DESTDIR} + + echo "Building final disk image... Please wait." + mkimg -s ${PARTSCHEME} -f ${VMFORMAT} \ + ${BOOTPARTS} \ + ${SWAPOPT} \ + ${ROOTFSPART} \ + -o ${VMIMAGE} + + if [ ${ESP} = "yes" ]; then + rm ${espfilename} + fi return 0 } From owner-dev-commits-src-all@freebsd.org Tue Apr 27 01:39:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 02:02:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 03:09:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 04:13:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 07:01:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 07:05:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 07:47:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21DA5624111 for ; Tue, 27 Apr 2021 07:47:43 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) (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 4FTv4b0GbYz3NLV for ; Tue, 27 Apr 2021 07:47:42 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2a.google.com with SMTP id c195so68193335ybf.9 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=bTKLLi2kgbylL66nIY/XE071naZ7nwTC4h+M4LvZwKsvnWpjscfyHDfqxrERZAXPqV uTWsveTrP8auGZ4pEwyVKlEa/0gXCTbAW5/l62q2cRUS5bA5YSoShN9+bwoR63D67E+l jrYIeNK89D/Is2fl9hPZjozq2uBZboO+9u4K9BIeXxv7M0HBscyWeMLfRFRHXIN5sI5L GyxNE/V1TeVDJRr2d6IY4ZyHqfR76SNOQags0WqBN+PMvj6LQore6Rl6g5Nkr7ySKLy5 eKG2I7yg75/hIMQ1ln0BKw1anMyvk4jrouqw2zAPavCYkI8G8WJRwlQpo/64LVOL1GTW 89bA== X-Gm-Message-State: AOAM530v2THV6SF9SdU7JxVeaCWlmDdlNa2oxIyIIhLgN/PQ2mG4ligx +eAgQiDBjgP32gIy7+857B64Wqv8qR5vDu7HNVtF/w== 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: 4FTv4b0GbYz3NLV 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 08:00:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 08:33:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 08:33:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 08:44:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38B56625FC5; Tue, 27 Apr 2021 08: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 4FTwLM5X60z3RHs; Tue, 27 Apr 2021 08:44: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 B0B3F17EB8; Tue, 27 Apr 2021 08:44: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 13R8ih0Q079094; Tue, 27 Apr 2021 08:44:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R8ihsf079093; Tue, 27 Apr 2021 08:44:43 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:44:43 GMT Message-Id: <202104270844.13R8ihsf079093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 68a43a511d94 - stable/13 - Document vnode_pager_setsize(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 68a43a511d94b141ce1f9e6d7b7c344ad2bda0b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:44:44 -0000 The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=68a43a511d94b141ce1f9e6d7b7c344ad2bda0b1 commit 68a43a511d94b141ce1f9e6d7b7c344ad2bda0b1 Author: Ka Ho Ng AuthorDate: 2021-04-07 11:00:31 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-27 08:44:08 +0000 Document vnode_pager_setsize(9) Sponsored by: The FreeBSD Foundation Reviewed by: bcr Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29408 (cherry picked from commit 86a52e262a6faf75ee34eaa801f6d8ddaad20733) --- share/man/man9/Makefile | 1 + share/man/man9/vnode_pager_setsize.9 | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index d2c3e77fc60f..0b025df78061 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -401,6 +401,7 @@ MAN= accept_filter.9 \ vn_isdisk.9 \ vnet.9 \ vnode.9 \ + vnode_pager_setsize.9 \ VOP_ACCESS.9 \ VOP_ACLCHECK.9 \ VOP_ADVISE.9 \ diff --git a/share/man/man9/vnode_pager_setsize.9 b/share/man/man9/vnode_pager_setsize.9 new file mode 100644 index 000000000000..c59a01796f20 --- /dev/null +++ b/share/man/man9/vnode_pager_setsize.9 @@ -0,0 +1,74 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" Portions of this software were developed by Ka Ho Ng +.\" under sponsorship from the FreeBSD Foundation. +.\" +.\" 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. +.\" +.Dd April 6, 2021 +.Dt VNODE_PAGER_SETSIZE 9 +.Os +.Sh NAME +.Nm vnode_pager_setsize +.Nd "notify the VM system about updates in the file size" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_extern.h +.Ft void +.Fn vnode_pager_setsize "struct vnode *vp" "vm_ooffset_t nsize" +.Sh DESCRIPTION +.Nm +lets the VM system know about a change in size for a file. +Content beyond the new EOF specified by the +.Fa nsize +argument will be purged from the cache. +This function is useful for use within file system code to implement +truncation in +.Xr VOP_SETATTR 9 . +.Sh IMPLEMENTATION NOTES +In case the new EOF specified by the +.Fa nsize +argument is not aligned to page boundaries, +partial-page area starting beyond the EOF will be zeroed. +In partial-page area, +for content occupying whole blocks within block +boundaries, +the dirty bits for the corresponding blocks will be cleared. +.Sh LOCKING +Writer lock of the VM object of +.Fa vp +will be held within the function. +.Sh SEE ALSO +.Xr vnode 9 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 14 . +.Sh AUTHORS +This +manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org . From owner-dev-commits-src-all@freebsd.org Tue Apr 27 08:44:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C213625E4A; Tue, 27 Apr 2021 08:44: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 4FTwLQ1B0Yz3RFk; Tue, 27 Apr 2021 08:44: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 0683817F17; Tue, 27 Apr 2021 08:44: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 13R8ijkG079143; Tue, 27 Apr 2021 08:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13R8ijmt079142; Tue, 27 Apr 2021 08:44:45 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:44:45 GMT Message-Id: <202104270844.13R8ijmt079142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 7bed7043e216 - stable/13 - __FreeBSD_version: update the references to the doc tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7bed7043e216119a0c9c261f4cbd93d5cd6b0944 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:44:46 -0000 The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=7bed7043e216119a0c9c261f4cbd93d5cd6b0944 commit 7bed7043e216119a0c9c261f4cbd93d5cd6b0944 Author: Ka Ho Ng AuthorDate: 2021-04-22 09:36:22 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-27 08:44:17 +0000 __FreeBSD_version: update the references to the doc tree Update the reference of which file to update in the doc tree when bumping __FreeBSD_version. This change is to catch up with commit f8fed61b80 in the doc repository. Approved by: lwhsu (mentor), philip (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29920 (cherry picked from commit 7c707c7c25ad361f911716c31d22f5722f4dffc9) --- 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 a08ec36f6fcc..e547452e5af1 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -52,7 +52,7 @@ * there. * Currently this lives here in the doc/ repository: * - * documentation/content/en/books/porters-handbook/versions/chapter.adoc + * documentation/content/en/books/porters-handbook/versions/_index.adoc * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-dev-commits-src-all@freebsd.org Tue Apr 27 08:44:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7E0B6261B8; Tue, 27 Apr 2021 08: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 4FTwLN68fLz3h5d; Tue, 27 Apr 2021 08: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 C4F1F17EB9; Tue, 27 Apr 2021 08: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 13R8iiPG079115; Tue, 27 Apr 2021 08: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 13R8iiTB079114; Tue, 27 Apr 2021 08:44:44 GMT (envelope-from git) Date: Tue, 27 Apr 2021 08:44:44 GMT Message-Id: <202104270844.13R8iiTB079114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 17db2ae5b520 - stable/13 - vnode_pager_setsize.9: Some clarifications on the manpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17db2ae5b520961bb9766fdcc0a41b68d571fd68 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 08:44:45 -0000 The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=17db2ae5b520961bb9766fdcc0a41b68d571fd68 commit 17db2ae5b520961bb9766fdcc0a41b68d571fd68 Author: Ka Ho Ng AuthorDate: 2021-04-11 06:45:37 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-27 08:44:12 +0000 vnode_pager_setsize.9: Some clarifications on the manpage A number of changes: - Clarifies the locking rules when calling the routine. - Correct the description regarding the content range to be purged. - Document the effects on page fault handler. MFC with: 86a52e262a6f Sponsored by: The FreeBSD Foundation Reviewed by: bcr, kib Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29637 (cherry picked from commit b77f5f5553e8ac7868b4b234a36bda3cf2db0907) --- share/man/man9/vnode_pager_setsize.9 | 41 ++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/share/man/man9/vnode_pager_setsize.9 b/share/man/man9/vnode_pager_setsize.9 index c59a01796f20..0dc3b2057930 100644 --- a/share/man/man9/vnode_pager_setsize.9 +++ b/share/man/man9/vnode_pager_setsize.9 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 6, 2021 +.Dd April 8, 2021 .Dt VNODE_PAGER_SETSIZE 9 .Os .Sh NAME @@ -41,26 +41,31 @@ .Fn vnode_pager_setsize "struct vnode *vp" "vm_ooffset_t nsize" .Sh DESCRIPTION .Nm -lets the VM system know about a change in size for a file. -Content beyond the new EOF specified by the -.Fa nsize -argument will be purged from the cache. -This function is useful for use within file system code to implement -truncation in -.Xr VOP_SETATTR 9 . -.Sh IMPLEMENTATION NOTES +lets the VM system know about a change in size for a file, +and updates the object size and vnode pager size of the vm object in +.Fa vp +with +.Fa nsize . +Page faults on the object mapping with offset beyond the new object +size results in +.Va SIGBUS . +.Pp +Pages between the old EOF and the new EOF are removed from the object queue +if the file size shrinks. In case the new EOF specified by the .Fa nsize -argument is not aligned to page boundaries, -partial-page area starting beyond the EOF will be zeroed. -In partial-page area, -for content occupying whole blocks within block -boundaries, -the dirty bits for the corresponding blocks will be cleared. -.Sh LOCKING -Writer lock of the VM object of +argument is not aligned to page boundary, +partial-page area starting beyond the EOF is zeroed and marked invalid. +if the page exists resident. +.Pp +In case the vnode .Fa vp -will be held within the function. +does not have a VM object allocated, the effect of calling this function is no-op. +.Pp +This function must be used within file system code to implement truncation +if the file system allocates vm objects for vnodes. +.Sh LOCKS +The vnode should be exclusively locked on entry and will still be locked on exit. .Sh SEE ALSO .Xr vnode 9 .Sh HISTORY From owner-dev-commits-src-all@freebsd.org Tue Apr 27 09:05:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 09:05:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 11:02:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 11:21:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 11:38:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 12:42:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 12:47:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCDDE5F0060; Tue, 27 Apr 2021 12:47: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 4FV1kj4zYZz3wT3; Tue, 27 Apr 2021 12:47: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 9E0061AE57; Tue, 27 Apr 2021 12:47: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 13RClf1v001321; Tue, 27 Apr 2021 12:47:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RClf3m001320; Tue, 27 Apr 2021 12:47:41 GMT (envelope-from git) Date: Tue, 27 Apr 2021 12:47:41 GMT Message-Id: <202104271247.13RClf3m001320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 2f2a081e5c9d - stable/13 - Fix race in case of device destruction. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f2a081e5c9d1418c44b8b26501d9d34e357fca7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 12:47:41 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2f2a081e5c9d1418c44b8b26501d9d34e357fca7 commit 2f2a081e5c9d1418c44b8b26501d9d34e357fca7 Author: Alexander Motin AuthorDate: 2021-04-13 15:19:10 +0000 Commit: Alexander Motin CommitDate: 2021-04-27 12:47:39 +0000 Fix race in case of device destruction. During device destruction it is possible that open() succeed, but fdevname() return NULL, that can't be assigned to string variable. Fix that by adding explicit NULL check. Also while there switch from fdevname() to fdevname_r(). Sponsored by: iXsystems, Inc. MFC after: 2 weeks (cherry picked from commit e49d3eb40324eaffaa13b93f2c4173dfa04dfa34) --- lib/libdevdctl/event.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libdevdctl/event.cc b/lib/libdevdctl/event.cc index 36c9b725fed1..76ef1896975a 100644 --- a/lib/libdevdctl/event.cc +++ b/lib/libdevdctl/event.cc @@ -277,6 +277,7 @@ Event::GetTimestamp() const bool Event::DevPath(std::string &path) const { + char buf[SPECNAMELEN + 1]; string devName; if (!DevName(devName)) @@ -288,7 +289,11 @@ Event::DevPath(std::string &path) const return (false); /* Normalize the device name in case the DEVFS event is for a link. */ - devName = fdevname(devFd); + if (fdevname_r(devFd, buf, sizeof(buf)) == NULL) { + close(devFd); + return (false); + } + devName = buf; path = _PATH_DEV + devName; close(devFd); From owner-dev-commits-src-all@freebsd.org Tue Apr 27 12:48:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 846CF5F03B5; Tue, 27 Apr 2021 12:48: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 4FV1mC3C3qz3wX1; Tue, 27 Apr 2021 12:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60FC21B113; Tue, 27 Apr 2021 12:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13RCmxMs001551; Tue, 27 Apr 2021 12:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RCmxmN001550; Tue, 27 Apr 2021 12:48:59 GMT (envelope-from git) Date: Tue, 27 Apr 2021 12:48:59 GMT Message-Id: <202104271248.13RCmxmN001550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 95b86ac22728 - stable/12 - Fix race in case of device destruction. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 95b86ac2272885b4e1b9b3c2f0aafca7ea90fabc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 12:48:59 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=95b86ac2272885b4e1b9b3c2f0aafca7ea90fabc commit 95b86ac2272885b4e1b9b3c2f0aafca7ea90fabc Author: Alexander Motin AuthorDate: 2021-04-13 15:19:10 +0000 Commit: Alexander Motin CommitDate: 2021-04-27 12:48:57 +0000 Fix race in case of device destruction. During device destruction it is possible that open() succeed, but fdevname() return NULL, that can't be assigned to string variable. Fix that by adding explicit NULL check. Also while there switch from fdevname() to fdevname_r(). Sponsored by: iXsystems, Inc. MFC after: 2 weeks (cherry picked from commit e49d3eb40324eaffaa13b93f2c4173dfa04dfa34) --- lib/libdevdctl/event.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libdevdctl/event.cc b/lib/libdevdctl/event.cc index 36c9b725fed1..76ef1896975a 100644 --- a/lib/libdevdctl/event.cc +++ b/lib/libdevdctl/event.cc @@ -277,6 +277,7 @@ Event::GetTimestamp() const bool Event::DevPath(std::string &path) const { + char buf[SPECNAMELEN + 1]; string devName; if (!DevName(devName)) @@ -288,7 +289,11 @@ Event::DevPath(std::string &path) const return (false); /* Normalize the device name in case the DEVFS event is for a link. */ - devName = fdevname(devFd); + if (fdevname_r(devFd, buf, sizeof(buf)) == NULL) { + close(devFd); + return (false); + } + devName = buf; path = _PATH_DEV + devName; close(devFd); From owner-dev-commits-src-all@freebsd.org Tue Apr 27 13:53:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:01:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:01:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:01:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:01:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:03:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:03:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:07:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 17:35:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18B815F901A; Tue, 27 Apr 2021 17:35: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 4FV87364xvz4gY3; Tue, 27 Apr 2021 17:35: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 A38EF1F003; Tue, 27 Apr 2021 17:35: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 13RHZhAb092092; Tue, 27 Apr 2021 17:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RHZhTV092091; Tue, 27 Apr 2021 17:35:43 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:35:43 GMT Message-Id: <202104271735.13RHZhTV092091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Sofian Brabez Subject: git: 447133ecfd2f - stable/13 - wlanstats: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 447133ecfd2fb6fa065b7ffce14f717777813566 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:35:44 -0000 The branch stable/13 has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=447133ecfd2fb6fa065b7ffce14f717777813566 commit 447133ecfd2fb6fa065b7ffce14f717777813566 Author: Sofian Brabez AuthorDate: 2021-04-20 18:31:48 +0000 Commit: Sofian Brabez CommitDate: 2021-04-27 17:31:18 +0000 wlanstats: fix build Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats Approved by: adrian MFC after: 1 week (cherry picked from commit b8be8094958a01255f5430bd6a36ff936bdd53c3) --- tools/tools/net80211/wlanstats/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile index 2d23932a62a5..f4384c6d0709 100644 --- a/tools/tools/net80211/wlanstats/Makefile +++ b/tools/tools/net80211/wlanstats/Makefile @@ -10,6 +10,6 @@ CFLAGS+=-I${.CURDIR}/../../../../lib/libbsdstat/ SRCS= wlanstats.c main.c -CFLAGS.clang+= -fbracket-depth=512 +CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align .include From owner-dev-commits-src-all@freebsd.org Tue Apr 27 17:35:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAA175F909E; Tue, 27 Apr 2021 17:35: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 4FV8724SP3z4gbS; Tue, 27 Apr 2021 17:35: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 8B9681EDE2; Tue, 27 Apr 2021 17:35: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 13RHZgRo092048; Tue, 27 Apr 2021 17:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RHZgQd092047; Tue, 27 Apr 2021 17:35:42 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:35:42 GMT Message-Id: <202104271735.13RHZgQd092047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Sofian Brabez Subject: git: d61f10a8780e - stable/13 - iwnstats: fix build with clang and allow install under /usr/local/sbin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d61f10a8780ef94f82e384248ce40d24fc27ad2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:35:42 -0000 The branch stable/13 has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d61f10a8780ef94f82e384248ce40d24fc27ad2b commit d61f10a8780ef94f82e384248ce40d24fc27ad2b Author: Sofian Brabez AuthorDate: 2021-04-20 17:58:46 +0000 Commit: Sofian Brabez CommitDate: 2021-04-27 17:31:12 +0000 iwnstats: fix build with clang and allow install under /usr/local/sbin iwnstats was not compiling because of some issues raised by the clang compiler due to -Werror. As a tool it is not connected to world build. Add missing field "barker_mrc" initialization in struct iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused pointer *is on iwn_stats_*_print functions and unused variables for -Wunused-parameter and -Wunused-variable. The value for field "barker_mrc" of struct iwn2030_sensitivity_limits was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115 .barker_corr_th_min_mrc = 390). Also set BINDIR in Makefile to make it possible to install under /usr/local/sbin/iwnstats as it require super user. Reviewed by: adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29800 (cherry picked from commit 561d34d70596b455c6a513431f8ad007076f90c5) --- sys/dev/iwn/if_iwnreg.h | 3 ++- tools/tools/iwn/iwnstats/Makefile | 2 ++ tools/tools/iwn/iwnstats/main.c | 26 +++++++++++--------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index e53343cfbf4a..54945f63df16 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -2267,7 +2267,8 @@ static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = { 160,310, 97, 97, - 110 + 110, + 390 }; /* Map TID to TX scheduler's FIFO. */ diff --git a/tools/tools/iwn/iwnstats/Makefile b/tools/tools/iwn/iwnstats/Makefile index b35530c324b0..685e40759fb2 100644 --- a/tools/tools/iwn/iwnstats/Makefile +++ b/tools/tools/iwn/iwnstats/Makefile @@ -15,6 +15,8 @@ PROG= iwnstats # to not compile, use gcc for now. #CC= gcc +BINDIR?=/usr/local/sbin + SRCS= main.c iwn_ioctl.c # CFLAGS.clang+= -fbracket-depth=512 diff --git a/tools/tools/iwn/iwnstats/main.c b/tools/tools/iwn/iwnstats/main.c index b047e11ce6b8..8717bc48f824 100644 --- a/tools/tools/iwn/iwnstats/main.c +++ b/tools/tools/iwn/iwnstats/main.c @@ -72,8 +72,7 @@ iwnstats_new(const char *ifname) } static void -iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, - const char *prefix) +iwn_stats_phy_print(struct iwn_rx_phy_stats *rxphy, const char *prefix) { printf("%s: %s: ina=%d, fina=%d, bad_plcp=%d, bad_crc32=%d, overrun=%d, eoverrun=%d\n", @@ -108,7 +107,7 @@ iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, } static void -iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) +iwn_stats_rx_general_print(struct iwn_rx_general_stats *g) { printf("%s: bad_cts=%d, bad_ack=%d, not_bss=%d, filtered=%d, bad_chan=%d, beacons=%d\n", @@ -147,7 +146,7 @@ iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) } static void -iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) +iwn_stats_tx_print(struct iwn_tx_stats *tx) { printf("%s: preamble=%d, rx_detected=%d, bt_defer=%d, bt_kill=%d, short_len=%d\n", @@ -191,7 +190,7 @@ iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) } static void -iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) +iwn_stats_ht_phy_print(struct iwn_rx_ht_phy_stats *ht) { printf("%s: bad_plcp=%d, overrun=%d, eoverrun=%d, good_crc32=%d, bad_crc32=%d\n", @@ -212,7 +211,7 @@ iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) static void -iwn_stats_general_print(struct iwnstats *is, struct iwn_stats *stats) +iwn_stats_general_print(struct iwn_stats *stats) { /* General */ @@ -249,16 +248,16 @@ iwn_print(struct iwnstats *is) gettimeofday(&tv, NULL); printf("time=%ld.%.6ld\n", (long)tv.tv_sec, (long)tv.tv_usec); - iwn_stats_general_print(is, s); + iwn_stats_general_print(s); /* RX */ - iwn_stats_phy_print(is, &s->rx.ofdm, "ofdm"); - iwn_stats_phy_print(is, &s->rx.cck, "cck"); - iwn_stats_ht_phy_print(is, &s->rx.ht); - iwn_stats_rx_general_print(is, &s->rx.general); + iwn_stats_phy_print(&s->rx.ofdm, "ofdm"); + iwn_stats_phy_print(&s->rx.cck, "cck"); + iwn_stats_ht_phy_print(&s->rx.ht); + iwn_stats_rx_general_print(&s->rx.general); /* TX */ - iwn_stats_tx_print(is, &s->tx); + iwn_stats_tx_print(&s->tx); printf("--\n"); } @@ -278,9 +277,6 @@ main(int argc, char *argv[]) int ch; char *ifname; bool first; - char *sysctlname; - size_t len; - int ret; ifname = strdup(IWN_DEFAULT_IF); From owner-dev-commits-src-all@freebsd.org Tue Apr 27 17:37:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9645F90D6; Tue, 27 Apr 2021 17:37: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 4FV88g3d3Xz4ghc; Tue, 27 Apr 2021 17:37: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 6F1A51F006; Tue, 27 Apr 2021 17:37: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 13RHb7QU092304; Tue, 27 Apr 2021 17:37:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RHb7xQ092303; Tue, 27 Apr 2021 17:37:07 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:37:07 GMT Message-Id: <202104271737.13RHb7xQ092303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Sofian Brabez Subject: git: f019ff28e429 - stable/12 - iwnstats: fix build with clang and allow install under /usr/local/sbin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f019ff28e4291f1580cb965d8bb1fd2a46a140ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:37:07 -0000 The branch stable/12 has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f019ff28e4291f1580cb965d8bb1fd2a46a140ce commit f019ff28e4291f1580cb965d8bb1fd2a46a140ce Author: Sofian Brabez AuthorDate: 2021-04-20 17:58:46 +0000 Commit: Sofian Brabez CommitDate: 2021-04-27 17:33:36 +0000 iwnstats: fix build with clang and allow install under /usr/local/sbin iwnstats was not compiling because of some issues raised by the clang compiler due to -Werror. As a tool it is not connected to world build. Add missing field "barker_mrc" initialization in struct iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused pointer *is on iwn_stats_*_print functions and unused variables for -Wunused-parameter and -Wunused-variable. The value for field "barker_mrc" of struct iwn2030_sensitivity_limits was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115 .barker_corr_th_min_mrc = 390). Also set BINDIR in Makefile to make it possible to install under /usr/local/sbin/iwnstats as it require super user. Reviewed by: adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29800 (cherry picked from commit 561d34d70596b455c6a513431f8ad007076f90c5) --- sys/dev/iwn/if_iwnreg.h | 3 ++- tools/tools/iwn/iwnstats/Makefile | 2 ++ tools/tools/iwn/iwnstats/main.c | 26 +++++++++++--------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index e53343cfbf4a..54945f63df16 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -2267,7 +2267,8 @@ static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = { 160,310, 97, 97, - 110 + 110, + 390 }; /* Map TID to TX scheduler's FIFO. */ diff --git a/tools/tools/iwn/iwnstats/Makefile b/tools/tools/iwn/iwnstats/Makefile index b35530c324b0..685e40759fb2 100644 --- a/tools/tools/iwn/iwnstats/Makefile +++ b/tools/tools/iwn/iwnstats/Makefile @@ -15,6 +15,8 @@ PROG= iwnstats # to not compile, use gcc for now. #CC= gcc +BINDIR?=/usr/local/sbin + SRCS= main.c iwn_ioctl.c # CFLAGS.clang+= -fbracket-depth=512 diff --git a/tools/tools/iwn/iwnstats/main.c b/tools/tools/iwn/iwnstats/main.c index b047e11ce6b8..8717bc48f824 100644 --- a/tools/tools/iwn/iwnstats/main.c +++ b/tools/tools/iwn/iwnstats/main.c @@ -72,8 +72,7 @@ iwnstats_new(const char *ifname) } static void -iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, - const char *prefix) +iwn_stats_phy_print(struct iwn_rx_phy_stats *rxphy, const char *prefix) { printf("%s: %s: ina=%d, fina=%d, bad_plcp=%d, bad_crc32=%d, overrun=%d, eoverrun=%d\n", @@ -108,7 +107,7 @@ iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, } static void -iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) +iwn_stats_rx_general_print(struct iwn_rx_general_stats *g) { printf("%s: bad_cts=%d, bad_ack=%d, not_bss=%d, filtered=%d, bad_chan=%d, beacons=%d\n", @@ -147,7 +146,7 @@ iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) } static void -iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) +iwn_stats_tx_print(struct iwn_tx_stats *tx) { printf("%s: preamble=%d, rx_detected=%d, bt_defer=%d, bt_kill=%d, short_len=%d\n", @@ -191,7 +190,7 @@ iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) } static void -iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) +iwn_stats_ht_phy_print(struct iwn_rx_ht_phy_stats *ht) { printf("%s: bad_plcp=%d, overrun=%d, eoverrun=%d, good_crc32=%d, bad_crc32=%d\n", @@ -212,7 +211,7 @@ iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) static void -iwn_stats_general_print(struct iwnstats *is, struct iwn_stats *stats) +iwn_stats_general_print(struct iwn_stats *stats) { /* General */ @@ -249,16 +248,16 @@ iwn_print(struct iwnstats *is) gettimeofday(&tv, NULL); printf("time=%ld.%.6ld\n", (long)tv.tv_sec, (long)tv.tv_usec); - iwn_stats_general_print(is, s); + iwn_stats_general_print(s); /* RX */ - iwn_stats_phy_print(is, &s->rx.ofdm, "ofdm"); - iwn_stats_phy_print(is, &s->rx.cck, "cck"); - iwn_stats_ht_phy_print(is, &s->rx.ht); - iwn_stats_rx_general_print(is, &s->rx.general); + iwn_stats_phy_print(&s->rx.ofdm, "ofdm"); + iwn_stats_phy_print(&s->rx.cck, "cck"); + iwn_stats_ht_phy_print(&s->rx.ht); + iwn_stats_rx_general_print(&s->rx.general); /* TX */ - iwn_stats_tx_print(is, &s->tx); + iwn_stats_tx_print(&s->tx); printf("--\n"); } @@ -278,9 +277,6 @@ main(int argc, char *argv[]) int ch; char *ifname; bool first; - char *sysctlname; - size_t len; - int ret; ifname = strdup(IWN_DEFAULT_IF); From owner-dev-commits-src-all@freebsd.org Tue Apr 27 17:37:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12EFA5F90D8; Tue, 27 Apr 2021 17:37: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 4FV88h4xbpz4gHv; Tue, 27 Apr 2021 17:37: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 990061F007; Tue, 27 Apr 2021 17:37: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 13RHb8WT092325; Tue, 27 Apr 2021 17:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RHb8cN092324; Tue, 27 Apr 2021 17:37:08 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:37:08 GMT Message-Id: <202104271737.13RHb8cN092324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Sofian Brabez Subject: git: 2414241b0e56 - stable/12 - wlanstats: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2414241b0e56cae959710f13903597f767b53e54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:37:09 -0000 The branch stable/12 has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2414241b0e56cae959710f13903597f767b53e54 commit 2414241b0e56cae959710f13903597f767b53e54 Author: Sofian Brabez AuthorDate: 2021-04-20 18:31:48 +0000 Commit: Sofian Brabez CommitDate: 2021-04-27 17:33:42 +0000 wlanstats: fix build Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats Approved by: adrian MFC after: 1 week (cherry picked from commit b8be8094958a01255f5430bd6a36ff936bdd53c3) --- tools/tools/net80211/wlanstats/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile index 2d23932a62a5..f4384c6d0709 100644 --- a/tools/tools/net80211/wlanstats/Makefile +++ b/tools/tools/net80211/wlanstats/Makefile @@ -10,6 +10,6 @@ CFLAGS+=-I${.CURDIR}/../../../../lib/libbsdstat/ SRCS= wlanstats.c main.c -CFLAGS.clang+= -fbracket-depth=512 +CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align .include From owner-dev-commits-src-all@freebsd.org Tue Apr 27 18:18:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 19:15:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20E1B5FC27D; Tue, 27 Apr 2021 19:15: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 4FVBLh6Fpkz4mZ0; Tue, 27 Apr 2021 19: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 B2F7E20488; Tue, 27 Apr 2021 19: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 13RJFuIu028211; Tue, 27 Apr 2021 19: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 13RJFuhS028210; Tue, 27 Apr 2021 19:15:56 GMT (envelope-from git) Date: Tue, 27 Apr 2021 19:15:56 GMT Message-Id: <202104271915.13RJFuhS028210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 62e32cf9140e - stable/12 - aesni: Avoid modifying session keys in hmac_update() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 62e32cf9140e6c13663dcd69ec3b3c7ca4579782 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 19:15:58 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=62e32cf9140e6c13663dcd69ec3b3c7ca4579782 commit 62e32cf9140e6c13663dcd69ec3b3c7ca4579782 Author: Mark Johnston AuthorDate: 2021-04-27 00:04:25 +0000 Commit: Mark Johnston CommitDate: 2021-04-27 19:10:16 +0000 aesni: Avoid modifying session keys in hmac_update() Otherwise aesni_process() is not thread-safe for AES+SHA-HMAC transforms, since hmac_update() updates the caller-supplied key directly to create the derived key. Use a buffer on the stack to store a copy of the key used for computing inner and outer digests. This is a direct commit to stable/12 as the bug is not present in later branches. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30001 --- sys/crypto/aesni/aesni.c | 18 ++++++++++-------- sys/crypto/aesni/aesni.h | 6 ++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index 76e637861879..594aa59b7046 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -655,10 +655,10 @@ hmac_internal(void *ctx, uint32_t *res, { size_t i; - for (i = 0; i < 64; i++) + for (i = 0; i < AESNI_SHA_BLOCK_LEN; i++) key[i] ^= xorbyte; - update(ctx, key, 64); - for (i = 0; i < 64; i++) + update(ctx, key, AESNI_SHA_BLOCK_LEN); + for (i = 0; i < AESNI_SHA_BLOCK_LEN; i++) key[i] ^= xorbyte; crypto_apply(crpflags, __DECONST(void *, buf), off, buflen, @@ -883,6 +883,7 @@ aesni_cipher_mac(struct aesni_session *ses, struct cryptodesc *crd, struct SHA256Context sha2 __aligned(16); struct sha1_ctxt sha1 __aligned(16); } sctx; + uint8_t hmac_key[AESNI_SHA_BLOCK_LEN] __aligned(16); uint32_t res[SHA2_256_HASH_LEN / sizeof(uint32_t)]; int hashlen, error; void *ctx; @@ -946,15 +947,16 @@ aesni_cipher_mac(struct aesni_session *ses, struct cryptodesc *crd, } if (hmac) { + memcpy(hmac_key, ses->hmac_key, AESNI_SHA_BLOCK_LEN); + /* Inner hash: (K ^ IPAD) || data */ InitFn(ctx); - hmac_internal(ctx, res, UpdateFn, FinalizeFn, ses->hmac_key, - 0x36, crp->crp_buf, crd->crd_skip, crd->crd_len, - crp->crp_flags); + hmac_internal(ctx, res, UpdateFn, FinalizeFn, hmac_key, 0x36, + crp->crp_buf, crd->crd_skip, crd->crd_len, crp->crp_flags); /* Outer hash: (K ^ OPAD) || inner hash */ InitFn(ctx); - hmac_internal(ctx, res, UpdateFn, FinalizeFn, ses->hmac_key, - 0x5C, res, 0, hashlen, 0); + hmac_internal(ctx, res, UpdateFn, FinalizeFn, hmac_key, 0x5C, + res, 0, hashlen, 0); } else { InitFn(ctx); crypto_apply(crp->crp_flags, crp->crp_buf, crd->crd_skip, diff --git a/sys/crypto/aesni/aesni.h b/sys/crypto/aesni/aesni.h index eeb5b4361879..d1e7abaa6062 100644 --- a/sys/crypto/aesni/aesni.h +++ b/sys/crypto/aesni/aesni.h @@ -52,12 +52,14 @@ #define AES256_ROUNDS 14 #define AES_SCHED_LEN ((AES256_ROUNDS + 1) * AES_BLOCK_LEN) +/* SHA1, SHA2-224 and SHA2-256 only. */ +#define AESNI_SHA_BLOCK_LEN 64 + struct aesni_session { uint8_t enc_schedule[AES_SCHED_LEN] __aligned(16); uint8_t dec_schedule[AES_SCHED_LEN] __aligned(16); uint8_t xts_schedule[AES_SCHED_LEN] __aligned(16); - /* Same as the SHA256 Blocksize. */ - uint8_t hmac_key[SHA1_BLOCK_LEN] __aligned(16); + uint8_t hmac_key[AESNI_SHA_BLOCK_LEN]; int algo; int rounds; /* uint8_t *ses_ictx; */ From owner-dev-commits-src-all@freebsd.org Tue Apr 27 19:19:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 20:19:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F8DC6213DD; Tue, 27 Apr 2021 20:19: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 4FVCmR0bD3z4rxR; Tue, 27 Apr 2021 20:19: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 06FF620DB1; Tue, 27 Apr 2021 20:19: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 13RKJovH008180; Tue, 27 Apr 2021 20:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RKJoD6008179; Tue, 27 Apr 2021 20:19:50 GMT (envelope-from git) Date: Tue, 27 Apr 2021 20:19:50 GMT Message-Id: <202104272019.13RKJoD6008179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: fbe149eef7d8 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fbe149eef7d8f225138809528e2824bfabc4419c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 20:19:51 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=fbe149eef7d8f225138809528e2824bfabc4419c commit fbe149eef7d8f225138809528e2824bfabc4419c Author: Alexander V. Chernikov AuthorDate: 2021-04-27 08:04:19 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-27 19:59:27 +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 (cherry picked from commit 25682e6a495fc6669d799bb64acdaf14d653173e) --- 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 b7a7e5170c74..405300a394de 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-all@freebsd.org Tue Apr 27 21:26:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 21:26:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A8CE622E26; Tue, 27 Apr 2021 21:26:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_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 4FVFFW2T9qz4vQr; Tue, 27 Apr 2021 21:26:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2EAD0260195; Tue, 27 Apr 2021 23:26:37 +0200 (CEST) Subject: Re: An apology about my commits To: Neel Chauhan , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org References: <6ae37bda99dfc279faff0ed0d50e3bfe@neelc.org> From: Hans Petter Selasky Message-ID: Date: Tue, 27 Apr 2021 23:25:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <6ae37bda99dfc279faff0ed0d50e3bfe@neelc.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FVFFW2T9qz4vQr 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 21:26:39 -0000 On 4/27/21 12:53 AM, Neel Chauhan wrote: > Hi src committers, > > I hope all is well with you. > > I am really sorry about me prematurely pushing these MFC'ing these > linuxkpi commits to stable/13 instead of waiting out the three-day minimum: > > > Going forward, I will respect the 3 day waiting period for future src > commits. > > I hope you all have a great day. Hi Neel, All your patches were solid and reviewed by others and didn't break the builds. I would expect that the comments in differential were squashed together as a single patch before the commit. I personally use "env GIT_EDITOR=ee git rebase -i", and then change the word "pick" into "s" for squashing. The 3-day minimum waiting period is more or less to catch issues with the patches before they hit -stable branches. Only in rare cases I've seen exceptions, but I've never seen anyone loose their commit bits over that :-) So don't worry and sleep well. Keep up the good work in the LinuxKPI Neel! And if in doubt there are many active FreeBSD developers to ask before commit :-) --HPS > > Thank You, > > Neel Chauhan (nc@) > _______________________________________________ > 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" From owner-dev-commits-src-all@freebsd.org Tue Apr 27 22:10:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 22:30:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 22:36:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Tue Apr 27 23:13:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51393624C68; Tue, 27 Apr 2021 23:13: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 4FVHcN1pkFz3GfS; Tue, 27 Apr 2021 23:13: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 3122E235C2; Tue, 27 Apr 2021 23:13: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 13RND89J044592; Tue, 27 Apr 2021 23:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RND8hp044591; Tue, 27 Apr 2021 23:13:08 GMT (envelope-from git) Date: Tue, 27 Apr 2021 23:13:08 GMT Message-Id: <202104272313.13RND8hp044591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 84800ef64b9f - stable/11 - nfsd: fix replies from session cache for retried 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/stable/11 X-Git-Reftype: branch X-Git-Commit: 84800ef64b9f8b75466c9622b9c105b227a5e2d3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 23:13:08 -0000 The branch stable/11 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=84800ef64b9f8b75466c9622b9c105b227a5e2d3 commit 84800ef64b9f8b75466c9622b9c105b227a5e2d3 Author: Rick Macklem AuthorDate: 2021-04-08 21:04:22 +0000 Commit: Rick Macklem CommitDate: 2021-04-27 23:08:47 +0000 nfsd: fix replies from session cache for retried RPCs Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. The FreeBSD server failed to reply using the cached reply in the session slot when an RPC was retried on the session slot, as indicated by same slot sequence#. This patch fixes this. It should also fix a similar failure for NFSv4.0 mounts, when the sequence# in the open/lock_owner requires a reply be done from an entry locked into the DRC. This fix affects the fairly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation. Note that retries only occur after the client has needed to create a new TCP connection. (cherry picked from commit 05a39c2c1c18cd0c4382a4f58e0952d3f77e7dfa) --- sys/fs/nfsserver/nfs_nfsdkrpc.c | 7 ++++++- sys/fs/nfsserver/nfs_nfsdsubs.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c index e1d82b33eb81..f77af2779847 100644 --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c @@ -388,8 +388,13 @@ nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt, m = NULL; if ((nd->nd_flag & ND_HASSEQUENCE) != 0) nfsrv_cache_session(nd, &m); - if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { nd->nd_repstat = 0; + if (m != NULL) { + m_freem(nd->nd_mreq); + nd->nd_mreq = m; + } + } cacherep = RC_REPLY; } else { if (nd->nd_repstat == NFSERR_DONTREPLY) diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index 382ed291c38b..0080f26ea643 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -1506,6 +1506,8 @@ nfsd_errmap(struct nfsrv_descript *nd) else if (nd->nd_repstat == NFSERR_MINORVERMISMATCH || nd->nd_repstat == NFSERR_OPILLEGAL) return (txdr_unsigned(nd->nd_repstat)); + else if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + return (txdr_unsigned(NFSERR_IO)); else if ((nd->nd_flag & ND_NFSV41) != 0) { if (nd->nd_repstat == EOPNOTSUPP) nd->nd_repstat = NFSERR_NOTSUPP; From owner-dev-commits-src-all@freebsd.org Tue Apr 27 23:19:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 074ED6252C3; Tue, 27 Apr 2021 23:19: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 4FVHlt6ng8z3Gfl; Tue, 27 Apr 2021 23:19: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 DBFA023707; Tue, 27 Apr 2021 23:19: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 13RNJcHV045120; Tue, 27 Apr 2021 23:19:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RNJc6M045119; Tue, 27 Apr 2021 23:19:38 GMT (envelope-from git) Date: Tue, 27 Apr 2021 23:19:38 GMT Message-Id: <202104272319.13RNJc6M045119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: b2cb7574420e - stable/11 - nfsd: fix replies from session cache for multiple retries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: b2cb7574420ed01f7b3ef99cade7b5dd935b9890 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 23:19:39 -0000 The branch stable/11 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b2cb7574420ed01f7b3ef99cade7b5dd935b9890 commit b2cb7574420ed01f7b3ef99cade7b5dd935b9890 Author: Rick Macklem AuthorDate: 2021-04-10 22:50:25 +0000 Commit: Rick Macklem CommitDate: 2021-04-27 23:16:07 +0000 nfsd: fix replies from session cache for multiple retries Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. Commit 05a39c2c1c18 fixed replying with the cached reply in in the session slot if same session slot sequence#. However, the code uses the reply and, as such, will fail for a subsequent retry of the RPC. A subsequent retry would be an extremely rare event, but this patch fixes this, so long as m_copym(..M_NOWAIT) does not fail, which should also be a rare event. This fix affects the exceedingly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation, multiple times. Note that retries only occur after the client has needed to create a new TCP connection, with a new TCP connection for each retry. (cherry picked from commit 22cefe3d8378f58adcdbb2c7589b9f30c2a38315) --- sys/fs/nfs/nfs_commonsubs.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 03f1676ecd6d..096614565a5e 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4145,6 +4145,7 @@ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, struct nfsslot *slots, struct mbuf **reply, uint16_t maxslot) { + struct mbuf *m; int error; error = 0; @@ -4158,8 +4159,14 @@ nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, error = NFSERR_DELAY; else if (slots[slotid].nfssl_reply != NULL) { if (reply != NULL) { - *reply = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + m = m_copym(slots[slotid].nfssl_reply, 0, + M_COPYALL, M_NOWAIT); + if (m != NULL) + *reply = m; + else { + *reply = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } } slots[slotid].nfssl_inprog = 1; error = NFSERR_REPLYFROMCACHE; @@ -4186,10 +4193,29 @@ void nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat, struct mbuf **rep) { + struct mbuf *m; if (repstat == NFSERR_REPLYFROMCACHE) { - *rep = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + if (slots[slotid].nfssl_reply != NULL) { + /* + * We cannot sleep here, but copy will usually + * succeed. + */ + m = m_copym(slots[slotid].nfssl_reply, 0, M_COPYALL, + M_NOWAIT); + if (m != NULL) + *rep = m; + else { + /* + * Multiple retries would be extremely rare, + * so using the cached reply will likely + * be ok. + */ + *rep = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } + } else + *rep = NULL; } else { if (slots[slotid].nfssl_reply != NULL) m_freem(slots[slotid].nfssl_reply); From owner-dev-commits-src-all@freebsd.org Wed Apr 28 00:10:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21D7E625F5D; Wed, 28 Apr 2021 00:10: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 4FVJv70S7bz3JKy; Wed, 28 Apr 2021 00:10:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0261324191; Wed, 28 Apr 2021 00:10:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13S0Awws020432; Wed, 28 Apr 2021 00:10:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S0AwJh020431; Wed, 28 Apr 2021 00:10:58 GMT (envelope-from git) Date: Wed, 28 Apr 2021 00:10:58 GMT Message-Id: <202104280010.13S0AwJh020431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e3bbb369c44b - stable/13 - libkiconv: address memory leak in not-found cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e3bbb369c44b7b3c43a430b090d47e67573edb6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 00:10:59 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e3bbb369c44b7b3c43a430b090d47e67573edb6d commit e3bbb369c44b7b3c43a430b090d47e67573edb6d Author: Ed Maste AuthorDate: 2021-04-21 17:45:27 +0000 Commit: Ed Maste CommitDate: 2021-04-28 00:10:12 +0000 libkiconv: address memory leak in not-found cases Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 (cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617) --- lib/libkiconv/kiconv_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index da68b3011f36..841a162bfd27 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -59,6 +59,7 @@ kiconv_lookupconv(const char *drvname) free(drivers); return (0); } + free(drivers); } return (ENOENT); } @@ -86,6 +87,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) return (0); } } + free(csi); } return (ENOENT); } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 00:12:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8560A6264B2; Wed, 28 Apr 2021 00:12: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 4FVJwV3RRrz3JcP; Wed, 28 Apr 2021 00:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F2F23B7A; Wed, 28 Apr 2021 00:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13S0CA2O021453; Wed, 28 Apr 2021 00:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S0CAQo021452; Wed, 28 Apr 2021 00:12:10 GMT (envelope-from git) Date: Wed, 28 Apr 2021 00:12:10 GMT Message-Id: <202104280012.13S0CAQo021452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7452b2e44be6 - stable/12 - libkiconv: address memory leak in not-found cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7452b2e44be687ba2916b1a80fbbe281f3edffb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 00:12:10 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7452b2e44be687ba2916b1a80fbbe281f3edffb2 commit 7452b2e44be687ba2916b1a80fbbe281f3edffb2 Author: Ed Maste AuthorDate: 2021-04-21 17:45:27 +0000 Commit: Ed Maste CommitDate: 2021-04-28 00:11:42 +0000 libkiconv: address memory leak in not-found cases Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 (cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617) --- lib/libkiconv/kiconv_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index da68b3011f36..841a162bfd27 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -59,6 +59,7 @@ kiconv_lookupconv(const char *drvname) free(drivers); return (0); } + free(drivers); } return (ENOENT); } @@ -86,6 +87,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) return (0); } } + free(csi); } return (ENOENT); } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 00:12:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7FF62670A; Wed, 28 Apr 2021 00:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVJww3bWqz3JPh; Wed, 28 Apr 2021 00:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E6DB24164; Wed, 28 Apr 2021 00:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13S0CWZ8023940; Wed, 28 Apr 2021 00:12:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S0CWI2023939; Wed, 28 Apr 2021 00:12:32 GMT (envelope-from git) Date: Wed, 28 Apr 2021 00:12:32 GMT Message-Id: <202104280012.13S0CWI2023939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8e64d97d94f7 - stable/11 - libkiconv: address memory leak in not-found cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 00:12:32 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b commit 8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b Author: Ed Maste AuthorDate: 2021-04-21 17:45:27 +0000 Commit: Ed Maste CommitDate: 2021-04-28 00:12:06 +0000 libkiconv: address memory leak in not-found cases Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 (cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617) --- lib/libkiconv/kiconv_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index 7eebf2b4e0c7..bc2e3341ab0b 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -57,6 +57,7 @@ kiconv_lookupconv(const char *drvname) free(drivers); return (0); } + free(drivers); } return (ENOENT); } @@ -84,6 +85,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) return (0); } } + free(csi); } return (ENOENT); } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 00:33:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 01:30:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 01:55:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42E096287C3 for ; Wed, 28 Apr 2021 01:55:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (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 4FVMCD1F67z3NFP for ; Wed, 28 Apr 2021 01:55:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf35.google.com with SMTP id dm16so5220346qvb.3 for ; Tue, 27 Apr 2021 18:55:03 -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=IDPMaaaWqU4/Nm9naLn7hXlgvwiLW5oWWj+fgFb1QkQV9rAxiW/krpGdQBSz/lcQLw 5j6CV66PnHtULqZk/3INuUbzgYDsrM0Fmb/9jFBbuwj4hjk70Qfs02HiGJf4Gg47u9U/ eIMgPoTNRPxcXsZrifBb5hC8YLhAwX3fYkNGF4v52i6h6UMa/D2kELED3/DcoMboqXX4 edlaDhStEOA4h0sbTSCBjhP0pFtm1h191mEsKAIJO5awyjJDENoBm5qQvtNO1XyTeYAb YwiKs6lVuRzTh8yALaydYsBS56flB2Gn7CI0D/pOFruPudgpSEdGXoz8t1T+wGuohzmJ xZuA== X-Gm-Message-State: AOAM531oYLMFr07fDP+0qGTixrynQMNn1/p+AXABSgxwkeJTrshZNj7q QYX6jyZbqJjnfJ6nkKuwEm/CP+KeByoxFMysOc+DOg== 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: 4FVMCD1F67z3NFP 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 04:59:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 06:03:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 08:16:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 09:19:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 09:36:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 769315E255A; Wed, 28 Apr 2021 09:36: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 4FVYRk2kyYz4S9f; Wed, 28 Apr 2021 09:36: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 5107939CA; Wed, 28 Apr 2021 09:36: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 13S9aYHx066231; Wed, 28 Apr 2021 09:36:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13S9aYf1066230; Wed, 28 Apr 2021 09:36:34 GMT (envelope-from git) Date: Wed, 28 Apr 2021 09:36:34 GMT Message-Id: <202104280936.13S9aYf1066230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome Subject: git: eabfffcb4c14 - stable/13 - loader: do not output empty menu title MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eabfffcb4c14751d1d2852ed82a1976b69854166 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 09:36:34 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=eabfffcb4c14751d1d2852ed82a1976b69854166 commit eabfffcb4c14751d1d2852ed82a1976b69854166 Author: Toomas Soome AuthorDate: 2021-04-21 11:42:10 +0000 Commit: Toomas Soome CommitDate: 2021-04-28 09:35:54 +0000 loader: do not output empty menu title As we output spaces around the menu title, we should also check, if the title is actually empty string. PR: 255299 Submitted by: Jose Luis Duran Reported by: Jose Luis Duran (cherry picked from 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69) --- stand/forth/menu.4th | 6 +++++- stand/lua/drawer.lua | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/forth/menu.4th b/stand/forth/menu.4th index a336b9f9e7aa..75e75e3e3654 100644 --- a/stand/forth/menu.4th +++ b/stand/forth/menu.4th @@ -490,7 +490,11 @@ also menu-infrastructure definitions menuX @ 19 + over 2 / - menuY @ 1- then swap 1- swap - at-xy space type space + at-xy dup 0= if + 2drop ( empty loader_menu_title ) + else + space type space + then \ If $menu_init is set, evaluate it (allowing for whole menus to be \ constructed dynamically -- as this function could conceivably set diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 523735a75d06..6324c2262c11 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -286,7 +286,10 @@ local function drawbox() menu_header_x = x + (w // 2) - (#menu_header // 2) end screen.setcursor(menu_header_x - 1, y) - printc(" " .. menu_header .. " ") + if menu_header ~= "" then + printc(" " .. menu_header .. " ") + end + end local function drawbrand() From owner-dev-commits-src-all@freebsd.org Wed Apr 28 10:05:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEC825E40A0; Wed, 28 Apr 2021 10:05: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 4FVZ5g6PYJz4Tnb; Wed, 28 Apr 2021 10:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE58D3F9D; Wed, 28 Apr 2021 10:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13SA5xEX006549; Wed, 28 Apr 2021 10:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SA5xEc006548; Wed, 28 Apr 2021 10:05:59 GMT (envelope-from git) Date: Wed, 28 Apr 2021 10:05:59 GMT Message-Id: <202104281005.13SA5xEc006548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 29246f2cb0c5 - stable/13 - ipfw: do not use sleepable malloc in callout context. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 29246f2cb0c5c5c06c73e99dc0d6c947f62c7dc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 10:06:00 -0000 The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=29246f2cb0c5c5c06c73e99dc0d6c947f62c7dc4 commit 29246f2cb0c5c5c06c73e99dc0d6c947f62c7dc4 Author: Andrey V. Elsukov AuthorDate: 2021-04-16 07:22:44 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-04-28 10:05:03 +0000 ipfw: do not use sleepable malloc in callout context. Use M_NOWAIT flag when hash growing is called from callout. PR: 255041 Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D29772 (cherry picked from commit 9bacbf1ae243de43d642c3ac0b7318ae0e5c5235) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 68 ++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 7b5a7f60e495..a76e8b1ac667 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -2582,7 +2582,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) #endif /* INET6 */ static void -dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) +dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new, int flags) { #ifdef INET6 struct dyn_ipv6ck_slist *ipv6, *ipv6_parent; @@ -2600,31 +2600,64 @@ dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) DYN_DEBUG("grow hash size %u -> %u", V_curr_dyn_buckets, new); /* * Allocate and initialize new lists. - * XXXAE: on memory pressure this can disable callout timer. */ bucket_lock = malloc(new * sizeof(struct mtx), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (bucket_lock == NULL) + return; + + ipv4 = ipv4_parent = NULL; + ipv4_add = ipv4_del = ipv4_parent_add = ipv4_parent_del = NULL; +#ifdef INET6 + ipv6 = ipv6_parent = NULL; + ipv6_add = ipv6_del = ipv6_parent_add = ipv6_parent_del = NULL; +#endif + ipv4 = malloc(new * sizeof(struct dyn_ipv4ck_slist), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4 == NULL) + goto bad; ipv4_parent = malloc(new * sizeof(struct dyn_ipv4ck_slist), M_IPFW, - M_WAITOK | M_ZERO); - ipv4_add = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); - ipv4_del = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent == NULL) + goto bad; + ipv4_add = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv4_add == NULL) + goto bad; + ipv4_del = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv4_del == NULL) + goto bad; ipv4_parent_add = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent_add == NULL) + goto bad; ipv4_parent_del = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent_del == NULL) + goto bad; #ifdef INET6 ipv6 = malloc(new * sizeof(struct dyn_ipv6ck_slist), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6 == NULL) + goto bad; ipv6_parent = malloc(new * sizeof(struct dyn_ipv6ck_slist), M_IPFW, - M_WAITOK | M_ZERO); - ipv6_add = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); - ipv6_del = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent == NULL) + goto bad; + ipv6_add = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv6_add == NULL) + goto bad; + ipv6_del = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv6_del == NULL) + goto bad; ipv6_parent_add = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent_add == NULL) + goto bad; ipv6_parent_del = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent_del == NULL) + goto bad; #endif for (bucket = 0; bucket < new; bucket++) { DYN_BUCKET_LOCK_INIT(bucket_lock, bucket); @@ -2695,6 +2728,7 @@ dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) /* Release old resources */ while (bucket-- != 0) DYN_BUCKET_LOCK_DESTROY(bucket_lock, bucket); +bad: free(bucket_lock, M_IPFW); free(ipv4, M_IPFW); free(ipv4_parent, M_IPFW); @@ -2762,7 +2796,7 @@ dyn_tick(void *vnetx) buckets = 1 << fls(V_dyn_count); if (buckets > V_dyn_buckets_max) buckets = V_dyn_buckets_max; - dyn_grow_hashtable(&V_layer3_chain, buckets); + dyn_grow_hashtable(&V_layer3_chain, buckets, M_NOWAIT); } callout_reset_on(&V_dyn_timeout, hz, dyn_tick, vnetx, 0); @@ -3187,7 +3221,7 @@ ipfw_dyn_init(struct ip_fw_chain *chain) /* Initialize buckets. */ V_curr_dyn_buckets = 0; V_dyn_bucket_lock = NULL; - dyn_grow_hashtable(chain, 256); + dyn_grow_hashtable(chain, 256, M_WAITOK); if (IS_DEFAULT_VNET(curvnet)) dyn_hp_cache = malloc(mp_ncpus * sizeof(void *), M_IPFW, From owner-dev-commits-src-all@freebsd.org Wed Apr 28 10:07:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6853E5E40E1; Wed, 28 Apr 2021 10:07: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 4FVZ7K2Nhnz4V43; Wed, 28 Apr 2021 10:07: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 44C873EC7; Wed, 28 Apr 2021 10:07: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 13SA7Plm006756; Wed, 28 Apr 2021 10:07:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SA7P0d006755; Wed, 28 Apr 2021 10:07:25 GMT (envelope-from git) Date: Wed, 28 Apr 2021 10:07:25 GMT Message-Id: <202104281007.13SA7P0d006755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 5ebfa80f7543 - stable/12 - ipfw: do not use sleepable malloc in callout context. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5ebfa80f7543d5cda828ee15ed20c9fc03f99208 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 10:07:25 -0000 The branch stable/12 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=5ebfa80f7543d5cda828ee15ed20c9fc03f99208 commit 5ebfa80f7543d5cda828ee15ed20c9fc03f99208 Author: Andrey V. Elsukov AuthorDate: 2021-04-16 07:22:44 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-04-28 10:06:33 +0000 ipfw: do not use sleepable malloc in callout context. Use M_NOWAIT flag when hash growing is called from callout. PR: 255041 Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D29772 (cherry picked from commit 9bacbf1ae243de43d642c3ac0b7318ae0e5c5235) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 68 ++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 5e425c582f07..8321df175f9d 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -2585,7 +2585,7 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) #endif /* INET6 */ static void -dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) +dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new, int flags) { #ifdef INET6 struct dyn_ipv6ck_slist *ipv6, *ipv6_parent; @@ -2603,31 +2603,64 @@ dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) DYN_DEBUG("grow hash size %u -> %u", V_curr_dyn_buckets, new); /* * Allocate and initialize new lists. - * XXXAE: on memory pressure this can disable callout timer. */ bucket_lock = malloc(new * sizeof(struct mtx), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (bucket_lock == NULL) + return; + + ipv4 = ipv4_parent = NULL; + ipv4_add = ipv4_del = ipv4_parent_add = ipv4_parent_del = NULL; +#ifdef INET6 + ipv6 = ipv6_parent = NULL; + ipv6_add = ipv6_del = ipv6_parent_add = ipv6_parent_del = NULL; +#endif + ipv4 = malloc(new * sizeof(struct dyn_ipv4ck_slist), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4 == NULL) + goto bad; ipv4_parent = malloc(new * sizeof(struct dyn_ipv4ck_slist), M_IPFW, - M_WAITOK | M_ZERO); - ipv4_add = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); - ipv4_del = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent == NULL) + goto bad; + ipv4_add = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv4_add == NULL) + goto bad; + ipv4_del = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv4_del == NULL) + goto bad; ipv4_parent_add = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent_add == NULL) + goto bad; ipv4_parent_del = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv4_parent_del == NULL) + goto bad; #ifdef INET6 ipv6 = malloc(new * sizeof(struct dyn_ipv6ck_slist), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6 == NULL) + goto bad; ipv6_parent = malloc(new * sizeof(struct dyn_ipv6ck_slist), M_IPFW, - M_WAITOK | M_ZERO); - ipv6_add = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); - ipv6_del = malloc(new * sizeof(uint32_t), M_IPFW, M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent == NULL) + goto bad; + ipv6_add = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv6_add == NULL) + goto bad; + ipv6_del = malloc(new * sizeof(uint32_t), M_IPFW, flags | M_ZERO); + if (ipv6_del == NULL) + goto bad; ipv6_parent_add = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent_add == NULL) + goto bad; ipv6_parent_del = malloc(new * sizeof(uint32_t), M_IPFW, - M_WAITOK | M_ZERO); + flags | M_ZERO); + if (ipv6_parent_del == NULL) + goto bad; #endif for (bucket = 0; bucket < new; bucket++) { DYN_BUCKET_LOCK_INIT(bucket_lock, bucket); @@ -2698,6 +2731,7 @@ dyn_grow_hashtable(struct ip_fw_chain *chain, uint32_t new) /* Release old resources */ while (bucket-- != 0) DYN_BUCKET_LOCK_DESTROY(bucket_lock, bucket); +bad: free(bucket_lock, M_IPFW); free(ipv4, M_IPFW); free(ipv4_parent, M_IPFW); @@ -2762,7 +2796,7 @@ dyn_tick(void *vnetx) buckets = 1 << fls(V_dyn_count); if (buckets > V_dyn_buckets_max) buckets = V_dyn_buckets_max; - dyn_grow_hashtable(&V_layer3_chain, buckets); + dyn_grow_hashtable(&V_layer3_chain, buckets, M_NOWAIT); } callout_reset_on(&V_dyn_timeout, hz, dyn_tick, vnetx, 0); @@ -3187,7 +3221,7 @@ ipfw_dyn_init(struct ip_fw_chain *chain) /* Initialize buckets. */ V_curr_dyn_buckets = 0; V_dyn_bucket_lock = NULL; - dyn_grow_hashtable(chain, 256); + dyn_grow_hashtable(chain, 256, M_WAITOK); if (IS_DEFAULT_VNET(curvnet)) dyn_hp_cache = malloc(mp_ncpus * sizeof(void *), M_IPFW, From owner-dev-commits-src-all@freebsd.org Wed Apr 28 11:19:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 11:19:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 13:08:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 14:09:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76C9A5F4BF0; Wed, 28 Apr 2021 14:09: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 4FVgW12rwXz4jYl; Wed, 28 Apr 2021 14:09: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 5526A737F; Wed, 28 Apr 2021 14:09: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 13SE9nUw025262; Wed, 28 Apr 2021 14:09:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SE9noN025261; Wed, 28 Apr 2021 14:09:49 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:09:49 GMT Message-Id: <202104281409.13SE9noN025261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2b826286c3b9 - stable/13 - Add required checks for unmapped mbufs in ipdivert and ipfw MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b826286c3b951df0bb3b4250eecbb7adc5c860b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:09:49 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b826286c3b951df0bb3b4250eecbb7adc5c860b commit 2b826286c3b951df0bb3b4250eecbb7adc5c860b Author: Mark Johnston AuthorDate: 2021-04-21 19:38:01 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:00:13 +0000 Add required checks for unmapped mbufs in ipdivert and ipfw Also add an M_ASSERTMAPPED() macro to verify that all mbufs in the chain are mapped. Use it in ipfw_nat, which operates on a chain returned by m_megapullup(). PR: 255164 Reviewed by: ae, gallatin Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29838 (cherry picked from commit 652908599b6fa7285ee60cb567b97e70b648ac29) --- sys/netinet/ip_divert.c | 6 ++++++ sys/netpfil/ipfw/ip_fw_nat.c | 1 + sys/netpfil/ipfw/nat64/nat64_translate.c | 10 ++++++++++ sys/sys/mbuf.h | 11 +++++++++++ 4 files changed, 28 insertions(+) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 70d3fbd1f230..c3f9c43b8f70 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -212,11 +212,17 @@ divert_packet(struct mbuf *m, bool incoming) /* Delayed checksums are currently not compatible with divert. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + m = mb_unmapped_to_ext(m); + if (m == NULL) + return; in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + m = mb_unmapped_to_ext(m); + if (m == NULL) + return; sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; } diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index bcda3cff011c..d7b31c29d4ec 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -307,6 +307,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m) args->m = NULL; return (IP_FW_DENY); } + M_ASSERTMAPPED(mcl); ip = mtod(mcl, struct ip *); /* diff --git a/sys/netpfil/ipfw/nat64/nat64_translate.c b/sys/netpfil/ipfw/nat64/nat64_translate.c index 4ed3bfa765f6..29666a7d3a9a 100644 --- a/sys/netpfil/ipfw/nat64/nat64_translate.c +++ b/sys/netpfil/ipfw/nat64/nat64_translate.c @@ -1296,6 +1296,11 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *saddr, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + NAT64STAT_INC(&cfg->stats, nomem); + return (NAT64RETURN); + } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -1673,6 +1678,11 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, uint16_t aport, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + NAT64STAT_INC(&cfg->stats, nomem); + return (NAT64RETURN); + } in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 0a249b6e2c6a..9c18ebd4943d 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1110,6 +1110,17 @@ m_extrefcnt(struct mbuf *m) KASSERT((((struct mbuf *)m)->m_flags & 0) == 0, \ ("%s: attempted use of a free mbuf!", __func__)) +/* Check whether any mbuf in the chain is unmapped. */ +#ifdef INVARIANTS +#define M_ASSERTMAPPED(m) do { \ + for (struct mbuf *__m = (m); __m != NULL; __m = __m->m_next) \ + KASSERT((__m->m_flags & M_EXTPG) == 0, \ + ("%s: chain %p contains an unmapped mbuf", __func__, (m)));\ +} while (0) +#else +#define M_ASSERTMAPPED(m) +#endif + /* * Return the address of the start of the buffer associated with an mbuf, * handling external storage, packet-header mbufs, and regular data mbufs. From owner-dev-commits-src-all@freebsd.org Wed Apr 28 14:09:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A69D55F53BA; Wed, 28 Apr 2021 14:09: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 4FVgW23zBKz4jR7; Wed, 28 Apr 2021 14:09: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 7967F7581; Wed, 28 Apr 2021 14:09: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 13SE9oie025283; Wed, 28 Apr 2021 14:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SE9od9025282; Wed, 28 Apr 2021 14:09:50 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:09:50 GMT Message-Id: <202104281409.13SE9od9025282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bbf46d33a668 - stable/13 - domainset: Define additional global policies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbf46d33a668f4a4a071c74c168a4ea4712f8dd0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:09:50 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bbf46d33a668f4a4a071c74c168a4ea4712f8dd0 commit bbf46d33a668f4a4a071c74c168a4ea4712f8dd0 Author: Mark Johnston AuthorDate: 2021-04-14 16:56:39 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:00:36 +0000 domainset: Define additional global policies Add global definitions for first-touch and interleave policies. The former may be useful for UMA, which implements a similar policy without using domainset iterators. No functional change intended. Reviewed by: mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29104 (cherry picked from commit 29bb6c19f044274cc6693f0c2463ca22106cd3ab) --- share/man/man9/domainset.9 | 20 ++++++++++++++++++-- sys/kern/kern_cpuset.c | 38 ++++++++++++++++++++++++-------------- sys/sys/domainset.h | 4 ++++ 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/share/man/man9/domainset.9 b/share/man/man9/domainset.9 index 5660f13afa88..969d9dd3b554 100644 --- a/share/man/man9/domainset.9 +++ b/share/man/man9/domainset.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd April 14, 2021 .Dt DOMAINSET 9 .Os .Sh NAME @@ -46,6 +46,10 @@ struct domainset { .Ft struct domainset * .Fn DOMAINSET_FIXED domain .Ft struct domainset * +.Fn DOMAINSET_FT +.Ft struct domainset * +.Fn DOMAINSET_IL +.Ft struct domainset * .Fn DOMAINSET_RR .Ft struct domainset * .Fn DOMAINSET_PREF domain @@ -104,6 +108,8 @@ efficiency higher and is preferential to round-robin for general use. .Pp The .Fn DOMAINSET_FIXED , +.Fn DOMAINSET_FT , +.Fn DOMAINSET_IL , .Fn DOMAINSET_RR and .Fn DOMAINSET_PREF @@ -111,8 +117,18 @@ macros provide pointers to global pre-defined policies for use when the desired policy is known at compile time. .Fn DOMAINSET_FIXED is a policy which only permits allocations from the specified domain. +.Fn DOMAINSET_FT +is a policy which attempts to allocate memory local to the current CPU, +falling back to a round-robin policy if the initial allocation fails. +.Fn DOMAINSET_IL +and .Fn DOMAINSET_RR -provides round-robin selection among all domains in the system. +provide round-robin selection among all domains in the system, corresponding +to the +.Dv DOMAINSET_POLICY_INTERLEAVE +and +.Dv DOMAINSET_POLICY_ROUNDROBIN +policies, respectively. The .Fn DOMAINSET_PREF policies attempt allocation from the specified domain, but unlike diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 19ad3fd20955..119df57c7b02 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); */ LIST_HEAD(domainlist, domainset); +struct domainset __read_mostly domainset_firsttouch; struct domainset __read_mostly domainset_fixed[MAXMEMDOM]; +struct domainset __read_mostly domainset_interleave; struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; struct domainset __read_mostly domainset_roundrobin; @@ -130,7 +132,7 @@ static struct setlist cpuset_ids; static struct domainlist cpuset_domains; static struct unrhdr *cpuset_unr; static struct cpuset *cpuset_zero, *cpuset_default, *cpuset_kernel; -static struct domainset domainset0, domainset2; +static struct domainset *domainset0, *domainset2; /* Return the size of cpuset_t at the kernel level */ SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD | CTLFLAG_CAPRD, @@ -568,7 +570,7 @@ domainset_create(const struct domainset *domain) if (domain->ds_policy == DOMAINSET_POLICY_PREFER && !DOMAINSET_ISSET(domain->ds_prefer, &domain->ds_mask)) return (NULL); - if (!DOMAINSET_SUBSET(&domainset0.ds_mask, &domain->ds_mask)) + if (!DOMAINSET_SUBSET(&domainset0->ds_mask, &domain->ds_mask)) return (NULL); ndomain = uma_zalloc(domainset_zone, M_WAITOK | M_ZERO); domainset_copy(domain, ndomain); @@ -1532,6 +1534,18 @@ domainset_init(void) struct domainset *dset; int i; + dset = &domainset_firsttouch; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH; + dset->ds_prefer = -1; + _domainset_create(dset, NULL); + + dset = &domainset_interleave; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_INTERLEAVE; + dset->ds_prefer = -1; + _domainset_create(dset, NULL); + dset = &domainset_roundrobin; DOMAINSET_COPY(&all_domains, &dset->ds_mask); dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; @@ -1554,7 +1568,7 @@ domainset_init(void) } /* - * Create the domainset for cpuset 0, 1 and cpuset 2. + * Define the domainsets for cpuset 0, 1 and cpuset 2. */ void domainset_zero(void) @@ -1563,15 +1577,11 @@ domainset_zero(void) mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); - dset = &domainset0; - DOMAINSET_COPY(&all_domains, &dset->ds_mask); - dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH; - dset->ds_prefer = -1; - curthread->td_domain.dr_policy = _domainset_create(dset, NULL); + domainset0 = &domainset_firsttouch; + curthread->td_domain.dr_policy = domainset0; - domainset_copy(dset, &domainset2); - domainset2.ds_policy = DOMAINSET_POLICY_INTERLEAVE; - kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL); + domainset2 = &domainset_interleave; + kernel_object->domain.dr_policy = domainset2; /* Remove empty domains from the global policies. */ LIST_FOREACH_SAFE(dset, &cpuset_domains, ds_link, tmp) @@ -1613,7 +1623,7 @@ cpuset_thread0(void) LIST_INSERT_HEAD(&cpuset_ids, set, cs_link); refcount_init(&set->cs_ref, 1); set->cs_flags = CPU_SET_ROOT | CPU_SET_RDONLY; - set->cs_domain = &domainset0; + set->cs_domain = domainset0; cpuset_zero = set; cpuset_root = &set->cs_mask; @@ -1630,7 +1640,7 @@ cpuset_thread0(void) set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); error = cpuset_init(set, cpuset_zero, NULL, NULL, 2); KASSERT(error == 0, ("Error creating kernel set: %d\n", error)); - set->cs_domain = &domainset2; + set->cs_domain = domainset2; cpuset_kernel = set; /* @@ -2315,7 +2325,7 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t level, cpuwhich_t which, * across all domains. */ if (domainset_empty_vm(&domain)) - domainset_copy(&domainset2, &domain); + domainset_copy(domainset2, &domain); switch (level) { case CPU_LEVEL_ROOT: diff --git a/sys/sys/domainset.h b/sys/sys/domainset.h index 7b1180012f4c..2113196d8d26 100644 --- a/sys/sys/domainset.h +++ b/sys/sys/domainset.h @@ -95,6 +95,10 @@ struct domainset { domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */ }; +extern struct domainset domainset_firsttouch; +#define DOMAINSET_FT() (&domainset_firsttouch) +extern struct domainset domainset_interleave; +#define DOMAINSET_IL() (&domainset_interleave) extern struct domainset domainset_fixed[MAXMEMDOM], domainset_prefer[MAXMEMDOM]; #define DOMAINSET_FIXED(domain) (&domainset_fixed[(domain)]) #define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)]) From owner-dev-commits-src-all@freebsd.org Wed Apr 28 14:09:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B01785F4BFA; Wed, 28 Apr 2021 14:09: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 4FVgW34NR9z4jYr; Wed, 28 Apr 2021 14:09: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 878AC6FDD; Wed, 28 Apr 2021 14:09: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 13SE9pXN025308; Wed, 28 Apr 2021 14:09:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SE9pCi025307; Wed, 28 Apr 2021 14:09:51 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:09:51 GMT Message-Id: <202104281409.13SE9pCi025307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6eddb6822c9a - stable/13 - uma: Split bucket_cache_drain() to permit per-domain reclamation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6eddb6822c9abe8a96fb1ad764aee231951ee87f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:09:51 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6eddb6822c9abe8a96fb1ad764aee231951ee87f commit 6eddb6822c9abe8a96fb1ad764aee231951ee87f Author: Mark Johnston AuthorDate: 2021-04-09 13:47:09 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:00:41 +0000 uma: Split bucket_cache_drain() to permit per-domain reclamation Note that the per-domain variant does not shrink the target bucket size. No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 54f421f9e84234c4313f2d636e4ebd74009a74d6) --- sys/vm/uma_core.c | 78 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index b1762500c147..a030be0dad13 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1307,11 +1307,50 @@ pcpu_cache_drain_safe(uma_zone_t zone) * estimated working set size. */ static void -bucket_cache_reclaim(uma_zone_t zone, bool drain) +bucket_cache_reclaim_domain(uma_zone_t zone, bool drain, int domain) { uma_zone_domain_t zdom; uma_bucket_t bucket; long target; + + /* + * The cross bucket is partially filled and not part of + * the item count. Reclaim it individually here. + */ + zdom = ZDOM_GET(zone, domain); + if ((zone->uz_flags & UMA_ZONE_SMR) == 0 || drain) { + ZONE_CROSS_LOCK(zone); + bucket = zdom->uzd_cross; + zdom->uzd_cross = NULL; + ZONE_CROSS_UNLOCK(zone); + if (bucket != NULL) + bucket_free(zone, bucket, NULL); + } + + /* + * 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. + */ + ZDOM_LOCK(zdom); + target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - + zdom->uzd_imin); + while (zdom->uzd_nitems > target) { + bucket = zone_fetch_bucket(zone, zdom, true); + if (bucket == NULL) + break; + bucket_free(zone, bucket, NULL); + ZDOM_LOCK(zdom); + } + ZDOM_UNLOCK(zdom); +} + +static void +bucket_cache_reclaim(uma_zone_t zone, bool drain) +{ int i; /* @@ -1321,41 +1360,8 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain) if (zone->uz_bucket_size > zone->uz_bucket_size_min) zone->uz_bucket_size--; - for (i = 0; i < vm_ndomains; i++) { - /* - * The cross bucket is partially filled and not part of - * the item count. Reclaim it individually here. - */ - zdom = ZDOM_GET(zone, i); - if ((zone->uz_flags & UMA_ZONE_SMR) == 0 || drain) { - ZONE_CROSS_LOCK(zone); - bucket = zdom->uzd_cross; - zdom->uzd_cross = NULL; - ZONE_CROSS_UNLOCK(zone); - if (bucket != NULL) - bucket_free(zone, bucket, NULL); - } - - /* - * 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. - */ - ZDOM_LOCK(zdom); - target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - - zdom->uzd_imin); - while (zdom->uzd_nitems > target) { - bucket = zone_fetch_bucket(zone, zdom, true); - if (bucket == NULL) - break; - bucket_free(zone, bucket, NULL); - ZDOM_LOCK(zdom); - } - ZDOM_UNLOCK(zdom); - } + for (i = 0; i < vm_ndomains; i++) + bucket_cache_reclaim_domain(zone, drain, i); } static void From owner-dev-commits-src-all@freebsd.org Wed Apr 28 14:09:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A4085F4FF0; Wed, 28 Apr 2021 14:09: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 4FVgW45xhLz4jCR; Wed, 28 Apr 2021 14:09: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 A9C656FDE; Wed, 28 Apr 2021 14:09: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 13SE9qqI025332; Wed, 28 Apr 2021 14:09:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SE9qcV025331; Wed, 28 Apr 2021 14:09:52 GMT (envelope-from git) Date: Wed, 28 Apr 2021 14:09:52 GMT Message-Id: <202104281409.13SE9qcV025331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0758fa13b43b - stable/13 - uma: Introduce per-domain reclamation functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0758fa13b43b2b913856b444a65338afadf5abd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 14:09:53 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0758fa13b43b2b913856b444a65338afadf5abd1 commit 0758fa13b43b2b913856b444a65338afadf5abd1 Author: Mark Johnston AuthorDate: 2021-04-14 16:57:24 +0000 Commit: Mark Johnston CommitDate: 2021-04-28 14:00:52 +0000 uma: Introduce per-domain reclamation functions Make it possible to reclaim items from a specific NUMA domain. - Add uma_zone_reclaim_domain() and uma_reclaim_domain(). - Permit parallel reclamations. Use a counter instead of a flag to synchronize with zone_dtor(). - Use the zone lock to protect cache_shrink() now that parallel reclaims can happen. - Add a sysctl that can be used to trigger reclamation from a specific domain. Currently the new KPIs are unused, so there should be no functional change. Reviewed by: mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29685 (cherry picked from commit aabe13f1450bb4caba66ec2a7a41c0dfefff511d) --- share/man/man9/zone.9 | 14 ++++- sys/vm/uma.h | 8 ++- sys/vm/uma_core.c | 152 ++++++++++++++++++++++++++++++-------------------- sys/vm/uma_int.h | 5 +- sys/vm/vm_kern.c | 29 +++++++++- 5 files changed, 137 insertions(+), 71 deletions(-) diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 index 7da40b13469b..89d5f3e2640f 100644 --- a/share/man/man9/zone.9 +++ b/share/man/man9/zone.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2021 +.Dd April 14, 2021 .Dt UMA 9 .Os .Sh NAME @@ -98,8 +98,12 @@ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); .Ft void .Fn uma_reclaim "int req" .Ft void +.Fn uma_reclaim_domain "int req" "int domain" +.Ft void .Fn uma_zone_reclaim "uma_zone_t zone" "int req" .Ft void +.Fn uma_zone_reclaim_domain "uma_zone_t zone" "int req" "int domain" +.Ft void .Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" .Ft void .Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" @@ -471,6 +475,14 @@ Free items in the per-CPU caches are left alone. .It Dv UMA_RECLAIM_DRAIN_CPU Reclaim all cached items. .El +The +.Fn uma_reclaim_domain +and +.Fn uma_zone_reclaim_domain +functions apply only to items allocated from the specified domain. +In the case of domains using a round-robin NUMA policy, cached items from all +domains are freed to the keg, but only slabs from the specific domain will +be freed. .Pp The .Fn uma_zone_set_allocf diff --git a/sys/vm/uma.h b/sys/vm/uma.h index f1bf7cea6e53..6407a4f50fb8 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -441,10 +441,12 @@ typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t size, int domain, typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); /* - * Reclaims unused memory + * Reclaims unused memory. If no NUMA domain is specified, memory from all + * domains is reclaimed. * * Arguments: - * req Reclamation request type. + * req Reclamation request type. + * domain The target NUMA domain. * Returns: * None */ @@ -452,7 +454,9 @@ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); #define UMA_RECLAIM_DRAIN_CPU 2 /* release bucket and per-CPU caches */ #define UMA_RECLAIM_TRIM 3 /* trim bucket cache to WSS */ void uma_reclaim(int req); +void uma_reclaim_domain(int req, int domain); void uma_zone_reclaim(uma_zone_t, int req); +void uma_zone_reclaim_domain(uma_zone_t, int req, int domain); /* * Sets the alignment mask to be used for all zones requesting cache diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index a030be0dad13..7e86c7c67786 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -167,17 +167,20 @@ static LIST_HEAD(,uma_keg) uma_kegs = LIST_HEAD_INITIALIZER(uma_kegs); static LIST_HEAD(,uma_zone) uma_cachezones = LIST_HEAD_INITIALIZER(uma_cachezones); -/* This RW lock protects the keg list */ +/* + * Mutex for global lists: uma_kegs, uma_cachezones, and the per-keg list of + * zones. + */ static struct rwlock_padalign __exclusive_cache_line uma_rwlock; +static struct sx uma_reclaim_lock; + /* * First available virual address for boot time allocations. */ static vm_offset_t bootstart; static vm_offset_t bootmem; -static struct sx uma_reclaim_lock; - /* * kmem soft limit, initialized by uma_set_limit(). Ensure that early * allocations don't trigger a wakeup of the reclaim thread. @@ -288,7 +291,7 @@ static void pcpu_page_free(void *, vm_size_t, uint8_t); 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); +static void bucket_cache_reclaim(uma_zone_t zone, bool, int); static int keg_ctor(void *, int, void *, int); static void keg_dtor(void *, int, void *); static int zone_ctor(void *, int, void *, int); @@ -314,7 +317,7 @@ static void bucket_enable(void); static void bucket_init(void); static uma_bucket_t bucket_alloc(uma_zone_t zone, void *, int); static void bucket_free(uma_zone_t zone, uma_bucket_t, void *); -static void bucket_zone_drain(void); +static void bucket_zone_drain(int domain); static uma_bucket_t zone_alloc_bucket(uma_zone_t, void *, int, int); static void *slab_alloc_item(uma_keg_t keg, uma_slab_t slab); static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); @@ -523,12 +526,13 @@ bucket_free(uma_zone_t zone, uma_bucket_t bucket, void *udata) } static void -bucket_zone_drain(void) +bucket_zone_drain(int domain) { struct uma_bucket_zone *ubz; for (ubz = &bucket_zones[0]; ubz->ubz_entries != 0; ubz++) - uma_zone_reclaim(ubz->ubz_zone, UMA_RECLAIM_DRAIN); + uma_zone_reclaim_domain(ubz->ubz_zone, UMA_RECLAIM_DRAIN, + domain); } /* @@ -1215,7 +1219,7 @@ cache_drain(uma_zone_t zone) bucket_free(zone, bucket, NULL); } } - bucket_cache_reclaim(zone, true); + bucket_cache_reclaim(zone, true, UMA_ANYDOMAIN); } static void @@ -1225,8 +1229,10 @@ cache_shrink(uma_zone_t zone, void *unused) if (zone->uz_flags & UMA_ZFLAG_INTERNAL) return; + ZONE_LOCK(zone); zone->uz_bucket_size = (zone->uz_bucket_size_min + zone->uz_bucket_size) / 2; + ZONE_UNLOCK(zone); } static void @@ -1349,7 +1355,7 @@ bucket_cache_reclaim_domain(uma_zone_t zone, bool drain, int domain) } static void -bucket_cache_reclaim(uma_zone_t zone, bool drain) +bucket_cache_reclaim(uma_zone_t zone, bool drain, int domain) { int i; @@ -1360,8 +1366,13 @@ bucket_cache_reclaim(uma_zone_t zone, bool drain) if (zone->uz_bucket_size > zone->uz_bucket_size_min) zone->uz_bucket_size--; - for (i = 0; i < vm_ndomains; i++) - bucket_cache_reclaim_domain(zone, drain, i); + if (domain != UMA_ANYDOMAIN && + (zone->uz_flags & UMA_ZONE_ROUNDROBIN) == 0) { + bucket_cache_reclaim_domain(zone, drain, domain); + } else { + for (i = 0; i < vm_ndomains; i++) + bucket_cache_reclaim_domain(zone, drain, i); + } } static void @@ -1464,63 +1475,65 @@ keg_drain_domain(uma_keg_t keg, int domain) * Returns nothing. */ static void -keg_drain(uma_keg_t keg) +keg_drain(uma_keg_t keg, int domain) { int i; if ((keg->uk_flags & UMA_ZONE_NOFREE) != 0) return; - for (i = 0; i < vm_ndomains; i++) - keg_drain_domain(keg, i); + if (domain != UMA_ANYDOMAIN) { + keg_drain_domain(keg, domain); + } else { + for (i = 0; i < vm_ndomains; i++) + keg_drain_domain(keg, i); + } } static void -zone_reclaim(uma_zone_t zone, int waitok, bool drain) +zone_reclaim(uma_zone_t zone, int domain, int waitok, bool drain) { - /* - * Set draining to interlock with zone_dtor() so we can release our - * locks as we go. Only dtor() should do a WAITOK call since it - * is the only call that knows the structure will still be available - * when it wakes up. + * Count active reclaim operations in order to interlock with + * zone_dtor(), which removes the zone from global lists before + * attempting to reclaim items itself. + * + * The zone may be destroyed while sleeping, so only zone_dtor() should + * specify M_WAITOK. */ ZONE_LOCK(zone); - while (zone->uz_flags & UMA_ZFLAG_RECLAIMING) { - if (waitok == M_NOWAIT) - goto out; - msleep(zone, &ZDOM_GET(zone, 0)->uzd_lock, PVM, "zonedrain", - 1); + if (waitok == M_WAITOK) { + while (zone->uz_reclaimers > 0) + msleep(zone, ZONE_LOCKPTR(zone), PVM, "zonedrain", 1); } - zone->uz_flags |= UMA_ZFLAG_RECLAIMING; + zone->uz_reclaimers++; ZONE_UNLOCK(zone); - bucket_cache_reclaim(zone, drain); + bucket_cache_reclaim(zone, drain, domain); - /* - * The DRAINING flag protects us from being freed while - * we're running. Normally the uma_rwlock would protect us but we - * must be able to release and acquire the right lock for each keg. - */ if ((zone->uz_flags & UMA_ZFLAG_CACHE) == 0) - keg_drain(zone->uz_keg); + keg_drain(zone->uz_keg, domain); ZONE_LOCK(zone); - zone->uz_flags &= ~UMA_ZFLAG_RECLAIMING; - wakeup(zone); -out: + zone->uz_reclaimers--; + if (zone->uz_reclaimers == 0) + wakeup(zone); ZONE_UNLOCK(zone); } static void -zone_drain(uma_zone_t zone, void *unused) +zone_drain(uma_zone_t zone, void *arg) { + int domain; - zone_reclaim(zone, M_NOWAIT, true); + domain = (int)(uintptr_t)arg; + zone_reclaim(zone, domain, M_NOWAIT, true); } static void -zone_trim(uma_zone_t zone, void *unused) +zone_trim(uma_zone_t zone, void *arg) { + int domain; - zone_reclaim(zone, M_NOWAIT, false); + domain = (int)(uintptr_t)arg; + zone_reclaim(zone, domain, M_NOWAIT, false); } /* @@ -2784,7 +2797,7 @@ zone_dtor(void *arg, int size, void *udata) keg = zone->uz_keg; keg->uk_reserve = 0; } - zone_reclaim(zone, M_WAITOK, true); + zone_reclaim(zone, UMA_ANYDOMAIN, M_WAITOK, true); /* * We only destroy kegs from non secondary/non cache zones. @@ -3054,9 +3067,9 @@ uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor, args.flags = flags; args.keg = NULL; - sx_slock(&uma_reclaim_lock); + sx_xlock(&uma_reclaim_lock); res = zone_alloc_item(zones, &args, UMA_ANYDOMAIN, M_WAITOK); - sx_sunlock(&uma_reclaim_lock); + sx_xunlock(&uma_reclaim_lock); return (res); } @@ -3082,9 +3095,9 @@ uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor, args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; - sx_slock(&uma_reclaim_lock); + sx_xlock(&uma_reclaim_lock); res = zone_alloc_item(zones, &args, UMA_ANYDOMAIN, M_WAITOK); - sx_sunlock(&uma_reclaim_lock); + sx_xunlock(&uma_reclaim_lock); return (res); } @@ -3125,9 +3138,9 @@ uma_zdestroy(uma_zone_t zone) if (booted == BOOT_SHUTDOWN && zone->uz_fini == NULL && zone->uz_release == zone_release) return; - sx_slock(&uma_reclaim_lock); + sx_xlock(&uma_reclaim_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); - sx_sunlock(&uma_reclaim_lock); + sx_xunlock(&uma_reclaim_lock); } void @@ -4917,22 +4930,29 @@ uma_zone_memory(uma_zone_t zone) void uma_reclaim(int req) { + uma_reclaim_domain(req, UMA_ANYDOMAIN); +} + +void +uma_reclaim_domain(int req, int domain) +{ + void *arg; - CTR0(KTR_UMA, "UMA: vm asked us to release pages!"); - sx_xlock(&uma_reclaim_lock); bucket_enable(); + arg = (void *)(uintptr_t)domain; + sx_slock(&uma_reclaim_lock); switch (req) { case UMA_RECLAIM_TRIM: - zone_foreach(zone_trim, NULL); + zone_foreach(zone_trim, arg); break; case UMA_RECLAIM_DRAIN: + zone_foreach(zone_drain, arg); + break; case UMA_RECLAIM_DRAIN_CPU: - zone_foreach(zone_drain, NULL); - if (req == UMA_RECLAIM_DRAIN_CPU) { - pcpu_cache_drain_safe(NULL); - zone_foreach(zone_drain, NULL); - } + zone_foreach(zone_drain, arg); + pcpu_cache_drain_safe(NULL); + zone_foreach(zone_drain, arg); break; default: panic("unhandled reclamation request %d", req); @@ -4943,10 +4963,10 @@ uma_reclaim(int req) * we visit again so that we can free pages that are empty once other * zones are drained. We have to do the same for buckets. */ - zone_drain(slabzones[0], NULL); - zone_drain(slabzones[1], NULL); - bucket_zone_drain(); - sx_xunlock(&uma_reclaim_lock); + zone_drain(slabzones[0], arg); + zone_drain(slabzones[1], arg); + bucket_zone_drain(domain); + sx_sunlock(&uma_reclaim_lock); } static volatile int uma_reclaim_needed; @@ -4981,17 +5001,25 @@ uma_reclaim_worker(void *arg __unused) void uma_zone_reclaim(uma_zone_t zone, int req) { + uma_zone_reclaim_domain(zone, req, UMA_ANYDOMAIN); +} + +void +uma_zone_reclaim_domain(uma_zone_t zone, int req, int domain) +{ + void *arg; + arg = (void *)(uintptr_t)domain; switch (req) { case UMA_RECLAIM_TRIM: - zone_trim(zone, NULL); + zone_trim(zone, arg); break; case UMA_RECLAIM_DRAIN: - zone_drain(zone, NULL); + zone_drain(zone, arg); break; case UMA_RECLAIM_DRAIN_CPU: pcpu_cache_drain_safe(zone); - zone_drain(zone, NULL); + zone_drain(zone, arg); break; default: panic("unhandled reclamation request %d", req); diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index 9965e486ca53..93910e78165b 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -162,7 +162,6 @@ #define UMA_ZFLAG_CTORDTOR 0x01000000 /* Zone has ctor/dtor set. */ #define UMA_ZFLAG_LIMIT 0x02000000 /* Zone has limit set. */ #define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ -#define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ #define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ #define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ #define UMA_ZFLAG_TRASH 0x40000000 /* Add trash ctor/dtor. */ @@ -175,7 +174,6 @@ "\37TRASH" \ "\36INTERNAL" \ "\35BUCKET" \ - "\34RECLAIMING" \ "\33CACHE" \ "\32LIMIT" \ "\31CTORDTOR" \ @@ -490,7 +488,7 @@ struct uma_zone { char *uz_ctlname; /* sysctl safe name string. */ int uz_namecnt; /* duplicate name count. */ uint16_t uz_bucket_size_min; /* Min number of items in bucket */ - uint16_t uz_pad0; + uint16_t uz_reclaimers; /* pending reclaim operations. */ /* Offset 192, rare read-only. */ struct sysctl_oid *uz_oid; /* sysctl oid pointer. */ @@ -582,6 +580,7 @@ static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data); #define ZONE_LOCK(z) ZDOM_LOCK(ZDOM_GET((z), 0)) #define ZONE_UNLOCK(z) ZDOM_UNLOCK(ZDOM_GET((z), 0)) +#define ZONE_LOCKPTR(z) (&ZDOM_GET((z), 0)->uzd_lock) #define ZONE_CROSS_LOCK_INIT(z) \ mtx_init(&(z)->uz_cross_lock, "UMA Cross", NULL, MTX_DEF) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 93c9e8c638bc..160821ba3a19 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -894,7 +894,6 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS) EVENTHANDLER_INVOKE(vm_lowmem, i); return (0); } - SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, 0, debug_vm_lowmem, "I", "set to trigger vm_lowmem event with given flags"); @@ -906,7 +905,7 @@ debug_uma_reclaim(SYSCTL_HANDLER_ARGS) i = 0; error = sysctl_handle_int(oidp, &i, 0, req); - if (error != 0) + if (error != 0 || req->newptr == NULL) return (error); if (i != UMA_RECLAIM_TRIM && i != UMA_RECLAIM_DRAIN && i != UMA_RECLAIM_DRAIN_CPU) @@ -914,7 +913,31 @@ debug_uma_reclaim(SYSCTL_HANDLER_ARGS) uma_reclaim(i); return (0); } - SYSCTL_PROC(_debug, OID_AUTO, uma_reclaim, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, 0, debug_uma_reclaim, "I", "set to generate request to reclaim uma caches"); + +static int +debug_uma_reclaim_domain(SYSCTL_HANDLER_ARGS) +{ + int domain, error, request; + + request = 0; + error = sysctl_handle_int(oidp, &request, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + domain = request >> 4; + request &= 0xf; + if (request != UMA_RECLAIM_TRIM && request != UMA_RECLAIM_DRAIN && + request != UMA_RECLAIM_DRAIN_CPU) + return (EINVAL); + if (domain < 0 || domain >= vm_ndomains) + return (EINVAL); + uma_reclaim_domain(request, domain); + return (0); +} +SYSCTL_PROC(_debug, OID_AUTO, uma_reclaim_domain, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, 0, + debug_uma_reclaim_domain, "I", + ""); From owner-dev-commits-src-all@freebsd.org Wed Apr 28 14:41:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 14:41:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 14:43:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 15:06:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 15:06:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 15:08:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 15:14:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BC755F7305; Wed, 28 Apr 2021 15:14: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 4FVhxL372hz4mW0; Wed, 28 Apr 2021 15:14: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 5DE8610729; Wed, 28 Apr 2021 15:14: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 13SFEEh1017806; Wed, 28 Apr 2021 15:14:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFEE5j017805; Wed, 28 Apr 2021 15:14:14 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:14:14 GMT Message-Id: <202104281514.13SFEE5j017805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 3a1c3e11ac11 - stable/12 - pf: Refactor state killing 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 3a1c3e11ac11e549f869e88f1fcd61f46baef344 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:14:14 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3a1c3e11ac11e549f869e88f1fcd61f46baef344 commit 3a1c3e11ac11e549f869e88f1fcd61f46baef344 Author: Kristof Provost AuthorDate: 2021-04-16 14:34:21 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:13:06 +0000 pf: Refactor state killing Extract the state killing code from pfioctl() and rephrase the filtering conditions for readability. No functional change intended. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29795 (cherry picked from commit 586aab9e0aa6c811758c19fb03831fc1e7305252) --- sys/netpfil/pf/pf_ioctl.c | 122 ++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8212d5055ef7..5663228ac5ac 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1733,6 +1733,72 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) return (0); } +static int +pf_killstates_row(struct pfioc_state_kill *psk, struct pf_idhash *ih) +{ + struct pf_state *s; + struct pf_state_key *sk; + struct pf_addr *srcaddr, *dstaddr; + int killed = 0; + u_int16_t srcport, dstport; + +relock_DIOCKILLSTATES: + PF_HASHROW_LOCK(ih); + LIST_FOREACH(s, &ih->states, entry) { + sk = s->key[PF_SK_WIRE]; + if (s->direction == PF_OUT) { + srcaddr = &sk->addr[1]; + dstaddr = &sk->addr[0]; + srcport = sk->port[1]; + dstport = sk->port[0]; + } else { + srcaddr = &sk->addr[0]; + dstaddr = &sk->addr[1]; + srcport = sk->port[0]; + dstport = sk->port[1]; + } + + if (psk->psk_af && sk->af != psk->psk_af) + continue; + + if (psk->psk_proto && psk->psk_proto != sk->proto) + continue; + + if (! PF_MATCHA(psk->psk_src.neg, &psk->psk_src.addr.v.a.addr, + &psk->psk_src.addr.v.a.mask, srcaddr, sk->af)) + continue; + + if (! PF_MATCHA(psk->psk_dst.neg, &psk->psk_dst.addr.v.a.addr, + &psk->psk_dst.addr.v.a.mask, dstaddr, sk->af)) + continue; + + if (psk->psk_src.port_op != 0 && + ! pf_match_port(psk->psk_src.port_op, + psk->psk_src.port[0], psk->psk_src.port[1], srcport)) + continue; + + if (psk->psk_dst.port_op != 0 && + ! pf_match_port(psk->psk_dst.port_op, + 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))) + continue; + + if (psk->psk_ifname[0] && strcmp(psk->psk_ifname, + s->kif->pfik_name)) + continue; + + pf_unlink_state(s, PF_ENTER_LOCKED); + killed++; + goto relock_DIOCKILLSTATES; + } + PF_HASHROW_UNLOCK(ih); + + return (killed); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -2384,9 +2450,6 @@ relock_DIOCCLRSTATES: case DIOCKILLSTATES: { struct pf_state *s; - struct pf_state_key *sk; - struct pf_addr *srcaddr, *dstaddr; - u_int16_t srcport, dstport; struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; u_int i, killed = 0; @@ -2401,58 +2464,9 @@ relock_DIOCCLRSTATES: break; } - for (i = 0; i <= pf_hashmask; i++) { - struct pf_idhash *ih = &V_pf_idhash[i]; + for (i = 0; i <= pf_hashmask; i++) + killed += pf_killstates_row(psk, &V_pf_idhash[i]); -relock_DIOCKILLSTATES: - PF_HASHROW_LOCK(ih); - LIST_FOREACH(s, &ih->states, entry) { - sk = s->key[PF_SK_WIRE]; - if (s->direction == PF_OUT) { - srcaddr = &sk->addr[1]; - dstaddr = &sk->addr[0]; - srcport = sk->port[1]; - dstport = sk->port[0]; - } else { - srcaddr = &sk->addr[0]; - dstaddr = &sk->addr[1]; - srcport = sk->port[0]; - dstport = sk->port[1]; - } - - if ((!psk->psk_af || sk->af == psk->psk_af) - && (!psk->psk_proto || psk->psk_proto == - sk->proto) && - PF_MATCHA(psk->psk_src.neg, - &psk->psk_src.addr.v.a.addr, - &psk->psk_src.addr.v.a.mask, - srcaddr, sk->af) && - PF_MATCHA(psk->psk_dst.neg, - &psk->psk_dst.addr.v.a.addr, - &psk->psk_dst.addr.v.a.mask, - dstaddr, sk->af) && - (psk->psk_src.port_op == 0 || - pf_match_port(psk->psk_src.port_op, - psk->psk_src.port[0], psk->psk_src.port[1], - srcport)) && - (psk->psk_dst.port_op == 0 || - pf_match_port(psk->psk_dst.port_op, - psk->psk_dst.port[0], psk->psk_dst.port[1], - dstport)) && - (!psk->psk_label[0] || - (s->rule.ptr->label[0] && - !strcmp(psk->psk_label, - s->rule.ptr->label))) && - (!psk->psk_ifname[0] || - !strcmp(psk->psk_ifname, - s->kif->pfik_name))) { - pf_unlink_state(s, PF_ENTER_LOCKED); - killed++; - goto relock_DIOCKILLSTATES; - } - } - PF_HASHROW_UNLOCK(ih); - } psk->psk_killed = killed; break; } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 15:14:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C7895F71DB; Wed, 28 Apr 2021 15:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVhxM5Sv7z4mXv; Wed, 28 Apr 2021 15:14: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 A78647E79; Wed, 28 Apr 2021 15:14: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 13SFEFVb017917; Wed, 28 Apr 2021 15:14:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFEF39017916; Wed, 28 Apr 2021 15:14:15 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:14:15 GMT Message-Id: <202104281514.13SFEF39017916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 6210e809da13 - stable/13 - pf: Refactor state killing 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6210e809da13c80ed560ce0d76c9bf81352b8a1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:14:16 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6210e809da13c80ed560ce0d76c9bf81352b8a1d commit 6210e809da13c80ed560ce0d76c9bf81352b8a1d Author: Kristof Provost AuthorDate: 2021-04-16 14:34:21 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:06:28 +0000 pf: Refactor state killing Extract the state killing code from pfioctl() and rephrase the filtering conditions for readability. No functional change intended. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29795 (cherry picked from commit 586aab9e0aa6c811758c19fb03831fc1e7305252) --- sys/netpfil/pf/pf_ioctl.c | 122 ++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index ce889c8d797e..3161c6b1f7c9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1732,6 +1732,72 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) return (0); } +static int +pf_killstates_row(struct pfioc_state_kill *psk, struct pf_idhash *ih) +{ + struct pf_state *s; + struct pf_state_key *sk; + struct pf_addr *srcaddr, *dstaddr; + int killed = 0; + u_int16_t srcport, dstport; + +relock_DIOCKILLSTATES: + PF_HASHROW_LOCK(ih); + LIST_FOREACH(s, &ih->states, entry) { + sk = s->key[PF_SK_WIRE]; + if (s->direction == PF_OUT) { + srcaddr = &sk->addr[1]; + dstaddr = &sk->addr[0]; + srcport = sk->port[1]; + dstport = sk->port[0]; + } else { + srcaddr = &sk->addr[0]; + dstaddr = &sk->addr[1]; + srcport = sk->port[0]; + dstport = sk->port[1]; + } + + if (psk->psk_af && sk->af != psk->psk_af) + continue; + + if (psk->psk_proto && psk->psk_proto != sk->proto) + continue; + + if (! PF_MATCHA(psk->psk_src.neg, &psk->psk_src.addr.v.a.addr, + &psk->psk_src.addr.v.a.mask, srcaddr, sk->af)) + continue; + + if (! PF_MATCHA(psk->psk_dst.neg, &psk->psk_dst.addr.v.a.addr, + &psk->psk_dst.addr.v.a.mask, dstaddr, sk->af)) + continue; + + if (psk->psk_src.port_op != 0 && + ! pf_match_port(psk->psk_src.port_op, + psk->psk_src.port[0], psk->psk_src.port[1], srcport)) + continue; + + if (psk->psk_dst.port_op != 0 && + ! pf_match_port(psk->psk_dst.port_op, + 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))) + continue; + + if (psk->psk_ifname[0] && strcmp(psk->psk_ifname, + s->kif->pfik_name)) + continue; + + pf_unlink_state(s, PF_ENTER_LOCKED); + killed++; + goto relock_DIOCKILLSTATES; + } + PF_HASHROW_UNLOCK(ih); + + return (killed); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -2371,9 +2437,6 @@ relock_DIOCCLRSTATES: case DIOCKILLSTATES: { struct pf_state *s; - struct pf_state_key *sk; - struct pf_addr *srcaddr, *dstaddr; - u_int16_t srcport, dstport; struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; u_int i, killed = 0; @@ -2388,58 +2451,9 @@ relock_DIOCCLRSTATES: break; } - for (i = 0; i <= pf_hashmask; i++) { - struct pf_idhash *ih = &V_pf_idhash[i]; + for (i = 0; i <= pf_hashmask; i++) + killed += pf_killstates_row(psk, &V_pf_idhash[i]); -relock_DIOCKILLSTATES: - PF_HASHROW_LOCK(ih); - LIST_FOREACH(s, &ih->states, entry) { - sk = s->key[PF_SK_WIRE]; - if (s->direction == PF_OUT) { - srcaddr = &sk->addr[1]; - dstaddr = &sk->addr[0]; - srcport = sk->port[1]; - dstport = sk->port[0]; - } else { - srcaddr = &sk->addr[0]; - dstaddr = &sk->addr[1]; - srcport = sk->port[0]; - dstport = sk->port[1]; - } - - if ((!psk->psk_af || sk->af == psk->psk_af) - && (!psk->psk_proto || psk->psk_proto == - sk->proto) && - PF_MATCHA(psk->psk_src.neg, - &psk->psk_src.addr.v.a.addr, - &psk->psk_src.addr.v.a.mask, - srcaddr, sk->af) && - PF_MATCHA(psk->psk_dst.neg, - &psk->psk_dst.addr.v.a.addr, - &psk->psk_dst.addr.v.a.mask, - dstaddr, sk->af) && - (psk->psk_src.port_op == 0 || - pf_match_port(psk->psk_src.port_op, - psk->psk_src.port[0], psk->psk_src.port[1], - srcport)) && - (psk->psk_dst.port_op == 0 || - pf_match_port(psk->psk_dst.port_op, - psk->psk_dst.port[0], psk->psk_dst.port[1], - dstport)) && - (!psk->psk_label[0] || - (s->rule.ptr->label[0] && - !strcmp(psk->psk_label, - s->rule.ptr->label))) && - (!psk->psk_ifname[0] || - !strcmp(psk->psk_ifname, - s->kif->pfik_name))) { - pf_unlink_state(s, PF_ENTER_LOCKED); - killed++; - goto relock_DIOCKILLSTATES; - } - } - PF_HASHROW_UNLOCK(ih); - } psk->psk_killed = killed; break; } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 15:14:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 183235F7392; Wed, 28 Apr 2021 15:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVhxM5SnFz4mW2; Wed, 28 Apr 2021 15:14: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 805167E78; Wed, 28 Apr 2021 15:14: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 13SFEFCa017868; Wed, 28 Apr 2021 15:14:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFEFCQ017867; Wed, 28 Apr 2021 15:14:15 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:14:15 GMT Message-Id: <202104281514.13SFEFCQ017867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: cbba818976fd - stable/12 - pf tests: Test cases for the 'kill state(s)' feature 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/stable/12 X-Git-Reftype: branch X-Git-Commit: cbba818976fdc08042f08db0c5435320dcfe5d31 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:14:16 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cbba818976fdc08042f08db0c5435320dcfe5d31 commit cbba818976fdc08042f08db0c5435320dcfe5d31 Author: Kristof Provost AuthorDate: 2021-04-16 15:33:17 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:13:06 +0000 pf tests: Test cases for the 'kill state(s)' feature MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29796 (cherry picked from commit 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4) --- tests/sys/netpfil/pf/Makefile | 5 +- tests/sys/netpfil/pf/killstate.sh | 175 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index e216caf1c55e..951a1392ae1f 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -10,6 +10,8 @@ ATF_TESTS_SH+= anchor \ checksum \ forward \ fragmentation \ + icmp \ + killstate \ names \ nat \ set_tos \ @@ -20,8 +22,7 @@ ATF_TESTS_SH+= anchor \ set_skip \ pfsync \ table \ - tos \ - icmp + tos ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh new file mode 100644 index 000000000000..994ce130a814 --- /dev/null +++ b/tests/sys/netpfil/pf/killstate.sh @@ -0,0 +1,175 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Test killing states by IPv4 address' + atf_set require.user root + atf_set require.progs scapy +} + +v4_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" + + # 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 with the wrong IP doesn't affect our state + jexec alcatraz pfctl -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with one correct address and one incorrect doesn't kill the state + jexec alcatraz pfctl -k 192.0.2.1 -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with correct address does remove the state + jexec alcatraz pfctl -k 192.0.2.1 + + # Now the ping fails + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "label" "cleanup" +label_head() +{ + atf_set descr 'Test killing states by label' + atf_set require.user root + atf_set require.progs scapy +} + +label_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 tcp label bar" \ + "pass in proto icmp label foo" + + # 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 bar + 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 non-existing label 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 correct label kills the state + 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 +} + +label_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "label" +} From owner-dev-commits-src-all@freebsd.org Wed Apr 28 15:14:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 425245F7591; Wed, 28 Apr 2021 15:14: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 4FVhxQ0Jpgz4mdh; Wed, 28 Apr 2021 15:14: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 E3155105C5; Wed, 28 Apr 2021 15:14: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 13SFEHZw017987; Wed, 28 Apr 2021 15:14:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFEHk5017986; Wed, 28 Apr 2021 15:14:17 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:14:17 GMT Message-Id: <202104281514.13SFEHk5017986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ce5da7d24316 - stable/13 - pf tests: IPv6 test case for the 'kill state(s)' feature 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ce5da7d24316ab41a7b535645d6cc7ecd5343951 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:14:18 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ce5da7d24316ab41a7b535645d6cc7ecd5343951 commit ce5da7d24316ab41a7b535645d6cc7ecd5343951 Author: Kristof Provost AuthorDate: 2021-04-16 15:47:47 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:06:28 +0000 pf tests: IPv6 test case for the 'kill state(s)' feature Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29797 (cherry picked from commit 9af2317423f399b30ff028e078d01eef553efc7f) --- tests/sys/netpfil/common/pft_ping.py | 28 +++++++++++++- tests/sys/netpfil/pf/killstate.sh | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 916a019d2f4a..de673f026c77 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -116,7 +116,10 @@ def check_ping6_request(args, packet): return True def check_ping_reply(args, packet): - return check_ping4_reply(args, packet) + if args.ip6: + return check_ping6_reply(args, packet) + else: + return check_ping4_reply(args, packet) def check_ping4_reply(args, packet): """ @@ -144,6 +147,29 @@ def check_ping4_reply(args, packet): return True +def check_ping6_reply(args, packet): + """ + Check that this is a reply to the ping request we sent + """ + dst_ip = args.to[0] + + ip = packet.getlayer(sp.IPv6) + if not ip: + return False + if ip.src != dst_ip: + return False + + icmp = packet.getlayer(sp.ICMPv6EchoReply) + if not icmp: + print("No echo reply!") + return False + + if icmp.data != PAYLOAD_MAGIC: + print("data mismatch") + return False + + return True + def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index 994ce130a814..d54858d5452c 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -101,6 +101,78 @@ v4_cleanup() pft_cleanup } +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Test killing states by IPv6 address' + atf_set require.user root + atf_set require.progs scapy +} + +v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::1/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::2/64 up no_dad + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "block all" \ + "pass in proto icmp6" + + # 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 \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::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 \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with the wrong IP doesn't affect our state + jexec alcatraz pfctl -k 2001:db8::3 + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with one correct address and one incorrect doesn't kill the state + jexec alcatraz pfctl -k 2001:db8::1 -k 2001:db8::3 + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with correct address does remove the state + jexec alcatraz pfctl -k 2001:db8::1 + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + +} + +v6_cleanup() +{ + pft_cleanup +} + atf_test_case "label" "cleanup" label_head() { @@ -171,5 +243,6 @@ label_cleanup() atf_init_test_cases() { atf_add_test_case "v4" + atf_add_test_case "v6" atf_add_test_case "label" } From owner-dev-commits-src-all@freebsd.org Wed Apr 28 15:14:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98C475F7236; Wed, 28 Apr 2021 15:14: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 4FVhxN6pR2z4mqt; Wed, 28 Apr 2021 15:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD769105C4; Wed, 28 Apr 2021 15:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13SFEGQp017966; Wed, 28 Apr 2021 15:14:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SFEGZY017965; Wed, 28 Apr 2021 15:14:16 GMT (envelope-from git) Date: Wed, 28 Apr 2021 15:14:16 GMT Message-Id: <202104281514.13SFEGZY017965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: faa873d0f92f - stable/13 - pf tests: Test cases for the 'kill state(s)' feature 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/stable/13 X-Git-Reftype: branch X-Git-Commit: faa873d0f92f7611dbab71391bb032716ef0a66b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 15:14:17 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=faa873d0f92f7611dbab71391bb032716ef0a66b commit faa873d0f92f7611dbab71391bb032716ef0a66b Author: Kristof Provost AuthorDate: 2021-04-16 15:33:17 +0000 Commit: Kristof Provost CommitDate: 2021-04-28 15:06:28 +0000 pf tests: Test cases for the 'kill state(s)' feature MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29796 (cherry picked from commit 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/killstate.sh | 175 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d89c1d7a7a4b..ea9d71610c77 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -11,6 +11,7 @@ ATF_TESTS_SH+= anchor \ forward \ fragmentation \ icmp \ + killstate \ names \ nat \ pass_block \ diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh new file mode 100644 index 000000000000..994ce130a814 --- /dev/null +++ b/tests/sys/netpfil/pf/killstate.sh @@ -0,0 +1,175 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Test killing states by IPv4 address' + atf_set require.user root + atf_set require.progs scapy +} + +v4_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" + + # 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 with the wrong IP doesn't affect our state + jexec alcatraz pfctl -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with one correct address and one incorrect doesn't kill the state + jexec alcatraz pfctl -k 192.0.2.1 -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with correct address does remove the state + jexec alcatraz pfctl -k 192.0.2.1 + + # Now the ping fails + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "label" "cleanup" +label_head() +{ + atf_set descr 'Test killing states by label' + atf_set require.user root + atf_set require.progs scapy +} + +label_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 tcp label bar" \ + "pass in proto icmp label foo" + + # 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 bar + 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 non-existing label 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 correct label kills the state + 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 +} + +label_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "label" +} From owner-dev-commits-src-all@freebsd.org Wed Apr 28 15:19:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 16:47:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 144EE5F9E48 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 4FVl175WcTz4rmS 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 98DB030ED66B; Thu, 29 Apr 2021 01:47:27 +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 443CF30ED655 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-all@freebsd.org From: "Mr. G" Date: Wed, 28 Apr 2021 09:47:27 -0700 Reply-To: gp4112316@gmail.com Message-Id: <20210428164727.98DB030ED66B@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: 4FVl175WcTz4rmS 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.80 / 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-all@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(1.00)[1.000]; FROM_NAME_HAS_TITLE(1.00)[mr]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 17:34:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 19:38:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A41485FEE27; Wed, 28 Apr 2021 19:38: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 4FVpnk4LRDz3HZp; Wed, 28 Apr 2021 19:38: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 880DF13CD8; Wed, 28 Apr 2021 19:38: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 13SJc2ah064373; Wed, 28 Apr 2021 19:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJc2xU064372; Wed, 28 Apr 2021 19:38:02 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:38:02 GMT Message-Id: <202104281938.13SJc2xU064372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: d7682961d386 - stable/13 - libfetch: Retry with proxy auth when server returns 407 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7682961d386ebc7d5ec9cb38e609d3ec9bb978a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:38:02 -0000 The branch stable/13 has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d7682961d386ebc7d5ec9cb38e609d3ec9bb978a commit d7682961d386ebc7d5ec9cb38e609d3ec9bb978a Author: Renato Botelho AuthorDate: 2021-04-01 21:02:57 +0000 Commit: Renato Botelho CommitDate: 2021-04-28 19:21:26 +0000 libfetch: Retry with proxy auth when server returns 407 PR: 220468 Submitted by: Egil Hasting (based on) Reviewed by: kevans, kp Approved by: kp MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29533 (cherry picked from commit 345c30a94f6425954163f1e0b075a75f603d27cd) --- lib/libfetch/http.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 7f37b7d67197..e61e23b1425a 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1387,6 +1388,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags) int verbose; int af, val; int serrno; + bool isproxyauth = false; + http_auth_challenges_t proxy_challenges; #ifdef INET6 af = AF_UNSPEC; @@ -1404,18 +1407,58 @@ http_connect(struct url *URL, struct url *purl, const char *flags) curl = (purl != NULL) ? purl : URL; +retry: if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); init_http_headerbuf(&headerbuf); if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { - http_cmd(conn, "CONNECT %s:%d HTTP/1.1", - URL->host, URL->port); - http_cmd(conn, "Host: %s:%d", - URL->host, URL->port); + init_http_auth_challenges(&proxy_challenges); + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); + http_cmd(conn, "Host: %s:%d", URL->host, URL->port); + if (isproxyauth) { + http_auth_params_t aparams; + init_http_auth_params(&aparams); + if (*purl->user || *purl->pwd) { + aparams.user = strdup(purl->user); + aparams.password = strdup(purl->pwd); + } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && + *p != '\0') { + if (http_authfromenv(p, &aparams) < 0) { + http_seterr(HTTP_NEED_PROXY_AUTH); + fetch_syserr(); + goto ouch; + } + } else if (fetch_netrc_auth(purl) == 0) { + aparams.user = strdup(purl->user); + aparams.password = strdup(purl->pwd); + } else { + /* + * No auth information found in system - exiting + * with warning. + */ + warnx("Missing username and/or password set"); + fetch_syserr(); + goto ouch; + } + http_authorize(conn, "Proxy-Authorization", + &proxy_challenges, &aparams, purl); + clean_http_auth_params(&aparams); + } http_cmd(conn, ""); - if (http_get_reply(conn) != HTTP_OK) { - http_seterr(conn->err); + /* Get reply from CONNECT Tunnel attempt */ + int httpreply = http_get_reply(conn); + if (httpreply != HTTP_OK) { + http_seterr(httpreply); + /* If the error is a 407/HTTP_NEED_PROXY_AUTH */ + if (httpreply == HTTP_NEED_PROXY_AUTH && + ! isproxyauth) { + /* Try again with authentication. */ + clean_http_headerbuf(&headerbuf); + fetch_close(conn); + isproxyauth = true; + goto retry; + } goto ouch; } /* Read and discard the rest of the proxy response */ From owner-dev-commits-src-all@freebsd.org Wed Apr 28 19:38:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3990B5FF096; Wed, 28 Apr 2021 19:38: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 4FVppG0FDFz3HMZ; Wed, 28 Apr 2021 19:38: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 EFD9A13B50; Wed, 28 Apr 2021 19:38: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 13SJcTCQ064551; Wed, 28 Apr 2021 19:38:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJcTkb064550; Wed, 28 Apr 2021 19:38:29 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:38:29 GMT Message-Id: <202104281938.13SJcTkb064550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: 730a7d5926bc - stable/12 - Support proxying FTP over HTTPS, not just HTTP. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 730a7d5926bc22c951817dfc34fa4fe280f2c386 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:38:30 -0000 The branch stable/12 has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=730a7d5926bc22c951817dfc34fa4fe280f2c386 commit 730a7d5926bc22c951817dfc34fa4fe280f2c386 Author: Dag-Erling SmĂžrgrav AuthorDate: 2018-11-27 10:06:41 +0000 Commit: Renato Botelho CommitDate: 2021-04-28 19:30:35 +0000 Support proxying FTP over HTTPS, not just HTTP. There is probably a PR for this, but I can't find this, or remember who submitted it. The patch got lost in the noise of another that wasn't ready to commit. MFC after: 3 days Approved by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b68815f0886031fcccb426b85484b18a282d1b8c) --- lib/libfetch/ftp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 72165d63fd19..18fa673147d4 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -1104,7 +1104,8 @@ ftp_request(struct url *url, const char *op, struct url_stat *us, int oflag; /* check if we should use HTTP instead */ - if (purl && strcasecmp(purl->scheme, SCHEME_HTTP) == 0) { + if (purl && (strcasecmp(purl->scheme, SCHEME_HTTP) == 0 || + strcasecmp(purl->scheme, SCHEME_HTTPS) == 0)) { if (strcmp(op, "STAT") == 0) return (http_request(url, "HEAD", us, purl, flags)); else if (strcmp(op, "RETR") == 0) From owner-dev-commits-src-all@freebsd.org Wed Apr 28 19:38:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD7F25FEED1; Wed, 28 Apr 2021 19:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVppJ3cpKz3HbS; Wed, 28 Apr 2021 19:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F4BC13B52; Wed, 28 Apr 2021 19:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13SJcWt0064596; Wed, 28 Apr 2021 19:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJcWaZ064595; Wed, 28 Apr 2021 19:38:32 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:38:32 GMT Message-Id: <202104281938.13SJcWaZ064595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: cbb52569dd15 - stable/12 - A few more cases where strcasecmp() is no longer required. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cbb52569dd1589e5e397cdb35cd36d746e8c3900 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:38:32 -0000 The branch stable/12 has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cbb52569dd1589e5e397cdb35cd36d746e8c3900 commit cbb52569dd1589e5e397cdb35cd36d746e8c3900 Author: Dag-Erling SmĂžrgrav AuthorDate: 2018-11-27 11:22:19 +0000 Commit: Renato Botelho CommitDate: 2021-04-28 19:31:22 +0000 A few more cases where strcasecmp() is no longer required. MFC after: 1 week Approved by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit ceedec4bce2161062ffcacf7f07e364c8cfe09bc) --- lib/libfetch/http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 85d624e2da35..7ba170b7c775 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1408,7 +1408,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags) /* fetch_connect() has already set an error code */ return (NULL); init_http_headerbuf(&headerbuf); - if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); http_cmd(conn, "Host: %s:%d", @@ -1436,7 +1436,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags) } } while (h > hdr_end); } - if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && + if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { /* grrr */ errno = EAUTH; @@ -1473,7 +1473,7 @@ http_get_proxy(struct url * url, const char *flags) strcpy(purl->scheme, SCHEME_HTTP); if (!purl->port) purl->port = fetch_default_proxy_port(purl->scheme); - if (strcasecmp(purl->scheme, SCHEME_HTTP) == 0) + if (strcmp(purl->scheme, SCHEME_HTTP) == 0) return (purl); fetchFreeURL(purl); } @@ -1617,7 +1617,7 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us, if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { + if (purl && strcmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { From owner-dev-commits-src-all@freebsd.org Wed Apr 28 19:38:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 474A75FF18F; Wed, 28 Apr 2021 19:38: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 4FVppH1Mqjz3HSm; Wed, 28 Apr 2021 19:38: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 2060113B51; Wed, 28 Apr 2021 19:38: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 13SJcVQ0064575; Wed, 28 Apr 2021 19:38:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJcVlr064574; Wed, 28 Apr 2021 19:38:31 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:38:31 GMT Message-Id: <202104281938.13SJcVlr064574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: fe95c6e2aa0c - stable/12 - Improve URL parsing. In particular, convert scheme and host to lowercase. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fe95c6e2aa0caf36422294ef69124613a8a294fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:38:31 -0000 The branch stable/12 has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fe95c6e2aa0caf36422294ef69124613a8a294fc commit fe95c6e2aa0caf36422294ef69124613a8a294fc Author: Dag-Erling SmĂžrgrav AuthorDate: 2018-11-27 10:45:14 +0000 Commit: Renato Botelho CommitDate: 2021-04-28 19:31:11 +0000 Improve URL parsing. In particular, convert scheme and host to lowercase. MFC after: 1 week Approved by:▾ kp Sponsored by:▾ Rubicon Communications, LLC ("Netgate") (cherry picked from commit 8d9de5b10a24bd2d79ed99f139c0ac28c09b15ca) --- lib/libfetch/common.c | 8 ++--- lib/libfetch/fetch.c | 83 +++++++++++++++++++++++++++++---------------------- lib/libfetch/ftp.c | 8 ++--- 3 files changed, 56 insertions(+), 43 deletions(-) diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 74bc145f6873..80a63123abdb 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -189,9 +189,9 @@ fetch_default_port(const char *scheme) if ((se = getservbyname(scheme, "tcp")) != NULL) return (ntohs(se->s_port)); - if (strcasecmp(scheme, SCHEME_FTP) == 0) + if (strcmp(scheme, SCHEME_FTP) == 0) return (FTP_DEFAULT_PORT); - if (strcasecmp(scheme, SCHEME_HTTP) == 0) + if (strcmp(scheme, SCHEME_HTTP) == 0) return (HTTP_DEFAULT_PORT); return (0); } @@ -202,9 +202,9 @@ fetch_default_port(const char *scheme) int fetch_default_proxy_port(const char *scheme) { - if (strcasecmp(scheme, SCHEME_FTP) == 0) + if (strcmp(scheme, SCHEME_FTP) == 0) return (FTP_DEFAULT_PROXY_PORT); - if (strcasecmp(scheme, SCHEME_HTTP) == 0) + if (strcmp(scheme, SCHEME_HTTP) == 0) return (HTTP_DEFAULT_PROXY_PORT); return (0); } diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index fdbcd3301aa3..82a3c5e451a9 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include -#include +#include + +#include #include #include #include @@ -81,13 +83,13 @@ fetchXGet(struct url *URL, struct url_stat *us, const char *flags) us->size = -1; us->atime = us->mtime = 0; } - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchXGetFile(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchXGetFTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchXGetHTTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchXGetHTTP(URL, us, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -111,13 +113,13 @@ FILE * fetchPut(struct url *URL, const char *flags) { - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchPutFile(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchPutFTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchPutHTTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchPutHTTP(URL, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -135,13 +137,13 @@ fetchStat(struct url *URL, struct url_stat *us, const char *flags) us->size = -1; us->atime = us->mtime = 0; } - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchStatFile(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchStatFTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchStatHTTP(URL, us, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchStatHTTP(URL, us, flags)); url_seterr(URL_BAD_SCHEME); return (-1); @@ -155,13 +157,13 @@ struct url_ent * fetchList(struct url *URL, const char *flags) { - if (strcasecmp(URL->scheme, SCHEME_FILE) == 0) + if (strcmp(URL->scheme, SCHEME_FILE) == 0) return (fetchListFile(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) + else if (strcmp(URL->scheme, SCHEME_FTP) == 0) return (fetchListFTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTP) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTP) == 0) return (fetchListHTTP(URL, flags)); - else if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0) + else if (strcmp(URL->scheme, SCHEME_HTTPS) == 0) return (fetchListHTTP(URL, flags)); url_seterr(URL_BAD_SCHEME); return (NULL); @@ -350,7 +352,7 @@ fetchParseURL(const char *URL) char *doc; const char *p, *q; struct url *u; - int i; + int i, n; /* allocate struct url */ if ((u = calloc(1, sizeof(*u))) == NULL) { @@ -361,8 +363,10 @@ fetchParseURL(const char *URL) /* scheme name */ if ((p = strstr(URL, ":/"))) { - snprintf(u->scheme, URL_SCHEMELEN+1, - "%.*s", (int)(p - URL), URL); + if (p - URL > URL_SCHEMELEN) + goto ouch; + for (i = 0; URL + i < p; i++) + u->scheme[i] = tolower((unsigned char)URL[i]); URL = ++p; /* * Only one slash: no host, leave slash as part of document @@ -397,28 +401,37 @@ fetchParseURL(const char *URL) } /* hostname */ - if (*p == '[' && (q = strchr(p + 1, ']')) != NULL && - (*++q == '\0' || *q == '/' || *q == ':')) { - if ((i = q - p) > MAXHOSTNAMELEN) - i = MAXHOSTNAMELEN; - strncpy(u->host, p, i); - p = q; + if (*p == '[') { + q = p + 1 + strspn(p + 1, ":0123456789ABCDEFabcdef"); + if (*q++ != ']') + goto ouch; } else { - for (i = 0; *p && (*p != '/') && (*p != ':'); p++) - if (i < MAXHOSTNAMELEN) - u->host[i++] = *p; + /* valid characters in a DNS name */ + q = p + strspn(p, "-." "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" + "abcdefghijklmnopqrstuvwxyz"); } + if ((*q != '\0' && *q != '/' && *q != ':') || q - p > MAXHOSTNAMELEN) + goto ouch; + for (i = 0; p + i < q; i++) + u->host[i] = tolower((unsigned char)p[i]); + u->host[i] = '\0'; + p = q; /* port */ if (*p == ':') { - for (q = ++p; *q && (*q != '/'); q++) - if (isdigit((unsigned char)*q)) - u->port = u->port * 10 + (*q - '0'); - else { + for (n = 0, q = ++p; *q && (*q != '/'); q++) { + if (*q >= '0' && *q <= '9' && n < INT_MAX / 10) { + n = n * 10 + (*q - '0'); + } else { /* invalid port */ url_seterr(URL_BAD_PORT); goto ouch; } + } + if (n < 1 || n > IPPORT_MAX) + goto ouch; + u->port = n; p = q; } @@ -427,8 +440,8 @@ nohost: if (!*p) p = "/"; - if (strcasecmp(u->scheme, SCHEME_HTTP) == 0 || - strcasecmp(u->scheme, SCHEME_HTTPS) == 0) { + if (strcmp(u->scheme, SCHEME_HTTP) == 0 || + strcmp(u->scheme, SCHEME_HTTPS) == 0) { const char hexnums[] = "0123456789abcdef"; /* percent-escape whitespace. */ diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 18fa673147d4..9a546f3fecad 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -1085,8 +1085,8 @@ ftp_get_proxy(struct url * url, const char *flags) } if (!purl->port) purl->port = fetch_default_proxy_port(purl->scheme); - if (strcasecmp(purl->scheme, SCHEME_FTP) == 0 || - strcasecmp(purl->scheme, SCHEME_HTTP) == 0) + if (strcmp(purl->scheme, SCHEME_FTP) == 0 || + strcmp(purl->scheme, SCHEME_HTTP) == 0) return (purl); fetchFreeURL(purl); } @@ -1104,8 +1104,8 @@ ftp_request(struct url *url, const char *op, struct url_stat *us, int oflag; /* check if we should use HTTP instead */ - if (purl && (strcasecmp(purl->scheme, SCHEME_HTTP) == 0 || - strcasecmp(purl->scheme, SCHEME_HTTPS) == 0)) { + if (purl && (strcmp(purl->scheme, SCHEME_HTTP) == 0 || + strcmp(purl->scheme, SCHEME_HTTPS) == 0)) { if (strcmp(op, "STAT") == 0) return (http_request(url, "HEAD", us, purl, flags)); else if (strcmp(op, "RETR") == 0) From owner-dev-commits-src-all@freebsd.org Wed Apr 28 19:38:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 993385FF122; Wed, 28 Apr 2021 19:38: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 4FVppK3LTsz3HZ0; Wed, 28 Apr 2021 19:38: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 5747A13E9A; Wed, 28 Apr 2021 19:38: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 13SJcXnu064617; Wed, 28 Apr 2021 19:38:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13SJcXSB064616; Wed, 28 Apr 2021 19:38:33 GMT (envelope-from git) Date: Wed, 28 Apr 2021 19:38:33 GMT Message-Id: <202104281938.13SJcXSB064616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: 208c36a005f5 - stable/12 - libfetch: Retry with proxy auth when server returns 407 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 208c36a005f5592a9f3325036cd2e6f6ee03ca9a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2021 19:38:33 -0000 The branch stable/12 has been updated by garga (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=208c36a005f5592a9f3325036cd2e6f6ee03ca9a commit 208c36a005f5592a9f3325036cd2e6f6ee03ca9a Author: Renato Botelho AuthorDate: 2021-04-01 21:02:57 +0000 Commit: Renato Botelho CommitDate: 2021-04-28 19:31:27 +0000 libfetch: Retry with proxy auth when server returns 407 PR: 220468 Submitted by: Egil Hasting (based on) Reviewed by: kevans, kp Approved by: kp MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29533 (cherry picked from commit 345c30a94f6425954163f1e0b075a75f603d27cd) --- lib/libfetch/http.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 7ba170b7c775..c83c2eb4ec4d 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1387,6 +1388,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags) int verbose; int af, val; int serrno; + bool isproxyauth = false; + http_auth_challenges_t proxy_challenges; #ifdef INET6 af = AF_UNSPEC; @@ -1404,18 +1407,58 @@ http_connect(struct url *URL, struct url *purl, const char *flags) curl = (purl != NULL) ? purl : URL; +retry: if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); init_http_headerbuf(&headerbuf); if (strcmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { - http_cmd(conn, "CONNECT %s:%d HTTP/1.1", - URL->host, URL->port); - http_cmd(conn, "Host: %s:%d", - URL->host, URL->port); + init_http_auth_challenges(&proxy_challenges); + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); + http_cmd(conn, "Host: %s:%d", URL->host, URL->port); + if (isproxyauth) { + http_auth_params_t aparams; + init_http_auth_params(&aparams); + if (*purl->user || *purl->pwd) { + aparams.user = strdup(purl->user); + aparams.password = strdup(purl->pwd); + } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && + *p != '\0') { + if (http_authfromenv(p, &aparams) < 0) { + http_seterr(HTTP_NEED_PROXY_AUTH); + fetch_syserr(); + goto ouch; + } + } else if (fetch_netrc_auth(purl) == 0) { + aparams.user = strdup(purl->user); + aparams.password = strdup(purl->pwd); + } else { + /* + * No auth information found in system - exiting + * with warning. + */ + warnx("Missing username and/or password set"); + fetch_syserr(); + goto ouch; + } + http_authorize(conn, "Proxy-Authorization", + &proxy_challenges, &aparams, purl); + clean_http_auth_params(&aparams); + } http_cmd(conn, ""); - if (http_get_reply(conn) != HTTP_OK) { - http_seterr(conn->err); + /* Get reply from CONNECT Tunnel attempt */ + int httpreply = http_get_reply(conn); + if (httpreply != HTTP_OK) { + http_seterr(httpreply); + /* If the error is a 407/HTTP_NEED_PROXY_AUTH */ + if (httpreply == HTTP_NEED_PROXY_AUTH && + ! isproxyauth) { + /* Try again with authentication. */ + clean_http_headerbuf(&headerbuf); + fetch_close(conn); + isproxyauth = true; + goto retry; + } goto ouch; } /* Read and discard the rest of the proxy response */ From owner-dev-commits-src-all@freebsd.org Wed Apr 28 19:43:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 19:53:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 20:23:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Wed Apr 28 23:41:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 01:22:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 810EA62794A; Thu, 29 Apr 2021 01:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FVyRJ3GBQz3kRf; Thu, 29 Apr 2021 01:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B2B16DEB; Thu, 29 Apr 2021 01:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13T1MaD8021279; Thu, 29 Apr 2021 01:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T1Maq0021278; Thu, 29 Apr 2021 01:22:36 GMT (envelope-from git) Date: Thu, 29 Apr 2021 01:22:36 GMT Message-Id: <202104290122.13T1Maq0021278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1a34afa9541e - stable/13 - e1000: Restore VF interface random MAC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a34afa9541e9e086451786a168c6fed634eb05b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 01:22:36 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1a34afa9541e9e086451786a168c6fed634eb05b commit 1a34afa9541e9e086451786a168c6fed634eb05b Author: Kevin Bowling AuthorDate: 2021-04-15 18:45:02 +0000 Commit: Kevin Bowling CommitDate: 2021-04-29 01:22:16 +0000 e1000: Restore VF interface random MAC Restore 525e07418c77 after the iflib conversion of igb(4). This reenables random MAC address generation when attaching to a VF with a zeroed MAC. PR: 253535 Reported by: Balaev PA Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29785 (cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e) --- sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index abc78952a560..25236bf9cb79 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1061,9 +1061,17 @@ em_if_attach_pre(if_ctx_t ctx) } if (!em_is_valid_ether_addr(hw->mac.addr)) { - device_printf(dev, "Invalid MAC address\n"); - error = EIO; - goto err_late; + if (adapter->vf_ifp) { + u8 addr[ETHER_ADDR_LEN]; + arc4rand(&addr, sizeof(addr), 0); + addr[0] &= 0xFE; + addr[0] |= 0x02; + bcopy(addr, hw->mac.addr, sizeof(addr)); + } else { + device_printf(dev, "Invalid MAC address\n"); + error = EIO; + goto err_late; + } } /* Disable ULP support */ @@ -1924,6 +1932,13 @@ em_identify_hardware(if_ctx_t ctx) device_printf(dev, "Setup init failure\n"); return; } + + /* Are we a VF device? */ + if ((adapter->hw.mac.type == e1000_vfadapt) || + (adapter->hw.mac.type == e1000_vfadapt_i350)) + adapter->vf_ifp = 1; + else + adapter->vf_ifp = 0; } static int From owner-dev-commits-src-all@freebsd.org Thu Apr 29 01:24:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE6B6627BAE; Thu, 29 Apr 2021 01:24: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 4FVyT84YKxz3l3p; Thu, 29 Apr 2021 01:24: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 8F56E17067; Thu, 29 Apr 2021 01:24: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 13T1OC4p021494; Thu, 29 Apr 2021 01:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T1OCR4021493; Thu, 29 Apr 2021 01:24:12 GMT (envelope-from git) Date: Thu, 29 Apr 2021 01:24:12 GMT Message-Id: <202104290124.13T1OCR4021493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 50cebb6a8596 - stable/12 - e1000: Restore VF interface random MAC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 50cebb6a8596eaccca5c6ea6f0fbc871d0197ef3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 01:24:12 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=50cebb6a8596eaccca5c6ea6f0fbc871d0197ef3 commit 50cebb6a8596eaccca5c6ea6f0fbc871d0197ef3 Author: Kevin Bowling AuthorDate: 2021-04-15 18:45:02 +0000 Commit: Kevin Bowling CommitDate: 2021-04-29 01:23:07 +0000 e1000: Restore VF interface random MAC Restore 525e07418c77 after the iflib conversion of igb(4). This reenables random MAC address generation when attaching to a VF with a zeroed MAC. PR: 253535 Reported by: Balaev PA Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29785 (cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e) --- sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 8fc40586ad76..2d0f65b34144 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1063,9 +1063,17 @@ em_if_attach_pre(if_ctx_t ctx) } if (!em_is_valid_ether_addr(hw->mac.addr)) { - device_printf(dev, "Invalid MAC address\n"); - error = EIO; - goto err_late; + if (adapter->vf_ifp) { + u8 addr[ETHER_ADDR_LEN]; + arc4rand(&addr, sizeof(addr), 0); + addr[0] &= 0xFE; + addr[0] |= 0x02; + bcopy(addr, hw->mac.addr, sizeof(addr)); + } else { + device_printf(dev, "Invalid MAC address\n"); + error = EIO; + goto err_late; + } } /* Disable ULP support */ @@ -1914,6 +1922,13 @@ em_identify_hardware(if_ctx_t ctx) device_printf(dev, "Setup init failure\n"); return; } + + /* Are we a VF device? */ + if ((adapter->hw.mac.type == e1000_vfadapt) || + (adapter->hw.mac.type == e1000_vfadapt_i350)) + adapter->vf_ifp = 1; + else + adapter->vf_ifp = 0; } static int From owner-dev-commits-src-all@freebsd.org Thu Apr 29 04:44:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 04:44:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 04:46:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 09:17:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC6F05FEBC6; Thu, 29 Apr 2021 09:17: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 4FW8yx6LWDz4V9w; Thu, 29 Apr 2021 09:17: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 CCB261ADB8; Thu, 29 Apr 2021 09:17: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 13T9HDFX032529; Thu, 29 Apr 2021 09:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HDMM032528; Thu, 29 Apr 2021 09:17:13 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:13 GMT Message-Id: <202104290917.13T9HDMM032528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 3d851bd03698 - stable/13 - Always use inp fib in the inp_lookup_mcast_ifp(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d851bd036986cab15650fff33185a0fb42d634f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:14 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3d851bd036986cab15650fff33185a0fb42d634f commit 3d851bd036986cab15650fff33185a0fb42d634f Author: Alexander V. Chernikov AuthorDate: 2021-04-05 19:58:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 Always use inp fib in the inp_lookup_mcast_ifp(). inp_lookup_mcast_ifp() is static and is only used in the inp_join_group(). The latter function is also static, and is only used in the inp_setmoptions(), which relies on inp being non-NULL. As a result, in the current code, inp_lookup_mcast_ifp() is always called with non-NULL inp. Eliminate unused RT_DEFAULT_FIB condition and always use inp fib instead. Differential Revision: https://reviews.freebsd.org/D29594 Reviewed by: kp MFC after: 2 weeks (cherry picked from commit c3a456defaf28df8d6f47704d606248f6c22146c) --- sys/netinet/in_mcast.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 6d390a0b263c..46658688bbc2 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1894,8 +1894,7 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sopt) * specific physical links in the networking stack, or which need * to join link-scope groups before IPv4 addresses are configured. * - * If inp is non-NULL, use this socket's current FIB number for any - * required FIB lookup. + * Use this socket's current FIB number for any required FIB lookup. * If ina is INADDR_ANY, look up the group address in the unicast FIB, * and use its ifp; usually, this points to the default next-hop. * @@ -1916,8 +1915,8 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, struct rm_priotracker in_ifa_tracker; struct ifnet *ifp; struct nhop_object *nh; - uint32_t fibnum; + KASSERT(inp != NULL, ("%s: inp must not be NULL", __func__)); KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), ("%s: not multicast", __func__)); @@ -1930,8 +1929,7 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, if_ref(ifp); IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { - fibnum = inp ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; - nh = fib4_lookup(fibnum, gsin->sin_addr, 0, NHR_NONE, 0); + nh = fib4_lookup(inp->inp_inc.inc_fibnum, gsin->sin_addr, 0, NHR_NONE, 0); if (nh != NULL) { ifp = nh->nh_ifp; if_ref(ifp); From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47A4D5FEE80; Thu, 29 Apr 2021 09:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FW8z00q47z4Tx3; Thu, 29 Apr 2021 09:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DF581AA45; Thu, 29 Apr 2021 09:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13T9HFLJ032578; Thu, 29 Apr 2021 09:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HF5a032577; Thu, 29 Apr 2021 09:17:15 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:15 GMT Message-Id: <202104290917.13T9HF5a032577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: b77bee7642ae - stable/13 - Appease -Wsign-compare in radix.c 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b77bee7642aec3fb52b13893f5f8b21f5d93ef12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:16 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=b77bee7642aec3fb52b13893f5f8b21f5d93ef12 commit b77bee7642aec3fb52b13893f5f8b21f5d93ef12 Author: Alexander V. Chernikov AuthorDate: 2021-04-10 13:48:25 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 Appease -Wsign-compare in radix.c Differential Revision: https://reviews.freebsd.org/D29661 Submitted by: zec MFC after 2 weeks (cherry picked from commit 63dceebe68569c3a7ebd07d0a6123264da625149) --- sys/net/radix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/radix.c b/sys/net/radix.c index 1f58318e52ae..931bf6db871b 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -428,7 +428,7 @@ rn_insert(void *v_arg, struct radix_head *head, int *dupentry, int head_off = top->rn_offset, vlen = LEN(v); struct radix_node *t = rn_search(v_arg, top); caddr_t cp = v + head_off; - int b; + unsigned b; struct radix_node *p, *tt, *x; /* * Find first bit at which v and t->rn_key differ From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 164835FE9E7; Thu, 29 Apr 2021 09:17: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 4FW8yy6bq7z4Tyx; Thu, 29 Apr 2021 09:17: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 D41E31A87B; Thu, 29 Apr 2021 09:17: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 13T9HEU9032557; Thu, 29 Apr 2021 09:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HE71032556; Thu, 29 Apr 2021 09:17:14 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:14 GMT Message-Id: <202104290917.13T9HE71032556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c1ce6196d289 - stable/13 - Allow to specify debugnet fib in sysctl/tunable. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c1ce6196d289d6ca2a46f600d28da129b7cecaae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:15 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c1ce6196d289d6ca2a46f600d28da129b7cecaae commit c1ce6196d289d6ca2a46f600d28da129b7cecaae Author: Alexander V. Chernikov AuthorDate: 2021-04-05 19:48:07 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 Allow to specify debugnet fib in sysctl/tunable. Differential Revision: https://reviews.freebsd.org/D29593 Reviewed by: donner MFC after: 2 weeks (cherry picked from commit caf2f62765f9087a6e0002b1c47c3c6f65a8ae0b) --- sys/net/debugnet.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index 3930a87d46dc..bb59ff33a93f 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -91,6 +91,10 @@ int debugnet_nretries = 10; SYSCTL_INT(_net_debugnet, OID_AUTO, nretries, CTLFLAG_RWTUN, &debugnet_nretries, 0, "Number of retransmit attempts before giving up"); +int debugnet_fib = RT_DEFAULT_FIB; +SYSCTL_INT(_net_debugnet, OID_AUTO, fib, CTLFLAG_RWTUN, + &debugnet_fib, 0, + "Fib to use when sending dump"); static bool g_debugnet_pcb_inuse; static struct debugnet_pcb g_dnet_pcb; @@ -658,7 +662,7 @@ debugnet_connect(const struct debugnet_conn_params *dcp, }; CURVNET_SET(vnet0); - nh = fib4_lookup_debugnet(RT_DEFAULT_FIB, dest_sin.sin_addr, 0, + nh = fib4_lookup_debugnet(debugnet_fib, dest_sin.sin_addr, 0, NHR_NONE); CURVNET_RESTORE(); From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4BBE5FEBD2; Thu, 29 Apr 2021 09:17: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 4FW8z342ktz4VBJ; Thu, 29 Apr 2021 09:17: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 5AE7E1AA47; Thu, 29 Apr 2021 09:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13T9HJC2032645; Thu, 29 Apr 2021 09:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HJe7032644; Thu, 29 Apr 2021 09:17:19 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:19 GMT Message-Id: <202104290917.13T9HJe7032644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 553c1513a8a5 - stable/13 - Fix build with gcc 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 553c1513a8a5b0deca8d1b97611d6859b806f281 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:19 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=553c1513a8a5b0deca8d1b97611d6859b806f281 commit 553c1513a8a5b0deca8d1b97611d6859b806f281 Author: Stefan Eßer AuthorDate: 2021-04-25 08:15:17 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 Fix build with gcc Correctly declare function without arguments as f(void) instead of f(). (cherry picked from commit 6409e594272f66ce3896706ac705bbd465ce233e) --- sys/net/route/fib_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index a00dfe338ab5..7b3eed9a71c2 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -364,7 +364,7 @@ fib_error_clear_flm(struct fib_lookup_module *flm) * Clears all errors in current VNET. */ static void -fib_error_clear() +fib_error_clear(void) { struct fib_error *fe, *fe_tmp; From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6764F5FEE85; Thu, 29 Apr 2021 09:17: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 4FW8z11hHFz4V2T; Thu, 29 Apr 2021 09:17: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 29A821AC86; Thu, 29 Apr 2021 09:17: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 13T9HHEX032603; Thu, 29 Apr 2021 09:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HHoZ032602; Thu, 29 Apr 2021 09:17:17 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:17 GMT Message-Id: <202104290917.13T9HHoZ032602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c971873acef4 - stable/13 - Implement better rebuild-delay fib algo policy. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c971873acef46eedec786387b1d9c22b002b6634 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:17 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c971873acef46eedec786387b1d9c22b002b6634 commit c971873acef46eedec786387b1d9c22b002b6634 Author: Alexander V. Chernikov AuthorDate: 2021-04-09 20:25:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 Implement better rebuild-delay fib algo policy. The intent is to better handle time intervals with large amount of RIB updates (e.g. BGP peer going up or down), while still keeping low sync delay for the rest scenarios. The implementation is the following: updates are bucketed into the buckets of size 50ms. If the number of updates within a current bucket exceeds the threshold of 500 routes/sec (e.g. 10 updates per bucket interval), the update is delayed for another 50ms. This can be repeated until the maximum update delay (1 sec) is reached. All 3 variables are runtime tunables: * net.route.algo.fib_max_sync_delay_ms: 1000 * net.route.algo.bucket_change_threshold_rate: 500 * net.route.algo.bucket_time_ms: 50 Differential Review: https://reviews.freebsd.org/D29588 MFC after: 2 weeks (cherry picked from commit ee2cf2b3609ee179f39080e0ebe8bf79dcb13461) --- sys/net/route/fib_algo.c | 289 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 228 insertions(+), 61 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index c93d76c2379b..03c21af4df97 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -105,10 +105,26 @@ SYSCTL_DECL(_net_route); SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Fib algorithm lookups"); -VNET_DEFINE(int, fib_sync_limit) = 100; -#define V_fib_sync_limit VNET(fib_sync_limit) -SYSCTL_INT(_net_route_algo, OID_AUTO, fib_sync_limit, CTLFLAG_RW | CTLFLAG_VNET, - &VNET_NAME(fib_sync_limit), 0, "Guarantee synchronous fib till route limit"); +/* Algorithm sync policy */ + +/* Time interval to bucket updates */ +VNET_DEFINE(unsigned int, bucket_time_ms) = 50; +#define V_bucket_time_ms VNET(bucket_time_ms) +SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_time_ms, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(bucket_time_ms), 0, "Time interval to calculate update rate"); + +/* Minimum update rate to delay sync */ +VNET_DEFINE(unsigned int, bucket_change_threshold_rate) = 500; +#define V_bucket_change_threshold_rate VNET(bucket_change_threshold_rate) +SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_change_threshold_rate, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(bucket_change_threshold_rate), 0, "Minimum update rate to delay sync"); + +/* Max allowed delay to sync */ +VNET_DEFINE(unsigned int, fib_max_sync_delay_ms) = 1000; +#define V_fib_max_sync_delay_ms VNET(fib_max_sync_delay_ms) +SYSCTL_UINT(_net_route_algo, OID_AUTO, fib_max_sync_delay_ms, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(fib_max_sync_delay_ms), 0, "Maximum time to delay sync (ms)"); + #ifdef INET6 VNET_DEFINE_STATIC(bool, algo_fixed_inet6) = false; @@ -131,6 +147,19 @@ struct nhop_ref_table { int32_t refcnt[0]; }; +enum fib_callout_action { + FDA_NONE, /* No callout scheduled */ + FDA_REBUILD, /* Asks to rebuild algo instance */ + FDA_EVAL, /* Asks to evaluate if the current algo is still be best */ +}; + +struct fib_sync_status { + struct timeval diverge_time; /* ts when diverged */ + uint32_t num_changes; /* number of changes since sync */ + uint32_t bucket_changes; /* num changes within the current bucket */ + uint64_t bucket_id; /* 50ms bucket # */ +}; + /* * Data structure for the fib lookup instance tied to the particular rib. */ @@ -141,12 +170,12 @@ struct fib_data { uint32_t fd_dead:1; /* Scheduled for deletion */ uint32_t fd_linked:1; /* true if linked */ uint32_t fd_need_rebuild:1; /* true if rebuild scheduled */ - uint32_t fd_force_eval:1;/* true if rebuild scheduled */ uint8_t fd_family; /* family */ uint32_t fd_fibnum; /* fibnum */ uint32_t fd_failed_rebuilds; /* stat: failed rebuilds */ uint32_t fd_gen; /* instance gen# */ struct callout fd_callout; /* rebuild callout */ + enum fib_callout_action fd_callout_action; /* Callout action to take */ void *fd_algo_data; /* algorithm data */ struct nhop_object **nh_idx; /* nhop idx->ptr array */ struct nhop_ref_table *nh_ref_table; /* array with # of nhop references */ @@ -156,12 +185,14 @@ struct fib_data { struct vnet *fd_vnet; /* vnet fib belongs to */ struct epoch_context fd_epoch_ctx; /* epoch context for deletion */ struct fib_lookup_module *fd_flm;/* pointer to the lookup module */ + struct fib_sync_status fd_ss; /* State relevant to the rib sync */ uint32_t fd_num_changes; /* number of changes since last callout */ TAILQ_ENTRY(fib_data) entries; /* list of all fds in vnet */ }; -static bool rebuild_fd(struct fib_data *fd); -static void rebuild_fd_callout(void *_data); +static bool rebuild_fd(struct fib_data *fd, const char *reason); +static bool rebuild_fd_flm(struct fib_data *fd, struct fib_lookup_module *flm_new); +static void handle_fd_callout(void *_data); static void destroy_fd_instance_epoch(epoch_context_t ctx); static bool is_idx_free(struct fib_data *fd, uint32_t index); static void set_algo_fixed(struct rib_head *rh); @@ -194,6 +225,7 @@ MTX_SYSINIT(fib_mtx, &fib_mtx, "algo list mutex", MTX_DEF); #define FIB_MAX_NHOPS 262144 #define FIB_CALLOUT_DELAY_MS 50 + /* Debug */ static int flm_debug_level = LOG_NOTICE; SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, @@ -460,11 +492,13 @@ callout_calc_delay_ms(struct fib_data *fd) } static void -schedule_callout(struct fib_data *fd, int delay_ms) +schedule_callout(struct fib_data *fd, enum fib_callout_action action, int delay_ms) { + FD_PRINTF(LOG_DEBUG, fd, "delay=%d action=%d", delay_ms, action); + fd->fd_callout_action = action; callout_reset_sbt(&fd->fd_callout, SBT_1MS * delay_ms, 0, - rebuild_fd_callout, fd, 0); + handle_fd_callout, fd, 0); } static void @@ -482,37 +516,138 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) */ FD_PRINTF(LOG_INFO, fd, "Scheduling rebuild: %s (failures=%d)", reason, fd->fd_failed_rebuilds); - schedule_callout(fd, callout_calc_delay_ms(fd)); + schedule_callout(fd, FDA_REBUILD, callout_calc_delay_ms(fd)); + } +} + +static int64_t +get_tv_diff_ms(const struct timeval *old_tv, const struct timeval *new_tv) +{ + int64_t diff = 0; + + diff = ((int64_t)(new_tv->tv_sec - old_tv->tv_sec)) * 1000; + diff += (new_tv->tv_usec - old_tv->tv_usec) / 1000; + + return (diff); +} + +static void +add_tv_diff_ms(struct timeval *tv, int ms) +{ + tv->tv_sec += ms / 1000; + ms = ms % 1000; + if (ms * 1000 + tv->tv_usec < 1000000) + tv->tv_usec += ms * 1000; + else { + tv->tv_sec += 1; + tv->tv_usec = ms * 1000 + tv->tv_usec - 1000000; } } +/* + * Marks the time when algo state diverges from the rib state. + */ static void -schedule_algo_eval(struct fib_data *fd) +mark_diverge_time(struct fib_data *fd) +{ + struct fib_sync_status *fd_ss = &fd->fd_ss; + + getmicrouptime(&fd_ss->diverge_time); + fd_ss->bucket_id = 0; + fd_ss->bucket_changes = 0; +} + +/* + * Calculates and updates the next algorithm sync time, based on the current activity. + * + * The intent is to provide reasonable balance between the update + * latency and efficient batching when changing large amount of routes. + * + * High-level algorithm looks the following: + * 1) all changes are bucketed in 50ms intervals + * 2) If amount of changes within the bucket is greater than the threshold, + * the update gets delayed, up to maximum delay threshold. + */ +static void +update_rebuild_delay(struct fib_data *fd) +{ + uint32_t bucket_id, new_delay = 0; + struct timeval tv; + + /* Fetch all variables at once to ensure consistent reads */ + uint32_t bucket_time_ms = V_bucket_time_ms; + uint32_t threshold_rate = V_bucket_change_threshold_rate; + uint32_t max_delay_ms = V_fib_max_sync_delay_ms; + + if (bucket_time_ms == 0) + bucket_time_ms = 50; + /* calculate per-bucket threshold rate */ + threshold_rate = threshold_rate * bucket_time_ms / 1000; + + getmicrouptime(&tv); + + struct fib_sync_status *fd_ss = &fd->fd_ss; + + bucket_id = get_tv_diff_ms(&fd_ss->diverge_time, &tv) / bucket_time_ms; + + if (fd_ss->bucket_id == bucket_id) { + fd_ss->bucket_changes++; + if (fd_ss->bucket_changes == threshold_rate) { + new_delay = (bucket_id + 2) * bucket_time_ms; + if (new_delay <= max_delay_ms) { + FD_PRINTF(LOG_DEBUG, fd, + "hit threshold of %u routes, delay update," + "bucket: %u, total delay: %u", + threshold_rate, bucket_id + 1, new_delay); + } else { + new_delay = 0; + FD_PRINTF(LOG_DEBUG, fd, + "maximum sync delay (%u ms) reached", max_delay_ms); + } + } else if ((bucket_id == 0) && (fd_ss->bucket_changes == 1)) + new_delay = bucket_time_ms; + } else { + fd_ss->bucket_id = bucket_id; + fd_ss->bucket_changes = 1; + } + + if (new_delay > 0) { + /* Calculated time has been updated */ + struct timeval new_tv = fd_ss->diverge_time; + add_tv_diff_ms(&new_tv, new_delay); + + int32_t delay_ms = get_tv_diff_ms(&tv, &new_tv); + schedule_callout(fd, FDA_REBUILD, delay_ms); + } +} + +static void +update_algo_state(struct fib_data *fd) { RIB_WLOCK_ASSERT(fd->fd_rh); + if (fd->fd_need_rebuild) { + update_rebuild_delay(fd); + return; + } + if (fd->fd_num_changes++ == 0) { /* Start callout to consider switch */ if (!callout_pending(&fd->fd_callout)) - schedule_callout(fd, ALGO_EVAL_DELAY_MS); - } else if (fd->fd_num_changes > ALGO_EVAL_NUM_ROUTES && !fd->fd_force_eval) { + schedule_callout(fd, FDA_EVAL, ALGO_EVAL_DELAY_MS); + } else if (fd->fd_num_changes == ALGO_EVAL_NUM_ROUTES) { /* Reset callout to exec immediately */ - if (!fd->fd_need_rebuild) { - fd->fd_force_eval = true; - schedule_callout(fd, 1); - } + if (fd->fd_callout_action == FDA_EVAL) + schedule_callout(fd, FDA_EVAL, 1); } } static bool -need_immediate_rebuild(struct fib_data *fd, struct rib_cmd_info *rc) +need_immediate_sync(struct fib_data *fd, struct rib_cmd_info *rc) { struct nhop_object *nh; - if ((V_fib_sync_limit == 0) || (fd->fd_rh->rnh_prefixes <= V_fib_sync_limit)) - return (true); - /* Sync addition/removal of interface routes */ switch (rc->rc_cmd) { case RTM_ADD: @@ -551,6 +686,12 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, */ if (!fd->init_done) return; + + bool immediate_sync = need_immediate_sync(fd, rc); + + /* Consider scheduling algorithm re-evaluation */ + update_algo_state(fd); + /* * If algo requested rebuild, stop sending updates by default. * This simplifies nexthop refcount handling logic. @@ -558,9 +699,6 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, if (fd->fd_need_rebuild) return; - /* Consider scheduling algorithm re-evaluation */ - schedule_algo_eval(fd); - /* * Maintain guarantee that every nexthop returned by the dataplane * lookup has > 0 refcount, so can be safely referenced within current @@ -588,15 +726,14 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * Algo is not able to apply the update. * Schedule algo rebuild. */ - if (!need_immediate_rebuild(fd, rc)) { + if (!immediate_sync) { + mark_diverge_time(fd); schedule_fd_rebuild(fd, "algo requested rebuild"); break; } - fd->fd_need_rebuild = true; FD_PRINTF(LOG_INFO, fd, "running sync rebuild"); - if (!rebuild_fd(fd)) - schedule_fd_rebuild(fd, "sync rebuild failed"); + rebuild_fd(fd, "rtable change type enforced sync"); break; case FLM_ERROR: @@ -1031,22 +1168,54 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, return (result); } +/* + * Tries to sync algo with the current rtable state, either + * by executing batch update or rebuilding. + * Returns true on success. + */ +static bool +execute_callout_action(struct fib_data *fd) +{ + enum fib_callout_action action = fd->fd_callout_action; + struct fib_lookup_module *flm_new = NULL; + bool result = true; + + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(fd->fd_rh); + + fd->fd_need_rebuild = false; + fd->fd_num_changes = 0; + + /* First, check if we're still OK to use this algo */ + if (!is_algo_fixed(fd->fd_rh)) + flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm); + if (flm_new != NULL) + action = FDA_REBUILD; + + if (action == FDA_REBUILD) + result = rebuild_fd_flm(fd, flm_new != NULL ? flm_new : fd->fd_flm); + if (flm_new != NULL) + fib_unref_algo(flm_new); + + return (result); +} + /* * Callout for all scheduled fd-related work. * - Checks if the current algo is still the best algo * - Creates a new instance of an algo for af/fib if desired. */ static void -rebuild_fd_callout(void *_data) +handle_fd_callout(void *_data) { struct fib_data *fd = (struct fib_data *)_data; struct epoch_tracker et; - FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); + FD_PRINTF(LOG_INFO, fd, "running callout type=%d", fd->fd_callout_action); NET_EPOCH_ENTER(et); CURVNET_SET(fd->fd_vnet); - rebuild_fd(fd); + execute_callout_action(fd); CURVNET_RESTORE(); NET_EPOCH_EXIT(et); } @@ -1056,41 +1225,17 @@ rebuild_fd_callout(void *_data) * Returns true on success. */ static bool -rebuild_fd(struct fib_data *fd) +rebuild_fd_flm(struct fib_data *fd, struct fib_lookup_module *flm_new) { - struct fib_data *fd_new, *fd_tmp; - struct fib_lookup_module *flm_new = NULL; - enum flm_op_result result; - bool need_rebuild = false; - - NET_EPOCH_ASSERT(); - RIB_WLOCK_ASSERT(fd->fd_rh); - - need_rebuild = fd->fd_need_rebuild; - fd->fd_need_rebuild = false; - fd->fd_force_eval = false; - fd->fd_num_changes = 0; - - /* First, check if we're still OK to use this algo */ - if (!is_algo_fixed(fd->fd_rh)) - flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm); - if ((flm_new == NULL) && (!need_rebuild)) { - /* Keep existing algo, no need to rebuild. */ - return (true); - } + struct fib_data *fd_new, *fd_tmp = NULL; + bool result; - if (flm_new == NULL) { - flm_new = fd->fd_flm; + if (flm_new == fd->fd_flm) fd_tmp = fd; - } else { - fd_tmp = NULL; + else FD_PRINTF(LOG_NOTICE, fd, "switching algo to %s", flm_new->flm_name); - } + result = setup_fd_instance(flm_new, fd->fd_rh, fd_tmp, &fd_new, true); - if (fd_tmp == NULL) { - /* fd_new represents new algo */ - fib_unref_algo(flm_new); - } if (result != FLM_SUCCESS) { FD_PRINTF(LOG_NOTICE, fd, "table rebuild failed"); return (false); @@ -1103,6 +1248,28 @@ rebuild_fd(struct fib_data *fd) return (true); } +static bool +rebuild_fd(struct fib_data *fd, const char *reason) +{ + struct fib_lookup_module *flm_new = NULL; + bool result; + + if (!is_algo_fixed(fd->fd_rh)) + flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm); + + FD_PRINTF(LOG_INFO, fd, "running sync rebuild: %s", reason); + result = rebuild_fd_flm(fd, flm_new != NULL ? flm_new : fd->fd_flm); + if (flm_new != NULL) + fib_unref_algo(flm_new); + + if (!result) { + FD_PRINTF(LOG_ERR, fd, "sync rebuild failed"); + schedule_fd_rebuild(fd, "sync rebuild failed"); + } + + return (result); +} + /* * Finds algo by name/family. * Returns referenced algo or NULL. From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B59D05FEC4E; Thu, 29 Apr 2021 09:17: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 4FW8z23D8Pz4V2Y; Thu, 29 Apr 2021 09:17: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 560581AA46; Thu, 29 Apr 2021 09:17: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 13T9HI1Q032624; Thu, 29 Apr 2021 09:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HIv3032623; Thu, 29 Apr 2021 09:17:18 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:18 GMT Message-Id: <202104290917.13T9HIv3032623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a07e7856e4cd - stable/13 - fib algo: do not reallocate datapath index for datapath ptr update. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a07e7856e4cd50b7fdae61b6dc6a4babe0cf1ed3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:18 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a07e7856e4cd50b7fdae61b6dc6a4babe0cf1ed3 commit a07e7856e4cd50b7fdae61b6dc6a4babe0cf1ed3 Author: Alexander V. Chernikov AuthorDate: 2021-04-18 15:03:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:31 +0000 fib algo: do not reallocate datapath index for datapath ptr update. Fib algo uses a per-family array indexed by the fibnum to store lookup function pointers and per-fib data. Each algorithm rebuild currently requires re-allocating this array to support atomic change of two pointers. As in reality most of the changes actually involve changing only data pointer, add a shortcut performing in-flight pointer update. MFC after: 2 weeks (cherry picked from commit 0abb6ff590842114c74e5d52e1af65605bd9d960) --- sys/net/route/fib_algo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 03c21af4df97..a00dfe338ab5 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1438,6 +1438,17 @@ replace_rtables_family(struct fib_dp **pdp, struct fib_data *fd, struct fib_dp * FIB_MOD_LOCK(); old_fdh = get_fib_dp_header(*pdp); + if (old_fdh->fdh_idx[fd->fd_fibnum].f == dp->f) { + /* + * Function is the same, data pointer needs update. + * Perform in-line replace without reallocation. + */ + old_fdh->fdh_idx[fd->fd_fibnum].arg = dp->arg; + FD_PRINTF(LOG_DEBUG, fd, "FDH %p inline update", old_fdh); + FIB_MOD_UNLOCK(); + return (true); + } + new_fdh = alloc_fib_dp_array(old_fdh->fdh_num_tables, false); FD_PRINTF(LOG_DEBUG, fd, "OLD FDH: %p NEW FDH: %p", old_fdh, new_fdh); if (new_fdh == NULL) { From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EABF75FE80A; Thu, 29 Apr 2021 09:17: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 4FW8z44wdgz4VLd; Thu, 29 Apr 2021 09:17: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 888E61ADB9; Thu, 29 Apr 2021 09:17: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 13T9HKVu032671; Thu, 29 Apr 2021 09:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HKAa032670; Thu, 29 Apr 2021 09:17:20 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:20 GMT Message-Id: <202104290917.13T9HKAa032670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6fa0160556e3 - stable/13 - Add batched update support for the fib algo. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6fa0160556e3c266a8d54f8cbd666d9e9e4b9401 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:21 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa0160556e3c266a8d54f8cbd666d9e9e4b9401 commit 6fa0160556e3c266a8d54f8cbd666d9e9e4b9401 Author: Alexander V. Chernikov AuthorDate: 2021-04-09 21:30:10 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:32 +0000 Add batched update support for the fib algo. Initial fib algo implementation was build on a very simple set of principles w.r.t updates: 1) algorithm is ether able to apply the change synchronously (DIR24-8) or requires full rebuild (bsearch, lradix). 2) framework falls back to rebuild on every error (memory allocation, nhg limit, other internal algo errors, etc). This changes brings the new "intermediate" concept - batched updates. Algotirhm can indicate that the particular update has to be handled in batched fashion (FLM_BATCH). The framework will write this update and other updates to the temporary buffer instead of pushing them to the algo callback. Depending on the update rate, the framework will batch 50..1024 ms of updates and submit them to a different algo callback. This functionality is handy for the slow-to-rebuild algorithms like DXR. Differential Revision: https://reviews.freebsd.org/D29588 Reviewed by: zec MFC after: 2 weeks (cherry picked from commit 6b8ef0d428c93c970c1951a52c72f9e99c9e4279) --- sys/net/route/fib_algo.c | 135 +++++++++++++++++++++++++++++++++++++++++++++-- sys/net/route/fib_algo.h | 25 ++++++++- 2 files changed, 154 insertions(+), 6 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 7b3eed9a71c2..171fa2cfb2dd 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -151,6 +151,7 @@ enum fib_callout_action { FDA_NONE, /* No callout scheduled */ FDA_REBUILD, /* Asks to rebuild algo instance */ FDA_EVAL, /* Asks to evaluate if the current algo is still be best */ + FDA_BATCH, /* Asks to submit batch of updates to the algo */ }; struct fib_sync_status { @@ -158,6 +159,7 @@ struct fib_sync_status { uint32_t num_changes; /* number of changes since sync */ uint32_t bucket_changes; /* num changes within the current bucket */ uint64_t bucket_id; /* 50ms bucket # */ + struct fib_change_queue fd_change_queue;/* list of scheduled entries */ }; /* @@ -170,6 +172,7 @@ struct fib_data { uint32_t fd_dead:1; /* Scheduled for deletion */ uint32_t fd_linked:1; /* true if linked */ uint32_t fd_need_rebuild:1; /* true if rebuild scheduled */ + uint32_t fd_batch:1; /* true if batched notification scheduled */ uint8_t fd_family; /* family */ uint32_t fd_fibnum; /* fibnum */ uint32_t fd_failed_rebuilds; /* stat: failed rebuilds */ @@ -384,6 +387,8 @@ print_op_result(enum flm_op_result result) return "success"; case FLM_REBUILD: return "rebuild"; + case FLM_BATCH: + return "batch"; case FLM_ERROR: return "error"; } @@ -509,6 +514,8 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) if (!fd->fd_need_rebuild) { fd->fd_need_rebuild = true; + /* Stop batch updates */ + fd->fd_batch = false; /* * Potentially re-schedules pending callout @@ -569,7 +576,7 @@ mark_diverge_time(struct fib_data *fd) * the update gets delayed, up to maximum delay threshold. */ static void -update_rebuild_delay(struct fib_data *fd) +update_rebuild_delay(struct fib_data *fd, enum fib_callout_action action) { uint32_t bucket_id, new_delay = 0; struct timeval tv; @@ -617,7 +624,7 @@ update_rebuild_delay(struct fib_data *fd) add_tv_diff_ms(&new_tv, new_delay); int32_t delay_ms = get_tv_diff_ms(&tv, &new_tv); - schedule_callout(fd, FDA_REBUILD, delay_ms); + schedule_callout(fd, action, delay_ms); } } @@ -627,8 +634,9 @@ update_algo_state(struct fib_data *fd) RIB_WLOCK_ASSERT(fd->fd_rh); - if (fd->fd_need_rebuild) { - update_rebuild_delay(fd); + if (fd->fd_batch || fd->fd_need_rebuild) { + enum fib_callout_action action = fd->fd_need_rebuild ? FDA_REBUILD : FDA_BATCH; + update_rebuild_delay(fd, action); return; } @@ -665,6 +673,77 @@ need_immediate_sync(struct fib_data *fd, struct rib_cmd_info *rc) return (false); } +static bool +apply_rtable_changes(struct fib_data *fd) +{ + enum flm_op_result result; + struct fib_change_queue *q = &fd->fd_ss.fd_change_queue; + + result = fd->fd_flm->flm_change_rib_items_cb(fd->fd_rh, q, fd->fd_algo_data); + + if (result == FLM_SUCCESS) { + for (int i = 0; i < q->count; i++) + if (q->entries[i].nh_old) + fib_unref_nhop(fd, q->entries[i].nh_old); + q->count = 0; + } + fd->fd_batch = false; + + return (result == FLM_SUCCESS); +} + +static bool +fill_change_entry(struct fib_data *fd, struct fib_change_entry *ce, struct rib_cmd_info *rc) +{ + int plen = 0; + + switch (fd->fd_family) { + case AF_INET: + rt_get_inet_prefix_plen(rc->rc_rt, &ce->addr4, &plen, &ce->scopeid); + break; + case AF_INET6: + rt_get_inet6_prefix_plen(rc->rc_rt, &ce->addr6, &plen, &ce->scopeid); + break; + } + + ce->plen = plen; + ce->nh_old = rc->rc_nh_old; + ce->nh_new = rc->rc_nh_new; + if (ce->nh_new != NULL) { + if (fib_ref_nhop(fd, ce->nh_new) == 0) + return (false); + } + + return (true); +} + +static bool +queue_rtable_change(struct fib_data *fd, struct rib_cmd_info *rc) +{ + struct fib_change_queue *q = &fd->fd_ss.fd_change_queue; + + if (q->count >= q->size) { + uint32_t q_size; + + if (q->size == 0) + q_size = 256; /* ~18k memory */ + else + q_size = q->size * 2; + + size_t size = q_size * sizeof(struct fib_change_entry); + void *a = realloc(q->entries, size, M_TEMP, M_NOWAIT | M_ZERO); + if (a == NULL) { + FD_PRINTF(LOG_INFO, fd, "Unable to realloc queue for %u elements", + q_size); + return (false); + } + q->entries = a; + q->size = q_size; + } + + return (fill_change_entry(fd, &q->entries[q->count++], rc)); +} + /* * Rib subscription handler. Checks if the algorithm is ready to * receive updates, handles nexthop refcounting and passes change @@ -696,8 +775,26 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * If algo requested rebuild, stop sending updates by default. * This simplifies nexthop refcount handling logic. */ - if (fd->fd_need_rebuild) + if (fd->fd_need_rebuild) { + if (immediate_sync) + rebuild_fd(fd, "rtable change type enforced sync"); + return; + } + + /* + * Algo requested updates to be delivered in batches. + * Add the current change to the queue and return. + */ + if (fd->fd_batch) { + if (immediate_sync) { + if (!queue_rtable_change(fd, rc) || !apply_rtable_changes(fd)) + rebuild_fd(fd, "batch sync failed"); + } else { + if (!queue_rtable_change(fd, rc)) + schedule_fd_rebuild(fd, "batch queue failed"); + } return; + } /* * Maintain guarantee that every nexthop returned by the dataplane @@ -720,6 +817,23 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, if (rc->rc_nh_old != NULL) fib_unref_nhop(fd, rc->rc_nh_old); break; + case FLM_BATCH: + + /* + * Algo asks to batch the changes. + */ + if (queue_rtable_change(fd, rc)) { + if (!immediate_sync) { + fd->fd_batch = true; + mark_diverge_time(fd); + update_rebuild_delay(fd, FDA_BATCH); + break; + } + if (apply_rtable_changes(fd)) + break; + } + FD_PRINTF(LOG_ERR, fd, "batched sync failed, force the rebuild"); + case FLM_REBUILD: /* @@ -982,6 +1096,9 @@ destroy_fd_instance(struct fib_data *fd) if (fd->nh_ref_table != NULL) free(fd->nh_ref_table, M_RTABLE); + if (fd->fd_ss.fd_change_queue.entries != NULL) + free(fd->fd_ss.fd_change_queue.entries, M_TEMP); + fib_unref_algo(fd->fd_flm); free(fd, M_RTABLE); @@ -1184,6 +1301,7 @@ execute_callout_action(struct fib_data *fd) RIB_WLOCK_ASSERT(fd->fd_rh); fd->fd_need_rebuild = false; + fd->fd_batch = false; fd->fd_num_changes = 0; /* First, check if we're still OK to use this algo */ @@ -1192,6 +1310,12 @@ execute_callout_action(struct fib_data *fd) if (flm_new != NULL) action = FDA_REBUILD; + if (action == FDA_BATCH) { + /* Try to sync */ + if (!apply_rtable_changes(fd)) + action = FDA_REBUILD; + } + if (action == FDA_REBUILD) result = rebuild_fd_flm(fd, flm_new != NULL ? flm_new : fd->fd_flm); if (flm_new != NULL) @@ -1203,6 +1327,7 @@ execute_callout_action(struct fib_data *fd) /* * Callout for all scheduled fd-related work. * - Checks if the current algo is still the best algo + * - Synchronises algo instance to the rtable (batch usecase) * - Creates a new instance of an algo for af/fib if desired. */ static void diff --git a/sys/net/route/fib_algo.h b/sys/net/route/fib_algo.h index 0e9994245ca4..23099ff7c132 100644 --- a/sys/net/route/fib_algo.h +++ b/sys/net/route/fib_algo.h @@ -36,6 +36,7 @@ enum flm_op_result { FLM_SUCCESS, /* No errors, operation successful */ FLM_REBUILD, /* Operation cannot be completed, schedule algorithm rebuild */ FLM_ERROR, /* Operation failed, this algo cannot be used */ + FLM_BATCH, /* Operation cannot be completed, algorithm asks to batch changes */ }; struct rib_rtable_info { @@ -51,6 +52,24 @@ struct flm_lookup_key { }; }; +struct fib_change_entry { + union { + struct in_addr addr4; + struct in6_addr addr6; + }; + uint32_t scopeid; + uint8_t plen; + struct nhop_object *nh_old; + struct nhop_object *nh_new; +}; + +struct fib_change_queue { + uint32_t count; + uint32_t size; + struct fib_change_entry *entries; +}; + + typedef struct nhop_object *flm_lookup_t(void *algo_data, const struct flm_lookup_key key, uint32_t scopeid); typedef enum flm_op_result flm_init_t (uint32_t fibnum, struct fib_data *fd, @@ -60,6 +79,8 @@ typedef enum flm_op_result flm_dump_t(struct rtentry *rt, void *data); typedef enum flm_op_result flm_dump_end_t(void *data, struct fib_dp *dp); typedef enum flm_op_result flm_change_t(struct rib_head *rnh, struct rib_cmd_info *rc, void *data); +typedef enum flm_op_result flm_change_batch_t(struct rib_head *rnh, + struct fib_change_queue *q, void *data); typedef uint8_t flm_get_pref_t(const struct rib_rtable_info *rinfo); struct fib_lookup_module { @@ -69,12 +90,14 @@ struct fib_lookup_module { uint32_t flm_flags; /* flags */ uint8_t flm_index; /* internal algo index */ flm_init_t *flm_init_cb; /* instance init */ - flm_destroy_t *flm_destroy_cb; /* destroy instance */ + flm_destroy_t *flm_destroy_cb; /* destroy instance */ flm_change_t *flm_change_rib_item_cb;/* routing table change hook */ flm_dump_t *flm_dump_rib_item_cb; /* routing table dump cb */ flm_dump_end_t *flm_dump_end_cb; /* end of dump */ flm_lookup_t *flm_lookup; /* lookup function */ flm_get_pref_t *flm_get_pref; /* get algo preference */ + flm_change_batch_t *flm_change_rib_items_cb;/* routing table change hook */ + void *spare[8]; /* Spare callbacks */ TAILQ_ENTRY(fib_lookup_module) entries; }; From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 814825FECD2; Thu, 29 Apr 2021 09:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FW8z80ScSz4Tt3; Thu, 29 Apr 2021 09:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D310C1AA49; Thu, 29 Apr 2021 09:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13T9HNdJ032739; Thu, 29 Apr 2021 09:17:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HN2I032738; Thu, 29 Apr 2021 09:17:23 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:23 GMT Message-Id: <202104290917.13T9HN2I032738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 2c0d16218efa - stable/13 - Fix NOINET[6], !VIMAGE builds after FIB_ALGO addition to GENERIC 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c0d16218efa5db40b8e3f0a0326fb0438faa4a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:24 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=2c0d16218efa5db40b8e3f0a0326fb0438faa4a1 commit 2c0d16218efa5db40b8e3f0a0326fb0438faa4a1 Author: Alexander V. Chernikov AuthorDate: 2021-04-21 04:52:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:32 +0000 Fix NOINET[6],!VIMAGE builds after FIB_ALGO addition to GENERIC Reported by: jbeich PR: 255390 (cherry picked from commit 7d222ce3c10bdc23c8dc92d6b13e376ede5840d5) --- sys/net/route/fib_algo.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 83fff1ec43e0..5dff2690454d 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -108,19 +108,19 @@ SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, /* Algorithm sync policy */ /* Time interval to bucket updates */ -VNET_DEFINE(unsigned int, bucket_time_ms) = 50; -#define V_bucket_time_ms VNET(bucket_time_ms) +VNET_DEFINE_STATIC(unsigned int, update_bucket_time_ms) = 50; +#define V_update_bucket_time_ms VNET(update_bucket_time_ms) SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_time_ms, CTLFLAG_RW | CTLFLAG_VNET, - &VNET_NAME(bucket_time_ms), 0, "Time interval to calculate update rate"); + &VNET_NAME(update_bucket_time_ms), 0, "Time interval to calculate update rate"); /* Minimum update rate to delay sync */ -VNET_DEFINE(unsigned int, bucket_change_threshold_rate) = 500; +VNET_DEFINE_STATIC(unsigned int, bucket_change_threshold_rate) = 500; #define V_bucket_change_threshold_rate VNET(bucket_change_threshold_rate) SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_change_threshold_rate, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(bucket_change_threshold_rate), 0, "Minimum update rate to delay sync"); /* Max allowed delay to sync */ -VNET_DEFINE(unsigned int, fib_max_sync_delay_ms) = 1000; +VNET_DEFINE_STATIC(unsigned int, fib_max_sync_delay_ms) = 1000; #define V_fib_max_sync_delay_ms VNET(fib_max_sync_delay_ms) SYSCTL_UINT(_net_route_algo, OID_AUTO, fib_max_sync_delay_ms, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(fib_max_sync_delay_ms), 0, "Maximum time to delay sync (ms)"); @@ -589,7 +589,7 @@ update_rebuild_delay(struct fib_data *fd, enum fib_callout_action action) struct timeval tv; /* Fetch all variables at once to ensure consistent reads */ - uint32_t bucket_time_ms = V_bucket_time_ms; + uint32_t bucket_time_ms = V_update_bucket_time_ms; uint32_t threshold_rate = V_bucket_change_threshold_rate; uint32_t max_delay_ms = V_fib_max_sync_delay_ms; @@ -1618,10 +1618,14 @@ static struct fib_dp ** get_family_dp_ptr(int family) { switch (family) { +#ifdef INET case AF_INET: return (&V_inet_dp); +#endif +#ifdef INET6 case AF_INET6: return (&V_inet6_dp); +#endif } return (NULL); } From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8541C5FEE5D; Thu, 29 Apr 2021 09:17: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 4FW8z91KfTz4Tt7; Thu, 29 Apr 2021 09:17: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 09FFD1AB0F; Thu, 29 Apr 2021 09:17: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 13T9HO4G032760; Thu, 29 Apr 2021 09:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HOMW032759; Thu, 29 Apr 2021 09:17:24 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:24 GMT Message-Id: <202104290917.13T9HOMW032759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 59b3b210a69e - stable/13 - [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/stable/13 X-Git-Reftype: branch X-Git-Commit: 59b3b210a69e5eda9e36aac740c2a8da0bf39409 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:25 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=59b3b210a69e5eda9e36aac740c2a8da0bf39409 commit 59b3b210a69e5eda9e36aac740c2a8da0bf39409 Author: Alexander V. Chernikov AuthorDate: 2021-04-27 08:23:29 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:32 +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 (cherry picked from commit 439d087d0b55574db81f4a2799a411c1236d95e3) --- 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-all@freebsd.org Thu Apr 29 09:17:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C8A15FEF04; Thu, 29 Apr 2021 09:17: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 4FW8z56RFBz4VLk; Thu, 29 Apr 2021 09: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 AD5831AA48; Thu, 29 Apr 2021 09: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 13T9HLDR032695; Thu, 29 Apr 2021 09: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 13T9HL6u032694; Thu, 29 Apr 2021 09:17:21 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:21 GMT Message-Id: <202104290917.13T9HL6u032694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 1899138d5ad5 - stable/13 - Fix rib generation count for fib algo. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1899138d5ad54a878435b503df8953afe8ab451d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:22 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=1899138d5ad54a878435b503df8953afe8ab451d commit 1899138d5ad54a878435b503df8953afe8ab451d Author: Alexander V. Chernikov AuthorDate: 2021-04-17 18:58:12 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:32 +0000 Fix rib generation count for fib algo. Currently, PCB caching mechanism relies on the rib generation counter (rnh_gen) to invalidate cached nhops/LLE entries. With certain fib algorithms, it is now possible that the datapath lookup state applies RIB changes with some delay. In that scenario, PCB cache will invalidate on the RIB change, but the new lookup may result in the same nexthop being returned. When fib algo finally gets in sync with the RIB changes, PCB cache will not receive any notification and will end up caching the stale data. To fix this, introduce additional counter, rnh_gen_rib, which is used only when FIB_ALGO is enabled. This counter is incremented by the control plane. Each time when fib algo synchronises with the RIB, it updates rnh_gen to the current rnh_gen_rib value. Differential Revision: https://reviews.freebsd.org/D29812 Reviewed by: donner MFC after: 2 weeks (cherry picked from commit 33cb3cb2e3212705b10e7885b37f70a3c2987c9e) --- sys/net/route/fib_algo.c | 13 ++++++++++++- sys/net/route/route_ctl.c | 6 +++--- sys/net/route/route_var.h | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 171fa2cfb2dd..43db482d73da 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -527,6 +527,13 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) } } +static void +sync_rib_gen(struct fib_data *fd) +{ + FD_PRINTF(LOG_DEBUG, fd, "Sync gen %u -> %u", fd->fd_rh->rnh_gen, fd->fd_rh->rnh_gen_rib); + fd->fd_rh->rnh_gen = fd->fd_rh->rnh_gen_rib; +} + static int64_t get_tv_diff_ms(const struct timeval *old_tv, const struct timeval *new_tv) { @@ -682,6 +689,7 @@ apply_rtable_changes(struct fib_data *fd) result = fd->fd_flm->flm_change_rib_items_cb(fd->fd_rh, q, fd->fd_algo_data); if (result == FLM_SUCCESS) { + sync_rib_gen(fd); for (int i = 0; i < q->count; i++) if (q->entries[i].nh_old) fib_unref_nhop(fd, q->entries[i].nh_old); @@ -813,6 +821,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, switch (result) { case FLM_SUCCESS: + sync_rib_gen(fd); /* Unref old nexthop on success */ if (rc->rc_nh_old != NULL) fib_unref_nhop(fd, rc->rc_nh_old); @@ -1238,7 +1247,9 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); if ((result == FLM_SUCCESS) && attach) { - if (!fib_set_datapath_ptr(new_fd, &new_fd->fd_dp)) + if (fib_set_datapath_ptr(new_fd, &new_fd->fd_dp)) + sync_rib_gen(new_fd); + else result = FLM_REBUILD; } diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index af3853041ac6..2ec25c94299d 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -811,7 +811,7 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info rt->rte_flags &= ~RTF_UP; /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); rnh->rnh_prefixes--; rc->rc_cmd = RTM_DELETE; @@ -1073,7 +1073,7 @@ add_route_nhop(struct rib_head *rnh, struct rtentry *rt, tmproutes_update(rnh, rt); /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); rnh->rnh_prefixes++; rc->rc_cmd = RTM_ADD; @@ -1129,7 +1129,7 @@ change_route_nhop(struct rib_head *rnh, struct rtentry *rt, } /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); if (rnd->rnd_nhop == NULL) rnh->rnh_prefixes--; diff --git a/sys/net/route/route_var.h b/sys/net/route/route_var.h index 427c286a5090..f12931476fd3 100644 --- a/sys/net/route/route_var.h +++ b/sys/net/route/route_var.h @@ -60,7 +60,7 @@ struct rib_head { rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ rnh_preadd_entry_f_t *rnh_preadd; /* hook to alter record prior to insertion */ - rt_gen_t rnh_gen; /* generation counter */ + rt_gen_t rnh_gen; /* datapath generation counter */ int rnh_multipath; /* multipath capable ? */ struct radix_node rnh_nodes[3]; /* empty tree for common case */ struct rmlock rib_lock; /* config/data path lock */ @@ -71,6 +71,9 @@ 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 uint32_t rib_dying:1; /* rib is detaching */ uint32_t rib_algo_fixed:1;/* fixed algorithm */ struct nh_control *nh_control; /* nexthop subsystem data */ @@ -116,6 +119,16 @@ CHK_STRUCT_ROUTE_FIELDS(_ro_new); \ _Static_assert(__offsetof(struct route, ro_dst) == __offsetof(_ro_new, _dst_new),\ "ro_dst and " #_dst_new " are at different offset") +static inline void +rib_bump_gen(struct rib_head *rnh) +{ +#ifdef FIB_ALGO + rnh->rnh_gen_rib++; +#else + rnh->rnh_gen++; +#endif +} + struct rib_head *rt_tables_get_rnh(uint32_t table, sa_family_t family); int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum); struct rib_cmd_info; From owner-dev-commits-src-all@freebsd.org Thu Apr 29 09:17:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05EA15FEE56; Thu, 29 Apr 2021 09:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FW8z66CFfz4VLm; Thu, 29 Apr 2021 09:17: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 BB6F61AC87; Thu, 29 Apr 2021 09:17: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 13T9HMZN032718; Thu, 29 Apr 2021 09:17:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13T9HMvh032717; Thu, 29 Apr 2021 09:17:22 GMT (envelope-from git) Date: Thu, 29 Apr 2021 09:17:22 GMT Message-Id: <202104290917.13T9HMvh032717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a423e945c70b - stable/13 - Fix NOINET[6] build after enabling FIB_ALGO in GENERIC. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a423e945c70b55d449d155997ec3d8d0e2cb6716 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 09:17:23 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a423e945c70b55d449d155997ec3d8d0e2cb6716 commit a423e945c70b55d449d155997ec3d8d0e2cb6716 Author: Alexander V. Chernikov AuthorDate: 2021-04-21 01:45:49 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-29 08:47:32 +0000 Fix NOINET[6] build after enabling FIB_ALGO in GENERIC. Submitted by: jbeich PR: 255389 (cherry picked from commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6) --- sys/net/route/fib_algo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 43db482d73da..83fff1ec43e0 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -706,12 +706,16 @@ fill_change_entry(struct fib_data *fd, struct fib_change_entry *ce, struct rib_c int plen = 0; switch (fd->fd_family) { +#ifdef INET case AF_INET: rt_get_inet_prefix_plen(rc->rc_rt, &ce->addr4, &plen, &ce->scopeid); break; +#endif +#ifdef INET6 case AF_INET6: rt_get_inet6_prefix_plen(rc->rc_rt, &ce->addr6, &plen, &ce->scopeid); break; +#endif } ce->plen = plen; From owner-dev-commits-src-all@freebsd.org Thu Apr 29 12:34:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 13:10:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 13:27:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 13:39:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77EFD6287F2; Thu, 29 Apr 2021 13:39: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 4FWGnK2vTgz4g1R; Thu, 29 Apr 2021 13:39: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 567CB1CC56; Thu, 29 Apr 2021 13:39: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 13TDdH2m070777; Thu, 29 Apr 2021 13:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDdHIb070776; Thu, 29 Apr 2021 13:39:17 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:39:17 GMT Message-Id: <202104291339.13TDdHIb070776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e0ae2b39aa3e - stable/13 - pmc_allocate(3): document the count argument 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e0ae2b39aa3e51b0e3f7b9661192cba8f06e7b10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:39:17 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e0ae2b39aa3e51b0e3f7b9661192cba8f06e7b10 commit e0ae2b39aa3e51b0e3f7b9661192cba8f06e7b10 Author: Mitchell Horne AuthorDate: 2021-04-21 20:27:49 +0000 Commit: Mitchell Horne CommitDate: 2021-04-29 13:13:57 +0000 pmc_allocate(3): document the count argument This was added in b2ca2e50b9aa, and serves to provide an initial value to the PMC, eliminating the need for a second syscall via pmc_set(3). Reviewed by: gnn, 0mp (manpages) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29885 (cherry picked from commit 50f6c139970084adeefec98c658645c34b72209e) --- lib/libpmc/pmc_allocate.3 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/libpmc/pmc_allocate.3 b/lib/libpmc/pmc_allocate.3 index 291ca8ac0113..515b427cf7bc 100644 --- a/lib/libpmc/pmc_allocate.3 +++ b/lib/libpmc/pmc_allocate.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2008 +.Dd April 21, 2021 .Dt PMC_ALLOCATE 3 .Os .Sh NAME @@ -41,6 +41,7 @@ .Fa "uint32_t flags" .Fa "int cpu" .Fa "pmc_id_t *pmcid" +.Fa "uint64_t count" .Fc .Ft int .Fn pmc_release "pmc_id_t pmc" @@ -111,6 +112,20 @@ Process scope PMC allocations should specify the constant .Dv PMC_CPU_ANY for this argument. .Pp +The +.Fa count +argument behaves identically to the +.Xr pmc_set 3 +function's +.Fa value +argument. +For counting PMCs, +.Fa count +specifies the initial value of the allocated PMC. +For sampling PMCs, +.Fa count +specifies the reload count. +.Pp Function .Fn pmc_release releases the PMC denoted by argument From owner-dev-commits-src-all@freebsd.org Thu Apr 29 13:39:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 245BD628C01; Thu, 29 Apr 2021 13:39: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 4FWGnM6T10z4fyg; Thu, 29 Apr 2021 13:39: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 B70611CA4B; Thu, 29 Apr 2021 13:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13TDdJe1070823; Thu, 29 Apr 2021 13:39:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDdJ1x070822; Thu, 29 Apr 2021 13:39:19 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:39:19 GMT Message-Id: <202104291339.13TDdJ1x070822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d87ee7b97fe8 - stable/13 - pmcstat: fix the usage message for -t 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:39:20 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 commit d87ee7b97fe8177f7374e7e8c053f0614c1ddbf0 Author: Mitchell Horne AuthorDate: 2021-04-21 20:44:52 +0000 Commit: Mitchell Horne CommitDate: 2021-04-29 13:21:19 +0000 pmcstat: fix the usage message for -t A slight mix-up of the flags means this case isn't triggered when it should be. Now, `pmcstat -s event -t 1234` will print the correct error message. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit c4473add1d3d588d8747cab86796d2f2d4c8847c) --- usr.sbin/pmcstat/pmcstat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index b7f6c5e0f63e..997005cec269 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -898,7 +898,8 @@ main(int argc, char **argv) pmcstat_show_usage(); /* check for -t pid without a process PMC spec */ - if ((args.pa_required & FLAG_HAS_TARGET) && + if ((args.pa_flags & FLAG_HAS_TARGET) && + (args.pa_required & FLAG_HAS_PROCESS_PMCS) && (args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0) errx(EX_USAGE, "ERROR: option -t requires a process mode PMC to be specified." From owner-dev-commits-src-all@freebsd.org Thu Apr 29 13:39:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E909F628857; Thu, 29 Apr 2021 13:39: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 4FWGnL4mM5z4fwS; Thu, 29 Apr 2021 13:39: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 8C0D61CC57; Thu, 29 Apr 2021 13:39: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 13TDdIEw070798; Thu, 29 Apr 2021 13:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TDdIAj070797; Thu, 29 Apr 2021 13:39:18 GMT (envelope-from git) Date: Thu, 29 Apr 2021 13:39:18 GMT Message-Id: <202104291339.13TDdIAj070797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 112e30301846 - stable/13 - pmcstat: set initial counter value to zero 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 112e30301846d8fede4679a3f95e18820d721bbd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 13:39:19 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=112e30301846d8fede4679a3f95e18820d721bbd commit 112e30301846d8fede4679a3f95e18820d721bbd Author: Mitchell Horne AuthorDate: 2021-04-21 20:28:12 +0000 Commit: Mitchell Horne CommitDate: 2021-04-29 13:19:20 +0000 pmcstat: set initial counter value to zero For an infrequent event, pmcstat may report (u_long)-1 for CPUs where the counter was never incremented. Just set this to zero, instead. ev->ev_count is passed as the 'count' argument to pmc_allocate(3), but this wasn't always the case. Reviewed by: gnn MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29887 (cherry picked from commit edcf9e59c356525632dd2546d72916aeca609a2b) --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 688a98843652..b7f6c5e0f63e 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -675,7 +675,7 @@ main(int argc, char **argv) if (option == 'S' || option == 'P') ev->ev_count = current_sampling_count ? current_sampling_count : pmc_pmu_sample_rate_get(ev->ev_spec); else - ev->ev_count = -1; + ev->ev_count = 0; if (option == 'S' || option == 's') ev->ev_cpu = CPU_FFS(&cpumask) - 1; From owner-dev-commits-src-all@freebsd.org Thu Apr 29 13:53:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 14:07:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 14:14:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81E1862997D for ; Thu, 29 Apr 2021 14:14:45 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 4FWHZD11Mnz4h8m for ; Thu, 29 Apr 2021 14:14:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f54.google.com with SMTP id k128so35952911wmk.4 for ; Thu, 29 Apr 2021 07:14:43 -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=dW/PAhxisYkTQNwOSHTcXNL6epwETktW7BmFFFbRAS+ZA70bgmSM6Ot2ZWkz3jklHX PEYsEETeBkrWEhUJYM5bklPberyAaxImtZQjQkYRC09e5/5LqLrGauAQNYL5TEgyrq4o q1Vo/T7I1z6I4pKuBYw0rEsVIIXvVFljVxNVtoRCihb45W7fVwHVIoKN5GqQXvoCcJ3o iCJQi0o33QnH511gyiLNBgzM7U1uuxfVz6VP82T39m9qA4Gs6bSOWz8o11t+OaVgn/9L RZop89e3mYy+flsJPhqbiZYoDiWclXeaqPLXuURmrmbvJp6PXpFtCYlG/pZuOwpgLOIL Rszw== X-Gm-Message-State: AOAM5332QA1iPr0h6tQqjEtDo0chmGUACpN1tqMNSZcC3pC43pcF/jAo Q1+io6ZZVy5Pavr5ksn+ePk9Gg== 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: 4FWHZD11Mnz4h8m 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.54 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]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.128.54:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.128.54:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.54:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.54:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:14:45 -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-all@freebsd.org Thu Apr 29 14:24:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C3462A141; Thu, 29 Apr 2021 14:24: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 4FWHnR2Vpcz4hJW; Thu, 29 Apr 2021 14:24: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 481D01D25E; Thu, 29 Apr 2021 14:24: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 13TEORGm035241; Thu, 29 Apr 2021 14:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TEORtA035240; Thu, 29 Apr 2021 14:24:27 GMT (envelope-from git) Date: Thu, 29 Apr 2021 14:24:27 GMT Message-Id: <202104291424.13TEORtA035240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b0ad62ff6fd1 - stable/13 - Add some regression tests for O_PATH and AT_EMPTY_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0ad62ff6fd17a061011cd8af8e39793cb93de5f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 14:24:27 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b0ad62ff6fd17a061011cd8af8e39793cb93de5f commit b0ad62ff6fd17a061011cd8af8e39793cb93de5f Author: Mark Johnston AuthorDate: 2021-04-15 13:40:57 +0000 Commit: Mark Johnston CommitDate: 2021-04-29 14:22:43 +0000 Add some regression tests for O_PATH and AT_EMPTY_PATH Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29719 (cherry picked from commit 3a248c84419d4f7d6617d30744ab56d0b456fe03) --- tests/sys/file/Makefile | 1 + tests/sys/file/path_test.c | 778 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 779 insertions(+) diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile index ed2d2c4fbe2e..46a6a9544c62 100644 --- a/tests/sys/file/Makefile +++ b/tests/sys/file/Makefile @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/file BINDIR= ${TESTSDIR} +ATF_TESTS_C+= path_test TAP_TESTS_C+= closefrom_test TAP_TESTS_C+= dup_test TAP_TESTS_C+= fcntlflags_test diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c new file mode 100644 index 000000000000..a8354f88b091 --- /dev/null +++ b/tests/sys/file/path_test.c @@ -0,0 +1,778 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * 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. + */ + +/* + * Basic regression tests for handling of O_PATH descriptors. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define FMT_ERR(s) s ": %s", strerror(errno) + +#define CHECKED_CLOSE(fd) \ + ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close")) + +/* Create a temporary regular file containing some data. */ +static void +mktfile(char path[PATH_MAX], const char *template) +{ + char buf[BUFSIZ]; + int fd; + + snprintf(path, PATH_MAX, "%s", template); + fd = mkstemp(path); + ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("mkstemp")); + memset(buf, 0, sizeof(buf)); + ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) == sizeof(buf), + FMT_ERR("write")); + CHECKED_CLOSE(fd); +} + +/* Make a temporary directory. */ +static void +mktdir(char path[PATH_MAX], const char *template) +{ + snprintf(path, PATH_MAX, "%s", template); + ATF_REQUIRE_MSG(mkdtemp(path) == path, FMT_ERR("mkdtemp")); +} + +/* Wait for a child process to exit with status 0. */ +static void +waitchild(pid_t child, int exstatus) +{ + int error, status; + + error = waitpid(child, &status, 0); + ATF_REQUIRE_MSG(error != -1, FMT_ERR("waitpid")); + ATF_REQUIRE_MSG(WIFEXITED(status), "child exited abnormally, status %d", + status); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == exstatus, + "child exit status is %d, expected %d", + WEXITSTATUS(status), exstatus); +} + +ATF_TC_WITHOUT_HEAD(path_access); +ATF_TC_BODY(path_access, tc) +{ + char path[PATH_MAX]; + struct stat sb; + struct timespec ts[2]; + struct timeval tv[2]; + int pathfd; + + mktfile(path, "path_access.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + ATF_REQUIRE_ERRNO(EBADF, fchmod(pathfd, 0666) == -1); + ATF_REQUIRE_ERRNO(EBADF, fchown(pathfd, getuid(), getgid()) == -1); + ATF_REQUIRE_ERRNO(EBADF, fchflags(pathfd, UF_NODUMP) == -1); + memset(tv, 0, sizeof(tv)); + ATF_REQUIRE_ERRNO(EBADF, futimes(pathfd, tv) == -1); + memset(ts, 0, sizeof(ts)); + ATF_REQUIRE_ERRNO(EBADF, futimens(pathfd, ts) == -1); + + /* fpathconf(2) and fstat(2) are permitted. */ + ATF_REQUIRE_MSG(fstat(pathfd, &sb) == 0, FMT_ERR("fstat")); + ATF_REQUIRE_MSG(fpathconf(pathfd, _PC_LINK_MAX) != -1, + FMT_ERR("fpathconf")); + + CHECKED_CLOSE(pathfd); +} + +/* Basic tests to verify that AIO operations fail. */ +ATF_TC_WITHOUT_HEAD(path_aio); +ATF_TC_BODY(path_aio, tc) +{ + struct aiocb aio; + char buf[BUFSIZ], path[PATH_MAX]; + int pathfd; + + mktfile(path, "path_aio.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + memset(&aio, 0, sizeof(aio)); + aio.aio_buf = buf; + aio.aio_nbytes = sizeof(buf); + aio.aio_fildes = pathfd; + aio.aio_offset = 0; + + ATF_REQUIRE_ERRNO(EBADF, aio_read(&aio) == -1); + ATF_REQUIRE_ERRNO(EBADF, aio_write(&aio) == -1); + ATF_REQUIRE_ERRNO(EBADF, aio_fsync(O_SYNC, &aio) == -1); + ATF_REQUIRE_ERRNO(EBADF, aio_fsync(O_DSYNC, &aio) == -1); + + CHECKED_CLOSE(pathfd); +} + +/* Basic tests to verify that Capsicum restrictions apply to path fds. */ +ATF_TC_WITHOUT_HEAD(path_capsicum); +ATF_TC_BODY(path_capsicum, tc) +{ + char path[PATH_MAX]; + cap_rights_t rights; + int truefd; + pid_t child; + + mktfile(path, "path_capsicum.XXXXXX"); + + /* Make sure that filesystem namespace restrictions apply to O_PATH. */ + child = fork(); + ATF_REQUIRE_MSG(child != -1, FMT_ERR("fork")); + if (child == 0) { + if (cap_enter() != 0) + _exit(1); + if (open(path, O_PATH) >= 0) + _exit(2); + if (errno != ECAPMODE) + _exit(3); + if (open("/usr/bin/true", O_PATH | O_EXEC) >= 0) + _exit(4); + if (errno != ECAPMODE) + _exit(5); + _exit(0); + } + waitchild(child, 0); + + /* Make sure that CAP_FEXECVE is required. */ + child = fork(); + ATF_REQUIRE_MSG(child != -1, FMT_ERR("fork")); + if (child == 0) { + truefd = open("/usr/bin/true", O_PATH | O_EXEC); + if (truefd < 0) + _exit(1); + cap_rights_init(&rights); + if (cap_rights_limit(truefd, &rights) != 0) + _exit(2); + (void)fexecve(truefd, + (char * const[]){__DECONST(char *, "/usr/bin/true"), NULL}, + NULL); + if (errno != ENOTCAPABLE) + _exit(3); + _exit(4); + } + waitchild(child, 4); +} + +/* Verify operations on directory path descriptors. */ +ATF_TC_WITHOUT_HEAD(path_directory); +ATF_TC_BODY(path_directory, tc) +{ + struct dirent de; + struct stat sb; + char path[PATH_MAX]; + int fd, pathfd; + + mktdir(path, "path_directory.XXXXXX"); + + pathfd = open(path, O_PATH | O_DIRECTORY); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* Should not be possible to list directory entries. */ + ATF_REQUIRE_ERRNO(EBADF, + getdirentries(pathfd, (char *)&de, sizeof(de), NULL) == -1); + + /* It should be possible to create files under pathfd. */ + fd = openat(pathfd, "test", O_RDWR | O_CREAT, 0600); + ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open")); + ATF_REQUIRE_MSG(fstatat(pathfd, "test", &sb, 0) == 0, + FMT_ERR("fstatat")); + CHECKED_CLOSE(fd); + + /* ... but doing so requires write access. */ + if (geteuid() != 0) { + ATF_REQUIRE_ERRNO(EBADF, fchmod(pathfd, 0500) == -1); + ATF_REQUIRE_MSG(chmod(path, 0500) == 0, FMT_ERR("chmod")); + ATF_REQUIRE_ERRNO(EACCES, + openat(pathfd, "test2", O_RDWR | O_CREAT, 0600) < 0); + } + + /* fchdir(2) is permitted. */ + ATF_REQUIRE_MSG(fchdir(pathfd) == 0, FMT_ERR("fchdir")); + + CHECKED_CLOSE(pathfd); +} + +/* Verify access permission checking for a directory path fd. */ +ATF_TC_WITH_CLEANUP(path_directory_not_root); +ATF_TC_HEAD(path_directory_not_root, tc) +{ + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(path_directory_not_root, tc) +{ + char path[PATH_MAX]; + int pathfd; + + mktdir(path, "path_directory.XXXXXX"); + + pathfd = open(path, O_PATH | O_DIRECTORY); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + ATF_REQUIRE_ERRNO(EBADF, fchmod(pathfd, 0500) == -1); + ATF_REQUIRE_MSG(chmod(path, 0500) == 0, FMT_ERR("chmod")); + ATF_REQUIRE_ERRNO(EACCES, + openat(pathfd, "test2", O_RDWR | O_CREAT, 0600) < 0); + + CHECKED_CLOSE(pathfd); +} +ATF_TC_CLEANUP(path_directory_not_root, tc) +{ +} + +/* Validate system calls that handle AT_EMPTY_PATH. */ +ATF_TC_WITHOUT_HEAD(path_empty); +ATF_TC_BODY(path_empty, tc) +{ + char path[PATH_MAX]; + struct timespec ts[2]; + struct stat sb; + int pathfd; + + mktfile(path, "path_empty.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* Various *at operations should work on path fds. */ + ATF_REQUIRE_MSG(faccessat(pathfd, "", F_OK, AT_EMPTY_PATH) == 0, + FMT_ERR("faccessat")); + ATF_REQUIRE_MSG(chflagsat(pathfd, "", UF_NODUMP, AT_EMPTY_PATH) == 0, + FMT_ERR("chflagsat")); + ATF_REQUIRE_MSG(fchmodat(pathfd, "", 0600, AT_EMPTY_PATH) == 0, + FMT_ERR("fchmodat")); + ATF_REQUIRE_MSG(fchownat(pathfd, "", getuid(), getgid(), + AT_EMPTY_PATH) == 0, FMT_ERR("fchownat")); + ATF_REQUIRE_MSG(fstatat(pathfd, "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat")); + ATF_REQUIRE_MSG(sb.st_size == BUFSIZ, + "unexpected size %ju", (uintmax_t)sb.st_size); + memset(ts, 0, sizeof(ts)); + ATF_REQUIRE_MSG(utimensat(pathfd, "", ts, AT_EMPTY_PATH) == 0, + FMT_ERR("utimensat")); + + CHECKED_CLOSE(pathfd); +} + +/* Verify that various operations on a path fd have access checks. */ +ATF_TC_WITH_CLEANUP(path_empty_not_root); +ATF_TC_HEAD(path_empty_not_root, tc) +{ + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(path_empty_not_root, tc) +{ + int pathfd; + + pathfd = open("/dev/null", O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + ATF_REQUIRE_ERRNO(EPERM, + chflagsat(pathfd, "", UF_NODUMP, AT_EMPTY_PATH) == -1); + ATF_REQUIRE_ERRNO(EPERM, + fchownat(pathfd, "", getuid(), getgid(), AT_EMPTY_PATH) == -1); + ATF_REQUIRE_ERRNO(EPERM, + fchmodat(pathfd, "", 0600, AT_EMPTY_PATH) == -1); + ATF_REQUIRE_ERRNO(EPERM, + linkat(pathfd, "", AT_FDCWD, "test", AT_EMPTY_PATH) == -1); + + CHECKED_CLOSE(pathfd); +} +ATF_TC_CLEANUP(path_empty_not_root, tc) +{ +} + +/* Test linkat(2) with AT_EMPTY_PATH, which requires privileges. */ +ATF_TC_WITH_CLEANUP(path_empty_root); +ATF_TC_HEAD(path_empty_root, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(path_empty_root, tc) +{ + char path[PATH_MAX]; + struct stat sb, sb2; + int pathfd; + + mktfile(path, "path_empty_root.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + ATF_REQUIRE_MSG(fstatat(pathfd, "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat")); + + ATF_REQUIRE_MSG(linkat(pathfd, "", AT_FDCWD, "test", AT_EMPTY_PATH) == + 0, FMT_ERR("linkat")); + ATF_REQUIRE_MSG(fstatat(AT_FDCWD, "test", &sb2, 0) == 0, + FMT_ERR("fstatat")); + ATF_REQUIRE_MSG(sb.st_dev == sb2.st_dev, "st_dev mismatch"); + ATF_REQUIRE_MSG(sb.st_ino == sb2.st_ino, "st_ino mismatch"); + + CHECKED_CLOSE(pathfd); + +} +ATF_TC_CLEANUP(path_empty_root, tc) +{ +} + +/* poll(2) never returns an event for path fds, but kevent(2) does. */ +ATF_TC_WITHOUT_HEAD(path_event); +ATF_TC_BODY(path_event, tc) +{ + char buf[BUFSIZ], path[PATH_MAX]; + struct kevent ev; + struct pollfd pollfd; + int kq, pathfd; + + mktfile(path, "path_event.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* poll(2) should return POLLNVAL. */ + pollfd.fd = pathfd; + pollfd.events = POLLIN; + pollfd.revents = 0; + ATF_REQUIRE_MSG(poll(&pollfd, 1, 0) == 1, FMT_ERR("poll")); + ATF_REQUIRE_MSG(pollfd.revents == POLLNVAL, "unexpected revents %x", + pollfd.revents); + pollfd.events = POLLOUT; + pollfd.revents = 0; + ATF_REQUIRE_MSG(poll(&pollfd, 1, 0) == 1, FMT_ERR("poll")); + ATF_REQUIRE_MSG(pollfd.revents == POLLNVAL, "unexpected revents %x", + pollfd.revents); + + /* Try to get a EVFILT_READ event through a path fd. */ + kq = kqueue(); + ATF_REQUIRE_MSG(kq >= 0, FMT_ERR("kqueue")); + EV_SET(&ev, pathfd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0); + ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, + FMT_ERR("kevent")); + ATF_REQUIRE_MSG(kevent(kq, NULL, 0, &ev, 1, NULL) == 1, + FMT_ERR("kevent")); + ATF_REQUIRE_MSG((ev.flags & EV_ERROR) == 0, "EV_ERROR is set"); + ATF_REQUIRE_MSG(ev.data == sizeof(buf), + "data is %jd", (intmax_t)ev.data); + EV_SET(&ev, pathfd, EVFILT_READ, EV_DELETE, 0, 0, 0); + ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, + FMT_ERR("kevent")); + + /* Try to get a EVFILT_VNODE/NOTE_LINK event through a path fd. */ + EV_SET(&ev, pathfd, EVFILT_VNODE, EV_ADD | EV_ENABLE, NOTE_LINK, 0, 0); + ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, + FMT_ERR("kevent")); + ATF_REQUIRE_MSG(funlinkat(AT_FDCWD, path, pathfd, 0) == 0, + FMT_ERR("funlinkat")); + ATF_REQUIRE_MSG(kevent(kq, NULL, 0, &ev, 1, NULL) == 1, + FMT_ERR("kevent")); + EV_SET(&ev, pathfd, EVFILT_VNODE, EV_DELETE, 0, 0, 0); + ATF_REQUIRE_MSG(kevent(kq, &ev, 1, NULL, 0, NULL) == 0, + FMT_ERR("kevent")); + + CHECKED_CLOSE(kq); + CHECKED_CLOSE(pathfd); +} + +/* Check various fcntl(2) operations on a path desriptor. */ +ATF_TC_WITHOUT_HEAD(path_fcntl); +ATF_TC_BODY(path_fcntl, tc) +{ + char path[PATH_MAX]; + int flags, pathfd, pathfd2; + + mktfile(path, "path_fcntl.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* O_PATH should appear in the fd flags. */ + flags = fcntl(pathfd, F_GETFL); + ATF_REQUIRE_MSG(flags != -1, FMT_ERR("fcntl")); + ATF_REQUIRE_MSG((flags & O_PATH) != 0, "O_PATH not set"); + + ATF_REQUIRE_ERRNO(EBADF, + fcntl(pathfd, F_SETFL, flags & ~O_PATH)); + ATF_REQUIRE_ERRNO(EBADF, + fcntl(pathfd, F_SETFL, flags | O_APPEND)); + + /* A dup'ed O_PATH fd had better have O_PATH set too. */ + pathfd2 = fcntl(pathfd, F_DUPFD, 0); + ATF_REQUIRE_MSG(pathfd2 >= 0, FMT_ERR("fcntl")); + flags = fcntl(pathfd2, F_GETFL); + ATF_REQUIRE_MSG(flags != -1, FMT_ERR("fcntl")); + ATF_REQUIRE_MSG((flags & O_PATH) != 0, "O_PATH not set"); + CHECKED_CLOSE(pathfd2); + + /* Double check with dup(2). */ + pathfd2 = dup(pathfd); + ATF_REQUIRE_MSG(pathfd2 >= 0, FMT_ERR("dup")); + flags = fcntl(pathfd2, F_GETFL); + ATF_REQUIRE_MSG(flags != -1, FMT_ERR("fcntl")); + ATF_REQUIRE_MSG((flags & O_PATH) != 0, "O_PATH not set"); + CHECKED_CLOSE(pathfd2); + + /* It should be possible to set O_CLOEXEC. */ + ATF_REQUIRE_MSG(fcntl(pathfd, F_SETFD, FD_CLOEXEC) == 0, + FMT_ERR("fcntl")); + ATF_REQUIRE_MSG(fcntl(pathfd, F_GETFD) == FD_CLOEXEC, + FMT_ERR("fcntl")); + + CHECKED_CLOSE(pathfd); +} + +/* Verify that we can execute a file opened with O_PATH. */ +ATF_TC_WITHOUT_HEAD(path_fexecve); +ATF_TC_BODY(path_fexecve, tc) +{ + char path[PATH_MAX]; + pid_t child; + int fd, pathfd; + + child = fork(); + ATF_REQUIRE_MSG(child != -1, FMT_ERR("fork")); + if (child == 0) { + pathfd = open("/usr/bin/true", O_PATH | O_EXEC); + if (pathfd < 0) + _exit(1); + fexecve(pathfd, + (char * const[]){__DECONST(char *, "/usr/bin/true"), NULL}, + NULL); + _exit(2); + } + waitchild(child, 0); + + /* + * Also verify that access permissions are checked when opening with + * O_PATH. + */ + snprintf(path, sizeof(path), "path_fexecve.XXXXXX"); + ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); + + fd = open(path, O_CREAT | O_RDONLY, 0600); + ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open")); + + pathfd = open(path, O_PATH | O_EXEC); + ATF_REQUIRE_ERRNO(EACCES, pathfd < 0); +} + +/* Files may be unlinked using a path fd. */ +ATF_TC_WITHOUT_HEAD(path_funlinkat); +ATF_TC_BODY(path_funlinkat, tc) +{ + char path[PATH_MAX]; + struct stat sb; + int pathfd; + + mktfile(path, "path_rights.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + ATF_REQUIRE_MSG(funlinkat(AT_FDCWD, path, pathfd, 0) == 0, + FMT_ERR("funlinkat")); + ATF_REQUIRE_ERRNO(ENOENT, stat(path, &sb) == -1); + + CHECKED_CLOSE(pathfd); +} + +/* Verify that various I/O operations fail on an O_PATH descriptor. */ +ATF_TC_WITHOUT_HEAD(path_io); +ATF_TC_BODY(path_io, tc) +{ + char path[PATH_MAX], path2[PATH_MAX]; + char buf[BUFSIZ]; + struct iovec iov; + int error, fd, pathfd, sd[2]; + + /* It shouldn't be possible to create new files with O_PATH. */ + snprintf(path, sizeof(path), "path_io.XXXXXX"); + ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); + ATF_REQUIRE_ERRNO(ENOENT, open(path, O_PATH | O_CREAT, 0600) < 0); + + /* Create a non-empty file for use in the rest of the tests. */ + mktfile(path, "path_io.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* Make sure that basic I/O operations aren't possible. */ + iov.iov_base = path; + iov.iov_len = strlen(path); + ATF_REQUIRE_ERRNO(EBADF, + write(pathfd, iov.iov_base, iov.iov_len) == -1); + ATF_REQUIRE_ERRNO(EBADF, + pwrite(pathfd, iov.iov_base, iov.iov_len, 0) == -1); + ATF_REQUIRE_ERRNO(EBADF, + writev(pathfd, &iov, 1) == -1); + ATF_REQUIRE_ERRNO(EBADF, + pwritev(pathfd, &iov, 1, 0) == -1); + ATF_REQUIRE_ERRNO(EBADF, + read(pathfd, path, 1) == -1); + ATF_REQUIRE_ERRNO(EBADF, + pread(pathfd, path, 1, 0) == -1); + ATF_REQUIRE_ERRNO(EBADF, + readv(pathfd, &iov, 1) == -1); + ATF_REQUIRE_ERRNO(EBADF, + preadv(pathfd, &iov, 1, 0) == -1); + + /* copy_file_range() should not be permitted. */ + mktfile(path2, "path_io.XXXXXX"); + fd = open(path2, O_RDWR); + ATF_REQUIRE_ERRNO(EBADF, + copy_file_range(fd, NULL, pathfd, NULL, sizeof(buf), 0) == -1); + ATF_REQUIRE_ERRNO(EBADF, + copy_file_range(pathfd, NULL, fd, NULL, sizeof(buf), 0) == -1); + CHECKED_CLOSE(fd); + + /* sendfile() should not be permitted. */ + ATF_REQUIRE_MSG(socketpair(PF_LOCAL, SOCK_STREAM, 0, sd) == 0, + FMT_ERR("socketpair")); + ATF_REQUIRE_ERRNO(EBADF, + sendfile(pathfd, sd[0], 0, 0, NULL, NULL, 0)); + CHECKED_CLOSE(sd[0]); + CHECKED_CLOSE(sd[1]); + + /* No seeking. */ + ATF_REQUIRE_ERRNO(ESPIPE, + lseek(pathfd, 0, SEEK_SET) == -1); + + /* No operations on the file extent. */ + ATF_REQUIRE_ERRNO(EINVAL, + ftruncate(pathfd, 0) == -1); + error = posix_fallocate(pathfd, 0, sizeof(buf) * 2); + ATF_REQUIRE_MSG(error == ESPIPE, "posix_fallocate() returned %d", error); + error = posix_fadvise(pathfd, 0, sizeof(buf), POSIX_FADV_NORMAL); + ATF_REQUIRE_MSG(error == ESPIPE, "posix_fadvise() returned %d", error); + + /* mmap() is not allowed. */ + ATF_REQUIRE_ERRNO(ENODEV, + mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, pathfd, 0) == + MAP_FAILED); + ATF_REQUIRE_ERRNO(ENODEV, + mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_SHARED, pathfd, 0) == + MAP_FAILED); + ATF_REQUIRE_ERRNO(ENODEV, + mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, pathfd, 0) == + MAP_FAILED); + + /* No fsync() or fdatasync(). */ + ATF_REQUIRE_ERRNO(EBADF, fsync(pathfd) == -1); + ATF_REQUIRE_ERRNO(EBADF, fdatasync(pathfd) == -1); + + CHECKED_CLOSE(pathfd); +} + +/* ioctl(2) is not permitted on path fds. */ +ATF_TC_WITHOUT_HEAD(path_ioctl); +ATF_TC_BODY(path_ioctl, tc) +{ + char path[PATH_MAX]; + struct mem_extract me; + int pathfd, val; + + mktfile(path, "path_ioctl.XXXXXX"); + + /* Standard file descriptor ioctls should fail. */ + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + val = 0; + ATF_REQUIRE_ERRNO(EBADF, ioctl(pathfd, FIONBIO, &val) == -1); + ATF_REQUIRE_ERRNO(EBADF, ioctl(pathfd, FIONREAD, &val) == -1); + ATF_REQUIRE_ERRNO(EBADF, ioctl(pathfd, FIONWRITE, &val) == -1); + ATF_REQUIRE_ERRNO(EBADF, ioctl(pathfd, FIONSPACE, &val) == -1); + + CHECKED_CLOSE(pathfd); + + /* Device ioctls should fail. */ + pathfd = open("/dev/mem", O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + me.me_vaddr = (uintptr_t)&me; + ATF_REQUIRE_ERRNO(EBADF, ioctl(pathfd, MEM_EXTRACT_PADDR, &me) == -1); + + CHECKED_CLOSE(pathfd); +} + +ATF_TC_WITHOUT_HEAD(path_lock); +ATF_TC_BODY(path_lock, tc) +{ + char buf[BUFSIZ], path[PATH_MAX]; + struct flock flk; + int fd, pathfd; + + snprintf(path, sizeof(path), "path_rights.XXXXXX"); + fd = mkostemp(path, O_SHLOCK); + ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("mkostemp")); + memset(buf, 0, sizeof(buf)); + ATF_REQUIRE_MSG(write(fd, buf, sizeof(buf)) == sizeof(buf), + FMT_ERR("write()")); + + /* Verify that O_EXLOCK is ignored when combined with O_PATH. */ + pathfd = open(path, O_PATH | O_EXLOCK); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + CHECKED_CLOSE(fd); + + /* flock(2) is prohibited. */ + ATF_REQUIRE_ERRNO(EOPNOTSUPP, flock(pathfd, LOCK_SH) == -1); + ATF_REQUIRE_ERRNO(EOPNOTSUPP, flock(pathfd, LOCK_EX) == -1); + ATF_REQUIRE_ERRNO(EOPNOTSUPP, flock(pathfd, LOCK_SH | LOCK_NB) == -1); + ATF_REQUIRE_ERRNO(EOPNOTSUPP, flock(pathfd, LOCK_EX | LOCK_NB) == -1); + ATF_REQUIRE_ERRNO(EOPNOTSUPP, flock(pathfd, LOCK_UN) == -1); + + /* fcntl(2) file locks are prohibited. */ + memset(&flk, 0, sizeof(flk)); + flk.l_whence = SEEK_CUR; + ATF_REQUIRE_ERRNO(EBADF, fcntl(pathfd, F_GETLK, &flk) == -1); + flk.l_type = F_RDLCK; + ATF_REQUIRE_ERRNO(EBADF, fcntl(pathfd, F_SETLK, &flk) == -1); + ATF_REQUIRE_ERRNO(EBADF, fcntl(pathfd, F_SETLKW, &flk) == -1); + flk.l_type = F_WRLCK; + ATF_REQUIRE_ERRNO(EBADF, fcntl(pathfd, F_SETLK, &flk) == -1); + ATF_REQUIRE_ERRNO(EBADF, fcntl(pathfd, F_SETLKW, &flk) == -1); + + CHECKED_CLOSE(pathfd); +} + +/* Verify that we can send an O_PATH descriptor over a unix socket. */ +ATF_TC_WITHOUT_HEAD(path_rights); +ATF_TC_BODY(path_rights, tc) +{ + char path[PATH_MAX]; + struct cmsghdr *cmsg; + struct msghdr msg; + struct iovec iov; + int flags, pathfd, pathfd_copy, sd[2]; + char c; + + ATF_REQUIRE_MSG(socketpair(PF_LOCAL, SOCK_STREAM, 0, sd) == 0, + FMT_ERR("socketpair")); + + mktfile(path, "path_rights.XXXXXX"); + + pathfd = open(path, O_PATH); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + /* Package up the O_PATH and send it over the socket pair. */ + cmsg = malloc(CMSG_SPACE(sizeof(pathfd))); + ATF_REQUIRE_MSG(cmsg != NULL, FMT_ERR("malloc")); + + cmsg->cmsg_len = CMSG_LEN(sizeof(pathfd)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)(void *)CMSG_DATA(cmsg) = pathfd; + + c = 0; + iov.iov_base = &c; + iov.iov_len = 1; + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = cmsg; + msg.msg_controllen = CMSG_SPACE(sizeof(pathfd)); + + ATF_REQUIRE_MSG(sendmsg(sd[0], &msg, 0) == sizeof(c), + FMT_ERR("sendmsg")); + + /* Grab the pathfd copy from the other end of the pair. */ + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = cmsg; + msg.msg_controllen = CMSG_SPACE(sizeof(pathfd)); + + ATF_REQUIRE_MSG(recvmsg(sd[1], &msg, 0) == 1, + FMT_ERR("recvmsg")); + pathfd_copy = *(int *)(void *)CMSG_DATA(cmsg); + ATF_REQUIRE_MSG(pathfd_copy != pathfd, + "pathfd and pathfd_copy are equal"); + + /* Verify that the copy has O_PATH properties. */ + flags = fcntl(pathfd_copy, F_GETFL); + ATF_REQUIRE_MSG(flags != -1, FMT_ERR("fcntl")); + ATF_REQUIRE_MSG((flags & O_PATH) != 0, "O_PATH is not set"); + ATF_REQUIRE_ERRNO(EBADF, + read(pathfd_copy, &c, 1) == -1); + ATF_REQUIRE_ERRNO(EBADF, + write(pathfd_copy, &c, 1) == -1); + + CHECKED_CLOSE(pathfd); + CHECKED_CLOSE(pathfd_copy); + CHECKED_CLOSE(sd[0]); + CHECKED_CLOSE(sd[1]); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, path_access); + ATF_TP_ADD_TC(tp, path_aio); + ATF_TP_ADD_TC(tp, path_capsicum); + ATF_TP_ADD_TC(tp, path_directory); + ATF_TP_ADD_TC(tp, path_directory_not_root); + ATF_TP_ADD_TC(tp, path_empty); + ATF_TP_ADD_TC(tp, path_empty_not_root); + ATF_TP_ADD_TC(tp, path_empty_root); + ATF_TP_ADD_TC(tp, path_event); + ATF_TP_ADD_TC(tp, path_fcntl); + ATF_TP_ADD_TC(tp, path_fexecve); + ATF_TP_ADD_TC(tp, path_funlinkat); + ATF_TP_ADD_TC(tp, path_io); + ATF_TP_ADD_TC(tp, path_ioctl); + ATF_TP_ADD_TC(tp, path_lock); + ATF_TP_ADD_TC(tp, path_rights); + + return (atf_no_error()); +} From owner-dev-commits-src-all@freebsd.org Thu Apr 29 14:30:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 14:56:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:14:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A003D62DB7A for ; Thu, 29 Apr 2021 15:14:17 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 4FWJtx07hWz4n4y for ; Thu, 29 Apr 2021 15:14:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x834.google.com with SMTP id n22so9798635qtk.9 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=dmbuQ2pmUVgZhQtVoF6X6EuevxXPuvkDkmEwGSbiBy9qPEFpVgCr0OhFQKD6ILLLPx 7EpyTJ+TV3piAdF8nID7i+tbQcn8tHwB5dz84WHhfY8+LCwyN6nlajYbyPZbjyJ6ORSz IF+P37O+/jgc/pPh05PR+qFT0M4AJaCtcjnGqTcGmm3XZShcGBw0fwISlX0zRbQzisl1 429b2JC0gczHGTQN8r+b1qDKTvmut/ZIerGaCrjf7nI5Ift/mv9SZtxB94ajfvmaBboS 2Zf+oJOTZIQlhpEm4rvLYbUt+7RSZEbfohBUfQDH8lepeXH8I9N7Sp8bFPqKVvmTj9fl 10Yw== X-Gm-Message-State: AOAM531jPSc/Qa0lnGb/6qk7Y/KTUra1Ecegowtnv7+Ay45AeVhgvI/G EISR8O9MHevayyZ11UwlNbo4jA== 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: 4FWJtx07hWz4n4y 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::834 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:c]; 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::834: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-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::834:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::834:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:19:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:21:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:25:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:32:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C41962E545; Thu, 29 Apr 2021 15:32: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 4FWKHn2dJtz4p0m; Thu, 29 Apr 2021 15:32: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 4D1BE1DA1B; Thu, 29 Apr 2021 15:32: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 13TFWLx0032887; Thu, 29 Apr 2021 15:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFWL2l032886; Thu, 29 Apr 2021 15:32:21 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:32:21 GMT Message-Id: <202104291532.13TFWL2l032886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 5950b9cdbba2 - stable/13 - release.sh: Skip installing textproc/docproj when NODOC is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5950b9cdbba29ebd1b33be9e52cd9d26d732481b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:32:21 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=5950b9cdbba29ebd1b33be9e52cd9d26d732481b commit 5950b9cdbba29ebd1b33be9e52cd9d26d732481b Author: Glen Barber AuthorDate: 2021-02-03 00:04:11 +0000 Commit: Glen Barber CommitDate: 2021-04-29 15:24:03 +0000 release.sh: Skip installing textproc/docproj when NODOC is set PR: 253192 Submitted by: Yasuhiro Kimura Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 805e2876ec20f89e45f0f9f4164f31b6711ff0ea) --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 8294eaef6f00..58f946b9bba1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -326,7 +326,7 @@ extra_chroot_setup() { pkg clean -y fi fi - if [ -d ${CHROOTDIR}/usr/ports ]; then + if [ -z "${NODOC}" ] && [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) From owner-dev-commits-src-all@freebsd.org Thu Apr 29 15:39:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B83162E6E6 for ; Thu, 29 Apr 2021 15:39:02 +0000 (UTC) (envelope-from bounces+17430347-ff63-dev-commits-src-all=freebsd.org@em4937.fdc-k.co.ke) Received: from wrqvqzqh.outbound-mail.sendgrid.net (wrqvqzqh.outbound-mail.sendgrid.net [149.72.78.64]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWKRT5dgmz4nqR for ; Thu, 29 Apr 2021 15:39:01 +0000 (UTC) (envelope-from bounces+17430347-ff63-dev-commits-src-all=freebsd.org@em4937.fdc-k.co.ke) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fdc-k.co.ke; h=content-transfer-encoding:content-type:from:mime-version:subject:to: list-unsubscribe; s=s1; bh=O4xZ5LeibpFJDP/jQNA5KPOkCqy8YUhPT19zJEH0wLo=; b=hLgiJafekXsVRpK+nvAS0CTV63rAOTFQDcCUm9FVJOnj1TBA1AaDPwDWsAPrNyLylXRf N/LEM4jew+Kfga0D+aj/MP0R1qW7VfZswoJX4nDGPo5ebFtED/a20u0LLd7sHVr6XNPxik DzafVIlEgb9U9g7MP9KkxwwMGqlZIYfBw= Received: by filterdrecv-7d8df758bc-b7cn8 with SMTP id filterdrecv-7d8df758bc-b7cn8-1-608AD306-54 2021-04-29 15:38:46.362152568 +0000 UTC m=+66136.985597706 Received: from MTc0MzAzNDc (unknown) by geopod-ismtpd-5-0 (SG) with HTTP id bwZc3wQiRzmj1IdNRVWzWw Thu, 29 Apr 2021 15:38:46.200 +0000 (UTC) Date: Thu, 29 Apr 2021 15:39:00 +0000 (UTC) From: Jackson From FDC-K Africa Message-ID: Subject: Invitation to Project Monitoring and Evaluation with Data Management and Analysis Workshop X-SG-EID: =?us-ascii?Q?3wog+d5TzdhcwgBasJnObFyeAw+8wvDWF34iMoa8dWPJZAM+l4575dN+CbK4vY?= =?us-ascii?Q?kzb5GVXA0e4Q53if5FWzyj6KAQI5ypSAZo7RHtg?= =?us-ascii?Q?e6wQuCRWD15UhMP8vWjh745wtaGG+AvCeCZXF+I?= =?us-ascii?Q?nORpPm6mPCSS3mZDD9dyN4mK+r4qmBg+2Jw2Nkn?= =?us-ascii?Q?0PGDaEbwNIsjr1oT3aHdNJc81VnlUNsoURLnK+z?= =?us-ascii?Q?qdR+B9zDbPb9b3iTBVD=2F0YVkOpUUXBdsfDxfMNX?= =?us-ascii?Q?0E3JdBkYMbRZkS8FF7ArT24aVaxgJyhPcMuQfK6?= =?us-ascii?Q?hXs=3D?= To: dev-commits-src-all@freebsd.org X-Entity-ID: lgZohGoWIjvYsKzlUpYsxA== X-Rspamd-Queue-Id: 4FWKRT5dgmz4nqR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fdc-k.co.ke header.s=s1 header.b=hLgiJafe; dmarc=pass (policy=none) header.from=fdc-k.co.ke; spf=pass (mx1.freebsd.org: domain of bounces@em4937.fdc-k.co.ke designates 149.72.78.64 as permitted sender) smtp.mailfrom=bounces@em4937.fdc-k.co.ke X-Spamd-Result: default: False [-2.41 / 15.00]; R_SPF_ALLOW(-0.20)[+ip4:149.72.0.0/16:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[fdc-k.co.ke:+]; DMARC_POLICY_ALLOW(-0.50)[fdc-k.co.ke,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[Jackson@fdc-k.co.ke,bounces@em4937.fdc-k.co.ke]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[149.72.78.64:from]; ASN(0.00)[asn:11377, ipnet:149.72.64.0/19, country:US]; MIME_TRACE(0.00)[0:~]; TAGGED_FROM(0.00)[17430347-ff63-dev-commits-src-all=freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[fdc-k.co.ke:s=s1]; FROM_NEQ_ENVFROM(0.00)[Jackson@fdc-k.co.ke,bounces@em4937.fdc-k.co.ke]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[149.72.78.64:from:127.0.2.255]; MIME_HTML_ONLY(0.20)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[149.72.78.64:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:39:02 -0000 From owner-dev-commits-src-all@freebsd.org Thu Apr 29 15:42:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 15:57:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2534F62F27D; Thu, 29 Apr 2021 15:57: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 4FWKrJ6tpYz4ptK; Thu, 29 Apr 2021 15: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 DCFD11DFF6; Thu, 29 Apr 2021 15: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 13TFv41V059200; Thu, 29 Apr 2021 15: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 13TFv4tu059199; Thu, 29 Apr 2021 15:57:04 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:57:04 GMT Message-Id: <202104291557.13TFv4tu059199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 5a3548f2e28a - stable/13 - release: do not set __MAKE_CONF and SRCCONF for the chroot build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a3548f2e28a7240138ea714e31ae9089f8a80be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:57:05 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=5a3548f2e28a7240138ea714e31ae9089f8a80be commit 5a3548f2e28a7240138ea714e31ae9089f8a80be Author: Glen Barber AuthorDate: 2021-03-16 16:01:48 +0000 Commit: Glen Barber CommitDate: 2021-04-29 15:45:46 +0000 release: do not set __MAKE_CONF and SRCCONF for the chroot build PR: 254319 Submitted by: truckman Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0af8a2db34cff008d4f48f357da48b7379b18893) --- release/release.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/release/release.sh b/release/release.sh index 58f946b9bba1..0c38f2ed45b1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -188,6 +188,7 @@ env_check() { # this file, unless overridden by release.conf. In most cases, these # will not need to be changed. CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" + NOCONF_FILES="__MAKE_CONF=/dev/null SRCCONF=/dev/null" if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" else @@ -211,9 +212,9 @@ env_check() { CHROOT_MAKEENV="${CHROOT_MAKEENV} \ MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" - CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" - CHROOT_IMAKEFLAGS="${WORLD_FLAGS} ${CONF_FILES}" - CHROOT_DMAKEFLAGS="${WORLD_FLAGS} ${CONF_FILES}" + CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${NOCONF_FILES}" + CHROOT_IMAKEFLAGS="${WORLD_FLAGS} ${NOCONF_FILES}" + CHROOT_DMAKEFLAGS="${WORLD_FLAGS} ${NOCONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} \ ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \ From owner-dev-commits-src-all@freebsd.org Thu Apr 29 15:57:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCA1F62F51D; Thu, 29 Apr 2021 15:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWKrH5WYpz4pr3; Thu, 29 Apr 2021 15:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B05861DDAA; Thu, 29 Apr 2021 15:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13TFv3Hn059179; Thu, 29 Apr 2021 15:57:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFv39D059178; Thu, 29 Apr 2021 15:57:03 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:57:03 GMT Message-Id: <202104291557.13TFv39D059178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 0490d82acef8 - stable/13 - release: sync 'git count' logic with newvers.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0490d82acef865eef70d3214f695c93b4cf3aef2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:57:03 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=0490d82acef865eef70d3214f695c93b4cf3aef2 commit 0490d82acef865eef70d3214f695c93b4cf3aef2 Author: Glen Barber AuthorDate: 2021-03-17 14:57:32 +0000 Commit: Glen Barber CommitDate: 2021-04-29 15:44:46 +0000 release: sync 'git count' logic with newvers.sh Sync determining the git count with newvers.sh by adding the --first-parent argument. This ensures uname(1) reflects the file name for snapshots. Reported by: Mark Millard Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit e5c6913a8d23ebe49c9e8f95c5236c7a0d8dbac5) --- release/Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index 64f7c6e049a4..da7226dfa890 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -22,7 +22,7 @@ GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || . export GITREV . endif . if !defined(GITCOUNT) || empty(GITCOUNT) -GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --count HEAD 2>/dev/null || true +GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true . export GITCOUNT . endif .else From owner-dev-commits-src-all@freebsd.org Thu Apr 29 15:57:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA7C262F27E; Thu, 29 Apr 2021 15:57: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 4FWKrL26LBz4pwH; Thu, 29 Apr 2021 15:57: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 14D491D8EA; Thu, 29 Apr 2021 15:57: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 13TFv5Cv059227; Thu, 29 Apr 2021 15:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFv5Ou059226; Thu, 29 Apr 2021 15:57:05 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:57:05 GMT Message-Id: <202104291557.13TFv5Ou059226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: fb3ce5331ce3 - stable/13 - release: fix VMSIZE following 1ca8842f3ad9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb3ce5331ce3219eb525630e8cc290b6c3b7654b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:57:07 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=fb3ce5331ce3219eb525630e8cc290b6c3b7654b commit fb3ce5331ce3219eb525630e8cc290b6c3b7654b Author: Glen Barber AuthorDate: 2021-03-04 13:39:43 +0000 Commit: Glen Barber CommitDate: 2021-04-29 15:52:42 +0000 release: fix VMSIZE following 1ca8842f3ad9 truncate(1) is not case-sensitive with regard to setting the size of a file. makefs(8), however, does not honor upper-case values. Update release-specific files and the release(7) manual page to reflect this. Submitted by: ehem_freebsd_m5p.com (original) Differential Review: https://reviews.freebsd.org/D28979 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fa04db476201c4cad5f6a5f67da8f2ef1e1cdad3) --- release/Makefile.vm | 4 ++-- release/release.conf.sample | 4 ++-- release/tools/basic-ci.conf | 2 +- release/tools/ec2.conf | 2 +- release/tools/gce.conf | 2 +- release/tools/vagrant.conf | 2 +- share/man/man7/release.7 | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index d201e11e19b2..39a8186ba675 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -7,8 +7,8 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 4096M -SWAPSIZE?= 1G +VMSIZE?= 4096m +SWAPSIZE?= 1g VMBASE?= vm VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image diff --git a/release/release.conf.sample b/release/release.conf.sample index 3a77a6bf1fac..a70a8bb3bd80 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -106,8 +106,8 @@ PORTBRANCH="main" ## If WITH_VMIMAGES is set to a non-empty value, this is the size of the ## virtual machine disk filesystem. Valid size values are described in -## the truncate(1) manual page. -#VMSIZE="20G" +## the makefs(8) manual page. +#VMSIZE="20g" ## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk ## image formats to create. Valid values are listed in the mkimg(1) diff --git a/release/tools/basic-ci.conf b/release/tools/basic-ci.conf index 19bb2454f78d..9dc05c57d0f4 100644 --- a/release/tools/basic-ci.conf +++ b/release/tools/basic-ci.conf @@ -4,7 +4,7 @@ # # Should be enough for base image, image can be resized in needed -export VMSIZE=5G +export VMSIZE=5g # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="sshd growfs" diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index e726ccadc048..bfda9052421f 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -24,7 +24,7 @@ export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_ # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the UFS partition, not the disk which # it resides within. -export VMSIZE=5000M +export VMSIZE=5000m # No swap space; the ec2_ephemeralswap rc.d script will allocate swap # space on EC2 ephemeral disks. (If they exist -- the T2 low-cost instances diff --git a/release/tools/gce.conf b/release/tools/gce.conf index f156a5bb93eb..113784a7643e 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -4,7 +4,7 @@ # # The default of 3GB is too small for GCE, so override the size here. -export VMSIZE=20G +export VMSIZE=20g # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf index c683cf7a07d2..05e7052d46c4 100644 --- a/release/tools/vagrant.conf +++ b/release/tools/vagrant.conf @@ -4,7 +4,7 @@ # # The default of 3GB is too small for Vagrant, so override the size here. -export VMSIZE=8G +export VMSIZE=8g # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap. diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 02ee2dfc0e5e..0dbbe67f0258 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2020 +.Dd March 4, 2021 .Dt RELEASE 7 .Os .Sh NAME @@ -383,9 +383,9 @@ The default value is .It Va VMSIZE Set to change the size of the virtual machine disk capacity. The default value is -.Va 20G . +.Va 20g . See -.Xr truncate 1 +.Xr makefs 8 for valid values. .Pp Virtual machine disk images are, by default, created as sparse images. From owner-dev-commits-src-all@freebsd.org Thu Apr 29 15:57:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96BAB62EF66; Thu, 29 Apr 2021 15:57: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 4FWKrM236fz4pcZ; Thu, 29 Apr 2021 15:57: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 274D21D9F7; Thu, 29 Apr 2021 15:57: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 13TFv78O059249; Thu, 29 Apr 2021 15:57:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13TFv7Bd059248; Thu, 29 Apr 2021 15:57:07 GMT (envelope-from git) Date: Thu, 29 Apr 2021 15:57:07 GMT Message-Id: <202104291557.13TFv7Bd059248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: aa4eb2089751 - stable/13 - pass UNAME_r to fix building 14.x ports on 13.x MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa4eb2089751cd0039d114a0fd016d2d7fddc5e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 15:57:07 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=aa4eb2089751cd0039d114a0fd016d2d7fddc5e9 commit aa4eb2089751cd0039d114a0fd016d2d7fddc5e9 Author: Glen Barber AuthorDate: 2021-02-18 23:52:39 +0000 Commit: Glen Barber CommitDate: 2021-04-29 15:55:46 +0000 pass UNAME_r to fix building 14.x ports on 13.x Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 80ab50e1de19ca125f05a13937c796d48c4edd4a) --- release/Makefile.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 39a8186ba675..67e849369596 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -54,7 +54,7 @@ emulator-portinstall: .if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" ) .if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) .if exists(${PORTSDIR}/emulators/qemu-user-static/Makefile) - env - PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean + env - UNAME_r="${REVISION}-${BRANCH}" PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean .else .if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y From owner-dev-commits-src-all@freebsd.org Thu Apr 29 16:22:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 16:27:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 16:45:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 16:45:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 16:56:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 17:45:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 18:08:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 20:20:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Thu Apr 29 21:28:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 00:47:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B42585E2D1E; Fri, 30 Apr 2021 00:47: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 4FWYcs4gbsz3Qf8; Fri, 30 Apr 2021 00:47:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ED4C23123; Fri, 30 Apr 2021 00:47:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13U0lvRh052474; Fri, 30 Apr 2021 00:47:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U0lviX052473; Fri, 30 Apr 2021 00:47:57 GMT (envelope-from git) Date: Fri, 30 Apr 2021 00:47:57 GMT Message-Id: <202104300047.13U0lviX052473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 5a45802b3c8c - stable/13 - nfsv4 client: do the BindConnectionToSession as required MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a45802b3c8c3962649f47b01453c819dd137da1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 00:47:57 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5a45802b3c8c3962649f47b01453c819dd137da1 commit 5a45802b3c8c3962649f47b01453c819dd137da1 Author: Rick Macklem AuthorDate: 2021-04-11 21:34:57 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 00:43:50 +0000 nfsv4 client: do the BindConnectionToSession as required During a recent testing event, it was reported that the NFSv4.1/4.2 server erroneously bound the back channel to a new TCP connection. RFC5661 specifies that the fore channel is implicitly bound to a new TCP connection when an RPC with Sequence (almost any of them) is done on it. For the back channel to be bound to the new TCP connection, an explicit BindConnectionToSession must be done as the first RPC on the new connection. Since new TCP connections are created by the "reconnect" layer (sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional upcall done by the krpc whenever a new connection is created. The patch also adds the specific upcall function that does a BindConnectionToSession and configures the krpc to call it when required. This is necessary for correct interoperability with NFSv4.1/NFSv4.2 servers when the nfscbd daemon is running. If doing NFSv4.1/NFSv4.2 mounts without this patch, it is recommended that the nfscbd daemon not be running and that the "pnfs" mount option not be specified. PR: 254840 (cherry picked from commit 7763814fc9c27a98fefcbf582d7a936ea43af23a) --- sys/fs/nfs/nfs_commonsubs.c | 5 ++- sys/fs/nfs/nfs_var.h | 1 + sys/fs/nfs/nfscl.h | 5 +++ sys/fs/nfs/nfsport.h | 9 +++-- sys/fs/nfs/nfsproto.h | 5 ++- sys/fs/nfsclient/nfs_clrpcops.c | 90 +++++++++++++++++++++++++++++++++++++++++ sys/rpc/clnt.h | 6 +++ sys/rpc/clnt_rc.c | 15 +++++++ sys/rpc/krpc.h | 3 ++ 9 files changed, 133 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 43bb396d9cfd..4afa4c2d9ab4 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -218,7 +218,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 1 }; + 1, 0, 0, 1, 0 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -301,6 +301,7 @@ static struct { { NFSV4OP_SETXATTR, 2, "Setxattr", 8, }, { NFSV4OP_REMOVEXATTR, 2, "Rmxattr", 7, }, { NFSV4OP_LISTXATTRS, 2, "Listxattr", 9, }, + { NFSV4OP_BINDCONNTOSESS, 1, "BindConSess", 11, }, }; /* @@ -309,7 +310,7 @@ static struct { static int nfs_bigrequest[NFSV42_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }; /* diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index aba5c5124e72..0297b52015f8 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -561,6 +561,7 @@ int nfsrpc_listextattr(vnode_t, uint64_t *, struct uio *, size_t *, bool *, struct nfsvattr *, int *, struct ucred *, NFSPROC_T *); int nfsrpc_rmextattr(vnode_t, const char *, struct nfsvattr *, int *, struct ucred *, NFSPROC_T *); +void nfsrpc_bindconnsess(CLIENT *, void *, struct ucred *); /* nfs_clstate.c */ int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int, diff --git a/sys/fs/nfs/nfscl.h b/sys/fs/nfs/nfscl.h index 52da0af6fa51..3d7afaf68432 100644 --- a/sys/fs/nfs/nfscl.h +++ b/sys/fs/nfs/nfscl.h @@ -81,4 +81,9 @@ struct nfsv4node { printf(__VA_ARGS__); \ } while (0) +struct nfscl_reconarg { + int minorvers; + uint8_t sessionid[NFSX_V4SESSIONID]; +}; + #endif /* _NFS_NFSCL_H */ diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 255c9a47ebdf..6777dc72f6a3 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -412,10 +412,13 @@ #define NFSPROC_RMEXTATTR 63 #define NFSPROC_LISTEXTATTR 64 +/* BindConnectionToSession, done by the krpc for a new connection. */ +#define NFSPROC_BINDCONNTOSESS 65 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 65 +#define NFSV42_NPROCS 66 #endif /* NFS_V3NPROCS */ @@ -444,7 +447,7 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 15]; + uint64_t rpccnt[NFSV42_NPROCS + 14]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; uint64_t reserved_0; @@ -509,7 +512,7 @@ struct nfsstatsov1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 4]; + uint64_t rpccnt[NFSV42_NPROCS + 3]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; uint64_t reserved_0; diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index c123152a7cb7..236d8c14ff24 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -394,10 +394,13 @@ #define NFSPROC_RMEXTATTR 63 #define NFSPROC_LISTEXTATTR 64 +/* BindConnectionToSession, done by the krpc for a new connection. */ +#define NFSPROC_BINDCONNTOSESS 65 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 65 +#define NFSV42_NPROCS 66 #endif /* NFS_V3NPROCS */ diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 527a47338b3f..db0b6ab1f5e8 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -946,6 +946,8 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, struct nfsclds *dsp, *odsp; struct in6_addr a6; struct nfsclsession *tsep; + struct rpc_reconupcall recon; + struct nfscl_reconarg *rcp; if (nfsboottime.tv_sec == 0) NFSSETBOOTTIME(nfsboottime); @@ -1019,6 +1021,23 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, NFSCL_DEBUG(1, "aft createsess=%d\n", error); } if (error == 0) { + /* + * If the session supports a backchannel, set up + * the BindConnectionToSession call in the krpc + * so that it is done on a reconnection. + */ + if (nfscl_enablecallb != 0 && nfs_numnfscbd > 0) { + rcp = mem_alloc(sizeof(*rcp)); + rcp->minorvers = nmp->nm_minorvers; + memcpy(rcp->sessionid, + dsp->nfsclds_sess.nfsess_sessionid, + NFSX_V4SESSIONID); + recon.call = nfsrpc_bindconnsess; + recon.arg = rcp; + CLNT_CONTROL(nmp->nm_client, CLSET_RECONUPCALL, + &recon); + } + NFSLOCKMNT(nmp); /* * The old sessions cannot be safely free'd @@ -8709,3 +8728,74 @@ nfsm_split(struct mbuf *mp, uint64_t xfer) m->m_next = NULL; return (m2); } + +/* + * Do the NFSv4.1 Bind Connection to Session. + * Called from the reconnect layer of the krpc (sys/rpc/clnt_rc.c). + */ +void +nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucred *cr) +{ + struct nfscl_reconarg *rcp = (struct nfscl_reconarg *)arg; + uint32_t res, *tl; + struct nfsrv_descript nfsd; + struct nfsrv_descript *nd = &nfsd; + struct rpc_callextra ext; + struct timeval utimeout; + enum clnt_stat stat; + int error; + + nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, + NFS_VER4, rcp->minorvers); + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); + memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); + tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; + *tl++ = txdr_unsigned(NFSCDFC4_FORE_OR_BOTH); + *tl = newnfs_false; + + memset(&ext, 0, sizeof(ext)); + utimeout.tv_sec = 30; + utimeout.tv_usec = 0; + ext.rc_auth = authunix_create(cr); + nd->nd_mrep = NULL; + stat = CLNT_CALL_MBUF(cl, &ext, NFSV4PROC_COMPOUND, nd->nd_mreq, + &nd->nd_mrep, utimeout); + AUTH_DESTROY(ext.rc_auth); + if (stat != RPC_SUCCESS) { + printf("nfsrpc_bindconnsess: call failed stat=%d\n", stat); + return; + } + if (nd->nd_mrep == NULL) { + printf("nfsrpc_bindconnsess: no reply args\n"); + return; + } + error = 0; + newnfs_realign(&nd->nd_mrep, M_WAITOK); + nd->nd_md = nd->nd_mrep; + nd->nd_dpos = mtod(nd->nd_md, char *); + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + nd->nd_repstat = fxdr_unsigned(uint32_t, *tl++); + if (nd->nd_repstat == NFSERR_OK) { + res = fxdr_unsigned(uint32_t, *tl); + if (res > 0 && (error = nfsm_advance(nd, NFSM_RNDUP(res), + -1)) != 0) + goto nfsmout; + NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + + 4 * NFSX_UNSIGNED); + tl += 3; + if (!NFSBCMP(tl, rcp->sessionid, NFSX_V4SESSIONID)) { + tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; + res = fxdr_unsigned(uint32_t, *tl); + if (res != NFSCDFS4_BOTH) + printf("nfsrpc_bindconnsess: did not " + "return FS4_BOTH\n"); + } else + printf("nfsrpc_bindconnsess: not same " + "sessionid\n"); + } else if (nd->nd_repstat != NFSERR_BADSESSION) + printf("nfsrpc_bindconnsess: returned %d\n", nd->nd_repstat); +nfsmout: + if (error != 0) + printf("nfsrpc_bindconnsess: reply bad xdr\n"); + m_freem(nd->nd_mrep); +} diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index f4cc78b1c3b6..6f8f898ca918 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -360,6 +360,12 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLSET_TLS 30 /* set TLS for socket */ #define CLSET_BLOCKRCV 31 /* Temporarily block reception */ #define CLSET_TLSCERTNAME 32 /* TLS certificate file name */ +/* Structure used as the argument for CLSET_RECONUPCALL. */ +struct rpc_reconupcall { + void (*call)(CLIENT *, void *, struct ucred *); + void *arg; +}; +#define CLSET_RECONUPCALL 33 /* Reconnect upcall */ #endif diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 8c204989d0ea..ae3b2985a891 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -111,6 +111,8 @@ clnt_reconnect_create( rc->rc_client = NULL; rc->rc_tls = false; rc->rc_tlscertname = NULL; + rc->rc_reconcall = NULL; + rc->rc_reconarg = NULL; cl->cl_refs = 1; cl->cl_ops = &clnt_reconnect_ops; @@ -213,6 +215,9 @@ clnt_reconnect_connect(CLIENT *cl) goto out; } } + if (newclient != NULL && rc->rc_reconcall != NULL) + (*rc->rc_reconcall)(newclient, rc->rc_reconarg, + rc->rc_ucred); } td->td_ucred = oldcred; @@ -408,6 +413,7 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) struct rc_data *rc = (struct rc_data *)cl->cl_private; SVCXPRT *xprt; size_t slen; + struct rpc_reconupcall *upcp; if (info == NULL) { return (FALSE); @@ -513,6 +519,12 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) strlcpy(rc->rc_tlscertname, info, slen); break; + case CLSET_RECONUPCALL: + upcp = (struct rpc_reconupcall *)info; + rc->rc_reconcall = upcp->call; + rc->rc_reconarg = upcp->arg; + break; + default: return (FALSE); } @@ -555,12 +567,15 @@ clnt_reconnect_destroy(CLIENT *cl) CLNT_DESTROY(rc->rc_client); if (rc->rc_backchannel) { xprt = (SVCXPRT *)rc->rc_backchannel; + KASSERT(xprt->xp_socket == NULL, + ("clnt_reconnect_destroy: xp_socket not NULL")); xprt_unregister(xprt); SVC_RELEASE(xprt); } crfree(rc->rc_ucred); mtx_destroy(&rc->rc_lock); mem_free(rc->rc_tlscertname, 0); /* 0 ok, since arg. ignored. */ + mem_free(rc->rc_reconarg, 0); mem_free(rc, sizeof(*rc)); mem_free(cl, sizeof (CLIENT)); } diff --git a/sys/rpc/krpc.h b/sys/rpc/krpc.h index 77facdcf16cc..48df782e481c 100644 --- a/sys/rpc/krpc.h +++ b/sys/rpc/krpc.h @@ -81,6 +81,9 @@ struct rc_data { void *rc_backchannel; bool rc_tls; /* Enable TLS on connection */ char *rc_tlscertname; + void (*rc_reconcall)(CLIENT *, void *, + struct ucred *); /* reconection upcall */ + void *rc_reconarg; /* upcall arg */ }; /* Bits for ct_rcvstate. */ From owner-dev-commits-src-all@freebsd.org Fri Apr 30 01:32:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 173585E3C59; Fri, 30 Apr 2021 01:32: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 4FWZcG6hx3z3hyP; Fri, 30 Apr 2021 01: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 D886D238C6; Fri, 30 Apr 2021 01: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 13U1WU0Y018070; Fri, 30 Apr 2021 01:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U1WUel018069; Fri, 30 Apr 2021 01:32:30 GMT (envelope-from git) Date: Fri, 30 Apr 2021 01:32:30 GMT Message-Id: <202104300132.13U1WUel018069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d60c6dc8f69b - stable/13 - param.h: bump __FreeBSD_version for commit 5a45802b3c8c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d60c6dc8f69b1264c7af5e2479ea94f000fd2c6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 01:32:31 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d60c6dc8f69b1264c7af5e2479ea94f000fd2c6d commit d60c6dc8f69b1264c7af5e2479ea94f000fd2c6d Author: Rick Macklem AuthorDate: 2021-04-30 01:29:25 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 01:29:25 +0000 param.h: bump __FreeBSD_version for commit 5a45802b3c8c Commit 5a45802b3c8c changed the internal KAPI between the krpc and NFS. As such, the krpc, nfscommon and nfscl modules must all 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 e547452e5af1..c93eccc143dd 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 1300502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Fri Apr 30 01:42:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E5B5E418A; Fri, 30 Apr 2021 01:42: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 4FWZrF50sXz3jZs; Fri, 30 Apr 2021 01:42: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 9F33923E87; Fri, 30 Apr 2021 01:42: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 13U1grgX031657; Fri, 30 Apr 2021 01:42:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13U1grKS031656; Fri, 30 Apr 2021 01:42:53 GMT (envelope-from git) Date: Fri, 30 Apr 2021 01:42:53 GMT Message-Id: <202104300142.13U1grKS031656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 00a7499bcba1 - stable/13 - Add an UPDATING entry for commit 5a45802b3c8c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 00a7499bcba17c974275e8208b4227b73cbcbebe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 01:42:53 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=00a7499bcba17c974275e8208b4227b73cbcbebe commit 00a7499bcba17c974275e8208b4227b73cbcbebe Author: Rick Macklem AuthorDate: 2021-04-30 01:40:04 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 01:40:04 +0000 Add an UPDATING entry for commit 5a45802b3c8c --- UPDATING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPDATING b/UPDATING index c42fe6639b12..b966ed678efd 100644 --- a/UPDATING +++ b/UPDATING @@ -11,6 +11,14 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20210429: + Commit 5a45802b3c8c changed the internal KAPI between + the krpc and NFS. As such, the krpc, nfscommon and + nfscl modules must all be rebuilt from sources. + Without this patch, NFSv4.1/4.2 mounts should not + be done with the nfscbd(8) daemon running, to avoid + needing a working back channel for server->client RPCs. + 20210202: Various LinuxKPI functionality was added which conflicts with DRM. Please update your drm-kmod port to after the __FreeBSD_verison 1300139 From owner-dev-commits-src-all@freebsd.org Fri Apr 30 07:57:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 08:12:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 08:45:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 08:45:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 08:45:51 -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-all@freebsd.org Fri Apr 30 10:45:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 10:46:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 11:33:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 13:11:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1AC05FE2AE for ; Fri, 30 Apr 2021 13:11: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 4FWt6x6ZB5z4l5L; Fri, 30 Apr 2021 13:11: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 D48BB2C8D9; Fri, 30 Apr 2021 13:11: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 13UDBbPF044304; Fri, 30 Apr 2021 13:11:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UDBbiK044303; Fri, 30 Apr 2021 13:11:37 GMT (envelope-from git) Date: Fri, 30 Apr 2021 13:11:37 GMT Message-Id: <202104301311.13UDBbiK044303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Emmanuel Vadot Subject: git: a3bedc0dcb55 - internal/admin - Welcome Oskar as src commiter. 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/internal/admin X-Git-Reftype: branch X-Git-Commit: a3bedc0dcb551f96d3451241c329300d1a50e94d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 13:11:38 -0000 The branch internal/admin has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a3bedc0dcb551f96d3451241c329300d1a50e94d commit a3bedc0dcb551f96d3451241c329300d1a50e94d Author: Emmanuel Vadot AuthorDate: 2021-04-30 13:09:15 +0000 Commit: Emmanuel Vadot CommitDate: 2021-04-30 13:10:56 +0000 Welcome Oskar as src commiter. I'll mentor him. Approved by: core --- access | 1 + mentors | 1 + 2 files changed, 2 insertions(+) diff --git a/access b/access index 122b446b74cd..1dd27a968833 100644 --- a/access +++ b/access @@ -148,6 +148,7 @@ np nwhitehorn nyan obrien +oh oshogbo peter peter@wemm.org peterj diff --git a/mentors b/mentors index e802c82f6821..259b9fb3fe42 100644 --- a/mentors +++ b/mentors @@ -21,6 +21,7 @@ kadesai ken Co-mentor: scottl, ambrisko khng philip Co-mentor: lwhsu mjoras rstone nick philip Co-mentor: kp +oh manu rajeshasp gallatin Co-mentor: vmaffione ram ken Co-mentor: mav sam emaste From owner-dev-commits-src-all@freebsd.org Fri Apr 30 13:21:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F6A25FE50D; Fri, 30 Apr 2021 13:21: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 4FWtKt1DhJz4lT8; Fri, 30 Apr 2021 13:21: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 1D3F52CA49; Fri, 30 Apr 2021 13:21: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 13UDL61E056446; Fri, 30 Apr 2021 13:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UDL6er056445; Fri, 30 Apr 2021 13:21:06 GMT (envelope-from git) Date: Fri, 30 Apr 2021 13:21:06 GMT Message-Id: <202104301321.13UDL6er056445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ce6fffd96542 - stable/13 - dtrace tests: Fix tst.system.d after ping/ping6 unification MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ce6fffd96542099ff01cb9611170825753796edc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 13:21:06 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce6fffd96542099ff01cb9611170825753796edc commit ce6fffd96542099ff01cb9611170825753796edc Author: Mark Johnston AuthorDate: 2021-04-23 14:28:09 +0000 Commit: Mark Johnston CommitDate: 2021-04-30 13:21:00 +0000 dtrace tests: Fix tst.system.d after ping/ping6 unification Sponsored by: The FreeBSD Foundation (cherry picked from commit d500a85e640d1cd270747c12e17c511b53864436) --- .../opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d index 63a850133b3f..4d5cced71c79 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d @@ -35,11 +35,11 @@ BEGIN this->b = -2; system("echo %s %d %d", "foo", this->a, this->b); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -4 -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -4 -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); exit(0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 30 13:29:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 14:45:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 14:45:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 14:45:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 14:45:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 14:45:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 16:40:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5484062453C; Fri, 30 Apr 2021 16:40:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWylT0pjgz4vZB; Fri, 30 Apr 2021 16:40:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A23B2F781; Fri, 30 Apr 2021 16:40:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UGe4BD015636; Fri, 30 Apr 2021 16:40:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UGe4t7015630; Fri, 30 Apr 2021 16:40:04 GMT (envelope-from git) Date: Fri, 30 Apr 2021 16:40:04 GMT Message-Id: <202104301640.13UGe4t7015630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 9e5809e91b61 - stable/12 - Merge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9e5809e91b613c24fb298a3782139bb6a2773c0a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 16:40:05 -0000 The branch stable/12 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=9e5809e91b613c24fb298a3782139bb6a2773c0a commit 9e5809e91b613c24fb298a3782139bb6a2773c0a Author: Stefan Eßer AuthorDate: 2021-04-25 06:42:31 +0000 Commit: Stefan Eßer CommitDate: 2021-04-30 16:38:04 +0000 Merge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94' usr.bin/bc: update to version 4.0.1 This update adds a flush() of the output buffer to the bc print command. (cherry picked from commit 8ea9013512494c9f035afa1ffa1e199b44c7904f) This commit included a change to .gitattributes for an already checked-in file, which caused an inconsistency in the repository. This was fixed by Michael Gmelin with a follow-up commit: 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 (cherry picked from commit a0358e3d5184950b4316f105eb292cbafdea208b) --- contrib/bc/.gitattributes | 3 + contrib/bc/.gitignore | 4 + contrib/bc/NEWS.md | 5 + contrib/bc/README.md | 4 + contrib/bc/bc.vcxproj | 554 ++++++++++++++++++++--------------------- contrib/bc/bc.vcxproj.filters | 362 +++++++++++++-------------- contrib/bc/bcl.vcxproj | 320 ++++++++++++------------ contrib/bc/bcl.vcxproj.filters | 190 +++++++------- contrib/bc/include/version.h | 2 +- contrib/bc/src/program.c | 1 + 10 files changed, 731 insertions(+), 714 deletions(-) diff --git a/contrib/bc/.gitattributes b/contrib/bc/.gitattributes new file mode 100644 index 000000000000..22d6e60bce68 --- /dev/null +++ b/contrib/bc/.gitattributes @@ -0,0 +1,3 @@ +*.vcxproj eol=crlf +*.vcxproj.filters eol=crlf +*.sln eol= crlf diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index 5c2bbae866c0..b131d5813764 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -68,3 +68,7 @@ core.* cscope*.out tags + +*.vcxproj.user +Debug/* +Release/* diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 011cb9138912..c66e7b164c8a 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,10 @@ # News +## 4.0.1 + +This is a production release that only adds one thing: flushing output when it +is printed with a print statement. + ## 4.0.0 This is a production release with many fixes, a new command-line option, and a diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 852c8956a73d..f0dcecf15bde 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -19,6 +19,10 @@ functionality is unnecessary. For more information, see the `dc`'s full manual. +This `bc` also provides `bc`'s math as a library with C bindings, called `bcl`. + +For more information, see the full manual for `bcl`. + This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD 2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. 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 + *** 586 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Apr 30 16:48:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10944624798; Fri, 30 Apr 2021 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWyx5018cz4vqb; Fri, 30 Apr 2021 16:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E773E2F178; Fri, 30 Apr 2021 16:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UGmOOL026951; Fri, 30 Apr 2021 16:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UGmOKh026950; Fri, 30 Apr 2021 16:48:24 GMT (envelope-from git) Date: Fri, 30 Apr 2021 16:48:24 GMT Message-Id: <202104301648.13UGmOKh026950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: e4419043d1dd - stable/13 - UPDATING: dereference portupgrade(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4419043d1dd7d3b992893b45b0fe1405bb1eabf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 16:48:25 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=e4419043d1dd7d3b992893b45b0fe1405bb1eabf commit e4419043d1dd7d3b992893b45b0fe1405bb1eabf Author: Glen Barber AuthorDate: 2021-04-09 00:26:41 +0000 Commit: Glen Barber CommitDate: 2021-04-30 16:47:41 +0000 UPDATING: dereference portupgrade(8) Make the UPDATING file less tool-specific regarding upgrading third-party software. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 6dadf78f115cbdcb17dff8974a2044dd5129f7dc) --- UPDATING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index b966ed678efd..7a07f2d8fe35 100644 --- a/UPDATING +++ b/UPDATING @@ -9,7 +9,8 @@ handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html Items affecting the ports and packages system can be found in -/usr/ports/UPDATING. Please read that file before running portupgrade. +/usr/ports/UPDATING. Please read that file before updating system packages +and/or ports. 20210429: Commit 5a45802b3c8c changed the internal KAPI between From owner-dev-commits-src-all@freebsd.org Fri Apr 30 16:48:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73E476244C8; Fri, 30 Apr 2021 16:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWyx824sfz4vtN; Fri, 30 Apr 2021 16:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A5B82F982; Fri, 30 Apr 2021 16:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UGmSoP027069; Fri, 30 Apr 2021 16:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UGmSE4027068; Fri, 30 Apr 2021 16:48:28 GMT (envelope-from git) Date: Fri, 30 Apr 2021 16:48:28 GMT Message-Id: <202104301648.13UGmSE4027068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 885d930e8504 - stable/12 - UPDATING: dereference portupgrade(8) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 885d930e85040217aca8634d163ca44d2b7bee84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 16:48:28 -0000 The branch stable/12 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=885d930e85040217aca8634d163ca44d2b7bee84 commit 885d930e85040217aca8634d163ca44d2b7bee84 Author: Glen Barber AuthorDate: 2021-04-09 00:26:41 +0000 Commit: Glen Barber CommitDate: 2021-04-30 16:47:54 +0000 UPDATING: dereference portupgrade(8) Make the UPDATING file less tool-specific regarding upgrading third-party software. Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 6dadf78f115cbdcb17dff8974a2044dd5129f7dc) --- UPDATING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index ac80b270c8c4..cc5ac276432d 100644 --- a/UPDATING +++ b/UPDATING @@ -9,7 +9,8 @@ handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html Items affecting the ports and packages system can be found in -/usr/ports/UPDATING. Please read that file before running portupgrade. +/usr/ports/UPDATING. Please read that file before updating system packages +and/or ports. NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to From owner-dev-commits-src-all@freebsd.org Fri Apr 30 18:13:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 18:33:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 20:16:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25D68628793; Fri, 30 Apr 2021 20:16: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 4FX3Xk0Nmwz3MHJ; Fri, 30 Apr 2021 20:16: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 F0070226F; Fri, 30 Apr 2021 20:16: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 13UKG5Tn004381; Fri, 30 Apr 2021 20:16:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKG50r004380; Fri, 30 Apr 2021 20:16:05 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:05 GMT Message-Id: <202104302016.13UKG50r004380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 610e72370607 - stable/13 - pchtherm: Add IDs for CannonLake-H, CometLake and Lewisburg controllers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 610e72370607654368851a5a55d040c2b47433a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:06 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=610e72370607654368851a5a55d040c2b47433a2 commit 610e72370607654368851a5a55d040c2b47433a2 Author: Vladimir Kondratyev AuthorDate: 2021-04-14 10:03:18 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:12:20 +0000 pchtherm: Add IDs for CannonLake-H, CometLake and Lewisburg controllers Submitted by: Dmitry Luhtionov --- sys/dev/intel/pchtherm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/intel/pchtherm.c b/sys/dev/intel/pchtherm.c index 31d06a1bc26a..b65cc9879e26 100644 --- a/sys/dev/intel/pchtherm.c +++ b/sys/dev/intel/pchtherm.c @@ -96,7 +96,15 @@ static const struct pci_device_table pchtherm_devices[] = { PCI_DEV(0x8086, 0xa131), PCI_DESCR("Skylake PCH 100 Thermal Subsystem")}, { PCI_DEV(0x8086, 0x9df9), - PCI_DESCR("Cannon Lake PCH Thermal Controller")}, + PCI_DESCR("CannonLake-LP Thermal Subsystem")}, + { PCI_DEV(0x8086, 0xa379), + PCI_DESCR("CannonLake-H Thermal Subsystem")}, + { PCI_DEV(0x8086, 0x02f9), + PCI_DESCR("CometLake-LP Thermal Subsystem")}, + { PCI_DEV(0x8086, 0x06f9), + PCI_DESCR("CometLake-H Thermal Subsystem")}, + { PCI_DEV(0x8086, 0xa1b1), + PCI_DESCR("Lewisburg Thermal Subsystem")}, }; static int pchtherm_probe(device_t dev) From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71EEF62868A; Fri, 30 Apr 2021 20:16: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 4FX3Xm2gZcz3MHP; Fri, 30 Apr 2021 20:16: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 43917281A; Fri, 30 Apr 2021 20:16: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 13UKG87G004430; Fri, 30 Apr 2021 20:16:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKG8UG004429; Fri, 30 Apr 2021 20:16:08 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:08 GMT Message-Id: <202104302016.13UKG8UG004429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 91e562169c0b - stable/13 - hidmap: add missing opt_hid.h to module Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91e562169c0b68b6034a67db1350008ff48e37de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:08 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=91e562169c0b68b6034a67db1350008ff48e37de commit 91e562169c0b68b6034a67db1350008ff48e37de Author: Vladimir Kondratyev AuthorDate: 2021-04-14 19:55:52 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:12:33 +0000 hidmap: add missing opt_hid.h to module Makefile Reported by: pstef --- sys/modules/hid/hidmap/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/hid/hidmap/Makefile b/sys/modules/hid/hidmap/Makefile index 8e79f156d9d7..00e7099b287b 100644 --- a/sys/modules/hid/hidmap/Makefile +++ b/sys/modules/hid/hidmap/Makefile @@ -4,6 +4,7 @@ KMOD= hidmap SRCS= hidmap.c +SRCS+= opt_hid.h SRCS+= bus_if.h device_if.h .include From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B727F6281FA; Fri, 30 Apr 2021 20:16: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 4FX3Xn4JDlz3MND; Fri, 30 Apr 2021 20:16: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 4FBF427EE; Fri, 30 Apr 2021 20:16: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 13UKG9Ap004451; Fri, 30 Apr 2021 20:16:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKG9lo004450; Fri, 30 Apr 2021 20:16:09 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:09 GMT Message-Id: <202104302016.13UKG9lo004450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ad711fa497d5 - stable/13 - ng_ubt: Do not clear stall before receiving of HCI command response. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad711fa497d564f7bf9fd1a2e9e01efcb4de102f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:09 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ad711fa497d564f7bf9fd1a2e9e01efcb4de102f commit ad711fa497d564f7bf9fd1a2e9e01efcb4de102f Author: Vladimir Kondratyev AuthorDate: 2021-04-15 14:25:00 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:12:41 +0000 ng_ubt: Do not clear stall before receiving of HCI command response. Unconditional execution of "clear feature" request at SETUP stage was workaround for probe failures on ng_ubt.ko re-kldloading which is unnecessary now. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D29775 --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 30a012702c8f..8b93687c6688 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -825,8 +825,6 @@ ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: submit_next: - /* Try clear stall first */ - usbd_xfer_set_stall(xfer); usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); break; @@ -835,6 +833,8 @@ submit_next: if (error != USB_ERR_CANCELLED) { printf("ng_ubt: interrupt transfer failed: %s\n", usbd_errstr(error)); + /* Try clear stall first */ + usbd_xfer_set_stall(xfer); goto submit_next; } break; From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BBDB6282C7; Fri, 30 Apr 2021 20:16: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 4FX3Xl13y2z3MKy; Fri, 30 Apr 2021 20:16: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 15F282819; Fri, 30 Apr 2021 20:16: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 13UKG6fn004408; Fri, 30 Apr 2021 20:16:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKG6MQ004407; Fri, 30 Apr 2021 20:16:06 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:06 GMT Message-Id: <202104302016.13UKG6MQ004407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 61860b0a488f - stable/13 - ichsmb: Add PCI ID for Intel Gemini Lake SMBus controller MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 61860b0a488ff991313e16747110224a06463c7a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:07 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=61860b0a488ff991313e16747110224a06463c7a commit 61860b0a488ff991313e16747110224a06463c7a Author: Vladimir Kondratyev AuthorDate: 2021-04-13 22:10:13 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:12:28 +0000 ichsmb: Add PCI ID for Intel Gemini Lake SMBus controller Submitted by: Dmitry Luhtionov --- sys/dev/ichsmb/ichsmb_pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index ff4b287dd020..51049643ae15 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #define ID_COMETLAKE2 0x06a3 #define ID_TIGERLAKE 0xa0a3 #define ID_TIGERLAKE2 0x43a3 +#define ID_GEMINILAKE 0x31d4 static const struct pci_device_table ichsmb_devices[] = { { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA), @@ -199,6 +200,8 @@ static const struct pci_device_table ichsmb_devices[] = { PCI_DESCR("Intel Tiger Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_TIGERLAKE2), PCI_DESCR("Intel Tiger Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_GEMINILAKE), + PCI_DESCR("Intel Gemini Lake SMBus controller") }, }; /* Internal functions */ From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 085DF62869B; Fri, 30 Apr 2021 20:16: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 4FX3Xq5kryz3MFB; Fri, 30 Apr 2021 20:16: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 A040C24CF; Fri, 30 Apr 2021 20:16: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 13UKGBWC004493; Fri, 30 Apr 2021 20:16:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKGBPu004492; Fri, 30 Apr 2021 20:16:11 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:11 GMT Message-Id: <202104302016.13UKGBPu004492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 83235903d5dc - stable/13 - ng_ubt: Block attachment of uninitialized Intel Wireless 7265 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 83235903d5dc735fbce8b22a5204ab648f2d9c94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:12 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=83235903d5dc735fbce8b22a5204ab648f2d9c94 commit 83235903d5dc735fbce8b22a5204ab648f2d9c94 Author: Vladimir Kondratyev AuthorDate: 2021-04-15 14:26:32 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:14:44 +0000 ng_ubt: Block attachment of uninitialized Intel Wireless 7265 As this controller requires firmware patch downloading to operate. "Intel Wireless 7265" support in iwmbtfw(8) is yet to be done. Tested by: arrowd et al PR: 228787 --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 5 +- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 122 +++++++++++++++++----- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h | 4 + 3 files changed, 103 insertions(+), 28 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 8b93687c6688..3e4dc0e80dec 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -423,7 +423,10 @@ static const STRUCT_USB_HOST_ID ubt_ignore_devs[] = { USB_VPI(0x0489, 0xe03c, 0), USB_DEV_BCD_LTEQ(1) }, { USB_VPI(0x0489, 0xe036, 0), USB_DEV_BCD_LTEQ(1) }, - /* Intel Wireless 8260 and successors are handled in ng_ubt_intel.c */ + /* Intel Wireless controllers are handled in ng_ubt_intel.c */ + { USB_VPI(USB_VENDOR_INTEL2, 0x07dc, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0a2a, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0aa7, 0) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, 0) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, 0) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0025, 0) }, diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index 377543b73387..978aeb924db6 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -5,7 +5,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2019, 2021 Vladimir Kondratyev * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,6 +58,24 @@ #include #include +enum { + UBT_INTEL_DEVICE_7260, + UBT_INTEL_DEVICE_8260, +}; + +struct ubt_intel_version_rp { + uint8_t status; + uint8_t hw_platform; + uint8_t hw_variant; + uint8_t hw_revision; + uint8_t fw_variant; + uint8_t fw_revision; + uint8_t fw_build_num; + uint8_t fw_build_ww; + uint8_t fw_build_yy; + uint8_t fw_patch_num; +} __attribute__ ((packed)); + static device_probe_t ubt_intel_probe; /* @@ -67,44 +85,49 @@ static device_probe_t ubt_intel_probe; static const STRUCT_USB_HOST_ID ubt_intel_devs[] = { + /* Intel Wireless 7260/7265 and successors */ + { USB_VPI(USB_VENDOR_INTEL2, 0x07dc, UBT_INTEL_DEVICE_7260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0a2a, UBT_INTEL_DEVICE_7260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0aa7, UBT_INTEL_DEVICE_7260) }, /* Intel Wireless 8260/8265 and successors */ - { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, 0) }, - { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, 0) }, - { USB_VPI(USB_VENDOR_INTEL2, 0x0025, 0) }, - { USB_VPI(USB_VENDOR_INTEL2, 0x0026, 0) }, - { USB_VPI(USB_VENDOR_INTEL2, 0x0029, 0) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0a2b, UBT_INTEL_DEVICE_8260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0aaa, UBT_INTEL_DEVICE_8260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0025, UBT_INTEL_DEVICE_8260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0026, UBT_INTEL_DEVICE_8260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0029, UBT_INTEL_DEVICE_8260) }, }; /* - * Find if the Intel Wireless 8260/8265 device is in bootloader mode or is - * running operational firmware with checking of 4-th byte "Intel version" - * HCI command response. The value 0x23 identifies the operational firmware. + * Execute generic HCI command and return response in provided buffer. */ -static bool -ubt_intel_check_firmware_state(struct usb_device *udev) +static usb_error_t +ubt_intel_do_hci_request(struct usb_device *udev, uint16_t opcode, + void *resp, uint8_t resp_len) { -#define UBT_INTEL_VER_LEN 13 #define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ struct ubt_hci_event_command_compl *evt; - uint8_t buf[offsetof(struct ubt_hci_event, data) + UBT_INTEL_VER_LEN]; - static struct ubt_hci_cmd cmd = { - .opcode = htole16(NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05)), - .length = 0, - }; + struct ubt_hci_cmd cmd; usb_error_t error; - bzero(buf, sizeof(buf)); - evt = (struct ubt_hci_event_command_compl *)buf; - evt->header.length = UBT_INTEL_VER_LEN; + memset(&cmd, 0, sizeof(cmd)); + cmd.opcode = htole16(opcode); + evt = malloc(offsetof(struct ubt_hci_event_command_compl, data) + + resp_len, M_TEMP, M_ZERO | M_WAITOK); + evt->header.length = resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE; error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); if (error != USB_ERR_NORMAL_COMPLETION) - return false; - - return (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && - evt->header.length == UBT_INTEL_VER_LEN && - evt->data[4] == 0x23); + goto exit; + + if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && + evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) + memcpy(resp, evt->data, resp_len); + else + error = USB_ERR_INVAL; +exit: + free(evt, M_TEMP); + return (error); } /* @@ -115,6 +138,8 @@ static int ubt_intel_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + struct ubt_intel_version_rp version; + ng_hci_reset_rp reset; int error; if (uaa->usb_mode != USB_MODE_HOST) @@ -128,8 +153,51 @@ ubt_intel_probe(device_t dev) if (error != 0) return (error); - if (!ubt_intel_check_firmware_state(uaa->device)) - return (ENXIO); + switch (USB_GET_DRIVER_INFO(uaa)) { + case UBT_INTEL_DEVICE_7260: + /* + * Send HCI Reset command to workaround controller bug with the + * first HCI command sent to it returning number of completed + * commands as zero. This will reset the number of completed + * commands and allow further normal command processing. + */ + if (ubt_intel_do_hci_request(uaa->device, + NG_HCI_OPCODE(NG_HCI_OGF_HC_BASEBAND, NG_HCI_OCF_RESET), + &reset, sizeof(reset)) != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + if (reset.status != 0) + return (ENXIO); + /* + * fw_patch_num indicates the version of patch the device + * currently have. If there is no patch data in the device, + * it is always 0x00 and we need to patch the device again. + */ + if (ubt_intel_do_hci_request(uaa->device, + NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05), + &version, sizeof(version)) != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + if (version.fw_patch_num == 0) + return (ENXIO); + break; + + case UBT_INTEL_DEVICE_8260: + /* + * Find if the Intel Wireless 8260/8265 device is in bootloader + * mode or is running operational firmware with checking of + * variant byte of "Intel version" HCI command response. + * The value 0x23 identifies the operational firmware. + */ + if (ubt_intel_do_hci_request(uaa->device, + NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05), + &version, sizeof(version)) != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + if (version.fw_variant != 0x23) + return (ENXIO); + break; + + default: + KASSERT(0 == 1, ("Unknown DRIVER_INFO")); + } return (BUS_PROBE_DEFAULT); } diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h index e93c85569f10..c2bd75c7faf0 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h @@ -102,6 +102,10 @@ struct ubt_hci_event_command_compl { } __attribute__ ((packed)); #define UBT_HCI_EVENT_SIZE(evt) \ ((evt)->header.length + offsetof(struct ubt_hci_event, data)) +#define UBT_HCI_EVENT_COMPL_HEAD_SIZE \ + (offsetof(struct ubt_hci_event_command_compl, data) - \ + offsetof(struct ubt_hci_event_command_compl, numpkt)) + /* USB device softc structure */ struct ubt_softc { From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D0D562869C; Fri, 30 Apr 2021 20:16: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 4FX3Xr5zZnz3MLQ; Fri, 30 Apr 2021 20:16: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 B32BA264A; Fri, 30 Apr 2021 20:16: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 13UKGCR1004515; Fri, 30 Apr 2021 20:16:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKGCOu004514; Fri, 30 Apr 2021 20:16:12 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:12 GMT Message-Id: <202104302016.13UKGCOu004514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 51b2d043692c - stable/13 - hkbd: Fix typo which disables keyboard input in kdb MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51b2d043692cf64a23e6babc6a449a091ccd9d4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:13 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=51b2d043692cf64a23e6babc6a449a091ccd9d4d commit 51b2d043692cf64a23e6babc6a449a091ccd9d4d Author: Vladimir Kondratyev AuthorDate: 2021-04-24 18:49:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:14:52 +0000 hkbd: Fix typo which disables keyboard input in kdb Reported by: Greg V --- sys/dev/hid/hkbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 775ad677f4de..55eba6d321ea 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -917,7 +917,7 @@ hkbd_attach(device_t dev) /* interrupt handler will be called with hkbd mutex taken */ hidbus_set_lock(dev, &sc->sc_mtx); /* interrupt handler can be called during panic */ - hidbus_set_flags(dev, hidbus_get_flags(dev) & HIDBUS_FLAG_CAN_POLL); + hidbus_set_flags(dev, hidbus_get_flags(dev) | HIDBUS_FLAG_CAN_POLL); /* setup default keyboard maps */ From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:16:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1E8762879A; Fri, 30 Apr 2021 20:16: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 4FX3Xp3wZMz3Lxx; Fri, 30 Apr 2021 20:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B85A24CE; Fri, 30 Apr 2021 20:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UKGAui004472; Fri, 30 Apr 2021 20:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UKGAPa004471; Fri, 30 Apr 2021 20:16:10 GMT (envelope-from git) Date: Fri, 30 Apr 2021 20:16:10 GMT Message-Id: <202104302016.13UKGAPa004471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 3f5ce99dc625 - stable/13 - ng_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f5ce99dc625a6a0290295929eeec1ea0c5c122c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:16:10 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3f5ce99dc625a6a0290295929eeec1ea0c5c122c commit 3f5ce99dc625a6a0290295929eeec1ea0c5c122c Author: Vladimir Kondratyev AuthorDate: 2021-04-15 14:25:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-30 20:14:38 +0000 ng_ubt: Use DEFINE_CLASS_1 macro for kobj inheritance. --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index c56d2288e77b..377543b73387 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -145,15 +145,8 @@ static device_method_t ubt_intel_methods[] = DEVMETHOD_END }; -static kobj_class_t ubt_baseclasses[] = { &ubt_driver, NULL }; -static driver_t ubt_intel_driver = -{ - .name = "ubt", - .methods = ubt_intel_methods, - .size = sizeof(struct ubt_softc), - .baseclasses = ubt_baseclasses, -}; - +DEFINE_CLASS_1(ubt, ubt_intel_driver, ubt_intel_methods, + sizeof(struct ubt_softc), ubt_driver); DRIVER_MODULE(ng_ubt_intel, uhub, ubt_intel_driver, ubt_devclass, 0, 0); MODULE_VERSION(ng_ubt_intel, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_ubt_intel, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); From owner-dev-commits-src-all@freebsd.org Fri Apr 30 20:33:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2369628C73; Fri, 30 Apr 2021 20:33:58 +0000 (UTC) (envelope-from wulf@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 4FX3xL6WyXz3N2d; Fri, 30 Apr 2021 20:33:58 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from [192.168.0.30] (unknown [176.120.241.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: wulf) by smtp.freebsd.org (Postfix) with ESMTPSA id 6274729309; Fri, 30 Apr 2021 20:33:58 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Subject: Re: git: 51b2d043692c - stable/13 - hkbd: Fix typo which disables keyboard input in kdb From: Vladimir Kondratyev To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202104302016.13UKGCOu004514@gitrepo.freebsd.org> Message-ID: <615a75d2-9ddd-44d7-83cd-2f314a2abcd6@FreeBSD.org> Date: Fri, 30 Apr 2021 23:33:13 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <202104302016.13UKGCOu004514@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 20:33:59 -0000 On 30.04.2021 23:16, Vladimir Kondratyev wrote: > The branch stable/13 has been updated by wulf: > > URL: https://cgit.FreeBSD.org/src/commit/?id=51b2d043692cf64a23e6babc6a449a091ccd9d4d > > commit 51b2d043692cf64a23e6babc6a449a091ccd9d4d > Author: Vladimir Kondratyev > AuthorDate: 2021-04-24 18:49:27 +0000 > Commit: Vladimir Kondratyev > CommitDate: 2021-04-30 20:14:52 +0000 > > hkbd: Fix typo which disables keyboard input in kdb > > Reported by: Greg V > --- > sys/dev/hid/hkbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Oops. Attempt to do cherry-picking through interactive rebase resulted in loss of "cherry picked from commit" lines in all commits. From owner-dev-commits-src-all@freebsd.org Fri Apr 30 22:58:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 22:58:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Fri Apr 30 23:21:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 541F562CC7B; Fri, 30 Apr 2021 23:21: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 4FX7fZ1fLGz3lkK; Fri, 30 Apr 2021 23:21: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 2B7B15014; Fri, 30 Apr 2021 23:21: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 13UNLQj4052317; Fri, 30 Apr 2021 23:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UNLQUA052316; Fri, 30 Apr 2021 23:21:26 GMT (envelope-from git) Date: Fri, 30 Apr 2021 23:21:26 GMT Message-Id: <202104302321.13UNLQUA052316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0a1fdb867c72 - stable/12 - nfsv4 client: do the BindConnectionToSession as required MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a1fdb867c72a1009b4a194deb9978289cf5a3cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 23:21:26 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0a1fdb867c72a1009b4a194deb9978289cf5a3cd commit 0a1fdb867c72a1009b4a194deb9978289cf5a3cd Author: Rick Macklem AuthorDate: 2021-04-11 21:34:57 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 23:16:11 +0000 nfsv4 client: do the BindConnectionToSession as required During a recent testing event, it was reported that the NFSv4.1 server erroneously bound the back channel to a new TCP connection. RFC5661 specifies that the fore channel is implicitly bound to a new TCP connection when an RPC with Sequence (almost any of them) is done on it. For the back channel to be bound to the new TCP connection, an explicit BindConnectionToSession must be done as the first RPC on the new connection. Since new TCP connections are created by the "reconnect" layer (sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional upcall done by the krpc whenever a new connection is created. The patch also adds the specific upcall function that does a BindConnectionToSession and configures the krpc to call it when required. This is necessary for correct interoperability with NFSv4.1 servers when the nfscbd daemon is running. If doing NFSv4.1 mounts without this patch, it is recommended that the nfscbd daemon not be running and that the "pnfs" mount option not be specified. PR: 254840 (cherry picked from commit 7763814fc9c27a98fefcbf582d7a936ea43af23a) --- sys/fs/nfs/nfs_commonsubs.c | 5 ++- sys/fs/nfs/nfs_var.h | 1 + sys/fs/nfs/nfscl.h | 5 +++ sys/fs/nfs/nfsport.h | 7 +++- sys/fs/nfs/nfsproto.h | 5 ++- sys/fs/nfsclient/nfs_clrpcops.c | 89 +++++++++++++++++++++++++++++++++++++++++ sys/rpc/clnt.h | 6 +++ sys/rpc/clnt_rc.c | 15 +++++++ sys/rpc/krpc.h | 3 ++ 9 files changed, 131 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index d004fbb1bc51..07652fbdb911 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -192,7 +192,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; */ static int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -267,6 +267,7 @@ static struct { { NFSV4OP_COMMIT, 1, "CommitDS", 8, }, { NFSV4OP_OPEN, 3, "OpenLayoutGet", 13, }, { NFSV4OP_OPEN, 8, "CreateLayGet", 12, }, + { NFSV4OP_BINDCONNTOSESS, 1, "BindConSess", 11, }, }; /* @@ -275,7 +276,7 @@ static struct { static int nfs_bigrequest[NFSV41_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 }; /* diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 4bc1101e3b8d..9c8942e27132 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -535,6 +535,7 @@ int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, int nfscl_findlayoutforio(struct nfscllayout *, uint64_t, uint32_t, struct nfsclflayout **); void nfscl_freenfsclds(struct nfsclds *); +void nfsrpc_bindconnsess(CLIENT *, void *, struct ucred *); /* nfs_clstate.c */ int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int, diff --git a/sys/fs/nfs/nfscl.h b/sys/fs/nfs/nfscl.h index 52da0af6fa51..3d7afaf68432 100644 --- a/sys/fs/nfs/nfscl.h +++ b/sys/fs/nfs/nfscl.h @@ -81,4 +81,9 @@ struct nfsv4node { printf(__VA_ARGS__); \ } while (0) +struct nfscl_reconarg { + int minorvers; + uint8_t sessionid[NFSX_V4SESSIONID]; +}; + #endif /* _NFS_NFSCL_H */ diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 177fcad5443d..a0181df0bde7 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -357,10 +357,13 @@ #define NFSPROC_OPENLAYGET 54 #define NFSPROC_CREATELAYGET 55 +/* BindConnectionToSession, done by the krpc for a new connection. */ +#define NFSPROC_BINDCONNTOSESS 56 + /* * Must be defined as one higher than the last NFSv4.1 Proc# above. */ -#define NFSV41_NPROCS 56 +#define NFSV41_NPROCS 57 #endif /* NFS_V3NPROCS */ @@ -389,7 +392,7 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV41_NPROCS + 13]; + uint64_t rpccnt[NFSV41_NPROCS + 12]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS]; uint64_t srvrpc_errs; diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 2e9f6d7b9dbe..ff712df5e54c 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -359,10 +359,13 @@ #define NFSPROC_OPENLAYGET 54 #define NFSPROC_CREATELAYGET 55 +/* BindConnectionToSession, done by the krpc for a new connection. */ +#define NFSPROC_BINDCONNTOSESS 56 + /* * Must be defined as one higher than the last NFSv4.1 Proc# above. */ -#define NFSV41_NPROCS 56 +#define NFSV41_NPROCS 57 #endif /* NFS_V3NPROCS */ diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 6143edb93895..0666a4a9dac2 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -924,6 +924,8 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, struct nfsclds *dsp; struct in6_addr a6; struct nfsclsession *tsep; + struct rpc_reconupcall recon; + struct nfscl_reconarg *rcp; if (nfsboottime.tv_sec == 0) NFSSETBOOTTIME(nfsboottime); @@ -942,6 +944,23 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, &nmp->nm_sockreq, dsp->nfsclds_sess.nfsess_sequenceid, 1, cred, p); if (error == 0) { + /* + * If the session supports a backchannel, set up + * the BindConnectionToSession call in the krpc + * so that it is done on a reconnection. + */ + if (nfscl_enablecallb != 0 && nfs_numnfscbd > 0) { + rcp = mem_alloc(sizeof(*rcp)); + rcp->minorvers = nmp->nm_minorvers; + memcpy(rcp->sessionid, + dsp->nfsclds_sess.nfsess_sessionid, + NFSX_V4SESSIONID); + recon.call = nfsrpc_bindconnsess; + recon.arg = rcp; + CLNT_CONTROL(nmp->nm_client, CLSET_RECONUPCALL, + &recon); + } + NFSLOCKMNT(nmp); /* * The old sessions cannot be safely free'd @@ -7680,3 +7699,73 @@ out: return (laystat); } +/* + * Do the NFSv4.1 Bind Connection to Session. + * Called from the reconnect layer of the krpc (sys/rpc/clnt_rc.c). + */ +void +nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucred *cr) +{ + struct nfscl_reconarg *rcp = (struct nfscl_reconarg *)arg; + uint32_t res, *tl; + struct nfsrv_descript nfsd; + struct nfsrv_descript *nd = &nfsd; + struct rpc_callextra ext; + struct timeval utimeout; + enum clnt_stat stat; + int error; + + nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, + NFS_VER4, rcp->minorvers); + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); + memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); + tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; + *tl++ = txdr_unsigned(NFSCDFC4_FORE_OR_BOTH); + *tl = newnfs_false; + + memset(&ext, 0, sizeof(ext)); + utimeout.tv_sec = 30; + utimeout.tv_usec = 0; + ext.rc_auth = authunix_create(cr); + nd->nd_mrep = NULL; + stat = CLNT_CALL_MBUF(cl, &ext, NFSV4PROC_COMPOUND, nd->nd_mreq, + &nd->nd_mrep, utimeout); + AUTH_DESTROY(ext.rc_auth); + if (stat != RPC_SUCCESS) { + printf("nfsrpc_bindconnsess: call failed stat=%d\n", stat); + return; + } + if (nd->nd_mrep == NULL) { + printf("nfsrpc_bindconnsess: no reply args\n"); + return; + } + error = 0; + newnfs_realign(&nd->nd_mrep, M_WAITOK); + nd->nd_md = nd->nd_mrep; + nd->nd_dpos = mtod(nd->nd_md, char *); + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + nd->nd_repstat = fxdr_unsigned(uint32_t, *tl++); + if (nd->nd_repstat == NFSERR_OK) { + res = fxdr_unsigned(uint32_t, *tl); + if (res > 0 && (error = nfsm_advance(nd, NFSM_RNDUP(res), + -1)) != 0) + goto nfsmout; + NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + + 4 * NFSX_UNSIGNED); + tl += 3; + if (!NFSBCMP(tl, rcp->sessionid, NFSX_V4SESSIONID)) { + tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; + res = fxdr_unsigned(uint32_t, *tl); + if (res != NFSCDFS4_BOTH) + printf("nfsrpc_bindconnsess: did not " + "return FS4_BOTH\n"); + } else + printf("nfsrpc_bindconnsess: not same " + "sessionid\n"); + } else if (nd->nd_repstat != NFSERR_BADSESSION) + printf("nfsrpc_bindconnsess: returned %d\n", nd->nd_repstat); +nfsmout: + if (error != 0) + printf("nfsrpc_bindconnsess: reply bad xdr\n"); + m_freem(nd->nd_mrep); +} diff --git a/sys/rpc/clnt.h b/sys/rpc/clnt.h index 26a21cf13187..b36f37f7f3cc 100644 --- a/sys/rpc/clnt.h +++ b/sys/rpc/clnt.h @@ -357,6 +357,12 @@ enum clnt_stat clnt_call_private(CLIENT *, struct rpc_callextra *, rpcproc_t, #define CLSET_PRIVPORT 27 /* set privileged source port flag */ #define CLGET_PRIVPORT 28 /* get privileged source port flag */ #define CLSET_BACKCHANNEL 29 /* set backchannel for socket */ +/* Structure used as the argument for CLSET_RECONUPCALL. */ +struct rpc_reconupcall { + void (*call)(CLIENT *, void *, struct ucred *); + void *arg; +}; +#define CLSET_RECONUPCALL 30 /* Reconnect upcall */ #endif diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c index 5254f4c8c450..c50d5a8a6776 100644 --- a/sys/rpc/clnt_rc.c +++ b/sys/rpc/clnt_rc.c @@ -108,6 +108,8 @@ clnt_reconnect_create( rc->rc_closed = FALSE; rc->rc_ucred = crdup(curthread->td_ucred); rc->rc_client = NULL; + rc->rc_reconcall = NULL; + rc->rc_reconarg = NULL; cl->cl_refs = 1; cl->cl_ops = &clnt_reconnect_ops; @@ -193,6 +195,9 @@ clnt_reconnect_connect(CLIENT *cl) newclient = clnt_vc_create(so, (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers, rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr); + if (newclient != NULL && rc->rc_reconcall != NULL) + (*rc->rc_reconcall)(newclient, rc->rc_reconarg, + rc->rc_ucred); } td->td_ucred = oldcred; @@ -385,6 +390,7 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) { struct rc_data *rc = (struct rc_data *)cl->cl_private; SVCXPRT *xprt; + struct rpc_reconupcall *upcp; if (info == NULL) { return (FALSE); @@ -472,6 +478,12 @@ clnt_reconnect_control(CLIENT *cl, u_int request, void *info) rc->rc_backchannel = info; break; + case CLSET_RECONUPCALL: + upcp = (struct rpc_reconupcall *)info; + rc->rc_reconcall = upcp->call; + rc->rc_reconarg = upcp->arg; + break; + default: return (FALSE); } @@ -514,11 +526,14 @@ clnt_reconnect_destroy(CLIENT *cl) CLNT_DESTROY(rc->rc_client); if (rc->rc_backchannel) { xprt = (SVCXPRT *)rc->rc_backchannel; + KASSERT(xprt->xp_socket == NULL, + ("clnt_reconnect_destroy: xp_socket not NULL")); xprt_unregister(xprt); SVC_RELEASE(xprt); } crfree(rc->rc_ucred); mtx_destroy(&rc->rc_lock); + mem_free(rc->rc_reconarg, 0); mem_free(rc, sizeof(*rc)); mem_free(cl, sizeof (CLIENT)); } diff --git a/sys/rpc/krpc.h b/sys/rpc/krpc.h index 43fd742db71a..76e77047aa59 100644 --- a/sys/rpc/krpc.h +++ b/sys/rpc/krpc.h @@ -78,6 +78,9 @@ struct rc_data { CLIENT* rc_client; /* underlying RPC client */ struct rpc_err rc_err; void *rc_backchannel; + void (*rc_reconcall)(CLIENT *, void *, + struct ucred *); /* reconection upcall */ + void *rc_reconarg; /* upcall arg */ }; struct ct_data { From owner-dev-commits-src-all@freebsd.org Fri Apr 30 23:31:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74C2062D815; Fri, 30 Apr 2021 23:31: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 4FX7t82wqvz3mT2; Fri, 30 Apr 2021 23:31: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 578F65242; Fri, 30 Apr 2021 23:31: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 13UNVSQr067426; Fri, 30 Apr 2021 23:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UNVS88067425; Fri, 30 Apr 2021 23:31:28 GMT (envelope-from git) Date: Fri, 30 Apr 2021 23:31:28 GMT Message-Id: <202104302331.13UNVS88067425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d36cc12ddfe3 - stable/12 - param.h: bump __FreeBSD_version to 1202506 for commit 0a1fdb867c72 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d36cc12ddfe3335ec8306bd4b393f11069551fa0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 23:31:28 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d36cc12ddfe3335ec8306bd4b393f11069551fa0 commit d36cc12ddfe3335ec8306bd4b393f11069551fa0 Author: Rick Macklem AuthorDate: 2021-04-30 23:28:46 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 23:28:46 +0000 param.h: bump __FreeBSD_version to 1202506 for commit 0a1fdb867c72 Commit 0a1fdb867c72 changed the internal KAPI between the krpc and NFS. As such, the krpc, nfscommon and nfscl modules must all 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 1473009481e0..89ab74bc07a6 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 1202505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Fri Apr 30 23:38:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49CD662D665; Fri, 30 Apr 2021 23:38: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 4FX8261TSRz3mf8; Fri, 30 Apr 2021 23:38: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 259D95058; Fri, 30 Apr 2021 23:38: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 13UNcM8h068043; Fri, 30 Apr 2021 23:38:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UNcM5S068042; Fri, 30 Apr 2021 23:38:22 GMT (envelope-from git) Date: Fri, 30 Apr 2021 23:38:22 GMT Message-Id: <202104302338.13UNcM5S068042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2e26b41fe54c - stable/12 - UPDATING: add an entry for commit 0a1fdb867c72 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2e26b41fe54c81230ad802d00b95bbbd3b2eeea9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 23:38:22 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2e26b41fe54c81230ad802d00b95bbbd3b2eeea9 commit 2e26b41fe54c81230ad802d00b95bbbd3b2eeea9 Author: Rick Macklem AuthorDate: 2021-04-30 23:35:39 +0000 Commit: Rick Macklem CommitDate: 2021-04-30 23:35:39 +0000 UPDATING: add an entry for commit 0a1fdb867c72 --- UPDATING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UPDATING b/UPDATING index cc5ac276432d..225f0ca05baa 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20210430: + Commit 0a1fdb867c72 changed the internal KAPI between + the krpc and NFS. As such, the krpc, nfscommon and + nfscl modules must all be rebuilt from sources. + Without this patch, NFSv4.1 mounts should not + be done with the nfscbd(8) daemon running, to avoid + needing a working back channel for server->client RPCs. + 20200912: The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and enabling assertions and statistics gathering in malloc(3), has been From owner-dev-commits-src-all@freebsd.org Sat May 1 00:38:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 177FA62E5B4; Sat, 1 May 2021 00:38: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 4FX9N003XHz3pp6; Sat, 1 May 2021 00:38: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 E8AC85DA4; Sat, 1 May 2021 00:38: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 1410ctBG047946; Sat, 1 May 2021 00:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410ctvu047945; Sat, 1 May 2021 00:38:55 GMT (envelope-from git) Date: Sat, 1 May 2021 00:38:55 GMT Message-Id: <202105010038.1410ctvu047945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 56e711d581d8 - stable/12 - linuxkpi: copy ldev into local to test and free the same pointer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 56e711d581d8004104311fa654f3cc4ece1907c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:38:56 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56e711d581d8004104311fa654f3cc4ece1907c9 commit 56e711d581d8004104311fa654f3cc4ece1907c9 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:41:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:28 +0000 linuxkpi: copy ldev into local to test and free the same pointer (cherry picked from commit 7b0125cbec1579a0a1bf38f7abe583b5f6fd79e7) --- sys/compat/linuxkpi/common/src/linux_compat.c | 5 +- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 2598 ++++++++++++++++++++ 2 files changed, 2601 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index e758a5590bc9..21856a5257d9 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1526,8 +1526,9 @@ linux_file_close(struct file *file, struct thread *td) if (filp->f_vnode != NULL) vdrop(filp->f_vnode); linux_drop_fop(ldev); - if (filp->f_cdev != NULL) - linux_cdev_deref(filp->f_cdev); + ldev = filp->f_cdev; + if (ldev != NULL) + linux_cdev_deref(ldev); kfree(filp); return (error); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig new file mode 100644 index 000000000000..42f47b6e510a --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -0,0 +1,2598 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_stack.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#if defined(__i386__) || defined(__amd64__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__i386__) || defined(__amd64__) +#include +#endif + +SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "LinuxKPI parameters"); + +int linuxkpi_debug; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, + &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); + +static struct timeval lkpi_net_lastlog; +static int lkpi_net_curpps; +static int lkpi_net_maxpps = 99; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, net_ratelimit, CTLFLAG_RWTUN, + &lkpi_net_maxpps, 0, "Limit number of LinuxKPI net messages per second."); + +MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); + +#include +/* Undo Linux compat changes. */ +#undef RB_ROOT +#undef file +#undef cdev +#define RB_ROOT(head) (head)->rbh_root + +static void linux_cdev_deref(struct linux_cdev *ldev); +static struct vm_area_struct *linux_cdev_handle_find(void *handle); + +struct kobject linux_class_root; +struct device linux_root_device; +struct class linux_class_misc; +struct list_head pci_drivers; +struct list_head pci_devices; +spinlock_t pci_lock; + +unsigned long linux_timer_hz_mask; + +wait_queue_head_t linux_bit_waitq; +wait_queue_head_t linux_var_waitq; + +int +panic_cmp(struct rb_node *one, struct rb_node *two) +{ + panic("no cmp"); +} + +RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); + +int +kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) +{ + va_list tmp_va; + int len; + char *old; + char *name; + char dummy; + + old = kobj->name; + + if (old && fmt == NULL) + return (0); + + /* compute length of string */ + va_copy(tmp_va, args); + len = vsnprintf(&dummy, 0, fmt, tmp_va); + va_end(tmp_va); + + /* account for zero termination */ + len++; + + /* check for error */ + if (len < 1) + return (-EINVAL); + + /* allocate memory for string */ + name = kzalloc(len, GFP_KERNEL); + if (name == NULL) + return (-ENOMEM); + vsnprintf(name, len, fmt, args); + kobj->name = name; + + /* free old string */ + kfree(old); + + /* filter new string */ + for (; *name != '\0'; name++) + if (*name == '/') + *name = '!'; + return (0); +} + +int +kobject_set_name(struct kobject *kobj, const char *fmt, ...) +{ + va_list args; + int error; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + + return (error); +} + +static int +kobject_add_complete(struct kobject *kobj, struct kobject *parent) +{ + const struct kobj_type *t; + int error; + + kobj->parent = parent; + error = sysfs_create_dir(kobj); + if (error == 0 && kobj->ktype && kobj->ktype->default_attrs) { + struct attribute **attr; + t = kobj->ktype; + + for (attr = t->default_attrs; *attr != NULL; attr++) { + error = sysfs_create_file(kobj, *attr); + if (error) + break; + } + if (error) + sysfs_remove_dir(kobj); + } + return (error); +} + +int +kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...) +{ + va_list args; + int error; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + if (error) + return (error); + + return kobject_add_complete(kobj, parent); +} + +void +linux_kobject_release(struct kref *kref) +{ + struct kobject *kobj; + char *name; + + kobj = container_of(kref, struct kobject, kref); + sysfs_remove_dir(kobj); + name = kobj->name; + if (kobj->ktype && kobj->ktype->release) + kobj->ktype->release(kobj); + kfree(name); +} + +static void +linux_kobject_kfree(struct kobject *kobj) +{ + kfree(kobj); +} + +static void +linux_kobject_kfree_name(struct kobject *kobj) +{ + if (kobj) { + kfree(kobj->name); + } +} + +const struct kobj_type linux_kfree_type = { + .release = linux_kobject_kfree +}; + +static void +linux_device_release(struct device *dev) +{ + pr_debug("linux_device_release: %s\n", dev_name(dev)); + kfree(dev); +} + +static ssize_t +linux_class_show(struct kobject *kobj, struct attribute *attr, char *buf) +{ + struct class_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct class_attribute, attr); + error = -EIO; + if (dattr->show) + error = dattr->show(container_of(kobj, struct class, kobj), + dattr, buf); + return (error); +} + +static ssize_t +linux_class_store(struct kobject *kobj, struct attribute *attr, const char *buf, + size_t count) +{ + struct class_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct class_attribute, attr); + error = -EIO; + if (dattr->store) + error = dattr->store(container_of(kobj, struct class, kobj), + dattr, buf, count); + return (error); +} + +static void +linux_class_release(struct kobject *kobj) +{ + struct class *class; + + class = container_of(kobj, struct class, kobj); + if (class->class_release) + class->class_release(class); +} + +static const struct sysfs_ops linux_class_sysfs = { + .show = linux_class_show, + .store = linux_class_store, +}; + +const struct kobj_type linux_class_ktype = { + .release = linux_class_release, + .sysfs_ops = &linux_class_sysfs +}; + +static void +linux_dev_release(struct kobject *kobj) +{ + struct device *dev; + + dev = container_of(kobj, struct device, kobj); + /* This is the precedence defined by linux. */ + if (dev->release) + dev->release(dev); + else if (dev->class && dev->class->dev_release) + dev->class->dev_release(dev); +} + +static ssize_t +linux_dev_show(struct kobject *kobj, struct attribute *attr, char *buf) +{ + struct device_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct device_attribute, attr); + error = -EIO; + if (dattr->show) + error = dattr->show(container_of(kobj, struct device, kobj), + dattr, buf); + return (error); +} + +static ssize_t +linux_dev_store(struct kobject *kobj, struct attribute *attr, const char *buf, + size_t count) +{ + struct device_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct device_attribute, attr); + error = -EIO; + if (dattr->store) + error = dattr->store(container_of(kobj, struct device, kobj), + dattr, buf, count); + return (error); +} + +static const struct sysfs_ops linux_dev_sysfs = { + .show = linux_dev_show, + .store = linux_dev_store, +}; + +const struct kobj_type linux_dev_ktype = { + .release = linux_dev_release, + .sysfs_ops = &linux_dev_sysfs +}; + +struct device * +device_create(struct class *class, struct device *parent, dev_t devt, + void *drvdata, const char *fmt, ...) +{ + struct device *dev; + va_list args; + + dev = kzalloc(sizeof(*dev), M_WAITOK); + dev->parent = parent; + dev->class = class; + dev->devt = devt; + dev->driver_data = drvdata; + dev->release = linux_device_release; + va_start(args, fmt); + kobject_set_name_vargs(&dev->kobj, fmt, args); + va_end(args); + device_register(dev); + + return (dev); +} + +int +kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, + struct kobject *parent, const char *fmt, ...) +{ + va_list args; + int error; + + kobject_init(kobj, ktype); + kobj->ktype = ktype; + kobj->parent = parent; + kobj->name = NULL; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + if (error) + return (error); + return kobject_add_complete(kobj, parent); +} + +static void +linux_kq_lock(void *arg) +{ + spinlock_t *s = arg; + + spin_lock(s); +} +static void +linux_kq_unlock(void *arg) +{ + spinlock_t *s = arg; + + spin_unlock(s); +} + +static void +linux_kq_assert_lock(void *arg, int what) +{ +#ifdef INVARIANTS + spinlock_t *s = arg; + + if (what == LA_LOCKED) + mtx_assert(&s->m, MA_OWNED); + else + mtx_assert(&s->m, MA_NOTOWNED); +#endif +} + +static void +linux_file_kqfilter_poll(struct linux_file *, int); + +struct linux_file * +linux_file_alloc(void) +{ + struct linux_file *filp; + + filp = kzalloc(sizeof(*filp), GFP_KERNEL); + + /* set initial refcount */ + filp->f_count = 1; + + /* setup fields needed by kqueue support */ + spin_lock_init(&filp->f_kqlock); + knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, + linux_kq_lock, linux_kq_unlock, linux_kq_assert_lock); + + return (filp); +} + +void +linux_file_free(struct linux_file *filp) +{ + if (filp->_file == NULL) { + if (filp->f_shmem != NULL) + vm_object_deallocate(filp->f_shmem); + kfree(filp); + } else { + /* + * The close method of the character device or file + * will free the linux_file structure: + */ + _fdrop(filp->_file, curthread); + } +} + +static int +linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, + vm_page_t *mres) +{ + struct vm_area_struct *vmap; + + vmap = linux_cdev_handle_find(vm_obj->handle); + + MPASS(vmap != NULL); + MPASS(vmap->vm_private_data == vm_obj->handle); + + if (likely(vmap->vm_ops != NULL && offset < vmap->vm_len)) { + vm_paddr_t paddr = IDX_TO_OFF(vmap->vm_pfn) + offset; + vm_page_t page; + + if (((*mres)->flags & PG_FICTITIOUS) != 0) { + /* + * If the passed in result page is a fake + * page, update it with the new physical + * address. + */ + page = *mres; + vm_page_updatefake(page, paddr, vm_obj->memattr); + } else { + /* + * Replace the passed in "mres" page with our + * own fake page and free up the all of the + * original pages. + */ + VM_OBJECT_WUNLOCK(vm_obj); + page = vm_page_getfake(paddr, vm_obj->memattr); + VM_OBJECT_WLOCK(vm_obj); + + vm_page_replace(page, vm_obj, (*mres)->pindex, *mres); + *mres = page; + } + vm_page_valid(page); + return (VM_PAGER_OK); + } + return (VM_PAGER_FAIL); +} + +static int +linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + struct vm_area_struct *vmap; + int err; + + /* get VM area structure */ + vmap = linux_cdev_handle_find(vm_obj->handle); + MPASS(vmap != NULL); + MPASS(vmap->vm_private_data == vm_obj->handle); + + VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); + + down_write(&vmap->vm_mm->mmap_sem); + if (unlikely(vmap->vm_ops == NULL)) { + err = VM_FAULT_SIGBUS; + } else { + struct vm_fault vmf; + + /* fill out VM fault structure */ + vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); + vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; + vmf.pgoff = 0; + vmf.page = NULL; + vmf.vma = vmap; + + vmap->vm_pfn_count = 0; + vmap->vm_pfn_pcount = &vmap->vm_pfn_count; + vmap->vm_obj = vm_obj; + + err = vmap->vm_ops->fault(vmap, &vmf); + + while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) { + kern_yield(PRI_USER); + err = vmap->vm_ops->fault(vmap, &vmf); + } + } + + /* translate return code */ + switch (err) { + case VM_FAULT_OOM: + err = VM_PAGER_AGAIN; + break; + case VM_FAULT_SIGBUS: + err = VM_PAGER_BAD; + break; + case VM_FAULT_NOPAGE: + /* + * By contract the fault handler will return having + * busied all the pages itself. If pidx is already + * found in the object, it will simply xbusy the first + * page and return with vm_pfn_count set to 1. + */ + *first = vmap->vm_pfn_first; + *last = *first + vmap->vm_pfn_count - 1; + err = VM_PAGER_OK; + break; + default: + err = VM_PAGER_ERROR; + break; + } + up_write(&vmap->vm_mm->mmap_sem); + VM_OBJECT_WLOCK(vm_obj); + return (err); +} + +static struct rwlock linux_vma_lock; +static TAILQ_HEAD(, vm_area_struct) linux_vma_head = + TAILQ_HEAD_INITIALIZER(linux_vma_head); + +static void +linux_cdev_handle_free(struct vm_area_struct *vmap) +{ + /* Drop reference on vm_file */ + if (vmap->vm_file != NULL) + fput(vmap->vm_file); + + /* Drop reference on mm_struct */ + mmput(vmap->vm_mm); + + kfree(vmap); +} + +static void +linux_cdev_handle_remove(struct vm_area_struct *vmap) +{ + rw_wlock(&linux_vma_lock); + TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry); + rw_wunlock(&linux_vma_lock); +} + +static struct vm_area_struct * +linux_cdev_handle_find(void *handle) +{ + struct vm_area_struct *vmap; + + rw_rlock(&linux_vma_lock); + TAILQ_FOREACH(vmap, &linux_vma_head, vm_entry) { + if (vmap->vm_private_data == handle) + break; + } + rw_runlock(&linux_vma_lock); + return (vmap); +} + +static int +linux_cdev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + + MPASS(linux_cdev_handle_find(handle) != NULL); + *color = 0; + return (0); +} + +static void +linux_cdev_pager_dtor(void *handle) +{ + const struct vm_operations_struct *vm_ops; + struct vm_area_struct *vmap; + + vmap = linux_cdev_handle_find(handle); + MPASS(vmap != NULL); + + /* + * Remove handle before calling close operation to prevent + * other threads from reusing the handle pointer. + */ + linux_cdev_handle_remove(vmap); + + down_write(&vmap->vm_mm->mmap_sem); + vm_ops = vmap->vm_ops; + if (likely(vm_ops != NULL)) + vm_ops->close(vmap); + up_write(&vmap->vm_mm->mmap_sem); + + linux_cdev_handle_free(vmap); +} + +static struct cdev_pager_ops linux_cdev_pager_ops[2] = { + { + /* OBJT_MGTDEVICE */ + .cdev_pg_populate = linux_cdev_pager_populate, + .cdev_pg_ctor = linux_cdev_pager_ctor, + .cdev_pg_dtor = linux_cdev_pager_dtor + }, + { + /* OBJT_DEVICE */ + .cdev_pg_fault = linux_cdev_pager_fault, + .cdev_pg_ctor = linux_cdev_pager_ctor, + .cdev_pg_dtor = linux_cdev_pager_dtor + }, +}; + +int +zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size) +{ + vm_object_t obj; + vm_page_t m; + + obj = vma->vm_obj; + if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) + return (-ENOTSUP); + VM_OBJECT_RLOCK(obj); + for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); + m != NULL && m->pindex < OFF_TO_IDX(address + size); + m = TAILQ_NEXT(m, listq)) + pmap_remove_all(m); + VM_OBJECT_RUNLOCK(obj); + return (0); +} + +static struct file_operations dummy_ldev_ops = { + /* XXXKIB */ +}; + +static struct linux_cdev dummy_ldev = { + .ops = &dummy_ldev_ops, +}; + +#define LDEV_SI_DTR 0x0001 +#define LDEV_SI_REF 0x0002 + +static void +linux_get_fop(struct linux_file *filp, const struct file_operations **fop, + struct linux_cdev **dev) +{ + struct linux_cdev *ldev; + u_int siref; + + ldev = filp->f_cdev; + *fop = filp->f_op; + if (ldev != NULL) { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + siref = ldev->siref; + *fop = ldev->ops; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, &siref, + siref + LDEV_SI_REF)) { + break; + } + } + } + *dev = ldev; +} + +static void +linux_drop_fop(struct linux_cdev *ldev) +{ + + if (ldev == NULL) + return; + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); +} + +#define OPW(fp,td,code) ({ \ + struct file *__fpop; \ + __typeof(code) __retval; \ + \ + __fpop = (td)->td_fpop; \ + (td)->td_fpop = (fp); \ + __retval = (code); \ + (td)->td_fpop = __fpop; \ + __retval; \ +}) + +static int +linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, + struct file *file) +{ + struct linux_cdev *ldev; + struct linux_file *filp; + const struct file_operations *fop; + int error; + + ldev = dev->si_drv1; + + filp = linux_file_alloc(); + filp->f_dentry = &filp->f_dentry_store; + filp->f_op = ldev->ops; + filp->f_mode = file->f_flag; + filp->f_flags = file->f_flag; + filp->f_vnode = file->f_vnode; + filp->_file = file; + refcount_acquire(&ldev->refs); + filp->f_cdev = ldev; + + linux_set_current(td); + linux_get_fop(filp, &fop, &ldev); + + if (fop->open != NULL) { + error = -fop->open(file->f_vnode, filp); + if (error != 0) { + linux_drop_fop(ldev); + linux_cdev_deref(filp->f_cdev); + kfree(filp); + return (error); + } + } + + /* hold on to the vnode - used for fstat() */ + vhold(filp->f_vnode); + + /* release the file from devfs */ + finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + linux_drop_fop(ldev); + return (ENXIO); +} + +#define LINUX_IOCTL_MIN_PTR 0x10000UL +#define LINUX_IOCTL_MAX_PTR (LINUX_IOCTL_MIN_PTR + IOCPARM_MAX) + +static inline int +linux_remap_address(void **uaddr, size_t len) +{ + uintptr_t uaddr_val = (uintptr_t)(*uaddr); + + if (unlikely(uaddr_val >= LINUX_IOCTL_MIN_PTR && + uaddr_val < LINUX_IOCTL_MAX_PTR)) { + struct task_struct *pts = current; + if (pts == NULL) { + *uaddr = NULL; + return (1); + } + + /* compute data offset */ + uaddr_val -= LINUX_IOCTL_MIN_PTR; + + /* check that length is within bounds */ + if ((len > IOCPARM_MAX) || + (uaddr_val + len) > pts->bsd_ioctl_len) { + *uaddr = NULL; + return (1); + } + + /* re-add kernel buffer address */ + uaddr_val += (uintptr_t)pts->bsd_ioctl_data; + + /* update address location */ + *uaddr = (void *)uaddr_val; + return (1); + } + return (0); +} + +int +linux_copyin(const void *uaddr, void *kaddr, size_t len) +{ + if (linux_remap_address(__DECONST(void **, &uaddr), len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(kaddr, uaddr, len); + return (0); + } + return (-copyin(uaddr, kaddr, len)); +} + +int +linux_copyout(const void *kaddr, void *uaddr, size_t len) +{ + if (linux_remap_address(&uaddr, len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(uaddr, kaddr, len); + return (0); + } + return (-copyout(kaddr, uaddr, len)); +} + +size_t +linux_clear_user(void *_uaddr, size_t _len) +{ + uint8_t *uaddr = _uaddr; + size_t len = _len; + + /* make sure uaddr is aligned before going into the fast loop */ + while (((uintptr_t)uaddr & 7) != 0 && len > 7) { + if (subyte(uaddr, 0)) + return (_len); + uaddr++; + len--; + } + + /* zero 8 bytes at a time */ + while (len > 7) { +#ifdef __LP64__ + if (suword64(uaddr, 0)) + return (_len); +#else + if (suword32(uaddr, 0)) + return (_len); + if (suword32(uaddr + 4, 0)) + return (_len); +#endif + uaddr += 8; + len -= 8; + } + + /* zero fill end, if any */ + while (len > 0) { + if (subyte(uaddr, 0)) + return (_len); + uaddr++; + len--; + } + return (0); +} + +int +linux_access_ok(const void *uaddr, size_t len) +{ + uintptr_t saddr; + uintptr_t eaddr; + + /* get start and end address */ + saddr = (uintptr_t)uaddr; + eaddr = (uintptr_t)uaddr + len; + + /* verify addresses are valid for userspace */ + return ((saddr == eaddr) || + (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); +} + +/* + * This function should return either EINTR or ERESTART depending on + * the signal type sent to this thread: + */ +static int +linux_get_error(struct task_struct *task, int error) +{ + /* check for signal type interrupt code */ + if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { + error = -linux_schedule_get_interrupt_value(task); + if (error == 0) + error = EINTR; + } + return (error); +} + +static int +linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, + const struct file_operations *fop, u_long cmd, caddr_t data, + struct thread *td) +{ + struct task_struct *task = current; + unsigned size; + int error; + + size = IOCPARM_LEN(cmd); + /* refer to logic in sys_ioctl() */ + if (size > 0) { + /* + * Setup hint for linux_copyin() and linux_copyout(). + * + * Background: Linux code expects a user-space address + * while FreeBSD supplies a kernel-space address. + */ + task->bsd_ioctl_data = data; *** 1651 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat May 1 00:38:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33E9662E5B6; Sat, 1 May 2021 00:38: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 4FX9N111KBz3prj; Sat, 1 May 2021 00:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15C005C5F; Sat, 1 May 2021 00:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410cuZ4047967; Sat, 1 May 2021 00:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410cu0e047966; Sat, 1 May 2021 00:38:56 GMT (envelope-from git) Date: Sat, 1 May 2021 00:38:56 GMT Message-Id: <202105010038.1410cu0e047966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: db28c19602dd - stable/12 - linuxkpi: rename cdev to ldev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: db28c19602dd42bbace4de386814cc0063556344 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:38:57 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=db28c19602dd42bbace4de386814cc0063556344 commit db28c19602dd42bbace4de386814cc0063556344 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:43:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:28 +0000 linuxkpi: rename cdev to ldev (cherry picked from commit 28b482e2baf43cdd30e8b9bd090e6d9f405cf4b3) --- sys/compat/linuxkpi/common/src/linux_compat.c | 6 +++--- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 21856a5257d9..9c307650f1fd 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2201,12 +2201,12 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { - struct linux_cdev *cdev; + struct linux_cdev *ldev; struct kobject *parent; - cdev = container_of(kobj, struct linux_cdev, kobj); + ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(cdev); + linux_destroy_dev(ldev); kobject_put(parent); } diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 42f47b6e510a..b7a7ba8b4f18 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -1520,8 +1520,9 @@ linux_file_close(struct file *file, struct thread *td) if (filp->f_vnode != NULL) vdrop(filp->f_vnode); linux_drop_fop(ldev); - if (filp->f_cdev != NULL) - linux_cdev_deref(filp->f_cdev); + ldev = filp->f_cdev; + if (ldev != NULL) + linux_cdev_deref(ldev); kfree(filp); return (error); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:38:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50C5E62E7C9; Sat, 1 May 2021 00:38: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 4FX9N21gHdz3prv; Sat, 1 May 2021 00:38: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 2B3F15DA5; Sat, 1 May 2021 00:38: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 1410cwP9047988; Sat, 1 May 2021 00:38:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410cw1L047987; Sat, 1 May 2021 00:38:58 GMT (envelope-from git) Date: Sat, 1 May 2021 00:38:58 GMT Message-Id: <202105010038.1410cw1L047987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 07509440d2e6 - stable/12 - linuxkpi: do not destroy/free embedded linux cdevs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 07509440d2e690de06d0973ae9334aecb3b4896b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:38:58 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=07509440d2e690de06d0973ae9334aecb3b4896b commit 07509440d2e690de06d0973ae9334aecb3b4896b Author: Konstantin Belousov AuthorDate: 2021-03-30 08:44:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:28 +0000 linuxkpi: do not destroy/free embedded linux cdevs (cherry picked from commit 7f9867f8c65b1b3e590dba4dc432a4bc8cf01f68) --- sys/compat/linuxkpi/common/src/linux_compat.c | 13 ++++++++++--- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 9c307650f1fd..6058af9c3395 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2180,8 +2180,8 @@ linux_completion_done(struct completion *c) static void linux_cdev_deref(struct linux_cdev *ldev) { - - if (refcount_release(&ldev->refs)) + if (refcount_release(&ldev->refs) && + ldev->kobj.ktype == &linux_cdev_ktype) kfree(ldev); } @@ -2201,12 +2201,17 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { + struct cdev *cdev; struct linux_cdev *ldev; struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(ldev); + cdev = ldev->cdev; + if (cdev != NULL) { + destroy_dev(cdev); + ldev->cdev = NULL; + } kobject_put(parent); } @@ -2218,6 +2223,8 @@ linux_destroy_dev(struct linux_cdev *ldev) return; MPASS((ldev->siref & LDEV_SI_DTR) == 0); + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) pause("ldevdtr", hz / 4); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index b7a7ba8b4f18..0731859e7a53 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -2220,12 +2220,12 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { - struct linux_cdev *cdev; + struct linux_cdev *ldev; struct kobject *parent; - cdev = container_of(kobj, struct linux_cdev, kobj); + ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(cdev); + linux_destroy_dev(ldev); kobject_put(parent); } From owner-dev-commits-src-all@freebsd.org Sat May 1 00:38:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFE3562E9C0; Sat, 1 May 2021 00:38: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 4FX9N33SHNz3ps5; Sat, 1 May 2021 00:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4393F5EED; Sat, 1 May 2021 00:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410cxVL048009; Sat, 1 May 2021 00:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410cxYL048008; Sat, 1 May 2021 00:38:59 GMT (envelope-from git) Date: Sat, 1 May 2021 00:38:59 GMT Message-Id: <202105010038.1410cxYL048008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fb0943711a7e - stable/12 - linuxkpi: avoid counting per-thread use for the embedded linux cdevs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fb0943711a7ebde92bcc7257174167a6df9833f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:38:59 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fb0943711a7ebde92bcc7257174167a6df9833f2 commit fb0943711a7ebde92bcc7257174167a6df9833f2 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:45:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:28 +0000 linuxkpi: avoid counting per-thread use for the embedded linux cdevs (cherry picked from commit f6b108837e7df7d7bfb35ec447f7cb62afa79441) --- sys/compat/linuxkpi/common/src/linux_compat.c | 31 ++++++++++++++-------- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 13 ++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 6058af9c3395..4a734bb495ce 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -722,15 +722,19 @@ linux_get_fop(struct linux_file *filp, const struct file_operations **fop, ldev = filp->f_cdev; *fop = filp->f_op; if (ldev != NULL) { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - siref = ldev->siref; - *fop = ldev->ops; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, &siref, - siref + LDEV_SI_REF)) { - break; + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + refcount_acquire(&ldev->refs); + } else { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + *fop = ldev->ops; + siref = ldev->siref; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, + &siref, siref + LDEV_SI_REF)) { + break; + } } } } @@ -743,8 +747,13 @@ linux_drop_fop(struct linux_cdev *ldev) if (ldev == NULL) return; - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + linux_cdev_deref(ldev); + } else { + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + } } #define OPW(fp,td,code) ({ \ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 0731859e7a53..71ea7e0844dc 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -2199,8 +2199,8 @@ linux_completion_done(struct completion *c) static void linux_cdev_deref(struct linux_cdev *ldev) { - - if (refcount_release(&ldev->refs)) + if (refcount_release(&ldev->refs) && + ldev->kobj.ktype == &linux_cdev_ktype) kfree(ldev); } @@ -2220,12 +2220,17 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { + struct cdev *cdev; struct linux_cdev *ldev; struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(ldev); + cdev = ldev->cdev; + if (cdev != NULL) { + destroy_dev(cdev); + ldev->cdev = NULL; + } kobject_put(parent); } @@ -2237,6 +2242,8 @@ linux_destroy_dev(struct linux_cdev *ldev) return; MPASS((ldev->siref & LDEV_SI_DTR) == 0); + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) pause("ldevdtr", hz / 4); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91CDE62E664; Sat, 1 May 2021 00:39: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 4FX9N43Qzgz3pV9; Sat, 1 May 2021 00:39: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 65D5F6014; Sat, 1 May 2021 00:39: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 1410d09t048037; Sat, 1 May 2021 00:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d0cd048036; Sat, 1 May 2021 00:39:00 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:00 GMT Message-Id: <202105010039.1410d0cd048036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 941e3cd8239a - stable/12 - linuxkpi: drop single-use variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 941e3cd8239a41c40448f218bd68ddf7fd0ea87b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:00 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=941e3cd8239a41c40448f218bd68ddf7fd0ea87b commit 941e3cd8239a41c40448f218bd68ddf7fd0ea87b Author: Konstantin Belousov AuthorDate: 2021-03-30 08:46:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 linuxkpi: drop single-use variable (cherry picked from commit 8011fb795baa59ba14371d6db5ab661a5db77615) --- sys/compat/linuxkpi/common/src/linux_compat.c | 4 +-- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 31 ++++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 4a734bb495ce..7175c0f87364 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2212,16 +2212,14 @@ linux_cdev_static_release(struct kobject *kobj) { struct cdev *cdev; struct linux_cdev *ldev; - struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); - parent = kobj->parent; cdev = ldev->cdev; if (cdev != NULL) { destroy_dev(cdev); ldev->cdev = NULL; } - kobject_put(parent); + kobject_put(kobj->parent); } void diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 71ea7e0844dc..28413c59bb76 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -717,15 +717,19 @@ linux_get_fop(struct linux_file *filp, const struct file_operations **fop, ldev = filp->f_cdev; *fop = filp->f_op; if (ldev != NULL) { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - siref = ldev->siref; - *fop = ldev->ops; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, &siref, - siref + LDEV_SI_REF)) { - break; + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + refcount_acquire(&ldev->refs); + } else { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + *fop = ldev->ops; + siref = ldev->siref; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, + &siref, siref + LDEV_SI_REF)) { + break; + } } } } @@ -738,8 +742,13 @@ linux_drop_fop(struct linux_cdev *ldev) if (ldev == NULL) return; - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + linux_cdev_deref(ldev); + } else { + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + } } #define OPW(fp,td,code) ({ \ From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1FD362E4FF; Sat, 1 May 2021 00:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FX9N53gZLz3pm5; Sat, 1 May 2021 00:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D6EA5D43; Sat, 1 May 2021 00:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410d1Zt048059; Sat, 1 May 2021 00:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d1P5048058; Sat, 1 May 2021 00:39:01 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:01 GMT Message-Id: <202105010039.1410d1P5048058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e35c16556617 - stable/12 - linuxkpi: remove erronously committed diff save file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e35c16556617eab9e922686f7760c1f1cf3cea5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:02 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e35c16556617eab9e922686f7760c1f1cf3cea5b commit e35c16556617eab9e922686f7760c1f1cf3cea5b Author: Konstantin Belousov AuthorDate: 2021-04-06 00:42:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 linuxkpi: remove erronously committed diff save file (cherry picked from commit 5b3b19db7305f8255f021d6f8d94d17ab778660f) --- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 2615 -------------------- 1 file changed, 2615 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig deleted file mode 100644 index 28413c59bb76..000000000000 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ /dev/null @@ -1,2615 +0,0 @@ -/*- - * Copyright (c) 2010 Isilon Systems, Inc. - * Copyright (c) 2010 iX Systems, Inc. - * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "opt_stack.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#if defined(__i386__) || defined(__amd64__) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__i386__) || defined(__amd64__) -#include -#endif - -SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, - "LinuxKPI parameters"); - -int linuxkpi_debug; -SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, - &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); - -static struct timeval lkpi_net_lastlog; -static int lkpi_net_curpps; -static int lkpi_net_maxpps = 99; -SYSCTL_INT(_compat_linuxkpi, OID_AUTO, net_ratelimit, CTLFLAG_RWTUN, - &lkpi_net_maxpps, 0, "Limit number of LinuxKPI net messages per second."); - -MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); - -#include -/* Undo Linux compat changes. */ -#undef RB_ROOT -#undef file -#undef cdev -#define RB_ROOT(head) (head)->rbh_root - -static void linux_cdev_deref(struct linux_cdev *ldev); -static struct vm_area_struct *linux_cdev_handle_find(void *handle); - -struct kobject linux_class_root; -struct device linux_root_device; -struct class linux_class_misc; -struct list_head pci_drivers; -struct list_head pci_devices; -spinlock_t pci_lock; - -unsigned long linux_timer_hz_mask; - -wait_queue_head_t linux_bit_waitq; -wait_queue_head_t linux_var_waitq; - -int -panic_cmp(struct rb_node *one, struct rb_node *two) -{ - panic("no cmp"); -} - -RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); - -int -kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) -{ - va_list tmp_va; - int len; - char *old; - char *name; - char dummy; - - old = kobj->name; - - if (old && fmt == NULL) - return (0); - - /* compute length of string */ - va_copy(tmp_va, args); - len = vsnprintf(&dummy, 0, fmt, tmp_va); - va_end(tmp_va); - - /* account for zero termination */ - len++; - - /* check for error */ - if (len < 1) - return (-EINVAL); - - /* allocate memory for string */ - name = kzalloc(len, GFP_KERNEL); - if (name == NULL) - return (-ENOMEM); - vsnprintf(name, len, fmt, args); - kobj->name = name; - - /* free old string */ - kfree(old); - - /* filter new string */ - for (; *name != '\0'; name++) - if (*name == '/') - *name = '!'; - return (0); -} - -int -kobject_set_name(struct kobject *kobj, const char *fmt, ...) -{ - va_list args; - int error; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - - return (error); -} - -static int -kobject_add_complete(struct kobject *kobj, struct kobject *parent) -{ - const struct kobj_type *t; - int error; - - kobj->parent = parent; - error = sysfs_create_dir(kobj); - if (error == 0 && kobj->ktype && kobj->ktype->default_attrs) { - struct attribute **attr; - t = kobj->ktype; - - for (attr = t->default_attrs; *attr != NULL; attr++) { - error = sysfs_create_file(kobj, *attr); - if (error) - break; - } - if (error) - sysfs_remove_dir(kobj); - } - return (error); -} - -int -kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...) -{ - va_list args; - int error; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - if (error) - return (error); - - return kobject_add_complete(kobj, parent); -} - -void -linux_kobject_release(struct kref *kref) -{ - struct kobject *kobj; - char *name; - - kobj = container_of(kref, struct kobject, kref); - sysfs_remove_dir(kobj); - name = kobj->name; - if (kobj->ktype && kobj->ktype->release) - kobj->ktype->release(kobj); - kfree(name); -} - -static void -linux_kobject_kfree(struct kobject *kobj) -{ - kfree(kobj); -} - -static void -linux_kobject_kfree_name(struct kobject *kobj) -{ - if (kobj) { - kfree(kobj->name); - } -} - -const struct kobj_type linux_kfree_type = { - .release = linux_kobject_kfree -}; - -static void -linux_device_release(struct device *dev) -{ - pr_debug("linux_device_release: %s\n", dev_name(dev)); - kfree(dev); -} - -static ssize_t -linux_class_show(struct kobject *kobj, struct attribute *attr, char *buf) -{ - struct class_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct class_attribute, attr); - error = -EIO; - if (dattr->show) - error = dattr->show(container_of(kobj, struct class, kobj), - dattr, buf); - return (error); -} - -static ssize_t -linux_class_store(struct kobject *kobj, struct attribute *attr, const char *buf, - size_t count) -{ - struct class_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct class_attribute, attr); - error = -EIO; - if (dattr->store) - error = dattr->store(container_of(kobj, struct class, kobj), - dattr, buf, count); - return (error); -} - -static void -linux_class_release(struct kobject *kobj) -{ - struct class *class; - - class = container_of(kobj, struct class, kobj); - if (class->class_release) - class->class_release(class); -} - -static const struct sysfs_ops linux_class_sysfs = { - .show = linux_class_show, - .store = linux_class_store, -}; - -const struct kobj_type linux_class_ktype = { - .release = linux_class_release, - .sysfs_ops = &linux_class_sysfs -}; - -static void -linux_dev_release(struct kobject *kobj) -{ - struct device *dev; - - dev = container_of(kobj, struct device, kobj); - /* This is the precedence defined by linux. */ - if (dev->release) - dev->release(dev); - else if (dev->class && dev->class->dev_release) - dev->class->dev_release(dev); -} - -static ssize_t -linux_dev_show(struct kobject *kobj, struct attribute *attr, char *buf) -{ - struct device_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct device_attribute, attr); - error = -EIO; - if (dattr->show) - error = dattr->show(container_of(kobj, struct device, kobj), - dattr, buf); - return (error); -} - -static ssize_t -linux_dev_store(struct kobject *kobj, struct attribute *attr, const char *buf, - size_t count) -{ - struct device_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct device_attribute, attr); - error = -EIO; - if (dattr->store) - error = dattr->store(container_of(kobj, struct device, kobj), - dattr, buf, count); - return (error); -} - -static const struct sysfs_ops linux_dev_sysfs = { - .show = linux_dev_show, - .store = linux_dev_store, -}; - -const struct kobj_type linux_dev_ktype = { - .release = linux_dev_release, - .sysfs_ops = &linux_dev_sysfs -}; - -struct device * -device_create(struct class *class, struct device *parent, dev_t devt, - void *drvdata, const char *fmt, ...) -{ - struct device *dev; - va_list args; - - dev = kzalloc(sizeof(*dev), M_WAITOK); - dev->parent = parent; - dev->class = class; - dev->devt = devt; - dev->driver_data = drvdata; - dev->release = linux_device_release; - va_start(args, fmt); - kobject_set_name_vargs(&dev->kobj, fmt, args); - va_end(args); - device_register(dev); - - return (dev); -} - -int -kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, - struct kobject *parent, const char *fmt, ...) -{ - va_list args; - int error; - - kobject_init(kobj, ktype); - kobj->ktype = ktype; - kobj->parent = parent; - kobj->name = NULL; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - if (error) - return (error); - return kobject_add_complete(kobj, parent); -} - -static void -linux_kq_lock(void *arg) -{ - spinlock_t *s = arg; - - spin_lock(s); -} -static void -linux_kq_unlock(void *arg) -{ - spinlock_t *s = arg; - - spin_unlock(s); -} - -static void -linux_kq_assert_lock(void *arg, int what) -{ -#ifdef INVARIANTS - spinlock_t *s = arg; - - if (what == LA_LOCKED) - mtx_assert(&s->m, MA_OWNED); - else - mtx_assert(&s->m, MA_NOTOWNED); -#endif -} - -static void -linux_file_kqfilter_poll(struct linux_file *, int); - -struct linux_file * -linux_file_alloc(void) -{ - struct linux_file *filp; - - filp = kzalloc(sizeof(*filp), GFP_KERNEL); - - /* set initial refcount */ - filp->f_count = 1; - - /* setup fields needed by kqueue support */ - spin_lock_init(&filp->f_kqlock); - knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, - linux_kq_lock, linux_kq_unlock, linux_kq_assert_lock); - - return (filp); -} - -void -linux_file_free(struct linux_file *filp) -{ - if (filp->_file == NULL) { - if (filp->f_shmem != NULL) - vm_object_deallocate(filp->f_shmem); - kfree(filp); - } else { - /* - * The close method of the character device or file - * will free the linux_file structure: - */ - _fdrop(filp->_file, curthread); - } -} - -static int -linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, - vm_page_t *mres) -{ - struct vm_area_struct *vmap; - - vmap = linux_cdev_handle_find(vm_obj->handle); - - MPASS(vmap != NULL); - MPASS(vmap->vm_private_data == vm_obj->handle); - - if (likely(vmap->vm_ops != NULL && offset < vmap->vm_len)) { - vm_paddr_t paddr = IDX_TO_OFF(vmap->vm_pfn) + offset; - vm_page_t page; - - if (((*mres)->flags & PG_FICTITIOUS) != 0) { - /* - * If the passed in result page is a fake - * page, update it with the new physical - * address. - */ - page = *mres; - vm_page_updatefake(page, paddr, vm_obj->memattr); - } else { - /* - * Replace the passed in "mres" page with our - * own fake page and free up the all of the - * original pages. - */ - VM_OBJECT_WUNLOCK(vm_obj); - page = vm_page_getfake(paddr, vm_obj->memattr); - VM_OBJECT_WLOCK(vm_obj); - - vm_page_replace(page, vm_obj, (*mres)->pindex, *mres); - *mres = page; - } - vm_page_valid(page); - return (VM_PAGER_OK); - } - return (VM_PAGER_FAIL); -} - -static int -linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, - vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) -{ - struct vm_area_struct *vmap; - int err; - - /* get VM area structure */ - vmap = linux_cdev_handle_find(vm_obj->handle); - MPASS(vmap != NULL); - MPASS(vmap->vm_private_data == vm_obj->handle); - - VM_OBJECT_WUNLOCK(vm_obj); - - linux_set_current(curthread); - - down_write(&vmap->vm_mm->mmap_sem); - if (unlikely(vmap->vm_ops == NULL)) { - err = VM_FAULT_SIGBUS; - } else { - struct vm_fault vmf; - - /* fill out VM fault structure */ - vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); - vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; - vmf.pgoff = 0; - vmf.page = NULL; - vmf.vma = vmap; - - vmap->vm_pfn_count = 0; - vmap->vm_pfn_pcount = &vmap->vm_pfn_count; - vmap->vm_obj = vm_obj; - - err = vmap->vm_ops->fault(vmap, &vmf); - - while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) { - kern_yield(PRI_USER); - err = vmap->vm_ops->fault(vmap, &vmf); - } - } - - /* translate return code */ - switch (err) { - case VM_FAULT_OOM: - err = VM_PAGER_AGAIN; - break; - case VM_FAULT_SIGBUS: - err = VM_PAGER_BAD; - break; - case VM_FAULT_NOPAGE: - /* - * By contract the fault handler will return having - * busied all the pages itself. If pidx is already - * found in the object, it will simply xbusy the first - * page and return with vm_pfn_count set to 1. - */ - *first = vmap->vm_pfn_first; - *last = *first + vmap->vm_pfn_count - 1; - err = VM_PAGER_OK; - break; - default: - err = VM_PAGER_ERROR; - break; - } - up_write(&vmap->vm_mm->mmap_sem); - VM_OBJECT_WLOCK(vm_obj); - return (err); -} - -static struct rwlock linux_vma_lock; -static TAILQ_HEAD(, vm_area_struct) linux_vma_head = - TAILQ_HEAD_INITIALIZER(linux_vma_head); - -static void -linux_cdev_handle_free(struct vm_area_struct *vmap) -{ - /* Drop reference on vm_file */ - if (vmap->vm_file != NULL) - fput(vmap->vm_file); - - /* Drop reference on mm_struct */ - mmput(vmap->vm_mm); - - kfree(vmap); -} - -static void -linux_cdev_handle_remove(struct vm_area_struct *vmap) -{ - rw_wlock(&linux_vma_lock); - TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry); - rw_wunlock(&linux_vma_lock); -} - -static struct vm_area_struct * -linux_cdev_handle_find(void *handle) -{ - struct vm_area_struct *vmap; - - rw_rlock(&linux_vma_lock); - TAILQ_FOREACH(vmap, &linux_vma_head, vm_entry) { - if (vmap->vm_private_data == handle) - break; - } - rw_runlock(&linux_vma_lock); - return (vmap); -} - -static int -linux_cdev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred, u_short *color) -{ - - MPASS(linux_cdev_handle_find(handle) != NULL); - *color = 0; - return (0); -} - -static void -linux_cdev_pager_dtor(void *handle) -{ - const struct vm_operations_struct *vm_ops; - struct vm_area_struct *vmap; - - vmap = linux_cdev_handle_find(handle); - MPASS(vmap != NULL); - - /* - * Remove handle before calling close operation to prevent - * other threads from reusing the handle pointer. - */ - linux_cdev_handle_remove(vmap); - - down_write(&vmap->vm_mm->mmap_sem); - vm_ops = vmap->vm_ops; - if (likely(vm_ops != NULL)) - vm_ops->close(vmap); - up_write(&vmap->vm_mm->mmap_sem); - - linux_cdev_handle_free(vmap); -} - -static struct cdev_pager_ops linux_cdev_pager_ops[2] = { - { - /* OBJT_MGTDEVICE */ - .cdev_pg_populate = linux_cdev_pager_populate, - .cdev_pg_ctor = linux_cdev_pager_ctor, - .cdev_pg_dtor = linux_cdev_pager_dtor - }, - { - /* OBJT_DEVICE */ - .cdev_pg_fault = linux_cdev_pager_fault, - .cdev_pg_ctor = linux_cdev_pager_ctor, - .cdev_pg_dtor = linux_cdev_pager_dtor - }, -}; - -int -zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, - unsigned long size) -{ - vm_object_t obj; - vm_page_t m; - - obj = vma->vm_obj; - if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) - return (-ENOTSUP); - VM_OBJECT_RLOCK(obj); - for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); - m != NULL && m->pindex < OFF_TO_IDX(address + size); - m = TAILQ_NEXT(m, listq)) - pmap_remove_all(m); - VM_OBJECT_RUNLOCK(obj); - return (0); -} - -static struct file_operations dummy_ldev_ops = { - /* XXXKIB */ -}; - -static struct linux_cdev dummy_ldev = { - .ops = &dummy_ldev_ops, -}; - -#define LDEV_SI_DTR 0x0001 -#define LDEV_SI_REF 0x0002 - -static void -linux_get_fop(struct linux_file *filp, const struct file_operations **fop, - struct linux_cdev **dev) -{ - struct linux_cdev *ldev; - u_int siref; - - ldev = filp->f_cdev; - *fop = filp->f_op; - if (ldev != NULL) { - if (ldev->kobj.ktype == &linux_cdev_static_ktype) { - refcount_acquire(&ldev->refs); - } else { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - *fop = ldev->ops; - siref = ldev->siref; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, - &siref, siref + LDEV_SI_REF)) { - break; - } - } - } - } - *dev = ldev; -} - -static void -linux_drop_fop(struct linux_cdev *ldev) -{ - - if (ldev == NULL) - return; - if (ldev->kobj.ktype == &linux_cdev_static_ktype) { - linux_cdev_deref(ldev); - } else { - MPASS(ldev->kobj.ktype == &linux_cdev_ktype); - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); - } -} - -#define OPW(fp,td,code) ({ \ - struct file *__fpop; \ - __typeof(code) __retval; \ - \ - __fpop = (td)->td_fpop; \ - (td)->td_fpop = (fp); \ - __retval = (code); \ - (td)->td_fpop = __fpop; \ - __retval; \ -}) - -static int -linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, - struct file *file) -{ - struct linux_cdev *ldev; - struct linux_file *filp; - const struct file_operations *fop; - int error; - - ldev = dev->si_drv1; - - filp = linux_file_alloc(); - filp->f_dentry = &filp->f_dentry_store; - filp->f_op = ldev->ops; - filp->f_mode = file->f_flag; - filp->f_flags = file->f_flag; - filp->f_vnode = file->f_vnode; - filp->_file = file; - refcount_acquire(&ldev->refs); - filp->f_cdev = ldev; - - linux_set_current(td); - linux_get_fop(filp, &fop, &ldev); - - if (fop->open != NULL) { - error = -fop->open(file->f_vnode, filp); - if (error != 0) { - linux_drop_fop(ldev); - linux_cdev_deref(filp->f_cdev); - kfree(filp); - return (error); - } - } - - /* hold on to the vnode - used for fstat() */ - vhold(filp->f_vnode); - - /* release the file from devfs */ - finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); - linux_drop_fop(ldev); - return (ENXIO); -} - -#define LINUX_IOCTL_MIN_PTR 0x10000UL -#define LINUX_IOCTL_MAX_PTR (LINUX_IOCTL_MIN_PTR + IOCPARM_MAX) - -static inline int -linux_remap_address(void **uaddr, size_t len) -{ - uintptr_t uaddr_val = (uintptr_t)(*uaddr); - - if (unlikely(uaddr_val >= LINUX_IOCTL_MIN_PTR && - uaddr_val < LINUX_IOCTL_MAX_PTR)) { - struct task_struct *pts = current; - if (pts == NULL) { - *uaddr = NULL; - return (1); - } - - /* compute data offset */ - uaddr_val -= LINUX_IOCTL_MIN_PTR; - - /* check that length is within bounds */ - if ((len > IOCPARM_MAX) || - (uaddr_val + len) > pts->bsd_ioctl_len) { - *uaddr = NULL; - return (1); - } - - /* re-add kernel buffer address */ - uaddr_val += (uintptr_t)pts->bsd_ioctl_data; - - /* update address location */ - *uaddr = (void *)uaddr_val; - return (1); - } - return (0); -} - -int -linux_copyin(const void *uaddr, void *kaddr, size_t len) -{ - if (linux_remap_address(__DECONST(void **, &uaddr), len)) { - if (uaddr == NULL) - return (-EFAULT); - memcpy(kaddr, uaddr, len); - return (0); - } - return (-copyin(uaddr, kaddr, len)); -} - -int -linux_copyout(const void *kaddr, void *uaddr, size_t len) -{ - if (linux_remap_address(&uaddr, len)) { - if (uaddr == NULL) - return (-EFAULT); - memcpy(uaddr, kaddr, len); - return (0); - } - return (-copyout(kaddr, uaddr, len)); -} - -size_t -linux_clear_user(void *_uaddr, size_t _len) -{ - uint8_t *uaddr = _uaddr; - size_t len = _len; - - /* make sure uaddr is aligned before going into the fast loop */ - while (((uintptr_t)uaddr & 7) != 0 && len > 7) { - if (subyte(uaddr, 0)) - return (_len); - uaddr++; - len--; - } - - /* zero 8 bytes at a time */ - while (len > 7) { -#ifdef __LP64__ - if (suword64(uaddr, 0)) - return (_len); -#else - if (suword32(uaddr, 0)) - return (_len); - if (suword32(uaddr + 4, 0)) - return (_len); -#endif - uaddr += 8; - len -= 8; - } - - /* zero fill end, if any */ - while (len > 0) { - if (subyte(uaddr, 0)) - return (_len); - uaddr++; - len--; - } - return (0); -} - -int -linux_access_ok(const void *uaddr, size_t len) -{ - uintptr_t saddr; - uintptr_t eaddr; - - /* get start and end address */ - saddr = (uintptr_t)uaddr; - eaddr = (uintptr_t)uaddr + len; - - /* verify addresses are valid for userspace */ - return ((saddr == eaddr) || - (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); -} - -/* - * This function should return either EINTR or ERESTART depending on - * the signal type sent to this thread: - */ -static int -linux_get_error(struct task_struct *task, int error) -{ - /* check for signal type interrupt code */ - if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { - error = -linux_schedule_get_interrupt_value(task); - if (error == 0) - error = EINTR; - } - return (error); -} - -static int -linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, - const struct file_operations *fop, u_long cmd, caddr_t data, - struct thread *td) -{ - struct task_struct *task = current; - unsigned size; - int error; - - size = IOCPARM_LEN(cmd); - /* refer to logic in sys_ioctl() */ - if (size > 0) { - /* - * Setup hint for linux_copyin() and linux_copyout(). - * - * Background: Linux code expects a user-space address - * while FreeBSD supplies a kernel-space address. - */ - task->bsd_ioctl_data = data; - task->bsd_ioctl_len = size; - data = (void *)LINUX_IOCTL_MIN_PTR; - } else { - /* fetch user-space pointer */ - data = *(void **)data; - } -#if defined(__amd64__) - if (td->td_proc->p_elf_machine == EM_386) { *** 1651 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BA2962EA83; Sat, 1 May 2021 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FX9N664Zhz3pPF; Sat, 1 May 2021 00:39: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 9413A5D44; Sat, 1 May 2021 00:39: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 1410d2TJ048080; Sat, 1 May 2021 00:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d2XI048079; Sat, 1 May 2021 00:39:02 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:02 GMT Message-Id: <202105010039.1410d2XI048079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 29e156233904 - stable/12 - ptrace: remove dead call to FIX_SSTEP() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 29e156233904cf6093db5f6d8b05284f5df679c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:03 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29e156233904cf6093db5f6d8b05284f5df679c5 commit 29e156233904cf6093db5f6d8b05284f5df679c5 Author: Konstantin Belousov AuthorDate: 2021-04-11 09:02:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 ptrace: remove dead call to FIX_SSTEP() (cherry picked from commit 9d7e450b64f1e605c718fba0f357d49541c8147b) --- sys/kern/sys_process.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 82f25e93b218..c61a77cd7584 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -922,13 +922,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) /* Keep this process around until we finish this request. */ _PHOLD(p); -#ifdef FIX_SSTEP - /* - * Single step fixup ala procfs - */ - FIX_SSTEP(td2); -#endif - /* * Actually do the requests */ From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0F2562E7D2; Sat, 1 May 2021 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FX9N76Dt4z3pdX; Sat, 1 May 2021 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C28305C60; Sat, 1 May 2021 00:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410d3ep048101; Sat, 1 May 2021 00:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d37A048100; Sat, 1 May 2021 00:39:03 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:03 GMT Message-Id: <202105010039.1410d37A048100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6c27e0b8e19e - stable/12 - ptrace: restructure comments around reparenting on PT_DETACH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6c27e0b8e19e2665b8c7049f67a43a63dde6fcf4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:04 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6c27e0b8e19e2665b8c7049f67a43a63dde6fcf4 commit 6c27e0b8e19e2665b8c7049f67a43a63dde6fcf4 Author: Konstantin Belousov AuthorDate: 2021-04-11 09:06:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 ptrace: restructure comments around reparenting on PT_DETACH (cherry picked from commit a091c353235e0ee97d2531e80d9d64e1648350f4) --- sys/kern/sys_process.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index c61a77cd7584..cac4916c2460 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1160,14 +1160,16 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; case PT_DETACH: /* - * Reset the process parent. - * - * NB: This clears P_TRACED before reparenting + * Clear P_TRACED before reparenting * a detached process back to its original * parent. Otherwise the debugee will be set * as an orphan of the debugger. */ p->p_flag &= ~(P_TRACED | P_WAITED); + + /* + * Reset the process parent. + */ if (p->p_oppid != p->p_pptr->p_pid) { PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); @@ -1180,9 +1182,11 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) CTR3(KTR_PTRACE, "PT_DETACH: pid %d reparented to pid %d, sig %d", p->p_pid, pp->p_pid, data); - } else + } else { CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); + } + p->p_ptevents = 0; FOREACH_THREAD_IN_PROC(p, td3) { if ((td3->td_dbgflags & TDB_FSTP) != 0) { From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5328562E56F; Sat, 1 May 2021 00:39: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 4FX9N905xJz3q0g; Sat, 1 May 2021 00:39: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 DF4215D45; Sat, 1 May 2021 00:39: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 1410d4bM048122; Sat, 1 May 2021 00:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d4ZL048121; Sat, 1 May 2021 00:39:04 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:04 GMT Message-Id: <202105010039.1410d4ZL048121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1bc0b6929ff3 - stable/12 - link(2): correct descriptor name in AT_RESOLVE_BENEATH description MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1bc0b6929ff3198604afc7a1aa10c2695b063d23 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:05 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1bc0b6929ff3198604afc7a1aa10c2695b063d23 commit 1bc0b6929ff3198604afc7a1aa10c2695b063d23 Author: Konstantin Belousov AuthorDate: 2021-03-30 21:56:28 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 link(2): correct descriptor name in AT_RESOLVE_BENEATH description (cherry picked from commit c78e124535febc6c0bc7c0756b42d6b845428d2e) --- lib/libc/sys/link.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index de0efd5e510f..bcf03f17f3bb 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -117,7 +117,7 @@ names a symbolic link, a new link for the target of the symbolic link is created. .It Dv AT_RESOLVE_BENEATH Only walk paths below the directory specified by the -.Ar fd +.Ar fd1 descriptor. See the description of the .Dv O_RESOLVE_BENEATH From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F14562E673; Sat, 1 May 2021 00:39: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 4FX9NC3JzLz3pxW; Sat, 1 May 2021 00:39: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 17A046015; Sat, 1 May 2021 00:39: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 1410d7ra048170; Sat, 1 May 2021 00:39:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d7Ze048169; Sat, 1 May 2021 00:39:07 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:07 GMT Message-Id: <202105010039.1410d7Ze048169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 83f3bc609090 - stable/12 - amd64: clear debug registers on execing 32bit Linux binary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 83f3bc609090aedb9b276e4f2b43e570857fd153 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:07 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=83f3bc609090aedb9b276e4f2b43e570857fd153 commit 83f3bc609090aedb9b276e4f2b43e570857fd153 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:25:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 amd64: clear debug registers on execing 32bit Linux binary (cherry picked from commit 94172affa43af15fe3b50293a96c292eca30c386) --- sys/amd64/linux32/linux32_sysvec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 315dcc7ca629..1686891861c3 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -710,6 +710,8 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) regs->tf_cs = _ucode32sel; regs->tf_rbx = imgp->ps_strings; + x86_clear_dbregs(pcb); + fpstate_drop(td); /* Do full restore on return so that we can change to a different %cs */ From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAB7862E965; Sat, 1 May 2021 00:39: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 4FX9NB2qcPz3pxN; Sat, 1 May 2021 00:39: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 0468D5D46; Sat, 1 May 2021 00:39: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 1410d5v7048145; Sat, 1 May 2021 00:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d5X6048144; Sat, 1 May 2021 00:39:05 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:05 GMT Message-Id: <202105010039.1410d5X6048144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b847aca56c2b - stable/12 - x86: add x86_clear_dbregs() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b847aca56c2b252bd68f63d142473bbdf1f71429 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:07 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b847aca56c2b252bd68f63d142473bbdf1f71429 commit b847aca56c2b252bd68f63d142473bbdf1f71429 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:19:23 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 x86: add x86_clear_dbregs() helper (cherry picked from commit a8b75a57c9b2cb3388746f097a55086a0f8c5d38) --- sys/amd64/amd64/machdep.c | 50 +++++++++++++++++++++++++++-------------------- sys/i386/i386/machdep.c | 50 +++++++++++++++++++++++++++-------------------- sys/x86/include/x86_var.h | 1 + 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 2400d130ac0c..1e663382f140 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -588,6 +588,34 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) } #endif +/* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ +void +x86_clear_dbregs(struct pcb *pcb) +{ + if ((pcb->pcb_flags & PCB_DBREGS) == 0) + return; + + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + + if (pcb == curpcb) { + /* + * Clear the debug registers on the running CPU, + * otherwise they will end up affecting the next + * process we switch to. + */ + reset_dbregs(); + } + clear_pcb_flags(pcb, PCB_DBREGS); +} + /* * Reset registers to default values on exec. */ @@ -624,27 +652,7 @@ exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - clear_pcb_flags(pcb, PCB_DBREGS); - } + x86_clear_dbregs(pcb); /* * Drop the FP state if we hold it, so that the process gets a diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 885087f7a479..4ef37861b151 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1134,6 +1134,34 @@ setup_priv_lcall_gate(struct proc *p) } #endif +/* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ +void +x86_clear_dbregs(struct pcb *pcb) +{ + if ((pcb->pcb_flags & PCB_DBREGS) == 0) + return; + + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + + if (pcb == curpcb) { + /* + * Clear the debug registers on the running CPU, + * otherwise they will end up affecting the next + * process we switch to. + */ + reset_dbregs(); + } + pcb->pcb_flags &= ~PCB_DBREGS; +} + /* * Reset registers to default values on exec. */ @@ -1187,27 +1215,7 @@ exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ regs->tf_ebx = imgp->ps_strings; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - pcb->pcb_flags &= ~PCB_DBREGS; - } + x86_clear_dbregs(pcb); pcb->pcb_initial_npxcw = __INITIAL_NPXCW__; diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 44d2853377b3..3e146b44338f 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -127,6 +127,7 @@ u_int cpu_auxmsr(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); +void x86_clear_dbregs(struct pcb *pcb); bool disable_wp(void); void restore_wp(bool old_wp); void dump_add_page(vm_paddr_t); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B63162E9EE; Sat, 1 May 2021 00:39: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 4FX9ND3XjPz3pvk; Sat, 1 May 2021 00:39: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 43DF85AFB; Sat, 1 May 2021 00:39: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 1410d8k5048191; Sat, 1 May 2021 00:39:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d8DD048190; Sat, 1 May 2021 00:39:08 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:08 GMT Message-Id: <202105010039.1410d8DD048190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ce8a17c2ba6c - stable/12 - amd64: clear debug registers on execing 32bit native binary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ce8a17c2ba6cb1dba49d25c70b91ff8203ad816c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:08 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ce8a17c2ba6cb1dba49d25c70b91ff8203ad816c commit ce8a17c2ba6cb1dba49d25c70b91ff8203ad816c Author: Konstantin Belousov AuthorDate: 2021-04-09 23:23:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 amd64: clear debug registers on execing 32bit native binary (cherry picked from commit d50adfec9ee73e88e8d365525f1acef2c1db798a) --- sys/amd64/ia32/ia32_signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index 72f35af75b85..4342d6fb807d 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -971,6 +971,8 @@ ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack) regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; + x86_clear_dbregs(pcb); + fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0995062E7DD; Sat, 1 May 2021 00:39: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 4FX9NF4b0Tz3pxk; Sat, 1 May 2021 00:39: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 6612F5AFC; Sat, 1 May 2021 00:39: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 1410d9Zl048212; Sat, 1 May 2021 00:39:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410d9j8048211; Sat, 1 May 2021 00:39:09 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:09 GMT Message-Id: <202105010039.1410d9j8048211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bd19553cb5d2 - stable/12 - amd64 linux64: use x86_clear_dbregs() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bd19553cb5d26a4100e3f6cc90e65647ded36b97 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:10 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd19553cb5d26a4100e3f6cc90e65647ded36b97 commit bd19553cb5d26a4100e3f6cc90e65647ded36b97 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 amd64 linux64: use x86_clear_dbregs() (cherry picked from commit 2f1588474768f61f3a983af207e753bd0340a9e7) --- sys/amd64/linux/linux_sysvec.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index b14b4014a87a..03240acaae1c 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -424,27 +424,7 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - clear_pcb_flags(pcb, PCB_DBREGS); - } + x86_clear_dbregs(pcb); /* * Drop the FP state if we hold it, so that the process gets a From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B9A062EAB1; Sat, 1 May 2021 00:39: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 4FX9NG55s1z3pxn; Sat, 1 May 2021 00:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E495FD5; Sat, 1 May 2021 00:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410dA36048233; Sat, 1 May 2021 00:39:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dAe8048232; Sat, 1 May 2021 00:39:10 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:10 GMT Message-Id: <202105010039.1410dAe8048232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dbb32ca9394a - stable/12 - x86: clear %db registers in new process MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dbb32ca9394a0b5732551705055bc0efbf88b5e2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:11 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dbb32ca9394a0b5732551705055bc0efbf88b5e2 commit dbb32ca9394a0b5732551705055bc0efbf88b5e2 Author: Konstantin Belousov AuthorDate: 2021-03-30 15:40:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 x86: clear %db registers in new process (cherry picked from commit 8223717ce62c1ad0becc34ce69fe2d1771f3ba05) --- sys/amd64/amd64/vm_machdep.c | 8 ++++++++ sys/i386/i386/vm_machdep.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index eae5c36d2533..5b3845e5c68e 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -181,6 +181,14 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), cpu_max_ext_state_size); + /* Reset debug registers in the new process */ + pcb2->pcb_dr0 = 0; + pcb2->pcb_dr1 = 0; + pcb2->pcb_dr2 = 0; + pcb2->pcb_dr3 = 0; + pcb2->pcb_dr6 = 0; + pcb2->pcb_dr7 = 0; + /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 06112ebb34d0..c76074f5446d 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -192,6 +192,14 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), cpu_max_ext_state_size); + /* Reset debug registers in the new process */ + pcb2->pcb_dr0 = 0; + pcb2->pcb_dr1 = 0; + pcb2->pcb_dr2 = 0; + pcb2->pcb_dr3 = 0; + pcb2->pcb_dr6 = 0; + pcb2->pcb_dr7 = 0; + /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; bcopy(&p1->p_md, mdp2, sizeof(*mdp2)); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8A2B62EAB3; Sat, 1 May 2021 00:39: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 4FX9NH4xsPz3pmf; Sat, 1 May 2021 00:39: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 96B356016; Sat, 1 May 2021 00:39: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 1410dBwj048254; Sat, 1 May 2021 00:39:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dBE7048253; Sat, 1 May 2021 00:39:11 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:11 GMT Message-Id: <202105010039.1410dBE7048253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 71add7877a02 - stable/12 - x86: use x86_clear_dbregs() on fork MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 71add7877a02dffa93883cc1b83542bc540645f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:12 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=71add7877a02dffa93883cc1b83542bc540645f4 commit 71add7877a02dffa93883cc1b83542bc540645f4 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:20:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:29 +0000 x86: use x86_clear_dbregs() on fork (cherry picked from commit 290b0d123ae2136ad84b268cd1884b1624d1d37f) --- sys/amd64/amd64/vm_machdep.c | 7 +------ sys/i386/i386/vm_machdep.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 5b3845e5c68e..da7f58d4fd3c 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -182,12 +182,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) cpu_max_ext_state_size); /* Reset debug registers in the new process */ - pcb2->pcb_dr0 = 0; - pcb2->pcb_dr1 = 0; - pcb2->pcb_dr2 = 0; - pcb2->pcb_dr3 = 0; - pcb2->pcb_dr6 = 0; - pcb2->pcb_dr7 = 0; + x86_clear_dbregs(pcb2); /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index c76074f5446d..8f1b0a971f58 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -193,12 +193,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) cpu_max_ext_state_size); /* Reset debug registers in the new process */ - pcb2->pcb_dr0 = 0; - pcb2->pcb_dr1 = 0; - pcb2->pcb_dr2 = 0; - pcb2->pcb_dr3 = 0; - pcb2->pcb_dr6 = 0; - pcb2->pcb_dr7 = 0; + x86_clear_dbregs(pcb2); /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 063B662E5D7; Sat, 1 May 2021 00:39: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 4FX9NJ65lfz3ptB; Sat, 1 May 2021 00:39: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 B9A585CBD; Sat, 1 May 2021 00:39: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 1410dCfR048281; Sat, 1 May 2021 00:39:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dCxQ048280; Sat, 1 May 2021 00:39:12 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:12 GMT Message-Id: <202105010039.1410dCxQ048280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2a8c3e7b22c8 - stable/12 - sbuf_uionew(): sbuf_new() takes int as length MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2a8c3e7b22c8d09233c148411a3169ca6a7f364d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:13 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2a8c3e7b22c8d09233c148411a3169ca6a7f364d commit 2a8c3e7b22c8d09233c148411a3169ca6a7f364d Author: Konstantin Belousov AuthorDate: 2021-04-13 19:12:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 sbuf_uionew(): sbuf_new() takes int as length (cherry picked from commit 116f26f947b8bbf868dcd85d79226406029a45ee) --- sys/kern/subr_sbuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index ac6bc14b7a8c..03f7b1e94c51 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -259,6 +259,10 @@ sbuf_uionew(struct sbuf *s, struct uio *uio, int *error) KASSERT(error != NULL, ("%s called with NULL error pointer", __func__)); + if (uio->uio_resid >= INT_MAX || uio->uio_resid < SBUF_MINSIZE - 1) { + *error = EINVAL; + return (NULL); + } s = sbuf_new(s, NULL, uio->uio_resid + 1, 0); if (s == NULL) { *error = ENOMEM; From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B781962E975; Sat, 1 May 2021 00:39: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 4FX9NM2dtTz3py7; Sat, 1 May 2021 00:39: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 1B10B5AFE; Sat, 1 May 2021 00:39: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 1410dEuK048323; Sat, 1 May 2021 00:39:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dEW6048322; Sat, 1 May 2021 00:39:14 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:14 GMT Message-Id: <202105010039.1410dEW6048322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d13215b99d0b - stable/12 - pseudofs: limit writes to 1M MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d13215b99d0b9d04de111dd469938e6854fc3493 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:16 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d13215b99d0b9d04de111dd469938e6854fc3493 commit d13215b99d0b9d04de111dd469938e6854fc3493 Author: Konstantin Belousov AuthorDate: 2021-04-13 19:48:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 pseudofs: limit writes to 1M (cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f) --- sys/fs/pseudofs/pseudofs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index 6c025547b71b..510b6936d2fa 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -996,6 +996,9 @@ pfs_write(struct vop_write_args *va) if (pn->pn_fill == NULL) PFS_RETURN (EIO); + if (uio->uio_resid > PFS_MAXBUFSIZ) + PFS_RETURN (EIO); + /* * This is necessary because either process' privileges may * have changed since the open() call. From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A7B562E7E7; Sat, 1 May 2021 00:39: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 4FX9NL2YXTz3ptD; Sat, 1 May 2021 00:39: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 EA65F5AFD; Sat, 1 May 2021 00:39: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 1410dDak048302; Sat, 1 May 2021 00:39:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dDSZ048301; Sat, 1 May 2021 00:39:13 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:13 GMT Message-Id: <202105010039.1410dDSZ048301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 72e1884f593f - stable/12 - Bump pseudofs size limit from 128kB to 1MB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 72e1884f593f9b86c9ea4e74d02449f6678770dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:14 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72e1884f593f9b86c9ea4e74d02449f6678770dd commit 72e1884f593f9b86c9ea4e74d02449f6678770dd Author: Edward Tomasz Napierala AuthorDate: 2020-10-16 09:58:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 Bump pseudofs size limit from 128kB to 1MB. PR: 237883 (cherry picked from commit ce764cbd1c725c54966315949fe93eb3994c1b5e) --- sys/fs/pseudofs/pseudofs_vnops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index da35f06208fa..6c025547b71b 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); KASSERT((pn)->pn_type == pfstype_symlink, \ ("%s(): VLNK vnode refers to non-link pfs_node", __func__)) +#define PFS_MAXBUFSIZ 1024 * 1024 + /* * Returns the fileno, adjusted for target pid */ @@ -659,8 +661,8 @@ pfs_read(struct vop_read_args *va) goto ret; } buflen = uio->uio_offset + uio->uio_resid; - if (buflen > MAXPHYS) - buflen = MAXPHYS; + if (buflen > PFS_MAXBUFSIZ) + buflen = PFS_MAXBUFSIZ; sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) { From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39BB162EA53; Sat, 1 May 2021 00:39: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 4FX9NN5kLmz3q5w; Sat, 1 May 2021 00:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D3975D47; Sat, 1 May 2021 00:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410dGl5048344; Sat, 1 May 2021 00:39:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dGct048343; Sat, 1 May 2021 00:39:16 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:16 GMT Message-Id: <202105010039.1410dGct048343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: db38075bd956 - stable/12 - b_vflags update requries bufobj lock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: db38075bd9560aeb8cb7d9f30ba39d737e4abc7d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:17 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=db38075bd9560aeb8cb7d9f30ba39d737e4abc7d commit db38075bd9560aeb8cb7d9f30ba39d737e4abc7d Author: Konstantin Belousov AuthorDate: 2021-04-13 10:22:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 b_vflags update requries bufobj lock (cherry picked from commit e3d675958539eee899d42438f5b46a26f3c64902) --- sys/ufs/ffs/ffs_softdep.c | 2 ++ sys/ufs/ffs/ffs_vnops.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 895410cef152..bc83b92ee384 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -7179,7 +7179,9 @@ cleanrestart: BO_LOCK(bo); goto cleanrestart; } + BO_LOCK(bo); bp->b_vflags |= BV_SCANNED; + BO_UNLOCK(bo); bremfree(bp); if (blkoff != 0) { allocbuf(bp, blkoff); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 17dfb1ff3883..9dae437f9a76 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -287,8 +287,9 @@ loop: if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { + BO_LOCK(bo); bp->b_vflags &= ~BV_SCANNED; - goto next; + goto next_locked; } } else continue; @@ -328,6 +329,7 @@ next: * to start from a known point. */ BO_LOCK(bo); +next_locked: nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); } if (waitfor != MNT_WAIT) { From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3255A62EBA5; Sat, 1 May 2021 00:39: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 4FX9NP5Vhmz3pqB; Sat, 1 May 2021 00:39: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 64ED75C61; Sat, 1 May 2021 00:39: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 1410dHSq048365; Sat, 1 May 2021 00:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dHke048364; Sat, 1 May 2021 00:39:17 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:17 GMT Message-Id: <202105010039.1410dHke048364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f7020e7b5ee2 - stable/12 - AT_RESOLVE_BENEATH is bsd-specific MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f7020e7b5ee2bbe6d309b1ccea1ad74184ba4478 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:18 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f7020e7b5ee2bbe6d309b1ccea1ad74184ba4478 commit f7020e7b5ee2bbe6d309b1ccea1ad74184ba4478 Author: Konstantin Belousov AuthorDate: 2021-03-11 15:07:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 AT_RESOLVE_BENEATH is bsd-specific (cherry picked from commit d51b4b0aac43d9d25f7eb3f17b2d3034a5c851d8) --- sys/sys/fcntl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 04f2cd48a975..279fed49b9bd 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -216,10 +216,12 @@ typedef __pid_t pid_t; #define AT_SYMLINK_NOFOLLOW 0x0200 /* Do not follow symbolic links */ #define AT_SYMLINK_FOLLOW 0x0400 /* Follow symbolic link */ #define AT_REMOVEDIR 0x0800 /* Remove directory instead of file */ +#endif /* __POSIX_VISIBLE >= 200809 */ +#if __BSD_VISIBLE /* #define AT_UNUSED1 0x1000 *//* Was AT_BENEATH */ #define AT_RESOLVE_BENEATH 0x2000 /* Do not allow name resolution to walk out of dirfd */ -#endif +#endif /* __BSD_VISIBLE */ /* * Constants used for fcntl(2) From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EA1C62EC25; Sat, 1 May 2021 00:39: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 4FX9NQ5lLrz3pyR; Sat, 1 May 2021 00:39: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 8596F5DA6; Sat, 1 May 2021 00:39: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 1410dIWg048392; Sat, 1 May 2021 00:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dIgQ048391; Sat, 1 May 2021 00:39:18 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:18 GMT Message-Id: <202105010039.1410dIgQ048391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9102ba040a6f - stable/12 - vn_open_vnode(): handle error when fp == NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9102ba040a6faf1badf950d6af104440b667f89f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:19 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9102ba040a6faf1badf950d6af104440b667f89f commit 9102ba040a6faf1badf950d6af104440b667f89f Author: Konstantin Belousov AuthorDate: 2021-04-19 10:25:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 vn_open_vnode(): handle error when fp == NULL PR: 255119 (cherry picked from commit 54f98c4dbf9b1203a4e3e1b13fd0738441226991) --- sys/kern/vfs_vnops.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 1e0b76089b0f..ff44aba46f95 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -405,16 +405,34 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, /* * Error from advlock or VOP_ADD_WRITECOUNT() still requires * calling VOP_CLOSE() to pair with earlier VOP_OPEN(). - * Arrange for that by having fdrop() to use vn_closefile(). */ if (error != 0) { - fp->f_flag |= FOPENFAILED; - fp->f_vnode = vp; - if (fp->f_ops == &badfileops) { - fp->f_type = DTYPE_VNODE; - fp->f_ops = &vnops; + if (fp != NULL) { + /* + * Arrange the call by having fdrop() to use + * vn_closefile(). This is to satisfy + * filesystems like devfs or tmpfs, which + * override fo_close(). + */ + fp->f_flag |= FOPENFAILED; + fp->f_vnode = vp; + if (fp->f_ops == &badfileops) { + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + } + vref(vp); + } else { + /* + * If there is no fp, due to kernel-mode open, + * we can call VOP_CLOSE() now. + */ + if (vp->v_type != VFIFO && (fmode & FWRITE) != 0 && + !MNT_EXTENDED_SHARED(vp->v_mount) && + VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + vn_lock(vp, LK_UPGRADE | LK_RETRY); + (void)VOP_CLOSE(vp, fmode & (FREAD | FWRITE | FEXEC), + cred, td); } - vref(vp); } ASSERT_VOP_LOCKED(vp, "vn_open_vnode"); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AACC462EC88; Sat, 1 May 2021 00:39: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 4FX9NS4Mvgz3q3d; Sat, 1 May 2021 00:39: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 C3D225AFF; Sat, 1 May 2021 00:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410dJXJ048413; Sat, 1 May 2021 00:39:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dJ4i048412; Sat, 1 May 2021 00:39:19 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:19 GMT Message-Id: <202105010039.1410dJ4i048412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f9ff2861a3b2 - stable/12 - Style. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f9ff2861a3b263bd7643a993a18c35ed39080863 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:21 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f9ff2861a3b263bd7643a993a18c35ed39080863 commit f9ff2861a3b263bd7643a993a18c35ed39080863 Author: Konstantin Belousov AuthorDate: 2021-03-18 10:40:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 Style. (cherry picked from commit 42be0a7b10b14113ba9c4e4a738e8f20e235b736) --- sys/kern/kern_descrip.c | 2 +- sys/kern/vfs_vnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 8614656990c0..6e97a1e8e2f5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -562,7 +562,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; tmp |= FFLAGS(arg & ~O_ACCMODE) & FCNTLFLAGS; - } while(atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); + } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); tmp = fp->f_flag & FNONBLOCK; error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); if (error != 0) { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index ff44aba46f95..d95351ee3dd6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1624,7 +1624,7 @@ vn_closefile(struct file *fp, struct thread *td) vp = fp->f_vnode; fp->f_ops = &badfileops; - ref= (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; + ref = (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; error = vn_close1(vp, fp->f_flag, fp->f_cred, td, ref); From owner-dev-commits-src-all@freebsd.org Sat May 1 00:39:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FA6A62E5E7; Sat, 1 May 2021 00:39: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 4FX9NT2MzHz3pqQ; Sat, 1 May 2021 00:39: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 E10875D48; Sat, 1 May 2021 00:39: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 1410dKEC048434; Sat, 1 May 2021 00:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410dK8U048433; Sat, 1 May 2021 00:39:20 GMT (envelope-from git) Date: Sat, 1 May 2021 00:39:20 GMT Message-Id: <202105010039.1410dK8U048433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 00f85e3f264d - stable/12 - nfs client: depend on xdr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 00f85e3f264d665b30f0ce2ad98a12b15802dd65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:39:22 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=00f85e3f264d665b30f0ce2ad98a12b15802dd65 commit 00f85e3f264d665b30f0ce2ad98a12b15802dd65 Author: Konstantin Belousov AuthorDate: 2021-04-13 11:47:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 00:38:30 +0000 nfs client: depend on xdr (cherry picked from commit 8cca7b7f28feaf0c5e2dfedb985ae334a4013ef6) --- sys/fs/nfsclient/nfs_clvfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 348a64abc11b..754f370a04de 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -151,7 +151,7 @@ MODULE_VERSION(nfs, 1); MODULE_DEPEND(nfs, nfscommon, 1, 1, 1); MODULE_DEPEND(nfs, krpc, 1, 1, 1); MODULE_DEPEND(nfs, nfssvc, 1, 1, 1); -MODULE_DEPEND(nfs, nfslock, 1, 1, 1); +MODULE_DEPEND(nfs, xdr, 1, 1, 1); /* * This structure is now defined in sys/nfs/nfs_diskless.c so that it From owner-dev-commits-src-all@freebsd.org Sat May 1 00:57:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B34FB62FAC9; Sat, 1 May 2021 00:57: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 4FX9nR4h0wz3rLK; Sat, 1 May 2021 00:57: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 9386364B6; Sat, 1 May 2021 00:57: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 1410vVAs074363; Sat, 1 May 2021 00:57:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410vVEB074362; Sat, 1 May 2021 00:57:31 GMT (envelope-from git) Date: Sat, 1 May 2021 00:57:31 GMT Message-Id: <202105010057.1410vVEB074362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: bbdd27a5bc84 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bbdd27a5bc8496b270d9f39d97f984d092411241 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:57:31 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bbdd27a5bc8496b270d9f39d97f984d092411241 commit bbdd27a5bc8496b270d9f39d97f984d092411241 Author: Neel Chauhan AuthorDate: 2021-04-28 15:04:52 +0000 Commit: Neel Chauhan CommitDate: 2021-05-01 00:54:42 +0000 linuxkpi: Implement rcu_replace_pointer() macro This is needed for the drm-kmod 5.5 update. Reviewed by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30025 (cherry picked from commit efe7f12cd37bf8f2538df387d565e7849112a598) --- 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-all@freebsd.org Sat May 1 00:57:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8D9B62FCA6; Sat, 1 May 2021 00:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FX9nS5kNTz3r9W; Sat, 1 May 2021 00:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B647963A7; Sat, 1 May 2021 00:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1410vWk8074384; Sat, 1 May 2021 00:57:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410vWF9074383; Sat, 1 May 2021 00:57:32 GMT (envelope-from git) Date: Sat, 1 May 2021 00:57:32 GMT Message-Id: <202105010057.1410vWF9074383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: 1fbf4377a410 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fbf4377a41096cc1a0fa46b35f7afb4ed21ee98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:57:32 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1fbf4377a41096cc1a0fa46b35f7afb4ed21ee98 commit 1fbf4377a41096cc1a0fa46b35f7afb4ed21ee98 Author: Neel Chauhan AuthorDate: 2021-04-28 15:05:57 +0000 Commit: Neel Chauhan CommitDate: 2021-05-01 00:55:47 +0000 linuxkpi: Introduce tasklet_disable_nosync() This is needed for the drm-kmod 5.5 update. Reviewed by: hselasky (src) Differential Revision: https://reviews.freebsd.org/D30024 (cherry picked from commit 9781105bea58b8bce53ba766850c5f023b34c43c) --- 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-all@freebsd.org Sat May 1 00:57:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 258FF62FD27; Sat, 1 May 2021 00:57: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 4FX9nV08Chz3r9b; Sat, 1 May 2021 00:57: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 D39956249; Sat, 1 May 2021 00:57: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 1410vXom074405; Sat, 1 May 2021 00:57:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1410vXrC074404; Sat, 1 May 2021 00:57:33 GMT (envelope-from git) Date: Sat, 1 May 2021 00:57:33 GMT Message-Id: <202105010057.1410vXrC074404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Neel Chauhan Subject: git: fb34817c686c - stable/13 - param.h: bump __FreeBSD_version for commits efe7f12cd37b and 9781105bea58 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fb34817c686cc130449325499870e36979899801 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 00:57:34 -0000 The branch stable/13 has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fb34817c686cc130449325499870e36979899801 commit fb34817c686cc130449325499870e36979899801 Author: Neel Chauhan AuthorDate: 2021-05-01 00:56:57 +0000 Commit: Neel Chauhan CommitDate: 2021-05-01 00:56:57 +0000 param.h: bump __FreeBSD_version for commits efe7f12cd37b and 9781105bea58 Both commits update the linuxkpi to accommodate the drm-kmod 5.5 update. --- 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 c93eccc143dd..db5a31d60267 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 1300503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Sat May 1 00:58:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sat May 1 08:25:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sat May 1 08:25:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sat May 1 09:03:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2406D63B044; Sat, 1 May 2021 09:03: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 4FXNZ50LgGz3qWh; Sat, 1 May 2021 09: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 F0B4814FB5; Sat, 1 May 2021 09:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14193Ond022837; Sat, 1 May 2021 09:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14193OSE022836; Sat, 1 May 2021 09:03:24 GMT (envelope-from git) Date: Sat, 1 May 2021 09:03:24 GMT Message-Id: <202105010903.14193OSE022836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: bb9dcbf1a243 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bb9dcbf1a243ac92855c0109fd922c2ba60eb691 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 09:03:25 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=bb9dcbf1a243ac92855c0109fd922c2ba60eb691 commit bb9dcbf1a243ac92855c0109fd922c2ba60eb691 Author: Richard Scheffenegger AuthorDate: 2021-04-28 12:56:14 +0000 Commit: Richard Scheffenegger CommitDate: 2021-05-01 08:26:53 +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 (cherry picked from commit 48be5b976e34022862da3be69350d60e969d39e5) --- 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 9905fc01ced8..eec722d8097e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -510,6 +510,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 40d63bd3832f..9187a9fc66d8 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -866,9 +866,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-all@freebsd.org Sat May 1 13:36:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sat May 1 13:46:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8F7E62BD02; Sat, 1 May 2021 13:46: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 4FXVrJ4qQxz4Z1B; Sat, 1 May 2021 13:46: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 9839018B28; Sat, 1 May 2021 13:46: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 141Dk8CC093935; Sat, 1 May 2021 13:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 141Dk8mu093934; Sat, 1 May 2021 13:46:08 GMT (envelope-from git) Date: Sat, 1 May 2021 13:46:08 GMT Message-Id: <202105011346.141Dk8mu093934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23a3c3d97d72 - stable/12 - Fix mismerge in 00f85e3f264d665b30f0ce2a. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 23a3c3d97d72e9d3daa76ff263148bd6a68eb65e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 13:46:08 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23a3c3d97d72e9d3daa76ff263148bd6a68eb65e commit 23a3c3d97d72e9d3daa76ff263148bd6a68eb65e Author: Konstantin Belousov AuthorDate: 2021-05-01 13:42:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-05-01 13:42:27 +0000 Fix mismerge in 00f85e3f264d665b30f0ce2a. nfslock is still needed on stable/12. This is the direct commit to the stable/12 branch. Noted by: rmacklem Sponsored by: The FreeBSD Foundation --- sys/fs/nfsclient/nfs_clvfsops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 754f370a04de..1a1e1b122994 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -151,6 +151,7 @@ MODULE_VERSION(nfs, 1); MODULE_DEPEND(nfs, nfscommon, 1, 1, 1); MODULE_DEPEND(nfs, krpc, 1, 1, 1); MODULE_DEPEND(nfs, nfssvc, 1, 1, 1); +MODULE_DEPEND(nfs, nfslock, 1, 1, 1); MODULE_DEPEND(nfs, xdr, 1, 1, 1); /* From owner-dev-commits-src-all@freebsd.org Sat May 1 21:18:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 06:13:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45C235FA0B8 for ; Sun, 2 May 2021 06:13: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 4FXwln1X99z3srM; Sun, 2 May 2021 06:13: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 277F525D33; Sun, 2 May 2021 06:13: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 1426DfKd007706; Sun, 2 May 2021 06:13:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1426DfQo007705; Sun, 2 May 2021 06:13:41 GMT (envelope-from git) Date: Sun, 2 May 2021 06:13:41 GMT Message-Id: <202105020613.1426DfQo007705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: bb457ab74420 - vendor/less - Vendor import of less 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/vendor/less X-Git-Reftype: branch X-Git-Commit: bb457ab744207cc137364e84eb5e56632cdcdc98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 06:13:41 -0000 The branch vendor/less has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=bb457ab744207cc137364e84eb5e56632cdcdc98 commit bb457ab744207cc137364e84eb5e56632cdcdc98 Author: Xin LI AuthorDate: 2021-05-02 06:13:19 +0000 Commit: Xin LI CommitDate: 2021-05-02 06:13:19 +0000 Vendor import of less v581.2. --- NEWS | 2 +- README | 4 ++-- help.c | 2 +- less.man | 2 +- less.nro | 2 +- lessecho.man | 2 +- lessecho.nro | 2 +- lesskey.man | 2 +- lesskey.nro | 2 +- screen.c | 16 ++++++++-------- version.c | 3 ++- 11 files changed, 20 insertions(+), 19 deletions(-) diff --git a/NEWS b/NEWS index fd214e62007d..bc5afd655ddc 100644 --- a/NEWS +++ b/NEWS @@ -12,7 +12,7 @@ ====================================================================== - Major changes between "less" versions 563 and 581 + Major changes between "less" versions 563 and 581.2 * Change ESC-u command to toggle, not disable, highlighting per man page. diff --git a/README b/README index c99d208960cc..b5bf899c7170 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ - 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 diff --git a/help.c b/help.c index 94b92cea69c2..f5b4aa1fbf1a 100644 --- a/help.c +++ b/help.c @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 1:31 on 2021/4/7 */ +/* This file was generated by mkhelp.pl from less.hlp at 14:59 on 2021/4/28 */ #include "less.h" constant char helpdata[] = { '\n', diff --git a/less.man b/less.man index 5556488be6fa..6efe7a99d464 100644 --- a/less.man +++ b/less.man @@ -1817,4 +1817,4 @@ LESS(1) General Commands Manual LESS(1) - Version 581: 06 Apr 2021 LESS(1) + Version 581.2: 28 Apr 2021 LESS(1) diff --git a/less.nro b/less.nro index 41021321964b..f148ccb76d98 100644 --- a/less.nro +++ b/less.nro @@ -1,5 +1,5 @@ '\" t -.TH LESS 1 "Version 581: 06 Apr 2021" +.TH LESS 1 "Version 581.2: 28 Apr 2021" .SH NAME less \- opposite of more .SH SYNOPSIS diff --git a/lessecho.man b/lessecho.man index 878e7ad7e17e..6a47aba2dab6 100644 --- a/lessecho.man +++ b/lessecho.man @@ -51,4 +51,4 @@ LESSECHO(1) General Commands Manual LESSECHO(1) - Version 581: 06 Apr 2021 LESSECHO(1) + Version 581.2: 28 Apr 2021 LESSECHO(1) diff --git a/lessecho.nro b/lessecho.nro index ef822fabdafb..484efa135d34 100644 --- a/lessecho.nro +++ b/lessecho.nro @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 581: 06 Apr 2021" +.TH LESSECHO 1 "Version 581.2: 28 Apr 2021" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS diff --git a/lesskey.man b/lesskey.man index 8692f3fead56..36a629ef850e 100644 --- a/lesskey.man +++ b/lesskey.man @@ -358,4 +358,4 @@ LESSKEY(1) General Commands Manual LESSKEY(1) - Version 581: 06 Apr 2021 LESSKEY(1) + Version 581.2: 28 Apr 2021 LESSKEY(1) diff --git a/lesskey.nro b/lesskey.nro index a9aec69fea0f..1f8e5b39ecaf 100644 --- a/lesskey.nro +++ b/lesskey.nro @@ -1,5 +1,5 @@ '\" t -.TH LESSKEY 1 "Version 581: 06 Apr 2021" +.TH LESSKEY 1 "Version 581.2: 28 Apr 2021" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS diff --git a/screen.c b/screen.c index 7e8f8af4f463..ff6b6d785af7 100644 --- a/screen.c +++ b/screen.c @@ -1673,8 +1673,6 @@ ltputs(str, affcnt, f_putc) public void init_mouse(VOID_PARAM) { - if (!mousecap) - return; #if !MSDOS_COMPILER ltputs(sc_s_mousecap, sc_height, putchr); #else @@ -1693,8 +1691,6 @@ init_mouse(VOID_PARAM) public void deinit_mouse(VOID_PARAM) { - if (!mousecap) - return; #if !MSDOS_COMPILER ltputs(sc_e_mousecap, sc_height, putchr); #else @@ -1718,7 +1714,8 @@ init(VOID_PARAM) ltputs(sc_init, sc_height, putchr); if (!no_keypad) ltputs(sc_s_keypad, sc_height, putchr); - init_mouse(); + if (mousecap) + init_mouse(); } init_done = 1; if (top_scroll) @@ -1741,7 +1738,8 @@ init(VOID_PARAM) { if (!no_init) win32_init_term(); - init_mouse(); + if (mousecap) + init_mouse(); } win32_init_vt_term(); @@ -1763,7 +1761,8 @@ deinit(VOID_PARAM) #if !MSDOS_COMPILER if (!(quit_if_one_screen && one_screen)) { - deinit_mouse(); + if (mousecap) + deinit_mouse(); if (!no_keypad) ltputs(sc_e_keypad, sc_height, putchr); if (!no_init) @@ -1776,7 +1775,8 @@ deinit(VOID_PARAM) win32_deinit_vt_term(); if (!(quit_if_one_screen && one_screen)) { - deinit_mouse(); + if (mousecap) + deinit_mouse(); if (!no_init) win32_deinit_term(); } diff --git a/version.c b/version.c index cb7d69ffcda7..7ca31e0930fa 100644 --- a/version.c +++ b/version.c @@ -919,6 +919,7 @@ v578 2/9/21 Doc v579 2/14/21 Fix double-width char bugs and non-match search crash. v580 3/2/21 Some color fixes; fix compiler warnings; some lesstest support. v581 4/6/21 Ignore SIGTSTP in secure mode; don't print "skipping" when filtering. +v581.2 4/28/21 Fix failure to deinit mouse. */ -char version[] = "581"; +char version[] = "581.2"; From owner-dev-commits-src-all@freebsd.org Sun May 2 06:14:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF44F5FA41B for ; Sun, 2 May 2021 06:14: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 4FXwmt569rz3sRd; Sun, 2 May 2021 06:14: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 A227825DA6; Sun, 2 May 2021 06:14: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 1426EcAa007882; Sun, 2 May 2021 06:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1426Ec0M007881; Sun, 2 May 2021 06:14:38 GMT (envelope-from git) Date: Sun, 2 May 2021 06:14:38 GMT Message-Id: <202105020614.1426Ec0M007881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: 668122b7ccf0 - Create tag vendor/less/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/tags/vendor/less/v581.2 X-Git-Reftype: annotated tag X-Git-Commit: 668122b7ccf01e7aac80171e37a227e2b7b5c668 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2021 06:14:38 -0000 The annotated tag vendor/less/v581.2 has been created by delphij: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/less/v581.2 tag vendor/less/v581.2 Tagger: Xin LI TaggerDate: 2021-05-02 06:13:56 +0000 Tag less v581.2. commit bb457ab744207cc137364e84eb5e56632cdcdc98 Author: Xin LI AuthorDate: 2021-05-02 06:13:19 +0000 Commit: Xin LI CommitDate: 2021-05-02 06:13:19 +0000 Vendor import of less v581.2. From owner-dev-commits-src-all@freebsd.org Sun May 2 06:20:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 10:56:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 10:56:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 14:22:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 16:33:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 16:33:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 19:46:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 23:08:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 23:24:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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-all@freebsd.org Sun May 2 23:45:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches 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);