svn commit: r263710 - in head/sys: net netpfil/pf

2014-03-25 Thread Martin Matuska
Author: mm
Date: Tue Mar 25 06:55:53 2014
New Revision: 263710
URL: http://svnweb.freebsd.org/changeset/base/263710

Log:
  Merge from projects/pf r251993 (glebius@):
  
  De-vnet hash sizes and hash masks.
  
  Submitted by: Nikos Vassiliadis nvass gmx.com
  Reviewed by:  trociny
  
  MFC after:1 month

Modified:
  head/sys/net/pfvar.h
  head/sys/netpfil/pf/if_pfsync.c
  head/sys/netpfil/pf/pf.c
  head/sys/netpfil/pf/pf_ioctl.c
Directory Properties:
  head/sys/   (props changed)

Modified: head/sys/net/pfvar.h
==
--- head/sys/net/pfvar.hTue Mar 25 04:45:55 2014(r263709)
+++ head/sys/net/pfvar.hTue Mar 25 06:55:53 2014(r263710)
@@ -1488,19 +1488,17 @@ struct pf_idhash {
struct mtx  lock;
 };
 
+extern u_long  pf_hashmask;
+extern u_long  pf_srchashmask;
 #definePF_HASHSIZ  (32768)
 VNET_DECLARE(struct pf_keyhash *, pf_keyhash);
 VNET_DECLARE(struct pf_idhash *, pf_idhash);
-VNET_DECLARE(u_long, pf_hashmask);
 #define V_pf_keyhash   VNET(pf_keyhash)
 #defineV_pf_idhash VNET(pf_idhash)
-#defineV_pf_hashmask   VNET(pf_hashmask)
 VNET_DECLARE(struct pf_srchash *, pf_srchash);
-VNET_DECLARE(u_long, pf_srchashmask);
 #defineV_pf_srchashVNET(pf_srchash)
-#define V_pf_srchashmask VNET(pf_srchashmask)
 
-#define PF_IDHASH(s)   (be64toh((s)-id) % (V_pf_hashmask + 1))
+#define PF_IDHASH(s)   (be64toh((s)-id) % (pf_hashmask + 1))
 
 VNET_DECLARE(void *, pf_swi_cookie);
 #define V_pf_swi_cookieVNET(pf_swi_cookie)

Modified: head/sys/netpfil/pf/if_pfsync.c
==
--- head/sys/netpfil/pf/if_pfsync.c Tue Mar 25 04:45:55 2014
(r263709)
+++ head/sys/netpfil/pf/if_pfsync.c Tue Mar 25 06:55:53 2014
(r263710)
@@ -683,7 +683,7 @@ pfsync_in_clr(struct pfsync_pkt *pkt, st
pfi_kif_find(clr[i].ifname) == NULL)
continue;
 
-   for (int i = 0; i = V_pf_hashmask; i++) {
+   for (int i = 0; i = pf_hashmask; i++) {
struct pf_idhash *ih = V_pf_idhash[i];
struct pf_state *s;
 relock:
@@ -2048,7 +2048,7 @@ pfsync_bulk_update(void *arg)
else
i = sc-sc_bulk_hashid;
 
-   for (; i = V_pf_hashmask; i++) {
+   for (; i = pf_hashmask; i++) {
struct pf_idhash *ih = V_pf_idhash[i];
 
if (s != NULL)

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cTue Mar 25 04:45:55 2014(r263709)
+++ head/sys/netpfil/pf/pf.cTue Mar 25 06:55:53 2014(r263710)
@@ -361,21 +361,19 @@ enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI
 static MALLOC_DEFINE(M_PFHASH, pf_hash, pf(4) hash header structures);
 VNET_DEFINE(struct pf_keyhash *, pf_keyhash);
 VNET_DEFINE(struct pf_idhash *, pf_idhash);
-VNET_DEFINE(u_long, pf_hashmask);
 VNET_DEFINE(struct pf_srchash *, pf_srchash);
-VNET_DEFINE(u_long, pf_srchashmask);
 
 SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW, 0, pf(4));
 
-VNET_DEFINE(u_long, pf_hashsize);
-#defineV_pf_hashsize   VNET(pf_hashsize)
-SYSCTL_VNET_UINT(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN,
-VNET_NAME(pf_hashsize), 0, Size of pf(4) states hashtable);
-
-VNET_DEFINE(u_long, pf_srchashsize);
-#defineV_pf_srchashsizeVNET(pf_srchashsize)
-SYSCTL_VNET_UINT(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN,
-VNET_NAME(pf_srchashsize), 0, Size of pf(4) source nodes hashtable);
+u_long pf_hashmask;
+u_long pf_srchashmask;
+static u_long  pf_hashsize;
+static u_long  pf_srchashsize;
+
+SYSCTL_UINT(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN,
+pf_hashsize, 0, Size of pf(4) states hashtable);
+SYSCTL_UINT(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN,
+pf_srchashsize, 0, Size of pf(4) source nodes hashtable);
 
 VNET_DEFINE(void *, pf_swi_cookie);
 
@@ -391,7 +389,7 @@ pf_hashkey(struct pf_state_key *sk)
sizeof(struct pf_state_key_cmp)/sizeof(uint32_t),
V_pf_hashseed);
 
-   return (h  V_pf_hashmask);
+   return (h  pf_hashmask);
 }
 
 static __inline uint32_t
@@ -412,7 +410,7 @@ pf_hashsrc(struct pf_addr *addr, sa_fami
panic(%s: unknown address family %u, __func__, af);
}
 
-   return (h  V_pf_srchashmask);
+   return (h  pf_srchashmask);
 }
 
 #ifdef INET6
@@ -574,7 +572,7 @@ pf_overload_task(void *c, int pending)
if (SLIST_EMPTY(queue))
return;
 
-   for (int i = 0; i = V_pf_hashmask; i++) {
+   for (int i = 0; i = pf_hashmask; i++) {
struct pf_idhash *ih = V_pf_idhash[i];
struct pf_state_key *sk;
struct pf_state *s;
@@ -739,12 +737,12 @@ pf_initialize()
struct 

svn commit: r263711 - in head/sys: arm/allwinner arm/allwinner/a20 arm/rockchip boot/fdt/dts/arm

2014-03-25 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Tue Mar 25 08:31:47 2014
New Revision: 263711
URL: http://svnweb.freebsd.org/changeset/base/263711

Log:
  Switch to my freebsd.org emal address in copyright.
  
  Approved by:  stas (mentor)

Modified:
  head/sys/arm/allwinner/a10_clk.c
  head/sys/arm/allwinner/a10_clk.h
  head/sys/arm/allwinner/a10_common.c
  head/sys/arm/allwinner/a10_ehci.c
  head/sys/arm/allwinner/a10_gpio.c
  head/sys/arm/allwinner/a10_gpio.h
  head/sys/arm/allwinner/a10_machdep.c
  head/sys/arm/allwinner/a10_sramc.c
  head/sys/arm/allwinner/a10_sramc.h
  head/sys/arm/allwinner/a20/a20_cpu_cfg.c
  head/sys/arm/allwinner/a20/a20_cpu_cfg.h
  head/sys/arm/allwinner/aintc.c
  head/sys/arm/allwinner/console.c
  head/sys/arm/allwinner/if_emac.c
  head/sys/arm/allwinner/if_emacreg.h
  head/sys/arm/allwinner/timer.c
  head/sys/arm/rockchip/rk30xx_common.c
  head/sys/arm/rockchip/rk30xx_gpio.c
  head/sys/arm/rockchip/rk30xx_grf.c
  head/sys/arm/rockchip/rk30xx_grf.h
  head/sys/arm/rockchip/rk30xx_machdep.c
  head/sys/arm/rockchip/rk30xx_pmu.c
  head/sys/arm/rockchip/rk30xx_pmu.h
  head/sys/arm/rockchip/rk30xx_wdog.c
  head/sys/arm/rockchip/rk30xx_wdog.h
  head/sys/boot/fdt/dts/arm/cubieboard.dts
  head/sys/boot/fdt/dts/arm/cubieboard2.dts
  head/sys/boot/fdt/dts/arm/rk3188-radxa.dts
  head/sys/boot/fdt/dts/arm/rk3188.dtsi

Modified: head/sys/arm/allwinner/a10_clk.c
==
--- head/sys/arm/allwinner/a10_clk.cTue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_clk.cTue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/a10_clk.h
==
--- head/sys/arm/allwinner/a10_clk.hTue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_clk.hTue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/a10_common.c
==
--- head/sys/arm/allwinner/a10_common.c Tue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_common.c Tue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2012 Ganbold Tsagaankhuu ganb...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/a10_ehci.c
==
--- head/sys/arm/allwinner/a10_ehci.c   Tue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_ehci.c   Tue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2012 Ganbold Tsagaankhuu ganb...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Tue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_gpio.c   Tue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@freebsd.org
  * Copyright (c) 2012 Oleksandr Tymoshenko go...@freebsd.org
  * Copyright (c) 2012 Luiz Otavio O Souza.
  * All rights reserved.

Modified: head/sys/arm/allwinner/a10_gpio.h
==
--- head/sys/arm/allwinner/a10_gpio.h   Tue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_gpio.h   Tue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2013 Ganbold Tsagaankhuu ganb...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/arm/allwinner/a10_machdep.c
==
--- head/sys/arm/allwinner/a10_machdep.cTue Mar 25 06:55:53 2014
(r263710)
+++ head/sys/arm/allwinner/a10_machdep.cTue Mar 25 08:31:47 2014
(r263711)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012 Ganbold Tsagaankhuu ganb...@gmail.com
+ * Copyright (c) 2012 Ganbold 

Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys

2014-03-25 Thread Alexey Dokuchaev
On Sun, Mar 23, 2014 at 10:58:18PM -0700, Justin Hibbits wrote:
 On Mon, 24 Mar 2014 05:44:42 + Alexey Dokuchaev wrote:
  Hmm, -CURRENT does not build for me after this commit apparently;
  take a look at the log excerpt.  Could it be that r261342 relies on
  some earlier revision which I'm missing (that is, my r260369'ish
  -CURRENT is too old)? What's the best way to catch up?  Thanks,
 
 It looks to me like it's picking up your old PMC header files.  Did you
 try doing a full buildworld (without a -DNO_CLEAN)?  I've built world
 multiple times since and it works just fine for me.

It turned out to be ccache's fault.  Once I've resumed the build with
-DNO_CLEAN -DNO_CCACHE, it finished just fine.

./danfe
___
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: r263704 - head/sys/kern

2014-03-25 Thread Warner Losh

On Mar 24, 2014, at 9:28 PM, Mateusz Guzik m...@freebsd.org wrote:

 Author: mjg
 Date: Tue Mar 25 03:28:58 2014
 New Revision: 263704
 URL: http://svnweb.freebsd.org/changeset/base/263704
 
 Log:
  Make /dev/devctl mpsafe.
 
  MFC after:   1 week
 
 Modified:
  head/sys/kern/subr_bus.c
 
 Modified: head/sys/kern/subr_bus.c
 ==
 --- head/sys/kern/subr_bus.c  Tue Mar 25 03:25:30 2014(r263703)
 +++ head/sys/kern/subr_bus.c  Tue Mar 25 03:28:58 2014(r263704)
 @@ -358,15 +358,16 @@ device_sysctl_fini(device_t dev)
 /* Deprecated way to adjust queue length */
 static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS);
 /* XXX Need to support old-style tunable hw.bus.devctl_disable */
 -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, 
 NULL,
 -0, sysctl_devctl_disable, I, devctl disable -- deprecated);
 +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW |
 +CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, I,
 +devctl disable -- deprecated”);

