Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4

2021-06-09 Thread Emmanuel Vadot
On Thu, 3 Jun 2021 16:38:16 GMT
Cy Schubert  wrote:

> The branch vendor/wpa has been updated by cy:
> 
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12372b2d3f9a
> 
> commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a
> Author: Cy Schubert 
> AuthorDate: 2021-06-03 16:15:01 +
> Commit: Cy Schubert 
> CommitDate: 2021-06-03 16:15:01 +
> 
> wpa: Import wpa_supplicant/hostapd commit e8662e9d4
> 
> This is the June update to vendor/wpa committed upstream 2021/06/03.

 Hi cy@

 Don't know if it is this commit or something else yet but I'm seeing
weird behavior from a recent head.
 wpa_supplicant abort with SIGBUS just after connecting to my wireless
network. I'm still connected but this stopped working after a while (I
guess when the supplicant would need to do some stuff with the AP or
something).
 From dmesg just after running service netif restart:
lo0: link state changed to DOWN
wlan0: link state changed to DOWN
wlan0: Ethernet address: bc:54:2f:4b:d1:dd
lo0: link state changed to UP
wlan0: link state changed to UP
pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core
dumped)

Reading symbols from /usr/sbin/wpa_supplicant...
Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug...
[New LWP 112604]
Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c 
/etc/wpa_supplicant.conf -D bsd -P /v'.
Program terminated with signal SIGBUS, Bus error.
#0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
304 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h: No 
such file or directory.
(gdb) bt
#0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
#1  wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, 
ver=, key_data=, key_data_len=)
at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa.c:1572
#2  wpa_sm_rx_eapol (sm=, src_addr=, 
buf=, len=)
at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa.c:2434
#3  0x010e372e in l2_packet_receive (sock=, 
eloop_ctx=0x801e286e0, sock_ctx=)
at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2_packet_freebsd.c:98
#4  0x01112b23 in eloop_sock_table_dispatch (table=, 
fds=0x801e44080) at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/utils/eloop.c:600
#5  eloop_run () at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/utils/eloop.c:1223
#6  0x010af228 in wpa_supplicant_run (global=, 
global@entry=0x801e2d000)
at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/wpa_supplicant.c:6526
#7  0x0109ab6c in main (argc=, argv=) at 
/usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c:397

 I'll try to revert the update later this week but if you have any idea in the 
mean time.

 Thanks,

-- 
Emmanuel Vadot  
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 20eb6bd8c598 - main - rc.d: liberate powerd from ACPI dependency

2021-06-09 Thread Andriy Gapon
The branch main has been updated by avg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=20eb6bd8c598fdbf4e96ed4ca64a609be255ccba

commit 20eb6bd8c598fdbf4e96ed4ca64a609be255ccba
Author: Andriy Gapon 
AuthorDate: 2021-06-08 17:08:10 +
Commit: Andriy Gapon 
CommitDate: 2021-06-09 09:40:53 +

rc.d: liberate powerd from ACPI dependency

For instance, many non-ACPI ARM systems have CPU power / frequency
levels.

Discussed with: manu
MFC after:  1 week
---
 libexec/rc/rc.d/Makefile | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile
index 0834d8c4c2a0..24a4e7edb9d9 100644
--- a/libexec/rc/rc.d/Makefile
+++ b/libexec/rc/rc.d/Makefile
@@ -78,6 +78,7 @@ CONFS=DAEMON \
pf \
pflog \
pfsync \
+   powerd \
ppp \
pppoed \
pwcheck \
@@ -135,10 +136,6 @@ ACPI=  power_profile
 ACPIPACKAGE=   acpi
 .endif
 
-.if ${MK_ACPI} != "no" || ${MK_APM} != "no"
-CONFS+=powerd
-.endif
-
 .if ${MK_APM} != "no"
 CONFGROUPS+=   APM
 APM+=  apm
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: ffc5dc788f05 - main - rk3328_cru: fix a typo in the SCLK_I2S2 gate definition

2021-06-09 Thread Andriy Gapon
The branch main has been updated by avg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ffc5dc788f05dec5fd11aff8f216c37cd56fcd7f

commit ffc5dc788f05dec5fd11aff8f216c37cd56fcd7f
Author: Andriy Gapon 
AuthorDate: 2021-06-09 07:44:41 +
Commit: Andriy Gapon 
CommitDate: 2021-06-09 09:41:52 +

rk3328_cru: fix a typo in the SCLK_I2S2 gate definition

MFC after:  4 days
---
 sys/arm64/rockchip/clk/rk3328_cru.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/rockchip/clk/rk3328_cru.c 
b/sys/arm64/rockchip/clk/rk3328_cru.c
index e110564f773d..95a87cfd0e00 100644
--- a/sys/arm64/rockchip/clk/rk3328_cru.c
+++ b/sys/arm64/rockchip/clk/rk3328_cru.c
@@ -114,7 +114,7 @@ static struct rk_cru_gate rk3328_gates[] = {
/* CRU_CLKGATE_CON1 */
CRU_GATE(SCLK_I2S0, "clk_i2s0", "clk_i2s0_mux", 0x204, 3)
CRU_GATE(SCLK_I2S1, "clk_i2s1", "clk_i2s1_mux", 0x204, 6)
-   CRU_GATE(SCLK_I2S1, "clk_i2s2", "clk_i2s2_mux", 0x204, 10)
+   CRU_GATE(SCLK_I2S2, "clk_i2s2", "clk_i2s2_mux", 0x204, 10)
 
/* CRU_CLKGATE_CON4 */
CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0)
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: dc318a4ffabc - main - Fix syscall kld example

