svn commit: r361106 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample

2020-05-15 Thread Adrian Chadd
Author: adrian
Date: Sat May 16 05:07:45 2020
New Revision: 361106
URL: https://svnweb.freebsd.org/changeset/base/361106

Log:
  [ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries
  into account and remove the requirement that the MCS rate is "higher" if we're
   considering a new rate.
  
  Ok, another fun one.
  
  * In order for reliable non-software retried higher MCS rates, the TX 
schedules
(inconsistently!) use hard-coded lower rates at the end of the schedule.
Now, hard-coded is a problem because (a) it means that aggregate formation
is limited by the SLOWEST rate, so I never formed large AMDU frames for
3 stream rates, and (b) if the AP disables lower rates as base rates, it
complains about "unknown rix" every frame you transmit at that rate.
  
So, for now just disable the third and fourth schedule entry for AMPDUs.
Now I'm forming 32k and 64k aggregates for the higher density MCS rates
much more reliably.
  
It would be much nicer if the rate schedule stuff wasn't fixed but instead
I'd just populate ath_rc_series[] when I fetch the rates.  This is all a
holdover of ye olde pre-11n stuff and I really just need to nuke it.
  
But for now, ye hack.
  
  * The check for "is this MCS rate better" based on MCS itself is just garbage.
It meant things like going MCS0->7 would be fine, and say 0->8->16 is fine,
(as they're equivalent encoding but 1,2,3 spatial streams), BUT it meant
going something like MCS7->11 would fail even though it's likely that
MCS11 would just be better, both for EWMA/BER and throughput.
  
So for now just use the average tx time.  The "right" way for this 
comparison
would be to compare PHY bitrates rather than MCS / rate indexes, but I'm not
yet there.  The bit rates ARE available in the PHY index, but honestly
I have a lot of other cleaning up to here before I think about that.
  
  * Don't include the RTS/CTS retry count (and thus time) into the average tx 
time
caluation.  It just makes temporarily failures make the rate look bad by
QUITE A LOT, as RTS/CTS exchanges are (a) long, and (b) mostly irrelevant
to the actual rate being tried.  If we keep hitting RTS/CTS failures then
there's something ELSE wrong on the channel, not our selected rate.

Modified:
  head/sys/dev/ath/ath_rate/amrr/amrr.c
  head/sys/dev/ath/ath_rate/onoe/onoe.c
  head/sys/dev/ath/ath_rate/sample/sample.c
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_athrate.h

Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c
==
--- head/sys/dev/ath/ath_rate/amrr/amrr.c   Sat May 16 04:52:29 2020
(r361105)
+++ head/sys/dev/ath/ath_rate/amrr/amrr.c   Sat May 16 05:07:45 2020
(r361106)
@@ -128,7 +128,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod
  */
 void
 ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
-uint8_t rix0, struct ath_rc_series *rc)
+uint8_t rix0, int is_aggr, struct ath_rc_series *rc)
 {
struct amrr_node *amn = ATH_NODE_AMRR(an);
 

Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c
==
--- head/sys/dev/ath/ath_rate/onoe/onoe.c   Sat May 16 04:52:29 2020
(r361105)
+++ head/sys/dev/ath/ath_rate/onoe/onoe.c   Sat May 16 05:07:45 2020
(r361106)
@@ -136,7 +136,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod
  */
 void
 ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
-uint8_t rix0, struct ath_rc_series *rc)
+uint8_t rix0, int is_aggr, struct ath_rc_series *rc)
 {
struct onoe_node *on = ATH_NODE_ONOE(an);
 

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==
--- head/sys/dev/ath/ath_rate/sample/sample.c   Sat May 16 04:52:29 2020
(r361105)
+++ head/sys/dev/ath/ath_rate/sample/sample.c   Sat May 16 05:07:45 2020
(r361106)
@@ -168,7 +168,7 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = {
  */
 static int
 ath_rate_sample_find_min_pktlength(struct ath_softc *sc,
-struct ath_node *an, uint8_t rix0)
+struct ath_node *an, uint8_t rix0, int is_aggr)
 {
 #defineMCS_IDX(ix) (rt->info[ix].dot11Rate)
const HAL_RATE_TABLE *rt = sc->sc_currates;
@@ -196,6 +196,24 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *s
 * is not zero.
 *
 * Note: assuming all four PHYs are HT!
+*
+* XXX TODO: right now I hardcode here and in getxtxrates() that
+* rates 2 and 3 in the tx schedule are ignored.  This is important
+* for forming larger aggregates because right now (a) the tx schedule
+* per rate is fixed, and (b) reliable packet transmission at those
+* higher rates kinda needs a lower MCS rate in there 

svn commit: r361105 - head/lib/libc/sys

2020-05-15 Thread Kyle Evans
Author: kevans
Date: Sat May 16 04:52:29 2020
New Revision: 361105
URL: https://svnweb.freebsd.org/changeset/base/361105

Log:
  procctl(2): correct a minor cut-n-pasto
  
  This is clearly describing PROC_PROTMAX_FORCE_DISABLE, rather than
  PROC_ASL_FORCE_DISABLE.
  
  Submitted by: sig...@gmail.com

Modified:
  head/lib/libc/sys/procctl.2

Modified: head/lib/libc/sys/procctl.2
==
--- head/lib/libc/sys/procctl.2 Sat May 16 03:52:30 2020(r361104)
+++ head/lib/libc/sys/procctl.2 Sat May 16 04:52:29 2020(r361105)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 25, 2020
+.Dd May 16, 2020
 .Dt PROCCTL 2
 .Os
 .Sh NAME
@@ -128,7 +128,7 @@ Enables implicit PROT_MAX application,
 even if it is disabled system-wide by the sysctl
 .Va vm.imply_prot_max .
 The image flag might still prevent the enablement.
-.It Dv PROC_ASLR_FORCE_DISABLE
+.It Dv PROC_PROTMAX_FORCE_DISABLE
 Request that implicit application of PROT_MAX be disabled.
 Same notes as for
 .Dv PROC_PROTMAX_FORCE_ENABLE
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361104 - head/contrib/elftoolchain/libelf

2020-05-15 Thread Justin Hibbits
Author: jhibbits
Date: Sat May 16 03:52:30 2020
New Revision: 361104
URL: https://svnweb.freebsd.org/changeset/base/361104

Log:
  elftoolchain: Add powerpc64 definition to elftoolchain config
  
  powerpc is already in place, but powerpc64 is needed separately.

Modified:
  head/contrib/elftoolchain/libelf/_libelf_config.h

Modified: head/contrib/elftoolchain/libelf/_libelf_config.h
==
--- head/contrib/elftoolchain/libelf/_libelf_config.h   Sat May 16 03:45:15 
2020(r361103)
+++ head/contrib/elftoolchain/libelf/_libelf_config.h   Sat May 16 03:52:30 
2020(r361104)
@@ -91,6 +91,12 @@
 #endif
 #defineLIBELF_CLASSELFCLASS32
 
+#elif  defined(__powerpc64__)
+
+#defineLIBELF_ARCH EM_PPC64
+#defineLIBELF_BYTEORDERELFDATA2MSB
+#defineLIBELF_CLASSELFCLASS64
+
 #elif  defined(__powerpc__)
 
 #defineLIBELF_ARCH EM_PPC
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361103 - in head/sys: kern security/audit

2020-05-15 Thread Christian S.J. Peron
Author: csjp
Date: Sat May 16 03:45:15 2020
New Revision: 361103
URL: https://svnweb.freebsd.org/changeset/base/361103

Log:
  Add BSM record conversion for a number of syscalls:
  
  - thr_kill(2) and thr_exit(2) generally (no argument auditing here.
  - A set of syscalls for the process descriptor family, specifically:
pdfork(2), pdgetpid(2) and pdkill(2)
  
For these syscalls, audit the file descriptor. In the case of pdfork(2)
a pointer to an integer (file descriptor) is passed in as an argument.
We audit the post initialized file descriptor (not the random garbage
that would have been passed in). We will also audit the child process
which was created from the fork operation (similar to what is done for
the fork(2) syscall).
  
pdkill(2) we audit the signal value and fd, and finally pdgetpid(2)
just the file descriptor:
  
  - Following is a sample of the produced audit trails:
  
header,111,11,pdfork(2),0,Sat May 16 03:07:50 2020, + 394 msec
argument,0,0x39d,child PID
argument,2,0x2,flags
argument,1,0x8,fd
subject,root,root,0,root,0,924,0,0,0.0.0.0
return,success,925
  
header,79,11,pdgetpid(2),0,Sat May 16 03:07:50 2020, + 394 msec
argument,1,0x8,fd
subject,root,root,0,root,0,924,0,0,0.0.0.0
return,success,0
trailer,79
  
header,135,11,pdkill(2),0,Sat May 16 03:07:50 2020, + 395 msec
argument,1,0x8,fd
argument,2,0xf,signal
process_ex,root,root,0,root,0,925,0,0,0.0.0.0
subject,root,root,0,root,0,924,0,0,0.0.0.0
return,success,0
trailer,135
  
  MFC after:  1 week

Modified:
  head/sys/kern/kern_fork.c
  head/sys/security/audit/audit_bsm.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Sat May 16 03:33:28 2020(r361102)
+++ head/sys/kern/kern_fork.c   Sat May 16 03:45:15 2020(r361103)
@@ -128,6 +128,7 @@ sys_pdfork(struct thread *td, struct pdfork_args *uap)
fr.fr_pidp = 
fr.fr_pd_fd = 
fr.fr_pd_flags = uap->flags;
+   AUDIT_ARG_FFLAGS(uap->flags);
/*
 * It is necessary to return fd by reference because 0 is a valid file
 * descriptor number, and the child needs to be able to distinguish
@@ -909,6 +910,7 @@ fork1(struct thread *td, struct fork_req *fr)
fr->fr_pd_flags, fr->fr_pd_fcaps);
if (error != 0)
goto fail2;
+   AUDIT_ARG_FD(*fr->fr_pd_fd);
}
 
mem_charged = 0;

Modified: head/sys/security/audit/audit_bsm.c
==
--- head/sys/security/audit/audit_bsm.c Sat May 16 03:33:28 2020
(r361102)
+++ head/sys/security/audit/audit_bsm.c Sat May 16 03:45:15 2020
(r361103)
@@ -1317,6 +1317,38 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec
UPATH1_VNODE1_TOKENS;
break;
 
+   case AUE_PDKILL:
+   if (ARG_IS_VALID(kar, ARG_FD)) {
+   tok = au_to_arg32(1, "fd", ar->ar_arg_fd);
+   kau_write(rec, tok);
+   }
+   if (ARG_IS_VALID(kar, ARG_SIGNUM)) {
+   tok = au_to_arg32(2, "signal", ar->ar_arg_signum);
+   kau_write(rec, tok);
+   }
+   PROCESS_PID_TOKENS(1);
+   break;
+   case AUE_PDFORK:
+   if (ARG_IS_VALID(kar, ARG_PID)) {
+   tok = au_to_arg32(0, "child PID", ar->ar_arg_pid);
+   kau_write(rec, tok);
+   }
+   if (ARG_IS_VALID(kar, ARG_FFLAGS)) {
+   tok = au_to_arg32(2, "flags", ar->ar_arg_fflags);
+   kau_write(rec, tok);
+   }
+   if (ARG_IS_VALID(kar, ARG_FD)) {
+   tok = au_to_arg32(1, "fd", ar->ar_arg_fd);
+   kau_write(rec, tok);
+   }
+   break;
+   case AUE_PDGETPID:
+   if (ARG_IS_VALID(kar, ARG_FD)) {
+   tok = au_to_arg32(1, "fd", ar->ar_arg_fd);
+   kau_write(rec, tok);
+   }
+   break;
+
case AUE_PROCCTL:
if (ARG_IS_VALID(kar, ARG_VALUE)) {
tok = au_to_arg32(1, "idtype", ar->ar_arg_value);
@@ -1747,6 +1779,8 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec
break;
 
case AUE_THR_NEW:
+   case AUE_THR_KILL:
+   case AUE_THR_EXIT:
break;
 
case AUE_NULL:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361102 - head/sys/powerpc/conf

2020-05-15 Thread Justin Hibbits
Author: jhibbits
Date: Sat May 16 03:33:28 2020
New Revision: 361102
URL: https://svnweb.freebsd.org/changeset/base/361102

Log:
  powerpc/qoriq: Add more devices to config for desktop usage
  
  The most likely users of the QORIQ64 config nowadays are users of AmigaOne
  X5000 systems, which are desktops.  They need a framebuffer and
  keyboard/mouse, so add these to the config so it works by default once
  drm-current-kmod is installed.

Modified:
  head/sys/powerpc/conf/QORIQ64

Modified: head/sys/powerpc/conf/QORIQ64
==
--- head/sys/powerpc/conf/QORIQ64   Sat May 16 02:43:27 2020
(r361101)
+++ head/sys/powerpc/conf/QORIQ64   Sat May 16 03:33:28 2020
(r361102)
@@ -113,3 +113,10 @@ device ehci
 device umass
 device usb
 device vlan
+
+# Desktop related
+device vt
+device fbd
+optionsKBD_INSTALL_CDEV
+device ukbd
+device ums
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361099 - in head: . lib/libalias/libalias lib/libalias/modules/cuseeme sys/modules/libalias/modules sys/modules/libalias/modules/cuseeme sys/netinet/libalias targets/pseudo/userland/li...

2020-05-15 Thread Ed Maste
Author: emaste
Date: Sat May 16 02:29:10 2020
New Revision: 361099
URL: https://svnweb.freebsd.org/changeset/base/361099

Log:
  libalias: retire cuseeme support
  
  The CU-SeeMe videoconferencing client and associated protocol is at this
  point a historical artifact; there is no need to retain support for this
  protocol today.
  
  Reviewed by:  philip, markj, allanjude
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D24790

Deleted:
  head/lib/libalias/modules/cuseeme/
  head/sys/modules/libalias/modules/cuseeme/
  head/sys/netinet/libalias/alias_cuseeme.c
Modified:
  head/ObsoleteFiles.inc
  head/lib/libalias/libalias/libalias.conf
  head/sys/modules/libalias/modules/modules.inc
  head/sys/netinet/libalias/libalias.3
  head/targets/pseudo/userland/lib/Makefile.depend
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat May 16 01:56:06 2020(r361098)
+++ head/ObsoleteFiles.inc  Sat May 16 02:29:10 2020(r361099)
@@ -36,6 +36,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20200515: libalias cuseeme protocol support retired
+OLD_LIBS+=lib/libalias_cuseeme.so
+OLD_FILES+=usr/lib/libalias_cuseeme.a
+OLD_FILES+=usr/lib/libalias_cuseeme_p.a
+
 # 20200511: Remove ubsec(4)
 OLD_FILES+=usr/share/man/man4/ubsec.4.gz
 

Modified: head/lib/libalias/libalias/libalias.conf
==
--- head/lib/libalias/libalias/libalias.confSat May 16 01:56:06 2020
(r361098)
+++ head/lib/libalias/libalias/libalias.confSat May 16 02:29:10 2020
(r361099)
@@ -1,5 +1,4 @@
 # $FreeBSD$
-/lib/libalias_cuseeme.so
 /lib/libalias_ftp.so
 /lib/libalias_irc.so
 /lib/libalias_nbt.so

Modified: head/sys/modules/libalias/modules/modules.inc
==
--- head/sys/modules/libalias/modules/modules.inc   Sat May 16 01:56:06 
2020(r361098)
+++ head/sys/modules/libalias/modules/modules.inc   Sat May 16 02:29:10 
2020(r361099)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 MODULES =
-MODULES+= cuseeme
 MODULES+= dummy
 MODULES+= ftp
 MODULES+= irc

Modified: head/sys/netinet/libalias/libalias.3
==
--- head/sys/netinet/libalias/libalias.3Sat May 16 01:56:06 2020
(r361098)
+++ head/sys/netinet/libalias/libalias.3Sat May 16 02:29:10 2020
(r361099)
@@ -1051,7 +1051,6 @@ There is a configuration file,
 .Pa /etc/libalias.conf ,
 with the following contents (by default):
 .Bd -literal -offset indent
-/usr/lib/libalias_cuseeme.so
 /usr/lib/libalias_ftp.so
 /usr/lib/libalias_irc.so
 /usr/lib/libalias_nbt.so

Modified: head/targets/pseudo/userland/lib/Makefile.depend
==
--- head/targets/pseudo/userland/lib/Makefile.dependSat May 16 01:56:06 
2020(r361098)
+++ head/targets/pseudo/userland/lib/Makefile.dependSat May 16 02:29:10 
2020(r361099)
@@ -26,7 +26,6 @@ DIRDEPS = \
lib/geom/virstor \
lib/lib80211 \
lib/libalias/libalias \
-   lib/libalias/modules/cuseeme \
lib/libalias/modules/dummy \
lib/libalias/modules/ftp \
lib/libalias/modules/irc \

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat May 16 01:56:06 
2020(r361098)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sat May 16 02:29:10 
2020(r361099)
@@ -7531,7 +7531,6 @@ OLD_FILES+=usr/share/man/man8/pppctl.8.gz
 .if ${MK_PROFILE} == no
 OLD_FILES+=usr/lib/lib80211_p.a
 OLD_FILES+=usr/lib/libBlocksRuntime_p.a
-OLD_FILES+=usr/lib/libalias_cuseeme_p.a
 OLD_FILES+=usr/lib/libalias_dummy_p.a
 OLD_FILES+=usr/lib/libalias_ftp_p.a
 OLD_FILES+=usr/lib/libalias_irc_p.a
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361098 - head/sys/dev/ath/ath_rate/sample

2020-05-15 Thread Adrian Chadd
Author: adrian
Date: Sat May 16 01:56:06 2020
New Revision: 361098
URL: https://svnweb.freebsd.org/changeset/base/361098

Log:
  [ath_rate_sample] Fix logic for determining whether to bump up an MCS rate.
  
  * Fix formatting, cause reasons;
  * Put back the "and the chosen rate is within 90% of the current rate" logic;
  * Ensure the best rate and the current rate aren't the same; this ...
  * ... fixes the packets_since_switch[] tracking to actually conut how many
frames since the rate switched, so now I know how stable stuff is; and
  * Ensure that MCS can go up to a higher MCS at this or any other spatial 
stream.
My previous quick hack attempt was doing > rather than >= so you had to go
to both a higher root MCS rate (0..7) and spatial stream. Eg, you couldn't
go from MCS0 (1ss) to MCS8 (2ss) this way.
  
  The best rate and switching rate logic still have a bunch more work to do
  because they're still quite touchy when it comes to average tx time but at 
least
  now it's choosing higher rates correctly when it wants to try a higher rate.
  
  Tested:
  
  * AR9380, STA mode

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==
--- head/sys/dev/ath/ath_rate/sample/sample.c   Sat May 16 01:50:28 2020
(r361097)
+++ head/sys/dev/ath/ath_rate/sample/sample.c   Sat May 16 01:56:06 2020
(r361098)
@@ -712,10 +712,13 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod
 * Limit the time measuring the performance of other tx
 * rates to sample_rate% of the total transmission time.
 */
-   if (sn->sample_tt[size_bin] < average_tx_time * 
(sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) {
+   if (sn->sample_tt[size_bin] <
+   average_tx_time *
+   (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) {
rix = pick_sample_rate(ssc, an, rt, size_bin);
IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL,
->an_node, "att %d sample_tt %d size %u sample rate %d 
%s current rate %d %s",
+>an_node, "att %d sample_tt %d size %u "
+"sample rate %d %s current rate %d %s",
 average_tx_time,
 sn->sample_tt[size_bin],
 bin_to_size(size_bin),
@@ -776,12 +779,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod
printf("cur rix/att %x/%d, best rix/att %x/%d\n",
MCS(cur_rix), cur_att, MCS(best_rix), 
average_tx_time);
 #endif
-#if 0
-   if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) &&
-   (average_tx_time * 10) <= (cur_att * 10)) {
-#else
-   if ((average_tx_time * 10) <= (cur_att * 10)) {
-#endif
+   if ((best_rix != cur_rix) &&
+   ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) &&
+   (average_tx_time * 9) <= (cur_att * 10)) {
IEEE80211_NOTE(an->an_node.ni_vap,
IEEE80211_MSG_RATECTL, >an_node,
"%s: HT: size %d best_rix 0x%x > "
@@ -823,7 +823,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod
/* 
 * Set the visible txrate for this node.
 */
-   an->an_node.ni_txrate = (rt->info[best_rix].phy == 
IEEE80211_T_HT) ?  MCS(best_rix) : DOT11RATE(best_rix);
+   an->an_node.ni_txrate =
+   (rt->info[best_rix].phy == IEEE80211_T_HT) ?
+MCS(best_rix) : DOT11RATE(best_rix);
}
rix = sn->current_rix[size_bin];
sn->packets_since_switch[size_bin]++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361097 - head/sys/dev/acpica

2020-05-15 Thread Colin Percival
Author: cperciva
Date: Sat May 16 01:50:28 2020
New Revision: 361097
URL: https://svnweb.freebsd.org/changeset/base/361097

Log:
  Send Lid status notification via devd from acpi_lid_status_update.
  
  Some laptops don't send ACPI "lid status changed" notifications upon
  opening the lid if the system was currently suspended.  In r358219
  this was partially fixed, updating the "lid_status" variable upon
  resume even if there is no "status changed" notification from ACPI.
  
  Unfortunately the fix in r358219 did not include notifying userland
  via devd; this causes problems on systems using upowerd (e.g. KDE),
  since upowerd remembers the most recent devd notification about the
  lid status rather than querying the sysctl to get the current status.
  
  This showed up as two symptoms when KDE's "When laptop lid closed: Sleep"
  option is set:
  1. 50% of the time, closing the lid would not trigger S3 sleep.
  2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep.
  
  PR:   246477
  MFC after:3 days

Modified:
  head/sys/dev/acpica/acpi_lid.c

Modified: head/sys/dev/acpica/acpi_lid.c
==
--- head/sys/dev/acpica/acpi_lid.c  Sat May 16 00:28:49 2020
(r361096)
+++ head/sys/dev/acpica/acpi_lid.c  Sat May 16 01:50:28 2020
(r361097)
@@ -114,6 +114,9 @@ acpi_lid_status_update(struct acpi_lid_softc *sc)
/* range check value */
sc->lid_status = lid_status ? 1 : 0;
 
+   /* Send notification via devd */
+   acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status);
+
 #ifdef EVDEV_SUPPORT
/* Notify evdev about lid status */
evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361095 - in head/sys: net netpfil/pf

2020-05-15 Thread Mark Johnston
Author: markj
Date: Sat May 16 00:28:12 2020
New Revision: 361095
URL: https://svnweb.freebsd.org/changeset/base/361095

Log:
  pf: Add a new zone for per-table entry counters.
  
  Right now we optionally allocate 8 counters per table entry, so in
  addition to memory consumed by counters, we require 8 pointers worth of
  space in each entry even when counters are not allocated (the default).
  
  Instead, define a UMA zone that returns contiguous per-CPU counter
  arrays for use in table entries.  On amd64 this reduces sizeof(struct
  pfr_kentry) from 216 to 160.  The smaller size also results in better
  slab efficiency, so memory usage for large tables is reduced by about
  28%.
  
  Reviewed by:  kp
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D24843

Modified:
  head/sys/net/pfvar.h
  head/sys/netpfil/pf/pf_table.c

Modified: head/sys/net/pfvar.h
==
--- head/sys/net/pfvar.hFri May 15 23:44:52 2020(r361094)
+++ head/sys/net/pfvar.hSat May 16 00:28:12 2020(r361095)
@@ -1000,6 +1000,8 @@ struct pfr_addr {
 
 enum { PFR_DIR_IN, PFR_DIR_OUT, PFR_DIR_MAX };
 enum { PFR_OP_BLOCK, PFR_OP_PASS, PFR_OP_ADDR_MAX, PFR_OP_TABLE_MAX };
+enum { PFR_TYPE_PACKETS, PFR_TYPE_BYTES, PFR_TYPE_MAX };
+#definePFR_NUM_COUNTERS(PFR_DIR_MAX * PFR_OP_ADDR_MAX * 
PFR_TYPE_MAX)
 #define PFR_OP_XPASS   PFR_OP_ADDR_MAX
 
 struct pfr_astats {
@@ -1045,10 +1047,12 @@ union sockaddr_union {
 #endif /* _SOCKADDR_UNION_DEFINED */
 
 struct pfr_kcounters {
-   counter_u64_tpfrkc_packets[PFR_DIR_MAX][PFR_OP_ADDR_MAX];
-   counter_u64_tpfrkc_bytes[PFR_DIR_MAX][PFR_OP_ADDR_MAX];
+   counter_u64_tpfrkc_counters;
long pfrkc_tzero;
 };
+#definepfr_kentry_counter(kc, dir, op, t)  \
+   ((kc)->pfrkc_counters + \
+   (dir) * PFR_OP_ADDR_MAX * PFR_TYPE_MAX + (op) * PFR_TYPE_MAX + (t))
 
 SLIST_HEAD(pfr_kentryworkq, pfr_kentry);
 struct pfr_kentry {

Modified: head/sys/netpfil/pf/pf_table.c
==
--- head/sys/netpfil/pf/pf_table.c  Fri May 15 23:44:52 2020
(r361094)
+++ head/sys/netpfil/pf/pf_table.c  Sat May 16 00:28:12 2020
(r361095)
@@ -127,6 +127,8 @@ struct pfr_walktree {
 static MALLOC_DEFINE(M_PFTABLE, "pf_table", "pf(4) tables structures");
 VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_z);
 #defineV_pfr_kentry_z  VNET(pfr_kentry_z)
+VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_counter_z);
+#defineV_pfr_kentry_counter_z  VNET(pfr_kentry_counter_z)
 
 static struct pf_addr   pfr_ffaddr = {
.addr32 = { 0x, 0x, 0x, 0x }
@@ -144,12 +146,8 @@ static void pfr_mark_addrs(struct 
pfr_ktable *);
 static struct pfr_kentry
*pfr_lookup_addr(struct pfr_ktable *,
struct pfr_addr *, int);
-static bool pfr_create_kentry_counter(struct pfr_kentry *, int,
-   int);
 static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool);
 static void pfr_destroy_kentries(struct pfr_kentryworkq *);
-static void pfr_destroy_kentry_counter(struct pfr_kcounters *,
-   int, int);
 static void pfr_destroy_kentry(struct pfr_kentry *);
 static void pfr_insert_kentries(struct pfr_ktable *,
struct pfr_kentryworkq *, long);
@@ -205,6 +203,9 @@ void
 pfr_initialize(void)
 {
 
+   V_pfr_kentry_counter_z = uma_zcreate("pf table entry counters",
+   PFR_NUM_COUNTERS * sizeof(uint64_t), NULL, NULL, NULL, NULL,
+   UMA_ALIGN_PTR, UMA_ZONE_PCPU);
V_pfr_kentry_z = uma_zcreate("pf table entries",
sizeof(struct pfr_kentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
0);
@@ -217,6 +218,7 @@ pfr_cleanup(void)
 {
 
uma_zdestroy(V_pfr_kentry_z);
+   uma_zdestroy(V_pfr_kentry_counter_z);
 }
 
 int
@@ -785,27 +787,11 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr
return (ke);
 }
 
-static bool
-pfr_create_kentry_counter(struct pfr_kentry *ke, int pfr_dir, int pfr_op)
-{
-   counter_u64_t c;
-
-   c = counter_u64_alloc(M_NOWAIT);
-   if (c == NULL)
-   return (false);
-   ke->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op] = c;
-   c = counter_u64_alloc(M_NOWAIT);
-   if (c == NULL)
-   return (false);
-   ke->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op] = c;
-   return (true);
-}
-
 static struct pfr_kentry *
 pfr_create_kentry(struct pfr_addr *ad, bool counters)
 {
struct pfr_kentry   *ke;
-   int pfr_dir, pfr_op;
+   counter_u64_tc;
 
ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT 

svn commit: r361094 - head/share/man/man4

2020-05-15 Thread Christian S.J. Peron
Author: csjp
Date: Fri May 15 23:44:52 2020
New Revision: 361094
URL: https://svnweb.freebsd.org/changeset/base/361094

Log:
  Fix typo that snuck in
  
  Reported by:  Jose Luis Duran
  MFC after:1 week

Modified:
  head/share/man/man4/procdesc.4

Modified: head/share/man/man4/procdesc.4
==
--- head/share/man/man4/procdesc.4  Fri May 15 22:56:59 2020
(r361093)
+++ head/share/man/man4/procdesc.4  Fri May 15 23:44:52 2020
(r361094)
@@ -1,4 +1,3 @@
-W
 .\"
 .\" Copyright (c) 2013 Robert N. M. Watson
 .\" All rights reserved.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361093 - head/tools/build/mk

2020-05-15 Thread John Baldwin
Author: jhb
Date: Fri May 15 22:56:59 2020
New Revision: 361093
URL: https://svnweb.freebsd.org/changeset/base/361093

Log:
  Don't remove ubsec(4) manual page for WITHOUT_USB=yes.
  
  In head this manpage has been removed entirely, but ubsec(4) is a PCI
  device and not a USB device.
  
  MFC after:1 week

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri May 15 22:55:49 
2020(r361092)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri May 15 22:56:59 
2020(r361093)
@@ -9648,7 +9648,6 @@ OLD_FILES+=usr/share/man/man4/uark.4.gz
 OLD_FILES+=usr/share/man/man4/uart.4.gz
 OLD_FILES+=usr/share/man/man4/uath.4.gz
 OLD_FILES+=usr/share/man/man4/ubsa.4.gz
-OLD_FILES+=usr/share/man/man4/ubsec.4.gz
 OLD_FILES+=usr/share/man/man4/ubser.4.gz
 OLD_FILES+=usr/share/man/man4/ubtbcmfw.4.gz
 OLD_FILES+=usr/share/man/man4/uchcom.4.gz
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361092 - head/tools/kerneldoc/subsys

2020-05-15 Thread John Baldwin
Author: jhb
Date: Fri May 15 22:55:49 2020
New Revision: 361092
URL: https://svnweb.freebsd.org/changeset/base/361092

Log:
  Remove Doxyfile for sys/dev/ubsec since it has been removed.

Deleted:
  head/tools/kerneldoc/subsys/Doxyfile-dev_ubsec
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361091 - head/tools/tools/crypto

2020-05-15 Thread John Baldwin
Author: jhb
Date: Fri May 15 22:55:28 2020
New Revision: 361091
URL: https://svnweb.freebsd.org/changeset/base/361091

Log:
  Remove the ubsecstats tool since ubsec(4) has been removed.
  
  Reported by:  markj

Deleted:
  head/tools/tools/crypto/ubsecstats.c
Modified:
  head/tools/tools/crypto/Makefile

Modified: head/tools/tools/crypto/Makefile
==
--- head/tools/tools/crypto/MakefileFri May 15 20:29:41 2020
(r361090)
+++ head/tools/tools/crypto/MakefileFri May 15 22:55:28 2020
(r361091)
@@ -27,7 +27,7 @@
 #
 
 PROGS= cryptocheck cryptotest cryptokeytest cryptostats \
-   ubsecstats hifnstats ipsecstats safestats
+   hifnstats ipsecstats safestats
 MAN=
 BINDIR?=   /usr/local/bin
 
@@ -38,7 +38,6 @@ LIBADD.cryptocheck+=  crypto util
 LIBADD.cryptokeytest+= crypto
 
 # cryptostats: dump statistics kept by the core crypto code
-# ubsecstats: print statistics kept by the Broadcom driver
 # hifnstats: print statistics kept by the HIFN driver
 # safestats: statistics kept by the SafeNet driver
 # ipsecstats: print statistics kept by fast ipsec
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Rodney W. Grimes
> 
> On 5/15/20 4:17 PM, Rodney W. Grimes wrote:
> >> On 5/15/20 3:24 PM, Rodney W. Grimes wrote:
> >>
>  On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:
> 
> > On 5/15/20 1:38 AM, Ryan Moeller wrote:
> >> Author: freqlabs
> >> Date: Thu May 14 23:38:11 2020
> >> New Revision: 361066
> >> URL: https://svnweb.freebsd.org/changeset/base/361066
> >>
> >> Log:
> >>  jail: Add exec.prepare and exec.release command hooks
> >>  
> >>  This change introduces new jail command hooks that run before and 
> >> after any
> >>  other actions.
> > Should it go into RELNOTES?
>  I'm not sure what all the criteria are for relnotes.
>  The committer's guide makes it seem like relnotes is for breaking
>  changes, which this is not.
> >>> Please could you point at which specific language in the commiters
> >>> guide makes you believe that the RELNOTES are for breaking changes?
> >> Every mention of "release notes" in the document is in the context of
> >> deprecating, removing,
> >> or breaking things, with one exception:
> > Fair, there should be a section on "new features and enhnacements"
> > which is laking.  However if one reads a release notes from a shipping
> > version it becomes clear that the actual majority of the text in it is
> > "new stuff."
> 
> Now that I know better, how do I retcon this and other potentially 
> relnoteworthy enhancements I've made? :)

There is a top level file in the src tree called RELNOTES that
you can use to ad an entry to describing the change and the
revision number.

> >>   > Relnotes:??? If the change is a candidate for inclusion in the
> >> release notes for the next release from the branch, set to yes.
> >>> RELNOTES should be for all changes that have user visible impact
> >>> of any type.
> >>>
>  -Ryan
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361090 - head/share/man/man4

2020-05-15 Thread Christian S.J. Peron
Author: csjp
Date: Fri May 15 20:29:41 2020
New Revision: 361090
URL: https://svnweb.freebsd.org/changeset/base/361090

Log:
  Bump revision date to today.
  
  MFC after:1 week

Modified:
  head/share/man/man4/procdesc.4

Modified: head/share/man/man4/procdesc.4
==
--- head/share/man/man4/procdesc.4  Fri May 15 20:24:08 2020
(r361089)
+++ head/share/man/man4/procdesc.4  Fri May 15 20:29:41 2020
(r361090)
@@ -30,7 +30,7 @@ W
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 14, 2018
+.Dd May 15, 2020
 .Dt PROCDESC 4
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Ryan Moeller



On 5/15/20 4:17 PM, Rodney W. Grimes wrote:

On 5/15/20 3:24 PM, Rodney W. Grimes wrote:


On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:


On 5/15/20 1:38 AM, Ryan Moeller wrote:

Author: freqlabs
Date: Thu May 14 23:38:11 2020
New Revision: 361066
URL: https://svnweb.freebsd.org/changeset/base/361066

Log:
 jail: Add exec.prepare and exec.release command hooks
 
 This change introduces new jail command hooks that run before and after any

 other actions.

Should it go into RELNOTES?

I'm not sure what all the criteria are for relnotes.
The committer's guide makes it seem like relnotes is for breaking
changes, which this is not.

Please could you point at which specific language in the commiters
guide makes you believe that the RELNOTES are for breaking changes?

Every mention of "release notes" in the document is in the context of
deprecating, removing,
or breaking things, with one exception:

Fair, there should be a section on "new features and enhnacements"
which is laking.  However if one reads a release notes from a shipping
version it becomes clear that the actual majority of the text in it is
"new stuff."


Now that I know better, how do I retcon this and other potentially 
relnoteworthy enhancements I've made? :)



  > Relnotes:??? If the change is a candidate for inclusion in the
release notes for the next release from the branch, set to yes.

RELNOTES should be for all changes that have user visible impact
of any type.


-Ryan

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361089 - head/share/man/man4

2020-05-15 Thread Christian S.J. Peron
Author: csjp
Date: Fri May 15 20:24:08 2020
New Revision: 361089
URL: https://svnweb.freebsd.org/changeset/base/361089

Log:
  Remove references to pdwait4(2). This syscall was never implemented
  and its presence just creates confusion.
  
  Discussed with:   cem
  MFC after:1 week

Modified:
  head/share/man/man4/procdesc.4

Modified: head/share/man/man4/procdesc.4
==
--- head/share/man/man4/procdesc.4  Fri May 15 20:03:57 2020
(r361088)
+++ head/share/man/man4/procdesc.4  Fri May 15 20:24:08 2020
(r361089)
@@ -1,3 +1,4 @@
+W
 .\"
 .\" Copyright (c) 2013 Robert N. M. Watson
 .\" All rights reserved.
@@ -40,16 +41,14 @@
 is a file-descriptor-oriented interface to process signalling and control,
 which supplements historic
 .Ux
-.Xr fork 2 ,
-.Xr kill 2 ,
+.Xr fork 2
 and
-.Xr wait4 2
+.Xr kill 2 ,
 primitives with
 new system calls such as
-.Xr pdfork 2 ,
-.Xr pdkill 2 ,
+.Xr pdfork 2
 and
-.Xr pdwait4 2 .
+.Xr pdkill 2 ,
 .Nm
 is designed for use with
 .Xr capsicum 4 ,
@@ -65,7 +64,6 @@ Given a process descriptor, it is possible to query it
 .Xr pdfork 2 ,
 .Xr pdgetpid 2 ,
 .Xr pdkill 2 ,
-.Xr pdwait4 2 ,
 .Xr kqueue 2 ,
 .Xr wait4 2 ,
 .Xr capsicum 4
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Rodney W. Grimes
> On 5/15/20 3:24 PM, Rodney W. Grimes wrote:
> 
> >> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:
> >>
> >>> On 5/15/20 1:38 AM, Ryan Moeller wrote:
>  Author: freqlabs
>  Date: Thu May 14 23:38:11 2020
>  New Revision: 361066
>  URL: https://svnweb.freebsd.org/changeset/base/361066
> 
>  Log:
>  jail: Add exec.prepare and exec.release command hooks
>  
>  This change introduces new jail command hooks that run before and 
>  after any
>  other actions.
> >>> Should it go into RELNOTES?
> >> I'm not sure what all the criteria are for relnotes.
> >> The committer's guide makes it seem like relnotes is for breaking
> >> changes, which this is not.
> > Please could you point at which specific language in the commiters
> > guide makes you believe that the RELNOTES are for breaking changes?
> 
> Every mention of "release notes" in the document is in the context of 
> deprecating, removing,
> or breaking things, with one exception:

Fair, there should be a section on "new features and enhnacements"
which is laking.  However if one reads a release notes from a shipping
version it becomes clear that the actual majority of the text in it is
"new stuff."

>  > Relnotes:??? If the change is a candidate for inclusion in the 
> release notes for the next release from the branch, set to yes.
> >
> > RELNOTES should be for all changes that have user visible impact
> > of any type.
> >
> >> -Ryan
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Ryan Moeller

On 5/15/20 3:24 PM, Rodney W. Grimes wrote:


On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:


On 5/15/20 1:38 AM, Ryan Moeller wrote:

Author: freqlabs
Date: Thu May 14 23:38:11 2020
New Revision: 361066
URL: https://svnweb.freebsd.org/changeset/base/361066

Log:
jail: Add exec.prepare and exec.release command hooks

This change introduces new jail command hooks that run before and after any

other actions.

Should it go into RELNOTES?

I'm not sure what all the criteria are for relnotes.
The committer's guide makes it seem like relnotes is for breaking
changes, which this is not.

Please could you point at which specific language in the commiters
guide makes you believe that the RELNOTES are for breaking changes?


Every mention of "release notes" in the document is in the context of 
deprecating, removing,

or breaking things, with one exception:

> Relnotes:    If the change is a candidate for inclusion in the 
release notes for the next release from the branch, set to yes.


RELNOTES should be for all changes that have user visible impact
of any type.


-Ryan

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361087 - head/sys/dev/ath/ath_rate/sample

2020-05-15 Thread Adrian Chadd
Author: adrian
Date: Fri May 15 20:03:53 2020
New Revision: 361087
URL: https://svnweb.freebsd.org/changeset/base/361087

Log:
  [ath] [ath_rate_sample] le oops, trim out an #if 1 that I didn't fully delete.
  
  Cool, so now I know it's about 3 weeks between starting on freebsd coding
  and breaking the build again. Queue dunce cap.

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==
--- head/sys/dev/ath/ath_rate/sample/sample.c   Fri May 15 20:01:30 2020
(r361086)
+++ head/sys/dev/ath/ath_rate/sample/sample.c   Fri May 15 20:03:53 2020
(r361087)
@@ -358,7 +358,6 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB
if (best_rate_pct > (pct + 50))
continue;
}
-#if 1
/*
 * For non-MCS rates, use the current average txtime for
 * comparison.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Rodney W. Grimes
> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:
> 
> > On 5/15/20 1:38 AM, Ryan Moeller wrote:
> >> Author: freqlabs
> >> Date: Thu May 14 23:38:11 2020
> >> New Revision: 361066
> >> URL: https://svnweb.freebsd.org/changeset/base/361066
> >>
> >> Log:
> >>jail: Add exec.prepare and exec.release command hooks
> >>
> >>This change introduces new jail command hooks that run before and after 
> >> any
> >>other actions.
> > Should it go into RELNOTES?
> I'm not sure what all the criteria are for relnotes.
> The committer's guide makes it seem like relnotes is for breaking 
> changes, which this is not.

Please could you point at which specific language in the commiters
guide makes you believe that the RELNOTES are for breaking changes?

RELNOTES should be for all changes that have user visible impact
of any type.

> -Ryan

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361085 - in head/sys/dev/ath: . ath_hal/ar5416 ath_rate/amrr ath_rate/onoe ath_rate/sample

2020-05-15 Thread Adrian Chadd
Author: adrian
Date: Fri May 15 18:51:20 2020
New Revision: 361085
URL: https://svnweb.freebsd.org/changeset/base/361085

Log:
  [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and 
aggregates.
  
  My initial rate control code was .. suboptimal.  I wanted to at least get MCS
  rates sent, but it didn't do anywhere near enough to handle low signal level 
links
  or remotely keep accurate statistics.
  
  So, 8 years later, here's what I should've done back then.
  
  * Firstly, I wasn't at all tracking packet sizes other than the two buckets
(250 and 1600 bytes.)  So, extend it to include 4096, 8192, 16384, 32768 and
65536.  I may go add 2048 at some point if I find it's useful.
  
This is important for a few reasons.  First, when forming A-MPDU or AMSDU
aggregates the frame sizes are larger, and thus the TX time calculation
is woefully, increasingly wrong.  Secondly, the behaviour of 802.11 channels
isn't some fixed thing, both due to channel conditions and radios 
themselves.
Notably, there was some observations done a few years ago on 11n chipsets
which noticed longer aggregates showed an increase in failed A-MPDU 
sub-frame
reception as you got further along in the transmit time.  It could be due to
a variety of things - transmitter linearity, channel conditions changing,
frequency/phase drift, etc - but the observation was to potentially form
shorter aggregates to improve BER.
  
  * .. and then modify the ath TX path to report the length of the aggregate 
sent,
so as the statistics kept would line up with the correct bucket.
  
  * Then on the rate control look-up side - i was also only using the first 
frame
length for an A-MPDU rate control lookup which isn't good enough here.
So, add a new method that walks the TID software queue for that node to
find out what the likely length of data available is.  It isn't ALL of the
data in the queue because we'll only ever send enough data to fit inside the
block-ack window, so limit how many bytes we return to roughly what 
ath_tx_form_aggr()
would do.
  
  * .. and cache that in the first ath_buf in the aggregate so it and the 
eventual
AMPDU length can be returned to the rate control code.
  
  * THEN, modify the rate control code to look at them both when deciding which 
bucket
to attribute the sent frame on.  I'm erring on the side of caution and 
using the
size bucket that the lookup is based on.
  
  Ok, so now the rate lookups and statistics are "more correct".  However, MCS 
rates
  are not the same as 11abg rates in that they're not a monotonically 
incrementing
  set of faster rates and you can't assume that just because a given MCS rate 
fails,
  the next higher one wouldn't work better or be a lower average tx time.
  
  So, I had to do a bunch of surgery to the best rate and sample rate math.
  This is the bit that's a WIP.
  
  * First, simplify the statistics updates (update_stats()) to do a single pass 
on
all rates.
  * Next, make sure that each rate average tx time is updated based on /its/ 
failure/success.
Eg if you sent a frame with { MCS15, MCS12, MCS8 } and MCS8 succeeded, 
MCS15 and MCS
12 would have their average tx time updated for /their/ part of the 
transmission,
not the whole transmission.
  * Next, EWMA wasn't being fully calculated based on the /failures/ in each of 
the
rate attempts.  So, if MCS15, MCS12 failed above but MCS8 didn't, then 
ensure
that the statistics noted that /all/ subframes failed at those rates, 
rather than
the eventual set of transmitted/sent frames.   This ensures the EWMA /and/ 
average
TX time are updated correctly.
  * When picking a sample rate and initial rate, probe rates aroud the current 
MCS
but limit it to MCS0..7 /for all spatial streams/, rather than doing crazy 
things
like hitting MCS7 and then probing MCS8 - MCS8 is basically MCS0 but two 
spatial
streams.  It's a /lot/ slower than MCS7.  Also, the reverse is true - if 
we're at
MCS8 then don't probe MCS7 as part of it, it's not likely to succeed.
  * Fix bugs in pick_best_rate() where I was /immediately/ choosing the highest 
MCS
rate if there weren't any frames yet transmitted.  I was defaulting to 25% 
EWMA and
.. then each comparison would accept the higher rate.  Just skip those; 
sampling
will fill in the details.
  
  So, this seems to work a lot better.  It's not perfect; I'm still seeing a 
lot of
  instability around higher MCS rates because there are bursts of 
loss/retransmissions
  that aren't /too/ bad.  But i'll keep iterating over this and tidying up my 
hacks.
  
  Ok, so why this still something I'm poking at? rather than porting 
minstrel_ht?
  
  ath_rate_sample tries to minimise airtime, not maximise throughput.  I have
  extended it with an EWMA based on sub-frame success/failures - high MCS rates
  that have partially successful receptions still show 

svn commit: r361084 - head/usr.bin/systat

2020-05-15 Thread Michael Reifenberger
Author: mr
Date: Fri May 15 17:37:08 2020
New Revision: 361084
URL: https://svnweb.freebsd.org/changeset/base/361084

Log:
  Introduce sysputpage() to display large page size with human readable format.
  Using UI units allows to fit larger numbers in columns.
  Stop calling v_page_size - this is a value that doesn't change at runtime.
  Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable.
  Use bit-shift to convert page size to byte.
  
  PR: 246458
  Submitted by:   o...@j.email.ne.jp
  MFC after: 2 weeks
  Differential Revision:  D24834

Modified:
  head/usr.bin/systat/extern.h
  head/usr.bin/systat/fetch.c
  head/usr.bin/systat/sysput.c
  head/usr.bin/systat/vmstat.c

Modified: head/usr.bin/systat/extern.h
==
--- head/usr.bin/systat/extern.hFri May 15 16:14:50 2020
(r361083)
+++ head/usr.bin/systat/extern.hFri May 15 17:37:08 2020
(r361084)
@@ -165,8 +165,11 @@ voidshowtcp(void);
 voidstatus(void);
 voidsuspend(int);
 char   *sysctl_dynread(const char *, size_t *);
+voidsysputpage(WINDOW* , int, int, int, uint64_t, int);
+voidsysputspaces(WINDOW* , int, int, int);
 voidsysputstrs(WINDOW* , int, int, int);
 voidsysputuint64(WINDOW* , int, int, int, uint64_t, int);
+voidsysputwuint64(WINDOW* , int, int, int, uint64_t, int);
 
 #define SYSTAT_CMD(name)   \
void close ## name(WINDOW *); \

Modified: head/usr.bin/systat/fetch.c
==
--- head/usr.bin/systat/fetch.c Fri May 15 16:14:50 2020(r361083)
+++ head/usr.bin/systat/fetch.c Fri May 15 17:37:08 2020(r361084)
@@ -60,9 +60,11 @@ kvm_ckread(void *a, void *b, int l)
return (1);
 }
 
-void getsysctl(const char *name, void *ptr, size_t len)
+void
+getsysctl(const char *name, void *ptr, size_t len)
 {
size_t nlen = len;
+
if (sysctlbyname(name, ptr, , NULL, 0) != 0) {
error("sysctl(%s...) failed: %s", name,
strerror(errno));

Modified: head/usr.bin/systat/sysput.c
==
--- head/usr.bin/systat/sysput.cFri May 15 16:14:50 2020
(r361083)
+++ head/usr.bin/systat/sysput.cFri May 15 17:37:08 2020
(r361084)
@@ -41,15 +41,23 @@ __FBSDID("$FreeBSD$");
 #include "extern.h"
 
 void
-sysputstrs(WINDOW *wnd, int row, int col, int width)
+sysputspaces(WINDOW *wd, int row, int col, int width)
 {
+   static char str40[] = "";
+
+   mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1);
+}
+
+void
+sysputstrs(WINDOW *wd, int row, int col, int width)
+{
static char str40[] = "";
 
mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1);
 }
 
 void
-sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags)
+sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags)
 {
char unit, *ptr, *start, wrtbuf[width + width + 1];
int len;
@@ -69,9 +77,42 @@ sysputuint64(WINDOW *wnd, int row, int col, int width,
memset(wrtbuf + len, ' ', width - len);
start += len;
 
-   mvwaddstr(wnd, row, col, start);
+   mvwaddstr(wd, row, col, start);
return;
 
 error:
-   sysputstrs(wnd, row, col, width);
+   sysputstrs(wd, row, col, width);
+}
+
+void
+sysputwuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags)
+{
+   if(val == 0)
+   sysputspaces(wd, row, col, width);
+   else
+   sysputuint64(wd, row, col, width, val, flags);
+}
+
+static int
+calc_page_shift()
+{
+   u_int page_size;
+   int shifts;
+
+   shifts = 0;
+   GETSYSCTL("vm.stats.vm.v_page_size", page_size);
+   for(; page_size > 1; page_size >>= 1)
+   shifts++;
+   return shifts;
+}
+
+void
+sysputpage(WINDOW *wd, int row, int col, int width, uint64_t pages, int flags)
+{
+   static int shifts = 0;
+
+   if (shifts == 0)
+   shifts = calc_page_shift();
+   pages <<= shifts;
+   sysputuint64(wd, row, col, width, pages, flags);
 }

Modified: head/usr.bin/systat/vmstat.c
==
--- head/usr.bin/systat/vmstat.cFri May 15 16:14:50 2020
(r361083)
+++ head/usr.bin/systat/vmstat.cFri May 15 17:37:08 2020
(r361084)
@@ -104,7 +104,6 @@ static struct Info {
/*
 * Distribution of page usages.
 */
-   u_int v_page_size;  /* page size in bytes */
u_int v_free_count; /* number of pages free */
u_int v_wire_count; /* number of pages wired down */
u_int v_active_count;   /* number of pages active */
@@ -173,15 

Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Ryan Moeller

On 5/15/20 6:18 AM, Mateusz Piotrowski wrote:


On 5/15/20 1:38 AM, Ryan Moeller wrote:

Author: freqlabs
Date: Thu May 14 23:38:11 2020
New Revision: 361066
URL: https://svnweb.freebsd.org/changeset/base/361066

Log:
   jail: Add exec.prepare and exec.release command hooks
   
   This change introduces new jail command hooks that run before and after any

   other actions.

Should it go into RELNOTES?

I'm not sure what all the criteria are for relnotes.
The committer's guide makes it seem like relnotes is for breaking 
changes, which this is not.


-Ryan

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361082 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve

2020-05-15 Thread Conrad Meyer
Author: cem
Date: Fri May 15 15:54:22 2020
New Revision: 361082
URL: https://svnweb.freebsd.org/changeset/base/361082

Log:
  vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace
  
  Expose the special kernel LAPIC, IOAPIC, and HPET devices to userspace
  for use in, e.g., fallback instruction emulation (when userspace has a
  newer instruction decode/emulation layer than the kernel vmm(4)).
  
  Plumb the ioctl through libvmmapi and register the memory ranges in
  bhyve(8).
  
  Reviewed by:  grehan
  Differential Revision:https://reviews.freebsd.org/D24525

Added:
  head/usr.sbin/bhyve/kernemu_dev.c   (contents, props changed)
  head/usr.sbin/bhyve/kernemu_dev.h   (contents, props changed)
Modified:
  head/lib/libvmmapi/vmmapi.c
  head/lib/libvmmapi/vmmapi.h
  head/sys/amd64/include/vmm_dev.h
  head/sys/amd64/vmm/vmm_dev.c
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/lib/libvmmapi/vmmapi.c
==
--- head/lib/libvmmapi/vmmapi.c Fri May 15 14:06:37 2020(r361081)
+++ head/lib/libvmmapi/vmmapi.c Fri May 15 15:54:22 2020(r361082)
@@ -799,6 +799,25 @@ vm_ioapic_pincount(struct vmctx *ctx, int *pincount)
 }
 
 int
+vm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu, vm_paddr_t gpa,
+bool write, int size, uint64_t *value)
+{
+   struct vm_readwrite_kernemu_device irp = {
+   .vcpuid = vcpu,
+   .access_width = fls(size) - 1,
+   .gpa = gpa,
+   .value = write ? *value : ~0ul,
+   };
+   long cmd = (write ? VM_SET_KERNEMU_DEV : VM_GET_KERNEMU_DEV);
+   int rc;
+
+   rc = ioctl(ctx->fd, cmd, );
+   if (rc == 0 && !write)
+   *value = irp.value;
+   return (rc);
+}
+
+int
 vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq)
 {
struct vm_isa_irq isa_irq;
@@ -1615,6 +1634,7 @@ vm_get_ioctls(size_t *len)
VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER,
VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR,
VM_SET_REGISTER_SET, VM_GET_REGISTER_SET,
+   VM_SET_KERNEMU_DEV, VM_GET_KERNEMU_DEV,
VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ,
VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ,
VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ,

Modified: head/lib/libvmmapi/vmmapi.h
==
--- head/lib/libvmmapi/vmmapi.h Fri May 15 14:06:37 2020(r361081)
+++ head/lib/libvmmapi/vmmapi.h Fri May 15 15:54:22 2020(r361082)
@@ -35,6 +35,8 @@
 #include 
 #include 
 
+#include 
+
 /*
  * API version for out-of-tree consumers like grub-bhyve for making compile
  * time decisions.
@@ -156,6 +158,8 @@ int vm_ioapic_assert_irq(struct vmctx *ctx, int irq);
 intvm_ioapic_deassert_irq(struct vmctx *ctx, int irq);
 intvm_ioapic_pulse_irq(struct vmctx *ctx, int irq);
 intvm_ioapic_pincount(struct vmctx *ctx, int *pincount);
+intvm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu,
+   vm_paddr_t gpa, bool write, int size, uint64_t *value);
 intvm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq);
 intvm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq);
 intvm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq);

Modified: head/sys/amd64/include/vmm_dev.h
==
--- head/sys/amd64/include/vmm_dev.hFri May 15 14:06:37 2020
(r361081)
+++ head/sys/amd64/include/vmm_dev.hFri May 15 15:54:22 2020
(r361082)
@@ -235,6 +235,15 @@ struct vm_cpu_topology {
uint16_tmaxcpus;
 };
 
+struct vm_readwrite_kernemu_device {
+   int vcpuid;
+   unsignedaccess_width : 3;
+   unsigned_unused : 29;
+   uint64_tgpa;
+   uint64_tvalue;
+};
+_Static_assert(sizeof(struct vm_readwrite_kernemu_device) == 24, "ABI");
+
 enum {
/* general routines */
IOCNUM_ABIVERS = 0,
@@ -262,6 +271,8 @@ enum {
IOCNUM_GET_SEGMENT_DESCRIPTOR = 23,
IOCNUM_SET_REGISTER_SET = 24,
IOCNUM_GET_REGISTER_SET = 25,
+   IOCNUM_GET_KERNEMU_DEV = 26,
+   IOCNUM_SET_KERNEMU_DEV = 27,
 
/* interrupt injection */
IOCNUM_GET_INTINFO = 28,
@@ -347,6 +358,12 @@ enum {
_IOW('v', IOCNUM_SET_REGISTER_SET, struct vm_register_set)
 #defineVM_GET_REGISTER_SET \
_IOWR('v', IOCNUM_GET_REGISTER_SET, struct vm_register_set)
+#defineVM_SET_KERNEMU_DEV \
+   _IOW('v', IOCNUM_SET_KERNEMU_DEV, \
+   struct vm_readwrite_kernemu_device)
+#defineVM_GET_KERNEMU_DEV \
+   _IOWR('v', IOCNUM_GET_KERNEMU_DEV, \
+   struct vm_readwrite_kernemu_device)
 #defineVM_INJECT_EXCEPTION

Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys

2020-05-15 Thread John Baldwin
On 5/15/20 7:21 AM, Mark Johnston wrote:
> On Mon, May 11, 2020 at 08:30:29PM +, John Baldwin wrote:
>> Author: jhb
>> Date: Mon May 11 20:30:28 2020
>> New Revision: 360918
>> URL: https://svnweb.freebsd.org/changeset/base/360918
>>
>> Log:
>>   Remove ubsec(4).
>>   
>>   This driver was previously marked for deprecation in r360710.
> 
> We still have tools/tools/crypto/ubsecstats.c.  Is there a reason to
> keep it, or was it an oversight?

Ah, oversight.  (Did not cast a wide-enough grep)

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys

2020-05-15 Thread Mark Johnston
On Mon, May 11, 2020 at 08:30:29PM +, John Baldwin wrote:
> Author: jhb
> Date: Mon May 11 20:30:28 2020
> New Revision: 360918
> URL: https://svnweb.freebsd.org/changeset/base/360918
> 
> Log:
>   Remove ubsec(4).
>   
>   This driver was previously marked for deprecation in r360710.

We still have tools/tools/crypto/ubsecstats.c.  Is there a reason to
keep it, or was it an oversight?

>   
>   Approved by:csprng (cem, gordon, delphij)
>   Relnotes:   yes
>   Sponsored by:   Chelsio Communications
>   Differential Revision:  https://reviews.freebsd.org/D24766
> 
> Deleted:
>   head/share/man/man4/ubsec.4
>   head/sys/dev/ubsec/ubsec.c
>   head/sys/dev/ubsec/ubsecreg.h
>   head/sys/dev/ubsec/ubsecvar.h
>   head/sys/modules/ubsec/Makefile
> Modified:
>   head/ObsoleteFiles.inc
>   head/share/man/man4/Makefile
>   head/share/man/man4/crypto.4
>   head/share/man/man4/rndtest.4
>   head/sys/conf/NOTES
>   head/sys/conf/files
>   head/sys/conf/options
>   head/sys/dev/random/random_harvestq.c
>   head/sys/modules/Makefile
>   head/sys/sys/random.h
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361081 - head/sys/netinet

2020-05-15 Thread Michael Tuexen
Author: tuexen
Date: Fri May 15 14:06:37 2020
New Revision: 361081
URL: https://svnweb.freebsd.org/changeset/base/361081

Log:
  Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets.
  
  This problem was found by looking at syzkaller reproducers for some other
  problems.
  
  Reviewed by:  rrs
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D24831

Modified:
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Fri May 15 14:00:12 2020
(r361080)
+++ head/sys/netinet/tcp_usrreq.c   Fri May 15 14:06:37 2020
(r361081)
@@ -1037,6 +1037,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf
error = EINVAL;
goto out;
}
+   if ((inp->inp_vflag & INP_IPV6PROTO) == 0) {
+   if (m != NULL)
+   m_freem(m);
+   error = EAFNOSUPPORT;
+   goto out;
+   }
if (IN6_IS_ADDR_MULTICAST(>sin6_addr)) {
if (m)
m_freem(m);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361080 - head/sys/netinet/tcp_stacks

2020-05-15 Thread Randall Stewart
Author: rrs
Date: Fri May 15 14:00:12 2020
New Revision: 361080
URL: https://svnweb.freebsd.org/changeset/base/361080

Log:
  This fixes several skyzaller issues found with the
  help of Michael Tuexen. There was some accounting
  errors with TCPFO for bbr and also for both rack
  and bbr there was a FO case where we should be
  jumping to the just_return_nolock label to
  exit instead of returning 0. This of course
  caused no timer to be running and thus the
  stuck sessions.
  
  Reported by: Michael Tuexen and Skyzaller
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D24852

Modified:
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_stacks/rack_bbr_common.c

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Fri May 15 13:53:10 2020
(r361079)
+++ head/sys/netinet/tcp_stacks/bbr.c   Fri May 15 14:00:12 2020
(r361080)
@@ -4975,6 +4975,15 @@ bbr_remxt_tmr(struct tcpcb *tp)
rsm->r_flags &= ~(BBR_ACKED | BBR_SACK_PASSED | 
BBR_WAS_SACKPASS);
bbr_log_type_rsmclear(bbr, cts, rsm, old_flags, 
__LINE__);
} else {
+   if ((tp->t_state < TCPS_ESTABLISHED) &&
+   (rsm->r_start == tp->snd_una)) {
+   /*
+* Special case for TCP FO. Where
+* we sent more data beyond the snd_max.
+* We don't mark that as lost and stop here.
+*/
+   break;
+   }
if ((rsm->r_flags & BBR_MARKED_LOST) == 0) {
bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start;
bbr->r_ctl.rc_lost_bytes += rsm->r_end - 
rsm->r_start;
@@ -12315,7 +12324,8 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva
 (tp->t_state == TCPS_SYN_SENT)) &&
SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent 
*/
(tp->t_rxtshift == 0)) {/* not a retransmit */
-   return (0);
+   len = 0;
+   goto just_return_nolock;
}
/*
 * Before sending anything check for a state update. For hpts
@@ -14286,6 +14296,7 @@ nomore:
(hw_tls == 0) &&
(len > 0) &&
((flags & TH_RST) == 0) &&
+   ((flags & TH_SYN) == 0) &&
(IN_RECOVERY(tp->t_flags) == 0) &&
(bbr->rc_in_persist == 0) &&
(tot_len < bbr->r_ctl.rc_pace_max_segs)) {

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Fri May 15 13:53:10 2020
(r361079)
+++ head/sys/netinet/tcp_stacks/rack.c  Fri May 15 14:00:12 2020
(r361080)
@@ -3873,6 +3873,7 @@ skip_measurement:
 * the next send will trigger us picking up the missing data.
 */
if (rack->r_ctl.rc_first_appl &&
+   TCPS_HAVEESTABLISHED(tp->t_state) &&
rack->r_ctl.rc_app_limited_cnt &&
(SEQ_GT(rack->r_ctl.rc_first_appl->r_start, th_ack)) &&
((rack->r_ctl.rc_first_appl->r_start - th_ack) >
@@ -11741,6 +11742,13 @@ rack_start_gp_measurement(struct tcpcb *tp, struct tcp
struct rack_sendmap *my_rsm = NULL;
struct rack_sendmap fe;
 
+   if (tp->t_state < TCPS_ESTABLISHED) {
+   /*
+* We don't start any measurements if we are
+* not at least established.
+*/
+   return;
+   }
tp->t_flags |= TF_GPUTINPROG;
rack->r_ctl.rc_gp_lowrtt = 0x;
rack->r_ctl.rc_gp_high_rwnd = rack->rc_tp->snd_wnd;
@@ -12109,8 +12117,10 @@ rack_output(struct tcpcb *tp)
((tp->t_state == TCPS_SYN_RECEIVED) ||
 (tp->t_state == TCPS_SYN_SENT)) &&
SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent 
*/
-   (tp->t_rxtshift == 0))  /* not a retransmit */
-   return (0);
+   (tp->t_rxtshift == 0)) {  /* not a retransmit */
+   cwnd_to_use = rack->r_ctl.cwnd_to_use = tp->snd_cwnd;
+   goto just_return_nolock;
+   }
/*
 * Determine length of data that should be transmitted, and flags
 * that will be used. If there is some data or critical controls

Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c
==
--- head/sys/netinet/tcp_stacks/rack_bbr_common.c   Fri May 15 13:53:10 
2020(r361079)
+++ head/sys/netinet/tcp_stacks/rack_bbr_common.c   Fri May 15 14:00:12 
2020 

svn commit: r361079 - head/sys/kern

2020-05-15 Thread Konstantin Belousov
Author: kib
Date: Fri May 15 13:53:10 2020
New Revision: 361079
URL: https://svnweb.freebsd.org/changeset/base/361079

Log:
  Improve comment for compat32 handling of sysctl hw.pagesizes.
  
  Explain why truncation works as intended.
  Reformat.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cFri May 15 13:52:39 2020(r361078)
+++ head/sys/kern/kern_mib.cFri May 15 13:53:10 2020(r361079)
@@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS)
 
if (req->flags & SCTL_MASK32) {
/*
-* Recreate the "pagesizes" array with 32-bit elements.  
Truncate
-* any page size greater than UINT32_MAX to zero.
+* Recreate the "pagesizes" array with 32-bit elements.
+* Truncate any page size greater than UINT32_MAX to zero,
+* which assumes that page sizes are powers of two.
 */
for (i = 0; i < MAXPAGESIZES; i++)
pagesizes32[i] = (uint32_t)pagesizes[i];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361078 - head/sys/kern

2020-05-15 Thread Konstantin Belousov
Author: kib
Date: Fri May 15 13:52:39 2020
New Revision: 361078
URL: https://svnweb.freebsd.org/changeset/base/361078

Log:
  Revert r361077 to recommit with proper message.

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cFri May 15 13:50:08 2020(r361077)
+++ head/sys/kern/kern_mib.cFri May 15 13:52:39 2020(r361078)
@@ -238,9 +238,8 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS)
 
if (req->flags & SCTL_MASK32) {
/*
-* Recreate the "pagesizes" array with 32-bit elements.
-* Truncate any page size greater than UINT32_MAX to zero,
-* which assumes that page sizes are powers of two.
+* Recreate the "pagesizes" array with 32-bit elements.  
Truncate
+* any page size greater than UINT32_MAX to zero.
 */
for (i = 0; i < MAXPAGESIZES; i++)
pagesizes32[i] = (uint32_t)pagesizes[i];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361077 - head/sys/kern

2020-05-15 Thread Konstantin Belousov
Author: kib
Date: Fri May 15 13:50:08 2020
New Revision: 361077
URL: https://svnweb.freebsd.org/changeset/base/361077

Log:
  Implement RTLD_DEEPBIND.
  
  PR:   246462
  Tested by:Martin Birgmeier 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D24841

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cFri May 15 13:33:48 2020(r361076)
+++ head/sys/kern/kern_mib.cFri May 15 13:50:08 2020(r361077)
@@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS)
 
if (req->flags & SCTL_MASK32) {
/*
-* Recreate the "pagesizes" array with 32-bit elements.  
Truncate
-* any page size greater than UINT32_MAX to zero.
+* Recreate the "pagesizes" array with 32-bit elements.
+* Truncate any page size greater than UINT32_MAX to zero,
+* which assumes that page sizes are powers of two.
 */
for (i = 0; i < MAXPAGESIZES; i++)
pagesizes32[i] = (uint32_t)pagesizes[i];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361076 - in head/sys/arm64: arm64 include

2020-05-15 Thread Andrew Turner
Author: andrew
Date: Fri May 15 13:33:48 2020
New Revision: 361076
URL: https://svnweb.freebsd.org/changeset/base/361076

Log:
  Remove arm64_idcache_wbinv_range as it's unused.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/cpufunc_asm.S
  head/sys/arm64/include/cpufunc.h

Modified: head/sys/arm64/arm64/cpufunc_asm.S
==
--- head/sys/arm64/arm64/cpufunc_asm.S  Fri May 15 12:47:39 2020
(r361075)
+++ head/sys/arm64/arm64/cpufunc_asm.S  Fri May 15 13:33:48 2020
(r361076)
@@ -133,14 +133,6 @@ ENTRY(arm64_dcache_inv_range)
 END(arm64_dcache_inv_range)
 
 /*
- * void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t)
- */
-ENTRY(arm64_idcache_wbinv_range)
-   cache_handle_range  dcop = civac, ic = 1, icop = ivau
-   ret
-END(arm64_idcache_wbinv_range)
-
-/*
  * void arm64_icache_sync_range(vm_offset_t, vm_size_t)
  */
 ENTRY(arm64_icache_sync_range)

Modified: head/sys/arm64/include/cpufunc.h
==
--- head/sys/arm64/include/cpufunc.hFri May 15 12:47:39 2020
(r361075)
+++ head/sys/arm64/include/cpufunc.hFri May 15 13:33:48 2020
(r361076)
@@ -216,7 +216,6 @@ extern int64_t dczva_line_size;
 #definecpu_dcache_inv_range(a, s)  arm64_dcache_inv_range((a), (s))
 #definecpu_dcache_wb_range(a, s)   arm64_dcache_wb_range((a), (s))
 
-#definecpu_idcache_wbinv_range(a, s)   arm64_idcache_wbinv_range((a), 
(s))
 #definecpu_icache_sync_range(a, s) arm64_icache_sync_range((a), 
(s))
 #define cpu_icache_sync_range_checked(a, s) 
arm64_icache_sync_range_checked((a), (s))
 
@@ -224,7 +223,6 @@ void arm64_nullop(void);
 void arm64_tlb_flushID(void);
 void arm64_icache_sync_range(vm_offset_t, vm_size_t);
 int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t);
-void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t);
 void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t);
 void arm64_dcache_inv_range(vm_offset_t, vm_size_t);
 void arm64_dcache_wb_range(vm_offset_t, vm_size_t);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361075 - head/sys/kern

2020-05-15 Thread Hans Petter Selasky
Author: hselasky
Date: Fri May 15 12:47:39 2020
New Revision: 361075
URL: https://svnweb.freebsd.org/changeset/base/361075

Log:
  Assign process group of the TTY under the "proctree_lock".
  
  This fixes a race where concurrent calls to doenterpgrp() and
  leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp
  changing value so that tty_rel_pgrp() misses clearing it to NULL. For
  more details refer to the use of pgdelete() in the kernel.
  
  No functional change intended.
  
  Panic backtrace:
  __mtx_lock_sleep() # page fault due to using destroyed mutex
  tty_signal_pgrp()
  tty_ioctl()
  ptsdev_ioctl()
  kern_ioctl()
  sys_ioctl()
  amd64_syscall()
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Fri May 15 12:04:39 2020(r361074)
+++ head/sys/kern/tty.c Fri May 15 12:47:39 2020(r361075)
@@ -1818,7 +1818,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da
tp->t_session = p->p_session;
tp->t_session->s_ttyp = tp;
tp->t_sessioncnt++;
-   sx_xunlock(_lock);
 
/* Assign foreground process group. */
tp->t_pgrp = p->p_pgrp;
@@ -1826,6 +1825,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da
p->p_flag |= P_CONTROLT;
PROC_UNLOCK(p);
 
+   sx_xunlock(_lock);
return (0);
}
case TIOCSPGRP: {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361074 - head/lib/libnetgraph

2020-05-15 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Fri May 15 12:04:39 2020
New Revision: 361074
URL: https://svnweb.freebsd.org/changeset/base/361074

Log:
  Fix SYNPOSIS section to point to the proper include directive.
  
  netgraph(3) points to #include , which is kernel only.
  The man page refers to the user-space part of the netgraph module, which is
  located in .
  
  Submitted by: lutz_donnerhacke.de
  Approved by:  bcr
  Differential Revision:https://reviews.freebsd.org/D23814

Modified:
  head/lib/libnetgraph/netgraph.3

Modified: head/lib/libnetgraph/netgraph.3
==
--- head/lib/libnetgraph/netgraph.3 Fri May 15 11:58:01 2020
(r361073)
+++ head/lib/libnetgraph/netgraph.3 Fri May 15 12:04:39 2020
(r361074)
@@ -35,7 +35,7 @@
 .\" $FreeBSD$
 .\" $Whistle: netgraph.3,v 1.7 1999/01/25 07:14:06 archie Exp $
 .\"
-.Dd November 25, 2013
+.Dd May 15, 2020
 .Dt NETGRAPH 3
 .Os
 .Sh NAME
@@ -57,7 +57,7 @@
 .Sh LIBRARY
 .Lb libnetgraph
 .Sh SYNOPSIS
-.In netgraph/netgraph.h
+.In netgraph.h
 .Ft int
 .Fn NgMkSockNode "const char *name" "int *csp" "int *dsp"
 .Ft int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361073 - in head: include lib/libc/gen libexec/rtld-elf

2020-05-15 Thread Konstantin Belousov
Author: kib
Date: Fri May 15 11:58:01 2020
New Revision: 361073
URL: https://svnweb.freebsd.org/changeset/base/361073

Log:
  Implement RTLD_DEEPBIND.
  
  PR:   246462
  Tested by:Martin Birgmeier 
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D24841

Modified:
  head/include/dlfcn.h
  head/lib/libc/gen/dlopen.3
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/include/dlfcn.h
==
--- head/include/dlfcn.hFri May 15 11:03:27 2020(r361072)
+++ head/include/dlfcn.hFri May 15 11:58:01 2020(r361073)
@@ -47,6 +47,8 @@
 #defineRTLD_TRACE  0x200   /* Trace loaded objects and exit. */
 #defineRTLD_NODELETE   0x01000 /* Do not remove members. */
 #defineRTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */
+#defineRTLD_DEEPBIND   0x04000 /* Put symbols from the dso ahead of
+  the global list */
 
 /*
  * Request arguments for dlinfo().

Modified: head/lib/libc/gen/dlopen.3
==
--- head/lib/libc/gen/dlopen.3  Fri May 15 11:03:27 2020(r361072)
+++ head/lib/libc/gen/dlopen.3  Fri May 15 11:58:01 2020(r361073)
@@ -32,7 +32,7 @@
 .\" @(#) dlopen.3 1.6 90/01/31 SMI
 .\" $FreeBSD$
 .\"
-.Dd January 2, 2019
+.Dd May 14, 2020
 .Dt DLOPEN 3
 .Os
 .Sh NAME
@@ -162,6 +162,9 @@ the process address space, otherwise
 is returned.
 Other mode flags may be specified, which will be applied for promotion
 for the found object.
+.It Dv RTLD_DEEPBIND
+Symbols from the loaded library are put before global symbols when
+resolving symbolic references originated from the library.
 .El
 .Pp
 If

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cFri May 15 11:03:27 2020
(r361072)
+++ head/libexec/rtld-elf/rtld.cFri May 15 11:58:01 2020
(r361073)
@@ -3366,6 +3366,8 @@ rtld_dlopen(const char *name, int fd, int mode)
lo_flags |= RTLD_LO_NODELETE;
 if (mode & RTLD_NOLOAD)
lo_flags |= RTLD_LO_NOLOAD;
+if (mode & RTLD_DEEPBIND)
+   lo_flags |= RTLD_LO_DEEPBIND;
 if (ld_tracing != NULL)
lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS;
 
@@ -3417,6 +3419,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref
if (globallist_next(old_obj_tail) != NULL) {
/* We loaded something new. */
assert(globallist_next(old_obj_tail) == obj);
+   if ((lo_flags & RTLD_LO_DEEPBIND) != 0)
+   obj->symbolic = true;
result = 0;
if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 &&
  obj->static_tls && !allocate_tls_offset(obj)) {

Modified: head/libexec/rtld-elf/rtld.h
==
--- head/libexec/rtld-elf/rtld.hFri May 15 11:03:27 2020
(r361072)
+++ head/libexec/rtld-elf/rtld.hFri May 15 11:58:01 2020
(r361073)
@@ -309,6 +309,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry);
 #defineRTLD_LO_EARLY   0x20/* Do not call ctors, postpone it to the
   initialization during the image start. */
 #defineRTLD_LO_IGNSTLS 0x40/* Do not allocate static TLS */
+#defineRTLD_LO_DEEPBIND 0x80   /* Force symbolic for this object */
 
 /*
  * Symbol cache entry used during relocation to avoid multiple lookups
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361072 - head/usr.sbin/bhyve

2020-05-15 Thread Aleksandr Fedorov
Author: afedorov
Date: Fri May 15 11:03:27 2020
New Revision: 361072
URL: https://svnweb.freebsd.org/changeset/base/361072

Log:
  bhyve: Fix processing of netgraph backend options.
  
  After r360820, additional parameters are passed through the argument 'opts', 
and the name of the backend through the argument 'devname'. So, there is no 
need to skip the backend name from the 'opts' argument.

Modified:
  head/usr.sbin/bhyve/net_backends.c

Modified: head/usr.sbin/bhyve/net_backends.c
==
--- head/usr.sbin/bhyve/net_backends.c  Fri May 15 03:54:25 2020
(r361071)
+++ head/usr.sbin/bhyve/net_backends.c  Fri May 15 11:03:27 2020
(r361072)
@@ -438,8 +438,6 @@ ng_init(struct net_backend *be, const char *devname,
path_provided = 0;
peerhook_provided = 0;
 
-   (void)strsep(, ",");
-
while (ngopts != NULL) {
char *value = ngopts;
char *key;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361066 - head/usr.sbin/jail

2020-05-15 Thread Mateusz Piotrowski
On 5/15/20 1:38 AM, Ryan Moeller wrote:
> Author: freqlabs
> Date: Thu May 14 23:38:11 2020
> New Revision: 361066
> URL: https://svnweb.freebsd.org/changeset/base/361066
>
> Log:
>   jail: Add exec.prepare and exec.release command hooks
>   
>   This change introduces new jail command hooks that run before and after any
>   other actions.
Should it go into RELNOTES?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"