svn commit: r309605 - in stable: 10 11 9

2016-12-05 Thread Dimitry Andric
Author: dim
Date: Tue Dec  6 07:33:49 2016
New Revision: 309605
URL: https://svnweb.freebsd.org/changeset/base/309605

Log:
  MFC r309332:
  
  Cleanup old debug dirs in delete-old-dirs target
  
  Any .debug or .symbols files under /usr/lib/debug which correspond to
  OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
  by the delete-old target.  Make this also apply to any OLD_DIRS entries.
  
  Reviewed by:  emaste
  Differential Revision: https://reviews.freebsd.org/D8683

Modified:
  stable/10/Makefile.inc1
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/Makefile.inc1
  stable/9/Makefile.inc1   (contents, props changed)
Directory Properties:
  stable/11/   (props changed)
  stable/9/   (props changed)

Modified: stable/10/Makefile.inc1
==
--- stable/10/Makefile.inc1 Tue Dec  6 06:15:28 2016(r309604)
+++ stable/10/Makefile.inc1 Tue Dec  6 07:33:49 2016(r309605)
@@ -2028,6 +2028,11 @@ delete-old-dirs:
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
@echo ">>> Old directories removed"
 
@@ -2042,6 +2047,11 @@ check-old-dirs:
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
 
 delete-old: delete-old-files delete-old-dirs
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309605 - in stable: 10 11 9

2016-12-05 Thread Dimitry Andric
Author: dim
Date: Tue Dec  6 07:33:49 2016
New Revision: 309605
URL: https://svnweb.freebsd.org/changeset/base/309605

Log:
  MFC r309332:
  
  Cleanup old debug dirs in delete-old-dirs target
  
  Any .debug or .symbols files under /usr/lib/debug which correspond to
  OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
  by the delete-old target.  Make this also apply to any OLD_DIRS entries.
  
  Reviewed by:  emaste
  Differential Revision: https://reviews.freebsd.org/D8683

Modified:
  stable/11/Makefile.inc1
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/Makefile.inc1
  stable/9/Makefile.inc1   (contents, props changed)
Directory Properties:
  stable/10/   (props changed)
  stable/9/   (props changed)

Modified: stable/11/Makefile.inc1
==
--- stable/11/Makefile.inc1 Tue Dec  6 06:15:28 2016(r309604)
+++ stable/11/Makefile.inc1 Tue Dec  6 07:33:49 2016(r309605)
@@ -2345,6 +2345,11 @@ delete-old-dirs: .PHONY
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
@echo ">>> Old directories removed"
 
@@ -2359,6 +2364,11 @@ check-old-dirs: .PHONY
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
 
 delete-old: delete-old-files delete-old-dirs .PHONY
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309605 - in stable: 10 11 9

2016-12-05 Thread Dimitry Andric
Author: dim
Date: Tue Dec  6 07:33:49 2016
New Revision: 309605
URL: https://svnweb.freebsd.org/changeset/base/309605

Log:
  MFC r309332:
  
  Cleanup old debug dirs in delete-old-dirs target
  
  Any .debug or .symbols files under /usr/lib/debug which correspond to
  OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
  by the delete-old target.  Make this also apply to any OLD_DIRS entries.
  
  Reviewed by:  emaste
  Differential Revision: https://reviews.freebsd.org/D8683

Modified:
  stable/9/Makefile.inc1   (contents, props changed)
Directory Properties:
  stable/9/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/Makefile.inc1
  stable/11/Makefile.inc1
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/9/Makefile.inc1
==
--- stable/9/Makefile.inc1  Tue Dec  6 06:15:28 2016(r309604)
+++ stable/9/Makefile.inc1  Tue Dec  6 07:33:49 2016(r309605)
@@ -1659,6 +1659,11 @@ delete-old-dirs:
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
@echo ">>> Old directories removed"
 
@@ -1673,6 +1678,11 @@ check-old-dirs:
elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove 
everything manually."; \
fi; \
+   if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
+   elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
+   echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please 
remove everything manually."; \
+   fi; \
done
 
 delete-old: delete-old-files delete-old-dirs
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309604 - head/sys/arm/include

2016-12-05 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Dec  6 06:15:28 2016
New Revision: 309604
URL: https://svnweb.freebsd.org/changeset/base/309604

Log:
  Fix the armv6 build after r309553.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Tue Dec  6 06:12:01 2016(r309603)
+++ head/sys/arm/include/pmap.h Tue Dec  6 06:15:28 2016(r309604)
@@ -30,7 +30,6 @@
 #ifndef _MACHINE_PMAP_H_
 #define _MACHINE_PMAP_H_
 
-#include 
 #if __ARM_ARCH >= 6
 #include 
 #else
@@ -38,6 +37,7 @@
 #endif
 
 #ifdef _KERNEL
+#include 
 
 extern vm_paddr_t dump_avail[];
 extern vm_paddr_t phys_avail[];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309603 - head/sys/dev/usb/wlan

2016-12-05 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Dec  6 06:12:01 2016
New Revision: 309603
URL: https://svnweb.freebsd.org/changeset/base/309603

Log:
  rsu: fix printf format specifiers.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Tue Dec  6 06:04:13 2016