2021-06-09 Thread Fernando Apesteguía
The branch main has been updated by fernape (doc, ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=dc318a4ffabcbfa23bb56a33403aad36e6de30af

commit dc318a4ffabcbfa23bb56a33403aad36e6de30af
Author: Fernando Apesteguía 
AuthorDate: 2021-05-27 12:09:39 +
Commit: Fernando Apesteguía 
CommitDate: 2021-06-09 10:24:26 +

Fix syscall kld example

PR: 255936
Reported by:splitf...@mailfence.com
Approved by:gbe (mentor), imp@, jilles@
Differential Revision:  https://reviews.freebsd.org/D30498
---
 share/examples/kld/syscall/module/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/examples/kld/syscall/module/syscall.c 
b/share/examples/kld/syscall/module/syscall.c
index 701e2492884c..1ee533005b85 100644
--- a/share/examples/kld/syscall/module/syscall.c
+++ b/share/examples/kld/syscall/module/syscall.c
@@ -51,8 +51,8 @@ hello(struct thread *td, void *arg)
  * The `sysent' for the new syscall
  */
 static struct sysent hello_sysent = {
-   0,  /* sy_narg */
-   hello   /* sy_call */
+   .sy_narg = 0,
+   .sy_call = hello
 };
 
 /*
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


Re: git: 97993d1ebf59 - main - hyperv: Fix vmbus after the i386 4/4 split

2021-06-09 Thread Mateusz Guzik
This breaks i386 LINT kernels:

ld: error: undefined symbol: Xvmbus_isr
>>> referenced by vmbus.c
>>>   vmbus.o:(vmbus_intrhook)

ld: error: undefined symbol: Xvmbus_isr_pti
>>> referenced by vmbus.c
>>>   vmbus.o:(vmbus_intrhook)


On 6/8/21, Mark Johnston  wrote:
> The branch main has been updated by markj:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=97993d1ebf592ac6689a498d5d0d2afb46758680
>
> commit 97993d1ebf592ac6689a498d5d0d2afb46758680
> Author: Mark Johnston 
> AuthorDate: 2021-06-08 13:40:30 +
> Commit: Mark Johnston 
> CommitDate: 2021-06-08 13:40:30 +
>
> hyperv: Fix vmbus after the i386 4/4 split
>
> The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
> trampoline at driver initialization time poses some difficulties due to
> the fact that the KENTER macro assumes that the offset relative to
> tramp_idleptd is fixed at static link time.  Another problem is that
> native_lapic_ipi_alloc() uses setidt(), which assumes a fixed
> trampoline
> offset.
>
> Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add
> a
> new HYPERV kernel option to make this optional, and configure it by
> default on i386.  This is sufficient to make use of vmbus(4) after the
> 4/4 split.  Note that vmbus cannot be loaded dynamically and both the
> HYPERV option and device must be configured together.  I think this is
> not too onerous a requirement, since vmbus(4) was previously
> non-functional.
>
> Reported by:Harry Schmalzbauer 
> Tested by:  Harry Schmalzbauer 
> Reviewed by:whu, kib
> MFC after:  2 weeks
> Sponsored by:   The FreeBSD Foundation
> Differential Revision:  https://reviews.freebsd.org/D30577
> ---
>  sys/conf/files.i386  | 1 -
>  sys/conf/options.i386| 3 +++
>  sys/dev/hyperv/vmbus/i386/vmbus_vector.S | 6 +-
>  sys/i386/conf/GENERIC| 4 +++-
>  sys/i386/i386/exception.s| 9 +
>  sys/modules/hyperv/vmbus/Makefile| 5 -
>  6 files changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
> index 331ad5fec79a..10e286dae271 100644
> --- a/sys/conf/files.i386
> +++ b/sys/conf/files.i386
> @@ -102,7 +102,6 @@ dev/glxiic/glxiic.c   optional glxiic
>  dev/glxsb/glxsb.coptional glxsb
>  dev/glxsb/glxsb_hash.c   optional glxsb
>  dev/hyperv/vmbus/i386/hyperv_machdep.c   optional
> hyperv
> -dev/hyperv/vmbus/i386/vmbus_vector.S optionalhyperv
>  dev/le/if_le_isa.c   optional le isa
>  dev/nctgpio/nctgpio.coptional nctgpio
>  dev/nfe/if_nfe.c optional nfe pci
> diff --git a/sys/conf/options.i386 b/sys/conf/options.i386
> index 4249fa1dfd0a..5e7ea446089b 100644
> --- a/sys/conf/options.i386
> +++ b/sys/conf/options.i386
> @@ -101,6 +101,9 @@ NPX_DEBUG opt_npx.h
>  # BPF just-in-time compiler
>  BPF_JITTER   opt_bpf.h
>
> +# Hyper-V support
> +HYPERV   opt_hyperv.h
> +
>  XENHVM   opt_global.h
>
>  # options for the Intel C600 SAS driver (isci)
> diff --git a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S
> b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S
> index 0570c6b49e1c..d119cfdc5b12 100644
> --- a/sys/dev/hyperv/vmbus/i386/vmbus_vector.S
> +++ b/sys/dev/hyperv/vmbus/i386/vmbus_vector.S
> @@ -35,6 +35,9 @@
>  /*
>   * This is the Hyper-V vmbus channel direct callback interrupt.
>   * Only used when it is running on Hyper-V.
> + *
> + * Note that this file is not compiled directly, it is included into
> + * i386/exception.s.
>   */
>   .text
>   SUPERALIGN_TEXT
> @@ -45,6 +48,7 @@ IDTVEC(vmbus_isr)
>   cld
>   KENTER
>   pushl   %esp
> - callvmbus_handle_intr
> + mov $vmbus_handle_intr, %eax
> + call*%eax
>   add $4, %esp
>   jmp doreti
> diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
> index 1b4d853fe1d4..288968d84af1 100644
> --- a/sys/i386/conf/GENERIC
> +++ b/sys/i386/conf/GENERIC
> @@ -339,7 +339,9 @@ devicevirtio_scsi # VirtIO SCSI 
> device
>  device   virtio_balloon  # VirtIO Memory Balloon device
>
>  # HyperV drivers and enhancement support
> -device   hyperv  # HyperV drivers
> +# NOTE: HYPERV depends on hyperv.  They must be added or removed together.
> +options  HYPERV  # Kernel support for HyperV drivers
> +device   hyperv  # HyperV drivers
>
>  # Xen HVM Guest Optimizations
>  # NOTE: XENHVM depends on xenpci.  They must be added or removed together.
> diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
> index 6989d3e2828a..f47ab92f1987 100644
> --- a/sys/i386/i386/exception.s
> +++ b/sys/i386/i386/exception.s
> @@ 

git: 0230e6cf56eb - stable/13 - rack: honor prior socket buffer lock when doing the upcall

2021-06-09 Thread Richard Scheffenegger
The branch stable/13 has been updated by rscheff:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0230e6cf56eb6be41b075537a4752b898d27cc1d

commit 0230e6cf56eb6be41b075537a4752b898d27cc1d
Author: Richard Scheffenegger 
AuthorDate: 2021-05-21 22:08:56 +
Commit: Richard Scheffenegger 
CommitDate: 2021-06-09 10:51:36 +

rack: honor prior socket buffer lock when doing the upcall

While partially reverting D24237 with D29690, due to introducing some
unintended effects for in-kernel TCP consumers, the preexisting lock
on the socket send buffer was not considered properly.

Found by: markj
MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D30390

(cherry picked from commit 39756885633fd9d9649b4cb0f0abf594bfeb8dbb)
---
 sys/netinet/tcp_stacks/rack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 9203eb8e252d..bd17749bbd0e 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -10643,7 +10643,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct 
socket *so,
rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una);
/* Wake up the socket if we have room to write more */
rack_log_wakeup(tp,rack, &so->so_snd, acked, 2);
-   sowwakeup(so);
+   sowwakeup_locked(so);
m_freem(mfree);
tp->t_rxtshift = 0;
RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp),
@@ -13172,7 +13172,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, 
struct socket *so, struct mb
rack_adjust_sendmap(rack, &so->so_snd, tp->snd_una);
/* Wake up the socket if we have room to write more */
rack_log_wakeup(tp,rack, &so->so_snd, acked, 2);
-   sowwakeup(so);
+   sowwakeup_locked(so);
m_freem(mfree);
}
/* update progress */
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 55cc0a478506 - stable/13 - [tcp] Keep socket buffer locked until upcall

2021-06-09 Thread Richard Scheffenegger
The branch stable/13 has been updated by rscheff:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=55cc0a478506ee1c2db7b2f9aadb9855e5490af3

commit 55cc0a478506ee1c2db7b2f9aadb9855e5490af3
Author: Richard Scheffenegger 
AuthorDate: 2021-05-21 09:00:53 +
Commit: Richard Scheffenegger 
CommitDate: 2021-06-09 10:51:19 +

[tcp] Keep socket buffer locked until upcall

r367492 would unlock the socket buffer before eventually calling the upcall.
This leads to problematic interaction with NFS kernel server/client 
components
(MP threads) accessing the socket buffer with potentially not correctly 
updated
state.

Reported by: rmacklem
Reviewed By: tuexen, #transport
Tested by: rmacklem, otis
MFC after: 2 weeks
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29690

(cherry picked from commit 032bf749fd44ac5ff20aab2c3d8e3c05491778ea)
---
 sys/netinet/tcp_input.c  | 38 ++--
 sys/netinet/tcp_reass.c  |  2 --
 sys/netinet/tcp_stacks/bbr.c | 20 -
 sys/netinet/tcp_stacks/rack.c| 20 -
 sys/netinet/tcp_stacks/rack_bbr_common.c |  1 -
 sys/netinet/tcp_var.h|  2 +-
 6 files changed, 37 insertions(+), 46 deletions(-)

diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 5e25b38c45e2..19232218170b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1505,18 +1505,17 @@ tcp_handle_wakeup(struct tcpcb *tp, struct socket *so)
 * the TIME_WAIT state before coming here, we need
 * to check if the socket is still connected.
 */
-   if ((so->so_state & SS_ISCONNECTED) == 0)
+   if (tp == NULL) {
return;
+   }
+   if (so == NULL) {
+   return;
+   }
INP_LOCK_ASSERT(tp->t_inpcb);
if (tp->t_flags & TF_WAKESOR) {
tp->t_flags &= ~TF_WAKESOR;
-   SOCKBUF_UNLOCK_ASSERT(&so->so_rcv);
-   sorwakeup(so);
-   }
-   if (tp->t_flags & TF_WAKESOW) {
-   tp->t_flags &= ~TF_WAKESOW;
-   SOCKBUF_UNLOCK_ASSERT(&so->so_snd);
-   sowwakeup(so);
+   SOCKBUF_LOCK_ASSERT(&so->so_rcv);
+   sorwakeup_locked(so);
}
 }
 
@@ -1894,7 +1893,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct 
socket *so,
else if (!tcp_timer_active(tp, TT_PERSIST))
tcp_timer_activate(tp, TT_REXMT,
  tp->t_rxtcur);
-   tp->t_flags |= TF_WAKESOW;
+   sowwakeup(so);
if (sbavail(&so->so_snd))
(void) tp->t_fb->tfb_tcp_output(tp);
goto check_delack;
@@ -1959,8 +1958,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct 
socket *so,
m_adj(m, drop_hdrlen);  /* delayed header drop 
*/
sbappendstream_locked(&so->so_rcv, m, 0);
}
-   SOCKBUF_UNLOCK(&so->so_rcv);
-   tp->t_flags |= TF_WAKESOR;
+   /* NB: sorwakeup_locked() does an implicit unlock. */
+   sorwakeup_locked(so);
if (DELAY_ACK(tp, tlen)) {
tp->t_flags |= TF_DELACK;
} else {
@@ -2498,9 +2497,11 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct 
socket *so,
 * If segment contains data or ACK, will call tcp_reass()
 * later; if not, do so now to pass queued data to user.
 */
-   if (tlen == 0 && (thflags & TH_FIN) == 0)
+   if (tlen == 0 && (thflags & TH_FIN) == 0) {
(void) tcp_reass(tp, (struct tcphdr *)0, NULL, 0,
(struct mbuf *)0);
+   tcp_handle_wakeup(tp, so);
+   }
tp->snd_wl1 = th->th_seq - 1;
/* FALLTHROUGH */
 
@@ -2952,8 +2953,8 @@ process_ACK:
tp->snd_wnd = 0;
ourfinisacked = 0;
}
-   SOCKBUF_UNLOCK(&so->so_snd);
-   tp->t_flags |= TF_WAKESOW;
+   /* NB: sowwakeup_locked() does an implicit unlock. */
+   sowwakeup_locked(so);
m_freem(mfree);
/* Detect una wraparound. */
if (!IN_RECOVERY(tp->t_flags) &&
@@ -3174,7 +3175,6 @@ dodata:   
/* XXX */
m_freem(m);
else
sbappendstream_locked(&so->so_rcv, m, 0);
-  

git: 71b88ee39fc6 - stable/13 - tcp: fix a RACK socket buffer lock issue

2021-06-09 Thread Richard Scheffenegger
The branch stable/13 has been updated by rscheff:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=71b88ee39fc6427b6353e9210710a947a27f383f

commit 71b88ee39fc6427b6353e9210710a947a27f383f
Author: Michael Tuexen 
AuthorDate: 2021-05-24 18:31:23 +
Commit: Richard Scheffenegger 
CommitDate: 2021-06-09 10:51:50 +

tcp: fix a RACK socket buffer lock issue

Fix a missing socket buffer unlocking of the socket receive buffer.

Reviewed by:gallatin, rrs
MFC after:  1 week
Sponsored by:   Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D30402

(cherry picked from commit 9bbd1a8fcb13928cd4b6cfddf0a8359d5dc97451)
---
 sys/netinet/tcp_stacks/rack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index bd17749bbd0e..f010c958951c 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -6063,7 +6063,7 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap 
*nrsm,
/* Push bit must go to the right edge as well */
if (rsm->r_flags & RACK_HAD_PUSH)
rsm->r_flags &= ~RACK_HAD_PUSH;
-   
+
/*
 * Now we need to find nrsm's new location in the mbuf chain
 * we basically calculate a new offset, which is soff +
@@ -10492,6 +10492,7 @@ rack_do_fastnewdata(struct mbuf *m, struct tcphdr *th, 
struct socket *so,
rack_handle_delayed_ack(tp, rack, tlen, 0);
if (tp->snd_una == tp->snd_max)
sack_filter_clear(&rack->r_ctl.rack_sf, tp->snd_una);
+   tcp_handle_wakeup(tp, so);
return (1);
 }
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: a664ade93972 - main - tests/netgraph: Fix style

2021-06-09 Thread Lutz Donnerhacke
The branch main has been updated by donner:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a664ade93972ce617f0888ff79e715dff9cf0f87

commit a664ade93972ce617f0888ff79e715dff9cf0f87
Author: Lutz Donnerhacke 
AuthorDate: 2021-06-08 08:46:18 +
Commit: Lutz Donnerhacke 
CommitDate: 2021-06-09 11:31:16 +

tests/netgraph: Fix style

Indent all files correctly

MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D30692
---
 tests/sys/netgraph/basic.c |  28 -
 tests/sys/netgraph/util.c  | 100 -
 tests/sys/netgraph/util.h  |  58 +++---
 3 files changed, 105 insertions(+), 81 deletions(-)

diff --git a/tests/sys/netgraph/basic.c b/tests/sys/netgraph/basic.c
index 6f2e085e4a83..614208ba42a8 100644
--- a/tests/sys/netgraph/basic.c
+++ b/tests/sys/netgraph/basic.c
@@ -1,4 +1,4 @@
-/*
+/*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright 2021 Lutz Donnerhacke
@@ -37,17 +37,18 @@
 
 #include "util.h"
 
-static void get_data(void *data, size_t len, void *ctx);
+static voidget_data(void *data, size_t len, void *ctx);
 
 ATF_TC(send_recv);
 ATF_TC_HEAD(send_recv, conf)
 {
atf_tc_set_md_var(conf, "require.user", "root");
 }
+
 ATF_TC_BODY(send_recv, dummy)
 {
-   char msg[] = "test";
-   int received;
+   charmsg[] = "test";
+   int received;
 
ng_init();
ng_connect(".", "a", ".", "b");
@@ -64,10 +65,11 @@ ATF_TC_HEAD(node, conf)
 {
atf_tc_set_md_var(conf, "require.user", "root");
 }
+
 ATF_TC_BODY(node, dummy)
 {
-   char msg[] = "test";
-   int received;
+   charmsg[] = "test";
+   int received;
 
ng_init();
ng_mkpeer(".", "a", "hub", "a");
@@ -99,6 +101,7 @@ ATF_TC_HEAD(message, conf)
 {
atf_tc_set_md_var(conf, "require.user", "root");
 }
+
 ATF_TC_BODY(message, dummy)
 {
ng_init();
@@ -116,6 +119,7 @@ ATF_TC_HEAD(same_name, conf)
 {
atf_tc_set_md_var(conf, "require.user", "root");
 }
+
 ATF_TC_BODY(same_name, dummy)
 {
ng_init();
@@ -139,18 +143,20 @@ ATF_TC_HEAD(queuelimit, conf)
 {
atf_tc_set_md_var(conf, "require.user", "root");
 }
+
 ATF_TC_BODY(queuelimit, dummy)
 {
-   int received, i;
-   char msg[] = "test";
-   const int MAX = 1000;
+   int received, i;
+   charmsg[] = "test";
+   const int   MAX = 1000;
 
ng_init();
ng_connect(".", "a", ".", "b");
ng_register_data("b", get_data);
 
ng_errors(PASS);
-   for (i = 0; i < MAX; i++) {
+   for (i = 0; i < MAX; i++)
+   {
ng_send_data("a", msg, sizeof(msg));
if (errno != 0)
break;
@@ -183,7 +189,7 @@ ATF_TP_ADD_TCS(basic)
 static void
 get_data(void *data, size_t len, void *ctx)
 {
-   int *cnt = ctx;
+   int*cnt = ctx;
 
(void)data;
printf("Got %zu bytes of data.\n", len);
diff --git a/tests/sys/netgraph/util.c b/tests/sys/netgraph/util.c
index dbf62599aa04..307bacfa8cc6 100644
--- a/tests/sys/netgraph/util.c
+++ b/tests/sys/netgraph/util.c
@@ -1,4 +1,4 @@
-/*
+/*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright 2021 Lutz Donnerhacke
@@ -42,7 +42,7 @@
 #include "util.h"
 
 
-static int cs = -1, ds = -1;
+static int cs = -1, ds = -1;
 static ng_error_t error_handling = FAIL;
 
 #define CHECK(r, x)do {\
@@ -54,16 +54,17 @@ static ng_error_t error_handling = FAIL;
}   \
 } while(0)
 
-struct data_handler {
-   char const *hook;
+struct data_handler
+{
+   char const *hook;
ng_data_handler_t handler;
-   SLIST_ENTRY(data_handler) next;
+   SLIST_ENTRY(data_handler) next;
 };
 static SLIST_HEAD(, data_handler) data_head = 
SLIST_HEAD_INITIALIZER(data_head);
 static ng_msg_handler_t msg_handler = NULL;
 
-static void handle_data(void *ctx);
-static void handle_msg(void *ctx);
+static voidhandle_data(void *ctx);
+static voidhandle_msg(void *ctx);
 
 void
 _ng_connect(char const *path1, char const *hook1,
@@ -72,29 +73,29 @@ _ng_connect(char const *path1, char const *hook1,
 {
struct ngm_connect c;
 
-   strncpy(c.ourhook,  hook1, sizeof(c.ourhook));
+   strncpy(c.ourhook, hook1, sizeof(c.ourhook));
strncpy(c.peerhook, hook2, sizeof(c.peerhook));
-   strncpy(c.path, path2, sizeof(c.path));
+   strncpy(c.path, path2, sizeof(c.path));
 
CHECK(, -1 != NgSendMsg(cs, path1,
-   NGM_GENERIC_COOKIE, NGM_CONNECT,
-   &c, sizeof(c)));
+   NGM_GENERIC_COOKIE, NGM_CONNECT,
+   &c, sizeof(c)));
 }
 
 void
 _ng_mkpeer(char const *path1, char const *hook1,
-  char const *type,  char const *hook2,
+  char const *type, char cons

git: 5554abd9cc97 - main - tests/netgraph: Factor out univeral data counter functions

2021-06-09 Thread Lutz Donnerhacke
The branch main has been updated by donner:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5554abd9cc9702af30af90925b33c5efff4e7d88

commit 5554abd9cc9702af30af90925b33c5efff4e7d88
Author: Lutz Donnerhacke 
AuthorDate: 2021-06-08 19:45:20 +
Commit: Lutz Donnerhacke 
CommitDate: 2021-06-09 11:32:22 +

tests/netgraph: Factor out univeral data counter functions

Factor out the data counter helpers for other tests to use.

Reviewed by:kp
MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D30699
---
 tests/sys/netgraph/bridge.c | 104 +---
 tests/sys/netgraph/util.c   |  20 +
 tests/sys/netgraph/util.h   |  17 
 3 files changed, 78 insertions(+), 63 deletions(-)

diff --git a/tests/sys/netgraph/bridge.c b/tests/sys/netgraph/bridge.c
index 41d2346b527b..3e3c0f804278 100644
--- a/tests/sys/netgraph/bridge.c
+++ b/tests/sys/netgraph/bridge.c
@@ -43,11 +43,6 @@
 #include "util.h"
 #include 
 
-static voidget_data0(void *data, size_t len, void *ctx);
-static voidget_data1(void *data, size_t len, void *ctx);
-static voidget_data2(void *data, size_t len, void *ctx);
-static voidget_data3(void *data, size_t len, void *ctx);
-
 static voidget_tablesize(char const *source, struct ng_mesg *msg, void 
*ctx);
 struct gettable
 {
@@ -90,7 +85,7 @@ ATF_TC_HEAD(basic, conf)
 
 ATF_TC_BODY(basic, dummy)
 {
-   int r[4];
+   ng_counter_tr;
struct gettable rm;
 
ng_init();
@@ -105,7 +100,7 @@ ATF_TC_BODY(basic, dummy)
 
/* do not bounce back */
ng_register_data("a", get_data0);
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
ng_send_data("a", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
@@ -114,26 +109,26 @@ ATF_TC_BODY(basic, dummy)
/* send to others */
ng_register_data("b", get_data1);
ng_register_data("c", get_data2);
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
ng_send_data("a", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
ATF_CHECK(r[0] == 0 && r[1] == 1 && r[2] == 1);
 
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 2;
ng_send_data("b", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
ATF_CHECK(r[0] == 1 && r[1] == 0 && r[2] == 1);
 
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 3;
ng_send_data("c", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
ATF_CHECK(r[0] == 1 && r[1] == 1 && r[2] == 0);
 
/* send to learned unicast */
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
msg4.eh.ether_dhost[5] = 3;
ng_send_data("a", &msg4, sizeof(msg4));
@@ -149,7 +144,7 @@ ATF_TC_BODY(basic, dummy)
 
/* remove a link */
ng_rmhook(".", "b");
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
msg4.eh.ether_dhost[5] = 0;
ng_send_data("a", &msg4, sizeof(msg4));
@@ -196,7 +191,8 @@ ATF_TC_HEAD(loop, conf)
 
 ATF_TC_BODY(loop, dummy)
 {
-   int r[4], i;
+   ng_counter_tr;
+   int i;
 
ng_init();
ng_errors(PASS);
@@ -221,7 +217,7 @@ ATF_TC_BODY(loop, dummy)
 */
ng_connect("bridge1:", "link11", "bridge2:", "link11");
 
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
ng_send_data("a", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
@@ -236,7 +232,7 @@ ATF_TC_BODY(loop, dummy)
 */
ng_connect("bridge1:", "link12", "bridge2:", "link12");
 
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[5] = 1;
ng_errors(PASS);
ng_send_data("a", &msg4, sizeof(msg4));
@@ -259,7 +255,8 @@ ATF_TC_HEAD(many_unicasts, conf)
 
 ATF_TC_BODY(many_unicasts, dummy)
 {
-   int r[4], i;
+   ng_counter_tr;
+   int i;
const int   HOOKS = 1000;
struct gettable rm;
 
@@ -273,7 +270,7 @@ ATF_TC_BODY(many_unicasts, dummy)
ng_register_data("a", get_data0);
 
/* learn MAC */
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
msg4.eh.ether_shost[3] = 0xff;
ng_send_data("a", &msg4, sizeof(msg4));
ng_handle_events(50, &r);
@@ -284,7 +281,7 @@ ATF_TC_BODY(many_unicasts, dummy)
msg4.eh.ether_dhost[3] = 0xff;
 
/* now send */
-   bzero(r, sizeof(r));
+   ng_counter_clear(r);
for (i = 1; i <= HOOKS; i++)
{
charhook[20];
@@ -330,7 +327,8 @@ ATF_TC_HEAD(many_broadcasts, conf)
 
 ATF_TC_BODY(many_broadcasts, dummy)
 {
-   int r[4], i;
+   ng_counter_tr;
+   int 

git: 7863faa78ae2 - main - tests/netgraph: Tests for ng_hub

2021-06-09 Thread Lutz Donnerhacke
The branch main has been updated by donner:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7863faa78ae271017c404c635b2a9d07379d4316

commit 7863faa78ae271017c404c635b2a9d07379d4316
Author: Lutz Donnerhacke 
AuthorDate: 2021-06-03 22:22:29 +
Commit: Lutz Donnerhacke 
CommitDate: 2021-06-09 11:36:23 +

tests/netgraph: Tests for ng_hub

Test functionality of ng_hub(4):
 - replicting traffic to anything but the sending hook
 - persistence
 - an unrestricted loop
 - implementation limits with many hooks.

Reviewed by:kp
MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D30633
---
 tests/sys/netgraph/Makefile |   2 +
 tests/sys/netgraph/hub.c| 231 
 2 files changed, 233 insertions(+)

diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile
index 7376cb5c1227..2ae9882b2bc3 100644
--- a/tests/sys/netgraph/Makefile
+++ b/tests/sys/netgraph/Makefile
@@ -12,9 +12,11 @@ TEST_METADATA.ng_macfilter_test+=required_programs="perl"
 
 ATF_TESTS_C+=  basic   \
bridge  \
+   hub \
 
 SRCS.basic=basic.c util.c
 SRCS.bridge=   bridge.c util.c
+SRCS.hub=  hub.c util.c
 
 LIBADD+=   netgraph
 
diff --git a/tests/sys/netgraph/hub.c b/tests/sys/netgraph/hub.c
new file mode 100644
index ..08d083ad9605
--- /dev/null
+++ b/tests/sys/netgraph/hub.c
@@ -0,0 +1,231 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright 2021 Lutz Donnerhacke
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials provided
+ *with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include 
+#include 
+#include 
+
+#include "util.h"
+
+ATF_TC(basic);
+ATF_TC_HEAD(basic, conf)
+{
+   atf_tc_set_md_var(conf, "require.user", "root");
+}
+
+ATF_TC_BODY(basic, dummy)
+{
+   charmsg[] = "test";
+   ng_counter_tr;
+
+   ng_errors(PASS);
+   ng_shutdown("hub:");
+   ng_errors(FAIL);
+
+   ng_init();
+   ng_mkpeer(".", "a", "hub", "a");
+   ng_name("a", "hub");
+   ng_connect(".", "b", "hub:", "b");
+   ng_connect(".", "c", "hub:", "c");
+
+   /* do not bounce back */
+   ng_register_data("a", get_data0);
+   ng_counter_clear(r);
+   ng_send_data("a", msg, sizeof(msg));
+   ng_handle_events(50, r);
+   ATF_CHECK(r[0] == 0);
+
+   /* send to others */
+   ng_register_data("b", get_data0);
+   ng_register_data("c", get_data0);
+   ng_counter_clear(r);
+   ng_send_data("a", msg, sizeof(msg));
+   ng_handle_events(50, r);
+   ATF_CHECK(r[0] == 2);
+
+   ng_counter_clear(r);
+   ng_send_data("b", msg, sizeof(msg));
+   ng_handle_events(50, r);
+   ATF_CHECK(r[0] == 2);
+
+   ng_counter_clear(r);
+   ng_send_data("c", msg, sizeof(msg));
+   ng_handle_events(50, r);
+   ATF_CHECK(r[0] == 2);
+
+   /* remove a link */
+   ng_rmhook(".", "b");
+   ng_counter_clear(r);
+   ng_send_data("a", msg, sizeof(msg));
+   ng_handle_events(50, r);
+   ATF_CHECK(r[0] == 1);
+
+   ng_shutdown("hub:");
+}
+
+ATF_TC(persistence);
+ATF_TC_HEAD(persistence, conf)
+{
+   atf_tc_set_md_var(conf, "require.user", "root");
+}
+
+ATF_TC_BODY(persistence, dummy)
+{
+   ng_errors(PASS);
+   ng_shutdown("hub:");
+   ng_errors(FAIL);
+
+   ng_init();
+   ng_mkpeer(".", "a", "hub", "a");
+   ng_name("a", "hub");
+
+   ng_send_msg("hub:", "setpersistent");
+   ng_rmhook

git: 6b08e68be111 - main - tests/netgraph: Tests for ng_vlan_rotate

2021-06-09 Thread Lutz Donnerhacke
The branch main has been updated by donner:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6b08e68be111d50931b0d30145f8b7e3402decaf

commit 6b08e68be111d50931b0d30145f8b7e3402decaf
Author: Lutz Donnerhacke 
AuthorDate: 2021-06-06 23:56:12 +
Commit: Lutz Donnerhacke 
CommitDate: 2021-06-09 11:45:37 +

tests/netgraph: Tests for ng_vlan_rotate

Test functionality of ng_vlan_rotate(4):
 - Rotate 1 to 9 stagged vlans in any possible direction and length
 - Rotate random combinations of ethertypes (8100, 88a8, 9100)
 - Automatic reverse rotating for backward data flow
 - Test too many and to few vlans

Reviewed by:kp (earlier version)
MFC after:  1 week
Differential Revision: https://reviews.freebsd.org/D30670
---
 tests/sys/netgraph/Makefile  |   8 +-
 tests/sys/netgraph/vlan_rotate.c | 335 +++
 2 files changed, 340 insertions(+), 3 deletions(-)

diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile
index 2ae9882b2bc3..f397e66a22bc 100644
--- a/tests/sys/netgraph/Makefile
+++ b/tests/sys/netgraph/Makefile
@@ -10,13 +10,15 @@ TAP_TESTS_SH+=  ng_macfilter_test
 TEST_METADATA.ng_macfilter_test+=  required_user="root"
 TEST_METADATA.ng_macfilter_test+=  required_programs="perl"
 
-ATF_TESTS_C+=  basic   \
-   bridge  \
-   hub \
+ATF_TESTS_C+=  basic   \
+   bridge  \
+   hub \
+   vlan_rotate \
 
 SRCS.basic=basic.c util.c
 SRCS.bridge=   bridge.c util.c
 SRCS.hub=  hub.c util.c
+SRCS.vlan_rotate=vlan_rotate.c util.c
 
 LIBADD+=   netgraph
 
diff --git a/tests/sys/netgraph/vlan_rotate.c b/tests/sys/netgraph/vlan_rotate.c
new file mode 100644
index ..8df3ab981a7c
--- /dev/null
+++ b/tests/sys/netgraph/vlan_rotate.c
@@ -0,0 +1,335 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright 2021 Lutz Donnerhacke
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials provided
+ *with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "util.h"
+#include 
+
+struct vlan
+{
+   uint16_tproto;
+   uint16_ttag;
+}  __packed;
+
+struct frame
+{
+   u_char  dst[ETHER_ADDR_LEN];
+   u_char  src[ETHER_ADDR_LEN];
+   struct vlan vlan[10];
+}  __packed;
+
+static struct frame msg = {
+   .src = {2, 4, 6, 1, 3, 5},
+   .dst = {2, 4, 6, 1, 3, 7},
+   .vlan[0] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(1, 0, 0))},
+   .vlan[1] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(2, 0, 0))},
+   .vlan[2] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(3, 0, 0))},
+   .vlan[3] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(4, 0, 0))},
+   .vlan[4] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(5, 0, 0))},
+   .vlan[5] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(6, 0, 0))},
+   .vlan[6] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(7, 0, 0))},
+   .vlan[7] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(8, 0, 0))},
+   .vlan[8] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(9, 0, 0))},
+   .vlan[9] = {0}
+};
+
+static void_basic(int);
+static voidget_vlan(void *data, size_t len, void *ctx);
+
+static void
+get_vlan(void *data, size_t len, void *ctx)
+{
+   int*v = ctx, i;
+   struct frame   *f = data;
+
+   (void)len;
+   for (i = 0; i < 10; i++)
+  

git: 334335cb14d4 - main - i386: Add "options HYPERV" to NOTES

2021-06-09 Thread Mark Johnston
The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=334335cb14d4754d45265d19cd3c6e7708cca0c1

commit 334335cb14d4754d45265d19cd3c6e7708cca0c1
Author: Mark Johnston 
AuthorDate: 2021-06-09 12:58:45 +
Commit: Mark Johnston 
CommitDate: 2021-06-09 13:01:22 +

i386: Add "options HYPERV" to NOTES

This unbreaks the LINT build.

Fixes:  97993d1ebf
Reported by:mjg
MFC after:  13 days
---
 sys/i386/conf/NOTES | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 81d2140ebfa5..e02426df2df2 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -719,7 +719,8 @@ device  virtio_balloon  # VirtIO Memory Balloon 
device
 device virtio_random   # VirtIO Entropy device
 device virtio_console  # VirtIO Console device
 
-device hyperv  # HyperV drivers
+optionsHYPERV
+device hyperv  # HyperV drivers
 
 #
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4

2021-06-09 Thread Cy Schubert
In message <20210609090415.507c477968bce2efce9e9...@bidouilliste.com>, 
Emmanuel
 Vadot writes:
> On Thu, 3 Jun 2021 16:38:16 GMT
> Cy Schubert  wrote:
>
> > The branch vendor/wpa has been updated by cy:
> > 
> > URL: https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12
> 372b2d3f9a
> > 
> > commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a
> > Author: Cy Schubert 
> > AuthorDate: 2021-06-03 16:15:01 +
> > Commit: Cy Schubert 
> > CommitDate: 2021-06-03 16:15:01 +
> > 
> > wpa: Import wpa_supplicant/hostapd commit e8662e9d4
> > 
> > This is the June update to vendor/wpa committed upstream 2021/06/03.
>
>  Hi cy@
>
>  Don't know if it is this commit or something else yet but I'm seeing
> weird behavior from a recent head.
>  wpa_supplicant abort with SIGBUS just after connecting to my wireless
> network. I'm still connected but this stopped working after a while (I
> guess when the supplicant would need to do some stuff with the AP or
> something).
>  From dmesg just after running service netif restart:
> lo0: link state changed to DOWN
> wlan0: link state changed to DOWN
> wlan0: Ethernet address: bc:54:2f:4b:d1:dd
> lo0: link state changed to UP
> wlan0: link state changed to UP
> pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core
> dumped)
>
> Reading symbols from /usr/sbin/wpa_supplicant...
> Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug...
> [New LWP 112604]
> Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_su
> pplicant.conf -D bsd -P /v'.
> Program terminated with signal SIGBUS, Bus error.
> #0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l
> ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
> 304 /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wp
> a_i.h: No such file or directory.
> (gdb) bt
> #0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at /usr/l
> ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
> #1  wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, ver=<
> optimized out>, key_data=, key_data_len=)
> at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa
> .c:1572
> #2  wpa_sm_rx_eapol (sm=, src_addr=, buf= ized out>, len=)
> at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa
> .c:2434
> #3  0x010e372e in l2_packet_receive (sock=, eloop_ctx=
> 0x801e286e0, sock_ctx=)
> at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2
> _packet_freebsd.c:98
> #4  0x01112b23 in eloop_sock_table_dispatch (table=, f
> ds=0x801e44080) at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/
> utils/eloop.c:600
> #5  eloop_run () at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src
> /utils/eloop.c:1223
> #6  0x010af228 in wpa_supplicant_run (global=, global@
> entry=0x801e2d000)
> at /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/w
> pa_supplicant.c:6526
> #7  0x0109ab6c in main (argc=, argv=) a
> t /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c
> :397
>
>  I'll try to revert the update later this week but if you have any idea in th
> e mean time.

Hi Emmanuel,

The commit you quote was only to the vendor branch which has not landed in 
main yet. However the SIGBUS you have been experiencing, a SIBGUS at line 
304 of wpa_i.h, caused by 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 and 
fixed by the following commit:

commit 9a0f82285322a338548d13fcda07e1d574301190
Author: Cy Schubert 
Date:   Wed Jun 2 12:46:02 2021 -0700

wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload

Incorrectly linked built-in wpa functions resulted in overwriting
sm->ctx->set_rekey_offload with garbage. It was initialized correctly
however it changed after wpa_supplicant became a daemon.

No SIGBUS violations reported by dhw@ were experienced during testing
of the original commit by msyelf or philip@.

Reported by:dhw
Tested by:  dhw
MFC after:  2 months
X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3

If you already have 9a0f82285322a338548d13fcda07e1d574301190 applied and do 
-DWITHOUT_CLEAN builds and still have the SIGBUS, rm -r 
/usr/obj/${ARCH}/usr.sbin/wpa will remove incorrectly built .a files and 
rebuild. They will rebuild correctly and the SIBGUS will resolve.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.


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


Re: git: 40c7ff83e74e - vendor/wpa - wpa: Import wpa_supplicant/hostapd commit e8662e9d4

2021-06-09 Thread Emmanuel Vadot
On Wed, 09 Jun 2021 06:17:09 -0700
Cy Schubert  wrote:

> In message <20210609090415.507c477968bce2efce9e9...@bidouilliste.com>, 
> Emmanuel
>  Vadot writes:
> > On Thu, 3 Jun 2021 16:38:16 GMT
> > Cy Schubert  wrote:
> >
> > > The branch vendor/wpa has been updated by cy:
> > > 
> > > URL: 
> > > https://cgit.FreeBSD.org/src/commit/?id=40c7ff83e74eabba5a7e2caefeea12
> > 372b2d3f9a
> > > 
> > > commit 40c7ff83e74eabba5a7e2caefeea12372b2d3f9a
> > > Author: Cy Schubert 
> > > AuthorDate: 2021-06-03 16:15:01 +
> > > Commit: Cy Schubert 
> > > CommitDate: 2021-06-03 16:15:01 +
> > > 
> > > wpa: Import wpa_supplicant/hostapd commit e8662e9d4
> > > 
> > > This is the June update to vendor/wpa committed upstream 2021/06/03.
> >
> >  Hi cy@
> >
> >  Don't know if it is this commit or something else yet but I'm seeing
> > weird behavior from a recent head.
> >  wpa_supplicant abort with SIGBUS just after connecting to my wireless
> > network. I'm still connected but this stopped working after a while (I
> > guess when the supplicant would need to do some stuff with the AP or
> > something).
> >  From dmesg just after running service netif restart:
> > lo0: link state changed to DOWN
> > wlan0: link state changed to DOWN
> > wlan0: Ethernet address: bc:54:2f:4b:d1:dd
> > lo0: link state changed to UP
> > wlan0: link state changed to UP
> > pid 69593 (wpa_supplicant), jid 0, uid 0: exited on signal 10 (core
> > dumped)
> >
> > Reading symbols from /usr/sbin/wpa_supplicant...
> > Reading symbols from /usr/lib/debug//usr/sbin/wpa_supplicant.debug...
> > [New LWP 112604]
> > Core was generated by `/usr/sbin/wpa_supplicant -s -B -i wlan0 -c 
> > /etc/wpa_su
> > pplicant.conf -D bsd -P /v'.
> > Program terminated with signal SIGBUS, Bus error.
> > #0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at 
> > /usr/l
> > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
> > 304 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wp
> > a_i.h: No such file or directory.
> > (gdb) bt
> > #0  0x010eaf7f in wpa_sm_set_rekey_offload (sm=0x801e12700) at 
> > /usr/l
> > ocal/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa_i.h:304
> > #1  wpa_supplicant_process_3_of_4 (sm=0x801e12700, key=, 
> > ver=<
> > optimized out>, key_data=, key_data_len=)
> > at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa
> > .c:1572
> > #2  wpa_sm_rx_eapol (sm=, src_addr=, 
> > buf= > ized out>, len=)
> > at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/rsn_supp/wpa
> > .c:2434
> > #3  0x010e372e in l2_packet_receive (sock=, 
> > eloop_ctx=
> > 0x801e286e0, sock_ctx=)
> > at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/l2_packet/l2
> > _packet_freebsd.c:98
> > #4  0x01112b23 in eloop_sock_table_dispatch (table=, 
> > f
> > ds=0x801e44080) at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src/
> > utils/eloop.c:600
> > #5  eloop_run () at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/src
> > /utils/eloop.c:1223
> > #6  0x010af228 in wpa_supplicant_run (global=, 
> > global@
> > entry=0x801e2d000)
> > at 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/w
> > pa_supplicant.c:6526
> > #7  0x0109ab6c in main (argc=, argv=) 
> > a
> > t 
> > /usr/local/poudriere/jails/wipbsd/usr/src/contrib/wpa/wpa_supplicant/main.c
> > :397
> >
> >  I'll try to revert the update later this week but if you have any idea in 
> > th
> > e mean time.
> 
> Hi Emmanuel,
> 
> The commit you quote was only to the vendor branch which has not landed in 
> main yet. However the SIGBUS you have been experiencing, a SIBGUS at line 
> 304 of wpa_i.h, caused by 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 and 
> fixed by the following commit:
> 
> commit 9a0f82285322a338548d13fcda07e1d574301190
> Author: Cy Schubert 
> Date:   Wed Jun 2 12:46:02 2021 -0700
> 
> wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload
> 
> Incorrectly linked built-in wpa functions resulted in overwriting
> sm->ctx->set_rekey_offload with garbage. It was initialized correctly
> however it changed after wpa_supplicant became a daemon.
> 
> No SIGBUS violations reported by dhw@ were experienced during testing
> of the original commit by msyelf or philip@.
> 
> Reported by:dhw
> Tested by:  dhw
> MFC after:  2 months
> X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3
> 
> If you already have 9a0f82285322a338548d13fcda07e1d574301190 applied and do 
> -DWITHOUT_CLEAN builds and still have the SIGBUS, rm -r 
> /usr/obj/${ARCH}/usr.sbin/wpa will remove incorrectly built .a files and 
> rebuild. They will rebuild correctly and the SIBGUS will resolve.
> 
> 
> -- 
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  https://FreeBSD.org
> NTP:   Web:  https://nwtime.org
> 
>  

