Re: svn commit: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc

2012-01-13 Thread Sergey Kandaurov
On 13 January 2012 10:51, Kevin Lo  wrote:
> Author: kevlo
> Date: Fri Jan 13 06:51:15 2012
> New Revision: 230044
> URL: http://svn.freebsd.org/changeset/base/230044
>
> Log:
>  fgets(3) returns a pointer, so compare against NULL, not integer 0.
>
[...]
> Modified: head/usr.sbin/config/mkmakefile.c
> ==
> --- head/usr.sbin/config/mkmakefile.c   Fri Jan 13 06:18:23 2012        
> (r230043)
> +++ head/usr.sbin/config/mkmakefile.c   Fri Jan 13 06:51:15 2012        
> (r230044)
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 1993, 19801990
> + * Copyright (c) 1980, 1993

This should be rather "Copyright (c) 1980, 1990, 1993"
It was "1980,1990" until 4.4BSD-Alpha (and i386bsd),
then changed to "1993, 19801990" in 4.4BSD-Lite.

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


svn commit: r230051 - head/usr.sbin/config

2012-01-13 Thread Kevin Lo
Author: kevlo
Date: Fri Jan 13 09:08:41 2012
New Revision: 230051
URL: http://svn.freebsd.org/changeset/base/230051

Log:
  Fix copyright year
  
  Spotted by:   pluknet

Modified:
  head/usr.sbin/config/mkmakefile.c

Modified: head/usr.sbin/config/mkmakefile.c
==
--- head/usr.sbin/config/mkmakefile.c   Fri Jan 13 07:28:34 2012
(r230050)
+++ head/usr.sbin/config/mkmakefile.c   Fri Jan 13 09:08:41 2012
(r230051)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1980, 1993
+ * Copyright (c) 1980, 1990, 1993
  * The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc

2012-01-13 Thread Kevin Lo
On Fri, 2012-01-13 at 11:24 +0300, Sergey Kandaurov wrote:
> On 13 January 2012 10:51, Kevin Lo  wrote:
> > Author: kevlo
> > Date: Fri Jan 13 06:51:15 2012
> > New Revision: 230044
> > URL: http://svn.freebsd.org/changeset/base/230044
> >
> > Log:
> >  fgets(3) returns a pointer, so compare against NULL, not integer 0.
> >
> [...]
> > Modified: head/usr.sbin/config/mkmakefile.c
> > ==
> > --- head/usr.sbin/config/mkmakefile.c   Fri Jan 13 06:18:23 2012
> > (r230043)
> > +++ head/usr.sbin/config/mkmakefile.c   Fri Jan 13 06:51:15 2012
> > (r230044)
> > @@ -1,5 +1,5 @@
> >  /*
> > - * Copyright (c) 1993, 19801990
> > + * Copyright (c) 1980, 1993
> 
> This should be rather "Copyright (c) 1980, 1990, 1993"
> It was "1980,1990" until 4.4BSD-Alpha (and i386bsd),
> then changed to "1993, 19801990" in 4.4BSD-Lite.

My bad. This change should be done in a separate commit.
Just committed the fix to HEAD, thanks for pointing that out.

Kevin


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


svn commit: r230052 - head/sys/dev/netmap

2012-01-13 Thread Luigi Rizzo
Author: luigi
Date: Fri Jan 13 10:21:15 2012
New Revision: 230052
URL: http://svn.freebsd.org/changeset/base/230052

Log:
  Two performance-related fixes:
  1. as reported by Alexander Fiveg, the allocator was reporting
 half of the allocated memory. Fix this by exiting from the
 loop earlier (not too critical because this code is going
 away soon).
  
  2. following a discussion on freebsd-current
  
http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031144.html
 turns out that (re)loading the dmamap was expensive and not optimized.
 This operation is in the critical path when doing zero-copy forwarding
 between interfaces.
 At least on netmap and i386/amd64, the bus_dmamap_load can be
 completely bypassed if the map is NULL, so we do it.
  
  The latter change gives an almost 3x improvement in forwarding
  performance, from the previous 9.5Mpps at 2.9GHz to the current
  line rate (14.2Mpps) at 1.733GHz. (this is for 64+4 byte packets,
  in other configurations the PCIe bus is a bottleneck).

Modified:
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cFri Jan 13 09:08:41 2012
(r230051)
+++ head/sys/dev/netmap/netmap.cFri Jan 13 10:21:15 2012
(r230052)
@@ -426,7 +426,6 @@ netmap_dtor(void *data)
 }
 
 
-
 /*
  * Create and return a new ``netmap_if`` object, and possibly also
  * rings and packet buffors.
@@ -1393,30 +1392,6 @@ netmap_reset(struct netmap_adapter *na, 
return kring->ring->slot;
 }
 
-static void
-ns_dmamap_cb(__unused void *arg, __unused bus_dma_segment_t * segs,
-   __unused int nseg, __unused int error)
-{
-}
-
-/* unload a bus_dmamap and create a new one. Used when the
- * buffer in the slot is changed.
- * XXX buflen is probably not needed, buffers have constant size.
- */
-void
-netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf)
-{
-   bus_dmamap_unload(tag, map);
-   bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb,
-   NULL, BUS_DMA_NOWAIT);
-}
-
-void
-netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf)
-{
-   bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb,
-   NULL, BUS_DMA_NOWAIT);
-}
 
 /*-- netmap memory allocator ---*/
 /*
@@ -1541,7 +1516,7 @@ netmap_memory_init(void)
int i, n, sz = NETMAP_MEMORY_SIZE;
int extra_sz = 0; // space for rings and two spare buffers
 
-   for (; !buf && sz >= 1<<20; sz >>=1) {
+   for (; sz >= 1<<20; sz >>=1) {
extra_sz = sz/200;
extra_sz = (extra_sz + 2*PAGE_SIZE - 1) & ~(PAGE_SIZE-1);
buf = contigmalloc(sz + extra_sz,
@@ -1552,6 +1527,8 @@ netmap_memory_init(void)
 PAGE_SIZE, /* alignment */
 0 /* boundary */
);
+   if (buf)
+   break;
} 
if (buf == NULL)
return (ENOMEM);

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Fri Jan 13 09:08:41 2012
(r230051)
+++ head/sys/dev/netmap/netmap_kern.h   Fri Jan 13 10:21:15 2012
(r230052)
@@ -169,16 +169,8 @@ int netmap_start(struct ifnet *, struct 
 enum txrx { NR_RX = 0, NR_TX = 1 };
 struct netmap_slot *netmap_reset(struct netmap_adapter *na,
enum txrx tx, int n, u_int new_cur);
-void netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf);
-void netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf);
 int netmap_ring_reinit(struct netmap_kring *);
 
-/*
- * XXX eventually, get rid of netmap_total_buffers and netmap_buffer_base
- * in favour of the structure
- */
-// struct netmap_buf_pool;
-// extern struct netmap_buf_pool nm_buf_pool;
 extern u_int netmap_total_buffers;
 extern char *netmap_buffer_base;
 extern int netmap_verbose; // XXX debugging
@@ -203,6 +195,35 @@ enum {  
 #defineNA(_ifp)((struct netmap_adapter *)WNA(_ifp))
 
 
+/* Callback invoked by the dma machinery after a successfull dmamap_load */
+static void netmap_dmamap_cb(__unused void *arg,
+   __unused bus_dma_segment_t * segs, __unused int nseg, __unused int 
error)
+{
+}
+
+/* bus_dmamap_load wrapper: call aforementioned function if map != NULL.
+ * XXX can we do it without a callback ?
+ */
+static inline void
+netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf)
+{
+   if (map)
+   bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE,
+   netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT);
+}
+
+/* update the map when a buffer changes. */
+static inline void
+netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf)
+

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

2012-01-13 Thread Alexander Motin
Author: mav
Date: Fri Jan 13 10:21:17 2012
New Revision: 230053
URL: http://svn.freebsd.org/changeset/base/230053

Log:
  Add BIO_DELETE support for SCSI Direct Access devices (da).
  
  Depending on device capabilities use different methods to implement it.
  Currently used method can be read/set via kern.cam.da.X.delete_method
  sysctls. Possible values are:
   NONE - no provisioning support reported by the device;
   DISABLE - provisioning support was disabled because of errors;
   ZERO - use WRITE SAME (10) command to write zeroes;
   WS10 - use WRITE SAME (10) command with UNMAP bit set;
   WS16 - use WRITE SAME (16) command with UNMAP bit set;
   UNMAP - use UNMAP command (equivalent of the ATA DSM TRIM command).
  The last two methods (UNMAP and WS16) are defined by SBC specification and
  the UNMAP method is the most advanced one. The rest of methods I've found
  supported in Linux, and as soon as they were trivial to implement, then
  why not? Hope they will be useful in some cases.
  
  Unluckily I have no devices properly reporting parameters of the logical
  block provisioning support via respective VPD pages (0xB0 and 0xB2). So
  all info I have/use now is the flag telling whether logical block
  provisioning is supported or not. As result, specific methods chosen now
  by trying different ones in order (UNMAP, WS16, DISABLE) and checking
  completion status to fallback if needed. I don't expect problems from this,
  as if something go wrong, it should just disable itself. It may disable
  even too aggressively if only some command parameter misfit.
  
  Unlike Linux, which executes each delete with separate request, I've
  implemented here the same request aggregation as implemented in ada driver.
  Tests on SSDs I have show much better results doing it this way: above
  8GB/s of the linear delete on Intel SATA SSD on LSI SAS HBA (mps).
  
  Reviewed by:  silence on scsi@
  MFC after:2 month
  Sponsored by: iXsystems, Inc.

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

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cFri Jan 13 10:21:15 2012
(r230052)
+++ head/sys/cam/scsi/scsi_all.cFri Jan 13 10:21:17 2012
(r230053)
@@ -364,6 +364,8 @@ static struct op_table_entry scsi_op_cod
{ 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" },
/* 41  O   WRITE SAME(10) */
{ 0x41, D, "WRITE SAME(10)" },
+   /* 42   O  UNMAP */
+   { 0x42, D, "UNMAP" },
/* 42   O  READ SUB-CHANNEL */
{ 0x42, R, "READ SUB-CHANNEL" },
/* 43   O  READ TOC/PMA/ATIP */
@@ -5570,6 +5572,104 @@ scsi_read_write(struct ccb_scsiio *csio,
 }
 
 void
+scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries,
+   void (*cbfcnp)(struct cam_periph *, union ccb *),
+   u_int8_t tag_action, u_int8_t byte2,
+   int minimum_cmd_size, u_int64_t lba, u_int32_t block_count,
+   u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len,
+   u_int32_t timeout)
+{
+   u_int8_t cdb_len;
+   if ((minimum_cmd_size < 16) &&
+   ((block_count & 0x) == block_count) &&
+   ((lba & 0x) == lba)) {
+   /*
+* Need a 10 byte cdb.
+*/
+   struct scsi_write_same_10 *scsi_cmd;
+
+   scsi_cmd = (struct scsi_write_same_10 *)&csio->cdb_io.cdb_bytes;
+   scsi_cmd->opcode = WRITE_SAME_10;
+   scsi_cmd->byte2 = byte2;
+   scsi_ulto4b(lba, scsi_cmd->addr);
+   scsi_cmd->group = 0;
+   scsi_ulto2b(block_count, scsi_cmd->length);
+   scsi_cmd->control = 0;
+   cdb_len = sizeof(*scsi_cmd);
+
+   CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE,
+ ("10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->addr[0],
+  scsi_cmd->addr[1], scsi_cmd->addr[2],
+  scsi_cmd->addr[3], scsi_cmd->length[0],
+  scsi_cmd->length[1], dxfer_len));
+   } else {
+   /*
+* 16 byte CDB.  We'll only get here if the LBA is larger
+* than 2^32, or if the user asks for a 16 byte command.
+*/
+   struct scsi_write_same_16 *scsi_cmd;
+
+   scsi_cmd = (struct scsi_write_same_16 *)&csio->cdb_io.cdb_bytes;
+   scsi_cmd->opcode = WRITE_SAME_16;
+   scsi_cmd->byte2 = byte2;
+   scsi_u64to8b(lba, scsi_cmd->addr);
+   scsi_ulto4b(block_count, scsi_cmd->length);
+   scsi_cmd->group = 0;
+   scsi_cmd->control = 0;
+   cdb_len = sizeof(*scsi_cmd);
+
+   CAM_DEBUG(csio->ccb_h.path, CAM_D

svn commit: r230054 - stable/9/share/man/man9

2012-01-13 Thread Jaakko Heinonen
Author: jh
Date: Fri Jan 13 10:54:26 2012
New Revision: 230054
URL: http://svn.freebsd.org/changeset/base/230054

Log:
  MFC r228358:
  
  - Fix markup.
  - Remove trailing whitespace.
  
  MFC r228359:
  
  sbuf_data() hasn't returned NULL for overflowed buffers since r71721.
  
  MFC r228784:
  
  Follow style(9) more closely in the example.

Modified:
  stable/9/share/man/man9/sbuf.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/sbuf.9
==
--- stable/9/share/man/man9/sbuf.9  Fri Jan 13 10:21:17 2012
(r230053)
+++ stable/9/share/man/man9/sbuf.9  Fri Jan 13 10:54:26 2012
(r230054)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2011
+.Dd December 21, 2011
 .Dt SBUF 9
 .Os
 .Sh NAME
@@ -117,7 +117,7 @@ defined in
 .Pp
 Any errors encountered during the allocation or composition of the
 string will be latched in the data structure,
-making a single error test at the end of the composition 
+making a single error test at the end of the composition
 sufficient to determine success or failure of the entire process.
 .Pp
 The
@@ -391,7 +391,8 @@ function returns the actual string;
 only works on a finished
 .Fa sbuf .
 The
-.Fn sbuf_len function returns the length of the string.
+.Fn sbuf_len
+function returns the length of the string.
 For an
 .Fa sbuf
 with an attached drain,
@@ -462,12 +463,8 @@ function returns a non-zero value if the
 drain error, and zero otherwise.
 .Pp
 The
-.Fn sbuf_data
-and
 .Fn sbuf_len
-functions return
-.Dv NULL
-and \-1, respectively, if the buffer overflowed.
+function returns \-1 if the buffer overflowed.
 .Pp
 The
 .Fn sbuf_copyin
@@ -482,7 +479,7 @@ being finished,
 or returns the error code from the drain if one is attached.
 .Pp
 The
-.Fn sbuf_finish 3 
+.Fn sbuf_finish 3
 function (the userland version)
 will return zero for success and \-1 and set errno on error.
 .Sh EXAMPLES
@@ -498,8 +495,8 @@ TAILQ_FOREACH(foo, &foolist, list) {
sbuf_printf(sb, "  Address: %s\en", foo->address);
sbuf_printf(sb, "  Zip: %s\en", foo->zipcode);
 }
-if (sbuf_finish(sb)) /* Check for any and all errors */
-   err(1,"Could not generate message");
+if (sbuf_finish(sb) != 0) /* Check for any and all errors */
+   err(1, "Could not generate message");
 transmit_msg(sbuf_data(sb), sbuf_len(sb));
 sbuf_delete(sb);
 .Ed
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230055 - head/sys/dev/netmap

2012-01-13 Thread Luigi Rizzo
Author: luigi
Date: Fri Jan 13 11:01:23 2012
New Revision: 230055
URL: http://svn.freebsd.org/changeset/base/230055

Log:
  fix indentation

Modified:
  head/sys/dev/netmap/if_re_netmap.h

Modified: head/sys/dev/netmap/if_re_netmap.h
==
--- head/sys/dev/netmap/if_re_netmap.h  Fri Jan 13 10:54:26 2012
(r230054)
+++ head/sys/dev/netmap/if_re_netmap.h  Fri Jan 13 11:01:23 2012
(r230055)
@@ -25,7 +25,7 @@
 
 /*
  * $FreeBSD$
- * $Id: if_re_netmap.h 9802 2011-12-02 18:42:37Z luigi $
+ * $Id: if_re_netmap.h 10075 2011-12-25 22:55:48Z luigi $
  *
  * netmap support for if_re
  */
@@ -409,7 +409,7 @@ re_netmap_rx_init(struct rl_softc *sc)
addr = PNMB(slot + l, &paddr);
 
netmap_reload_map(sc->rl_ldata.rl_rx_mtag,
-   sc->rl_ldata.rl_rx_desc[i].rx_dmamap, addr);
+   sc->rl_ldata.rl_rx_desc[i].rx_dmamap, addr);
bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag,
sc->rl_ldata.rl_rx_desc[i].rx_dmamap, BUS_DMASYNC_PREREAD);
desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230056 - stable/8/share/man/man9

