svn commit: r279103 - head

2015-02-21 Thread Gavin Atkinson
Author: gavin
Date: Sat Feb 21 13:00:52 2015
New Revision: 279103
URL: https://svnweb.freebsd.org/changeset/base/279103

Log:
  Typo: effect -> affect.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sat Feb 21 10:10:26 2015(r279102)
+++ head/UPDATING   Sat Feb 21 13:00:52 2015(r279103)
@@ -36,7 +36,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
but before r278950, the RNG was not seeded properly.  Immediately
upgrade the kernel to r278950 or later and regenerate any keys (e.g.
ssh keys or openssl keys) that were generated w/ a kernel from that
-   range.  This does not effect programs that directly used /dev/random
+   range.  This does not affect programs that directly used /dev/random
or /dev/urandom.  All userland uses of arc4random(3) are affected.
 
 20150210:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279104 - head/lib/libc/regex

2015-02-21 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Feb 21 15:02:27 2015
New Revision: 279104
URL: https://svnweb.freebsd.org/changeset/base/279104

Log:
  Prevent NULL pointer de-reference.
  
  As a follow up to r279090, if dp hasn't been defined, we
  shouldn't attempt to do an optimization here.

Modified:
  head/lib/libc/regex/engine.c

Modified: head/lib/libc/regex/engine.c
==
--- head/lib/libc/regex/engine.cSat Feb 21 13:00:52 2015
(r279103)
+++ head/lib/libc/regex/engine.cSat Feb 21 15:02:27 2015
(r279104)
@@ -244,7 +244,7 @@ matcher(struct re_guts *g,
ZAPSTATE(&m->mbs);
 
/* Adjust start according to moffset, to speed things up */
-   if (g->moffset > -1)
+   if (dp != NULL && g->moffset > -1)
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
 
SP("mloop", m->st, *start);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-02-21 Thread Ian Lepore
Author: ian
Date: Sat Feb 21 22:19:59 2015
New Revision: 279114
URL: https://svnweb.freebsd.org/changeset/base/279114

Log:
  Correct a comment which was exactly backwards from reality.

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

Modified: head/sys/arm/include/atomic.h
==
--- head/sys/arm/include/atomic.h   Sat Feb 21 22:10:14 2015
(r279113)
+++ head/sys/arm/include/atomic.h   Sat Feb 21 22:19:59 2015
(r279114)
@@ -582,8 +582,8 @@ atomic_load_64(volatile uint64_t *p)
 
/*
 * The only way to atomically load 64 bits is with LDREXD which puts the
-* exclusive monitor into the open state, so reset it with CLREX because
-* we don't actually need to store anything.
+* exclusive monitor into the exclusive state, so reset it to open state
+* with CLREX because we don't actually need to store anything.
 */
__asm __volatile(
"1:  \n"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279115 - head/share/man/man9

2015-02-21 Thread John-Mark Gurney
Author: jmg
Date: Sat Feb 21 22:25:24 2015
New Revision: 279115
URL: https://svnweb.freebsd.org/changeset/base/279115

Log:
  back Xref get_cyclecount to have it get more exposure...

Modified:
  head/share/man/man9/microuptime.9

Modified: head/share/man/man9/microuptime.9
==
--- head/share/man/man9/microuptime.9   Sat Feb 21 22:19:59 2015
(r279114)
+++ head/share/man/man9/microuptime.9   Sat Feb 21 22:25:24 2015
(r279115)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2013
+.Dd February 21, 2015
 .Dt MICROUPTIME 9
 .Os
 .Sh NAME
@@ -112,6 +112,7 @@ functions is to enforce the user's prefe
 execution time.
 .Sh SEE ALSO
 .Xr bintime 9 ,
+.Xr get_cyclecount 9 ,
 .Xr getbintime 9 ,
 .Xr getmicrotime 9 ,
 .Xr getnanotime 9 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-02-21 Thread Konstantin Belousov
Author: kib
Date: Sat Feb 21 22:38:32 2015
New Revision: 279117
URL: https://svnweb.freebsd.org/changeset/base/279117

Log:
  Revert r276949 and redo the fix for PCIe/PCI bridges, which do not
  follow specification and do not provide PCIe capability.
  
  Verify if the port above such bridge is downstream PCIe (or root port)
  and treat the bridge as PCIe/PCI then.  This allows to avoid
  maintaining the table of device ids for bridges without capability,
  while still calculate correct request originator for devices behind
  the bridge.
  
  Submitted by: Jason Harmening 
  MFC after:1 week

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

Modified: head/sys/x86/iommu/busdma_dmar.c
==
--- head/sys/x86/iommu/busdma_dmar.cSat Feb 21 22:27:57 2015
(r279116)
+++ head/sys/x86/iommu/busdma_dmar.cSat Feb 21 22:38:32 2015
(r279117)
@@ -98,6 +98,8 @@ dmar_get_requester(device_t dev, uint16_
devclass_t pci_class;
device_t l, pci, pcib, pcip, pcibp, requester;
int cap_offset;
+   uint16_t pcie_flags;
+   bool bridge_is_pcie;
 
pci_class = devclass_find("pci");
l = requester = dev;
@@ -144,13 +146,30 @@ dmar_get_requester(device_t dev, uint16_
} else {
/*
 * Device is not PCIe, it cannot be seen as a
-* requester by DMAR unit.
+* requester by DMAR unit.  Check whether the
+* bridge is PCIe.
 */
-   requester = pcibp;
+   bridge_is_pcie = pci_find_cap(pcib, PCIY_EXPRESS,
+   &cap_offset) == 0;
+   requester = pcib;
 
-   /* Check whether the bus above the bridge is PCIe. */
-   if (pci_find_cap(pcibp, PCIY_EXPRESS,
-   &cap_offset) == 0) {
+   /*
+* Check for a buggy PCIe/PCI bridge that
+* doesn't report the express capability.  If
+* the bridge above it is express but isn't a
+* PCI bridge, then we know pcib is actually a
+* PCIe/PCI bridge.
+*/
+   if (!bridge_is_pcie && pci_find_cap(pcibp,
+   PCIY_EXPRESS, &cap_offset) == 0) {
+   pcie_flags = pci_read_config(pcibp,
+   cap_offset + PCIER_FLAGS, 2);
+   if ((pcie_flags & PCIEM_FLAGS_TYPE) !=
+   PCIEM_TYPE_PCI_BRIDGE)
+   bridge_is_pcie = true;
+   }
+
+   if (bridge_is_pcie) {
/*
 * The current device is not PCIe, but
 * the bridge above it is.  This is a
@@ -168,6 +187,7 @@ dmar_get_requester(device_t dev, uint16_
 * non-taken transactions.
 */
*rid = PCI_RID(pci_get_bus(l), 0, 0);
+   l = pcibp;
} else {
/*
 * Neither the device nor the bridge
@@ -177,8 +197,8 @@ dmar_get_requester(device_t dev, uint16_
 * requester ID.
 */
*rid = pci_get_rid(pcib);
+   l = pcib;
}
-   l = pcibp;
}
}
return (requester);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279119 - head/sys/kern

2015-02-21 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sat Feb 21 23:20:05 2015
New Revision: 279119
URL: https://svnweb.freebsd.org/changeset/base/279119

Log:
  Make kernel ELF image parsing not crash for kernels running at locations
  other than their link address.

Modified:
  head/sys/kern/link_elf.c

Modified: head/sys/kern/link_elf.c
==
--- head/sys/kern/link_elf.cSat Feb 21 23:04:18 2015(r279118)
+++ head/sys/kern/link_elf.cSat Feb 21 23:20:05 2015(r279119)
@@ -381,6 +381,8 @@ link_elf_link_common_finish(linker_file_
return (0);
 }
 
+extern vm_offset_t __startkernel;
+
 static void
 link_elf_init(void* arg)
 {
@@ -409,7 +411,11 @@ link_elf_init(void* arg)
 
ef = (elf_file_t) linker_kernel_file;
ef->preloaded = 1;
+#ifdef __powerpc64__
+   ef->address = (caddr_t) (__startkernel - KERNBASE);
+#else
ef->address = 0;
+#endif
 #ifdef SPARSE_MAPPING
ef->object = 0;
 #endif
@@ -417,7 +423,7 @@ link_elf_init(void* arg)
 
if (dp != NULL)
parse_dynamic(ef);
-   linker_kernel_file->address = (caddr_t) KERNBASE;
+   linker_kernel_file->address += KERNBASE;
linker_kernel_file->size = -(intptr_t)linker_kernel_file->address;
 
if (modptr != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279121 - head/bin/pkill/tests

2015-02-21 Thread Garrett Cooper
Author: ngie
Date: Sat Feb 21 23:39:43 2015
New Revision: 279121
URL: https://svnweb.freebsd.org/changeset/base/279121

Log:
  Disguising stderr from jls generally considered harmful
  
  Undisguising it dumps out the following logspew:
  
  jls: unknown parameter: allow
  
  PR: 191019

Modified:
  head/bin/pkill/tests/pgrep-j_test.sh
  head/bin/pkill/tests/pkill-j_test.sh

Modified: head/bin/pkill/tests/pgrep-j_test.sh
==
--- head/bin/pkill/tests/pgrep-j_test.shSat Feb 21 23:21:40 2015
(r279120)
+++ head/bin/pkill/tests/pgrep-j_test.shSat Feb 21 23:39:43 2015
(r279121)
@@ -4,7 +4,7 @@
 jail_name_to_jid()
 {
local check_name="$1"
-   jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 
's/.*=//g'
+   jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g'
 }
 
 base=pgrep_j_test
@@ -38,6 +38,7 @@ for i in `seq 1 10`; do
esac
sleep 0.1
 done
+sleep 0.5
 
 pid1="$(pgrep -f -x -j "$jid" "$sleep $sleep_amount" | sort)"
 pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \

Modified: head/bin/pkill/tests/pkill-j_test.sh
==
--- head/bin/pkill/tests/pkill-j_test.shSat Feb 21 23:21:40 2015
(r279120)
+++ head/bin/pkill/tests/pkill-j_test.shSat Feb 21 23:39:43 2015
(r279121)
@@ -4,7 +4,7 @@
 jail_name_to_jid()
 {
local check_name="$1"
-   jls -j "$check_name" -s 2>/dev/null | tr ' ' '\n' | grep jid= | sed -e 
's/.*=//g'
+   jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g'
 }
 
 base=pkill_j_test
@@ -40,6 +40,7 @@ for i in `seq 1 10`; do
esac
sleep 0.1
 done
+sleep 0.5
 
 if pkill -f -j "$jid" $sleep && sleep 0.5 &&
 ! -f ${PWD}/${base}_1_1.pid &&
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279122 - head/usr.bin/netstat

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sat Feb 21 23:47:20 2015
New Revision: 279122
URL: https://svnweb.freebsd.org/changeset/base/279122

Log:
  Convert netstat to use libxo.
  
  Obtained from:  Phil Shafer 
  Ported to -current by: alfred@ (mostly), Kim Shrier
  Formatting: marcel@
  Sponsored by:   Juniper Networks, Inc.

Modified:
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/bpf.c
  head/usr.bin/netstat/flowtable.c
  head/usr.bin/netstat/if.c
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/inet6.c
  head/usr.bin/netstat/ipsec.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/mbuf.c
  head/usr.bin/netstat/mroute.c
  head/usr.bin/netstat/mroute6.c
  head/usr.bin/netstat/netgraph.c
  head/usr.bin/netstat/netisr.c
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/pfkey.c
  head/usr.bin/netstat/route.c
  head/usr.bin/netstat/sctp.c
  head/usr.bin/netstat/unix.c

Modified: head/usr.bin/netstat/Makefile
==
--- head/usr.bin/netstat/Makefile   Sat Feb 21 23:39:43 2015
(r279121)
+++ head/usr.bin/netstat/Makefile   Sat Feb 21 23:47:20 2015
(r279122)
@@ -41,4 +41,6 @@ LIBADD+=  netgraph
 CFLAGS+=-DNETGRAPH
 .endif
 
+LIBADD+= xo
+
 .include 

Modified: head/usr.bin/netstat/bpf.c
==
--- head/usr.bin/netstat/bpf.c  Sat Feb 21 23:39:43 2015(r279121)
+++ head/usr.bin/netstat/bpf.c  Sat Feb 21 23:47:20 2015(r279122)
@@ -46,8 +46,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 #include "netstat.h"
 
@@ -67,7 +69,7 @@ bpf_pidname(pid_t pid)
size = sizeof(newkp);
error = sysctl(mib, 4, &newkp, &size, NULL, 0);
if (error < 0) {
-   warn("kern.proc.pid failed");
+   xo_warn("kern.proc.pid failed");
return (strdup("??"));
}
return (strdup(newkp.ki_comm));
@@ -86,6 +88,21 @@ bpf_flags(struct xbpf_d *bd, char *flagb
*flagbuf++ = bd->bd_async ? 'a' : '-';
*flagbuf++ = bd->bd_locked ? 'l' : '-';
*flagbuf++ = '\0';
+
+   if (bd->bd_promisc)
+   xo_emit("{e:promiscuous/}");
+   if (bd->bd_immediate)
+   xo_emit("{e:immediate/}");
+   if (bd->bd_hdrcmplt)
+   xo_emit("{e:header-complete/}");
+   xo_emit("{e:direction}", (bd->bd_direction == BPF_D_IN) ? "input" :
+   (bd->bd_direction == BPF_D_OUT) ? "output" : "bidirectional");
+   if (bd->bd_feedback)
+   xo_emit("{e:feedback/}");
+   if (bd->bd_async)
+   xo_emit("{e:async/}");
+   if (bd->bd_locked)
+   xo_emit("{e:locked/}");
 }
 
 void
@@ -99,44 +116,55 @@ bpf_stats(char *ifname)
bzero(&zerostat, sizeof(zerostat));
if (sysctlbyname("net.bpf.stats", NULL, NULL,
&zerostat, sizeof(zerostat)) < 0)
-   warn("failed to zero bpf counters");
+   xo_warn("failed to zero bpf counters");
return;
}
if (sysctlbyname("net.bpf.stats", NULL, &size,
NULL, 0) < 0) {
-   warn("net.bpf.stats");
+   xo_warn("net.bpf.stats");
return;
}
if (size == 0)
return;
bd = malloc(size);
if (bd == NULL) {
-   warn("malloc failed");
+   xo_warn("malloc failed");
return;
}
if (sysctlbyname("net.bpf.stats", bd, &size,
NULL, 0) < 0) {
-   warn("net.bpf.stats");
+   xo_warn("net.bpf.stats");
free(bd);
return;
}
-   (void) printf("%5s %6s %7s %9s %9s %9s %5s %5s %s\n",
-   "Pid", "Netif", "Flags", "Recv", "Drop", "Match", "Sblen",
-   "Hblen", "Command");
+   xo_emit("{T:/%5s} {T:/%6s} {T:/%7s} {T:/%9s} {T:/%9s} {T:/%9s} "
+   "{T:/%5s} {T:/%5s} {T:/%s}\n",
+   "Pid", "Netif", "Flags", "Recv", "Drop", "Match",
+   "Sblen", "Hblen", "Command");
+   xo_open_container("bpf-statistics");
+   xo_open_list("bpf-entry");
for (d = &bd[0]; d < &bd[size / sizeof(*d)]; d++) {
if (d->bd_structsize != sizeof(*d)) {
-   warnx("bpf_stats_extended: version mismatch");
+   xo_warnx("bpf_stats_extended: version mismatch");
return;
}
if (ifname && strcmp(ifname, d->bd_ifname) != 0)
continue;
-   bpf_flags(d, flagbuf);
+   xo_open_instance("bpf-entry");
pname = bpf_pidname(d->bd_pid);
-   (void) printf("%5d %6s %7s %9ju %9ju %9ju %5d %5d %s\n",
-   d->bd_pid, d->bd_ifname, flagbuf,
-   d->bd_rcount, d->bd_dcount, d->bd_fcount,
- 

svn commit: r279123 - head/usr.sbin/jls

2015-02-21 Thread Jamie Gritton
Author: jamie
Date: Sun Feb 22 00:00:10 2015
New Revision: 279123
URL: https://svnweb.freebsd.org/changeset/base/279123

Log:
  Allow for parameters added with the JP_OPT flag to not exist.
  That's why the flag exists in the first place.
  
  MFC after:1 week

Modified:
  head/usr.sbin/jls/jls.c

Modified: head/usr.sbin/jls/jls.c
==
--- head/usr.sbin/jls/jls.c Sat Feb 21 23:47:20 2015(r279122)
+++ head/usr.sbin/jls/jls.c Sun Feb 22 00:00:10 2015(r279123)
@@ -294,10 +294,8 @@ add_param(const char *name, void *value,
param->jp_flags |= flags;
return param - params;
}
-   if (jailparam_init(param, name) < 0)
-   errx(1, "%s", jail_errmsg);
-   param->jp_flags = flags;
-   if ((value != NULL ? jailparam_import_raw(param, value, valuelen)
+   if (jailparam_init(param, name) < 0 ||
+   (value != NULL ? jailparam_import_raw(param, value, valuelen)
 : jailparam_import(param, value)) < 0) {
if (flags & JP_OPT) {
nparams--;
@@ -305,6 +303,7 @@ add_param(const char *name, void *value,
}
errx(1, "%s", jail_errmsg);
}
+   param->jp_flags = flags;
return param - params;
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279124 - head/usr.bin/netstat

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sun Feb 22 00:01:42 2015
New Revision: 279124
URL: https://svnweb.freebsd.org/changeset/base/279124

Log:
  Document that netstat(1) supports libxo(3).

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

Modified: head/usr.bin/netstat/netstat.1
==
--- head/usr.bin/netstat/netstat.1  Sun Feb 22 00:00:10 2015
(r279123)
+++ head/usr.bin/netstat/netstat.1  Sun Feb 22 00:01:42 2015
(r279124)
@@ -28,7 +28,7 @@
 .\"@(#)netstat.1   8.8 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd June 4, 2014
+.Dd February 21, 2015
 .Dt NETSTAT 1
 .Os
 .Sh NAME
@@ -38,58 +38,70 @@
 .Bk -words
 .Bl -tag -width "netstat"
 .It Nm
+.Op Fl -libxo
 .Op Fl 46AaLnRSTWx
 .Op Fl f Ar protocol_family | Fl p Ar protocol
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl i | I Ar interface
+.Op Fl -libxo
 .Op Fl 46abdhnW
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl w Ar wait
+.Op Fl -libxo
 .Op Fl I Ar interface
 .Op Fl 46d
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl q Ar howmany
 .It Nm Fl s
+.Op Fl -libxo
 .Op Fl 46sz
 .Op Fl f Ar protocol_family | Fl p Ar protocol
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl i | I Ar interface Fl s
+.Op Fl -libxo
 .Op Fl 46s
 .Op Fl f Ar protocol_family | Fl p Ar protocol
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl m
+.Op Fl -libxo
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl B
+.Op Fl -libxo
 .Op Fl z
 .Op Fl I Ar interface
 .It Nm Fl r
+.Op Fl -libxo
 .Op Fl 46AnW
 .Op Fl F Ar fibnum
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl rs
+.Op Fl -libxo
 .Op Fl s
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl g
+.Op Fl -libxo
 .Op Fl 46W
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl gs
+.Op Fl -libxo
 .Op Fl 46s
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .It Nm Fl Q
+.Op Fl -libxo
 .El
 .Ek
 .Sh DESCRIPTION
@@ -784,6 +796,8 @@ and display them symbolically.
 .Xr procstat 1 ,
 .Xr ps 1 ,
 .Xr sockstat 1 ,
+.Xr libxo 3 ,
+.Xr xo_parse_args 3 ,
 .Xr bpf 4 ,
 .Xr inet 4 ,
 .Xr route 4 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r279123 - head/usr.sbin/jls

2015-02-21 Thread Garrett Cooper
On Feb 21, 2015, at 16:00, Jamie Gritton  wrote:

> Author: jamie
> Date: Sun Feb 22 00:00:10 2015
> New Revision: 279123
> URL: https://svnweb.freebsd.org/changeset/base/279123
> 
> Log:
>  Allow for parameters added with the JP_OPT flag to not exist.
>  That's why the flag exists in the first place.
> 
>  MFC after:   1 week

It works ! Thank you :)!!!

$ sudo prove -v pkill-j_test.sh 
pkill-j_test.sh .. 
1..3
ok 1 - pkill -j 
ok 2 - pkill -j any
ok 3 - pkill -j none
ok
All tests successful.
Files=1, Tests=3,  8 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.27 
csys =  0.32 CPU)
Result: PASS


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r279125 - head/usr.bin/mkimg

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sun Feb 22 00:58:10 2015
New Revision: 279125
URL: https://svnweb.freebsd.org/changeset/base/279125

Log:
  Remove extraneous parenthesis in assignment.

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

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Sun Feb 22 00:01:42 2015(r279124)
+++ head/usr.bin/mkimg/mkimg.c  Sun Feb 22 00:58:10 2015(r279125)
@@ -442,7 +442,7 @@ mkimg(void)
errc(EX_IOERR, error, "image sizing");
block = image_get_size();
ncyls = block / (nsecs * nheads);
-   error = (scheme_write(block));
+   error = scheme_write(block);
if (error)
errc(EX_IOERR, error, "writing metadata");
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279126 - head/usr.bin/mkimg

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sun Feb 22 01:01:02 2015
New Revision: 279126
URL: https://svnweb.freebsd.org/changeset/base/279126

Log:
  In scheme_write(), don't overwrite the end parameter with the
  return value of image_get_size(). As it so happens, the only
  caller of scheme_write() passes exactly that.

Modified:
  head/usr.bin/mkimg/scheme.c

Modified: head/usr.bin/mkimg/scheme.c
==
--- head/usr.bin/mkimg/scheme.c Sun Feb 22 00:58:10 2015(r279125)
+++ head/usr.bin/mkimg/scheme.c Sun Feb 22 01:01:02 2015(r279126)
@@ -180,7 +180,6 @@ scheme_write(lba_t end)
 {
int error;
 
-   end = image_get_size();
error = scheme->write(end, bootcode);
return (error);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279127 - head/lib/msun/src

2015-02-21 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Feb 22 01:15:09 2015
New Revision: 279127
URL: https://svnweb.freebsd.org/changeset/base/279127

Log:
  msun: drop unnecessary checks.
  
  Drop an unnecessary check in some calculations. The check
  would have Coverity falsely conclude that variables could
  be left undefined.
  
  Discussed with:   kargl, bde
  Reviewed by:  bde

Modified:
  head/lib/msun/src/e_j0.c
  head/lib/msun/src/e_j0f.c
  head/lib/msun/src/e_j1.c
  head/lib/msun/src/e_j1f.c

Modified: head/lib/msun/src/e_j0.c
==
--- head/lib/msun/src/e_j0.cSun Feb 22 01:01:02 2015(r279126)
+++ head/lib/msun/src/e_j0.cSun Feb 22 01:15:09 2015(r279127)
@@ -278,7 +278,7 @@ static const double pS2[5] = {
if(ix>=0x4020) {p = pR8; q= pS8;}
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
-   else if(ix>=0x4000){p = pR2; q= pS2;}
+   else   {p = pR2; q= pS2;}   /* ix>=0x4000 */
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];

Modified: head/lib/msun/src/e_j0f.c
==
--- head/lib/msun/src/e_j0f.c   Sun Feb 22 01:01:02 2015(r279126)
+++ head/lib/msun/src/e_j0f.c   Sun Feb 22 01:15:09 2015(r279127)
@@ -234,7 +234,7 @@ static const float pS2[5] = {
if(ix>=0x4100) {p = pR8; q= pS8;}
else if(ix>=0x40f71c58){p = pR5; q= pS5;}
else if(ix>=0x4036db68){p = pR3; q= pS3;}
-   else if(ix>=0x4000){p = pR2; q= pS2;}
+   else   {p = pR2; q= pS2;}   /* ix>=0x4000 */
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];

Modified: head/lib/msun/src/e_j1.c
==
--- head/lib/msun/src/e_j1.cSun Feb 22 01:01:02 2015(r279126)
+++ head/lib/msun/src/e_j1.cSun Feb 22 01:15:09 2015(r279127)
@@ -272,7 +272,7 @@ static const double ps2[5] = {
 if(ix>=0x4020) {p = pr8; q= ps8;}
 else if(ix>=0x40122E8B){p = pr5; q= ps5;}
 else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
-else if(ix>=0x4000){p = pr2; q= ps2;}
+   else   {p = pr2; q= ps2;}   /* ix>=0x4000 */
 z = one/(x*x);
 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];

Modified: head/lib/msun/src/e_j1f.c
==
--- head/lib/msun/src/e_j1f.c   Sun Feb 22 01:01:02 2015(r279126)
+++ head/lib/msun/src/e_j1f.c   Sun Feb 22 01:15:09 2015(r279127)
@@ -229,7 +229,7 @@ static const float ps2[5] = {
 if(ix>=0x4100) {p = pr8; q= ps8;}
 else if(ix>=0x40f71c58){p = pr5; q= ps5;}
 else if(ix>=0x4036db68){p = pr3; q= ps3;}
-else if(ix>=0x4000){p = pr2; q= ps2;}
+   else   {p = pr2; q= ps2;}   /* ix>=0x4000 */
 z = one/(x*x);
 r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5];
 s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279128 - head/usr.bin/mkimg

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sun Feb 22 01:20:49 2015
New Revision: 279128
URL: https://svnweb.freebsd.org/changeset/base/279128

Log:
  Don't require a scheme if no partitions are given. Change the code
  to handle that case. Note that we still require partitions, so the
  change is effectively a no-op.

Modified:
  head/usr.bin/mkimg/mkimg.c
  head/usr.bin/mkimg/scheme.c

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Sun Feb 22 01:15:09 2015(r279127)
+++ head/usr.bin/mkimg/mkimg.c  Sun Feb 22 01:20:49 2015(r279128)
@@ -541,7 +541,7 @@ main(int argc, char *argv[])
 
if (argc > optind)
usage("trailing arguments");
-   if (scheme_selected() == NULL)
+   if (scheme_selected() == NULL && nparts > 0)
usage("no scheme");
if (nparts == 0)
usage("no partitions");
@@ -577,8 +577,9 @@ main(int argc, char *argv[])
fprintf(stderr, "Sectors per track:   %u\n", nsecs);
fprintf(stderr, "Number of heads: %u\n", nheads);
fputc('\n', stderr);
-   fprintf(stderr, "Partitioning scheme: %s\n",
-   scheme_selected()->name);
+   if (scheme_selected())
+   fprintf(stderr, "Partitioning scheme: %s\n",
+   scheme_selected()->name);
fprintf(stderr, "Output file format:  %s\n",
format_selected()->name);
fputc('\n', stderr);

Modified: head/usr.bin/mkimg/scheme.c
==
--- head/usr.bin/mkimg/scheme.c Sun Feb 22 01:15:09 2015(r279127)
+++ head/usr.bin/mkimg/scheme.c Sun Feb 22 01:20:49 2015(r279128)
@@ -31,8 +31,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -104,7 +106,7 @@ scheme_bootcode(int fd)
 {
struct stat sb;
 
-   if (scheme->bootcode == 0)
+   if (scheme == NULL || scheme->bootcode == 0)
return (ENXIO);
 
if (fstat(fd, &sb) == -1)
@@ -130,6 +132,8 @@ scheme_check_part(struct part *p)
struct mkimg_alias *iter;
enum alias alias;
 
+   assert(scheme != NULL);
+
/* Check the partition type alias */
alias = scheme_parse_alias(p->alias);
if (alias == ALIAS_NONE)
@@ -158,28 +162,26 @@ u_int
 scheme_max_parts(void)
 {
 
-   return (scheme->nparts);
+   return ((scheme == NULL) ? 0 : scheme->nparts);
 }
 
 u_int
 scheme_max_secsz(void)
 {
 
-   return (scheme->maxsecsz);
+   return ((scheme == NULL) ? INT_MAX+1U : scheme->maxsecsz);
 }
 
 lba_t
 scheme_metadata(u_int where, lba_t start)
 {
 
-   return (scheme->metadata(where, start));
+   return ((scheme == NULL) ? start : scheme->metadata(where, start));
 }
 
 int
 scheme_write(lba_t end)
 {
-   int error;
 
-   error = scheme->write(end, bootcode);
-   return (error);
+   return ((scheme == NULL) ? 0 : scheme->write(end, bootcode));
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279136 - head/sys/powerpc/ps3

2015-02-21 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Feb 22 02:59:53 2015
New Revision: 279136
URL: https://svnweb.freebsd.org/changeset/base/279136

Log:
  Allow use of higher-resolution (e.g. 1920x1080) framebuffers on PS3.
  
  MFC after:1 month

Modified:
  head/sys/powerpc/ps3/ps3_syscons.c

Modified: head/sys/powerpc/ps3/ps3_syscons.c
==
--- head/sys/powerpc/ps3/ps3_syscons.c  Sun Feb 22 02:49:27 2015
(r279135)
+++ head/sys/powerpc/ps3/ps3_syscons.c  Sun Feb 22 02:59:53 2015
(r279136)
@@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$");
 
 #include "ps3-hvcall.h"
 
-#define PS3FB_SIZE (4*1024*1024)
-
 #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET   0x0100
 #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC   0x0101
 #define  L1GPU_DISPLAY_SYNC_HSYNC  1
@@ -138,8 +136,8 @@ ps3fb_remap(void)
0,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
1,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
-   lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle,
-   &fb_paddr);
+   lv1_gpu_memory_allocate(roundup2(sc->fb_info.fb_size, 1024*1024),
+   0, 0, 0, 0, &sc->sc_fbhandle, &fb_paddr);
lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext,
&sc->sc_dma_control, &sc->sc_driver_info, &sc->sc_reports,
&sc->sc_reports_size);
@@ -150,7 +148,7 @@ ps3fb_remap(void)
L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
 
sc->fb_info.fb_pbase = fb_paddr;
-   for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE)
+   for (va = 0; va < sc->fb_info.fb_size; va += PAGE_SIZE)
pmap_kenter_attr(0x1000 + va, fb_paddr + va,
VM_MEMATTR_WRITE_COMBINING);
sc->fb_info.fb_flags &= ~FB_FLAG_NOWRITE;
@@ -168,6 +166,8 @@ ps3fb_init(struct vt_device *vd)
sc->fb_info.fb_depth = 32;
sc->fb_info.fb_height = 480;
sc->fb_info.fb_width = 720;
+   TUNABLE_INT_FETCH("hw.ps3fb.height", &sc->fb_info.fb_height);
+   TUNABLE_INT_FETCH("hw.ps3fb.width", &sc->fb_info.fb_width);
sc->fb_info.fb_stride = sc->fb_info.fb_width*4;
sc->fb_info.fb_size = sc->fb_info.fb_height * sc->fb_info.fb_stride;
sc->fb_info.fb_bpp = sc->fb_info.fb_stride / sc->fb_info.fb_width * 8;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279139 - head/usr.bin/mkimg

2015-02-21 Thread Marcel Moolenaar
Author: marcel
Date: Sun Feb 22 04:50:47 2015
New Revision: 279139
URL: https://svnweb.freebsd.org/changeset/base/279139

Log:
  Add the -c option for specifying the capacity of the disk image. When
  a capcity is given, no partitions are required. When no partitions are
  given, no scheme needs to be specified either. This makes it possible
  to create an entirely empty disk image. To add an empty partitioning
  table, specify the scheme.
  
  Bump the version to 20150222.

Modified:
  head/usr.bin/mkimg/Makefile
  head/usr.bin/mkimg/mkimg.1
  head/usr.bin/mkimg/mkimg.c

Modified: head/usr.bin/mkimg/Makefile
==
--- head/usr.bin/mkimg/Makefile Sun Feb 22 03:30:02 2015(r279138)
+++ head/usr.bin/mkimg/Makefile Sun Feb 22 04:50:47 2015(r279139)
@@ -6,7 +6,7 @@ PROG=   mkimg
 SRCS=  format.c image.c mkimg.c scheme.c
 MAN=   mkimg.1
 
-MKIMG_VERSION=20141211
+MKIMG_VERSION=20150222
 mkimg.o: Makefile
 
 CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}

Modified: head/usr.bin/mkimg/mkimg.1
==
--- head/usr.bin/mkimg/mkimg.1  Sun Feb 22 03:30:02 2015(r279138)
+++ head/usr.bin/mkimg/mkimg.1  Sun Feb 22 04:50:47 2015(r279139)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 27, 2014
+.Dd February 22, 2015
 .Dt MKIMG 1
 .Os
 .Sh NAME
@@ -37,13 +37,12 @@
 .Op Fl S Ar secsz
 .Op Fl T Ar tracksz
 .Op Fl b Ar bootcode
+.Op Fl c Ar capacity
 .Op Fl f Ar format
 .Op Fl o Ar outfile
 .Op Fl v
 .Op Fl y
-.Fl s Ar scheme
-.Fl p Ar partition
-.Op Fl p Ar partition ...
+.Op Fl s Ar scheme Op Fl p Ar partition ...
 .Nm
 .Ar --formats | --schemes | --version
 .Sh DESCRIPTION
@@ -109,13 +108,29 @@ utility will use the (physical) block si
 partitions and to round the size of the disk image.
 .Pp
 The
-.Op Fl v
+.Fl c
+option can be used to specify a minimal capacity for the disk image.
+Use this option without the
+.Fl s
+and
+.Fl p
+options to create an empty disk image with the given (virtual) size.
+An empty partition table can be written to the disk when specifying a
+partitioning scheme with the
+.Fl s
+option, but without specifying any partitions.
+When the size required to for all the partitions is larger than the
+given capacity, then the disk image will be larger than the capacity
+given.
+.Pp
+The
+.Fl v
 option increases the level of output that the
 .Nm
 utility prints.
 .Pp
 The
-.Op Fl y
+.Fl y
 option is used for testing purposes only and is not to be used in production.
 When present, the
 .Nm

Modified: head/usr.bin/mkimg/mkimg.c
==
--- head/usr.bin/mkimg/mkimg.c  Sun Feb 22 03:30:02 2015(r279138)
+++ head/usr.bin/mkimg/mkimg.c  Sun Feb 22 04:50:47 2015(r279139)
@@ -60,6 +60,8 @@ static struct option longopts[] = {
{ NULL, 0, NULL, 0 }
 };
 
+static uint64_t capacity;
+
 struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist);
 u_int nparts = 0;
 
@@ -147,6 +149,7 @@ usage(const char *why)
fprintf(stderr, "\t--version\t-  show version information\n");
fputc('\n', stderr);
fprintf(stderr, "\t-b \t-  file containing boot code\n");
+   fprintf(stderr, "\t-c \t-  capacity (in bytes) of the disk\n");
fprintf(stderr, "\t-f \n");
fprintf(stderr, "\t-o \t-  file to write image into\n");
fprintf(stderr, "\t-p \n");
@@ -179,7 +182,7 @@ usage(const char *why)
 }
 
 static int
-parse_number(u_int *valp, u_int min, u_int max, const char *arg)
+parse_uint32(uint32_t *valp, uint32_t min, uint32_t max, const char *arg)
 {
uint64_t val;
 
@@ -187,7 +190,20 @@ parse_number(u_int *valp, u_int min, u_i
return (errno);
if (val > UINT_MAX || val < (uint64_t)min || val > (uint64_t)max)
return (EINVAL);
-   *valp = (u_int)val;
+   *valp = (uint32_t)val;
+   return (0);
+}
+
+static int
+parse_uint64(uint64_t *valp, uint64_t min, uint64_t max, const char *arg)
+{
+   uint64_t val;
+
+   if (expand_number(arg, &val) == -1)
+   return (errno);
+   if (val < min || val > max)
+   return (EINVAL);
+   *valp = val;
return (0);
 }
 
@@ -376,6 +392,17 @@ mkimg_uuid(struct uuid *uuid)
memcpy(uuid, gen, sizeof(uuid_t));
 }
 
+static int
+capacity_resize(lba_t end)
+{
+   lba_t capsz;
+
+   capsz = (capacity + secsz - 1) / secsz;
+   if (end >= capsz)
+   return (0);
+   return (image_set_size(capsz));
+}
+
 static void
 mkimg(void)
 {
@@ -437,6 +464,8 @@ mkimg(void)
block = scheme_metadata(SCHEME_META_IMG_END, block);
error = image_set_size(block);
if (!error)
+   error = capacity_resize(block);
+   if (!error)
error = format_resize(block);
if (error)
errc(EX_IOERR, error, "image sizing")

svn commit: r279141 - in head/sys/dev/sfxge: . common

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:08:57 2015
New Revision: 279141
URL: https://svnweb.freebsd.org/changeset/base/279141

Log:
  sfxge: style fixes and cleanup
  
  Sync endif comment with conditional.
  BOOTROM and SIENA_BOOTROM are the same, but highlight that it is Siena.
  Restore commented out assertion.
  Sync comments with out-of-tree driver.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/efx_ev.c
  head/sys/dev/sfxge/common/efx_filter.c
  head/sys/dev/sfxge/common/efx_mcdi.c
  head/sys/dev/sfxge/common/efx_nic.c
  head/sys/dev/sfxge/common/efx_tx.c
  head/sys/dev/sfxge/common/siena_mac.c
  head/sys/dev/sfxge/common/siena_nic.c
  head/sys/dev/sfxge/common/siena_nvram.c
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/common/efx_ev.c
==
--- head/sys/dev/sfxge/common/efx_ev.c  Sun Feb 22 06:22:10 2015
(r279140)
+++ head/sys/dev/sfxge/common/efx_ev.c  Sun Feb 22 07:08:57 2015
(r279141)
@@ -654,7 +654,7 @@ out:
return (should_abort);
 }
 
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
 
__checkReturn   int
 efx_ev_qprime(
@@ -970,7 +970,7 @@ efx_ev_qcreate(
eep->ee_handler[FSE_AZ_EV_CODE_DRV_GEN_EV] = efx_ev_drv_gen;
 #if EFSYS_OPT_MCDI
eep->ee_handler[FSE_AZ_EV_CODE_MCDI_EVRESPONSE] = efx_ev_mcdi;
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
 
/* Set up the new event queue */
if (enp->en_family != EFX_FAMILY_FALCON) {

Modified: head/sys/dev/sfxge/common/efx_filter.c
==
--- head/sys/dev/sfxge/common/efx_filter.c  Sun Feb 22 06:22:10 2015
(r279140)
+++ head/sys/dev/sfxge/common/efx_filter.c  Sun Feb 22 07:08:57 2015
(r279141)
@@ -412,7 +412,7 @@ efx_filter_search(
__inuint32_t key,
__inboolean_t for_insert,
__out   int *filter_index,
-   __out   int *depth_required)
+   __out   unsigned int *depth_required)
 {
unsigned hash, incr, filter_idx, depth;
 
@@ -528,7 +528,8 @@ efx_filter_remove_filter(
efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
efx_filter_spec_t *saved_spec;
efx_oword_t filter;
-   int filter_idx, depth;
+   int filter_idx;
+   unsigned int depth;
int state;
uint32_t key;
int rc;
@@ -561,7 +562,7 @@ efx_filter_remove_index(
__inint index)
 {
efx_filter_t *efp = &enp->en_filter;
-   enum efx_filter_tbl_id tbl_id = efx_filter_tbl_id(type);
+   efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(type);
efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
int state;
 

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==
--- head/sys/dev/sfxge/common/efx_mcdi.cSun Feb 22 06:22:10 2015
(r279140)
+++ head/sys/dev/sfxge/common/efx_mcdi.cSun Feb 22 07:08:57 2015
(r279141)
@@ -532,7 +532,7 @@ efx_mcdi_version(
 
 version:
/* The bootrom doesn't understand BOOT_STATUS */
-   if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM) {
+   if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM) {
status = EFX_MCDI_BOOT_ROM;
goto out;
}

Modified: head/sys/dev/sfxge/common/efx_nic.c
==
--- head/sys/dev/sfxge/common/efx_nic.c Sun Feb 22 06:22:10 2015
(r279140)
+++ head/sys/dev/sfxge/common/efx_nic.c Sun Feb 22 07:08:57 2015
(r279141)
@@ -249,10 +249,13 @@ efx_nic_create(
 #if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops;
-   enp->en_features = EFX_FEATURE_IPV6 |
+   enp->en_features =
+   EFX_FEATURE_IPV6 |
EFX_FEATURE_LFSR_HASH_INSERT |
-   EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS |
-   EFX_FEATURE_WOL | EFX_FEATURE_MCDI |
+   EFX_FEATURE_LINK_EVENTS |
+   EFX_FEATURE_PERIODIC_MAC_STATS |
+   EFX_FEATURE_WOL |
+   EFX_FEATURE_MCDI |
EFX_FEATURE_LOOKAHEAD_SPLIT |
EFX_FEATURE_MAC_HEADER_FILTERS;
break;

Modified: head/sys/dev/sfxge/common/efx_tx.c
==
--- head/sys/dev/sfxge/common/efx_tx.c  Sun Feb 22 06:22:10 2015
(r279140)
+++ head/sys/dev/sfxge/common/efx_tx.c  Sun Feb 22 07:08:57 2015
(r279141)
@@ -289,8 +289,9 @@ efx_tx_qcreate(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EF

svn commit: r279142 - head/sys/dev/sfxge/common

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:11:55 2015
New Revision: 279142
URL: https://svnweb.freebsd.org/changeset/base/279142

Log:
  sfxge: synchronize EF10 registers header
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/efx_regs_ef10.h

Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h
==
--- head/sys/dev/sfxge/common/efx_regs_ef10.h   Sun Feb 22 07:08:57 2015
(r279141)
+++ head/sys/dev/sfxge/common/efx_regs_ef10.h   Sun Feb 22 07:11:55 2015
(r279142)
@@ -1732,8 +1732,8 @@ extern "C" {
 #defineESF_DZ_RX_U_QST1_SPARE_WIDTH 12
 #defineESF_DZ_RX_U_SOFT16_B0R3_0_LBN 48
 #defineESF_DZ_RX_U_SOFT16_B0R3_0_WIDTH 16
-#defineESF_DZ_RX_U_PKT_EDIT_LBN 51
-#defineESF_DZ_RX_U_PKT_EDIT_WIDTH 1
+#defineESF_DZ_RX_U_TIMESTAMP_LBN 51
+#defineESF_DZ_RX_U_TIMESTAMP_WIDTH 1
 #defineESF_DZ_RX_U_DOORBELL_ENABLED_LBN 50
 #defineESF_DZ_RX_U_DOORBELL_ENABLED_WIDTH 1
 #defineESF_DZ_RX_U_WORK_PENDING_LBN 49
@@ -2677,6 +2677,138 @@ extern "C" {
 #defineESF_DZ_B2T_CPL_RSP_CPL_ADRS_WIDTH 7
 
 
+
+/* Enum DPCPU_INSTR_BRTYPE */
+#defineESE_DZ_BNEZAL 19
+#defineESE_DZ_BEQZAL 18
+#defineESE_DZ_BGEZAL 17
+#defineESE_DZ_BLTZAL 16
+#defineESE_DZ_BNEZ 3
+#defineESE_DZ_BEQZ 2
+#defineESE_DZ_BGEZ 1
+#defineESE_DZ_BLTZ 0
+
+/* Enum DPCPU_INSTR_FUNCT */
+#defineESE_DZ_MASKMOD 44
+#defineESE_DZ_SLTU 43
+#defineESE_DZ_SLT 42
+#defineESE_DZ_INCMOD 40
+#defineESE_DZ_NOR 39
+#defineESE_DZ_XOR 38
+#defineESE_DZ_OR 37
+#defineESE_DZ_AND 36
+#defineESE_DZ_SUBU 35
+#defineESE_DZ_SUB 34
+#defineESE_DZ_ADDU 33
+#defineESE_DZ_ADD 32
+#defineESE_DZ_MULT 25
+#defineESE_DZ_MFLO 18
+#defineESE_DZ_MFHI 16
+#defineESE_DZ_JALR 9
+#defineESE_DZ_JR 8
+#defineESE_DZ_SRAV 7
+#defineESE_DZ_SRLV 6
+#defineESE_DZ_SLLV 4
+#defineESE_DZ_SRA 3
+#defineESE_DZ_SRL 2
+#defineESE_DZ_SLL 0
+
+/* Enum DPCPU_INSTR_OP */
+#defineESE_DZ_LM_MSG 49
+#defineESE_DZ_MSG 48
+#defineESE_DZ_SHA 43
+#defineESE_DZ_SBA 42
+#defineESE_DZ_SH 41
+#defineESE_DZ_SB 40
+#defineESE_DZ_LHUA 39
+#defineESE_DZ_LBUA 38
+#defineESE_DZ_LHU 37
+#defineESE_DZ_LBU 36
+#defineESE_DZ_LHA 35
+#defineESE_DZ_LBA 34
+#defineESE_DZ_LH 33
+#defineESE_DZ_LB 32
+#defineESE_DZ_BGTU 31
+#defineESE_DZ_BLEU 30
+#defineESE_DZ_MODI 28
+#defineESE_DZ_NEGU 27
+#defineESE_DZ_NEG 26
+#defineESE_DZ_LI 25
+#defineESE_DZ_INCMODI 24
+#defineESE_DZ_BGT 23
+#defineESE_DZ_BLE 22
+#defineESE_DZ_BBS 21
+#defineESE_DZ_BBC 20
+#defineESE_DZ_JAL_EVT 19
+#defineESE_DZ_J_EVT 18
+#defineESE_DZ_HALT 16
+#defineESE_DZ_NORI 15
+#defineESE_DZ_XORI 14
+#defineESE_DZ_ORI 13
+#defineESE_DZ_ANDI 12
+#defineESE_DZ_SLTIU 11
+#defineESE_DZ_SLTI 10
+#defineESE_DZ_ADDIU 9
+#defineESE_DZ_ADDI 8
+#defineESE_DZ_BGTZ 7
+#defineESE_DZ_BLEZ 6
+#defineESE_DZ_BNE 5
+#defineESE_DZ_BEQ 4
+#defineESE_DZ_JAL 3
+#defineESE_DZ_J 2
+#defineESE_DZ_BRANCH 1
+#defineESE_DZ_REG2REG 0
+
+/* Enum DPCPU_MSG_DIR */
+#defineESE_DPCPU_MSG_DZ_OUTB 0x1
+#defineESE_DPCPU_MSG_DZ_INB 0x0
+
+/* Enum DPCPU_PDBUS_OP */
+#defineESE_DPCPU_PDBUS_DZ_RD 0x1
+#defineESE_DPCPU_PDBUS_DZ_WR 0x0
+
+/* Enum INI_OP */
+#defineESE_DZ_RD_COMPL 0x3
+#defineESE_DZ_NOP 0x2
+#defineESE_DZ_WR 0x1
+#defineESE_DZ_RD 0x0
+
+/* Enum INT_OP */
+#defineESE_DZ_LEGACY 0x2
+#defineESE_DZ_MSI 0x1
+#defineESE_DZ_MSIX 0x0
+
+/* Enum PKT_STRM_CTL */
+#defineESE_DZ_EOP_TRUNC 0x3
+#defineESE_DZ_EOP_CRC_ERR 0x2
+#defineESE_DZ_EOP 0x1
+#defineESE_DZ_NOOP 0x0
+
+/* Enum PM_EPI_PKT_MARKER */
+#defineESE_DZ_PM_EPI_LST 0x3
+#defineESE_DZ_PM_EPI_OBL 0x2
+#defineESE_DZ_PM_EPI_TBL 0x1
+#defineESE_DZ_PM_EPI_MDL 0x0
+
+/* Enum PM_IPI_TO_PM_MM_COMMAND */
+#defineESE_DZ_FREE_CHAIN 0x3
+#defineESE_DZ_FREE_BUFFER 0x2
+#defineESE_DZ_ADD_BUFFER 0x1
+#defineESE_DZ_PM_MM_NOOP 0x0
+
+/* Enum PM_MA_TO_PM_EPI_COMMAND */
+#defineESE_DZ_FROM_PORT_D 0x4
+#defineESE_DZ_FROM_PORT_C 0x3
+#defineESE_DZ_FROM_PORT_B 0x2
+#defineESE_DZ_FROM_PORT_A 0x1
+#defineESE_DZ_PM_EPI_NOOP 0x0
+
+/* Enum PM_MA_TO_PM_IPI_COMMAND */
+#defineESE_DZ_TO_PORT_D 0x4
+#defineESE_DZ_TO_PORT_C 0x3
+#def

svn commit: r279143 - head/sys/dev/sfxge/common

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:14:12 2015
New Revision: 279143
URL: https://svnweb.freebsd.org/changeset/base/279143

Log:
  sfxge: use common definitions of MC shared memory offsets and PDU length
  
  Submitted by:   Ben Hutchings
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/efx_mcdi.c

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==
--- head/sys/dev/sfxge/common/efx_mcdi.cSun Feb 22 07:11:55 2015
(r279142)
+++ head/sys/dev/sfxge/common/efx_mcdi.cSun Feb 22 07:14:12 2015
(r279143)
@@ -35,15 +35,6 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_MCDI
 
-/* Shared memory layout */
-
-#defineMCDI_P1_DBL_OFST0x0
-#defineMCDI_P2_DBL_OFST0x1
-#defineMCDI_P1_PDU_OFST0x2
-#defineMCDI_P2_PDU_OFST0x42
-#defineMCDI_P1_REBOOT_OFST 0x1fe
-#defineMCDI_P2_REBOOT_OFST 0x1ff
-
 /*
  * A reboot/assertion causes the MCDI status word to be set after the
  * command word is set or a REBOOT event is sent. If we notice a reboot
@@ -72,12 +63,12 @@ efx_mcdi_request_start(
 
switch (emip->emi_port) {
case 1:
-   pdur = MCDI_P1_PDU_OFST;
-   dbr = MCDI_P1_DBL_OFST;
+   pdur = MC_SMEM_P0_PDU_OFST >> 2;
+   dbr = MC_SMEM_P0_DOORBELL_OFST >> 2;
break;
case 2:
-   pdur = MCDI_P2_PDU_OFST;
-   dbr = MCDI_P2_DBL_OFST;
+   pdur = MC_SMEM_P1_PDU_OFST >> 2;
+   dbr = MC_SMEM_P1_DOORBELL_OFST >> 2;
break;
default:
EFSYS_ASSERT(0);
@@ -140,7 +131,9 @@ efx_mcdi_request_copyout(
unsigned int pdur;
efx_dword_t data;
 
-   pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST;
+   pdur = (emip->emi_port == 1)
+   ? MC_SMEM_P0_PDU_OFST >> 2
+   : MC_SMEM_P1_PDU_OFST >> 2;
 
/* Copy payload out if caller supplied buffer */
if (emrp->emr_out_buf != NULL) {
@@ -227,8 +220,8 @@ efx_mcdi_poll_reboot(
 
EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
rebootr = ((emip->emi_port == 1)
-   ? MCDI_P1_REBOOT_OFST
-   : MCDI_P2_REBOOT_OFST);
+   ? MC_SMEM_P0_STATUS_OFST >> 2
+   : MC_SMEM_P1_STATUS_OFST >> 2);
 
EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, rebootr, &dword, B_FALSE);
value = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
@@ -281,7 +274,9 @@ efx_mcdi_request_poll(
}
 
EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2);
-   pdur = (emip->emi_port == 1) ? MCDI_P1_PDU_OFST : MCDI_P2_PDU_OFST;
+   pdur = (emip->emi_port == 1)
+   ? MC_SMEM_P0_PDU_OFST >> 2
+   : MC_SMEM_P1_PDU_OFST >> 2;
 
/* Read the command header */
EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279144 - head/sys/dev/sfxge

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:16:11 2015
New Revision: 279144
URL: https://svnweb.freebsd.org/changeset/base/279144

Log:
  sfxge: packet can't require more than n_dma_seg descriptors plus one
  
  Use remaining number of DMA segment instead of maximum number in mapping
  when checking space for one more TSO segment packet.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Sun Feb 22 07:14:12 2015
(r279143)
+++ head/sys/dev/sfxge/sfxge_tx.c   Sun Feb 22 07:16:11 2015
(r279144)
@@ -1104,8 +1104,8 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq
 * the remainder of the input mbuf but do not
 * roll back the work we have done.
 */
-   if (txq->n_pend_desc >
-   SFXGE_TSO_MAX_DESC - (1 + 
SFXGE_TX_MAPPING_MAX_SEG)) {
+   if (txq->n_pend_desc + 1 /* header */ + n_dma_seg >
+   SFXGE_TSO_MAX_DESC) {
txq->tso_pdrop_too_many++;
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279145 - head/sys/dev/sfxge/common

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:17:35 2015
New Revision: 279145
URL: https://svnweb.freebsd.org/changeset/base/279145

Log:
  sfxge: use macros to acquire and release BAR locks everywhere
  
  It was the result of invalid merge of the patch from out-of-tree driver.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/efsys.h

Modified: head/sys/dev/sfxge/common/efsys.h
==
--- head/sys/dev/sfxge/common/efsys.h   Sun Feb 22 07:16:11 2015
(r279144)
+++ head/sys/dev/sfxge/common/efsys.h   Sun Feb 22 07:17:35 2015
(r279145)
@@ -669,7 +669,7 @@ typedef struct efsys_bar_s {
uint32_t, (_eqp)->eq_u32[1],\
uint32_t, (_eqp)->eq_u32[0]);   \
\
-   mtx_unlock(&((_esbp)->esb_lock));   \
+   SFXGE_BAR_UNLOCK(_esbp);\
_NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 
@@ -681,7 +681,7 @@ typedef struct efsys_bar_s {
\
_NOTE(CONSTANTCONDITION)\
if (_lock)  \
-   mtx_lock(&((_esbp)->esb_lock)); \
+   SFXGE_BAR_LOCK(_esbp);  \
\
(_eop)->eo_u64[0] = bus_space_read_8((_esbp)->esb_tag,  \
(_esbp)->esb_handle, (_offset));\
@@ -696,7 +696,7 @@ typedef struct efsys_bar_s {
\
_NOTE(CONSTANTCONDITION)\
if (_lock)  \
-   mtx_unlock(&((_esbp)->esb_lock));   \
+   SFXGE_BAR_UNLOCK(_esbp);\
_NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 
@@ -707,7 +707,7 @@ typedef struct efsys_bar_s {
KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
("not power of 2 aligned"));\
\
-   mtx_lock(&((_esbp)->esb_lock)); \
+   SFXGE_BAR_LOCK(_esbp);  \
\
(_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag,  \
(_esbp)->esb_handle, (_offset));\
@@ -762,7 +762,7 @@ typedef struct efsys_bar_s {
\
_NOTE(CONSTANTCONDITION)\
if (_lock)  \
-   SFXGE_BAR_LOCK(_esbp);  \
+   SFXGE_BAR_LOCK(_esbp);  \
\
EFSYS_PROBE2(bar_writed, unsigned int, (_offset),   \
uint32_t, (_edp)->ed_u32[0]);   \
@@ -772,7 +772,7 @@ typedef struct efsys_bar_s {
\
_NOTE(CONSTANTCONDITION)\
if (_lock)  \
-   SFXGE_BAR_UNLOCK(_esbp);\
+   SFXGE_BAR_UNLOCK(_esbp);\
_NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 
@@ -792,7 +792,7 @@ typedef struct efsys_bar_s {
bus_space_write_8((_esbp)->esb_tag, (_esbp)->esb_handle,\
(_offset), (_eqp)->eq_u64[0]);  \
\
-   mtx_unlock(&((_esbp)->esb_lock));   \
+   SFXGE_BAR_UNLOCK(_esbp);\
_NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 #else
@@ -802,7 +802,7 @@ typedef struct efsys_bar_s {
KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
("not power of 2 aligned"));\
\
-   mtx_lock(&((_esbp)->esb_

svn commit: r279146 - head/sys/dev/sfxge/common

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:18:38 2015
New Revision: 279146
URL: https://svnweb.freebsd.org/changeset/base/279146

Log:
  sfxge: use sparse index to retrieve sensor value
  
  Submitted by:   Andrew Jackson 
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/siena_mon.c

Modified: head/sys/dev/sfxge/common/siena_mon.c
==
--- head/sys/dev/sfxge/common/siena_mon.c   Sun Feb 22 07:17:35 2015
(r279145)
+++ head/sys/dev/sfxge/common/siena_mon.c   Sun Feb 22 07:18:38 2015
(r279146)
@@ -105,6 +105,7 @@ siena_mon_decode_stats(
uint16_t mc_sensor;
size_t mc_sensor_max;
uint32_t vmask = 0;
+   uint32_t idx = 0;
 
/* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */
SIENA_STATIC_SENSOR_ASSERT(OK);
@@ -125,18 +126,19 @@ siena_mon_decode_stats(
for (mc_sensor = 0; mc_sensor < mc_sensor_max; ++mc_sensor) {
uint16_t efx_sensor = sensor_map[mc_sensor];
 
-   if (efx_sensor == SIENA_MON_WRONG_PORT)
+   if (~dmask & (1 << mc_sensor))
continue;
-   EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS);
+   idx++;
 
-   if (~dmask & (1 << mc_sensor))
+   if (efx_sensor == SIENA_MON_WRONG_PORT)
continue;
+   EFSYS_ASSERT(efx_sensor < EFX_MON_NSTATS);
 
vmask |= (1 << efx_sensor);
if (value != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) {
efx_mon_stat_value_t *emsvp = value + efx_sensor;
efx_dword_t dword;
-   EFSYS_MEM_READD(esmp, 4 * mc_sensor, &dword);
+   EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword);
emsvp->emsv_value =
(uint16_t)EFX_DWORD_FIELD(
dword,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r279147 - head/sys/dev/sfxge

2015-02-21 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Feb 22 07:20:04 2015
New Revision: 279147
URL: https://svnweb.freebsd.org/changeset/base/279147

Log:
  sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:gnn (mentor)

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Sun Feb 22 07:18:38 2015
(r279146)
+++ head/sys/dev/sfxge/sfxge_tx.c   Sun Feb 22 07:20:04 2015
(r279147)
@@ -67,16 +67,22 @@ __FBSDID("$FreeBSD$");
 #include "sfxge.h"
 #include "sfxge_tx.h"
 
-/* Set the block level to ensure there is space to generate a
- * large number of descriptors for TSO.  With minimum MSS and
- * maximum mbuf length we might need more than a ring-ful of
- * descriptors, but this should not happen in practice except
- * due to deliberate attack.  In that case we will truncate
- * the output at a packet boundary.
+/*
+ * Estimate maximum number of Tx descriptors required for TSO packet.
+ * With minimum MSS and maximum mbuf length we might need more (even
+ * than a ring-ful of descriptors), but this should not happen in
+ * practice except due to deliberate attack.  In that case we will
+ * truncate the output at a packet boundary.
  */
 #defineSFXGE_TSO_MAX_DESC  
\
(SFXGE_TSO_MAX_SEGS * 2 + SFXGE_TX_MAPPING_MAX_SEG - 1)
-#defineSFXGE_TXQ_BLOCK_LEVEL(_entries) ((_entries) - 
SFXGE_TSO_MAX_DESC)
+
+/*
+ * Set the block level to ensure there is space to generate a
+ * large number of descriptors for TSO.
+ */
+#defineSFXGE_TXQ_BLOCK_LEVEL(_entries) 
\
+   (EFX_TXQ_LIMIT(_entries) - SFXGE_TSO_MAX_DESC)
 
 #ifdef SFXGE_HAVE_MQ
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"