svn commit: r361272 - head/contrib/wpa/src/drivers

2020-05-19 Thread Cy Schubert
Author: cy
Date: Wed May 20 04:16:13 2020
New Revision: 361272
URL: https://svnweb.freebsd.org/changeset/base/361272

Log:
  Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi
  radio is disabled through the communication device toggle key (also known
  as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be
  issued.
  
  Submitted by: avg
  Reported by:  avg
  MFC after:1 week

Modified:
  head/contrib/wpa/src/drivers/driver_bsd.c

Modified: head/contrib/wpa/src/drivers/driver_bsd.c
==
--- head/contrib/wpa/src/drivers/driver_bsd.c   Wed May 20 02:33:41 2020
(r361271)
+++ head/contrib/wpa/src/drivers/driver_bsd.c   Wed May 20 04:16:13 2020
(r361272)
@@ -1358,14 +1358,18 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void
drv = bsd_get_drvindex(global, ifm->ifm_index);
if (drv == NULL)
return;
-   if ((ifm->ifm_flags & IFF_UP) == 0 &&
-   (drv->flags & IFF_UP) != 0) {
+   if (((ifm->ifm_flags & IFF_UP) == 0 ||
+   (ifm->ifm_flags & IFF_RUNNING) == 0) &&
+   (drv->flags & IFF_UP) != 0 &&
+   (drv->flags & IFF_RUNNING) != 0) {
wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN",
   drv->ifname);
wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED,
 NULL);
} else if ((ifm->ifm_flags & IFF_UP) != 0 &&
-   (drv->flags & IFF_UP) == 0) {
+   (ifm->ifm_flags & IFF_RUNNING) != 0 &&
+   ((drv->flags & IFF_UP) == 0 ||
+   (drv->flags & IFF_RUNNING)  == 0)) {
wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
   drv->ifname);
wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361271 - in head/sys/powerpc: aim include

2020-05-19 Thread Justin Hibbits
Author: jhibbits
Date: Wed May 20 02:33:41 2020
New Revision: 361271
URL: https://svnweb.freebsd.org/changeset/base/361271

Log:
  powerpc/radix mmu: No need for delayed TLB invalidation
  
  x86 needs delayed TLB invalidation because invalidation requires an
  expensive IPI.  PowerPC has had a TLB invalidation instruction since the
  POWER1 in 1990, so there's no need to delay anything.

Modified:
  head/sys/powerpc/aim/mmu_radix.c
  head/sys/powerpc/include/proc.h

Modified: head/sys/powerpc/aim/mmu_radix.c
==
--- head/sys/powerpc/aim/mmu_radix.cWed May 20 01:25:46 2020
(r361270)
+++ head/sys/powerpc/aim/mmu_radix.cWed May 20 02:33:41 2020
(r361271)
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -406,7 +405,6 @@ static u_int64_tKPTphys;/* phys addr of kernel 
level
 
 static vm_offset_t qframe = 0;
 static struct mtx qframe_mtx;
-static epoch_t pmap_epoch;
 
 void mmu_radix_activate(mmu_t mmu, struct thread *);
 void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int);
@@ -849,43 +847,6 @@ pa_cmp(const void *a, const void *b)
PG_M | PG_A | RPTE_EAA_MASK | PG_V)
 
 
-static void
-pmap_epoch_init(void *arg __unused)
-{
-   pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED);
-}
-SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL);
-
-static bool
-pmap_not_in_di(void)
-{
-
-   return (curthread->td_md.md_invl_gen.gen == 0);
-}
-
-#definePMAP_ASSERT_NOT_IN_DI() \
-KASSERT(pmap_not_in_di(), ("DI already started"))
-
-static void
-pmap_delayed_invl_started(epoch_tracker_t et)
-{
-   epoch_enter_preempt(pmap_epoch, et);
-   curthread->td_md.md_invl_gen.gen = 1;
-}
-
-static void
-pmap_delayed_invl_finished(epoch_tracker_t et)
-{
-   curthread->td_md.md_invl_gen.gen = 0;
-   epoch_exit_preempt(pmap_epoch, et);
-}
-
-static void
-pmap_delayed_invl_wait(vm_page_t m __unused)
-{
-   epoch_wait_preempt(pmap_epoch);
-}
-
 static __inline void
 pmap_resident_count_inc(pmap_t pmap, int count)
 {
@@ -1370,8 +1331,7 @@ out:
 }
 
 static void
-reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap, bool start_di,
-   epoch_tracker_t et)
+reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap)
 {
 
if (pmap == NULL)
@@ -1379,8 +1339,6 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked
pmap_invalidate_all(pmap);
if (pmap != locked_pmap)
PMAP_UNLOCK(pmap);
-   if (start_di)
-   pmap_delayed_invl_finished(et);
 }
 
 /*
@@ -1410,8 +1368,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
struct spglist free;
uint64_t inuse;
int bit, field, freed;
-   bool start_di;
-   struct epoch_tracker et;
 
PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED);
KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL"));
@@ -1423,13 +1379,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
pc_marker = (struct pv_chunk *)_marker_b;
pc_marker_end = (struct pv_chunk *)_marker_end_b;
 
-   /*
-* A delayed invalidation block should already be active if
-* pmap_advise() or pmap_remove() called this function by way
-* of pmap_demote_l3e_locked().
-*/
-   start_di = pmap_not_in_di();
-
mtx_lock(_chunks_mutex);
active_reclaims++;
TAILQ_INSERT_HEAD(_chunks, pc_marker, pc_lru);
@@ -1454,21 +1403,16 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
 * corresponding pmap is locked.
 */