2012-01-13 Thread Jaakko Heinonen
Author: jh
Date: Fri Jan 13 11:06:31 2012
New Revision: 230056
URL: http://svn.freebsd.org/changeset/base/230056

Log:
  Partially MFC r228358: Fix markup.

Modified:
  stable/8/share/man/man9/sbuf.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/sbuf.9
==
--- stable/8/share/man/man9/sbuf.9  Fri Jan 13 11:01:23 2012
(r230055)
+++ stable/8/share/man/man9/sbuf.9  Fri Jan 13 11:06:31 2012
(r230056)
@@ -380,7 +380,8 @@ function returns the actual string;
 only works on a finished
 .Fa sbuf .
 The
-.Fn sbuf_len function returns the length of the string.
+.Fn sbuf_len
+function returns the length of the string.
 For an
 .Fa sbuf
 with an attached drain,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230057 - stable/8/share/man/man9

2012-01-13 Thread Jaakko Heinonen
Author: jh
Date: Fri Jan 13 11:10:17 2012
New Revision: 230057
URL: http://svn.freebsd.org/changeset/base/230057

Log:
  MFC r228359:
  
  sbuf_data() hasn't returned NULL for overflowed buffers since r71721.

Modified:
  stable/8/share/man/man9/sbuf.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/sbuf.9
==
--- stable/8/share/man/man9/sbuf.9  Fri Jan 13 11:06:31 2012
(r230056)
+++ stable/8/share/man/man9/sbuf.9  Fri Jan 13 11:10:17 2012
(r230057)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2011
+.Dd December 9, 2011
 .Dt SBUF 9
 .Os
 .Sh NAME
@@ -456,12 +456,8 @@ function
 returns a non-zero value if the buffer overflowed, and zero otherwise.
 .Pp
 The
-.Fn sbuf_data
-and
 .Fn sbuf_len
-functions return
-.Dv NULL
-and \-1, respectively, if the buffer overflowed.
+function returns \-1 if the buffer overflowed.
 .Pp
 The
 .Fn sbuf_copyin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230058 - head/sys/dev/netmap

2012-01-13 Thread Luigi Rizzo
Author: luigi
Date: Fri Jan 13 11:58:06 2012
New Revision: 230058
URL: http://svn.freebsd.org/changeset/base/230058

Log:
  indentation and whitespace fixes

Modified:
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cFri Jan 13 11:10:17 2012
(r230057)
+++ head/sys/dev/netmap/netmap.cFri Jan 13 11:58:06 2012
(r230058)
@@ -1056,6 +1056,7 @@ netmap_poll(__unused struct cdev *dev, i
struct netmap_kring *kring;
u_int core_lock, i, check_all, want_tx, want_rx, revents = 0;
void *adapter;
+   enum {NO_CL, NEED_CL, LOCKED_CL }; /* see below */
 
if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL)
return POLLERR;
@@ -1130,8 +1131,7 @@ netmap_poll(__unused struct cdev *dev, i
 *  to remember to release the lock once done.
 * LOCKED_CLcore lock is set, so we need to release it.
 */
-   enum {NO_CL, NEED_CL, LOCKED_CL };
-   core_lock = (check_all || !na->separate_locks) ?  NEED_CL:NO_CL;
+   core_lock = (check_all || !na->separate_locks) ? NEED_CL : NO_CL;
/*
 * We start with a lock free round which is good if we have
 * data available. If this fails, then lock and call the sync

Modified: head/sys/dev/netmap/netmap_kern.h
==
--- head/sys/dev/netmap/netmap_kern.h   Fri Jan 13 11:10:17 2012
(r230057)
+++ head/sys/dev/netmap/netmap_kern.h   Fri Jan 13 11:58:06 2012
(r230058)
@@ -39,13 +39,13 @@ MALLOC_DECLARE(M_NETMAP);
 #endif
 
 #define ND(format, ...)
-#define D(format, ...) \
-   do {\
-   struct timeval __xxts;  \
+#define D(format, ...) \
+   do {\
+   struct timeval __xxts;  \
microtime(&__xxts); \
-   printf("%03d.%06d %s [%d] " format "\n",\
-   (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \
-   __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+   printf("%03d.%06d %s [%d] " format "\n",\
+   (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \
+   __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
  
 struct netmap_adapter;
@@ -197,7 +197,7 @@ enum {  
 
 /* Callback invoked by the dma machinery after a successfull dmamap_load */
 static void netmap_dmamap_cb(__unused void *arg,
-   __unused bus_dma_segment_t * segs, __unused int nseg, __unused int 
error)
+__unused bus_dma_segment_t * segs, __unused int nseg, __unused int error)
 {
 }
 
@@ -209,7 +209,7 @@ netmap_load_map(bus_dma_tag_t tag, bus_d
 {
if (map)
bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE,
-   netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT);
+   netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT);
 }
 
 /* update the map when a buffer changes. */
@@ -219,7 +219,7 @@ netmap_reload_map(bus_dma_tag_t tag, bus
if (map) {
bus_dmamap_unload(tag, map);
bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE,
-   netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT);
+   netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT);
}
 }
 
