svn commit: r292603 - in head/sys: net netinet

2015-12-22 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Dec 22 15:00:04 2015
New Revision: 292603
URL: https://svnweb.freebsd.org/changeset/base/292603

Log:
  If bootverbose is enabled every vnet startup and virtual interface
  creation will print extra lines on the console. We are generally not
  interested in this (repeated) information for each VNET. Thus only
  print it for the default VNET. Virtual interfaces on the base system
  will remain printing information, but e.g. each loopback in each vnet
  will no longer cause a "bpf attached" line.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D4531

Modified:
  head/sys/net/bpf.c
  head/sys/netinet/tcp_subr.c

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Tue Dec 22 14:57:04 2015(r292602)
+++ head/sys/net/bpf.c  Tue Dec 22 15:00:04 2015(r292603)
@@ -2551,7 +2551,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt,
 
bp->bif_hdrlen = hdrlen;
 
-   if (bootverbose)
+   if (bootverbose && IS_DEFAULT_VNET(curvnet))
if_printf(ifp, "bpf attached\n");
 }
 

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Tue Dec 22 14:57:04 2015(r292602)
+++ head/sys/netinet/tcp_subr.c Tue Dec 22 15:00:04 2015(r292603)
@@ -609,7 +609,7 @@ tcp_init(void)
 */
if (hashsize < 512)
hashsize = 512;
-   if (bootverbose)
+   if (bootverbose && IS_DEFAULT_VNET(curvnet))
printf("%s: %s auto tuned to %d\n", __func__,
tcbhash_tuneable, hashsize);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292604 - head/sys/net

2015-12-22 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Dec 22 15:03:45 2015
New Revision: 292604
URL: https://svnweb.freebsd.org/changeset/base/292604

Log:
  If vnets are torn down while ifconfig runs an ioctl to say, destroy an
  epair(4), we may hit if_detach_internal() without holding a lock and by
  the time we aquire it the interface might be gone.
  We should not panic() in this case as it is our fault for not holding
  the lock all the way. It is not ideal to return silently without error
  to user space, but other callers will all ignore the return values so
  do not change the entire KPI for little benefit for now.
  The ifp will be dealt with one way or another still.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D4529

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Tue Dec 22 15:00:04 2015(r292603)
+++ head/sys/net/if.c   Tue Dec 22 15:03:45 2015(r292604)
@@ -173,7 +173,7 @@ static int  if_getgroup(struct ifgroupreq
 static int if_getgroupmembers(struct ifgroupreq *);
 static voidif_delgroups(struct ifnet *);
 static voidif_attach_internal(struct ifnet *, int, struct if_clone *);
-static voidif_detach_internal(struct ifnet *, int, struct if_clone **);
+static int if_detach_internal(struct ifnet *, int, struct if_clone **);
 
 #ifdef INET6
 /*
@@ -884,7 +884,7 @@ if_detach(struct ifnet *ifp)
CURVNET_RESTORE();
 }
 
-static void
+static int
 if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
 {
struct ifaddr *ifa;
@@ -906,11 +906,19 @@ if_detach_internal(struct ifnet *ifp, in
 #endif
IFNET_WUNLOCK();
if (!found) {
+   /*
+* While we would want to panic here, we cannot
+* guarantee that the interface is indeed still on
+* the list given we don't hold locks all the way.
+*/
+   return (ENOENT);
+#if 0
if (vmove)
panic("%s: ifp=%p not on the ifnet tailq %p",
__func__, ifp, _ifnet);
else
return; /* XXX this should panic as well? */
+#endif
}
 
/* Check if this is a cloned interface or not. */
@@ -993,6 +1001,8 @@ if_detach_internal(struct ifnet *ifp, in
(*dp->dom_ifdetach)(ifp,
ifp->if_afdata[dp->dom_family]);
}
+
+   return (0);
 }
 
 #ifdef VIMAGE
@@ -1007,12 +1017,16 @@ void
 if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
 {
struct if_clone *ifc;
+   int rc;
 
/*
 * Detach from current vnet, but preserve LLADDR info, do not
 * mark as dead etc. so that the ifnet can be reattached later.
+* If we cannot find it, we lost the race to someone else.
 */
-   if_detach_internal(ifp, 1, );
+   rc = if_detach_internal(ifp, 1, );
+   if (rc != 0)
+   return;
 
/*
 * Unlink the ifnet from ifindex_table[] in current vnet, and shrink
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292605 - head/usr.sbin/cron/cron

2015-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 22 15:20:08 2015
New Revision: 292605
URL: https://svnweb.freebsd.org/changeset/base/292605

Log:
  crontab: replace malloc + bzero with calloc
  
  Obtained from:OpenBSD (Rev 1.20)

Modified:
  head/usr.sbin/cron/cron/popen.c

Modified: head/usr.sbin/cron/cron/popen.c
==
--- head/usr.sbin/cron/cron/popen.c Tue Dec 22 15:03:45 2015
(r292604)
+++ head/usr.sbin/cron/cron/popen.c Tue Dec 22 15:20:08 2015
(r292605)
@@ -82,9 +82,8 @@ cron_popen(program, type, e)
if (!pids) {
if ((fds = getdtablesize()) <= 0)
return(NULL);
-   if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T)
+   if (!(pids = calloc(fds, sizeof(PID_T
return(NULL);
-   bzero((char *)pids, fds * sizeof(PID_T));
}
if (pipe(pdes) < 0)
return(NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292606 - head/usr.sbin/cron/crontab

2015-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 22 15:30:26 2015
New Revision: 292606
URL: https://svnweb.freebsd.org/changeset/base/292606

Log:
  crontab: properly free an entry
  
  This should close memory leak.
  
  Obtained from:OpenBSD (rev. 1.62)
  CID:  271773

Modified:
  head/usr.sbin/cron/crontab/crontab.c

Modified: head/usr.sbin/cron/crontab/crontab.c
==
--- head/usr.sbin/cron/crontab/crontab.cTue Dec 22 15:20:08 2015
(r292605)
+++ head/usr.sbin/cron/crontab/crontab.cTue Dec 22 15:30:26 2015
(r292606)
@@ -558,7 +558,7 @@ replace_cmd() {
case FALSE:
e = load_entry(tmp, check_error, pw, envp);
if (e)
-   free(e);
+   free_entry(e);
break;
case TRUE:
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292607 - head/usr.sbin/cron/cron

2015-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 22 15:32:45 2015
New Revision: 292607
URL: https://svnweb.freebsd.org/changeset/base/292607

Log:
  cron: Check the return value of pipe(2)
  
  Fix inspired by:  OpenBSD (rev 1.56)
  CID:  1009830

Modified:
  head/usr.sbin/cron/cron/do_command.c

Modified: head/usr.sbin/cron/cron/do_command.c
==
--- head/usr.sbin/cron/cron/do_command.cTue Dec 22 15:30:26 2015
(r292606)
+++ head/usr.sbin/cron/cron/do_command.cTue Dec 22 15:32:45 2015
(r292607)
@@ -114,7 +114,7 @@ child_process(e, u)
struct pam_conv pamc = {
.conv = openpam_nullconv,
.appdata_ptr = NULL
-   };
+   }
 
Debug(DPROC, ("[%d] checking account with PAM\n", getpid()))
 
@@ -161,8 +161,10 @@ child_process(e, u)
 
/* create some pipes to talk to our future child
 */
-   pipe(stdin_pipe);   /* child's stdin */
-   pipe(stdout_pipe);  /* child's stdout */
+   if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) {
+   log_it("CRON", getpid(), "error", "can't pipe");
+   exit(ERROR_EXIT);
+   }
 
/* since we are a forked process, we can diddle the command string
 * we were passed -- nobody else is going to use it again, right?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292608 - head/usr.sbin/cron/cron

2015-12-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Dec 22 15:42:53 2015
New Revision: 292608
URL: https://svnweb.freebsd.org/changeset/base/292608

Log:
  Undo change from r292607 that was not meant to be there
  
  Pointyhat: me

Modified:
  head/usr.sbin/cron/cron/do_command.c

Modified: head/usr.sbin/cron/cron/do_command.c
==
--- head/usr.sbin/cron/cron/do_command.cTue Dec 22 15:32:45 2015
(r292607)
+++ head/usr.sbin/cron/cron/do_command.cTue Dec 22 15:42:53 2015
(r292608)
@@ -114,7 +114,7 @@ child_process(e, u)
struct pam_conv pamc = {
.conv = openpam_nullconv,
.appdata_ptr = NULL
-   }
+   };
 
Debug(DPROC, ("[%d] checking account with PAM\n", getpid()))
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292625 - in head/sys/boot/efi: include include/amd64 include/arm64 include/i386 libefi

2015-12-22 Thread Ed Maste
Author: emaste
Date: Tue Dec 22 20:40:34 2015
New Revision: 292625
URL: https://svnweb.freebsd.org/changeset/base/292625

Log:
  Revert accidental whitespace changes included with r292623

Modified:
  head/sys/boot/efi/include/amd64/efibind.h
  head/sys/boot/efi/include/amd64/pe.h
  head/sys/boot/efi/include/arm64/efibind.h
  head/sys/boot/efi/include/efi.h
  head/sys/boot/efi/include/efi_nii.h
  head/sys/boot/efi/include/efidebug.h
  head/sys/boot/efi/include/efidef.h
  head/sys/boot/efi/include/efidevp.h
  head/sys/boot/efi/include/efifs.h
  head/sys/boot/efi/include/efinet.h
  head/sys/boot/efi/include/efipart.h
  head/sys/boot/efi/include/efipciio.h
  head/sys/boot/efi/include/efiprot.h
  head/sys/boot/efi/include/efipxebc.h
  head/sys/boot/efi/include/efiser.h
  head/sys/boot/efi/include/efiuga.h
  head/sys/boot/efi/include/i386/efibind.h
  head/sys/boot/efi/include/i386/pe.h
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/efi/libefi/time.c

Modified: head/sys/boot/efi/include/amd64/efibind.h
==
--- head/sys/boot/efi/include/amd64/efibind.h   Tue Dec 22 20:37:34 2015
(r292624)
+++ head/sys/boot/efi/include/amd64/efibind.h   Tue Dec 22 20:40:34 2015
(r292625)
@@ -37,11 +37,11 @@ Revision History
 
 #if (__STDC_VERSION__ < 199901L )
 
-// No ANSI C 1999/2000 stdint.h integer width declarations
+// No ANSI C 1999/2000 stdint.h integer width declarations 
 
 #if _MSC_EXTENSIONS
 
-// Use Microsoft C compiler integer width declarations
+// Use Microsoft C compiler integer width declarations 
 
 typedef unsigned __int64uint64_t;
 typedef __int64 int64_t;
@@ -51,10 +51,10 @@ Revision History
 typedef short   int16_t;
 typedef unsigned char   uint8_t;
 typedef charint8_t;
-#else
+#else 
 #ifdef UNIX_LP64
 
-// Use LP64 programming model from C_FLAGS for integer width 
declarations
+// Use LP64 programming model from C_FLAGS for integer width 
declarations 
 
 typedef unsigned long   uint64_t;
 typedef longint64_t;
@@ -66,7 +66,7 @@ Revision History
 typedef charint8_t;
 #else
 
-// Assume P64 programming model from C_FLAGS for integer width 
declarations
+// Assume P64 programming model from C_FLAGS for integer width 
declarations 
 
 typedef unsigned long long  uint64_t;
 typedef long long   int64_t;
@@ -112,17 +112,17 @@ typedef uint64_t   UINTN;
 
 #ifdef EFI_NT_EMULATOR
 #define POST_CODE(_Data)
-#else
+#else
 #ifdef EFI_DEBUG
 #define POST_CODE(_Data)__asm mov eax,(_Data) __asm out 0x80,al
 #else
 #define POST_CODE(_Data)
-#endif
+#endif  
 #endif
 
 #define EFIERR(a)   (0x8000 | a)
 #define EFI_ERROR_MASK  0x8000
-#define EFIERR_OEM(a)   (0xc000 | a)
+#define EFIERR_OEM(a)   (0xc000 | a)  
 
 
 #define BAD_POINTER 0xFBFBFBFBFBFBFBFB
@@ -156,18 +156,18 @@ typedef uint64_t   UINTN;
 // BOOTSERVICE - prototype for implementation of a boot service interface
 // RUNTIMESERVICE - prototype for implementation of a runtime service interface
 // RUNTIMEFUNCTION - prototype for implementation of a runtime function that 
is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
 //
 
 #ifdef __amd64__
 #defineEFIAPI  __attribute__((ms_abi))
 #endif
 
-#ifndef EFIAPI  // Forces EFI calling conventions reguardless 
of compiler options
+#ifndef EFIAPI  // Forces EFI calling conventions reguardless 
of compiler options 
 #if _MSC_EXTENSIONS
-#define EFIAPI __cdecl  // Force C calling convention for Microsoft C 
compiler
+#define EFIAPI __cdecl  // Force C calling convention for Microsoft C 
compiler 
 #else
-#define EFIAPI  // Substitute expresion to force C calling 
convention
+#define EFIAPI  // Substitute expresion to force C calling 
convention 
 #endif
 #endif
 
@@ -184,7 +184,7 @@ typedef uint64_t   UINTN;
 
 #define VOLATILEvolatile
 
-#define MEMORY_FENCE()
+#define MEMORY_FENCE()
 
 #ifdef EFI_NO_INTERFACE_DECL
   #define EFI_FORWARD_DECLARATION(x)
@@ -233,9 +233,9 @@ typedef uint64_t   UINTN;
 
 
 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry)  \
-(_if)->LoadInternal(type, name, NULL)
+(_if)->LoadInternal(type, name, NULL) 
 
-#else // EFI_NT_EMULATOR
+#else // EFI_NT_EMULATOR 
 
 //
 // When build similiar to FW, then link everything together as
@@ -247,7 +247,7 @@ typedef uint64_t   UINTN;
 #define LOAD_INTERNAL_DRIVER(_if, type, 

svn commit: r292627 - head/contrib/gcc/config/rs6000

2015-12-22 Thread Andreas Tobler
Author: andreast
Date: Tue Dec 22 21:26:50 2015
New Revision: 292627
URL: https://svnweb.freebsd.org/changeset/base/292627

Log:
  Silence a boring warning.

Modified:
  head/contrib/gcc/config/rs6000/sysv4.h

Modified: head/contrib/gcc/config/rs6000/sysv4.h
==
--- head/contrib/gcc/config/rs6000/sysv4.h  Tue Dec 22 21:07:33 2015
(r292626)
+++ head/contrib/gcc/config/rs6000/sysv4.h  Tue Dec 22 21:26:50 2015
(r292627)
@@ -282,7 +282,9 @@ do {
\
 #define RESTORE_FP_SUFFIX "_l"
 
 /* Type used for ptrdiff_t, as a string used in a declaration.  */
+#ifndef PTRDIFF_TYPE
 #define PTRDIFF_TYPE "int"
+#endif
 
 /* Type used for wchar_t, as a string used in a declaration.  */
 /* Override svr4.h definition.  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292614 - stable/10/sys/dev/if_ndis

2015-12-22 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec 22 18:39:07 2015
New Revision: 292614
URL: https://svnweb.freebsd.org/changeset/base/292614

Log:
  Merge r292411: Fix regression in if_ndis in r280347.

Modified:
  stable/10/sys/dev/if_ndis/if_ndis_pci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/if_ndis/if_ndis_pci.c
==
--- stable/10/sys/dev/if_ndis/if_ndis_pci.c Tue Dec 22 18:12:11 2015
(r292613)
+++ stable/10/sys/dev/if_ndis/if_ndis_pci.c Tue Dec 22 18:39:07 2015
(r292614)
@@ -295,8 +295,7 @@ ndis_attach_pci(dev)
BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
-   BUS_SPACE_MAXSIZE_32BIT, /* maxsize */
-   NDIS_NSEG_NEW,  /* nsegments */
+   DFLTPHYS, NDIS_NSEG_NEW,/* maxsize, nsegments */
BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */
BUS_DMA_ALLOCNOW,   /* flags */
NULL, NULL, /* lockfunc, lockarg */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292617 - stable/9/sys/dev/qlxgbe

2015-12-22 Thread David C Somayajulu
Author: davidcs
Date: Tue Dec 22 19:41:40 2015
New Revision: 292617
URL: https://svnweb.freebsd.org/changeset/base/292617

Log:
  MFC r289635
  
ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
ql_os.c: removed unnecessary debug printf
ql_ver.h: updated version number

Modified:
  stable/9/sys/dev/qlxgbe/ql_hw.c
  stable/9/sys/dev/qlxgbe/ql_os.c
  stable/9/sys/dev/qlxgbe/ql_ver.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/qlxgbe/ql_hw.c