This can likely be deleted now...

 #define DEVCTL_DEFAULT_QUEUE_LEN 1000
 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS);
 static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN;
 TUNABLE_INT(hw.bus.devctl_queue, devctl_queue_length);
 -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW, NULL,
 -0, sysctl_devctl_queue, I, devctl queue length);
 +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW |
 +CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, I, devctl queue 
 length);
 
 static d_open_t   devopen;
 static d_close_t  devclose;
 @@ -376,7 +377,6 @@ static d_poll_t   devpoll;
 
 static struct cdevsw dev_cdevsw = {
   .d_version =D_VERSION,
 - .d_flags =  D_NEEDGIANT,
   .d_open =   devopen,
   .d_close =  devclose,
   .d_read =   devread,
 @@ -420,23 +420,31 @@ devinit(void)
 static int
 devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
 {
 +
   if (devsoftc.inuse)
   return (EBUSY);

Why not delete these two lines? Since this isn’t a performance critical part of 
the code,
it is clearer and safer to just test inuse inside the locked section.

 + mtx_lock(devsoftc.mtx);
 + if (devsoftc.inuse) {
 + mtx_unlock(devsoftc.mtx);
 + return (EBUSY);
 + }
   /* move to init */
   devsoftc.inuse = 1;
   devsoftc.nonblock = 0;
   devsoftc.async_proc = NULL;
 + mtx_unlock(devsoftc.mtx);
   return (0);
 }
 
 static int
 devclose(struct cdev *dev, int fflag, int devtype, struct thread *td)
 {
 - devsoftc.inuse = 0;
 +
   mtx_lock(devsoftc.mtx);
 + devsoftc.inuse = 0;
 + devsoftc.async_proc = NULL;
   cv_broadcast(devsoftc.cv);
   mtx_unlock(devsoftc.mtx);
 - devsoftc.async_proc = NULL;
   return (0);
 }
___
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: r263738 - head/tests/sys/netinet

2014-03-25 Thread Alan Somers
Author: asomers
Date: Tue Mar 25 15:03:08 2014
New Revision: 263738
URL: http://svnweb.freebsd.org/changeset/base/263738

Log:
  tests/sys/netinet/Makefile
  tests/sys/netinet/fibs.sh
Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet.
The original test was poorly written; it was actually testing
kern/167947 instead of the desired kern/187553.  The root cause of the
bug is that ifa_ifwithnet did not have a fib argument.  The new test
more directly targets that behavior.
  
  tests/sys/netinet/udp_dontroute.c
Delete the auxilliary binary used by the old test
  
  PR:   kern/187553
  MFC after:3 weeks
  Sponsored by: Spectra Logic Corporation

Deleted:
  head/tests/sys/netinet/udp_dontroute.c
Modified:
  head/tests/sys/netinet/Makefile
  head/tests/sys/netinet/fibs_test.sh

Modified: head/tests/sys/netinet/Makefile
==
--- head/tests/sys/netinet/Makefile Tue Mar 25 13:41:55 2014
(r263737)
+++ head/tests/sys/netinet/Makefile Tue Mar 25 15:03:08 2014
(r263738)
@@ -1,12 +1,7 @@
 # $FreeBSD$
 
 TESTSDIR=  ${TESTSBASE}/sys/netinet
-BINDIR=${TESTSDIR}
 
 ATF_TESTS_SH+= fibs_test
-PROG=  udp_dontroute
-SRCS=  udp_dontroute.c
-NO_MAN=
-WARNS?=6
 
 .include bsd.test.mk

Modified: head/tests/sys/netinet/fibs_test.sh
==
--- head/tests/sys/netinet/fibs_test.sh Tue Mar 25 13:41:55 2014
(r263737)
+++ head/tests/sys/netinet/fibs_test.sh Tue Mar 25 15:03:08 2014
(r263738)
@@ -255,45 +255,66 @@ subnet_route_with_multiple_fibs_on_same_
cleanup_tap
 }
 
-# Test that source address selection works correctly for UDP packets with
-# SO_DONTROUTE set that are sent on non-default FIBs.
+# Regression test for kern/187553 Source address selection for UDP packets
+# with SO_DONTROUTE uses the default FIB.  The original complaint was that a
+# UDP packet with SO_DONTROUTE set would select a source address from an
+# interface on the default FIB instead of the process FIB.
 # This bug was discovered with setfib 1 netperf -t UDP_STREAM -H some_host
 # Regression test for kern/187553
-atf_test_case udp_dontroute cleanup
-udp_dontroute_head()
+
+# The root cause was that ifa_ifwithnet() did not have a fib argument.  It
+# would return an address from an interface on any FIB that had a subnet route
+# for the destination.  If more than one were available, it would choose the
+# most specific.  The root cause is most easily tested by creating two
+# interfaces with overlapping subnet routes, adding a default route to the
+# interface with the less specific subnet route, and looking up a host that
+# requires the default route using the FIB of the interface with the less
+# specific subnet route.  route get should provide a route that uses the
+# interface on the chosen FIB.  However, absent the patch for this bug it will
+# instead use the other interface.
+atf_test_case src_addr_selection_by_subnet cleanup
+src_addr_selection_by_subnet_head()
 {
atf_set descr Source address selection for UDP packets with 
SO_DONTROUTE on non-default FIBs works
atf_set require.user root
atf_set require.config fibs
 }
 
-udp_dontroute_body()
+src_addr_selection_by_subnet_body()
 {
atf_expect_fail kern/187553 Source address selection for UDP packets 
with SO_DONTROUTE uses the default FIB
# Configure the TAP interface to use an RFC5737 nonrouteable address
# and a non-default fib
-   ADDR=192.0.2.2
+   ADDR0=192.0.2.2
+   ADDR1=192.0.2.3
+   GATEWAY0=192.0.2.1
+   TARGET=192.0.2.128
SUBNET=192.0.2.0
-   MASK=24
-   # Use a different IP on the same subnet as the target
-   TARGET=192.0.2.100
+   MASK0=25
+   MASK1=26
 
# Check system configuration
if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then
atf_skip This test requires net.add_addr_allfibs=0
fi
-   get_fibs 1
+   get_fibs 2
 
# Configure a TAP interface
-   setup_tap ${FIB0} ${ADDR} ${MASK}
+   setup_tap ${FIB0} ${ADDR0} ${MASK0}
+   TAP0=${TAP}
+   setup_tap ${FIB1} ${ADDR1} ${MASK1}
+   TAP1=${TAP}
+
+   # Add a gateway to the interface with the less specific subnet route
+   setfib ${FIB0} route add default ${GATEWAY0}
 
-   # Send a UDP packet with SO_DONTROUTE.  In the failure case, it will
-   # return ENETUNREACH
-   SRCDIR=`atf_get_srcdir`
-   atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET}
+   # Lookup a route
+   echo Looking up route to ${TARGET} with fib ${FIB0}
+   echo Expected behavior is to use interface ${TAP0}
+   atf_check -o match:interface:.${TAP0} setfib ${FIB0} route -n get 
${TARGET}
 }
 