(r309602)
+++ head/sys/dev/usb/wlan/if_rsu.c  Tue Dec  6 06:12:01 2016
(r309603)
@@ -1473,7 +1473,7 @@ rsu_process_key(struct ieee80211vap *vap
if (>iv_nw_keys[0] <= k &&
k < >iv_nw_keys[IEEE80211_WEP_NKID]) {
KASSERT(k->wk_keyix < nitems(sc->group_keys),
-   ("keyix %d > %d\n", k->wk_keyix, nitems(sc->group_keys)));
+   ("keyix %u > %zu\n", k->wk_keyix, nitems(sc->group_keys)));
 
RSU_LOCK(sc);
sc->group_keys[k->wk_keyix] = (set ? k : NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-12-05 Thread Ngie Cooper
Author: ngie
Date: Tue Dec  6 06:04:13 2016
New Revision: 309602
URL: https://svnweb.freebsd.org/changeset/base/309602

Log:
  Remove svn[lite]{bench,fsfs} if either MK_SVN == no or MK_SVNLITE == no
  
  MFC after:1 week

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

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Dec  6 04:38:08 
2016(r309601)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Dec  6 06:04:13 
2016(r309602)
@@ -8826,7 +8826,9 @@ OLD_FILES+=usr/share/man/man8/wpa_suppli
 .if ${MK_SVNLITE} == no || ${MK_SVN} == yes
 OLD_FILES+=usr/bin/svnlite
 OLD_FILES+=usr/bin/svnliteadmin
+OLD_FILES+=usr/bin/svnlitebench
 OLD_FILES+=usr/bin/svnlitedumpfilter
+OLD_FILES+=usr/bin/svnlitefsfs
 OLD_FILES+=usr/bin/svnlitelook
 OLD_FILES+=usr/bin/svnlitemucc
 OLD_FILES+=usr/bin/svnliterdump
@@ -8839,7 +8841,9 @@ OLD_FILES+=usr/share/man/man1/svnlite.1.
 .if ${MK_SVN} == no
 OLD_FILES+=usr/bin/svn
 OLD_FILES+=usr/bin/svnadmin
+OLD_FILES+=usr/bin/svnbench
 OLD_FILES+=usr/bin/svndumpfilter
+OLD_FILES+=usr/bin/svnfsfs
 OLD_FILES+=usr/bin/svnlook
 OLD_FILES+=usr/bin/svnmucc
 OLD_FILES+=usr/bin/svnrdump
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309601 - stable/10/lib/libc/tests/stdio

2016-12-05 Thread Ngie Cooper
Author: ngie
Date: Tue Dec  6 04:38:08 2016
New Revision: 309601
URL: https://svnweb.freebsd.org/changeset/base/309601

Log:
  MFstable/11 r309600:
  
  MFC r307220:
  r307220 (by br):
  
  Fix typos: use correct string format and value to compare.

Modified:
  stable/10/lib/libc/tests/stdio/printbasic_test.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/tests/stdio/printbasic_test.c
==
--- stable/10/lib/libc/tests/stdio/printbasic_test.cTue Dec  6 04:35:24 
2016(r309600)
+++ stable/10/lib/libc/tests/stdio/printbasic_test.cTue Dec  6 04:38:08 
2016(r309601)
@@ -124,10 +124,10 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt(S_ULONGMAX, "%lu", ULONG_MAX);
 
testfmt("-1", "%lld", (long long)-1);
-   testfmt(S_ULONGMAX, "%lu", ULLONG_MAX);
+   testfmt(S_ULLONGMAX, "%llu", ULLONG_MAX);
 
testfmt("-1", "%d", -1);
-   testfmt(S_UINT32MAX, "%lu", UINT32_MAX);
+   testfmt(S_UINT32MAX, "%u", UINT32_MAX);
 
testfmt("-1", "%hd", -1);
testfmt("65535", "%hu", USHRT_MAX);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309600 - stable/11/lib/libc/tests/stdio

2016-12-05 Thread Ngie Cooper
Author: ngie
Date: Tue Dec  6 04:35:24 2016
New Revision: 309600
URL: https://svnweb.freebsd.org/changeset/base/309600

Log:
  MFC r307220:
  r307220 (by br):
  
  Fix typos: use correct string format and value to compare.

Modified:
  stable/11/lib/libc/tests/stdio/printbasic_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/tests/stdio/printbasic_test.c
==
--- stable/11/lib/libc/tests/stdio/printbasic_test.cTue Dec  6 04:28:56 
2016(r309599)
+++ stable/11/lib/libc/tests/stdio/printbasic_test.cTue Dec  6 04:35:24 
2016(r309600)
@@ -124,10 +124,10 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt(S_ULONGMAX, "%lu", ULONG_MAX);
 
testfmt("-1", "%lld", (long long)-1);
-   testfmt(S_ULONGMAX, "%lu", ULLONG_MAX);
+   testfmt(S_ULLONGMAX, "%llu", ULLONG_MAX);
 
testfmt("-1", "%d", -1);
-   testfmt(S_UINT32MAX, "%lu", UINT32_MAX);
+   testfmt(S_UINT32MAX, "%u", UINT32_MAX);
 
testfmt("-1", "%hd", -1);
testfmt("65535", "%hu", USHRT_MAX);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309599 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:28:56 2016
New Revision: 309599
URL: https://svnweb.freebsd.org/changeset/base/309599

Log:
  libdtrace: Don't use a read-only handle for enumerating pid probes.
  
  Enumeration of return probes involves disassembling subroutines in the
  target process, and ptrace(2) is currently used to read from the target
  process. libproc could read from the backing file instead to avoid this
  problem, but in the common case libdtrace will have a writeable handle
  on the process anyway. In particular, a writeable handle is needed to list
  USDT probes, and libdtrace will cache such a handle for processes that it
  controls via dtrace -c and -p.

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Tue Dec  6 
04:23:32 2016(r309598)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Tue Dec  6 
04:28:56 2016(r309599)
@@ -729,8 +729,13 @@ dt_pid_create_probes(dtrace_probedesc_t 
(void) snprintf(provname, sizeof (provname), "pid%d", (int)pid);
 
if (gmatch(provname, pdp->dtpd_provider) != 0) {
+#ifdef __FreeBSD__
+   if ((P = dt_proc_grab(dtp, pid, 0, 1)) == NULL)
+#else
if ((P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE,
-   0)) == NULL) {
+   0)) == NULL)
+#endif
+   {
(void) dt_pid_error(dtp, pcb, NULL, NULL, D_PROC_GRAB,
"failed to grab process %d", (int)pid);
return (-1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309598 - in head: . lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:23:32 2016
New Revision: 309598
URL: https://svnweb.freebsd.org/changeset/base/309598

Log:
  Bump the libproc library version.

Modified:
  head/ObsoleteFiles.inc
  head/lib/libproc/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Dec  6 04:22:38 2016(r309597)
+++ head/ObsoleteFiles.inc  Tue Dec  6 04:23:32 2016(r309598)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20161205: libproc version bump
+OLD_LIBS+=usr/lib/libproc.so.3
+OLD_LIBS+=usr/lib32/libproc.so.3
 # 20161127: Remove vm_page_cache(9)
 OLD_FILES+=usr/share/man/man9/vm_page_cache.9.gz
 # 20161124: new clang import which bumps version from 3.8.0 to 3.9.0.

Modified: head/lib/libproc/Makefile
==
--- head/lib/libproc/Makefile   Tue Dec  6 04:22:38 2016(r309597)
+++ head/lib/libproc/Makefile   Tue Dec  6 04:23:32 2016(r309598)
@@ -37,7 +37,7 @@ CFLAGS+=  -I${.CURDIR}/../../cddl/contrib
 CFLAGS+=   -DNO_CTF
 .endif
 
-SHLIB_MAJOR=   3
+SHLIB_MAJOR=   4
 
 MAN=
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309597 - in head: cddl/compat/opensolaris/include cddl/lib/libdtrace lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:22:38 2016
New Revision: 309597
URL: https://svnweb.freebsd.org/changeset/base/309597

Log:
  libproc: Add support for some proc_attach() flags.
  
  This change adds some handling for the equivalent of Solaris' PGRAB_*
  flags. In particular, support for PGRAB_RDONLY is needed to avoid a
  nasty deadlock: dtrace(1) may otherwise stop the master process for its
  pseudo-terminal and end up blocking while writing to standard output.

Modified:
  head/cddl/compat/opensolaris/include/libproc.h
  head/cddl/lib/libdtrace/libproc_compat.h
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_util.c

Modified: head/cddl/compat/opensolaris/include/libproc.h
==
--- head/cddl/compat/opensolaris/include/libproc.h  Tue Dec  6 04:21:35 
2016(r309596)
+++ head/cddl/compat/opensolaris/include/libproc.h  Tue Dec  6 04:22:38 
2016(r309597)
@@ -38,9 +38,6 @@
 #define PR_RLC 0x0001
 #define PR_KLC 0x0002
 
-#definePGRAB_RDONLYO_RDONLY
-#definePGRAB_FORCE 0
-
 #include_next 
 
 #endif

Modified: head/cddl/lib/libdtrace/libproc_compat.h
==
--- head/cddl/lib/libdtrace/libproc_compat.hTue Dec  6 04:21:35 2016
(r309596)
+++ head/cddl/lib/libdtrace/libproc_compat.hTue Dec  6 04:22:38 2016
(r309597)
@@ -34,6 +34,9 @@
  * Functions sorted alphabetically.
  */
 #definePR_LMID_EVERY 0
+#definePGRAB_RDONLYPATTACH_RDONLY
+#definePGRAB_FORCE PATTACH_FORCE
+
 #definePsetrun(p, a1, a2) proc_continue((p))
 #definePxlookup_by_addr(p, a, n, s, sym, i) \
 proc_addr2sym(p, a, n, s, sym)

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Tue Dec  6 04:21:35 2016(r309596)
+++ head/lib/libproc/libproc.h  Tue Dec  6 04:22:38 2016(r309597)
@@ -50,6 +50,11 @@ typedef void (*proc_child_func)(void *);
 #define PS_DEAD5
 #define PS_LOST6
 
+/* Flags for proc_attach(). */
+#definePATTACH_FORCE   0x01
+#definePATTACH_RDONLY  0x02
+#definePATTACH_NOSTOP  0x04
+
 /* Reason values for proc_detach(). */
 #define PRELEASE_HANG  1
 #define PRELEASE_KILL  2

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Tue Dec  6 04:21:35 2016
(r309596)
+++ head/lib/libproc/proc_create.c  Tue Dec  6 04:22:38 2016
(r309597)
@@ -127,7 +127,7 @@ proc_attach(pid_t pid, int flags, struct
struct proc_handle *phdl;
int error, status;
 
-   if (pid == 0 || pid == getpid())
+   if (pid == 0 || (pid == getpid() && (flags & PATTACH_RDONLY) == 0))
return (EINVAL);
if (elf_version(EV_CURRENT) == EV_NONE)
return (ENOENT);
@@ -140,27 +140,32 @@ proc_attach(pid_t pid, int flags, struct
if (error != 0)
goto out;
 
-   if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) {
-   error = errno;
-   DPRINTF("ERROR: cannot ptrace child process %d", pid);
-   goto out;
-   }
+   if ((flags & PATTACH_RDONLY) == 0) {
+   if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) {
+   error = errno;
+   DPRINTF("ERROR: cannot ptrace child process %d", pid);
+   goto out;
+   }
 
-   /* Wait for the child process to stop. */
-   if (waitpid(pid, , WUNTRACED) == -1) {
-   error = errno;
-   DPRINTF("ERROR: child process %d didn't stop as expected", pid);
-   goto out;
-   }
+   /* Wait for the child process to stop. */
+   if (waitpid(pid, , WUNTRACED) == -1) {
+   error = errno;
+   DPRINTF("ERROR: child process %d didn't stop as 
expected", pid);
+   goto out;
+   }
 
-   /* Check for an unexpected status. */
-   if (!WIFSTOPPED(status))
-   DPRINTFX("ERROR: child process %d status 0x%x", pid, status);
-   else
-   phdl->status = PS_STOP;
+   /* Check for an unexpected status. */
+   if (!WIFSTOPPED(status))
+   DPRINTFX("ERROR: child process %d status 0x%x", pid, 
status);
+   else
+   phdl->status = PS_STOP;
+
+   if ((flags & PATTACH_NOSTOP) != 0)
+   proc_continue(phdl);
+   }
 
 out:
-   if (error && phdl != NULL) {
+   if (error != 0 && phdl != NULL) {
proc_free(phdl);
phdl = NULL;
}

Modified: 

svn commit: r309596 - head/lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:21:35 2016
New Revision: 309596
URL: https://svnweb.freebsd.org/changeset/base/309596

Log:
  libproc: Cache symbol tables for mapped objects upon access.
  
  Extend the file handle cache entries to include symbol tables as well. An
  index is used to implement binary search by symbol value. Lookups by
  name are comparatively rare and are thus still implemented with a linear
  search, but support for a binary search by name would be straightforward
  to add if needed.

Modified:
  head/lib/libproc/_libproc.h
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Tue Dec  6 04:20:32 2016(r309595)
+++ head/lib/libproc/_libproc.h Tue Dec  6 04:21:35 2016(r309596)
@@ -39,10 +39,22 @@
 
 struct procstat;
 
+struct symtab {
+   Elf_Data *data;
+   u_int   nsyms;
+   u_int   *index;
+   u_long  stridx;
+};
+
 struct file_info {
Elf *elf;
int fd;
u_int   refs;
+   GElf_Ehdr ehdr;
+
+   /* Symbol tables, sorted by value. */
+   struct symtab dynsymtab;
+   struct symtab symtab;
 };
 
 struct map_info {

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Tue Dec  6 04:20:32 2016
(r309595)
+++ head/lib/libproc/proc_create.c  Tue Dec  6 04:21:35 2016
(r309596)
@@ -239,6 +239,10 @@ proc_free(struct proc_handle *phdl)
if (file->elf != NULL) {
(void)elf_end(file->elf);
(void)close(file->fd);
+   if (file->symtab.nsyms > 0)
+   free(file->symtab.index);
+   if (file->dynsymtab.nsyms > 0)
+   free(file->dynsymtab.index);
}
free(file);
}

Modified: head/lib/libproc/proc_sym.c
==
--- head/lib/libproc/proc_sym.c Tue Dec  6 04:20:32 2016(r309595)
+++ head/lib/libproc/proc_sym.c Tue Dec  6 04:21:35 2016(r309596)
@@ -101,6 +101,74 @@ fail:
 }
 
 static int
+symvalcomp(void *thunk, const void *a1, const void *a2)
+{
+   struct symtab *symtab;
+   GElf_Sym sym1, sym2;
+   u_int i1, i2;
+   int ret;
+
+   i1 = *(const u_int *)a1;
+   i2 = *(const u_int *)a2;
+   symtab = thunk;
+
+   (void)gelf_getsym(symtab->data, i1, );
+   (void)gelf_getsym(symtab->data, i2, );
+   if (sym1.st_value < sym2.st_value)
+   ret = -1;
+   else if (sym1.st_value == sym2.st_value)
+   ret = 0;
+   else
+   ret = 1;
+   return (ret);
+}
+
+static int
+load_symtab(Elf *e, struct symtab *symtab, u_long sh_type)
+{
+   GElf_Ehdr ehdr;
+   GElf_Shdr shdr;
+   Elf_Scn *scn;
+   u_int nsyms;
+
+   if (gelf_getehdr(e, ) == NULL)
+   return (-1);
+
+   scn = NULL;
+   while ((scn = elf_nextscn(e, scn)) != NULL) {
+   (void)gelf_getshdr(scn, );
+   if (shdr.sh_type == sh_type)
+   break;
+   }
+   if (scn == NULL)
+   return (-1);
+
+   if ((symtab->data = elf_getdata(scn, NULL)) == NULL)
+   return (-1);
+
+   nsyms = shdr.sh_size / shdr.sh_entsize;
+
+   symtab->index = calloc(nsyms, sizeof(u_int));
+   if (symtab->index == NULL)
+   return (-1);
+   for (u_int i = 0; i < nsyms; i++)
+   symtab->index[i] = i;
+   qsort_r(symtab->index, nsyms, sizeof(u_int), symtab, symvalcomp);
+   symtab->nsyms = nsyms;
+   symtab->stridx = shdr.sh_link;
+   return (0);
+}
+
+static void
+load_symtabs(struct file_info *file)
+{
+
+   file->symtab.nsyms = file->dynsymtab.nsyms = 0;
+   (void)load_symtab(file->elf, >symtab, SHT_SYMTAB);
+   (void)load_symtab(file->elf, >dynsymtab, SHT_DYNSYM);
+}
+
+static int
 open_debug_file(char *path, const char *debugfile, uint32_t crc)
 {
size_t n;
@@ -159,6 +227,10 @@ open_object(struct map_info *mapping)
DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1));
goto err;
}
+   if (gelf_getehdr(e, >ehdr) != >ehdr) {
+   DPRINTFX("ERROR: elf_getehdr() failed: %s", elf_errmsg(-1));
+   goto err;
+   }
 
scn = NULL;
while ((scn = elf_nextscn(e, scn)) != NULL) {
@@ -235,6 +307,7 @@ internal:
/* We didn't find a debug file, just return the object's descriptor. */
file->elf = e;
file->fd = fd;
+   load_symtabs(file);
return (0);
 
 external:
@@ -247,6 +320,7 @@ external:

svn commit: r309595 - in head: cddl/lib/libdtrace lib/libproc lib/libproc/tests

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:20:32 2016
New Revision: 309595
URL: https://svnweb.freebsd.org/changeset/base/309595

Log:
  libproc: Match prefixes when looking up mapped object by name.
  
  When looking up an object by name, allow prefix matches if no direct match
  is found. This allows one to, for example, match libc entry probes with:
  
   # dtrace -n 'pid$target:libc.so::entry' -c ./foo
  
  instead of requiring "libc.so.7" or a glob.
  
  Also remove proc_obj2map() as it currently just duplicates the
  functionality of proc_name2map(). It's supposed to take a Solaris
  link-map ID as a paramter, but support for this isn't implemented and
  isn't required to support DTrace's pid provider.

Modified:
  head/cddl/lib/libdtrace/libproc_compat.h
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_sym.c
  head/lib/libproc/tests/proc_test.c

Modified: head/cddl/lib/libdtrace/libproc_compat.h
==
--- head/cddl/lib/libdtrace/libproc_compat.hTue Dec  6 04:19:08 2016
(r309594)
+++ head/cddl/lib/libdtrace/libproc_compat.hTue Dec  6 04:20:32 2016
(r309595)
@@ -44,7 +44,7 @@
 #definePdelbkpt proc_bkptdel
 #definePgrab_error strerror
 #definePlmid(p, a, l) (-1)
-#definePlmid_to_map(p, l, o) proc_obj2map((p), (o))
+#definePlmid_to_map(p, l, o) proc_name2map(p, o)
 #definePlookup_by_addr proc_addr2sym
 #definePname_to_ctf(p, obj) (ctf_file_t *)proc_name2ctf(p, obj)
 #definePname_to_map proc_name2map

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Tue Dec  6 04:19:08 2016(r309594)
+++ head/lib/libproc/libproc.h  Tue Dec  6 04:20:32 2016(r309595)
@@ -128,7 +128,6 @@ __BEGIN_DECLS
 prmap_t *proc_addr2map(struct proc_handle *, uintptr_t);
 prmap_t *proc_name2map(struct proc_handle *, const char *);
 char   *proc_objname(struct proc_handle *, uintptr_t, char *, size_t);
-prmap_t *proc_obj2map(struct proc_handle *, const char *);
 intproc_iter_objs(struct proc_handle *, proc_map_f *, void *);
 intproc_iter_symbyaddr(struct proc_handle *, const char *, int,
int, proc_sym_f *, void *);

Modified: head/lib/libproc/proc_sym.c
==
--- head/lib/libproc/proc_sym.c Tue Dec  6 04:19:08 2016(r309594)
+++ head/lib/libproc/proc_sym.c Tue Dec  6 04:20:32 2016(r309595)
@@ -274,31 +274,6 @@ proc_objname(struct proc_handle *p, uint
return (NULL);
 }
 
-/*
- * Currently just returns the first mapping of the named object, effectively
- * what Plmid_to_map(p, PR_LMID_EVERY, objname) does in illumos libproc.
- */
-prmap_t *
-proc_obj2map(struct proc_handle *p, const char *objname)
-{
-   char path[PATH_MAX], *base;
-   prmap_t *map;
-   size_t i;
-
-   map = NULL;
-   for (i = 0; i < p->nmappings; i++) {
-   strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path));
-   base = basename(path);
-   if (strcmp(base, objname) == 0) {
-   map = >mappings[i].map;
-   break;
-   }
-   }
-   if (map == NULL && strcmp(objname, "a.out") == 0 && p->exec_map != NULL)
-   map = p->exec_map;
-   return (map);
-}
-
 int
 proc_iter_objs(struct proc_handle *p, proc_map_f *func, void *cd)
 {
@@ -468,9 +443,10 @@ _proc_name2map(struct proc_handle *p, co
 {
char path[MAXPATHLEN], *base;
struct map_info *mapping;
-   size_t i;
+   size_t i, len;
 
-   mapping = NULL;
+   if ((len = strlen(name)) == 0)
+   return (NULL);
if (p->nmappings == 0)
if (proc_rdagent(p) == NULL)
return (NULL);
@@ -479,13 +455,18 @@ _proc_name2map(struct proc_handle *p, co
(void)strlcpy(path, mapping->map.pr_mapname, sizeof(path));
base = basename(path);
if (strcmp(base, name) == 0)
-   break;
+   return (mapping);
+   }
+   /* If we didn't find a match, try matching prefixes of the basename. */
+   for (i = 0; i < p->nmappings; i++) {
+   strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path));
+   base = basename(path);
+   if (strncmp(base, name, len) == 0)
+   return (>mappings[i]);
}
-   if (i == p->nmappings)
-   mapping = NULL;
-   if (mapping == NULL && strcmp(name, "a.out") == 0)
-   mapping = _proc_addr2map(p, p->exec_map->pr_vaddr);
-   return (mapping);
+   if (strcmp(name, "a.out") == 0)
+   return (_proc_addr2map(p, p->exec_map->pr_vaddr));
+   return (NULL);
 }
 
 prmap_t *

Modified: head/lib/libproc/tests/proc_test.c

svn commit: r309594 - head/lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:19:08 2016
New Revision: 309594
URL: https://svnweb.freebsd.org/changeset/base/309594

Log:
  libproc: Cache ELF handles for loaded objects.
  
  libproc previously created a new handle for each symbol lookup, which
  gives rather egregious performance for DTrace's ustack() action. With
  this change libproc will cache the libelf descriptor upon access, making
  lookups much faster in the common case.

Modified:
  head/lib/libproc/_libproc.h
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_rtld.c
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Tue Dec  6 04:18:09 2016(r309593)
+++ head/lib/libproc/_libproc.h Tue Dec  6 04:19:08 2016(r309594)
@@ -32,12 +32,24 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include "libproc.h"
 
 struct procstat;
 
+struct file_info {
+   Elf *elf;
+   int fd;
+   u_int   refs;
+};
+
+struct map_info {
+   prmap_t map;
+   struct file_info *file;
+};
+
 struct proc_handle {
struct proc_handle_public public; /* Public fields. */
int flags;  /* Process flags. */
@@ -45,13 +57,13 @@ struct proc_handle {
int wstat;  /* Process wait status. */
int model;  /* Process data model. */
rd_agent_t *rdap;   /* librtld_db agent */
-   rd_loadobj_t *rdobjs;   /* Array of loaded objects. */
-   size_t  rdobjsz;/* Array size. */
-   size_t  nobjs;  /* Num. objects currently loaded. */
-   rd_loadobj_t *rdexec;   /* rdobj for program executable. */
-   struct lwpstatus lwps;  /* Process status. */
+   struct map_info *mappings;  /* File mappings for proc. */
+   size_t  maparrsz;   /* Map array size. */
+   size_t  nmappings;  /* Number of mappings. */
+   prmap_t *exec_map;  /* Executable text mapping. */
+   lwpstatus_t lwps;   /* Process status. */
struct procstat *procstat;  /* libprocstat handle. */
-   charexecpath[MAXPATHLEN];   /* Path to program executable. */
+   charexecpath[PATH_MAX]; /* Path to program executable. */
 };
 
 #ifdef DEBUG

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Tue Dec  6 04:18:09 2016(r309593)
+++ head/lib/libproc/libproc.h  Tue Dec  6 04:19:08 2016(r309594)
@@ -131,7 +131,7 @@ char*proc_objname(struct proc_handle *,
 prmap_t *proc_obj2map(struct proc_handle *, const char *);
 intproc_iter_objs(struct proc_handle *, proc_map_f *, void *);
 intproc_iter_symbyaddr(struct proc_handle *, const char *, int,
-int, proc_sym_f *, void *);
+   int, proc_sym_f *, void *);
 intproc_addr2sym(struct proc_handle *, uintptr_t, char *, size_t, GElf_Sym 
*);
 intproc_attach(pid_t pid, int flags, struct proc_handle **pphdl);
 intproc_continue(struct proc_handle *);

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Tue Dec  6 04:18:09 2016
(r309593)
+++ head/lib/libproc/proc_create.c  Tue Dec  6 04:19:08 2016
(r309594)
@@ -230,8 +230,24 @@ bad:
 void
 proc_free(struct proc_handle *phdl)
 {
+   struct file_info *file;
+   size_t i;
 
+   for (i = 0; i < phdl->nmappings; i++) {
+   file = phdl->mappings[i].file;
+   if (file != NULL && --file->refs == 0) {
+   if (file->elf != NULL) {
+   (void)elf_end(file->elf);
+   (void)close(file->fd);
+   }
+   free(file);
+   }
+   }
+   if (phdl->maparrsz > 0)
+   free(phdl->mappings);
if (phdl->procstat != NULL)
procstat_close(phdl->procstat);
+   if (phdl->rdap != NULL)
+   rd_delete(phdl->rdap);
free(phdl);
 }

Modified: head/lib/libproc/proc_rtld.c
==
--- head/lib/libproc/proc_rtld.cTue Dec  6 04:18:09 2016
(r309593)
+++ head/lib/libproc/proc_rtld.cTue Dec  6 04:19:08 2016
(r309594)
@@ -31,46 +31,99 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
+#include 
+
 #include 
 
 #include "_libproc.h"
 
+static voidrdl2prmap(const rd_loadobj_t *, prmap_t *);
+
 static int
 map_iter(const rd_loadobj_t *lop, void *arg)
 {
-   struct proc_handle *phdl = arg;
-
-   if (phdl->nobjs >= phdl->rdobjsz) {
-   phdl->rdobjsz *= 2;
-   

svn commit: r309593 - head/lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:18:09 2016
New Revision: 309593
URL: https://svnweb.freebsd.org/changeset/base/309593

Log:
  libproc: Improve .gnu_debuglink support.
  
  As of r278658 libproc looks for debug files under /usr/lib/debug and will
  use them if available. This change fleshes out that support a bit further:
  - Check for a .gnu_debuglink section and use the file name specified
there if one is present.
  - Validate external debug files with the CRC in the .gnu_debuglink
section so as to avoid using stale or corrupt debug files.
  - Search for debug files in the directory containing the referencing
object or in the .debug subdirectory, as GDB does.

Added:
  head/lib/libproc/crc32.c   (contents, props changed)
  head/lib/libproc/crc32.h   (contents, props changed)
Modified:
  head/lib/libproc/Makefile
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/Makefile
==
--- head/lib/libproc/Makefile   Tue Dec  6 04:14:20 2016(r309592)
+++ head/lib/libproc/Makefile   Tue Dec  6 04:18:09 2016(r309593)
@@ -5,7 +5,8 @@
 PACKAGE=lib${LIB}
 LIB=   proc
 
-SRCS=  proc_bkpt.c \
+SRCS=  crc32.c \
+   proc_bkpt.c \
proc_create.c   \
proc_regs.c \
proc_sym.c  \

Added: head/lib/libproc/crc32.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libproc/crc32.cTue Dec  6 04:18:09 2016(r309593)
@@ -0,0 +1,57 @@
+/*-
+ *  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or
+ *  code or tables extracted from it, as desired without restriction.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+
+#include 
+
+uint32_t crc32_tab[] = {
+   0x, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
+   0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+   0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
+   0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+   0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+   0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+   0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
+   0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+   0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
+   0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+   0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
+   0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+   0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
+   0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+   0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+   0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+   0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
+   0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+   0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
+   0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+   0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
+   0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+   0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
+   0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+   0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+   0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+   0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
+   0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+   0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
+   0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+   0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
+   0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+   0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
+   0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+   0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+   0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+   0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
+   0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+   0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 

svn commit: r309592 - head/lib/libproc

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:14:20 2016
New Revision: 309592
URL: https://svnweb.freebsd.org/changeset/base/309592

Log:
  libproc: Make proc_getpid() an accessor for struct proc_handle.
  
  This allows librtld_db to fetch the PID from a handle without calling into
  libproc. Together with r303531, this means that librtld_db no longer
  references symbols from libproc.

Modified:
  head/lib/libproc/_libproc.h
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_sym.c
  head/lib/libproc/proc_util.c

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Tue Dec  6 04:13:02 2016(r309591)
+++ head/lib/libproc/_libproc.h Tue Dec  6 04:14:20 2016(r309592)
@@ -39,7 +39,7 @@
 struct procstat;
 
 struct proc_handle {
-   pid_t   pid;/* Process ID. */
+   struct proc_handle_public public; /* Public fields. */
int flags;  /* Process flags. */
int status; /* Process status (PS_*). */
int wstat;  /* Process wait status. */

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Tue Dec  6 04:13:02 2016(r309591)
+++ head/lib/libproc/libproc.h  Tue Dec  6 04:14:20 2016(r309592)
@@ -116,6 +116,12 @@ typedef struct lwpstatus {
 #definePR_MODEL_ILP32  1
 #definePR_MODEL_LP64   2
 
+struct proc_handle_public {
+   pid_t   pid;
+};
+
+#defineproc_getpid(phdl)   (((struct proc_handle_public 
*)(phdl))->pid)
+
 /* Function prototype definitions. */
 __BEGIN_DECLS
 
@@ -140,7 +146,6 @@ struct ctf_file *proc_name2ctf(struct pr
 intproc_setflags(struct proc_handle *, int);
 intproc_state(struct proc_handle *);
 intproc_getmodel(struct proc_handle *);
-pid_t  proc_getpid(struct proc_handle *);
 intproc_wstatus(struct proc_handle *);
 intproc_getwstat(struct proc_handle *);
 char * proc_signame(int, char *, size_t);

Modified: head/lib/libproc/proc_create.c
==
--- head/lib/libproc/proc_create.c  Tue Dec  6 04:13:02 2016
(r309591)
+++ head/lib/libproc/proc_create.c  Tue Dec  6 04:14:20 2016
(r309592)
@@ -79,7 +79,7 @@ proc_init(pid_t pid, int flags, int stat
goto out;
 
memset(phdl, 0, sizeof(*phdl));
-   phdl->pid = pid;
+   phdl->public.pid = pid;
phdl->flags = flags;
phdl->status = status;
phdl->procstat = procstat_open_sysctl();
@@ -140,7 +140,7 @@ proc_attach(pid_t pid, int flags, struct
if (error != 0)
goto out;
 
-   if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) {
+   if (ptrace(PT_ATTACH, proc_getpid(phdl), 0, 0) != 0) {
error = errno;
DPRINTF("ERROR: cannot ptrace child process %d", pid);
goto out;

Modified: head/lib/libproc/proc_sym.c
==
--- head/lib/libproc/proc_sym.c Tue Dec  6 04:13:02 2016(r309591)
+++ head/lib/libproc/proc_sym.c Tue Dec  6 04:14:20 2016(r309592)
@@ -208,7 +208,7 @@ proc_addr2map(struct proc_handle *p, uin
 * it ourselves.
 */
if (p->nobjs == 0) {
-   if ((kves = kinfo_getvmmap(p->pid, )) == NULL)
+   if ((kves = kinfo_getvmmap(proc_getpid(p), )) == NULL)
return (NULL);
for (i = 0; i < (size_t)cnt; i++) {
kve = kves + i;

Modified: head/lib/libproc/proc_util.c
==
--- head/lib/libproc/proc_util.cTue Dec  6 04:13:02 2016
(r309591)
+++ head/lib/libproc/proc_util.cTue Dec  6 04:14:20 2016
(r309592)
@@ -70,7 +70,8 @@ proc_continue(struct proc_handle *phdl)
pending = WSTOPSIG(phdl->wstat);
else
pending = 0;
-   if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0)
+   if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1,
+   pending) != 0)
return (-1);
 
phdl->status = PS_RUN;
@@ -82,20 +83,22 @@ int
 proc_detach(struct proc_handle *phdl, int reason)
 {
int status;
+   pid_t pid;
 
if (phdl == NULL)
return (EINVAL);
if (reason == PRELEASE_KILL) {
-   kill(phdl->pid, SIGKILL);
+   kill(proc_getpid(phdl), SIGKILL);
return (0);
}
-   if (ptrace(PT_DETACH, phdl->pid, 0, 0) != 0 && errno == ESRCH)
+   pid = proc_getpid(phdl);
+   if (ptrace(PT_DETACH, pid, 0, 0) != 0 && errno == ESRCH)
return (0);
if (errno == EBUSY) {

svn commit: r309591 - in head/lib: libproc librtld_db

2016-12-05 Thread Mark Johnston
Author: markj
Date: Tue Dec  6 04:13:02 2016
New Revision: 309591
URL: https://svnweb.freebsd.org/changeset/base/309591

Log:
  Fix style bugs and remove trailing whitespace in libproc and librtld_db.
  
  MFC after:1 week

Modified:
  head/lib/libproc/_libproc.h
  head/lib/libproc/libproc.h
  head/lib/libproc/proc_bkpt.c
  head/lib/libproc/proc_create.c
  head/lib/libproc/proc_regs.c
  head/lib/libproc/proc_rtld.c
  head/lib/libproc/proc_util.c
  head/lib/librtld_db/rtld_db.c
  head/lib/librtld_db/rtld_db.h

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Tue Dec  6 01:35:27 2016(r309590)
+++ head/lib/libproc/_libproc.h Tue Dec  6 04:13:02 2016(r309591)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef __LIBPROC_H_
+#define__LIBPROC_H_
+
 #include 
 #include 
 
@@ -58,3 +61,5 @@ struct proc_handle {
 #defineDPRINTF(...)do { } while (0)
 #defineDPRINTFX(...)   do { } while (0)
 #endif
+
+#endif /* __LIBPROC_H_ */

Modified: head/lib/libproc/libproc.h
==
--- head/lib/libproc/libproc.h  Tue Dec  6 01:35:27 2016(r309590)
+++ head/lib/libproc/libproc.h  Tue Dec  6 04:13:02 2016(r309591)
@@ -158,4 +158,4 @@ int proc_regset(struct proc_handle *, pr
 
 __END_DECLS
 
-#endif /* !_LIBPROC_H_ */
+#endif /* _LIBPROC_H_ */

Modified: head/lib/libproc/proc_bkpt.c
==
--- head/lib/libproc/proc_bkpt.cTue Dec  6 01:35:27 2016
(r309590)
+++ head/lib/libproc/proc_bkpt.cTue Dec  6 04:13:02 2016
(r309591)
@@ -1,31 +1,31 @@
-/*
- * Copyright (c) 2010 The FreeBSD Foundation 
- * All rights reserved. 
- * 
+/*-
+ * Copyright (c) 2010 The FreeBSD Foundation
+ * All rights reserved.
+ *
  * This software was developed by Rui Paulo 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 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.
+ */
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
+
 #include "_libproc.h"
 
 #if defined(__aarch64__)
@@ -130,8 +130,8 @@ proc_bkptset(struct proc_handle *phdl, 

Re: svn commit: r309553 - head/sys/arm/include

2016-12-05 Thread Ed Maste
On 5 December 2016 at 10:55, Michal Meloun  wrote:
> Author: mmel
> Date: Mon Dec  5 15:55:51 2016
> New Revision: 309553
> URL: https://svnweb.freebsd.org/changeset/base/309553
>
> Log:
>   Fix build breakage caused by r309531.
>
>   Reported by: andrew
>   MFC after: 2 weeks
>   X-MFC with: r309531

It appears this breaks armv6 buildworld:

In file included from /tank/emaste/src/freebsd-staging/lib/libkvm/kvm.c:48:
In file included from
/tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/sys/user.h:52:
In file included from
/tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/vm/pmap.h:90:
In file included from
/tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/machine/pmap.h:33:
/tank/emaste/obj/arm.armv6/tank/emaste/src/freebsd-staging/tmp/usr/include/sys/systm.h:178:5:
error:
  declaration of built-in function 'setjmp' requires inclusion of the header
   [-Werror,-Wbuiltin-requires-header]
int setjmp(struct _jmp_buf *) __returns_twice;
^
...
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309590 - in head: contrib/libarchive/cat/test contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2016-12-05 Thread Martin Matuska
Author: mm
Date: Tue Dec  6 01:35:27 2016
New Revision: 309590
URL: https://svnweb.freebsd.org/changeset/base/309590

Log:
  MFV r309587:
  
  Sync libarchive with vendor.
  
  Vendor bugfixes:
  
  libarchive #831:
Spelling fixes
  libarchive #832:
Relax sanity checks of number fields in tar header even more
  OSS-Fuzz #16:
Fix possible hang in uudecode_filter_read()
  OSS-Fuzz #220:
Reject an 'ar' filename table larger than 1GB or a filename larger
than 1MB.
  
  MFC after:1 week

Added:
  head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c
 - copied unchanged from r309587, 
vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c
  head/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu
 - copied unchanged from r309587, 
vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu
Modified:
  head/contrib/libarchive/cat/test/main.c
  head/contrib/libarchive/cpio/test/main.c
  head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
  head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
  head/contrib/libarchive/libarchive/archive_read_support_format_ar.c
  head/contrib/libarchive/libarchive/archive_read_support_format_cab.c
  head/contrib/libarchive/libarchive/archive_read_support_format_tar.c
  head/contrib/libarchive/libarchive/archive_string.c
  head/contrib/libarchive/libarchive/archive_string.h
  head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
  head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c
  head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c
  head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c
  head/contrib/libarchive/libarchive/archive_write_set_format_pax.c
  head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c
  head/contrib/libarchive/libarchive/archive_write_set_format_zip.c
  head/contrib/libarchive/libarchive/test/main.c
  head/contrib/libarchive/libarchive/test/test_archive_cmdline.c
  head/lib/libarchive/tests/Makefile
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/cat/test/main.c
==
--- head/contrib/libarchive/cat/test/main.c Tue Dec  6 00:39:00 2016
(r309589)
+++ head/contrib/libarchive/cat/test/main.c Tue Dec  6 01:35:27 2016
(r309590)
@@ -520,7 +520,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (0); /* Standard:  return 0 for end-of-string. */
cnt = utf8_count[ch];
 
-   /* Invalide sequence or there are not plenty bytes. */
+   /* Invalid sequence or there are not plenty bytes. */
if (n < (size_t)cnt)
return (-1);
 
@@ -559,7 +559,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (-1);
}
 
-   /* The code point larger than 0x10 is not leagal
+   /* The code point larger than 0x10 is not legal
 * Unicode values. */
if (wc > 0x10)
return (-1);

Modified: head/contrib/libarchive/cpio/test/main.c
==
--- head/contrib/libarchive/cpio/test/main.cTue Dec  6 00:39:00 2016
(r309589)
+++ head/contrib/libarchive/cpio/test/main.cTue Dec  6 01:35:27 2016
(r309590)
@@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (0); /* Standard:  return 0 for end-of-string. */
cnt = utf8_count[ch];
 
-   /* Invalide sequence or there are not plenty bytes. */
+   /* Invalid sequence or there are not plenty bytes. */
if (n < (size_t)cnt)
return (-1);
 
@@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (-1);
}
 
-   /* The code point larger than 0x10 is not leagal
+   /* The code point larger than 0x10 is not legal
 * Unicode values. */
if (wc > 0x10)
return (-1);

Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
==
--- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Tue Dec  6 00:39:00 2016(r309589)
+++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c  
Tue Dec  6 01:35:27 2016(r309590)
@@ -690,7 +690,7 @@ translate_acl(struct archive_read_disk *
 #ifdef ACL_TYPE_NFS4
if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
/*
-* acl_get_entry_type_np() falis with non-NFSv4 ACLs
+* acl_get_entry_type_np() fails with non-NFSv4 

Re: svn commit: r309589 - head/usr.bin/truss

2016-12-05 Thread John Baldwin
On Tuesday, December 06, 2016 12:39:00 AM John Baldwin wrote:
> Author: jhb
> Date: Tue Dec  6 00:39:00 2016
> New Revision: 309589
> URL: https://svnweb.freebsd.org/changeset/base/309589
> 
> Log:
>   Rework syscall structure lookups.
>   
>   Avoid always using an O(n^2) loop over known syscall structures with
>   strcmp() on each system call.  Instead, use a per-ABI cache indexed by
>   the system call number. The first 1024 system calls (which should cover
>   all of the normal system calls in currently-supported ABIs) use a flat array
>   indexed by the system call number to find system call structure.  For other
>   system calls, a linked list of structures storing an integer to structure
>   mapping is stored in the ABI.  The linked list isn't very smart, but it
>   should only be used by buggy applications invoking unknown system calls.
>   
>   This also fixes handling of unknown system calls which currently trigger
>   a NULL pointer dereference.
>   
>   Reviewed by:kib
>   MFC after:  2 weeks

I of course forgot:

Differential Revision: https://reviews.freebsd.org/D8639

The table + linked-list could perhaps be replaced by a hash table, but
I don't quite feel like writing a new hash table from scratch.  One
option would be to make truss a C++ program and use unordered_map<>.

We could then turn the procabi thing into a class which might look a bit
nicer (and use constructors to initialize the hash table instead of
the inline STAILQ_HEAD_INITIALIZER).

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


svn commit: r309589 - head/usr.bin/truss

2016-12-05 Thread John Baldwin
Author: jhb
Date: Tue Dec  6 00:39:00 2016
New Revision: 309589
URL: https://svnweb.freebsd.org/changeset/base/309589

Log:
  Rework syscall structure lookups.
  
  Avoid always using an O(n^2) loop over known syscall structures with
  strcmp() on each system call.  Instead, use a per-ABI cache indexed by
  the system call number. The first 1024 system calls (which should cover
  all of the normal system calls in currently-supported ABIs) use a flat array
  indexed by the system call number to find system call structure.  For other
  system calls, a linked list of structures storing an integer to structure
  mapping is stored in the ABI.  The linked list isn't very smart, but it
  should only be used by buggy applications invoking unknown system calls.
  
  This also fixes handling of unknown system calls which currently trigger
  a NULL pointer dereference.
  
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/usr.bin/truss/aarch64-cloudabi64.c
  head/usr.bin/truss/aarch64-freebsd.c
  head/usr.bin/truss/amd64-cloudabi64.c
  head/usr.bin/truss/amd64-freebsd.c
  head/usr.bin/truss/amd64-freebsd32.c
  head/usr.bin/truss/amd64-linux.c
  head/usr.bin/truss/amd64-linux32.c
  head/usr.bin/truss/arm-freebsd.c
  head/usr.bin/truss/i386-freebsd.c
  head/usr.bin/truss/i386-linux.c
  head/usr.bin/truss/mips-freebsd.c
  head/usr.bin/truss/powerpc-freebsd.c
  head/usr.bin/truss/powerpc64-freebsd.c
  head/usr.bin/truss/powerpc64-freebsd32.c
  head/usr.bin/truss/setup.c
  head/usr.bin/truss/sparc64-freebsd.c
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c
  head/usr.bin/truss/truss.h

Modified: head/usr.bin/truss/aarch64-cloudabi64.c
==
--- head/usr.bin/truss/aarch64-cloudabi64.c Tue Dec  6 00:36:02 2016
(r309588)
+++ head/usr.bin/truss/aarch64-cloudabi64.c Tue Dec  6 00:39:00 2016
(r309589)
@@ -80,7 +80,9 @@ static struct procabi aarch64_cloudabi64
"CloudABI ELF64",
SYSDECODE_ABI_CLOUDABI64,
aarch64_cloudabi64_fetch_args,
-   aarch64_cloudabi64_fetch_retval
+   aarch64_cloudabi64_fetch_retval,
+   STAILQ_HEAD_INITIALIZER(aarch64_cloudabi64.extra_syscalls),
+   { NULL }
 };
 
 PROCABI(aarch64_cloudabi64);

Modified: head/usr.bin/truss/aarch64-freebsd.c
==
--- head/usr.bin/truss/aarch64-freebsd.cTue Dec  6 00:36:02 2016
(r309588)
+++ head/usr.bin/truss/aarch64-freebsd.cTue Dec  6 00:39:00 2016
(r309589)
@@ -102,7 +102,9 @@ static struct procabi aarch64_freebsd = 
"FreeBSD ELF64",
SYSDECODE_ABI_FREEBSD,
aarch64_fetch_args,
-   aarch64_fetch_retval
+   aarch64_fetch_retval,
+   STAILQ_HEAD_INITIALIZER(aarch64_freebsd.extra_syscalls),
+   { NULL }
 };
 
 PROCABI(aarch64_freebsd);

Modified: head/usr.bin/truss/amd64-cloudabi64.c
==
--- head/usr.bin/truss/amd64-cloudabi64.c   Tue Dec  6 00:36:02 2016
(r309588)
+++ head/usr.bin/truss/amd64-cloudabi64.c   Tue Dec  6 00:39:00 2016
(r309589)
@@ -89,7 +89,9 @@ static struct procabi amd64_cloudabi64 =
"CloudABI ELF64",
SYSDECODE_ABI_CLOUDABI64,
amd64_cloudabi64_fetch_args,
-   amd64_cloudabi64_fetch_retval
+   amd64_cloudabi64_fetch_retval,
+   STAILQ_HEAD_INITIALIZER(amd64_cloudabi64.extra_syscalls),
+   { NULL }
 };
 
 PROCABI(amd64_cloudabi64);

Modified: head/usr.bin/truss/amd64-freebsd.c
==
--- head/usr.bin/truss/amd64-freebsd.c  Tue Dec  6 00:36:02 2016
(r309588)
+++ head/usr.bin/truss/amd64-freebsd.c  Tue Dec  6 00:39:00 2016
(r309589)
@@ -124,7 +124,9 @@ static struct procabi amd64_freebsd = {
"FreeBSD ELF64",
SYSDECODE_ABI_FREEBSD,
amd64_fetch_args,
-   amd64_fetch_retval
+   amd64_fetch_retval,
+   STAILQ_HEAD_INITIALIZER(amd64_freebsd.extra_syscalls),
+   { NULL }
 };
 
 PROCABI(amd64_freebsd);

Modified: head/usr.bin/truss/amd64-freebsd32.c
==
--- head/usr.bin/truss/amd64-freebsd32.cTue Dec  6 00:36:02 2016
(r309588)
+++ head/usr.bin/truss/amd64-freebsd32.cTue Dec  6 00:39:00 2016
(r309589)
@@ -120,7 +120,9 @@ static struct procabi amd64_freebsd32 = 
"FreeBSD ELF32",
SYSDECODE_ABI_FREEBSD32,
amd64_freebsd32_fetch_args,
-   amd64_freebsd32_fetch_retval
+   amd64_freebsd32_fetch_retval,
+   STAILQ_HEAD_INITIALIZER(amd64_freebsd32.extra_syscalls),
+   { NULL }
 };
 
 PROCABI(amd64_freebsd32);
@@ -129,7 +131,9 @@ static struct procabi amd64_freebsd32_ao
"FreeBSD a.out",
SYSDECODE_ABI_FREEBSD32,
amd64_freebsd32_fetch_args,
-   

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

2016-12-05 Thread John Baldwin
Author: jhb
Date: Tue Dec  6 00:36:02 2016
New Revision: 309588
URL: https://svnweb.freebsd.org/changeset/base/309588

Log:
  Don't attach to Host-PCI bridges with a bad bus number.
  
  If the bus number assigned to a Host-PCI bridge doesn't match the first
  bus number in the associated producer range from _CRS, print a warning and
  fail to attach rather than panicking due to an assertion failure.
  
  At least one single-socket Dell machine leaves a "ghost" Host-PCI bridge
  device in the ACPI namespace that seems to correspond to the I/O hub in
  the second socket of a two-socket machine.  However, the BIOS doesn't
  configure the settings for this "ghost" bridge correctly, nor does it have
  any PCI devices behind it.
  
  Tested by:royger
  MFC after:2 weeks

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

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==
--- head/sys/dev/acpica/acpi_pcib_acpi.cTue Dec  6 00:35:20 2016
(r309587)
+++ head/sys/dev/acpica/acpi_pcib_acpi.cTue Dec  6 00:36:02 2016
(r309588)
@@ -488,10 +488,17 @@ acpi_pcib_acpi_attach(device_t dev)
pci_domain_release_bus(sc->ap_segment, dev, rid, bus_res);
}
 } else {
-#ifdef INVARIANTS
-   if (first_decoded_bus(sc, ) == 0)
-   KASSERT(start == sc->ap_bus, ("bus number mismatch"));
-#endif
+   /*
+* Require the bus number from _BBN to match the start of any
+* decoded range.
+*/
+   if (first_decoded_bus(sc, ) == 0 && sc->ap_bus != start) {
+   device_printf(dev,
+   "bus number %d does not match start of decoded range %ju\n",
+   sc->ap_bus, (uintmax_t)start);
+   pcib_host_res_free(dev, >ap_host_res);
+   return (ENXIO);
+   }
 }
 #else
 /*
@@ -514,6 +521,9 @@ acpi_pcib_acpi_attach(device_t dev)
 
 if (device_add_child(dev, "pci", -1) == NULL) {
device_printf(device_get_parent(dev), "couldn't attach pci bus\n");
+#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
+   pcib_host_res_free(dev, >ap_host_res);
+#endif
return (ENXIO);
 }
 return (bus_generic_attach(dev));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309587 - in vendor/libarchive/dist: . cat/test cpio/test libarchive libarchive/test

2016-12-05 Thread Martin Matuska
Author: mm
Date: Tue Dec  6 00:35:20 2016
New Revision: 309587
URL: https://svnweb.freebsd.org/changeset/base/309587

Log:
  Update vendor/libarchive to git ddb3954bfdb9a0a98d50fb1c50cbecb603d9adf0
  
  Vendor bugfixes:
  
  libarchive #831:
Spelling fixes
  libarchive #832:
Relax sanity checks of number fields in tar header even more
  OSS-Fuzz #16:
Fix possible hang in uudecode_filter_read()
  OSS-Fuzz #220:
Reject an 'ar' filename table larger than 1GB or a filename larger
than 1MB.

Added:
  vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c   
(contents, props changed)
  vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu
Modified:
  vendor/libarchive/dist/Makefile.am
  vendor/libarchive/dist/cat/test/main.c
  vendor/libarchive/dist/cpio/test/main.c
  vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c
  vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c
  vendor/libarchive/dist/libarchive/archive_string.c
  vendor/libarchive/dist/libarchive/archive_string.h
  vendor/libarchive/dist/libarchive/archive_windows.c
  vendor/libarchive/dist/libarchive/archive_write_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_v7tar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c
  vendor/libarchive/dist/libarchive/test/CMakeLists.txt
  vendor/libarchive/dist/libarchive/test/main.c
  vendor/libarchive/dist/libarchive/test/test_archive_cmdline.c

Modified: vendor/libarchive/dist/Makefile.am
==
--- vendor/libarchive/dist/Makefile.am  Tue Dec  6 00:13:49 2016
(r309586)
+++ vendor/libarchive/dist/Makefile.am  Tue Dec  6 00:35:20 2016
(r309587)
@@ -371,6 +371,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_compat_mac.c \
libarchive/test/test_compat_pax_libarchive_2x.c \
libarchive/test/test_compat_perl_archive_tar.c \
+   libarchive/test/test_compat_plexus_archiver_tar.c \
libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_solaris_pax_sparse.c \
libarchive/test/test_compat_star_acl_posix1e.c \
@@ -627,6 +628,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_compat_mac-2.tar.Z.uu \
libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \
libarchive/test/test_compat_perl_archive_tar.tar.uu \
+   libarchive/test/test_compat_plexus_archiver_tar.uu \
libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \
libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \
libarchive/test/test_compat_solaris_tar_acl.tar.uu \

Modified: vendor/libarchive/dist/cat/test/main.c
==
--- vendor/libarchive/dist/cat/test/main.c  Tue Dec  6 00:13:49 2016
(r309586)
+++ vendor/libarchive/dist/cat/test/main.c  Tue Dec  6 00:35:20 2016
(r309587)
@@ -520,7 +520,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (0); /* Standard:  return 0 for end-of-string. */
cnt = utf8_count[ch];
 
-   /* Invalide sequence or there are not plenty bytes. */
+   /* Invalid sequence or there are not plenty bytes. */
if (n < (size_t)cnt)
return (-1);
 
@@ -559,7 +559,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (-1);
}
 
-   /* The code point larger than 0x10 is not leagal
+   /* The code point larger than 0x10 is not legal
 * Unicode values. */
if (wc > 0x10)
return (-1);

Modified: vendor/libarchive/dist/cpio/test/main.c
==
--- vendor/libarchive/dist/cpio/test/main.c Tue Dec  6 00:13:49 2016
(r309586)
+++ vendor/libarchive/dist/cpio/test/main.c Tue Dec  6 00:35:20 2016
(r309587)
@@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch
return (0); /* Standard:  return 0 for end-of-string. */
cnt = utf8_count[ch];
 
-   /* Invalide sequence or there are not plenty bytes. */
+   /* Invalid sequence or there are not plenty bytes. */
if 

svn commit: r309586 - head/sys/dev/usb/wlan

2016-12-05 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Dec  6 00:13:49 2016
New Revision: 309586
URL: https://svnweb.freebsd.org/changeset/base/309586

Log:
  rsu: add hardware crypto support (WEP, TKIP and CCMP).
  
  This change includes firmware commands for key setup +
  some additional checking via CAMREAD / CAMWRITE registers.
  Nothing (except rsu_delete_key() for pairwise keys) is deferred;
  to ensure that things are done in order rsu_set_key() will wait
  until key deletion task will be finished.
  
  Tested with Asus USB-N10 (all ciphers).
  
  Differences from initial (reviewed) patch:
  - Pause AC queues before disassociation - since CMD_DISCONNECT clears
  crypto state all pending frames must be processed / dropped before it.
  - Check sc_running flag before trying to set static keys.
  - Clear key index from bitmap even when firmware command fails
  (it will be invalidated via CAMWRITE anyway).
  
  Reviewed by:  adrian, kevlo
  Tested by:kevlo
  Differential Revision:https://reviews.freebsd.org/D8706

Modified:
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rsureg.h

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Tue Dec  6 00:12:09 2016
(r309585)
+++ head/sys/dev/usb/wlan/if_rsu.c  Tue Dec  6 00:13:49 2016
(r309586)
@@ -22,8 +22,8 @@ __FBSDID("$FreeBSD$");
  * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU.
  *
  * TODO:
- *   o h/w crypto
- *   o hostap / ibss / mesh
+ *   o tx a-mpdu
+ *   o monitor / hostap / ibss / mesh
  *   o power-save operation
  */
 
@@ -102,6 +102,7 @@ TUNABLE_INT("hw.usb.rsu.enable_11n", 
 #defineRSU_DEBUG_FW0x0100
 #defineRSU_DEBUG_FWDBG 0x0200
 #defineRSU_DEBUG_AMPDU 0x0400
+#defineRSU_DEBUG_KEY   0x0800
 
 static const STRUCT_USB_HOST_ID rsu_devs[] = {
 #defineRSU_HT_NOT_SUPPORTED 0
@@ -202,10 +203,25 @@ static intrsu_fw_cmd(struct rsu_softc *
 static voidrsu_calib_task(void *, int);
 static voidrsu_tx_task(void *, int);
 static int rsu_newstate(struct ieee80211vap *, enum ieee80211_state, int);
-#ifdef notyet
-static voidrsu_set_key(struct rsu_softc *, const struct ieee80211_key *);
-static voidrsu_delete_key(struct rsu_softc *, const struct ieee80211_key 
*);
-#endif
+static int rsu_key_alloc(struct ieee80211vap *, struct ieee80211_key *,
+   ieee80211_keyix *, ieee80211_keyix *);
+static int rsu_process_key(struct ieee80211vap *,
+   const struct ieee80211_key *, int);
+static int rsu_key_set(struct ieee80211vap *,
+   const struct ieee80211_key *);
+static int rsu_key_delete(struct ieee80211vap *,
+   const struct ieee80211_key *);
+static int rsu_cam_read(struct rsu_softc *, uint8_t, uint32_t *);
+static voidrsu_cam_write(struct rsu_softc *, uint8_t, uint32_t);
+static int rsu_key_check(struct rsu_softc *, ieee80211_keyix, int);
+static uint8_t rsu_crypto_mode(struct rsu_softc *, u_int, int);
+static int rsu_set_key_group(struct rsu_softc *,
+   const struct ieee80211_key *);
+static int rsu_set_key_pair(struct rsu_softc *,
+   const struct ieee80211_key *);
+static int rsu_reinit_static_keys(struct rsu_softc *);
+static int rsu_delete_key(struct rsu_softc *sc, ieee80211_keyix);
+static voidrsu_delete_key_pair_cb(void *, int);
 static int rsu_site_survey(struct rsu_softc *,
struct ieee80211_scan_ssid *);
 static int rsu_join_bss(struct rsu_softc *, struct ieee80211_node *);
@@ -437,8 +453,10 @@ rsu_attach(device_t self)
 
mtx_init(>sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK,
MTX_DEF);
+   RSU_DELKEY_BMAP_LOCK_INIT(sc);
TIMEOUT_TASK_INIT(taskqueue_thread, >calib_task, 0, 
rsu_calib_task, sc);
+   TASK_INIT(>del_key_task, 0, rsu_delete_key_pair_cb, sc);
TASK_INIT(>tx_task, 0, rsu_tx_task, sc);
mbufq_init(>sc_snd, ifqmaxlen);
 
@@ -524,6 +542,11 @@ rsu_attach(device_t self)
IEEE80211_C_SHSLOT |/* Short slot time supported. */
IEEE80211_C_WPA;/* WPA/RSN. */
 
+   ic->ic_cryptocaps =
+   IEEE80211_CRYPTO_WEP |
+   IEEE80211_CRYPTO_TKIP |
+   IEEE80211_CRYPTO_AES_CCM;
+
/* Check if HT support is present. */
if (sc->sc_ht) {
device_printf(sc->sc_dev, "%s: enabling 11n\n", __func__);
@@ -608,8 +631,10 @@ rsu_detach(device_t self)
ieee80211_ifdetach(ic);
 
taskqueue_drain_timeout(taskqueue_thread, >calib_task);
+   taskqueue_drain(taskqueue_thread, >del_key_task);
taskqueue_drain(taskqueue_thread, >tx_task);
 
+   RSU_DELKEY_BMAP_LOCK_DESTROY(sc);
mtx_destroy(>sc_mtx);
 
return (0);
@@ -662,6 +687,9 @@ rsu_vap_create(struct 

svn commit: r309584 - in releng/11.0: contrib/netbsd-tests/lib/libc/locale usr.bin/localedef

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec  6 00:09:52 2016
New Revision: 309584
URL: https://svnweb.freebsd.org/changeset/base/309584

Log:
  Merge r308330 by bapt:
  
localedef: Fix ctype dump (fixed wide spread errors)
  
  See original commit for longer description.
  
  Errata Notice:EN-16:21
  Approved by:  so

Modified:
  releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
  releng/11.0/usr.bin/localedef/ctype.c
  releng/11.0/usr.bin/localedef/parser.y   (contents, props changed)
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
==
--- releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c   Tue Dec 
 6 00:06:16 2016(r309583)
+++ releng/11.0/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c   Tue Dec 
 6 00:09:52 2016(r309584)
@@ -88,7 +88,7 @@ static struct test {
0x, 0x5D, 0x5B, 0x1, 0x10, 0x5D, 0x0A
},
 #ifdef __FreeBSD__
-   {1, -1, -1,  1,  1, -1, 1,  1,  1, 1, -1,  1,  1, -1, -1,
+   {1, -1, -1,  1,  1, -1, -1,  1,  1, 1, -1,  1,  1, -1, -1,
 #else
{1, -1, -1,  1,  1, -1, -1,  1,  1, -1, -1,  1,  1, -1, -1,
 #endif

Modified: releng/11.0/usr.bin/localedef/ctype.c
==
--- releng/11.0/usr.bin/localedef/ctype.c   Tue Dec  6 00:06:16 2016
(r309583)
+++ releng/11.0/usr.bin/localedef/ctype.c   Tue Dec  6 00:09:52 2016
(r309584)
@@ -407,9 +407,9 @@ dump_ctype(void)
continue;
}
 
-   if ((last_ct != NULL) && (last_ct->ctype == ctn->ctype)) {
+   if ((last_ct != NULL) && (last_ct->ctype == ctn->ctype) &&
+   (last_ct->wc + 1 == wc)) {
ct[rl.runetype_ext_nranges-1].max = wc;
-   last_ct = ctn;
} else {
rl.runetype_ext_nranges++;
ct = realloc(ct,
@@ -417,8 +417,8 @@ dump_ctype(void)
ct[rl.runetype_ext_nranges - 1].min = wc;
ct[rl.runetype_ext_nranges - 1].max = wc;
ct[rl.runetype_ext_nranges - 1].map = ctn->ctype;
-   last_ct = ctn;
}
+   last_ct = ctn;
if (ctn->tolower == 0) {
last_lo = NULL;
} else if ((last_lo != NULL) &&

Modified: releng/11.0/usr.bin/localedef/parser.y
==
--- releng/11.0/usr.bin/localedef/parser.y  Tue Dec  6 00:06:16 2016
(r309583)
+++ releng/11.0/usr.bin/localedef/parser.y  Tue Dec  6 00:09:52 2016
(r309584)
@@ -27,6 +27,8 @@
  * 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$
  */
 
 /*
@@ -321,21 +323,18 @@ ctype_kw  : T_ISUPPER cc_list T_NL
| T_TOLOWER conv_list T_NL
;
 
+cc_list: cc_list T_SEMI cc_range_end
+   | cc_list T_SEMI cc_char
+   | cc_char
+   ;
 
-cc_list: cc_list T_SEMI T_CHAR
+cc_range_end   : T_ELLIPSIS T_SEMI T_CHAR
{
-   add_ctype($3);
+   add_ctype_range($3);
}
-   | cc_list T_SEMI T_SYMBOL
-   {
-   add_charmap_undefined($3);
-   }
-   | cc_list T_SEMI T_ELLIPSIS T_SEMI T_CHAR
-   {
-   /* note that the endpoints *must* be characters */
-   add_ctype_range($5);
-   }
-   | T_CHAR
+   ;
+
+cc_char: T_CHAR
{
add_ctype($1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309583 - releng/11.0/contrib/tzdata

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec  6 00:06:16 2016
New Revision: 309583
URL: https://svnweb.freebsd.org/changeset/base/309583

Log:
  Update tzdata to 2016i.
  
  Note: because of what appears to be a missing MFC to stable branches,
  these patches were generated by doing:
  
   % rsync -av stable/11/contrib/tzdata releng/11.x/contrib
   % svn add releng/11.x/contrib/tzdata
  
  Errata Notice:EN-16:20
  Submitted by: gjb
  Approved by:  so

Added:
  releng/11.0/contrib/tzdata/CONTRIBUTING
  releng/11.0/contrib/tzdata/LICENSE
  releng/11.0/contrib/tzdata/Makefile   (contents, props changed)
  releng/11.0/contrib/tzdata/NEWS
  releng/11.0/contrib/tzdata/README
  releng/11.0/contrib/tzdata/Theory
  releng/11.0/contrib/tzdata/backzone
  releng/11.0/contrib/tzdata/checklinks.awk   (contents, props changed)
  releng/11.0/contrib/tzdata/checktab.awk   (contents, props changed)
  releng/11.0/contrib/tzdata/leapseconds.awk   (contents, props changed)
  releng/11.0/contrib/tzdata/version
  releng/11.0/contrib/tzdata/zoneinfo2tdf.pl   (contents, props changed)
Modified:
  releng/11.0/contrib/tzdata/africa
  releng/11.0/contrib/tzdata/antarctica
  releng/11.0/contrib/tzdata/asia
  releng/11.0/contrib/tzdata/australasia
  releng/11.0/contrib/tzdata/backward
  releng/11.0/contrib/tzdata/etcetera
  releng/11.0/contrib/tzdata/europe
  releng/11.0/contrib/tzdata/factory
  releng/11.0/contrib/tzdata/leap-seconds.list
  releng/11.0/contrib/tzdata/leapseconds
  releng/11.0/contrib/tzdata/northamerica
  releng/11.0/contrib/tzdata/southamerica
  releng/11.0/contrib/tzdata/zone.tab
  releng/11.0/contrib/tzdata/zone1970.tab

Added: releng/11.0/contrib/tzdata/CONTRIBUTING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/11.0/contrib/tzdata/CONTRIBUTING Tue Dec  6 00:06:16 2016
(r309583)
@@ -0,0 +1,73 @@
+Contributing to the tz code and data
+
+The time zone database is by no means authoritative: governments
+change timekeeping rules erratically and sometimes with little
+warning, the data entries do not cover all of civil time before
+1970, and undoubtedly errors remain in the code and data.  Feel
+free to fill gaps or fix mistakes, and please email improvements
+to t...@iana.org for use in the future.
+
+To email small changes, please run a POSIX shell command like
+'diff -u old/europe new/europe >myfix.patch', and attach
+myfix.patch to the email.
+
+For more-elaborate changes, please read the Theory file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Ideally, additions to
+data should contain commentary citing reliable sources as
+justification.
+
+Please submit changes against either the latest release in
+ or the master branch of the experimental
+Git repository.  If you use Git the following workflow may be helpful:
+
+  * Copy the experimental repository.
+
+  git clone https://github.com/eggert/tz.git
+  cd tz
+
+  * Get current with the master branch.
+
+  git checkout master
+  git pull
+
+  * Switch to a new branch for the changes.  Choose a different
+branch name for each change set.
+
+  git checkout -b mybranch
+
+  * Edit source files.  Include commentary that justifies the
+changes by citing reliable sources.
+
+  * Debug the changes, e.g.:
+
+  make check
+  make install
+  ./zdump -v America/Los_Angeles
+
+  * For each separable change, commit it in the new branch, e.g.:
+
+  git add northamerica
+  git commit
+
+See recent 'git log' output for the commit-message style.
+
+  * Create patch files 0001-*, 0002-*, ...
+
+  git format-patch master
+
+  * After reviewing the patch files, send the patches to t...@iana.org
+for others to review.
+
+  git send-email master
+
+  * Start anew by getting current with the master branch again
+(the second step above).
+
+Please do not create issues or pull requests on GitHub, as the
+proper procedure for proposing and distributing patches is via
+email as illustrated above.
+
+-
+
+This file is in the public domain.

Added: releng/11.0/contrib/tzdata/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/11.0/contrib/tzdata/LICENSE  Tue Dec  6 00:06:16 2016
(r309583)
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.

Added: releng/11.0/contrib/tzdata/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/11.0/contrib/tzdata/Makefile Tue Dec  6 

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

2016-12-05 Thread John Baldwin
Author: jhb
Date: Tue Dec  6 00:05:38 2016
New Revision: 309582
URL: https://svnweb.freebsd.org/changeset/base/309582

Log:
  Bump Dd for addition of T6.
  
  Pointy hat to:jhb

Modified:
  head/share/man/man4/cxgbe.4
  head/share/man/man4/cxgbev.4

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Tue Dec  6 00:01:53 2016(r309581)
+++ head/share/man/man4/cxgbe.4 Tue Dec  6 00:05:38 2016(r309582)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2011-2014, Chelsio Inc
+.\" Copyright (c) 2011-2016, Chelsio Inc
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 2, 2015
+.Dd December 5, 2016
 .Dt CXGBE 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/cxgbev.4
==
--- head/share/man/man4/cxgbev.4Tue Dec  6 00:01:53 2016
(r309581)
+++ head/share/man/man4/cxgbev.4Tue Dec  6 00:05:38 2016
(r309582)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 22, 2016
+.Dd December 5, 2016
 .Dt CXGBEV 4
 .Os
 .Sh NAME
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-12-05 Thread John Baldwin
Author: jhb
Date: Tue Dec  6 00:01:53 2016
New Revision: 309581
URL: https://svnweb.freebsd.org/changeset/base/309581

Log:
  Document support for Terminator 6 adapters in cxgbe(4) and cxgbev(4).
  
  Approved by:  np
  MFC after:3 days
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D8716

Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/cxgbe.4
  head/share/man/man4/cxgbev.4

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileMon Dec  5 23:55:53 2016
(r309580)
+++ head/share/man/man4/MakefileTue Dec  6 00:01:53 2016
(r309581)
@@ -607,11 +607,21 @@ MLINKS+=crypto.4 cryptodev.4
 MLINKS+=cue.4 if_cue.4
 MLINKS+=cxgb.4 if_cxgb.4
 MLINKS+=cxgbe.4 if_cxgbe.4 \
+   cxgbe.4 vcxgbe.4 \
+   cxgbe.4 if_vcxgbe.4 \
cxgbe.4 cxl.4 \
-   cxgbe.4 if_cxl.4
+   cxgbe.4 if_cxl.4 \
+   cxgbe.4 vcxl.4 \
+   cxgbe.4 if_vcxl.4 \
+   cxgbe.4 cc.4 \
+   cxgbe.4 if_cc.4 \
+   cxgbe.4 vcc.4 \
+   cxgbe.4 if_vcc.4
 MLINKS+=cxgbev.4 if_cxgbev.4 \
cxgbev.4 cxlv.4 \
-   cxgbev.4 if_cxlv.4
+   cxgbev.4 if_cxlv.4 \
+   cxgbev.4 ccv.4 \
+   cxgbev.4 if_ccv.4
 MLINKS+=dc.4 if_dc.4
 MLINKS+=de.4 if_de.4
 MLINKS+=disc.4 if_disc.4

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Mon Dec  5 23:55:53 2016(r309580)
+++ head/share/man/man4/cxgbe.4 Tue Dec  6 00:01:53 2016(r309581)
@@ -36,7 +36,7 @@
 .Os
 .Sh NAME
 .Nm cxgbe
-.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet adapter driver"
+.Nd "Chelsio T4-, T5-, and T6-based 100Gb, 40Gb, 25Gb, 10Gb, and 1Gb Ethernet 
adapter driver"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following lines in your
@@ -51,13 +51,14 @@ module at boot time, place the following
 .Bd -literal -offset indent
 t4fw_cfg_load="YES"
 t5fw_cfg_load="YES"
+t6fw_cfg_load="YES"
 if_cxgbe_load="YES"
 .Ed
 .Sh DESCRIPTION
 The
 .Nm
 driver provides support for PCI Express Ethernet adapters based on
-the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5).
+the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and 
T6).
 The driver supports Jumbo Frames, Transmit/Receive checksum offload,
 TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN
 tag insertion/extraction, VLAN checksum offload, VLAN TSO, and
@@ -66,17 +67,46 @@ For further hardware information and que
 requirements, see
 .Pa http://www.chelsio.com/ .
 .Pp
-Note that ports of T5 cards are named cxl and attach to a t5nex parent device
-(in contrast to ports named cxgbe that attach to a t4nex parent for a T4 card).
-Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 cards.
-The sysctl MIBs are at dev.t5nex and dev.cxl for T5 cards and at dev.t4nex and
-dev.cxgbe for T4 cards.
+The
+.Nm
+driver uses different names for devices based on the associated ASIC:
+.Bl -column -offset indent "ASIC" "Port Name" "Parent Device"
+.It Sy ASIC Ta Sy Port Name Ta Sy Parent Device Ta Sy Virtual Interface
+.It T4 Ta cxgbe Ta t4nex Ta vcxgbe
+.It T5 Ta cxl Ta t5nex Ta vcxl
+.It T6 Ta cc Ta t6nex Ta vcc
+.El
+.Pp
+Loader tunables with the hw.cxgbe prefix apply to all cards.
+The driver provides sysctl MIBs for both ports and parent devices using
+the names above.
+For example, a T5 adapter will provide port MIBs under dev.cxl and
+adapter-wide MIBs under dev.t5nex.
+References to sysctl MIBs in the remainder of this page will use
+dev. for port MIBs and dev. for adapter-wide MIBs.
 .Pp
 For more information on configuring this device, see
 .Xr ifconfig 8 .
 .Sh HARDWARE
 The
 .Nm
+driver supports 100Gb and 25Gb Ethernet adapters based on the T6 ASIC:
+.Pp
+.Bl -bullet -compact
+.It
+Chelsio T6225-CR
+.It
+Chelsio T6225-SO-CR
+.It
+Chelsio T62100-LP-CR
+.It
+Chelsio T62100-SO-CR
+.It
+Chelsio T62100-CR
+.El
+.Pp
+The
+.Nm
 driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC:
 .Pp
 .Bl -bullet -compact
@@ -139,11 +169,11 @@ prompt before booting the kernel or stor
 .Xr loader.conf 5 .
 .Bl -tag -width indent
 .It Va hw.cxgbe.ntxq10g
-The number of tx queues to use for a 10Gb or 40Gb port.
+The number of tx queues to use for a 10Gb or higher-speed port.
 The default is 16 or the number
 of CPU cores in the system, whichever is less.
 .It Va hw.cxgbe.nrxq10g
-The number of rx queues to use for a 10Gb or 40Gb port.
+The number of rx queues to use for a 10Gb or higher-speed port.
 The default is 8 or the number
 of CPU cores in the system, whichever is less.
 .It Va hw.cxgbe.ntxq1g
@@ -155,11 +185,11 @@ The number of rx queues to use for a 1Gb
 The default is 2 or the number
 of CPU cores in the system, whichever is less.
 .It Va hw.cxgbe.nofldtxq10g
-The number of TOE tx queues to use for a 10Gb or 40Gb port.

svn commit: r309580 - in stable: 10/sys/dev/cxgbe/common 11/sys/dev/cxgbe/common

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:55:53 2016
New Revision: 309580
URL: https://svnweb.freebsd.org/changeset/base/309580

Log:
  MFC 308066: cxgbe(4): Accurate statistics for all chip settings.
  
  There are 4 independent knobs in T5+ chips to include or exclude PAUSE
  frames from the "total frames" and "multicast frames" counters in either
  direction.  This change lets the driver deal with any combination of
  these settings.

Modified:
  stable/11/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:46:21 2016
(r309579)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:55:53 2016
(r309580)
@@ -5879,10 +5879,13 @@ void t4_get_port_stats(struct adapter *a
p->tx_ppp6  = GET_STAT(TX_PORT_PPP6);
p->tx_ppp7  = GET_STAT(TX_PORT_PPP7);
 
-   if (stat_ctl & F_COUNTPAUSESTATTX) {
-   p->tx_frames -= p->tx_pause;
-   p->tx_octets -= p->tx_pause * 64;
-   p->tx_mcast_frames -= p->tx_pause;
+   if (chip_id(adap) >= CHELSIO_T5) {
+   if (stat_ctl & F_COUNTPAUSESTATTX) {
+   p->tx_frames -= p->tx_pause;
+   p->tx_octets -= p->tx_pause * 64;
+   }
+   if (stat_ctl & F_COUNTPAUSEMCTX)
+   p->tx_mcast_frames -= p->tx_pause;
}
 
p->rx_pause = GET_STAT(RX_PORT_PAUSE);
@@ -5913,10 +5916,13 @@ void t4_get_port_stats(struct adapter *a
p->rx_ppp6  = GET_STAT(RX_PORT_PPP6);
p->rx_ppp7  = GET_STAT(RX_PORT_PPP7);
 
-   if (stat_ctl & F_COUNTPAUSESTATRX) {
-   p->rx_frames -= p->rx_pause;
-   p->rx_octets -= p->rx_pause * 64;
-   p->rx_mcast_frames -= p->rx_pause;
+   if (chip_id(adap) >= CHELSIO_T5) {
+   if (stat_ctl & F_COUNTPAUSESTATRX) {
+   p->rx_frames -= p->rx_pause;
+   p->rx_octets -= p->rx_pause * 64;
+   }
+   if (stat_ctl & F_COUNTPAUSEMCRX)
+   p->rx_mcast_frames -= p->rx_pause;
}
 
p->rx_ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_MAC_DROP_FRAME) : 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309580 - in stable: 10/sys/dev/cxgbe/common 11/sys/dev/cxgbe/common

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:55:53 2016
New Revision: 309580
URL: https://svnweb.freebsd.org/changeset/base/309580

Log:
  MFC 308066: cxgbe(4): Accurate statistics for all chip settings.
  
  There are 4 independent knobs in T5+ chips to include or exclude PAUSE
  frames from the "total frames" and "multicast frames" counters in either
  direction.  This change lets the driver deal with any combination of
  these settings.

Modified:
  stable/10/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/10/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:46:21 2016
(r309579)
+++ stable/10/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:55:53 2016
(r309580)
@@ -5876,10 +5876,13 @@ void t4_get_port_stats(struct adapter *a
p->tx_ppp6  = GET_STAT(TX_PORT_PPP6);
p->tx_ppp7  = GET_STAT(TX_PORT_PPP7);
 
-   if (stat_ctl & F_COUNTPAUSESTATTX) {
-   p->tx_frames -= p->tx_pause;
-   p->tx_octets -= p->tx_pause * 64;
-   p->tx_mcast_frames -= p->tx_pause;
+   if (chip_id(adap) >= CHELSIO_T5) {
+   if (stat_ctl & F_COUNTPAUSESTATTX) {
+   p->tx_frames -= p->tx_pause;
+   p->tx_octets -= p->tx_pause * 64;
+   }
+   if (stat_ctl & F_COUNTPAUSEMCTX)
+   p->tx_mcast_frames -= p->tx_pause;
}
 
p->rx_pause = GET_STAT(RX_PORT_PAUSE);
@@ -5910,10 +5913,13 @@ void t4_get_port_stats(struct adapter *a
p->rx_ppp6  = GET_STAT(RX_PORT_PPP6);
p->rx_ppp7  = GET_STAT(RX_PORT_PPP7);
 
-   if (stat_ctl & F_COUNTPAUSESTATRX) {
-   p->rx_frames -= p->rx_pause;
-   p->rx_octets -= p->rx_pause * 64;
-   p->rx_mcast_frames -= p->rx_pause;
+   if (chip_id(adap) >= CHELSIO_T5) {
+   if (stat_ctl & F_COUNTPAUSESTATRX) {
+   p->rx_frames -= p->rx_pause;
+   p->rx_octets -= p->rx_pause * 64;
+   }
+   if (stat_ctl & F_COUNTPAUSEMCRX)
+   p->rx_mcast_frames -= p->rx_pause;
}
 
p->rx_ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_MAC_DROP_FRAME) : 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309579 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:46:21 2016
New Revision: 309579
URL: https://svnweb.freebsd.org/changeset/base/309579

Log:
  MFC 307876:
  cxgbe(4): Fix bug in the calculation of the number of physically
  contiguous regions in an mbuf chain.
  
  If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
  incorrectly consider the next mbuf's payload physically contiguous based
  solely on a KVA comparison.

Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_sge.c
==
--- stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 23:35:37 2016
(r309578)
+++ stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 23:46:21 2016
(r309579)
@@ -2101,24 +2101,6 @@ m_advance(struct mbuf **pm, int *poffset
return ((void *)p);
 }
 
-static inline int
-same_paddr(char *a, char *b)
-{
-
-   if (a == b)
-   return (1);
-   else if (a != NULL && b != NULL) {
-   vm_offset_t x = (vm_offset_t)a;
-   vm_offset_t y = (vm_offset_t)b;
-
-   if ((x & PAGE_MASK) == (y & PAGE_MASK) &&
-   pmap_kextract(x) == pmap_kextract(y))
-   return (1);
-   }
-
-   return (0);
-}
-
 /*
  * Can deal with empty mbufs in the chain that have m_len = 0, but the chain
  * must have at least one mbuf that's not empty.
@@ -2126,24 +2108,25 @@ same_paddr(char *a, char *b)
 static inline int
 count_mbuf_nsegs(struct mbuf *m)
 {
-   char *prev_end, *start;
+   vm_paddr_t lastb, next;
+   vm_offset_t va;
int len, nsegs;
 
MPASS(m != NULL);
 
nsegs = 0;
-   prev_end = NULL;
+   lastb = 0;
for (; m; m = m->m_next) {
 
len = m->m_len;
if (__predict_false(len == 0))
continue;
-   start = mtod(m, char *);
-
-   nsegs += sglist_count(start, len);
-   if (same_paddr(prev_end, start))
+   va = mtod(m, vm_offset_t);
+   next = pmap_kextract(va);
+   nsegs += sglist_count(m->m_data, len);
+   if (lastb + 1 == next)
nsegs--;
-   prev_end = start + len;
+   lastb = pmap_kextract(va + len - 1);
}
 
MPASS(nsegs > 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309579 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:46:21 2016
New Revision: 309579
URL: https://svnweb.freebsd.org/changeset/base/309579

Log:
  MFC 307876:
  cxgbe(4): Fix bug in the calculation of the number of physically
  contiguous regions in an mbuf chain.
  
  If the payload of an mbuf ends at a page boundary count_mbuf_nsegs would
  incorrectly consider the next mbuf's payload physically contiguous based
  solely on a KVA comparison.

Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 23:35:37 2016
(r309578)
+++ stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 23:46:21 2016
(r309579)
@@ -2101,24 +2101,6 @@ m_advance(struct mbuf **pm, int *poffset
return ((void *)p);
 }
 
-static inline int
-same_paddr(char *a, char *b)
-{
-
-   if (a == b)
-   return (1);
-   else if (a != NULL && b != NULL) {
-   vm_offset_t x = (vm_offset_t)a;
-   vm_offset_t y = (vm_offset_t)b;
-
-   if ((x & PAGE_MASK) == (y & PAGE_MASK) &&
-   pmap_kextract(x) == pmap_kextract(y))
-   return (1);
-   }
-
-   return (0);
-}
-
 /*
  * Can deal with empty mbufs in the chain that have m_len = 0, but the chain
  * must have at least one mbuf that's not empty.
@@ -2126,24 +2108,25 @@ same_paddr(char *a, char *b)
 static inline int
 count_mbuf_nsegs(struct mbuf *m)
 {
-   char *prev_end, *start;
+   vm_paddr_t lastb, next;
+   vm_offset_t va;
int len, nsegs;
 
MPASS(m != NULL);
 
nsegs = 0;
-   prev_end = NULL;
+   lastb = 0;
for (; m; m = m->m_next) {
 
len = m->m_len;
if (__predict_false(len == 0))
continue;
-   start = mtod(m, char *);
-
-   nsegs += sglist_count(start, len);
-   if (same_paddr(prev_end, start))
+   va = mtod(m, vm_offset_t);
+   next = pmap_kextract(va);
+   nsegs += sglist_count(m->m_data, len);
+   if (lastb + 1 == next)
nsegs--;
-   prev_end = start + len;
+   lastb = pmap_kextract(va + len - 1);
}
 
MPASS(nsegs > 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309578 - in stable: 10/sys/dev/cxgbe/common 11/sys/dev/cxgbe/common

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:35:37 2016
New Revision: 309578
URL: https://svnweb.freebsd.org/changeset/base/309578

Log:
  MFC 307759: cxgbe(4): Dump any mailbox command that times out.

Modified:
  stable/11/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:30:13 2016
(r309577)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:35:37 2016
(r309578)
@@ -432,6 +432,21 @@ int t4_wr_mbox_meat_timeout(struct adapt
CH_ERR(adap, "command %#x in mailbox %d timed out\n",
   *(const u8 *)cmd, mbox);
 
+   /* If DUMP_MBOX is set the mbox has already been dumped */
+   if ((adap->debug_flags & DF_DUMP_MBOX) == 0) {
+   p = cmd;
+   CH_ERR(adap, "mbox: %016llx %016llx %016llx %016llx "
+   "%016llx %016llx %016llx %016llx\n",
+   (unsigned long long)be64_to_cpu(p[0]),
+   (unsigned long long)be64_to_cpu(p[1]),
+   (unsigned long long)be64_to_cpu(p[2]),
+   (unsigned long long)be64_to_cpu(p[3]),
+   (unsigned long long)be64_to_cpu(p[4]),
+   (unsigned long long)be64_to_cpu(p[5]),
+   (unsigned long long)be64_to_cpu(p[6]),
+   (unsigned long long)be64_to_cpu(p[7]));
+   }
+
t4_report_fw_error(adap);
t4_fatal_err(adap);
return ret;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309578 - in stable: 10/sys/dev/cxgbe/common 11/sys/dev/cxgbe/common

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:35:37 2016
New Revision: 309578
URL: https://svnweb.freebsd.org/changeset/base/309578

Log:
  MFC 307759: cxgbe(4): Dump any mailbox command that times out.

Modified:
  stable/10/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/10/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:30:13 2016
(r309577)
+++ stable/10/sys/dev/cxgbe/common/t4_hw.c  Mon Dec  5 23:35:37 2016
(r309578)
@@ -429,6 +429,21 @@ int t4_wr_mbox_meat_timeout(struct adapt
CH_ERR(adap, "command %#x in mailbox %d timed out\n",
   *(const u8 *)cmd, mbox);
 
+   /* If DUMP_MBOX is set the mbox has already been dumped */
+   if ((adap->debug_flags & DF_DUMP_MBOX) == 0) {
+   p = cmd;
+   CH_ERR(adap, "mbox: %016llx %016llx %016llx %016llx "
+   "%016llx %016llx %016llx %016llx\n",
+   (unsigned long long)be64_to_cpu(p[0]),
+   (unsigned long long)be64_to_cpu(p[1]),
+   (unsigned long long)be64_to_cpu(p[2]),
+   (unsigned long long)be64_to_cpu(p[3]),
+   (unsigned long long)be64_to_cpu(p[4]),
+   (unsigned long long)be64_to_cpu(p[5]),
+   (unsigned long long)be64_to_cpu(p[6]),
+   (unsigned long long)be64_to_cpu(p[7]));
+   }
+
t4_report_fw_error(adap);
t4_fatal_err(adap);
return ret;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309577 - releng/10.3/contrib/tzdata

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:30:13 2016
New Revision: 309577
URL: https://svnweb.freebsd.org/changeset/base/309577

Log:
  Update tzdata to 2016i.
  
  Note: because of what appears to be a missing MFC to stable branches,
  these patches were generated by doing:
  
   % rsync -av stable/10/contrib/tzdata releng/10.x/contrib/tzdata
   % svn add releng/10.x/contrib/tzdata
  
  Errata Notice:EN-16:19
  Submitted by: gjb
  Approved by:  so

Added:
  releng/10.3/contrib/tzdata/CONTRIBUTING
  releng/10.3/contrib/tzdata/LICENSE
  releng/10.3/contrib/tzdata/Makefile   (contents, props changed)
  releng/10.3/contrib/tzdata/NEWS
  releng/10.3/contrib/tzdata/README
  releng/10.3/contrib/tzdata/Theory
  releng/10.3/contrib/tzdata/backzone
  releng/10.3/contrib/tzdata/checklinks.awk   (contents, props changed)
  releng/10.3/contrib/tzdata/checktab.awk   (contents, props changed)
  releng/10.3/contrib/tzdata/leapseconds.awk   (contents, props changed)
  releng/10.3/contrib/tzdata/version
  releng/10.3/contrib/tzdata/zoneinfo2tdf.pl   (contents, props changed)
Modified:
  releng/10.3/contrib/tzdata/africa
  releng/10.3/contrib/tzdata/antarctica
  releng/10.3/contrib/tzdata/asia
  releng/10.3/contrib/tzdata/australasia
  releng/10.3/contrib/tzdata/backward
  releng/10.3/contrib/tzdata/etcetera
  releng/10.3/contrib/tzdata/europe
  releng/10.3/contrib/tzdata/factory
  releng/10.3/contrib/tzdata/leap-seconds.list
  releng/10.3/contrib/tzdata/leapseconds
  releng/10.3/contrib/tzdata/northamerica
  releng/10.3/contrib/tzdata/southamerica
  releng/10.3/contrib/tzdata/zone.tab
  releng/10.3/contrib/tzdata/zone1970.tab

Added: releng/10.3/contrib/tzdata/CONTRIBUTING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.3/contrib/tzdata/CONTRIBUTING Mon Dec  5 23:30:13 2016
(r309577)
@@ -0,0 +1,73 @@
+Contributing to the tz code and data
+
+The time zone database is by no means authoritative: governments
+change timekeeping rules erratically and sometimes with little
+warning, the data entries do not cover all of civil time before
+1970, and undoubtedly errors remain in the code and data.  Feel
+free to fill gaps or fix mistakes, and please email improvements
+to t...@iana.org for use in the future.
+
+To email small changes, please run a POSIX shell command like
+'diff -u old/europe new/europe >myfix.patch', and attach
+myfix.patch to the email.
+
+For more-elaborate changes, please read the Theory file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Ideally, additions to
+data should contain commentary citing reliable sources as
+justification.
+
+Please submit changes against either the latest release in
+ or the master branch of the experimental
+Git repository.  If you use Git the following workflow may be helpful:
+
+  * Copy the experimental repository.
+
+  git clone https://github.com/eggert/tz.git
+  cd tz
+
+  * Get current with the master branch.
+
+  git checkout master
+  git pull
+
+  * Switch to a new branch for the changes.  Choose a different
+branch name for each change set.
+
+  git checkout -b mybranch
+
+  * Edit source files.  Include commentary that justifies the
+changes by citing reliable sources.
+
+  * Debug the changes, e.g.:
+
+  make check
+  make install
+  ./zdump -v America/Los_Angeles
+
+  * For each separable change, commit it in the new branch, e.g.:
+
+  git add northamerica
+  git commit
+
+See recent 'git log' output for the commit-message style.
+
+  * Create patch files 0001-*, 0002-*, ...
+
+  git format-patch master
+
+  * After reviewing the patch files, send the patches to t...@iana.org
+for others to review.
+
+  git send-email master
+
+  * Start anew by getting current with the master branch again
+(the second step above).
+
+Please do not create issues or pull requests on GitHub, as the
+proper procedure for proposing and distributing patches is via
+email as illustrated above.
+
+-
+
+This file is in the public domain.

Added: releng/10.3/contrib/tzdata/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.3/contrib/tzdata/LICENSE  Mon Dec  5 23:30:13 2016
(r309577)
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.

Added: releng/10.3/contrib/tzdata/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.3/contrib/tzdata/Makefile Mon 

svn commit: r309576 - releng/10.2/contrib/tzdata

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:26:06 2016
New Revision: 309576
URL: https://svnweb.freebsd.org/changeset/base/309576

Log:
  Update tzdata to 2016i.
  
  Note: because of what appears to be a missing MFC to stable branches,
  these patches were generated by doing:
  
   % rsync -av stable/10/contrib/tzdata releng/10.x/contrib/tzdata
   % svn add releng/10.x/contrib/tzdata
  
  Errata Notice:EN-16:19
  Submitted by: gjb
  Approved by:  so

Added:
  releng/10.2/contrib/tzdata/CONTRIBUTING
  releng/10.2/contrib/tzdata/LICENSE
  releng/10.2/contrib/tzdata/Makefile   (contents, props changed)
  releng/10.2/contrib/tzdata/NEWS
  releng/10.2/contrib/tzdata/README
  releng/10.2/contrib/tzdata/Theory
  releng/10.2/contrib/tzdata/backzone
  releng/10.2/contrib/tzdata/checklinks.awk   (contents, props changed)
  releng/10.2/contrib/tzdata/checktab.awk   (contents, props changed)
  releng/10.2/contrib/tzdata/leapseconds.awk   (contents, props changed)
  releng/10.2/contrib/tzdata/version
  releng/10.2/contrib/tzdata/zoneinfo2tdf.pl   (contents, props changed)
Modified:
  releng/10.2/contrib/tzdata/africa
  releng/10.2/contrib/tzdata/antarctica
  releng/10.2/contrib/tzdata/asia
  releng/10.2/contrib/tzdata/australasia
  releng/10.2/contrib/tzdata/backward
  releng/10.2/contrib/tzdata/etcetera
  releng/10.2/contrib/tzdata/europe
  releng/10.2/contrib/tzdata/factory
  releng/10.2/contrib/tzdata/leap-seconds.list
  releng/10.2/contrib/tzdata/leapseconds
  releng/10.2/contrib/tzdata/northamerica
  releng/10.2/contrib/tzdata/southamerica
  releng/10.2/contrib/tzdata/zone.tab
  releng/10.2/contrib/tzdata/zone1970.tab

Added: releng/10.2/contrib/tzdata/CONTRIBUTING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.2/contrib/tzdata/CONTRIBUTING Mon Dec  5 23:26:06 2016
(r309576)
@@ -0,0 +1,73 @@
+Contributing to the tz code and data
+
+The time zone database is by no means authoritative: governments
+change timekeeping rules erratically and sometimes with little
+warning, the data entries do not cover all of civil time before
+1970, and undoubtedly errors remain in the code and data.  Feel
+free to fill gaps or fix mistakes, and please email improvements
+to t...@iana.org for use in the future.
+
+To email small changes, please run a POSIX shell command like
+'diff -u old/europe new/europe >myfix.patch', and attach
+myfix.patch to the email.
+
+For more-elaborate changes, please read the Theory file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Ideally, additions to
+data should contain commentary citing reliable sources as
+justification.
+
+Please submit changes against either the latest release in
+ or the master branch of the experimental
+Git repository.  If you use Git the following workflow may be helpful:
+
+  * Copy the experimental repository.
+
+  git clone https://github.com/eggert/tz.git
+  cd tz
+
+  * Get current with the master branch.
+
+  git checkout master
+  git pull
+
+  * Switch to a new branch for the changes.  Choose a different
+branch name for each change set.
+
+  git checkout -b mybranch
+
+  * Edit source files.  Include commentary that justifies the
+changes by citing reliable sources.
+
+  * Debug the changes, e.g.:
+
+  make check
+  make install
+  ./zdump -v America/Los_Angeles
+
+  * For each separable change, commit it in the new branch, e.g.:
+
+  git add northamerica
+  git commit
+
+See recent 'git log' output for the commit-message style.
+
+  * Create patch files 0001-*, 0002-*, ...
+
+  git format-patch master
+
+  * After reviewing the patch files, send the patches to t...@iana.org
+for others to review.
+
+  git send-email master
+
+  * Start anew by getting current with the master branch again
+(the second step above).
+
+Please do not create issues or pull requests on GitHub, as the
+proper procedure for proposing and distributing patches is via
+email as illustrated above.
+
+-
+
+This file is in the public domain.

Added: releng/10.2/contrib/tzdata/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.2/contrib/tzdata/LICENSE  Mon Dec  5 23:26:06 2016
(r309576)
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.

Added: releng/10.2/contrib/tzdata/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.2/contrib/tzdata/Makefile Mon 

svn commit: r309575 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:25:49 2016
New Revision: 309575
URL: https://svnweb.freebsd.org/changeset/base/309575

Log:
  MFC 307233:
  cxgbe(4): Allow the interface MTU to be set as high as the actual
  hardware limit.

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:23:13 2016
(r309574)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:25:49 2016
(r309575)
@@ -1567,7 +1567,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned 
switch (cmd) {
case SIOCSIFMTU:
mtu = ifr->ifr_mtu;
-   if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO))
+   if (mtu < ETHERMIN || mtu > MAX_MTU)
return (EINVAL);
 
rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309575 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:25:49 2016
New Revision: 309575
URL: https://svnweb.freebsd.org/changeset/base/309575

Log:
  MFC 307233:
  cxgbe(4): Allow the interface MTU to be set as high as the actual
  hardware limit.

Modified:
  stable/10/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_main.c
==
--- stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:23:13 2016
(r309574)
+++ stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:25:49 2016
(r309575)
@@ -1493,7 +1493,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned 
switch (cmd) {
case SIOCSIFMTU:
mtu = ifr->ifr_mtu;
-   if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO))
+   if (mtu < ETHERMIN || mtu > MAX_MTU)
return (EINVAL);
 
rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309574 - releng/10.1/contrib/tzdata

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:23:13 2016
New Revision: 309574
URL: https://svnweb.freebsd.org/changeset/base/309574

Log:
  Update tzdata to 2016i.
  
  Note: because of what appears to be a missing MFC to stable branches,
  these patches were generated by doing:
  
   % rsync -av stable/10/contrib/tzdata releng/10.x/contrib/tzdata
   % svn add releng/10.x/contrib/tzdata
  
  Errata Notice:EN-16:19
  Submitted by: gjb
  Approved by:  so

Added:
  releng/10.1/contrib/tzdata/CONTRIBUTING
  releng/10.1/contrib/tzdata/LICENSE
  releng/10.1/contrib/tzdata/Makefile   (contents, props changed)
  releng/10.1/contrib/tzdata/NEWS
  releng/10.1/contrib/tzdata/README
  releng/10.1/contrib/tzdata/Theory
  releng/10.1/contrib/tzdata/backzone
  releng/10.1/contrib/tzdata/checklinks.awk   (contents, props changed)
  releng/10.1/contrib/tzdata/checktab.awk   (contents, props changed)
  releng/10.1/contrib/tzdata/leapseconds.awk   (contents, props changed)
  releng/10.1/contrib/tzdata/version
  releng/10.1/contrib/tzdata/zoneinfo2tdf.pl   (contents, props changed)
Modified:
  releng/10.1/contrib/tzdata/africa
  releng/10.1/contrib/tzdata/antarctica
  releng/10.1/contrib/tzdata/asia
  releng/10.1/contrib/tzdata/australasia
  releng/10.1/contrib/tzdata/backward
  releng/10.1/contrib/tzdata/etcetera
  releng/10.1/contrib/tzdata/europe
  releng/10.1/contrib/tzdata/factory
  releng/10.1/contrib/tzdata/leap-seconds.list
  releng/10.1/contrib/tzdata/leapseconds
  releng/10.1/contrib/tzdata/northamerica
  releng/10.1/contrib/tzdata/southamerica
  releng/10.1/contrib/tzdata/zone.tab
  releng/10.1/contrib/tzdata/zone1970.tab

Added: releng/10.1/contrib/tzdata/CONTRIBUTING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.1/contrib/tzdata/CONTRIBUTING Mon Dec  5 23:23:13 2016
(r309574)
@@ -0,0 +1,73 @@
+Contributing to the tz code and data
+
+The time zone database is by no means authoritative: governments
+change timekeeping rules erratically and sometimes with little
+warning, the data entries do not cover all of civil time before
+1970, and undoubtedly errors remain in the code and data.  Feel
+free to fill gaps or fix mistakes, and please email improvements
+to t...@iana.org for use in the future.
+
+To email small changes, please run a POSIX shell command like
+'diff -u old/europe new/europe >myfix.patch', and attach
+myfix.patch to the email.
+
+For more-elaborate changes, please read the Theory file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Ideally, additions to
+data should contain commentary citing reliable sources as
+justification.
+
+Please submit changes against either the latest release in
+ or the master branch of the experimental
+Git repository.  If you use Git the following workflow may be helpful:
+
+  * Copy the experimental repository.
+
+  git clone https://github.com/eggert/tz.git
+  cd tz
+
+  * Get current with the master branch.
+
+  git checkout master
+  git pull
+
+  * Switch to a new branch for the changes.  Choose a different
+branch name for each change set.
+
+  git checkout -b mybranch
+
+  * Edit source files.  Include commentary that justifies the
+changes by citing reliable sources.
+
+  * Debug the changes, e.g.:
+
+  make check
+  make install
+  ./zdump -v America/Los_Angeles
+
+  * For each separable change, commit it in the new branch, e.g.:
+
+  git add northamerica
+  git commit
+
+See recent 'git log' output for the commit-message style.
+
+  * Create patch files 0001-*, 0002-*, ...
+
+  git format-patch master
+
+  * After reviewing the patch files, send the patches to t...@iana.org
+for others to review.
+
+  git send-email master
+
+  * Start anew by getting current with the master branch again
+(the second step above).
+
+Please do not create issues or pull requests on GitHub, as the
+proper procedure for proposing and distributing patches is via
+email as illustrated above.
+
+-
+
+This file is in the public domain.

Added: releng/10.1/contrib/tzdata/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.1/contrib/tzdata/LICENSE  Mon Dec  5 23:23:13 2016
(r309574)
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.

Added: releng/10.1/contrib/tzdata/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/10.1/contrib/tzdata/Makefile Mon 

svn commit: r309573 - releng/11.0/contrib/tzcode/zic

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:17:05 2016
New Revision: 309573
URL: https://svnweb.freebsd.org/changeset/base/309573

Log:
  Merge r307358 from stable/11:
  
  Incorporate a change from OpenBSD by mill...@openbsd.org
  
  Don't warn about valid time zone abbreviations.  POSIX
  through 2000 says that an abbreviation cannot start with ':', and
  cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
  on changes this rule to say that an abbreviation can contain only
  '-', '+', and alphanumeric characters from the portable character
  set in the current locale.  To be portable to both sets of rules,
  an abbreviation must therefore use only ASCII letters."  Adapted
  from tzcode2015f.
  
  Errata Notice:EN-16:19.tzcode
  Submitted by: bapt
  Approved by:  so

Modified:
  releng/11.0/contrib/tzcode/zic/zdump.c
  releng/11.0/contrib/tzcode/zic/zic.c
Directory Properties:
  releng/11.0/   (props changed)

Modified: releng/11.0/contrib/tzcode/zic/zdump.c
==
--- releng/11.0/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:13:16 2016
(r309572)
+++ releng/11.0/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:17:05 2016
(r309573)
@@ -212,24 +212,16 @@ const char * constzone;
return;
cp = abbrp;
wp = NULL;
-   while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
+   while (isascii((unsigned char) *cp) &&
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == '+'))
++cp;
-   if (cp - abbrp == 0)
-   wp = _("lacks alphabetic at start");
-   else if (cp - abbrp < 3)
-   wp = _("has fewer than 3 alphabetics");
+   if (cp - abbrp < 3)
+   wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
-   wp = _("has more than 6 alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-   ++cp;
-   if (*cp != '\0')
-   wp = _("differs from POSIX standard");
-   }
-   if (wp == NULL)
+   wp = _("has more than 6 characters");
+   else if (*cp)
+   wp = "has characters other than ASCII alphanumerics, '-' or 
'+'";
+   else
return;
(void) fflush(stdout);
(void) fprintf(stderr,

Modified: releng/11.0/contrib/tzcode/zic/zic.c
==
--- releng/11.0/contrib/tzcode/zic/zic.cMon Dec  5 23:13:16 2016
(r309572)
+++ releng/11.0/contrib/tzcode/zic/zic.cMon Dec  5 23:17:05 2016
(r309573)
@@ -2615,29 +2615,15 @@ const char * const  string;
register const char *   cp;
register char * wp;
 
-   /*
-   ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
-   ** optionally followed by a + or - and a number from 1 to 14.
-   */
cp = string;
wp = NULL;
while (isascii((unsigned char) *cp) &&
-   isalpha((unsigned char) *cp))
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == 
'+'))
++cp;
-   if (cp - string == 0)
-wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
-wp = _("time zone abbreviation has more than 3 alphabetics");
+wp = _("time zone abbreviation has more than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-wp = _("time zone abbreviation has too many alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' &&
-   *cp >= '0' && *cp <= '4')
-   ++cp;
-   }
+wp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
 wp = _("time zone abbreviation differs from POSIX standard");
if (wp != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309572 - releng/10.3/contrib/tzcode/zic

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:13:16 2016
New Revision: 309572
URL: https://svnweb.freebsd.org/changeset/base/309572

Log:
  Merge r307359 from stable/10:
  
  Incorporate a change from OpenBSD by mill...@openbsd.org
  
  Don't warn about valid time zone abbreviations.  POSIX
  through 2000 says that an abbreviation cannot start with ':', and
  cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
  on changes this rule to say that an abbreviation can contain only
  '-', '+', and alphanumeric characters from the portable character
  set in the current locale.  To be portable to both sets of rules,
  an abbreviation must therefore use only ASCII letters."  Adapted
  from tzcode2015f.
  
  Errata Notice:EN-16:19.tzcode
  Submitted by: bapt
  Approved by:  so

Modified:
  releng/10.3/contrib/tzcode/zic/zdump.c
  releng/10.3/contrib/tzcode/zic/zic.c
Directory Properties:
  releng/10.3/   (props changed)

Modified: releng/10.3/contrib/tzcode/zic/zdump.c
==
--- releng/10.3/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:12:22 2016
(r309571)
+++ releng/10.3/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:13:16 2016
(r309572)
@@ -212,24 +212,16 @@ const char * constzone;
return;
cp = abbrp;
wp = NULL;
-   while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
+   while (isascii((unsigned char) *cp) &&
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == '+'))
++cp;
-   if (cp - abbrp == 0)
-   wp = _("lacks alphabetic at start");
-   else if (cp - abbrp < 3)
-   wp = _("has fewer than 3 alphabetics");
+   if (cp - abbrp < 3)
+   wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
-   wp = _("has more than 6 alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-   ++cp;
-   if (*cp != '\0')
-   wp = _("differs from POSIX standard");
-   }
-   if (wp == NULL)
+   wp = _("has more than 6 characters");
+   else if (*cp)
+   wp = "has characters other than ASCII alphanumerics, '-' or 
'+'";
+   else
return;
(void) fflush(stdout);
(void) fprintf(stderr,

Modified: releng/10.3/contrib/tzcode/zic/zic.c
==
--- releng/10.3/contrib/tzcode/zic/zic.cMon Dec  5 23:12:22 2016
(r309571)
+++ releng/10.3/contrib/tzcode/zic/zic.cMon Dec  5 23:13:16 2016
(r309572)
@@ -2615,29 +2615,15 @@ const char * const  string;
register const char *   cp;
register char * wp;
 
-   /*
-   ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
-   ** optionally followed by a + or - and a number from 1 to 14.
-   */
cp = string;
wp = NULL;
while (isascii((unsigned char) *cp) &&
-   isalpha((unsigned char) *cp))
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == 
'+'))
++cp;
-   if (cp - string == 0)
-wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
-wp = _("time zone abbreviation has more than 3 alphabetics");
+wp = _("time zone abbreviation has more than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-wp = _("time zone abbreviation has too many alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' &&
-   *cp >= '0' && *cp <= '4')
-   ++cp;
-   }
+wp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
 wp = _("time zone abbreviation differs from POSIX standard");
if (wp != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309571 - releng/10.2/contrib/tzcode/zic

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:12:22 2016
New Revision: 309571
URL: https://svnweb.freebsd.org/changeset/base/309571

Log:
  Merge r307359 from stable/10:
  
  Incorporate a change from OpenBSD by mill...@openbsd.org
  
  Don't warn about valid time zone abbreviations.  POSIX
  through 2000 says that an abbreviation cannot start with ':', and
  cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
  on changes this rule to say that an abbreviation can contain only
  '-', '+', and alphanumeric characters from the portable character
  set in the current locale.  To be portable to both sets of rules,
  an abbreviation must therefore use only ASCII letters."  Adapted
  from tzcode2015f.
  
  Errata Notice:EN-16:19.tzcode
  Submitted by: bapt
  Approved by:  so

Modified:
  releng/10.2/contrib/tzcode/zic/zdump.c
  releng/10.2/contrib/tzcode/zic/zic.c
Directory Properties:
  releng/10.2/   (props changed)

Modified: releng/10.2/contrib/tzcode/zic/zdump.c
==
--- releng/10.2/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:09:54 2016
(r309570)
+++ releng/10.2/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:12:22 2016
(r309571)
@@ -212,24 +212,16 @@ const char * constzone;
return;
cp = abbrp;
wp = NULL;
-   while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
+   while (isascii((unsigned char) *cp) &&
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == '+'))
++cp;
-   if (cp - abbrp == 0)
-   wp = _("lacks alphabetic at start");
-   else if (cp - abbrp < 3)
-   wp = _("has fewer than 3 alphabetics");
+   if (cp - abbrp < 3)
+   wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
-   wp = _("has more than 6 alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-   ++cp;
-   if (*cp != '\0')
-   wp = _("differs from POSIX standard");
-   }
-   if (wp == NULL)
+   wp = _("has more than 6 characters");
+   else if (*cp)
+   wp = "has characters other than ASCII alphanumerics, '-' or 
'+'";
+   else
return;
(void) fflush(stdout);
(void) fprintf(stderr,

Modified: releng/10.2/contrib/tzcode/zic/zic.c
==
--- releng/10.2/contrib/tzcode/zic/zic.cMon Dec  5 23:09:54 2016
(r309570)
+++ releng/10.2/contrib/tzcode/zic/zic.cMon Dec  5 23:12:22 2016
(r309571)
@@ -2615,29 +2615,15 @@ const char * const  string;
register const char *   cp;
register char * wp;
 
-   /*
-   ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
-   ** optionally followed by a + or - and a number from 1 to 14.
-   */
cp = string;
wp = NULL;
while (isascii((unsigned char) *cp) &&
-   isalpha((unsigned char) *cp))
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == 
'+'))
++cp;
-   if (cp - string == 0)
-wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
-wp = _("time zone abbreviation has more than 3 alphabetics");
+wp = _("time zone abbreviation has more than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-wp = _("time zone abbreviation has too many alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' &&
-   *cp >= '0' && *cp <= '4')
-   ++cp;
-   }
+wp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
 wp = _("time zone abbreviation differs from POSIX standard");
if (wp != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309570 - releng/10.1/contrib/tzcode/zic

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:09:54 2016
New Revision: 309570
URL: https://svnweb.freebsd.org/changeset/base/309570

Log:
  Merge r307359 from stable/10:
  
  Incorporate a change from OpenBSD by mill...@openbsd.org
  
  Don't warn about valid time zone abbreviations.  POSIX
  through 2000 says that an abbreviation cannot start with ':', and
  cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
  on changes this rule to say that an abbreviation can contain only
  '-', '+', and alphanumeric characters from the portable character
  set in the current locale.  To be portable to both sets of rules,
  an abbreviation must therefore use only ASCII letters."  Adapted
  from tzcode2015f.
  
  Errata Notice:EN-16:19.tzcode
  Submitted by: bapt
  Approved by:  so

Modified:
  releng/10.1/contrib/tzcode/zic/zdump.c
  releng/10.1/contrib/tzcode/zic/zic.c
Directory Properties:
  releng/10.1/   (props changed)

Modified: releng/10.1/contrib/tzcode/zic/zdump.c
==
--- releng/10.1/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:02:26 2016
(r309569)
+++ releng/10.1/contrib/tzcode/zic/zdump.c  Mon Dec  5 23:09:54 2016
(r309570)
@@ -212,24 +212,16 @@ const char * constzone;
return;
cp = abbrp;
wp = NULL;
-   while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
+   while (isascii((unsigned char) *cp) &&
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == '+'))
++cp;
-   if (cp - abbrp == 0)
-   wp = _("lacks alphabetic at start");
-   else if (cp - abbrp < 3)
-   wp = _("has fewer than 3 alphabetics");
+   if (cp - abbrp < 3)
+   wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
-   wp = _("has more than 6 alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-   ++cp;
-   if (*cp != '\0')
-   wp = _("differs from POSIX standard");
-   }
-   if (wp == NULL)
+   wp = _("has more than 6 characters");
+   else if (*cp)
+   wp = "has characters other than ASCII alphanumerics, '-' or 
'+'";
+   else
return;
(void) fflush(stdout);
(void) fprintf(stderr,

Modified: releng/10.1/contrib/tzcode/zic/zic.c
==
--- releng/10.1/contrib/tzcode/zic/zic.cMon Dec  5 23:02:26 2016
(r309569)
+++ releng/10.1/contrib/tzcode/zic/zic.cMon Dec  5 23:09:54 2016
(r309570)
@@ -2615,29 +2615,15 @@ const char * const  string;
register const char *   cp;
register char * wp;
 
-   /*
-   ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
-   ** optionally followed by a + or - and a number from 1 to 14.
-   */
cp = string;
wp = NULL;
while (isascii((unsigned char) *cp) &&
-   isalpha((unsigned char) *cp))
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == 
'+'))
++cp;
-   if (cp - string == 0)
-wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
-wp = _("time zone abbreviation has more than 3 alphabetics");
+wp = _("time zone abbreviation has more than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-wp = _("time zone abbreviation has too many alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' &&
-   *cp >= '0' && *cp <= '4')
-   ++cp;
-   }
+wp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
 wp = _("time zone abbreviation differs from POSIX standard");
if (wp != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309569 - in stable: 10/sys/dev/cxgbe 10/tools/tools/cxgbetool 11/sys/dev/cxgbe 11/tools/tools/cxgbetool

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:02:26 2016
New Revision: 309569
URL: https://svnweb.freebsd.org/changeset/base/309569

Log:
  MFC 306821,306823: Permit updating firmware config file in flash.
  
  306821:
  cxgbe(4): Add an ioctl to copy a firmware config file to the card's flash.
  
  306823:
  cxgbetool: Add a loadcfg subcommand to allow a user to upload a firmware
  configuration file to the card.

Modified:
  stable/11/sys/dev/cxgbe/t4_ioctl.h
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/tools/tools/cxgbetool/cxgbetool.8
  stable/11/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_ioctl.h
  stable/10/sys/dev/cxgbe/t4_main.c
  stable/10/tools/tools/cxgbetool/cxgbetool.8
  stable/10/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_ioctl.h
==
--- stable/11/sys/dev/cxgbe/t4_ioctl.h  Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/11/sys/dev/cxgbe/t4_ioctl.h  Mon Dec  5 23:02:26 2016
(r309569)
@@ -56,6 +56,7 @@ enum {
T4_SET_SCHED_QUEUE, /* set queue class */
T4_GET_TRACER,  /* get information about a tracer */
T4_SET_TRACER,  /* program a tracer */
+   T4_LOAD_CFG,/* copy a config file to card's flash */
 };
 
 struct t4_reg {
@@ -344,4 +345,5 @@ struct t4_tracer {
 struct t4_sched_queue)
 #define CHELSIO_T4_GET_TRACER  _IOWR('f', T4_GET_TRACER, struct t4_tracer)
 #define CHELSIO_T4_SET_TRACER  _IOW('f', T4_SET_TRACER, struct t4_tracer)
+#define CHELSIO_T4_LOAD_CFG_IOW('f', T4_LOAD_CFG, struct t4_data)
 #endif

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:02:26 2016
(r309569)
@@ -549,6 +549,7 @@ static int set_tcb_rpl(struct sge_iq *, 
 struct mbuf *);
 static int get_sge_context(struct adapter *, struct t4_sge_context *);
 static int load_fw(struct adapter *, struct t4_data *);
+static int load_cfg(struct adapter *, struct t4_data *);
 static int read_card_mem(struct adapter *, int, struct t4_mem_range *);
 static int read_i2c(struct adapter *, struct t4_i2c_data *);
 #ifdef TCP_OFFLOAD
@@ -8597,6 +8598,38 @@ done:
return (rc);
 }
 
+static int
+load_cfg(struct adapter *sc, struct t4_data *cfg)
+{
+   int rc;
+   uint8_t *cfg_data = NULL;
+
+   rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ldcf");
+   if (rc)
+   return (rc);
+
+   if (cfg->len == 0) {
+   /* clear */
+   rc = -t4_load_cfg(sc, NULL, 0);
+   goto done;
+   }
+
+   cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK);
+   if (cfg_data == NULL) {
+   rc = ENOMEM;
+   goto done;
+   }
+
+   rc = copyin(cfg->data, cfg_data, cfg->len);
+   if (rc == 0)
+   rc = -t4_load_cfg(sc, cfg_data, cfg->len);
+
+   free(cfg_data, M_CXGBE);
+done:
+   end_synchronized_op(sc, 0);
+   return (rc);
+}
+
 #define MAX_READ_BUF_SIZE (128 * 1024)
 static int
 read_card_mem(struct adapter *sc, int win, struct t4_mem_range *mr)
@@ -9154,6 +9187,9 @@ t4_ioctl(struct cdev *dev, unsigned long
case CHELSIO_T4_SET_TRACER:
rc = t4_set_tracer(sc, (struct t4_tracer *)data);
break;
+   case CHELSIO_T4_LOAD_CFG:
+   rc = load_cfg(sc, (struct t4_data *)data);
+   break;
default:
rc = ENOTTY;
}

Modified: stable/11/tools/tools/cxgbetool/cxgbetool.8
==
--- stable/11/tools/tools/cxgbetool/cxgbetool.8 Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/11/tools/tools/cxgbetool/cxgbetool.8 Mon Dec  5 23:02:26 2016
(r309569)
@@ -56,6 +56,10 @@
 .It
 .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
 .It
+.Nm Ar nexus Cm loadcfg Ar fw-config.txt
+.It
+.Nm Ar nexus Cm loadcfg clear
+.It
 .Nm Ar nexus Cm loadfw Ar fw-image.bin
 .It
 .Nm Ar nexus Cm memdump Ar addr len
@@ -353,6 +357,15 @@ Delete filter that is at the given index
 .It Cm filter Cm list
 List all filters programmed into the hardware.
 .It Cm i2c Ar port_id devaddr addr Op Ar len
+.It Cm loadcfg Ar fw-config.txt
+Install the firmware configuration file contained in
+.Ar fw-config.txt
+to the card.
+Set hw.cxgbe.config_file="flash" in loader.conf to get
+.Xr cxgbe 4
+to use the on-flash configuration.
+.It Cm loadcfg Cm clear
+Erase configuration file from the card.
 .It Cm loadfw Ar fw-image.bin
 Install the firmware contained in
 .Ar fw-image.bin

Modified: 

svn commit: r309569 - in stable: 10/sys/dev/cxgbe 10/tools/tools/cxgbetool 11/sys/dev/cxgbe 11/tools/tools/cxgbetool

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 23:02:26 2016
New Revision: 309569
URL: https://svnweb.freebsd.org/changeset/base/309569

Log:
  MFC 306821,306823: Permit updating firmware config file in flash.
  
  306821:
  cxgbe(4): Add an ioctl to copy a firmware config file to the card's flash.
  
  306823:
  cxgbetool: Add a loadcfg subcommand to allow a user to upload a firmware
  configuration file to the card.

Modified:
  stable/10/sys/dev/cxgbe/t4_ioctl.h
  stable/10/sys/dev/cxgbe/t4_main.c
  stable/10/tools/tools/cxgbetool/cxgbetool.8
  stable/10/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_ioctl.h
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/tools/tools/cxgbetool/cxgbetool.8
  stable/11/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_ioctl.h
==
--- stable/10/sys/dev/cxgbe/t4_ioctl.h  Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/10/sys/dev/cxgbe/t4_ioctl.h  Mon Dec  5 23:02:26 2016
(r309569)
@@ -56,6 +56,7 @@ enum {
T4_SET_SCHED_QUEUE, /* set queue class */
T4_GET_TRACER,  /* get information about a tracer */
T4_SET_TRACER,  /* program a tracer */
+   T4_LOAD_CFG,/* copy a config file to card's flash */
 };
 
 struct t4_reg {
@@ -344,4 +345,5 @@ struct t4_tracer {
 struct t4_sched_queue)
 #define CHELSIO_T4_GET_TRACER  _IOWR('f', T4_GET_TRACER, struct t4_tracer)
 #define CHELSIO_T4_SET_TRACER  _IOW('f', T4_SET_TRACER, struct t4_tracer)
+#define CHELSIO_T4_LOAD_CFG_IOW('f', T4_LOAD_CFG, struct t4_data)
 #endif

Modified: stable/10/sys/dev/cxgbe/t4_main.c
==
--- stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 23:02:26 2016
(r309569)
@@ -538,6 +538,7 @@ static int set_tcb_rpl(struct sge_iq *, 
 struct mbuf *);
 static int get_sge_context(struct adapter *, struct t4_sge_context *);
 static int load_fw(struct adapter *, struct t4_data *);
+static int load_cfg(struct adapter *, struct t4_data *);
 static int read_card_mem(struct adapter *, int, struct t4_mem_range *);
 static int read_i2c(struct adapter *, struct t4_i2c_data *);
 #ifdef TCP_OFFLOAD
@@ -8452,6 +8453,38 @@ done:
return (rc);
 }
 
+static int
+load_cfg(struct adapter *sc, struct t4_data *cfg)
+{
+   int rc;
+   uint8_t *cfg_data = NULL;
+
+   rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ldcf");
+   if (rc)
+   return (rc);
+
+   if (cfg->len == 0) {
+   /* clear */
+   rc = -t4_load_cfg(sc, NULL, 0);
+   goto done;
+   }
+
+   cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK);
+   if (cfg_data == NULL) {
+   rc = ENOMEM;
+   goto done;
+   }
+
+   rc = copyin(cfg->data, cfg_data, cfg->len);
+   if (rc == 0)
+   rc = -t4_load_cfg(sc, cfg_data, cfg->len);
+
+   free(cfg_data, M_CXGBE);
+done:
+   end_synchronized_op(sc, 0);
+   return (rc);
+}
+
 #define MAX_READ_BUF_SIZE (128 * 1024)
 static int
 read_card_mem(struct adapter *sc, int win, struct t4_mem_range *mr)
@@ -9009,6 +9042,9 @@ t4_ioctl(struct cdev *dev, unsigned long
case CHELSIO_T4_SET_TRACER:
rc = t4_set_tracer(sc, (struct t4_tracer *)data);
break;
+   case CHELSIO_T4_LOAD_CFG:
+   rc = load_cfg(sc, (struct t4_data *)data);
+   break;
default:
rc = ENOTTY;
}

Modified: stable/10/tools/tools/cxgbetool/cxgbetool.8
==
--- stable/10/tools/tools/cxgbetool/cxgbetool.8 Mon Dec  5 23:02:02 2016
(r309568)
+++ stable/10/tools/tools/cxgbetool/cxgbetool.8 Mon Dec  5 23:02:26 2016
(r309569)
@@ -56,6 +56,10 @@
 .It
 .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
 .It
+.Nm Ar nexus Cm loadcfg Ar fw-config.txt
+.It
+.Nm Ar nexus Cm loadcfg clear
+.It
 .Nm Ar nexus Cm loadfw Ar fw-image.bin
 .It
 .Nm Ar nexus Cm memdump Ar addr len
@@ -353,6 +357,15 @@ Delete filter that is at the given index
 .It Cm filter Cm list
 List all filters programmed into the hardware.
 .It Cm i2c Ar port_id devaddr addr Op Ar len
+.It Cm loadcfg Ar fw-config.txt
+Install the firmware configuration file contained in
+.Ar fw-config.txt
+to the card.
+Set hw.cxgbe.config_file="flash" in loader.conf to get
+.Xr cxgbe 4
+to use the on-flash configuration.
+.It Cm loadcfg Cm clear
+Erase configuration file from the card.
 .It Cm loadfw Ar fw-image.bin
 Install the firmware contained in
 .Ar fw-image.bin

Modified: 

svn commit: r309568 - releng/9.3/contrib/tzdata

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 23:02:02 2016
New Revision: 309568
URL: https://svnweb.freebsd.org/changeset/base/309568

Log:
  Update tzdata to 2016i.
  
  Note: because of what appears to be a missing MFC to stable branches,
  these patches were generated by doing:
  
   % rsync -av stable/9/contrib/tzdata releng/9.3/contrib/tzdata
   % svn add releng/9.3/contrib/tzdata
  
  Errata Notice:EN-16:19
  Submitted by: gjb
  Approved by:  so

Added:
  releng/9.3/contrib/tzdata/CONTRIBUTING
  releng/9.3/contrib/tzdata/LICENSE
  releng/9.3/contrib/tzdata/Makefile   (contents, props changed)
  releng/9.3/contrib/tzdata/NEWS
  releng/9.3/contrib/tzdata/README
  releng/9.3/contrib/tzdata/Theory
  releng/9.3/contrib/tzdata/backzone
  releng/9.3/contrib/tzdata/checklinks.awk   (contents, props changed)
  releng/9.3/contrib/tzdata/checktab.awk   (contents, props changed)
  releng/9.3/contrib/tzdata/leapseconds.awk   (contents, props changed)
  releng/9.3/contrib/tzdata/version
  releng/9.3/contrib/tzdata/zoneinfo2tdf.pl   (contents, props changed)
Modified:
  releng/9.3/contrib/tzdata/africa
  releng/9.3/contrib/tzdata/antarctica
  releng/9.3/contrib/tzdata/asia
  releng/9.3/contrib/tzdata/australasia
  releng/9.3/contrib/tzdata/backward
  releng/9.3/contrib/tzdata/etcetera
  releng/9.3/contrib/tzdata/europe
  releng/9.3/contrib/tzdata/factory
  releng/9.3/contrib/tzdata/leap-seconds.list
  releng/9.3/contrib/tzdata/leapseconds
  releng/9.3/contrib/tzdata/northamerica
  releng/9.3/contrib/tzdata/southamerica
  releng/9.3/contrib/tzdata/zone.tab
  releng/9.3/contrib/tzdata/zone1970.tab

Added: releng/9.3/contrib/tzdata/CONTRIBUTING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/9.3/contrib/tzdata/CONTRIBUTING  Mon Dec  5 23:02:02 2016
(r309568)
@@ -0,0 +1,73 @@
+Contributing to the tz code and data
+
+The time zone database is by no means authoritative: governments
+change timekeeping rules erratically and sometimes with little
+warning, the data entries do not cover all of civil time before
+1970, and undoubtedly errors remain in the code and data.  Feel
+free to fill gaps or fix mistakes, and please email improvements
+to t...@iana.org for use in the future.
+
+To email small changes, please run a POSIX shell command like
+'diff -u old/europe new/europe >myfix.patch', and attach
+myfix.patch to the email.
+
+For more-elaborate changes, please read the Theory file and browse
+the mailing list archives  for
+examples of patches that tend to work well.  Ideally, additions to
+data should contain commentary citing reliable sources as
+justification.
+
+Please submit changes against either the latest release in
+ or the master branch of the experimental
+Git repository.  If you use Git the following workflow may be helpful:
+
+  * Copy the experimental repository.
+
+  git clone https://github.com/eggert/tz.git
+  cd tz
+
+  * Get current with the master branch.
+
+  git checkout master
+  git pull
+
+  * Switch to a new branch for the changes.  Choose a different
+branch name for each change set.
+
+  git checkout -b mybranch
+
+  * Edit source files.  Include commentary that justifies the
+changes by citing reliable sources.
+
+  * Debug the changes, e.g.:
+
+  make check
+  make install
+  ./zdump -v America/Los_Angeles
+
+  * For each separable change, commit it in the new branch, e.g.:
+
+  git add northamerica
+  git commit
+
+See recent 'git log' output for the commit-message style.
+
+  * Create patch files 0001-*, 0002-*, ...
+
+  git format-patch master
+
+  * After reviewing the patch files, send the patches to t...@iana.org
+for others to review.
+
+  git send-email master
+
+  * Start anew by getting current with the master branch again
+(the second step above).
+
+Please do not create issues or pull requests on GitHub, as the
+proper procedure for proposing and distributing patches is via
+email as illustrated above.
+
+-
+
+This file is in the public domain.

Added: releng/9.3/contrib/tzdata/LICENSE
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/9.3/contrib/tzdata/LICENSE   Mon Dec  5 23:02:02 2016
(r309568)
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.

Added: releng/9.3/contrib/tzdata/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ releng/9.3/contrib/tzdata/Makefile  Mon Dec  5 23:02:02 2016

svn commit: r309567 - releng/9.3/contrib/tzcode/zic

2016-12-05 Thread Gleb Smirnoff
Author: glebius
Date: Mon Dec  5 22:43:24 2016
New Revision: 309567
URL: https://svnweb.freebsd.org/changeset/base/309567

Log:
  Merge r307360 from stable/9:
  
Incorporate a change from OpenBSD by mill...@openbsd.org
  
Don't warn about valid time zone abbreviations.  POSIX
through 2000 says that an abbreviation cannot start with ':', and
cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
on changes this rule to say that an abbreviation can contain only
'-', '+', and alphanumeric characters from the portable character
set in the current locale.  To be portable to both sets of rules,
an abbreviation must therefore use only ASCII letters."  Adapted
from tzcode2015f.
  
  Errata Notice:EN-16:19.tzcode
  Approved by:  so

Modified:
  releng/9.3/contrib/tzcode/zic/zdump.c
  releng/9.3/contrib/tzcode/zic/zic.c
Directory Properties:
  releng/9.3/   (props changed)
  releng/9.3/contrib/tzcode/   (props changed)

Modified: releng/9.3/contrib/tzcode/zic/zdump.c
==
--- releng/9.3/contrib/tzcode/zic/zdump.c   Mon Dec  5 22:36:25 2016
(r309566)
+++ releng/9.3/contrib/tzcode/zic/zdump.c   Mon Dec  5 22:43:24 2016
(r309567)
@@ -212,24 +212,16 @@ const char * constzone;
return;
cp = abbrp;
wp = NULL;
-   while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
+   while (isascii((unsigned char) *cp) &&
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == '+'))
++cp;
-   if (cp - abbrp == 0)
-   wp = _("lacks alphabetic at start");
-   else if (cp - abbrp < 3)
-   wp = _("has fewer than 3 alphabetics");
+   if (cp - abbrp < 3)
+   wp = _("has fewer than 3 characters");
else if (cp - abbrp > 6)
-   wp = _("has more than 6 alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-   ++cp;
-   if (*cp != '\0')
-   wp = _("differs from POSIX standard");
-   }
-   if (wp == NULL)
+   wp = _("has more than 6 characters");
+   else if (*cp)
+   wp = "has characters other than ASCII alphanumerics, '-' or 
'+'";
+   else
return;
(void) fflush(stdout);
(void) fprintf(stderr,

Modified: releng/9.3/contrib/tzcode/zic/zic.c
==
--- releng/9.3/contrib/tzcode/zic/zic.c Mon Dec  5 22:36:25 2016
(r309566)
+++ releng/9.3/contrib/tzcode/zic/zic.c Mon Dec  5 22:43:24 2016
(r309567)
@@ -2615,29 +2615,15 @@ const char * const  string;
register const char *   cp;
register char * wp;
 
-   /*
-   ** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
-   ** optionally followed by a + or - and a number from 1 to 14.
-   */
cp = string;
wp = NULL;
while (isascii((unsigned char) *cp) &&
-   isalpha((unsigned char) *cp))
+   (isalnum((unsigned char)*cp) || *cp == '-' || *cp == 
'+'))
++cp;
-   if (cp - string == 0)
-wp = _("time zone abbreviation lacks alphabetic at start");
if (noise && cp - string > 3)
-wp = _("time zone abbreviation has more than 3 alphabetics");
+wp = _("time zone abbreviation has more than 3 characters");
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
-wp = _("time zone abbreviation has too many alphabetics");
-   if (wp == NULL && (*cp == '+' || *cp == '-')) {
-   ++cp;
-   if (isascii((unsigned char) *cp) &&
-   isdigit((unsigned char) *cp))
-   if (*cp++ == '1' &&
-   *cp >= '0' && *cp <= '4')
-   ++cp;
-   }
+wp = _("time zone abbreviation has too many characters");
if (*cp != '\0')
 wp = _("time zone abbreviation differs from POSIX standard");
if (wp != NULL) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309566 - head/sys/fs/nfsserver

2016-12-05 Thread Rick Macklem
Author: rmacklem
Date: Mon Dec  5 22:36:25 2016
New Revision: 309566
URL: https://svnweb.freebsd.org/changeset/base/309566

Log:
  Fix the NFSv4.1 server for Open reclaim after a reboot.
  
  The NFSv4.1 server failed to update the nfs-stablerestart file for
  a client when the client was issued its first Open. As such, recovery
  of Opens after a server reboot failed with NFSERR_NOGRACE.
  This patch fixes this.
  It also changes the code so that it malloc()'s the 1024 byte array
  instead of allocating it on the kernel stack for both NFSv4.0 and NFSv4.1.
  Note that this bug only affected NFSv4.1 and only when clients attempted
  to reclaim Opens after a server reboot.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Mon Dec  5 22:26:48 2016
(r309565)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Mon Dec  5 22:36:25 2016
(r309566)
@@ -2501,6 +2501,8 @@ nfsrv_openctrl(struct nfsrv_descript *nd
struct nfsclient *clp;
int error = 0, haslock = 0, ret, delegate = 1, writedeleg = 1;
int readonly = 0, cbret = 1, getfhret = 0;
+   int gotstate = 0, len = 0;
+   u_char *clidp = NULL;
 
if ((new_stp->ls_flags & NFSLCK_SHAREBITS) == NFSLCK_READACCESS)
readonly = 1;
@@ -2519,6 +2521,7 @@ nfsrv_openctrl(struct nfsrv_descript *nd
goto out;
}
 
+   clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK);
 tryagain:
MALLOC(new_lfp, struct nfslockfile *, sizeof (struct nfslockfile),
M_NFSDLOCKFILE, M_WAITOK);
@@ -3181,6 +3184,16 @@ tryagain:
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
+   /*
+* Since NFSv4.1 never does an OpenConfirm, the first
+* open state will be acquired here.
+*/
+   if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) {
+   clp->lc_flags |= LCL_STAMPEDSTABLE;
+   len = clp->lc_idlen;
+   NFSBCOPY(clp->lc_id, clidp, len);
+   gotstate = 1;
+   }
} else {
*rflagsp |= NFSV4OPEN_RESULTCONFIRM;
new_stp->ls_flags = NFSLCK_NEEDSCONFIRM;
@@ -3217,7 +3230,17 @@ tryagain:
if (new_deleg)
FREE((caddr_t)new_deleg, M_NFSDSTATE);
 
+   /*
+* If the NFSv4.1 client just acquired its first open, write a timestamp
+* to the stable storage file.
+*/
+   if (gotstate != 0) {
+   nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p);
+   nfsrv_backupstable();
+   }
+
 out:
+   free(clidp, M_TEMP);
NFSEXITCODE2(error, nd);
return (error);
 }
@@ -3234,7 +3257,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss
struct nfslockfile *lfp;
u_int32_t bits;
int error = 0, gotstate = 0, len = 0;
-   u_char client[NFSV4_OPAQUELIMIT];
+   u_char *clidp = NULL;
 
/*
 * Check for restart conditions (client and server).
@@ -3244,6 +3267,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss
if (error)
goto out;
 
+   clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK);
NFSLOCKSTATE();
/*
 * Get the open structure via clientid and stateid.
@@ -3322,7 +3346,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss
if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) {
clp->lc_flags |= LCL_STAMPEDSTABLE;
len = clp->lc_idlen;
-   NFSBCOPY(clp->lc_id, client, len);
+   NFSBCOPY(clp->lc_id, clidp, len);
gotstate = 1;
}
NFSUNLOCKSTATE();
@@ -3369,11 +3393,12 @@ nfsrv_openupdate(vnode_t vp, struct nfss
 * to the stable storage file.
 */
if (gotstate != 0) {
-   nfsrv_writestable(client, len, NFSNST_NEWSTATE, p);
+   nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p);
nfsrv_backupstable();
}
 
 out:
+   free(clidp, M_TEMP);
NFSEXITCODE2(error, nd);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309564 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 22:13:09 2016
New Revision: 309564
URL: https://svnweb.freebsd.org/changeset/base/309564

Log:
  MFC 306277:
  cxgbe(4): Make the location/length of all descriptor rings available in
  the sysctl MIB.

Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_sge.c
==
--- stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 21:52:10 2016
(r309563)
+++ stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 22:13:09 2016
(r309564)
@@ -176,8 +176,8 @@ static int free_ring(struct adapter *, b
 static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *,
 int, int);
 static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *);
-static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *,
-struct sge_fl *);
+static void add_fl_sysctls(struct adapter *, struct sysctl_ctx_list *,
+struct sysctl_oid *, struct sge_fl *);
 static int alloc_fwq(struct adapter *);
 static int free_fwq(struct adapter *);
 static int alloc_mgmtq(struct adapter *);
@@ -2869,8 +2869,8 @@ free_iq_fl(struct vi_info *vi, struct sg
 }
 
 static void
-add_fl_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid,
-struct sge_fl *fl)
+add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx,
+struct sysctl_oid *oid, struct sge_fl *fl)
 {
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
 
@@ -2878,6 +2878,11 @@ add_fl_sysctls(struct sysctl_ctx_list *c
"freelist");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   fl->sidx * EQ_ESIZE + sc->params.sge.spg_len,
+   "desc ring size in bytes");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id",
CTLTYPE_INT | CTLFLAG_RD, >cntxt_id, 0, sysctl_uint16, "I",
"SGE context id of the freelist");
@@ -2933,6 +2938,10 @@ alloc_fwq(struct adapter *sc)
NULL, "firmware event queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   fwq->qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, >abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3044,6 +3053,10 @@ alloc_rxq(struct vi_info *vi, struct sge
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >iq.ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, >iq.abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3065,7 +3078,7 @@ alloc_rxq(struct vi_info *vi, struct sge
CTLFLAG_RD, >vlan_extraction,
"# of times hardware extracted 802.1Q tag");
 
-   add_fl_sysctls(>ctx, oid, >fl);
+   add_fl_sysctls(sc, >ctx, oid, >fl);
 
return (rc);
 }
@@ -3094,12 +3107,13 @@ static int
 alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq,
 int intr_idx, int idx, struct sysctl_oid *oid)
 {
+   struct port_info *pi = vi->pi;
int rc;
struct sysctl_oid_list *children;
char name[16];
 
rc = alloc_iq_fl(vi, _rxq->iq, _rxq->fl, intr_idx,
-   vi->pi->rx_chan_map);
+   pi->rx_chan_map);
if (rc != 0)
return (rc);
 