git: 5e5ca4c8fc53 - main - nfscl: Add a "has acquired a delegation" flag for delegations

2021-06-09 Thread Rick Macklem
The branch main has been updated by rmacklem:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7

commit 5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7
Author: Rick Macklem 
AuthorDate: 2021-06-09 15:00:43 +
Commit: Rick Macklem 
CommitDate: 2021-06-09 15:00:43 +

nfscl: Add a "has acquired a delegation" flag for delegations

A problem was reported via email, where a large (13+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 10+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount.  Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

MFC after:  2 weeks
---
 sys/fs/nfsclient/nfs_clstate.c | 44 +++---
 sys/fs/nfsclient/nfsmount.h|  1 +
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 5e4ac2ae9d4d..0659e77289e9 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -438,20 +438,32 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t 
*nfhp,
 int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp)
 {
struct nfscldeleg *dp = *dpp, *tdp;
+   struct nfsmount *nmp;
 
+   KASSERT(mp != NULL, ("nfscl_deleg: mp NULL"));
+   nmp = VFSTONFS(mp);
/*
 * First, if we have received a Read delegation for a file on a
 * read/write file system, just return it, because they aren't
 * useful, imho.
 */
-   if (mp != NULL && dp != NULL && !NFSMNT_RDONLY(mp) &&
+   if (dp != NULL && !NFSMNT_RDONLY(mp) &&
(dp->nfsdl_flags & NFSCLDL_READ)) {
-   (void) nfscl_trydelegreturn(dp, cred, VFSTONFS(mp), p);
+   nfscl_trydelegreturn(dp, cred, nmp, p);
free(dp, M_NFSCLDELEG);
*dpp = NULL;
return (0);
}
 
+   /*
+* Since a delegation might be added to the mount,
+* set NFSMNTP_DELEGISSUED now.  If a delegation already
+* exagain ists, setting this flag is harmless.
+*/
+   NFSLOCKMNT(nmp);
+   nmp->nm_privflag |= NFSMNTP_DELEGISSUED;
+   NFSUNLOCKMNT(nmp);
+
/* Look for the correct deleg, based upon FH */
NFSLOCKCLSTATE();
tdp = nfscl_finddeleg(clp, nfhp, fhlen);
@@ -3356,12 +3368,20 @@ nfscl_delegreturnvp(vnode_t vp, NFSPROC_T *p)
struct nfscldeleg *dp;
struct ucred *cred;
struct nfsnode *np;
+   struct nfsmount *nmp;
 
+   nmp = VFSTONFS(vp->v_mount);
+   NFSLOCKMNT(nmp);
+   if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {
+   NFSUNLOCKMNT(nmp);
+   return;
+   }
+   NFSUNLOCKMNT(nmp);
np = VTONFS(vp);
cred = newnfs_getcred();
dp = NULL;
NFSLOCKCLSTATE();
-   clp = VFSTONFS(vp->v_mount)->nm_clp;
+   clp = nmp->nm_clp;
if (clp != NULL)
dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh,
np->n_fhp->nfh_len);
@@ -4500,6 +4520,12 @@ nfscl_nodeleg(vnode_t vp, int writedeleg)
nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp))
return (1);
+   NFSLOCKMNT(nmp);
+   if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {
+   NFSUNLOCKMNT(nmp);
+   return (1);
+   }
+   NFSUNLOCKMNT(nmp);
NFSLOCKCLSTATE();
clp = nfscl_findcl(nmp);
if (clp == NULL) {
@@ -4856,6 +4882,12 @@ nfscl_delegmodtime(vnode_t vp)
nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp))
return;
+   NFSLOCKMNT(nmp);
+   if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) {
+   NFSUNLOCKMNT(nmp);
+   return;
+   }
+   NFSUNLOCKMNT(nmp);
NFSLOCKCLSTATE();
clp = nfscl_findcl(nmp);
if (clp == NULL) {
@@ -4885,6 +4917,12 @@ nfscl_deleggetmodtime(vnode_t vp, struct timespec *mtime)
nmp

git: 3045f4aa1a2b - stable/13 - libsa: Fix infinite loop in bzipfs & gzipfs

2021-06-09 Thread David Bright
The branch stable/13 has been updated by dab:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab

commit 3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab
Author: David Bright 
AuthorDate: 2021-05-24 17:12:15 +
Commit: David Bright 
CommitDate: 2021-06-09 16:11:01 +

libsa: Fix infinite loop in bzipfs & gzipfs

A bug in the loader's bzipfs & gzipfs filesystems caused compressed
kernel and modules not to work on EFI systems with a veriexec-enabled
loader. Since the size of files in these filesystems are not known
_a priori_ `stat` would initialize the size to -1 and the loader would
then hang in an infinite loop while trying to seek (read) to the end
of file since the loop termination condition compares the current
offset to that negative target position.

Sponsored by:   Dell EMC Isilon

(cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2)
---
 stand/libsa/bzipfs.c | 3 +++
 stand/libsa/gzipfs.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c
index 47380ae72e5e..bb67bda2aa19 100644
--- a/stand/libsa/bzipfs.c
+++ b/stand/libsa/bzipfs.c
@@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where)
target - bzf->bzf_bzstream.total_out_lo32), NULL);
if (errno)
return(-1);
+   /* Break out of loop if end of file has been reached. */
+   if (bzf->bzf_endseen)
+   break;
 }
 /* This is where we are (be honest if we overshot) */
 return(bzf->bzf_bzstream.total_out_lo32);
diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c
index 39e2f98eb1e0..8154b0f95a9a 100644
--- a/stand/libsa/gzipfs.c
+++ b/stand/libsa/gzipfs.c
@@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where)
target - zf->zf_zstream.total_out), NULL);
if (errno)
return(-1);
+   /* Break out of loop if end of file has been reached. */
+   if (zf->zf_endseen)
+   break;
 }
 /* This is where we are (be honest if we overshot) */
 return(zf->zf_zstream.total_out);
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 80a5d786a3cd - stable/12 - libsa: Fix infinite loop in bzipfs & gzipfs

2021-06-09 Thread David Bright
The branch stable/12 has been updated by dab:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be

commit 80a5d786a3cdee6b6d2dbf6c2d8037a19d2fd9be
Author: David Bright 
AuthorDate: 2021-05-24 17:12:15 +
Commit: David Bright 
CommitDate: 2021-06-09 16:15:33 +

libsa: Fix infinite loop in bzipfs & gzipfs

A bug in the loader's bzipfs & gzipfs filesystems caused compressed
kernel and modules not to work on EFI systems with a veriexec-enabled
loader. Since the size of files in these filesystems are not known
_a priori_ `stat` would initialize the size to -1 and the loader would
then hang in an infinite loop while trying to seek (read) to the end
of file since the loop termination condition compares the current
offset to that negative target position.

Sponsored by:   Dell EMC Isilon

(cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2)
---
 stand/libsa/bzipfs.c | 3 +++
 stand/libsa/gzipfs.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/stand/libsa/bzipfs.c b/stand/libsa/bzipfs.c
index 47380ae72e5e..bb67bda2aa19 100644
--- a/stand/libsa/bzipfs.c
+++ b/stand/libsa/bzipfs.c
@@ -340,6 +340,9 @@ bzf_seek(struct open_file *f, off_t offset, int where)
target - bzf->bzf_bzstream.total_out_lo32), NULL);
if (errno)
return(-1);
+   /* Break out of loop if end of file has been reached. */
+   if (bzf->bzf_endseen)
+   break;
 }
 /* This is where we are (be honest if we overshot) */
 return(bzf->bzf_bzstream.total_out_lo32);
diff --git a/stand/libsa/gzipfs.c b/stand/libsa/gzipfs.c
index 39e2f98eb1e0..8154b0f95a9a 100644
--- a/stand/libsa/gzipfs.c
+++ b/stand/libsa/gzipfs.c
@@ -315,6 +315,9 @@ zf_seek(struct open_file *f, off_t offset, int where)
target - zf->zf_zstream.total_out), NULL);
if (errno)
return(-1);
+   /* Break out of loop if end of file has been reached. */
+   if (zf->zf_endseen)
+   break;
 }
 /* This is where we are (be honest if we overshot) */
 return(zf->zf_zstream.total_out);
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 7f06d6f3fdde - stable/13 - pciconf: Fix up pciconf -lc output

2021-06-09 Thread David Bright
The branch stable/13 has been updated by dab:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a

commit 7f06d6f3fdde93f5f9cf1fde2d0a058f2c6fe01a
Author: David Bright 
AuthorDate: 2021-05-24 19:02:43 +
Commit: David Bright 
CommitDate: 2021-06-09 16:17:58 +

pciconf: Fix up pciconf -lc output

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by:   Dell EMC Isilon
Submitted by:   Robert Herndon (robert.hern...@dell.com)

(cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514)
---
 usr.sbin/pciconf/cap.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index bd7315beb047..eae53acbd250 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -861,8 +861,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t 
ver)
uint32_t sta, mask;
 
printf("AER %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
printf(" %d fatal", bitcount32(sta & mask));
@@ -877,8 +879,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t 
ver)
uint32_t cap1;
 
printf("VC %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4);
printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT);
if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0)
@@ -893,8 +897,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, 
uint8_t ver)
uint32_t high, low;
 
printf("Serial %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4);
high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
printf(" %08x%08x\n", high, low);
@@ -940,8 +946,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, 
uint8_t ver)
uint32_t val;
 
printf("PCIe Sec %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
val = read_config(fd, &p->pc_sel, ptr + 8, 4);
printf(" lane errors %#x\n", val);
 }
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: fe58db828934 - stable/12 - pciconf: Fix up pciconf -lc output

2021-06-09 Thread David Bright
The branch stable/12 has been updated by dab:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fe58db828934c40b5d84a6485573e04f6981f8b6

commit fe58db828934c40b5d84a6485573e04f6981f8b6
Author: David Bright 
AuthorDate: 2021-05-24 19:02:43 +
Commit: David Bright 
CommitDate: 2021-06-09 16:19:10 +

pciconf: Fix up pciconf -lc output

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by:   Dell EMC Isilon
Submitted by:   Robert Herndon (robert.hern...@dell.com)

(cherry picked from commit 2f176a2b20107f7a9132242223e9eef657400514)
---
 usr.sbin/pciconf/cap.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index f990fdca7313..07f4b63bbcd2 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -854,8 +854,10 @@ ecap_aer(int fd, struct pci_conf *p, uint16_t ptr, uint8_t 
ver)
uint32_t sta, mask;
 
printf("AER %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
printf(" %d fatal", bitcount32(sta & mask));
@@ -870,8 +872,10 @@ ecap_vc(int fd, struct pci_conf *p, uint16_t ptr, uint8_t 
ver)
uint32_t cap1;
 
printf("VC %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4);
printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT);
if ((cap1 & PCIM_VC_CAP1_LOWPRI_EXT_COUNT) != 0)
@@ -886,8 +890,10 @@ ecap_sernum(int fd, struct pci_conf *p, uint16_t ptr, 
uint8_t ver)
uint32_t high, low;
 
printf("Serial %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4);
high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
printf(" %08x%08x\n", high, low);
@@ -911,8 +917,10 @@ ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, 
uint8_t ver)
uint32_t val;
 
printf("PCIe Sec %d", ver);
-   if (ver < 1)
+   if (ver < 1) {
+   printf("\n");
return;
+   }
val = read_config(fd, &p->pc_sel, ptr + 8, 4);
printf(" lane errors %#x\n", val);
 }
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


Re: git: 2f176a2b2010 - main - pciconf: Fix up pciconf -lc output

2021-06-09 Thread David Bright
On Jun 1, 2021, at 12:44 PM, John Baldwin  wrote:
> 
> On 6/1/21 8:56 AM, David Bright wrote:
>> The branch main has been updated by dab:
>> URL: 
>> https://cgit.FreeBSD.org/src/commit/?id=2f176a2b20107f7a9132242223e9eef657400514
>> commit 2f176a2b20107f7a9132242223e9eef657400514
>> 
>> pciconf: Fix up pciconf -lc output
>>  The pciconf command fails to emit newlines when particular ecap 
>> field
>> values are seen. Fix them up. This has been seen on several systems at
>> $JOB. The documentation for PCI capabilities says that capability
>> type 0 should not be used once the spec for PCI capabilities was
>> published, but that seems more wishful-thinking than reality. pciconf
>> also chooses not to print fields related to field values that are
>> zero, but it seems several of these fields are zero on actual
>> hardware.
>> 
> 
> Are the ecap registers actually valid for version 1 in this case?  That is,
> should we treat version 0 as being version 1?  The current checks are just
> defensive coding for not parsing something unless we know it is valid.
> If the only version 0 caps in practice are always compatible with version 1
> we could just treat 0 as if it were 1.

I think the answer is “maybe, but we don’t know for sure”. Robert Herndon did 
some looking at this; his findings are paraphrased below:

-

Searching on version fields in PCI caps and ecaps doesn’t produce a lot of 
information. There are references to particular devices indicating that 
‘version’ should be ‘1’, or that it should not be ‘0’, but there’s nothing that 
says so for any generic case, or in the standards I’ve found. The version field 
is only four bits, so it seems a little odd that zero wouldn’t be a 
reasonable-ish value. Internally we have only found two hosts exhibiting this 
issue and both exhibit the same behavior. When the early return on version 0 is 
disabled they show multiple instances of:


 cap 10[40] = PCI-Express 2 root endpoint max data 128(128)
 ecap 000b[100] = Vendor 0 ID 1
none114@pci0:93:15:0:   class=0x110100 card=0x8086 chip=0x20588086 rev=0x07 
hdr=0x00

So they appear to be mainstream vendor (Intel) devices. All instances showed 
‘Vendor 0 ID 1’. In this particular instance, the current FreeBSD code would 
print this much information and a little more before refusing to dump more 
detailed information, printing

printf("Vendor [%d] ID %04x Rev %d Length %d\n", ver,
PCIR_VSEC_ID(hdr), PCIR_VSEC_REV(hdr), len);

before returning. (After the return, it does read more registers out of the 
capability, and prints more detailed information for extra registers as found).

It’s conceivable that reading these registers when a particular field is zero 
could cause it to print erroneous or misleading information, but there is a 
reasonable probability that it would be helpful in real usage. 

-