-udp_dontroute_cleanup()
+src_addr_selection_by_subnet_cleanup()
 {
 

Re: svn commit: r256768 - head/sbin/ifconfig

2014-03-25 Thread Alan Somers
On Sat, Oct 19, 2013 at 3:59 AM, Dag-Erling Smørgrav d...@freebsd.org wrote:
 Author: des
 Date: Sat Oct 19 09:59:11 2013
 New Revision: 256768
 URL: http://svnweb.freebsd.org/changeset/base/256768

 Log:
   Do not error out when adding an interface to a group to which it
   already belongs or removing it from a group to which it does not
   belong.  This makes it possible to include group memberships in
   ifconfig_foo0 in rc.conf without fear of breaking service netif
   restart foo0.

   MFC after:3 days

 Modified:
   head/sbin/ifconfig/ifgroup.c

 Modified: head/sbin/ifconfig/ifgroup.c

Is there any reason why this can't be MFCed to stable/9 ?

-Alan
___
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: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mo

2014-03-25 Thread Dag-Erling Smørgrav
Julio Merino j...@freebsd.org writes:
 Log:
   Migrate tools/regression/usr.bin/make/ to the new tests layout.
   
   Note that these tests are for fmake, not bmake, and thus they are not
   installed nor run when bmake is selected (the default).  Yes, I have
   wasted a *ton* of time on moving tests for no real reason other than
   ensuring they are not left behind.
   
   But maybe, just maybe, it was not work in vain: the majority of these
   tests also work with bmake and the few that don't may point at broken
   stuff.  For example, the tests for the archive feature do not work
   with bmake, but bmake's manpage and source tree seem to imply that they
   should.  So... to be investigated later; need to poke sjg@.

This, or a subsequent but related commit, broke the WITHOUT_BMAKE build:

TB --- 2014-03-25 15:10:28 - tinderbox 2.20 running on worker02.tb.des.no
TB --- 2014-03-25 15:10:28 - FreeBSD worker02.tb.des.no 9.1-RELEASE-p4 FreeBSD 
9.1-RELEASE-p4 #0: Mon Jun 17 11:42:37 UTC 2013 
r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
TB --- 2014-03-25 15:10:28 - starting HEAD tinderbox run for amd64/amd64
TB --- 2014-03-25 15:10:28 - cleaning the object tree
TB --- 2014-03-25 15:10:28 - /usr/local/bin/svn stat --no-ignore /src
TB --- 2014-03-25 15:10:47 - At svn revision 263738
TB --- 2014-03-25 15:10:48 - building world
TB --- 2014-03-25 15:10:48 - CROSS_BUILD_TESTING=YES
TB --- 2014-03-25 15:10:48 - MAKEOBJDIRPREFIX=/obj
TB --- 2014-03-25 15:10:48 - PATH=/usr/bin:/usr/sbin:/bin:/sbin
TB --- 2014-03-25 15:10:48 - SRCCONF=/dev/null
TB --- 2014-03-25 15:10:48 - TARGET=amd64
TB --- 2014-03-25 15:10:48 - TARGET_ARCH=amd64
TB --- 2014-03-25 15:10:48 - TZ=UTC
TB --- 2014-03-25 15:10:48 - WITHOUT_BMAKE=YES
TB --- 2014-03-25 15:10:48 - __MAKE_CONF=/dev/null
TB --- 2014-03-25 15:10:48 - cd /src
TB --- 2014-03-25 15:10:48 - /usr/bin/make -B buildworld
 Building an up-to-date make(1)
--
Makefile, line 121: Malformed conditional (${MK_TESTS} != no)
Makefile, line 123: if-less endif
make: fatal errors encountered -- cannot continue
*** [make] Error code 1

Stop in /src.
*** [upgrade_checks] Error code 1

Stop in /src.
TB --- 2014-03-25 15:10:48 - WARNING: /usr/bin/make returned exit code  1 
TB --- 2014-03-25 15:10:48 - ERROR: failed to build world
TB --- 2014-03-25 15:10:48 - 2.07 user 16.82 system 20.05 real
tinderbox returned exit code 1

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r256768 - head/sbin/ifconfig

2014-03-25 Thread Dag-Erling Smørgrav
Alan Somers asom...@freebsd.org writes:
 Is there any reason why this can't be MFCed to stable/9 ?

I thought I had, but apparently I only did stable/10.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r263740 - in head/sys: cam/ctl dev/iscsi

2014-03-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 25 18:30:57 2014
New Revision: 263740
URL: http://svnweb.freebsd.org/changeset/base/263740

Log:
  Use a less unusual syntax in debug printfs.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Mar 25 15:35:33 2014
(r263739)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Mar 25 18:30:57 2014
(r263740)
@@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
 maxcmdsn_delta, 256, Number of commands the initiator can send 
 without confirmation);
 
