svn commit: r322338 - head/sys/net

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 03:43:23 2017
New Revision: 322338
URL: https://svnweb.freebsd.org/changeset/base/322338

Log:
  Don't leak mbufs if clusers exceeds the number of segments.  This would
  leak mbufs over time causing crashes.
  
  PR:   221202
  Submitted by: Matt Macy 
  Reported by:  gergely.czu...@harmless.hu
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug 10 03:11:05 2017(r322337)
+++ head/sys/net/iflib.cThu Aug 10 03:43:23 2017(r322338)
@@ -267,6 +267,8 @@ iflib_get_sctx(if_ctx_t ctx)
 #define RX_SW_DESC_INUSE(1 << 3)
 #define TX_SW_DESC_MAPPED   (1 << 4)
 
+#defineM_TOOBIGM_UNUSED_8
+
 typedef struct iflib_sw_rx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
struct mbuf **ifsd_m;   /* pkthdr mbufs */
@@ -2930,8 +2932,11 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
m = m->m_next;
count++;
} while (m != NULL);
-   if (count > *nsegs)
+   if (count > *nsegs) {
+   ifsd_m[pidx] = *m0;
+   ifsd_m[pidx]->m_flags |= M_TOOBIG;
return (0);
+   }
m = *m0;
count = 0;
do {
@@ -3241,8 +3246,15 @@ iflib_tx_desc_free(iflib_txq_t txq, int n)
if ((m = ifsd_m[cidx]) != NULL) {
/* XXX we don't support any drivers that batch 
packets yet */
MPASS(m->m_nextpkt == NULL);
-
-   m_free(m);
+   /* if the number of clusters exceeds the number 
of segments
+* there won't be space on the ring to save a 
pointer to each
+* cluster so we simply free the list here
+*/
+   if (m->m_flags & M_TOOBIG) {
+   m_freem(m);
+   } else {
+   m_free(m);
+   }
ifsd_m[cidx] = NULL;
 #if MEMORY_LOGGING
txq->ift_dequeued++;
___
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: r322337 - head/sys/net

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 03:11:05 2017
New Revision: 322337
URL: https://svnweb.freebsd.org/changeset/base/322337

Log:
  Export IFCAP_HWSTATS so that we don't experience double stats counting
  on iflib enabled devices.
  
  PR:   220198
  Submitted by: Matt Macy 
  Reported by:  Ben Woods 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug 10 02:55:22 2017(r322336)
+++ head/sys/net/iflib.cThu Aug 10 03:11:05 2017(r322337)
@@ -3723,7 +3723,7 @@ iflib_if_qflush(if_t ifp)
 
 
 #define IFCAP_FLAGS (IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6 | IFCAP_HWCSUM | 
IFCAP_LRO | \
-IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING |   \
+IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | 
IFCAP_HWSTATS | \
 IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO)
 
 static int
@@ -4096,8 +4096,8 @@ iflib_device_register(device_t dev, void *sc, if_share
MPASS(scctx->isc_tx_csum_flags);
 #endif
 
-   if_setcapabilities(ifp, scctx->isc_capenable);
-   if_setcapenable(ifp, scctx->isc_capenable);
+   if_setcapabilities(ifp, scctx->isc_capenable | IFCAP_HWSTATS);
+   if_setcapenable(ifp, scctx->isc_capenable | IFCAP_HWSTATS);
 
if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && 
scctx->isc_ntxqsets_max < scctx->isc_ntxqsets))
scctx->isc_ntxqsets = scctx->isc_ntxqsets_max;
___
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: r322336 - head/usr.bin/calendar/calendars

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 02:55:22 2017
New Revision: 322336
URL: https://svnweb.freebsd.org/changeset/base/322336

Log:
  Add sbruno@ birthday information.
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 02:15:40 
2017(r322335)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 02:55:22 
2017(r322336)
@@ -427,6 +427,7 @@
 12/18  Semen Ustimenko  born in Novosibirsk, Russian 
Federation, 1979
 12/19  Stephen Hurd  born in Estevan, Saskatchewan, Canada, 
1975
 12/19  Emmanuel Vadot  born in Decines-Charpieu, France, 1983
+12/20  Sean Bruno  born in Monterey, California, USA, 1974
 12/21  Rong-En Fan  born in Taipei, Taiwan, Republic of 
China, 1982
 12/22  Alan L. Cox  born in Warren, Ohio, United States, 1964
 12/22  Maxim Sobolev  born in Dnepropetrovsk, Ukraine, 
1976
___
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: r322335 - head/usr.bin/calendar/calendars

2017-08-09 Thread Ryan Libby
Author: rlibby
Date: Thu Aug 10 02:15:40 2017
New Revision: 322335
URL: https://svnweb.freebsd.org/changeset/base/322335

Log:
  Add myself (rlibby) to calendar.freebsd
  
  Reported by:  mckusick
  Approved by:  markj (mentor)
  Differential Revision:https://reviews.freebsd.org/D11947

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 00:39:02 
2017(r322334)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 02:15:40 
2017(r322335)
@@ -219,6 +219,7 @@
 06/04  Zack Kirsch  born in Memphis, Tennessee, United 
States, 1982
 06/04  Johannes Jost Meixner  born in Wiesbaden, Germany, 
1987
 06/06  Sergei Kolobov  born in Karpinsk, Russian 
Federation, 1972
+06/06  Ryan Libby  born in Kirkland, Washington, United 
States, 1985
 06/06  Alan Eldridge  died in Denver, Colorado, 2003
 06/07  Jimmy Olgeni  born in Milano, Italy, 1976
 06/07  Benjamin Close  born in Adelaide, Australia, 1978
___
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: r322332 - in head: contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2017-08-09 Thread Ryan Libby
Author: rlibby
Date: Wed Aug  9 22:58:42 2017
New Revision: 322332
URL: https://svnweb.freebsd.org/changeset/base/322332

Log:
  Pick 'Remove external linkage for spin_adaptive' from upstream jemalloc
  
  Apply the changes from upstream jemalloc 048c6679.  This is actually not
  quite a cherry pick due to makefile difference and because FreeBSD does
  not carry the msvc project files which were also modified in that
  commit.
  
  Approved by:  jasone (maintainer), markj (mentor)
  Sponsored by: Dell EMC Isilon

Deleted:
  head/contrib/jemalloc/src/spin.c
Modified:
  head/contrib/jemalloc/include/jemalloc/internal/spin.h
  head/lib/libc/stdlib/jemalloc/Makefile.inc

Modified: head/contrib/jemalloc/include/jemalloc/internal/spin.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/spin.h  Wed Aug  9 
22:18:49 2017(r322331)
+++ head/contrib/jemalloc/include/jemalloc/internal/spin.h  Wed Aug  9 
22:58:42 2017(r322332)
@@ -1,19 +1,13 @@
 #ifndef JEMALLOC_INTERNAL_SPIN_H
 #define JEMALLOC_INTERNAL_SPIN_H
 
-#ifdef JEMALLOC_SPIN_C_
-#  define SPIN_INLINE extern inline
-#else
-#  define SPIN_INLINE inline
-#endif
-
 #define SPIN_INITIALIZER {0U}
 
 typedef struct {
unsigned iteration;
 } spin_t;
 