@@ -3110,6 +3124,10 @@ alloc_ofld_rxq(struct vi_info *vi, struc
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   _rxq->iq.ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   ofld_rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, _rxq->iq.abs_id, 0, sysctl_uint16,
"I", "absolute id of the queue");
@@ -3120,7 +3138,7 @@ alloc_ofld_rxq(struct vi_info *vi, struc
CTLTYPE_INT | CTLFLAG_RD, _rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
 
-   add_fl_sysctls(>ctx, oid, 

svn commit: r309564 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 22:13:09 2016
New Revision: 309564
URL: https://svnweb.freebsd.org/changeset/base/309564

Log:
  MFC 306277:
  cxgbe(4): Make the location/length of all descriptor rings available in
  the sysctl MIB.

Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 21:52:10 2016
(r309563)
+++ stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 22:13:09 2016
(r309564)
@@ -177,8 +177,8 @@ static int free_ring(struct adapter *, b
 static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *,
 int, int);
 static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *);
-static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *,
-struct sge_fl *);
+static void add_fl_sysctls(struct adapter *, struct sysctl_ctx_list *,
+struct sysctl_oid *, struct sge_fl *);
 static int alloc_fwq(struct adapter *);
 static int free_fwq(struct adapter *);
 static int alloc_mgmtq(struct adapter *);