@@ -227,7 +227,6 @@ netmap_reload_map(bus_dma_tag_t tag, bus
 /*
  * NMB return the virtual address of a buffer (buffer 0 on bad index)
  * PNMB also fills the physical address
- * XXX this is a special version with hardwired 2k bufs
  */
 static inline void *
 NMB(struct netmap_slot *slot)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230059 - head/sbin/geom/class/part

2012-01-13 Thread Dag-Erling Smorgrav
Author: des
Date: Fri Jan 13 12:40:33 2012
New Revision: 230059
URL: http://svn.freebsd.org/changeset/base/230059

Log:
  Provide a better explanation for the sizing of the boot partition, and
  reduce the size of the partition in the example from 128 blocks to 94
  blocks so it will end on a 128-block boundary.  Also remove the -b
  option from the next example.
  
  MFC after:3 weeks

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==
--- head/sbin/geom/class/part/gpart.8   Fri Jan 13 11:58:06 2012
(r230058)
+++ head/sbin/geom/class/part/gpart.8   Fri Jan 13 12:40:33 2012
(r230059)
@@ -960,17 +960,21 @@ partition that can boot
 from a
 .Cm freebsd-ufs
 partition, and install bootstrap code into it.
-This partition must be larger than
-.Pa /boot/gptboot ,
-or the GPT boot you are planning to write, but smaller than 545 KB.
-A size of 15 blocks (7680 bytes) would be sufficient for
-booting from UFS but 128 blocks (64 KB) is used in
-this example to reserve some space for potential
-future need (e.g.\& a larger
+This partition must be larger than the bootstrap code
+.Po
+usually either
+.Pa /boot/gptboot
+or
 .Pa /boot/gptzfsboot
-for booting from a ZFS partition).
+.Pc ,
+but smaller than 545 kB since the first-stage loader will load the
+entire partition into memory during boot, regardless of how much data
+it actually contains.
+This example uses 94 blocks (47 kB) so the next partition will be
+aligned on a 64 kB boundary without the need to specify an explicit
+offset or alignment.
 .Bd -literal -offset indent
-/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0
+/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0
 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0
 .Ed
 .Pp
@@ -978,7 +982,7 @@ Create a 512MB-sized
 .Cm freebsd-ufs
 partition to contain a UFS filesystem from which the system can boot.
 .Bd -literal -offset indent
-/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0
+/sbin/gpart add -s 512M -t freebsd-ufs ad0
 .Ed
 .Pp
 Create an MBR scheme on
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230060 - in head: . lib/libc/gen tools/build/options usr.bin usr.bin/wtmpcvt

2012-01-13 Thread Ed Schouten
Author: ed
Date: Fri Jan 13 15:40:49 2012
New Revision: 230060
URL: http://svn.freebsd.org/changeset/base/230060

Log:
  Remove wtmpcvt(1).
  
  The wtmpcvt(1) utility converts wtmp files to the new format used by
  utmpx(3). Now that HEAD has been branched to stable/9 and 9.0 is
  released, there is no need for it in HEAD.
  
  MFC after:never

Deleted:
  head/usr.bin/wtmpcvt/
Modified:
  head/ObsoleteFiles.inc
  head/lib/libc/gen/getutxent.3
  head/tools/build/options/WITHOUT_UTMPX
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Jan 13 12:40:33 2012(r230059)
+++ head/ObsoleteFiles.inc  Fri Jan 13 15:40:49 2012(r230060)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20120113: removal of wtmpcvt(1)
+OLD_FILES+=usr/bin/wtmpcvt
+OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz
 # 20111214: eventtimers(7) moved to eventtimers(4)
 OLD_FILES+=usr/share/man/man7/eventtimers.7.gz
 # 2025: amd(4) removed

Modified: head/lib/libc/gen/getutxent.3
==
--- head/lib/libc/gen/getutxent.3   Fri Jan 13 12:40:33 2012
(r230059)
+++ head/lib/libc/gen/getutxent.3   Fri Jan 13 15:40:49 2012
(r230060)
@@ -418,7 +418,6 @@ The file format is invalid.
 .Sh SEE ALSO
 .Xr last 1 ,
 .Xr write 1 ,
-.Xr wtmpcvt 1 ,
 .Xr getpid 2 ,
 .Xr gettimeofday 2 ,
 .Xr tty 4 ,

Modified: head/tools/build/options/WITHOUT_UTMPX
==
--- head/tools/build/options/WITHOUT_UTMPX  Fri Jan 13 12:40:33 2012
(r230059)
+++ head/tools/build/options/WITHOUT_UTMPX  Fri Jan 13 15:40:49 2012
(r230060)
@@ -3,7 +3,6 @@ Set to not build user accounting tools s
 .Xr last 1 ,
 .Xr users 1 ,
 .Xr who 1 ,
-.Xr wtmpcvt 1 ,
 .Xr ac 8 ,
 .Xr lastlogin 8
 and

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Fri Jan 13 12:40:33 2012(r230059)
+++ head/usr.bin/Makefile   Fri Jan 13 15:40:49 2012(r230060)
@@ -340,7 +340,6 @@ SUBDIR+=usbhidctl
 SUBDIR+=   last
 SUBDIR+=   users
 SUBDIR+=   who
-SUBDIR+=   wtmpcvt
 .endif
 
 .include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2012-01-13 Thread Ed Schouten
Author: ed
Date: Fri Jan 13 15:43:01 2012
New Revision: 230061
URL: http://svn.freebsd.org/changeset/base/230061

Log:
  Regenerate src.conf(5).

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

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Fri Jan 13 15:40:49 2012
(r230060)
+++ head/share/man/man5/src.conf.5  Fri Jan 13 15:43:01 2012
(r230061)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z 
ru
 .\" $FreeBSD$
-.Dd December 30, 2011
+.Dd January 13, 2012
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -252,7 +252,7 @@ Set to build some programs without optio
 Set to not build
 .Xr calendar 1 .
 .It Va WITHOUT_CAPSICUM
-.\" $FreeBSD$
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 
21:57:58Z rwatson
 Set to not build Capsicum support into system programs.
 .It Va WITHOUT_CDDL
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 
09:02:11Z jb
@@ -930,12 +930,11 @@ When set, it also enforces the following
 .\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 
07:50:50Z ru
 Set to not build USB-related programs and libraries.
 .It Va WITHOUT_UTMPX
-.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 223209 2011-06-17 
21:30:21Z ed
+.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 230060 2012-01-13 
15:40:49Z ed
 Set to not build user accounting tools such as
 .Xr last 1 ,
 .Xr users 1 ,
 .Xr who 1 ,
-.Xr wtmpcvt 1 ,
 .Xr ac 8 ,
 .Xr lastlogin 8
 and
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230062 - head/include

2012-01-13 Thread Ed Schouten
Author: ed
Date: Fri Jan 13 16:01:34 2012
New Revision: 230062
URL: http://svn.freebsd.org/changeset/base/230062

Log:
  Correct mistake in atomic_flag macros.
  
  The _explicit versions only have two parameters, namely the object and
  the order. There is no need to pass the values of the atomic variable.

Modified:
  head/include/stdatomic.h

Modified: head/include/stdatomic.h
==
--- head/include/stdatomic.hFri Jan 13 15:43:01 2012(r230061)
+++ head/include/stdatomic.hFri Jan 13 16:01:34 2012(r230062)
@@ -325,9 +325,8 @@ typedef atomic_bool atomic_flag;
atomic_compare_exchange_strong_explicit(object, 0, 1, order, order)
 
 #defineatomic_flag_clear(object)   
\
-   atomic_flag_clear_explicit(object, 0, memory_order_seq_cst)
+   atomic_flag_clear_explicit(object, memory_order_seq_cst)
 #defineatomic_flag_test_and_set(object)
\
-   atomic_flag_test_and_set_explicit(object, 0, 1, \
-   memory_order_seq_cst, memory_order_seq_cst)
+   atomic_flag_test_and_set_explicit(object, memory_order_seq_cst)
 
 #endif /* !_STDATOMIC_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230063 - head/sys/dev/hwpmc

2012-01-13 Thread George V. Neville-Neil
Author: gnn
Date: Fri Jan 13 17:13:46 2012
New Revision: 230063
URL: http://svn.freebsd.org/changeset/base/230063

Log:
  Clean up a switch statement for uncore events on Westmere processors.
  
  Submitted by: Davide Italiano
  Reviewed by:  gnn
  MFC after:1 week

Modified:
  head/sys/dev/hwpmc/hwpmc_uncore.c
  head/sys/dev/hwpmc/hwpmc_uncore.h

Modified: head/sys/dev/hwpmc/hwpmc_uncore.c
==
--- head/sys/dev/hwpmc/hwpmc_uncore.c   Fri Jan 13 16:01:34 2012
(r230062)
+++ head/sys/dev/hwpmc/hwpmc_uncore.c   Fri Jan 13 17:13:46 2012
(r230063)
@@ -974,26 +974,18 @@ ucp_start_pmc(int cpu, int ri)
/* Event specific configuration. */
switch (pm->pm_event) {
case PMC_EV_UCP_EVENT_0CH_04H_E:
+   case PMC_EV_UCP_EVENT_0CH_08H_E:
wrmsr(MSR_GQ_SNOOP_MESF,0x2);
break;
case PMC_EV_UCP_EVENT_0CH_04H_F:
+   case PMC_EV_UCP_EVENT_0CH_08H_F:
wrmsr(MSR_GQ_SNOOP_MESF,0x8);
break;
case PMC_EV_UCP_EVENT_0CH_04H_M:
-   wrmsr(MSR_GQ_SNOOP_MESF,0x1);
-   break;
-   case PMC_EV_UCP_EVENT_0CH_04H_S:
-   wrmsr(MSR_GQ_SNOOP_MESF,0x4);
-   break;
-   case PMC_EV_UCP_EVENT_0CH_08H_E:
-   wrmsr(MSR_GQ_SNOOP_MESF,0x2);
-   break;
-   case PMC_EV_UCP_EVENT_0CH_08H_F:
-   wrmsr(MSR_GQ_SNOOP_MESF,0x8);
-   break;  
case PMC_EV_UCP_EVENT_0CH_08H_M:
wrmsr(MSR_GQ_SNOOP_MESF,0x1);
break;
+   case PMC_EV_UCP_EVENT_0CH_04H_S:
case PMC_EV_UCP_EVENT_0CH_08H_S:
wrmsr(MSR_GQ_SNOOP_MESF,0x4);
break;

Modified: head/sys/dev/hwpmc/hwpmc_uncore.h
==
--- head/sys/dev/hwpmc/hwpmc_uncore.h   Fri Jan 13 16:01:34 2012
(r230062)
+++ head/sys/dev/hwpmc/hwpmc_uncore.h   Fri Jan 13 17:13:46 2012
(r230063)
@@ -87,7 +87,6 @@ struct pmc_md_ucp_op_pmcallocate {
 #defineUC_GLOBAL_CTRL  0x391
 #defineUC_GLOBAL_OVF_CTRL  0x393
 
-
 #defineUC_GLOBAL_STATUS_FLAG_CLRCHG(1ULL << 63)
 #defineUC_GLOBAL_STATUS_FLAG_OVFPMI(1ULL << 61)
 #defineUC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230064 - head/sys/geom/part

2012-01-13 Thread Don Lewis
Author: truckman
Date: Fri Jan 13 18:32:56 2012
New Revision: 230064
URL: http://svn.freebsd.org/changeset/base/230064

Log:
  Allow an MBR primary or extended Linux swap partition to be specified
  as the system dump device.  This was already allowed for GPT.  The Linux
  swap metadata at the beginning of the partition should not be disturbed
  because the crash dump is written at the end.
  
  Reviewed by:  alfred, pjd, marcel
  MFC after:2 weeks

Modified:
  head/sys/geom/part/g_part_ebr.c
  head/sys/geom/part/g_part_mbr.c

Modified: head/sys/geom/part/g_part_ebr.c
==
--- head/sys/geom/part/g_part_ebr.c Fri Jan 13 17:13:46 2012
(r230063)
+++ head/sys/geom/part/g_part_ebr.c Fri Jan 13 18:32:56 2012
(r230064)
@@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *t
 {
struct g_part_ebr_entry *entry;
 
-   /* Allow dumping to a FreeBSD partition only. */
+   /* Allow dumping to a FreeBSD partition or Linux swap partition only. */
entry = (struct g_part_ebr_entry *)baseentry;
-   return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+   return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+   entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
 }
 
 #if defined(GEOM_PART_EBR_COMPAT)

Modified: head/sys/geom/part/g_part_mbr.c
==
--- head/sys/geom/part/g_part_mbr.c Fri Jan 13 17:13:46 2012
(r230063)
+++ head/sys/geom/part/g_part_mbr.c Fri Jan 13 18:32:56 2012
(r230064)
@@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *t
 {
struct g_part_mbr_entry *entry;
 
-   /* Allow dumping to a FreeBSD partition only. */
+   /* Allow dumping to a FreeBSD partition or Linux swap partition only. */
entry = (struct g_part_mbr_entry *)baseentry;
-   return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
+   return ((entry->ent.dp_typ == DOSPTYP_386BSD ||
+   entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230065 - in stable/9: sys/boot/i386/boot0 usr.sbin/boot0cfg

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:49:04 2012
New Revision: 230065
URL: http://svn.freebsd.org/changeset/base/230065

Log:
  MFC 228738:
  Allow boot0cfg to force a PXE boot via boot0 on the next boot.
  - Fix boot0 to check for PXE when using the pre-set setting for the
preferred slice.
  - Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
instead of a number for the 's' option as a way to select PXE as well.

Modified:
  stable/9/sys/boot/i386/boot0/boot0.S
  stable/9/usr.sbin/boot0cfg/boot0cfg.8
  stable/9/usr.sbin/boot0cfg/boot0cfg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/usr.sbin/boot0cfg/   (props changed)

Modified: stable/9/sys/boot/i386/boot0/boot0.S
==
--- stable/9/sys/boot/i386/boot0/boot0.SFri Jan 13 18:32:56 2012
(r230064)
+++ stable/9/sys/boot/i386/boot0/boot0.SFri Jan 13 18:49:04 2012
(r230065)
@@ -413,6 +413,7 @@ got_key:
3:
 #endif /* ONLY_F_KEYS */
 #endif /* SIO */
+check_selection:
cmpb $0x5,%al   # F1..F6 or 1..6 ?
 #ifdef PXE /* enable PXE/INT18 using F6 */
jne 1f;
@@ -421,7 +422,6 @@ got_key:
 #endif /* PXE */
jae beep# Not in F1..F5, beep
 
-check_selection:
/*
 * We have a selection.  If it's a bad selection go back to complain.
 * The bits in MNUOPT were set when the options were printed.

Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8
==
--- stable/9/usr.sbin/boot0cfg/boot0cfg.8   Fri Jan 13 18:32:56 2012
(r230064)
+++ stable/9/usr.sbin/boot0cfg/boot0cfg.8   Fri Jan 13 18:49:04 2012
(r230065)
@@ -146,6 +146,9 @@ Set the default boot selection to
 .Ar slice .
 Values between 1 and 4 refer to slices; a value of 5 refers to the
 option of booting from a second disk.
+The special string
+.Dq PXE
+or a value of 6 can be used to boot via PXE.
 .It Fl t Ar ticks
 Set the timeout value to
 .Ar ticks .

Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c
==
--- stable/9/usr.sbin/boot0cfg/boot0cfg.c   Fri Jan 13 18:32:56 2012
(r230064)
+++ stable/9/usr.sbin/boot0cfg/boot0cfg.c   Fri Jan 13 18:49:04 2012
(r230065)
@@ -168,7 +168,10 @@ main(int argc, char *argv[])
 o_flag = 1;
 break;
 case 's':
-s_arg = argtoi(optarg, 1, 5, 's');
+   if (strcasecmp(optarg, "pxe") == 0)
+   s_arg = 6;
+   else
+   s_arg = argtoi(optarg, 1, 6, 's');
 break;
 case 't':
 t_arg = argtoi(optarg, 1, 0x, 't');
@@ -441,8 +444,10 @@ display_mbr(u_int8_t *mbr)
 printf("default_selection=F%d (", mbr[OFF_OPT] + 1);
 if (mbr[OFF_OPT] < 4)
printf("Slice %d", mbr[OFF_OPT] + 1);
-else
+else if (mbr[OFF_OPT] == 4)
printf("Drive 1");
+else
+   printf("PXE");
 printf(")\n");
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230066 - in stable/8: sys/boot/i386/boot0 usr.sbin/boot0cfg

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:49:28 2012
New Revision: 230066
URL: http://svn.freebsd.org/changeset/base/230066

Log:
  MFC 228738:
  Allow boot0cfg to force a PXE boot via boot0 on the next boot.
  - Fix boot0 to check for PXE when using the pre-set setting for the
preferred slice.
  - Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
instead of a number for the 's' option as a way to select PXE as well.

Modified:
  stable/8/sys/boot/i386/boot0/boot0.S
  stable/8/usr.sbin/boot0cfg/boot0cfg.8
  stable/8/usr.sbin/boot0cfg/boot0cfg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/usr.sbin/boot0cfg/   (props changed)

Modified: stable/8/sys/boot/i386/boot0/boot0.S
==
--- stable/8/sys/boot/i386/boot0/boot0.SFri Jan 13 18:49:04 2012
(r230065)
+++ stable/8/sys/boot/i386/boot0/boot0.SFri Jan 13 18:49:28 2012
(r230066)
@@ -413,6 +413,7 @@ got_key:
3:
 #endif /* ONLY_F_KEYS */
 #endif /* SIO */
+check_selection:
cmpb $0x5,%al   # F1..F6 or 1..6 ?
 #ifdef PXE /* enable PXE/INT18 using F6 */
jne 1f;
@@ -421,7 +422,6 @@ got_key:
 #endif /* PXE */
jae beep# Not in F1..F5, beep
 
-check_selection:
/*
 * We have a selection.  If it's a bad selection go back to complain.
 * The bits in MNUOPT were set when the options were printed.

Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.8
==
--- stable/8/usr.sbin/boot0cfg/boot0cfg.8   Fri Jan 13 18:49:04 2012
(r230065)
+++ stable/8/usr.sbin/boot0cfg/boot0cfg.8   Fri Jan 13 18:49:28 2012
(r230066)
@@ -146,6 +146,9 @@ Set the default boot selection to
 .Ar slice .
 Values between 1 and 4 refer to slices; a value of 5 refers to the
 option of booting from a second disk.
+The special string
+.Dq PXE
+or a value of 6 can be used to boot via PXE.
 .It Fl t Ar ticks
 Set the timeout value to
 .Ar ticks .

Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.c
==
--- stable/8/usr.sbin/boot0cfg/boot0cfg.c   Fri Jan 13 18:49:04 2012
(r230065)
+++ stable/8/usr.sbin/boot0cfg/boot0cfg.c   Fri Jan 13 18:49:28 2012
(r230066)
@@ -168,7 +168,10 @@ main(int argc, char *argv[])
 o_flag = 1;
 break;
 case 's':
-s_arg = argtoi(optarg, 1, 5, 's');
+   if (strcasecmp(optarg, "pxe") == 0)
+   s_arg = 6;
+   else
+   s_arg = argtoi(optarg, 1, 6, 's');
 break;
 case 't':
 t_arg = argtoi(optarg, 1, 0x, 't');
@@ -441,8 +444,10 @@ display_mbr(u_int8_t *mbr)
 printf("default_selection=F%d (", mbr[OFF_OPT] + 1);
 if (mbr[OFF_OPT] < 4)
printf("Slice %d", mbr[OFF_OPT] + 1);
-else
+else if (mbr[OFF_OPT] == 4)
printf("Drive 1");
+else
+   printf("PXE");
 printf(")\n");
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230067 - in stable/9/sys: kern sys

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:53:48 2012
New Revision: 230067
URL: http://svn.freebsd.org/changeset/base/230067

Log:
  MFC 228849, 229727:
  Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
  these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
  attributes of a vnode are changed.

Modified:
  stable/9/sys/kern/vfs_subr.c
  stable/9/sys/kern/vnode_if.src
  stable/9/sys/sys/vnode.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/kern/vfs_subr.c
==
--- stable/9/sys/kern/vfs_subr.cFri Jan 13 18:49:28 2012
(r230066)
+++ stable/9/sys/kern/vfs_subr.cFri Jan 13 18:53:48 2012
(r230067)
@@ -4033,6 +4033,15 @@ vop_create_post(void *ap, int rc)
 }
 
 void
+vop_deleteextattr_post(void *ap, int rc)
+{
+   struct vop_deleteextattr_args *a = ap;
+
+   if (!rc)
+   VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB);
+}
+
+void
 vop_link_post(void *ap, int rc)
 {
struct vop_link_args *a = ap;
@@ -4114,6 +4123,15 @@ vop_setattr_post(void *ap, int rc)
 }
 
 void
+vop_setextattr_post(void *ap, int rc)
+{
+   struct vop_setextattr_args *a = ap;
+
+   if (!rc)
+   VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB);
+}
+
+void
 vop_symlink_post(void *ap, int rc)
 {
struct vop_symlink_args *a = ap;

Modified: stable/9/sys/kern/vnode_if.src
==
--- stable/9/sys/kern/vnode_if.src  Fri Jan 13 18:49:28 2012
(r230066)
+++ stable/9/sys/kern/vnode_if.src  Fri Jan 13 18:53:48 2012
(r230067)
@@ -569,6 +569,7 @@ vop_openextattr {
 
 
 %% deleteextattr   vp  E E E
+%! deleteextattr   postvop_deleteextattr_post
 
 vop_deleteextattr {
IN struct vnode *vp;
@@ -580,6 +581,7 @@ vop_deleteextattr {
 
 
 %% setextattr  vp  E E E
+%! setextattr  postvop_setextattr_post
 
 vop_setextattr {
IN struct vnode *vp;

Modified: stable/9/sys/sys/vnode.h
==
--- stable/9/sys/sys/vnode.hFri Jan 13 18:49:28 2012(r230066)
+++ stable/9/sys/sys/vnode.hFri Jan 13 18:53:48 2012(r230067)
@@ -705,6 +705,7 @@ int vop_panic(struct vop_generic_args *a
 
 /* These are called from within the actual VOPS. */
 void   vop_create_post(void *a, int rc);
+void   vop_deleteextattr_post(void *a, int rc);
 void   vop_link_post(void *a, int rc);
 void   vop_lock_pre(void *a);
 void   vop_lock_post(void *a, int rc);
@@ -717,6 +718,7 @@ voidvop_rename_post(void *a, int rc);
 void   vop_rename_pre(void *a);
 void   vop_rmdir_post(void *a, int rc);
 void   vop_setattr_post(void *a, int rc);
+void   vop_setextattr_post(void *a, int rc);
 void   vop_strategy_pre(void *a);
 void   vop_symlink_post(void *a, int rc);
 void   vop_unlock_post(void *a, int rc);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230068 - in stable/8/sys: kern sys

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:54:10 2012
New Revision: 230068
URL: http://svn.freebsd.org/changeset/base/230068

Log:
  MFC 228849, 229727:
  Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
  these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
  attributes of a vnode are changed.

Modified:
  stable/8/sys/kern/vfs_subr.c
  stable/8/sys/kern/vnode_if.src
  stable/8/sys/sys/vnode.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/vfs_subr.c
==
--- stable/8/sys/kern/vfs_subr.cFri Jan 13 18:53:48 2012
(r230067)
+++ stable/8/sys/kern/vfs_subr.cFri Jan 13 18:54:10 2012
(r230068)
@@ -4003,6 +4003,15 @@ vop_create_post(void *ap, int rc)
 }
 
 void
+vop_deleteextattr_post(void *ap, int rc)
+{
+   struct vop_deleteextattr_args *a = ap;
+
+   if (!rc)
+   VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB);
+}
+
+void
 vop_link_post(void *ap, int rc)
 {
struct vop_link_args *a = ap;
@@ -4084,6 +4093,15 @@ vop_setattr_post(void *ap, int rc)
 }
 
 void
+vop_setextattr_post(void *ap, int rc)
+{
+   struct vop_setextattr_args *a = ap;
+
+   if (!rc)
+   VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB);
+}
+
+void
 vop_symlink_post(void *ap, int rc)
 {
struct vop_symlink_args *a = ap;

Modified: stable/8/sys/kern/vnode_if.src
==
--- stable/8/sys/kern/vnode_if.src  Fri Jan 13 18:53:48 2012
(r230067)
+++ stable/8/sys/kern/vnode_if.src  Fri Jan 13 18:54:10 2012
(r230068)
@@ -562,6 +562,7 @@ vop_openextattr {
 
 
 %% deleteextattr   vp  E E E
+%! deleteextattr   postvop_deleteextattr_post
 
 vop_deleteextattr {
IN struct vnode *vp;
@@ -573,6 +574,7 @@ vop_deleteextattr {
 
 
 %% setextattr  vp  E E E
+%! setextattr  postvop_setextattr_post
 
 vop_setextattr {
IN struct vnode *vp;

Modified: stable/8/sys/sys/vnode.h
==
--- stable/8/sys/sys/vnode.hFri Jan 13 18:53:48 2012(r230067)
+++ stable/8/sys/sys/vnode.hFri Jan 13 18:54:10 2012(r230068)
@@ -705,6 +705,7 @@ int vop_panic(struct vop_generic_args *a
 
 /* These are called from within the actual VOPS. */
 void   vop_create_post(void *a, int rc);
+void   vop_deleteextattr_post(void *a, int rc);
 void   vop_link_post(void *a, int rc);
 void   vop_lock_pre(void *a);
 void   vop_lock_post(void *a, int rc);
@@ -717,6 +718,7 @@ voidvop_rename_post(void *a, int rc);
 void   vop_rename_pre(void *a);
 void   vop_rmdir_post(void *a, int rc);
 void   vop_setattr_post(void *a, int rc);
+void   vop_setextattr_post(void *a, int rc);
 void   vop_strategy_pre(void *a);
 void   vop_symlink_post(void *a, int rc);
 void   vop_unlock_post(void *a, int rc);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230069 - stable/9/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:58:15 2012
New Revision: 230069
URL: http://svn.freebsd.org/changeset/base/230069

Log:
  MFC 229622:
  Fix a logic bug in change 228207 in the check for a thread's new user
  priority being a realtime priority.

Modified:
  stable/9/sys/kern/kern_resource.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/kern/kern_resource.c
==
--- stable/9/sys/kern/kern_resource.c   Fri Jan 13 18:54:10 2012
(r230068)
+++ stable/9/sys/kern/kern_resource.c   Fri Jan 13 18:58:15 2012
(r230069)
@@ -497,7 +497,7 @@ rtp_to_pri(struct rtprio *rtp, struct th
oldpri = td->td_user_pri;
sched_user_prio(td, newpri);
if (td->td_user_pri != oldpri && (td == curthread ||
-   td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME))
+   td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME))
sched_prio(td, td->td_user_pri);
if (TD_ON_UPILOCK(td) && oldpri != newpri) {
critical_enter();
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230070 - stable/8/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 18:58:31 2012
New Revision: 230070
URL: http://svn.freebsd.org/changeset/base/230070

Log:
  MFC 229622:
  Fix a logic bug in change 228207 in the check for a thread's new user
  priority being a realtime priority.

Modified:
  stable/8/sys/kern/kern_resource.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_resource.c
==
--- stable/8/sys/kern/kern_resource.c   Fri Jan 13 18:58:15 2012
(r230069)
+++ stable/8/sys/kern/kern_resource.c   Fri Jan 13 18:58:31 2012
(r230070)
@@ -506,7 +506,7 @@ rtp_to_pri(struct rtprio *rtp, struct th
oldpri = td->td_user_pri;
sched_user_prio(td, newpri);
if (td->td_user_pri != oldpri && (td == curthread ||
-   td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME))
+   td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME))
sched_prio(td, td->td_user_pri);
if (TD_ON_UPILOCK(td) && oldpri != newpri) {
thread_unlock(td);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230071 - stable/9/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:03:30 2012
New Revision: 230071
URL: http://svn.freebsd.org/changeset/base/230071

Log:
  MFC 229728:
  Add 5 spare VOPs as placeholders to avoid breaking the KBI in the future
  when new VOPs are MFC'd to a branch.

Modified:
  stable/9/sys/kern/vnode_if.src
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/kern/vnode_if.src
==
--- stable/9/sys/kern/vnode_if.src  Fri Jan 13 18:58:31 2012
(r230070)
+++ stable/9/sys/kern/vnode_if.src  Fri Jan 13 19:03:30 2012
(r230071)
@@ -50,7 +50,7 @@
 # X: locked if not nil.
 #
 # The paramater named "vpp" is assumed to be always used with double
-# indirection (**vpp) and that name is hard-codeed in vnode_if.awk !
+# indirection (**vpp) and that name is hard-coded in vnode_if.awk !
 #
 # Lines starting with %! specify a pre or post-condition function
 # to call before/after the vop call.
@@ -639,3 +639,28 @@ vop_advise {
IN off_t end;
IN int advice;
 };
+
+# The VOPs below are spares at the end of the table to allow new VOPs to be
+# added in stable branches without breaking the KBI.  New VOPs in HEAD should
+# be added above these spares.  When merging a new VOP to a stable branch,
+# the new VOP should replace one of the spares.
+
+vop_spare1 {
+   IN struct vnode *vp;
+};
+
+vop_spare2 {
+   IN struct vnode *vp;
+};
+
+vop_spare3 {
+   IN struct vnode *vp;
+};
+
+vop_spare4 {
+   IN struct vnode *vp;
+};
+
+vop_spare5 {
+   IN struct vnode *vp;
+};
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230072 - stable/9/sys

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:10:53 2012
New Revision: 230072
URL: http://svn.freebsd.org/changeset/base/230072

Log:
  MFC 229400:
  Improve the cscope target's handling of MD directories.  Automatically
  include the MACHINE_CPUARCH directory if it differents from MACHINE when
  building an index for a single machine.  Also, include the 'x86' directory
  when building an index for i386, pc98, or amd64.

Modified:
  stable/9/sys/Makefile
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/Makefile
==
--- stable/9/sys/Makefile   Fri Jan 13 19:03:30 2012(r230071)
+++ stable/9/sys/Makefile   Fri Jan 13 19:10:53 2012(r230072)
@@ -13,10 +13,18 @@ CSCOPEDIRS= boot bsm cam cddl compat con
netgraph netinet netinet6 netipsec netipx netnatm netncp \
netsmb nfs nfsclient nfsserver nlm opencrypto \
pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
+.if !defined(CSCOPE_ARCHDIR)
 .if defined(ALL_ARCH)
-CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86
+CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86
 .else
-CSCOPE_ARCHDIR ?= ${MACHINE}
+CSCOPE_ARCHDIR = ${MACHINE} 
+.if ${MACHINE} != ${MACHINE_CPUARCH}
+CSCOPE_ARCHDIR += ${MACHINE_CPUARCH}
+.endif
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+CSCOPE_ARCHDIR += x86
+.endif
+.endif
 .endif
 
 # Loadable kernel modules
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230073 - stable/8/sys

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:13:43 2012
New Revision: 230073
URL: http://svn.freebsd.org/changeset/base/230073

Log:
  MFC 215605,215606,222952,229400:
  Various improvements to the 'cscope' target:
  - Add x86 to ALL_ARCH.
  - Add lex and yacc sources to things cscope'd.
  - Include sys/xen in cscope tag file generation.
  - Improve the cscope target's handling of MD directories.  Automatically
include the MACHINE_ARCH directory if it differs from MACHINE when
building an index for a single machine.  Also, include the 'x86'
directory when building an index for i386, pc98, or amd64.

Modified:
  stable/8/sys/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/Makefile
==
--- stable/8/sys/Makefile   Fri Jan 13 19:10:53 2012(r230072)
+++ stable/8/sys/Makefile   Fri Jan 13 19:13:43 2012(r230073)
@@ -12,11 +12,19 @@ CSCOPEDIRS= boot bsm cam cddl compat con
geom gnu isa kern libkern modules net net80211 netatalk \
netgraph netinet netinet6 netipsec netipx netnatm netncp \
netsmb nfs nfsclient nfsserver nlm opencrypto \
-   pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR}
+   pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
+.if !defined(CSCOPE_ARCHDIR)
 .if defined(ALL_ARCH)
-CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
+CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v x86
 .else
-CSCOPE_ARCHDIR ?= ${MACHINE}
+CSCOPE_ARCHDIR = ${MACHINE} 
+.if ${MACHINE} != ${MACHINE_ARCH}
+CSCOPE_ARCHDIR += ${MACHINE_ARCH}
+.endif
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+CSCOPE_ARCHDIR += x86
+.endif
+.endif
 .endif
 
 # Loadable kernel modules
@@ -34,7 +42,7 @@ cscope.out: ${.CURDIR}/cscope.files
 
 ${.CURDIR}/cscope.files: .PHONY
cd ${.CURDIR}; \
-   find ${CSCOPEDIRS} -name "*.[chSs]" -a -type f > ${.TARGET}
+   find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET}
 
 cscope-clean:
rm -f cscope.files cscope.out cscope.in.out cscope.po.out
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230074 - in stable/9/sys: netinet netinet6

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:20:09 2012
New Revision: 230074
URL: http://svn.freebsd.org/changeset/base/230074

Log:
  MFC 229414,229476,229477:
  Various fixes to the SIOC[DG]LIFADDR ioctl handlers:
  - Grab a reference on any matching interface address (ifa) before dropping
the IF_ADDR_LOCK() and release the reference after using it to prevent a
potential use-after-free.
  - Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4
interface addresses rather than IPv6.
  - Add missing interface address list locking in the IPv4 handlers.

Modified:
  stable/9/sys/netinet/in.c
  stable/9/sys/netinet6/in6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet/in.c
==
--- stable/9/sys/netinet/in.c   Fri Jan 13 19:13:43 2012(r230073)
+++ stable/9/sys/netinet/in.c   Fri Jan 13 19:20:09 2012(r230074)
@@ -704,7 +704,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
if (iflr->flags & IFLR_PREFIX)
return (EINVAL);
 
-   /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */
+   /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
@@ -753,8 +753,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo
}
}
 
+   IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
-   if (ifa->ifa_addr->sa_family != AF_INET6)
+   if (ifa->ifa_addr->sa_family != AF_INET)
continue;
if (match.s_addr == 0)
break;
@@ -763,6 +764,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo
if (candidate.s_addr == match.s_addr)
break;
}
+   if (ifa != NULL)
+   ifa_ref(ifa);
+   IF_ADDR_UNLOCK(ifp);
if (ifa == NULL)
return (EADDRNOTAVAIL);
ia = (struct in_ifaddr *)ifa;
@@ -781,12 +785,13 @@ in_lifaddr_ioctl(struct socket *so, u_lo
in_mask2len(&ia->ia_sockmask.sin_addr);
 
iflr->flags = 0;/*XXX*/
+   ifa_free(ifa);
 
return (0);
} else {
struct in_aliasreq ifra;
 
-   /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */
+   /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
@@ -799,6 +804,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
}
bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr,
ia->ia_sockmask.sin_len);
+   ifa_free(ifa);
 
return (in_control(so, SIOCDIFADDR, (caddr_t)&ifra,
ifp, td));

Modified: stable/9/sys/netinet6/in6.c
==
--- stable/9/sys/netinet6/in6.c Fri Jan 13 19:13:43 2012(r230073)
+++ stable/9/sys/netinet6/in6.c Fri Jan 13 19:20:09 2012(r230074)
@@ -1738,6 +1738,8 @@ in6_lifaddr_ioctl(struct socket *so, u_l
if (IN6_ARE_ADDR_EQUAL(&candidate, &match))
break;
}
+   if (ifa != NULL)
+   ifa_ref(ifa);
IF_ADDR_UNLOCK(ifp);
if (!ifa)
return EADDRNOTAVAIL;
@@ -1750,16 +1752,20 @@ in6_lifaddr_ioctl(struct socket *so, u_l
bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len);
error = sa6_recoverscope(
(struct sockaddr_in6 *)&iflr->addr);
-   if (error != 0)
+   if (error != 0) {
+   ifa_free(ifa);
 

svn commit: r230075 - in stable/8/sys: netinet netinet6

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:20:33 2012
New Revision: 230075
URL: http://svn.freebsd.org/changeset/base/230075

Log:
  MFC 229414,229476,229477:
  Various fixes to the SIOC[DG]LIFADDR ioctl handlers:
  - Grab a reference on any matching interface address (ifa) before dropping
the IF_ADDR_LOCK() and release the reference after using it to prevent a
potential use-after-free.
  - Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4
interface addresses rather than IPv6.
  - Add missing interface address list locking in the IPv4 handlers.

Modified:
  stable/8/sys/netinet/in.c
  stable/8/sys/netinet6/in6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/in.c
==
--- stable/8/sys/netinet/in.c   Fri Jan 13 19:20:09 2012(r230074)
+++ stable/8/sys/netinet/in.c   Fri Jan 13 19:20:33 2012(r230075)
@@ -720,7 +720,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
if (iflr->flags & IFLR_PREFIX)
return (EINVAL);
 
-   /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */
+   /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
@@ -769,8 +769,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo
}
}
 
+   IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
-   if (ifa->ifa_addr->sa_family != AF_INET6)
+   if (ifa->ifa_addr->sa_family != AF_INET)
continue;
if (match.s_addr == 0)
break;
@@ -779,6 +780,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo
if (candidate.s_addr == match.s_addr)
break;
}
+   if (ifa != NULL)
+   ifa_ref(ifa);
+   IF_ADDR_UNLOCK(ifp);
if (ifa == NULL)
return (EADDRNOTAVAIL);
ia = (struct in_ifaddr *)ifa;
@@ -797,12 +801,13 @@ in_lifaddr_ioctl(struct socket *so, u_lo
in_mask2len(&ia->ia_sockmask.sin_addr);
 
iflr->flags = 0;/*XXX*/
+   ifa_free(ifa);
 
return (0);
} else {
struct in_aliasreq ifra;
 
-   /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */
+   /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */
bzero(&ifra, sizeof(ifra));
bcopy(iflr->iflr_name, ifra.ifra_name,
sizeof(ifra.ifra_name));
@@ -815,6 +820,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
}
bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr,
ia->ia_sockmask.sin_len);
+   ifa_free(ifa);
 