-- 
David Bright
d...@freebsd.org


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


git: b45daaea95ab - main - tcp: LRO timestamps have lost their previous precision

2021-06-09 Thread Randall Stewart
The branch main has been updated by rrs:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b45daaea95abd8bda52caaacf120f9197caab3e7

commit b45daaea95abd8bda52caaacf120f9197caab3e7
Author: Randall Stewart 
AuthorDate: 2021-06-09 17:58:54 +
Commit: Randall Stewart 
CommitDate: 2021-06-09 17:58:54 +

tcp: LRO timestamps have lost their previous precision

Recently we had a rewrite to tcp_lro.c that was tested but one subtle change
was the move to a less precise timestamp. This causes all kinds of chaos
in tcp's that do pacing and needs to be fixed to use the more precise
time that was there before.

Reviewed by: mtuexen, gallatin, hselasky
Sponsored by: Netflix Inc
Differential Revision:  https://reviews.freebsd.org/D30695
---
 sys/netinet/tcp_lro.c | 23 +--
 sys/netinet/tcp_lro.h |  4 ++--
 sys/sys/time.h| 11 +++
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c
index 09fc024c3d73..ea84ca191eca 100644
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -562,16 +562,18 @@ void
 tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout)
 {
struct lro_entry *le, *le_tmp;
-   sbintime_t sbt;
+   uint64_t now, tov;
+   struct bintime bt;
 
if (LIST_EMPTY(&lc->lro_active))
return;
 
-   /* get timeout time */
-   sbt = getsbinuptime() - tvtosbt(*timeout);
-
+   /* get timeout time and current time in ns */
+   binuptime(&bt);
+   now = bintime2ns(&bt);
+   tov = ((timeout->tv_sec * 10) + (timeout->tv_usec * 1000));
LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) {
-   if (sbt >= le->alloc_time) {
+   if (now >= (bintime2ns(&le->alloc_time) + tov)) {
tcp_lro_active_remove(le);
tcp_lro_flush(lc, le);
}
@@ -610,7 +612,7 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
 {
if (tp->t_logstate != TCP_LOG_STATE_OFF) {
union tcp_log_stackspecific log;
-   struct timeval tv;
+   struct timeval tv, btv;
uint32_t cts;
 
cts = tcp_get_usecs(&tv);
@@ -637,7 +639,8 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
log.u_bbr.cwnd_gain = le->window;
log.u_bbr.cur_del_rate = (uintptr_t)m;
log.u_bbr.bw_inuse = (uintptr_t)le->m_head;
-   log.u_bbr.flex6 = sbttous(lc->lro_last_queue_time);
+   bintime2timeval(&lc->lro_last_queue_time, &btv);
+   log.u_bbr.flex6 = tcp_tv_to_usectick(&btv);
log.u_bbr.flex7 = le->compressed;
log.u_bbr.pacing_gain = le->uncompressed;
if (in_epoch(net_epoch_preempt))
@@ -1446,7 +1449,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc)
CURVNET_SET(lc->ifp->if_vnet);
 
/* get current time */
-   lc->lro_last_queue_time = getsbinuptime();
+   binuptime(&lc->lro_last_queue_time);
 
/* sort all mbufs according to stream */
tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count);
@@ -1739,7 +1742,7 @@ tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, 
uint32_t csum, bool use_h
 #endif
/* If no hardware or arrival stamp on the packet add timestamp */
if ((m->m_flags & (M_TSTMP_LRO | M_TSTMP)) == 0) {
-   m->m_pkthdr.rcv_tstmp = sbttons(lc->lro_last_queue_time);
+   m->m_pkthdr.rcv_tstmp = bintime2ns(&lc->lro_last_queue_time); 
m->m_flags |= M_TSTMP_LRO;
}
 
@@ -1834,7 +1837,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t 
csum)
int error;
 
/* get current time */
-   lc->lro_last_queue_time = getsbinuptime();
+   binuptime(&lc->lro_last_queue_time);
 
CURVNET_SET(lc->ifp->if_vnet);
error = tcp_lro_rx_common(lc, m, csum, true);
diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h
index d2220a626b81..5ff15e2dc97e 100644
--- a/sys/netinet/tcp_lro.h
+++ b/sys/netinet/tcp_lro.h
@@ -140,7 +140,7 @@ struct lro_entry {
uint16_tuncompressed;
uint16_twindow;
uint16_ttimestamp;  /* flag, not a TCP hdr field. */
-   sbintime_t  alloc_time; /* time when entry was 
allocated */
+   struct bintime  alloc_time; /* time when entry was 
allocated */
 };
 
 LIST_HEAD(lro_head, lro_entry);
@@ -154,7 +154,7 @@ struct lro_mbuf_sort {
 struct lro_ctrl {
struct ifnet*ifp;
struct lro_mbuf_sort *lro_mbuf_data;
-   sbintime_t  lro_last_queue_time;/* last time data was queued */
+   struct bintime  lro_last_queue_time;/* last time data was queued */
uint64_tlro_queued;
uint64_tlro_flushed;
uint64_tlro_bad_csum;
diff 

git: 5452cb6bf9f0 - stable/13 - etcupdate: Always extract to a temporary tree.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5452cb6bf9f07cdc479c24e880a3628fcb3dda49

commit 5452cb6bf9f07cdc479c24e880a3628fcb3dda49
Author: John Baldwin 
AuthorDate: 2021-04-20 20:21:42 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:38 +

etcupdate: Always extract to a temporary tree.

etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by:dim, np (and many others)
Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472)
(cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71)
---
 usr.sbin/etcupdate/etcupdate.sh | 148 +---
 1 file changed, 92 insertions(+), 56 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 87d269f2ca69..41f13412f340 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -226,9 +226,11 @@ build_tree()
return 0
 }
 
-# Generate a new NEWTREE tree.  If tarball is set, then the tree is
+# Generate a new tree.  If tarball is set, then the tree is
 # extracted from the tarball.  Otherwise the tree is built from a
 # source tree.
+#
+# $1 - directory to store new tree in
 extract_tree()
 {
local files
@@ -239,16 +241,16 @@ extract_tree()
if [ -n "$preworld" ]; then
files="$PREWORLD_FILES"
fi
-   if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \
+   if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \
>&3 2>&1; then
echo "Failed to extract new tree."
-   remove_tree $NEWTREE
+   remove_tree $1
exit 1
fi
else
-   if ! build_tree $NEWTREE; then
+   if ! build_tree $1; then
echo "Failed to build new tree."
-   remove_tree $NEWTREE
+   remove_tree $1
exit 1
fi
fi
@@ -1353,14 +1355,28 @@ extract_cmd()
 
log "extract command: tarball=$tarball"
 
+   # Create a temporary directory to hold the tree
+   dir=`mktemp -d $WORKDIR/etcupdate-XXX`
+   if [ $? -ne 0 ]; then
+   echo "Unable to create temporary directory."
+   exit 1
+   fi
+
+   extract_tree $dir
+
if [ -d $NEWTREE ]; then
if ! remove_tree $NEWTREE; then
echo "Unable to remove current tree."
+   remove_tree $dir
exit 1
fi
fi
 
-   extract_tree
+   if ! mv $dir $NEWTREE >&3 2>&1; then
+   echo "Unable to rename temp tree to current tree."
+   remove_tree $dir
+   exit 1
+   fi
 }
 
 # Resolve conflicts left from an earlier merge.
@@ -1420,7 +1436,7 @@ status_cmd()
 # source tree.
 update_cmd()
 {
-   local dir
+   local dir new old
 
if [ $# -ne 0 ]; then
usage
@@ -1449,60 +1465,44 @@ update_cmd()
exit 1
fi
 
+   # Save tree names to use for rotation later.
+   old=$OLDTREE
+   new=$NEWTREE
if [ -z "$rerun" ]; then
-   # For a dryrun that is not a rerun, do not rotate the existing
-   # stock tree.  Instead, extract a tree to a temporary directory
-   # and use that for the comparison.
-   if [ -n "$dryrun" ]; then
-   dir=`mktemp -d $WORKDIR/etcupdate-XXX`
-   if [ $? -ne 0 ]; then
-   echo "Unable to create temporary directory."
-   exit 1
-   fi
-
-   # A pre-world dryrun has already set OLDTREE to
-   # point to the current stock tree.
-   if [ -z "$preworld" ]; then
-   OLDTREE=$NEWTREE
-   fi
-   NEWTREE=$dir
-
-   # For a pre-world update, blow away any pre-existing
-   

git: 960c954c55f2 - stable/13 - etcupdate: Add a revert mode to restore one or more stock files.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=960c954c55f24d08b7cbd184b035f0e93e4be5ee

commit 960c954c55f24d08b7cbd184b035f0e93e4be5ee
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:35 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:39 +

etcupdate: Add a revert mode to restore one or more stock files.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29846

(cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d)
---
 usr.sbin/etcupdate/etcupdate.8  | 24 
 usr.sbin/etcupdate/etcupdate.sh | 49 +
 2 files changed, 60 insertions(+), 13 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index 24afbca12951..5f13ed1d6733 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 27, 2018
+.Dd April 20, 2021
 .Dt ETCUPDATE 8
 .Os
 .Sh NAME
@@ -69,6 +69,12 @@
 .Op Fl D Ar destdir
 .Op Fl L Ar logfile
 .Nm
+.Cm revert
+.Op Fl d Ar workdir
+.Op Fl D Ar destdir
+.Op Fl L Ar logfile
+.Ar
+.Nm
 .Cm status
 .Op Fl d Ar workdir
 .Op Fl D Ar destdir
@@ -342,6 +348,14 @@ tree and discard any local changes made to the file.
 .It (h)  help
 Display the list of commands.
 .El
+.Ss Revert Mode
+The
+.Cm revert
+mode is used to restore the stock versions of files.
+In this mode,
+.Nm
+installs the stock version of requested files.
+This mode cannot be used to restore directories, only individual files.
 .Ss Status Mode
 The
 .Cm status
@@ -880,14 +894,6 @@ For example, one can imagine a syntax along the lines of
 .Pp
 to resolve a specific conflict in an automated fashion.
 .Pp
-It might be nice to have something like a
-.Sq revert
-command to replace a locally modified version of a file with the stock
-version of the file.
-For example:
-.Pp
-.Dl "etcupdate revert /etc/mail/freebsd.cf"
-.Pp
 Bootstrapping
 .Nm
 often results in gratuitous diffs in
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index dc26bc0c8aab..254a72abae08 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -58,7 +58,6 @@
 
 # TODO:
 # - automatable conflict resolution
-# - a 'revert' command to make a file "stock"
 
 usage()
 {
@@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t 
tarball]
etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L 
logfile]
  [-M options]
etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile]
+   etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ...
etcupdate status [-d workdir] [-D destdir]
 EOF
exit 1
@@ -1415,6 +1415,47 @@ resolve_cmd()
fi
 }
 
+# Restore files to the stock version.  Only files with a local change
+# are restored from the stock version.
+revert_cmd()
+{
+   local cmp file
+
+   if [ $# -eq 0 ]; then
+   usage
+   fi
+
+   for file; do
+   log "revert $file"
+
+   if ! [ -e $NEWTREE/$file ]; then
+   echo "File $file does not exist in the current tree."
+   exit 1
+   fi
+   if [ -d $NEWTREE/$file ]; then
+   echo "File $file is a directory."
+   exit 1
+   fi
+
+   compare $DESTDIR/$file $NEWTREE/$file
+   cmp=$?
+   if [ $cmp -eq $COMPARE_EQUAL ]; then
+   continue
+   fi
+
+   if update_unmodified $file; then
+   # If this file had a conflict, clean up the
+   # conflict.
+   if [ -e $CONFLICTS/$file ]; then
+   if ! rm $CONFLICTS/$file >&3 2>&1; then
+   echo "Failed to remove conflict " \
+"for $file".
+   fi
+   fi
+   fi
+   done
+}
+
 # Report a summary of the previous merge.  Specifically, list any
 # remaining conflicts followed by any warnings from the previous
 # update.
@@ -1622,7 +1663,7 @@ EOF
 command="update"
 if [ $# -gt 0 ]; then
case "$1" in
-   build|diff|extract|status|resolve)
+   build|diff|extract|status|resolve|revert)
command="$1"
shift
;;
@@ -1801,7 +1842,7 @@ case $command in
usage
fi
;;
-   build|diff|status)
+   build|diff|status|revert)
if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \
 -n "$preworld" ]; then
usage
@@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then
 fi
 
 case $comman

git: 76a0f6f3bfd8 - stable/13 - etcupdate: Trim trailing whitespace.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=76a0f6f3bfd8a77146d328c89b424565d4036761

commit 76a0f6f3bfd8a77146d328c89b424565d4036761
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:24 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:38 +

etcupdate: Trim trailing whitespace.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29845

(cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b)
---
 usr.sbin/etcupdate/etcupdate.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 3fd2e87bf52a..dc26bc0c8aab 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -442,7 +442,7 @@ empty_destdir()
 #
 # $1 - first tree
 # $2 - second tree
-# $3 - node name 
+# $3 - node name
 # $4 - label for first tree
 # $5 - label for second tree
 diffnode()
@@ -867,7 +867,7 @@ merge_file()
 # $1 - pathname of the file to resolve (relative to DESTDIR)
 has_conflicts()
 {
-   
+
egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1
 }
 
@@ -1526,7 +1526,7 @@ EOF
if [ -n "$preworld" ]; then
> $WORKDIR/removed.files
fi
-   
+
# The order for the following sections is important.  In the
# odd case that a directory is converted into a file, the
# existing subfiles need to be removed if possible before the
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 6d55189fe7c3 - stable/13 - etcupdate: Gracefully handle SIGINT when building trees.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6d55189fe7c38df13aac1ad980318387f3cbe7b3

commit 6d55189fe7c38df13aac1ad980318387f3cbe7b3
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:11 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:38 +

etcupdate: Gracefully handle SIGINT when building trees.

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29844

(cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e)
---
 usr.sbin/etcupdate/etcupdate.sh | 31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 41f13412f340..3fd2e87bf52a 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -179,17 +179,21 @@ always_install()
return 1
 }
 
-# Build a new tree
+# Build a new tree.  This runs inside a subshell to trap SIGINT.
 #
 # $1 - directory to store new tree in
 build_tree()
-{
+(
local destdir dir file make
 
make="make $MAKE_OPTIONS -DNO_FILEMON"
 
log "Building tree at $1 with $make"
-   mkdir -p $1/usr/obj >&3 2>&1
+
+   exec >&3 2>&1
+   trap 'return 1' INT
+
+   mkdir -p $1/usr/obj
destdir=`realpath $1`
 
if [ -n "$preworld" ]; then
@@ -197,34 +201,33 @@ build_tree()
# crucial to installworld.
for file in $PREWORLD_FILES; do
name=$(basename $file)
-   mkdir -p $1/etc >&3 2>&1 || return 1
+   mkdir -p $1/etc || return 1
cp -p $SRCDIR/$file $1/etc/$name || return 1
done
elif ! [ -n "$nobuild" ]; then
(cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs &&
 MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc &&
 MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc &&
-MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \
-   >&3 2>&1 || return 1
+MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \
+   return 1
else
(cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs &&
-   $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1
+   $make DESTDIR=$destdir distribution) || return 1
fi
-   chflags -R noschg $1 >&3 2>&1 || return 1
-   rm -rf $1/usr/obj >&3 2>&1 || return 1
+   chflags -R noschg $1 || return 1
+   rm -rf $1/usr/obj || return 1
 
# Purge auto-generated files.  Only the source files need to
# be updated after which these files are regenerated.
-   rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \
-   return 1
+   rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1
 
# Remove empty files.  These just clutter the output of 'diff'.
-   find $1 -type f -size 0 -delete >&3 2>&1 || return 1
+   find $1 -type f -size 0 -delete || return 1
 
# Trim empty directories.
-   find -d $1 -type d -empty -delete >&3 2>&1 || return 1
+   find -d $1 -type d -empty -delete || return 1
return 0
-}
+)
 
 # Generate a new tree.  If tarball is set, then the tree is
 # extracted from the tarball.  Otherwise the tree is built from a
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 6914b924d579 - stable/12 - etcupdate: Always extract to a temporary tree.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6914b924d57989b1da56588c247b9e248a9190ff

commit 6914b924d57989b1da56588c247b9e248a9190ff
Author: John Baldwin 
AuthorDate: 2021-04-20 20:21:42 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:19 +

etcupdate: Always extract to a temporary tree.

etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against.  This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by:dim, np (and many others)
Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472)
(cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71)
---
 usr.sbin/etcupdate/etcupdate.sh | 148 +---
 1 file changed, 92 insertions(+), 56 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 9144498544da..a84323890828 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -226,9 +226,11 @@ build_tree()