if (pmap != next_pmap) {
-   reclaim_pv_chunk_leave_pmap(pmap, locked_pmap,
-   start_di, );
+   reclaim_pv_chunk_leave_pmap(pmap, locked_pmap);
pmap = next_pmap;
/* Avoid deadlock and lock recursion. */
if (pmap > locked_pmap) {
RELEASE_PV_LIST_LOCK(lockp);
PMAP_LOCK(pmap);
-   if (start_di)
-   pmap_delayed_invl_started();
mtx_lock(_chunks_mutex);
continue;
} else if (pmap != locked_pmap) {
if (PMAP_TRYLOCK(pmap)) {
-   if (start_di)
-   pmap_delayed_invl_started();
mtx_lock(_chunks_mutex);
continue;
} else {
@@ -1480,8 +1424,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
continue;
   

svn commit: r361268 - head/tests/sys/net

2020-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 19 21:55:29 2020
New Revision: 361268
URL: https://svnweb.freebsd.org/changeset/base/361268

Log:
  Make sys.net.if_bridge_test depend on python; sys.net.if_bridge_test.span
  requires it.
  
  MFC after:2 weeks
  Sponsored by: DARPA

Modified:
  head/tests/sys/net/Makefile

Modified: head/tests/sys/net/Makefile
==
--- head/tests/sys/net/Makefile Tue May 19 21:48:45 2020(r361267)
+++ head/tests/sys/net/Makefile Tue May 19 21:55:29 2020(r361268)
@@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR}
 
 ATF_TESTS_C+=  if_epair
 ATF_TESTS_SH+= if_bridge_test
+TEST_METADATA.if_bridge_test+= required_programs="python"
 ATF_TESTS_SH+= if_clone_test
 ATF_TESTS_SH+= if_lagg_test
 ATF_TESTS_SH+= if_tun_test
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361267 - in head/tests/sys: netinet netinet6

2020-05-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue May 19 21:48:45 2020
New Revision: 361267
URL: https://svnweb.freebsd.org/changeset/base/361267

Log:
  Make sys.netinet.output and sys.netinet6.output6 tests depend on python;
  they need to be able to run net_receiver.py.
  
  MFC after:2 weeks
  Sponsored by: DARPA

Modified:
  head/tests/sys/netinet/Makefile
  head/tests/sys/netinet6/Makefile

Modified: head/tests/sys/netinet/Makefile
==
--- head/tests/sys/netinet/Makefile Tue May 19 19:53:12 2020
(r361266)
+++ head/tests/sys/netinet/Makefile Tue May 19 21:48:45 2020
(r361267)
@@ -10,6 +10,7 @@ ATF_TESTS_C=  ip_reass_test \
socket_afinet
 
 ATF_TESTS_SH=  carp fibs_test redirect divert forward output lpm
+TEST_METADATA.output+= required_programs="python"
 
 PROGS= udp_dontroute tcp_user_cookie
 

Modified: head/tests/sys/netinet6/Makefile
==
--- head/tests/sys/netinet6/MakefileTue May 19 19:53:12 2020
(r361266)
+++ head/tests/sys/netinet6/MakefileTue May 19 21:48:45 2020
(r361267)
@@ -14,6 +14,7 @@ ATF_TESTS_SH= \
forward6 \
output6 \
lpm6
+TEST_METADATA.output6+=required_programs="python"
 
 ${PACKAGE}FILES+=  exthdr.py
 ${PACKAGE}FILES+=  mld.py
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347418 - head/sys/net

2020-05-19 Thread Kristof Provost

On 19 May 2020, at 17:02, Andrew Gallatin wrote:

On 2020-05-19 04:21, Kristof Provost wrote:

The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, 
INT32_MAX, INT32_MAX},|, so presumably that’s the cause.
I don’t know what a sane value would be though. I’ve defaulted to 
4096 (because that’s what some other iflib users seems to do) for 
now, and that seems to work. It doesn’t panic and I can get traffic 
through it at least:


You seem to be setting the max, not the default, and 4K max 
descriptors on a 100g device is going to basically cripple it.


Yeah, I just grabbed whatever number other iflib users used. My 
immediate concern was to get it to stop panicking.


How about setting to the next power of 2 below max int so as to keep 
with the authors intent?



Makes sense, yes.


If we don't already have a macro, something like  (INT32_MAX >> 1) + 1


https://reviews.freebsd.org/D24922

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


svn commit: r361266 - head/sys/cddl/contrib/opensolaris/common/lz4

2020-05-19 Thread Toomas Soome
Author: tsoome
Date: Tue May 19 19:53:12 2020
New Revision: 361266
URL: https://svnweb.freebsd.org/changeset/base/361266

Log:
  lz4 hash table does not start zeroed
  
  illumos issue: https://www.illumos.org/issues/12757
  
  Submitted by: andyf

Modified:
  head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c

Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c
==
--- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c  Tue May 19 18:41:46 
2020(r361265)
+++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c  Tue May 19 19:53:12 
2020(r361266)
@@ -850,7 +850,7 @@ real_LZ4_compress(const char *source, char *dest, int 
 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP);
 #else
-   void *ctx = malloc(sizeof(struct refTables));
+   void *ctx = calloc(1, sizeof(struct refTables));
 #endif
int result;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361265 - head

2020-05-19 Thread Ryan Moeller
Author: freqlabs
Date: Tue May 19 18:41:46 2020
New Revision: 361265
URL: https://svnweb.freebsd.org/changeset/base/361265

Log:
  Mention new jail(8) command hooks in RELNOTES
  
  Reported by:  0mp
  Approved by:  mmacy (mentor)

Modified:
  head/RELNOTES

Modified: head/RELNOTES
==
--- head/RELNOTES   Tue May 19 18:38:46 2020(r361264)
+++ head/RELNOTES   Tue May 19 18:41:46 2020(r361265)
@@ -13,6 +13,12 @@ Changes to this file should not be MFCed.
 r361238:
ZFS will now reject read(2) of a dirfd with EISDIR.
 
+r361066:
+   Add exec.prepare and exec.release hooks for jail(8) and jail.conf(5).
+   exec.prepare runs before mounts, so can be used to populate new jails.
+   exec.release runs after unmounts, so can be used to remove ephemeral
+   jails.
+
 r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936:
Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5,
MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361264 - head

2020-05-19 Thread Ryan Moeller
Author: freqlabs
Date: Tue May 19 18:38:46 2020
New Revision: 361264
URL: https://svnweb.freebsd.org/changeset/base/361264

Log:
  Mention new dd flags in RELNOTES
  
  Approved by:  mmacy (mentor)
  Sponsored by: iXsystems, Inc.

Modified:
  head/RELNOTES

Modified: head/RELNOTES
==
--- head/RELNOTES   Tue May 19 18:35:08 2020(r361263)
+++ head/RELNOTES   Tue May 19 18:38:46 2020(r361264)
@@ -87,6 +87,10 @@ r352304:
ntpd is no longer by default locked in memory. rlimit memlock 32
or rlimit memlock 0 can be used to restore this behaviour.
 
+r351770,r352920,r352922,r352923:
+   dd(1) now supports conv=fsync, conv=fdatasync, oflag=fsync, oflag=sync,
+   and iflag=fullblock flags, compatible with illumos and GNU.
+
 r351522:
Add kernel-side support for in-kernel Transport Layer Security
(KTLS).  KTLS permits using sendfile(2) over sockets using
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361263 - in head/sys: netinet sys

2020-05-19 Thread Mark Johnston
Author: markj
Date: Tue May 19 18:35:08 2020
New Revision: 361263
URL: https://svnweb.freebsd.org/changeset/base/361263

Log:
  Define a module version for accept filter modules.
  
  Otherwise accept filters compiled into the kernel do not preempt
  preloaded accept filter modules.  Then, the preloaded file registers its
  accept filter module before the kernel, and the kernel's attempt fails
  since duplicate accept filter list entries are not permitted.  This
  causes the preloaded file's module to be released, since
  module_register_init() does a lookup by name, so the preloaded file is
  unloaded, and the accept filter's callback points to random memory since
  preload_delete_name() unmaps the file on x86 as of r336505.
  
  Add a new ACCEPT_FILTER_DEFINE macro which wraps the accept filter and
  module definitions, and ensures that a module version is defined.
  
  PR:   245870
  Reported by:  Thomas von Dein 
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet/accf_data.c
  head/sys/netinet/accf_dns.c
  head/sys/netinet/accf_http.c
  head/sys/sys/socketvar.h

Modified: head/sys/netinet/accf_data.c
==
--- head/sys/netinet/accf_data.cTue May 19 18:34:50 2020
(r361262)
+++ head/sys/netinet/accf_data.cTue May 19 18:35:08 2020
(r361263)
@@ -42,20 +42,7 @@ __FBSDID("$FreeBSD$");
 
 static int sohasdata(struct socket *so, void *arg, int waitflag);
 
-static struct accept_filter accf_data_filter = {
-   "dataready",
-   sohasdata,
-   NULL,
-   NULL
-};
-
-static moduledata_t accf_data_mod = {
-   "accf_data",
-   accept_filt_generic_mod_event,
-   _data_filter
-};
-
-DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
+ACCEPT_FILTER_DEFINE(accf_data, "dataready", sohasdata, NULL, NULL, 1);
 
 static int
 sohasdata(struct socket *so, void *arg, int waitflag)

Modified: head/sys/netinet/accf_dns.c
==
--- head/sys/netinet/accf_dns.c Tue May 19 18:34:50 2020(r361262)
+++ head/sys/netinet/accf_dns.c Tue May 19 18:35:08 2020(r361263)
@@ -41,6 +41,8 @@
 /* check for full DNS request */
 static int sohasdns(struct socket *so, void *arg, int waitflag);
 
+ACCEPT_FILTER_DEFINE(accf_dns, "dnsready", sohasdns, NULL, NULL, 1);
+
 struct packet {
struct mbuf *m; /* Current mbuf. */
struct mbuf *n; /* nextpkt mbuf. */
@@ -55,21 +57,6 @@ struct packet {
 
 /* check we can skip over various parts of DNS request */
 static int skippacket(struct sockbuf *sb);
-
-static struct accept_filter accf_dns_filter = {
-   "dnsready",
-   sohasdns,
-   NULL,
-   NULL
-};
-
-static moduledata_t accf_dns_mod = {
-   "accf_dns",
-   accept_filt_generic_mod_event,
-   _dns_filter
-};
-
-DECLARE_MODULE(accf_dns, accf_dns_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
 
 static int
 sohasdns(struct socket *so, void *arg, int waitflag)

Modified: head/sys/netinet/accf_http.c
==
--- head/sys/netinet/accf_http.cTue May 19 18:34:50 2020
(r361262)
+++ head/sys/netinet/accf_http.cTue May 19 18:35:08 2020
(r361263)
@@ -54,29 +54,16 @@ static int mbufstrncmp(struct mbuf *m, struct mbuf *np
 /* socketbuffer is full */
 static int sbfull(struct sockbuf *sb);
 
-static struct accept_filter accf_http_filter = {
-   "httpready",
-   sohashttpget,
-   NULL,
-   NULL
-};
+ACCEPT_FILTER_DEFINE(accf_http, "httpready", sohashttpget, NULL, NULL, 1);
 
-static moduledata_t accf_http_mod = {
-   "accf_http",
-   accept_filt_generic_mod_event,
-   _http_filter
-};
-
-DECLARE_MODULE(accf_http, accf_http_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-
 static int parse_http_version = 1;
 
 static SYSCTL_NODE(_net_inet_accf, OID_AUTO, http,
 CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
 "HTTP accept filter");
 SYSCTL_INT(_net_inet_accf_http, OID_AUTO, parsehttpversion, CTLFLAG_RW,
-_http_version, 1,
-"Parse http version so that non 1.x requests work");
+_http_version, 1,
+"Parse http version so that non 1.x requests work");
 
 #ifdef ACCF_HTTP_DEBUG
 #define DPRINT(fmt, args...)   \

Modified: head/sys/sys/socketvar.h
==
--- head/sys/sys/socketvar.hTue May 19 18:34:50 2020(r361262)
+++ head/sys/sys/socketvar.hTue May 19 18:35:08 2020(r361263)
@@ -335,6 +335,22 @@ struct accept_filter {
SLIST_ENTRY(accept_filter) accf_next;
 };
 
+#defineACCEPT_FILTER_DEFINE(modname, filtname, cb, create, destroy, 
ver) \
+   static struct accept_filter modname##_filter = {\
+   .accf_name = filtname,  

svn commit: r361262 - head/sys/kern

2020-05-19 Thread Mark Johnston
Author: markj
Date: Tue May 19 18:34:50 2020
New Revision: 361262
URL: https://svnweb.freebsd.org/changeset/base/361262

Log:
  Use the symbolic name for "modmetadata_set".
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_linker.c

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Tue May 19 16:28:20 2020(r361261)
+++ head/sys/kern/kern_linker.c Tue May 19 18:34:50 2020(r361262)
@@ -369,8 +369,7 @@ linker_file_register_modules(linker_file_t lf)
 
sx_assert(_sx, SA_XLOCKED);
 
-   if (linker_file_lookup_set(lf, "modmetadata_set", ,
-   , NULL) != 0) {
+   if (linker_file_lookup_set(lf, MDT_SETNAME, , , NULL) != 0) {
/*
 * This fallback should be unnecessary, but if we get booted
 * from boot2 instead of loader and we are missing our
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread John Baldwin
On 5/19/20 8:34 AM, Rodney W. Grimes wrote:
> The EISDIR behavior is what your changing, independent of file system(s)
> you have done so far.  The fact the behavior is now different between
> UFS and ZFS is sic, IMHO.

Oh please.  NFS already fails with ESIDIR and has failed to read()
directories for 30 years:

https://svnweb.freebsd.org/csrg?view=revision=41905

We haven't had riots in the streets over that.  If you actually looked at
what ZFS was returning for read(), it was useless.

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


svn commit: r361261 - in head/sys/dev/cxgbe: . iw_cxgbe

2020-05-19 Thread Navdeep Parhar
Author: np
Date: Tue May 19 16:28:20 2020
New Revision: 361261
URL: https://svnweb.freebsd.org/changeset/base/361261

Log:
  cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a
  fatal error.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/cxgbe/iw_cxgbe/device.c
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hTue May 19 16:06:03 2020
(r361260)
+++ head/sys/dev/cxgbe/adapter.hTue May 19 16:28:20 2020
(r361261)
@@ -830,6 +830,7 @@ struct adapter {
int sc_do_rxcopy;
 
struct taskqueue *tq[MAX_NCHAN];/* General purpose taskqueues */
+   struct task async_event_task;
struct port_info *port[MAX_NPORTS];
uint8_t chan_map[MAX_NCHAN];/* channel -> port */
 

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cTue May 19 16:06:03 2020
(r361260)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cTue May 19 16:28:20 2020
(r361261)
@@ -1085,7 +1085,7 @@ c4iw_so_upcall(struct socket *so, void *arg, int waitf
 * Wake up any threads waiting in rdma_init()/rdma_fini(),
 * with locks held.
 */
-   if (so->so_error)
+   if (so->so_error || (ep->com.dev->rdev.flags & T4_FATAL_ERROR))
c4iw_wake_up(>com.wr_wait, -ECONNRESET);
add_ep_to_req_list(ep, C4IW_EVENT_SOCKET);
 
@@ -2700,6 +2700,11 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog
 
CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %s", __func__, cm_id,
backlog);
+   if (c4iw_fatal_error(>rdev)) {
+   CTR2(KTR_IW_CXGBE, "%s: cm_id %p, fatal error", __func__,
+  cm_id);
+   return -EIO;
+   }
lep = alloc_ep(sizeof(*lep), GFP_KERNEL);
lep->com.cm_id = cm_id;
ref_cm_id(>com);
@@ -2800,7 +2805,6 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt,
 {
int ret = 0;
int close = 0;
-   int fatal = 0;
struct c4iw_rdev *rdev;
 
 
@@ -2809,12 +2813,14 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt,
rdev = >com.dev->rdev;
 
if (c4iw_fatal_error(rdev)) {
-
-   CTR2(KTR_IW_CXGBE, "%s:ced1 %p", __func__, ep);
-   fatal = 1;
+   CTR3(KTR_IW_CXGBE, "%s:ced1 fatal error %p %s", __func__, ep,
+   states[ep->com.state]);
+   if (ep->com.state != DEAD) {
+   send_abort(ep);
+   ep->com.state = DEAD;
+   }
close_complete_upcall(ep, -ECONNRESET);
-   send_abort(ep);
-   ep->com.state = DEAD;
+   return ECONNRESET;
}
CTR3(KTR_IW_CXGBE, "%s:ced2 %p %s", __func__, ep,
states[ep->com.state]);
@@ -2877,9 +2883,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt,
CTR2(KTR_IW_CXGBE, "%s:ced4 %p", __func__, ep);
set_bit(EP_DISC_ABORT, >com.history);
close_complete_upcall(ep, -ECONNRESET);
-   ret = send_abort(ep);
-   if (ret)
-   fatal = 1;
+   send_abort(ep);
} else {
 
CTR2(KTR_IW_CXGBE, "%s:ced5 %p", __func__, ep);
@@ -2889,33 +2893,28 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt,
ep->com.state = MORIBUND;
 
CURVNET_SET(ep->com.so->so_vnet);
-   sodisconnect(ep->com.so);
+   ret = sodisconnect(ep->com.so);
CURVNET_RESTORE();
-   }
-
-   }
-
-   if (fatal) {
-   set_bit(EP_DISC_FAIL, >com.history);
-   if (!abrupt) {
-   STOP_EP_TIMER(ep);
-   close_complete_upcall(ep, -EIO);
-   }
-   if (ep->com.qp) {
-   struct c4iw_qp_attributes attrs = {0};
-
-   attrs.next_state = C4IW_QP_STATE_ERROR;
-   ret = c4iw_modify_qp(ep->com.dev, ep->com.qp,
-   C4IW_QP_ATTR_NEXT_STATE,
-   , 1);
if (ret) {
-   CTR2(KTR_IW_CXGBE, "%s:ced7 %p", __func__, ep);
-   printf("%s - qp <- error failed!\n", __func__);
+   CTR2(KTR_IW_CXGBE, "%s:ced6 %p", 

svn commit: r361260 - head/usr.sbin/ntp/ntpd

2020-05-19 Thread Xin LI
Author: delphij
Date: Tue May 19 16:06:03 2020
New Revision: 361260
URL: https://svnweb.freebsd.org/changeset/base/361260

Log:
  Update leap-seconds to leap-seconds.3676924800.
  
  Obtained from:ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800
  MFC after:3 days

Modified:
  head/usr.sbin/ntp/ntpd/leap-seconds

Modified: head/usr.sbin/ntp/ntpd/leap-seconds
==
--- head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:04:27 2020
(r361259)
+++ head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:06:03 2020
(r361260)
@@ -204,10 +204,10 @@
 #  current -- the update time stamp, the data and the name of the file
 #  will not change.
 #
-#  Updated through IERS Bulletin C58
-#  File expires on:  28 June 2020
+#  Updated through IERS Bulletin C59
+#  File expires on:  28 December 2020
 #
-#@ 3802291200
+#@ 3818102400
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -252,4 +252,4 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30
+#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2020-05-19 Thread Andrew Turner
Author: andrew
Date: Tue May 19 16:04:27 2020
New Revision: 361259
URL: https://svnweb.freebsd.org/changeset/base/361259

Log:
  Stop performing a full icache sync when the DIC and IDC flags are set
  
  The DIC and IDC bits in the CTR_EL0 register signal to the kernel when it
  can relax the instruction cache synchronisation operations. The IDC bit
  means we can relax cleaning the data cache to the point of unification
  while the DIC bit means we don't need to invalidate the instruction cache
  for data coherence. In both cases an appropriate barrier is still needed.
  
  For now only implement the case where both bits are set, as is the case
  on the Neoverse-N1 as used in the Amazon AWS Graviton 2 CPU. Note that
  this behaviour is a optional on the N1 so we may later need to implement
  only one or the other bit being set.
  
  There is a tunable to disable each flag on boot.
  
  Testing on a 4 core Graviton 2 instance found a significant improvement
  in sys and real time when running "make buildkernel -j4", with no
  significant difference in user time.
  
  Reviewed by:  markj
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D24853

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

Modified: head/sys/arm64/arm64/cpufunc_asm.S
==
--- head/sys/arm64/arm64/cpufunc_asm.S  Tue May 19 15:27:20 2020
(r361258)
+++ head/sys/arm64/arm64/cpufunc_asm.S  Tue May 19 16:04:27 2020
(r361259)
@@ -133,9 +133,20 @@ ENTRY(arm64_dcache_inv_range)
 END(arm64_dcache_inv_range)
 
 /*
- * void arm64_icache_sync_range(vm_offset_t, vm_size_t)
+ * void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t)
+ * When the CTR_EL0.IDC bit is set cleaning to PoU becomes a dsb.
+ * When the CTR_EL0.DIC bit is set icache invalidation becomes an isb.
  */
-ENTRY(arm64_icache_sync_range)
+ENTRY(arm64_dic_idc_icache_sync_range)
+   dsb ishst
+   isb
+   ret
+END(arm64_dic_idc_icache_sync_range)
+
+/*
+ * void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t)
+ */
+ENTRY(arm64_aliasing_icache_sync_range)
/*
 * XXX Temporary solution - I-cache flush should be range based for
 * PIPT cache or IALLUIS for VIVT or VIPT caches
@@ -146,7 +157,7 @@ ENTRY(arm64_icache_sync_range)
dsb ish
isb
ret
-END(arm64_icache_sync_range)
+END(arm64_aliasing_icache_sync_range)
 
 /*
  * int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t)

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Tue May 19 15:27:20 2020
(r361258)
+++ head/sys/arm64/arm64/identcpu.c Tue May 19 16:04:27 2020
(r361259)
@@ -56,6 +56,24 @@ char machine[] = "arm64";
 extern int adaptive_machine_arch;
 #endif
 
+static SYSCTL_NODE(_machdep, OID_AUTO, cache, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+"Cache management tuning");
+
+static int allow_dic = 1;
+SYSCTL_INT(_machdep_cache, OID_AUTO, allow_dic, CTLFLAG_RDTUN, _dic, 0,
+"Allow optimizations based on the DIC cache bit");
+
+static int allow_idc = 1;
+SYSCTL_INT(_machdep_cache, OID_AUTO, allow_idc, CTLFLAG_RDTUN, _idc, 0,
+"Allow optimizations based on the IDC cache bit");
+
+/*
+ * The default implementation of I-cache sync assumes we have an
+ * aliasing cache until we know otherwise.
+ */
+void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t) =
+_aliasing_icache_sync_range;
+
 static int
 sysctl_hw_machine(SYSCTL_HANDLER_ARGS)
 {
@@ -977,6 +995,7 @@ identify_cpu_sysinit(void *dummy __unused)
 {
int cpu;
u_long hwcap;
+   bool dic, idc;
 
/* Create a user visible cpu description with safe values */
memset(_cpu_desc, 0, sizeof(user_cpu_desc));
@@ -985,6 +1004,8 @@ identify_cpu_sysinit(void *dummy __unused)
ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64;
user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8;
 
+   dic = (allow_dic != 0);
+   idc = (allow_idc != 0);
CPU_FOREACH(cpu) {
print_cpu_features(cpu);
hwcap = parse_cpu_features_hwcap(cpu);
@@ -993,6 +1014,17 @@ identify_cpu_sysinit(void *dummy __unused)
else
elf_hwcap &= hwcap;
update_user_regs(cpu);
+
+   if (CTR_DIC_VAL(cpu_desc[cpu].ctr) == 0)
+   dic = false;
+   if (CTR_IDC_VAL(cpu_desc[cpu].ctr) == 0)
+   idc = false;
+   }
+
+   if (dic && idc) {
+   arm64_icache_sync_range = _dic_idc_icache_sync_range;
+   if (bootverbose)
+   printf("Enabling DIC & IDC ICache sync\n");
}
 
if ((elf_hwcap & HWCAP_ATOMICS) != 0) {

Modified: 

Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Kyle Evans
On Tue, May 19, 2020 at 10:34 AM Rodney W. Grimes
 wrote:
>
> > On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes
> >  wrote:
> > >
> > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
> > > >  wrote:
> > > > >
> > > > > > Author: kevans
> > > > > > Date: Tue May 19 02:41:05 2020
> > > > > > New Revision: 361238
> > > > > > URL: https://svnweb.freebsd.org/changeset/base/361238
> > > > > >
> > > > > > Log:
> > > > > >   zfs: reject read(2) of a dirfd with EISDIR
> > > > > >
> > > > > >   This is independent of the recently-discussed global change, 
> > > > > > which is still
> > > > > >   in review/discussion stage.
> > > > > >
> > > > > >   This is effectively a measure for consistency in the ZFS world, 
> > > > > > where
> > > > > >   FreeBSD was the only platform (as far as I could find) that 
> > > > > > allowed this.
> > > > > >   What ZFS exposes is decidedly not useful for any real purposes, to
> > > > > >   paraphrase (hopefully faithfully) jhb's findings when exploring 
> > > > > > this:
> > > > > >
> > > > > >   The size of a directory in ZFS is the number of directory entries 
> > > > > > within.
> > > > > >   When reading a directory, you would instead get the leading part 
> > > > > > of its raw
> > > > > >   contents; the amount you get being dictated by the "size," i.e. 
> > > > > > number of
> > > > > >   directory entries. There's decidedly (luckily) no stack 
> > > > > > disclosure happening
> > > > > >   here, though the behavior is bizarre and almost certainly a 
> > > > > > historical
> > > > > >   accident.
> > > > > >
> > > > > >   This change has already been upstreamed to OpenZFS.
> > > > >
> > > > > Until the grep -d skip issue is addressed I object to this change as
> > > > > it is going to cause people who do grep with wildcards to see lots
> > > > > of errors that before where pretty much either silent (no match 
> > > > > occured)
> > > > > or spit out a "binary file foo matches."
> > > > >
> > > >
> > > > That seems preferable to grepping random bytes that don't particularly
> > > > contain any strings? They'd never see "binary file foo matches" in
> > > > this case.
> > >
> > > The difference is you rarely get a hit, and now your gauranteed to
> > > get a hit on every single directory making grep * very noisy, where
> > > it was often silent or nearly silent before.
> > >
> >
> > As you noted in the review for the larger change, -d skip is a good
> > option for the people that don't like this. It probably makes sense as
> > a default, but then we'd be diverging from the other popular grep that
> > defaults to -d read and spews out EISDIR more often than not.
>
> Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-)
>
> > > >
> > > > This isn't exactly divergent from the behavior they'd see with ZFS
> > > > anywhere else.
> > >
> > > It is extremly divergent from 42 years of behavior.
> > >
> >
> > I don't think ZFS has been implemented on FreeBSD for 42 years, and I
> > don't find this grep argument compelling enough to restore peoples'
> > ability to read the raw znode of a directory.
>
> The EISDIR behavior is what your changing, independent of file system(s)
> you have done so far.  The fact the behavior is now different between
> UFS and ZFS is sic, IMHO.

EISDIR in read(2) denotes that a filesystem does not support reading a
directory, this isn't a new kind of error. In particular, ZFS
traditionally does NOT support reading a directory like this. The
behavior between UFS and ZFS should have always been different, this
is correction of a historical *accident*.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Rodney W. Grimes
> On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes
>  wrote:
> >
> > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
> > >  wrote:
> > > >
> > > > > Author: kevans
> > > > > Date: Tue May 19 02:41:05 2020
> > > > > New Revision: 361238
> > > > > URL: https://svnweb.freebsd.org/changeset/base/361238
> > > > >
> > > > > Log:
> > > > >   zfs: reject read(2) of a dirfd with EISDIR
> > > > >
> > > > >   This is independent of the recently-discussed global change, which 
> > > > > is still
> > > > >   in review/discussion stage.
> > > > >
> > > > >   This is effectively a measure for consistency in the ZFS world, 
> > > > > where
> > > > >   FreeBSD was the only platform (as far as I could find) that allowed 
> > > > > this.
> > > > >   What ZFS exposes is decidedly not useful for any real purposes, to
> > > > >   paraphrase (hopefully faithfully) jhb's findings when exploring 
> > > > > this:
> > > > >
> > > > >   The size of a directory in ZFS is the number of directory entries 
> > > > > within.
> > > > >   When reading a directory, you would instead get the leading part of 
> > > > > its raw
> > > > >   contents; the amount you get being dictated by the "size," i.e. 
> > > > > number of
> > > > >   directory entries. There's decidedly (luckily) no stack disclosure 
> > > > > happening
> > > > >   here, though the behavior is bizarre and almost certainly a 
> > > > > historical
> > > > >   accident.
> > > > >
> > > > >   This change has already been upstreamed to OpenZFS.
> > > >
> > > > Until the grep -d skip issue is addressed I object to this change as
> > > > it is going to cause people who do grep with wildcards to see lots
> > > > of errors that before where pretty much either silent (no match occured)
> > > > or spit out a "binary file foo matches."
> > > >
> > >
> > > That seems preferable to grepping random bytes that don't particularly
> > > contain any strings? They'd never see "binary file foo matches" in
> > > this case.
> >
> > The difference is you rarely get a hit, and now your gauranteed to
> > get a hit on every single directory making grep * very noisy, where
> > it was often silent or nearly silent before.
> >
> 
> As you noted in the review for the larger change, -d skip is a good
> option for the people that don't like this. It probably makes sense as
> a default, but then we'd be diverging from the other popular grep that
> defaults to -d read and spews out EISDIR more often than not.

Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-)

> > >
> > > This isn't exactly divergent from the behavior they'd see with ZFS
> > > anywhere else.
> >
> > It is extremly divergent from 42 years of behavior.
> >
> 
> I don't think ZFS has been implemented on FreeBSD for 42 years, and I
> don't find this grep argument compelling enough to restore peoples'
> ability to read the raw znode of a directory.

The EISDIR behavior is what your changing, independent of file system(s)
you have done so far.  The fact the behavior is now different between
UFS and ZFS is sic, IMHO.


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


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Kyle Evans
On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes
 wrote:
>
> > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
> >  wrote:
> > >
> > > > Author: kevans
> > > > Date: Tue May 19 02:41:05 2020
> > > > New Revision: 361238
> > > > URL: https://svnweb.freebsd.org/changeset/base/361238
> > > >
> > > > Log:
> > > >   zfs: reject read(2) of a dirfd with EISDIR
> > > >
> > > >   This is independent of the recently-discussed global change, which is 
> > > > still
> > > >   in review/discussion stage.
> > > >
> > > >   This is effectively a measure for consistency in the ZFS world, where
> > > >   FreeBSD was the only platform (as far as I could find) that allowed 
> > > > this.
> > > >   What ZFS exposes is decidedly not useful for any real purposes, to
> > > >   paraphrase (hopefully faithfully) jhb's findings when exploring this:
> > > >
> > > >   The size of a directory in ZFS is the number of directory entries 
> > > > within.
> > > >   When reading a directory, you would instead get the leading part of 
> > > > its raw
> > > >   contents; the amount you get being dictated by the "size," i.e. 
> > > > number of
> > > >   directory entries. There's decidedly (luckily) no stack disclosure 
> > > > happening
> > > >   here, though the behavior is bizarre and almost certainly a historical
> > > >   accident.
> > > >
> > > >   This change has already been upstreamed to OpenZFS.
> > >
> > > Until the grep -d skip issue is addressed I object to this change as
> > > it is going to cause people who do grep with wildcards to see lots
> > > of errors that before where pretty much either silent (no match occured)
> > > or spit out a "binary file foo matches."
> > >
> >
> > That seems preferable to grepping random bytes that don't particularly
> > contain any strings? They'd never see "binary file foo matches" in
> > this case.
>
> The difference is you rarely get a hit, and now your gauranteed to
> get a hit on every single directory making grep * very noisy, where
> it was often silent or nearly silent before.
>

As you noted in the review for the larger change, -d skip is a good
option for the people that don't like this. It probably makes sense as
a default, but then we'd be diverging from the other popular grep that
defaults to -d read and spews out EISDIR more often than not.

> >
> > This isn't exactly divergent from the behavior they'd see with ZFS
> > anywhere else.
>
> It is extremly divergent from 42 years of behavior.
>

I don't think ZFS has been implemented on FreeBSD for 42 years, and I
don't find this grep argument compelling enough to restore peoples'
ability to read the raw znode of a directory.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Rodney W. Grimes
> > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
> >  wrote:
> > >
> > > > Author: kevans
> > > > Date: Tue May 19 02:41:05 2020
> > > > New Revision: 361238
> > > > URL: https://svnweb.freebsd.org/changeset/base/361238
> > > >
> > > > Log:
> > > >   zfs: reject read(2) of a dirfd with EISDIR
> > > >
> > > >   This is independent of the recently-discussed global change, which is 
> > > > still
> > > >   in review/discussion stage.
> > > >
> > > >   This is effectively a measure for consistency in the ZFS world, where
> > > >   FreeBSD was the only platform (as far as I could find) that allowed 
> > > > this.
> > > >   What ZFS exposes is decidedly not useful for any real purposes, to
> > > >   paraphrase (hopefully faithfully) jhb's findings when exploring this:
> > > >
> > > >   The size of a directory in ZFS is the number of directory entries 
> > > > within.
> > > >   When reading a directory, you would instead get the leading part of 
> > > > its raw
> > > >   contents; the amount you get being dictated by the "size," i.e. 
> > > > number of
> > > >   directory entries. There's decidedly (luckily) no stack disclosure 
> > > > happening
> > > >   here, though the behavior is bizarre and almost certainly a historical
> > > >   accident.
> > > >
> > > >   This change has already been upstreamed to OpenZFS.
> > >
> > > Until the grep -d skip issue is addressed I object to this change as
> > > it is going to cause people who do grep with wildcards to see lots
> > > of errors that before where pretty much either silent (no match occured)
> > > or spit out a "binary file foo matches."
> > >
> > 
> > That seems preferable to grepping random bytes that don't particularly
> > contain any strings? They'd never see "binary file foo matches" in
> > this case.
> 
> The difference is you rarely get a hit, and now your gauranteed to
> get a hit on every single directory making grep * very noisy, where
> it was often silent or nearly silent before.

Please, go try this and see if you can see why I am asserting what I am:
(on one of your patched systems)
cd /etc
grep foo *
grep -d skip foo *  #This makes it closer to old behavior, not 
exact as binary matches shall be skipped.

The first command isg going to return an error for every directory,
the second command, closer to historical behavior, is going to be nearly silent.
You could run the second command on a pre patched system, ufs or zfs wont 
matter much.

> > This isn't exactly divergent from the behavior they'd see with ZFS
> > anywhere else.
> 
> It is extremly divergent from 42 years of behavior.
> 
> > Thanks,
> > 
> > Kyle Evans
> > 
> 
> -- 
> Rod Grimes rgri...@freebsd.org
> 

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


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Rodney W. Grimes
> On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
>  wrote:
> >
> > > Author: kevans
> > > Date: Tue May 19 02:41:05 2020
> > > New Revision: 361238
> > > URL: https://svnweb.freebsd.org/changeset/base/361238
> > >
> > > Log:
> > >   zfs: reject read(2) of a dirfd with EISDIR
> > >
> > >   This is independent of the recently-discussed global change, which is 
> > > still
> > >   in review/discussion stage.
> > >
> > >   This is effectively a measure for consistency in the ZFS world, where
> > >   FreeBSD was the only platform (as far as I could find) that allowed 
> > > this.
> > >   What ZFS exposes is decidedly not useful for any real purposes, to
> > >   paraphrase (hopefully faithfully) jhb's findings when exploring this:
> > >
> > >   The size of a directory in ZFS is the number of directory entries 
> > > within.
> > >   When reading a directory, you would instead get the leading part of its 
> > > raw
> > >   contents; the amount you get being dictated by the "size," i.e. number 
> > > of
> > >   directory entries. There's decidedly (luckily) no stack disclosure 
> > > happening
> > >   here, though the behavior is bizarre and almost certainly a historical
> > >   accident.
> > >
> > >   This change has already been upstreamed to OpenZFS.
> >
> > Until the grep -d skip issue is addressed I object to this change as
> > it is going to cause people who do grep with wildcards to see lots
> > of errors that before where pretty much either silent (no match occured)
> > or spit out a "binary file foo matches."
> >
> 
> That seems preferable to grepping random bytes that don't particularly
> contain any strings? They'd never see "binary file foo matches" in
> this case.

The difference is you rarely get a hit, and now your gauranteed to
get a hit on every single directory making grep * very noisy, where
it was often silent or nearly silent before.

> 
> This isn't exactly divergent from the behavior they'd see with ZFS
> anywhere else.

It is extremly divergent from 42 years of behavior.

> Thanks,
> 
> Kyle Evans
> 

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


svn commit: r361258 - head/sys/arm64/arm64

2020-05-19 Thread Andrew Turner
Author: andrew
Date: Tue May 19 15:27:20 2020
New Revision: 361258
URL: https://svnweb.freebsd.org/changeset/base/361258

Log:
  Create MSI/MSI-X isrcs as needed in the GICv3 ITS driver
  
  Previously we would create an isrc for each MSI/MSI-X interrupt. This
  causes issues for other interrupt sources in the system, e.g. a GPIO
  driver, as they may be unable to allocate interrupts. This works around
  this by allocating the isrc only when needed.
  
  Reported by:  alisa...@amazon.com
  Reviewed by:  mmel
  Sponsored by: Innovaate UK
  Differential Revision:https://reviews.freebsd.org/D24876

Modified:
  head/sys/arm64/arm64/gicv3_its.c

Modified: head/sys/arm64/arm64/gicv3_its.c
==
--- head/sys/arm64/arm64/gicv3_its.cTue May 19 15:19:39 2020
(r361257)
+++ head/sys/arm64/arm64/gicv3_its.cTue May 19 15:27:20 2020
(r361258)
@@ -228,6 +228,7 @@ struct gicv3_its_irqsrc {
u_int   gi_id;
u_int   gi_lpi;
struct its_dev  *gi_its_dev;
+   TAILQ_ENTRY(gicv3_its_irqsrc) gi_link;
 };
 
 struct gicv3_its_softc {
@@ -254,12 +255,14 @@ struct gicv3_its_softc {
size_t sc_its_cmd_next_idx;
 
vmem_t *sc_irq_alloc;
-   struct gicv3_its_irqsrc *sc_irqs;
+   struct gicv3_its_irqsrc **sc_irqs;
u_int   sc_irq_base;
u_int   sc_irq_length;
+   u_int   sc_irq_count;
 
struct mtx sc_its_dev_lock;
TAILQ_HEAD(its_dev_list, its_dev) sc_its_dev_list;
+   TAILQ_HEAD(free_irqs, gicv3_its_irqsrc) sc_free_irqs;
 
 #defineITS_FLAGS_CMDQ_FLUSH0x0001
 #defineITS_FLAGS_LPI_CONF_FLUSH0x0002
@@ -800,7 +803,6 @@ static int
 gicv3_its_attach(device_t dev)
 {
struct gicv3_its_softc *sc;
-   const char *name;
uint32_t iidr;
int domain, err, i, rid;
 
@@ -875,6 +877,7 @@ gicv3_its_attach(device_t dev)
its_init_cpu(dev, sc);
 
TAILQ_INIT(>sc_its_dev_list);
+   TAILQ_INIT(>sc_free_irqs);
 
/*
 * Create the vmem object to allocate INTRNG IRQs from. We try to
@@ -887,13 +890,6 @@ gicv3_its_attach(device_t dev)
 
sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * sc->sc_irq_length,
M_GICV3_ITS, M_WAITOK | M_ZERO);
-   name = device_get_nameunit(dev);
-   for (i = 0; i < sc->sc_irq_length; i++) {
-   sc->sc_irqs[i].gi_id = -1;
-   sc->sc_irqs[i].gi_lpi = i + sc->sc_irq_base - GIC_FIRST_LPI;
-   err = intr_isrc_register(>sc_irqs[i].gi_isrc, dev, 0,
-   "%s,%u", name, i);
-   }
 
/* For GIC-500 install tracking sysctls. */
if ((iidr & (GITS_IIDR_PRODUCT_MASK | GITS_IIDR_IMPLEMENTOR_MASK)) ==
@@ -975,7 +971,7 @@ gicv3_its_intr(void *arg, uintptr_t irq)
struct trapframe *tf;
 
irq -= sc->sc_irq_base;
-   girq = >sc_irqs[irq];
+   girq = sc->sc_irqs[irq];
if (girq == NULL)
panic("gicv3_its_intr: Invalid interrupt %ld",
irq + sc->sc_irq_base);
@@ -1201,6 +1197,53 @@ its_device_release(device_t dev, struct its_dev *its_d
free(its_dev, M_GICV3_ITS);
 }
 
+static struct gicv3_its_irqsrc *
+gicv3_its_alloc_irqsrc(device_t dev, struct gicv3_its_softc *sc, u_int irq)
+{
+   struct gicv3_its_irqsrc *girq = NULL;
+
+   KASSERT(sc->sc_irqs[irq] == NULL,
+   ("%s: Interrupt %u already allocated", __func__, irq));
+   mtx_lock_spin(>sc_its_dev_lock);
+   if (!TAILQ_EMPTY(>sc_free_irqs)) {
+   girq = TAILQ_FIRST(>sc_free_irqs);
+   TAILQ_REMOVE(>sc_free_irqs, girq, gi_link);
+   }
+   mtx_unlock_spin(>sc_its_dev_lock);
+   if (girq == NULL) {
+   girq = malloc(sizeof(*girq), M_GICV3_ITS,
+   M_NOWAIT | M_ZERO);
+   if (girq == NULL)
+   return (NULL);
+   girq->gi_id = -1;
+   if (intr_isrc_register(>gi_isrc, dev, 0,
+   "%s,%u", device_get_nameunit(dev), irq) != 0) {
+   free(girq, M_GICV3_ITS);
+   return (NULL);
+   }
+   }
+   girq->gi_lpi = irq + sc->sc_irq_base - GIC_FIRST_LPI;
+   sc->sc_irqs[irq] = girq;
+
+   return (girq);
+}
+
+static void
+gicv3_its_release_irqsrc(struct gicv3_its_softc *sc,
+struct gicv3_its_irqsrc *girq)
+{
+   u_int irq;
+
+   mtx_assert(>sc_its_dev_lock, MA_OWNED);
+
+   irq = girq->gi_lpi + GIC_FIRST_LPI - sc->sc_irq_base;
+   sc->sc_irqs[irq] = NULL;
+
+   girq->gi_id = -1;
+   girq->gi_its_dev = NULL;
+   TAILQ_INSERT_TAIL(>sc_free_irqs, girq, gi_link);
+}
+
 static int
 gicv3_its_alloc_msi(device_t dev, device_t child, int count, int maxcount,
 device_t *pic, struct intr_irqsrc **srcs)
@@ -1220,12 +1263,35 @@ gicv3_its_alloc_msi(device_t dev, device_t child, int 
  

Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Kyle Evans
On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes
 wrote:
>
> > Author: kevans
> > Date: Tue May 19 02:41:05 2020
> > New Revision: 361238
> > URL: https://svnweb.freebsd.org/changeset/base/361238
> >
> > Log:
> >   zfs: reject read(2) of a dirfd with EISDIR
> >
> >   This is independent of the recently-discussed global change, which is 
> > still
> >   in review/discussion stage.
> >
> >   This is effectively a measure for consistency in the ZFS world, where
> >   FreeBSD was the only platform (as far as I could find) that allowed this.
> >   What ZFS exposes is decidedly not useful for any real purposes, to
> >   paraphrase (hopefully faithfully) jhb's findings when exploring this:
> >
> >   The size of a directory in ZFS is the number of directory entries within.
> >   When reading a directory, you would instead get the leading part of its 
> > raw
> >   contents; the amount you get being dictated by the "size," i.e. number of
> >   directory entries. There's decidedly (luckily) no stack disclosure 
> > happening
> >   here, though the behavior is bizarre and almost certainly a historical
> >   accident.
> >
> >   This change has already been upstreamed to OpenZFS.
>
> Until the grep -d skip issue is addressed I object to this change as
> it is going to cause people who do grep with wildcards to see lots
> of errors that before where pretty much either silent (no match occured)
> or spit out a "binary file foo matches."
>

That seems preferable to grepping random bytes that don't particularly
contain any strings? They'd never see "binary file foo matches" in
this case.

This isn't exactly divergent from the behavior they'd see with ZFS
anywhere else.

Thanks,

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


Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-05-19 Thread Rodney W. Grimes
> Author: kevans
> Date: Tue May 19 02:41:05 2020
> New Revision: 361238
> URL: https://svnweb.freebsd.org/changeset/base/361238
> 
> Log:
>   zfs: reject read(2) of a dirfd with EISDIR
>   
>   This is independent of the recently-discussed global change, which is still
>   in review/discussion stage.
>   
>   This is effectively a measure for consistency in the ZFS world, where
>   FreeBSD was the only platform (as far as I could find) that allowed this.
>   What ZFS exposes is decidedly not useful for any real purposes, to
>   paraphrase (hopefully faithfully) jhb's findings when exploring this:
>   
>   The size of a directory in ZFS is the number of directory entries within.
>   When reading a directory, you would instead get the leading part of its raw
>   contents; the amount you get being dictated by the "size," i.e. number of
>   directory entries. There's decidedly (luckily) no stack disclosure happening
>   here, though the behavior is bizarre and almost certainly a historical
>   accident.
>   
>   This change has already been upstreamed to OpenZFS.

Until the grep -d skip issue is addressed I object to this change as
it is going to cause people who do grep with wildcards to see lots
of errors that before where pretty much either silent (no match occured)
or spit out a "binary file foo matches."

>   
>   MFC after:  1 week

Please no.

> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c   Tue May 
> 19 02:07:08 2020(r361237)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c   Tue May 
> 19 02:41:05 2020(r361238)
> @@ -646,6 +646,12 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t *
>   ZFS_ENTER(zfsvfs);
>   ZFS_VERIFY_ZP(zp);
>  
> + /* We don't copy out anything useful for directories. */
> + if (vp->v_type == VDIR) {
> + ZFS_EXIT(zfsvfs);
> + return (SET_ERROR(EISDIR));
> + }
> +
>   if (zp->z_pflags & ZFS_AV_QUARANTINED) {
>   ZFS_EXIT(zfsvfs);
>   return (SET_ERROR(EACCES));
> 

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


svn commit: r361257 - head/usr.sbin/bsdinstall/scripts

2020-05-19 Thread Kyle Evans
Author: kevans
Date: Tue May 19 15:19:39 2020
New Revision: 361257
URL: https://svnweb.freebsd.org/changeset/base/361257

Log:
  bsdinstall: do a `certctl rehash` upon installation of configuration
  
  If certctl is installed on the system we're configuring, do a certctl
  rehash.
  
  Note that certctl may not be present if the world we've installed was built
  either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't
  currently see if the host has a certctl as this may be an indication that
  the system *shouldn't* have certs installed into /etc/ssl.
  
  Reviewed by:  allanjude, dteske
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D24640

Modified:
  head/usr.sbin/bsdinstall/scripts/config

Modified: head/usr.sbin/bsdinstall/scripts/config
==
--- head/usr.sbin/bsdinstall/scripts/config Tue May 19 14:42:09 2020
(r361256)
+++ head/usr.sbin/bsdinstall/scripts/config Tue May 19 15:19:39 2020
(r361257)
@@ -55,6 +55,9 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
 
 # Set up other things from installed config
 chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
+if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then
+   chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash
+fi
 
 exit 0
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347418 - head/sys/net

2020-05-19 Thread Andrew Gallatin

On 2020-05-19 04:21, Kristof Provost wrote:

The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, INT32_MAX, 
INT32_MAX},|, so presumably that’s the cause.
I don’t know what a sane value would be though. I’ve defaulted to 4096 
(because that’s what some other iflib users seems to do) for now, and 
that seems to work. It doesn’t panic and I can get traffic through it at 
least:


You seem to be setting the max, not the default, and 4K max descriptors 
on a 100g device is going to basically cripple it.


How about setting to the next power of 2 below max int so as to keep 
with the authors intent?


If we don't already have a macro, something like  (INT32_MAX >> 1) + 1

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


svn commit: r361254 - head/sys/netgraph/bluetooth/include

2020-05-19 Thread Takanori Watanabe
Author: takawata
Date: Tue May 19 13:58:52 2020
New Revision: 361254
URL: https://svnweb.freebsd.org/changeset/base/361254

Log:
  Fix Typo in ng_hci_le_connection_complete_ep struct.
  
  PR:   246538
  Submitted by: Marc Veldman

Modified:
  head/sys/netgraph/bluetooth/include/ng_hci.h

Modified: head/sys/netgraph/bluetooth/include/ng_hci.h
==
--- head/sys/netgraph/bluetooth/include/ng_hci.hTue May 19 13:54:33 
2020(r361253)
+++ head/sys/netgraph/bluetooth/include/ng_hci.hTue May 19 13:58:52 
2020(r361254)
@@ -1964,7 +1964,7 @@ typedef struct {
u_int16_t   interval;
u_int8_tlatency;
u_int16_t   supervision_timeout;
-   u_int8_tmaster_clock_accracy;
+   u_int8_tmaster_clock_accuracy;

 } __attribute__ ((packed)) ng_hci_le_connection_complete_ep;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361253 - head

2020-05-19 Thread Mark Johnston
Author: markj
Date: Tue May 19 13:54:33 2020
New Revision: 361253
URL: https://svnweb.freebsd.org/changeset/base/361253

Log:
  Belatedly add a RELNOTES entry for r347532.

Modified:
  head/RELNOTES

Modified: head/RELNOTES
==
--- head/RELNOTES   Tue May 19 13:52:34 2020(r361252)
+++ head/RELNOTES   Tue May 19 13:54:33 2020(r361253)
@@ -174,4 +174,10 @@ r347908-r347923:
ed(4), ep(4), ex(4), fe(4), pcn(4), sf(4), sn(4), tl(4), tx(4), txp(4),
vx(4), wb(4), xe(4).
 
+r347532:
+   Wired page accounting has been split into kernel wirings and user
+   wirings (e.g., by mlock(2)).  Kernel wirings no long count towards
+   the global limit, which is renamed to vm.max_user_wired.  bhyve -S
+   allocates user-wired memory and is now subject to that limit.
+
 $FreeBSD$
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361251 - head/usr.sbin/bluetooth/hccontrol

2020-05-19 Thread Takanori Watanabe
Author: takawata
Date: Tue May 19 13:44:32 2020
New Revision: 361251
URL: https://svnweb.freebsd.org/changeset/base/361251

Log:
  Add LE Whitelist commands to hccontrol
  
  PR: 214555
  Submitted by Marc Veldman

Modified:
  head/usr.sbin/bluetooth/hccontrol/hccontrol.8
  head/usr.sbin/bluetooth/hccontrol/le.c

Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8
==
--- head/usr.sbin/bluetooth/hccontrol/hccontrol.8   Tue May 19 12:16:44 
2020(r361250)
+++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8   Tue May 19 13:44:32 
2020(r361251)
@@ -157,6 +157,10 @@ are:
 .It Cm LE_Read_Supported_States
 .It Cm LE_Read_Buffer_Size
 .It Cm LE Scan
+.It Cm LE_Read_White_List_Size
+.It Cm LE_Clear_White_List
+.It Cm LE_Add_Device_To_White_List
+.It Cm LE_Remove_Device_From_White_List
 .El
 .Pp
 The currently supported node commands in

Modified: head/usr.sbin/bluetooth/hccontrol/le.c
==
--- head/usr.sbin/bluetooth/hccontrol/le.c  Tue May 19 12:16:44 2020
(r361250)
+++ head/usr.sbin/bluetooth/hccontrol/le.c  Tue May 19 13:44:32 2020
(r361251)
@@ -63,6 +63,10 @@ static int le_set_advertising_param(int s, int argc, c
 static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]);
 static int le_scan(int s, int argc, char *argv[]);
 static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose);
+static int le_read_white_list_size(int s, int argc, char *argv[]);
+static int le_clear_white_list(int s, int argc, char *argv[]);
+static int le_add_device_to_white_list(int s, int argc, char *argv[]);
+static int le_remove_device_from_white_list(int s, int argc, char *argv[]);
 
 static int
 le_set_scan_param(int s, int argc, char *argv[])
@@ -762,6 +766,173 @@ static void handle_le_event(ng_hci_event_pkt_t* e, boo
}
 }
 
+static int
+le_read_white_list_size(int s, int argc, char *argv[])
+{
+   ng_hci_le_read_white_list_size_rp rp;
+   int n;
+
+   n = sizeof(rp);
+
+   if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE,
+   NG_HCI_OCF_LE_READ_WHITE_LIST_SIZE), 
+   (void *), ) == ERROR)
+   return (ERROR);
+   
+   if (rp.status != 0x00) {
+   fprintf(stdout, "Status: %s [%#02x]\n", 
+   hci_status2str(rp.status), rp.status);
+   return (FAILED);
+   }
+
+fprintf(stdout, "White list size: %d\n",
+   (uint8_t)rp.white_list_size);
+
+   return (OK);
+}
+
+static int
+le_clear_white_list(int s, int argc, char *argv[])
+{
+   ng_hci_le_clear_white_list_rp rp;
+   int n;
+
+   n = sizeof(rp);
+
+   if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE,
+   NG_HCI_OCF_LE_CLEAR_WHITE_LIST), 
+   (void *), ) == ERROR)
+   return (ERROR);
+   
+   if (rp.status != 0x00) {
+   fprintf(stdout, "Status: %s [%#02x]\n", 
+   hci_status2str(rp.status), rp.status);
+   return (FAILED);
+   }
+
+fprintf(stdout, "White list cleared\n");
+
+   return (OK);
+}
+
+static int
+le_add_device_to_white_list(int s, int argc, char *argv[])
+{
+   ng_hci_le_add_device_to_white_list_cp cp;
+   ng_hci_le_add_device_to_white_list_rp rp;
+   int n;
+   char ch;
+   optreset = 1;
+   optind = 0;
+   bool addr_set = false;
+
+   n = sizeof(rp);
+
+   cp.address_type = 0x00;
+
+   while ((ch = getopt(argc, argv , "t:a:")) != -1) {
+   switch(ch) {
+   case 't':
+   if (strcmp(optarg, "public") == 0)
+   cp.address_type = 0x00;
+   else if (strcmp(optarg, "random") == 0)
+   cp.address_type = 0x01;
+   else 
+   return (USAGE);
+   break;
+   case 'a':
+   addr_set = true;
+   if (!bt_aton(optarg, )) {
+   struct hostent  *he = NULL;
+
+   if ((he = bt_gethostbyname(optarg)) == NULL)
+   return (USAGE);
+
+   memcpy(, he->h_addr,
+   sizeof(cp.address));
+   }
+   break;
+   }
+   }
+
+   if (addr_set == false) 
+   return (USAGE);
+
+   if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE,
+   NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST), 
+   (void *), sizeof(cp), (void *), ) == ERROR)
+   return (ERROR);
+   
+   if (rp.status != 0x00) {
+   fprintf(stdout, "Status: %s [%#02x]\n", 
+

svn commit: r361250 - head/sbin/swapon

2020-05-19 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Tue May 19 12:16:44 2020
New Revision: 361250
URL: https://svnweb.freebsd.org/changeset/base/361250

Log:
  The -F flag of swapon(8) requires -a to work.
  
  Before this change, swapon(8) implied that -F works as a standalone option,
  which is not the case and would produce a usage message. This change extends
  the description of the -F option to mention that -a is required with it.
  
  PR:   238551
  Submitted by: Christian Baltini
  MFC after:5 days

Modified:
  head/sbin/swapon/swapon.8

Modified: head/sbin/swapon/swapon.8
==
--- head/sbin/swapon/swapon.8   Tue May 19 11:05:27 2020(r361249)
+++ head/sbin/swapon/swapon.8   Tue May 19 12:16:44 2020(r361250)
@@ -28,7 +28,7 @@
 .\" @(#)swapon.8   8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd June 21, 2019
+.Dd May 19, 2020
 .Dt SWAPON 8
 .Os
 .Sh NAME
@@ -98,7 +98,7 @@ To delay
 .Nm swapon
 for a device until after
 .Nm savecore
-has copied the crash dump to another location, use the 
+has copied the crash dump to another location, use the
 .Dq late
 option.
 .Pp
@@ -143,7 +143,8 @@ are as follows:
 .It Fl F Ar fstab
 Specify the
 .Pa fstab
-file to use.
+file to use (in conjunction with
+.Fl a Ns ).
 .El
 .Pp
 The
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361249 - head/lib/libc/stdlib

2020-05-19 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Tue May 19 11:05:27 2020
New Revision: 361249
URL: https://svnweb.freebsd.org/changeset/base/361249

Log:
  Fix a typo: argments -> arguments
  
  PR:   243294
  Submitted by: Igor Ostapenko
  MFC after:5 days

Modified:
  head/lib/libc/stdlib/getopt_long.3

Modified: head/lib/libc/stdlib/getopt_long.3
==
--- head/lib/libc/stdlib/getopt_long.3  Tue May 19 09:17:20 2020
(r361248)
+++ head/lib/libc/stdlib/getopt_long.3  Tue May 19 11:05:27 2020
(r361249)
@@ -244,7 +244,7 @@ matching the default behavior of
 .Xr getopt 3 .
 The default behavior without
 .Ql \&+
-is to permute non-option argments to the end of
+is to permute non-option arguments to the end of
 .Fa argv .
 .Pp
 A leading
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361248 - head/usr.bin/sed

2020-05-19 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Tue May 19 09:17:20 2020
New Revision: 361248
URL: https://svnweb.freebsd.org/changeset/base/361248

Log:
  Update SYNOPSIS section to be consistent regarding -u, -i, and -I.
  
  Apparently, when the -u, -i and -I options where added to sed(1), it was
  forgotten to add them to both lines in the SYNOPSIS section. They were only
  added to the second line, although they apply to both.
  
  With the updated SYNOPSIS, it is now allowed (and consistent) to run:
  
  sed -i BAK s/foo/bar/g some_file
  
  PR:   240556
  Submitted by: Oliver Fromme
  MFC after:5 days

Modified:
  head/usr.bin/sed/sed.1

Modified: head/usr.bin/sed/sed.1
==
--- head/usr.bin/sed/sed.1  Tue May 19 09:04:35 2020(r361247)
+++ head/usr.bin/sed/sed.1  Tue May 19 09:17:20 2020(r361248)
@@ -31,7 +31,7 @@
 .\"@(#)sed.1   8.2 (Berkeley) 12/30/93
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2017
+.Dd May 19, 2020
 .Dt SED 1
 .Os
 .Sh NAME
@@ -41,9 +41,11 @@
 .Nm
 .Op Fl Ealnru
 .Ar command
+.Op Fl I Ar extension
+.Op Fl i Ar extension
 .Op Ar
 .Nm
-.Op Fl Ealnr
+.Op Fl Ealnru
 .Op Fl e Ar command
 .Op Fl f Ar command_file
 .Op Fl I Ar extension
@@ -197,7 +199,8 @@ option was specified);
 .It
 a context address
 that consists of a regular expression preceded and followed by a
-delimiter. The closing delimiter can also optionally be followed by the
+delimiter.
+The closing delimiter can also optionally be followed by the
 .Dq I
 character, to indicate that the regular expression is to be matched
 in a case-insensitive way.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361247 - head/sys/compat/linuxkpi/common/include/linux

2020-05-19 Thread Emmanuel Vadot
Author: manu
Date: Tue May 19 09:04:35 2020
New Revision: 361247
URL: https://svnweb.freebsd.org/changeset/base/361247

Log:
  linuxkpi: Add irq_work.h
  
  Since handlers are call in a thread context we can simply use a workqueue
  to emulate those functions.
  The DRM code was patched to do that already, having it in linuxkpi allows us
  to not patch the upstream code.
  
  Sponsored-by: The FreeBSD Foundation
  Reviewed by:  hselasky
  Differential Revision:https://reviews.freebsd.org/D24859

Added:
  head/sys/compat/linuxkpi/common/include/linux/irq_work.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/irq_work.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/irq_work.hTue May 19 
09:04:35 2020(r361247)
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __LINUX_IRQ_WORK_H__
+#define__LINUX_IRQ_WORK_H__
+
+#include 
+
+struct irq_work {
+   struct work_struct work;
+};
+
+static inline void
+init_irq_work(struct irq_work *irqw, void (*func)(struct irq_work *))
+{
+   INIT_WORK(>work, (work_func_t)func);
+}
+
+static inline void
+irq_work_queue(struct irq_work *irqw)
+{
+   schedule_work(>work);
+}
+
+#endif /* __LINUX_IRQ_WORK_H__ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361246 - head/sys/compat/linuxkpi/common/include/linux

2020-05-19 Thread Emmanuel Vadot
Author: manu
Date: Tue May 19 08:44:33 2020
New Revision: 361246
URL: https://svnweb.freebsd.org/changeset/base/361246

Log:
  linuxkpi: add pci_dev_present
  
  pci_dev_present shows if a set of pci ids are present in the system.
  It just wraps pci_find_device.
  Needed by DRMv5.2
  
  Submitted by: Austing Shafer (asha...@badland.io)
  Differential Revision:https://reviews.freebsd.org/D24796

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:43:17 
2020(r361245)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:44:33 
2020(r361246)
@@ -1050,4 +1050,16 @@ extern int linux_pci_attach_device(device_t, struct pc
 const struct pci_device_id *, struct pci_dev *);
 extern int linux_pci_detach_device(struct pci_dev *);
 
+static inline int
+pci_dev_present(const struct pci_device_id *cur)
+{
+   while (cur != NULL && (cur->vendor || cur->device)) {
+   if (pci_find_device(cur->vendor, cur->device) != NULL) {
+   return (1);
+   }
+   cur++;
+   }
+   return (0);
+}
+
 #endif /* _LINUX_PCI_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r361245 - head/sys/compat/linuxkpi/common/include/linux

2020-05-19 Thread Emmanuel Vadot
Author: manu
Date: Tue May 19 08:43:17 2020
New Revision: 361245
URL: https://svnweb.freebsd.org/changeset/base/361245

Log:
  linuxkpi: Add __init_waitqueue_head
  
  The only difference with init_waitqueue_head is that the name and the
  lock class key are provided but we don't use those so use init_waitqueue_head
  directly.
  
  Sponsored-by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D24861

Modified:
  head/sys/compat/linuxkpi/common/include/linux/wait.h

Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h
==
--- head/sys/compat/linuxkpi/common/include/linux/wait.hTue May 19 
07:47:59 2020(r361244)
+++ head/sys/compat/linuxkpi/common/include/linux/wait.hTue May 19 
08:43:17 2020(r361245)
@@ -119,6 +119,8 @@ extern wait_queue_func_t default_wake_function;
INIT_LIST_HEAD(&(wqh)->task_list);  \
 } while (0)
 
+#define__init_waitqueue_head(wqh, name, lk) init_waitqueue_head(wqh)
+
 void linux_init_wait_entry(wait_queue_t *, int);
 void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r347418 - head/sys/net

2020-05-19 Thread Kristof Provost

On 10 May 2019, at 2:41, Eric Joyner wrote:

Author: erj
Date: Fri May 10 00:41:42 2019
New Revision: 347418
URL: https://svnweb.freebsd.org/changeset/base/347418

Log:
  iflib: use default ntxd and nrxd when user value is not power of 2

  From Jake:
  A user may set a sysctl to override the default number of Tx or Rx
  descriptors. However, certain calculations in the iflib core expect 
the

  number of descriptors to be a power of 2.

  Update _iflib_assert to verify that all of the shared context 
parameters

  for the number of descriptors are powers of 2.

  Modify iflib_reset_qvalues to check that the provided isc_nrxd value 
is

  a power of 2. If it's not, print a warning message and then use the
  default value.

  An alternative might be to try rounding the number down instead.
  However, this creates problems in case the rounded down value is 
below

  the minimum value that the driver would support.

This commit appears to trigger a panic I see on a system with a Broadcom 
BCM57416 (if_bnxt) nic.


It trips over the power of two assertion:

	panic: Assertion powerof2(sctx->isc_nrxd_max[i]) failed at 
/usr/src/sys/net/iflib.c:5320

Tracing pid 0 tid 10 td 0x81c8c640
kdb_enter() at kdb_enter+0x37/frame 0x825be990
vpanic() at vpanic+0x19e/frame 0x825be9e0
panic() at panic+0x43/frame 0x825bea40
iflib_register() at iflib_register+0x340/frame 0x825bea80
	iflib_device_register() at iflib_device_register+0x9f/frame 
0x825bee10
	iflib_device_attach() at iflib_device_attach+0xb5/frame 
0x825bee40

device_attach() at device_attach+0x3ca/frame 0x825bee80
	device_probe_and_attach() at device_probe_and_attach+0x70/frame 
0x825beeb0
	bus_generic_attach() at bus_generic_attach+0x18/frame 
0x825beed0

pci_attach() at pci_attach+0xe0/frame 0x825bef10
acpi_pci_attach() at acpi_pci_attach+0x19/frame 0x825bf150
device_attach() at device_attach+0x3ca/frame 0x825bf190
	device_probe_and_attach() at device_probe_and_attach+0x70/frame 
0x825bf1c0
	bus_generic_attach() at bus_generic_attach+0x18/frame 
0x825bf1e0
	acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x431/frame 
0x825bf250

device_attach() at device_attach+0x3ca/frame 0x825bf290
	device_probe_and_attach() at device_probe_and_attach+0x70/frame 
0x825bf2c0
	bus_generic_attach() at bus_generic_attach+0x18/frame 
0x825bf2e0

acpi_attach() at acpi_attach+0xbb7/frame 0x825bf370
device_attach() at device_attach+0x3ca/frame 0x825bf3b0
	device_probe_and_attach() at device_probe_and_attach+0x70/frame 
0x825bf3e0
	bus_generic_attach() at bus_generic_attach+0x18/frame 
0x825bf400

device_attach() at device_attach+0x3ca/frame 0x825bf440
	device_probe_and_attach() at device_probe_and_attach+0x70/frame 
0x825bf470
	bus_generic_new_pass() at bus_generic_new_pass+0xed/frame 
0x825bf4a0

bus_set_pass() at bus_set_pass+0x46/frame 0x825bf4d0
configure() at configure+0x9/frame 0x825bf4e0
mi_startup() at mi_startup+0xec/frame 0x825bf530
btext() at btext+0x2c

The if_bnxt driver initialises `.isc_nrxd_max = {INT32_MAX, INT32_MAX, 
INT32_MAX},`, so presumably that’s the cause.
I don’t know what a sane value would be though. I’ve defaulted to 
4096 (because that’s what some other iflib users seems to do) for now, 
and that seems to work. It doesn’t panic and I can get traffic through 
it at least:


diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c
index 50827106024..3958d95cab9 100644
--- a/sys/dev/bnxt/if_bnxt.c
+++ b/sys/dev/bnxt/if_bnxt.c
@@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = {
.isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8,
PAGE_SIZE / sizeof(struct rx_prod_pkt_bd),
PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)},
-   .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX},
+   .isc_nrxd_max = {4096, 4096, 4096},
.isc_ntxd_min = {16, 16, 16},
.isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2,
PAGE_SIZE / sizeof(struct tx_bd_short)},
-   .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX},
+   .isc_ntxd_max = {4096, 4096, 4096},