@@ -2869,8 +2869,8 @@ free_iq_fl(struct vi_info *vi, struct sg
 }
 
 static void
-add_fl_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid,
-struct sge_fl *fl)
+add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx,
+struct sysctl_oid *oid, struct sge_fl *fl)
 {
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
 
@@ -2878,6 +2878,11 @@ add_fl_sysctls(struct sysctl_ctx_list *c
"freelist");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   fl->sidx * EQ_ESIZE + sc->params.sge.spg_len,
+   "desc ring size in bytes");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id",
CTLTYPE_INT | CTLFLAG_RD, >cntxt_id, 0, sysctl_uint16, "I",
"SGE context id of the freelist");
@@ -2933,6 +2938,10 @@ alloc_fwq(struct adapter *sc)
NULL, "firmware event queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   fwq->qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, >abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3044,6 +3053,10 @@ alloc_rxq(struct vi_info *vi, struct sge
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   >iq.ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, >iq.abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
@@ -3065,7 +3078,7 @@ alloc_rxq(struct vi_info *vi, struct sge
CTLFLAG_RD, >vlan_extraction,
"# of times hardware extracted 802.1Q tag");
 
-   add_fl_sysctls(>ctx, oid, >fl);
+   add_fl_sysctls(sc, >ctx, oid, >fl);
 