==
--- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:40:34 2015
(r292616)
+++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:41:40 2015
(r292617)
@@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha)
"Minidump Utility can start minidump process");
 #ifdef QL_DBG
 
+   ha->err_inject = 0;
 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 OID_AUTO, "err_inject",
@@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha)
val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT);
 
if ((val != ha->hw.hbeat_value) &&
-   (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE {
+   (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE {
ha->hw.hbeat_value = val;
return 0;
}

Modified: stable/9/sys/dev/qlxgbe/ql_os.c
==
--- stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:40:34 2015
(r292616)
+++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:41:40 2015
(r292617)
@@ -289,8 +289,6 @@ qla_pci_attach(device_t dev)
int i;
uint32_t num_rcvq = 0;
 
-   QL_DPRINT2(ha, (dev, "%s: enter\n", __func__));
-
 if ((ha = device_get_softc(dev)) == NULL) {
 device_printf(dev, "cannot get softc\n");
 return (ENOMEM);

Modified: stable/9/sys/dev/qlxgbe/ql_ver.h
==
--- stable/9/sys/dev/qlxgbe/ql_ver.hTue Dec 22 19:40:34 2015
(r292616)
+++ stable/9/sys/dev/qlxgbe/ql_ver.hTue Dec 22 19:41:40 2015
(r292617)
@@ -36,6 +36,6 @@
 
 #define QLA_VERSION_MAJOR  3
 #define QLA_VERSION_MINOR  10
-#define QLA_VERSION_BUILD   24
+#define QLA_VERSION_BUILD   25
 
 #endif /* #ifndef _QL_VER_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292616 - head/tools/tools/nanobsd/embedded

2015-12-22 Thread Warner Losh
Author: imp
Date: Tue Dec 22 19:40:34 2015
New Revision: 292616
URL: https://svnweb.freebsd.org/changeset/base/292616

Log:
  Delete the DOS dir to mirror what we do with NANO_WORLDDIR.
  Copy ubldr and ubldr.bin to the dos partition when we're making it.
  Minor style fixes.

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonTue Dec 22 19:34:21 2015
(r292615)
+++ head/tools/tools/nanobsd/embedded/commonTue Dec 22 19:40:34 2015
(r292616)
@@ -106,18 +106,16 @@ NANO_FAT_DIR=${NANO_OBJ}/_.fat
 
 customize_cmd cust_allow_ssh_root
 
-add_etc_make_conf()
-{
+add_etc_make_conf ( ) (
touch ${NANO_WORLDDIR}/etc/make.conf
-}
+)
 customize_cmd add_etc_make_conf
 
-cust_install_machine_files()
-{
+cust_install_machine_files ( ) (
echo "cd ${NANO_CFG_BASE}/Files"
cd ${NANO_CFG_BASE}/Files
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv 
${NANO_WORLDDIR}
-}
+)
 customize_cmd cust_install_files
 customize_cmd cust_install_machine_files 
 
@@ -181,8 +179,7 @@ WITHOUT_RCS=true
 NANO_PACKAGE_ONLY=1
 
 # install a package from a pre-built binary
-do_add_pkg ()
-{
+do_add_pkg ( ) (
# Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function
set -x
mkdir -p ${NANO_OBJ}/ports/distfiles
@@ -200,11 +197,10 @@ do_add_pkg ()
rmdir ${NANO_WORLDDIR}/usr/ports/distfiles
rmdir ${NANO_WORLDDIR}/usr/ports
set +x
-}
+)
 
 # Build a port (with the side effect of creating a package)
-do_add_port ()
-{
+do_add_port ( ) (
local port_path
port_path=$1
shift
@@ -245,11 +241,12 @@ do_add_port ()
umount ${NANO_WORLDDIR}/usr/ports
umount ${NANO_WORLDDIR}/usr/src
set +x
-}
+)
 
 # Need to check if this function works with cross-compiling architecture
 # Recursive complex fonction: Generate one function for each ports
-add_port () {
+# writes shell functions called later, so don't do in subshell.
+add_port ( ) {
 local port_path=$1
 local port=`echo $1 | sed -e 's/\//_/'`
 shift
@@ -262,7 +259,7 @@ add_port () {
 if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then
# Pkg file found: Generate add_pkg_NAME function
eval "
-   add_pkg_${port} () {
+   add_pkg_${port} ( ) {
do_add_pkg ${PKG_NAME}
}
 customize_cmd add_pkg_${port}
@@ -270,7 +267,7 @@ add_port () {
 else
# No pkg file: Generate add_port_NAME function
 eval "
-add_port_${port} () {
+add_port_${port} ( ) {
do_add_port ${port_path} $*
}
customize_cmd add_port_${port}
@@ -329,7 +326,7 @@ create_diskimage_mbr ( ) (
if [ -z "${NANO_CFGDIR}" ]; then
echo "Faking cfg dir, it's empty"
NANO_CFGDIR=${NANO_OBJ}/_.empty
-   mkdir ${NANO_CFGDIR}
+   mkdir -p ${NANO_CFGDIR}
fi
# XXX -F cfg-mtree
eval "${NANO_MAKEFS_UFS}" -s ${NANO_SLICE_CFG_SIZE} \
@@ -377,8 +374,7 @@ create_diskimage_mbr ( ) (
) > ${NANO_OBJ}/_.di 2>&1
 )
 
-die()
-{
+die( ) {
echo "$*"
exit 1
 }
@@ -435,19 +431,17 @@ $var=$val"
fi
 done
 
-save_build ( )
-{
+save_build ( ) (
VERSION_FILE=${NANO_WORLDDIR}/etc/version
if [ "${SVNREVISION}" = "${REVISION}" ]; then
echo "${NANO_NAME}" > "${VERSION_FILE}"
else
echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}"
fi
-}
+)
 customize_cmd save_build
 
-shrink_md_fbsize ( )
-{
+shrink_md_fbsize ( ) (
# We have a lot of little files on our memory disks. Let's decrease
# the block and frag size to fit more little files on them (this
# halves our space requirement by ~50% on /etc and /var on 8.x --
@@ -455,17 +449,25 @@ shrink_md_fbsize ( )
# are 4 times larger).
sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \
${NANO_WORLDDIR}/etc/rc.initdiskless
-}
+)
 customize_cmd shrink_md_fbsize
 
 customize_cmd cust_comconsole
 
-dos_boot_part ( )
-(
+dos_boot_part ( ) (
local d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
 
+   # For now, just copy all the files. However, for iMX6 and Allwinner,
+   # we'll need to put a special boot block at a fixed location
+   # on the disk as well.
+   rm -rf ${NANO_FAT_DIR}
mkdir ${NANO_FAT_DIR}
-   cp ${d}/* ${NANO_FAT_DIR}   
+   cp ${d}/* ${NANO_FAT_DIR}
+
+   # Also copy ubldr. u-boot will load it and it will load the kernel
+   # from the ufs partition
+   cp ${NANO_WORLDDIR}/boot/ubldr ${NANO_FAT_DIR}
+   cp ${NANO_WORLDDIR}/boot/ubldr.bin ${NANO_FAT_DIR}
 )
 
 if [ -n "$NANO_BOOT_PKG" ]; then
@@ -480,8 +482,7 @@ if [ -n 

svn commit: r292619 - head/sys/amd64/include

2015-12-22 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 20:08:32 2015
New Revision: 292619
URL: https://svnweb.freebsd.org/changeset/base/292619

Log:
  Remove redundant ctx_switch_xsave declaration in sys/amd64/include/md_var.h
  
  This variable was added to sys/x86/include/x86_var.h recently.
  
  This unbreaks building kernel source that #includes both md_var.h and 
x86_var.h
  with gcc 4.2.1 on amd64
  
  Differential Revision: https://reviews.freebsd.org/D4686
  Reviewed by: kib
  X-MFC with: r291949
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/amd64/include/md_var.h

Modified: head/sys/amd64/include/md_var.h
==
--- head/sys/amd64/include/md_var.h Tue Dec 22 20:03:49 2015
(r292618)
+++ head/sys/amd64/include/md_var.h Tue Dec 22 20:08:32 2015
(r292619)
@@ -34,7 +34,6 @@
 
 #include 
 
-extern charctx_switch_xsave[];
 extern  uint64_t *vm_page_dump;
 
 /* XXX */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292621 - head/sys/fs/devfs

2015-12-22 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 22 20:22:17 2015
New Revision: 292621
URL: https://svnweb.freebsd.org/changeset/base/292621

Log:
  Keep devfs mount locked for the whole duration of the devfs_setattr(),
  and ensure that our dirent is instantiated.
  
  Reported and tested by:   bde
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:12:52 2015
(r292620)
+++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:22:17 2015
(r292621)
@@ -1560,11 +1560,15 @@ devfs_setattr(struct vop_setattr_args *a
return (EINVAL);
}
 
+   error = devfs_populate_vp(vp);
+   if (error != 0)
+   return (error);
+
de = vp->v_data;
if (vp->v_type == VDIR)
de = de->de_dir;
 
-   error = c = 0;
+   c = 0;
if (vap->va_uid == (uid_t)VNOVAL)
uid = de->de_uid;
else
@@ -1577,8 +1581,8 @@ devfs_setattr(struct vop_setattr_args *a
if ((ap->a_cred->cr_uid != de->de_uid) || uid != de->de_uid ||
(gid != de->de_gid && !groupmember(gid, ap->a_cred))) {
error = priv_check(td, PRIV_VFS_CHOWN);
-   if (error)
-   return (error);
+   if (error != 0)
+   goto ret;
}
de->de_uid = uid;
de->de_gid = gid;
@@ -1588,8 +1592,8 @@ devfs_setattr(struct vop_setattr_args *a
if (vap->va_mode != (mode_t)VNOVAL) {
if (ap->a_cred->cr_uid != de->de_uid) {
error = priv_check(td, PRIV_VFS_ADMIN);
-   if (error)
-   return (error);
+   if (error != 0)
+   goto ret;
}
de->de_mode = vap->va_mode;
c = 1;
@@ -1598,7 +1602,7 @@ devfs_setattr(struct vop_setattr_args *a
if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
error = vn_utimes_perm(vp, vap, ap->a_cred, td);
if (error != 0)
-   return (error);
+   goto ret;
if (vap->va_atime.tv_sec != VNOVAL) {
if (vp->v_type == VCHR)
vp->v_rdev->si_atime = vap->va_atime;
@@ -1620,7 +1624,10 @@ devfs_setattr(struct vop_setattr_args *a
else
vfs_timestamp(>de_mtime);
}
-   return (0);
+
+ret:
+   sx_xunlock((vp->v_mount)->dm_lock);
+   return (error);
 }
 
 #ifdef MAC
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292624 - in head/sys: fs/devfs sys

2015-12-22 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 22 20:37:34 2015
New Revision: 292624
URL: https://svnweb.freebsd.org/changeset/base/292624

Log:
  Make it possible for the cdevsw d_close() driver method to detect last
  close and close due to revoke(2)-like operation.
  
  A new FLASTCLOSE flag indicates that this is last close.  FREVOKE is
  set for revokes, and FNONBLOCK is also set, same as is already done
  for VOP_CLOSE() call from vgonel().
  
  The flags reuse user open(2) flags which are never stored in f_flag,
  to not consume bit space in the ABI visible way.  Assert this with the
  static check.
  
  Requested and reviewed by:bde
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/sys/fcntl.h

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:36:14 2015
(r292623)
+++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:37:34 2015
(r292624)
@@ -557,7 +557,9 @@ devfs_access(struct vop_access_args *ap)
return (error);
 }
 
-/* ARGSUSED */
+_Static_assert(((FMASK | FCNTLFLAGS) & (FLASTCLOSE | FREVOKE)) == 0,
+"devfs-only flag reuse failed");
+
 static int
 devfs_close(struct vop_close_args *ap)
 {
@@ -566,7 +568,7 @@ devfs_close(struct vop_close_args *ap)
struct proc *p;
struct cdev *dev = vp->v_rdev;
struct cdevsw *dsw;
-   int vp_locked, error, ref;
+   int dflags, error, ref, vp_locked;
 
/*
 * XXX: Don't call d_close() if we were called because of
@@ -621,9 +623,11 @@ devfs_close(struct vop_close_args *ap)
dsw = dev_refthread(dev, );
if (dsw == NULL)
return (ENXIO);
+   dflags = 0;
VI_LOCK(vp);
if (vp->v_iflag & VI_DOOMED) {
/* Forced close. */
+   dflags |= FREVOKE | FNONBLOCK;
} else if (dsw->d_flags & D_TRACKCLOSE) {
/* Keep device updated on status. */
} else if (count_dev(dev) > 1) {
@@ -631,13 +635,15 @@ devfs_close(struct vop_close_args *ap)
dev_relthread(dev, ref);
return (0);
}
+   if (count_dev(dev) == 1)
+   dflags |= FLASTCLOSE;
vholdl(vp);
VI_UNLOCK(vp);
vp_locked = VOP_ISLOCKED(vp);
VOP_UNLOCK(vp, 0);
KASSERT(dev->si_refcount > 0,
("devfs_close() on un-referenced struct cdev *(%s)", 
devtoname(dev)));
-   error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td);
+   error = dsw->d_close(dev, ap->a_fflag | dflags, S_IFCHR, td);
dev_relthread(dev, ref);
vn_lock(vp, vp_locked | LK_RETRY);
vdrop(vp);

Modified: head/sys/sys/fcntl.h
==
--- head/sys/sys/fcntl.hTue Dec 22 20:36:14 2015(r292623)
+++ head/sys/sys/fcntl.hTue Dec 22 20:37:34 2015(r292624)
@@ -138,6 +138,11 @@ typedef__pid_t pid_t;
  */
 
 #ifdef _KERNEL
+
+/* Only for devfs d_close() flags. */
+#defineFLASTCLOSE  O_DIRECTORY
+#defineFREVOKE O_VERIFY
+
 /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */
 #defineFFLAGS(oflags)  ((oflags) & O_EXEC ? (oflags) : (oflags) + 1)
 #defineOFLAGS(fflags)  ((fflags) & O_EXEC ? (fflags) : (fflags) - 1)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-12-22 Thread John Baldwin
On Tuesday, December 22, 2015 09:07:33 PM Garrett Cooper wrote:
> Author: ngie
> Date: Tue Dec 22 21:07:33 2015
> New Revision: 292626
> URL: https://svnweb.freebsd.org/changeset/base/292626
> 
> Log:
>   Fold lim_shared into lim_copy to mute a -Wunused compiler warning from
>   clang when the kernel is compiled without INVARIANTS
>   
>   Differential Revision: https://reviews.freebsd.org/D4683
>   Reviewed by: kib, jhb
>   MFC after: 1 week
>   Sponsored by: EMC / Isilon Storage Division
> 
> Modified:
>   head/sys/kern/kern_resource.c
> 
> Modified: head/sys/kern/kern_resource.c
> ==
> --- head/sys/kern/kern_resource.c Tue Dec 22 20:40:34 2015
> (r292625)
> +++ head/sys/kern/kern_resource.c Tue Dec 22 21:07:33 2015
> (r292626)
> @@ -80,8 +80,6 @@ static int  donice(struct thread *td, str
>  static struct uidinfo *uilookup(uid_t uid);
>  static void  ruxagg_locked(struct rusage_ext *rux, struct thread *td);
>  
> -static __inline int  lim_shared(struct plimit *limp);
> -
>  /*
>   * Resource controls and accounting.
>   */
> @@ -1109,13 +1107,6 @@ lim_hold(struct plimit *limp)
>   return (limp);
>  }
>  
> -static __inline int
> -lim_shared(struct plimit *limp)
> -{
> -
> - return (limp->pl_refcnt > 1);
> -}
> -
>  void
>  lim_fork(struct proc *p1, struct proc *p2)
>  {
> @@ -1146,7 +1137,7 @@ void
>  lim_copy(struct plimit *dst, struct plimit *src)
>  {
>  
> - KASSERT(!lim_shared(dst), ("lim_copy to shared limit"));
> + KASSERT(dst->pl_refcnt <= 1, ("lim_copy to shared limit"));

It shouldn't be zero, I think == 1 would be best actually.

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


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

2015-12-22 Thread David C Somayajulu
Author: davidcs
Date: Wed Dec 23 03:19:12 2015
New Revision: 292639
URL: https://svnweb.freebsd.org/changeset/base/292639

Log:
  Add support for firmware dump (a.k.a grcdump)
  
  MFC after:5 days

Added:
  head/sys/dev/bxe/bxe_dump.h   (contents, props changed)
  head/sys/dev/bxe/bxe_ioctl.h   (contents, props changed)
Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/ecore_init.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Dec 23 01:31:32 2015(r292638)
+++ head/sys/dev/bxe/bxe.c  Wed Dec 23 03:19:12 2015(r292639)
@@ -736,6 +736,8 @@ static __noinline int bxe_nic_unload(str
 static void bxe_handle_sp_tq(void *context, int pending);
 static void bxe_handle_fp_tq(void *context, int pending);
 
+static int bxe_add_cdev(struct bxe_softc *sc);
+static void bxe_del_cdev(struct bxe_softc *sc);
 
 /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */
 uint32_t
@@ -4503,7 +4505,7 @@ bxe_nic_unload(struct bxe_softc *sc,
 sc->rx_mode = BXE_RX_MODE_NONE;
 /* XXX set rx mode ??? */
 
-if (IS_PF(sc)) {
+if (IS_PF(sc) && !sc->grcdump_done) {
 /* set ALWAYS_ALIVE bit in shmem */
 sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE;
 
@@ -4523,7 +4525,8 @@ bxe_nic_unload(struct bxe_softc *sc,
 ; /* bxe_vfpf_close_vf(sc); */
 } else if (unload_mode != UNLOAD_RECOVERY) {
 /* if this is a normal/close unload need to clean up chip */
-bxe_chip_cleanup(sc, unload_mode, keep_link);
+if (!sc->grcdump_done)
+bxe_chip_cleanup(sc, unload_mode, keep_link);
 } else {
 /* Send the UNLOAD_REQUEST to the MCP */
 bxe_send_unload_req(sc, unload_mode);
@@ -16276,6 +16279,12 @@ bxe_add_sysctls(struct bxe_softc *sc)
 CTLFLAG_RW, >debug,
 "debug logging mode");
 
+sc->trigger_grcdump = 0;
+SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
+CTLFLAG_RW, >trigger_grcdump, 0,
+"set by driver when a grcdump is needed");
+
+
 sc->rx_budget = bxe_rx_budget;
 SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget",
 CTLFLAG_RW, >rx_budget, 0,
@@ -16404,8 +16413,20 @@ bxe_attach(device_t dev)
 return (ENXIO);
 }
 
+if (bxe_add_cdev(sc) != 0) {
+if (sc->ifp != NULL) {
+ether_ifdetach(sc->ifp);
+}
+ifmedia_removeall(>ifmedia);
+bxe_release_mutexes(sc);
+bxe_deallocate_bars(sc);
+pci_disable_busmaster(dev);
+return (ENXIO);
+}
+
 /* allocate device interrupts */
 if (bxe_interrupt_alloc(sc) != 0) {
+bxe_del_cdev(sc);
 if (sc->ifp != NULL) {
 ether_ifdetach(sc->ifp);
 }
@@ -16419,6 +16440,7 @@ bxe_attach(device_t dev)
 /* allocate ilt */
 if (bxe_alloc_ilt_mem(sc) != 0) {
 bxe_interrupt_free(sc);
+bxe_del_cdev(sc);
 if (sc->ifp != NULL) {
 ether_ifdetach(sc->ifp);
 }
@@ -16433,6 +16455,7 @@ bxe_attach(device_t dev)
 if (bxe_alloc_hsi_mem(sc) != 0) {
 bxe_free_ilt_mem(sc);
 bxe_interrupt_free(sc);
+bxe_del_cdev(sc);
 if (sc->ifp != NULL) {
 ether_ifdetach(sc->ifp);
 }
@@ -16504,6 +16527,8 @@ bxe_detach(device_t dev)
 return(EBUSY);
 }
 
+bxe_del_cdev(sc);
+
 /* stop the periodic callout */
 bxe_periodic_stop(sc);
 
@@ -18824,3 +18849,457 @@ ecore_storm_memset_struct(struct bxe_sof
 }
 }
 
+
+/*
+ * character device - ioctl interface definitions
+ */
+
+
+#include "bxe_dump.h"
+#include "bxe_ioctl.h"
+#include 
+
+static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
+struct thread *td);
+
+static struct cdevsw bxe_cdevsw = {
+.d_version = D_VERSION,
+.d_ioctl = bxe_eioctl,
+.d_name = "bxecnic",
+};
+
+#define BXE_PATH(sc)(CHIP_IS_E1x(sc) ? 0 : (sc->pcie_func & 1))
+
+
+#define DUMP_ALL_PRESETS0x1FFF
+#define DUMP_MAX_PRESETS13
+#define IS_E1_REG(chips)((chips & DUMP_CHIP_E1) == DUMP_CHIP_E1)
+#define IS_E1H_REG(chips)   ((chips & DUMP_CHIP_E1H) == DUMP_CHIP_E1H)
+#define IS_E2_REG(chips)((chips & DUMP_CHIP_E2) == DUMP_CHIP_E2)
+#define IS_E3A0_REG(chips)  ((chips & DUMP_CHIP_E3A0) == DUMP_CHIP_E3A0)
+#define IS_E3B0_REG(chips)  ((chips & DUMP_CHIP_E3B0) == DUMP_CHIP_E3B0)
+
+#define IS_REG_IN_PRESET(presets, idx)  \
+((presets & (1 << (idx-1))) == (1 << (idx-1)))
+
+
+static int
+bxe_get_preset_regs_len(struct bxe_softc *sc, uint32_t preset)
+{
+if (CHIP_IS_E1(sc))
+return dump_num_registers[0][preset-1];
+else if (CHIP_IS_E1H(sc))
+return dump_num_registers[1][preset-1];
+else if (CHIP_IS_E2(sc))
+return dump_num_registers[2][preset-1];
+else if 

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

2015-12-22 Thread David C Somayajulu
Author: davidcs
Date: Wed Dec 23 01:31:32 2015
New Revision: 292638
URL: https://svnweb.freebsd.org/changeset/base/292638

Log:
  Check for packet_length is greater than 60 bytes as well as packet_length is
  greater than len_on_bd, before invoking the routine to handle jumbo over SGL
  (bxe_service_rxsgl()).
  Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
  erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)
  
  Fix formatting in bxe_sysctl_state()
  
  MFC after:5 days

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

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Tue Dec 22 23:21:06 2015(r292637)
+++ head/sys/dev/bxe/bxe.c  Wed Dec 23 01:31:32 2015(r292638)
@@ -472,6 +472,10 @@ static const struct {
 4, STATS_FLAGS_FUNC, "rx_pkts"},
 { STATS_OFFSET32(rx_tpa_pkts),
 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"},
+{ STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts),
+4, STATS_FLAGS_FUNC, "rx_erroneous_jumbo_sge_pkts"},
+{ STATS_OFFSET32(rx_bxe_service_rxsgl),
+4, STATS_FLAGS_FUNC, "rx_bxe_service_rxsgl"},
 { STATS_OFFSET32(rx_jumbo_sge_pkts),
 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"},
 { STATS_OFFSET32(rx_soft_errors),
@@ -585,6 +589,10 @@ static const struct {
 4, "rx_pkts"},
 { Q_STATS_OFFSET32(rx_tpa_pkts),
 4, "rx_tpa_pkts"},
+{ Q_STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts),
+4, "rx_erroneous_jumbo_sge_pkts"},
+{ Q_STATS_OFFSET32(rx_bxe_service_rxsgl),
+4, "rx_bxe_service_rxsgl"},
 { Q_STATS_OFFSET32(rx_jumbo_sge_pkts),
 4, "rx_jumbo_sge_pkts"},
 { Q_STATS_OFFSET32(rx_soft_errors),
@@ -3475,11 +3483,14 @@ bxe_rxeof(struct bxe_softc*sc,
 m_adj(m, pad);
 m->m_pkthdr.len = m->m_len = len;
 
-if (len != lenonbd){
+if ((len > 60) && (len > lenonbd)) {
+fp->eth_q_stats.rx_bxe_service_rxsgl++;
 rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp);
 if (rc)
 break;
 fp->eth_q_stats.rx_jumbo_sge_pkts++;
+} else if (lenonbd < len) {
+fp->eth_q_stats.rx_erroneous_jumbo_sge_pkts++;
 }
 
 /* assign packet to this interface interface */
@@ -16122,12 +16133,12 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
 }
 
 if (result == 1) {
-   uint32_t  temp;
+uint32_t  temp;
 sc = (struct bxe_softc *)arg1;
 
 BLOGI(sc, "... dumping driver state ...\n");
-   temp = SHMEM2_RD(sc, temperature_in_half_celsius);
-   BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2));
+temp = SHMEM2_RD(sc, temperature_in_half_celsius);
+BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2));
 }
 
 return (error);

Modified: head/sys/dev/bxe/bxe_stats.c
==
--- head/sys/dev/bxe/bxe_stats.cTue Dec 22 23:21:06 2015
(r292637)
+++ head/sys/dev/bxe/bxe_stats.cWed Dec 23 01:31:32 2015
(r292638)
@@ -1227,6 +1227,8 @@ bxe_drv_stats_update(struct bxe_softc *s
 UPDATE_ESTAT_QSTAT(rx_calls);
 UPDATE_ESTAT_QSTAT(rx_pkts);
 UPDATE_ESTAT_QSTAT(rx_tpa_pkts);
+UPDATE_ESTAT_QSTAT(rx_erroneous_jumbo_sge_pkts);
+UPDATE_ESTAT_QSTAT(rx_bxe_service_rxsgl);
 UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts);
 UPDATE_ESTAT_QSTAT(rx_soft_errors);
 UPDATE_ESTAT_QSTAT(rx_hw_csum_errors);

Modified: head/sys/dev/bxe/bxe_stats.h
==
--- head/sys/dev/bxe/bxe_stats.hTue Dec 22 23:21:06 2015
(r292637)
+++ head/sys/dev/bxe/bxe_stats.hWed Dec 23 01:31:32 2015
(r292638)
@@ -218,6 +218,8 @@ struct bxe_eth_stats {
 uint32_t rx_calls;
 uint32_t rx_pkts;
 uint32_t rx_tpa_pkts;
+uint32_t rx_erroneous_jumbo_sge_pkts;
+uint32_t rx_bxe_service_rxsgl;
 uint32_t rx_jumbo_sge_pkts;
 uint32_t rx_soft_errors;
 uint32_t rx_hw_csum_errors;
@@ -319,6 +321,8 @@ struct bxe_eth_q_stats {
 uint32_t rx_calls;
 uint32_t rx_pkts;
 uint32_t rx_tpa_pkts;
+uint32_t rx_erroneous_jumbo_sge_pkts;
+uint32_t rx_bxe_service_rxsgl;
 uint32_t rx_jumbo_sge_pkts;
 uint32_t rx_soft_errors;
 uint32_t rx_hw_csum_errors;
@@ -413,6 +417,8 @@ struct bxe_eth_q_stats_old {
 uint32_t rx_calls_old;
 uint32_t rx_pkts_old;
 uint32_t rx_tpa_pkts_old;
+uint32_t rx_erroneous_jumbo_sge_pkts_old;
+uint32_t rx_bxe_service_rxsgl_old;
 uint32_t rx_jumbo_sge_pkts_old;
 uint32_t rx_soft_errors_old;
 uint32_t rx_hw_csum_errors_old;
___

svn commit: r292622 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss

2015-12-22 Thread John Baldwin
Author: jhb
Date: Tue Dec 22 20:33:49 2015
New Revision: 292622
URL: https://svnweb.freebsd.org/changeset/base/292622

Log:
  Move the mkioctls script to libsysdecode and use it to generate a
  sysdecode_ioctlname() function.  This function matches the behavior
  of the truss variant in that it returns a pointer to a string description
  for known ioctls.  The caller is responsible for displaying unknown
  ioctl requests.  For kdump this meant moving the logic to handle unknown
  ioctl requests out of the generated function and into an ioctlname()
  function in kdump.c instead.
  
  Differential Revision:https://reviews.freebsd.org/D4610

Added:
  head/lib/libsysdecode/mkioctls
 - copied, changed from r292620, head/usr.bin/kdump/mkioctls
  head/lib/libsysdecode/sysdecode_ioctlname.3   (contents, props changed)
Deleted:
  head/usr.bin/kdump/mkioctls
Modified:
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/sysdecode.3
  head/lib/libsysdecode/sysdecode.h
  head/usr.bin/kdump/Makefile
  head/usr.bin/kdump/kdump.c
  head/usr.bin/truss/Makefile
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libsysdecode/Makefile
==
--- head/lib/libsysdecode/Makefile  Tue Dec 22 20:22:17 2015
(r292621)
+++ head/lib/libsysdecode/Makefile  Tue Dec 22 20:33:49 2015
(r292622)
@@ -4,10 +4,31 @@
 
 LIB=   sysdecode
 
-SRCS=  utrace.c
+SRCS=  ioctl.c utrace.c
 INCS=  sysdecode.h
 
 MAN+=  sysdecode.3 \
+   sysdecode_ioctlname.3 \
sysdecode_utrace.3
 
+CLEANFILES= ioctl.c
+
+.if defined(COMPAT_32BIT)
+CPP+=  -m32
+.endif
+
+.if ${MK_PF} != "no"
+CFLAGS+=-DPF
+.endif
+
+# Workaround duplicate declarations in 
+CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls
+CFLAGS.gcc+=   ${CFLAGS.gcc.${.IMPSRC}}
+
+ioctl.c: mkioctls
+   env MACHINE=${MACHINE} CPP="${CPP}" \
+   /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
+
+beforedepend: ioctl.c
+
 .include 

Copied and modified: head/lib/libsysdecode/mkioctls (from r292620, 
head/usr.bin/kdump/mkioctls)
==
--- head/usr.bin/kdump/mkioctls Tue Dec 22 20:12:52 2015(r292620, copy 
source)
+++ head/lib/libsysdecode/mkioctls  Tue Dec 22 20:33:49 2015
(r292622)
@@ -1,19 +1,15 @@
 #!/bin/sh
 #
 # $FreeBSD$
-#
-# When editing this script, keep in mind that truss also uses it.
-#
 
 set -e
 
-if [ $# -ne 2 -o \( $1 != "print" -a $1 != "return" \) ]; then
-   echo "usage: sh $0 print|return include-dir"
+if [ $# -ne 1 ]; then
+   echo "usage: sh $0 include-dir"
exit 1
 fi
 
-style="$1"
-includedir="$2"
+includedir="$1"
 
 LC_ALL=C; export LC_ALL
 
@@ -40,7 +36,7 @@ esac
 
 awk -v x="$ioctl_includes" 'BEGIN {print x}' |
$CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - |
-   awk -v ioctl_includes="$ioctl_includes" -v style="$style" '
+   awk -v ioctl_includes="$ioctl_includes" '
 BEGIN {
print "/* XXX obnoxious prerequisites. */"
print "#define COMPAT_43"
@@ -68,20 +64,12 @@ BEGIN {
print "#include "
print "#include "
print "#include "
+   print "#include "
print ""
print ioctl_includes
print ""
-   if (style == "print") {
-   print "void ioctlname(unsigned long val, int decimal);"
-   print ""
-   print "void"
-   print "ioctlname(unsigned long val, int decimal)"
-   } else {
-   print "const char *ioctlname(unsigned long val);"
-   print ""
-   print "const char *"
-   print "ioctlname(unsigned long val)"
-   }
+   print "const char *"
+   print "sysdecode_ioctlname(unsigned long val)"
print "{"
print "\tconst char *str = NULL;"
print ""
@@ -103,16 +91,7 @@ BEGIN {
 }
 END {
print ""
-   if (style == "print") {
-   print "\tif (str != NULL)"
-   print "\t\tprintf(\"%s\", str);"
-   print "\telse if (decimal)"
-   print "\t\tprintf(\"%lu\", val);"
-   print "\telse"
-   print "\t\tprintf(\"%#lx\", val);"
-   } else {
-   print "\treturn (str);"
-   }
+   print "\treturn (str);"
print "}"
 }
 '

Modified: head/lib/libsysdecode/sysdecode.3
==
--- head/lib/libsysdecode/sysdecode.3   Tue Dec 22 20:22:17 2015
(r292621)
+++ head/lib/libsysdecode/sysdecode.3   Tue Dec 22 20:33:49 2015
(r292622)
@@ -39,6 +39,7 @@ The
 library includes several functions that provide descriptive names of
 values associated with system calls.
 .Sh SEE ALSO
+.Xr sysdecode_ioctlname 3 ,
 .Xr sysdecode_utrace 3
 .Sh HISTORY
 The

Modified: head/lib/libsysdecode/sysdecode.h

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

2015-12-22 Thread Bruce Evans

On Tue, 22 Dec 2015, Konstantin Belousov wrote:


Log:
 If we annoy user with the terminal output due to failed load of
 interpreter, also show the actual error code instead of some
 interpretation.


This and nearby messages are of annoyingly low quality.  They don't
even print the program name(s).

I use the following partial fixes.  I forget if they print the program
name or the interpeter name.

X Index: imgact_elf.c
X ===
X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v
X retrieving revision 1.151
X diff -u -2 -r1.151 imgact_elf.c
X --- imgact_elf.c  5 Jun 2004 02:18:28 -   1.151
X +++ imgact_elf.c  5 Jun 2004 06:51:25 -
X @@ -694,6 +693,6 @@
X   brand_info = __elfN(get_brandinfo)(hdr, interp);
X   if (brand_info == NULL) {
X - uprintf("ELF binary type \"%u\" not known.\n",
X - hdr->e_ident[EI_OSABI]);
X + uprintf("%s: ELF binary type \"%u\" not known.\n",
X + imgp->stringbase, hdr->e_ident[EI_OSABI]);
X   error = ENOEXEC;
X   goto fail;
X @@ -828,5 +827,6 @@
X   >entry_addr, sv->sv_pagesize);
X   if (error != 0) {
X - uprintf("ELF interpreter %s not found\n", interp);
X + uprintf("%s: ELF interpreter %s not found\n",
X + imgp->stringbase, interp);
X   goto fail;
X   }

Other uprintf()s in imgact_elf.c are worse -- they print a fixed string that
gives no hint about the intepreter either (except it sometimes says ELF or
elf or PT_).

Y   uprintf("elf_load_section: truncated ELF file\n");
Y   uprintf("Program headers not in the first page\n");
Y   uprintf("Unaligned program headers\n");
Y   uprintf("Invalid PT_INTERP\n");
Y   uprintf("i/o error PT_INTERP\n");
Y   uprintf("Cannot execute shared object\n");
Y   uprintf("%s\n", err_str);
Y   uprintf("ELF interpreter %s not found\n", interp);
Y   uprintf("i/o error PT_NOTE\n");

The "ELF binary type \"%u\" not known.\n", message is the only one with
the style bug of a terminating ".".  My patch is missing the fix for this.

"elf_load_section: truncated ELF file\n" messages is the only one that
prints the function name.  This is not very useful for users.

All kernel printfs and KASSERT()s in the file use __func__ to obfuscate
the function name and have many other style bugs.

uprintf() is rarely used.  Aproximately 100 times.  Most uses don't
print enough context.  In kern_exec.c there is a related one that
prints a pathname, but not in err() format with the name first.  The
problematic pathname or interpreter name may be nested.  I'm not sure how
to find the complete sequence of names.

tprintf() is only used 7 times.  Some uprintf()s should probably be
tprintf()s to get them logged.

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


Re: svn commit: r292621 - head/sys/fs/devfs

2015-12-22 Thread Bruce Evans

On Tue, 22 Dec 2015, Konstantin Belousov wrote:


Log:
 Keep devfs mount locked for the whole duration of the devfs_setattr(),
 and ensure that our dirent is instantiated.

 Reported and tested by:bde
 Sponsored by:  The FreeBSD Foundation
 MFC after: 1 week


Thanks.

This is part of fixing revoke(2).  Even stat() doesn't work right when
it races revoke().  setattr() is used surprisingly often since it is used
for opening with O_TRUNC.  open() racing with revoke() caused problems
doing the truncation even though truncation is a no-op for devfs.
Truncation is not atomic for opening with O_TRUNC.

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


Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm

2015-12-22 Thread Justin Hibbits
On Dec 22, 2015 18:48, "NGie Cooper"  wrote:
>
>
> > On Dec 22, 2015, at 13:51, Ed Maste  wrote:
> >
> > On 19 December 2015 at 13:42, Alan Cox  wrote:
> >> Author: alc
> >> Date: Sat Dec 19 18:42:50 2015
> >> New Revision: 292469
> >> URL: https://svnweb.freebsd.org/changeset/base/292469
> >>
> >> Log:
> >>  Introduce a new mechanism for relocating virtual pages to a new
physical
> >>  address and use this mechanism when:
> >
> > Universe build is failing on powerpc.powerpc with:
> >
> > cc1: warnings being treated as errors
> > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function
'vm_page_reclaim_run':
> > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison
> > is always true due to limited range of data type
> > *** [vm_page.o] Error code 1
>
> +1
>
> It’s only with the MPC85XX kernel, which I believe is 32-bit powerpc.
>
> Thanks!
> -NGie

Correct, this is due to the fact that on this target vm_paddr_t is 64-bit,
and trunc_page() macro casts through unsigned long (32 bits). I have a
patch that removes all casts for vm macros in PowerPC (PowerPC is the only
target that casts for these macros still), in code review right now (only
been lightly tested).

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

Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm

2015-12-22 Thread Ed Maste
On 19 December 2015 at 13:42, Alan Cox  wrote:
> Author: alc
> Date: Sat Dec 19 18:42:50 2015
> New Revision: 292469
> URL: https://svnweb.freebsd.org/changeset/base/292469
>
> Log:
>   Introduce a new mechanism for relocating virtual pages to a new physical
>   address and use this mechanism when:

Universe build is failing on powerpc.powerpc with:

cc1: warnings being treated as errors
/scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function 'vm_page_reclaim_run':
/scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison
is always true due to limited range of data type
*** [vm_page.o] Error code 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm

2015-12-22 Thread NGie Cooper

> On Dec 22, 2015, at 13:51, Ed Maste  wrote:
> 
> On 19 December 2015 at 13:42, Alan Cox  wrote:
>> Author: alc
>> Date: Sat Dec 19 18:42:50 2015
>> New Revision: 292469
>> URL: https://svnweb.freebsd.org/changeset/base/292469
>> 
>> Log:
>>  Introduce a new mechanism for relocating virtual pages to a new physical
>>  address and use this mechanism when:
> 
> Universe build is failing on powerpc.powerpc with:
> 
> cc1: warnings being treated as errors
> /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function 
> 'vm_page_reclaim_run':
> /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison
> is always true due to limited range of data type
> *** [vm_page.o] Error code 1

+1

It’s only with the MPC85XX kernel, which I believe is 32-bit powerpc.

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

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

2015-12-22 Thread NGie Cooper

> On Dec 22, 2015, at 13:17, John Baldwin  wrote:
> 
> On Tuesday, December 22, 2015 09:07:33 PM Garrett Cooper wrote:

…

> It shouldn't be zero, I think == 1 would be best actually.

I’ll boot up GENERIC and see whether or not it works with == 1.
Thanks :)!
-NGie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r292629 - head/contrib/libexecinfo

2015-12-22 Thread Baptiste Daroussin
Author: bapt
Date: Tue Dec 22 22:40:42 2015
New Revision: 292629
URL: https://svnweb.freebsd.org/changeset/base/292629

Log:
  backtrace.3: Fix prototype of backtrace_symbols_fd_fmt().
  While here, fix a typo
  
  Submitted by: Sascha Wildner 
  Obtained from:DragonflyBSD

Modified:
  head/contrib/libexecinfo/backtrace.3

Modified: head/contrib/libexecinfo/backtrace.3
==
--- head/contrib/libexecinfo/backtrace.3Tue Dec 22 22:32:19 2015
(r292628)
+++ head/contrib/libexecinfo/backtrace.3Tue Dec 22 22:40:42 2015
(r292629)
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 3, 2015
+.Dd December 12, 2015
 .Dt BACKTRACE 3
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@
 .Ft "char **"
 .Fn backtrace_symbols_fmt "void * const *addrlist" "size_t len" "const char 
*fmt"
 .Ft int
-.Fn backtrace_symbols_fd_fmt "void * const *addrlist" "size_t len" "const char 
*fmt" "int fd"
+.Fn backtrace_symbols_fd_fmt "void * const *addrlist" "size_t len" "int fd" 
"const char *fmt"
 .Sh DESCRIPTION
 The
 .Fn backtrace
@@ -85,7 +85,7 @@ the /proc filesystem is available to det
 The difference of the symbol address and the address element printed
 using 0x%tx.
 .It Dv D
-The difference of the symbol addresss and the address element printed using
+The difference of the symbol address and the address element printed using
 +0x%tx if non-zero, or nothing if zero.
 .It Dv f
 The filename of the symbol as determined by
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292623 - in head: lib/libc/gen sys/boot/efi/include sys/boot/efi/include/amd64 sys/boot/efi/include/arm64 sys/boot/efi/include/i386 sys/boot/efi/libefi

2015-12-22 Thread Ed Maste
Author: emaste
Date: Tue Dec 22 20:36:14 2015
New Revision: 292623
URL: https://svnweb.freebsd.org/changeset/base/292623

Log:
  Support a.out format in nlist only on i386
  
  i386 is the only current FreeBSD architecture that ever used a.out
  format.
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D4687

Modified:
  head/lib/libc/gen/nlist.c
  head/sys/boot/efi/include/amd64/efibind.h
  head/sys/boot/efi/include/amd64/pe.h
  head/sys/boot/efi/include/arm64/efibind.h
  head/sys/boot/efi/include/efi.h
  head/sys/boot/efi/include/efi_nii.h
  head/sys/boot/efi/include/efidebug.h
  head/sys/boot/efi/include/efidef.h
  head/sys/boot/efi/include/efidevp.h
  head/sys/boot/efi/include/efifs.h
  head/sys/boot/efi/include/efinet.h
  head/sys/boot/efi/include/efipart.h
  head/sys/boot/efi/include/efipciio.h
  head/sys/boot/efi/include/efiprot.h
  head/sys/boot/efi/include/efipxebc.h
  head/sys/boot/efi/include/efiser.h
  head/sys/boot/efi/include/efiuga.h
  head/sys/boot/efi/include/i386/efibind.h
  head/sys/boot/efi/include/i386/pe.h
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/efi/libefi/time.c

Modified: head/lib/libc/gen/nlist.c
==
--- head/lib/libc/gen/nlist.c   Tue Dec 22 20:33:49 2015(r292622)
+++ head/lib/libc/gen/nlist.c   Tue Dec 22 20:36:14 2015(r292623)
@@ -47,8 +47,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "un-namespace.h"
 
-/* There is no a.out support on arm64 */
-#ifndef __aarch64__
+/* i386 is the only current FreeBSD architecture that used a.out format. */
+#ifdef __i386__
 #define _NLIST_DO_AOUT
 #endif
 #define _NLIST_DO_ELF

Modified: head/sys/boot/efi/include/amd64/efibind.h
==
--- head/sys/boot/efi/include/amd64/efibind.h   Tue Dec 22 20:33:49 2015
(r292622)
+++ head/sys/boot/efi/include/amd64/efibind.h   Tue Dec 22 20:36:14 2015
(r292623)
@@ -37,11 +37,11 @@ Revision History
 
 #if (__STDC_VERSION__ < 199901L )
 
-// No ANSI C 1999/2000 stdint.h integer width declarations 
+// No ANSI C 1999/2000 stdint.h integer width declarations
 
 #if _MSC_EXTENSIONS
 
-// Use Microsoft C compiler integer width declarations 
+// Use Microsoft C compiler integer width declarations
 
 typedef unsigned __int64uint64_t;
 typedef __int64 int64_t;
@@ -51,10 +51,10 @@ Revision History
 typedef short   int16_t;
 typedef unsigned char   uint8_t;
 typedef charint8_t;
-#else 
+#else
 #ifdef UNIX_LP64
 
-// Use LP64 programming model from C_FLAGS for integer width 
declarations 
+// Use LP64 programming model from C_FLAGS for integer width 
declarations
 
 typedef unsigned long   uint64_t;
 typedef longint64_t;
@@ -66,7 +66,7 @@ Revision History
 typedef charint8_t;
 #else
 
-// Assume P64 programming model from C_FLAGS for integer width 
declarations 
+// Assume P64 programming model from C_FLAGS for integer width 
declarations
 
 typedef unsigned long long  uint64_t;
 typedef long long   int64_t;
@@ -112,17 +112,17 @@ typedef uint64_t   UINTN;
 
 #ifdef EFI_NT_EMULATOR
 #define POST_CODE(_Data)
-#else
+#else
 #ifdef EFI_DEBUG
 #define POST_CODE(_Data)__asm mov eax,(_Data) __asm out 0x80,al
 #else
 #define POST_CODE(_Data)
-#endif  
+#endif
 #endif
 
 #define EFIERR(a)   (0x8000 | a)
 #define EFI_ERROR_MASK  0x8000
-#define EFIERR_OEM(a)   (0xc000 | a)  
+#define EFIERR_OEM(a)   (0xc000 | a)
 
 
 #define BAD_POINTER 0xFBFBFBFBFBFBFBFB
@@ -156,18 +156,18 @@ typedef uint64_t   UINTN;
 // BOOTSERVICE - prototype for implementation of a boot service interface
 // RUNTIMESERVICE - prototype for implementation of a runtime service interface
 // RUNTIMEFUNCTION - prototype for implementation of a runtime function that 
is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
+// RUNTIME_CODE - pragma macro for declaring runtime code
 //
 
 #ifdef __amd64__
 #defineEFIAPI  __attribute__((ms_abi))
 #endif
 
-#ifndef EFIAPI  // Forces EFI calling conventions reguardless 
of compiler options 
+#ifndef EFIAPI  // Forces EFI calling conventions reguardless 
of compiler options
 #if _MSC_EXTENSIONS
-#define EFIAPI __cdecl  // Force C calling convention for Microsoft C 
compiler 
+#define EFIAPI __cdecl  // Force C calling convention for Microsoft C 
compiler
 #else
-#define EFIAPI  // Substitute expresion to 

svn commit: r292613 - in head: include lib/libc/stdlib lib/libc/tests/stdlib

2015-12-22 Thread Ed Schouten
Author: ed
Date: Tue Dec 22 18:12:11 2015
New Revision: 292613
URL: https://svnweb.freebsd.org/changeset/base/292613

Log:
  Let tsearch()/tdelete() use an AVL tree.
  
  The existing implementations of POSIX tsearch() and tdelete() don't
  attempt to perform any balancing at all. Testing reveals that inserting
  100k nodes into a tree sequentially takes approximately one minute on my
  system.
  
  Though most other BSDs also don't use any balanced tree internally, C
  libraries like glibc and musl do provide better implementations. glibc
  uses a red-black tree and musl uses an AVL tree.
  
  Red-black trees have the advantage over AVL trees that they only require
  O(1) rotations after insertion and deletion, but have the disadvantage
  that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n).
  My take is that it's better to focus on having a lower maximum depth,
  for the reason that in the case of tsearch() the invocation of the
  comparator likely dominates the running time.
  
  This change replaces the tsearch() and tdelete() functions by versions
  that create an AVL tree. Compared to musl's implementation, this version
  is different in two different ways:
  
  - We don't keep track of heights; just balances. This is sufficient.
This has the advantage that it reduces the number of nodes that are
being accessed. Storing heights requires us to also access all of the
siblings along the path.
  
  - Don't use any recursion at all. We know that the tree cannot 2^64
elements in size, so the height of the tree can never be larger than
96. Use a 128-bit bitmask to keep track of the path that is computed.
This allows us to iterate over the same path twice, meaning we can
apply rotations from top to bottom.
  
  Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion
  seems to be twice as fast as glibc, whereas deletion has about the same
  performance. Unlike glibc, it uses a fixed amount of memory.
  
  I also experimented with both recursive and iterative bottom-up
  implementations of the same algorithm. This iterative top-down version
  performs similar to the recursive bottom-up version in terms of speed
  and code size.
  
  For some reason, the iterative bottom-up algorithm was actually 30%
  faster for deletion, but has a quadratic memory complexity to keep track
  of all the parent pointers.
  
  Reviewed by:  jilles
  Obtained from:https://github.com/NuxiNL/cloudlibc
  Differential Revision:https://reviews.freebsd.org/D4412

Added:
  head/lib/libc/stdlib/tsearch_path.h   (contents, props changed)
  head/lib/libc/tests/stdlib/tsearch_test.c   (contents, props changed)
Modified:
  head/include/search.h
  head/lib/libc/stdlib/tdelete.c
  head/lib/libc/stdlib/tsearch.3
  head/lib/libc/stdlib/tsearch.c
  head/lib/libc/tests/stdlib/Makefile

Modified: head/include/search.h
==
--- head/include/search.h   Tue Dec 22 17:46:14 2015(r292612)
+++ head/include/search.h   Tue Dec 22 18:12:11 2015(r292613)
@@ -35,8 +35,9 @@ typedef   enum {
 
 #ifdef _SEARCH_PRIVATE
 typedefstruct node {
-   char *key;
+   void *key;
struct node  *llink, *rlink;
+   signed char   balance;
 } node_t;
 
 struct que_elem {

Modified: head/lib/libc/stdlib/tdelete.c
==
--- head/lib/libc/stdlib/tdelete.c  Tue Dec 22 17:46:14 2015
(r292612)
+++ head/lib/libc/stdlib/tdelete.c  Tue Dec 22 18:12:11 2015
(r292613)
@@ -1,72 +1,213 @@
-/* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $*/
-
-/*
- * Tree search generalized from Knuth (6.2.2) Algorithm T just like
- * the AT man page says.
- *
- * The node_t structure is for internal use only, lint doesn't grok it.
+/*-
+ * Copyright (c) 2015 Nuxi, https://nuxi.nl/
  *
- * Written by reading the System V Interface Definition, not the code.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
  *
- * Totally public domain.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 

svn commit: r292641 - head/sys/kern

2015-12-22 Thread Garrett Cooper
Author: ngie
Date: Wed Dec 23 03:34:43 2015
New Revision: 292641
URL: https://svnweb.freebsd.org/changeset/base/292641

Log:
  Fix r292640
  
  vim overzealously removed some trailing `+' and I didn't check the
  diff
  
  MFC after: 1 week
  X-MFC with: r292640
  Pointyhat to: ngie
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/link_elf.c

Modified: head/sys/kern/link_elf.c
==
--- head/sys/kern/link_elf.cWed Dec 23 03:29:37 2015(r292640)
+++ head/sys/kern/link_elf.cWed Dec 23 03:34:43 2015(r292641)
@@ -438,7 +438,7 @@ link_elf_init(void* arg)
ctors_sizep = (Elf_Size *)preload_search_info(modptr,
MODINFO_METADATA | MODINFOMD_CTORS_SIZE);
if (ctors_addrp != NULL && ctors_sizep != NULL) {
-   linker_kernel_file->ctors_addr = ef->address
+   linker_kernel_file->ctors_addr = ef->address +
*ctors_addrp;
linker_kernel_file->ctors_size = *ctors_sizep;
}
@@ -979,7 +979,7 @@ link_elf_load_file(linker_class_t cls, c
 #ifdef GPROF
/* Update profiling information with the new text segment. */
mtx_lock();
-   kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr
+   kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr +
segs[0]->p_memsz));
mtx_unlock();
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended

2015-12-22 Thread Craig Rodrigues
On Mon, Dec 21, 2015 at 12:58 AM, Garrett Cooper  wrote:

> Author: ngie
> Date: Mon Dec 21 08:58:14 2015
> New Revision: 292533
> URL: https://svnweb.freebsd.org/changeset/base/292533
>
> Log:
>   Skip the testcases if mac_bsdextended(4) isn't detected on the
>   system
>
>   MFC after: 2 weeks
>   Sponsored by: EMC / Isilon Storage Division
>
> Modified:
>   head/tools/regression/mac/mac_bsdextended/test_matches.sh
>
>
One of these tests seems to be failing:

https://jenkins.freebsd.org/job/FreeBSD_HEAD_Build_and_Test/60/testReport/junit/sys.mac.bsdextended/ugidfw_test/main/

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


svn commit: r292645 - head/tools/tools/nanobsd/embedded

2015-12-22 Thread Warner Losh
Author: imp
Date: Wed Dec 23 06:49:28 2015
New Revision: 292645
URL: https://svnweb.freebsd.org/changeset/base/292645

Log:
  Touch /firstboot in the WORLDDIR.

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonWed Dec 23 06:49:18 2015
(r292644)
+++ head/tools/tools/nanobsd/embedded/commonWed Dec 23 06:49:28 2015
(r292645)
@@ -508,6 +508,8 @@ product_custom ( ) (
echo "growfs_type=nanobsd-pingpong" >> $rc
echo "ntpdate_enable=YES" >> $rc
echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> 
$rc
+   # Make sure that firstboot scripts run so growfs works.
+   touch ${NANO_WORLDDIR}/firstboot
 )
 late_customize_cmd product_custom
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292644 - head/tools/tools/nanobsd/embedded

2015-12-22 Thread Warner Losh
Author: imp
Date: Wed Dec 23 06:49:18 2015
New Revision: 292644
URL: https://svnweb.freebsd.org/changeset/base/292644

Log:
  Copy all the dtb files that we build as part of the kernel build from
  boot/dtb to the fat partition. They seem to be needed.
  Create an empty uEnv.txt file

Modified:
  head/tools/tools/nanobsd/embedded/common

Modified: head/tools/tools/nanobsd/embedded/common
==
--- head/tools/tools/nanobsd/embedded/commonWed Dec 23 04:36:15 2015
(r292643)
+++ head/tools/tools/nanobsd/embedded/commonWed Dec 23 06:49:18 2015
(r292644)
@@ -456,18 +456,26 @@ customize_cmd cust_comconsole
 
 dos_boot_part ( ) (
local d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
+   local f=${NANO_FAT_DIR}
 
# For now, just copy all the files. However, for iMX6 and Allwinner,
# we'll need to put a special boot block at a fixed location
# on the disk as well.
-   rm -rf ${NANO_FAT_DIR}
-   mkdir ${NANO_FAT_DIR}
-   cp ${d}/* ${NANO_FAT_DIR}
+   rm -rf $f
+   mkdir $f
+   chdir $f
+   cp ${d}/* .
 
# Also copy ubldr. u-boot will load it and it will load the kernel
# from the ufs partition
-   cp ${NANO_WORLDDIR}/boot/ubldr ${NANO_FAT_DIR}
-   cp ${NANO_WORLDDIR}/boot/ubldr.bin ${NANO_FAT_DIR}
+   cp ${NANO_WORLDDIR}/boot/ubldr .
+   cp ${NANO_WORLDDIR}/boot/ubldr.bin .
+
+   # We have to touch the saveenv file
+   touch uEnv.txt
+
+   # Now we need to copy over dtb files from the build.
+   cp ${NANO_WORLDDIR}/boot/dtb/*.dtb .
 )
 
 if [ -n "$NANO_BOOT_PKG" ]; then
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292640 - head/sys/kern

2015-12-22 Thread Garrett Cooper
Author: ngie
Date: Wed Dec 23 03:29:37 2015
New Revision: 292640
URL: https://svnweb.freebsd.org/changeset/base/292640

Log:
  Clean up trailing whitespace; no functional change
  
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/link_elf.c

Modified: head/sys/kern/link_elf.c
==
--- head/sys/kern/link_elf.cWed Dec 23 03:19:12 2015(r292639)
+++ head/sys/kern/link_elf.cWed Dec 23 03:29:37 2015(r292640)
@@ -438,7 +438,7 @@ link_elf_init(void* arg)
ctors_sizep = (Elf_Size *)preload_search_info(modptr,
MODINFO_METADATA | MODINFOMD_CTORS_SIZE);
if (ctors_addrp != NULL && ctors_sizep != NULL) {
-   linker_kernel_file->ctors_addr = ef->address +
+   linker_kernel_file->ctors_addr = ef->address
*ctors_addrp;
linker_kernel_file->ctors_size = *ctors_sizep;
}
@@ -605,7 +605,7 @@ parse_dynamic(elf_file_t ef)
 
 static int
 parse_dpcpu(elf_file_t ef)
-{ 
+{
int count;
int error;
 
@@ -636,7 +636,7 @@ parse_dpcpu(elf_file_t ef)
 #ifdef VIMAGE
 static int
 parse_vnet(elf_file_t ef)
-{ 
+{
int count;
int error;
 
@@ -916,7 +916,7 @@ link_elf_load_file(linker_class_t cls, c
 */
base_offset = trunc_page(segs[0]->p_offset);
base_vaddr = trunc_page(segs[0]->p_vaddr);
-   base_vlimit = round_page(segs[nsegs - 1]->p_vaddr + 
+   base_vlimit = round_page(segs[nsegs - 1]->p_vaddr +
segs[nsegs - 1]->p_memsz);
mapsize = base_vlimit - base_vaddr;
 
@@ -979,7 +979,7 @@ link_elf_load_file(linker_class_t cls, c
 #ifdef GPROF
/* Update profiling information with the new text segment. */
mtx_lock();
-   kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr +
+   kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr
segs[0]->p_memsz));
mtx_unlock();
 #endif
@@ -1481,7 +1481,7 @@ link_elf_each_function_name(linker_file_
elf_file_t ef = (elf_file_t)file;
const Elf_Sym *symp;
int i, error;
-   
+
/* Exhaustive search */
for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) {
if (symp->st_value != 0 &&
@@ -1652,7 +1652,7 @@ link_elf_symtab_get(linker_file_t lf, co
 
return (ef->ddbsymcnt);
 }
-
+
 static long
 link_elf_strtab_get(linker_file_t lf, caddr_t *strtab)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292593 - head/sys/fs/cuse

2015-12-22 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Dec 22 09:41:33 2015
New Revision: 292593
URL: https://svnweb.freebsd.org/changeset/base/292593

Log:
  Make CUSE usable with platforms where the size of "unsigned long" is
  different from the size of a pointer.

Modified:
  head/sys/fs/cuse/cuse.c
  head/sys/fs/cuse/cuse_ioctl.h

Modified: head/sys/fs/cuse/cuse.c
==
--- head/sys/fs/cuse/cuse.c Tue Dec 22 09:26:24 2015(r292592)
+++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:41:33 2015(r292593)
@@ -1137,7 +1137,7 @@ cuse_server_ioctl(struct cdev *dev, unsi
if (pccmd != NULL) {
pcc = pccmd->client;
for (n = 0; n != CUSE_CMD_MAX; n++) {
-   pcc->cmds[n].sub.per_file_handle = *(unsigned 
long *)data;
+   pcc->cmds[n].sub.per_file_handle = *(uintptr_t 
*)data;
}
} else {
error = ENXIO;

Modified: head/sys/fs/cuse/cuse_ioctl.h
==
--- head/sys/fs/cuse/cuse_ioctl.h   Tue Dec 22 09:26:24 2015
(r292592)
+++ head/sys/fs/cuse/cuse_ioctl.h   Tue Dec 22 09:41:33 2015
(r292593)
@@ -53,7 +53,7 @@ struct cuse_alloc_info {
 struct cuse_command {
struct cuse_dev *dev;
unsigned long fflags;
-   unsigned long per_file_handle;
+   uintptr_t per_file_handle;
unsigned long data_pointer;
unsigned long argument;
unsigned long command;  /* see CUSE_CMD_XXX */
@@ -76,7 +76,7 @@ struct cuse_create_dev {
 #defineCUSE_IOCTL_GET_SIG  _IOR('C', 4, int)
 #defineCUSE_IOCTL_ALLOC_MEMORY _IOW('C', 5, struct 
cuse_alloc_info)
 #defineCUSE_IOCTL_FREE_MEMORY  _IOW('C', 6, struct 
cuse_alloc_info)
-#defineCUSE_IOCTL_SET_PFH  _IOW('C', 7, unsigned long)
+#defineCUSE_IOCTL_SET_PFH  _IOW('C', 7, uintptr_t)
 #defineCUSE_IOCTL_CREATE_DEV   _IOW('C', 8, struct 
cuse_create_dev)
 #defineCUSE_IOCTL_DESTROY_DEV  _IOW('C', 9, struct cuse_dev *)
 #defineCUSE_IOCTL_ALLOC_UNIT   _IOR('C',10, int)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292588 - in stable/10: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/...

2015-12-22 Thread Xin LI
/stream_decoder.c
  stable/10/contrib/xz/src/liblzma/common/stream_decoder.h
  stable/10/contrib/xz/src/liblzma/common/stream_encoder.c
  stable/10/contrib/xz/src/liblzma/delta/delta_common.c
  stable/10/contrib/xz/src/liblzma/delta/delta_decoder.c
  stable/10/contrib/xz/src/liblzma/delta/delta_decoder.h
  stable/10/contrib/xz/src/liblzma/delta/delta_encoder.c
  stable/10/contrib/xz/src/liblzma/delta/delta_encoder.h
  stable/10/contrib/xz/src/liblzma/delta/delta_private.h
  stable/10/contrib/xz/src/liblzma/lz/lz_decoder.c
  stable/10/contrib/xz/src/liblzma/lz/lz_decoder.h
  stable/10/contrib/xz/src/liblzma/lz/lz_encoder.c
  stable/10/contrib/xz/src/liblzma/lz/lz_encoder.h
  stable/10/contrib/xz/src/liblzma/lz/lz_encoder_mf.c
  stable/10/contrib/xz/src/liblzma/lzma/fastpos.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma2_decoder.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma2_decoder.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma2_encoder.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma2_encoder.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma_common.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma_decoder.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma_decoder.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.h
  stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
  stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h
  stable/10/contrib/xz/src/liblzma/rangecoder/range_decoder.h
  stable/10/contrib/xz/src/liblzma/simple/arm.c
  stable/10/contrib/xz/src/liblzma/simple/armthumb.c
  stable/10/contrib/xz/src/liblzma/simple/ia64.c
  stable/10/contrib/xz/src/liblzma/simple/powerpc.c
  stable/10/contrib/xz/src/liblzma/simple/simple_coder.c
  stable/10/contrib/xz/src/liblzma/simple/simple_coder.h
  stable/10/contrib/xz/src/liblzma/simple/simple_decoder.c
  stable/10/contrib/xz/src/liblzma/simple/simple_decoder.h
  stable/10/contrib/xz/src/liblzma/simple/simple_private.h
  stable/10/contrib/xz/src/liblzma/simple/sparc.c
  stable/10/contrib/xz/src/liblzma/simple/x86.c
  stable/10/contrib/xz/src/xz/args.c
  stable/10/contrib/xz/src/xz/args.h
  stable/10/contrib/xz/src/xz/coder.c
  stable/10/contrib/xz/src/xz/coder.h
  stable/10/contrib/xz/src/xz/file_io.c
  stable/10/contrib/xz/src/xz/file_io.h
  stable/10/contrib/xz/src/xz/hardware.c
  stable/10/contrib/xz/src/xz/hardware.h
  stable/10/contrib/xz/src/xz/list.c
  stable/10/contrib/xz/src/xz/main.c
  stable/10/contrib/xz/src/xz/message.c
  stable/10/contrib/xz/src/xz/options.c
  stable/10/contrib/xz/src/xz/private.h
  stable/10/contrib/xz/src/xz/signals.c
  stable/10/contrib/xz/src/xz/suffix.c
  stable/10/contrib/xz/src/xz/xz.1
  stable/10/lib/Makefile
  stable/10/lib/libarchive/Makefile
  stable/10/lib/liblzma/Makefile
  stable/10/lib/liblzma/Symbol.map
  stable/10/lib/liblzma/Versions.def
  stable/10/lib/liblzma/config.h
  stable/10/rescue/rescue/Makefile
  stable/10/usr.bin/cpio/Makefile
  stable/10/usr.bin/grep/Makefile
  stable/10/usr.bin/gzip/Makefile
  stable/10/usr.bin/lzmainfo/Makefile
  stable/10/usr.bin/mkulzma/Makefile
  stable/10/usr.bin/tar/Makefile
  stable/10/usr.bin/xz/Makefile
  stable/10/usr.bin/xzdec/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/Makefile.inc1
==
--- stable/10/Makefile.inc1 Tue Dec 22 07:59:41 2015(r292587)
+++ stable/10/Makefile.inc1 Tue Dec 22 08:03:23 2015(r292588)
@@ -1697,6 +1697,8 @@ _lib_libradius=   lib/libradius
 _ofed_lib= contrib/ofed/usr.lib/
 .endif
 
+lib/liblzma__L: lib/libthr__L
+
 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} 
usr.bin/lex/lib ${_ofed_lib}
 .for _DIR in ${LOCAL_LIB_DIRS}
 .if exists(${.CURDIR}/${_DIR}/Makefile)

Modified: stable/10/ObsoleteFiles.inc
==
--- stable/10/ObsoleteFiles.inc Tue Dec 22 07:59:41 2015(r292587)
+++ stable/10/ObsoleteFiles.inc Tue Dec 22 08:03:23 2015(r292588)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20151222: liblzma header
+OLD_FILES+=usr/include/lzma/lzma.h
 # 20151115: added missing _test suffix on multiple tests in lib/libc
 OLD_FILES+=usr/tests/lib/libc/c063/faccessat
 OLD_FILES+=usr/tests/lib/libc/c063/fchmodat

Modified: stable/10/contrib/xz/ChangeLog
==
--- stable/10/contrib/xz/ChangeLog  Tue Dec 22 07:59:41 2015
(r292587)
+++ stable/10/contrib/xz/ChangeLog  Tue Dec 22 08:03:23 2015
(r292588)
@@ -1,66 +1,1463 @@
-commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af
+commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a
 Author: Lasse Collin <lasse.col...@tukaani.org>
-Date:   2014-09-20 20:44:32 +0300
+Date:   2015-09-29 13:59:35 +0300
 
-Bump version and soname for

svn commit: r292594 - in head: lib/libcuse sys/fs/cuse

2015-12-22 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Dec 22 09:55:44 2015
New Revision: 292594
URL: https://svnweb.freebsd.org/changeset/base/292594

Log:
  Make CUSE usable with platforms where the size of "unsigned long" is
  different from the size of a pointer.

Modified:
  head/lib/libcuse/cuse_lib.c
  head/sys/fs/cuse/cuse.c
  head/sys/fs/cuse/cuse_ioctl.h

Modified: head/lib/libcuse/cuse_lib.c
==
--- head/lib/libcuse/cuse_lib.c Tue Dec 22 09:41:33 2015(r292593)
+++ head/lib/libcuse/cuse_lib.c Tue Dec 22 09:55:44 2015(r292594)
@@ -711,8 +711,8 @@ cuse_copy_out(const void *src, void *use
if (pe->is_local) {
memcpy(user_dst, src, len);
} else {
-   info.local_ptr = (unsigned long)src;
-   info.peer_ptr = (unsigned long)user_dst;
+   info.local_ptr = (uintptr_t)src;
+   info.peer_ptr = (uintptr_t)user_dst;
info.length = len;
 
error = ioctl(f_cuse, CUSE_IOCTL_WRITE_DATA, );
@@ -744,8 +744,8 @@ cuse_copy_in(const void *user_src, void 
if (pe->is_local) {
memcpy(dst, user_src, len);
} else {
-   info.local_ptr = (unsigned long)dst;
-   info.peer_ptr = (unsigned long)user_src;
+   info.local_ptr = (uintptr_t)dst;
+   info.peer_ptr = (uintptr_t)user_src;
info.length = len;
 
error = ioctl(f_cuse, CUSE_IOCTL_READ_DATA, );

Modified: head/sys/fs/cuse/cuse.c
==
--- head/sys/fs/cuse/cuse.c Tue Dec 22 09:41:33 2015(r292593)
+++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:55:44 2015(r292594)
@@ -511,7 +511,7 @@ cuse_client_is_closing(struct cuse_clien
 
 static void
 cuse_client_send_command_locked(struct cuse_client_command *pccmd,
-unsigned long data_ptr, unsigned long arg, int fflags, int ioflag)
+uintptr_t data_ptr, unsigned long arg, int fflags, int ioflag)
 {
unsigned long cuse_fflags = 0;
struct cuse_server *pcs;
@@ -1547,7 +1547,7 @@ cuse_client_read(struct cdev *dev, struc
 
cuse_lock();
cuse_client_send_command_locked(pccmd,
-   (unsigned long)uio->uio_iov->iov_base,
+   (uintptr_t)uio->uio_iov->iov_base,
(unsigned long)(unsigned int)len, pcc->fflags, ioflag);
 
error = cuse_client_receive_command_locked(pccmd, 0, 0);
@@ -1607,7 +1607,7 @@ cuse_client_write(struct cdev *dev, stru
 
cuse_lock();
cuse_client_send_command_locked(pccmd,
-   (unsigned long)uio->uio_iov->iov_base,
+   (uintptr_t)uio->uio_iov->iov_base,
(unsigned long)(unsigned int)len, pcc->fflags, ioflag);
 
error = cuse_client_receive_command_locked(pccmd, 0, 0);

Modified: head/sys/fs/cuse/cuse_ioctl.h
==
--- head/sys/fs/cuse/cuse_ioctl.h   Tue Dec 22 09:41:33 2015
(r292593)
+++ head/sys/fs/cuse/cuse_ioctl.h   Tue Dec 22 09:55:44 2015
(r292594)
@@ -40,8 +40,8 @@
 struct cuse_dev;
 
 struct cuse_data_chunk {
-   unsigned long local_ptr;
-   unsigned long peer_ptr;
+   uintptr_t local_ptr;
+   uintptr_t peer_ptr;
unsigned long length;
 };
 
@@ -54,7 +54,7 @@ struct cuse_command {
struct cuse_dev *dev;
unsigned long fflags;
uintptr_t per_file_handle;
-   unsigned long data_pointer;
+   uintptr_t data_pointer;
unsigned long argument;
unsigned long command;  /* see CUSE_CMD_XXX */
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292589 - stable/10/sys/sys

2015-12-22 Thread Xin LI
Author: delphij
Date: Tue Dec 22 08:08:41 2015
New Revision: 292589
URL: https://svnweb.freebsd.org/changeset/base/292589

Log:
  Bump __FreeBSD_version after xz 5.2.2 merge (multithread support).

Modified:
  stable/10/sys/sys/param.h

Modified: stable/10/sys/sys/param.h
==
--- stable/10/sys/sys/param.h   Tue Dec 22 08:03:23 2015(r292588)
+++ stable/10/sys/sys/param.h   Tue Dec 22 08:08:41 2015(r292589)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1002503  /* Master, propagated to newvers */
+#define __FreeBSD_version 1002504  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292590 - stable/10/sys/cam/ctl

2015-12-22 Thread Alexander Motin
Author: mav
Date: Tue Dec 22 09:02:51 2015
New Revision: 292590
URL: https://svnweb.freebsd.org/changeset/base/292590

Log:
  MFC r292290: Set DS flag, required for LPB log page by spec.

Modified:
  stable/10/sys/cam/ctl/ctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl.c
==
--- stable/10/sys/cam/ctl/ctl.c Tue Dec 22 08:08:41 2015(r292589)
+++ stable/10/sys/cam/ctl/ctl.c Tue Dec 22 09:02:51 2015(r292590)
@@ -6870,6 +6870,8 @@ ctl_log_sense(struct ctl_scsiio *ctsio)
 
header = (struct scsi_log_header *)ctsio->kern_data_ptr;
header->page = page_index->page_code;
+   if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING)
+   header->page |= SL_DS;
if (page_index->subpage) {
header->page |= SL_SPF;
header->subpage = page_index->subpage;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292591 - in head/sys: arm/at91 arm/cavium/cns11xx arm/conf arm/lpc arm/mv/discovery arm/mv/orion arm/xscale/ixp425 conf

2015-12-22 Thread Andrew Turner
Author: andrew
Date: Tue Dec 22 09:08:21 2015
New Revision: 292591
URL: https://svnweb.freebsd.org/changeset/base/292591

Log:
  Remove the arm KERNPHYSADDR option as it is no longer used. The make
  option is still in existance as it is used to build the trampoline code.

Modified:
  head/sys/arm/at91/std.bwct
  head/sys/arm/at91/std.eb9200
  head/sys/arm/at91/std.ethernut5
  head/sys/arm/at91/std.hl200
  head/sys/arm/at91/std.hl201
  head/sys/arm/at91/std.kb920x
  head/sys/arm/at91/std.qila9g20
  head/sys/arm/at91/std.sam9260ek
  head/sys/arm/at91/std.sam9g20ek
  head/sys/arm/at91/std.sam9x25ek
  head/sys/arm/at91/std.sn9g45
  head/sys/arm/at91/std.tsc4370
  head/sys/arm/cavium/cns11xx/std.econa
  head/sys/arm/conf/ATMEL
  head/sys/arm/conf/CNS11XXNAS
  head/sys/arm/conf/CRB
  head/sys/arm/conf/GUMSTIX
  head/sys/arm/conf/NOTES
  head/sys/arm/conf/NSLU
  head/sys/arm/lpc/std.lpc
  head/sys/arm/mv/discovery/std.db78xxx
  head/sys/arm/mv/orion/std.db88f5xxx
  head/sys/arm/mv/orion/std.ts7800
  head/sys/arm/xscale/ixp425/std.avila
  head/sys/conf/options.arm

Modified: head/sys/arm/at91/std.bwct
==
--- head/sys/arm/at91/std.bwct  Tue Dec 22 09:02:51 2015(r292590)
+++ head/sys/arm/at91/std.bwct  Tue Dec 22 09:08:21 2015(r292591)
@@ -2,7 +2,6 @@
 include "../at91/std.at91"
 
 makeoptionsKERNPHYSADDR=0x2000
-optionsKERNPHYSADDR=0x2000 
 makeoptionsKERNVIRTADDR=0xc000
 optionsKERNVIRTADDR=0xc000
 

Modified: head/sys/arm/at91/std.eb9200
==
--- head/sys/arm/at91/std.eb9200Tue Dec 22 09:02:51 2015
(r292590)
+++ head/sys/arm/at91/std.eb9200Tue Dec 22 09:08:21 2015
(r292591)
@@ -2,7 +2,6 @@
 include "../at91/std.at91"
 
 makeoptionsKERNPHYSADDR=0x2000
-optionsKERNPHYSADDR=0x2000 
 makeoptionsKERNVIRTADDR=0xc000
 optionsKERNVIRTADDR=0xc000
 

Modified: head/sys/arm/at91/std.ethernut5
==
--- head/sys/arm/at91/std.ethernut5 Tue Dec 22 09:02:51 2015
(r292590)
+++ head/sys/arm/at91/std.ethernut5 Tue Dec 22 09:08:21 2015
(r292591)
@@ -3,7 +3,6 @@ include "../at91/std.at91sam9"
 
 makeoptionsKERNPHYSADDR=0x2000
 makeoptionsKERNVIRTADDR=0xc000
-optionsKERNPHYSADDR=0x2000
 optionsKERNVIRTADDR=0xc000
 
 device at91_board_ethernut5

Modified: head/sys/arm/at91/std.hl200
==
--- head/sys/arm/at91/std.hl200 Tue Dec 22 09:02:51 2015(r292590)
+++ head/sys/arm/at91/std.hl200 Tue Dec 22 09:08:21 2015(r292591)
@@ -2,7 +2,6 @@
 include "../at91/std.at91"
 
 makeoptionsKERNPHYSADDR=0x2010
-optionsKERNPHYSADDR=0x2010 
 makeoptionsKERNVIRTADDR=0xc010
 optionsKERNVIRTADDR=0xc010
 

Modified: head/sys/arm/at91/std.hl201
==
--- head/sys/arm/at91/std.hl201 Tue Dec 22 09:02:51 2015(r292590)
+++ head/sys/arm/at91/std.hl201 Tue Dec 22 09:08:21 2015(r292591)
@@ -3,7 +3,6 @@ include "../at91/std.at91sam9"
 
 makeoptionsKERNPHYSADDR=0x2000
 makeoptionsKERNVIRTADDR=0xc000
-optionsKERNPHYSADDR=0x2000 
 optionsKERNVIRTADDR=0xc000
 
 device at91_board_hl201

Modified: head/sys/arm/at91/std.kb920x
==
--- head/sys/arm/at91/std.kb920xTue Dec 22 09:02:51 2015
(r292590)
+++ head/sys/arm/at91/std.kb920xTue Dec 22 09:08:21 2015
(r292591)
@@ -2,7 +2,6 @@
 include "../at91/std.at91"
 
 makeoptionsKERNPHYSADDR=0x2000
-optionsKERNPHYSADDR=0x2000 
 makeoptionsKERNVIRTADDR=0xc000
 optionsKERNVIRTADDR=0xc000
 

Modified: head/sys/arm/at91/std.qila9g20
==
--- head/sys/arm/at91/std.qila9g20  Tue Dec 22 09:02:51 2015
(r292590)
+++ head/sys/arm/at91/std.qila9g20  Tue Dec 22 09:08:21 2015
(r292591)
@@ -3,7 +3,6 @@ include "../at91/std.at91sam9"
 
 makeoptionsKERNPHYSADDR=0x2000
 makeoptionsKERNVIRTADDR=0xc000
-optionsKERNPHYSADDR=0x2000 
 optionsKERNVIRTADDR=0xc000
 
 device at91_board_qila9g20

Modified: head/sys/arm/at91/std.sam9260ek
==
--- head/sys/arm/at91/std.sam9260ek Tue Dec 22 09:02:51 2015
(r292590)
+++ head/sys/arm/at91/std.sam9260ek Tue Dec 22 09:08:21 2015
(r292591)
@@ -3,7 +3,6 @@ 

svn commit: r292592 - head/sys/fs/cuse

2015-12-22 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Dec 22 09:26:24 2015
New Revision: 292592
URL: https://svnweb.freebsd.org/changeset/base/292592

Log:
  Guard against the same process being both CUSE server and client at
  the same time. This can easily lead to a deadlock when destroying the
  character devices nodes.

Modified:
  head/sys/fs/cuse/cuse.c

Modified: head/sys/fs/cuse/cuse.c
==
--- head/sys/fs/cuse/cuse.c Tue Dec 22 09:08:21 2015(r292591)
+++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:26:24 2015(r292592)
@@ -108,6 +108,7 @@ struct cuse_server {
TAILQ_HEAD(, cuse_client) hcli;
struct cv cv;
struct selinfo selinfo;
+   pid_t   pid;
int is_closing;
int refs;
 };
@@ -691,6 +692,10 @@ cuse_server_open(struct cdev *dev, int f
free(pcs, M_CUSE);
return (ENOMEM);
}
+
+   /* store current process ID */
+   pcs->pid = curproc->p_pid;
+
TAILQ_INIT(>head);
TAILQ_INIT(>hdev);
TAILQ_INIT(>hcli);
@@ -1357,9 +1362,15 @@ cuse_client_open(struct cdev *dev, int f
if (pcsd != NULL) {
pcs = pcsd->server;
pcd = pcsd->user_dev;
+   /*
+* Check that the refcount didn't wrap and that the
+* same process is not both client and server. This
+* can easily lead to deadlocks when destroying the
+* CUSE character device nodes:
+*/
pcs->refs++;
-   if (pcs->refs < 0) {
-   /* overflow */
+   if (pcs->refs < 0 || pcs->pid == curproc->p_pid) {
+   /* overflow or wrong PID */
pcs->refs--;
pcsd = NULL;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292595 - head/lib/libc/net

2015-12-22 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Dec 22 12:01:06 2015
New Revision: 292595
URL: https://svnweb.freebsd.org/changeset/base/292595

Log:
  We don't need to use a temporary buffer, here.
  
  MFC after:1 week

Modified:
  head/lib/libc/net/map_v4v6.c

Modified: head/lib/libc/net/map_v4v6.c
==
--- head/lib/libc/net/map_v4v6.cTue Dec 22 09:55:44 2015
(r292594)
+++ head/lib/libc/net/map_v4v6.cTue Dec 22 12:01:06 2015
(r292595)
@@ -78,15 +78,11 @@ typedef union {
 void
 _map_v4v6_address(const char *src, char *dst)
 {
-   char tmp[NS_INADDRSZ];
-
-   /* Stash a temporary copy so our caller can update in place. */
-   memcpy(tmp, src, NS_INADDRSZ);
+   /* Our caller may update in place. */
+   memmove([12], src, NS_INADDRSZ);
/* Mark this ipv6 addr as a mapped ipv4. */
-   memset([0], 0, 10);
memset([10], 0xff, 2);
-   /* Retrieve the saved copy and we're done. */
-   memcpy([12], tmp, NS_INADDRSZ);
+   memset([0], 0, 10);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292597 - stable/10/sys/dev/isp

2015-12-22 Thread Alexander Motin
Author: mav
Date: Tue Dec 22 12:54:13 2015
New Revision: 292597
URL: https://svnweb.freebsd.org/changeset/base/292597

Log:
  MFC r291868: Rework WWNs generation to make cards without NVRAM more useful.

Modified:
  stable/10/sys/dev/isp/isp_freebsd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/isp/isp_freebsd.c
==
--- stable/10/sys/dev/isp/isp_freebsd.c Tue Dec 22 12:53:01 2015
(r292596)
+++ stable/10/sys/dev/isp/isp_freebsd.c Tue Dec 22 12:54:13 2015
(r292597)
@@ -4550,91 +4550,52 @@ isp_uninit(ispsoftc_t *isp)
ISP_DISABLE_INTS(isp);
 }
 
-/*
- * When we want to get the 'default' WWNs (when lacking NVRAM), we pick them
- * up from our platform default (defww{p|n}n) and morph them based upon
- * channel.
- * 
- * When we want to get the 'active' WWNs, we get NVRAM WWNs and then morph them
- * based upon channel.
- */
-
 uint64_t
 isp_default_wwn(ispsoftc_t * isp, int chan, int isactive, int iswwnn)
 {
uint64_t seed;
struct isp_fc *fc = ISP_FC_PC(isp, chan);
 
-   /*
-* If we're asking for a active WWN, the default overrides get
-* returned, otherwise the NVRAM value is picked.
-* 
-* If we're asking for a default WWN, we just pick the default override.
-*/
+   /* First try to use explicitly configured WWNs. */
+   seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
+   if (seed)
+   return (seed);
+
+   /* Otherwise try to use WWNs from NVRAM. */
if (isactive) {
-   seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
-   if (seed) {
-   return (seed);
-   }
-   seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram : 
FCPARAM(isp, chan)->isp_wwpn_nvram;
-   if (seed) {
+   seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram :
+   FCPARAM(isp, chan)->isp_wwpn_nvram;
+   if (seed)
return (seed);
-   }
-   return (0x40007F09ull);
}
 
-   seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
-
-   /*
-* For channel zero just return what we have. For either ACTIVE or
-* DEFAULT cases, we depend on default override of NVRAM values for
-* channel zero.
-*/
-   if (chan == 0) {
-   return (seed);
+   /* If still no WWNs, try to steal them from the first channel. */
+   if (chan > 0) {
+   seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn :
+   ISP_FC_PC(isp, 0)->def_wwpn;
+   if (seed == 0) {
+   seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram :
+   FCPARAM(isp, 0)->isp_wwpn_nvram;
+   }
}
 
-   /*
-* For other channels, we are doing one of three things:
-* 
-* 1. If what we have now is non-zero, return it. Otherwise we morph
-* values from channel 0. 2. If we're here for a WWPN we synthesize
-* it if Channel 0's wwpn has a type 2 NAA. 3. If we're here for a
-* WWNN we synthesize it if Channel 0's wwnn has a type 2 NAA.
-*/
-
-   if (seed) {
-   return (seed);
+   /* If still nothing -- improvise. */
+   if (seed == 0) {
+   seed = 0x40007F00ull + device_get_unit(isp->isp_dev);
+   if (!iswwnn)
+   seed ^= 0x0100ULL;
}
-   seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 
0)->def_wwpn;
-   if (seed == 0)
-   seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : FCPARAM(isp, 
0)->isp_wwpn_nvram;
 
-   if (((seed >> 60) & 0xf) == 2) {
+   /* For additional channels we have to improvise even more. */
+   if (!iswwnn && chan > 0) {
/*
-* The type 2 NAA fields for QLogic cards appear be laid out
-* thusly:
-* 
-* bits 63..60 NAA == 2 bits 59..57 unused/zero bit 56
-* port (1) or node (0) WWN distinguishor bit 48
-* physical port on dual-port chips (23XX/24XX)
-* 
-* This is somewhat nutty, particularly since bit 48 is
-* irrelevant as they assign separate serial numbers to
-* different physical ports anyway.
-* 
 * We'll stick our channel number plus one first into bits
 * 57..59 and thence into bits 52..55 which allows for 8 bits
-* of channel which is comfortably more than our maximum
-* (126) now.
+* of channel which is enough for our maximum of 255 channels.
 */
-   seed &= ~0x0FF0ULL;
-   if (iswwnn == 0) {
-   seed |= ((uint64_t) (chan + 1) 

svn commit: r292598 - in stable/10: share/man/man4 sys/dev/isp

2015-12-22 Thread Alexander Motin
Author: mav
Date: Tue Dec 22 13:19:29 2015
New Revision: 292598
URL: https://svnweb.freebsd.org/changeset/base/292598

Log:
  MFC r291654, r291727, r291821, r291872, r292034, r292041, r292249, r292042:
  Add initial support for 16Gbps FC QLogic chips.

Modified:
  stable/10/share/man/man4/isp.4
  stable/10/sys/dev/isp/isp.c
  stable/10/sys/dev/isp/isp_freebsd.h
  stable/10/sys/dev/isp/isp_pci.c
  stable/10/sys/dev/isp/isp_sbus.c
  stable/10/sys/dev/isp/ispmbox.h
  stable/10/sys/dev/isp/ispvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/isp.4
==
--- stable/10/share/man/man4/isp.4  Tue Dec 22 12:54:13 2015
(r292597)
+++ stable/10/share/man/man4/isp.4  Tue Dec 22 13:19:29 2015
(r292598)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 22, 2015
+.Dd December 9, 2015
 .Dt ISP 4
 .Os
 .Sh NAME
@@ -107,10 +107,12 @@ Optical 2Gb Fibre Channel PCIe cards.
 Dell branded version of the QLogic 2312.
 .It Qlogic 2422
 Optical 4Gb Fibre Channel PCI cards.
-.It Qlogic 2432
+.It Qlogic 246x (aka 2432)
 Optical 4Gb Fibre Channel PCIe cards.
-.It Qlogic 2532
+.It Qlogic 256x (aka 2532)
 Optical 8Gb Fibre Channel PCIe cards.
+.It Qlogic 267x/836x (aka 2031/8031)
+Optical 16Gb FC/FCoE PCIe cards.
 .El
 .Sh CONFIGURATION OPTIONS
 Target mode support for Fibre Channel adapters may be enabled with the
@@ -127,12 +129,6 @@ They are:
 .It Va hint.isp.0.fwload_disable
 A hint value to disable loading of firmware
 .Xr ispfw 4 .
-.It Va hint.isp.0.prefer_memmap
-A hint value to use PCI memory space instead of I/O space
-access for.
-.It Va hint.isp.0.prefer_iomap
-A hint value to use PCI I/O space instead of Memory space
-access for.
 .It Va hint.isp.0.ignore_nvram
 A hint value to ignore board NVRAM settings for.
 Otherwise use NVRAM settings.

Modified: stable/10/sys/dev/isp/isp.c
==
--- stable/10/sys/dev/isp/isp.c Tue Dec 22 12:54:13 2015(r292597)
+++ stable/10/sys/dev/isp/isp.c Tue Dec 22 13:19:29 2015(r292598)
@@ -277,6 +277,9 @@ isp_reset(ispsoftc_t *isp, int do_load_d
case ISP_HA_FC_2500:
btype = "2532";
break;
+   case ISP_HA_FC_2600:
+   btype = "2031";
+   break;
default:
break;
}
@@ -655,8 +658,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d
ISP_WRITE(isp, isp->isp_respinrp, 0);
ISP_WRITE(isp, isp->isp_respoutrp, 0);
if (IS_24XX(isp)) {
-   ISP_WRITE(isp, BIU2400_PRI_REQINP, 0);
-   ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0);
+   if (!IS_26XX(isp)) {
+   ISP_WRITE(isp, BIU2400_PRI_REQINP, 0);
+   ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0);
+   }
ISP_WRITE(isp, BIU2400_ATIO_RSPINP, 0);
ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0);
}
@@ -761,6 +766,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d
code_org = ISP_CODE_ORG;
}
 
+   isp->isp_loaded_fw = 0;
if (dodnld && IS_24XX(isp)) {
const uint32_t *ptr = isp->isp_mdvec->dv_ispfw;
int wordload;
@@ -956,8 +962,17 @@ isp_reset(ispsoftc_t *isp, int do_load_d
ISP_RESET0(isp);
return;
}
+   } else if (IS_26XX(isp)) {
+   MBSINIT(, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 500);
+   mbs.ibitm = 0x01;
+   mbs.obitm = 0x07;
+   isp_mboxcmd(isp, );
+   if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
+   isp_prt(isp, ISP_LOGERR, "Flash F/W load failed");
+   ISP_RESET0(isp);
+   return;
+   }
} else {
-   isp->isp_loaded_fw = 0;
isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download");
}
 
@@ -966,7 +981,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d
 */
if (isp->isp_loaded_fw) {
MBSINIT(, MBOX_VERIFY_CHECKSUM, MBLOGNONE, 0);
-   mbs.param[0] = MBOX_VERIFY_CHECKSUM;
if (IS_24XX(isp)) {
mbs.param[1] = code_org >> 16;
mbs.param[2] = code_org;
@@ -998,9 +1012,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d
} else {
mbs.param[3] = 1;
}
-   if (IS_25XX(isp)) {
-   mbs.ibits |= 0x10;
-   }
} else if (IS_2322(isp)) {
mbs.param[1] = code_org;
if (isp->isp_loaded_fw) {
@@ -1861,16 +1872,16 @@ isp_fibre_init(ispsoftc_t *isp)
icbp->icb_idelaytimer = 10;
}
  

svn commit: r292596 - stable/10/sys/dev/isp

2015-12-22 Thread Alexander Motin
Author: mav
Date: Tue Dec 22 12:53:01 2015
New Revision: 292596
URL: https://svnweb.freebsd.org/changeset/base/292596

Log:
  MFC r291730: Update isp_put_icb_2400() for new structure fields.

Modified:
  stable/10/sys/dev/isp/isp_library.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/isp/isp_library.c
==
--- stable/10/sys/dev/isp/isp_library.c Tue Dec 22 12:01:06 2015
(r292595)
+++ stable/10/sys/dev/isp/isp_library.c Tue Dec 22 12:53:01 2015
(r292596)
@@ -1402,7 +1402,9 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_ic
for (i = 0; i < 4; i++) {
ISP_IOXPUT_16(isp, src->icb_priaddr[i], >icb_priaddr[i]);
}
-   for (i = 0; i < 4; i++) {
+   ISP_IOXPUT_16(isp, src->icb_msixresp, >icb_msixresp);
+   ISP_IOXPUT_16(isp, src->icb_msixatio, >icb_msixatio);
+   for (i = 0; i < 2; i++) {
ISP_IOXPUT_16(isp, src->icb_reserved1[i], 
>icb_reserved1[i]);
}
ISP_IOXPUT_16(isp, src->icb_atio_in, >icb_atio_in);
@@ -1415,9 +1417,14 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_ic
ISP_IOXPUT_32(isp, src->icb_fwoptions1, >icb_fwoptions1);
ISP_IOXPUT_32(isp, src->icb_fwoptions2, >icb_fwoptions2);
ISP_IOXPUT_32(isp, src->icb_fwoptions3, >icb_fwoptions3);
-   for (i = 0; i < 12; i++) {
+   ISP_IOXPUT_16(isp, src->icb_qos, >icb_qos);
+   for (i = 0; i < 3; i++)
ISP_IOXPUT_16(isp, src->icb_reserved2[i], 
>icb_reserved2[i]);
-   }
+   for (i = 0; i < 3; i++)
+   ISP_IOXPUT_16(isp, src->icb_enodemac[i], >icb_enodemac[i]);
+   ISP_IOXPUT_16(isp, src->icb_disctime, >icb_disctime);
+   for (i = 0; i < 4; i++)
+   ISP_IOXPUT_16(isp, src->icb_reserved3[i], 
>icb_reserved3[i]);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292609 - in head/sys/mips: include mips

2015-12-22 Thread Adrian Chadd
Author: adrian
Date: Tue Dec 22 15:59:41 2015
New Revision: 292609
URL: https://svnweb.freebsd.org/changeset/base/292609

Log:
  [mips] Add TLB pagemask probing code, and print out the allowable page sizes.
  
  This is from Stacey's work on larger kernel stack sizes for MIPS.  Thanks!
  
  Submitted by: sson

Modified:
  head/sys/mips/include/cpuinfo.h
  head/sys/mips/include/pte.h
  head/sys/mips/mips/cpu.c

Modified: head/sys/mips/include/cpuinfo.h
==
--- head/sys/mips/include/cpuinfo.h Tue Dec 22 15:42:53 2015
(r292608)
+++ head/sys/mips/include/cpuinfo.h Tue Dec 22 15:59:41 2015
(r292609)
@@ -54,6 +54,7 @@ struct mips_cpuinfo {
u_int8_tcpu_rev;
u_int8_tcpu_impl;
u_int8_ttlb_type;
+   u_int32_t   tlb_pgmask;
u_int16_t   tlb_nentries;
u_int8_ticache_virtual;
boolean_t   cache_coherent_dma;

Modified: head/sys/mips/include/pte.h
==
--- head/sys/mips/include/pte.h Tue Dec 22 15:42:53 2015(r292608)
+++ head/sys/mips/include/pte.h Tue Dec 22 15:59:41 2015(r292609)
@@ -188,4 +188,17 @@ typedefpt_entry_t *pd_entry_t;
 #endif
 
 #endif /* LOCORE */
+
+/* PageMask Register (CP0 Register 5, Select 0) Values */
+#defineMIPS3_PGMASK_MASKX  0x1800
+#defineMIPS3_PGMASK_4K 0x
+#defineMIPS3_PGMASK_16K0x6000
+#defineMIPS3_PGMASK_64K0x0001e000
+#defineMIPS3_PGMASK_256K   0x0007e000
+#defineMIPS3_PGMASK_1M 0x001fe000
+#defineMIPS3_PGMASK_4M 0x007fe000
+#defineMIPS3_PGMASK_16M0x01ffe000
+#defineMIPS3_PGMASK_64M0x07ffe000
+#defineMIPS3_PGMASK_256M   0x1fffe000
+
 #endif /* !_MACHINE_PTE_H_ */

Modified: head/sys/mips/mips/cpu.c
==
--- head/sys/mips/mips/cpu.cTue Dec 22 15:42:53 2015(r292608)
+++ head/sys/mips/mips/cpu.cTue Dec 22 15:59:41 2015(r292609)
@@ -190,6 +190,14 @@ mips_get_identity(struct mips_cpuinfo *c
cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize 
* cpuinfo->l1.dc_nsets * cpuinfo->l1.dc_nways;
 
+   /*
+* Probe PageMask register to see what sizes of pages are supported
+* by writing all one's and then reading it back.
+*/
+   mips_wr_pagemask(~0);
+   cpuinfo->tlb_pgmask = mips_rd_pagemask();
+   mips_wr_pagemask(MIPS3_PGMASK_4K);
+
 #ifndef CPU_CNMIPS
/* L2 cache */
if (!(cfg1 & MIPS_CONFIG_CM)) {
@@ -289,8 +297,31 @@ cpu_identify(void)
} else if (cpuinfo.tlb_type == MIPS_MMU_FIXED) {
printf("Fixed mapping");
}
-   printf(", %d entries\n", cpuinfo.tlb_nentries);
+   printf(", %d entries ", cpuinfo.tlb_nentries);
+   }
+
+   if (cpuinfo.tlb_pgmask) {
+   printf("(");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_MASKX)
+   printf("1K ");
+   printf("4K ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_16K)
+   printf("16K ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_64K)
+   printf("64K ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_256K)
+   printf("256K ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_1M)
+   printf("1M ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_16M)
+   printf("16M ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_64M)
+   printf("64M ");
+   if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_256M)
+   printf("256M ");
+   printf("pg sizes)");
}
+   printf("\n");
 
printf("  L1 i-cache: ");
if (cpuinfo.l1.ic_linesize == 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2015-12-22 Thread Alexander Motin
Author: mav
Date: Tue Dec 22 17:01:30 2015
New Revision: 292610
URL: https://svnweb.freebsd.org/changeset/base/292610

Log:
  Fix speed setting by NVRAM for 24xx and above chips.

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

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Dec 22 15:59:41 2015(r292609)
+++ head/sys/dev/isp/isp.c  Tue Dec 22 17:01:30 2015(r292610)
@@ -2142,19 +2142,41 @@ isp_fibre_init_2400(ispsoftc_t *isp)
if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) {
icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24;
}
-   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_AUTO;
if (isp->isp_confopts & ISP_CFG_1GB) {
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_1GB;
} else if (isp->isp_confopts & ISP_CFG_2GB) {
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_2GB;
} else if (isp->isp_confopts & ISP_CFG_4GB) {
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_4GB;
} else if (isp->isp_confopts & ISP_CFG_8GB) {
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_8GB;
} else if (isp->isp_confopts & ISP_CFG_16GB) {
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_16GB;
} else {
-   icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO;
+   switch (icbp->icb_fwoptions3 & ICB2400_OPT3_RATE_MASK) {
+   case ICB2400_OPT3_RATE_4GB:
+   case ICB2400_OPT3_RATE_8GB:
+   case ICB2400_OPT3_RATE_16GB:
+   case ICB2400_OPT3_RATE_AUTO:
+   break;
+   case ICB2400_OPT3_RATE_2GB:
+   if (isp->isp_type <= ISP_HA_FC_2500)
+   break;
+   /*FALLTHROUGH*/
+   case ICB2400_OPT3_RATE_1GB:
+   if (isp->isp_type <= ISP_HA_FC_2400)
+   break;
+   /*FALLTHROUGH*/
+   default:
+   icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK;
+   icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO;
+   break;
+   }
}
icbp->icb_logintime = ICB_LOGIN_TOV;
 
@@ -7632,6 +7654,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c
fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX;
}
fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS;
+   fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO;
} else {
fcp->isp_fwoptions |= ICBOPT_FAIRNESS;
fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE;
@@ -7644,6 +7667,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c
 * extended options from NVRAM
 */
fcp->isp_fwoptions &= ~ICBOPT_EXTENDED;
+   fcp->isp_zfwoptions |= ICBZOPT_RATE_AUTO;
}
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292599 - head/sys/netinet

2015-12-22 Thread Jonathan T. Looney
Author: jtl
Date: Tue Dec 22 13:41:50 2015
New Revision: 292599
URL: https://svnweb.freebsd.org/changeset/base/292599

Log:
  Fix a panic when launching VNETs after the commit of r292309.
  
  Differential Revision:https://reviews.freebsd.org/D4645
  Reviewed by:  rrs
  Reported by:  kp
  Tested by:kp
  Sponsored by: Juniper Networks

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Tue Dec 22 13:19:29 2015(r292598)
+++ head/sys/netinet/tcp_subr.c Tue Dec 22 13:41:50 2015(r292599)
@@ -593,10 +593,6 @@ tcp_init(void)
if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT,
_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 
0)
printf("%s: WARNING: unable to register helper hook\n", 
__func__);
-   /* Setup the tcp function block list */
-   TAILQ_INIT(_functions);
-   rw_init_flags(_function_lock, "tcp_func_lock" , 0);
-   register_tcp_functions(_def_funcblk, M_WAITOK);
hashsize = TCBHASHSIZE;
TUNABLE_INT_FETCH(tcbhash_tuneable, );
if (hashsize == 0) {
@@ -675,6 +671,10 @@ tcp_init(void)
tcp_rexmit_slop = TCPTV_CPU_VAR;
tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
tcp_tcbhashsize = hashsize;
+   /* Setup the tcp function block list */
+   TAILQ_INIT(_functions);
+   rw_init_flags(_function_lock, "tcp_func_lock" , 0);
+   register_tcp_functions(_def_funcblk, M_WAITOK);
 
if (tcp_soreceive_stream) {
 #ifdef INET
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r292599 - head/sys/netinet

2015-12-22 Thread Kristof Provost
Thanks!

Kristof

> On 22 Dec 2015, at 14:41, Jonathan T. Looney  wrote:
> 
> Author: jtl
> Date: Tue Dec 22 13:41:50 2015
> New Revision: 292599
> URL: https://svnweb.freebsd.org/changeset/base/292599
> 
> Log:
>  Fix a panic when launching VNETs after the commit of r292309.
> 
>  Differential Revision:   https://reviews.freebsd.org/D4645
>  Reviewed by: rrs
>  Reported by: kp
>  Tested by:   kp
>  Sponsored by:Juniper Networks
> 
> Modified:
>  head/sys/netinet/tcp_subr.c
> 
> Modified: head/sys/netinet/tcp_subr.c
> ==
> --- head/sys/netinet/tcp_subr.c   Tue Dec 22 13:19:29 2015
> (r292598)
> +++ head/sys/netinet/tcp_subr.c   Tue Dec 22 13:41:50 2015
> (r292599)
> @@ -593,10 +593,6 @@ tcp_init(void)
>   if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT,
>   _tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 
> 0)
>   printf("%s: WARNING: unable to register helper hook\n", 
> __func__);
> - /* Setup the tcp function block list */
> - TAILQ_INIT(_functions);
> - rw_init_flags(_function_lock, "tcp_func_lock" , 0);
> - register_tcp_functions(_def_funcblk, M_WAITOK);
>   hashsize = TCBHASHSIZE;
>   TUNABLE_INT_FETCH(tcbhash_tuneable, );
>   if (hashsize == 0) {
> @@ -675,6 +671,10 @@ tcp_init(void)
>   tcp_rexmit_slop = TCPTV_CPU_VAR;
>   tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
>   tcp_tcbhashsize = hashsize;
> + /* Setup the tcp function block list */
> + TAILQ_INIT(_functions);
> + rw_init_flags(_function_lock, "tcp_func_lock" , 0);
> + register_tcp_functions(_def_funcblk, M_WAITOK);
> 
>   if (tcp_soreceive_stream) {
> #ifdef INET
> 

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


svn commit: r292601 - in head/sys: netinet netinet6

2015-12-22 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Dec 22 14:53:19 2015
New Revision: 292601
URL: https://svnweb.freebsd.org/changeset/base/292601

Log:
  Since r256624 we've been leaking routing table allocations
  on vnet enabled jail shutdown. Call the provided cleanup
  routines for IP versions 4 and 6 to plug these leaks.
  
  Sponsored by: The FreeBSD Foundation
  MFC atfer:2 weeks
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D4530

Modified:
  head/sys/netinet/in_rmx.c
  head/sys/netinet6/in6_rmx.c

Modified: head/sys/netinet/in_rmx.c
==
--- head/sys/netinet/in_rmx.c   Tue Dec 22 13:58:11 2015(r292600)
+++ head/sys/netinet/in_rmx.c   Tue Dec 22 14:53:19 2015(r292601)
@@ -133,7 +133,7 @@ int
 in_detachhead(void **head, int off)
 {
 
-   return (1);
+   return (rn_detachhead(head));
 }
 #endif
 

Modified: head/sys/netinet6/in6_rmx.c
==
--- head/sys/netinet6/in6_rmx.c Tue Dec 22 13:58:11 2015(r292600)
+++ head/sys/netinet6/in6_rmx.c Tue Dec 22 14:53:19 2015(r292601)
@@ -266,6 +266,7 @@ in6_detachhead(void **head, int off)
 {
 
callout_drain(_rtq_mtutimer);
+   return (rn_detachhead(head));
return (1);
 }
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292602 - head/sys/net

2015-12-22 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Dec 22 14:57:04 2015
New Revision: 292602
URL: https://svnweb.freebsd.org/changeset/base/292602

Log:
  Simplify bringup order by removing a SYSINIT making it a static list
  initialization.
  
  Mfp4 @180384,180385:
  
There is no need for a dedicated SYSINIT here.  The
list can be initialized statically.
  
Sponsored by:   CK Software GmbH
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D4528

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==
--- head/sys/net/if_llatbl.cTue Dec 22 14:53:19 2015(r292601)
+++ head/sys/net/if_llatbl.cTue Dec 22 14:57:04 2015(r292602)
@@ -62,11 +62,10 @@ __FBSDID("$FreeBSD$");
 
 MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables");
 
-static VNET_DEFINE(SLIST_HEAD(, lltable), lltables);
+static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) =
+SLIST_HEAD_INITIALIZER(lltables);
 #defineV_lltables  VNET(lltables)
 
-static void vnet_lltable_init(void);
-
 struct rwlock lltable_rwlock;
 RW_SYSINIT(lltable_rwlock, _rwlock, "lltable_rwlock");
 
@@ -740,15 +739,6 @@ lla_rt_output(struct rt_msghdr *rtm, str
return (error);
 }
 
-static void
-vnet_lltable_init()
-{
-
-   SLIST_INIT(_lltables);
-}
-VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST,
-vnet_lltable_init, NULL);
-
 #ifdef DDB
 struct llentry_sa {
struct llentry  base;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292611 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD

2015-12-22 Thread Andrew Turner
Author: andrew
Date: Tue Dec 22 17:18:40 2015
New Revision: 292611
URL: https://svnweb.freebsd.org/changeset/base/292611

Log:
  Don't adjust the program counter to an invalid address after reaching a
  breakpoint. The value doesn't need to be adjusted as it is already
  correctly returned from the kernel.
  
  This allows lldb to set breakpoints, and stop on them, however more work
  is needed, for example single stepping fails to stop.
  
  Discussed with:   emaste

Modified:
  
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
==
--- 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
Tue Dec 22 17:01:30 2015(r292610)
+++ 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
Tue Dec 22 17:18:40 2015(r292611)
@@ -260,13 +260,9 @@ RegisterContextPOSIXProcessMonitor_arm64
 bool
 RegisterContextPOSIXProcessMonitor_arm64::UpdateAfterBreakpoint()
 {
-// PC points one byte past the int3 responsible for the breakpoint.
-lldb::addr_t pc;
-
-if ((pc = GetPC()) == LLDB_INVALID_ADDRESS)
+if (GetPC() == LLDB_INVALID_ADDRESS)
 return false;
 
-SetPC(pc - 1);
 return true;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292612 - head

2015-12-22 Thread Craig Rodrigues
Author: rodrigc
Date: Tue Dec 22 17:46:14 2015
New Revision: 292612
URL: https://svnweb.freebsd.org/changeset/base/292612

Log:
  Refer to creating Phabricator Herald notifications
  
  This will allow maintainers to be notified of
  any reviews or commits affecting parts of the
  tree which they maintain.
  
  Reviewed by:   jhb, emaste, allanjude
  Differential Revision: https://reviews.freebsd.org/D4623

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Dec 22 17:18:40 2015(r292611)
+++ head/MAINTAINERSTue Dec 22 17:46:14 2015(r292612)
@@ -24,6 +24,15 @@ maintainer of a sub-system is to check r
 sub-system.
 ***
 
+***
+Maintainers are encouraged to visit:
+  https://reviews.freebsd.org/herald
+
+and configure notifications for parts of the tree which they maintain.
+Notifications can automatically be sent when someone proposes a revision or
+makes a commit to the specified subtree.
+***
+
 subsystem  login   notes
 -
 atffreebsd-testing,jmmv,ngie   Pre-commit review 
requested.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292615 - stable/10/sys/dev/qlxgbe

2015-12-22 Thread David C Somayajulu
Author: davidcs
Date: Tue Dec 22 19:34:21 2015
New Revision: 292615
URL: https://svnweb.freebsd.org/changeset/base/292615

Log:
  MFC r289635
  
  ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
  ql_os.c: removed unnecessary debug printf
  ql_ver.h: updated version number

Modified:
  stable/10/sys/dev/qlxgbe/ql_hw.c
  stable/10/sys/dev/qlxgbe/ql_os.c
  stable/10/sys/dev/qlxgbe/ql_ver.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/qlxgbe/ql_hw.c
==
--- stable/10/sys/dev/qlxgbe/ql_hw.cTue Dec 22 18:39:07 2015
(r292614)
+++ stable/10/sys/dev/qlxgbe/ql_hw.cTue Dec 22 19:34:21 2015
(r292615)
@@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha)
"Minidump Utility can start minidump process");
 #ifdef QL_DBG
 
+   ha->err_inject = 0;
 SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
 OID_AUTO, "err_inject",
@@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha)
val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT);
 
if ((val != ha->hw.hbeat_value) &&
-   (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE {
+   (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE {
ha->hw.hbeat_value = val;
return 0;
}

Modified: stable/10/sys/dev/qlxgbe/ql_os.c
==
--- stable/10/sys/dev/qlxgbe/ql_os.cTue Dec 22 18:39:07 2015
(r292614)
+++ stable/10/sys/dev/qlxgbe/ql_os.cTue Dec 22 19:34:21 2015
(r292615)
@@ -289,8 +289,6 @@ qla_pci_attach(device_t dev)
int i;
uint32_t num_rcvq = 0;
 
-   QL_DPRINT2(ha, (dev, "%s: enter\n", __func__));
-
 if ((ha = device_get_softc(dev)) == NULL) {
 device_printf(dev, "cannot get softc\n");
 return (ENOMEM);

Modified: stable/10/sys/dev/qlxgbe/ql_ver.h
==
--- stable/10/sys/dev/qlxgbe/ql_ver.h   Tue Dec 22 18:39:07 2015
(r292614)
+++ stable/10/sys/dev/qlxgbe/ql_ver.h   Tue Dec 22 19:34:21 2015
(r292615)
@@ -36,6 +36,6 @@
 
 #define QLA_VERSION_MAJOR  3
 #define QLA_VERSION_MINOR  10
-#define QLA_VERSION_BUILD   24
+#define QLA_VERSION_BUILD   25
 
 #endif /* #ifndef _QL_VER_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292620 - head/sys/kern

2015-12-22 Thread Konstantin Belousov
Author: kib
Date: Tue Dec 22 20:12:52 2015
New Revision: 292620
URL: https://svnweb.freebsd.org/changeset/base/292620

Log:
  If we annoy user with the terminal output due to failed load of
  interpreter, also show the actual error code instead of some
  interpretation.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Tue Dec 22 20:08:32 2015(r292619)
+++ head/sys/kern/imgact_elf.c  Tue Dec 22 20:12:52 2015(r292620)
@@ -1009,7 +1009,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
}
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
if (error != 0) {
-   uprintf("ELF interpreter %s not found\n", interp);
+   uprintf("ELF interpreter %s not found, error %d\n",
+   interp, error);
goto ret;
}
} else
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292626 - head/sys/kern

2015-12-22 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 22 21:07:33 2015
New Revision: 292626
URL: https://svnweb.freebsd.org/changeset/base/292626

Log:
  Fold lim_shared into lim_copy to mute a -Wunused compiler warning from
  clang when the kernel is compiled without INVARIANTS
  
  Differential Revision: https://reviews.freebsd.org/D4683
  Reviewed by: kib, jhb
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/kern/kern_resource.c

Modified: head/sys/kern/kern_resource.c
==
--- head/sys/kern/kern_resource.c   Tue Dec 22 20:40:34 2015
(r292625)
+++ head/sys/kern/kern_resource.c   Tue Dec 22 21:07:33 2015
(r292626)
@@ -80,8 +80,6 @@ static intdonice(struct thread *td, str
 static struct uidinfo *uilookup(uid_t uid);
 static voidruxagg_locked(struct rusage_ext *rux, struct thread *td);
 
-static __inline intlim_shared(struct plimit *limp);
-
 /*
  * Resource controls and accounting.
  */
@@ -1109,13 +1107,6 @@ lim_hold(struct plimit *limp)
return (limp);
 }
 
-static __inline int
-lim_shared(struct plimit *limp)
-{
-
-   return (limp->pl_refcnt > 1);
-}
-
 void
 lim_fork(struct proc *p1, struct proc *p2)
 {
@@ -1146,7 +1137,7 @@ void
 lim_copy(struct plimit *dst, struct plimit *src)
 {
 
-   KASSERT(!lim_shared(dst), ("lim_copy to shared limit"));
+   KASSERT(dst->pl_refcnt <= 1, ("lim_copy to shared limit"));
bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit));
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended

2015-12-22 Thread Garrett Cooper

> On Dec 22, 2015, at 22:42, Craig Rodrigues  wrote:
> 
>> On Mon, Dec 21, 2015 at 12:58 AM, Garrett Cooper  wrote:
>> Author: ngie
>> Date: Mon Dec 21 08:58:14 2015
>> New Revision: 292533
>> URL: https://svnweb.freebsd.org/changeset/base/292533
>> 
>> Log:
>>   Skip the testcases if mac_bsdextended(4) isn't detected on the
>>   system
>> 
>>   MFC after: 2 weeks
>>   Sponsored by: EMC / Isilon Storage Division
>> 
>> Modified:
>>   head/tools/regression/mac/mac_bsdextended/test_matches.sh
> 
> One of these tests seems to be failing:
> 
> https://jenkins.freebsd.org/job/FreeBSD_HEAD_Build_and_Test/60/testReport/junit/sys.mac.bsdextended/ugidfw_test/main/

Thanks for the heads up. I'll look into this soon!
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292646 - head/usr.bin/vmstat

2015-12-22 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Dec 23 07:28:48 2015
New Revision: 292646
URL: https://svnweb.freebsd.org/changeset/base/292646

Log:
  Remove extraneous characters
  
  Noticed by: markj
  Reviewed by:allanjude

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

Modified: head/usr.bin/vmstat/vmstat.c
==
--- head/usr.bin/vmstat/vmstat.cWed Dec 23 06:49:28 2015
(r292645)
+++ head/usr.bin/vmstat/vmstat.cWed Dec 23 07:28:48 2015
(r292646)
@@ -886,9 +886,9 @@ printhdr(int maxid, u_long cpumask)
 
num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs;
if (hflag) {
-   xo_emit("{T:procs}  {T:memory}   ${T:/page%*s}", 19, "");
+   xo_emit("{T:procs}  {T:memory}   {T:/page%*s}", 19, "");
} else {
-   xo_emit("{T:procs} {T:memory}${T:/page%*s}", 19, 
"");
+   xo_emit("{T:procs} {T:memory}{T:/page%*s}", 19, "");
}
if (num_shown > 1)
xo_emit(" {T:/disks %*s}", num_shown * 4 - 7, ""); 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"