return 0
 }
 
-# Generate a new NEWTREE tree.  If tarball is set, then the tree is
+# Generate a new tree.  If tarball is set, then the tree is
 # extracted from the tarball.  Otherwise the tree is built from a
 # source tree.
+#
+# $1 - directory to store new tree in
 extract_tree()
 {
local files
@@ -239,16 +241,16 @@ extract_tree()
if [ -n "$preworld" ]; then
files="$PREWORLD_FILES"
fi
-   if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \
+   if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \
>&3 2>&1; then
echo "Failed to extract new tree."
-   remove_tree $NEWTREE
+   remove_tree $1
exit 1
fi
else
-   if ! build_tree $NEWTREE; then
+   if ! build_tree $1; then
echo "Failed to build new tree."
-   remove_tree $NEWTREE
+   remove_tree $1
exit 1
fi
fi
@@ -1353,14 +1355,28 @@ extract_cmd()
 
log "extract command: tarball=$tarball"
 
+   # Create a temporary directory to hold the tree
+   dir=`mktemp -d $WORKDIR/etcupdate-XXX`
+   if [ $? -ne 0 ]; then
+   echo "Unable to create temporary directory."
+   exit 1
+   fi
+
+   extract_tree $dir
+
if [ -d $NEWTREE ]; then
if ! remove_tree $NEWTREE; then
echo "Unable to remove current tree."
+   remove_tree $dir
exit 1
fi
fi
 
-   extract_tree
+   if ! mv $dir $NEWTREE >&3 2>&1; then
+   echo "Unable to rename temp tree to current tree."
+   remove_tree $dir
+   exit 1
+   fi
 }
 
 # Resolve conflicts left from an earlier merge.
@@ -1420,7 +1436,7 @@ status_cmd()
 # source tree.
 update_cmd()
 {
-   local dir
+   local dir new old
 
if [ $# -ne 0 ]; then
usage
@@ -1449,60 +1465,44 @@ update_cmd()
exit 1
fi
 
+   # Save tree names to use for rotation later.
+   old=$OLDTREE
+   new=$NEWTREE
if [ -z "$rerun" ]; then
-   # For a dryrun that is not a rerun, do not rotate the existing
-   # stock tree.  Instead, extract a tree to a temporary directory
-   # and use that for the comparison.
-   if [ -n "$dryrun" ]; then
-   dir=`mktemp -d $WORKDIR/etcupdate-XXX`
-   if [ $? -ne 0 ]; then
-   echo "Unable to create temporary directory."
-   exit 1
-   fi
-
-   # A pre-world dryrun has already set OLDTREE to
-   # point to the current stock tree.
-   if [ -z "$preworld" ]; then
-   OLDTREE=$NEWTREE
-   fi
-   NEWTREE=$dir
-
-   # For a pre-world update, blow away any pre-existing
-   

git: 5cb183fe4369 - stable/12 - etcupdate: Add a revert mode to restore one or more stock files.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5cb183fe4369ca7170038d5333f297e9a60168d6

commit 5cb183fe4369ca7170038d5333f297e9a60168d6
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:35 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:19 +

etcupdate: Add a revert mode to restore one or more stock files.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29846

(cherry picked from commit ba30215ae0efeb49e5e9ca2469d95edaea78680d)
---
 usr.sbin/etcupdate/etcupdate.8  | 24 
 usr.sbin/etcupdate/etcupdate.sh | 49 +
 2 files changed, 60 insertions(+), 13 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index 4cc5d69eb195..c3d95b3261ef 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 29, 2015
+.Dd April 20, 2021
 .Dt ETCUPDATE 8
 .Os
 .Sh NAME
@@ -69,6 +69,12 @@
 .Op Fl D Ar destdir
 .Op Fl L Ar logfile
 .Nm
+.Cm revert
+.Op Fl d Ar workdir
+.Op Fl D Ar destdir
+.Op Fl L Ar logfile
+.Ar
+.Nm
 .Cm status
 .Op Fl d Ar workdir
 .Op Fl D Ar destdir
@@ -342,6 +348,14 @@ tree and discard any local changes made to the file.
 .It (h)  help
 Display the list of commands.
 .El
+.Ss Revert Mode
+The
+.Cm revert
+mode is used to restore the stock versions of files.
+In this mode,
+.Nm
+installs the stock version of requested files.
+This mode cannot be used to restore directories, only individual files.
 .Ss Status Mode
 The
 .Cm status
@@ -879,14 +893,6 @@ For example, one can imagine a syntax along the lines of
 .Pp
 to resolve a specific conflict in an automated fashion.
 .Pp
-It might be nice to have something like a
-.Sq revert
-command to replace a locally modified version of a file with the stock
-version of the file.
-For example:
-.Pp
-.Dl "etcupdate revert /etc/mail/freebsd.cf"
-.Pp
 Bootstrapping
 .Nm
 often results in gratuitous diffs in
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 28f6cbb42aff..aa7d12e80be6 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -58,7 +58,6 @@
 
 # TODO:
 # - automatable conflict resolution
-# - a 'revert' command to make a file "stock"
 
 usage()
 {
@@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t 
tarball]
etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L 
logfile]
  [-M options]
etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile]
+   etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ...
etcupdate status [-d workdir] [-D destdir]
 EOF
exit 1
@@ -1415,6 +1415,47 @@ resolve_cmd()
fi
 }
 
+# Restore files to the stock version.  Only files with a local change
+# are restored from the stock version.
+revert_cmd()
+{
+   local cmp file
+
+   if [ $# -eq 0 ]; then
+   usage
+   fi
+
+   for file; do
+   log "revert $file"
+
+   if ! [ -e $NEWTREE/$file ]; then
+   echo "File $file does not exist in the current tree."
+   exit 1
+   fi
+   if [ -d $NEWTREE/$file ]; then
+   echo "File $file is a directory."
+   exit 1
+   fi
+
+   compare $DESTDIR/$file $NEWTREE/$file
+   cmp=$?
+   if [ $cmp -eq $COMPARE_EQUAL ]; then
+   continue
+   fi
+
+   if update_unmodified $file; then
+   # If this file had a conflict, clean up the
+   # conflict.
+   if [ -e $CONFLICTS/$file ]; then
+   if ! rm $CONFLICTS/$file >&3 2>&1; then
+   echo "Failed to remove conflict " \
+"for $file".
+   fi
+   fi
+   fi
+   done
+}
+
 # Report a summary of the previous merge.  Specifically, list any
 # remaining conflicts followed by any warnings from the previous
 # update.
@@ -1622,7 +1663,7 @@ EOF
 command="update"
 if [ $# -gt 0 ]; then
case "$1" in
-   build|diff|extract|status|resolve)
+   build|diff|extract|status|resolve|revert)
command="$1"
shift
;;
@@ -1801,7 +1842,7 @@ case $command in
usage
fi
;;
-   build|diff|status)
+   build|diff|status|revert)
if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \
 -n "$preworld" ]; then
usage
@@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then
 fi
 
 case $comma

git: ea6546fa1dd4 - stable/12 - etcupdate: Trim trailing whitespace.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ea6546fa1dd4fad52421585ebbfce56a07d8284d

commit ea6546fa1dd4fad52421585ebbfce56a07d8284d
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:24 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:19 +

etcupdate: Trim trailing whitespace.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29845

(cherry picked from commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b)
---
 usr.sbin/etcupdate/etcupdate.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index f64e58e4ecd1..28f6cbb42aff 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -442,7 +442,7 @@ empty_destdir()
 #
 # $1 - first tree
 # $2 - second tree
-# $3 - node name 
+# $3 - node name
 # $4 - label for first tree
 # $5 - label for second tree
 diffnode()
@@ -867,7 +867,7 @@ merge_file()
 # $1 - pathname of the file to resolve (relative to DESTDIR)
 has_conflicts()
 {
-   
+
egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1
 }
 
@@ -1526,7 +1526,7 @@ EOF
if [ -n "$preworld" ]; then
> $WORKDIR/removed.files
fi
-   
+
# The order for the following sections is important.  In the
# odd case that a directory is converted into a file, the
# existing subfiles need to be removed if possible before the
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: c417b618b933 - stable/13 - etcupdate: Add -D destdir to usage for 'extract'.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c417b618b93395c2b084382646e94ee9ac6a1451

commit c417b618b93395c2b084382646e94ee9ac6a1451
Author: John Baldwin 
AuthorDate: 2021-04-26 16:49:34 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:39 +

etcupdate: Add -D destdir to usage for 'extract'.

Reported by:Mark Millard 

(cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2)
---
 usr.sbin/etcupdate/etcupdate.8  | 1 +
 usr.sbin/etcupdate/etcupdate.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index 5f13ed1d6733..3d48e218494c 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -60,6 +60,7 @@
 .Op Fl B
 .Op Fl d Ar workdir
 .Op Fl s Ar source | Fl t Ar tarball
+.Op Fl D Ar destdir
 .Op Fl L Ar logfile
 .Op Fl M Ar options
 .Nm
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index 254a72abae08..acfc601b93af 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t 
tarball]
etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options]
  
etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile]
-   etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L 
logfile]
- [-M options]
+   etcupdate extract [-B] [-d workdir] [-s source | -t tarball]
+ [-D destdir] [-L logfile] [-M options]
etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile]
etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ...
etcupdate status [-d workdir] [-D destdir]
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 73a9788cf474 - stable/12 - etcupdate: Add -D destdir to usage for 'extract'.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=73a9788cf474ba3c168286a1a0ffa9bd04aef30d

commit 73a9788cf474ba3c168286a1a0ffa9bd04aef30d
Author: John Baldwin 
AuthorDate: 2021-04-26 16:49:34 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:19 +

etcupdate: Add -D destdir to usage for 'extract'.

Reported by:Mark Millard 

(cherry picked from commit 5eb9c93a20d7320b24635ed09eba4908951bdeb2)
---
 usr.sbin/etcupdate/etcupdate.8  | 1 +
 usr.sbin/etcupdate/etcupdate.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8
index c3d95b3261ef..22e1eb3c4483 100644
--- a/usr.sbin/etcupdate/etcupdate.8
+++ b/usr.sbin/etcupdate/etcupdate.8
@@ -60,6 +60,7 @@
 .Op Fl B
 .Op Fl d Ar workdir
 .Op Fl s Ar source | Fl t Ar tarball
+.Op Fl D Ar destdir
 .Op Fl L Ar logfile
 .Op Fl M Ar options
 .Nm
diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index aa7d12e80be6..1070c6905e46 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -68,8 +68,8 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t 
tarball]
etcupdate build [-B] [-d workdir] [-s source] [-L logfile] [-M options]
  
etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile]
-   etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L 
logfile]
- [-M options]
+   etcupdate extract [-B] [-d workdir] [-s source | -t tarball]
+ [-D destdir] [-L logfile] [-M options]
etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile]
etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ...
etcupdate status [-d workdir] [-D destdir]
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 29ed8efb3b1e - stable/12 - etcupdate: Gracefully handle SIGINT when building trees.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=29ed8efb3b1e834a5c6f4726fa2516a5af3266a9

commit 29ed8efb3b1e834a5c6f4726fa2516a5af3266a9
Author: John Baldwin 
AuthorDate: 2021-04-20 20:22:11 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:19:19 +

etcupdate: Gracefully handle SIGINT when building trees.

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by:imp
Differential Revision:  https://reviews.freebsd.org/D29844

(cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e)
---
 usr.sbin/etcupdate/etcupdate.sh | 31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index a84323890828..f64e58e4ecd1 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -179,17 +179,21 @@ always_install()
return 1
 }
 
-# Build a new tree
+# Build a new tree.  This runs inside a subshell to trap SIGINT.
 #
 # $1 - directory to store new tree in
 build_tree()