.isc_admin_intrcnt = 1,
.isc_vendor_info = bnxt_vendor_info_array,


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


svn commit: r361243 - head/sys/netinet

2020-05-19 Thread Michael Tuexen
Author: tuexen
Date: Tue May 19 07:23:35 2020
New Revision: 361243
URL: https://svnweb.freebsd.org/changeset/base/361243

Log:
  Replace snprintf() by SCTP_SNPRINTF() and let SCTP_SNPRINTF() map
  to snprintf() on FreeBSD. This allows to check for failures of snprintf()
  on platforms other than FreeBSD kernel.

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Tue May 19 07:21:11 2020
(r361242)
+++ head/sys/netinet/sctp_asconf.c  Tue May 19 07:23:35 2020
(r361243)
@@ -1706,8 +1706,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
char msg[SCTP_DIAG_INFO_LEN];
 
SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected 
next serial number! Aborting asoc!\n");
-   snprintf(msg, sizeof(msg), "Never sent serial number %8.8x",
-   serial_num);
+   SCTP_SNPRINTF(msg, sizeof(msg), "Never sent serial number 
%8.8x", serial_num);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, 
msg);
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, 
SCTP_SO_NOT_LOCKED);
*abort_no_unlock = 1;

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Tue May 19 07:21:11 2020
(r361242)
+++ head/sys/netinet/sctp_indata.c  Tue May 19 07:23:35 2020
(r361243)
@@ -434,7 +434,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb,
struct mbuf *oper;
 