return (rc);
 }
@@ -3094,12 +3107,13 @@ static int
 alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq,
 int intr_idx, int idx, struct sysctl_oid *oid)
 {
+   struct port_info *pi = vi->pi;
int rc;
struct sysctl_oid_list *children;
char name[16];
 
rc = alloc_iq_fl(vi, _rxq->iq, _rxq->fl, intr_idx,
-   vi->pi->rx_chan_map);
+   pi->rx_chan_map);
if (rc != 0)
return (rc);
 
@@ -3110,6 +3124,10 @@ alloc_ofld_rxq(struct vi_info *vi, struc
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
 
+   SYSCTL_ADD_UAUTO(>ctx, children, OID_AUTO, "ba", CTLFLAG_RD,
+   _rxq->iq.ba, "bus address of descriptor ring");
+   SYSCTL_ADD_INT(>ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL,
+   ofld_rxq->iq.qsize * IQ_ESIZE, "descriptor ring size in bytes");
SYSCTL_ADD_PROC(>ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, _rxq->iq.abs_id, 0, sysctl_uint16,
"I", "absolute id of the queue");
@@ -3120,7 +3138,7 @@ alloc_ofld_rxq(struct vi_info *vi, struc
CTLTYPE_INT | CTLFLAG_RD, _rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
 
-   add_fl_sysctls(>ctx, oid, 

svn commit: r309563 - head/sys/netpfil/pf

2016-12-05 Thread Kristof Provost
Author: kp
Date: Mon Dec  5 21:52:10 2016
New Revision: 309563
URL: https://svnweb.freebsd.org/changeset/base/309563

Log:
  pflog: Correctly initialise subrulenr
  
  subrulenr is considered unset if it's set to -1, not if it's set to 1.
  See contrib/tcpdump/print-pflog.c pflog_print() for a user.
  
  This caused incorrect pflog output (tcpdump -n -e -ttt -i pflog0):
rule 0..16777216(match)
  instead of the correct output of
rule 0/0(match)
  
  PR:   214832
  Submitted by: andywh...@gmail.com

Modified:
  head/sys/netpfil/pf/if_pflog.c

Modified: head/sys/netpfil/pf/if_pflog.c
==
--- head/sys/netpfil/pf/if_pflog.c  Mon Dec  5 21:24:38 2016
(r309562)
+++ head/sys/netpfil/pf/if_pflog.c  Mon Dec  5 21:52:10 2016
(r309563)
@@ -221,7 +221,7 @@ pflog_packet(struct pfi_kif *kif, struct
 
if (am == NULL) {
hdr.rulenr = htonl(rm->nr);
-   hdr.subrulenr =  1;
+   hdr.subrulenr = -1;
} else {
hdr.rulenr = htonl(am->nr);
hdr.subrulenr = htonl(rm->nr);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308371 - in stable/10: share/man/man4 sys/conf sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts

2016-12-05 Thread John Baldwin
On Sunday, November 06, 2016 01:56:34 PM Andriy Gapon wrote:
> Author: avg
> Date: Sun Nov  6 13:56:34 2016
> New Revision: 308371
> URL: https://svnweb.freebsd.org/changeset/base/308371
> 
> Log:
>   MFC r307768: jedec_ts: a driver for thermal sensors on memory modules
> 
> Added:
>   stable/10/share/man/man4/jedec_ts.4
>  - copied unchanged from r307768, head/share/man/man4/jedec_ts.4
>   stable/10/sys/dev/jedec_ts/
>  - copied from r307768, head/sys/dev/jedec_ts/
>   stable/10/sys/modules/i2c/jedec_ts/
>  - copied from r307768, head/sys/modules/i2c/jedec_ts/
> Modified:
>   stable/10/sys/conf/NOTES
>   stable/10/sys/conf/files
>   stable/10/sys/modules/i2c/Makefile
> Directory Properties:
>   stable/10/   (props changed)

FYI, this doesn't work and has broken tinderbox builds on stable/10.
smbus_get_addr() doesn't exist on 10.  It was originally a hand-rolled
ivar wrapper that was removed in r93023 in 2002.  The function prototype
was not removed, so the compile works, but linking fails.  The stale
prototype is still present in smbconf.h in HEAD (and should be removed).
The "real" smbus_get_addr() was added back to smbconf.h along with an
implementation of smbus_read_ivar() in r281985.  Parts of that commit
probably need to be MFC'd to 10.

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


svn commit: r309562 - vendor/byacc/20161202

2016-12-05 Thread Jung-uk Kim
Author: jkim
Date: Mon Dec  5 21:24:38 2016
New Revision: 309562
URL: https://svnweb.freebsd.org/changeset/base/309562

Log:
  Tag byacc 20161202.

Added:
  vendor/byacc/20161202/
 - copied from r309561, vendor/byacc/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309561 - in vendor/byacc/dist: . package package/debian package/pkgsrc test/btyacc

2016-12-05 Thread Jung-uk Kim
Author: jkim
Date: Mon Dec  5 21:23:44 2016
New Revision: 309561
URL: https://svnweb.freebsd.org/changeset/base/309561

Log:
  Import byacc 20161202.

Modified:
  vendor/byacc/dist/CHANGES
  vendor/byacc/dist/MANIFEST
  vendor/byacc/dist/VERSION
  vendor/byacc/dist/aclocal.m4
  vendor/byacc/dist/btyaccpar.c
  vendor/byacc/dist/btyaccpar.skel
  vendor/byacc/dist/config.guess
  vendor/byacc/dist/config.sub
  vendor/byacc/dist/configure
  vendor/byacc/dist/defs.h
  vendor/byacc/dist/error.c
  vendor/byacc/dist/main.c
  vendor/byacc/dist/mstring.c
  vendor/byacc/dist/output.c
  vendor/byacc/dist/package/byacc.spec
  vendor/byacc/dist/package/debian/changelog
  vendor/byacc/dist/package/mingw-byacc.spec
  vendor/byacc/dist/package/pkgsrc/Makefile
  vendor/byacc/dist/reader.c
  vendor/byacc/dist/test/btyacc/btyacc_calc1.tab.c
  vendor/byacc/dist/test/btyacc/btyacc_demo.tab.c
  vendor/byacc/dist/test/btyacc/btyacc_demo.tab.h
  vendor/byacc/dist/test/btyacc/btyacc_destroy1.tab.c
  vendor/byacc/dist/test/btyacc/btyacc_destroy2.tab.c
  vendor/byacc/dist/test/btyacc/btyacc_destroy3.tab.c
  vendor/byacc/dist/test/btyacc/calc.tab.c
  vendor/byacc/dist/test/btyacc/calc1.tab.c
  vendor/byacc/dist/test/btyacc/calc2.tab.c
  vendor/byacc/dist/test/btyacc/calc3.tab.c
  vendor/byacc/dist/test/btyacc/code_calc.code.c
  vendor/byacc/dist/test/btyacc/code_calc.tab.c
  vendor/byacc/dist/test/btyacc/code_error.code.c
  vendor/byacc/dist/test/btyacc/code_error.tab.c
  vendor/byacc/dist/test/btyacc/empty.tab.c
  vendor/byacc/dist/test/btyacc/err_inherit3.tab.c
  vendor/byacc/dist/test/btyacc/err_inherit4.tab.c
  vendor/byacc/dist/test/btyacc/err_inherit4.tab.h
  vendor/byacc/dist/test/btyacc/err_syntax10.tab.c
  vendor/byacc/dist/test/btyacc/err_syntax11.tab.c
  vendor/byacc/dist/test/btyacc/err_syntax12.tab.c
  vendor/byacc/dist/test/btyacc/err_syntax18.tab.c
  vendor/byacc/dist/test/btyacc/err_syntax20.tab.c
  vendor/byacc/dist/test/btyacc/error.tab.c
  vendor/byacc/dist/test/btyacc/grammar.tab.c
  vendor/byacc/dist/test/btyacc/inherit0.tab.c
  vendor/byacc/dist/test/btyacc/inherit1.tab.c
  vendor/byacc/dist/test/btyacc/inherit2.tab.c
  vendor/byacc/dist/test/btyacc/ok_syntax1.tab.c
  vendor/byacc/dist/test/btyacc/pure_calc.tab.c
  vendor/byacc/dist/test/btyacc/pure_error.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc-s.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc2-s.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc2.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc3-s.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc3.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc4-s.tab.c
  vendor/byacc/dist/test/btyacc/quote_calc4.tab.c
  vendor/byacc/dist/test/btyacc/rename_debug.c
  vendor/byacc/dist/test/btyacc/varsyntax_calc1.tab.c
  vendor/byacc/dist/yaccpar.c
  vendor/byacc/dist/yaccpar.skel

Modified: vendor/byacc/dist/CHANGES
==
--- vendor/byacc/dist/CHANGES   Mon Dec  5 20:43:25 2016(r309560)
+++ vendor/byacc/dist/CHANGES   Mon Dec  5 21:23:44 2016(r309561)
@@ -1,4 +1,123 @@
-2016-06-06  Thomas E. Dickey  
+2016-12-02  Thomas E. Dickey  
+
+   * test/btyacc/quote_calc4-s.tab.c, test/btyacc/varsyntax_calc1.tab.c, 
test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, 
test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, 
test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, 
test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, 
test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, 
test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, 
test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4.tab.c, 
test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, 
test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, 
test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, 
test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, 
test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, 
test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, 
test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c, 
test/btyacc/btyacc_calc1.tab.c, test/btyacc
 /btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, 
test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, 
btyaccpar.c:
+   regen
+
+   * btyaccpar.skel: changes from NetBSD
+   + use YYINT rather than short in btyaccpar.skel
+ (some of this had already been done by Tom Shields)
+   + remove some casts of malloc/realloc
+
+   * yaccpar.c, yaccpar.skel, output.c: changes from NetBSD
+   - Add some more bison stuff to make the mesa/gallium parser work:
+   %initial-action (add missing source struct member in location)
+   %debug (unimplemented)
+   %error-verbose (unimplemented)
+
+   This changes some existing code:
+  

svn commit: r309560 - in stable: 10/sys/conf 10/sys/dev/cxgbe 10/sys/dev/cxgbe/common 10/sys/dev/cxgbe/firmware 10/sys/dev/cxgbe/tom 10/sys/modules/cxgbe 10/sys/modules/cxgbe/if_cc 10/sys/modules/c...

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 20:43:25 2016
New Revision: 309560
URL: https://svnweb.freebsd.org/changeset/base/309560

Log:
  MFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
  305908,306062,306063,306137,306138,306206,306216,306273,306295,306301,
  306465,309302:
  Add support for adapters using the Terminator T6 ASIC.
  
  305695:
  cxgbe(4): Set up fl_starve_threshold2 accurately for T6.
  
  305696:
  cxgbe(4): Use correct macro for header length with T6 ASICs.  This
  affects the transmit of the VF driver only.
  
  305699:
  cxgbe(4): Update the pad_boundary calculation for T6, which has a
  different range of boundaries.
  
  305702:
  cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.
  
  305703:
  cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.
  
  305713:
  cxgbe(4): Add support for additional port types and link speeds.
  
  305715:
  cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
  of the capabilities of the crypto engine in T6.
  
  305827:
  cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
  to use in tx work requests.
  
  305852:
  cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
  come up as 't6nex' nexus devices with 'cc' ports hanging off them.
  
  The T6 firmware and configuration files will be added as soon as they
  are released.  For now the driver will try to work with whatever
  firmware and configuration is on the card's flash.
  
  305906:
  cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.
  
  305908:
  cxgbe/t4_tom: Update the active/passive open code to support T6.  Data
  path works as-is.
  
  306062:
  cxgbe(4): Show wcwr_stats for T6 cards.
  
  306063:
  cxgbe(4): Setup congestion response for T6 rx queues.
  
  306137:
  cxgbetool: Add T6 support to the SGE context decoder.
  
  306138:
  Fix typo.
  
  306206:
  cxgbe(4): Catch up with the different layout of WHOAMI in T6.
  
  Note that the code moved below t4_prep_adapter() as part of this change
  because now it needs a working chip_id().
  
  306216:
  cxgbe(4): Fix the output of the "tids" sysctl on T6.
  
  306273:
  cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
  message inside a FW_MSG.  The base NIC already deals with updates in
  either form.
  
  306295:
  cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
  for 25Gbps and 100Gbps ports.   This should have been part of r305713,
  which is when the driver first started reporting extended media types.
  
  306301:
  cxgbe(4): Use the port's top speed to figure out whether it is "high
  speed" or not (for the purpose of calculating the number of queues etc.)
  This does the right thing for 25Gbps and 100Gbps ports.
  
  306465:
  cxgbe(4): Claim the T6 -DBG card.
  
  309302:
  cxgbe(4): Include firmware for T6 cards in the driver.  Update all
  firmwares to 1.16.12.0.
  
  Sponsored by: Chelsio Communications

Added:
  stable/10/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu
  stable/10/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu
  stable/10/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu
  stable/10/sys/dev/cxgbe/firmware/t6fw_cfg.txt
 - copied unchanged from r309302, head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  stable/10/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt
  stable/10/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
  stable/10/sys/dev/cxgbe/if_cc.c
 - copied unchanged from r305852, head/sys/dev/cxgbe/if_cc.c
  stable/10/sys/dev/cxgbe/if_ccv.c
 - copied unchanged from r305852, head/sys/dev/cxgbe/if_ccv.c
  stable/10/sys/modules/cxgbe/if_cc/
 - copied from r305852, head/sys/modules/cxgbe/if_cc/
  stable/10/sys/modules/cxgbe/if_ccv/
 - copied from r305852, head/sys/modules/cxgbe/if_ccv/
  stable/10/sys/modules/cxgbe/t6_firmware/
 - copied from r309302, head/sys/modules/cxgbe/t6_firmware/
Deleted:
  stable/10/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu
  stable/10/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu
Modified:
  stable/10/sys/conf/files
  stable/10/sys/dev/cxgbe/adapter.h
  stable/10/sys/dev/cxgbe/common/common.h
  stable/10/sys/dev/cxgbe/common/t4_hw.c
  stable/10/sys/dev/cxgbe/common/t4vf_hw.c
  stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h
  stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt
  stable/10/sys/dev/cxgbe/t4_main.c
  stable/10/sys/dev/cxgbe/t4_netmap.c
  stable/10/sys/dev/cxgbe/t4_sge.c
  stable/10/sys/dev/cxgbe/t4_tracer.c
  stable/10/sys/dev/cxgbe/t4_vf.c
  

svn commit: r309560 - in stable: 10/sys/conf 10/sys/dev/cxgbe 10/sys/dev/cxgbe/common 10/sys/dev/cxgbe/firmware 10/sys/dev/cxgbe/tom 10/sys/modules/cxgbe 10/sys/modules/cxgbe/if_cc 10/sys/modules/c...

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 20:43:25 2016
New Revision: 309560
URL: https://svnweb.freebsd.org/changeset/base/309560

Log:
  MFC 305695,305696,305699,305702,305703,305713,305715,305827,305852,305906,
  305908,306062,306063,306137,306138,306206,306216,306273,306295,306301,
  306465,309302:
  Add support for adapters using the Terminator T6 ASIC.
  
  305695:
  cxgbe(4): Set up fl_starve_threshold2 accurately for T6.
  
  305696:
  cxgbe(4): Use correct macro for header length with T6 ASICs.  This
  affects the transmit of the VF driver only.
  
  305699:
  cxgbe(4): Update the pad_boundary calculation for T6, which has a
  different range of boundaries.
  
  305702:
  cxgbe(4): Use smaller min/max bursts for fl descriptors with a T6.
  
  305703:
  cxgbe(4): Deal with the slightly different SGE_STAT_CFG in T6.
  
  305713:
  cxgbe(4): Add support for additional port types and link speeds.
  
  305715:
  cxgbe(4): Catch up with the rename of tlscaps -> cryptocaps.  TLS is one
  of the capabilities of the crypto engine in T6.
  
  305827:
  cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
  to use in tx work requests.
  
  305852:
  cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
  come up as 't6nex' nexus devices with 'cc' ports hanging off them.
  
  The T6 firmware and configuration files will be added as soon as they
  are released.  For now the driver will try to work with whatever
  firmware and configuration is on the card's flash.
  
  305906:
  cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.
  
  305908:
  cxgbe/t4_tom: Update the active/passive open code to support T6.  Data
  path works as-is.
  
  306062:
  cxgbe(4): Show wcwr_stats for T6 cards.
  
  306063:
  cxgbe(4): Setup congestion response for T6 rx queues.
  
  306137:
  cxgbetool: Add T6 support to the SGE context decoder.
  
  306138:
  Fix typo.
  
  306206:
  cxgbe(4): Catch up with the different layout of WHOAMI in T6.
  
  Note that the code moved below t4_prep_adapter() as part of this change
  because now it needs a working chip_id().
  
  306216:
  cxgbe(4): Fix the output of the "tids" sysctl on T6.
  
  306273:
  cxgbe(4): Fix netmap with T6, which doesn't encapsulate SGE_EGR_UPDATE
  message inside a FW_MSG.  The base NIC already deals with updates in
  either form.
  
  306295:
  cxgbe(4): Support SIOGIFXMEDIA so that ifconfig displays correct media
  for 25Gbps and 100Gbps ports.   This should have been part of r305713,
  which is when the driver first started reporting extended media types.
  
  306301:
  cxgbe(4): Use the port's top speed to figure out whether it is "high
  speed" or not (for the purpose of calculating the number of queues etc.)
  This does the right thing for 25Gbps and 100Gbps ports.
  
  306465:
  cxgbe(4): Claim the T6 -DBG card.
  
  309302:
  cxgbe(4): Include firmware for T6 cards in the driver.  Update all
  firmwares to 1.16.12.0.
  
  Sponsored by: Chelsio Communications

Added:
  stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu
  stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu
  stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu
  stable/11/sys/dev/cxgbe/firmware/t6fw_cfg.txt
 - copied unchanged from r309302, head/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt
  stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
 - copied unchanged from r309302, 
head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt
  stable/11/sys/dev/cxgbe/if_cc.c
 - copied unchanged from r305852, head/sys/dev/cxgbe/if_cc.c
  stable/11/sys/dev/cxgbe/if_ccv.c
 - copied unchanged from r305852, head/sys/dev/cxgbe/if_ccv.c
  stable/11/sys/modules/cxgbe/if_cc/
 - copied from r305852, head/sys/modules/cxgbe/if_cc/
  stable/11/sys/modules/cxgbe/if_ccv/
 - copied from r305852, head/sys/modules/cxgbe/if_ccv/
  stable/11/sys/modules/cxgbe/t6_firmware/
 - copied from r309302, head/sys/modules/cxgbe/t6_firmware/
Deleted:
  stable/11/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu
  stable/11/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu
Modified:
  stable/11/sys/conf/files
  stable/11/sys/dev/cxgbe/adapter.h
  stable/11/sys/dev/cxgbe/common/common.h
  stable/11/sys/dev/cxgbe/common/t4_hw.c
  stable/11/sys/dev/cxgbe/common/t4vf_hw.c
  stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h
  stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt
  stable/11/sys/dev/cxgbe/t4_iov.c
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_netmap.c
  stable/11/sys/dev/cxgbe/t4_sge.c
  stable/11/sys/dev/cxgbe/t4_tracer.c
  

svn commit: r309559 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:37:15 2016
New Revision: 309559
URL: https://svnweb.freebsd.org/changeset/base/309559

Log:
  MFC 305667:
  cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
  Port softc's are not initialized when the adapter is in recovery mode.

Modified:
  stable/10/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_main.c
==
--- stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 19:34:52 2016
(r309558)
+++ stable/10/sys/dev/cxgbe/t4_main.c   Mon Dec  5 19:37:15 2016
(r309559)
@@ -8726,6 +8726,8 @@ t4_ioctl(struct cdev *dev, unsigned long
if (port_id >= sc->params.nports)
return (EINVAL);
pi = sc->port[port_id];
+   if (pi == NULL)
+   return (EIO);
 
/* MAC stats */
t4_clr_port_stats(sc, pi->tx_chan);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309559 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:37:15 2016
New Revision: 309559
URL: https://svnweb.freebsd.org/changeset/base/309559

Log:
  MFC 305667:
  cxgbe(4): Avoid a NULL dereference in the clearstats ioctl handler.
  Port softc's are not initialized when the adapter is in recovery mode.

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 19:34:52 2016
(r309558)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Mon Dec  5 19:37:15 2016
(r309559)
@@ -8868,6 +8868,8 @@ t4_ioctl(struct cdev *dev, unsigned long
if (port_id >= sc->params.nports)
return (EINVAL);
pi = sc->port[port_id];
+   if (pi == NULL)
+   return (EIO);
 
/* MAC stats */
t4_clr_port_stats(sc, pi->tx_chan);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309558 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:34:52 2016
New Revision: 309558
URL: https://svnweb.freebsd.org/changeset/base/309558

Log:
  MFC 305652: cxgbe(4): Do not prescreen frames before attempting LRO.

Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 19:32:06 2016
(r309557)
+++ stable/11/sys/dev/cxgbe/t4_sge.cMon Dec  5 19:34:52 2016
(r309558)
@@ -1821,8 +1821,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
}
 
 #if defined(INET) || defined(INET6)
-   if (cpl->l2info & htobe32(F_RXF_LRO) &&
-   iq->flags & IQ_LRO_ENABLED &&
+   if (iq->flags & IQ_LRO_ENABLED &&
tcp_lro_rx(lro, m0, 0) == 0) {
/* queued for LRO */
} else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309558 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:34:52 2016
New Revision: 309558
URL: https://svnweb.freebsd.org/changeset/base/309558

Log:
  MFC 305652: cxgbe(4): Do not prescreen frames before attempting LRO.

Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_sge.c
==
--- stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 19:32:06 2016
(r309557)
+++ stable/10/sys/dev/cxgbe/t4_sge.cMon Dec  5 19:34:52 2016
(r309558)
@@ -1821,8 +1821,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
}
 
 #if defined(INET) || defined(INET6)
-   if (cpl->l2info & htobe32(F_RXF_LRO) &&
-   iq->flags & IQ_LRO_ENABLED &&
+   if (iq->flags & IQ_LRO_ENABLED &&
tcp_lro_rx(lro, m0, 0) == 0) {
/* queued for LRO */
} else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309557 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:32:06 2016
New Revision: 309557
URL: https://svnweb.freebsd.org/changeset/base/309557

Log:
  MFC 305433:
  cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
  that cleans up on failure assumes that non-NULL values indicate
  initialized items.

Modified:
  stable/11/sys/dev/cxgbe/tom/t4_connect.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/cxgbe/tom/t4_connect.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c
==
--- stable/11/sys/dev/cxgbe/tom/t4_connect.cMon Dec  5 19:16:46 2016
(r309556)
+++ stable/11/sys/dev/cxgbe/tom/t4_connect.cMon Dec  5 19:32:06 2016
(r309557)
@@ -332,7 +332,7 @@ t4_connect(struct toedev *tod, struct so
else
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
 
-   toep = alloc_toepcb(vi, -1, -1, M_NOWAIT);
+   toep = alloc_toepcb(vi, -1, -1, M_NOWAIT | M_ZERO);
if (toep == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309557 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:32:06 2016
New Revision: 309557
URL: https://svnweb.freebsd.org/changeset/base/309557

Log:
  MFC 305433:
  cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
  that cleans up on failure assumes that non-NULL values indicate
  initialized items.

Modified:
  stable/10/sys/dev/cxgbe/tom/t4_connect.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/tom/t4_connect.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c
==
--- stable/10/sys/dev/cxgbe/tom/t4_connect.cMon Dec  5 19:16:46 2016
(r309556)
+++ stable/10/sys/dev/cxgbe/tom/t4_connect.cMon Dec  5 19:32:06 2016
(r309557)
@@ -332,7 +332,7 @@ t4_connect(struct toedev *tod, struct so
else
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
 
-   toep = alloc_toepcb(vi, -1, -1, M_NOWAIT);
+   toep = alloc_toepcb(vi, -1, -1, M_NOWAIT | M_ZERO);
if (toep == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309556 - stable/10/sys/dev/cxgbe/tom

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:16:46 2016
New Revision: 309556
URL: https://svnweb.freebsd.org/changeset/base/309556

Log:
  MFC 303688,303750,305166,305167: Centralize and rework page pod handling.
  
  Note that the TOE DDP code in 10 is different from 11 and later and
  had to be updated directly.
  
  303688:
  cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
  per-adapter data structure.  This replaces a global array with hardcoded
  page sizes.
  
  303750:
  cxgbe/t4_tom: The page pod arena allocates from pod address space and
  not index space.  The minimum valid allocation out of this arena is the
  size of a single page pod.
  
  305166:
  cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
  and allocations within them.  Switch to these routines to manage the TOE
  DDP region.
  
  305167:
  cxgbe/t4_tom: Two new routines to allocate and write page pods for a
  buffer in the kernel's address space.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/10/sys/dev/cxgbe/tom/t4_ddp.c
  stable/10/sys/dev/cxgbe/tom/t4_tom.c
  stable/10/sys/dev/cxgbe/tom/t4_tom.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c
==
--- stable/10/sys/dev/cxgbe/tom/t4_ddp.cMon Dec  5 19:15:33 2016
(r309555)
+++ stable/10/sys/dev/cxgbe/tom/t4_ddp.cMon Dec  5 19:16:46 2016
(r309556)
@@ -74,46 +74,29 @@ VNET_DECLARE(int, tcp_autorcvbuf_max);
 
 static struct mbuf *get_ddp_mbuf(int len);
 
-#define PPOD_SZ(n) ((n) * sizeof(struct pagepod))
-#define PPOD_SIZE  (PPOD_SZ(1))
-
-/* XXX: must match A_ULP_RX_TDDP_PSZ */
-static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6};
-
 #define MAX_DDP_BUFFER_SIZE(M_TCB_RX_DDP_BUF0_LEN)
-static int
-alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr)
-{
-   vmem_addr_t v;
-   int rc;
-
-   MPASS(n > 0);
-
-   rc = vmem_alloc(td->ppod_arena, PPOD_SZ(n), M_NOWAIT | M_FIRSTFIT, );
-   *ppod_addr = (u_int)v;
 
-   return (rc);
-}
-
-static void
-free_ppods(struct tom_data *td, u_int ppod_addr, int n)
+static struct ddp_buffer *
+alloc_ddp_buffer(vm_page_t *pages, int npages, int offset, int len)
 {
+   struct ddp_buffer *db;
 
-   MPASS(n > 0);
-
-   vmem_free(td->ppod_arena, (vmem_addr_t)ppod_addr, PPOD_SZ(n));
-}
+   db = malloc(sizeof(*db), M_CXGBE, M_NOWAIT | M_ZERO);
+   if (db == NULL) {
+   CTR1(KTR_CXGBE, "%s: malloc failed.", __func__);
+   return (NULL);
+   }
 
-static inline int
-pages_to_nppods(int npages, int ddp_pgsz)
-{
-   int nsegs = npages * PAGE_SIZE / ddp_pgsz;
+   db->npages = npages;
+   db->pages = pages;
+   db->offset = offset;
+   db->len = len;
 
-   return (howmany(nsegs, PPOD_PAGES));
+   return (db);
 }
 
 static void
-free_ddp_buffer(struct tom_data *td, struct ddp_buffer *db)
+free_ddp_buffer(struct ddp_buffer *db)
 {
 
if (db == NULL)
@@ -122,8 +105,8 @@ free_ddp_buffer(struct tom_data *td, str
if (db->pages)
free(db->pages, M_CXGBE);
 
-   if (db->nppods > 0)
-   free_ppods(td, db->ppod_addr, db->nppods);
+   if (db->prsv.prsv_nppods > 0)
+   t4_free_page_pods(>prsv);
 
free(db, M_CXGBE);
 }
@@ -135,7 +118,7 @@ release_ddp_resources(struct toepcb *toe
 
for (i = 0; i < nitems(toep->db); i++) {
if (toep->db[i] != NULL) {
-   free_ddp_buffer(toep->td, toep->db[i]);
+   free_ddp_buffer(toep->db[i]);
toep->db[i] = NULL;
}
}
@@ -302,7 +285,7 @@ mk_update_tcb_for_ddp(struct adapter *sc
ulpmc = mk_set_tcb_field_ulp(ulpmc, toep,
W_TCB_RX_DDP_BUF0_TAG + db_idx,
V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG),
-   V_TCB_RX_DDP_BUF0_TAG(db->tag));
+   V_TCB_RX_DDP_BUF0_TAG(db->prsv.prsv_tag));
 
/* Update the current offset in the DDP buffer and its total length */
if (db_idx == 0)
@@ -651,12 +634,52 @@ calculate_hcf(int n1, int n2)
return (b);
 }
 
-static struct ddp_buffer *
-alloc_ddp_buffer(struct tom_data *td, vm_page_t *pages, int npages, int offset,
-int len)
+static inline int
+pages_to_nppods(int npages, int ddp_page_shift)
 {
-   int i, hcf, seglen, idx, ppod, nppods;
-   struct ddp_buffer *db;
+
+   MPASS(ddp_page_shift >= PAGE_SHIFT);
+
+   return (howmany(npages >> (ddp_page_shift - PAGE_SHIFT), PPOD_PAGES));
+}
+
+static int
+alloc_page_pods(struct ppod_region *pr, u_int nppods, u_int pgsz_idx,
+struct ppod_reservation *prsv)
+{
+   vmem_addr_t addr;   /* relative to start of region */
+
+   if (vmem_alloc(pr->pr_arena, PPOD_SZ(nppods), M_NOWAIT | M_FIRSTFIT,
+   ) != 0)
+   return (ENOMEM);
+
+   

svn commit: r309555 - in stable/11/sys/dev/cxgbe: cxgbei tom

2016-12-05 Thread John Baldwin
Author: jhb
Date: Mon Dec  5 19:15:33 2016
New Revision: 309555
URL: https://svnweb.freebsd.org/changeset/base/309555

Log:
  MFC 303688,303750,305166,305167: Centralize and rework page pod handling.
  
  303688:
  cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
  per-adapter data structure.  This replaces a global array with hardcoded
  page sizes.
  
  303750:
  cxgbe/t4_tom: The page pod arena allocates from pod address space and
  not index space.  The minimum valid allocation out of this arena is the
  size of a single page pod.
  
  305166:
  cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
  and allocations within them.  Switch to these routines to manage the TOE
  DDP region.
  
  305167:
  cxgbe/t4_tom: Two new routines to allocate and write page pods for a
  buffer in the kernel's address space.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c
  stable/11/sys/dev/cxgbe/tom/t4_ddp.c
  stable/11/sys/dev/cxgbe/tom/t4_tom.c
  stable/11/sys/dev/cxgbe/tom/t4_tom.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c
==
--- stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Dec  5 17:21:04 2016
(r309554)
+++ stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Dec  5 19:15:33 2016
(r309555)
@@ -157,7 +157,6 @@ ulp_mem_io_set_hdr(struct adapter *sc, i
idata->len = htonl(dlen);
 }
 
-#define PPOD_SIZE  sizeof(struct pagepod)
 #define ULPMEM_IDATA_MAX_NPPODS 1  /* 256/PPOD_SIZE */
 #define PCIE_MEMWIN_MAX_NPPODS 16  /* 1024/PPOD_SIZE */
 

Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c
==
--- stable/11/sys/dev/cxgbe/tom/t4_ddp.cMon Dec  5 17:21:04 2016
(r309554)
+++ stable/11/sys/dev/cxgbe/tom/t4_ddp.cMon Dec  5 19:15:33 2016
(r309555)
@@ -85,47 +85,11 @@ static void ddp_complete_all(struct toep
 static void t4_aio_cancel_active(struct kaiocb *job);
 static void t4_aio_cancel_queued(struct kaiocb *job);
 
-#define PPOD_SZ(n) ((n) * sizeof(struct pagepod))
-#define PPOD_SIZE  (PPOD_SZ(1))
-
-/* XXX: must match A_ULP_RX_TDDP_PSZ */
-static int t4_ddp_pgsz[] = {4096, 4096 << 2, 4096 << 4, 4096 << 6};
-
 static TAILQ_HEAD(, pageset) ddp_orphan_pagesets;
 static struct mtx ddp_orphan_pagesets_lock;
 static struct task ddp_orphan_task;
 
 #define MAX_DDP_BUFFER_SIZE(M_TCB_RX_DDP_BUF0_LEN)
-static int
-alloc_ppods(struct tom_data *td, int n, u_int *ppod_addr)
-{
-   vmem_addr_t v;
-   int rc;
-
-   MPASS(n > 0);
-
-   rc = vmem_alloc(td->ppod_arena, PPOD_SZ(n), M_NOWAIT | M_FIRSTFIT, );
-   *ppod_addr = (u_int)v;
-
-   return (rc);
-}
-
-static void
-free_ppods(struct tom_data *td, u_int ppod_addr, int n)
-{
-
-   MPASS(n > 0);
-
-   vmem_free(td->ppod_arena, (vmem_addr_t)ppod_addr, PPOD_SZ(n));
-}
-
-static inline int
-pages_to_nppods(int npages, int ddp_pgsz)
-{
-   int nsegs = npages * PAGE_SIZE / ddp_pgsz;
-
-   return (howmany(nsegs, PPOD_PAGES));
-}
 
 /*
  * A page set holds information about a buffer used for DDP.  The page
@@ -150,8 +114,8 @@ free_pageset(struct tom_data *td, struct
vm_page_t p;
int i;
 
-   if (ps->nppods > 0)
-   free_ppods(td, ps->ppod_addr, ps->nppods);
+   if (ps->prsv.prsv_nppods > 0)
+   t4_free_page_pods(>prsv);
 
if (ps->flags & PS_WIRED) {
for (i = 0; i < ps->npages; i++) {
@@ -486,7 +450,7 @@ mk_update_tcb_for_ddp(struct adapter *sc
ulpmc = mk_set_tcb_field_ulp(ulpmc, toep,
W_TCB_RX_DDP_BUF0_TAG + db_idx,
V_TCB_RX_DDP_BUF0_TAG(M_TCB_RX_DDP_BUF0_TAG),
-   V_TCB_RX_DDP_BUF0_TAG(ps->tag));
+   V_TCB_RX_DDP_BUF0_TAG(ps->prsv.prsv_tag));
 
/* Update the current offset in the DDP buffer and its total length */
if (db_idx == 0)
@@ -882,13 +846,52 @@ calculate_hcf(int n1, int n2)
return (b);
 }
 
+static inline int
+pages_to_nppods(int npages, int ddp_page_shift)
+{
+
+   MPASS(ddp_page_shift >= PAGE_SHIFT);
+
+   return (howmany(npages >> (ddp_page_shift - PAGE_SHIFT), PPOD_PAGES));
+}
+
 static int
-alloc_page_pods(struct tom_data *td, struct pageset *ps)
+alloc_page_pods(struct ppod_region *pr, u_int nppods, u_int pgsz_idx,
+struct ppod_reservation *prsv)
 {
-   int i, hcf, seglen, idx, ppod, nppods;
-   u_int ppod_addr;
+   vmem_addr_t addr;   /* relative to start of region */
+
+   if (vmem_alloc(pr->pr_arena, PPOD_SZ(nppods), M_NOWAIT | M_FIRSTFIT,
+   ) != 0)
+   return (ENOMEM);
+
+   CTR5(KTR_CXGBE, "%-17s arena %p, addr 0x%08x, nppods %d, pgsz %d",
+   __func__, pr->pr_arena, (uint32_t)addr & pr->pr_tag_mask,
+   nppods, 1 << 

Re: svn commit: r309531 - head/sys/arm/include

2016-12-05 Thread John Baldwin
On Sunday, December 04, 2016 03:55:14 PM Ian Lepore wrote:
> On Sun, 2016-12-04 at 13:43 -0800, John Baldwin wrote:
> > On Sunday, December 04, 2016 03:27:39 PM Michal Meloun wrote:
> > > 
> > > Author: mmel
> > > Date: Sun Dec  4 15:27:39 2016
> > > New Revision: 309531
> > > URL: https://svnweb.freebsd.org/changeset/base/309531
> > > 
> > > Log:
> > >   Implement fake pmap_mapdev_attr() for ARMv6.
> > >   This function is referenced, but never called from DRM2 code.
> > > Also,
> > >   real behavior of pmap_mapdev_attr() in ARM world is unclear as we
> > > don't
> > >   have any additional attribute for a device memory type.
> > You have VM_MEMATTR constants on ARM though.  Some devices might want
> > a
> > WB mapping (e.g. for a prefetchable memory BAR) rather than UC.
> > 
> 
> On ARM, 'DEVICE' memory is its own type/attribute and it can't usefully
> be changed (if you were to change it, it would no longer be device
> memory, it would be some other type).  If this function is being used
> to map main memory just because that memory happens to be used in some
> device driver, then that's a usage model that just doesn't map usefully
> to arm memory semantics.

Ah, no.  It is used for things like BARs, etc.  It is fine if devices are
always mapped uncacheable.  The requests for write-combining are performance
hints, but devices should still function correctly.  For example, on i386
without PAT we will map WC requests to UC.

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


svn commit: r309554 - head/tools/regression/sockets/unix_cmsg

2016-12-05 Thread Maxim Sobolev
Author: sobomax
Date: Mon Dec  5 17:21:04 2016
New Revision: 309554
URL: https://svnweb.freebsd.org/changeset/base/309554

Log:
  Refactor the regression test code by splitting huge monolithic C
  file into smaller pieces that are hopefully easier to understand
  and extend. This is to pave the ground for adding few more
  socket timestamp formats that I am working on here.
  
  No functional changes (I hope).

Added:
  head/tools/regression/sockets/unix_cmsg/t_bintime.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_bintime.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsg_len.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsg_len.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsgcred.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsgcred.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.c   (contents, 
props changed)
  head/tools/regression/sockets/unix_cmsg/t_cmsgcred_sockcred.h   (contents, 
props changed)
  head/tools/regression/sockets/unix_cmsg/t_generic.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_generic.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_peercred.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_peercred.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_sockcred.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_sockcred.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_timeval.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/t_timeval.h   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/uc_common.c   (contents, props 
changed)
  head/tools/regression/sockets/unix_cmsg/uc_common.h   (contents, props 
changed)
Modified:
  head/tools/regression/sockets/unix_cmsg/Makefile
  head/tools/regression/sockets/unix_cmsg/unix_cmsg.c

Modified: head/tools/regression/sockets/unix_cmsg/Makefile
==
--- head/tools/regression/sockets/unix_cmsg/MakefileMon Dec  5 15:55:51 
2016(r309553)
+++ head/tools/regression/sockets/unix_cmsg/MakefileMon Dec  5 17:21:04 
2016(r309554)
@@ -1,6 +1,10 @@
 # $FreeBSD$
 
 PROG=  unix_cmsg
+SRCS=  unix_cmsg.c t_bintime.h t_bintime.c uc_common.h uc_common.c \
+   t_generic.h t_generic.c t_peercred.h t_peercred.c t_timeval.h \
+   t_timeval.c t_cmsgcred.h t_cmsgcred.c t_sockcred.h t_sockcred.c \
+   t_cmsgcred_sockcred.h t_cmsgcred_sockcred.c t_cmsg_len.h t_cmsg_len.c
 MAN=
 WARNS?=3
 

Added: head/tools/regression/sockets/unix_cmsg/t_bintime.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/sockets/unix_cmsg/t_bintime.c Mon Dec  5 17:21:04 
2016(r309554)
@@ -0,0 +1,156 @@
+/*-
+ * Copyright (c) 2005 Andrey Simonenko
+ * All rights reserved.
+ *
+ * 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "t_bintime.h"
+#include "t_generic.h"
+#include "uc_common.h"
+
+static int
+check_scm_bintime(struct cmsghdr *cmsghdr)
+{
+const struct bintime *bt;
+
+if (uc_check_cmsghdr(cmsghdr, SCM_BINTIME, sizeof(struct bintime)) < 0)
+return (-1);
+
+bt = (struct bintime *)CMSG_DATA(cmsghdr);
+
+uc_dbgmsg("bintime.sec %"PRIdMAX", bintime.frac 

Re: svn commit: r309531 - head/sys/arm/include

2016-12-05 Thread Michal Meloun
Fixed in r309553.

Sorry for breakage and thanks for report.

Michal


On 05.12.2016 12:25, Andrew Turner wrote:
> On Sun, 4 Dec 2016 15:27:39 + (UTC)
> Michal Meloun  wrote:
>
>> Author: mmel
>> Date: Sun Dec  4 15:27:39 2016
>> New Revision: 309531
>> URL: https://svnweb.freebsd.org/changeset/base/309531
>>
>> Log:
>>   Implement fake pmap_mapdev_attr() for ARMv6.
>>   This function is referenced, but never called from DRM2 code. Also,
>>   real behavior of pmap_mapdev_attr() in ARM world is unclear as we
>> don't have any additional attribute for a device memory type.
>>   
>>   MFC after: 2 weeks
>>
>> Modified:
>>   head/sys/arm/include/pmap-v6.h
>>   head/sys/arm/include/pmap.h
>>
>> Modified: head/sys/arm/include/pmap-v6.h
>> ==
>> --- head/sys/arm/include/pmap-v6.h   Sun Dec  4 13:56:15
>> 2016 (r309530) +++ head/sys/arm/include/pmap-v6.hSun
>> Dec  4 15:27:39 2016 (r309531) @@ -166,7 +166,6 @@ extern
>> ttb_entry_t pmap_kern_ttb;   /* TT void
>> pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t,
>> vm_paddr_t); void pmap_kremove(vm_offset_t);
>> -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
>>  boolean_t pmap_page_is_mapped(vm_page_t);
>>  
>>  void pmap_tlb_flush(pmap_t, vm_offset_t);
>>
>> Modified: head/sys/arm/include/pmap.h
>> ==
>> --- head/sys/arm/include/pmap.h  Sun Dec  4 13:56:15
>> 2016 (r309530) +++ head/sys/arm/include/pmap.h   Sun Dec
>> 4 15:27:39 2016  (r309531) @@ -53,6 +53,12 @@ void
>> pmap_page_set_memattr(vm_page_t, vm void *pmap_mapdev(vm_paddr_t,
>> vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t);
>>  
>> +static inline void *
>> +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr)
>> +{
>> +panic("%s is not implemented yet!\n", __func__);
>> +}
>> +
>>  struct pcb;
>>  void pmap_set_pcb_pagedir(pmap_t, struct pcb *);
>>  
>>
> This broke building the cloudabi module:
>
> ===> cloudabi (all)
> cc -target arm-gnueabi-freebsd12.0 
> --sysroot=/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/head-git/tmp 
> -B/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew
> /head-git/tmp/usr/bin  -O -pipe  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   
> -DHAVE_KERNEL_OPTION_HEADERS -include 
> /scratch/tmp/andrew/obj/arm.arm/scratch/tmp/and
> rew/head-git/sys/GENERIC/opt_global.h -I. -I/scratch/tmp/andrew/head-git/sys 
> -fno-common -g -funwind-tables 
> -I/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/
> head-git/sys/GENERIC -march=armv7a -MD  -MF.depend.cloudabi_vdso.o 
> -MTcloudabi_vdso.o -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls 
> -Wnested-externs -
> Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual 
> -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ 
> -Wmissing-include-dirs -f
> diagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare 
> -Wno-error-empty-body -Wno-error-parentheses-equality 
> -Wno-error-unused-function -Wn
> o-error-pointer-sign -Wno-error-shift-negative-value  -mno-movt -mfpu=none  
> -std=iso9899:1999 -c 
> /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/c
> loudabi/cloudabi_vdso.c -o cloudabi_vdso.o
> In file included from 
> /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:35:
> In file included from /scratch/tmp/andrew/head-git/sys/vm/pmap.h:90:
> ./machine/pmap.h:59:2: error: implicit declaration of function 'panic' is 
> invalid in C99 [-Werror,-Wimplicit-function-declaration]
> panic("%s is not implemented yet!\n", __func__);
> ^
> ./machine/pmap.h:60:1: error: control reaches end of non-void function 
> [-Werror,-Wreturn-type]
> }
> ^
> In file included from 
> /scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:38:
> In file included from /scratch/tmp/andrew/head-git/sys/vm/vm_page.h:345:
> /scratch/tmp/andrew/head-git/sys/sys/systm.h:196:6: error: conflicting types 
> for 'panic'
> voidpanic(const char *, ...) __dead2 __printflike(1, 2);
> ^
> ./machine/pmap.h:59:2: note: previous implicit declaration is here
> panic("%s is not implemented yet!\n", __func__);
> ^
> 3 errors generated.
> *** Error code 1
>
> Andrew

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


svn commit: r309553 - head/sys/arm/include

2016-12-05 Thread Michal Meloun
Author: mmel
Date: Mon Dec  5 15:55:51 2016
New Revision: 309553
URL: https://svnweb.freebsd.org/changeset/base/309553

Log:
  Fix build breakage caused by r309531.
  
  Reported by: andrew
  MFC after: 2 weeks
  X-MFC with: r309531

Modified:
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Mon Dec  5 13:23:22 2016(r309552)
+++ head/sys/arm/include/pmap.h Mon Dec  5 15:55:51 2016(r309553)
@@ -30,6 +30,7 @@
 #ifndef _MACHINE_PMAP_H_
 #define _MACHINE_PMAP_H_
 
+#include 
 #if __ARM_ARCH >= 6
 #include 
 #else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-12-05 Thread Sevan Janiyan
Author: sevan (doc committer)
Date: Mon Dec  5 13:23:22 2016
New Revision: 309552
URL: https://svnweb.freebsd.org/changeset/base/309552

Log:
  Fix error in the example section
  Adjust formatting highlighted by igor.
  
  PR:   214683
  Submitted by: Anindya Mukherjee 
  Reviewed by:  jilles
  Approved by:  bcr (mentor)
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D8591

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

Modified: head/usr.bin/systat/systat.1
==
--- head/usr.bin/systat/systat.1Mon Dec  5 11:42:09 2016
(r309551)
+++ head/usr.bin/systat/systat.1Mon Dec  5 13:23:22 2016
(r309552)
@@ -28,7 +28,7 @@
 .\"@(#)systat.18.2 (Berkeley) 12/30/93
 .\" $FreeBSD$
 .\"
-.Dd November 10, 2016
+.Dd December 5, 2016
 .Dt SYSTAT 1
 .Os
 .Sh NAME
@@ -112,19 +112,22 @@ The
 specifies the screen refresh time interval in seconds.
 Time interval can be fractional.
 .It Ar display-commands
-A list of commands specific for this display. These commands can also
-be entered interactively and are described for each display separately
-below. If the command of the display requires an argument or arguments,
-it is possible to specify them as separate command line argument. To finish
-display commands it is possible to use double dash at the end
-of the list. For example:
+A list of commands specific to this display.
+These commands can also be entered interactively and are described for
+each display separately below.
+If the command requires arguments, they can be specified as separate
+command line arguments.
+A command line argument
+.Fl -
+will finish display commands.
+For example:
 .Pp
 .Dl Nm Fl ifstat Fl match Ar bge0,em1 Fl pps
 .Pp
 This will display statistics of packets per second for network interfaces
 named as bge0 and em1.
 .Pp
-.Dl Nm Fl iostat Fl numeric Fl - Ar 2.1
+.Dl Nm Fl iostat Fl numbers Fl - Ar 2.1
 .Pp
 This will display all IO statistics in a numeric format and the information
 will be refreshed each 2.1 seconds.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309551 - head/sys/x86/iommu

2016-12-05 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  5 11:42:09 2016
New Revision: 309551
URL: https://svnweb.freebsd.org/changeset/base/309551

Log:
  Release DMAR table after using it.
  
  Reported and tested by:   hps
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/x86/iommu/intel_drv.c

Modified: head/sys/x86/iommu/intel_drv.c
==
--- head/sys/x86/iommu/intel_drv.c  Mon Dec  5 11:41:09 2016
(r309550)
+++ head/sys/x86/iommu/intel_drv.c  Mon Dec  5 11:42:09 2016
(r309551)
@@ -109,6 +109,7 @@ dmar_iterate_tbl(dmar_iter_t iter, void 
if (!iter(dmarh, arg))
break;
}
+   AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl);
 }
 
 struct find_iter_args {
@@ -184,6 +185,7 @@ dmar_identify(driver_t *driver, device_t
(unsigned)dmartbl->Flags,
"\020\001INTR_REMAP\002X2APIC_OPT_OUT");
}
+   AcpiPutTable((ACPI_TABLE_HEADER *)dmartbl);
 
dmar_iterate_tbl(dmar_count_iter, NULL);
if (dmar_devcnt == 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309550 - head/sys/x86/iommu

2016-12-05 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  5 11:41:09 2016
New Revision: 309550
URL: https://svnweb.freebsd.org/changeset/base/309550

Log:
  Rename fast taskqueues used by DMAR to avoid naming conflict of the
  sleepable and spin mutexes created by the queues.
  
  Reported and tested by:   hps
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/x86/iommu/intel_fault.c
  head/sys/x86/iommu/intel_qi.c

Modified: head/sys/x86/iommu/intel_fault.c
==
--- head/sys/x86/iommu/intel_fault.cMon Dec  5 11:40:54 2016
(r309549)
+++ head/sys/x86/iommu/intel_fault.cMon Dec  5 11:41:09 2016
(r309550)
@@ -271,7 +271,7 @@ dmar_init_fault_log(struct dmar_unit *un
M_DEVBUF, M_WAITOK | M_ZERO);
 
TASK_INIT(>fault_task, 0, dmar_fault_task, unit);
-   unit->fault_taskqueue = taskqueue_create_fast("dmar", M_WAITOK,
+   unit->fault_taskqueue = taskqueue_create_fast("dmarff", M_WAITOK,
taskqueue_thread_enqueue, >fault_taskqueue);
taskqueue_start_threads(>fault_taskqueue, 1, PI_AV,
"dmar%d fault taskq", unit->unit);

Modified: head/sys/x86/iommu/intel_qi.c
==
--- head/sys/x86/iommu/intel_qi.c   Mon Dec  5 11:40:54 2016
(r309549)
+++ head/sys/x86/iommu/intel_qi.c   Mon Dec  5 11:41:09 2016
(r309550)
@@ -378,7 +378,7 @@ dmar_init_qi(struct dmar_unit *unit)
 
TAILQ_INIT(>tlb_flush_entries);
TASK_INIT(>qi_task, 0, dmar_qi_task, unit);
-   unit->qi_taskqueue = taskqueue_create_fast("dmar", M_WAITOK,
+   unit->qi_taskqueue = taskqueue_create_fast("dmarqf", M_WAITOK,
taskqueue_thread_enqueue, >qi_taskqueue);
taskqueue_start_threads(>qi_taskqueue, 1, PI_AV,
"dmar%d qi taskq", unit->unit);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-12-05 Thread Andrew Turner
Author: andrew
Date: Mon Dec  5 11:40:54 2016
New Revision: 309549
URL: https://svnweb.freebsd.org/changeset/base/309549

Log:
  Remove an unneeded header. It was used when we had an arm64 specific GIC
  driver, however with INTRNG this has been merged into a common arm driver.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

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


Re: svn commit: r309531 - head/sys/arm/include

2016-12-05 Thread Andrew Turner
On Sun, 4 Dec 2016 15:27:39 + (UTC)
Michal Meloun  wrote:

> Author: mmel
> Date: Sun Dec  4 15:27:39 2016
> New Revision: 309531
> URL: https://svnweb.freebsd.org/changeset/base/309531
> 
> Log:
>   Implement fake pmap_mapdev_attr() for ARMv6.
>   This function is referenced, but never called from DRM2 code. Also,
>   real behavior of pmap_mapdev_attr() in ARM world is unclear as we
> don't have any additional attribute for a device memory type.
>   
>   MFC after: 2 weeks
> 
> Modified:
>   head/sys/arm/include/pmap-v6.h
>   head/sys/arm/include/pmap.h
> 
> Modified: head/sys/arm/include/pmap-v6.h
> ==
> --- head/sys/arm/include/pmap-v6.hSun Dec  4 13:56:15
> 2016  (r309530) +++ head/sys/arm/include/pmap-v6.hSun
> Dec  4 15:27:39 2016  (r309531) @@ -166,7 +166,6 @@ extern
> ttb_entry_t pmap_kern_ttb;/* TT void
> pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t,
> vm_paddr_t); void pmap_kremove(vm_offset_t);
> -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
>  boolean_t pmap_page_is_mapped(vm_page_t);
>  
>  void pmap_tlb_flush(pmap_t, vm_offset_t);
> 
> Modified: head/sys/arm/include/pmap.h
> ==
> --- head/sys/arm/include/pmap.h   Sun Dec  4 13:56:15
> 2016  (r309530) +++ head/sys/arm/include/pmap.h   Sun Dec
> 4 15:27:39 2016   (r309531) @@ -53,6 +53,12 @@ void
> pmap_page_set_memattr(vm_page_t, vm void *pmap_mapdev(vm_paddr_t,
> vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t);
>  
> +static inline void *
> +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr)
> +{
> + panic("%s is not implemented yet!\n", __func__);
> +}
> +
>  struct pcb;
>  void pmap_set_pcb_pagedir(pmap_t, struct pcb *);
>  
> 

This broke building the cloudabi module:

===> cloudabi (all)
cc -target arm-gnueabi-freebsd12.0 
--sysroot=/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/head-git/tmp 
-B/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew
/head-git/tmp/usr/bin  -O -pipe  -Werror -D_KERNEL -DKLD_MODULE -nostdinc   
-DHAVE_KERNEL_OPTION_HEADERS -include 
/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/and
rew/head-git/sys/GENERIC/opt_global.h -I. -I/scratch/tmp/andrew/head-git/sys 
-fno-common -g -funwind-tables 
-I/scratch/tmp/andrew/obj/arm.arm/scratch/tmp/andrew/
head-git/sys/GENERIC -march=armv7a -MD  -MF.depend.cloudabi_vdso.o 
-MTcloudabi_vdso.o -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls 
-Wnested-externs -
Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual 
-Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ 
-Wmissing-include-dirs -f
diagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare 
-Wno-error-empty-body -Wno-error-parentheses-equality 
-Wno-error-unused-function -Wn
o-error-pointer-sign -Wno-error-shift-negative-value  -mno-movt -mfpu=none  
-std=iso9899:1999 -c 
/scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/c
loudabi/cloudabi_vdso.c -o cloudabi_vdso.o
In file included from 
/scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:35:
In file included from /scratch/tmp/andrew/head-git/sys/vm/pmap.h:90:
./machine/pmap.h:59:2: error: implicit declaration of function 'panic' is 
invalid in C99 [-Werror,-Wimplicit-function-declaration]
panic("%s is not implemented yet!\n", __func__);
^
./machine/pmap.h:60:1: error: control reaches end of non-void function 
[-Werror,-Wreturn-type]
}
^
In file included from 
/scratch/tmp/andrew/head-git/sys/modules/cloudabi/../../compat/cloudabi/cloudabi_vdso.c:38:
In file included from /scratch/tmp/andrew/head-git/sys/vm/vm_page.h:345:
/scratch/tmp/andrew/head-git/sys/sys/systm.h:196:6: error: conflicting types 
for 'panic'
voidpanic(const char *, ...) __dead2 __printflike(1, 2);
^
./machine/pmap.h:59:2: note: previous implicit declaration is here
panic("%s is not implemented yet!\n", __func__);
^
3 errors generated.
*** Error code 1

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


Re: svn commit: r309372 - head/sys/sys

2016-12-05 Thread Oleg Bulyzhin
On Fri, Dec 02, 2016 at 04:11:32PM +0800, Sepherosa Ziehau wrote:
> peek_clear_sc is added to address the issue you mentioned.  IMHO, this
> commit weakens the proper assertion.

I would say this check:

#ifdef DEBUG_BUFRING
int i;
for (i = br->br_cons_head; i != br->br_prod_head;
 i = ((i + 1) & br->br_cons_mask))
if(br->br_ring[i] == buf)
panic("buf=%p already enqueue at %d prod=%d cons=%d",
buf, i, br->br_prod_tail, br->br_cons_tail);
#endif

can't be relied upon:

1) it does not synchronize with anything, neither consumers nor producers.
   So you can read inconsistent data. For example, you are storing
   NULL in buf_ring_peek_clear_sc() but there is no guarantee you will see
   it here.
2) it's not covered by critical section so thread running this check can be
   preempted. Consider the following scenario: 
   a) thread is running this check and gets preempted by other producer
  before i != br->br_prod_head check.
   b) other producer moves br->br_prod_head forward.
   c) if we are unlucky we can spin forever.

Current buf_ring implementation has insufficient memory ordering constraints.
I've tried to fix acq/rel usage here:
https://reviews.freebsd.org/D8637
but didn't get any review yet.

> 
> On Fri, Dec 2, 2016 at 5:08 AM, Ryan Stone  wrote:
> > Author: rstone
> > Date: Thu Dec  1 21:08:42 2016
> > New Revision: 309372
> > URL: https://svnweb.freebsd.org/changeset/base/309372
> >
> > Log:
> >   Fix a false positive in a buf_ring assert
> >
> >   buf_ring contains an assert that checks whether an item being
> >   enqueued already exists on the ring.  There is a subtle bug in
> >   this assert.  An item can be returned by a peek() function and
> >   freed, and then the consumer thread can be preempted before
> >   calling advance().  If this happens the item appears to still be
> >   on the queue, but another thread may allocate the item from the
> >   free pool and wind up trying to enqueue it again, causing the
> >   assert to trigger incorrectly.
> >
> >   Fix this by skipping the head of the consumer's portion of the
> >   ring, as this index is what will be returned by peek().
> >
> >   Sponsored by: Dell EMC Isilon
> >   MFC After:1 week
> >   Differential Revision:https://reviews.freebsd.org/D8685
> >   Reviewed by:  hselasky
> >
> > Modified:
> >   head/sys/sys/buf_ring.h
> >
> > Modified: head/sys/sys/buf_ring.h
> > ==
> > --- head/sys/sys/buf_ring.h Thu Dec  1 20:36:48 2016(r309371)
> > +++ head/sys/sys/buf_ring.h Thu Dec  1 21:08:42 2016(r309372)
> > @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo
> > uint32_t prod_head, prod_next, cons_tail;
> >  #ifdef DEBUG_BUFRING
> > int i;
> > -   for (i = br->br_cons_head; i != br->br_prod_head;
> > -i = ((i + 1) & br->br_cons_mask))
> > -   if(br->br_ring[i] == buf)
> > -   panic("buf=%p already enqueue at %d prod=%d 
> > cons=%d",
> > -   buf, i, br->br_prod_tail, br->br_cons_tail);
> > +   if (br->br_cons_head != br->br_prod_head) {
> > +   for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != 
> > br->br_prod_head;
> > +   i = ((i + 1) & br->br_cons_mask))
> > +   if(br->br_ring[i] == buf)
> > +   panic("buf=%p already enqueue at %d prod=%d 
> > cons=%d",
> > +   buf, i, br->br_prod_tail, 
> > br->br_cons_tail);
> > +   }
> >  #endif
> > critical_enter();
> > do {
> > ___
> > svn-src-all@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-all
> > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> 
> 
> 
> -- 
> Tomorrow Will Never Die

-- 
Oleg.


=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- o...@rinet.ru ===


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