-{
+(
local destdir dir file make
 
make="make $MAKE_OPTIONS -DNO_FILEMON"
 
log "Building tree at $1 with $make"
-   mkdir -p $1/usr/obj >&3 2>&1
+
+   exec >&3 2>&1
+   trap 'return 1' INT
+
+   mkdir -p $1/usr/obj
destdir=`realpath $1`
 
if [ -n "$preworld" ]; then
@@ -197,34 +201,33 @@ build_tree()
# crucial to installworld.
for file in $PREWORLD_FILES; do
dir=`dirname /$file`
-   mkdir -p $1/$dir >&3 2>&1 || return 1
+   mkdir -p $1/$dir || return 1
cp -p $SRCDIR/$file $1/$file || return 1
done
elif ! [ -n "$nobuild" ]; then
(cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs &&
 MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc &&
 MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc &&
-MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \
-   >&3 2>&1 || return 1
+MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \
+   return 1
else
(cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs &&
-   $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1
+   $make DESTDIR=$destdir distribution) || return 1
fi
-   chflags -R noschg $1 >&3 2>&1 || return 1
-   rm -rf $1/usr/obj >&3 2>&1 || return 1
+   chflags -R noschg $1 || return 1
+   rm -rf $1/usr/obj || return 1
 
# Purge auto-generated files.  Only the source files need to
# be updated after which these files are regenerated.
-   rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \
-   return 1
+   rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1
 
# Remove empty files.  These just clutter the output of 'diff'.
-   find $1 -type f -size 0 -delete >&3 2>&1 || return 1
+   find $1 -type f -size 0 -delete || return 1
 
# Trim empty directories.
-   find -d $1 -type d -empty -delete >&3 2>&1 || return 1
+   find -d $1 -type d -empty -delete || return 1
return 0
-}
+)
 
 # Generate a new tree.  If tarball is set, then the tree is
 # extracted from the tarball.  Otherwise the tree is built from a
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 278e37006673 - main - freebsd-tips: Add fortune on kern.tty_info_kstacks

2021-06-09 Thread Michael Gmelin
The branch main has been updated by grembo (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=278e370066734a06f6b35e585568ac34969b1e84

commit 278e370066734a06f6b35e585568ac34969b1e84
Author: Michael Gmelin 
AuthorDate: 2021-05-21 16:10:26 +
Commit: Michael Gmelin 
CommitDate: 2021-06-09 21:35:38 +

freebsd-tips: Add fortune on kern.tty_info_kstacks

Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to
alter the output of ^T (tty info).

Reviewed by: ceri
Differential Revision: https://reviews.freebsd.org/D30388
---
 usr.bin/fortune/datfiles/freebsd-tips | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/usr.bin/fortune/datfiles/freebsd-tips 
b/usr.bin/fortune/datfiles/freebsd-tips
index eb7339cec698..cbbaff9eb84f 100644
--- a/usr.bin/fortune/datfiles/freebsd-tips
+++ b/usr.bin/fortune/datfiles/freebsd-tips
@@ -836,3 +836,10 @@ $ cu -s 9600 -l /dev/ttyU0
 
-- Daniel Ebdrup Jensen 
 %
+You can control kernel stack(9) traces on ^T (tty info) by setting
+kern.tty_info_kstacks to 0 (off), 1 (on), or 2 (verbose), e.g.:
+
+# sysctl kern.tty_info_kstacks=2
+
+   -- Michael Gmelin 
+%
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: fee0d486ef34 - main - linuxkpi: Add _RET_IP_ macro in kernel.h

2021-06-09 Thread Neel Chauhan
The branch main has been updated by nc (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fee0d486ef34c6bd113ed743e33357ff626f2495

commit fee0d486ef34c6bd113ed743e33357ff626f2495
Author: Neel Chauhan 
AuthorDate: 2021-06-09 21:34:58 +
Commit: Neel Chauhan 
CommitDate: 2021-06-09 21:41:44 +

linuxkpi: Add _RET_IP_ macro in kernel.h

This is needed by the drm-kmod 5.7 update.

Approved by:hselasky (src)
MFC after:  3 days
Differential Revision:  https://reviews.freebsd.org/D30707
---
 sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h 
b/sys/compat/linuxkpi/common/include/linux/kernel.h
index f34179d9566b..aba5896111f7 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -301,6 +301,8 @@ extern int linuxkpi_debug;
 
 #defineu64_to_user_ptr(val)((void *)(uintptr_t)(val))
 
+#define _RET_IP_   __builtin_return_address(0)
+
 static inline unsigned long long
 simple_strtoull(const char *cp, char **endp, unsigned int base)
 {
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 8a1a42b2a7a4 - main - linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()

2021-06-09 Thread Neel Chauhan
The branch main has been updated by nc (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535

commit 8a1a42b2a7a428fb97fda9f19fd0d67a4eec7535
Author: Neel Chauhan 
AuthorDate: 2021-06-09 21:38:52 +
Commit: Neel Chauhan 
CommitDate: 2021-06-09 21:41:44 +

linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()

In Linux, these are macros to locks in the kernel for scheduling purposes.
But as with other macros in this header, we aren't doing anything with them
so we are doing `do {} while (0)` for now.

This is needed by the drm-kmod 5.7 update.

Approved by:hselasky (src)
MFC after:  3 days
Differential Revision:  https://reviews.freebsd.org/D30710
---
 sys/compat/linuxkpi/common/include/linux/lockdep.h | 5 +
 sys/sys/param.h| 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h 
b/sys/compat/linuxkpi/common/include/linux/lockdep.h
index de82d06a419e..d12bd049b820 100644
--- a/sys/compat/linuxkpi/common/include/linux/lockdep.h
+++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h
@@ -79,6 +79,7 @@ lockdep_is_held(void *__m)
 
 #definemight_lock(m)   do { } while (0)
 #definemight_lock_read(m) do { } while (0)
+#definemight_lock_nested(m, n) do { } while (0)
 
 #definelock_acquire(...) do { } while (0)
 #definelock_release(...) do { } while (0)
@@ -91,4 +92,8 @@ lockdep_is_held(void *__m)
 #definelock_map_acquire_read(_map) do { } while (0)
 #definelock_map_release(_map) do { } while (0)
 
+#definelockdep_pin_lock(l) do { } while (0)
+#definelockdep_repin_lock(l,c) do { } while (0)
+#definelockdep_unpin_lock(l,c) do { } while (0)
+
 #endif /* _LINUX_LOCKDEP_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index d3a6fae783d4..d78612b5ebb9 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -76,7 +76,7 @@
  * cannot include sys/param.h and should only be updated here.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1400019
+#define __FreeBSD_version 1400020
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: f8edb3f9c725 - stable/13 - libcrypto: Add symbol versions for symbols added since 1.1.1d.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f8edb3f9c725e5b4a60981ee19a56395b0497e13

commit f8edb3f9c725e5b4a60981ee19a56395b0497e13
Author: John Baldwin 
AuthorDate: 2021-05-28 22:18:15 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:53:42 +

libcrypto: Add symbol versions for symbols added since 1.1.1d.

While here, trim a spurious local: I missed when added SSL_sendfile.

PR: 255277
Reported by:yuri
Reviewed by:jkim
Differential Revision:  https://reviews.freebsd.org/D30483

(cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf)
---
 secure/lib/libcrypto/Version.map | 17 -
 secure/lib/libssl/Version.map|  1 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map
index 33432019a023..bed7623b9c47 100644
--- a/secure/lib/libcrypto/Version.map
+++ b/secure/lib/libcrypto/Version.map
@@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d {
 global:
 X509_get0_authority_issuer;
 X509_get0_authority_serial;
-local: *;
 } OPENSSL_1_1_1c;
 
+OPENSSL_1_1_1e {
+global:
+EVP_PKEY_meth_get_digestsign;
+EVP_PKEY_meth_get_digestverify;
+EVP_PKEY_meth_set_digestsign;
+EVP_PKEY_meth_set_digestverify;
+RSA_get0_pss_params;
+} OPENSSL_1_1_1d;
 
+OPENSSL_1_1_1h {
+global:
+EC_KEY_decoded_from_explicit_params;
+X509_ALGOR_copy;
+X509_REQ_set0_signature;
+X509_REQ_set1_signature_algo;
+local: *;
+} OPENSSL_1_1_1e;
diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map
index 8c5eba6795ec..3e4e00950def 100644
--- a/secure/lib/libssl/Version.map
+++ b/secure/lib/libssl/Version.map
@@ -512,7 +512,6 @@ OPENSSL_1_1_1 {
 OPENSSL_1_1_1a {
 global:
 SSL_get_signature_type_nid;
-local: *;
 } OPENSSL_1_1_1;
 
 OPENSSL_1_1_1e {
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: f29f5cc6f2d3 - stable/12 - libcrypto: Add symbol versions for symbols added since 1.1.1d.

2021-06-09 Thread John Baldwin
The branch stable/12 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f29f5cc6f2d390b1ae4a6c526271e37233aafc70

commit f29f5cc6f2d390b1ae4a6c526271e37233aafc70
Author: John Baldwin 
AuthorDate: 2021-05-28 22:18:15 +
Commit: John Baldwin 
CommitDate: 2021-06-09 21:54:13 +

libcrypto: Add symbol versions for symbols added since 1.1.1d.

While here, trim a spurious local: I missed when added SSL_sendfile.

PR: 255277
Reported by:yuri
Reviewed by:jkim
Differential Revision:  https://reviews.freebsd.org/D30483

(cherry picked from commit 7ad70d22c667173586c04fc13dd315995d78fbbf)
---
 secure/lib/libcrypto/Version.map | 17 -
 secure/lib/libssl/Version.map|  1 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/secure/lib/libcrypto/Version.map b/secure/lib/libcrypto/Version.map
index 33432019a023..bed7623b9c47 100644
--- a/secure/lib/libcrypto/Version.map
+++ b/secure/lib/libcrypto/Version.map
@@ -4450,7 +4450,22 @@ OPENSSL_1_1_1d {
 global:
 X509_get0_authority_issuer;
 X509_get0_authority_serial;
-local: *;
 } OPENSSL_1_1_1c;
 
+OPENSSL_1_1_1e {
+global:
+EVP_PKEY_meth_get_digestsign;
+EVP_PKEY_meth_get_digestverify;
+EVP_PKEY_meth_set_digestsign;
+EVP_PKEY_meth_set_digestverify;
+RSA_get0_pss_params;
+} OPENSSL_1_1_1d;
 
+OPENSSL_1_1_1h {
+global:
+EC_KEY_decoded_from_explicit_params;
+X509_ALGOR_copy;
+X509_REQ_set0_signature;
+X509_REQ_set1_signature_algo;
+local: *;
+} OPENSSL_1_1_1e;
diff --git a/secure/lib/libssl/Version.map b/secure/lib/libssl/Version.map
index 9011ff99d88d..118ac93966e3 100644
--- a/secure/lib/libssl/Version.map
+++ b/secure/lib/libssl/Version.map
@@ -512,5 +512,4 @@ OPENSSL_1_1_1 {
 OPENSSL_1_1_1a {
 global:
 SSL_get_signature_type_nid;
-local: *;
 } OPENSSL_1_1_1;
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 597cc550e7b9 - main - LinuxKPI: add fault_flag_allow_retry_first

2021-06-09 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=597cc550e7b98294617cdd41800e9f132b6bcad9

commit 597cc550e7b98294617cdd41800e9f132b6bcad9
Author: Greg V 
AuthorDate: 2021-06-09 23:09:16 +
Commit: Ed Maste 
CommitDate: 2021-06-09 23:11:41 +

LinuxKPI: add fault_flag_allow_retry_first

Used by drm 5.7.

Reviewed by:bz, hselasky, nc
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D30673
---
 sys/compat/linuxkpi/common/include/linux/mm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h 
b/sys/compat/linuxkpi/common/include/linux/mm.h
index 68a0f34acaf3..74709299ba1a 100644
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -92,6 +92,9 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0);
 #defineFAULT_FLAG_REMOTE   (1 << 7)
 #defineFAULT_FLAG_INSTRUCTION  (1 << 8)
 
+#define fault_flag_allow_retry_first(flags) \
+   (((flags) & (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_TRIED)) == 
FAULT_FLAG_ALLOW_RETRY)
+
 typedef int (*pte_fn_t)(linux_pte_t *, pgtable_t, unsigned long addr, void 
*data);
 
 struct vm_area_struct {
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning

2021-06-09 Thread Warner Losh
The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291

commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291
Author: Warner Losh 
AuthorDate: 2021-06-10 00:10:12 +
Commit: Warner Losh 
CommitDate: 2021-06-10 00:10:52 +

mk: WITH_FOO=no now generates a warning

Many people are used to gnu configure's behavior of changing
--with-foo=no to --without-foo. At the same time, several folks have
WITH_FOO=no in their config files to enable this ironic form of the
option because of an old meme from IRC, a mailing list or the forums (I
forget which). Add a warning to allow to alert people w/o breaking POLA.

Reviewed by:allanjude, bdrewery, manu
MFC After:  2 weeks
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D30684
---
 share/mk/bsd.mkopt.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk
index 5a9cf1b2f1be..98d23dd46c2a 100644
--- a/share/mk/bsd.mkopt.mk
+++ b/share/mk/bsd.mkopt.mk
@@ -36,6 +36,9 @@
 #
 .for var in ${__DEFAULT_YES_OPTIONS}
 .if !defined(MK_${var})
+.if defined(WITH_${var}) && ${WITH_${var}} == "no"
+.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
+.endif
 .if defined(WITHOUT_${var})# WITHOUT always wins
 MK_${var}:=no
 .else
@@ -54,6 +57,9 @@ MK_${var}:=   yes
 #
 .for var in ${__DEFAULT_NO_OPTIONS}
 .if !defined(MK_${var})
+.if defined(WITH_${var}) && ${WITH_${var}} == "no"
+.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
+.endif
 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
 MK_${var}:=yes
 .else
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: a4f99b3c2384 - stable/13 - Disable building svnlite(1) by default.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a4f99b3c2384e04118182d917c689d446a63be71

commit a4f99b3c2384e04118182d917c689d446a63be71
Author: John Baldwin 
AuthorDate: 2021-05-05 21:05:10 +
Commit: John Baldwin 
CommitDate: 2021-06-09 22:21:59 +

Disable building svnlite(1) by default.

Now that all repositories have switched to git, initiate the de-orbit
burn for svnlite(1).

Reviewed by:emaste
Relnotes:   yes
Differential Revision:  https://reviews.freebsd.org/D30105

(cherry picked from commit a2bc17474b962ba9e29c4526356203fe48a549eb)
---
 share/mk/src.opts.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index d01472c7fae6..70462adb6a37 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -176,7 +176,6 @@ __DEFAULT_YES_OPTIONS = \
 SOURCELESS_HOST \
 SOURCELESS_UCODE \
 STATS \
-SVNLITE \
 SYSCONS \
 SYSTEM_COMPILER \
 SYSTEM_LINKER \
@@ -216,6 +215,7 @@ __DEFAULT_NO_OPTIONS = \
 RPCBIND_WARMSTART_SUPPORT \
 SORT_THREADS \
 SVN \
+SVNLITE \
 ZONEINFO_LEAPSECONDS_SUPPORT \
 
 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 214bbc2ddca8 - stable/13 - Add a description for WITH_SVNLITE.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=214bbc2ddca8708004df7577fe70d38c91c69e5e

commit 214bbc2ddca8708004df7577fe70d38c91c69e5e
Author: John Baldwin 
AuthorDate: 2021-05-05 21:05:38 +
Commit: John Baldwin 
CommitDate: 2021-06-09 22:22:43 +

Add a description for WITH_SVNLITE.

Reviewed by:emaste
MFC after:  1 month
Differential Revision:  https://reviews.freebsd.org/D30106

(cherry picked from commit 0ac711e07ece9ac260023a62250d50fb2f37e975)
---
 tools/build/options/WITH_SVNLITE | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/build/options/WITH_SVNLITE b/tools/build/options/WITH_SVNLITE
new file mode 100644
index ..25aeec40fab1
--- /dev/null
+++ b/tools/build/options/WITH_SVNLITE
@@ -0,0 +1,3 @@
+Build
+.Xr svnlite 1
+and related programs.
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: cbf2dc5ffc8b - stable/13 - src.conf.5: Regen.

2021-06-09 Thread John Baldwin
The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c

commit cbf2dc5ffc8bf0869d67fe3c4ec4b2721349888c
Author: John Baldwin 
AuthorDate: 2021-06-09 22:24:42 +
Commit: John Baldwin 
CommitDate: 2021-06-09 22:24:42 +

src.conf.5: Regen.
---
 share/man/man5/src.conf.5 | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 90905413175e..dad8d465e3fd 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd February 4, 2021
+.Dd June 9, 2021
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1250,10 +1250,19 @@ Set to build nvme related tools and kernel modules.
 .Pp
 This is a default setting on
 amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64.
-.It Va WITH_OFED
-Set to build the
+.It Va WITHOUT_OFED
+Set to disable the build of the
 .Dq "OpenFabrics Enterprise Distribution"
-Infiniband software stack.
+Infiniband software stack, including kernel modules and userspace libraries.
+.Pp
+This is a default setting on
+riscv/riscv64 and riscv/riscv64sf.
+When set, it enforces these options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_OFED_EXTRA
+.El
 .It Va WITH_OFED_EXTRA
 Set to build the non-essential components of the
 .Dq "OpenFabrics Enterprise Distribution"
@@ -1497,8 +1506,8 @@ Set to install
 .Xr svnlite 1
 as
 .Xr svn 1 .
-.It Va WITHOUT_SVNLITE
-Set to not build
+.It Va WITH_SVNLITE
+Build
 .Xr svnlite 1
 and related programs.
 .It Va WITHOUT_SYSCONS
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: b48d1066d54b - stable/13 - madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC

2021-06-09 Thread Konstantin Belousov
The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b48d1066d54b1a134cbf64f86c0bc2035fd08251

commit b48d1066d54b1a134cbf64f86c0bc2035fd08251
Author: Konstantin Belousov 
AuthorDate: 2021-06-02 22:01:28 +
Commit: Konstantin Belousov 
CommitDate: 2021-06-10 00:47:50 +

madt_setup_local: skip further checks if ACPI DMAR table already disabled 
x2APIC

(cherry picked from commit a603d41aca48ff21df59967c55ddef181e16ec14)
---
 sys/x86/acpica/madt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 5683f7eb321d..11c7b9de52d7 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -158,7 +158,9 @@ madt_setup_local(void)
reason = "by DMAR table";
acpi_unmap_table(dmartbl);
}
-   if (vm_guest == VM_GUEST_VMWARE) {
+   if (reason != NULL) {
+   /* Already disabled */
+   } else if (vm_guest == VM_GUEST_VMWARE) {
vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p);
if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
(p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0)
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: c04954bb39d8 - stable/13 - Disable x2APIC for SandyBridge laptops with Samsung BIOS

2021-06-09 Thread Konstantin Belousov
The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c04954bb39d807860d27ffe867d86c1f12465f6e

commit c04954bb39d807860d27ffe867d86c1f12465f6e
Author: Konstantin Belousov 
AuthorDate: 2021-06-02 22:29:07 +
Commit: Konstantin Belousov 
CommitDate: 2021-06-10 00:47:50 +

Disable x2APIC for SandyBridge laptops with Samsung BIOS

PR: 256389

(cherry picked from commit 37f780d3e0a2e8e4c64c526b6e7dc77ff6b91057)
---
 sys/x86/acpica/madt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index e041296d4ca5..8e343a6619f3 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -131,6 +131,7 @@ madt_probe_cpus(void)
 static const char *x2apic_sandy_dis[] = {
"LENOVO",
"ASUSTeK Computer Inc.",
+   "SAMSUNG ELECTRONICS CO., LTD.",
 };
 
 /*
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: ca473f38c156 - stable/13 - madt_setup_local: convert series of strcmp to iteration over the array

2021-06-09 Thread Konstantin Belousov
The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ca473f38c1568c89113e64e1495df3f17271b433

commit ca473f38c1568c89113e64e1495df3f17271b433
Author: Konstantin Belousov 
AuthorDate: 2021-06-02 22:19:09 +
Commit: Konstantin Belousov 
CommitDate: 2021-06-10 00:47:50 +

madt_setup_local: convert series of strcmp to iteration over the array

(cherry picked from commit 92adf00d0512b674ce18eb1a542ae42e85dd5bca)
---
 sys/x86/acpica/madt.c | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 11c7b9de52d7..035a618f68a3 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -128,6 +128,11 @@ madt_probe_cpus(void)
return (0);
 }
 
+static const char *x2apic_sandy_dis[] = {
+   "LENOVO",
+   "ASUSTeK Computer Inc.",
+};
+
 /*
  * Initialize the local APIC on the BSP.
  */
@@ -139,7 +144,7 @@ madt_setup_local(void)
const char *reason;
char *hw_vendor;
u_int p[4];
-   int user_x2apic;
+   int i, user_x2apic;
bool bios_x2apic;
 
if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
@@ -173,21 +178,22 @@ madt_setup_local(void)
CPUID_TO_MODEL(cpu_id) == 0x2a) {
hw_vendor = kern_getenv("smbios.planar.maker");
/*
-* It seems that some Lenovo and ASUS
-* SandyBridge-based notebook BIOSes have a
-* bug which prevents booting AP in x2APIC
-* mode.  Since the only way to detect mobile
-* CPU is to check northbridge pci id, which
-* cannot be done that early, disable x2APIC
-* for all Lenovo and ASUS SandyBridge
+* It seems that some SandyBridge-based
+* notebook BIOSes have a bug which prevents
+* booting AP in x2APIC mode.  Since the only
+* way to detect mobile CPU is to check
+* northbridge pci id, which cannot be done
+* that early, disable x2APIC for all such
 * machines.
 */
if (hw_vendor != NULL) {
-   if (!strcmp(hw_vendor, "LENOVO") ||
-   !strcmp(hw_vendor,
-   "ASUSTeK Computer Inc.")) {
-   reason =
+   for (i = 0; i < nitems(x2apic_sandy_dis); i++) {
+   if (strcmp(hw_vendor,
+   x2apic_sandy_dis[i]) == 0) {
+   reason =
"for a suspected SandyBridge BIOS bug";
+   break;
+   }
}
freeenv(hw_vendor);
}
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 9e500de92587 - stable/13 - madt_setup_local: extract special case checks into a helper

2021-06-09 Thread Konstantin Belousov
The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9e500de925873bb16e45def54512d3abda958ae3

commit 9e500de925873bb16e45def54512d3abda958ae3
Author: Konstantin Belousov 
AuthorDate: 2021-06-02 22:27:32 +
Commit: Konstantin Belousov 
CommitDate: 2021-06-10 00:47:50 +

madt_setup_local: extract special case checks into a helper

(cherry picked from commit e9e00cc0c98738f0ce7bface221c920c36a1356e)
---
 sys/x86/acpica/madt.c | 114 --
 1 file changed, 64 insertions(+), 50 deletions(-)

diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 035a618f68a3..e041296d4ca5 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -134,70 +134,84 @@ static const char *x2apic_sandy_dis[] = {
 };
 
 /*
- * Initialize the local APIC on the BSP.
+ * Automatically detect several configurations where x2APIC mode is
+ * known to cause troubles.  User can override the setting with
+ * hw.x2apic_enable tunable.
  */
-static int
-madt_setup_local(void)
+static const char *
+madt_x2apic_disable_reason(void)
 {
ACPI_TABLE_DMAR *dmartbl;
vm_paddr_t dmartbl_physaddr;
const char *reason;
char *hw_vendor;
u_int p[4];
-   int i, user_x2apic;
-   bool bios_x2apic;
+   int i;
 
-   if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
-   reason = NULL;
+   reason = NULL;
 
+   dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR);
+   if (dmartbl_physaddr != 0) {
+   dmartbl = acpi_map_table(dmartbl_physaddr, ACPI_SIG_DMAR);
+   if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0)
+   reason = "by DMAR table";
+   acpi_unmap_table(dmartbl);
+   if (reason != NULL)
+   return (reason);
+   }
+
+   if (vm_guest == VM_GUEST_VMWARE) {
+   vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p);
+   if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
+   (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0)
+   return ("inside VMWare without intr redirection");
+   }
+
+   if (vm_guest == VM_GUEST_XEN)
+   return ("due to running under XEN");
+
+   if (vm_guest == VM_GUEST_NO &&
+   CPUID_TO_FAMILY(cpu_id) == 0x6 &&
+   CPUID_TO_MODEL(cpu_id) == 0x2a) {
+   hw_vendor = kern_getenv("smbios.planar.maker");
/*
-* Automatically detect several configurations where
-* x2APIC mode is known to cause troubles.  User can
-* override the setting with hw.x2apic_enable tunable.
+* It seems that some SandyBridge-based notebook
+* BIOSes have a bug which prevents booting AP in
+* x2APIC mode.  Since the only way to detect mobile
+* CPU is to check northbridge pci id, which cannot be
+* done that early, disable x2APIC for all such
+* machines.
 */
-   dmartbl_physaddr = acpi_find_table(ACPI_SIG_DMAR);
-   if (dmartbl_physaddr != 0) {
-   dmartbl = acpi_map_table(dmartbl_physaddr,
-   ACPI_SIG_DMAR);
-   if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0)
-   reason = "by DMAR table";
-   acpi_unmap_table(dmartbl);
-   }
-   if (reason != NULL) {
-   /* Already disabled */
-   } else if (vm_guest == VM_GUEST_VMWARE) {
-   vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p);
-   if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
-   (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0)
-   reason =
-   "inside VMWare without intr redirection";
-   } else if (vm_guest == VM_GUEST_XEN) {
-   reason = "due to running under XEN";
-   } else if (vm_guest == VM_GUEST_NO &&
-   CPUID_TO_FAMILY(cpu_id) == 0x6 &&
-   CPUID_TO_MODEL(cpu_id) == 0x2a) {
-   hw_vendor = kern_getenv("smbios.planar.maker");
-   /*
-* It seems that some SandyBridge-based
-* notebook BIOSes have a bug which prevents
-* booting AP in x2APIC mode.  Since the only
-* way to detect mobile CPU is to check
-* northbridge pci id, which cannot be done
-* that early, disable x2APIC for all such
-* machines.
-*/
-   if (hw_vendor != NULL) {
-   for (i = 0; i < nitems(x2apic_sandy_dis); i++) {
- 

git: 36435ca5d3fa - main - insetad -> instead

2021-06-09 Thread Warner Losh
The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=36435ca5d3faa869c76f488c41daa9d195496f1f

commit 36435ca5d3faa869c76f488c41daa9d195496f1f
Author: Warner Losh 
AuthorDate: 2021-06-10 02:17:22 +
Commit: Warner Losh 
CommitDate: 2021-06-10 02:17:22 +

insetad -> instead
---
 share/mk/bsd.mkopt.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk
index 98d23dd46c2a..794f4108b7d7 100644
--- a/share/mk/bsd.mkopt.mk
+++ b/share/mk/bsd.mkopt.mk
@@ -37,7 +37,7 @@
 .for var in ${__DEFAULT_YES_OPTIONS}
 .if !defined(MK_${var})
 .if defined(WITH_${var}) && ${WITH_${var}} == "no"
-.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
+.warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no"
 .endif
 .if defined(WITHOUT_${var})# WITHOUT always wins
 MK_${var}:=no
@@ -58,7 +58,7 @@ MK_${var}:=   yes
 .for var in ${__DEFAULT_NO_OPTIONS}
 .if !defined(MK_${var})
 .if defined(WITH_${var}) && ${WITH_${var}} == "no"
-.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no"
+.warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no"
 .endif
 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
 MK_${var}:=yes
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 4ab5c88da287 - main - stress2: Exclude new syzkaller tests

2021-06-09 Thread Peter Holm
The branch main has been updated by pho:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4ab5c88da28780334f48eae56db52d8e77c871cf

commit 4ab5c88da28780334f48eae56db52d8e77c871cf
Author: Peter Holm 
AuthorDate: 2021-06-10 02:30:12 +
Commit: Peter Holm 
CommitDate: 2021-06-10 02:30:12 +

stress2: Exclude new syzkaller tests
---
 tools/test/stress2/misc/all.exclude | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/test/stress2/misc/all.exclude 
b/tools/test/stress2/misc/all.exclude
index 4f818b53a976..833e4fb0dbd3 100644
--- a/tools/test/stress2/misc/all.exclude
+++ b/tools/test/stress2/misc/all.exclude
@@ -64,6 +64,9 @@ syzkaller30.shMay change policy for random 
threads to to domainset_fixed  20210
 syzkaller31.sh panic: Bad tailq NEXT(0xfe0079608f00->tqh_last) != 
NULL 20210322
 syzkaller32.sh Fatal trap 18: integer divide fault while in kernel 
mode20210322
 syzkaller33.sh Fatal trap 18: integer divide fault while in kernel 
mode20210418
+syzkaller39.sh WiP 
20210607
+syzkaller40.sh WiP 
20210607
+syzkaller41.sh WiP 
20210607
 truss3.sh  WiP 
20200915
 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 
20130909
 unionfs2.shinsmntque: mp-safe fs and non-locked vp is not ...  
20111219
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: e34c3d0721bc - stable/12 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

2021-06-09 Thread Dmitry Chagin
The branch stable/12 has been updated by dchagin:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e34c3d0721bc52b4130489170e509266ce4e4b96

commit e34c3d0721bc52b4130489170e509266ce4e4b96
Author: Dmitry Chagin 
AuthorDate: 2021-05-27 18:52:10 +
Commit: Dmitry Chagin 
CommitDate: 2021-06-10 06:13:04 +

rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

PR: 256203
Submitted by:   Steve Kargl sgk at troutmask.apl.washington.edu

(cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09)
---
 share/man/man4/rtwn_usb.4  | 3 ++-
 sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 +
 sys/dev/usb/usbdevs| 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4
index b146cfe4fe09..86c4c02aafa9 100644
--- a/share/man/man4/rtwn_usb.4
+++ b/share/man/man4/rtwn_usb.4
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd May 26, 2021
+.Dd May 27, 2021
 .Dt RTWN_USB 4
 .Os
 .Sh NAME
@@ -99,6 +99,7 @@ based USB wireless network adapters, including:
 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0
 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0
+.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0
 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0
diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h 
b/sys/dev/rtwn/usb/rtwn_usb_attach.h
index 40076dbb941c..c7a0f1ce1576 100644
--- a/sys/dev/rtwn/usb/rtwn_usb_attach.h
+++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h
@@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2),
RTWN_RTL8821AU_DEV(TPLINK,  T2UNANO),
RTWN_RTL8821AU_DEV(TPLINK,  T2UPLUS),
+   RTWN_RTL8821AU_DEV(TPLINK,  T2UV3),
 #undef RTWN_RTL8821AU_DEV
 };
 
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 9add31c6d781..15cd996745e6 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -4694,6 +4694,7 @@ product TPLINK T4UV2  0x010d  Archer T4U ver 2
 product TPLINK T4UHV1  0x0103  Archer T4UH ver 1
 product TPLINK T4UHV2  0x010e  Archer T4UH ver 2
 product TPLINK T2UNANO 0x011e  Archer T2U Nano
+product TPLINK T2UV3   0x011f  Archer T2U ver 3
 product TPLINK T2UPLUS 0x0120  Archer T2U Plus
 product TPLINK RTL8153 0x0601  RTL8153 USB 10/100/1000 LAN
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 923cd7e05af8 - stable/13 - rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

2021-06-09 Thread Dmitry Chagin
The branch stable/13 has been updated by dchagin:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=923cd7e05af843421b6eb46086f9a786f643361c

commit 923cd7e05af843421b6eb46086f9a786f643361c
Author: Dmitry Chagin 
AuthorDate: 2021-05-27 18:52:10 +
Commit: Dmitry Chagin 
CommitDate: 2021-06-10 06:14:22 +

rtwn_usb(4): Add a USB ID for the TP-Link Archer T2U v3.

PR: 256203
Submitted by:   Steve Kargl sgk at troutmask.apl.washington.edu

(cherry picked from commit 434c46c00602e16115cfb19344e4c45135b68b09)
---
 share/man/man4/rtwn_usb.4  | 3 ++-
 sys/dev/rtwn/usb/rtwn_usb_attach.h | 1 +
 sys/dev/usb/usbdevs| 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/share/man/man4/rtwn_usb.4 b/share/man/man4/rtwn_usb.4
index b146cfe4fe09..86c4c02aafa9 100644
--- a/share/man/man4/rtwn_usb.4
+++ b/share/man/man4/rtwn_usb.4
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd May 26, 2021
+.Dd May 27, 2021
 .Dt RTWN_USB 4
 .Os
 .Sh NAME
@@ -99,6 +99,7 @@ based USB wireless network adapters, including:
 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0
 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0
+.It "TP-Link Archer T2U v3" Ta RTL8821AU Ta USB 2.0
 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0
 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0
diff --git a/sys/dev/rtwn/usb/rtwn_usb_attach.h 
b/sys/dev/rtwn/usb/rtwn_usb_attach.h
index 40076dbb941c..c7a0f1ce1576 100644
--- a/sys/dev/rtwn/usb/rtwn_usb_attach.h
+++ b/sys/dev/rtwn/usb/rtwn_usb_attach.h
@@ -167,6 +167,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2),
RTWN_RTL8821AU_DEV(TPLINK,  T2UNANO),
RTWN_RTL8821AU_DEV(TPLINK,  T2UPLUS),
+   RTWN_RTL8821AU_DEV(TPLINK,  T2UV3),
 #undef RTWN_RTL8821AU_DEV
 };
 
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 1239449b4697..b3cf80be01a4 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -4699,6 +4699,7 @@ product TPLINK T4UV2  0x010d  Archer T4U ver 2
 product TPLINK T4UHV1  0x0103  Archer T4UH ver 1
 product TPLINK T4UHV2  0x010e  Archer T4UH ver 2
 product TPLINK T2UNANO 0x011e  Archer T2U Nano
+product TPLINK T2UV3   0x011f  Archer T2U ver 3
 product TPLINK T2UPLUS 0x0120  Archer T2U Plus
 product TPLINK RTL8153 0x0601  RTL8153 USB 10/100/1000 LAN
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"