svn commit: r365685 - head/usr.sbin/traceroute6
Author: tuexen Date: Sun Sep 13 09:00:00 2020 New Revision: 365685 URL: https://svnweb.freebsd.org/changeset/base/365685 Log: Add a -t option to traceroute6 to control the traffic class used when sending probe packets. Reviewed by: rscheff MFC after:1 week Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D26410 Modified: head/usr.sbin/traceroute6/traceroute6.8 head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.8 == --- head/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 02:17:57 2020 (r365684) +++ head/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 09:00:00 2020 (r365685) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2019 +.Dd September 13, 2020 .Dt TRACEROUTE6 8 .Os .\" @@ -61,6 +61,9 @@ .Op Fl s Ar src .Ek .Bk -words +.Op Fl t Ar tclass +.Ek +.Bk -words .Op Fl w Ar waittime .Ek .Bk -words @@ -148,6 +151,13 @@ If .Ar datalen is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled with a PAD chunk. For larger probe packets, an INIT chunk is used. +.It Fl t Ar tclass +.Ar tclass +specifies the +.Em traffic class +used when sending probe packets. +The value must be a decimal integer in the range 0 to 255. +The default is 0. .It Fl T Use TCP segments for the probes. .It Fl U Modified: head/usr.sbin/traceroute6/traceroute6.c == --- head/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 02:17:57 2020 (r365684) +++ head/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 09:00:00 2020 (r365685) @@ -346,6 +346,7 @@ static u_long max_hops = 30; static u_int16_t srcport; static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ static u_int16_t ident; +static int tclass = -1; static int options;/* socket options */ static int verbose; static int waittime = 5; /* time to wait for response (in seconds) */ @@ -364,7 +365,7 @@ main(int argc, char *argv[]) int ch, i, on = 1, seq, rcvcmsglen, error; struct addrinfo hints, *res; static u_char *rcvcmsgbuf; - u_long probe, hops, lport; + u_long probe, hops, lport, ltclass; struct hostent *hp; size_t size, minlen; uid_t uid; @@ -414,7 +415,7 @@ main(int argc, char *argv[]) seq = 0; ident = htons(getpid() & 0x); /* same as ping6 */ - while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1) switch (ch) { case 'a': as_path = 1; @@ -531,6 +532,17 @@ main(int argc, char *argv[]) case 'S': useproto = IPPROTO_SCTP; break; + case 't': + ep = NULL; + errno = 0; + ltclass = strtoul(optarg, &ep, 0); + if (errno || !*optarg || *ep || ltclass > 255) { + fprintf(stderr, + "traceroute6: invalid traffic class.\n"); + exit(1); + } + tclass = (int)ltclass; + break; case 'T': useproto = IPPROTO_TCP; break; @@ -595,6 +607,13 @@ main(int argc, char *argv[]) exit(1); } + if (tclass != -1) { + if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_TCLASS, &tclass, + sizeof(int)) == -1) { + perror("setsockopt(IPV6_TCLASS)"); + exit(7); + } + } if (argc < 1 || argc > 2) usage(); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365686 - head/sys/netinet
Author: tuexen Date: Sun Sep 13 09:06:50 2020 New Revision: 365686 URL: https://svnweb.freebsd.org/changeset/base/365686 Log: Export the name of the congestion control. This will be used by sockstat and netstat. Reviewed by: rscheff MFC after:1 week Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D26412 Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Sun Sep 13 09:00:00 2020(r365685) +++ head/sys/netinet/tcp_subr.c Sun Sep 13 09:06:50 2020(r365686) @@ -3457,6 +3457,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + bcopy(CC_ALGO(tp)->name, xt->xt_cc, + TCP_CA_NAME_MAX); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: head/sys/netinet/tcp_var.h == --- head/sys/netinet/tcp_var.h Sun Sep 13 09:00:00 2020(r365685) +++ head/sys/netinet/tcp_var.h Sun Sep 13 09:06:50 2020(r365686) @@ -754,7 +754,8 @@ struct xtcpcb { struct xinpcb xt_inp; charxt_stack[TCP_FUNCTION_NAME_LEN_MAX];/* (s) */ charxt_logid[TCP_LOG_ID_LEN]; /* (s) */ - int64_t spare64[8]; + charxt_cc[TCP_CA_NAME_MAX]; /* (s) */ + int64_t spare64[6]; int32_t t_state;/* (s,p) */ uint32_tt_flags;/* (s,p) */ int32_t t_sndzerowin; /* (s) */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365687 - head/usr.bin/sockstat
Author: tuexen Date: Sun Sep 13 09:12:25 2020 New Revision: 365687 URL: https://svnweb.freebsd.org/changeset/base/365687 Log: Add a -C option to sockstat to display the congestion control for TCP connections. Reviewed by: rscheff MFC after:1 week Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D26413 Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 == --- head/usr.bin/sockstat/sockstat.1Sun Sep 13 09:06:50 2020 (r365686) +++ head/usr.bin/sockstat/sockstat.1Sun Sep 13 09:12:25 2020 (r365687) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2020 +.Dd September 13, 2020 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46cLlSsUuvw +.Op Fl 46CcLlSsUuvw .Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols @@ -56,6 +56,9 @@ Show Show .Dv AF_INET6 (IPv6) sockets. +.It Fl C +Display the congestion control module, if applicable. +This is currently only implemented for TCP. .It Fl c Show connected sockets. .It Fl j Ar jail @@ -170,6 +173,10 @@ is specified (only for SCTP or TCP). .It Li STACK The protocol stack if .Fl S +is specified (only for TCP). +.It Li CC +The congestion control if +.Fl C is specified (only for TCP). .El .Pp Modified: head/usr.bin/sockstat/sockstat.c == --- head/usr.bin/sockstat/sockstat.cSun Sep 13 09:06:50 2020 (r365686) +++ head/usr.bin/sockstat/sockstat.cSun Sep 13 09:12:25 2020 (r365687) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ +static int opt_C; /* Show congestion control */ static int opt_c; /* Show connected sockets */ static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ @@ -118,6 +119,7 @@ struct sock { int state; const char *protoname; char stack[TCP_FUNCTION_NAME_LEN_MAX]; + char cc[TCP_CA_NAME_MAX]; struct addr *laddr; struct addr *faddr; struct sock *next; @@ -716,6 +718,7 @@ gather_inet(int proto) sock->state = xtp->t_state; memcpy(sock->stack, xtp->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + memcpy(sock->cc, xtp->xt_cc, TCP_CA_NAME_MAX); } sock->protoname = protoname; hash = (int)((uintptr_t)sock->socket % HASHSIZE); @@ -1130,12 +1133,24 @@ displaysock(struct sock *s, int pos) } offset += 13; } - if (opt_S && s->proto == IPPROTO_TCP) { - while (pos < offset) - pos += xprintf(" "); - xprintf("%.*s", TCP_FUNCTION_NAME_LEN_MAX, - s->stack); + if (opt_S) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + pos += xprintf("%.*s", + TCP_FUNCTION_NAME_LEN_MAX, + s->stack); + } + offset += TCP_FUNCTION_NAME_LEN_MAX + 1; } + if (opt_C) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + xprintf("%.*s", TCP_CA_NAME_MAX, s->cc); + } + offset += TCP_CA_NAME_MAX + 1; + } } if (laddr != NULL) laddr = laddr->next; @@ -1170,7 +1185,10 @@ display(void) printf(" %-12s", "CONN STATE"); } if (opt_S) - printf(" %.*s", TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + printf(" %-*.*s", TCP_FUNCTION_NAME_LEN_MAX, + TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + if (opt_C) + printf(" %-.*s", TCP_CA_NAME_MAX, "CC"); printf("\n"); } setpassent(1); @@ -1286,13 +1304,16 @@ main(int argc, char *argv[]) int o, i; opt_j = -1; - while ((o
svn commit: r365688 - head/usr.bin/netstat
Author: tuexen Date: Sun Sep 13 09:14:32 2020 New Revision: 365688 URL: https://svnweb.freebsd.org/changeset/base/365688 Log: Add a -C option to netstat to display the congestion control for TCP connections. Reviewed by: rscheff MFC after:1 week Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D26414 Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/inet.c == --- head/usr.bin/netstat/inet.c Sun Sep 13 09:12:25 2020(r365687) +++ head/usr.bin/netstat/inet.c Sun Sep 13 09:14:32 2020(r365688) @@ -341,6 +341,9 @@ protopr(u_long off, const char *name, int af1, int pro xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } + if (Cflag) + xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, "CC"); if (Pflag) xo_emit(" {T:/%s}", "Log ID"); xo_emit("\n"); @@ -514,9 +517,15 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_flowid, inp->inp_flowtype); } - if (istcp && Pflag) - xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ? - "-" : tp->xt_logid); + if (istcp) { + if (Cflag) + xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, tp->xt_cc); + if (Pflag) + xo_emit(" {:log-id/%s}", + tp->xt_logid[0] == '\0' ? + "-" : tp->xt_logid); + } xo_emit("\n"); xo_close_instance("socket"); } Modified: head/usr.bin/netstat/main.c == --- head/usr.bin/netstat/main.c Sun Sep 13 09:12:25 2020(r365687) +++ head/usr.bin/netstat/main.c Sun Sep 13 09:14:32 2020(r365688) @@ -205,6 +205,7 @@ int Aflag; /* show addresses of protocol control bloc intaflag; /* show all sockets (including servers) */ static int Bflag; /* show information about bpf consumers */ intbflag; /* show i/f total bytes in/out */ +intCflag; /* show congestion control */ intdflag; /* show i/f dropped packets */ intgflag; /* show group (multicast) routing or stats */ inthflag; /* show counters in human readable format */ @@ -249,7 +250,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:noPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCdF:f:ghI:iLlM:mN:noPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -277,6 +278,9 @@ main(int argc, char *argv[]) break; case 'b': bflag = 1; + break; + case 'C': + Cflag = 1; break; case 'd': dflag = 1; Modified: head/usr.bin/netstat/netstat.1 == --- head/usr.bin/netstat/netstat.1 Sun Sep 13 09:12:25 2020 (r365687) +++ head/usr.bin/netstat/netstat.1 Sun Sep 13 09:14:32 2020 (r365688) @@ -28,7 +28,7 @@ .\"@(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 21, 2020 +.Dd September 13, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Bl -tag -width "netstat" .It Nm .Op Fl -libxo -.Op Fl 46AaLnPRSTWx +.Op Fl 46AaCLnPRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -111,7 +111,7 @@ depending on the options for the information presented .It Xo .Bk -words .Nm -.Op Fl 46AaLnRSTWx +.Op Fl 46AaCLnRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -172,6 +172,8 @@ associated with a socket; used for debugging. .It Fl a Show the state of all sockets; normally sockets used by server processes are not shown. +.It Fl C +Show the congestion control of TCP sockets. .It Fl L Show the size of the various listen queues. The first count shows the number of unaccepted connections, Modified: head/usr.bin/netstat/netstat.h == --- head
Re: svn commit: r365640 - in head: share/man/man5 share/man/man7 tools/build/options
On 2020-09-13 07:57, Gordon Bergling wrote: Hi Niclas, On Sat, Sep 12, 2020 at 09:13:33PM +0200, Niclas Zeising wrote: On 2020-09-11 20:09, Gordon Bergling wrote: Author: gbe (doc committer) Date: Fri Sep 11 18:09:49 2020 New Revision: 365640 URL: https://svnweb.freebsd.org/changeset/base/365640 Log: Improvements for the src.conf(5) and build(7) man pages PR: 203863 (based on) Submitted by: Russell Haley Reviewed by:bcr, imp Approved by:imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26343 Modified: head/share/man/man5/src.conf.5 head/share/man/man7/build.7 head/tools/build/options/makeman Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Fri Sep 11 17:05:09 2020 (r365639) +++ head/share/man/man5/src.conf.5 Fri Sep 11 18:09:49 2020 (r365640) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. As the comment above hints, this file is generated by a tool, and should not be edited directly. This will be overwritten the next time someone regenerates the manual page. You have to update the template in tools/build/options/makeman and regenerate the manual from there. I did updated 'tools/build/options/makeman' with this commit. I justed commited the newly generated src.conf.5 alongside and not with a separate commit. Sorry about that, I should have seen it in the commit log. Regards -- Niclas Zeising ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365689 - in stable/12: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris...
Author: allanjude Date: Sun Sep 13 16:28:25 2020 New Revision: 365689 URL: https://svnweb.freebsd.org/changeset/base/365689 Log: MFOpenZFS: Introduce read/write kstats per dataset The following patch introduces a few statistics on reads and writes grouped by dataset. These statistics are implemented as kstats (backed by aggregate sums for performance) and can be retrieved by using the dataset objset ID number. The motivation for this change is to provide some preliminary analytics on dataset usage/performance. Reviewed-by: Richard Elling Reviewed-by: Brian Behlendorf Reviewed by: Matthew Ahrens Signed-off-by: Serapheim Dimitropoulos openzfs/zfs@a448a2557ec4938ed6944c7766fe0b8e6e5f6456 Also contains parts of: MFOpenZFS: Connect dataset_kstats for FreeBSD Example output: kstat.zfs/mypool.dataset.objset-0x10b.nread: 150528 kstat.zfs/mypool.dataset.objset-0x10b.reads: 48 kstat.zfs/mypool.dataset.objset-0x10b.nwritten: 134217728 kstat.zfs/mypool.dataset.objset-0x10b.writes: 1024 kstat.zfs/mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname Reviewed-by: Ryan Moeller Reviewed by: Sean Eric Fagan Reviewed-by: Serapheim Dimitropoulos Reviewed-by: Brian Behlendorf Signed-off-by: Allan Jude openzfs/zfs@4547fc4e071ceb1818b3a46c3035b923e06e5390 This is a direct commit to stable/12 because they do not exist in illumos upstream ZFS and needed to be heavily modified to work in stable/12 Relnotes: yes Sponsored by: Klara Inc. Added: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c stable/12/sys/cddl/compat/opensolaris/sys/kstat.h stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 == --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8Sun Sep 13 09:14:32 2020(r365688) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8Sun Sep 13 16:28:25 2020(r365689) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2019 +.Dd September 12, 2020 .Dt ZFS 8 .Os .Sh NAME @@ -635,6 +635,16 @@ property can be either .Cm yes or .Cm no . +.It Sy objsetid +A unique identifier for this dataset within the pool. Unlike the dataset's +.Sy guid +, the +.Sy objsetid +of a dataset is not transferred to other pools when the snapshot is copied +with a send/receive operation. +The +.Sy objsetid +can be reused (for a new datatset) after the dataset is deleted. .It Sy origin For cloned file systems or volumes, the snapshot from which the clone was created. See also the Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 == --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8Sun Sep 13 09:14:32 2020(r365688) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8Sun Sep 13 16:28:25 2020(r365689) @@ -687,6 +687,15 @@ will decrease while increases. .It Sy guid A unique identifier for the pool. +.It Sy load_guid +A unique identifier for the pool. +Unlike the +.Sy guid +property, this identifier is generated every time we load the pool (e.g. does +not persist across imports/exports) and never changes while the pool is loaded +(even if a +.Sy reguid +operation takes place). .It Sy health The current health of the pool. Health can be .Qq Sy ONLINE , Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c == --- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sun Sep 13 09:14:32 2020(r365688) +++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sun Sep 13 16:28:25 2020(r365689) @@ -38,6 +38,17 @@ static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel st SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); +static int +kstat_default_update(kstat_t *ksp, int rw) +{ + KASSERT(ks
svn commit: r365690 - head/sys/powerpc/aim
Author: bdragon Date: Sun Sep 13 16:42:49 2020 New Revision: 365690 URL: https://svnweb.freebsd.org/changeset/base/365690 Log: [PowerPC64] Implement pmap_mincore() for moea64 Implement pmap_mincore() for moea64. This will need some slight tweaks when large page support in HPT lands. Submitted by: Fernando Eckhardt Valle Reviewed by: bdragon Differential Revision:https://reviews.freebsd.org/D26314 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cSun Sep 13 16:28:25 2020 (r365689) +++ head/sys/powerpc/aim/mmu_oea64.cSun Sep 13 16:42:49 2020 (r365690) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -315,6 +317,7 @@ static void *moea64_dump_pmap_init(unsigned blkpgs); #ifdef __powerpc64__ static void moea64_page_array_startup(long); #endif +static int moea64_mincore(pmap_t, vm_offset_t, vm_paddr_t *); static struct pmap_funcs moea64_methods = { .clear_modify = moea64_clear_modify, @@ -331,6 +334,7 @@ static struct pmap_funcs moea64_methods = { .is_referenced = moea64_is_referenced, .ts_referenced = moea64_ts_referenced, .map = moea64_map, + .mincore = moea64_mincore, .page_exists_quick = moea64_page_exists_quick, .page_init = moea64_page_init, .page_wired_mappings = moea64_page_wired_mappings, @@ -1219,6 +1223,51 @@ moea64_unwire(pmap_t pm, vm_offset_t sva, vm_offset_t pm->pm_stats.wired_count--; } PMAP_UNLOCK(pm); +} + +static int +moea64_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *pap) +{ + struct pvo_entry *pvo; + vm_paddr_t pa; + vm_page_t m; + int val; + bool managed; + + PMAP_LOCK(pmap); + + /* XXX Add support for superpages */ + pvo = moea64_pvo_find_va(pmap, addr); + if (pvo != NULL) { + pa = PVO_PADDR(pvo); + m = PHYS_TO_VM_PAGE(pa); + managed = (pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED; + val = MINCORE_INCORE; + } else { + PMAP_UNLOCK(pmap); + return (0); + } + + PMAP_UNLOCK(pmap); + + if (m == NULL) + return (0); + + if (managed) { + if (moea64_is_modified(m)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + + if (moea64_is_referenced(m)) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + managed) { + *pap = pa; + } + + return (val); } /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365691 - head/sys/powerpc/aim
Author: bdragon Date: Sun Sep 13 16:46:03 2020 New Revision: 365691 URL: https://svnweb.freebsd.org/changeset/base/365691 Log: [PowerPC] Implement pmap_mincore() for moea Do the same as previous for moea. Tested on G4. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Sun Sep 13 16:42:49 2020 (r365690) +++ head/sys/powerpc/aim/mmu_oea.c Sun Sep 13 16:46:03 2020 (r365691) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -291,6 +293,7 @@ boolean_t moea_is_prefaultable(pmap_t, vm_offset_t); boolean_t moea_is_referenced(vm_page_t); int moea_ts_referenced(vm_page_t); vm_offset_t moea_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); +static int moea_mincore(pmap_t, vm_offset_t, vm_paddr_t *); boolean_t moea_page_exists_quick(pmap_t, vm_page_t); void moea_page_init(vm_page_t); int moea_page_wired_mappings(vm_page_t); @@ -354,7 +357,8 @@ static struct pmap_funcs moea_methods = { .qremove = moea_qremove, .release = moea_release, .remove = moea_remove, - .remove_all = moea_remove_all, + .remove_all = moea_remove_all, + .mincore = moea_mincore, .remove_write = moea_remove_write, .sync_icache = moea_sync_icache, .unwire = moea_unwire, @@ -1924,6 +1928,50 @@ moea_remove_all(vm_page_t m) } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); +} + +static int +moea_mincore(pmap_t pm, vm_offset_t va, vm_paddr_t *pap) +{ + struct pvo_entry *pvo; + vm_paddr_t pa; + vm_page_t m; + int val; + bool managed; + + PMAP_LOCK(pm); + + pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); + if (pvo != NULL) { + pa = PVO_PADDR(pvo); + m = PHYS_TO_VM_PAGE(pa); + managed = (pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED; + val = MINCORE_INCORE; + } else { + PMAP_UNLOCK(pm); + return (0); + } + + PMAP_UNLOCK(pm); + + if (m == NULL) + return (0); + + if (managed) { + if (moea_is_modified(m)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + + if (moea_is_referenced(m)) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + managed) { + *pap = pa; + } + + return (val); } /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365692 - head/tools/build/options
Author: emaste Date: Sun Sep 13 17:13:32 2020 New Revision: 365692 URL: https://svnweb.freebsd.org/changeset/base/365692 Log: Remove WITHOUT_BMAKE description The option was retired in r265423 and bmake is the only make in tree. Deleted: head/tools/build/options/WITHOUT_BMAKE ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365693 - head/sys/powerpc/include
Author: bdragon Date: Sun Sep 13 17:36:43 2020 New Revision: 365693 URL: https://svnweb.freebsd.org/changeset/base/365693 Log: [PowerPC64LE] Adjust ELF definitions for LE. Set ELF_TARG_DATA correctly on PowerPC64LE. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/include/elf.h Modified: head/sys/powerpc/include/elf.h == --- head/sys/powerpc/include/elf.h Sun Sep 13 17:13:32 2020 (r365692) +++ head/sys/powerpc/include/elf.h Sun Sep 13 17:36:43 2020 (r365693) @@ -100,14 +100,17 @@ __ElfType(Auxinfo); #defineR_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1) /* Define "machine" characteristics */ +#if BYTE_ORDER == LITTLE_ENDIAN +#defineELF_TARG_DATA ELFDATA2LSB +#else +#defineELF_TARG_DATA ELFDATA2MSB +#endif #if __ELF_WORD_SIZE == 64 #defineELF_TARG_CLASS ELFCLASS64 -#defineELF_TARG_DATA ELFDATA2MSB #defineELF_TARG_MACH EM_PPC64 #defineELF_TARG_VER1 #else #defineELF_TARG_CLASS ELFCLASS32 -#defineELF_TARG_DATA ELFDATA2MSB #defineELF_TARG_MACH EM_PPC #defineELF_TARG_VER1 #endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365694 - in head: include sys/modules
Author: bdragon Date: Sun Sep 13 18:24:15 2020 New Revision: 365694 URL: https://svnweb.freebsd.org/changeset/base/365694 Log: [PowerPC64LE] Ensure nvram is built on powerpc64le. Fix some cases where conditionals that were trying to exclude powerpcspe were also excluding powerpc64le. Sponsored by: Tag1 Consulting, Inc. Modified: head/include/Makefile head/sys/modules/Makefile Modified: head/include/Makefile == --- head/include/Makefile Sun Sep 13 17:36:43 2020(r365693) +++ head/include/Makefile Sun Sep 13 18:24:15 2020(r365694) @@ -93,7 +93,7 @@ INCS+=iconv.h LSUBDIRS+= dev/usb .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" _dev_powermac_nvram= dev/powermac_nvram .endif Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Sun Sep 13 17:36:43 2020(r365693) +++ head/sys/modules/Makefile Sun Sep 13 18:24:15 2020(r365694) @@ -784,7 +784,7 @@ _ipmi= ipmi _ixl= ixl _nvram=opal_nvram .endif -.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" # Don't build powermac_nvram for powerpcspe, it's never supported. _nvram+= powermac_nvram .endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365695 - head/release/tools
Author: cperciva Date: Sun Sep 13 19:11:45 2020 New Revision: 365695 URL: https://svnweb.freebsd.org/changeset/base/365695 Log: Bump the size of EC2 AMIs up to 5 GB. The FreeBSD base system continues to expand. 4GB is now insufficient; we passed 3 GB in May 2019; we passed 2 GB in August 2017. Over half of the disk space used is in /usr/lib/debug/. Without this change, instances boot but are unusable, since the first thing which breaks when VM filesystems are too small is the "pkg install" in the VM building process. Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf == --- head/release/tools/ec2.conf Sun Sep 13 18:24:15 2020(r365694) +++ head/release/tools/ec2.conf Sun Sep 13 19:11:45 2020(r365695) @@ -19,12 +19,12 @@ fi # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd dev_aws_disk" -# Build with a 3.9 GB UFS partition; the growfs rc.d script will expand +# Build with a 4.9 GB UFS partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # 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=4000M +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 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365696 - head/release/tools
Author: cperciva Date: Sun Sep 13 19:56:53 2020 New Revision: 365696 URL: https://svnweb.freebsd.org/changeset/base/365696 Log: Spawn the DHCPv6 client in EC2 instances via rtsold. Prior to this commit, EC2 AMIs used a "dual-dhclient" tool which was launched in place of dhclient and spawned both the base system dhclient for IPv4 and the ISC dhclient from ports for IPv6. Now that rtsold supports the "M bit" (managed configuration), we can go back to having the base system dhclient spawned normally, and provide a script to rtsold which spawns the ISC dhclient from ports when rtsold decides that it is appropriate. Thanks to:bz MFC after:1 week Sponsored by: https://www.patreon.com/cperciva Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf == --- head/release/tools/ec2.conf Sun Sep 13 19:11:45 2020(r365695) +++ head/release/tools/ec2.conf Sun Sep 13 19:56:53 2020(r365696) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client ebsnvme-id" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. @@ -63,9 +63,19 @@ vm_extra_pre_umount() { # via EC2 user-data. echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf - # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6. + # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf + + # Provide a script which rtsold can use to launch DHCPv6 + mkdir -p ${DESTDIR}/usr/local/libexec + cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF' +#!/bin/sh + +/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 +EOF + chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365697 - head/sys/powerpc/powerpc
Author: bdragon Date: Sun Sep 13 21:22:39 2020 New Revision: 365697 URL: https://svnweb.freebsd.org/changeset/base/365697 Log: [PowerPC64LE] Bus space prep for LE Swap the BE and LE bus_space tags when on LE, and adjust the nexus tag to match. This is prep for a a followup that makes the powerpc bus_space macros easier to maintain in the future. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/bus_machdep.c == --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 19:56:53 2020 (r365696) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:22:39 2020 (r365697) @@ -790,7 +790,11 @@ bs_le_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uin TODO; } +#if BYTE_ORDER == LITTLE_ENDIAN +struct bus_space bs_le_tag = { +#else struct bus_space bs_be_tag = { +#endif /* mapping/unmapping */ bs_gen_map, bs_gen_unmap, @@ -884,7 +888,11 @@ struct bus_space bs_be_tag = { bs_be_sr_8, }; +#if BYTE_ORDER == LITTLE_ENDIAN +struct bus_space bs_be_tag = { +#else struct bus_space bs_le_tag = { +#endif /* mapping/unmapping */ bs_gen_map, bs_gen_unmap, Modified: head/sys/powerpc/powerpc/nexus.c == --- head/sys/powerpc/powerpc/nexus.cSun Sep 13 19:56:53 2020 (r365696) +++ head/sys/powerpc/powerpc/nexus.cSun Sep 13 21:22:39 2020 (r365697) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -173,7 +174,11 @@ static bus_space_tag_t nexus_get_bus_tag(device_t bus __unused, device_t child __unused) { +#if BYTE_ORDER == LITTLE_ENDIAN + return(&bs_le_tag); +#else return(&bs_be_tag); +#endif } static int ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365698 - head/sys/powerpc/powerpc
Author: bdragon Date: Sun Sep 13 21:27:30 2020 New Revision: 365698 URL: https://svnweb.freebsd.org/changeset/base/365698 Log: [PowerPC] bus_space cleanup part 1 - rename bs_be / bs_le functions The intention of the bus_be naming was for those to be the no-endian-swapping and for the bus_le to be endian-swapping in all the functions. This naming breaks down when we're actually are running in LE and need to use the opposite sense. As such, rename bs_be_* to native_bs_* and rename bs_le_* to swapped_bs_*. No functional change. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c == --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:22:39 2020 (r365697) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:27:30 2020 (r365698) @@ -178,10 +178,10 @@ bs_gen_barrier(bus_space_handle_t bsh __unused, bus_si } /* - * Big-endian access functions + * Native-endian access functions */ static uint8_t -bs_be_rs_1(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_1(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint8_t *addr; uint8_t res; @@ -194,7 +194,7 @@ bs_be_rs_1(bus_space_handle_t bsh, bus_size_t ofs) } static uint16_t -bs_be_rs_2(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_2(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint16_t *addr; uint16_t res; @@ -207,7 +207,7 @@ bs_be_rs_2(bus_space_handle_t bsh, bus_size_t ofs) } static uint32_t -bs_be_rs_4(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_4(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint32_t *addr; uint32_t res; @@ -220,7 +220,7 @@ bs_be_rs_4(bus_space_handle_t bsh, bus_size_t ofs) } static uint64_t -bs_be_rs_8(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_8(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint64_t *addr; uint64_t res; @@ -232,31 +232,31 @@ bs_be_rs_8(bus_space_handle_t bsh, bus_size_t ofs) } static void -bs_be_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +native_bs_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { ins8(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +native_bs_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { ins16(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +native_bs_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { ins32(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) +native_bs_rm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { ins64(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +native_bs_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { volatile uint8_t *s = __ppc_ba(bsh, ofs); @@ -266,7 +266,7 @@ bs_be_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +native_bs_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { volatile uint16_t *s = __ppc_ba(bsh, ofs); @@ -276,7 +276,7 @@ bs_be_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +native_bs_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { volatile uint32_t *s = __ppc_ba(bsh, ofs); @@ -286,7 +286,7 @@ bs_be_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) +native_bs_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { volatile uint64_t *s = __ppc_ba(bsh, ofs); @@ -296,7 +296,7 @@ bs_be_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) +native_bs_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { volatile uint8_t *addr; @@ -307,7 +307,7 @@ bs_be_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) +native_bs_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { volatile uint16_t *addr; @@ -318,7 +318,7 @@ bs_be_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) +native_bs_ws_4(bus_space_handle_t bsh, bus_size_t ofs,
svn commit: r365699 - head/sys/powerpc/powerpc
Author: bdragon Date: Sun Sep 13 21:34:32 2020 New Revision: 365699 URL: https://svnweb.freebsd.org/changeset/base/365699 Log: [PowerPC] bus_space cleanup part 2: Convert to c99 initializers. To make it easier to work with this in the future, convert to c99 designated initializer syntax. Tested on powerpc, powerpc64, and powerpc64le. No functional change. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c == --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:27:30 2020 (r365698) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:34:32 2020 (r365699) @@ -796,96 +796,115 @@ struct bus_space bs_le_tag = { struct bus_space bs_be_tag = { #endif /* mapping/unmapping */ - bs_gen_map, - bs_gen_unmap, - bs_gen_subregion, + .bs_map = bs_gen_map, + .bs_unmap = bs_gen_unmap, + .bs_subregion = bs_gen_subregion, /* allocation/deallocation */ - bs_gen_alloc, - bs_gen_free, + .bs_alloc = bs_gen_alloc, + .bs_free = bs_gen_free, /* barrier */ - bs_gen_barrier, + .bs_barrier = bs_gen_barrier, /* read (single) */ - native_bs_rs_1, - native_bs_rs_2, - native_bs_rs_4, - native_bs_rs_8, + .bs_r_1 = native_bs_rs_1, + .bs_r_2 = native_bs_rs_2, + .bs_r_4 = native_bs_rs_4, + .bs_r_8 = native_bs_rs_8, - native_bs_rs_2, - native_bs_rs_4, - native_bs_rs_8, + /* read (single) stream */ + .bs_r_s_2 = native_bs_rs_2, + .bs_r_s_4 = native_bs_rs_4, + .bs_r_s_8 = native_bs_rs_8, /* read multiple */ - native_bs_rm_1, - native_bs_rm_2, - native_bs_rm_4, - native_bs_rm_8, + .bs_rm_1 = native_bs_rm_1, + .bs_rm_2 = native_bs_rm_2, + .bs_rm_4 = native_bs_rm_4, + .bs_rm_8 = native_bs_rm_8, - native_bs_rm_2, - native_bs_rm_4, - native_bs_rm_8, + /* read multiple stream */ + .bs_rm_s_2 =native_bs_rm_2, + .bs_rm_s_4 =native_bs_rm_4, + .bs_rm_s_8 =native_bs_rm_8, /* read region */ - native_bs_rr_1, - native_bs_rr_2, - native_bs_rr_4, - native_bs_rr_8, + .bs_rr_1 = native_bs_rr_1, + .bs_rr_2 = native_bs_rr_2, + .bs_rr_4 = native_bs_rr_4, + .bs_rr_8 = native_bs_rr_8, - native_bs_rr_2, - native_bs_rr_4, - native_bs_rr_8, + /* read region stream */ + .bs_rr_s_2 =native_bs_rr_2, + .bs_rr_s_4 =native_bs_rr_4, + .bs_rr_s_8 =native_bs_rr_8, /* write (single) */ - native_bs_ws_1, - native_bs_ws_2, - native_bs_ws_4, - native_bs_ws_8, + .bs_w_1 = native_bs_ws_1, + .bs_w_2 = native_bs_ws_2, + .bs_w_4 = native_bs_ws_4, + .bs_w_8 = native_bs_ws_8, - native_bs_ws_2, - native_bs_ws_4, - native_bs_ws_8, + /* write (single) stream */ + .bs_w_s_2 = native_bs_ws_2, + .bs_w_s_4 = native_bs_ws_4, + .bs_w_s_8 = native_bs_ws_8, /* write multiple */ - native_bs_wm_1, - native_bs_wm_2, - native_bs_wm_4, - native_bs_wm_8, + .bs_wm_1 = native_bs_wm_1, + .bs_wm_2 = native_bs_wm_2, + .bs_wm_4 = native_bs_wm_4, + .bs_wm_8 = native_bs_wm_8, - native_bs_wm_2, - native_bs_wm_4, - native_bs_wm_8, + /* write multiple stream */ + .bs_wm_s_2 =native_bs_wm_2, + .bs_wm_s_4 =native_bs_wm_4, + .bs_wm_s_8 =native_bs_wm_8, /* write region */ - native_bs_wr_1, - native_bs_wr_2, - native_bs_wr_4, - native_bs_wr_8, + .bs_wr_1 = native_bs_wr_1, + .bs_wr_2 = native_bs_wr_2, + .bs_wr_4 = native_bs_wr_4, + .bs_wr_8 = native_bs_wr_8, - native_bs_wr_2, - native_bs_wr_4, - native_bs_wr_8, + /* write region stream */ + .bs_wr_s_2 =native_bs_wr_2, + .bs_wr_s_4 =native_bs_wr_4, + .bs_wr_s_8 =native_bs_wr_8, /* set multiple */ - native_bs_sm_1, - native_bs_sm_2, - native_bs_sm_4, - native_bs_sm_8, + .bs_sm_1 = native_bs_sm_1, + .bs_sm_2 = native_bs_sm_2, + .bs_sm_4 = native_bs_sm_4, + .bs_sm_8 = native_bs_sm_8, - native_bs_sm_2, - native_bs_sm_4, - native_bs_sm_8, + /* set multiple stream */ + .bs_sm_s_2 =native_bs_sm_2, + .bs_sm_s_4 =native_bs_sm_4, + .bs_sm_s_8 =native_bs_sm_8, /* set region */ - native_bs_sr_1, - native
svn commit: r365700 - head/sbin/newfs
Author: mckusick Date: Sun Sep 13 22:57:50 2020 New Revision: 365700 URL: https://svnweb.freebsd.org/changeset/base/365700 Log: In the newfs(8) utility, use the more appropriate sbwrite() and cgwrite() libufs interfaces rather than sbput() and cgput(). No functional change. MFC after:7 days Sponsored by: Netflix Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c == --- head/sbin/newfs/mkfs.c Sun Sep 13 21:34:32 2020(r365699) +++ head/sbin/newfs/mkfs.c Sun Sep 13 22:57:50 2020(r365700) @@ -556,8 +556,8 @@ restart: * Reference the summary information so it will also be written. */ sblock.fs_csp = fscs; - if (!Nflag && sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (!Nflag && sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); if (Xflag == 1) { printf("** Exiting on Xflag 1\n"); exit(0); @@ -619,8 +619,8 @@ restart: printf("** Exiting on Xflag 3\n"); exit(0); } - if (sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); /* * For UFS1 filesystems with a blocksize of 64K, the first * alternate superblock resides at the location used for @@ -811,11 +811,11 @@ initcg(int cylno, time_t utime) savedactualloc = sblock.fs_sblockactualloc; sblock.fs_sblockactualloc = dbtob(fsbtodb(&sblock, cgsblock(&sblock, cylno))); - if (sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); sblock.fs_sblockactualloc = savedactualloc; - if (cgput(&disk, &acg) != 0) - err(1, "initcg: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "initcg: cgwrite: %s", disk.d_error); start = 0; dp1 = (struct ufs1_dinode *)(&iobuf[start]); dp2 = (struct ufs2_dinode *)(&iobuf[start]); @@ -1024,8 +1024,8 @@ goth: for (i = frag; i < sblock.fs_frag; i++) setbit(cg_blksfree(&acg), d + i); } - if (cgput(&disk, &acg) != 0) - err(1, "alloc: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "alloc: cgwrite: %s", disk.d_error); return ((ufs2_daddr_t)d); } @@ -1045,8 +1045,8 @@ iput(union dinode *ip, ino_t ino) } acg.cg_cs.cs_nifree--; setbit(cg_inosused(&acg), ino); - if (cgput(&disk, &acg) != 0) - err(1, "iput: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "iput: cgwrite: %s", disk.d_error); sblock.fs_cstotal.cs_nifree--; fscs[0].cs_nifree--; if (getinode(&disk, &dp, ino) == -1) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365701 - head
Author: emaste Date: Sun Sep 13 23:05:19 2020 New Revision: 365701 URL: https://svnweb.freebsd.org/changeset/base/365701 Log: Makefile.inc1: remove more old stale depend hacks Current stale dependency hacks are in tools/build/depend-cleanup.sh. These ones were almost a year old; remove them from Makefile.inc1. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sun Sep 13 22:57:50 2020(r365700) +++ head/Makefile.inc1 Sun Sep 13 23:05:19 2020(r365701) @@ -983,34 +983,6 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY @echo ">>> Deleting stale dependencies..."; sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP} -# Date SVN Rev Syscalls/Changes -# Syscall stubs rewritten in C and obsolete MD assembly implementations -# 20191009 r353340 removal of opensolaris_atomic.S (also r353381) -.if ${MACHINE} != i386 -.for f in opensolaris_atomic - @if [ -e "${OBJTOP}/cddl/lib/libzpool/.depend.${f}.o" ] && \ - egrep -qw 'opensolaris_atomic\.S' ${OBJTOP}/cddl/lib/libzpool/.depend.${f}.o; then \ - echo "Removing stale dependencies for opensolaris_atomic"; \ - rm -f ${OBJTOP}/cddl/lib/libzpool/.depend.${f}.* \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/cddl/lib/libzpool/.depend.${f}.*}; \ - fi -.endfor -.endif -# 20190925 r352689 removal of obsolete i386 memchr.S -.for f in memchr - @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ - egrep -qw 'i386/string/memchr\.S' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo "Removing stale dependencies for memchr"; \ - rm -f ${OBJTOP}/lib/libc/.depend.${f}.*; \ - fi -.if defined(_LIBCOMPAT) - @if [ -e "${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o" ] && \ - egrep -qw 'i386/string/memchr\.S' ${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo "Removing stale dependencies for memchr"; \ - rm -f ${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*; \ - fi -.endif -.endfor _worldtmp: .PHONY @echo ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365702 - in releng/12.2: sys/dev/virtio/block usr.sbin/bhyve
Author: allanjude Date: Sun Sep 13 23:51:07 2020 New Revision: 365702 URL: https://svnweb.freebsd.org/changeset/base/365702 Log: MFC r360229, r363255 MFS r365614 r360229: Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend This will advertise support for TRIM to the guest virtio-blk driver and perform the DIOCGDELETE ioctl on the backing storage if it supports it. Thanks to Jason King and others at Joyent and illumos for expanding on my original patch, adding improvements including better error handling and making sure to following the virtio spec. r363255: Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver If the hypervisor advertises support for the DISCARD command then the guest can perform TRIM commands, freeing space on the backing store. If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE Tested with FreeBSD guests on bhyve and KVM Approved by: re (gjb) Relnotes: yes Sponsored by: Klara Inc. Modified: releng/12.2/sys/dev/virtio/block/virtio_blk.c releng/12.2/sys/dev/virtio/block/virtio_blk.h releng/12.2/usr.sbin/bhyve/block_if.c releng/12.2/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/dev/virtio/block/virtio_blk.c == --- releng/12.2/sys/dev/virtio/block/virtio_blk.c Sun Sep 13 23:05:19 2020(r365701) +++ releng/12.2/sys/dev/virtio/block/virtio_blk.c Sun Sep 13 23:51:07 2020(r365702) @@ -81,6 +81,7 @@ struct vtblk_softc { #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_BARRIER 0x0010 #define VTBLK_FLAG_WC_CONFIG 0x0020 +#define VTBLK_FLAG_DISCARD 0x0040 struct virtqueue*vtblk_vq; struct sglist *vtblk_sglist; @@ -112,6 +113,7 @@ static struct virtio_feature_desc vtblk_feature_desc[] { VIRTIO_BLK_F_WCE, "WriteCache"}, { VIRTIO_BLK_F_TOPOLOGY,"Topology" }, { VIRTIO_BLK_F_CONFIG_WCE, "ConfigWCE" }, + { VIRTIO_BLK_F_DISCARD, "Discard" }, { 0, NULL } }; @@ -210,6 +212,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writeca VIRTIO_BLK_F_WCE | \ VIRTIO_BLK_F_TOPOLOGY | \ VIRTIO_BLK_F_CONFIG_WCE | \ + VIRTIO_BLK_F_DISCARD | \ VIRTIO_RING_F_INDIRECT_DESC) #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx @@ -461,7 +464,7 @@ vtblk_config_change(device_t dev) vtblk_read_config(sc, &blkcfg); /* Capacity is always in 512-byte units. */ - capacity = blkcfg.capacity * 512; + capacity = blkcfg.capacity * VTBLK_BSIZE; if (sc->vtblk_disk->d_mediasize != capacity) vtblk_resize_disk(sc, capacity); @@ -546,11 +549,18 @@ vtblk_strategy(struct bio *bp) * be a better way to report our readonly'ness to GEOM above. */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && - (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { + (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH || + bp->bio_cmd == BIO_DELETE)) { vtblk_bio_done(sc, bp, EROFS); return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) && + (bp->bio_cmd != BIO_FLUSH) && (bp->bio_cmd != BIO_DELETE)) { + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { @@ -559,6 +569,13 @@ vtblk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd == BIO_DELETE) && + !(sc->vtblk_flags & VTBLK_FLAG_DISCARD)) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + bioq_insert_tail(&sc->vtblk_bioq, bp); vtblk_startio(sc); @@ -594,6 +611,8 @@ vtblk_setup_features(struct vtblk_softc *sc) sc->vtblk_flags |= VTBLK_FLAG_BARRIER; if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) + sc->vtblk_flags |= VTBLK_FLAG_DISCARD; } static int @@ -683,12 +702,12 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_dump = vtblk_dump; /* Capacity is always in 512-byte units. */ - dp->d_mediasize = blkcfg->capacity * 512; + dp->d_mediasize = blkcfg->capacity * VTBLK_BSIZE; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) dp->d_sectorsize = blkcfg->blk_size; else - dp->d_sectorsize = 512; + dp->d_sectorsize = VTBLK_BSIZE; /* * The VirtIO maximum I/O size is given in terms of segme
svn commit: r365703 - head/sys/fs/nfsserver
Author: rmacklem Date: Mon Sep 14 00:44:50 2020 New Revision: 365703 URL: https://svnweb.freebsd.org/changeset/base/365703 Log: Fix a case where the NFSv4.0 server might crash if delegations are enabled. asomers@ reported a crash on an NFSv4.0 server with a backtrace of: kdb_backtrace vpanic panic nfsrv_docallback nfsrv_checkgetattr nfsrvd_getattr nfsrvd_dorpc nfssvc_program svc_run_internal svc_thread_start fork_exit fork_trampoline where the panic message was "docallb", which indicates that a callback was attempted when the ClientID is unconfirmed. This would not normally occur, but it is possible to have an unconfirmed ClientID structure with delegation structure(s) chained off it if the client were to issue a SetClientID with the same "id" but different "verifier" after acquiring delegations on the previously confirmed ClientID. The bug appears to be that nfsrv_checkgetattr() failed to check for this uncommon case of an unconfirmed ClientID with a delegation structure that no longer refers to a delegation the client knows about. This patch adds a check for this case, handling it as if no delegation exists, which is the case when the above occurs. Although difficult to reproduce, this change should avoid the panic(). PR: 249127 Reported by: asomers Reviewed by: asomers MFC after:1 week Differential Revision:https://reviews.freebbsd.org/D26342 Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c == --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Sep 13 23:51:07 2020 (r365702) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Sep 14 00:44:50 2020 (r365703) @@ -5707,8 +5707,14 @@ nfsrv_checkgetattr(struct nfsrv_descript *nd, vnode_t goto out; } clp = stp->ls_clp; - delegfilerev = stp->ls_filerev; + /* If the clientid is not confirmed, ignore the delegation. */ + if (clp->lc_flags & LCL_NEEDSCONFIRM) { + NFSUNLOCKSTATE(); + goto out; + } + + delegfilerev = stp->ls_filerev; /* * If the Write delegation was issued as a part of this Compound RPC * or if we have an Implied Clientid (used in a previous Op in this ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365704 - stable/12/usr.sbin/ntp/ntpd
Author: emaste Date: Mon Sep 14 01:20:57 2020 New Revision: 365704 URL: https://svnweb.freebsd.org/changeset/base/365704 Log: MFC r365422: ntp: whitespace and typo fix in conf file PR: 248942 Submitted by: Jose Luis Duran (whitespace), igor (typo) Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf == --- stable/12/usr.sbin/ntp/ntpd/ntp.confMon Sep 14 00:44:50 2020 (r365703) +++ stable/12/usr.sbin/ntp/ntpd/ntp.confMon Sep 14 01:20:57 2020 (r365704) @@ -14,8 +14,8 @@ # Set the target and limit for adding servers configured via pool statements # or discovered dynamically via mechanisms such as broadcast and manycast. # Ntpd automatically adds maxclock-1 servers from configured pools, and may -# add as many as maxclock*2 if necessary to ensure that at least minclock -# servers are providing good consistant time. +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistent time. # tos minclock 3 maxclock 6 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365705 - head/sys/sys
Author: kevans Date: Mon Sep 14 01:56:29 2020 New Revision: 365705 URL: https://svnweb.freebsd.org/changeset/base/365705 Log: __FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean) The change in D26397 will need a __FreeBSD_version to base off of for bootstrapping crunchgen, to avoid avoidable build failures just because the host has an outdated crunchgen. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hMon Sep 14 01:20:57 2020(r365704) +++ head/sys/sys/param.hMon Sep 14 01:56:29 2020(r365705) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300114 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300115 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r365706 - in head/sys: arm/arm arm64/arm64 dev/mpr dev/mps kern mips/mips powerpc/powerpc riscv/riscv sys x86/x86
Author: scottl Date: Mon Sep 14 05:58:12 2020 New Revision: 365706 URL: https://svnweb.freebsd.org/changeset/base/365706 Log: Refine the busdma template interface. Provide tools for filling in fields that can be extended, but also ensure compile-time type checking. Refactor common code out of arch-specific implementations. Move the mpr and mps drivers to this new API. The template type remains visible to the consumer so that it can be allocated on the stack, but should be considered opaque. Modified: head/sys/arm/arm/busdma_machdep.c head/sys/arm64/arm64/busdma_machdep.c head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mps_user.c head/sys/kern/subr_bus_dma.c head/sys/mips/mips/busdma_machdep.c head/sys/powerpc/powerpc/busdma_machdep.c head/sys/riscv/riscv/busdma_machdep.c head/sys/sys/bus_dma.h head/sys/x86/x86/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c == --- head/sys/arm/arm/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/arm/arm/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -577,38 +577,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { if (t == NULL || dmat == NULL) Modified: head/sys/arm64/arm64/busdma_machdep.c == --- head/sys/arm64/arm64/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/arm64/arm64/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -215,38 +215,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { struct bus_dma_tag_common *common; Modified: head/sys/dev/mpr/mpr.c == --- head/sys/dev/mpr/mpr.c Mon Sep 14 01:56:29 2020(r365705) +++ head/sys/dev/mpr/mpr.c Mon Sep 14 05:58:12 2020(r365706) @@ -1310,7 +1310,7 @@ mpr_alloc_queues(struct mpr_softc *sc) static int mpr_alloc_hw_queues(struct mpr_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; bus_addr_t queues_busaddr; uint8_t *queues; int qsize, fqsize, pqsize; @@ -1333,10 +1333,9 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) qsize = fqsize + pqsize; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 16; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = qsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(qsize), + BD_MAXSEGSIZE(qsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->queues_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate queues DMA tag\n"); return (ENOMEM); @@ -1365
svn commit: r365707 - head/share/man/man9
Author: scottl Date: Mon Sep 14 06:26:36 2020 New Revision: 365707 URL: https://svnweb.freebsd.org/changeset/base/365707 Log: Update bus_dma.9 for the expanded template API. Add some clarifying language about the operation of parent tags in templates. Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 == --- head/share/man/man9/bus_dma.9 Mon Sep 14 05:58:12 2020 (r365706) +++ head/share/man/man9/bus_dma.9 Mon Sep 14 06:26:36 2020 (r365707) @@ -63,6 +63,8 @@ .Nm bus_dma_template_init , .Nm bus_dma_template_tag , .Nm bus_dma_template_clone , +.Nm bus_dma_template_fill, +.Nm BUS_DMA_TEMPLATE_FILL, .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , @@ -90,19 +92,29 @@ .Fn bus_dma_tag_destroy "bus_dma_tag_t dmat" .Ft void .Fo bus_dma_template_init -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t parent" .Fc .Ft int .Fo bus_dma_template_tag -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t *dmat" .Fc .Ft void .Fo bus_dma_template_clone -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t dmat" .Fc +.Ft void +.Fo bus_dma_template_fill +.Fa "bus_dma_template_t *template" +.Fa "bus_dma_param_t params[]" +.Fa "u_int count" +.Fc +.Fo BUS_DMA_TEMPLATE_FILL +.Fa "bus_dma_template_t *template" +.Fa "bus_dma_param_t param ..." +.Fc .Ft int .Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp" .Ft int @@ -697,8 +709,12 @@ Initializes a .Fa bus_dma_template_t structure. If the .Fa parent -argument is non-NULL, values from this tag will be copied into the template, -replacing any defaults. +argument is non-NULL, this parent tag is associated with the template and +will be compiled into the dma tag that is later created. The values +of the parent are not copied into the template. During tag creation in +.Fn bus_dma_tag_template , +any parameters from the parent tag that are more restrictive than what is +in the provided template will overwrite what goes into the new tag. .It Fn bus_dma_template_tag "*template" "*dmat" Unpacks a template into a tag, and returns the tag via the .Fa dmat . @@ -712,6 +728,31 @@ The template does not need to be initialized first. A be overwritten by the values contained in the tag. When paired with .Fn bus_dma_template_tag , this function is useful for creating copies of tags. +.It Fn bus_dma_template_fill "*template" "params[]" "count" +Fills in the selected fields of the template with the keyed values from the +.Fa params +array. This is not meant to be called directly, use +.Fn BUS_DMA_TEMPLATE_FILL +instead. +.It Fn BUS_DMA_TEMPLATE_FILL "*template" "param ..." +Fills in the selected fields of the template with a variable number of +key-value parameters. The macros listed below take an argument of the +specified type and encapsulate it into a key-value structure that is directly +usable as a parameter argument. Muliple parameters may be provided at once. +.Bd -literal + BD_PARENT() void * + BD_ALIGNMENT() uintmax_t + BD_BOUNDARY() uintmax_t + BD_LOWADDR()vm_paddr_t + BD_HIGHADDR() vm_paddr_t + BD_MAXSIZE()uintmax_t + BD_NSEGMENTS() uintmax_t + BD_MAXSEGSIZE() uintmax_t + BD_FLAGS() uintmax_t + BD_LOCKFUNC() void * + BD_LOCKFUNCARG() void * +.Ed +.Pp .It Fn bus_dmamap_create "dmat" "flags" "*mapp" Allocates and initializes a DMA map. Arguments are as follows: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"