if (stcb->asoc.idata_supported) {
-   snprintf(msg, sizeof(msg),
+   SCTP_SNPRINTF(msg, sizeof(msg),
"Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x",
opspot,
control->fsn_included,
@@ -442,7 +442,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb,
chk->rec.data.sid,
chk->rec.data.fsn, chk->rec.data.mid);
} else {
-   snprintf(msg, sizeof(msg),
+   SCTP_SNPRINTF(msg, sizeof(msg),
"Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x",
opspot,
control->fsn_included,
@@ -533,11 +533,11 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
 */
TAILQ_INSERT_HEAD(>inqueue, control, next_instrm);
if (asoc->idata_supported) {
-   snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got 
TSN=%8.8x, SID=%4.4x, MID=%8.8x",
+   SCTP_SNPRINTF(msg, sizeof(msg), "Delivered MID=%8.8x, 
got TSN=%8.8x, SID=%4.4x, MID=%8.8x",
strm->last_mid_delivered, control->sinfo_tsn,
control->sinfo_stream, control->mid);
} else {
-   snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got 
TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
+   SCTP_SNPRINTF(msg, sizeof(msg), "Delivered SSN=%4.4x, 
got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
(uint16_t)strm->last_mid_delivered,
control->sinfo_tsn,
control->sinfo_stream,
@@ -648,9 +648,8 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
 * to put it on the queue.
 */
if (sctp_place_control_in_stream(strm, asoc, control)) {
-   snprintf(msg, sizeof(msg),
-   "Queue to str MID: %u duplicate",
-   control->mid);
+   SCTP_SNPRINTF(msg, sizeof(msg),
+   "Queue to str MID: %u duplicate", control->mid);
sctp_clean_up_control(stcb, control);
op_err = 
sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA 
+ SCTP_LOC_3;
@@ -1881,8 +1880,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc
 * can *not* be fsn 0. XXX: This can happen in case of a
 * wrap around. Ignore is for now.
 */
-   snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but 
flags=%2.2x",
-   mid, chk_flags);
+   SCTP_SNPRINTF(msg, sizeof(msg), "FSN zero for MID=%8.8x, but 
flags=%2.2x", mid, chk_flags);
goto err_out;
}
control = sctp_find_reasm_entry(>strmin[sid], mid, ordered, 
asoc->idata_supported);
@@ -1893,7 +1891,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc
if (control != NULL) {
 

svn commit: r361242 - head/sys/netinet

2020-05-19 Thread Michael Tuexen
Author: tuexen
Date: Tue May 19 07:21:11 2020
New Revision: 361242
URL: https://svnweb.freebsd.org/changeset/base/361242

Log:
  Revert r361209:
  
  cem noted that on FreeBSD snprintf() can not fail and code should not
  check for that.
  
  A followup commit will replace the usage of snprintf() in the SCTP
  sources with a variadic macro SCTP_SNPRINTF, which will simply map to
  snprintf() on FreeBSD and do a checking similar to r361209 on
  other platforms.

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Tue May 19 07:16:09 2020
(r361241)
+++ head/sys/netinet/sctp_asconf.c  Tue May 19 07:21:11 2020
(r361242)
@@ -1706,9 +1706,8 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
char msg[SCTP_DIAG_INFO_LEN];
 
SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected 
next serial number! Aborting asoc!\n");
-   if (snprintf(msg, sizeof(msg), "Never sent serial number 
%8.8x", serial_num) < 0) {
-   msg[0] = '\0';
-   }
+   snprintf(msg, sizeof(msg), "Never sent serial number %8.8x",
+   serial_num);
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, 
msg);
sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, 
SCTP_SO_NOT_LOCKED);
*abort_no_unlock = 1;

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Tue May 19 07:16:09 2020
(r361241)
+++ head/sys/netinet/sctp_indata.c  Tue May 19 07:21:11 2020
(r361242)
@@ -434,26 +434,22 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb,
struct mbuf *oper;
 
if (stcb->asoc.idata_supported) {
-   if (snprintf(msg, sizeof(msg),
+   snprintf(msg, sizeof(msg),
"Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x",
opspot,
control->fsn_included,
chk->rec.data.tsn,
chk->rec.data.sid,
-   chk->rec.data.fsn, chk->rec.data.mid) < 0) {
-   msg[0] = '\0';
-   }
+   chk->rec.data.fsn, chk->rec.data.mid);
} else {
-   if (snprintf(msg, sizeof(msg),
+   snprintf(msg, sizeof(msg),
"Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x",
opspot,
control->fsn_included,
chk->rec.data.tsn,
chk->rec.data.sid,
chk->rec.data.fsn,
-   (uint16_t)chk->rec.data.mid) < 0) {
-   msg[0] = '\0';
-   }
+   (uint16_t)chk->rec.data.mid);
}
oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
sctp_m_freem(chk->data);
@@ -537,19 +533,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
 */
TAILQ_INSERT_HEAD(>inqueue, control, next_instrm);
if (asoc->idata_supported) {
-   if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, 
got TSN=%8.8x, SID=%4.4x, MID=%8.8x",
+   snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got 
TSN=%8.8x, SID=%4.4x, MID=%8.8x",
strm->last_mid_delivered, control->sinfo_tsn,
-   control->sinfo_stream, control->mid) < 0) {
-   msg[0] = '\0';
-   }
+   control->sinfo_stream, control->mid);
} else {
-   if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, 
got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
+   snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got 
TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
(uint16_t)strm->last_mid_delivered,
control->sinfo_tsn,
control->sinfo_stream,
-   (uint16_t)control->mid) < 0) {
-   msg[0] = '\0';
-   }
+   (uint16_t)control->mid);
}
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, 
msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + 
SCTP_LOC_2;
@@ -656,10 +648,9 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
 * to put it on the queue.
 */
if (sctp_place_control_in_stream(strm, asoc, control)) {
-   if (snprintf(msg, sizeof(msg),
-  

svn commit: r361241 - head/tests/sys/netinet

2020-05-19 Thread Li-Wen Hsu
Author: lwhsu
Date: Tue May 19 07:16:09 2020
New Revision: 361241
URL: https://svnweb.freebsd.org/changeset/base/361241

Log:
  Revert r361237, it's fixed by r361231
  
  PR:   246560
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/netinet/so_reuseport_lb_test.c

Modified: head/tests/sys/netinet/so_reuseport_lb_test.c
==
--- head/tests/sys/netinet/so_reuseport_lb_test.c   Tue May 19 03:24:45 
2020(r361240)
+++ head/tests/sys/netinet/so_reuseport_lb_test.c   Tue May 19 07:16:09 
2020(r361241)
@@ -188,9 +188,6 @@ ATF_TC_BODY(basic_ipv6, tc)
int error, sds[16];
uint16_t port;
 
-   if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-   atf_tc_skip("https://bugs.freebsd.org/246560;);
-
sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK);
 
memset(, 0, sizeof(addr));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"