return (in_control(so, SIOCDIFADDR, (caddr_t)&ifra,
ifp, td));

Modified: stable/8/sys/netinet6/in6.c
==
--- stable/8/sys/netinet6/in6.c Fri Jan 13 19:20:09 2012(r230074)
+++ stable/8/sys/netinet6/in6.c Fri Jan 13 19:20:33 2012(r230075)
@@ -1655,6 +1655,8 @@ in6_lifaddr_ioctl(struct socket *so, u_l
if (IN6_ARE_ADDR_EQUAL(&candidate, &match))
break;
}
+   if (ifa != NULL)
+   ifa_ref(ifa);
IF_ADDR_UNLOCK(ifp);
if (!ifa)
return EADDRNOTAVAIL;
@@ -1667,16 +1669,20 @@ in6_lifaddr_ioctl(struct socket *so, u_l
bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len);
error = sa6_recoverscope(
(struct sockaddr_in6 *)&iflr->addr);
-   if (error != 0)
+   if (error != 0) {
+   ifa_free(ifa);
return (error);
+   }
 
if ((ifp->if_flags & IFF_POINTOPOINT) != 0) {
bcopy(&ia->ia_dstaddr, &iflr->dstaddr,
ia->ia_dstaddr.sin6_len);
error = sa6_recoverscope(
(struct sockaddr_in6 *)&iflr->dstaddr);
-

svn commit: r230076 - in stable/9/sys: netinet netinet6

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:50:52 2012
New Revision: 230076
URL: http://svn.freebsd.org/changeset/base/230076

Log:
  MFC 229390,229420,229479:
  Fix some races in the multicast code by removing places where we would
  drop the IF_ADDR_LOCK while walking an interface's multicast address list:
  - Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.
  - When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on a pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.
  - Use the mli_relinmhead list normally used to defer calls to
in6m_release_locked() to defer calls to mld_v1_transmit_report() until
after the IF_ADDR_LOCK is dropped.

Modified:
  stable/9/sys/netinet/igmp.c
  stable/9/sys/netinet6/in6.c
  stable/9/sys/netinet6/mld6.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet/igmp.c
==
--- stable/9/sys/netinet/igmp.c Fri Jan 13 19:20:33 2012(r230075)
+++ stable/9/sys/netinet/igmp.c Fri Jan 13 19:50:52 2012(r230076)
@@ -1641,7 +1641,7 @@ igmp_fasttimo_vnet(void)
struct ifqueue   qrq;   /* Query response packets */
struct ifnet*ifp;
struct igmp_ifinfo  *igi;
-   struct ifmultiaddr  *ifma, *tifma;
+   struct ifmultiaddr  *ifma;
struct in_multi *inm;
int  loop, uri_fasthz;
 
@@ -1708,8 +1708,7 @@ igmp_fasttimo_vnet(void)
}
 
IF_ADDR_LOCK(ifp);
-   TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link,
-   tifma) {
+   TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -2003,7 +2002,7 @@ igmp_v3_cancel_link_timers(struct igmp_i
 {
struct ifmultiaddr  *ifma;
struct ifnet*ifp;
-   struct in_multi *inm;
+   struct in_multi *inm, *tinm;
 
CTR3(KTR_IGMPV3, "%s: cancel v3 timers on ifp %p(%s)", __func__,
igi->igi_ifp, igi->igi_ifp->if_xname);
@@ -2049,14 +2048,8 @@ igmp_v3_cancel_link_timers(struct igmp_i
 * transition to REPORTING to ensure the host leave
 * message is sent upstream to the old querier --
 * transition to NOT would lose the leave and race.
-*
-* SMPNG: Must drop and re-acquire IF_ADDR_LOCK
-* around inm_release_locked(), as it is not
-* a recursive mutex.
 */
-   IF_ADDR_UNLOCK(ifp);
-   inm_release_locked(inm);
-   IF_ADDR_LOCK(ifp);
+   SLIST_INSERT_HEAD(&igi->igi_relinmhead, inm, inm_nrele);
/* FALLTHROUGH */
case IGMP_G_QUERY_PENDING_MEMBER:
case IGMP_SG_QUERY_PENDING_MEMBER:
@@ -2075,6 +2068,10 @@ igmp_v3_cancel_link_timers(struct igmp_i
_IF_DRAIN(&inm->inm_scq);
}
IF_ADDR_UNLOCK(ifp);
+   SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) {
+   SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele);
+   inm_release_locked(inm);
+   }
 }
 
 /*
@@ -3320,7 +3317,7 @@ igmp_v3_merge_state_changes(struct in_mu
 static void
 igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi)
 {
-   struct ifmultiaddr  *ifma, *tifma;
+   struct ifmultiaddr  *ifma;
struct ifnet*ifp;
struct in_multi *inm;
int  retval, loop;
@@ -3334,7 +3331,7 @@ igmp_v3_dispatch_general_query(struct ig
ifp = igi->igi_ifp;
 
IF_ADDR_LOCK(ifp);
-   TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) {
+   TAILQ_FOREACH(ifma, &ifp-

svn commit: r230077 - in stable/8/sys: netinet netinet6

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:51:15 2012
New Revision: 230077
URL: http://svn.freebsd.org/changeset/base/230077

Log:
  MFC 229390,229420,229479:
  Fix some races in the multicast code by removing places where we would
  drop the IF_ADDR_LOCK while walking an interface's multicast address list:
  - Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.
  - When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on a pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.
  - Use the mli_relinmhead list normally used to defer calls to
in6m_release_locked() to defer calls to mld_v1_transmit_report() until
after the IF_ADDR_LOCK is dropped.

Modified:
  stable/8/sys/netinet/igmp.c
  stable/8/sys/netinet6/in6.c
  stable/8/sys/netinet6/mld6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/igmp.c
==
--- stable/8/sys/netinet/igmp.c Fri Jan 13 19:50:52 2012(r230076)
+++ stable/8/sys/netinet/igmp.c Fri Jan 13 19:51:15 2012(r230077)
@@ -1641,7 +1641,7 @@ igmp_fasttimo_vnet(void)
struct ifqueue   qrq;   /* Query response packets */
struct ifnet*ifp;
struct igmp_ifinfo  *igi;
-   struct ifmultiaddr  *ifma, *tifma;
+   struct ifmultiaddr  *ifma;
struct in_multi *inm;
int  loop, uri_fasthz;
 
@@ -1708,8 +1708,7 @@ igmp_fasttimo_vnet(void)
}
 
