svn commit: r297955 - in head/sys: geom geom/mirror geom/raid3 sys

2016-04-13 Thread Warner Losh
Author: imp
Date: Thu Apr 14 05:10:41 2016
New Revision: 297955
URL: https://svnweb.freebsd.org/changeset/base/297955

Log:
  Bump bio_cmd and bio_*flags from 8 bits to 16.
  
  Differential Revision: https://reviews.freebsd.org/D5784

Modified:
  head/sys/geom/geom_io.c
  head/sys/geom/geom_subr.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/sys/bio.h
  head/sys/sys/buf.h

Modified: head/sys/geom/geom_io.c
==
--- head/sys/geom/geom_io.c Thu Apr 14 04:59:51 2016(r297954)
+++ head/sys/geom/geom_io.c Thu Apr 14 05:10:41 2016(r297955)
@@ -504,11 +504,11 @@ g_io_request(struct bio *bp, struct g_co
cmd = bp->bio_cmd;
if (cmd == BIO_READ || cmd == BIO_WRITE || cmd == BIO_GETATTR) {
KASSERT(bp->bio_data != NULL,
-   ("NULL bp->data in g_io_request(cmd=%hhu)", bp->bio_cmd));
+   ("NULL bp->data in g_io_request(cmd=%hu)", bp->bio_cmd));
}
if (cmd == BIO_DELETE || cmd == BIO_FLUSH) {
KASSERT(bp->bio_data == NULL,
-   ("non-NULL bp->data in g_io_request(cmd=%hhu)",
+   ("non-NULL bp->data in g_io_request(cmd=%hu)",
bp->bio_cmd));
}
if (cmd == BIO_READ || cmd == BIO_WRITE || cmd == BIO_DELETE) {

Modified: head/sys/geom/geom_subr.c
==
--- head/sys/geom/geom_subr.c   Thu Apr 14 04:59:51 2016(r297954)
+++ head/sys/geom/geom_subr.c   Thu Apr 14 05:10:41 2016(r297955)
@@ -1508,8 +1508,8 @@ DB_SHOW_COMMAND(bio, db_show_bio)
db_printf("BIO %p\n", bp);
db_print_bio_cmd(bp);
db_print_bio_flags(bp);
-   db_printf("  cflags: 0x%hhx\n", bp->bio_cflags);
-   db_printf("  pflags: 0x%hhx\n", bp->bio_pflags);
+   db_printf("  cflags: 0x%hx\n", bp->bio_cflags);
+   db_printf("  pflags: 0x%hx\n", bp->bio_pflags);
db_printf("  offset: %jd\n", (intmax_t)bp->bio_offset);
db_printf("  length: %jd\n", (intmax_t)bp->bio_length);
db_printf("  bcount: %ld\n", bp->bio_bcount);

Modified: head/sys/geom/mirror/g_mirror.c
==
--- head/sys/geom/mirror/g_mirror.c Thu Apr 14 04:59:51 2016
(r297954)
+++ head/sys/geom/mirror/g_mirror.c Thu Apr 14 05:10:41 2016
(r297955)
@@ -1905,7 +1905,7 @@ g_mirror_worker(void *arg)
g_mirror_sync_request(bp);  /* WRITE */
else {
KASSERT(0,
-   ("Invalid request cflags=0x%hhx to=%s.",
+   ("Invalid request cflags=0x%hx to=%s.",
bp->bio_cflags, bp->bio_to->name));
}
} else {

Modified: head/sys/geom/raid3/g_raid3.c
==
--- head/sys/geom/raid3/g_raid3.c   Thu Apr 14 04:59:51 2016
(r297954)
+++ head/sys/geom/raid3/g_raid3.c   Thu Apr 14 05:10:41 2016
(r297955)
@@ -2127,7 +2127,7 @@ process:
g_raid3_sync_request(bp);   /* WRITE */
else {
KASSERT(0,
-   ("Invalid request cflags=0x%hhx to=%s.",
+   ("Invalid request cflags=0x%hx to=%s.",
bp->bio_cflags, bp->bio_to->name));
}
} else if (g_raid3_register_request(bp) != 0) {

Modified: head/sys/sys/bio.h
==
--- head/sys/sys/bio.h  Thu Apr 14 04:59:51 2016(r297954)
+++ head/sys/sys/bio.h  Thu Apr 14 05:10:41 2016(r297955)
@@ -77,10 +77,10 @@ typedef void bio_task_t(void *);
  * The bio structure describes an I/O operation in the kernel.
  */
 struct bio {
-   uint8_t bio_cmd;/* I/O operation. */
-   uint8_t bio_flags;  /* General flags. */
-   uint8_t bio_cflags; /* Private use by the consumer. */
-   uint8_t bio_pflags; /* Private use by the provider. */
+   uint16_t bio_cmd;   /* I/O operation. */
+   uint16_t bio_flags; /* General flags. */
+   uint16_t bio_cflags;/* Private use by the consumer. */
+   uint16_t bio_pflags;/* Private use by the provider. */
struct cdev *bio_dev;   /* Device to do I/O on. */
struct disk *bio_disk;  /* Valid below geom_disk.c only */
off_t   bio_offset; /* Offset into file. */

Modified: head/sys/sys/b

svn commit: r297954 - in head/sys: boot/efi/loader/arch/amd64 boot/i386/libi386 x86/acpica

2016-04-13 Thread Warner Losh
Author: imp
Date: Thu Apr 14 04:59:51 2016
New Revision: 297954
URL: https://svnweb.freebsd.org/changeset/base/297954

Log:
  Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the
  system. This uses the hints mechnanism. This mostly works today
  because when there's no static hints (the default), this value can be
  fetched from the hint. When there is a static hints file, the hint
  passed from the boot loader to the kernel is ignored, but for the BIOS
  case we're able to find it anyway. However, with UEFI, the fallback
  doesn't work, so we get a panic instead.
  
  Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to
  generate the old values to allow for transitions. In addition, fall
  back to the old method if the new method isn't present.
  
  Add comments about all this.
  
  Differential Revision: https://reviews.freebsd.org/D5866

Modified:
  head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
  head/sys/boot/i386/libi386/biosacpi.c
  head/sys/x86/acpica/OsdEnvironment.c

Modified: head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
==
--- head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Apr 14 04:54:47 
2016(r297953)
+++ head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Apr 14 04:59:51 
2016(r297954)
@@ -101,6 +101,17 @@ elf64_exec(struct preloaded_file *fp)
charbuf[24];
int revision;
 
+   /*
+* Report the RSDP to the kernel. While this can be found with
+* a BIOS boot, the RSDP may be elsewhere when booted from UEFI.
+* The old code used the 'hints' method to communite this to
+* the kernel. However, while convenient, the 'hints' method
+* is fragile and does not work when static hints are compiled
+* into the kernel. Instead, move to setting different tunables
+* that start with acpi. The old 'hints' can be removed before
+* we branch for FreeBSD 12.
+*/
+
rsdp = efi_get_table(&acpi20_guid);
if (rsdp == NULL) {
rsdp = efi_get_table(&acpi_guid);
@@ -108,23 +119,29 @@ elf64_exec(struct preloaded_file *fp)
if (rsdp != NULL) {
sprintf(buf, "0x%016llx", (unsigned long long)rsdp);
setenv("hint.acpi.0.rsdp", buf, 1);
+   setenv("acpi.rsdp", buf, 1);
revision = rsdp->Revision;
if (revision == 0)
revision = 1;
sprintf(buf, "%d", revision);
setenv("hint.acpi.0.revision", buf, 1);
+   setenv("acpi.revision", buf, 1);
strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
buf[sizeof(rsdp->OemId)] = '\0';
setenv("hint.acpi.0.oem", buf, 1);
+   setenv("acpi.oem", buf, 1);
sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress);
setenv("hint.acpi.0.rsdt", buf, 1);
+   setenv("acpi.rsdt", buf, 1);
if (revision >= 2) {
/* XXX extended checksum? */
sprintf(buf, "0x%016llx",
(unsigned long long)rsdp->XsdtPhysicalAddress);
setenv("hint.acpi.0.xsdt", buf, 1);
+   setenv("acpi.xsdt", buf, 1);
sprintf(buf, "%d", rsdp->Length);
setenv("hint.acpi.0.xsdt_length", buf, 1);
+   setenv("acpi.xsdt_length", buf, 1);
}
}
 

Modified: head/sys/boot/i386/libi386/biosacpi.c
==
--- head/sys/boot/i386/libi386/biosacpi.c   Thu Apr 14 04:54:47 2016
(r297953)
+++ head/sys/boot/i386/libi386/biosacpi.c   Thu Apr 14 04:59:51 2016
(r297954)
@@ -60,25 +60,40 @@ biosacpi_detect(void)
 if ((rsdp = biosacpi_find_rsdp()) == NULL)
return;
 
-/* export values from the RSDP */
+/*
+ * Report the RSDP to the kernel. While this can be found with
+ * a BIOS boot, the RSDP may be elsewhere when booted from UEFI.
+ * The old code used the 'hints' method to communite this to
+ * the kernel. However, while convenient, the 'hints' method
+ * is fragile and does not work when static hints are compiled
+ * into the kernel. Instead, move to setting different tunables
+ * that start with acpi. The old 'hints' can be removed before
+ * we branch for FreeBSD 12.
+ */
 sprintf(buf, "0x%08x", VTOP(rsdp));
 setenv("hint.acpi.0.rsdp", buf, 1);
+setenv("acpi.rsdp", buf, 1);
 revision = rsdp->Revision;
 if (revision == 0)
revision = 1;
 sprintf(buf, "%d", revision);
 setenv("hint.acpi.0.revision", buf, 1);
+setenv("acpi.revision", buf, 1);
 strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
 buf[sizeof(rsdp->O

svn commit: r297952 - head/lib/msun/tests

2016-04-13 Thread Garrett Cooper
Author: ngie
Date: Thu Apr 14 04:40:31 2016
New Revision: 297952
URL: https://svnweb.freebsd.org/changeset/base/297952

Log:
  Disable fmaxmin_test when compiling it with clang 3.8.0
  
  The testcase always fails today due to how C11 7.6.1/2 is interpreted
  with clang 3.8.0 when combined with "#pragma STDC FENV_ACCESS ON".
  
  This testcase passes with clang <3.8.0 and gcc, so continue testing it
  with those compiler combinations
  
  More intelligent discussion on the issue is in the PR
  
  MFC after: never
  PR: 208703
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/msun/tests/Makefile

Modified: head/lib/msun/tests/Makefile
==
--- head/lib/msun/tests/MakefileThu Apr 14 04:16:31 2016
(r297951)
+++ head/lib/msun/tests/MakefileThu Apr 14 04:40:31 2016
(r297952)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 TESTSRC=   ${SRCTOP}/contrib/netbsd-tests/lib/libm
 
 # All architectures on FreeBSD have fenv.h
@@ -47,7 +49,10 @@ TAP_TESTS_C+=ctrig_test
 TAP_TESTS_C+=  exponential_test
 TAP_TESTS_C+=  fenv_test
 TAP_TESTS_C+=  fma_test
+# clang 3.8.0 fails always fails this test. See: bug 208703
+.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} == 30800)
 TAP_TESTS_C+=  fmaxmin_test
+.endif
 TAP_TESTS_C+=  ilogb_test
 TAP_TESTS_C+=  invtrig_test
 TAP_TESTS_C+=  invctrig_test
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297951 - head/sys/sys

2016-04-13 Thread Warner Losh
Author: imp
Date: Thu Apr 14 04:16:31 2016
New Revision: 297951
URL: https://svnweb.freebsd.org/changeset/base/297951

Log:
  Add comment about where b_iocmd and b_ioflags come from.

Modified:
  head/sys/sys/buf.h

Modified: head/sys/sys/buf.h
==
--- head/sys/sys/buf.h  Thu Apr 14 01:24:00 2016(r297950)
+++ head/sys/sys/buf.h  Thu Apr 14 04:16:31 2016(r297951)
@@ -98,8 +98,8 @@ struct buf {
void*b_caller1;
caddr_t b_data;
int b_error;
-   uint8_t b_iocmd;
-   uint8_t b_ioflags;
+   uint8_t b_iocmd;/* BIO_* bio_cmd from bio.h */
+   uint8_t b_ioflags;  /* BIO_* bio_flags from bio.h */
off_t   b_iooffset;
longb_resid;
void(*b_iodone)(struct buf *);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297948 - head/share/man/man5

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 14 01:20:00 2016
New Revision: 297948
URL: https://svnweb.freebsd.org/changeset/base/297948

Log:
  Regenerate

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Thu Apr 14 01:17:37 2016
(r297947)
+++ head/share/man/man5/src.conf.5  Thu Apr 14 01:20:00 2016
(r297948)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z 
bdrewery
 .\" $FreeBSD$
-.Dd April 11, 2016
+.Dd April 13, 2016
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -821,11 +821,14 @@ Set to not build
 .\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 
2011-04-30 17:58:28Z bz
 Set to build libraries, programs, and kernel modules without IPv4 support.
 .It Va WITHOUT_INSTALLLIB
-.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 174497 
2007-12-09 21:56:21Z dougb
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 297941 
2016-04-13 21:01:58Z bdrewery
 Set this if you do not want to install optional libraries.
 For example when creating a
 .Xr nanobsd 8
 image.
+.Bf -symbolic
+The option does not work for build targets.
+.Ef
 .It Va WITH_INSTALL_AS_USER
 .\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 
2012-07-02 20:24:01Z marcel
 Set to make install targets succeed for non-root users by installing
@@ -1435,13 +1438,10 @@ and
 Set to not build or install
 .Xr timed 8 .
 .It Va WITHOUT_TOOLCHAIN
-.\" from FreeBSD: head/tools/build/options/WITHOUT_TOOLCHAIN 273172 2014-10-16 
15:55:13Z brooks
+.\" from FreeBSD: head/tools/build/options/WITHOUT_TOOLCHAIN 297939 2016-04-13 
20:55:05Z bdrewery
 Set to not install header or
 programs used for program development,
 compilers, debuggers etc.
-.Bf -symbolic
-The option does not work for build targets.
-.Ef
 When set, it also enforces the following options:
 .Pp
 .Bl -item -compact
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297947 - head/lib/libpam/modules

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 14 01:17:37 2016
New Revision: 297947
URL: https://svnweb.freebsd.org/changeset/base/297947

Log:
  Build libpam modules in parallel.
  
  MFC after:2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libpam/modules/Makefile

Modified: head/lib/libpam/modules/Makefile
==
--- head/lib/libpam/modules/MakefileThu Apr 14 01:17:03 2016
(r297946)
+++ head/lib/libpam/modules/MakefileThu Apr 14 01:17:37 2016
(r297947)
@@ -27,5 +27,6 @@
 .include "modules.inc"
 
 SUBDIR=${MODULES}
+SUBDIR_PARALLEL=
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297946 - in head: . lib/libpam lib/libpam/libpam lib/libpam/modules lib/libpam/static_libpam lib/libpam/static_modules targets/pseudo/userland/lib

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Thu Apr 14 01:17:03 2016
New Revision: 297946
URL: https://svnweb.freebsd.org/changeset/base/297946

Log:
  Simplify building libpam and fix libpam.a not containing the modules since 
r284345.
  
  The change in r284345 moved the creation of openpam_static_modules.o to
  lib/libpam/static_modules but never managed to get them into libpam.a.
  
  Move this logic to lib/libpam/static_libpam and have it create a static
  library for libpam.a  The main lib/libpam/libpam will only create a
  shared library.  No redundancy in compilation or installation exists
  in this solution.
  
  This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.
  
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/lib/libpam/static_libpam/
 - copied from r297945, head/lib/libpam/static_modules/
Deleted:
  head/lib/libpam/static_modules/
Modified:
  head/Makefile.inc1
  head/lib/libpam/Makefile
  head/lib/libpam/libpam/Makefile
  head/lib/libpam/modules/Makefile.inc
  head/lib/libpam/static_libpam/Makefile
  head/targets/pseudo/userland/lib/Makefile.depend

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Apr 14 00:25:11 2016(r297945)
+++ head/Makefile.inc1  Thu Apr 14 01:17:03 2016(r297946)
@@ -1719,7 +1719,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1
lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \
${_lib_casper} \
lib/ncurses/ncurses lib/ncurses/ncursesw \
-   lib/libopie lib/libpam ${_lib_libthr} \
+   lib/libopie lib/libpam/libpam ${_lib_libthr} \
${_lib_libradius} lib/libsbuf lib/libtacplus \
lib/libgeom \
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
@@ -1731,6 +1731,7 @@ _prebuild_libs=   ${_kerberos5_lib_libasn1
${_secure_lib_libcrypto} ${_lib_libldns} \
${_secure_lib_libssh} ${_secure_lib_libssl} \
gnu/lib/libdialog
+
 .if ${MK_GNUCXX} != "no"
 _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
 gnu/lib/libstdc++__L: lib/msun__L
@@ -1898,7 +1899,7 @@ ${_lib}__PL: .PHONY .MAKE
 .endif
 .endfor
 
-.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
+.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
 ${_lib}__L: .PHONY .MAKE
 .if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \
@@ -1909,18 +1910,6 @@ ${_lib}__L: .PHONY .MAKE
 .endif
 .endfor
 
-# libpam is special: we need to build static PAM modules before
-# static PAM library, and dynamic PAM library before dynamic PAM
-# modules.
-lib/libpam__L: .PHONY .MAKE
-   ${_+_}@${ECHODIR} "===> lib/libpam (obj,all,install)"; \
-   cd ${.CURDIR}/lib/libpam; \
-   ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
-   ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-   -D_NO_LIBPAM_SO_YET all; \
-   ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-   -D_NO_LIBPAM_SO_YET install
-
 _prereq_libs: ${_prereq_libs:S/$/__PL/}
 _startup_libs: ${_startup_libs:S/$/__L/}
 _prebuild_libs: ${_prebuild_libs:S/$/__L/}

Modified: head/lib/libpam/Makefile
==
--- head/lib/libpam/MakefileThu Apr 14 00:25:11 2016(r297945)
+++ head/lib/libpam/MakefileThu Apr 14 01:17:03 2016(r297946)
@@ -24,8 +24,11 @@
 #
 # $FreeBSD$
 
-# The modules must be built first, because they are built into the
-# static version of libpam.
-SUBDIR+=   modules libpam static_modules
+# The modules link in libpam.  They build the static modules as well.
+SUBDIR+=   libpam modules
+SUBDIR_DEPEND_modules= libpam
+SUBDIR+=   static_libpam
+SUBDIR_DEPEND_static_libpam= modules
+SUBDIR_PARALLEL=
 
 .include 

Modified: head/lib/libpam/libpam/Makefile
==
--- head/lib/libpam/libpam/Makefile Thu Apr 14 00:25:11 2016
(r297945)
+++ head/lib/libpam/libpam/Makefile Thu Apr 14 01:17:03 2016
(r297946)
@@ -38,7 +38,11 @@
 OPENPAM=   ${.CURDIR}/../../../contrib/openpam
 .PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man
 
-LIB=   pam
+# static_libpam will build libpam.a
+.if !defined(LIB)
+SHLIB= pam
+.endif
+
 MK_PROFILE=no
 
 SRCS=  openpam_asprintf.c \
@@ -98,7 +102,7 @@ SRCS=openpam_asprintf.c \
 # Local additions
 SRCS+= pam_debug_log.c
 
-MAN=   openpam.3 \
+MAN?=  openpam.3 \
openpam_borrow_cred.3 \
openpam_free_data.3 \
openpam_free_envlist.3 \
@@ -150,10 +154,10 @@ MAN=  openpam.3 \
pam_vprompt.3 \
pam.conf.5
 
-MLINKS=pam.conf.5 pam.d.5
+MLINKS?=   pam.conf.5 pam.d.5
 
 CSTD?= c99
-CFLAGS+= -I${.CURDIR} -I${OPENPAM}/include
+CFLAGS+= -I${OPENPAM}/include
 CFLAGS+= -DLIB_MAJ=${SHLIB_MAJO

svn commit: r297945 - head/sys/contrib/rdma/krping

2016-04-13 Thread Navdeep Parhar
Author: np
Date: Thu Apr 14 00:25:11 2016
New Revision: 297945
URL: https://svnweb.freebsd.org/changeset/base/297945

Log:
  Send krping output to the log instead of the tty, as is done upstream.
  
  Reviewed by:  hselasky@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D5931

Modified:
  head/sys/contrib/rdma/krping/krping.c
  head/sys/contrib/rdma/krping/krping.h
  head/sys/contrib/rdma/krping/krping_dev.c

Modified: head/sys/contrib/rdma/krping/krping.c
==
--- head/sys/contrib/rdma/krping/krping.c   Wed Apr 13 23:58:34 2016
(r297944)
+++ head/sys/contrib/rdma/krping/krping.c   Thu Apr 14 00:25:11 2016
(r297945)
@@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$");
 #include "getopt.h"
 
 extern int krping_debug;
-#define DEBUG_LOG(cb, x...) if (krping_debug) krping_printf((cb)->cookie, x)
-#define PRINTF(cb, x...) krping_printf((cb)->cookie, x)
+#define DEBUG_LOG(cb, x...) if (krping_debug) log(LOG_INFO, x)
+#define PRINTF(cb, x...) log(LOG_INFO, x)
 #define BIND_INFO 1
 
 MODULE_AUTHOR("Steve Wise");
@@ -376,8 +376,8 @@ static void krping_cq_event_handler(stru
continue;
} else {
PRINTF(cb, "cq completion failed with "
-  "wr_id %Lx status %d opcode %d 
vender_err %x\n",
-   wc.wr_id, wc.status, wc.opcode, 
wc.vendor_err);
+  "wr_id %jx status %d opcode %d 
vender_err %x\n",
+   (uintmax_t)wc.wr_id, wc.status, 
wc.opcode, wc.vendor_err);
goto error;
}
}
@@ -570,8 +570,8 @@ static int krping_setup_buffers(struct k
if (!cb->local_dma_lkey) {
buf.addr = cb->recv_dma_addr;
buf.size = sizeof cb->recv_buf;
-   DEBUG_LOG(cb, "recv buf dma_addr %llx size %d\n", 
buf.addr, 
-   (int)buf.size);
+   DEBUG_LOG(cb, "recv buf dma_addr %jx size %d\n",
+   (uintmax_t)buf.addr, (int)buf.size);
iovbase = cb->recv_dma_addr;
cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, 
 IB_ACCESS_LOCAL_WRITE, 
@@ -585,8 +585,8 @@ static int krping_setup_buffers(struct k
 
buf.addr = cb->send_dma_addr;
buf.size = sizeof cb->send_buf;
-   DEBUG_LOG(cb, "send buf dma_addr %llx size %d\n", 
buf.addr, 
-   (int)buf.size);
+   DEBUG_LOG(cb, "send buf dma_addr %jx size %d\n",
+   (uintmax_t)buf.addr, (int)buf.size);
iovbase = cb->send_dma_addr;
cb->send_mr = ib_reg_phys_mr(cb->pd, &buf, 1, 
 0, &iovbase);
@@ -657,8 +657,8 @@ static int krping_setup_buffers(struct k
ret = PTR_ERR(cb->rdma_mr);
goto bail;
}
-   DEBUG_LOG(cb, "rdma buf dma_addr %llx size %d mr rkey 
0x%x\n", 
-   buf.addr, (int)buf.size, cb->rdma_mr->rkey);
+   DEBUG_LOG(cb, "rdma buf dma_addr %jx size %d mr rkey 
0x%x\n",
+   (uintmax_t)buf.addr, (int)buf.size, 
cb->rdma_mr->rkey);
break;
default:
ret = -EINVAL;
@@ -691,8 +691,8 @@ static int krping_setup_buffers(struct k
 
buf.addr = cb->start_dma_addr;
buf.size = cb->size;
-   DEBUG_LOG(cb, "start buf dma_addr %llx size %d\n", 
-   buf.addr, (int)buf.size);
+   DEBUG_LOG(cb, "start buf dma_addr %jx size %d\n",
+   (uintmax_t)buf.addr, (int)buf.size);
iovbase = cb->start_dma_addr;
cb->start_mr = ib_reg_phys_mr(cb->pd, &buf, 1, 
 flags,
@@ -882,16 +882,16 @@ static u32 krping_rdma_rkey(struct krpin
for (i=0; i < cb->fastreg_wr.wr.fast_reg.page_list_len; 
 i++, p += PAGE_SIZE) {
cb->page_list->page_list[i] = p;
-   DEBUG_LOG(cb, "page_list[%d] 0x%llx\n", i, p);
+   DEBUG_LOG(cb, "page_list[%d] 0x%jx\n", i, (uintmax_t)p);
}
 
DEBUG_LOG(cb, "post_inv = %d, fastreg new rkey 0x%x shift %u 
len %u"
-   " iova_start %llx page_list_len %u\n",
+   " iova_start %jx page_list

Re: svn commit: r297935 - head/sys/kern

2016-04-13 Thread James Gritton

On 2016-04-13 17:45, Mateusz Guzik wrote:

On Wed, Apr 13, 2016 at 08:14:13PM +, Jamie Gritton wrote:

Author: jamie
Date: Wed Apr 13 20:14:13 2016
New Revision: 297935
URL: https://svnweb.freebsd.org/changeset/base/297935

Log:
  Separate POSIX sem/shm objects in jails, by prepending the jail's 
path

  name to the object's "path".  While the objects don't have real path
  names, it's a filesystem-like namespace, which allows jails to be
  kept to their own space, but still allows the system / jail parent 
to

  access a jail's IPC.



What is the reasoning behind this method?


The reasoning is that even though the namespace isn't the actual 
filesystem, it's still a filesystem-like namespace, and that provides a 
good way to let the system communicate with jails if it so chooses (that 
can be useful) while still keeping jails separate from each other.


I assume the fact that sem/shm objects aren't actual vnodes is because 
it was much easier than making it work (especially in a world of 
multiple filesystems), and not because it was considered an actual 
desirable feature.



Names are not supposed to contain slashes apart from the initial
one, so this cuts into the supported length.


Actually, for sem/shm objects, multiple slashes are supported, so it 
looks like a virtual full pathname.  And the supported length is in fact 
MAXPATHLEN.



If slashes were to be
permitted, this would create a possible conflict where part of the name
is the same as the path of a newly created jail.


Yes, there is that possible conflict.  But since these objects aren't 
actually in the filesystem, it's permissible to have one at "/jail" at 
the same time as having another at "/jail/foo/bar".



The standard way would be to provide an entirely separate namespace, if
requested, and keep things the same otherwise.


I would have done that had the namespace not already been essentially a 
poor man's filesystem.  But since the goal was obviously filesystem-ish 
if not the actual filesystem, the most natural way to specify the jail 
namespace is by using the jail path.


Note that the companion commit for the POSIX mqueue objects, does in 
fact keep the jails totally separate.  That's because the mqueue objects 
are in fact limited to a single "component" (i.e. only one slash).  This 
is not a feature, but rather an implementation deficiency as evidenced 
by the code in uipc_mqueue.c that handles full paths but is wrapped in 
"#ifdef notyet".


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


Re: svn commit: r297935 - head/sys/kern

2016-04-13 Thread Mateusz Guzik
On Wed, Apr 13, 2016 at 08:14:13PM +, Jamie Gritton wrote:
> Author: jamie
> Date: Wed Apr 13 20:14:13 2016
> New Revision: 297935
> URL: https://svnweb.freebsd.org/changeset/base/297935
> 
> Log:
>   Separate POSIX sem/shm objects in jails, by prepending the jail's path
>   name to the object's "path".  While the objects don't have real path
>   names, it's a filesystem-like namespace, which allows jails to be
>   kept to their own space, but still allows the system / jail parent to
>   access a jail's IPC.
>   

What is the reasoning behind this method?

Names are not supposed to contain slashes apart from the initial
one, so this cuts into the supported length. If slashes were to be
permitted, this would create a possible conflict where part of the name
is the same as the path of a newly created jail.

The standard way would be to provide an entirely separate namespace, if
requested, and keep things the same otherwise.

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


svn commit: r297943 - head/sys/arm/ti/omap4

2016-04-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Apr 13 21:39:45 2016
New Revision: 297943
URL: https://svnweb.freebsd.org/changeset/base/297943

Log:
  Fix UART3 and UART4 clock offsets.
  
  Original values were copy-pasted from UART1 and UART2
  
  PR:   197037
  Submitted by: Scott Ellis 

Modified:
  head/sys/arm/ti/omap4/omap4_prcm_clks.c

Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c
==
--- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 13 21:08:02 2016
(r297942)
+++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 13 21:39:45 2016
(r297943)
@@ -366,9 +366,9 @@ static struct omap4_clk_details g_omap4_
OMAP4_GENERIC_CLOCK_DETAILS(UART2_CLK, FREQ_48MHZ, CM2_INSTANCE,
(L4PER_CM2_OFFSET + 0x0148), CLKCTRL_MODULEMODE_ENABLE),
OMAP4_GENERIC_CLOCK_DETAILS(UART3_CLK, FREQ_48MHZ, CM2_INSTANCE,
-   (L4PER_CM2_OFFSET + 0x0140), CLKCTRL_MODULEMODE_ENABLE),
+   (L4PER_CM2_OFFSET + 0x0150), CLKCTRL_MODULEMODE_ENABLE),
OMAP4_GENERIC_CLOCK_DETAILS(UART4_CLK, FREQ_48MHZ, CM2_INSTANCE,
-   (L4PER_CM2_OFFSET + 0x0148), CLKCTRL_MODULEMODE_ENABLE),
+   (L4PER_CM2_OFFSET + 0x0158), CLKCTRL_MODULEMODE_ENABLE),
 
/* General purpose timers */
OMAP4_GENERIC_CLOCK_DETAILS(TIMER1_CLK,  -1, PRM_INSTANCE,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297942 - head/lib/libgssapi

2016-04-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 13 21:08:02 2016
New Revision: 297942
URL: https://svnweb.freebsd.org/changeset/base/297942

Log:
  libgssapi: avoid NULL pointer dereferences.
  
  While here also use NULL instead of zero for pointers.
  
  Found with coccinelle.
  
  MFC after:1 week

Modified:
  head/lib/libgssapi/gss_add_cred.c
  head/lib/libgssapi/gss_encapsulate_token.c
  head/lib/libgssapi/gss_get_mic.c
  head/lib/libgssapi/gss_inquire_context.c
  head/lib/libgssapi/gss_mech_switch.c
  head/lib/libgssapi/gss_pseudo_random.c
  head/lib/libgssapi/gss_verify_mic.c
  head/lib/libgssapi/gss_wrap.c
  head/lib/libgssapi/gss_wrap_size_limit.c

Modified: head/lib/libgssapi/gss_add_cred.c
==
--- head/lib/libgssapi/gss_add_cred.c   Wed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_add_cred.c   Wed Apr 13 21:08:02 2016
(r297942)
@@ -121,7 +121,7 @@ gss_add_cred(OM_uint32 *minor_status,
 * gss_add_cred for that mechanism, otherwise we copy the mc
 * to new_cred.
 */
-   target_mc = 0;
+   target_mc = NULL;
if (cred) {
SLIST_FOREACH(mc, &cred->gc_mc, gmc_link) {
if (gss_oid_equal(mc->gmc_mech_oid, desired_mech)) {
@@ -151,7 +151,7 @@ gss_add_cred(OM_uint32 *minor_status,
return (major_status);
}
} else {
-   mn = 0;
+   mn = NULL;
}
 
m = _gss_find_mech_switch(desired_mech);

Modified: head/lib/libgssapi/gss_encapsulate_token.c
==
--- head/lib/libgssapi/gss_encapsulate_token.c  Wed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_encapsulate_token.c  Wed Apr 13 21:08:02 2016
(r297942)
@@ -47,7 +47,7 @@ gss_encapsulate_token(const gss_buffer_t
 * First time around, we calculate the size, second time, we
 * encode the token.
 */
-   p = 0;
+   p = NULL;
for (i = 0; i < 2; i++) {
len = 0;
 

Modified: head/lib/libgssapi/gss_get_mic.c
==
--- head/lib/libgssapi/gss_get_mic.cWed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_get_mic.cWed Apr 13 21:08:02 2016
(r297942)
@@ -40,13 +40,14 @@ gss_get_mic(OM_uint32 *minor_status,
 gss_buffer_t message_token)
 {
struct _gss_context *ctx = (struct _gss_context *) context_handle;
-   struct _gss_mech_switch *m = ctx->gc_mech;
+   struct _gss_mech_switch *m;
 
_gss_buffer_zero(message_token);
if (ctx == NULL) {
*minor_status = 0;
return (GSS_S_NO_CONTEXT);
}
+   m = ctx->gc_mech;
 
return (m->gm_get_mic(minor_status, ctx->gc_ctx, qop_req,
message_buffer, message_token));

Modified: head/lib/libgssapi/gss_inquire_context.c
==
--- head/lib/libgssapi/gss_inquire_context.cWed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_inquire_context.cWed Apr 13 21:08:02 2016
(r297942)
@@ -99,7 +99,7 @@ gss_inquire_context(OM_uint32 *minor_sta
if (src_name)
gss_release_name(minor_status, src_name);
m->gm_release_name(minor_status, &src_mn);
-   minor_status = 0;
+   minor_status = NULL;
return (GSS_S_FAILURE);
}
*targ_name = (gss_name_t) name;

Modified: head/lib/libgssapi/gss_mech_switch.c
==
--- head/lib/libgssapi/gss_mech_switch.cWed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_mech_switch.cWed Apr 13 21:08:02 2016
(r297942)
@@ -83,7 +83,7 @@ _gss_string_to_oid(const char* s, gss_OI
 * out the size. Second time around, we actually encode the
 * number.
 */
-   res = 0;
+   res = NULL;
for (i = 0; i < 2; i++) {
byte_count = 0;
for (p = s, j = 0; p; p = q, j++) {

Modified: head/lib/libgssapi/gss_pseudo_random.c
==
--- head/lib/libgssapi/gss_pseudo_random.c  Wed Apr 13 21:01:58 2016
(r297941)
+++ head/lib/libgssapi/gss_pseudo_random.c  Wed Apr 13 21:08:02 2016
(r297942)
@@ -48,7 +48,7 @@ gss_pseudo_random(OM_uint32 *minor_statu
  gss_buffer_t prf_out)
 {
 struct _gss_context *ctx = (struct _gss_context *) context;
-struct _gss_mech_switch *m = ctx->gc_mech;
+struct _gss_mech_switch *m;
 OM_uint32 major_status;
 
 _gss_buffer_zero(prf_out);
@@ -58,6 +58,7 @@ 

svn commit: r297941 - head/tools/build/options

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Wed Apr 13 21:01:58 2016
New Revision: 297941
URL: https://svnweb.freebsd.org/changeset/base/297941

Log:
  Note the brokenness of WITHOUT_INSTALLLIB.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/build/options/WITHOUT_INSTALLLIB

Modified: head/tools/build/options/WITHOUT_INSTALLLIB
==
--- head/tools/build/options/WITHOUT_INSTALLLIB Wed Apr 13 21:00:00 2016
(r297940)
+++ head/tools/build/options/WITHOUT_INSTALLLIB Wed Apr 13 21:01:58 2016
(r297941)
@@ -3,3 +3,6 @@ Set this if you do not want to install o
 For example when creating a
 .Xr nanobsd 8
 image.
+.Bf -symbolic
+The option does not work for build targets.
+.Ef
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-13 Thread Ed Maste
Author: emaste
Date: Wed Apr 13 21:00:00 2016
New Revision: 297940
URL: https://svnweb.freebsd.org/changeset/base/297940

Log:
  arm64: Avoid null dereference in its_init_cpu
  
  its_init_cpu() is called from gic_v3_init_secondary(), and its_sc will
  be NULL if its did not attach.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/arm64/arm64/gic_v3_its.c
==
--- head/sys/arm64/arm64/gic_v3_its.c   Wed Apr 13 20:55:05 2016
(r297939)
+++ head/sys/arm64/arm64/gic_v3_its.c   Wed Apr 13 21:00:00 2016
(r297940)
@@ -565,7 +565,7 @@ its_init_cpu(struct gic_v3_its_softc *sc
 * this function was called during GICv3 secondary initialization.
 */
if (sc == NULL) {
-   if (device_is_attached(its_sc->dev)) {
+   if (its_sc != NULL && device_is_attached(its_sc->dev)) {
/*
 * XXX ARM64TODO: This is part of the workaround that
 * saves ITS software context for further use in
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297939 - head/tools/build/options

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Wed Apr 13 20:55:05 2016
New Revision: 297939
URL: https://svnweb.freebsd.org/changeset/base/297939

Log:
  The build does work now with WITHOUT_TOOLCHAIN.
  
  The bootstrap cross tools are still built in this mode as well.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tools/build/options/WITHOUT_TOOLCHAIN

Modified: head/tools/build/options/WITHOUT_TOOLCHAIN
==
--- head/tools/build/options/WITHOUT_TOOLCHAIN  Wed Apr 13 20:43:02 2016
(r297938)
+++ head/tools/build/options/WITHOUT_TOOLCHAIN  Wed Apr 13 20:55:05 2016
(r297939)
@@ -2,6 +2,3 @@
 Set to not install header or
 programs used for program development,
 compilers, debuggers etc.
-.Bf -symbolic
-The option does not work for build targets.
-.Ef
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297938 - head/release

2016-04-13 Thread Bryan Drewery
Author: bdrewery
Date: Wed Apr 13 20:43:02 2016
New Revision: 297938
URL: https://svnweb.freebsd.org/changeset/base/297938

Log:
  Remove misspelled and redundant MK_INSTALLIB=no.

Modified:
  head/release/Makefile

Modified: head/release/Makefile
==
--- head/release/Makefile   Wed Apr 13 20:32:35 2016(r297937)
+++ head/release/Makefile   Wed Apr 13 20:43:02 2016(r297938)
@@ -200,7 +200,7 @@ bootonly: packagesystem
MK_GAMES=no MK_GROFF=no \
MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \
-   MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \
+   MK_RESCUE=no MK_DICT=no \
MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no
 # Copy manifest only (no distfiles) to get checksums
mkdir -p ${.TARGET}/usr/freebsd-dist
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297937 - head/bin/sh

2016-04-13 Thread Jilles Tjoelker
Author: jilles
Date: Wed Apr 13 20:32:35 2016
New Revision: 297937
URL: https://svnweb.freebsd.org/changeset/base/297937

Log:
  sh: Simplify code by removing variable bracketed_name.

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cWed Apr 13 20:15:49 2016(r297936)
+++ head/bin/sh/parser.cWed Apr 13 20:32:35 2016(r297937)
@@ -1616,7 +1616,6 @@ parsesub: {
int flags;
char *p;
static const char types[] = "}-+?=";
-   int bracketed_name = 0; /* used to handle ${[0-9]*} variables */
int linno;
int length;
int c1;
@@ -1640,7 +1639,6 @@ parsesub: {
subtype = VSNORMAL;
flags = 0;
if (c == '{') {
-   bracketed_name = 1;
c = pgetc_linecont();
subtype = 0;
}
@@ -1665,7 +1663,7 @@ varname:
flags |= VSLINENO;
}
} else if (is_digit(c)) {
-   if (bracketed_name) {
+   if (subtype != VSNORMAL) {
do {
STPUTC(c, out);
c = pgetc_linecont();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297936 - head/sys/kern

2016-04-13 Thread Jamie Gritton
Author: jamie
Date: Wed Apr 13 20:15:49 2016
New Revision: 297936
URL: https://svnweb.freebsd.org/changeset/base/297936

Log:
  Separate POSIX mqueue objects in jails; actually, separate them by the
  jail's root, so jails that don't have their own filesystem directory
  also won't have their own mqueue namespace.
  
  PR:   208082

Modified:
  head/sys/kern/uipc_mqueue.c

Modified: head/sys/kern/uipc_mqueue.c
==
--- head/sys/kern/uipc_mqueue.c Wed Apr 13 20:14:13 2016(r297935)
+++ head/sys/kern/uipc_mqueue.c Wed Apr 13 20:15:49 2016(r297936)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,8 +61,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -132,6 +133,7 @@ struct mqfs_node {
LIST_HEAD(,mqfs_node)   mn_children;
LIST_ENTRY(mqfs_node)   mn_sibling;
LIST_HEAD(,mqfs_vdata)  mn_vnodes;
+   const void  *mn_pr_root;
int mn_refcount;
mqfs_type_t mn_type;
int mn_deleted;
@@ -152,6 +154,11 @@ struct mqfs_node {
 #defineFPTOMQ(fp)  ((struct mqueue *)(((struct mqfs_node *) \
(fp)->f_data)->mn_data))
 
+struct mqfs_osd {
+   struct task mo_task;
+   const void  *mo_pr_root;
+};
+
 TAILQ_HEAD(msgq, mqueue_msg);
 
 struct mqueue;
@@ -219,6 +226,7 @@ static uma_zone_t   mvdata_zone;
 static uma_zone_t  mqnoti_zone;
 static struct vop_vector   mqfs_vnodeops;
 static struct fileops  mqueueops;
+static unsignedmqfs_osd_jail_slot;
 
 /*
  * Directory structure construction and manipulation
@@ -236,6 +244,9 @@ static int  mqfs_destroy(struct mqfs_node
 static voidmqfs_fileno_alloc(struct mqfs_info *mi, struct mqfs_node *mn);
 static voidmqfs_fileno_free(struct mqfs_info *mi, struct mqfs_node *mn);
 static int mqfs_allocv(struct mount *mp, struct vnode **vpp, struct 
mqfs_node *pn);
+static int mqfs_prison_create(void *obj, void *data);
+static voidmqfs_prison_destructor(void *data);
+static voidmqfs_prison_remove_task(void *context, int pending);
 
 /*
  * Message queue construction and maniplation
@@ -436,6 +447,7 @@ mqfs_create_node(const char *name, int n
 
node = mqnode_alloc();
strncpy(node->mn_name, name, namelen);
+   node->mn_pr_root = cred->cr_prison->pr_root;
node->mn_type = nodetype;
node->mn_refcount = 1;
vfs_timestamp(&node->mn_birth);
@@ -644,6 +656,10 @@ mqfs_init(struct vfsconf *vfc)
 {
struct mqfs_node *root;
struct mqfs_info *mi;
+   struct prison *pr;
+   osd_method_t methods[PR_MAXMETHOD] = {
+   [PR_METHOD_CREATE] = mqfs_prison_create,
+   };
 
mqnode_zone = uma_zcreate("mqnode", sizeof(struct mqfs_node),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
@@ -670,6 +686,12 @@ mqfs_init(struct vfsconf *vfc)
EVENTHANDLER_PRI_ANY);
mq_fdclose = mqueue_fdclose;
p31b_setcfg(CTL_P1003_1B_MESSAGE_PASSING, _POSIX_MESSAGE_PASSING);
+   /* Note current jails */
+   mqfs_osd_jail_slot = osd_jail_register(mqfs_prison_destructor, methods);
+   sx_slock(&allprison_lock);
+   TAILQ_FOREACH(pr, &allprison, pr_list)
+   (void)mqfs_prison_create(pr, NULL);
+   sx_sunlock(&allprison_lock);
return (0);
 }
 
@@ -679,10 +701,14 @@ mqfs_init(struct vfsconf *vfc)
 static int
 mqfs_uninit(struct vfsconf *vfc)
 {
+   unsigned slot;
struct mqfs_info *mi;
 
if (!unloadable)
return (EOPNOTSUPP);
+   slot = mqfs_osd_jail_slot;
+   mqfs_osd_jail_slot = 0;
+   osd_jail_deregister(slot);
EVENTHANDLER_DEREGISTER(process_exit, exit_tag);
mi = &mqfs_data;
mqfs_destroy(mi->mi_root);
@@ -800,13 +826,17 @@ found:
  * Search a directory entry
  */
 static struct mqfs_node *
-mqfs_search(struct mqfs_node *pd, const char *name, int len)
+mqfs_search(struct mqfs_node *pd, const char *name, int len, struct ucred 
*cred)
 {
struct mqfs_node *pn;
+   const void *pr_root;
 
sx_assert(&pd->mn_info->mi_lock, SX_LOCKED);
+   pr_root = cred->cr_prison->pr_root;
LIST_FOREACH(pn, &pd->mn_children, mn_sibling) {
-   if (strncmp(pn->mn_name, name, len) == 0 &&
+   /* Only match names within the same prison root directory */
+   if ((pn->mn_pr_root == NULL || pn->mn_pr_root == pr_root) &&
+   strncmp(pn->mn_name, name, len) == 0 &&
pn->mn_name[len] == '\0')
return (pn);
}
@@ -878,7 +908,7 @@ mqfs_lookupx(struct vop_cachedlookup_arg
 
/* named node */
sx_xlock(&mqfs->mi_loc

svn commit: r297935 - head/sys/kern

2016-04-13 Thread Jamie Gritton
Author: jamie
Date: Wed Apr 13 20:14:13 2016
New Revision: 297935
URL: https://svnweb.freebsd.org/changeset/base/297935

Log:
  Separate POSIX sem/shm objects in jails, by prepending the jail's path
  name to the object's "path".  While the objects don't have real path
  names, it's a filesystem-like namespace, which allows jails to be
  kept to their own space, but still allows the system / jail parent to
  access a jail's IPC.
  
  PR:   208082

Modified:
  head/sys/kern/uipc_sem.c
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_sem.c
==
--- head/sys/kern/uipc_sem.cWed Apr 13 20:12:02 2016(r297934)
+++ head/sys/kern/uipc_sem.cWed Apr 13 20:14:13 2016(r297935)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -258,7 +259,9 @@ ksem_closef(struct file *fp, struct thre
 static int
 ksem_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
 {
+   const char *path, *pr_path;
struct ksem *ks;
+   size_t pr_pathlen;
 
kif->kf_type = KF_TYPE_SEM;
ks = fp->f_data;
@@ -269,7 +272,19 @@ ksem_fill_kinfo(struct file *fp, struct 
if (ks->ks_path != NULL) {
sx_slock(&ksem_dict_lock);
if (ks->ks_path != NULL)
-   strlcpy(kif->kf_path, ks->ks_path, 
sizeof(kif->kf_path));
+   {
+   path = ks->ks_path;
+   pr_path = curthread->td_ucred->cr_prison->pr_path;
+   if (strcmp(pr_path, "/") != 0)
+   {
+   /* Return the jail-rooted pathname */
+   pr_pathlen = strlen(pr_path);
+   if (strncmp(path, pr_path, pr_pathlen) == 0 &&
+   path[pr_pathlen] == '/')
+   path += pr_pathlen;
+   }
+   strlcpy(kif->kf_path, path, sizeof(kif->kf_path));
+   }
sx_sunlock(&ksem_dict_lock);
}
return (0);
@@ -449,6 +464,8 @@ ksem_create(struct thread *td, const cha
struct ksem *ks;
struct file *fp;
char *path;
+   const char *pr_path;
+   size_t pr_pathlen;
Fnv32_t fnv;
int error, fd;
 
@@ -485,10 +502,15 @@ ksem_create(struct thread *td, const cha
ks->ks_flags |= KS_ANONYMOUS;
} else {
path = malloc(MAXPATHLEN, M_KSEM, M_WAITOK);
-   error = copyinstr(name, path, MAXPATHLEN, NULL);
+   pr_path = td->td_ucred->cr_prison->pr_path;
+   /* Construct a full pathname for jailed callers */
+   pr_pathlen = strcmp(pr_path, "/") == 0 ? 0
+   : strlcpy(path, pr_path, MAXPATHLEN);
+   error = copyinstr(name, path + pr_pathlen,
+   MAXPATHLEN - pr_pathlen, NULL);
 
/* Require paths to start with a '/' character. */
-   if (error == 0 && path[0] != '/')
+   if (error == 0 && path[pr_pathlen] != '/')
error = EINVAL;
if (error) {
fdclose(td, fp, fd);
@@ -624,11 +646,17 @@ int
 sys_ksem_unlink(struct thread *td, struct ksem_unlink_args *uap)
 {
char *path;
+   const char *pr_path;
+   size_t pr_pathlen;
Fnv32_t fnv;
int error;
 
path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
-   error = copyinstr(uap->name, path, MAXPATHLEN, NULL);
+   pr_path = td->td_ucred->cr_prison->pr_path;
+   pr_pathlen = strcmp(pr_path, "/") == 0 ? 0
+   : strlcpy(path, pr_path, MAXPATHLEN);
+   error = copyinstr(uap->name, path + pr_pathlen, MAXPATHLEN - pr_pathlen,
+   NULL);
if (error) {
free(path, M_TEMP);
return (error);

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cWed Apr 13 20:12:02 2016(r297934)
+++ head/sys/kern/uipc_shm.cWed Apr 13 20:14:13 2016(r297935)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -687,6 +688,8 @@ kern_shm_open(struct thread *td, const c
struct shmfd *shmfd;
struct file *fp;
char *path;
+   const char *pr_path;
+   size_t pr_pathlen;
Fnv32_t fnv;
mode_t cmode;
int fd, error;
@@ -723,13 +726,18 @@ kern_shm_open(struct thread *td, const c
shmfd = shm_alloc(td->td_ucred, cmode);
} else {
path = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK);
-   error = copyinstr(userpath, path, MAXPATHLEN, NULL);
+   pr_path = td->td_ucred->cr_prison->pr_path;
+   

svn commit: r297933 - in head/sys/cam: . ata

2016-04-13 Thread Scott Long
Author: scottl
Date: Wed Apr 13 20:10:06 2016
New Revision: 297933
URL: https://svnweb.freebsd.org/changeset/base/297933

Log:
  Add sbuf variants ata_cmd_sbuf() and ata_res_sbuf(), and reimplement the
  _string variants on top of this.  This requires a change to the function
  signature of ata_res_sbuf().  Its use in the tree seems to be very limited,
  and the change makes it more consistent with the rest of the API.
  
  Reviewed by:  imp, mav, kenm
  Sponsored by: Netflix
  Differential Revision:D5940

Modified:
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_all.h
  head/sys/cam/cam.c

Modified: head/sys/cam/ata/ata_all.c
==
--- head/sys/cam/ata/ata_all.c  Wed Apr 13 18:39:33 2016(r297932)
+++ head/sys/cam/ata/ata_all.c  Wed Apr 13 20:10:06 2016(r297933)
@@ -211,29 +211,64 @@ ata_op_string(struct ata_cmd *cmd)
 char *
 ata_cmd_string(struct ata_cmd *cmd, char *cmd_string, size_t len)
 {
+   struct sbuf sb;
+   int error;
 
-   snprintf(cmd_string, len, "%02x %02x %02x %02x "
+   if (len == 0)
+   return ("");
+
+   sbuf_new(&sb, cmd_string, len, SBUF_FIXEDLEN);
+   ata_cmd_sbuf(cmd, &sb);
+
+   error = sbuf_finish(&sb);
+   if (error != 0 && error != ENOMEM)
+   return ("");
+
+   return(sbuf_data(&sb));
+}
+
+void
+ata_cmd_sbuf(struct ata_cmd *cmd, struct sbuf *sb)
+{
+   sbuf_printf(sb, "%02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x",
cmd->command, cmd->features,
cmd->lba_low, cmd->lba_mid, cmd->lba_high, cmd->device,
cmd->lba_low_exp, cmd->lba_mid_exp, cmd->lba_high_exp,
cmd->features_exp, cmd->sector_count, cmd->sector_count_exp);
-
-   return(cmd_string);
 }
 
 char *
 ata_res_string(struct ata_res *res, char *res_string, size_t len)
 {
+   struct sbuf sb;
+   int error;
+
+   if (len == 0)
+   return ("");
+
+   sbuf_new(&sb, res_string, len, SBUF_FIXEDLEN);
+   ata_res_sbuf(res, &sb);
+
+   error = sbuf_finish(&sb);
+   if (error != 0 && error != ENOMEM)
+   return ("");
+
+   return(sbuf_data(&sb));
+}
+
+int
+ata_res_sbuf(struct ata_res *res, struct sbuf *sb)
+{
 
-   snprintf(res_string, len, "%02x %02x %02x %02x "
+   sbuf_printf(sb, "%02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x",
res->status, res->error,
res->lba_low, res->lba_mid, res->lba_high, res->device,
res->lba_low_exp, res->lba_mid_exp, res->lba_high_exp,
res->sector_count, res->sector_count_exp);
 
-   return(res_string);
+   return (0);
 }
 
 /*
@@ -242,11 +277,10 @@ ata_res_string(struct ata_res *res, char
 int
 ata_command_sbuf(struct ccb_ataio *ataio, struct sbuf *sb)
 {
-   char cmd_str[(12 * 3) + 1];
 
-   sbuf_printf(sb, "%s. ACB: %s",
-   ata_op_string(&ataio->cmd),
-   ata_cmd_string(&ataio->cmd, cmd_str, sizeof(cmd_str)));
+   sbuf_printf(sb, "%s. ACB: ",
+   ata_op_string(&ataio->cmd));
+   ata_cmd_sbuf(&ataio->cmd, sb);
 
return(0);
 }
@@ -284,20 +318,6 @@ ata_status_sbuf(struct ccb_ataio *ataio,
return(0);
 }
 
-/*
- * ata_res_sbuf() returns 0 for success and -1 for failure.
- */
-int
-ata_res_sbuf(struct ccb_ataio *ataio, struct sbuf *sb)
-{
-   char res_str[(11 * 3) + 1];
-
-   sbuf_printf(sb, "RES: %s",
-   ata_res_string(&ataio->res, res_str, sizeof(res_str)));
-
-   return(0);
-}
-
 void
 ata_print_ident(struct ata_params *ident_data)
 {

Modified: head/sys/cam/ata/ata_all.h
==
--- head/sys/cam/ata/ata_all.h  Wed Apr 13 18:39:33 2016(r297932)
+++ head/sys/cam/ata/ata_all.h  Wed Apr 13 20:10:06 2016(r297933)
@@ -103,10 +103,11 @@ int   ata_version(int ver);
 
 char * ata_op_string(struct ata_cmd *cmd);
 char * ata_cmd_string(struct ata_cmd *cmd, char *cmd_string, size_t len);
+void   ata_cmd_sbuf(struct ata_cmd *cmd, struct sbuf *sb);
 char * ata_res_string(struct ata_res *res, char *res_string, size_t len);
 intata_command_sbuf(struct ccb_ataio *ataio, struct sbuf *sb);
 intata_status_sbuf(struct ccb_ataio *ataio, struct sbuf *sb);
-intata_res_sbuf(struct ccb_ataio *ataio, struct sbuf *sb);
+intata_res_sbuf(struct ata_res *res, struct sbuf *sb);
 
 void   ata_print_ident(struct ata_params *ident_data);
 void   ata_print_ident_short(struct ata_params *ident_data);

Modified: head/sys/cam/cam.c
==
--- head/sys/cam/cam.c  Wed Apr 13 18:39:33 2016(r297932)
+++ head/sys/cam/cam.c  Wed Apr 13 20:10:06 2016(r297933)
@@ -412,7 +412,8 @@ cam_error_string(struct cam_device *devi
}
if (proto_flags & CAM_EAF_PRINT_RE

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

2016-04-13 Thread John Baldwin
Author: jhb
Date: Wed Apr 13 18:39:33 2016
New Revision: 297932
URL: https://svnweb.freebsd.org/changeset/base/297932

Log:
  Handle PBA that shares a page with MSI-X table for passthrough devices.
  
  If the PBA shares a page with the MSI-X table, map the shared page via
  /dev/mem and emulate accesses to the portion of the PBA in the shared
  page by accessing the mapped page.
  
  Reviewed by:  grehan
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D5919

Modified:
  head/usr.sbin/bhyve/pci_emul.h
  head/usr.sbin/bhyve/pci_passthru.c

Modified: head/usr.sbin/bhyve/pci_emul.h
==
--- head/usr.sbin/bhyve/pci_emul.h  Wed Apr 13 17:37:31 2016
(r297931)
+++ head/usr.sbin/bhyve/pci_emul.h  Wed Apr 13 18:39:33 2016
(r297932)
@@ -142,6 +142,8 @@ struct pci_devinst {
int pba_size;
int function_mask;  
struct msix_table_entry *table; /* allocated at runtime */
+   void*pba_page;
+   int pba_page_offset;
} pi_msix;
 
void  *pi_arg;  /* devemu-private data */

Modified: head/usr.sbin/bhyve/pci_passthru.c
==
--- head/usr.sbin/bhyve/pci_passthru.c  Wed Apr 13 17:37:31 2016
(r297931)
+++ head/usr.sbin/bhyve/pci_passthru.c  Wed Apr 13 18:39:33 2016
(r297932)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -59,6 +60,10 @@ __FBSDID("$FreeBSD$");
 #define_PATH_DEVIO "/dev/io"
 #endif
 
+#ifndef _PATH_MEM
+#define_PATH_MEM   "/dev/mem"
+#endif
+
 #defineLEGACY_SUPPORT  1
 
 #define MSIX_TABLE_COUNT(ctrl) (((ctrl) & PCIM_MSIXCTRL_TABLE_SIZE) + 1)
@@ -66,6 +71,7 @@ __FBSDID("$FreeBSD$");
 
 static int pcifd = -1;
 static int iofd = -1;
+static int memfd = -1;
 
 struct passthru_softc {
struct pci_devinst *psc_pi;
@@ -279,6 +285,35 @@ msix_table_read(struct passthru_softc *s
int index;
 
pi = sc->psc_pi;
+   if (offset >= pi->pi_msix.pba_offset &&
+   offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) {
+   switch(size) {
+   case 1:
+   src8 = (uint8_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src8;
+   break;
+   case 2:
+   src16 = (uint16_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src16;
+   break;
+   case 4:
+   src32 = (uint32_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src32;
+   break;
+   case 8:
+   src64 = (uint64_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   data = *src64;
+   break;
+   default:
+   return (-1);
+   }
+   return (data);
+   }
+
if (offset < pi->pi_msix.table_offset)
return (-1);
 
@@ -320,12 +355,44 @@ msix_table_write(struct vmctx *ctx, int 
 {
struct pci_devinst *pi;
struct msix_table_entry *entry;
-   uint32_t *dest;
+   uint8_t *dest8;
+   uint16_t *dest16;
+   uint32_t *dest32;
+   uint64_t *dest64;
size_t entry_offset;
uint32_t vector_control;
int error, index;
 
pi = sc->psc_pi;
+   if (offset >= pi->pi_msix.pba_offset &&
+   offset < pi->pi_msix.pba_offset + pi->pi_msix.pba_size) {
+   switch(size) {
+   case 1:
+   dest8 = (uint8_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest8 = data;
+   break;
+   case 2:
+   dest16 = (uint16_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest16 = data;
+   break;
+   case 4:
+   dest32 = (uint32_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest32 = data;
+   break;
+   case 8:
+   dest64 = (uint64_t *)(pi->pi_msix.pba_page + offset -
+   pi->pi_msix.pba_page_offset);
+   *dest64 = data;
+   break;
+   default:
+   break;
+   }
+   return;
+   }
+
 

svn commit: r297931 - in head/sys: amd64/amd64 i386/i386

2016-04-13 Thread John Baldwin
Author: jhb
Date: Wed Apr 13 17:37:31 2016
New Revision: 297931
URL: https://svnweb.freebsd.org/changeset/base/297931

Log:
  Expose doreti as a global symbol on amd64 and i386.
  
  doreti provides the common code path for returning from interrupt
  andlers on x86.  Exposing doreti as a global symbol allows kernel
  modules to include low-level interrupt handlers instead of requiring
  all low-level handlers to be statically compiled into the kernel.
  
  Submitted by: Howard Su 
  Reviewed by:  kib

Modified:
  head/sys/amd64/amd64/exception.S
  head/sys/i386/i386/exception.s

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.SWed Apr 13 16:47:14 2016
(r297930)
+++ head/sys/amd64/amd64/exception.SWed Apr 13 17:37:31 2016
(r297931)
@@ -659,6 +659,7 @@ MCOUNT_LABEL(eintr)
.text
SUPERALIGN_TEXT
.type   doreti,@function
+   .globl  doreti
 doreti:
FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */
/*

Modified: head/sys/i386/i386/exception.s
==
--- head/sys/i386/i386/exception.s  Wed Apr 13 16:47:14 2016
(r297930)
+++ head/sys/i386/i386/exception.s  Wed Apr 13 17:37:31 2016
(r297931)
@@ -343,6 +343,7 @@ MCOUNT_LABEL(eintr)
.text
SUPERALIGN_TEXT
.type   doreti,@function
+   .globl  doreti
 doreti:
FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */
 doreti_next:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297926 - head/sys/cam/scsi

2016-04-13 Thread Scott Long
Author: scottl
Date: Wed Apr 13 15:57:13 2016
New Revision: 297926
URL: https://svnweb.freebsd.org/changeset/base/297926

Log:
  Use scsi_cdb_sbuf() inside of scsi_command_string now that the temporary
  string storage is no longer needed.
  
  MFC after:3 days
  Sponsored by: Netflix

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cWed Apr 13 15:43:11 2016
(r297925)
+++ head/sys/cam/scsi/scsi_all.cWed Apr 13 15:57:13 2016
(r297926)
@@ -3579,7 +3579,6 @@ scsi_command_string(struct cam_device *d
 #endif /* _KERNEL/!_KERNEL */
 {
struct scsi_inquiry_data *inq_data;
-   char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
 #ifdef _KERNEL
structccb_getdev *cgd;
 #endif /* _KERNEL */
@@ -3612,15 +3611,13 @@ scsi_command_string(struct cam_device *d
 #endif /* _KERNEL/!_KERNEL */
 
if ((csio->ccb_h.flags & CAM_CDB_POINTER) != 0) {
-   sbuf_printf(sb, "%s. CDB: %s", 
-   scsi_op_desc(csio->cdb_io.cdb_ptr[0], inq_data),
-   scsi_cdb_string(csio->cdb_io.cdb_ptr, cdb_str,
-   sizeof(cdb_str)));
+   sbuf_printf(sb, "%s. CDB: ", 
+   scsi_op_desc(csio->cdb_io.cdb_ptr[0], inq_data));
+   scsi_cdb_sbuf(csio->cdb_io.cdb_ptr, sb);
} else {
-   sbuf_printf(sb, "%s. CDB: %s",
-   scsi_op_desc(csio->cdb_io.cdb_bytes[0], inq_data),
-   scsi_cdb_string(csio->cdb_io.cdb_bytes, cdb_str,
-   sizeof(cdb_str)));
+   sbuf_printf(sb, "%s. CDB: ",
+   scsi_op_desc(csio->cdb_io.cdb_bytes[0], inq_data));
+   scsi_cdb_sbuf(csio->cdb_io.cdb_bytes, sb);
}
 
 #ifdef _KERNEL
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297925 - head/sys/cam/scsi

2016-04-13 Thread Scott Long
Author: scottl
Date: Wed Apr 13 15:43:11 2016
New Revision: 297925
URL: https://svnweb.freebsd.org/changeset/base/297925

Log:
  Add scsi_cdb_sbuf() for handling CDB strings.  Reimplement scsi_cdb_string()
  in terms of it.
  
  Reviewed by:  imp, mav, ken
  MFC after:3 days
  Sponsored by: Netflix
  Differential Revision:D5934

Modified:
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cWed Apr 13 15:22:43 2016
(r297924)
+++ head/sys/cam/scsi/scsi_all.cWed Apr 13 15:43:11 2016
(r297925)
@@ -3464,14 +3464,32 @@ scsi_error_action(struct ccb_scsiio *csi
 char *
 scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len)
 {
+   struct sbuf sb;
+   int error;
+
+   if (len == 0)
+   return ("");
+
+   sbuf_new(&sb, cdb_string, len, SBUF_FIXEDLEN);
+
+   scsi_cdb_sbuf(cdb_ptr, &sb);
+
+   /* ENOMEM just means that the fixed buffer is full, OK to ignore */
+   error = sbuf_finish(&sb);
+   if (error != 0 && error != ENOMEM)
+   return ("");
+
+   return(sbuf_data(&sb));
+}
+
+void
+scsi_cdb_sbuf(u_int8_t *cdb_ptr, struct sbuf *sb)
+{
u_int8_t cdb_len;
int i;
 
if (cdb_ptr == NULL)
-   return("");
-
-   /* Silence warnings */
-   cdb_len = 0;
+   return;
 
/*
 * This is taken from the SCSI-3 draft spec.
@@ -3508,12 +3526,11 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char 
cdb_len = 12;
break;
}
-   *cdb_string = '\0';
+
for (i = 0; i < cdb_len; i++)
-   snprintf(cdb_string + strlen(cdb_string),
-len - strlen(cdb_string), "%02hhx ", cdb_ptr[i]);
+   sbuf_printf(sb, "%02hhx ", cdb_ptr[i]);
 
-   return(cdb_string);
+   return;
 }
 
 const char *

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hWed Apr 13 15:22:43 2016
(r297924)
+++ head/sys/cam/scsi/scsi_all.hWed Apr 13 15:43:11 2016
(r297925)
@@ -3646,6 +3646,7 @@ const char *  scsi_op_desc(u_int16_t opco
 struct scsi_inquiry_data *inq_data);
 char * scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string,
size_t len);
+void   scsi_cdb_sbuf(u_int8_t *cdb_ptr, struct sbuf *sb);
 
 void   scsi_print_inquiry(struct scsi_inquiry_data *inq_data);
 void   scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: question about trimning data "len" conditions in TSO in tcp_output.c

2016-04-13 Thread Cui, Cheng
Hello Hans,

Does my previous email reach you well?

Thanks,
--Cheng Cui
NetApp Scale Out Networking




On 4/10/16, 4:44 PM, "Cui, Cheng"  wrote:

>Hi Hans,
>
>I would continue this discussion with a different change. The piece of
>change is
>here and also I attached the patch "change.patch" against the FreeBSD HEAD
>code-line.
>
>diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
>index 2043fc9..43b0737 100644
>--- a/sys/netinet/tcp_output.c
>+++ b/sys/netinet/tcp_output.c
>@@ -939,23 +939,15 @@ send:
>* emptied:
>*/
>   max_len = (tp->t_maxseg - optlen);
>-  if ((off + len) < sbavail(&so->so_snd)) {
>+  if (len > (max_len << 1)) {
>   moff = len % max_len;
>   if (moff != 0) {
>   len -= moff;
>   sendalot = 1;
>   }
>   }
>-
>-  /*
>-   * In case there are too many small fragments
>-   * don't use TSO:
>-   */
>-  if (len <= max_len) {
>-  len = max_len;
>-  sendalot = 1;
>-  tso = 0;
>-  }
>+  KASSERT(len >= max_len,
>+  ("[%s:%d]: len < max_len", __func__, __LINE__));
>   /*
>* Send the FIN in a separate segment
>
>
>
>
>I think this change could save additional loops that send single MSS-size
>packets. So I think some CPU cycles can be saved as well, due to this
>change 
>reduced software sends and pushed more data to offloading sends.
>
>Here is my test. The iperf command I choose pushes 100Mbytes data to the
>wire by setting the default TCP sendspace to 1MB and recvspace to 2MB. I
>tested this TCP connection performance on a pair of 10Gbps FreeBSD 10.2
>nodes 
>(s1 and r1) with a switch in between. Both nodes have TSO and delayed ACK
>enabled. 
>
>root@s1:~ # ping -c 3 r1
>PING r1-link1 (10.1.2.3): 56 data bytes
>64 bytes from 10.1.2.3: icmp_seq=0 ttl=64 time=0.045 ms
>64 bytes from 10.1.2.3: icmp_seq=1 ttl=64 time=0.037 ms
>64 bytes from 10.1.2.3: icmp_seq=2 ttl=64 time=0.038 ms
>
>--- r1-link1 ping statistics ---
>3 packets transmitted, 3 packets received, 0.0% packet loss
>round-trip min/avg/max/stddev = 0.037/0.040/0.045/0.004 ms
>
>1M snd buffer/2M rcv buffer
>sysctl -w net.inet.tcp.hostcache.expire=1
>sysctl -w net.inet.tcp.sendspace=1048576
>sysctl -w net.inet.tcp.recvspace=2097152
>
>iperf -s  <== iperf command@receiver
>iperf -c r1 -m -n 100M<== iperf command@sender
>
>root@s1:~ # iperf -c r1 -m -n 100M
>
>Client connecting to r1, TCP port 5001
>TCP window size: 1.00 MByte (default)
>
>[  3] local 10.1.2.2 port 22491 connected with 10.1.2.3 port 5001
>[ ID] Interval   Transfer Bandwidth
>[  3]  0.0- 0.3 sec   100 MBytes  2.69 Gbits/sec
>[  3] MSS size 1448 bytes (MTU 1500 bytes, ethernet)
>
>root@r1:~ # iperf -s
>
>Server listening on TCP port 5001
>TCP window size: 2.00 MByte (default)
>
>[  4] local 10.1.2.3 port 5001 connected with 10.1.2.2 port 22491
>[ ID] Interval   Transfer Bandwidth
>[  4]  0.0- 0.3 sec   100 MBytes  2.62 Gbits/sec
>
>Each test sent 100MBytes of data, and I collected the packet trace from
>both 
>nodes by tcpdump. I did this test twice to confirm the result can be
>reproduced.
>
>From the trace files of both nodes before my code change, I see a lot of
>single-MSS size packets. See the attached trace files in
>"before_change.zip".
>For example, in a sender trace file I see 43480 single-MSS size
>packets(tcp.len==1448) out of 57005 packets that contain data(tcp.len >
>0). 
>That's 76.2%.
>
>And I did the same iperf test and gathered trace files. I did not find
>many single-MSS packets this time. See the attached trace files in
>"after_change.zip". For example, in a sender trace file I see zero
>single-MSS 
>size packets(tcp.len==1448) out of 35729 data packets(tcp.len > 0).
>
>Compared with the receiver traces, I did not see significant more
>fractional 
>packets received after change.
>
>I also did tests using netperf, although I did not get enough 95%
>confidence for
>every test on snd/rcv buffer size. Attached are my netperf result on
>different
>snd/rcv buffer size before and after the change (netperf_before_change.txt
>and 
>netperf_after_change.txt), which also look good.
>
>used netperf command:
>netperf -H s1 -t TCP_STREAM -C -c -l 400 -i 10,3 -I 95,10 -- -s
>${LocalSndBuf} -S ${RemoteSndBuf}
>
>
>Thanks,
>--

svn commit: r297923 - head/lib/libvgl

2016-04-13 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 13 14:59:50 2016
New Revision: 297923
URL: https://svnweb.freebsd.org/changeset/base/297923

Log:
  libvgl: do not initialize static storage.
  
  The pointer value was being initialized to 0. While it would
  have been better to use NULL here, it is static storage so
  there is no need to do so.

Modified:
  head/lib/libvgl/text.c

Modified: head/lib/libvgl/text.c
==
--- head/lib/libvgl/text.c  Wed Apr 13 13:14:18 2016(r297922)
+++ head/lib/libvgl/text.c  Wed Apr 13 14:59:50 2016(r297923)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "vgl.h"
 
-static VGLText *VGLTextFont = 0;
+static VGLText *VGLTextFont;
 
 extern byte VGLFont[];
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297922 - head/sys/dev/bxe

2016-04-13 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr 13 13:14:18 2016
New Revision: 297922
URL: https://svnweb.freebsd.org/changeset/base/297922

Log:
  reversed commits r297916 r297909 r297898 due to i386 build failures.
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_stats.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Apr 13 12:32:58 2016(r297921)
+++ head/sys/dev/bxe/bxe.c  Wed Apr 13 13:14:18 2016(r297922)
@@ -672,6 +672,7 @@ static void bxe_handle_fp_tq(void *conte
 
 static int bxe_add_cdev(struct bxe_softc *sc);
 static void bxe_del_cdev(struct bxe_softc *sc);
+static int bxe_grc_dump(struct bxe_softc *sc);
 static int bxe_alloc_buf_rings(struct bxe_softc *sc);
 static void bxe_free_buf_rings(struct bxe_softc *sc);
 
@@ -3448,10 +3449,6 @@ bxe_watchdog(struct bxe_softc*sc,
 }
 
 BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index);
-if(sc->trigger_grcdump) {
- /* taking grcdump */
- bxe_grc_dump(sc);
-}
 
 BXE_FP_TX_UNLOCK(fp);
 
@@ -15640,6 +15637,30 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
 }
 
 static int
+bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
+{
+struct bxe_softc *sc;
+int error, result;
+
+result = 0;
+error = sysctl_handle_int(oidp, &result, 0, req);
+
+if (error || !req->newptr) {
+return (error);
+}
+
+if (result == 1) {
+sc = (struct bxe_softc *)arg1;
+
+BLOGI(sc, "... grcdump start ...\n");
+bxe_grc_dump(sc);
+BLOGI(sc, "... grcdump done ...\n");
+}
+
+return (error);
+}
+
+static int
 bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
 {
 struct bxe_softc *sc = (struct bxe_softc *)arg1;
@@ -15790,16 +15811,14 @@ bxe_add_sysctls(struct bxe_softc *sc)
 "debug logging mode");
 #endif /* #if __FreeBSD_version >= 90 */
 
-sc->trigger_grcdump = 0;
-SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
-   CTLFLAG_RW, &sc->trigger_grcdump, 0,
-   "trigger grcdump should be invoked"
-   "  before collecting grcdump");
+SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
+CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
+bxe_sysctl_trigger_grcdump, "IU",
+"set by driver when a grcdump is needed");
 
-sc->grcdump_started = 0;
 sc->grcdump_done = 0;
 SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
-   CTLFLAG_RD, &sc->grcdump_done, 0,
+   CTLFLAG_RW, &sc->grcdump_done, 0,
"set by driver when grcdump is done");
 
 sc->rx_budget = bxe_rx_budget;
@@ -18631,7 +18650,7 @@ bxe_get_preset_regs(struct bxe_softc *sc
 return 0;
 }
 
-int
+static int
 bxe_grc_dump(struct bxe_softc *sc)
 {
 int rval = 0;
@@ -18639,53 +18658,12 @@ bxe_grc_dump(struct bxe_softc *sc)
 uint8_t *buf;
 uint32_t size;
 struct  dump_header *d_hdr;
-uint32_t i;
-uint32_t reg_val;
-uint32_t reg_addr;
-uint32_t cmd_offset;
-int context_size;
-int allocated;
-struct ecore_ilt *ilt = SC_ILT(sc);
-struct bxe_fastpath *fp;
-struct ilt_client_info *ilt_cli;
-int grc_dump_size;
 
-
-if (sc->grcdump_done || sc->grcdump_started)
+if (sc->grcdump_done)
return (rval);
 
-sc->grcdump_started = 1;
-BLOGI(sc, "Started collecting grcdump\n");
-
-grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) +
-sizeof(struct  dump_header);
-
-sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT);
-
-if (sc->grc_dump == NULL) {
-BLOGW(sc, "Unable to allocate memory for grcdump collection\n");
-return(ENOMEM);
-}
-
-
-
-/* Disable parity attentions as long as following dump may
- * cause false alarms by reading never written registers. We
- * will re-enable parity attentions right after the dump.
- */
-
-/* Disable parity on path 0 */
-bxe_pretend_func(sc, 0);
-
 ecore_disable_blocks_parity(sc);
 
-/* Disable parity on path 1 */
-bxe_pretend_func(sc, 1);
-ecore_disable_blocks_parity(sc);
-
-/* Return to current function */
-bxe_pretend_func(sc, SC_ABS_FUNC(sc));
-
 buf = sc->grc_dump;
 d_hdr = sc->grc_dump;
 
@@ -18717,7 +18695,7 @@ bxe_grc_dump(struct bxe_softc *sc)
 (preset_idx == 11))
 continue;
 
-rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx);
+rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx);
 
if (rval)
 break;
@@ -18727,81 +18705,9 @@ bxe_grc_dump(struct bxe_softc *sc)
 buf += size;
 }
 
-bxe_pretend_func(sc, 0);
-ecore_clear_blocks_parity(sc);
-ecore_enable_blocks_parity(sc);
-
-bxe_pretend_func(sc, 1);
 ecore_clear_blocks_parity(sc);

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

2016-04-13 Thread Alexander Motin
Author: mav
Date: Wed Apr 13 12:32:58 2016
New Revision: 297921
URL: https://svnweb.freebsd.org/changeset/base/297921

Log:
  Add hint.ahci.X.quirks tunable for some odd cases.
  
  MFC after:2 weeks

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

Modified: head/sys/dev/ahci/ahci_pci.c
==
--- head/sys/dev/ahci/ahci_pci.cWed Apr 13 12:05:01 2016
(r297920)
+++ head/sys/dev/ahci/ahci_pci.cWed Apr 13 12:32:58 2016
(r297921)
@@ -423,6 +423,8 @@ ahci_pci_attach(device_t dev)
pci_get_subvendor(dev) == 0x1043 &&
pci_get_subdevice(dev) == 0x81e4)
ctlr->quirks |= AHCI_Q_SATA1_UNIT0;
+   resource_int_value(device_get_name(dev), device_get_unit(dev),
+   "quirks", &ctlr->quirks);
ctlr->vendorid = pci_get_vendor(dev);
ctlr->deviceid = pci_get_device(dev);
ctlr->subvendorid = pci_get_subvendor(dev);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r297902 - head

2016-04-13 Thread Steve Wills
On 04/13/16 04:12 AM, Peter Jeremy wrote:
> On 2016-Apr-13 01:47:05 +, Steve Wills  wrote:
>> +.if !defined(SVN) || empty(SVN)
>> +. for _P in /usr/bin /usr/local/bin
>> +.  for _S in svn svnlite
>> +.   if exists(${_P}/${_S})
>> +SVN=   ${_P}/${_S}
>> +.   endif
>> +.  endfor
>> +. endfor
>> +.endif
> 
> What is the preferred choice here?  The given order prefers ports over base
> (which makes sense) but then prefers svnlite over svn.  I would expect
> either the opposite directory order in _P (prefer svnlite in base) or the
> opposite command order in _S (prefer svn in ports).
> 
> In normal use, this will wind up with either /usr/local/bin/svn or
> /usr/bin/svnlite (in that order) but a non-standard configuration could
> result in different results.
> 

You also end up with /usr/bin/svn if WITH_SVN is set (in which case
/usr/bin/svnlite wouldn't exist). There wouldn't be a
/usr/local/bin/svnlite, at least normally.

The preference would be for /usr/local/bin/svn over /usr/bin/svn* (user
went out of their way to make this exist, they must want to use it).
Then for whichever of /usr/bin/svnlite or /usr/bin/svn exists.

This isn't to say that one is better than another. The goal here was
just to try harder to find it out of the box.

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


RE: svn commit: r297898 - head/sys/dev/bxe

2016-04-13 Thread David Somayajulu
Hi Sepherosa,
I just saw it and am taking a look at it. Give me a few minutes and I will get 
back.
Thanks
David S.

-Original Message-
From: Sepherosa Ziehau [mailto:sepher...@gmail.com] 
Sent: Tuesday, April 12, 2016 8:43 PM
To: David C Somayajulu 
Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@freebsd.org
Subject: Re: svn commit: r297898 - head/sys/dev/bxe

Hi David,

BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
sc->context[i].size);

This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:

/usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies type 
'uintmax_t' (aka 'unsigned long long') but the argument has type 'bus_addr_t' 
(aka 'unsigned int') [-Werror,-Wformat]
sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
^


On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  wrote:
> Author: davidcs
> Date: Wed Apr 13 00:53:04 2016
> New Revision: 297898
> URL: https://svnweb.freebsd.org/changeset/base/297898
>
> Log:
>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
>  basis.
>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>  sysctl flag is set.
>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>
>   Submitted by:vaishali.kulka...@qlogic.com
>   Approved by:davi...@freebsd.org
>   MFC after:5 days
>
> Modified:
>   head/sys/dev/bxe/bxe.c
>   head/sys/dev/bxe/bxe.h
>   head/sys/dev/bxe/bxe_stats.c
>
> Modified: head/sys/dev/bxe/bxe.c
> ==
> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>
>  static int bxe_add_cdev(struct bxe_softc *sc);  static void 
> bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct 
> bxe_softc *sc);  static int bxe_alloc_buf_rings(struct bxe_softc *sc);  
> static void bxe_free_buf_rings(struct bxe_softc *sc);
>
> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>  }
>
>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", 
> fp->index);
> +if(sc->trigger_grcdump) {
> + /* taking grcdump */
> + bxe_grc_dump(sc);
> +}
>
>  BXE_FP_TX_UNLOCK(fp);
>
> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>  }
>
>  static int
> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
> -{
> -struct bxe_softc *sc;
> -int error, result;
> -
> -result = 0;
> -error = sysctl_handle_int(oidp, &result, 0, req);
> -
> -if (error || !req->newptr) {
> -return (error);
> -}
> -
> -if (result == 1) {
> -sc = (struct bxe_softc *)arg1;
> -
> -BLOGI(sc, "... grcdump start ...\n");
> -bxe_grc_dump(sc);
> -BLOGI(sc, "... grcdump done ...\n");
> -}
> -
> -return (error);
> -}
> -
> -static int
>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>  {
>  struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14 
> +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>  "debug logging mode");  #endif /* #if 
> __FreeBSD_version >= 90 */
>
> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
> -bxe_sysctl_trigger_grcdump, "IU",
> -"set by driver when a grcdump is needed");
> +sc->trigger_grcdump = 0;
> +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
> +   CTLFLAG_RW, &sc->trigger_grcdump, 0,
> +   "trigger grcdump should be invoked"
> +   "  before collecting grcdump");
>
> +sc->grcdump_started = 0;
>  sc->grcdump_done = 0;
>  SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
> -   CTLFLAG_RW, &sc->grcdump_done, 0,
> +   CTLFLAG_RD, &sc->grcdump_done, 0,
> "set by driver when grcdump is done");
>
>  sc->rx_budget = bxe_rx_budget;
> @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc
>  return 0;
>  }
>
> -static int
> +int
>  bxe_grc_dump(struct bxe_softc *sc)
>  {
>  int rval = 0;
> @@ -18658,12 +18639,53 @@ bxe_grc_dump(struct bxe_softc *sc)
>  uint8_t *buf;
>  uint32_t size;
>  struct  dump_header *d_hdr;
> +uint32_t i;
> +uint32_t reg_val;
> +uint32_t reg_addr;
> +uint32_t cmd_offset;
> +int context_size;
> +int allocated;
> +struct ecore_ilt *ilt = SC_ILT(sc);
> +struct bxe_fastpath *fp;
> +struct ilt_client_info *ilt_cli;
> +int grc_dump_size;
>
> -if (sc->grcdump_

RE: svn commit: r297898 - head/sys/dev/bxe

2016-04-13 Thread David Somayajulu
HI Sepherosa,
I have checked in the fix. https://svnweb.freebsd.org/changeset/base/297909

Apologies for the screw up earlier. Sorry for the inconvenience.

Cheers
David S.

-Original Message-
From: Sepherosa Ziehau [mailto:sepher...@gmail.com] 
Sent: Tuesday, April 12, 2016 8:49 PM
To: David Somayajulu 
Cc: David C Somayajulu ; src-committ...@freebsd.org; 
svn-src-...@freebsd.org; svn-src-head@freebsd.org
Subject: Re: svn commit: r297898 - head/sys/dev/bxe

Great!  Thanks!

On Wed, Apr 13, 2016 at 11:48 AM, David Somayajulu 
 wrote:
> Hi Sepherosa,
> I just saw it and am taking a look at it. Give me a few minutes and I will 
> get back.
> Thanks
> David S.
>
> -Original Message-
> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
> Sent: Tuesday, April 12, 2016 8:43 PM
> To: David C Somayajulu 
> Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
> svn-src-head@freebsd.org
> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>
> Hi David,
>
> BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
> sc->context[i].size);
>
> This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:
>
> /usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies type 
> 'uintmax_t' (aka 'unsigned long long') but the argument has type 'bus_addr_t' 
> (aka 'unsigned int') [-Werror,-Wformat]
> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
> ^
>
>
> On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  
> wrote:
>> Author: davidcs
>> Date: Wed Apr 13 00:53:04 2016
>> New Revision: 297898
>> URL: https://svnweb.freebsd.org/changeset/base/297898
>>
>> Log:
>>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
>>  basis.
>>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>>  sysctl flag is set.
>>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>>
>>   Submitted by:vaishali.kulka...@qlogic.com
>>   Approved by:davi...@freebsd.org
>>   MFC after:5 days
>>
>> Modified:
>>   head/sys/dev/bxe/bxe.c
>>   head/sys/dev/bxe/bxe.h
>>   head/sys/dev/bxe/bxe_stats.c
>>
>> Modified: head/sys/dev/bxe/bxe.c
>> ==
>> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
>> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
>> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>>
>>  static int bxe_add_cdev(struct bxe_softc *sc);  static void 
>> bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct 
>> bxe_softc *sc);  static int bxe_alloc_buf_rings(struct bxe_softc 
>> *sc); static void bxe_free_buf_rings(struct bxe_softc *sc);
>>
>> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>>  }
>>
>>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n",
>> fp->index);
>> +if(sc->trigger_grcdump) {
>> + /* taking grcdump */
>> + bxe_grc_dump(sc);
>> +}
>>
>>  BXE_FP_TX_UNLOCK(fp);
>>
>> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>>  }
>>
>>  static int
>> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
>> -{
>> -struct bxe_softc *sc;
>> -int error, result;
>> -
>> -result = 0;
>> -error = sysctl_handle_int(oidp, &result, 0, req);
>> -
>> -if (error || !req->newptr) {
>> -return (error);
>> -}
>> -
>> -if (result == 1) {
>> -sc = (struct bxe_softc *)arg1;
>> -
>> -BLOGI(sc, "... grcdump start ...\n");
>> -bxe_grc_dump(sc);
>> -BLOGI(sc, "... grcdump done ...\n");
>> -}
>> -
>> -return (error);
>> -}
>> -
>> -static int
>>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>>  {
>>  struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14
>> +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>>  "debug logging mode");  #endif /* #if 
>> __FreeBSD_version >= 90 */
>>
>> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
>> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
>> -bxe_sysctl_trigger_grcdump, "IU",
>> -"set by driver when a grcdump is needed");
>> +sc->trigger_grcdump = 0;
>> +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
>> +   CTLFLAG_RW, &sc->trigger_grcdump, 0,
>> +   "trigger grcdump should be invoked"
>> +   "  before collecting grcdump");
>>
>> +sc->grcdump_started = 0;
>>  sc->grcdump_done = 0;
>>  SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
>> -   CTLFLAG_RW, &sc->grcdump_done, 0,
>> +   CTLFLAG_RD, &sc->grcdump_done, 0,
>> "set by dri

svn commit: r297917 - head/sys/arm64/include

2016-04-13 Thread Andrew Turner
Author: andrew
Date: Wed Apr 13 11:43:03 2016
New Revision: 297917
URL: https://svnweb.freebsd.org/changeset/base/297917

Log:
  Document the memory ranges within the kernel region to help with debugging
  to track down which region an address is from.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm64/include/vmparam.h

Modified: head/sys/arm64/include/vmparam.h
==
--- head/sys/arm64/include/vmparam.hWed Apr 13 11:24:24 2016
(r297916)
+++ head/sys/arm64/include/vmparam.hWed Apr 13 11:43:03 2016
(r297917)
@@ -128,14 +128,19 @@
  * We use the full 48 bits for each region, however the kernel may only use
  * a limited range within this space.
  *
- * Upper region:   0x
- * 0x
+ * Upper region:0x  Top of virtual memory
  *
- * Hole:   0xfffe
- * 0x0001
+ *  0xfeff  End of DMAP
+ *  0xfd00  Start of DMAP
  *
- * Lower region:   0x
- * 0x
+ *  0x007f  End of KVA
+ *  0x  Kernel base address & start of KVA
+ *
+ * Hole:0xfffe
+ *  0x0001
+ *
+ * Lower region:0x End of user address space
+ *  0x Start of user address space
  *
  * We use the upper region for the kernel, and the lower region for userland.
  *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297916 - head/sys/dev/bxe

2016-04-13 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr 13 11:24:24 2016
New Revision: 297916
URL: https://svnweb.freebsd.org/changeset/base/297916

Log:
  Fix compilation error on i386

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Apr 13 10:35:17 2016(r297915)
+++ head/sys/dev/bxe/bxe.c  Wed Apr 13 11:24:24 2016(r297916)
@@ -18752,12 +18752,12 @@ bxe_grc_dump(struct bxe_softc *sc)
 (uintmax_t)sc->fw_stats_req_mapping,
 (uintmax_t)sc->fw_stats_data_mapping,
 sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size));
-BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%lx\n",
+BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n",
 (void *)sc->def_sb_dma.paddr, sc->def_sb,
 sizeof(struct host_sp_status_block));
 BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n",
 (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE);
-BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%lx\n",
+BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n",
 (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr,
 sizeof(struct bxe_slowpath));
 BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n",
@@ -18767,7 +18767,7 @@ bxe_grc_dump(struct bxe_softc *sc)
 FW_BUF_SIZE);
 for (i = 0; i < sc->num_queues; i++) {
 fp = &sc->fp[i];
-BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%lx\n", i,
+BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i,
 (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr,
 sizeof(union bxe_host_hc_status_block));
 BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
@@ -18776,7 +18776,7 @@ bxe_grc_dump(struct bxe_softc *sc)
 BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
 (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr,
 (BCM_PAGE_SIZE * RX_BD_NUM_PAGES));
-BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%lx\n", i,
+BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i,
 (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr,
 (BCM_PAGE_SIZE * RCQ_NUM_PAGES));
 BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r297915 - head/sys/dev/isp

2016-04-13 Thread Alexander Motin
Author: mav
Date: Wed Apr 13 10:35:17 2016
New Revision: 297915
URL: https://svnweb.freebsd.org/changeset/base/297915

Log:
  Filter Port Database Changed notifications.
  
  For some reason firmware sends Port Database Changed notifications in case
  of explicit login requests from the driver when target port is unavailabe.
  Those notifications don't give driver any new information, but only cause
  infinite scan loop.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Wed Apr 13 09:44:32 2016(r297914)
+++ head/sys/dev/isp/isp.c  Wed Apr 13 10:35:17 2016(r297915)
@@ -2630,6 +2630,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp);
if (isp->isp_dblev & ISP_LOGDEBUG1)
isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, reqp);
+   FCPARAM(isp, chan)->isp_login_hdl = handle;
ISP_SYNC_REQUEST(isp);
if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz)
== EWOULDBLOCK) {
@@ -2638,6 +2639,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
isp_destroy_handle(isp, pl.plogx_handle);
return (-1);
}
+   FCPARAM(isp, chan)->isp_login_hdl = NIL_HANDLE;
if (isp->isp_dblev & ISP_LOGDEBUG1)
isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, resp);
isp_get_plogx(isp, (isp_plogx_t *)resp, &pl);
@@ -6000,9 +6002,13 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
fcp = FCPARAM(isp, chan);
if (fcp->role == ISP_ROLE_NONE)
continue;
-   if (fcp->isp_loopstate > LOOP_LTEST_DONE)
+   if (fcp->isp_loopstate > LOOP_LTEST_DONE) {
+   if (nphdl != NIL_HANDLE &&
+   nphdl == fcp->isp_login_hdl &&
+   reason == PDB24XX_AE_OPN_2)
+   continue;
fcp->isp_loopstate = LOOP_LTEST_DONE;
-   else if (fcp->isp_loopstate < LOOP_HAVE_LINK)
+   } else if (fcp->isp_loopstate < LOOP_HAVE_LINK)
fcp->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan,
ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason);
@@ -7818,6 +7824,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c
fcp->isp_xfwoptions = 0;
fcp->isp_zfwoptions = 0;
fcp->isp_lasthdl = NIL_HANDLE;
+   fcp->isp_login_hdl = NIL_HANDLE;
 
if (IS_24XX(isp)) {
fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS;

Modified: head/sys/dev/isp/ispvar.h
==
--- head/sys/dev/isp/ispvar.h   Wed Apr 13 09:44:32 2016(r297914)
+++ head/sys/dev/isp/ispvar.h   Wed Apr 13 10:35:17 2016(r297915)
@@ -449,6 +449,7 @@ typedef struct {
uint16_tisp_lasthdl;/* only valid for 
channel 0 */
uint16_tisp_maxalloc;
uint16_tisp_fabric_params;
+   uint16_tisp_login_hdl;  /* Logging in handle */
uint8_t isp_retry_delay;
uint8_t isp_retry_count;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-04-13 Thread Andrew Turner
Author: andrew
Date: Wed Apr 13 09:44:32 2016
New Revision: 297914
URL: https://svnweb.freebsd.org/changeset/base/297914

Log:
  Increase the arm64 kernel address space to 512GB, and the DMAP region to
  2TB. The latter can be increased in 512GB chunks by adjusting the lower
  address, however more work will be needed to increase the former.
  
  There is still some work needed to only create a DMAP region for the RAM
  address space as on ARM architectures all mappings should have the same
  memory attributes, and these will be different for device and normal memory.
  
  Reviewed by:  kib
  Obtained from:ABT Systems Ltd
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5859

Modified:
  head/sys/arm64/arm64/locore.S
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/include/vmparam.h

Modified: head/sys/arm64/arm64/locore.S
==
--- head/sys/arm64/arm64/locore.S   Wed Apr 13 09:20:29 2016
(r297913)
+++ head/sys/arm64/arm64/locore.S   Wed Apr 13 09:44:32 2016
(r297914)
@@ -37,6 +37,7 @@
 #include 
 
 #defineVIRT_BITS   48
+#defineDMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> 
L0_SHIFT)
 
.globl  kernbase
.setkernbase, KERNBASE
@@ -322,10 +323,12 @@ virt_map:
  * TODO: This is out of date.
  *  There are at least 5 pages before that address for the page tables
  *   The pages used are:
- *- The identity (PA = VA) table (TTBR0)
- *- The Kernel L1 table  (TTBR1)(not yet)
- *-  The PA != VA L2 table to jump into (not yet)
- *-  The FDT L2 table   (not yet)
+ *- The Kernel L2 table
+ *- The Kernel L1 table
+ *- The Kernel L0 table (TTBR1)
+ *- The identity (PA = VA) L1 table
+ *- The identity (PA = VA) L0 table (TTBR0)
+ *- The DMAP L1 tables
  */
 create_pagetables:
/* Save the Link register */
@@ -381,6 +384,12 @@ create_pagetables:
mov x10, #1
bl  link_l0_pagetable
 
+   /* Link the DMAP tables */
+   ldr x8, =DMAP_MIN_ADDRESS
+   adr x9, pagetable_dmap;
+   mov x10, #DMAP_TABLES
+   bl  link_l0_pagetable
+
/*
 * Build the TTBR0 maps.
 */
@@ -644,6 +653,10 @@ pagetable_l1_ttbr0:
.space  PAGE_SIZE
 pagetable_l0_ttbr0:
.space  PAGE_SIZE
+
+   .globl pagetable_dmap
+pagetable_dmap:
+   .space  PAGE_SIZE * DMAP_TABLES
 pagetable_end:
 
 el2_pagetable:

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Apr 13 09:20:29 2016(r297913)
+++ head/sys/arm64/arm64/pmap.c Wed Apr 13 09:44:32 2016(r297914)
@@ -222,6 +222,13 @@ static struct rwlock_padalign pvh_global
 
 vm_paddr_t dmap_phys_base; /* The start of the dmap region */
 
+/* This code assumes all L1 DMAP entries will be used */
+CTASSERT((DMAP_MIN_ADDRESS  & ~L0_OFFSET) == DMAP_MIN_ADDRESS);
+CTASSERT((DMAP_MAX_ADDRESS  & ~L0_OFFSET) == DMAP_MAX_ADDRESS);
+
+#defineDMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> 
L0_SHIFT)
+extern pt_entry_t pagetable_dmap[];
+
 /*
  * Data for the pv entry allocation mechanism
  */
@@ -543,28 +550,25 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_
 }
 
 static void
-pmap_bootstrap_dmap(vm_offset_t l1pt, vm_paddr_t kernstart)
+pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t kernstart)
 {
vm_offset_t va;
vm_paddr_t pa;
-   pd_entry_t *l1;
u_int l1_slot;
 
pa = dmap_phys_base = kernstart & ~L1_OFFSET;
va = DMAP_MIN_ADDRESS;
-   l1 = (pd_entry_t *)l1pt;
-   l1_slot = pmap_l1_index(DMAP_MIN_ADDRESS);
-
for (; va < DMAP_MAX_ADDRESS;
pa += L1_SIZE, va += L1_SIZE, l1_slot++) {
-   KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index"));
+   l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT);
 
-   pmap_load_store(&l1[l1_slot],
+   pmap_load_store(&pagetable_dmap[l1_slot],
(pa & ~L1_OFFSET) | ATTR_DEFAULT |
ATTR_IDX(CACHED_MEMORY) | L1_BLOCK);
}
 
-   cpu_dcache_wb_range((vm_offset_t)l1, PAGE_SIZE);
+   cpu_dcache_wb_range((vm_offset_t)pagetable_dmap,
+   PAGE_SIZE * DMAP_TABLES);
cpu_tlb_flushID();
 }
 

Modified: head/sys/arm64/include/vmparam.h
==
--- head/sys/arm64/include/vmparam.hWed Apr 13 09:20:29 2016
(r297913)
+++ head/sys/arm64/include/vmparam.hWed Apr 13 09:44:32 2016
(r297914)
@@ -125,15 +125,16 @@
  * split into 2 regions at each end of the 64 bit address space, with an
  * out of range "hole" in the middle.
  *
- * We limit the size of the two spaces to 39 bits each.
+ * We use the full 48 bits

Re: svn commit: r297913 - in head/sys/dev/hyperv: netvsc storvsc

2016-04-13 Thread Sepherosa Ziehau
Yeah, I knew, but it worth a different commit :)

On Wed, Apr 13, 2016 at 5:28 PM, Hans Petter Selasky  wrote:
> On 04/13/16 11:20, Sepherosa Ziehau wrote:
>>
>> bzero(sc, sizeof(hn_softc_t));
>
>
> Hi,
>
> According to:
>
>>
>> https://svnweb.freebsd.org/base/head/sys/kern/subr_bus.c?revision=297776&view=markup#l2763
>
>
> It is safe to assume that the memory you get is already zero'ed.
>
> The additional bzero() in your attach routine seems redundant.
>
> --HPS



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


Re: svn commit: r297913 - in head/sys/dev/hyperv: netvsc storvsc

2016-04-13 Thread Hans Petter Selasky

On 04/13/16 11:20, Sepherosa Ziehau wrote:

bzero(sc, sizeof(hn_softc_t));


Hi,

According to:


https://svnweb.freebsd.org/base/head/sys/kern/subr_bus.c?revision=297776&view=markup#l2763


It is safe to assume that the memory you get is already zero'ed.

The additional bzero() in your attach routine seems redundant.

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


svn commit: r297913 - in head/sys/dev/hyperv: netvsc storvsc

2016-04-13 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Apr 13 09:20:29 2016
New Revision: 297913
URL: https://svnweb.freebsd.org/changeset/base/297913

Log:
  hyperv: device_get_softc does not return NULL
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Wed Apr 13 07:04:04 
2016(r297912)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Wed Apr 13 09:20:29 
2016(r297913)
@@ -418,9 +418,6 @@ netvsc_attach(device_t dev)
 #endif
 
sc = device_get_softc(dev);
-   if (sc == NULL) {
-   return (ENOMEM);
-   }
 
bzero(sc, sizeof(hn_softc_t));
sc->hn_unit = unit;
@@ -1169,10 +1166,6 @@ netvsc_linkstatus_callback(struct hv_dev
 {
hn_softc_t *sc = device_get_softc(device_obj->device);
 
-   if (sc == NULL) {
-   return;
-   }
-
if (status == 1) {
sc->hn_carrier = 1;
} else {

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cWed Apr 13 
07:04:04 2016(r297912)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cWed Apr 13 
09:20:29 2016(r297913)
@@ -293,9 +293,6 @@ get_stor_device(struct hv_device *device
struct storvsc_softc *sc;
 
sc = device_get_softc(device->device);
-   if (sc == NULL) {
-   return NULL;
-   }
 
if (outbound) {
/*
@@ -976,10 +973,6 @@ storvsc_attach(device_t dev)
root_mount_token = root_mount_hold("storvsc");
 
sc = device_get_softc(dev);
-   if (sc == NULL) {
-   ret = ENOMEM;
-   goto cleanup;
-   }
 
stor_type = storvsc_get_storage_type(dev);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r297898 - head/sys/dev/bxe

2016-04-13 Thread Sepherosa Ziehau
Fails in different place :)

/usr/freebsd-svn/sys/dev/bxe/bxe.c:18757:9: error: format specifies
type 'unsigned long' but the argument has type 'unsigned int'
[-Werror,-Wformat]
sizeof(struct host_sp_status_block));
^~~

I think you could use %zx for size_t.

Thanks,
sephe


On Wed, Apr 13, 2016 at 12:15 PM, David Somayajulu
 wrote:
> HI Sepherosa,
> I have checked in the fix. https://svnweb.freebsd.org/changeset/base/297909
>
> Apologies for the screw up earlier. Sorry for the inconvenience.
>
> Cheers
> David S.
>
> -Original Message-
> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
> Sent: Tuesday, April 12, 2016 8:49 PM
> To: David Somayajulu 
> Cc: David C Somayajulu ; src-committ...@freebsd.org; 
> svn-src-...@freebsd.org; svn-src-head@freebsd.org
> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>
> Great!  Thanks!
>
> On Wed, Apr 13, 2016 at 11:48 AM, David Somayajulu 
>  wrote:
>> Hi Sepherosa,
>> I just saw it and am taking a look at it. Give me a few minutes and I will 
>> get back.
>> Thanks
>> David S.
>>
>> -Original Message-
>> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
>> Sent: Tuesday, April 12, 2016 8:43 PM
>> To: David C Somayajulu 
>> Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org;
>> svn-src-head@freebsd.org
>> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>>
>> Hi David,
>>
>> BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
>> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
>> sc->context[i].size);
>>
>> This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:
>>
>> /usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies type 
>> 'uintmax_t' (aka 'unsigned long long') but the argument has type 
>> 'bus_addr_t' (aka 'unsigned int') [-Werror,-Wformat]
>> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
>> ^
>>
>>
>> On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  
>> wrote:
>>> Author: davidcs
>>> Date: Wed Apr 13 00:53:04 2016
>>> New Revision: 297898
>>> URL: https://svnweb.freebsd.org/changeset/base/297898
>>>
>>> Log:
>>>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as 
>>> needed
>>>  basis.
>>>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>>>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>>>  sysctl flag is set.
>>>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>>>
>>>   Submitted by:vaishali.kulka...@qlogic.com
>>>   Approved by:davi...@freebsd.org
>>>   MFC after:5 days
>>>
>>> Modified:
>>>   head/sys/dev/bxe/bxe.c
>>>   head/sys/dev/bxe/bxe.h
>>>   head/sys/dev/bxe/bxe_stats.c
>>>
>>> Modified: head/sys/dev/bxe/bxe.c
>>> ==
>>> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
>>> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
>>> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>>>
>>>  static int bxe_add_cdev(struct bxe_softc *sc);  static void
>>> bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct
>>> bxe_softc *sc);  static int bxe_alloc_buf_rings(struct bxe_softc
>>> *sc); static void bxe_free_buf_rings(struct bxe_softc *sc);
>>>
>>> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>>>  }
>>>
>>>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n",
>>> fp->index);
>>> +if(sc->trigger_grcdump) {
>>> + /* taking grcdump */
>>> + bxe_grc_dump(sc);
>>> +}
>>>
>>>  BXE_FP_TX_UNLOCK(fp);
>>>
>>> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>>>  }
>>>
>>>  static int
>>> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
>>> -{
>>> -struct bxe_softc *sc;
>>> -int error, result;
>>> -
>>> -result = 0;
>>> -error = sysctl_handle_int(oidp, &result, 0, req);
>>> -
>>> -if (error || !req->newptr) {
>>> -return (error);
>>> -}
>>> -
>>> -if (result == 1) {
>>> -sc = (struct bxe_softc *)arg1;
>>> -
>>> -BLOGI(sc, "... grcdump start ...\n");
>>> -bxe_grc_dump(sc);
>>> -BLOGI(sc, "... grcdump done ...\n");
>>> -}
>>> -
>>> -return (error);
>>> -}
>>> -
>>> -static int
>>>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>>>  {
>>>  struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14
>>> +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>>>  "debug logging mode");  #endif /* #if
>>> __FreeBSD_version >= 90 */
>>>
>>> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
>>> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
>>> -bxe_sysctl_trigger_grcdump, "IU",
>>> -"set by driver when a grcdump is needed");
>>> +sc->trigger_g

Re: svn commit: r297902 - head

2016-04-13 Thread Peter Jeremy
On 2016-Apr-13 01:47:05 +, Steve Wills  wrote:
>+.if !defined(SVN) || empty(SVN)
>+. for _P in /usr/bin /usr/local/bin
>+.  for _S in svn svnlite
>+.   if exists(${_P}/${_S})
>+SVN=   ${_P}/${_S}
>+.   endif
>+.  endfor
>+. endfor
>+.endif

What is the preferred choice here?  The given order prefers ports over base
(which makes sense) but then prefers svnlite over svn.  I would expect
either the opposite directory order in _P (prefer svnlite in base) or the
opposite command order in _S (prefer svn in ports).

In normal use, this will wind up with either /usr/local/bin/svn or
/usr/bin/svnlite (in that order) but a non-standard configuration could
result in different results.

-- 
Peter Jeremy


signature.asc
Description: PGP signature


svn commit: r297912 - head/sys/dev/isp

2016-04-13 Thread Alexander Motin
Author: mav
Date: Wed Apr 13 07:04:04 2016
New Revision: 297912
URL: https://svnweb.freebsd.org/changeset/base/297912

Log:
  Respect NVRAM topology settings on 24xx and above chips.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Wed Apr 13 05:28:27 2016(r297911)
+++ head/sys/dev/isp/isp.c  Wed Apr 13 07:04:04 2016(r297912)
@@ -1822,22 +1822,24 @@ isp_fibre_init(ispsoftc_t *isp)
 * Prefer or force Point-To-Point instead Loop?
 */
switch (isp->isp_confopts & ISP_CFG_PORT_PREF) {
-   case ISP_CFG_NPORT:
+   case ISP_CFG_LPORT_ONLY:
icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK;
-   icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP;
+   icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY;
break;
case ISP_CFG_NPORT_ONLY:
icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK;
icbp->icb_xfwoptions |= ICBXOPT_PTP_ONLY;
break;
-   case ISP_CFG_LPORT_ONLY:
+   case ISP_CFG_LPORT:
icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK;
-   icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY;
+   icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP;
+   break;
+   case ISP_CFG_NPORT:
+   icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK;
+   icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP;
break;
default:
-   /*
-* Let NVRAM settings define it if they are sane
-*/
+   /* Let NVRAM settings define it if they are sane */
switch (icbp->icb_xfwoptions & ICBXOPT_TOPO_MASK) {
case ICBXOPT_PTP_2_LOOP:
case ICBXOPT_PTP_ONLY:
@@ -2109,19 +2111,32 @@ isp_fibre_init_2400(ispsoftc_t *isp)
}
 
switch (isp->isp_confopts & ISP_CFG_PORT_PREF) {
-   case ISP_CFG_NPORT_ONLY:
-   icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK;
-   icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY;
-   break;
case ISP_CFG_LPORT_ONLY:
icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK;
icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_ONLY;
break;
-   default:
+   case ISP_CFG_NPORT_ONLY:
+   icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK;
+   icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY;
+   break;
+   case ISP_CFG_NPORT:
/* ISP_CFG_PTP_2_LOOP not available in 24XX/25XX */
+   case ISP_CFG_LPORT:
icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK;
icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP;
break;
+   default:
+   /* Let NVRAM settings define it if they are sane */
+   switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TOPO_MASK) {
+   case ICB2400_OPT2_LOOP_ONLY:
+   case ICB2400_OPT2_PTP_ONLY:
+   case ICB2400_OPT2_LOOP_2_PTP:
+   break;
+   default:
+   icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK;
+   icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP;
+   }
+   break;
}
 
switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TIMER_MASK) {
@@ -7807,23 +7822,23 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c
if (IS_24XX(isp)) {
fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS;
fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS;
-   if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) {
+   if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX)
fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX;
-   }
fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS;
+   fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP;
fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO;
} else {
fcp->isp_fwoptions |= ICBOPT_FAIRNESS;
fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE;
fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS;
-   if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) {
+   if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX)
fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX;
-   }
/*
 * Make sure this is turned off now until we get
 * extended options from NVRAM
 */
fcp->isp_fwoptions &= ~ICBOPT_EXTENDED;
+   fcp->isp_xfwoptions