-#defineCFISCSI_DEBUG(X, ...)   \
-   if (debug  1) {\
-   printf(%s:  X \n, __func__, ## __VA_ARGS__);\
+#defineCFISCSI_DEBUG(X, ...)   
\
+   do {\
+   if (debug  1) {\
+   printf(%s:  X \n,   \
+   __func__, ## __VA_ARGS__);  \
+   }   \
} while (0)
 
-#defineCFISCSI_WARN(X, ...)\
-   if (debug  0) {\
-   printf(WARNING: %s:  X \n,  \
-   __func__, ## __VA_ARGS__);  \
+#defineCFISCSI_WARN(X, ...)
\
+   do {\
+   if (debug  0) {\
+   printf(WARNING: %s:  X \n,  \
+   __func__, ## __VA_ARGS__);  \
+   }   \
} while (0)
 
-#defineCFISCSI_SESSION_DEBUG(S, X, ...)\
-   if (debug  1) {\
-   printf(%s: %s (%s):  X \n,  \
-   __func__, S-cs_initiator_addr, \
-   S-cs_initiator_name, ## __VA_ARGS__);  \
+#defineCFISCSI_SESSION_DEBUG(S, X, ...)
\
+   do {\
+   if (debug  1) {\
+   printf(%s: %s (%s):  X \n,  \
+   __func__, S-cs_initiator_addr, \
+   S-cs_initiator_name, ## __VA_ARGS__);  \
+   }   \
} while (0)
 
-#defineCFISCSI_SESSION_WARN(S, X, ...) \
-   if (debug  0) {\
-   printf(WARNING: %s (%s):  X \n, \
-   S-cs_initiator_addr,   \
-   S-cs_initiator_name, ## __VA_ARGS__);  \
+#defineCFISCSI_SESSION_WARN(S, X, ...) 
\
+   do  {   \
+   if (debug  0) {\
+   printf(WARNING: %s (%s):  X \n, \
+   S-cs_initiator_addr,   \
+   S-cs_initiator_name, ## __VA_ARGS__);  \
+   }   \
} while (0)
 
 #define CFISCSI_SESSION_LOCK(X)mtx_lock(X-cs_lock)

Modified: head/sys/dev/iscsi/icl.c
==
--- head/sys/dev/iscsi/icl.cTue Mar 25 15:35:33 2014(r263739)
+++ head/sys/dev/iscsi/icl.cTue Mar 25 18:30:57 2014(r263740)
@@ -74,15 +74,18 @@ static uma_zone_t icl_pdu_zone;
 
 static volatile u_int  icl_ncons;
 
-#defineICL_DEBUG(X, ...)   \
-   if (debug  1) {\
-   printf(%s:  X \n, __func__, ## __VA_ARGS__);\
+#defineICL_DEBUG(X, ...)   
\
+   do {\
+   if (debug  1)  \
+   printf(%s:  X \n, __func__, ## __VA_ARGS__);\
} while (0)
 
-#defineICL_WARN(X, ...)\
-   if (debug  0) { 

Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys

2014-03-25 Thread Justin Hibbits
On Tue, Mar 25, 2014 at 2:06 AM, Alexey Dokuchaev da...@freebsd.org wrote:
 On Sun, Mar 23, 2014 at 10:58:18PM -0700, Justin Hibbits wrote:
 On Mon, 24 Mar 2014 05:44:42 + Alexey Dokuchaev wrote:
  Hmm, -CURRENT does not build for me after this commit apparently;
  take a look at the log excerpt.  Could it be that r261342 relies on
  some earlier revision which I'm missing (that is, my r260369'ish
  -CURRENT is too old)? What's the best way to catch up?  Thanks,

 It looks to me like it's picking up your old PMC header files.  Did you
 try doing a full buildworld (without a -DNO_CLEAN)?  I've built world
 multiple times since and it works just fine for me.

 It turned out to be ccache's fault.  Once I've resumed the build with
 -DNO_CLEAN -DNO_CCACHE, it finished just fine.

 ./danfe

Good to hear.  I've never used ccache myself.

- Justin
___
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: r263741 - head/sys/dev/iscsi

2014-03-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 25 19:05:05 2014
New Revision: 263741
URL: http://svnweb.freebsd.org/changeset/base/263741

Log:
  Use newly added extended LUN support in CAM.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Tue Mar 25 18:30:57 2014(r263740)
+++ head/sys/dev/iscsi/iscsi.c  Tue Mar 25 19:05:05 2014(r263741)
@@ -32,6 +32,7 @@
 #include sys/param.h
 #include sys/condvar.h
 #include sys/conf.h
+#include sys/endian.h
 #include sys/eventhandler.h
 #include sys/file.h
 #include sys/kernel.h
@@ -1817,40 +1818,6 @@ iscsi_ioctl(struct cdev *dev, u_long cmd
}
 }
 
-static uint64_t
-iscsi_encode_lun(uint32_t lun)
-{
-   uint8_t encoded[8];
-   uint64_t result;
-
-   memset(encoded, 0, sizeof(encoded));
-
-   if (lun  256) {
-   /*
-* Peripheral device addressing.
-*/
-   encoded[1] = lun;
-   } else if (lun  16384) {
-   /*
-* Flat space addressing.
-*/
-   encoded[0] = 0x40;
-   encoded[0] |= (lun  8)  0x3f;
-   encoded[1] = lun  0xff;
-   } else {
-   /*
-* Extended flat space addressing.
-*/
-   encoded[0] = 0xd2;
-   encoded[1] = lun  16;
-   encoded[2] = lun  8;
-   encoded[3] = lun;
-   }
-
-   memcpy(result, encoded, sizeof(result));
-   return (result);
-}
-
 static struct iscsi_outstanding *
 iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag)
 {
@@ -1965,7 +1932,7 @@ iscsi_action_scsiio(struct iscsi_session
 break;
 }
 
-   bhssc-bhssc_lun = iscsi_encode_lun(csio-ccb_h.target_lun);
+   bhssc-bhssc_lun = 
htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb-ccb_h.target_lun));
bhssc-bhssc_initiator_task_tag = is-is_initiator_task_tag;
is-is_initiator_task_tag++;
bhssc-bhssc_expected_data_transfer_length = htonl(csio-dxfer_len);
@@ -2037,13 +2004,11 @@ iscsi_action(struct cam_sim *sim, union 
cpi-version_num = 1;
cpi-hba_inquiry = PI_TAG_ABLE;
cpi-target_sprt = 0;
-   //cpi-hba_misc = PIM_NOBUSRESET;
-   cpi-hba_misc = 0;
+   cpi-hba_misc = PIM_EXTLUNS;
cpi-hba_eng_cnt = 0;
cpi-max_target = 0;
-   cpi-max_lun = 255;
-   //cpi-initiator_id = 0; /* XXX */
-   cpi-initiator_id = 64; /* XXX */
+   cpi-max_lun = 0;
+   cpi-initiator_id = ~0;
strlcpy(cpi-sim_vid, FreeBSD, SIM_IDLEN);
strlcpy(cpi-hba_vid, iSCSI, HBA_IDLEN);
strlcpy(cpi-dev_name, cam_sim_name(sim), DEV_IDLEN);
___
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: r263742 - head/sys/dev/iscsi

2014-03-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 25 19:09:52 2014
New Revision: 263742
URL: http://svnweb.freebsd.org/changeset/base/263742

Log:
  Fix harmless warning after reconnecting a session and not doing anything
  with it.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Tue Mar 25 19:05:05 2014(r263741)
+++ head/sys/dev/iscsi/iscsi.c  Tue Mar 25 19:09:52 2014(r263742)
@@ -1288,8 +1288,8 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
is-is_conn-ic_data_crc32c = false;
 
is-is_cmdsn = 0;
-   is-is_expcmdsn = 1;
-   is-is_maxcmdsn = 1;
+   is-is_expcmdsn = 0;
+   is-is_maxcmdsn = 0;
is-is_waiting_for_iscsid = false;
is-is_login_phase = false;
is-is_timeout = 0;
___
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: r263743 - head/sys/dev/iscsi

2014-03-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 25 19:17:22 2014
New Revision: 263743
URL: http://svnweb.freebsd.org/changeset/base/263743

Log:
  Move the ic_outstanding_count under #ifdef DIAGNOSTIC.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/icl.h

Modified: head/sys/dev/iscsi/icl.c
==
--- head/sys/dev/iscsi/icl.cTue Mar 25 19:09:52 2014(r263742)
+++ head/sys/dev/iscsi/icl.cTue Mar 25 19:17:22 2014(r263743)
@@ -138,11 +138,15 @@ icl_pdu_new(struct icl_conn *ic, int fla
 {
struct icl_pdu *ip;
 
+#ifdef DIAGNOSTIC
refcount_acquire(ic-ic_outstanding_pdus);
+#endif
ip = uma_zalloc(icl_pdu_zone, flags | M_ZERO);
if (ip == NULL) {
ICL_WARN(failed to allocate %zd bytes, sizeof(*ip));
+#ifdef DIAGNOSTIC
refcount_release(ic-ic_outstanding_pdus);
+#endif
return (NULL);
}
 
@@ -162,7 +166,9 @@ icl_pdu_free(struct icl_pdu *ip)
m_freem(ip-ip_ahs_mbuf);
m_freem(ip-ip_data_mbuf);
uma_zfree(icl_pdu_zone, ip);
+#ifdef DIAGNOSTIC
refcount_release(ic-ic_outstanding_pdus);
+#endif
 }
 
 /*
@@ -980,7 +986,9 @@ icl_conn_new(void)
mtx_init(ic-ic_lock, icl_lock, NULL, MTX_DEF);
cv_init(ic-ic_send_cv, icl_tx);
cv_init(ic-ic_receive_cv, icl_rx);
+#ifdef DIAGNOSTIC
refcount_init(ic-ic_outstanding_pdus, 0);
+#endif
ic-ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH;
 
return (ic);

Modified: head/sys/dev/iscsi/icl.h
==
--- head/sys/dev/iscsi/icl.hTue Mar 25 19:09:52 2014(r263742)
+++ head/sys/dev/iscsi/icl.hTue Mar 25 19:17:22 2014(r263743)
@@ -76,7 +76,9 @@ void  icl_pdu_free(struct icl_pdu *ip);
 struct icl_conn {
struct mtx  ic_lock;
struct socket   *ic_socket;
+#ifdef DIAGNOSTIC
volatile u_int  ic_outstanding_pdus;
+#endif
TAILQ_HEAD(, icl_pdu)   ic_to_send;
size_t  ic_receive_len;
int ic_receive_state;
___
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: r263744 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve

2014-03-25 Thread Tycho Nightingale
Author: tychon
Date: Tue Mar 25 19:20:34 2014
New Revision: 263744
URL: http://svnweb.freebsd.org/changeset/base/263744

Log:
  Move the atpit device model from userspace into vmm.ko for better
  precision and lower latency.
  
  Approved by:  grehan (co-mentor)

Added:
  head/sys/amd64/vmm/io/vatpit.c   (contents, props changed)
  head/sys/amd64/vmm/io/vatpit.h   (contents, props changed)
Deleted:
  head/usr.sbin/bhyve/pit_8254.c
  head/usr.sbin/bhyve/pit_8254.h
Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_ioport.c
  head/sys/modules/vmm/Makefile
  head/usr.sbin/bhyve/Makefile

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hTue Mar 25 19:17:22 2014
(r263743)
+++ head/sys/amd64/include/vmm.hTue Mar 25 19:20:34 2014
(r263744)
@@ -191,6 +191,7 @@ struct vmspace *vm_get_vmspace(struct vm
 int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func);
 int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func);
 struct vatpic *vm_atpic(struct vm *vm);
+struct vatpit *vm_atpit(struct vm *vm);
 
 /*
  * Inject exception 'vme' into the guest vcpu. This function returns 0 on

Added: head/sys/amd64/vmm/io/vatpit.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/amd64/vmm/io/vatpit.c  Tue Mar 25 19:20:34 2014
(r263744)
@@ -0,0 +1,370 @@
+/*-
+ * Copyright (c) 2014 Tycho Nightingale 
tycho.nighting...@pluribusnetworks.com
+ * Copyright (c) 2011 NetApp, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/types.h
+#include sys/queue.h
+#include sys/cpuset.h
+#include sys/kernel.h
+#include sys/lock.h
+#include sys/malloc.h
+#include sys/mutex.h
+#include sys/systm.h
+
+#include machine/vmm.h
+
+#include vmm_ktr.h
+#include vatpic.h
+#include vioapic.h
+#include vatpit.h
+
+static MALLOC_DEFINE(M_VATPIT, atpit, bhyve virtual atpit (8254));
+
+#defineVATPIT_LOCK(vatpit) mtx_lock_spin(((vatpit)-mtx))
+#defineVATPIT_UNLOCK(vatpit)   
mtx_unlock_spin(((vatpit)-mtx))
+#defineVATPIT_LOCKED(vatpit)   mtx_owned(((vatpit)-mtx))
+
+#defineTIMER_SEL_MASK  0xc0
+#defineTIMER_RW_MASK   0x30
+#defineTIMER_MODE_MASK 0x0f
+#defineTIMER_SEL_READBACK  0xc0
+
+#definePIT_8254_FREQ   1193182
+#defineTIMER_DIV(freq, hz) (((freq) + (hz) / 2) / (hz))
+
+struct vatpit_callout_arg {
+   struct vatpit   *vatpit;
+   int channel_num;
+};
+
+
+struct channel {
+   int mode;
+   uint16_tinitial;/* initial counter value */
+   sbintime_t  now_sbt;/* uptime when counter was loaded */
+   uint8_t cr[2];
+   uint8_t ol[2];
+   int crbyte;
+   int olbyte;
+   int frbyte;
+   struct callout  callout;
+   sbintime_t  callout_sbt;/* target time */
+   struct vatpit_callout_arg callout_arg;
+};
+
+struct vatpit {
+   struct vm   *vm;
+   struct mtx  mtx;
+
+   sbintime_t  freq_sbt;
+
+   struct channel  channel[3];
+};
+
+#defineVATPIT_CTR0(vatpit, fmt)
\
+   VM_CTR0((vatpit)-vm, fmt)
+
+#defineVATPIT_CTR1(vatpit, fmt, a1)
\
+   VM_CTR1((vatpit)-vm, fmt, a1)
+
+#define

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

2014-03-25 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Mar 25 19:28:40 2014
New Revision: 263745
URL: http://svnweb.freebsd.org/changeset/base/263745

Log:
  Target Transfer Tag is opaque; no need to htonl(3) it.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Mar 25 19:20:34 2014
(r263744)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Tue Mar 25 19:28:40 2014
(r263745)
@@ -2500,7 +2500,7 @@ cfiscsi_datamove_out(union ctl_io *io)
return;
}
cdw-cdw_ctl_io = io;
-   cdw-cdw_target_transfer_tag = htonl(target_transfer_tag);
+   cdw-cdw_target_transfer_tag = target_transfer_tag;
cdw-cdw_initiator_task_tag = bhssc-bhssc_initiator_task_tag;
 
if (cs-cs_immediate_data  icl_pdu_data_segment_length(request)  0) {
@@ -2540,7 +2540,7 @@ cfiscsi_datamove_out(union ctl_io *io)
bhsr2t-bhsr2t_flags = 0x80;
bhsr2t-bhsr2t_lun = bhssc-bhssc_lun;
bhsr2t-bhsr2t_initiator_task_tag = bhssc-bhssc_initiator_task_tag;
-   bhsr2t-bhsr2t_target_transfer_tag = htonl(target_transfer_tag);
+   bhsr2t-bhsr2t_target_transfer_tag = target_transfer_tag;
/*
 * XXX: Here we assume that cfiscsi_datamove() won't ever
 *  be running concurrently on several CPUs for a given
___
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: r252015 - in head: etc share/man/man5

2014-03-25 Thread Alan Somers
On Wed, Jun 19, 2013 at 8:29 PM, Hiroki Sato h...@freebsd.org wrote:
 Author: hrs
 Date: Thu Jun 20 02:29:49 2013
 New Revision: 252015
 URL: http://svnweb.freebsd.org/changeset/base/252015

 Log:
   - Add CIDR notation support like 192.168.1-2.10-16/24 to 
 $ifconfig_IF_aliasN.
 This is an extended version of ipv4_addr_IF which supports both IPv4 and
 IPv6, and multiple range specifications.  To avoid to generate too many
 addresses, the maximum number of the generated addresses is currently
 limited to 31.

   - Add $ifconfig_IF_aliases, which accepts multiple IP aliases in a variable.

   - ipv6_prefix_IF now supports !/64 prefix length.  In addition to the old
 64-bit format (2001:db8:1:1), a full 128-bit format like 2001:db8:1:1::/64
 is supported.

   - Replace ifconfig command with $IFCONFIG_CMD variable to support
 a dry-run mode in the future.

   - Remove IP aliases before removing all of IPv4 addresses when doing
 rc.d/netif down.

   - Add a DAD wait to network6_getladdr() because it is possible to fail to
 configure an EUI64 address when ipv6_prefix_IF is specified.

   A summary of the supported ifconfig_* variables is as follows:

# IPv4 configuration.
ifconfig_em0=inet 192.168.0.1
# IPv6 configuration.
ifconfig_em0_ipv6=inet6 2001:db8::1/64
# IPv4 address range spec.  Now deprecated.
ipv4_addr_em0=10.2.1.1-10
# IPv6 alias.
ifconfig_em0_alias0=inet6 2001:db8:5::1 prefixlen 70
# IPv4 alias.
ifconfig_em0_alias1=inet 10.2.2.1/24
# IPv4 alias with range spec w/o AF keyword (backward compat).
ifconfig_em0_alias2=10.3.1.1-10/32
# IPv6 alias with range spec.
ifconfig_em0_alias3=inet6 2001:db8:20-2f::1/64
# ifconfig_IF_aliases is just like ifconfig_IF_aliasN.
ifconfig_em0_aliases=inet 10.3.3.201-204/24 inet6 2001:db8:210-213::1/64 
 inet 10.1.1.1/24
# IPv6 alias (backward compat)
ipv6_ifconfig_em0_alias0=inet6 2001:db8:f::1/64
# IPv6 alias w/o AF keyword (backward compat)
ipv6_ifconfig_em0_alias1=2001:db8:f:1::1/64
# IPv6 prefix.
ipv6_prefix_em0=2001:db8::/64

   Tested by:Kimmo Paasiala

 Modified:
   head/etc/network.subr
   head/share/man/man5/rc.conf.5

 Modified: head/etc/network.subr
 ==
 --- head/etc/network.subr   Thu Jun 20 02:26:32 2013(r252014)
 +++ head/etc/network.subr   Thu Jun 20 02:29:49 2013(r252015)
 @@ -24,6 +24,10 @@
...
 +   for _c in $_args; do
 +   case $_c in
 +   ${_af})
 +   case $_tmpargs in
 +   ${_af}\ *-*)
 +   ifalias_af_common_handler $_if $_af $_action \
 +   `ifalias_expand_addr $_af $_action 
 ${_tmpargs#${_af}\ }`
 ;;
 -   )
...
 +   # Process the last component if any.
 +   if [ -n $_tmpargs} ]; then
 +   case $_tmpargs in
 +   ${_af}\ *-*)
 +   ifalias_af_common_handler $_if $_af $_action \
 +   `ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ 
 }`
 +   ;;

The ${_af}/ *-* globbing pattern is too greedy.  It matches -
characters that are not part of the IP address specification.  The
example I found was ifalias_af_common_handler igb1 inet -alias inet
192.168.34.45/20 fib 1 vhid 8 pass TtZeYgnyslwK6k6cItngoQAh1-E advskew
250.  Note the - in the CARP password.  This caused
ifalias_af_common_handler to get stuck in an infinite recursive loop.
In my case, the workaround was easy; I just used a CARP password with
no -.  But I can imagine other situations that might trigger this
same behavior, like ifalias_af_common_handler igb1 inet
192.168.0.2/24 -group foo.  It would be best if you tightened up the
globbing pattern.

-Alan
___
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: r263740 - in head/sys: cam/ctl dev/iscsi

2014-03-25 Thread John-Mark Gurney
Edward Tomasz Napierala wrote this message on Tue, Mar 25, 2014 at 18:30 +:
 Author: trasz
 Date: Tue Mar 25 18:30:57 2014
 New Revision: 263740
 URL: http://svnweb.freebsd.org/changeset/base/263740
 
 Log:
   Use a less unusual syntax in debug printfs.

Just for reference, this is partly a bug fix...

if { xxx } while (0)

is two statements, and if you tried to use the macros as such:
if (something)
MACRO(param)
else
somethingelse;

You would get a compile error:
t.c:11: error: expected expression before 'else'

Now it'll compile properly...

Thanks for the fix!

 @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
  maxcmdsn_delta, 256, Number of commands the initiator can send 
  without confirmation);
  
 -#define  CFISCSI_DEBUG(X, ...)   \
 - if (debug  1) {\
 - printf(%s:  X \n, __func__, ## __VA_ARGS__);\
 +#define  CFISCSI_DEBUG(X, ...)   
 \
 + do {\
 + if (debug  1) {\
 + printf(%s:  X \n,   \
 + __func__, ## __VA_ARGS__);  \
 + }   \
   } while (0)
  

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
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: r263748 - head/sys/netinet

2014-03-25 Thread Hiren Panchasara
Author: hiren
Date: Tue Mar 25 21:57:50 2014
New Revision: 263748
URL: http://svnweb.freebsd.org/changeset/base/263748

Log:
  Correct the comments as support for RFC 1644 has been removed for a long time.

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Mar 25 20:17:57 2014
(r263747)
+++ head/sys/netinet/tcp_input.cTue Mar 25 21:57:50 2014
(r263748)
@@ -1990,13 +1990,11 @@ tcp_do_segment(struct mbuf *m, struct tc
} else {
/*
 * Received initial SYN in SYN-SENT[*] state =
-* simultaneous open.  If segment contains CC option
-* and there is a cached CC, apply TAO test.
+* simultaneous open.
 * If it succeeds, connection is * half-synchronized.
 * Otherwise, do 3-way handshake:
 *SYN-SENT - SYN-RECEIVED
 *SYN-SENT* - SYN-RECEIVED*
-* If there was no CC option, clear cached CC value.
 */
tp-t_flags |= (TF_ACKNOW | TF_NEEDSYN);
tcp_timer_activate(tp, TT_REXMT, 0);
___
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: r263749 - in head: . sys/amd64/conf sys/conf sys/i386/conf sys/sparc64/conf

2014-03-25 Thread Warner Losh
Author: imp
Date: Tue Mar 25 22:08:31 2014
New Revision: 263749
URL: http://svnweb.freebsd.org/changeset/base/263749

Log:
  Rather than require a makeoptions DEBUG to get debug correct,
  add it in kern.mk, but only if we're using clang. While this
  option is supported by both clang and gcc, in the future there
  may be changes to clang which change the defaults that require
  a tweak to build our kernel such that other tools in our tree
  will work. Set a good example by forcing -gdwarf-2 only for
  clang builds, and only if the user hasn't specified another
  dwarf level already. Update UPDATING to reflect the changed
  state of affairs. This also keeps us from having to update
  all the ARM kernels to add this, and also keeps us from
  in the future having to update all the MIPS kernels and is
  one less place the user will have to know to do something
  special for clang and one less thing developers will need
  to do when moving an architecture to clang.
  
  Reviewed by:  ian@
  MFC after:1 week

Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/conf/kern.mk
  head/sys/i386/conf/GENERIC
  head/sys/i386/conf/XEN
  head/sys/sparc64/conf/GENERIC

Modified: head/UPDATING
==
--- head/UPDATING   Tue Mar 25 21:57:50 2014(r263748)
+++ head/UPDATING   Tue Mar 25 22:08:31 2014(r263749)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20140325:
+   It is no longer necessary to include the dwarf version in your DEBUG
+   options in your kernel config file. The bug that required it to be
+   placed in the config file has bene fixed. DEBUG should now just
+   contain -g. The build system will automatically update things
+   to do the right thing. Ignore the entry from 20140216.
+
 20140306:
Support for libwrap (TCP wrappers) in rpcbind was disabled by default
to improve performance.  To re-enable it, if needed, run rpcbind
@@ -44,16 +51,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler.
 
 20140216:
-   Clang and llvm have been upgraded to 3.4 release.  Please note that
-   clang 3.4 now defaults to DWARF4 debug information format when you
-   specify -g.  Since kgdb(1) only supports DWARF2, you should update any
-   customized kernel configurations which include debug information to
-   explicitly use -gdwarf-2, e.g:
+   Clang and llvm have been upgraded to 3.4 release.
+
+   Please note that clang 3.4 now defaults to DWARF4 debug information
+   format when you specify -g.  Since kgdb(1) only supports DWARF2, you
+   should update any customized kernel configurations which include debug
+   information to explicitly use -gdwarf-2, e.g:
 
  makeoptions   DEBUG=-gdwarf-2
 
This has already been applied to the appropriate GENERIC configuration
files, so if you inherit from those, no changes are required.
+   Please note: this bug has been fixed, please see 20140325.
 
 20140216:
The nve(4) driver has been removed.  Please use the nfe(4) driver

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Mar 25 21:57:50 2014(r263748)
+++ head/sys/amd64/conf/GENERIC Tue Mar 25 22:08:31 2014(r263749)
@@ -21,7 +21,7 @@
 cpuHAMMER
 ident  GENERIC
 
-makeoptionsDEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols
+makeoptionsDEBUG=-g
 makeoptionsWITH_CTF=1  # Run ctfconvert(1) for DTrace support
 
 optionsSCHED_ULE   # ULE scheduler

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Tue Mar 25 21:57:50 2014(r263748)
+++ head/sys/conf/kern.mk   Tue Mar 25 22:08:31 2014(r263749)
@@ -162,3 +162,10 @@ CFLAGS+=   -ffreestanding
 ${MACHINE_CPUARCH} != arm  ${MACHINE_CPUARCH} != mips
 CFLAGS+=   -fstack-protector
 .endif
+
+#
+# Add -gdwarf-2 when compiling -g
+#
+.if ${COMPILER_TYPE} == clang  ${CFLAGS:M-g} !=   ${CFLAGS:M-gdwarf} 
== 
+CFLAGS+=   -gdwarf-2
+.endif

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Tue Mar 25 21:57:50 2014(r263748)
+++ head/sys/i386/conf/GENERIC  Tue Mar 25 22:08:31 2014(r263749)
@@ -23,7 +23,7 @@ cpu   I586_CPU
 cpuI686_CPU
 ident  GENERIC
 
-makeoptionsDEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols
+makeoptionsDEBUG=-g
 makeoptionsWITH_CTF=1  # Run ctfconvert(1) for DTrace

svn commit: r263750 - head/sys/conf

2014-03-25 Thread Warner Losh
Author: imp
Date: Tue Mar 25 22:32:13 2014
New Revision: 263750
URL: http://svnweb.freebsd.org/changeset/base/263750

Log:
  Add a '*' to the M modifier string so we match any -gdwarf string (even
  though it works w/o it for some reason, contrary to our reading of
  make(1)). Also add a comment explaining things a bit better so there's
  one less mystery that must be answered with svn blame.
  
  Submitted by: ian@

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Tue Mar 25 22:08:31 2014(r263749)
+++ head/sys/conf/kern.mk   Tue Mar 25 22:32:13 2014(r263750)
@@ -164,8 +164,10 @@ CFLAGS+=   -fstack-protector
 .endif
 
 #
-# Add -gdwarf-2 when compiling -g
+# Add -gdwarf-2 when compiling -g on clang. The default starting in v3.4
+# is to generate DWARF version 4. However, our tools don't cope well with
+# DWARF 4, so force it to genereate DWARF2, which they understand.
 #
-.if ${COMPILER_TYPE} == clang  ${CFLAGS:M-g} !=   ${CFLAGS:M-gdwarf} 
== 
+.if ${COMPILER_TYPE} == clang  ${CFLAGS:M-g} !=   ${CFLAGS:M-gdwarf*} 
== 
 CFLAGS+=   -gdwarf-2
 .endif
___
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: r263752 - head/sys/powerpc/include

2014-03-25 Thread Warner Losh
Author: imp
Date: Tue Mar 25 22:49:33 2014
New Revision: 263752
URL: http://svnweb.freebsd.org/changeset/base/263752

Log:
  Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again.

Modified:
  head/sys/powerpc/include/psl.h

Modified: head/sys/powerpc/include/psl.h
==
--- head/sys/powerpc/include/psl.h  Tue Mar 25 22:43:34 2014
(r263751)
+++ head/sys/powerpc/include/psl.h  Tue Mar 25 22:49:33 2014
(r263752)
@@ -86,6 +86,7 @@
 /* Initial kernel MSR, use IS=1 ad DS=1. */
 #define PSL_KERNSET_INIT   (PSL_IS | PSL_DS)
 #define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE)
+#define PSL_SRR1_MASK  0xUL/* No mask on Book-E */
 #elif defined(BOOKE_PPC4XX)
 #define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE | PSL_FP)
 #define PSL_SRR1_MASK  0xUL/* No mask on Book-E */
___
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: r263752 - head/sys/powerpc/include

2014-03-25 Thread Justin Hibbits
On Tue, Mar 25, 2014 at 3:49 PM, Warner Losh i...@freebsd.org wrote:
 Author: imp
 Date: Tue Mar 25 22:49:33 2014
 New Revision: 263752
 URL: http://svnweb.freebsd.org/changeset/base/263752

 Log:
   Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again.

 Modified:
   head/sys/powerpc/include/psl.h

 Modified: head/sys/powerpc/include/psl.h
 ==
 --- head/sys/powerpc/include/psl.h  Tue Mar 25 22:43:34 2014
 (r263751)
 +++ head/sys/powerpc/include/psl.h  Tue Mar 25 22:49:33 2014
 (r263752)
 @@ -86,6 +86,7 @@
  /* Initial kernel MSR, use IS=1 ad DS=1. */
  #define PSL_KERNSET_INIT   (PSL_IS | PSL_DS)
  #define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE)
 +#define PSL_SRR1_MASK  0xUL/* No mask on Book-E */
  #elif defined(BOOKE_PPC4XX)
  #define PSL_KERNSET(PSL_CE | PSL_ME | PSL_EE | PSL_FP)
  #define PSL_SRR1_MASK  0xUL/* No mask on Book-E */


D'oh, thanks!
___
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: r263753 - head/sys/kern

2014-03-25 Thread Mateusz Guzik
Author: mjg
Date: Tue Mar 25 23:13:46 2014
New Revision: 263753
URL: http://svnweb.freebsd.org/changeset/base/263753

Log:
  Remove lockless check in devopen, while correct it does not make much sense.
  
  Suggested by: imp
  MFC after:6 days

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cTue Mar 25 22:49:33 2014(r263752)
+++ head/sys/kern/subr_bus.cTue Mar 25 23:13:46 2014(r263753)
@@ -421,8 +421,6 @@ static int
 devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
 {
 
-   if (devsoftc.inuse)
-   return (EBUSY);
mtx_lock(devsoftc.mtx);
if (devsoftc.inuse) {
mtx_unlock(devsoftc.mtx);
___
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: r263754 - head/sys/kern

2014-03-25 Thread Mateusz Guzik
Author: mjg
Date: Tue Mar 25 23:19:45 2014
New Revision: 263754
URL: http://svnweb.freebsd.org/changeset/base/263754

Log:
  Remove long obsolete sysctl hw.bus.devctl_disable.
  
  Suggested by: imp
  Relnotes: yes

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cTue Mar 25 23:13:46 2014(r263753)
+++ head/sys/kern/subr_bus.cTue Mar 25 23:19:45 2014(r263754)
@@ -355,13 +355,6 @@ device_sysctl_fini(device_t dev)
  * tested since 3.4 or 2.2.8!
  */
 
-/* Deprecated way to adjust queue length */
-static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS);
-/* XXX Need to support old-style tunable hw.bus.devctl_disable */
-SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW |
-CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, I,
-devctl disable -- deprecated);
-
 #define DEVCTL_DEFAULT_QUEUE_LEN 1000
 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS);
 static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN;
@@ -652,9 +645,9 @@ devctl_notify(const char *system, const 
  * Common routine that tries to make sending messages as easy as possible.
  * We allocate memory for the data, copy strings into that, but do not
  * free it unless there's an error.  The dequeue part of the driver should
- * free the data.  We don't send data when the device is disabled.  We do
- * send data, even when we have no listeners, because we wish to avoid
- * races relating to startup and restart of listening applications.
+ * free the data.  We don't send data when queue length is 0.  We do send
+ * data, even when we have no listeners, because we wish to avoid races
+ * relating to startup and restart of listening applications.
  *
  * devaddq is designed to string together the type of event, with the
  * object of that event, plus the plug and play info and location info
@@ -746,33 +739,6 @@ devnomatch(device_t dev)
 }
 
 static int
-sysctl_devctl_disable(SYSCTL_HANDLER_ARGS)
-{
-   struct dev_event_info *n1;
-   int dis, error;
-
-   dis = devctl_queue_length == 0;
-   error = sysctl_handle_int(oidp, dis, 0, req);
-   if (error || !req-newptr)
-   return (error);
-   mtx_lock(devsoftc.mtx);
-   if (dis) {
-   while (!TAILQ_EMPTY(devsoftc.devq)) {
-   n1 = TAILQ_FIRST(devsoftc.devq);
-   TAILQ_REMOVE(devsoftc.devq, n1, dei_link);
-   free(n1-dei_data, M_BUS);
-   free(n1, M_BUS);
-   }
-   devsoftc.queued = 0;
-   devctl_queue_length = 0;
-   } else {
-   devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN;
-   }
-   mtx_unlock(devsoftc.mtx);
-   return (0);
-}
-
-static int
 sysctl_devctl_queue(SYSCTL_HANDLER_ARGS)
 {
struct dev_event_info *n1;
___
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: r263704 - head/sys/kern

2014-03-25 Thread Mateusz Guzik
On Tue, Mar 25, 2014 at 08:03:13AM -0600, Warner Losh wrote:
 On Mar 24, 2014, at 9:28 PM, Mateusz Guzik m...@freebsd.org wrote:
  Author: mjg
  Date: Tue Mar 25 03:28:58 2014
  New Revision: 263704
  URL: http://svnweb.freebsd.org/changeset/base/263704
  
  Log:
   Make /dev/devctl mpsafe.
  
   MFC after: 1 week
  
  static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS);
  /* XXX Need to support old-style tunable hw.bus.devctl_disable */
  -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, 
  NULL,
  -0, sysctl_devctl_disable, I, devctl disable -- deprecated);
  +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW |
  +CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, I,
  +devctl disable -- deprecated”);
 
 This can likely be deleted now...
 

http://svnweb.freebsd.org/changeset/base/263754

  @@ -420,23 +420,31 @@ devinit(void)
  static int
  devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
  {
  +
  if (devsoftc.inuse)
  return (EBUSY);
 
 Why not delete these two lines? Since this isn’t a performance critical part 
 of the code,
 it is clearer and safer to just test inuse inside the locked section.
 

http://svnweb.freebsd.org/changeset/base/263753

-- 
Mateusz Guzik mjguzik gmail.com
___
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: r263755 - head/sys/kern

2014-03-25 Thread Mateusz Guzik
Author: mjg
Date: Tue Mar 25 23:30:35 2014
New Revision: 263755
URL: http://svnweb.freebsd.org/changeset/base/263755

Log:
  Document a known problem with handling the process intended to receive
  SIGIO in /dev/devctl.
  
  Suggested by: adrian
  MFC after:6 days

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cTue Mar 25 23:19:45 2014(r263754)
+++ head/sys/kern/subr_bus.cTue Mar 25 23:30:35 2014(r263755)
@@ -490,6 +490,21 @@ devioctl(struct cdev *dev, u_long cmd, c
devsoftc.nonblock = 0;
return (0);
case FIOASYNC:
+   /*
+* FIXME:
+* Since this is a simple assignment there is no guarantee that
+* devsoftc.async_proc consumers will get a valid pointer.
+*
+* Example scenario where things break (processes A and B):
+* 1. A opens devctl
+* 2. A sends fd to B
+* 3. B sets itself as async_proc
+* 4. B exits
+*
+* However, normally this requires root privileges and the only
+* in-tree consumer does not behave in a dangerous way so the
+* issue is not critical.
+*/
if (*(int*)data)
devsoftc.async_proc = td-td_proc;
else
@@ -575,6 +590,7 @@ devctl_queue_data_f(char *data, int flag
cv_broadcast(devsoftc.cv);
mtx_unlock(devsoftc.mtx);
selwakeup(devsoftc.sel);
+   /* XXX see a comment in devioctl */
p = devsoftc.async_proc;
if (p != NULL) {
PROC_LOCK(p);
___
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: r263756 - head/usr.bin/kdump

2014-03-25 Thread Maxim Sobolev
Author: sobomax
Date: Tue Mar 25 23:37:57 2014
New Revision: 263756
URL: http://svnweb.freebsd.org/changeset/base/263756

Log:
  Make `-R', `-T' and `-E' options mutially non-exclusive. It is often
  useful to see two or three types at the same time when inspecting the
  dump.
  
  MFC after:1 month
  Sponsored by: Sippy Software, Inc.

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

Modified: head/usr.bin/kdump/kdump.c
==
--- head/usr.bin/kdump/kdump.c  Tue Mar 25 23:30:35 2014(r263755)
+++ head/usr.bin/kdump/kdump.c  Tue Mar 25 23:37:57 2014(r263756)
@@ -117,6 +117,11 @@ void limitfd(int fd);
 void usage(void);
 void ioctlname(unsigned long, int);
 
+#defineTIMESTAMP_NONE  0x0
+#defineTIMESTAMP_ABSOLUTE  0x1
+#defineTIMESTAMP_ELAPSED   0x2
+#defineTIMESTAMP_RELATIVE  0x4
+
 int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
 resolv = 0, abiflag = 0;
 const char *tracefile = DEF_TRACEFILE;
@@ -254,6 +259,8 @@ main(int argc, char *argv[])
 
setlocale(LC_CTYPE, );
 
+   timestamp = TIMESTAMP_NONE;
+
while ((ch = getopt(argc,argv,f:dElm:np:AHRrsTt:)) != -1)
switch (ch) {
case 'A':
@@ -284,16 +291,16 @@ main(int argc, char *argv[])
suppressdata = 1;
break;
case 'E':
-   timestamp = 3;  /* elapsed timestamp */
+   timestamp |= TIMESTAMP_ELAPSED;
break;
case 'H':
threads = 1;
break;
case 'R':
-   timestamp = 2;  /* relative timestamp */
+   timestamp |= TIMESTAMP_RELATIVE;
break;
case 'T':
-   timestamp = 1;
+   timestamp |= TIMESTAMP_ABSOLUTE;
break;
case 't':
trpoints = getpoints(optarg);
@@ -567,7 +574,7 @@ void
 dumpheader(struct ktr_header *kth)
 {
static char unknown[64];
-   static struct timeval prevtime, temp;
+   static struct timeval prevtime, prevtime_e, temp;
const char *type;
 
switch (kth-ktr_type) {
@@ -631,19 +638,26 @@ dumpheader(struct ktr_header *kth)
else
printf(%6jd %-8.*s , (intmax_t)kth-ktr_pid, MAXCOMLEN,
kth-ktr_comm);
-   if (timestamp) {
-   if (timestamp == 3) {
-   if (prevtime.tv_sec == 0)
-   prevtime = kth-ktr_time;
-   timevalsub(kth-ktr_time, prevtime);
+if (timestamp) {
+   if (timestamp  TIMESTAMP_ABSOLUTE) {
+   printf(%jd.%06ld , (intmax_t)kth-ktr_time.tv_sec,
+   kth-ktr_time.tv_usec);
+   }
+   if (timestamp  TIMESTAMP_ELAPSED) {
+   if (prevtime_e.tv_sec == 0)
+   prevtime_e = kth-ktr_time;
+   timevalsub(kth-ktr_time, prevtime_e);
+   printf(%jd.%06ld , (intmax_t)kth-ktr_time.tv_sec,
+   kth-ktr_time.tv_usec);
+   timevaladd(kth-ktr_time, prevtime_e);
}
-   if (timestamp == 2) {
+   if (timestamp  TIMESTAMP_RELATIVE) {
temp = kth-ktr_time;
timevalsub(kth-ktr_time, prevtime);
prevtime = temp;
+   printf(%jd.%06ld , (intmax_t)kth-ktr_time.tv_sec,
+   kth-ktr_time.tv_usec);
}
-   printf(%jd.%06ld , (intmax_t)kth-ktr_time.tv_sec,
-   kth-ktr_time.tv_usec);
}
printf(%s  , type);
 }
___
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: r263757 - head/release/doc/en_US.ISO8859-1/relnotes

2014-03-25 Thread Glen Barber
Author: gjb
Date: Wed Mar 26 01:36:00 2014
New Revision: 263757
URL: http://svnweb.freebsd.org/changeset/base/263757

Log:
  Document r263754
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Tue Mar 25 
23:37:57 2014(r263756)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Wed Mar 26 
01:36:00 2014(r263757)
@@ -104,6 +104,10 @@
   sect2 xml:id=kernel
 titleKernel Changes/title
 
+para revision=263754The man.sysctl.8;
+  literalhw.bus.devctl_disable/literal has been
+  removed./para
+
 para revision=260903Support for GPS ports has been added to
   man.uhso.4;./para
 
___
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: r263758 - in head: etc/rc.d sbin/devd share/man/man4 tools/tools/sysdoc

2014-03-25 Thread Mateusz Guzik
Author: mjg
Date: Wed Mar 26 02:25:40 2014
New Revision: 263758
URL: http://svnweb.freebsd.org/changeset/base/263758

Log:
  Update userspace users of hw.bus.devctl_disable.
  
  This fixes breakage resulting from r263754.
  
  Reported by:  AN a...@neu.net
  Reviewed by:  imp
  Pointy hat to:me

Modified:
  head/etc/rc.d/devd
  head/sbin/devd/devd.cc
  head/share/man/man4/devctl.4
  head/tools/tools/sysdoc/tunables.mdoc

Modified: head/etc/rc.d/devd
==
--- head/etc/rc.d/devd  Wed Mar 26 01:36:00 2014(r263757)
+++ head/etc/rc.d/devd  Wed Mar 26 02:25:40 2014(r263758)
@@ -30,9 +30,10 @@ devd_prestart()
 {
find_pidfile
 
-   # If devd is disabled, turn it off in the kernel to avoid memory leaks.
+   # If devd is disabled, turn it off in the kernel to avoid unnecessary
+   # memory usage.
if ! checkyesno ${rcvar}; then
-   $SYSCTL hw.bus.devctl_disable=1
+   $SYSCTL hw.bus.devctl_queue=0
fi
 }
 

Modified: head/sbin/devd/devd.cc
==
--- head/sbin/devd/devd.cc  Wed Mar 26 01:36:00 2014(r263757)
+++ head/sbin/devd/devd.cc  Wed Mar 26 02:25:40 2014(r263758)
@@ -102,7 +102,7 @@ __FBSDID($FreeBSD$);
 
 #define PIPE /var/run/devd.pipe
 #define CF /etc/devd.conf
-#define SYSCTL hw.bus.devctl_disable
+#define SYSCTL hw.bus.devctl_queue
 
 /*
  * Since the client socket is nonblocking, we must increase its send buffer to
@@ -1164,9 +1164,9 @@ check_devd_enabled()
len = sizeof(val);
if (sysctlbyname(SYSCTL, val, len, NULL, 0) != 0)
errx(1, devctl sysctl missing from kernel!);
-   if (val) {
-   warnx(Setting  SYSCTL  to 0);
-   val = 0;
+   if (val == 0) {
+   warnx(Setting  SYSCTL  to 1000);
+   val = 1000;
sysctlbyname(SYSCTL, NULL, NULL, val, sizeof(val));
}
 }

Modified: head/share/man/man4/devctl.4
==
--- head/share/man/man4/devctl.4Wed Mar 26 01:36:00 2014
(r263757)
+++ head/share/man/man4/devctl.4Wed Mar 26 02:25:40 2014
(r263758)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 11, 2003
+.Dd March 26, 2014
 .Dt DEVCTL 4
 .Os
 .Sh NAME
@@ -73,9 +73,9 @@ If you try to read this device a charact
 the rest of the data.
 Listening programs are expected to cope.
 .Pp
-The sysctl and boot parameter
-.Va hw.bus.devctl_disable
-is used to disable
+The sysctl
+.Va hw.bus.devctl_queue
+can be used to control queue length. It is set to 0 to disable
 .Nm
 when no
 .Xr devd 8

Modified: head/tools/tools/sysdoc/tunables.mdoc
==
--- head/tools/tools/sysdoc/tunables.mdoc   Wed Mar 26 01:36:00 2014
(r263757)
+++ head/tools/tools/sysdoc/tunables.mdoc   Wed Mar 26 02:25:40 2014
(r263758)
@@ -233,16 +233,6 @@ See
 for more information.
 
 ---
-hw.bus.devctl_disable
-bool
-
-This can be used to turn off
-.Xr devctl 4
-when no
-.Xr devd 8 
-is running.
-

 hw.bus.devices
 
 ---
___
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: r263759 - head/usr.bin/brandelf

2014-03-25 Thread John-Mark Gurney
Author: jmg
Date: Wed Mar 26 03:18:27 2014
New Revision: 263759
URL: http://svnweb.freebsd.org/changeset/base/263759

Log:
  udpate VERY old email address.. I haven't had this email address for
  well over 8 years...
  
  roll the clock forward 16 years since there have been other changes
  deserving of a bump, but never happened..
  
  Submitted by: feld
  Obtained from:1 week

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

Modified: head/usr.bin/brandelf/brandelf.1
==
--- head/usr.bin/brandelf/brandelf.1Wed Mar 26 02:25:40 2014
(r263758)
+++ head/usr.bin/brandelf/brandelf.1Wed Mar 26 03:18:27 2014
(r263759)
@@ -23,7 +23,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 6, 1997
+.Dd March 25, 2014
 .Dt BRANDELF 1
 .Os
 .Sh NAME
@@ -101,4 +101,4 @@ manual page first appeared in
 .Fx 2.2 .
 .Sh AUTHORS
 This manual page was written by
-.An John-Mark Gurney Aq gurne...@efn.org .
+.An John-Mark Gurney Aq j...@freebsd.org .
___
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: r263740 - in head/sys: cam/ctl dev/iscsi

2014-03-25 Thread Bruce Evans

On Tue, 25 Mar 2014, John-Mark Gurney wrote:


Edward Tomasz Napierala wrote this message on Tue, Mar 25, 2014 at 18:30 +:

Author: trasz
Date: Tue Mar 25 18:30:57 2014
New Revision: 263740
URL: http://svnweb.freebsd.org/changeset/base/263740

Log:
  Use a less unusual syntax in debug printfs.


Just for reference, this is partly a bug fix...

if { xxx } while (0)

is two statements, and if you tried to use the macros as such:
if (something)
MACRO(param)
else
somethingelse;


It seems to be entirely this bug fix, except for massive churning of the
indentation.


@@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
 maxcmdsn_delta, 256, Number of commands the initiator can send 
 without confirmation);

-#defineCFISCSI_DEBUG(X, ...)   \
-   if (debug  1) { \
-   printf(%s:  X \n, __func__, ## __VA_ARGS__);\
+#defineCFISCSI_DEBUG(X, ...)   
\
+   do {\
+   if (debug  1) { \
+   printf(%s:  X \n,   \
+   __func__, ## __VA_ARGS__);  \
+   }   \
} while (0)



Normal style is as in sys/queue.h.  It doesn't make the code less
readable by pushing the non-do-while parts of it to the right, and
didn't churn the indentation when adding do-while.

Normal style is also used for the more directly related KASSERT()...

BTW, KASSERT() is still dumbed down to work KR compilers that don't
support __VA_ARGS__.  This is hard to fix since its collateral bad
syntax is used in thousands of callers.  Automatic printing of the
function names was intentionally left out of KASSERT(), so that
callers could omit it if they wanted, but this has resulted in lots
of ugly syntax and source code bloat in callers.  Here the ugly
syntax is hidden in the macro, and the bloat is mostly at runtime.

Bruce
___
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: r263760 - in head/share/man: man4 man9

2014-03-25 Thread John-Mark Gurney
Author: jmg
Date: Wed Mar 26 05:49:09 2014
New Revision: 263760
URL: http://svnweb.freebsd.org/changeset/base/263760

Log:
  fix up an old email address and drop clause 3 of my copyright...
  
  bump date..
  
  MFC after:1 week

Modified:
  head/share/man/man4/sysmouse.4
  head/share/man/man9/cd.9

Modified: head/share/man/man4/sysmouse.4
==
--- head/share/man/man4/sysmouse.4  Wed Mar 26 03:18:27 2014
(r263759)
+++ head/share/man/man4/sysmouse.4  Wed Mar 26 05:49:09 2014
(r263760)
@@ -8,9 +8,6 @@
 .\ 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.
-.\ 3. Neither the name of the author nor the names of any co-contributors
-.\may be used to endorse or promote products derived from this software
-.\without specific prior written permission.
 .\
 .\ THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' 
AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -26,7 +23,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 16, 2010
+.Dd March 25, 2014
 .Dt SYSMOUSE 4
 .Os
 .Sh NAME
@@ -471,6 +468,6 @@ driver first appeared in
 .An -nosplit
 This
 manual page was written by
-.An John-Mark Gurney Aq gurne...@efn.org
+.An John-Mark Gurney Aq j...@freebsd.org
 and
 .An Kazutaka Yokota Aq yok...@freebsd.org .

Modified: head/share/man/man9/cd.9
==
--- head/share/man/man9/cd.9Wed Mar 26 03:18:27 2014(r263759)
+++ head/share/man/man9/cd.9Wed Mar 26 05:49:09 2014(r263760)
@@ -9,9 +9,6 @@
 .\ 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.
-.\ 3. Neither the name of the author nor the names of any co-contributors
-.\may be used to endorse or promote products derived from this software
-.\without specific prior written permission.
 .\
 .\ THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' 
AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -27,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 2, 2003
+.Dd March 25, 2014
 .Dt CD 9
 .Os
 .Sh NAME
@@ -119,7 +116,7 @@ manual page first appeared in
 .An -nosplit
 This
 manual page was written by
-.An John-Mark Gurney Aq gurne...@efn.org .
+.An John-Mark Gurney Aq j...@freebsd.org .
 It was updated for CAM and
 .Fx 3.0
 by
___
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