IF_ADDR_LOCK(ifp);
-   TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link,
-   tifma) {
+   TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -2003,7 +2002,7 @@ igmp_v3_cancel_link_timers(struct igmp_i
 {
struct ifmultiaddr  *ifma;
struct ifnet*ifp;
-   struct in_multi *inm;
+   struct in_multi *inm, *tinm;
 
CTR3(KTR_IGMPV3, "%s: cancel v3 timers on ifp %p(%s)", __func__,
igi->igi_ifp, igi->igi_ifp->if_xname);
@@ -2049,14 +2048,8 @@ igmp_v3_cancel_link_timers(struct igmp_i
 * transition to REPORTING to ensure the host leave
 * message is sent upstream to the old querier --
 * transition to NOT would lose the leave and race.
-*
-* SMPNG: Must drop and re-acquire IF_ADDR_LOCK
-* around inm_release_locked(), as it is not
-* a recursive mutex.
 */
-   IF_ADDR_UNLOCK(ifp);
-   inm_release_locked(inm);
-   IF_ADDR_LOCK(ifp);
+   SLIST_INSERT_HEAD(&igi->igi_relinmhead, inm, inm_nrele);
/* FALLTHROUGH */
case IGMP_G_QUERY_PENDING_MEMBER:
case IGMP_SG_QUERY_PENDING_MEMBER:
@@ -2075,6 +2068,10 @@ igmp_v3_cancel_link_timers(struct igmp_i
_IF_DRAIN(&inm->inm_scq);
}
IF_ADDR_UNLOCK(ifp);
+   SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) {
+   SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele);
+   inm_release_locked(inm);
+   }
 }
 
 /*
@@ -3320,7 +3317,7 @@ igmp_v3_merge_state_changes(struct in_mu
 static void
 igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi)
 {
-   struct ifmultiaddr  *ifma, *tifma;
+   struct ifmultiaddr  *ifma;
struct ifnet*ifp;
struct in_multi *inm;
int  retval, loop;
@@ -3334,7 +3331,7 @@ igmp_v3_dispatch_general_query(struct ig
ifp = igi->igi_ifp;
 
IF_ADDR_LOCK(ifp);
-   TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) {
+   TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;

Modified: stable/8/sys/netinet6/in6.c
==
--- stable/8/sys/netinet6/in6.c Fri Jan 13 19:50:52 2012(r230076)
+++ stable/8/sys/netinet6/in6.c Fri Jan 13 19:51:15 2012(r2

svn commit: r230078 - stable/9/sys/x86/acpica

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 19:54:00 2012
New Revision: 230078
URL: http://svn.freebsd.org/changeset/base/230078

Log:
  MFC 229427:
  Fix a few bugs in the SRAT parsing code:
  - Actually increment ndomain when building our list of known domains
so that we can properly renumber them to be 0-based and dense.
  - If the number of domains exceeds the configured maximum (VM_NDOMAIN),
bail out of processing the SRAT and disable NUMA rather than hitting an
obscure panic later.
  - Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to
disable NUMA (the default).

Modified:
  stable/9/sys/x86/acpica/srat.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/x86/acpica/srat.c
==
--- stable/9/sys/x86/acpica/srat.c  Fri Jan 13 19:51:15 2012
(r230077)
+++ stable/9/sys/x86/acpica/srat.c  Fri Jan 13 19:54:00 2012
(r230078)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#if VM_NDOMAIN > 1
 struct cpu_info {
int enabled:1;
int has_memory:1;
@@ -237,9 +238,9 @@ check_phys_avail(void)
 
 /*
  * Renumber the memory domains to be compact and zero-based if not
- * already.
+ * already.  Returns an error if there are too many domains.
  */
-static void
+static int
 renumber_domains(void)
 {
int domains[VM_PHYSSEG_MAX];
@@ -261,6 +262,11 @@ renumber_domains(void)
for (j = ndomain; j > slot; j--)
domains[j] = domains[j - 1];
domains[slot] = mem_info[i].domain;
+   ndomain++;
+   if (ndomain > VM_NDOMAIN) {
+   printf("SRAT: Too many memory domains\n");
+   return (EFBIG);
+   }
}
 
/* Renumber each domain to its index in the sorted 'domains' list. */
@@ -280,6 +286,7 @@ renumber_domains(void)
if (cpus[j].enabled && cpus[j].domain == domains[i])
cpus[j].domain = i;
}
+   return (0);
 }
 
 /*
@@ -306,13 +313,12 @@ parse_srat(void *dummy)
srat_walk_table(srat_parse_entry, &error);
acpi_unmap_table(srat);
srat = NULL;
-   if (error || check_domains() != 0 || check_phys_avail() != 0) {
+   if (error || check_domains() != 0 || check_phys_avail() != 0 ||
+   renumber_domains() != 0) {
srat_physaddr = 0;
return;
}
 
-   renumber_domains();
-
/* Point vm_phys at our memory affinity table. */
mem_affinity = mem_info;
 }
@@ -354,3 +360,4 @@ srat_set_cpus(void *dummy)
}
 }
 SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
+#endif /* VM_NDOMAIN > 1 */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230079 - stable/9/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:15:27 2012
New Revision: 230079
URL: http://svn.freebsd.org/changeset/base/230079

Log:
  MFC 229429:
  Some small fixes to CPU accounting for threads:
  - Only initialize the per-cpu switchticks and switchtime in sched_throw()
for the very first context switch on APs during boot.  This avoids a
small gap between the middle of thread_exit() and sched_throw() where
time is not accounted to any thread.
  - In thread_exit(), update the timestamp bookkeeping to track the changes
to mi_switch() introduced by td_rux so that the code once again matches
the comment claiming it is mimicing mi_switch().  Specifically, only
update the per-thread stats directly and depend on ruxagg() to update
p_rux rather than adjusting p_rux directly.  While here, move the
timestamp bookkeeping as late in the function as possible.

Modified:
  stable/9/sys/kern/kern_thread.c
  stable/9/sys/kern/sched_4bsd.c
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/kern/kern_thread.c
==
--- stable/9/sys/kern/kern_thread.c Fri Jan 13 19:54:00 2012
(r230078)
+++ stable/9/sys/kern/kern_thread.c Fri Jan 13 20:15:27 2012
(r230079)
@@ -381,7 +381,7 @@ thread_free(struct thread *td)
 void
 thread_exit(void)
 {
-   uint64_t new_switchtime;
+   uint64_t runtime, new_switchtime;
struct thread *td;
struct thread *td2;
struct proc *p;
@@ -410,15 +410,6 @@ thread_exit(void)
 */
cpu_thread_exit(td);/* XXXSMP */
 
-   /* Do the same timestamp bookkeeping that mi_switch() would do. */
-   new_switchtime = cpu_ticks();
-   p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime));
-   PCPU_SET(switchtime, new_switchtime);
-   PCPU_SET(switchticks, ticks);
-   PCPU_INC(cnt.v_swtch);
-   /* Save our resource usage in our process. */
-   td->td_ru.ru_nvcsw++;
-   rucollect(&p->p_ru, &td->td_ru);
/*
 * The last thread is left attached to the process
 * So that the whole bundle gets recycled. Skip
@@ -467,7 +458,21 @@ thread_exit(void)
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
 #endif
PROC_UNLOCK(p);
+
+   /* Do the same timestamp bookkeeping that mi_switch() would do. */
+   new_switchtime = cpu_ticks();
+   runtime = new_switchtime - PCPU_GET(switchtime);
+   td->td_runtime += runtime;
+   td->td_incruntime += runtime;
+   PCPU_SET(switchtime, new_switchtime);
+   PCPU_SET(switchticks, ticks);
+   PCPU_INC(cnt.v_swtch);
+
+   /* Save our resource usage in our process. */
+   td->td_ru.ru_nvcsw++;
ruxagg(p, td);
+   rucollect(&p->p_ru, &td->td_ru);
+
thread_lock(td);
PROC_SUNLOCK(p);
td->td_state = TDS_INACTIVE;

Modified: stable/9/sys/kern/sched_4bsd.c
==
--- stable/9/sys/kern/sched_4bsd.c  Fri Jan 13 19:54:00 2012
(r230078)
+++ stable/9/sys/kern/sched_4bsd.c  Fri Jan 13 20:15:27 2012
(r230079)
@@ -1571,14 +1571,14 @@ sched_throw(struct thread *td)
if (td == NULL) {
mtx_lock_spin(&sched_lock);
spinlock_exit();
+   PCPU_SET(switchtime, cpu_ticks());
+   PCPU_SET(switchticks, ticks);
} else {
lock_profile_release_lock(&sched_lock.lock_object);
MPASS(td->td_lock == &sched_lock);
}
mtx_assert(&sched_lock, MA_OWNED);
KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count"));
-   PCPU_SET(switchtime, cpu_ticks());
-   PCPU_SET(switchticks, ticks);
cpu_throw(td, choosethread());  /* doesn't return */
 }
 

Modified: stable/9/sys/kern/sched_ule.c
==
--- stable/9/sys/kern/sched_ule.c   Fri Jan 13 19:54:00 2012
(r230078)
+++ stable/9/sys/kern/sched_ule.c   Fri Jan 13 20:15:27 2012
(r230079)
@@ -2581,6 +2581,8 @@ sched_throw(struct thread *td)
/* Correct spinlock nesting and acquire the correct lock. */
TDQ_LOCK(tdq);

svn commit: r230080 - stable/8/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:15:49 2012
New Revision: 230080
URL: http://svn.freebsd.org/changeset/base/230080

Log:
  MFC 229429:
  Some small fixes to CPU accounting for threads:
  - Only initialize the per-cpu switchticks and switchtime in sched_throw()
for the very first context switch on APs during boot.  This avoids a
small gap between the middle of thread_exit() and sched_throw() where
time is not accounted to any thread.
  - In thread_exit(), update the timestamp bookkeeping to track the changes
to mi_switch() introduced by td_rux so that the code once again matches
the comment claiming it is mimicing mi_switch().  Specifically, only
update the per-thread stats directly and depend on ruxagg() to update
p_rux rather than adjusting p_rux directly.  While here, move the
timestamp bookkeeping as late in the function as possible.

Modified:
  stable/8/sys/kern/kern_thread.c
  stable/8/sys/kern/sched_4bsd.c
  stable/8/sys/kern/sched_ule.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thread.c
==
--- stable/8/sys/kern/kern_thread.c Fri Jan 13 20:15:27 2012
(r230079)
+++ stable/8/sys/kern/kern_thread.c Fri Jan 13 20:15:49 2012
(r230080)
@@ -333,7 +333,7 @@ thread_free(struct thread *td)
 void
 thread_exit(void)
 {
-   uint64_t new_switchtime;
+   uint64_t runtime, new_switchtime;
struct thread *td;
struct thread *td2;
struct proc *p;
@@ -362,15 +362,6 @@ thread_exit(void)
 */
cpu_thread_exit(td);/* XXXSMP */
 
-   /* Do the same timestamp bookkeeping that mi_switch() would do. */
-   new_switchtime = cpu_ticks();
-   p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime));
-   PCPU_SET(switchtime, new_switchtime);
-   PCPU_SET(switchticks, ticks);
-   PCPU_INC(cnt.v_swtch);
-   /* Save our resource usage in our process. */
-   td->td_ru.ru_nvcsw++;
-   rucollect(&p->p_ru, &td->td_ru);
/*
 * The last thread is left attached to the process
 * So that the whole bundle gets recycled. Skip
@@ -419,7 +410,21 @@ thread_exit(void)
PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT);
 #endif
PROC_UNLOCK(p);
+
+   /* Do the same timestamp bookkeeping that mi_switch() would do. */
+   new_switchtime = cpu_ticks();
+   runtime = new_switchtime - PCPU_GET(switchtime);
+   td->td_runtime += runtime;
+   td->td_incruntime += runtime;
+   PCPU_SET(switchtime, new_switchtime);
+   PCPU_SET(switchticks, ticks);
+   PCPU_INC(cnt.v_swtch);
+
+   /* Save our resource usage in our process. */
+   td->td_ru.ru_nvcsw++;
ruxagg(p, td);
+   rucollect(&p->p_ru, &td->td_ru);
+
thread_lock(td);
PROC_SUNLOCK(p);
td->td_state = TDS_INACTIVE;

Modified: stable/8/sys/kern/sched_4bsd.c
==
--- stable/8/sys/kern/sched_4bsd.c  Fri Jan 13 20:15:27 2012
(r230079)
+++ stable/8/sys/kern/sched_4bsd.c  Fri Jan 13 20:15:49 2012
(r230080)
@@ -1571,14 +1571,14 @@ sched_throw(struct thread *td)
if (td == NULL) {
mtx_lock_spin(&sched_lock);
spinlock_exit();
+   PCPU_SET(switchtime, cpu_ticks());
+   PCPU_SET(switchticks, ticks);
} else {
lock_profile_release_lock(&sched_lock.lock_object);
MPASS(td->td_lock == &sched_lock);
}
mtx_assert(&sched_lock, MA_OWNED);
KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count"));
-   PCPU_SET(switchtime, cpu_ticks());
-   PCPU_SET(switchticks, ticks);
cpu_throw(td, choosethread());  /* doesn't return */
 }
 