-SPIN_INLINE void
+static inline void
 spin_adaptive(spin_t *spin) {
volatile uint32_t i;
 

Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc
==
--- head/lib/libc/stdlib/jemalloc/Makefile.inc  Wed Aug  9 22:18:49 2017
(r322331)
+++ head/lib/libc/stdlib/jemalloc/Makefile.inc  Wed Aug  9 22:58:42 2017
(r322332)
@@ -5,7 +5,7 @@
 JEMALLOCSRCS:= jemalloc.c arena.c background_thread.c base.c bitmap.c ckh.c \
ctl.c extent.c extent_dss.c extent_mmap.c hash.c hooks.c large.c \
malloc_io.c mutex.c mutex_pool.c nstime.c pages.c prng.c prof.c \
-   rtree.c spin.c stats.c sz.c tcache.c ticker.c tsd.c witness.c
+   rtree.c stats.c sz.c tcache.c ticker.c tsd.c witness.c
 
 SYM_MAPS+=${LIBC_SRCTOP}/stdlib/jemalloc/Symbol.map
 
___
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: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

2017-08-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Aug  9 22:18:49 2017
New Revision: 322331
URL: https://svnweb.freebsd.org/changeset/base/322331

Log:
  Provide compile to choose receive processing in either Ithread or Taskqueue 
Thread.

Modified:
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/qlnx/qlnxe/qlnx_ver.h
  head/sys/modules/qlnx/qlnxe/Makefile

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
==
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 21:44:55 2017
(r322330)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 22:18:49 2017
(r322331)
@@ -397,10 +397,14 @@ qlnx_fp_taskqueue(void *context, int pending)
 struct ifnet   *ifp;
 struct mbuf*mp;
 intret = -1;
+   struct thread   *cthread;
+
+#ifdef QLNX_RCV_IN_TASKQ
int lro_enable;
int rx_int = 0, total_rx_count = 0;
-   struct thread   *cthread;
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 fp = context;
 
 if (fp == NULL)
@@ -419,55 +423,60 @@ qlnx_fp_taskqueue(void *context, int pending)
 
 ifp = ha->ifp;
 
-   lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
+#ifdef QLNX_RCV_IN_TASKQ
+   {
+   lro_enable = ifp->if_capenable & IFCAP_LRO;
 
-   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
+   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
 
-   if (rx_int) {
-   fp->rx_pkts += rx_int;
-   total_rx_count += rx_int;
-   }
+   if (rx_int) {
+   fp->rx_pkts += rx_int;
+   total_rx_count += rx_int;
+   }
 
 #ifdef QLNX_SOFT_LRO
-   {
-   struct lro_ctrl *lro;
+   {
+   struct lro_ctrl *lro;
+   
+   lro = &fp->rxq->lro;
 
-   lro = &fp->rxq->lro;
+   if (lro_enable && total_rx_count) {
 
-   if (lro_enable && total_rx_count) {
-
 #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
 
-   if (ha->dbg_trace_lro_cnt) {
-   if (lro->lro_mbuf_count & ~1023)
-   fp->lro_cnt_1024++;
-   else if (lro->lro_mbuf_count & ~511)
-   fp->lro_cnt_512++;
-   else if (lro->lro_mbuf_count & ~255)
-   fp->lro_cnt_256++;
-   else if (lro->lro_mbuf_count & ~127)
-   fp->lro_cnt_128++;
-   else if (lro->lro_mbuf_count & ~63)
-   fp->lro_cnt_64++;
-   }
-   tcp_lro_flush_all(lro);
+   if (ha->dbg_trace_lro_cnt) {
+   if (lro->lro_mbuf_count & ~1023)
+   fp->lro_cnt_1024++;
+   else if (lro->lro_mbuf_count & ~511)
+   fp->lro_cnt_512++;
+   else if (lro->lro_mbuf_count & ~255)
+   fp->lro_cnt_256++;
+   else if (lro->lro_mbuf_count & ~127)
+   fp->lro_cnt_128++;
+   else if (lro->lro_mbuf_count & ~63)
+   fp->lro_cnt_64++;
+   }
+   tcp_lro_flush_all(lro);
 
 #else
-   struct lro_entry *queued;
+   struct lro_entry *queued;
 
-   while ((!SLIST_EMPTY(&lro->lro_active))) {
-   queued = SLIST_FIRST(&lro->lro_active);
-   SLIST_REMOVE_HEAD(&lro->lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   while ((!SLIST_EMPTY(&lro->lro_active))) {
+   queued = SLIST_FIRST(&lro->lro_active);
+   SLIST_REMOVE_HEAD(&lro->lro_active, 
next);
+   tcp_lro_flush(lro, queued);
+   }
 #endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
+   }
}
-   }
 #endif /* #ifdef QLNX_SOFT_LRO */
 
-   ecore_sb_update_sb_idx(fp->sb_info);
-   rmb();
+   ecore_sb_update_sb_idx(fp->sb_info);
+   rmb();
+   }
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 mtx_lock(&fp->tx_mtx);
 
 if (((ifp->i

svn commit: r322330 - head/usr.bin/calendar/calendars

2017-08-09 Thread Kyle Evans
Author: kevans
Date: Wed Aug  9 21:44:55 2017
New Revision: 322330
URL: https://svnweb.freebsd.org/changeset/base/322330

Log:
  Add myself to calendar.freebsd
  
  Requested by: mckusick
  Approved by:  emaste (mentor)
  Differential Revision:https://reviews.freebsd.org/D11936

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdWed Aug  9 20:13:49 
2017(r322329)
+++ head/usr.bin/calendar/calendars/calendar.freebsdWed Aug  9 21:44:55 
2017(r322330)
@@ -343,6 +343,7 @@
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
 09/23  Martin Matuska  born in Bratislava, Slovakia, 1979
 09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
+09/27  Kyle Evans  born in Oklahoma City, Oklahoma, United 
States, 1991
 09/27  Neil Blakey-Milner  born in Port Elizabeth, South 
Africa, 1978
 09/27  Renato Botelho  born in Araras, Sao Paulo, Brazil, 
1979
 09/28  Greg Lehey  born in Melbourne, Victoria, Australia, 
1948
___
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: r322329 - head/sys/boot/i386/boot2

2017-08-09 Thread Ryan Libby
Author: rlibby
Date: Wed Aug  9 20:13:49 2017
New Revision: 322329
URL: https://svnweb.freebsd.org/changeset/base/322329

Log:
  i386/boot2: -fno-asynchronous-unwind-tables for gcc
  
  The amd64 build of boot2 was failing with gcc 6.3.0 due to being more
  than 1 kB too large. It was apparently generating a .eh_frame section
  which was not being removed by objcopy -S. The .eh_frame section seems
  to be mandatory per the amd64 ABI, but boot2 is compiled for i386 (uses
  -m32), and therefore should be optional in this context. Suppress
  generation of .eh_frame with the -fno-asynchronous-unwind-tables flag to
  gcc. This saves 1348 bytes (the limit is 7680 bytes).
  
  Reviewed by:  dim, imp
  Approved by:  markj (mentor)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D11928

Modified:
  head/sys/boot/i386/boot2/Makefile

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Wed Aug  9 19:58:38 2017
(r322328)
+++ head/sys/boot/i386/boot2/Makefile   Wed Aug  9 20:13:49 2017
(r322329)
@@ -38,6 +38,7 @@ CFLAGS=   -fomit-frame-pointer \
-Winline
 
 CFLAGS.gcc+=   -Os \
+   -fno-asynchronous-unwind-tables \
--param max-inline-insns-single=100
 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201
 CFLAGS.gcc+=   -mno-align-long-strings
___
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: r322328 - head/sys/netipsec

2017-08-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Aug  9 19:58:38 2017
New Revision: 322328
URL: https://svnweb.freebsd.org/changeset/base/322328

Log:
  Make user supplied data checks a bit stricter.
  
  key_msg2sp() is used for parsing data from setsockopt(IP[V6]_IPSEC_POLICY)
  call. This socket option is usually used to configure IPsec bypass for
  socket. Only privileged user can set this socket option.
  The message syntax is described here
http://www.kame.net/newsletter/20021210/
  
  and our libipsec is usually used to create the correct request.
  Add additional checks:
  * that sadb_x_ipsecrequest_len is not out of bounds of user supplied buffer
  * that src/dst's sa_len is the same
  * that 2*sa_len is not out of bounds of user supplied buffer
  * that 2*sa_len fits into bounds of sadb_x_ipsecrequest
  
  Reported by:  Ilja van Sprundel
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11796

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Wed Aug  9 19:16:54 2017(r322327)
+++ head/sys/netipsec/key.c Wed Aug  9 19:58:38 2017(r322328)
@@ -1403,7 +1403,8 @@ key_msg2sp(struct sadb_x_policy *xpl0, size_t len, int
 
while (tlen > 0) {
/* length check */
-   if (xisr->sadb_x_ipsecrequest_len < sizeof(*xisr)) {
+   if (xisr->sadb_x_ipsecrequest_len < sizeof(*xisr) ||
+   xisr->sadb_x_ipsecrequest_len > tlen) {
ipseclog((LOG_DEBUG, "%s: invalid ipsecrequest "
"length.\n", __func__));
key_freesp(&newsp);
@@ -1517,10 +1518,12 @@ key_msg2sp(struct sadb_x_policy *xpl0, size_t len, int
if (xisr->sadb_x_ipsecrequest_len > sizeof(*xisr)) {
struct sockaddr *paddr;
 
+   len = tlen - sizeof(*xisr);
paddr = (struct sockaddr *)(xisr + 1);
/* validity check */
-   if (paddr->sa_len
-   > sizeof(isr->saidx.src)) {
+   if (len < sizeof(struct sockaddr) ||
+   len < 2 * paddr->sa_len ||
+   paddr->sa_len > sizeof(isr->saidx.src)) {
ipseclog((LOG_DEBUG, "%s: invalid "
"request address length.\n",
__func__));
@@ -1528,13 +1531,26 @@ key_msg2sp(struct sadb_x_policy *xpl0, size_t len, int
*error = EINVAL;
return NULL;
}
+   /*
+* Request length should be enough to keep
+* source and destination addresses.
+*/
+   if (xisr->sadb_x_ipsecrequest_len <
+   sizeof(*xisr) + 2 * paddr->sa_len) {
+   ipseclog((LOG_DEBUG, "%s: invalid "
+   "ipsecrequest length.\n",
+   __func__));
+   key_freesp(&newsp);
+   *error = EINVAL;
+   return (NULL);
+   }
bcopy(paddr, &isr->saidx.src, paddr->sa_len);
paddr = (struct sockaddr *)((caddr_t)paddr +
paddr->sa_len);
 
/* validity check */
-   if (paddr->sa_len
-   > sizeof(isr->saidx.dst)) {
+   if (paddr->sa_len !=
+   isr->saidx.src.sa.sa_len) {
ipseclog((LOG_DEBUG, "%s: invalid "
"request address length.\n",
__func__));
___
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: r322327 - in head: . release/packages

2017-08-09 Thread Glen Barber
Author: gjb
Date: Wed Aug  9 19:16:54 2017
New Revision: 322327
URL: https://svnweb.freebsd.org/changeset/base/322327

Log:
  Add a dependency on the kernel package for the runtime package.
  
  The idea here is that, provided upstream pkg(8) maintainers accept
  the proposed change, the kernel.ucl will contain a post-install
  script causing pkg(8) to emit a message informing to reboot the
  system after the kernel is upgraded using 'pkg upgrade', so the
  new userland is installed on the running new kernel.  At present,
  this functionality does not exist in pkg(8), but will help ensure
  the upgrade path follows that from UPDATING.  To work around this
  for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
  wish to proceed if not set to true.
  
  Since there is a kernel dependency, and a non-GENERIC kernel may
  be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
  runtime.ucl with the first-built kernel set either via command line
  or in make.conf(5).
  
  MFC after:5 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1
  head/release/packages/kernel.ucl
  head/release/packages/runtime.ucl

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Aug  9 19:09:23 2017(r322326)
+++ head/Makefile.inc1  Wed Aug  9 19:16:54 2017(r322327)
@@ -1618,7 +1618,10 @@ create-world-package-${pkgname}: .PHONY
@awk -F\" ' \
/^name/ { printf("===> Creating %s-", $$2); next } \
/^version/ { print $$2; next } \
-   ' ${WSTAGEDIR}/${pkgname}.ucl ; \
+   ' ${WSTAGEDIR}/${pkgname}.ucl ;
+   @if [ "${pkgname}" == "runtime" ]; then \
+   sed -i '' -e "s/%KERNCONF%/${INSTALLKERNEL:tl}/" 
${WSTAGEDIR}/${pkgname}.ucl ; \
+   fi
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
create -M ${WSTAGEDIR}/${pkgname}.ucl \
-p ${WSTAGEDIR}/${pkgname}.plist \

Modified: head/release/packages/kernel.ucl
==
--- head/release/packages/kernel.uclWed Aug  9 19:09:23 2017
(r322326)
+++ head/release/packages/kernel.uclWed Aug  9 19:16:54 2017
(r322327)
@@ -16,6 +16,39 @@ desc = 

svn commit: r322326 - in head/contrib/llvm/tools/lldb: include/lldb/Target source/Plugins/ABI/SysV-i386 source/Plugins/Platform/FreeBSD source/Plugins/Platform/NetBSD source/Plugins/Platform/OpenBS...

2017-08-09 Thread Ed Maste
Author: emaste
Date: Wed Aug  9 19:09:23 2017
New Revision: 322326
URL: https://svnweb.freebsd.org/changeset/base/322326

Log:
  lldb: Make i386-*-freebsd expression work on JIT path
  
  * Enable i386 ABI creation for freebsd
  * Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap
syscall
  * Unlike linux, the last argument of mmap is actually 64-bit(off_t).
This requires us to push an additional word for the higher order bits.
  * Prior to this change, ktrace dump will show mmap failures due to
invalid argument coming from the 6th mmap argument.
  
  Submitted by: Karnajit Wangkhem
  Differential Revision:https://reviews.llvm.org/D34776

Modified:
  head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h
  head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
  
head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
  head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
  head/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
  head/contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
  
head/contrib/llvm/tools/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
  head/contrib/llvm/tools/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h
  
head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
  head/contrib/llvm/tools/lldb/source/Target/Platform.cpp

Modified: head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h
==
--- head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h Wed Aug  9 
18:23:46 2017(r322325)
+++ head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h Wed Aug  9 
19:09:23 2017(r322326)
@@ -53,6 +53,7 @@ class PlatformProperties : public Properties { (public
 };
 
 typedef std::shared_ptr PlatformPropertiesSP;
+typedef llvm::SmallVector MmapArgList;
 
 //--
 /// @class Platform Platform.h "lldb/Target/Platform.h"
@@ -628,8 +629,11 @@ class Platform : public PluginInterface { (public)
 
   virtual Status Unlink(const FileSpec &file_spec);
 
-  virtual uint64_t ConvertMmapFlagsToPlatform(const ArchSpec &arch,
-  unsigned flags);
+  virtual MmapArgList GetMmapArgumentList(const ArchSpec &arch,
+  lldb::addr_t addr,
+  lldb::addr_t length,
+  unsigned prot, unsigned flags,
+  lldb::addr_t fd, lldb::addr_t 
offset);
 
   virtual bool GetSupportsRSync() { return m_supports_rsync; }
 

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
==
--- head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp  
Wed Aug  9 18:23:46 2017(r322325)
+++ head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp  
Wed Aug  9 19:09:23 2017(r322326)
@@ -206,7 +206,7 @@ ABISP
 ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) 
{
   static ABISP g_abi_sp;
   if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
-  arch.GetTriple().isOSLinux()) {
+  (arch.GetTriple().isOSLinux() || arch.GetTriple().isOSFreeBSD())) {
 if (!g_abi_sp)
   g_abi_sp.reset(new ABISysV_i386(process_sp));
 return g_abi_sp;

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
==
--- 
head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
Wed Aug  9 18:23:46 2017(r322325)
+++ 
head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
Wed Aug  9 19:09:23 2017(r322326)
@@ -314,13 +314,19 @@ void PlatformFreeBSD::CalculateTrapHandlerSymbolNames(
   m_trap_handlers.push_back(ConstString("_sigtramp"));
 }
 
-uint64_t PlatformFreeBSD::ConvertMmapFlagsToPlatform(const ArchSpec &arch,
- unsigned flags) {
+MmapArgList PlatformFreeBSD::GetMmapArgumentList(const ArchSpec &arch,
+ addr_t addr, addr_t length,
+ unsigned prot, unsigned flags,
+ addr_t fd, addr_t offset) {
   uint64_t flags_platform = 0;
 
   if (flags & eMmapFlagsPrivate)
 flags_platform |= MAP_PRIVATE;
   if (flags & eMmapFlagsAnon)
 flags_platform |= MAP_ANON;
-  return flags_platform;
+
+  MmapArgList args({addr, length, prot, flags_platform, fd, offset});
+  if (arch.GetTriple().getArch() == llvm::Triple::x86)
+args.push_back(0

svn commit: r322325 - head/bin/cat

2017-08-09 Thread Ed Maste
Author: emaste
Date: Wed Aug  9 18:23:46 2017
New Revision: 322325
URL: https://svnweb.freebsd.org/changeset/base/322325

Log:
  cat: fix build with -DNO_UDOM_SUPPORT
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/bin/cat/cat.c

Modified: head/bin/cat/cat.c
==
--- head/bin/cat/cat.c  Wed Aug  9 18:15:07 2017(r322324)
+++ head/bin/cat/cat.c  Wed Aug  9 18:23:46 2017(r322325)
@@ -51,12 +51,12 @@ __FBSDID("$FreeBSD$");
 #ifndef NO_UDOM_SUPPORT
 #include 
 #include 
-#include 
 #include 
 #endif
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
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: r322324 - head/lib/libcapsicum

2017-08-09 Thread Kyle Evans
Author: kevans
Date: Wed Aug  9 18:15:07 2017
New Revision: 322324
URL: https://svnweb.freebsd.org/changeset/base/322324

Log:
  capsicum_helpers: Add FIODTYPE to default ioctls allowed
  
  FIODTYPE will be needed by hexdump(1) to speed up the -s flag on devices
  that should be able to support fseek(3); specifically, in an attempt to
  correct for the fact that most tape drives don't support seeking yet don't
  indicate as such when fseeko(3) is invoked. Related: D10939
  
  Reviewed by:  cem, emaste, oshogbo
  Approved by:  emaste (mentor)
  Differential Revision:https://reviews.freebsd.org/D10937

Modified:
  head/lib/libcapsicum/capsicum_helpers.h

Modified: head/lib/libcapsicum/capsicum_helpers.h
==
--- head/lib/libcapsicum/capsicum_helpers.h Wed Aug  9 18:09:09 2017
(r322323)
+++ head/lib/libcapsicum/capsicum_helpers.h Wed Aug  9 18:15:07 2017
(r322324)
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -47,7 +48,7 @@ static __inline int
 caph_limit_stream(int fd, int flags)
 {
cap_rights_t rights;
-   unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ };
+   unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ, FIODTYPE };
 
cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL);
 
___
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: r322323 - in head/sys: amd64/amd64 i386/include x86/include x86/x86

2017-08-09 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug  9 18:09:09 2017
New Revision: 322323
URL: https://svnweb.freebsd.org/changeset/base/322323

Log:
  Split identify_cpu() into two functions for amd64 as we do for i386.  This
  reduces diff between amd64 and i386.  Also, it fixes a regression introduced
  in r322076, i.e., identify_hypervisor() failed to identify some hypervisors.
  This function assumes cpu_feature2 is already initialized.
  
  Reported by:  dexuan
  Tested by:dexuan

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/include/md_var.h
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Wed Aug  9 18:06:27 2017
(r322322)
+++ head/sys/amd64/amd64/machdep.c  Wed Aug  9 18:09:09 2017
(r322323)
@@ -1537,6 +1537,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
kmdp = init_ops.parse_preload_data(modulep);
 
+   identify_cpu();
identify_hypervisor();
 
/* Init basic tunables, hz etc */
@@ -1643,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
!= NULL)
vty_set_preferred(VTY_VT);
 
-   identify_cpu(); /* Final stage of CPU initialization */
+   finishidentcpu();   /* Final stage of CPU initialization */
initializecpu();/* Initialize CPU registers */
initializecpucache();
 

Modified: head/sys/i386/include/md_var.h
==
--- head/sys/i386/include/md_var.h  Wed Aug  9 18:06:27 2017
(r322322)
+++ head/sys/i386/include/md_var.h  Wed Aug  9 18:09:09 2017
(r322323)
@@ -59,7 +59,6 @@ void  doreti_popl_es(void) __asm(__STRING(doreti_popl_e
 void   doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
 void   doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
 void   doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
-void   finishidentcpu(void);
 void   fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
 void   i686_pagezero(void *addr);
 void   sse2_pagezero(void *addr);

Modified: head/sys/x86/include/x86_var.h
==
--- head/sys/x86/include/x86_var.h  Wed Aug  9 18:06:27 2017
(r322322)
+++ head/sys/x86/include/x86_var.h  Wed Aug  9 18:09:09 2017
(r322323)
@@ -115,6 +115,7 @@ voidcpu_probe_amdc1e(void);
 void   cpu_setregs(void);
 void   dump_add_page(vm_paddr_t);
 void   dump_drop_page(vm_paddr_t);
+void   finishidentcpu(void);
 void   identify_cpu(void);
 void   identify_hypervisor(void);
 void   initializecpu(void);

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Wed Aug  9 18:06:27 2017(r322322)
+++ head/sys/x86/x86/identcpu.c Wed Aug  9 18:09:09 2017(r322323)
@@ -1372,23 +1372,12 @@ fix_cpuid(void)
return (false);
 }
 
-/*
- * Final stage of CPU identification.
- */
-#ifdef __i386__
+#ifdef __amd64__
 void
-finishidentcpu(void)
-#else
-void
 identify_cpu(void)
-#endif
 {
-   u_int regs[4], cpu_stdext_disable;
-#ifdef __i386__
-   u_char ccr3;
-#endif
+   u_int regs[4];
 
-#ifdef __amd64__
do_cpuid(0, regs);
cpu_high = regs[0];
((u_int *)&cpu_vendor)[0] = regs[1];
@@ -1401,6 +1390,18 @@ identify_cpu(void)
cpu_procinfo = regs[1];
cpu_feature = regs[3];
cpu_feature2 = regs[2];
+}
+#endif
+
+/*
+ * Final stage of CPU identification.
+ */
+void
+finishidentcpu(void)
+{
+   u_int regs[4], cpu_stdext_disable;
+#ifdef __i386__
+   u_char ccr3;
 #endif
 
cpu_vendor_id = find_cpu_vendor_id();
___
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: r322322 - head/lib/libusb

2017-08-09 Thread Kyle Evans
Author: kevans
Date: Wed Aug  9 18:06:27 2017
New Revision: 322322
URL: https://svnweb.freebsd.org/changeset/base/322322

Log:
  libusb(3): Expose device caps as libusb_bos_descriptor::dev_capability
  
  Some libusb consumers in Linux-land (in this case, libusb4java) expect a
  dev_capability member that they can use to enumerate the device
  capabilities.
  
  No particular layout is expected of this, just that it can be traversed
  using the bLength member until bNumDeviceCapabilities are read and that the
  consumer may then use one of the libusb_get_*_descriptor methods to extract
  specific (usb 2.0 vs. ss) capability information.
  
  In collaboration with:hselasky
  Reviewed by:  hselasky
  Approved by:  emaste (mentor)
  Differential Revision:https://reviews.freebsd.org/D11494

Modified:
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb10_desc.c

Modified: head/lib/libusb/libusb.h
==
--- head/lib/libusb/libusb.hWed Aug  9 17:48:38 2017(r322321)
+++ head/lib/libusb/libusb.hWed Aug  9 18:06:27 2017(r322322)
@@ -388,6 +388,7 @@ typedef struct libusb_bos_descriptor {
uint8_t bNumDeviceCapabilities;
struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap;
struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap;
+   struct libusb_bos_dev_capability_descriptor **dev_capability;
 }  libusb_bos_descriptor __aligned(sizeof(void *));
 
 typedef struct libusb_usb_2_0_extension_descriptor {

Modified: head/lib/libusb/libusb10_desc.c
==
--- head/lib/libusb/libusb10_desc.c Wed Aug  9 17:48:38 2017
(r322321)
+++ head/lib/libusb/libusb10_desc.c Wed Aug  9 18:06:27 2017
(r322322)
@@ -433,6 +433,7 @@ libusb_parse_bos_descriptor(const void *buf, int len,
struct libusb_bos_descriptor *ptr;
struct libusb_usb_2_0_device_capability_descriptor *dcap_20 = NULL;
struct libusb_ss_usb_device_capability_descriptor *ss_cap = NULL;
+   uint8_t index = 0;
 
if (buf == NULL || bos == NULL || len < 1)
return (LIBUSB_ERROR_INVALID_PARAM);
@@ -453,7 +454,8 @@ libusb_parse_bos_descriptor(const void *buf, int len,
break;
 
if (dlen >= LIBUSB_DT_BOS_SIZE &&
-   dtype == LIBUSB_DT_BOS) {
+   dtype == LIBUSB_DT_BOS &&
+   ptr == NULL) {
 
ptr = malloc(sizeof(*ptr) + sizeof(*dcap_20) +
sizeof(*ss_cap));
@@ -470,6 +472,11 @@ libusb_parse_bos_descriptor(const void *buf, int len,
ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4];
ptr->usb_2_0_ext_cap = NULL;
ptr->ss_usb_cap = NULL;
+   ptr->dev_capability = 
calloc(ptr->bNumDeviceCapabilities, sizeof(void *));
+   if (ptr->dev_capability == NULL) {
+   free(ptr);
+   return (LIBUSB_ERROR_NO_MEM);
+   }
 
dcap_20 = (void *)(ptr + 1);
ss_cap = (void *)(dcap_20 + 1);
@@ -477,6 +484,15 @@ libusb_parse_bos_descriptor(const void *buf, int len,
if (dlen >= 3 &&
ptr != NULL &&
dtype == LIBUSB_DT_DEVICE_CAPABILITY) {
+   if (index != ptr->bNumDeviceCapabilities) {
+   ptr->dev_capability[index] = malloc(dlen);
+   if (ptr->dev_capability[index] == NULL) {
+   libusb_free_bos_descriptor(ptr);
+   return LIBUSB_ERROR_NO_MEM;
+   }
+   memcpy(ptr->dev_capability[index], buf, dlen);
+   index++;
+   }
switch (((const uint8_t *)buf)[2]) {
case LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY:
if (ptr->usb_2_0_ext_cap != NULL || dcap_20 == 
NULL)
@@ -523,8 +539,11 @@ libusb_parse_bos_descriptor(const void *buf, int len,
buf = ((const uint8_t *)buf) + dlen;
len -= dlen;
}
-   if (ptr != NULL)
+
+   if (ptr != NULL) {
+   ptr->bNumDeviceCapabilities = index;
return (0); /* success */
+   }
 
return (LIBUSB_ERROR_IO);
 }
@@ -532,9 +551,14 @@ libusb_parse_bos_descriptor(const void *buf, int len,
 void
 libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)
 {
+   uint8_t i;
+
if (bos == NULL)
return;
 
+   for (i = 0; i != bos->bNumDeviceCapabilities; i++)
+   free(bos->dev_capability[i]);
+   fr

svn commit: r322321 - head/sys/kern

2017-08-09 Thread Gleb Smirnoff
Author: glebius
Date: Wed Aug  9 17:48:38 2017
New Revision: 322321
URL: https://svnweb.freebsd.org/changeset/base/322321

Log:
  Plug uninitialized stack variable leak in sendfile(2).
  
  Reported by:  Ilja Van Sprundel 
  Submitted by: Domagoj Stolfa 
  MFC after:1 week
  Security: uninitialized stack variable leak

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Wed Aug  9 17:32:39 2017
(r322320)
+++ head/sys/kern/kern_sendfile.c   Wed Aug  9 17:48:38 2017
(r322321)
@@ -945,6 +945,7 @@ sendfile(struct thread *td, struct sendfile_args *uap,
if (uap->offset < 0)
return (EINVAL);
 
+   sbytes = 0;
hdr_uio = trl_uio = NULL;
 
if (uap->hdtr != NULL) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86

2017-08-09 Thread Dexuan Cui via svn-src-head
> From: owner-src-committ...@freebsd.org [mailto:owner-src-
> committ...@freebsd.org] On Behalf Of Jung-uk Kim
> Sent: Wednesday, August 9, 2017 10:03
> To: Dexuan Cui ; src-committ...@freebsd.org; svn-src-
> a...@freebsd.org; svn-src-head@freebsd.org
> Cc: Yanmin Qiao ; Hongjiang Zhang
> 
> Subject: Re: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386
> x86/include x86/x86
> 
> On 08/09/2017 00:09, Dexuan Cui wrote:
> > Hi jkim,
> > The patch breaks FreeBSD VM on Hyper-V.
> >
> > identify_hypervisor() is moved from identify_cpu() to an earlier place, but 
> > the
> global
> > variable cpu_feature2 used by the function is still initialized in 
> > identify_cpu().
> >
> > I'm not sure about the background of your patch. Can you please have a look?
> 
> Can you please test the attached patch?
> 
> Jung-uk Kim

I tested the patch only with my  x86_64 VM, and it worked.  

Thanks for the quick fix!

-- Dexuan

___
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: r322320 - in head: contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGe...

2017-08-09 Thread Dimitry Andric
Author: dim
Date: Wed Aug  9 17:32:39 2017
New Revision: 322320
URL: https://svnweb.freebsd.org/changeset/base/322320

Log:
  Upgrade our copies of clang, llvm and libc++ to r310316 from the
  upstream release_50 branch.
  
  MFC after:2 months
  X-MFC-with:   r321369

Modified:
  head/contrib/libc++/include/__bsd_locale_defaults.h
  head/contrib/libc++/include/__bsd_locale_fallbacks.h
  head/contrib/libc++/include/__locale
  head/contrib/libc++/include/mutex
  head/contrib/libc++/include/sstream
  head/contrib/llvm/include/llvm/Analysis/ValueTracking.h
  head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h
  head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h
  head/contrib/llvm/lib/Analysis/ValueTracking.cpp
  head/contrib/llvm/lib/CodeGen/BranchFolding.cpp
  head/contrib/llvm/lib/CodeGen/MachineFunction.cpp
  head/contrib/llvm/lib/CodeGen/MachineInstr.cpp
  head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
  head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  head/contrib/llvm/lib/CodeGen/StackColoring.cpp
  head/contrib/llvm/lib/IR/ConstantFold.cpp
  head/contrib/llvm/lib/Object/COFFImportFile.cpp
  head/contrib/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  head/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
  head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td
  head/contrib/llvm/lib/Target/AArch64/AArch64MacroFusion.cpp
  head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
  head/contrib/llvm/lib/Target/X86/X86InstrSSE.td
  head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  head/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
  head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp
  head/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h
  head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def
  head/contrib/llvm/tools/clang/include/clang/Driver/Options.td
  head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
  head/contrib/llvm/tools/clang/lib/AST/ODRHash.cpp
  head/contrib/llvm/tools/clang/lib/AST/StmtCXX.cpp
  head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/Mips.cpp
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp
  head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h
  head/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h
  head/contrib/llvm/tools/clang/lib/Headers/avxintrin.h
  head/contrib/llvm/tools/clang/lib/Headers/float.h
  head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp
  head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp
  head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/lld/Config/Version.inc
  head/lib/clang/include/llvm/Support/VCSRevision.h
Directory Properties:
  head/contrib/compiler-rt/   (props changed)
  head/contrib/libc++/   (props changed)
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)
  head/contrib/llvm/tools/lld/   (props changed)
  head/contrib/llvm/tools/lldb/   (props changed)

Modified: head/contrib/libc++/include/__bsd_locale_defaults.h
==
--- head/contrib/libc++/include/__bsd_locale_defaults.h Wed Aug  9 16:37:37 
2017(r322319)
+++ head/contrib/libc++/include/__bsd_locale_defaults.h Wed Aug  9 17:32:39 
2017(r322320)
@@ -15,6 +15,10 @@
 #ifndef _LIBCPP_BSD_LOCALE_DEFAULTS_H
 #define _LIBCPP_BSD_LOCALE_DEFAULTS_H
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 #define __libcpp_mb_cur_max_l(loc)  MB_CUR_MAX_L(loc)
 #define __libcpp_btowc_l(ch, loc)   btowc_l(ch, loc)
 #define __libcpp_wctob_l(wch, loc)  wctob_l(wch, loc)

Modified: head/contrib/libc++/include/__bsd_locale_fallbacks.h
==
--- head/contrib/libc++/include/__bsd_locale_fallbacks.hWed Aug  9 
16:37:37 2017(r322319)
+++ head/contrib/libc++/include/__bsd_locale_fallbacks.hWed Aug  9 
17:32:39 2017(r322320)
@@ -18,6 +18,10 @@
 #include 
 #include 
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 inline _LIBCPP_ALWAYS_INLINE

Modified: head/contrib/libc++/include/__locale
==
--- head/contrib/libc++/include/__localeWed Aug  9 16:37:37 2017
(r322319)
+++ head/contrib/libc++/include/__localeWed Aug  9 17:32:39 2017
(r322320)
@@ -34,7 +34,7 @@
 # include 
 #elif defined(_NEWLIB_VERSION)
 # include 
-#elif (defined(__GLIBC_

Re: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86

2017-08-09 Thread Jung-uk Kim
On 08/09/2017 00:09, Dexuan Cui wrote:
> Hi jkim,
> The patch breaks FreeBSD VM on Hyper-V.
> 
> identify_hypervisor() is moved from identify_cpu() to an earlier place, but 
> the global 
> variable cpu_feature2 used by the function is still initialized in 
> identify_cpu().
> 
> I'm not sure about the background of your patch. Can you please have a look?

Can you please test the attached patch?

Jung-uk Kim
Index: sys/amd64/amd64/machdep.c
===
--- sys/amd64/amd64/machdep.c	(revision 322319)
+++ sys/amd64/amd64/machdep.c	(working copy)
@@ -1537,6 +1537,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 
 	kmdp = init_ops.parse_preload_data(modulep);
 
+	identify_cpu();
 	identify_hypervisor();
 
 	/* Init basic tunables, hz etc */
@@ -1643,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 	!= NULL)
 		vty_set_preferred(VTY_VT);
 
-	identify_cpu();		/* Final stage of CPU initialization */
+	finishidentcpu();	/* Final stage of CPU initialization */
 	initializecpu();	/* Initialize CPU registers */
 	initializecpucache();
 
Index: sys/i386/include/md_var.h
===
--- sys/i386/include/md_var.h	(revision 322319)
+++ sys/i386/include/md_var.h	(working copy)
@@ -59,7 +59,6 @@ void	doreti_popl_es(void) __asm(__STRING(doreti_po
 void	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
 void	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
 void	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
-void	finishidentcpu(void);
 void	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
 void	i686_pagezero(void *addr);
 void	sse2_pagezero(void *addr);
Index: sys/x86/include/x86_var.h
===
--- sys/x86/include/x86_var.h	(revision 322319)
+++ sys/x86/include/x86_var.h	(working copy)
@@ -115,6 +115,7 @@ void	cpu_probe_amdc1e(void);
 void	cpu_setregs(void);
 void	dump_add_page(vm_paddr_t);
 void	dump_drop_page(vm_paddr_t);
+void	finishidentcpu(void);
 void	identify_cpu(void);
 void	identify_hypervisor(void);
 void	initializecpu(void);
Index: sys/x86/x86/identcpu.c
===
--- sys/x86/x86/identcpu.c	(revision 322319)
+++ sys/x86/x86/identcpu.c	(working copy)
@@ -1372,23 +1372,12 @@ fix_cpuid(void)
 	return (false);
 }
 
-/*
- * Final stage of CPU identification.
- */
-#ifdef __i386__
+#ifdef __amd64__
 void
-finishidentcpu(void)
-#else
-void
 identify_cpu(void)
-#endif
 {
-	u_int regs[4], cpu_stdext_disable;
-#ifdef __i386__
-	u_char ccr3;
-#endif
+	u_int regs[4];
 
-#ifdef __amd64__
 	do_cpuid(0, regs);
 	cpu_high = regs[0];
 	((u_int *)&cpu_vendor)[0] = regs[1];
@@ -1401,8 +1390,20 @@ identify_cpu(void)
 	cpu_procinfo = regs[1];
 	cpu_feature = regs[3];
 	cpu_feature2 = regs[2];
+}
 #endif
 
+/*
+ * Final stage of CPU identification.
+ */
+void
+finishidentcpu(void)
+{
+	u_int regs[4], cpu_stdext_disable;
+#ifdef __i386__
+	u_char ccr3;
+#endif
+
 	cpu_vendor_id = find_cpu_vendor_id();
 
 	if (fix_cpuid()) {


signature.asc
Description: OpenPGP digital signature


Re: svn commit: r322277 - in head: tools/build/mk usr.bin usr.bin/ruptime usr.bin/rwho usr.sbin usr.sbin/rwhod

2017-08-09 Thread John Baldwin
On Tuesday, August 08, 2017 08:17:07 PM Jeremie Le Hen wrote:
> Author: jlh
> Date: Tue Aug  8 20:17:07 2017
> New Revision: 322277
> URL: https://svnweb.freebsd.org/changeset/base/322277
> 
> Log:
>   rwho/ruptime/rwhod shouldn't be gated by RCMDS.
>   
>   As peter@ points out in pr/220953:
>   "rwho, rwhod and ruptime are not part of the remote login suite (rsh, rlogin
>   etc).
>   
>   They should *not* be in the rcmds package which is disabled by default.  We
>   rely on rwho/rwhod/ruptime in the freebsd.org cluster."
>   
>   This commit is a re-commit of r322029 and r322031 with a better commit log, 
> as
>   pointed out by ngie@.
>   
>   This also includes the necesary changes to OptionalObsoleteFiles.inc, as
>   requested by jhb@.
>   
>   PR: 220953
>   Reported by:peter@, jhb@
>   Differential Revision:  https://reviews.freebsd.org/D11743

You still need to fix the Makefiles that install /etc/rc.d/rwho and
/etc/periodic/daily/140.clean-rwho to install those files unconditionally.

-- 
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: r322319 - head/sys/geom

2017-08-09 Thread Warner Losh
Author: imp
Date: Wed Aug  9 16:37:37 2017
New Revision: 322319
URL: https://svnweb.freebsd.org/changeset/base/322319

Log:
  Also provide a warning for geom_fox.
  
  Differential Review: https://reviews.freebsd.org/D11935
  Requested by: jhb@
  MFC After: 3 days

Modified:
  head/sys/geom/geom_fox.c

Modified: head/sys/geom/geom_fox.c
==
--- head/sys/geom/geom_fox.cWed Aug  9 16:15:24 2017(r322318)
+++ head/sys/geom/geom_fox.cWed Aug  9 16:37:37 2017(r322319)
@@ -53,6 +53,8 @@
 #define FOX_CLASS_NAME "FOX"
 #define FOX_MAGIC  "GEOM::FOX"
 
+static int g_fox_once;
+
 FEATURE(geom_fox, "GEOM FOX redundant path mitigation support");
 
 struct g_fox_softc {
@@ -438,8 +440,15 @@ printf("fox %s lock %p\n", gp->name, &sc->lock);
g_free(buf);
g_access(cp, -1, 0, 0);
 
-   if (!LIST_EMPTY(&gp->provider))
+   if (!LIST_EMPTY(&gp->provider)) {
+   if (!g_fox_once) {
+   g_fox_once = 1;
+   printf(
+   "WARNING: geom_fox (geom %s) is deprecated, "
+   "use gmultipath instead.\n", gp->name);
+   }
return (gp);
+   }
 
g_free(gp->softc);
g_detach(cp);
___
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: r322318 - in head: share/man/man4 sys/conf sys/geom

2017-08-09 Thread Warner Losh
Author: imp
Date: Wed Aug  9 16:15:24 2017
New Revision: 322318
URL: https://svnweb.freebsd.org/changeset/base/322318

Log:
  Mark geom classes as deprecated.
  
  geom_bsd, geom_mbr and geom_sunlabel have been obsolete since Marcel
  Moolenaar's geom_part was in FreeBSD 7. They haven't been in GENERIC
  since FreeBSD 8. Add warning when used.
  
  geom_vol_ffs has been obsolete since ufs support to geom_label was
  committed in FreeBSD 5. It hasn't been in GENERIC since FreeBSD 5.
  Add warning when used.
  
  geom_fox has been obsolete since gmultipath was committed in FreeBSD 7.
  (no warning added, since this is a very obscure class).
  
  These will all be removed in FreeBSD 12.
  
  MFC After: 3 days
  Differential Revision: https://reviews.freebsd.org/D11935
  
  Note: Classes will be removed after MFC

Modified:
  head/share/man/man4/geom.4
  head/share/man/man4/geom_fox.4
  head/sys/conf/NOTES
  head/sys/geom/geom_bsd.c
  head/sys/geom/geom_mbr.c
  head/sys/geom/geom_sunlabel.c
  head/sys/geom/geom_vol_ffs.c

Modified: head/share/man/man4/geom.4
==
--- head/share/man/man4/geom.4  Wed Aug  9 15:38:24 2017(r322317)
+++ head/share/man/man4/geom.4  Wed Aug  9 16:15:24 2017(r322318)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 20, 2017
+.Dd August 9, 2017
 .Dt GEOM 4
 .Os
 .Sh NAME
@@ -43,17 +43,14 @@
 .Sh SYNOPSIS
 .Cd options GEOM_AES
 .Cd options GEOM_BDE
-.Cd options GEOM_BSD
 .Cd options GEOM_CACHE
 .Cd options GEOM_CONCAT
 .Cd options GEOM_ELI
-.Cd options GEOM_FOX
 .Cd options GEOM_GATE
 .Cd options GEOM_JOURNAL
 .Cd options GEOM_LABEL
 .Cd options GEOM_LINUX_LVM
 .Cd options GEOM_MAP
-.Cd options GEOM_MBR
 .Cd options GEOM_MIRROR
 .Cd options GEOM_MOUNTVER
 .Cd options GEOM_MULTIPATH
@@ -71,10 +68,8 @@
 .Cd options GEOM_RAID3
 .Cd options GEOM_SHSEC
 .Cd options GEOM_STRIPE
-.Cd options GEOM_SUNLABEL
 .Cd options GEOM_UZIP
 .Cd options GEOM_VIRSTOR
-.Cd options GEOM_VOL
 .Cd options GEOM_ZERO
 .Sh DESCRIPTION
 The
@@ -449,6 +444,24 @@ This is unused at this time.
 .It 0x80 Pq Dv G_F_CTLDUMP
 Dump contents of gctl requests.
 .El
+.Sh OBSOLETE OPTIONS
+.Pp
+The following options have been deprecated and will be removed in
+.Fx 12 :
+.Cd GEOM_BSD ,
+.Cd GEOM_FOX ,
+.Cd GEOM_MBR ,
+.Cd GEOM_SUNLABEL ,
+and
+.Cd GEOM_VOL .
+.Pp
+Use
+.Cd GEOM_PART_BSD ,
+.Cd GEOM_MULTIPATH ,
+.Cd GEOM_PART_MBR ,
+.Cd GEOM_PART_VTOC8 ,
+.Cd GEOM_LABEL
+options, respectively, instead.
 .Sh SEE ALSO
 .Xr libgeom 3 ,
 .Xr DECLARE_GEOM_CLASS 9 ,

Modified: head/share/man/man4/geom_fox.4
==
--- head/share/man/man4/geom_fox.4  Wed Aug  9 15:38:24 2017
(r322317)
+++ head/share/man/man4/geom_fox.4  Wed Aug  9 16:15:24 2017
(r322318)
@@ -51,6 +51,8 @@ This driver is obsolete.
 Users are advised to use
 .Xr gmultipath 8
 instead.
+This driver will be removed in
+.Fx 12 .
 .Ef
 .Pp
 The intent of the

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Aug  9 15:38:24 2017(r322317)
+++ head/sys/conf/NOTES Wed Aug  9 16:15:24 2017(r322318)
@@ -147,17 +147,17 @@ options   BOOTHOWTO=RB_MULTIPLE
 
 optionsGEOM_AES# Don't use, use GEOM_BDE
 optionsGEOM_BDE# Disk encryption.
-optionsGEOM_BSD# BSD disklabels
+optionsGEOM_BSD# BSD disklabels (obsolete, gone in 12)
 optionsGEOM_CACHE  # Disk cache.
 optionsGEOM_CONCAT # Disk concatenation.
 optionsGEOM_ELI# Disk encryption.
-optionsGEOM_FOX# Redundant path mitigation
+optionsGEOM_FOX# Redundant path mitigation (obsolete, 
gone in 12)
 optionsGEOM_GATE   # Userland services.
 optionsGEOM_JOURNAL# Journaling.
 optionsGEOM_LABEL  # Providers labelization.
 optionsGEOM_LINUX_LVM  # Linux LVM2 volumes
 optionsGEOM_MAP# Map based partitioning
-optionsGEOM_MBR# DOS/MBR partitioning
+optionsGEOM_MBR# DOS/MBR partitioning (obsolete, gone 
in 12)
 optionsGEOM_MIRROR # Disk mirroring.
 optionsGEOM_MULTIPATH  # Disk multipath
 optionsGEOM_NOP# Test class.
@@ -174,11 +174,11 @@ options   GEOM_RAID   # Soft RAID 
functionality.
 optionsGEOM_RAID3  # RAID3 functionality.
 optionsGEOM_SHSEC  # Shared secret.
 optionsGEOM_STRIPE # Disk striping.
-optionsGEOM_SUNLABEL   # Sun/Solaris partitioning
+optionsGEOM_SUNLABEL   # Sun/Solaris partitioning (obsolete, 
gone in 12)
 optionsGEOM_UZIP   

svn commit: r322316 - head/sys/dev/ahci

2017-08-09 Thread Alexander Motin
Author: mav
Date: Wed Aug  9 13:46:16 2017
New Revision: 322316
URL: https://svnweb.freebsd.org/changeset/base/322316

Log:
  Missing remanant of 322309.
  
  MFC after:1 week

Modified:
  head/sys/dev/ahci/ahci_pci.c

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cWed Aug  9 13:26:12 2017
(r322315)
+++ head/sys/dev/ahci/ahci_pci.cWed Aug  9 13:46:16 2017
(r322316)
@@ -116,7 +116,7 @@ static const struct {
{0x3b258086, 0x00, "Intel Ibex Peak (RAID)",0},
{0x3b298086, 0x00, "Intel Ibex Peak-M", 0},
{0x3b2c8086, 0x00, "Intel Ibex Peak-M (RAID)",  0},
-   {0x3b2f8086, 0x00, "Intel Ibex Peak-M Series",  0},
+   {0x3b2f8086, 0x00, "Intel Ibex Peak-M", 0},
{0x19b08086, 0x00, "Intel Denverton",   0},
{0x19b18086, 0x00, "Intel Denverton",   0},
{0x19b28086, 0x00, "Intel Denverton",   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"


svn commit: r322314 - head/usr.bin/calendar/calendars

2017-08-09 Thread Jonathan Anderson
Author: jonathan
Date: Wed Aug  9 13:25:27 2017
New Revision: 322314
URL: https://svnweb.freebsd.org/changeset/base/322314

Log:
  Add birthday information for jonathan@.
  
  As requested by mckusick@...

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdWed Aug  9 12:55:58 
2017(r322313)
+++ head/usr.bin/calendar/calendars/calendar.freebsdWed Aug  9 13:25:27 
2017(r322314)
@@ -123,6 +123,7 @@
 03/24  Marcel Moolenaar  born in Hilversum, the 
Netherlands, 1968
 03/24  Emanuel Haupt  born in Zurich, Switzerland, 1979
 03/25  Andrew R. Reiter  born in Springfield, Massachusetts, 
United States, 1980
+03/26  Jonathan Anderson  born in Ottawa, Ontario, 
Canada, 1983
 03/27  Josef El-Rayes  born in Linz, Austria, 1982
 03/28  Sean C. Farley  born in Indianapolis, Indiana, United 
States, 1970
 03/29  Thierry Thomas  born in Luxeuil les Bains, France, 
1961
___
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: r322310 - in head: share/man/man4 sys/net

2017-08-09 Thread Andrey V. Elsukov
Author: ae
Date: Wed Aug  9 12:24:07 2017
New Revision: 322310
URL: https://svnweb.freebsd.org/changeset/base/322310

Log:
  Add to if_enc(4) ability to capture packets via BPF after pfil processing.
  
  New flag 0x4 can be configured in net.enc.[in|out].ipsec_bpf_mask.
  When it is set, if_enc(4) additionally captures a packet via BPF after
  invoking pfil hook. This may be useful for debugging.
  
  MFC after:2 weeks
  Sponsored by: Yandex LLC
  Differential Revision:https://reviews.freebsd.org/D11804

Modified:
  head/share/man/man4/enc.4
  head/sys/net/if_enc.c

Modified: head/share/man/man4/enc.4
==
--- head/share/man/man4/enc.4   Wed Aug  9 12:21:17 2017(r322309)
+++ head/share/man/man4/enc.4   Wed Aug  9 12:24:07 2017(r322310)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 28, 2007
+.Dd August 9, 2017
 .Dt ENC 4
 .Os
 .Sh NAME
@@ -44,6 +44,13 @@ kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device enc"
 .Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_enc_load="YES"
+.Ed
 .Sh DESCRIPTION
 The
 .Nm
@@ -115,6 +122,11 @@ outgoing path 
 Most people will want to run with the suggested defaults for
 .Cm ipsec_filter_mask
 and rely on the security policy database for the outer headers.
+.Pp
+Note that packets are captured by BPF before firewall processing.
+The special value 0x4 can be configured in the
+.Ar ipsec_bpf_mask
+and packets will be also captured after firewall processing.
 .Sh EXAMPLES
 To see the packets the processed via
 .Xr ipsec 4 ,

Modified: head/sys/net/if_enc.c
==
--- head/sys/net/if_enc.c   Wed Aug  9 12:21:17 2017(r322309)
+++ head/sys/net/if_enc.c   Wed Aug  9 12:24:07 2017(r322310)
@@ -99,9 +99,15 @@ static void  enc_remove_hhooks(struct enc_softc *);
 
 static const char encname[] = "enc";
 
+#defineIPSEC_ENC_AFTER_PFIL0x04
 /*
  * Before and after are relative to when we are stripping the
  * outer IP header.
+ *
+ * AFTER_PFIL flag used only for bpf_mask_*. It enables BPF capturing
+ * after PFIL hook execution. It might be useful when PFIL hook does
+ * some changes to the packet, e.g. address translation. If PFIL hook
+ * consumes mbuf, nothing will be captured.
  */
 static VNET_DEFINE(int, filter_mask_in) = IPSEC_ENC_BEFORE;
 static VNET_DEFINE(int, bpf_mask_in) = IPSEC_ENC_BEFORE;
@@ -194,6 +200,30 @@ enc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (0);
 }
 
+static void
+enc_bpftap(struct ifnet *ifp, struct mbuf *m, const struct secasvar *sav,
+int32_t hhook_type, uint8_t enc, uint8_t af)
+{
+   struct enchdr hdr;
+
+   if (hhook_type == HHOOK_TYPE_IPSEC_IN &&
+   (enc & V_bpf_mask_in) == 0)
+   return;
+   else if (hhook_type == HHOOK_TYPE_IPSEC_OUT &&
+   (enc & V_bpf_mask_out) == 0)
+   return;
+   if (bpf_peers_present(ifp->if_bpf) == 0)
+   return;
+   hdr.af = af;
+   hdr.spi = sav->spi;
+   hdr.flags = 0;
+   if (sav->alg_enc != SADB_EALG_NONE)
+   hdr.flags |= M_CONF;
+   if (sav->alg_auth != SADB_AALG_NONE)
+   hdr.flags |= M_AUTH;
+   bpf_mtap2(ifp->if_bpf, &hdr, sizeof(hdr), m);
+}
+
 /*
  * One helper hook function is used by any hook points.
  * + from hhook_type we can determine the packet direction:
@@ -206,7 +236,6 @@ static int
 enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data,
 void *hdata, struct osd *hosd)
 {
-   struct enchdr hdr;
struct ipsec_ctx_data *ctx;
struct enc_softc *sc;
struct ifnet *ifp, *rcvif;
@@ -223,21 +252,7 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *
if (ctx->af != hhook_id)
return (EPFNOSUPPORT);
 
-   if (((hhook_type == HHOOK_TYPE_IPSEC_IN &&
-   (ctx->enc & V_bpf_mask_in) != 0) ||
-   (hhook_type == HHOOK_TYPE_IPSEC_OUT &&
-   (ctx->enc & V_bpf_mask_out) != 0)) &&
-   bpf_peers_present(ifp->if_bpf) != 0) {
-   hdr.af = ctx->af;
-   hdr.spi = ctx->sav->spi;
-   hdr.flags = 0;
-   if (ctx->sav->alg_enc != SADB_EALG_NONE)
-   hdr.flags |= M_CONF;
-   if (ctx->sav->alg_auth != SADB_AALG_NONE)
-   hdr.flags |= M_AUTH;
-   bpf_mtap2(ifp->if_bpf, &hdr, sizeof(hdr), *ctx->mp);
-   }
-
+   enc_bpftap(ifp, *ctx->mp, ctx->sav, hhook_type, ctx->enc, ctx->af);
switch (hhook_type) {
case HHOOK_TYPE_IPSEC_IN:
if (ctx->enc == IPSEC_ENC_BEFORE) {
@@ -290,6 +305,8 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *
return (EACCES

svn commit: r322309 - in head/sys/dev: ahci ata ata/chipsets sound/pci/hda

2017-08-09 Thread Alexander Motin
Author: mav
Date: Wed Aug  9 12:21:17 2017
New Revision: 322309
URL: https://svnweb.freebsd.org/changeset/base/322309

Log:
  Use "Ibex Peak" codename for "5 Series/3400 Series" chipsets.
  
  This is shorter and unifies naming with later chipsets.
  
  MFC after:1 week

Modified:
  head/sys/dev/ahci/ahci_pci.c
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/chipsets/ata-intel.c
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cWed Aug  9 12:03:12 2017
(r322308)
+++ head/sys/dev/ahci/ahci_pci.cWed Aug  9 12:21:17 2017
(r322309)
@@ -111,12 +111,12 @@ static const struct {
{0x3a058086, 0x00, "Intel ICH10 (RAID)",0},
{0x3a228086, 0x00, "Intel ICH10",   0},
{0x3a258086, 0x00, "Intel ICH10 (RAID)",0},
-   {0x3b228086, 0x00, "Intel 5 Series/3400 Series",0},
-   {0x3b238086, 0x00, "Intel 5 Series/3400 Series",0},
-   {0x3b258086, 0x00, "Intel 5 Series/3400 Series (RAID)", 0},
-   {0x3b298086, 0x00, "Intel 5 Series/3400 Series",0},
-   {0x3b2c8086, 0x00, "Intel 5 Series/3400 Series (RAID)", 0},
-   {0x3b2f8086, 0x00, "Intel 5 Series/3400 Series",0},
+   {0x3b228086, 0x00, "Intel Ibex Peak",   0},
+   {0x3b238086, 0x00, "Intel Ibex Peak",   0},
+   {0x3b258086, 0x00, "Intel Ibex Peak (RAID)",0},
+   {0x3b298086, 0x00, "Intel Ibex Peak-M", 0},
+   {0x3b2c8086, 0x00, "Intel Ibex Peak-M (RAID)",  0},
+   {0x3b2f8086, 0x00, "Intel Ibex Peak-M Series",  0},
{0x19b08086, 0x00, "Intel Denverton",   0},
{0x19b18086, 0x00, "Intel Denverton",   0},
{0x19b28086, 0x00, "Intel Denverton",   0},

Modified: head/sys/dev/ata/ata-pci.h
==
--- head/sys/dev/ata/ata-pci.h  Wed Aug  9 12:03:12 2017(r322308)
+++ head/sys/dev/ata/ata-pci.h  Wed Aug  9 12:21:17 2017(r322309)
@@ -193,12 +193,12 @@ struct ata_pci_controller {
 #define ATA_I82801JI_S1 0x3a208086
 #define ATA_I82801JI_S2 0x3a268086
 
-#define ATA_5Series_S1  0x3b208086
-#define ATA_5Series_S2  0x3b218086
-#define ATA_5Series_S3  0x3b268086
-#define ATA_5Series_S4  0x3b288086
-#define ATA_5Series_S5  0x3b2d8086
-#define ATA_5Series_S6  0x3b2e8086
+#define ATA_IBP_S1  0x3b208086
+#define ATA_IBP_S2  0x3b218086
+#define ATA_IBP_S3  0x3b268086
+#define ATA_IBP_S4  0x3b288086
+#define ATA_IBP_S5  0x3b2d8086
+#define ATA_IBP_S6  0x3b2e8086
 
 #define ATA_CPT_S1  0x1c008086
 #define ATA_CPT_S2  0x1c018086

Modified: head/sys/dev/ata/chipsets/ata-intel.c
==
--- head/sys/dev/ata/chipsets/ata-intel.c   Wed Aug  9 12:03:12 2017
(r322308)
+++ head/sys/dev/ata/chipsets/ata-intel.c   Wed Aug  9 12:21:17 2017
(r322309)
@@ -149,12 +149,12 @@ ata_intel_probe(device_t dev)
  { ATA_I82801JD_S2,  0, INTEL_6CH2, 0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_S1,  0, INTEL_6CH,  0, ATA_SA300, "ICH10" },
  { ATA_I82801JI_S2,  0, INTEL_6CH2, 0, ATA_SA300, "ICH10" },
- { ATA_5Series_S1,   0, INTEL_6CH,  0, ATA_SA300, "5 Series/3400 Series 
PCH" },
- { ATA_5Series_S2,   0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series 
PCH" },
- { ATA_5Series_S3,   0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series 
PCH" },
- { ATA_5Series_S4,   0, INTEL_6CH,  0, ATA_SA300, "5 Series/3400 Series 
PCH" },
- { ATA_5Series_S5,   0, INTEL_6CH2, 0, ATA_SA300, "5 Series/3400 Series 
PCH" },
- { ATA_5Series_S6,   0, INTEL_6CH,  0, ATA_SA300, "5 Series/3400 Series 
PCH" },
+ { ATA_IBP_S1,   0, INTEL_6CH,  0, ATA_SA300, "Ibex Peak" },
+ { ATA_IBP_S2,   0, INTEL_6CH2, 0, ATA_SA300, "Ibex Peak" },
+ { ATA_IBP_S3,   0, INTEL_6CH2, 0, ATA_SA300, "Ibex Peak" },
+ { ATA_IBP_S4,   0, INTEL_6CH,  0, ATA_SA300, "Ibex Peak-M" },
+ { ATA_IBP_S5,   0, INTEL_6CH2, 0, ATA_SA300, "Ibex Peak-M" },
+ { ATA_IBP_S6,   0, INTEL_6CH,  0, ATA_SA300, "Ibex Peak-M" },
  { ATA_CPT_S1,   0, INTEL_6CH,  0, ATA_SA600, "Cougar Point" },
  { ATA_CPT_S2,   0, INTEL_6CH,  0, ATA_SA600, "Cougar Point" },
  { ATA_CPT_S3,   0, INTEL_6CH2, 0, ATA_SA300, "Cougar Point" },

Modified: head/sys/dev/sound/pci/hda/hdac.c
==
--- head/sys/dev/sound/pci/hda/hdac.c   Wed Aug  9 12:03:12 2017
(r322308)
+++ head/sys/dev/sound/pci/hda/hdac.c   Wed Aug  9 12:21:17 2017
(r322309)
@@ -106,8 +106,8 @@ static const struct {
{ HDA_INTEL_82801I,  "Intel 82801I",0, 0 },
{ HDA_INTEL_82801JI, "Intel 82801JI"

svn commit: r322308 - in head/sys/dev: ahci sound/pci/hda usb/controller

2017-08-09 Thread Alexander Motin
Author: mav
Date: Wed Aug  9 12:03:12 2017
New Revision: 322308
URL: https://svnweb.freebsd.org/changeset/base/322308

Log:
  Add new Intel Lewisburg and Union Point chipset PCI IDs.
  
  While there, polish some old AHCI ones, since they are still reused.
  
  MFC after:1 week

Modified:
  head/sys/dev/ahci/ahci_pci.c
  head/sys/dev/sound/pci/hda/hdac.c
  head/sys/dev/sound/pci/hda/hdac.h
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cWed Aug  9 10:46:34 2017
(r322307)
+++ head/sys/dev/ahci/ahci_pci.cWed Aug  9 12:03:12 2017
(r322308)
@@ -92,10 +92,10 @@ static const struct {
{0x27c58086, 0x00, "Intel ICH7M",   0},
{0x27c68086, 0x00, "Intel ICH7M",   0},
{0x28218086, 0x00, "Intel ICH8",0},
-   {0x28228086, 0x00, "Intel ICH8",0},
+   {0x28228086, 0x00, "Intel ICH8+ (RAID)",0},
{0x28248086, 0x00, "Intel ICH8",0},
{0x28298086, 0x00, "Intel ICH8M",   0},
-   {0x282a8086, 0x00, "Intel ICH8M",   0},
+   {0x282a8086, 0x00, "Intel ICH8M+ (RAID)",   0},
{0x29228086, 0x00, "Intel ICH9",0},
{0x29238086, 0x00, "Intel ICH9",0},
{0x29248086, 0x00, "Intel ICH9",0},
@@ -108,14 +108,14 @@ static const struct {
{0x292f8086, 0x00, "Intel ICH9M",   0},
{0x294d8086, 0x00, "Intel ICH9",0},
{0x294e8086, 0x00, "Intel ICH9M",   0},
-   {0x3a058086, 0x00, "Intel ICH10",   0},
+   {0x3a058086, 0x00, "Intel ICH10 (RAID)",0},
{0x3a228086, 0x00, "Intel ICH10",   0},
-   {0x3a258086, 0x00, "Intel ICH10",   0},
+   {0x3a258086, 0x00, "Intel ICH10 (RAID)",0},
{0x3b228086, 0x00, "Intel 5 Series/3400 Series",0},
{0x3b238086, 0x00, "Intel 5 Series/3400 Series",0},
-   {0x3b258086, 0x00, "Intel 5 Series/3400 Series",0},
+   {0x3b258086, 0x00, "Intel 5 Series/3400 Series (RAID)", 0},
{0x3b298086, 0x00, "Intel 5 Series/3400 Series",0},
-   {0x3b2c8086, 0x00, "Intel 5 Series/3400 Series",0},
+   {0x3b2c8086, 0x00, "Intel 5 Series/3400 Series (RAID)", 0},
{0x3b2f8086, 0x00, "Intel 5 Series/3400 Series",0},
{0x19b08086, 0x00, "Intel Denverton",   0},
{0x19b18086, 0x00, "Intel Denverton",   0},
@@ -139,12 +139,13 @@ static const struct {
{0x19cf8086, 0x00, "Intel Denverton",   0},
{0x1c028086, 0x00, "Intel Cougar Point",0},
{0x1c038086, 0x00, "Intel Cougar Point",0},
-   {0x1c048086, 0x00, "Intel Cougar Point",0},
-   {0x1c058086, 0x00, "Intel Cougar Point",0},
+   {0x1c048086, 0x00, "Intel Cougar Point (RAID)", 0},
+   {0x1c058086, 0x00, "Intel Cougar Point (RAID)", 0},
+   {0x1c068086, 0x00, "Intel Cougar Point (RAID)", 0},
{0x1d028086, 0x00, "Intel Patsburg",0},
{0x1d048086, 0x00, "Intel Patsburg",0},
{0x1d068086, 0x00, "Intel Patsburg",0},
-   {0x28268086, 0x00, "Intel Patsburg (RAID)", 0},
+   {0x28268086, 0x00, "Intel Patsburg+ (RAID)",0},
{0x1e028086, 0x00, "Intel Panther Point",   0},
{0x1e038086, 0x00, "Intel Panther Point",   0},
{0x1e048086, 0x00, "Intel Panther Point (RAID)",0},
@@ -170,8 +171,6 @@ static const struct {
{0x1f3e8086, 0x00, "Intel Avoton (RAID)",   0},
{0x1f3f8086, 0x00, "Intel Avoton (RAID)",   0},
{0x23a38086, 0x00, "Intel Coleto Creek",0},
-   {0x28238086, 0x00, "Intel Wellsburg (RAID)",0},
-   {0x28278086, 0x00, "Intel Wellsburg (RAID)",0},
{0x8c028086, 0x00, "Intel Lynx Point",  0},
{0x8c038086, 0x00, "Intel Lynx Point",  0},
{0x8c048086, 0x00, "Intel Lynx Point (RAID)",   0},
@@ -195,6 +194,8 @@ static const struct {
{0x8d648086, 0x00, "Intel Wellsburg (RAID)",0},
{0x8d668086, 0x00, "Intel Wellsburg (RAID)",0},
{0x8d6e8086, 0x00, "Intel Wellsburg (RAID)",0},
+   {0x28238086, 0x00, "Intel Wellsburg+ (RAID)",   0},
+   {0x28278086, 0x00, "Intel Wellsburg+ (RAID)",   0},
{0x9c028086, 0x00, "Intel Lynx Point-LP",   0},
{0x9c038086, 0x00, "Intel Lynx Point-LP",   0},
{0x9c048086, 0x00, "Intel Lynx Point-LP (RAID)",0},
@@ -212,6 +213,17 @@ static const struct {
{0xa1068086, 0x00, "Intel Sunrise Point (RAID)",0},
{0xa1078086, 0x00, "Intel Sunrise Point (RAID)",0},
{0xa10f8086, 0x00, "Intel Sunrise Point (RAID)",0},
+   {0xa1828086, 0x00, "Intel Lewisburg",   0},
+   {0xa1868086, 0x00, "Intel Lewisburg (RAID)",0},
+   {0xa1d28086, 0x00, "Intel Lewisburg",   0},
+   {0xa1d68086, 0x00, "Intel Lewisburg

svn commit: r322307 - head/sys/netinet

2017-08-09 Thread Oleg Bulyzhin
Author: oleg
Date: Wed Aug  9 10:46:34 2017
New Revision: 322307
URL: https://svnweb.freebsd.org/changeset/base/322307

Log:
  Fix comment typo.

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Wed Aug  9 10:32:51 2017(r322306)
+++ head/sys/netinet/if_ether.c Wed Aug  9 10:46:34 2017(r322307)
@@ -1279,7 +1279,7 @@ arp_mark_lle_reachable(struct llentry *la)
 }
 
 /*
- * Add pernament link-layer record for given interface address.
+ * Add permanent link-layer record for given interface address.
  */
 static __noinline void
 arp_add_ifa_lle(struct ifnet *ifp, const struct sockaddr *dst)
___
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: r322306 - head/sys/dev/mlx4/mlx4_en

2017-08-09 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Aug  9 10:32:51 2017
New Revision: 322306
URL: https://svnweb.freebsd.org/changeset/base/322306

Log:
  Print maximum MTU when trying to set invalid MTU in the mlx4en(4) driver.
  Useful for debugging.
  
  Submitted by: Sepherosa Ziehau 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Wed Aug  9 10:30:55 2017
(r322305)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Wed Aug  9 10:32:51 2017
(r322306)
@@ -1771,7 +1771,8 @@ static int mlx4_en_change_mtu(struct net_device *dev, 
   (unsigned)dev->if_mtu, (unsigned)new_mtu);
 
if ((new_mtu < MLX4_EN_MIN_MTU) || (new_mtu > priv->max_mtu)) {
-   en_err(priv, "Bad MTU size:%d.\n", new_mtu);
+   en_err(priv, "Bad MTU size:%d, max %u.\n", new_mtu,
+   priv->max_mtu);
return -EPERM;
}
mutex_lock(&mdev->state_lock);
___
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: r322305 - head/sys/dev/mlx4/mlx4_en

2017-08-09 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Aug  9 10:30:55 2017
New Revision: 322305
URL: https://svnweb.freebsd.org/changeset/base/322305

Log:
  Increment queue drops in the network statistics when transmitted packets
  are dropped by the mlx4en(4) driver.
  
  Submitted by: Sepherosa Ziehau 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c  Wed Aug  9 10:27:21 2017
(r322304)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c  Wed Aug  9 10:30:55 2017
(r322305)
@@ -1071,6 +1071,10 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m)
taskqueue_enqueue(cq->tq, &cq->cq_task);
}
 
+#if __FreeBSD_version >= 110
+   if (unlikely(err != 0))
+   if_inc_counter(dev, IFCOUNTER_IQDROPS, 1);
+#endif
return (err);
 }
 
___
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: r322304 - head/sys/dev/mlx4/mlx4_en

2017-08-09 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Aug  9 10:27:21 2017
New Revision: 322304
URL: https://svnweb.freebsd.org/changeset/base/322304

Log:
  Add support for RX and TX statistics when the mlx4en(4) PCI device
  is in VF or SRIOV mode typically in a virtual machine environment.
  
  Submitted by: Sepherosa Ziehau 
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_port.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_port.cWed Aug  9 09:16:16 2017
(r322303)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_port.cWed Aug  9 10:27:21 2017
(r322304)
@@ -124,11 +124,45 @@ out:
return err;
 }
 
+static void mlx4_en_fold_software_stats(struct net_device *dev)
+{
+   struct mlx4_en_priv *priv = netdev_priv(dev);
+   struct mlx4_en_dev *mdev = priv->mdev;
+   u64 packets, bytes;
+   int i;
+
+   if (!priv->port_up || mlx4_is_master(mdev->dev))
+   return;
+
+   packets = 0;
+   bytes = 0;
+   for (i = 0; i < priv->rx_ring_num; i++) {
+   const struct mlx4_en_rx_ring *ring = priv->rx_ring[i];
+
+   packets += READ_ONCE(ring->packets);
+   bytes += READ_ONCE(ring->bytes);
+   }
+   priv->pkstats.rx_packets = packets;
+   priv->pkstats.rx_bytes = bytes;
+
+   packets = 0;
+   bytes = 0;
+   for (i = 0; i < priv->tx_ring_num; i++) {
+   const struct mlx4_en_tx_ring *ring = priv->tx_ring[i];
+
+   packets += READ_ONCE(ring->packets);
+   bytes += READ_ONCE(ring->bytes);
+   }
+   priv->pkstats.tx_packets = packets;
+   priv->pkstats.tx_bytes = bytes;
+}
+
 int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
 {
struct mlx4_en_stat_out_mbox *mlx4_en_stats;
struct mlx4_en_stat_out_flow_control_mbox *flowstats;
-   struct mlx4_en_priv *priv = netdev_priv(mdev->pndev[port]);
+   struct net_device *dev = mdev->pndev[port];
+   struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_vport_stats *vport_stats = &priv->vport_stats;
struct mlx4_cmd_mailbox *mailbox = NULL;
struct mlx4_cmd_mailbox *mailbox_flow = NULL;
@@ -138,7 +172,6 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u
int do_if_stat = 1;
unsigned long period = (unsigned long) (jiffies - 
priv->last_ifq_jiffies);
struct mlx4_en_vport_stats tmp_vport_stats;
-struct net_device *dev;
 
if (jiffies_to_msecs(period) < EN_IFQ_MIN_INTERVAL ||
priv->counter_index == 0xff)
@@ -528,8 +561,12 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u
be64_to_cpu(flowstats[i].tx_pause_transition);
}
 
-   memset(&tmp_vport_stats, 0, sizeof(tmp_vport_stats));
+   mlx4_en_fold_software_stats(dev);
+
spin_unlock(&priv->stats_lock);
+
+   memset(&tmp_vport_stats, 0, sizeof(tmp_vport_stats));
+
err = mlx4_get_vport_ethtool_stats(mdev->dev, port,
   &tmp_vport_stats, reset);
spin_lock(&priv->stats_lock);
@@ -552,42 +589,37 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u
vport_stats->tx_errors = tmp_vport_stats.tx_errors;
}
 
-   if (!mlx4_is_mfunc(mdev->dev)) {
-/* netdevice stats format */
 #if __FreeBSD_version >= 110
-   if (reset == 0) {
-   dev = mdev->pndev[port];
-   if_inc_counter(dev, IFCOUNTER_IPACKETS,
-   priv->pkstats.rx_packets - 
priv->pkstats_last.rx_packets);
-   if_inc_counter(dev, IFCOUNTER_OPACKETS,
-   priv->pkstats.tx_packets - 
priv->pkstats_last.tx_packets);
-   if_inc_counter(dev, IFCOUNTER_IBYTES,
-   priv->pkstats.rx_bytes - 
priv->pkstats_last.rx_bytes);
-   if_inc_counter(dev, IFCOUNTER_OBYTES,
-   priv->pkstats.tx_bytes - 
priv->pkstats_last.tx_bytes);
-   if_inc_counter(dev, IFCOUNTER_IERRORS,
-   priv->pkstats.rx_errors - 
priv->pkstats_last.rx_errors);
-   if_inc_counter(dev, IFCOUNTER_IQDROPS,
-   priv->pkstats.rx_dropped - 
priv->pkstats_last.rx_dropped);
-   if_inc_counter(dev, IFCOUNTER_IMCASTS,
-   priv->pkstats.rx_multicast_packets - 
priv->pkstats_last.rx_multicast_packets);
-   if_inc_counter(dev, IFCOUNTER_OMCASTS,
-   priv->pkstats.tx_multicast_packets - 
priv->pkstats_last.tx_multicast_packets);
-   }
-   priv->pkstats_last = priv->pkstats;
+   if (reset == 0)

Re: svn commit: r322252 - head/usr.bin/vmstat

2017-08-09 Thread Emmanuel Vadot
On Wed, 9 Aug 2017 18:44:19 +1000 (EST)
Bruce Evans  wrote:

> On Tue, 8 Aug 2017, Emmanuel Vadot wrote:
> 
> > On Tue, 8 Aug 2017 23:55:52 +1000 (EST)
> > Bruce Evans  wrote:
> >
> >> On Tue, 8 Aug 2017, Emmanuel Vadot wrote:
> >>
> >>> Log:
> >>>  vmstat: Always emit a space after the free-memory column
> >>>
> >>>  When displaying in non-human form, if the free-memory number
> >>>  is large (more than 7 digits), there is no space between it and
> >>>  the page fault column.
> >>>
> >>>  PR:  221290
> >>>  Submitted by:Josuah Demangeon  (Original version)
> >>>
> >>> Modified:
> >>>  head/usr.bin/vmstat/vmstat.c
> >>>
> >>> Modified: head/usr.bin/vmstat/vmstat.c
> >>> ==
> >>> --- head/usr.bin/vmstat/vmstat.c  Tue Aug  8 11:49:36 2017
> >>> (r322251)
> >>> +++ head/usr.bin/vmstat/vmstat.c  Tue Aug  8 12:18:11 2017
> >>> (r322252)
> >>> @@ -832,6 +832,7 @@ dovmstat(unsigned int interval, int reps)
> >>>   xo_emit(" ");
> >>>   xo_emit("{:free-memory/%7d}",
> >>>   vmstat_pgtok(total.t_free));
> >>> + xo_emit(" ");
> >>>   }
> >>>   xo_emit("{:total-page-faults/%5lu} ",
> >>>   (unsigned long)rate(sum.v_vm_faults -
> >>
> >> This seems to break the formatting.  There was a negative amount of space
> >> available for expansion, and since the header was not expanded to match
> >> its alignment with the fields is more random than before.  With -h, the
> >> width was 80 columns, giving ugly line wrap on 80-column terminals with
> >> auto-wrap.  Now it is 81 columns, giving uglier line wrap on all 80-
> >> column terminals.
> >
> > This break nothing, This was the case before too (with or without
> > -h), just tested in tmux with force-width 80.
> 
> Testing shows that it breaks the -H case as expected.  (I had misread the
> change as affecting the -h case too.)
> 
> Before:
> 
> X procs memorypagedisks faults cpu
> X r b w avm fre  flt  re  pi  pofr   sr ad0 ad1   insycs 
> us sy id
> X 0 0 0 12719376  977460 2167   3  28   0  2545  451   0   0  268 27162  7175 
>  9  1 91
> 
> Misformatting in the data line starts with the avm field taking 8 of the 7
> columns reserved for it.  This and all subsequent fields are misaligned with
> the header.
> 
> The header is pre-misformatted to width 85, with lots of inconsistencies in
> the first line.  Old versions were carefully formatted to width 79, with no
> inconsistencies in the first line.  The extra width for avm makes the extra
> width for the header not even work to line up.
> 
> X procs memorypagedisks faults cpu
> X r b w avm fre  flt  re  pi  pofr   sr ad0 ad1   insycs 
> us sy id
> X 0 0 0 12719380  977460  2167   3  28   0  2545  451   0   0  268 27162  
> 7175  9  1 91
> 
> The new bugs are that the extra space before the "flt" field increases the
> off-by-1 error to off-by-2 for this field and all subsequent fields.  All
> fields starting with "flt" now have an error of at least off-by-1 even
> if none are too wide, since the header was not expanded to match.  Expansion
> would increase its breakage from 6 to wide to 7 too wide.

 Thanks, I know see the problem.
 I'll see if this could be corrected easily with libxo ...

> >> The bugs were mostly in the first line of the header:
> >> - the second line of the header was correct for vmstat -h
> >> - for vmstat without -h, the second line of the header was apparently 
> >> broken
> >>by a change like the one here, that added a space after the "r b w" 
> >> fields
> >>without adding one in the "r b w" header
> >> - most of the fields in the first line of the header are misaligned with 
> >> the
> >>second lone.  Many have drifted 3 to the left of where the were in a 
> >> sort
> >>of center-justified place.  Some of these might have actually been
> >>intended to be left justified, but had an off by +1 error.  Now these
> >>have an error of off by -2 relative to left justifications.
> >>
> >> Only the "memory" header in the first line is better than in old versions.
> >> It is now left justified.  Left justifying all headers in the first line
> >> is probably best.  I couldn't find a good way to delimit the right hand
> >> side of the extents of the headers in the first line.  The second line of
> >> the headers already uses right justification consistently and this works
> >> well.
> >
> > I think that all this might be true but you might talk about the whole
> > libxo conversion that was done, not my commit right ?
> 
> I try not to look at libxo, since its misformattings are enormous starting
> in the source code.
> 
> My columnize.awk script works almost perfectly to fix the above
> misformattings:
> 
> X BEGIN {
> X columns = 79

svn commit: r322302 - head/sys/cam/ctl

2017-08-09 Thread Alexander Motin
Author: mav
Date: Wed Aug  9 09:13:15 2017
New Revision: 322302
URL: https://svnweb.freebsd.org/changeset/base/322302

Log:
  Do not loose CCB flags after r320493.
  
  There is at least CAM_UNLOCKED that should be kept.
  
  MFC after:3 days

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Wed Aug  9 08:57:00 2017(r322301)
+++ head/sys/cam/ctl/scsi_ctl.c Wed Aug  9 09:13:15 2017(r322302)
@@ -1003,7 +1003,8 @@ ctlfe_requeue_ccb(struct cam_periph *periph, union ccb
 * target/lun.  Reset the target and LUN fields back to the wildcard
 * values before we send them back down to the SIM.
 */
-   xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NONE);
+   xpt_setup_ccb_flags(&ccb->ccb_h, periph->path, CAM_PRIORITY_NONE,
+   ccb->ccb_h.flags);
 
xpt_action(ccb);
 }
___
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: r322252 - head/usr.bin/vmstat

2017-08-09 Thread Bruce Evans

On Tue, 8 Aug 2017, Emmanuel Vadot wrote:


On Tue, 8 Aug 2017 23:55:52 +1000 (EST)
Bruce Evans  wrote:


On Tue, 8 Aug 2017, Emmanuel Vadot wrote:


Log:
 vmstat: Always emit a space after the free-memory column

 When displaying in non-human form, if the free-memory number
 is large (more than 7 digits), there is no space between it and
 the page fault column.

 PR:221290
 Submitted by:  Josuah Demangeon  (Original version)

Modified:
 head/usr.bin/vmstat/vmstat.c

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cTue Aug  8 11:49:36 2017
(r322251)
+++ head/usr.bin/vmstat/vmstat.cTue Aug  8 12:18:11 2017
(r322252)
@@ -832,6 +832,7 @@ dovmstat(unsigned int interval, int reps)
xo_emit(" ");
xo_emit("{:free-memory/%7d}",
vmstat_pgtok(total.t_free));
+   xo_emit(" ");
}
xo_emit("{:total-page-faults/%5lu} ",
(unsigned long)rate(sum.v_vm_faults -


This seems to break the formatting.  There was a negative amount of space
available for expansion, and since the header was not expanded to match
its alignment with the fields is more random than before.  With -h, the
width was 80 columns, giving ugly line wrap on 80-column terminals with
auto-wrap.  Now it is 81 columns, giving uglier line wrap on all 80-
column terminals.


This break nothing, This was the case before too (with or without
-h), just tested in tmux with force-width 80.


Testing shows that it breaks the -H case as expected.  (I had misread the
change as affecting the -h case too.)

Before:

X procs memorypagedisks faults cpu
X r b w avm fre  flt  re  pi  pofr   sr ad0 ad1   insycs us 
sy id
X 0 0 0 12719376  977460 2167   3  28   0  2545  451   0   0  268 27162  7175  
9  1 91

Misformatting in the data line starts with the avm field taking 8 of the 7
columns reserved for it.  This and all subsequent fields are misaligned with
the header.

The header is pre-misformatted to width 85, with lots of inconsistencies in
the first line.  Old versions were carefully formatted to width 79, with no
inconsistencies in the first line.  The extra width for avm makes the extra
width for the header not even work to line up.

X procs memorypagedisks faults cpu
X r b w avm fre  flt  re  pi  pofr   sr ad0 ad1   insycs us 
sy id
X 0 0 0 12719380  977460  2167   3  28   0  2545  451   0   0  268 27162  7175  
9  1 91

The new bugs are that the extra space before the "flt" field increases the
off-by-1 error to off-by-2 for this field and all subsequent fields.  All
fields starting with "flt" now have an error of at least off-by-1 even
if none are too wide, since the header was not expanded to match.  Expansion
would increase its breakage from 6 to wide to 7 too wide.


The bugs were mostly in the first line of the header:
- the second line of the header was correct for vmstat -h
- for vmstat without -h, the second line of the header was apparently broken
   by a change like the one here, that added a space after the "r b w" fields
   without adding one in the "r b w" header
- most of the fields in the first line of the header are misaligned with the
   second lone.  Many have drifted 3 to the left of where the were in a sort
   of center-justified place.  Some of these might have actually been
   intended to be left justified, but had an off by +1 error.  Now these
   have an error of off by -2 relative to left justifications.

Only the "memory" header in the first line is better than in old versions.
It is now left justified.  Left justifying all headers in the first line
is probably best.  I couldn't find a good way to delimit the right hand
side of the extents of the headers in the first line.  The second line of
the headers already uses right justification consistently and this works
well.


I think that all this might be true but you might talk about the whole
libxo conversion that was done, not my commit right ?


I try not to look at libxo, since its misformattings are enormous starting
in the source code.

My columnize.awk script works almost perfectly to fix the above
misformattings:

X BEGIN {
X   columns = 79# XXX
X }
X 
X {

X   # Determine fields and field widths for current line.
X   # awk's field splitting feature turned out to be inadequate,
X   # and this would be even easier in C.
X   n = split($0, a, "")
X   f = 1
X   j = 1
X   while (j <= n) {
X   cpw[f] = 0
X   cfw[f] = 0
X   while (j <= n && a[j] == " ") {
X   cpw[f]++# current (left) padding width
X   j++
X   }
X   if (

svn commit: r322300 - head/sys/netinet

2017-08-09 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Aug  9 07:24:58 2017
New Revision: 322300
URL: https://svnweb.freebsd.org/changeset/base/322300

Log:
  Correct sysctl names.

Modified:
  head/sys/netinet/in.h

Modified: head/sys/netinet/in.h
==
--- head/sys/netinet/in.h   Wed Aug  9 05:59:45 2017(r322299)
+++ head/sys/netinet/in.h   Wed Aug  9 07:24:58 2017(r322300)
@@ -289,7 +289,7 @@ __END_DECLS
  * if you trust the remote host to restrict these ports.
  *
  * The default range of ports and the high range can be changed by
- * sysctl(3).  (net.inet.ip.port{hi,low}{first,last}_auto)
+ * sysctl(3).  (net.inet.ip.portrange.{hi,low,}{first,last})
  *
  * Changing those values has bad security implications if you are
  * using a stateless firewall that is allowing packets outside of that
___
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: r322258 - head/sys/kern

2017-08-09 Thread Bruce Evans

On Tue, 8 Aug 2017, Alan Somers wrote:


Log:
 Make p1003_1b.aio_listio_max a tunable

 p1003_1b.aio_listio_max is now a tunable. Its value is reflected in the
 sysctl of the same name, and the sysconf(3) variable _SC_AIO_LISTIO_MAX.
 Its value will be bounded from below by the compile-time constant
 AIO_LISTIO_MAX and from above by the compile-time constant
 MAX_AIO_QUEUE_PER_PROC and the tunable vfs.aio.max_aio_queue.


I don't like tunables or sysctls being limited or silently limiting them.
This is not done for more important sysctls like kern.maxfilesperproc.
Lots of silent runtime limiting is done for a few more important limits
like kern.maxfilesperproc.

The limiting is also buggy:
- vfs.aio.max_aio_queue isn't a tunable as stated.  It is a r/w sysctl
- if vfs.aio.max_aio_queue were a r/o tunable, then there would be a
  solvable ordering problem initializing it before using it
- since vfs.aio.max_aio_queue is only a sysctl, it is unusable at boot
  time (and module load time), but it is used there.

Other bugs in vfs.aio.max_aio_queue:
- its name is too long, yet not very descriptive
- its name repeats "aio"
- its name but doesn't say "len", so it looks like it limits a number of
  queues and not the length of a single queue.  This is backwards relative
  to the corresponding variable name.  That is missing "aio" when it
  is needed, but only spells "length" badly as "count".  It is
  max_queue_count, but should be something like aio_max_qlen.  All
  sysctl variables should have an aio_ prefix which is removed in the
  leaf name in the sysctl tree.
Other names have similar or worse bugs.  Bugs start with parameter names
MAX_AIO_* instead of AIO_*_MAX, and variable names track this.  There is
some ambiguity from global vs per-process limits and counts, and the
noise word "num" is sprinkled to get names which differ without describing
any difference.


Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Tue Aug  8 16:06:16 2017(r322257)
+++ head/sys/kern/vfs_aio.c Tue Aug  8 16:14:31 2017(r322258)
@@ -102,6 +102,7 @@ static uint64_t jobseqno;
#endif

FEATURE(aio, "Asynchronous I/O");
+SYSCTL_DECL(_p1003_1b);

static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list");

@@ -168,6 +169,11 @@ static int max_buf_aio = MAX_BUF_AIO;
SYSCTL_INT(_vfs_aio, OID_AUTO, max_buf_aio, CTLFLAG_RW, &max_buf_aio, 0,
"Maximum buf aio requests per process (stored in the process)");

+static int aio_listio_max = AIO_LISTIO_MAX;
+SYSCTL_INT(_p1003_1b, CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max,
+CTLFLAG_RDTUN | CTLFLAG_CAPRD, &aio_listio_max, 0,
+"Maximum aio requests for a single lio_listio call");
+


The POSIX namespace is missing all of the bugs described above.  It has
aio first (except, for historical reasons it unfortunately has p10031b
instead of vfs.aio for the sysctl prefix), and max last.


#ifdef COMPAT_FREEBSD6
typedef struct oaiocb {
int aio_fildes; /* File descriptor */
@@ -388,6 +394,11 @@ static int
aio_onceonly(void)
{

+   if (aio_listio_max < AIO_LISTIO_MAX)
+   aio_listio_max = AIO_LISTIO_MAX;
+   if (aio_listio_max > MIN(MAX_AIO_QUEUE_PER_PROC, max_queue_count))
+   aio_listio_max = MIN(MAX_AIO_QUEUE_PER_PROC, max_queue_count);
+


max_queue_count is not initialized here, except to a default at compile
time.  Except for module (re)load, it always has the default value
MAX_AIO_QUEUE = 1024
  (this 1024 is bogusly ifdefed.  MAX_AIO_QUEUE is not defined in any
  header file and is not a supported option, and the tunable makes the
  option less needed than before).
MAX_AIO_QUEUE_PER_PROC = 256, modulo a similar unsupported option.
Thus MIN(MAX_AIO_QUEUE_PER_PROC, max_queue_count) is an obfuscated spelling
of 256.

MAX_AIO_QUEUE_PER_PROC is also just the default for a variable
(max_aio_queue_per_proc), so using it here has the same bugs except for
the obfuscation.

Using MIN() instead of imin() is a style bug.

OTOH, AIO_LISTIO_MAX is defined (as 16) in a header file, and is not
bogusly ifdefed.  It is 1 of 3 aio limits specified by POSIX.

The checking would be buggy if it were done later, since max_queue_count
is not checked and limiting to it can corrupt aio_listio_max (when it is
negative or just too small).

The compile-time definition of AIO_LISTIO_MAX seems to be broken.  I think
POSIX species that AIO_LISTIO_MAX shall not be defined if the value of
{AIO_LISTIO_MAX} varies at runtime, but it is still defined.  FreeBSD
has this bug for many other sysconf() variables, e.g., {OPEN_MAX}.
Perhaps AIO_LISTIO_MAX is easier to fix since it is not hard-coded as
often as OPEN_MAX.

AIO_LISTIO_MAX is now just the FreeBSD default, but the first check in
the above restricts {AIO_LISTIO_MAX} to this default (16) instead of to
the POSIX limit of _POSIX_IO_LISTIO_MAX (2).  Relaxing this check would
cause more problems with h