Modified: stable/8/sys/kern/sched_ule.c
==
--- stable/8/sys/kern/sched_ule.c   Fri Jan 13 20:15:27 2012
(r230079)
+++ stable/8/sys/kern/sched_ule.c   Fri Jan 13 20:15:49 2012
(r230080)
@@ -2585,6 +2585,8 @@ sched_throw(struct thread *td)
/* Correct spinlock nesting and acquire the correct lock. */
TDQ_LOCK(tdq);
spinlock_exit();
+   PCPU_SET(switchtime, cpu_ticks());
+   PCPU_SET(switchticks, ticks);
} else {
MPASS(td->td_lock == TDQ_LOCKPTR(tdq));
tdq_load_rem(tdq, td);
@@ -2593,8 +2595,6 @@ sched_throw(struct thread *td)
KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count"));
newtd = choosethread();
TDQ_LOCKPTR(tdq)->mtx_lock = (uin

svn commit: r230081 - stable/9/sys/modules/kgssapi_krb5

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:22:57 2012
New Revision: 230081
URL: http://svn.freebsd.org/changeset/base/230081

Log:
  MFC 229519:
  Fix 'make clean' for this module so it cleans up the generated gssd.h.

Modified:
  stable/9/sys/modules/kgssapi_krb5/Makefile
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/modules/kgssapi_krb5/Makefile
==
--- stable/9/sys/modules/kgssapi_krb5/Makefile  Fri Jan 13 20:15:49 2012
(r230080)
+++ stable/9/sys/modules/kgssapi_krb5/Makefile  Fri Jan 13 20:22:57 2012
(r230081)
@@ -13,6 +13,7 @@ SRCS= krb5_mech.c \
 
 SRCS+= kgss_if.h gssd.h
 MFILES=kgssapi/kgss_if.m
+CLEANFILES=gssd.h
 
 S= ${.CURDIR}/../..
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230082 - stable/8/sys/modules/kgssapi_krb5

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:23:18 2012
New Revision: 230082
URL: http://svn.freebsd.org/changeset/base/230082

Log:
  MFC 229519:
  Fix 'make clean' for this module so it cleans up the generated gssd.h.

Modified:
  stable/8/sys/modules/kgssapi_krb5/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/modules/kgssapi_krb5/Makefile
==
--- stable/8/sys/modules/kgssapi_krb5/Makefile  Fri Jan 13 20:22:57 2012
(r230081)
+++ stable/8/sys/modules/kgssapi_krb5/Makefile  Fri Jan 13 20:23:18 2012
(r230082)
@@ -13,6 +13,7 @@ SRCS= krb5_mech.c \
 
 SRCS+= kgss_if.h gssd.h
 MFILES=kgssapi/kgss_if.m
+CLEANFILES=gssd.h
 
 S= ${.CURDIR}/../..
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230083 - stable/9/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:25:38 2012
New Revision: 230083
URL: http://svn.freebsd.org/changeset/base/230083

Log:
  MFC 228960:
  Cap the priority calculated from the current thread's running tick count
  at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
  happen due to irregularities with clock interrupts under certain
  virtualization environments.

Modified:
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/kern/sched_ule.c
==
--- stable/9/sys/kern/sched_ule.c   Fri Jan 13 20:23:18 2012
(r230082)
+++ stable/9/sys/kern/sched_ule.c   Fri Jan 13 20:25:38 2012
(r230083)
@@ -1429,7 +1429,8 @@ sched_priority(struct thread *td)
} else {
pri = SCHED_PRI_MIN;
if (td->td_sched->ts_ticks)
-   pri += SCHED_PRI_TICKS(td->td_sched);
+   pri += min(SCHED_PRI_TICKS(td->td_sched),
+   SCHED_PRI_RANGE);
pri += SCHED_PRI_NICE(td->td_proc->p_nice);
KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH,
("sched_priority: invalid priority %d: nice %d, " 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230084 - stable/8/sys/kern

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:25:56 2012
New Revision: 230084
URL: http://svn.freebsd.org/changeset/base/230084

Log:
  MFC 228960:
  Cap the priority calculated from the current thread's running tick count
  at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
  happen due to irregularities with clock interrupts under certain
  virtualization environments.

Modified:
  stable/8/sys/kern/sched_ule.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/sched_ule.c
==
--- stable/8/sys/kern/sched_ule.c   Fri Jan 13 20:25:38 2012
(r230083)
+++ stable/8/sys/kern/sched_ule.c   Fri Jan 13 20:25:56 2012
(r230084)
@@ -1426,7 +1426,8 @@ sched_priority(struct thread *td)
} else {
pri = SCHED_PRI_MIN;
if (td->td_sched->ts_ticks)
-   pri += SCHED_PRI_TICKS(td->td_sched);
+   pri += min(SCHED_PRI_TICKS(td->td_sched),
+   SCHED_PRI_RANGE);
pri += SCHED_PRI_NICE(td->td_proc->p_nice);
KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH,
("sched_priority: invalid priority %d: nice %d, " 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230085 - stable/9/sys/dev/acpica

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:28:11 2012
New Revision: 230085
URL: http://svn.freebsd.org/changeset/base/230085

Log:
  MFC 228961:
  Further relax the strictness of enforcing allocations to only come from
  decoded ranges.  Pass any request for a specific range that fails because
  it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
  to see if it can still be allocated.  This is based on the assumption that
  many BIOSes are inconsistent/broken and that settings programmed into BARs
  or resources assigned to other built-in components are more trustworthy than
  the list of decoded resource ranges in _CRS.  This effectively limits the
  decoded ranges to only being used for "wildcard" ranges when allocating
  fresh resources for a BAR, etc.  At some point I would like to only be
  this permissive during an early scan of firmware-assigned resources during
  boot and to be strict about all later allocations, but that isn't viable
  currently.

Modified:
  stable/9/sys/dev/acpica/acpi_pcib_acpi.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/acpica/acpi_pcib_acpi.c
==
--- stable/9/sys/dev/acpica/acpi_pcib_acpi.cFri Jan 13 20:25:56 2012
(r230084)
+++ stable/9/sys/dev/acpica/acpi_pcib_acpi.cFri Jan 13 20:28:11 2012
(r230085)
@@ -511,8 +511,17 @@ acpi_pcib_acpi_alloc_resource(device_t d
 sc = device_get_softc(dev);
 res = pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end,
count, flags);
+
+/*
+ * XXX: If this is a request for a specific range, assume it is
+ * correct and pass it up to the parent.  What we probably want to
+ * do long-term is explicitly trust any firmware-configured
+ * resources during the initial bus scan on boot and then disable
+ * this after that.
+ */
 if (res == NULL && start + count - 1 == end)
-   res = acpi_alloc_sysres(child, type, rid, start, end, count, flags);
+   res = bus_generic_alloc_resource(dev, child, type, rid, start, end,
+   count, flags);
 return (res);
 #else
 return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230086 - stable/9/sys/netinet

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:35:12 2012
New Revision: 230086
URL: http://svn.freebsd.org/changeset/base/230086

Log:
  MFC 229665,229672,229700:
  Remove the assertion from tcp_input() that rcv_nxt is always greater
  than or equal to rcv_adv and fix tcp_twstart() to handle this case by
  assuming the last window was zero rather than a negative value.
  
  The code in tcp_input() already safely handled this case.  It can happen
  due to delayed ACKs along with a remote sender that sends data beyond
  the window we previously advertised.  If we have room in our socket buffer
  for the extra data beyond the advertised window, we will accept it.
  However, if the ACK for that segment is delayed, then we will not
  effectively fixup rcv_adv to account for that extra data until the
  next segment arrives and forces out an ACK.  When that next segment
  arrives, rcv_nxt will be beyond rcv_adv.

Modified:
  stable/9/sys/netinet/tcp_input.c
  stable/9/sys/netinet/tcp_timewait.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/netinet/tcp_input.c
==
--- stable/9/sys/netinet/tcp_input.cFri Jan 13 20:28:11 2012
(r230085)
+++ stable/9/sys/netinet/tcp_input.cFri Jan 13 20:35:12 2012
(r230086)
@@ -1826,9 +1826,6 @@ tcp_do_segment(struct mbuf *m, struct tc
win = sbspace(&so->so_rcv);
if (win < 0)
win = 0;
-   KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
-   ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
-   tp->rcv_nxt, tp->rcv_adv));
tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
 
/* Reset receive buffer auto scaling when not in bulk receive mode. */

Modified: stable/9/sys/netinet/tcp_timewait.c
==
--- stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:28:11 2012
(r230085)
+++ stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:12 2012
(r230086)
@@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp)
/*
 * Recover last window size sent.
 */
-   KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
-   ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
-   tp->rcv_nxt, tp->rcv_adv));
-   tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt))
+   tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+   else
+   tw->last_win = 0;
 
/*
 * Set t_recent if timestamps are used on the connection.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230087 - stable/8/sys/netinet

2012-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 20:35:43 2012
New Revision: 230087
URL: http://svn.freebsd.org/changeset/base/230087

Log:
  MFC 221891,229665,229672,229700:
  Remove the assertion from tcp_input() that rcv_nxt is always greater
  than or equal to rcv_adv and fix tcp_twstart() to handle this case by
  assuming the last window was zero rather than a negative value.
  
  The code in tcp_input() already safely handled this case.  It can happen
  due to delayed ACKs along with a remote sender that sends data beyond
  the window we previously advertised.  If we have room in our socket buffer
  for the extra data beyond the advertised window, we will accept it.
  However, if the ACK for that segment is delayed, then we will not
  effectively fixup rcv_adv to account for that extra data until the
  next segment arrives and forces out an ACK.  When that next segment
  arrives, rcv_nxt will be beyond rcv_adv.

Modified:
  stable/8/sys/netinet/tcp_input.c
  stable/8/sys/netinet/tcp_timewait.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/tcp_input.c
==
--- stable/8/sys/netinet/tcp_input.cFri Jan 13 20:35:12 2012
(r230086)
+++ stable/8/sys/netinet/tcp_input.cFri Jan 13 20:35:43 2012
(r230087)
@@ -1776,9 +1776,6 @@ tcp_do_segment(struct mbuf *m, struct tc
win = sbspace(&so->so_rcv);
if (win < 0)
win = 0;
-   KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
-   ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
-   tp->rcv_adv, tp->rcv_nxt));
tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
 
/* Reset receive buffer auto scaling when not in bulk receive mode. */

Modified: stable/8/sys/netinet/tcp_timewait.c
==
--- stable/8/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:12 2012
(r230086)
+++ stable/8/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:43 2012
(r230087)
@@ -228,10 +228,10 @@ tcp_twstart(struct tcpcb *tp)
/*
 * Recover last window size sent.
 */
-   KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt),
-   ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp,
-   tp->rcv_adv, tp->rcv_nxt));
-   tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+   if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt))
+   tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
+   else
+   tw->last_win = 0;
 
/*
 * Set t_recent if timestamps are used on the connection.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230088 - stable/9/release/doc/en_US.ISO8859-1/errata

2012-01-13 Thread Hiroki Sato
Author: hrs
Date: Fri Jan 13 20:50:18 2012
New Revision: 230088
URL: http://svn.freebsd.org/changeset/base/230088

Log:
  Add an open issue and workaround about possible device detection failure on
  FreeBSD/{amd64,i386}.

Modified:
  stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml

Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml
==
--- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgmlFri Jan 13 
20:35:43 2012(r230087)
+++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgmlFri Jan 13 
20:50:18 2012(r230088)
@@ -225,6 +225,23 @@
   fixed by a change in Errata Notice EN-12:01.  For more
   information, see http://security.freebsd.org/advisories/FreeBSD-EN-12:01.freebsd-update.asc";>
+
+&os; &release.current; includes several
+  changes to improve resource management of PCI devices.  Some x86
+  machines may not boot or may have devices that no longer attach
+  when using ACPI as a result of these changes.  This can be
+  worked around by setting a &man.loader.8; tunable
+  debug.acpi.disabled to
+  hostres.  To do this, enter the following
+  lines at the loader prompt:
+
+set debug.acpi.disabled="hostres"
+boot
+
+Or, put the following line into
+  /boot/loader.conf:
+
+debug.acpi.disabled="hostres"
   
 
   
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r230088 - stable/9/release/doc/en_US.ISO8859-1/errata

2012-01-13 Thread John Baldwin
On Friday, January 13, 2012 3:50:18 pm Hiroki Sato wrote:
> Author: hrs
> Date: Fri Jan 13 20:50:18 2012
> New Revision: 230088
> URL: http://svn.freebsd.org/changeset/base/230088
> 
> Log:
>   Add an open issue and workaround about possible device detection failure on
>   FreeBSD/{amd64,i386}.

Thanks!

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


svn commit: r230089 - in head/usr.sbin/acpi: acpidb iasl

2012-01-13 Thread Jung-uk Kim
Author: jkim
Date: Fri Jan 13 22:16:47 2012
New Revision: 230089
URL: http://svn.freebsd.org/changeset/base/230089

Log:
  Remove unused ACPICA sources from userland makefiles.

Modified:
  head/usr.sbin/acpi/acpidb/Makefile
  head/usr.sbin/acpi/iasl/Makefile

Modified: head/usr.sbin/acpi/acpidb/Makefile
==
--- head/usr.sbin/acpi/acpidb/Makefile  Fri Jan 13 20:50:18 2012
(r230088)
+++ head/usr.sbin/acpi/acpidb/Makefile  Fri Jan 13 22:16:47 2012
(r230089)
@@ -15,7 +15,7 @@ SRCS+=dmbuffer.c dmnames.c dmobject.c d
 # events
 SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c  \
evgpeutil.c evmisc.c evregion.c evrgnini.c evsci.c  \
-   evxface.c evxfevnt.c evxfgpe.c evxfregn.c
+   evxface.c evxfevnt.c evxfregn.c
 
 # hardware
 SRCS+= hwacpi.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwvalid.c   \
@@ -52,8 +52,7 @@ SRCS+=rsaddr.c rscalc.c rscreate.c rsdu
rsserial.c rsutils.c rsxface.c
 
 # tables
-SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c\
-   tbxfroot.c
+SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c
 
 # utilities
 SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c  \

Modified: head/usr.sbin/acpi/iasl/Makefile
==
--- head/usr.sbin/acpi/iasl/MakefileFri Jan 13 20:50:18 2012
(r230088)
+++ head/usr.sbin/acpi/iasl/MakefileFri Jan 13 22:16:47 2012
(r230089)
@@ -26,8 +26,8 @@ SRCS+=aslanalyze.c aslbtypes.c aslcodeg
 SRCS+= dbfileio.c
 
 # disassembler
-SRCS+= dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c\
-   dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
+SRCS+= dmbuffer.c dmnames.c dmopcode.c dmresrc.c dmresrcl.c\
+   dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
 
 # interpreter/dispatcher
 SRCS+= dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c\
@@ -37,8 +37,8 @@ SRCS+=dsargs.c dscontrol.c dsfield.c ds
 # interpreter/executer
 SRCS+= exconvrt.c excreate.c exdump.c exmisc.c exmutex.c   \
exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c   \
-   exprep.c exregion.c exresnte.c exresolv.c exresop.c \
-   exstore.c exstoren.c exstorob.c exsystem.c exutils.c
+   exprep.c exresnte.c exresolv.c exresop.c exstore.c  \
+   exstoren.c exstorob.c exsystem.c exutils.c
 
 # interpreter/parser
 SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c\
@@ -46,7 +46,7 @@ SRCS+=psargs.c psloop.c psopcode.c pspa
 
 # namespace
 SRCS+= nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c  \
-   nsparse.c nssearch.c nsutils.c nswalk.c nsxfobj.c
+   nsparse.c nssearch.c nsutils.c nswalk.c
 
 # os_specific/service_layers
 SRCS+= osunixxf.c
@@ -57,8 +57,8 @@ SRCS+=tbfadt.c tbinstal.c tbutils.c tbx
 # utilities
 SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c  \
utdecode.c utdelete.c utglobal.c utinit.c utlock.c  \
-   utmath.c utmisc.c utmutex.c utobject.c utosi.c  \
-   utresrc.c utstate.c utxface.c utxferror.c
+   utmath.c utmisc.c utmutex.c utobject.c utresrc.c\
+   utstate.c utxface.c utxferror.c
 
 WARNS?=2
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230090 - head/sys/dev/usb/controller

2012-01-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 13 22:19:14 2012
New Revision: 230090
URL: http://svn.freebsd.org/changeset/base/230090

Log:
  Bugfix: Make sure the XHCI driver doesn't clear
  the route string field. Else USB 3.0 HUBs
  won't work.
  
  MFC after:5 days

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Fri Jan 13 22:16:47 2012
(r230089)
+++ head/sys/dev/usb/controller/xhci.c  Fri Jan 13 22:19:14 2012
(r230090)
@@ -2264,7 +2264,7 @@ xhci_configure_device(struct usb_device 
temp |= XHCI_SCTX_0_CTX_NUM_SET(XHCI_MAX_ENDPOINTS - 1);
break;
default:
-   temp = XHCI_SCTX_0_CTX_NUM_SET(1);
+   temp |= XHCI_SCTX_0_CTX_NUM_SET(1);
break;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230091 - head/sys/dev/usb

2012-01-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 13 22:26:13 2012
New Revision: 230091
URL: http://svn.freebsd.org/changeset/base/230091

Log:
  Improve support for USB 3.0 HUBs. In certain states we
  should do a warm reset instead of the default reset.
  
  MFC after:5 days

Modified:
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_request.c

Modified: head/sys/dev/usb/usb_hub.c
==
--- head/sys/dev/usb/usb_hub.c  Fri Jan 13 22:19:14 2012(r230090)
+++ head/sys/dev/usb/usb_hub.c  Fri Jan 13 22:26:13 2012(r230091)
@@ -627,14 +627,15 @@ uhub_suspend_resume_port(struct uhub_sof
}
} else {
switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) {
-   case UPS_PORT_LS_U0:
-   case UPS_PORT_LS_U1:
-   case UPS_PORT_LS_U2:
-   case UPS_PORT_LS_RESUME:
+   case UPS_PORT_LS_U3:
+   is_suspend = 1;
+   break;
+   case UPS_PORT_LS_SS_INA:
+   usbd_req_warm_reset_port(udev, NULL, portno);
is_suspend = 0;
break;
default:
-   is_suspend = 1;
+   is_suspend = 0;
break;
}
}
@@ -793,7 +794,8 @@ uhub_explore(struct usb_device *udev)
break;
}
}
-   if (sc->sc_st.port_change & (UPS_C_SUSPEND | 
UPS_C_PORT_LINK_STATE)) {
+   if (sc->sc_st.port_change & (UPS_C_SUSPEND |
+   UPS_C_PORT_LINK_STATE)) {
err = uhub_suspend_resume_port(sc, portno);
if (err) {
/* most likely the HUB is gone */

Modified: head/sys/dev/usb/usb_request.c
==
--- head/sys/dev/usb/usb_request.c  Fri Jan 13 22:19:14 2012
(r230090)
+++ head/sys/dev/usb/usb_request.c  Fri Jan 13 22:26:13 2012
(r230091)
@@ -785,12 +785,17 @@ usbd_req_reset_port(struct usb_device *u
struct usb_port_status ps;
usb_error_t err;
uint16_t n;
+   uint16_t status;
+   uint16_t change;
 
 #ifdef USB_DEBUG
uint16_t pr_poll_delay;
uint16_t pr_recovery_delay;
 
 #endif
+
+   DPRINTF("\n");
+
/* clear any leftover port reset changes first */
usbd_req_clear_port_feature(
udev, mtx, port, UHF_C_PORT_RESET);
@@ -817,9 +822,6 @@ usbd_req_reset_port(struct usb_device *u
 #endif
n = 0;
while (1) {
-   uint16_t status;
-   uint16_t change;
-
 #ifdef USB_DEBUG
/* wait for the device to recover from reset */
usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay));
@@ -830,9 +832,9 @@ usbd_req_reset_port(struct usb_device *u
n += USB_PORT_RESET_DELAY;
 #endif
err = usbd_req_get_port_status(udev, mtx, &ps, port);
-   if (err) {
+   if (err)
goto done;
-   }
+
status = UGETW(ps.wPortStatus);
change = UGETW(ps.wPortChange);
 
@@ -862,9 +864,9 @@ usbd_req_reset_port(struct usb_device *u
/* clear port reset first */
err = usbd_req_clear_port_feature(
udev, mtx, port, UHF_C_PORT_RESET);
-   if (err) {
+   if (err)
goto done;
-   }
+
/* check for timeout */
if (n == 0) {
err = USB_ERR_TIMEOUT;
@@ -898,21 +900,50 @@ done:
  *   disabled.
  **/
 usb_error_t
-usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t 
port)
+usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx,
+uint8_t port)
 {
struct usb_port_status ps;
usb_error_t err;
uint16_t n;
+   uint16_t status;
+   uint16_t change;
 
 #ifdef USB_DEBUG
uint16_t pr_poll_delay;
uint16_t pr_recovery_delay;
 
 #endif
-   err = usbd_req_set_port_feature(udev, mtx, port, UHF_BH_PORT_RESET);
-   if (err) {
+
+   DPRINTF("\n");
+
+   err = usbd_req_get_port_status(udev, mtx, &ps, port);
+   if (err)
goto done;
+
+   status = UGETW(ps.wPortStatus);
+
+   switch (UPS_PORT_LINK_STATE_GET(status)) {
+   case UPS_PORT_LS_U3:
+   case UPS_PORT_LS_COMP_MODE:
+   case UPS_PORT_LS_LOOPBACK:
+   case UPS_PORT_LS_SS_INA:
+   break;
+   default:
+   DPRINTF("Wrong state for warm reset\n");
+   return (0);
}
+
+   /* clear any leftover warm port reset changes first */
+   usbd_req_clear_port_feature(udev, mtx,
+   port, UHF_C_BH_PORT_RESET);
+
+   /* set 

Re: svn commit: r229850 - in head: etc/rc.d sys/contrib/pf/net sys/netinet

2012-01-13 Thread Gleb Smirnoff
On Fri, Jan 13, 2012 at 11:34:15PM +0100, Ermal Lu?i wrote:
E> You ARE testing this right?

Sure.

E> Since you removed code that you do not actually mention at all in the
E> commit message!!!

What code are you worried about?

E> On Mon, Jan 9, 2012 at 9:50 AM, Gleb Smirnoff  wrote:
E> 
E> > Author: glebius
E> > Date: Mon Jan  9 08:50:22 2012
E> > New Revision: 229850
E> > URL: http://svn.freebsd.org/changeset/base/229850
E> >
E> > Log:
E> >  Bunch of fixes to pfsync(4) module load/unload:
E> >
E> >  o Make the pfsync.ko actually usable. Before this change loading it
E> >didn't register protosw, so was a nop. However, a module /boot/kernel
E> >did confused users.
E> >  o Rewrite the way we are joining multicast group:
E> >- Move multicast initialization/destruction to separate functions.
E> >- Don't allocate memory if we aren't going to join a multicast group.
E> >- Use modern API for joining/leaving multicast group.
E> >- Now the utterly wrong pfsync_ifdetach() isn't needed.
E> >  o Move module initialization from SYSINIT(9) to moduledata_t method.
E> >  o Refuse to unload module, unless asked forcibly.
E> >  o Improve a bit some FreeBSD porting code:
E> >- Use separate malloc type.
E> >- Simplify swi sheduling.
E> >
E> >  This change is probably wrong from VIMAGE viewpoint, however pfsync
E> >  wasn't VIMAGE-correct before this change, too.
E> >
E> >  Glanced at by:bz

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


Re: svn commit: r229850 - in head: etc/rc.d sys/contrib/pf/net sys/netinet

2012-01-13 Thread Ermal Luçi
You ARE testing this right?
Since you removed code that you do not actually mention at all in the
commit message!!!

On Mon, Jan 9, 2012 at 9:50 AM, Gleb Smirnoff  wrote:

> Author: glebius
> Date: Mon Jan  9 08:50:22 2012
> New Revision: 229850
> URL: http://svn.freebsd.org/changeset/base/229850
>
> Log:
>  Bunch of fixes to pfsync(4) module load/unload:
>
>  o Make the pfsync.ko actually usable. Before this change loading it
>didn't register protosw, so was a nop. However, a module /boot/kernel
>did confused users.
>  o Rewrite the way we are joining multicast group:
>- Move multicast initialization/destruction to separate functions.
>- Don't allocate memory if we aren't going to join a multicast group.
>- Use modern API for joining/leaving multicast group.
>- Now the utterly wrong pfsync_ifdetach() isn't needed.
>  o Move module initialization from SYSINIT(9) to moduledata_t method.
>  o Refuse to unload module, unless asked forcibly.
>  o Improve a bit some FreeBSD porting code:
>- Use separate malloc type.
>- Simplify swi sheduling.
>
>  This change is probably wrong from VIMAGE viewpoint, however pfsync
>  wasn't VIMAGE-correct before this change, too.
>
>  Glanced at by:bz
>
> Modified:
>  head/etc/rc.d/pfsync
>  head/sys/contrib/pf/net/if_pfsync.c
>  head/sys/netinet/in_proto.c
>
> Modified: head/etc/rc.d/pfsync
>
> ==
> --- head/etc/rc.d/pfsyncMon Jan  9 08:36:12 2012(r229849)
> +++ head/etc/rc.d/pfsyncMon Jan  9 08:50:22 2012(r229850)
> @@ -18,13 +18,6 @@ required_modules="pf"
>
>  pfsync_prestart()
>  {
> -   # XXX Currently pfsync cannot be a module as it must register
> -   # a network protocol in a static kernel table.
> -   if ! kldstat -q -m pfsync; then
> -   warn "pfsync(4) must be statically compiled in the kernel."
> -   return 1
> -   fi
> -
>case "$pfsync_syncdev" in
>'')
>warn "pfsync_syncdev is not set."
>
> Modified: head/sys/contrib/pf/net/if_pfsync.c
>
> ==
> --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan  9 08:36:12 2012
>  (r229849)
> +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan  9 08:50:22 2012
>  (r229850)
> @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #else
>  #include 
>  #include 
> @@ -295,21 +296,25 @@ struct pfsync_softc {
>  #else
>struct timeout   sc_tmo;
>  #endif
> -#ifdef __FreeBSD__
> -   eventhandler_tag sc_detachtag;
> -#endif
> -
>  };
>
>  #ifdef __FreeBSD__
> +static MALLOC_DEFINE(M_PFSYNC, "pfsync", "pfsync data");
>  static VNET_DEFINE(struct pfsync_softc *, pfsyncif) = NULL;
>  #defineV_pfsyncif  VNET(pfsyncif)
> -
> +static VNET_DEFINE(void *, pfsync_swi_cookie) = NULL;
> +#defineV_pfsync_swi_cookie VNET(pfsync_swi_cookie)
>  static VNET_DEFINE(struct pfsyncstats, pfsyncstats);
>  #defineV_pfsyncstats   VNET(pfsyncstats)
>  static VNET_DEFINE(int, pfsync_carp_adj) = CARP_MAXSKEW;
>  #defineV_pfsync_carp_adj   VNET(pfsync_carp_adj)
>
> +static voidpfsyncintr(void *);
> +static int pfsync_multicast_setup(struct pfsync_softc *);
> +static voidpfsync_multicast_cleanup(struct pfsync_softc *);
> +static int pfsync_init(void);
> +static voidpfsync_uninit(void);
> +
>  SYSCTL_NODE(_net, OID_AUTO, pfsync, CTLFLAG_RW, 0, "PFSYNC");
>  SYSCTL_VNET_STRUCT(_net_pfsync, OID_AUTO, stats, CTLFLAG_RW,
> &VNET_NAME(pfsyncstats), pfsyncstats,
> @@ -322,16 +327,6 @@ struct pfsyncstats  pfsyncstats;
>  #defineV_pfsyncstatspfsyncstats
>  #endif
>
> -#ifdef __FreeBSD__
> -static voidpfsyncintr(void *);
> -struct pfsync_swi {
> -   void *  pfsync_swi_cookie;
> -};
> -static struct pfsync_swipfsync_swi;
> -#defineschednetisr(p)  swi_sched(pfsync_swi.pfsync_swi_cookie, 0)
> -#defineNETISR_PFSYNC
> -#endif
> -
>  void   pfsyncattach(int);
>  #ifdef __FreeBSD__
>  intpfsync_clone_create(struct if_clone *, int, caddr_t);
> @@ -377,8 +372,6 @@ voidpfsync_bulk_update(void *);
>  void   pfsync_bulk_fail(void *);
>
>  #ifdef __FreeBSD__
> -void   pfsync_ifdetach(void *, struct ifnet *);
> -
>  /* XXX: ugly */
>  #definebetoh64 (unsigned long long)be64toh
>  #definetimeout_del callout_stop
> @@ -390,6 +383,10 @@ intpfsync_sync_ok;
>  #endif
>
>  #ifdef __FreeBSD__
> +VNET_DEFINE(struct ifc_simple_data, pfsync_cloner_data);
> +VNET_DEFINE(struct if_clone, pfsync_cloner);
> +#defineV_pfsync_cloner_dataVNET(pfsync_cloner_data)
> +#defineV_pfsync_cloner VNET(pfsync_cloner)
>  IFC_SIMPLE_DECLARE(pfsync, 1);
>  #else
>  struct if_clonepfsync_cloner =
> @@ -415,25 +412,20 @@ pfsync_clone_create(struct if_clone *ifc

svn commit: r230092 - head/sbin/hastd

2012-01-13 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Jan 13 23:25:35 2012
New Revision: 230092
URL: http://svn.freebsd.org/changeset/base/230092

Log:
  Style cleanups.
  
  MFC after:3 days

Modified:
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/secondary.c
==
--- head/sbin/hastd/secondary.c Fri Jan 13 22:26:13 2012(r230091)
+++ head/sbin/hastd/secondary.c Fri Jan 13 23:25:35 2012(r230092)
@@ -282,8 +282,10 @@ init_remote(struct hast_resource *res, s
(uintmax_t)resuid, (uintmax_t)res->hr_resuid);
pjdlog_error("%s", errmsg);
nv_add_string(nvout, errmsg, "errmsg");
-   if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) == 
-1) {
-   pjdlog_exit(EX_TEMPFAIL, "Unable to send response to 
%s",
+   if (hast_proto_send(res, res->hr_remotein, nvout,
+   NULL, 0) == -1) {
+   pjdlog_exit(EX_TEMPFAIL,
+   "Unable to send response to %s",
res->hr_remoteaddr);
}
nv_free(nvout);
@@ -327,8 +329,10 @@ init_remote(struct hast_resource *res, s
free(map);
pjdlog_error("Split-brain detected, exiting.");
nv_add_string(nvout, "Split-brain condition!", "errmsg");
-   if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) == 
-1) {
-   pjdlog_exit(EX_TEMPFAIL, "Unable to send response to 
%s",
+   if (hast_proto_send(res, res->hr_remotein, nvout,
+   NULL, 0) == -1) {
+   pjdlog_exit(EX_TEMPFAIL,
+   "Unable to send response to %s",
res->hr_remoteaddr);
}
nv_free(nvout);
@@ -475,7 +479,8 @@ hastd_secondary(struct hast_resource *re
 }
 
 static void
-reqlog(int loglevel, int debuglevel, int error, struct hio *hio, const char 
*fmt, ...)
+reqlog(int loglevel, int debuglevel, int error, struct hio *hio,
+const char *fmt, ...)
 {
char msg[1024];
va_list ap;
@@ -838,7 +843,7 @@ send_thread(void *arg)
nv_add_int16(nvout, hio->hio_error, "error");
if (hast_proto_send(res, res->hr_remoteout, nvout, data,
length) == -1) {
-   secondary_exit(EX_TEMPFAIL, "Unable to send reply.");
+   secondary_exit(EX_TEMPFAIL, "Unable to send reply");
}
nv_free(nvout);
pjdlog_debug(2, "send: (%p) Moving request to the free queue.",
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230093 - stable/8/sbin/dhclient

2012-01-13 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 13 23:25:58 2012
New Revision: 230093
URL: http://svn.freebsd.org/changeset/base/230093

Log:
  Merge r228463, that explicily uses 255.0.0.0 mask for the temporary prefix.
  This change isn't actually needed in the stable/8, but let it be here, in
  case if anyone tries to run stable/8 world on a head/ kernel.

Modified:
  stable/8/sbin/dhclient/dhclient-script
Directory Properties:
  stable/8/sbin/dhclient/   (props changed)

Modified: stable/8/sbin/dhclient/dhclient-script
==
--- stable/8/sbin/dhclient/dhclient-script  Fri Jan 13 23:25:35 2012
(r230092)
+++ stable/8/sbin/dhclient/dhclient-script  Fri Jan 13 23:25:58 2012
(r230093)
@@ -305,7 +305,7 @@ MEDIUM)
 
 PREINIT)
delete_old_alias
-   $IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 
255.255.255.255 up
+   $IFCONFIG $interface inet alias 0.0.0.0 netmask 255.0.0.0 broadcast 
255.255.255.255 up
;;
 
 ARPCHECK|ARPSEND)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2012-01-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Jan 13 23:31:36 2012
New Revision: 230094
URL: http://svn.freebsd.org/changeset/base/230094

Log:
  Fix backtrace for MIPS64:
  - Properly print 64-bit addresses
  - Get whole 64 bits of address using kdbpeekd
  - Make check for kernel address compatible with MIPS64

Modified:
  head/sys/mips/include/db_machdep.h
  head/sys/mips/mips/db_trace.c
  head/sys/mips/mips/support.S

Modified: head/sys/mips/include/db_machdep.h
==
--- head/sys/mips/include/db_machdep.h  Fri Jan 13 23:25:58 2012
(r230093)
+++ head/sys/mips/include/db_machdep.h  Fri Jan 13 23:31:36 2012
(r230094)
@@ -93,6 +93,7 @@ db_addr_t next_instr_address(db_addr_t, 
 int db_inst_type(int);
 db_addr_t branch_taken(int inst, db_addr_t pc);
 void stacktrace_subr(register_t pc, register_t sp, register_t ra, int 
(*)(const char *, ...));
-int kdbpeek(int *);
+int32_t kdbpeek(int *);
+int64_t kdbpeekd(int *);
 
 #endif /* !_MIPS_DB_MACHDEP_H_ */

Modified: head/sys/mips/mips/db_trace.c
==
--- head/sys/mips/mips/db_trace.c   Fri Jan 13 23:25:58 2012
(r230093)
+++ head/sys/mips/mips/db_trace.c   Fri Jan 13 23:31:36 2012
(r230094)
@@ -49,10 +49,13 @@ extern char edata[];
  */
 #defineMIPS_END_OF_FUNCTION(ins)   ((ins) == 0x03e8)
 
-/*
- * kdbpeekD(addr) - skip one word starting at 'addr', then read the second word
- */
-#definekdbpeekD(addr)  kdbpeek(((int *)(addr)) + 1)
+#if defined(__mips_n64)
+#  define  MIPS_IS_VALID_KERNELADDR(reg)   reg) & 3) == 0) && \
+   ((vm_offset_t)(reg) >= 
MIPS_XKPHYS_START))
+#else
+#  define  MIPS_IS_VALID_KERNELADDR(reg)   reg) & 3) == 0) && \
+   ((vm_offset_t)(reg) >= 
MIPS_KSEG0_START))
+#endif
 
 /*
  * Functions ``special'' enough to print by name
@@ -141,8 +144,8 @@ loop:
}
/* check for bad SP: could foul up next frame */
/*XXX MIPS64 bad: this hard-coded SP is lame */
-   if (sp & 3 || (uintptr_t)sp < 0x8000u) {
-   (*printfn) ("SP 0x%x: not in kernel\n", sp);
+   if (!MIPS_IS_VALID_KERNELADDR(sp)) {
+   (*printfn) ("SP 0x%jx: not in kernel\n", sp);
ra = 0;
subr = 0;
goto done;
@@ -182,8 +185,8 @@ loop:
}
/* check for bad PC */
/*XXX MIPS64 bad: These hard coded constants are lame */
-   if (pc & 3 || pc < (uintptr_t)0x8000) {
-   (*printfn) ("PC 0x%x: not in kernel\n", pc);
+   if (!MIPS_IS_VALID_KERNELADDR(pc)) {
+   (*printfn) ("PC 0x%jx: not in kernel\n", pc);
ra = 0;
goto done;
}
@@ -304,27 +307,27 @@ loop:
mask |= (1 << i.IType.rt);
switch (i.IType.rt) {
case 4:/* a0 */
-   args[0] = kdbpeekD((int *)(sp + 
(short)i.IType.imm));
+   args[0] = kdbpeekd((int *)(sp + 
(short)i.IType.imm));
valid_args[0] = 1;
break;
 
case 5:/* a1 */
-   args[1] = kdbpeekD((int *)(sp + 
(short)i.IType.imm));
+   args[1] = kdbpeekd((int *)(sp + 
(short)i.IType.imm));
valid_args[1] = 1;
break;
 
case 6:/* a2 */
-   args[2] = kdbpeekD((int *)(sp + 
(short)i.IType.imm));
+   args[2] = kdbpeekd((int *)(sp + 
(short)i.IType.imm));
valid_args[2] = 1;
break;
 
case 7:/* a3 */
-   args[3] = kdbpeekD((int *)(sp + 
(short)i.IType.imm));
+   args[3] = kdbpeekd((int *)(sp + 
(short)i.IType.imm));
valid_args[3] = 1;
break;
 
case 31:/* ra */
-   ra = kdbpeekD((int *)(sp + (short)i.IType.imm));
+   ra = kdbpeekd((int *)(sp + (short)i.IType.imm));
}
break;
 
@@ -350,7 +353,7 @@ done:
(*printfn)("?");
}
 
-   (*printfn) (") ra %x sp %x sz %d\n", ra, sp, stksize);
+   (*printfn) (") ra %jx sp %jx sz %d\n", ra, sp, stksize);
 
if (ra) {
if (pc == ra && stksize == 0)

Modified: head/sys/mips/mips/support.S
==
--- head/sys/mips/mips/support.SFri Jan 13 23:25:58 2012
(r230093)
+++ head/sys/mips/mips/support.S  

svn commit: r230095 - in head: bin/sh tools/regression/bin/sh/builtins

2012-01-13 Thread Jilles Tjoelker
Author: jilles
Date: Fri Jan 13 23:32:27 2012
New Revision: 230095
URL: http://svn.freebsd.org/changeset/base/230095

Log:
  sh: Properly show "Not a directory" error in cd builtin.
  
  The errno message display added in r92 did not take attempting to
  cd to a non-directory or something that cannot be stat()ed into account.
  
  PR:   bin/164070
  MFC after:10 days

Added:
  head/tools/regression/bin/sh/builtins/cd8.0   (contents, props changed)
Modified:
  head/bin/sh/cd.c

Modified: head/bin/sh/cd.c
==
--- head/bin/sh/cd.cFri Jan 13 23:31:36 2012(r230094)
+++ head/bin/sh/cd.cFri Jan 13 23:32:27 2012(r230095)
@@ -130,7 +130,12 @@ cdcmd(int argc, char **argv)
(path = bltinlookup("CDPATH", 1)) == NULL)
path = nullstr;
while ((p = padvance(&path, dest)) != NULL) {
-   if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) {
+   if (stat(p, &statb) < 0) {
+   if (errno != ENOENT)
+   errno1 = errno;
+   } else if (!S_ISDIR(statb.st_mode))
+   errno1 = ENOTDIR;
+   else {
if (!print) {
/*
 * XXX - rethink

Added: head/tools/regression/bin/sh/builtins/cd8.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/cd8.0 Fri Jan 13 23:32:27 2012
(r230095)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+# The exact wording of the error message is not standardized, but giving
+# a description of the errno is useful.
+
+LC_ALL=C
+export LC_ALL
+r=0
+
+t() {
+   exec 3>&1
+   errmsg=`cd "$1" 2>&1 >&3 3>&-`
+   exec 3>&-
+   case $errmsg in
+   *[Nn]ot\ a\ directory*)
+   ;;
+   *)
+   printf "Wrong error message for %s: %s\n" "$1" "$errmsg"
+   r=3
+   ;;
+   esac
+}
+
+t /dev/tty
+t /dev/tty/x
+exit $r
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230097 - head/sys/kern

2012-01-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Sat Jan 14 00:36:07 2012
New Revision: 230097
URL: http://svn.freebsd.org/changeset/base/230097

Log:
  Fix kernel modules loading for MIPS64 kernel:
  
  On amd64, link_elf_obj.c must specify KERNBASE rather than
  VM_MIN_KERNEL_ADDRESS to vm_map_find() because kernel loadable
  modules must be mapped for execution in the same upper region
  of the kernel map as the kernel code and data segments.
  
  For MIPS32 KERNBASE lies below KVA area (it's less than
  VM_MIN_KERNEL_ADDRESS) so basically vm_map_find got whole
  KVA to look through. On MIPS64 it's not the case because
  KERNBASE is set to the very end of XKSEG, well out of KVA
  bounds, so vm_map_find always fails. We should use
  VM_MIN_KERNEL_ADDRESS as a base for vm_map_find.
  
  Details obtained from: alc@

Modified:
  head/sys/kern/link_elf_obj.c

Modified: head/sys/kern/link_elf_obj.c
==
--- head/sys/kern/link_elf_obj.cSat Jan 14 00:28:02 2012
(r230096)
+++ head/sys/kern/link_elf_obj.cSat Jan 14 00:36:07 2012
(r230097)
@@ -684,7 +684,11 @@ link_elf_load_file(linker_class_t cls, c
 * location of code and data in the kernel's address space, request a
 * mapping that is above the kernel.  
 */
+#ifdef __amd64__
mapbase = KERNBASE;
+#else
+   mapbase = VM_MIN_KERNEL_ADDRESS;
+#endif
error = vm_map_find(kernel_map, ef->object, 0, &mapbase,
round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
if (error) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230099 - head/etc/rc.d

2012-01-13 Thread Doug Barton
Author: dougb
Date: Sat Jan 14 02:18:41 2012
New Revision: 230099
URL: http://svn.freebsd.org/changeset/base/230099

Log:
  Prepare for the removal of set_rcvar() by changing the rcvar=
  assignments to the literal values it would have returned.
  
  The concept of set_rcvar() was nice in theory, but the forks
  it creates are a drag on the startup process, which is especially
  noticeable on slower systems, such as embedded ones.
  
  During the discussion on freebsd-rc@ a preference was expressed for
  using ${name}_enable instead of the literal values. However the
  code portability concept doesn't really apply since there are so
  many other places where the literal name has to be searched for
  and replaced. Also, using the literal value is also a tiny bit
  faster than dereferencing the variables, and every little bit helps.

Modified:
  head/etc/rc.d/accounting
  head/etc/rc.d/amd
  head/etc/rc.d/apm
  head/etc/rc.d/apmd
  head/etc/rc.d/bootparams
  head/etc/rc.d/bsnmpd
  head/etc/rc.d/bthidd
  head/etc/rc.d/cleanvar
  head/etc/rc.d/cleartmp
  head/etc/rc.d/cron
  head/etc/rc.d/ddb
  head/etc/rc.d/devd
  head/etc/rc.d/dmesg
  head/etc/rc.d/ftp-proxy
  head/etc/rc.d/ftpd
  head/etc/rc.d/gptboot
  head/etc/rc.d/hastd
  head/etc/rc.d/hcsecd
  head/etc/rc.d/hostapd
  head/etc/rc.d/inetd
  head/etc/rc.d/ip6addrctl
  head/etc/rc.d/ipfilter
  head/etc/rc.d/ipfs
  head/etc/rc.d/ipmon
  head/etc/rc.d/ipnat
  head/etc/rc.d/ipsec
  head/etc/rc.d/ipxrouted
  head/etc/rc.d/jail
  head/etc/rc.d/keyserv
  head/etc/rc.d/lpd
  head/etc/rc.d/mountd
  head/etc/rc.d/moused
  head/etc/rc.d/mroute6d
  head/etc/rc.d/mrouted
  head/etc/rc.d/natd
  head/etc/rc.d/netwait
  head/etc/rc.d/newsyslog
  head/etc/rc.d/nfscbd
  head/etc/rc.d/nfsd
  head/etc/rc.d/nfsuserd
  head/etc/rc.d/nscd
  head/etc/rc.d/ntpd
  head/etc/rc.d/ntpdate
  head/etc/rc.d/pf
  head/etc/rc.d/pflog
  head/etc/rc.d/pfsync
  head/etc/rc.d/powerd
  head/etc/rc.d/ppp
  head/etc/rc.d/pppoed
  head/etc/rc.d/quota
  head/etc/rc.d/rarpd
  head/etc/rc.d/rfcomm_pppd_server
  head/etc/rc.d/route6d
  head/etc/rc.d/routed
  head/etc/rc.d/rpcbind
  head/etc/rc.d/rtadvd
  head/etc/rc.d/rtsold
  head/etc/rc.d/rwho
  head/etc/rc.d/sdpd
  head/etc/rc.d/sendmail
  head/etc/rc.d/sshd
  head/etc/rc.d/syslogd
  head/etc/rc.d/timed
  head/etc/rc.d/ubthidhci
  head/etc/rc.d/virecover
  head/etc/rc.d/watchdogd

Modified: head/etc/rc.d/accounting
==
--- head/etc/rc.d/accountingSat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/accountingSat Jan 14 02:18:41 2012(r230099)
@@ -11,7 +11,7 @@
 . /etc/rc.subr
 
 name="accounting"
-rcvar=`set_rcvar`
+rcvar="accounting_enable"
 accounting_command="/usr/sbin/accton"
 accounting_file="/var/account/acct"
 

Modified: head/etc/rc.d/amd
==
--- head/etc/rc.d/amd   Sat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/amd   Sat Jan 14 02:18:41 2012(r230099)
@@ -11,7 +11,7 @@
 . /etc/rc.subr
 
 name="amd"
-rcvar=`set_rcvar`
+rcvar="amd_enable"
 command="/usr/sbin/${name}"
 start_precmd="amd_precmd"
 command_args="&"

Modified: head/etc/rc.d/apm
==
--- head/etc/rc.d/apm   Sat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/apm   Sat Jan 14 02:18:41 2012(r230099)
@@ -11,7 +11,7 @@
 . /etc/rc.subr
 
 name="apm"
-rcvar=`set_rcvar`
+rcvar="apm_enable"
 start_precmd="apm_precmd"
 command="/usr/sbin/${name}"
 start_cmd="${command} -e enable"

Modified: head/etc/rc.d/apmd
==
--- head/etc/rc.d/apmd  Sat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/apmd  Sat Jan 14 02:18:41 2012(r230099)
@@ -11,7 +11,7 @@
 . /etc/rc.subr
 
 name="apmd"
-rcvar=`set_rcvar`
+rcvar="apmd_enable"
 command="/usr/sbin/${name}"
 start_precmd="apmd_prestart"
 

Modified: head/etc/rc.d/bootparams
==
--- head/etc/rc.d/bootparamsSat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/bootparamsSat Jan 14 02:18:41 2012(r230099)
@@ -11,7 +11,7 @@
 . /etc/rc.subr
 
 name="bootparamd"
-rcvar=`set_rcvar`
+rcvar="bootparamd_enable"
 required_files="/etc/bootparams"
 command="/usr/sbin/${name}"
 

Modified: head/etc/rc.d/bsnmpd
==
--- head/etc/rc.d/bsnmpdSat Jan 14 00:53:26 2012(r230098)
+++ head/etc/rc.d/bsnmpdSat Jan 14 02:18:41 2012(r230099)
@@ -10,7 +10,7 @@
 . /etc/rc.subr
 
 name="bsnmpd"
-rcvar=`set_rcvar`
+rcvar="bsnmpd_enable"
 command="/usr/sbin/${name}"
 pidfile="/var/run/snmpd.pid"
 

Modified: head/etc/rc.d/bthidd
==
--- head/etc/rc

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

2012-01-13 Thread Rick Macklem
Author: rmacklem
Date: Sat Jan 14 04:04:58 2012
New Revision: 230100
URL: http://svn.freebsd.org/changeset/base/230100

Log:
  Tai Horgan reported via email that there were two places in
  the new NFSv4 server where the code follows the wrong list.
  Fortunately, for these fairly rare cases, the lc_stateid[]
  lists are normally empty. This patch fixes the code to
  follow the correct list.
  
  Reported by:  tai.horgan at isilon.com
  Discussed with:   zack
  MFC after:2 weeks

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

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Sat Jan 14 02:18:41 2012
(r230099)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Sat Jan 14 04:04:58 2012
(r230100)
@@ -315,7 +315,7 @@ nfsrv_setclient(struct nfsrv_descript *n
for (i = 0; i < NFSSTATEHASHSIZE; i++) {
LIST_NEWHEAD(&new_clp->lc_stateid[i],
&clp->lc_stateid[i], ls_hash);
-   LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list)
+   LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
tstp->ls_clp = new_clp;
}
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
@@ -369,7 +369,7 @@ nfsrv_setclient(struct nfsrv_descript *n
for (i = 0; i < NFSSTATEHASHSIZE; i++) {
LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i],
ls_hash);
-   LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list)
+   LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash)
tstp->ls_clp = new_clp;
}
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r230101 - head/sys/ufs/ffs

2012-01-13 Thread Kirk McKusick
Author: mckusick
Date: Sat Jan 14 07:26:16 2012
New Revision: 230101
URL: http://svn.freebsd.org/changeset/base/230101

Log:
  Convert FFS mount error messages from kernel printf's to using the
  vfs_mount_error error message facility provided by the nmount
  interface.
  
  Clean up formatting of mount warnings which still need to use
  kernel printf's since they do not return errors.
  
  Requested by: Craig Rodrigues 
  MFC after: 2 weeks

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Sat Jan 14 04:04:58 2012
(r230100)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Sat Jan 14 07:26:16 2012
(r230101)
@@ -196,11 +196,13 @@ ffs_mount(struct mount *mp)
if (mp->mnt_flag & MNT_UPDATE) {
if (VFSTOUFS(mp)->um_fs->fs_ronly == 0 &&
 vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) {
-   printf("Checker enable: Must be read-only\n");
+   vfs_mount_error(mp,
+   "Checker enable: Must be read-only");
return (EINVAL);
}
} else if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) {
-   printf("Checker enable: Must be read-only\n");
+   vfs_mount_error(mp,
+   "Checker enable: Must be read-only");
return (EINVAL);
}
/* Set to -1 if we are done */
@@ -210,8 +212,9 @@ ffs_mount(struct mount *mp)
 
if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) {
if (mntorflags & MNT_ACLS) {
-   printf("WARNING: \"acls\" and \"nfsv4acls\" "
-   "options are mutually exclusive\n");
+   vfs_mount_error(mp,
+   "\"acls\" and \"nfsv4acls\" options "
+   "are mutually exclusive");
return (EINVAL);
}
mntorflags |= MNT_NFS4ACLS;
@@ -292,8 +295,8 @@ ffs_mount(struct mount *mp)
}
if (fs->fs_pendingblocks != 0 ||
fs->fs_pendinginodes != 0) {
-   printf("%s: %s: blocks %jd files %d\n",
-   fs->fs_fsmnt, "update error",
+   printf("WARNING: %s Update error: blocks %jd "
+   "files %d\n", fs->fs_fsmnt, 
(intmax_t)fs->fs_pendingblocks,
fs->fs_pendinginodes);
fs->fs_pendingblocks = 0;
@@ -336,7 +339,8 @@ ffs_mount(struct mount *mp)
 * If we are running a checker, do not allow upgrade.
 */
if (ump->um_fsckpid > 0) {
-   printf("Active checker, cannot rw upgrade\n");
+   vfs_mount_error(mp,
+   "Active checker, cannot upgrade to write");
return (EINVAL);
}
/*
@@ -360,15 +364,16 @@ ffs_mount(struct mount *mp)
((fs->fs_flags &
 (FS_SUJ | FS_NEEDSFSCK)) == 0 &&
 (fs->fs_flags & FS_DOSOFTDEP))) {
-   printf("WARNING: %s was not %s\n",
-  fs->fs_fsmnt, "properly dismounted");
+   printf("WARNING: %s was not properly "
+  "dismounted\n", fs->fs_fsmnt);
} else {
-   printf(
-"WARNING: R/W mount of %s denied.  Filesystem is not clean - run fsck\n",
-   fs->fs_fsmnt);
-   if (fs->fs_flags & FS_SUJ)
-   printf(
-"WARNING: Forced mount will invalidate journal contents\n");
+   vfs_mount_error(mp,
+  "R/W mount of %s denied. %s.%s",
+  fs->fs_fsmnt,
+  "Filesystem is not clean - run fsck",
+  (fs->fs_flags & FS_SUJ) == 0 ? "" :
+  " Forced mount will invalidate"
+  " journal contents");
return (EPERM);
}
}
@@ -439,7 +444,8 @@ f