svn commit: r245783 - head/sys/netinet

2013-01-22 Thread Lawrence Stewart
Author: lstewart
Date: Tue Jan 22 09:44:21 2013
New Revision: 245783
URL: http://svnweb.freebsd.org/changeset/base/245783

Log:
  Simplify and fix a bug in cc_ack_received()'s are we congestion window 
limited
  logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
  unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and 
could
  therefore potentially corrupt the result (although under normal operation,
  neither variable should legitmately exceed 32 bits).
  
  [1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html
  
  Submitted by: jhb
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Jan 22 08:09:43 2013
(r245782)
+++ head/sys/netinet/tcp_input.cTue Jan 22 09:44:21 2013
(r245783)
@@ -285,7 +285,7 @@ cc_ack_received(struct tcpcb *tp, struct
INP_WLOCK_ASSERT(tp-t_inpcb);
 
tp-ccv-bytes_this_ack = BYTES_THIS_ACK(tp, th);
-   if (tp-snd_cwnd == min(tp-snd_cwnd, tp-snd_wnd))
+   if (tp-snd_cwnd = tp-snd_wnd)
tp-ccv-flags |= CCF_CWND_LIMITED;
else
tp-ccv-flags = ~CCF_CWND_LIMITED;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245792 - head/usr.sbin/bsdinstall

2013-01-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Jan 22 15:26:19 2013
New Revision: 245792
URL: http://svnweb.freebsd.org/changeset/base/245792

Log:
  Improve documentation of BSDINSTALL_DISTSITE and mdoc.

Modified:
  head/usr.sbin/bsdinstall/bsdinstall.8

Modified: head/usr.sbin/bsdinstall/bsdinstall.8
==
--- head/usr.sbin/bsdinstall/bsdinstall.8   Tue Jan 22 12:40:00 2013
(r245791)
+++ head/usr.sbin/bsdinstall/bsdinstall.8   Tue Jan 22 15:26:19 2013
(r245792)
@@ -120,7 +120,9 @@ but non-interactively according to the d
 .Ar parameters .
 Each disk setup is specified by a three-part argument:
 .Pp
-.Ar disk [scheme] [{partitions}]
+.Ar disk
+.Op Ar scheme
+.Op Ar {partitions}
 .Pp
 Multiple disk setups are separated by semicolons. The
 .Ar disk
@@ -141,7 +143,9 @@ argument is also optional and specifies 
 It consists of a comma-separated list of partitions to create enclosed in
 curly braces. Each partition declaration takes the form
 .Pp
-.Ar size type [mount point]
+.Ar size
+.Ar type
+.Op Ar mount point
 .Pp
 .Ar size
 specifies the partition size to create in bytes (K, M, and G suffixes
@@ -209,13 +213,27 @@ process. Many are used internally during
 default values for most installation scenarios. Others are set by various
 interactive user prompts, and can be usefully overridden when making scripted
 or customized installers.
-.Bl -tag -width .Ev BSDINSTALL_DISTDIR
+.Bl -tag -width .Ev BSDINSTALL_DISTSITE
 .It Ev DISTRIBUTIONS
 The set of distributions to install (e.g. base kernel ports). Default: none
 .It Ev BSDINSTALL_DISTDIR
 The directory in which the distribution files can be found (or to which they
 should be downloaded). Default:
 .Pa /usr/freebsd-dist
+.It Ev BSDINSTALL_DISTSITE
+URL from which the distribution files should be downloaded if they are not
+already present in the directory defined by
+.Ev BSDINSTALL_DISTDIR .
+This should be a full path to the files, including architecture and release
+names. Most targets (e.g.
+.Cm auto
+and
+.Cm jail )
+that prompt for a
+.Fx
+mirror will skip that step if this variable is already defined in the
+environment. Example:
+.Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE
 .It Ev BSDINSTALL_CHROOT
 The directory into which the distribution files should be unpacked and the
 directory at which the root file system of the new system should be mounted.
@@ -286,8 +304,9 @@ which is passed to the
 .Cm scriptedpart
 target to control disk setup.
 .Ss SETUP SCRIPT
-Following the preamble is a shell script, beginning with a #! declaration.
-This script will be run at the end of the installation process inside a
+Following the preamble is an optional shell script, beginning with a #!
+declaration. This script will be run at the end of the installation process
+inside a
 .Xr chroot 8
 environment in the newly installed system and can be used to set up
 configuration files, install packages, etc. Note that newly configured
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245793 - head/usr.bin/xinstall

2013-01-22 Thread Brooks Davis
Author: brooks
Date: Tue Jan 22 16:23:08 2013
New Revision: 245793
URL: http://svnweb.freebsd.org/changeset/base/245793

Log:
  Make install -l s[ar] act like ln -sfh as intended. This fixes
  installation of symbolic links where the target is a link is to an
  existing directory.

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

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cTue Jan 22 15:26:19 2013
(r245792)
+++ head/usr.bin/xinstall/xinstall.cTue Jan 22 16:23:08 2013
(r245793)
@@ -336,8 +336,21 @@ main(int argc, char *argv[])
/* NOTREACHED */
}
 
-   no_target = stat(to_name = argv[argc - 1], to_sb);
+   to_name = argv[argc - 1];
+   no_target = stat(to_name, to_sb);
if (!no_target  S_ISDIR(to_sb.st_mode)) {
+   if (dolink  LN_SYMBOLIC) {
+   if (lstat(to_name, to_sb) != 0)
+   err(EX_OSERR, %s vanished, to_name);
+   if (S_ISLNK(to_sb.st_mode)) {
+   if (argc != 2) {
+   errno = ENOTDIR;
+   err(EX_USAGE, %s, to_name);
+   }
+   install(*argv, to_name, fset, iflags);
+   exit(EX_OK);
+   }
+   }
for (; *argv != to_name; ++argv)
install(*argv, to_name, fset, iflags | DIRECTORY);
exit(EX_OK);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245796 - head/usr.sbin/bsdinstall/partedit

2013-01-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Jan 22 17:06:28 2013
New Revision: 245796
URL: http://svnweb.freebsd.org/changeset/base/245796

Log:
  Improve error handling and remove an unnecessary check on geom provider
  type. GEOM provider names can't duplicate (or shouldn't -- devfs will either
  break or only use the first one if they do) so using the first provider
  by that name is a sufficient check. This also lets the scripted partitioner
  install onto gmirror and geli and such things.

Modified:
  head/usr.sbin/bsdinstall/partedit/part_wizard.c
  head/usr.sbin/bsdinstall/partedit/partedit.c
  head/usr.sbin/bsdinstall/partedit/scripted.c

Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c
==
--- head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jan 22 17:05:26 
2013(r245795)
+++ head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jan 22 17:06:28 
2013(r245796)
@@ -167,12 +167,6 @@ provider_for_name(struct gmesh *mesh, co
struct ggeom *gp;
 
LIST_FOREACH(classp, mesh-lg_class, lg_class) {
-   if (strcmp(classp-lg_name, DISK) != 0 
-   strcmp(classp-lg_name, PART) != 0 
-   strcmp(classp-lg_name, RAID) != 0 
-   strcmp(classp-lg_name, MD) != 0)
-   continue;
-
LIST_FOREACH(gp, classp-lg_geom, lg_geom) {
if (LIST_EMPTY(gp-lg_provider))
continue;

Modified: head/usr.sbin/bsdinstall/partedit/partedit.c
==
--- head/usr.sbin/bsdinstall/partedit/partedit.cTue Jan 22 17:05:26 
2013(r245795)
+++ head/usr.sbin/bsdinstall/partedit/partedit.cTue Jan 22 17:06:28 
2013(r245796)
@@ -97,8 +97,12 @@ main(int argc, const char **argv)
the Finish button.;
part_wizard();
} else if (strcmp(basename(argv[0]), scriptedpart) == 0) {
-   scripted_editor(argc, argv);
+   error = scripted_editor(argc, argv);
prompt = NULL;
+   if (error != 0) {
+   end_dialog();
+   return (error);
+   }
} else {
prompt = Create partitions for FreeBSD. No changes will be 
made until you select Finish.;

Modified: head/usr.sbin/bsdinstall/partedit/scripted.c
==
--- head/usr.sbin/bsdinstall/partedit/scripted.cTue Jan 22 17:05:26 
2013(r245795)
+++ head/usr.sbin/bsdinstall/partedit/scripted.cTue Jan 22 17:06:28 
2013(r245796)
@@ -45,12 +45,6 @@ provider_for_name(struct gmesh *mesh, co
struct ggeom *gp;
 
LIST_FOREACH(classp, mesh-lg_class, lg_class) {
-   if (strcmp(classp-lg_name, DISK) != 0 
-   strcmp(classp-lg_name, PART) != 0 
-   strcmp(classp-lg_name, RAID) != 0 
-   strcmp(classp-lg_name, MD) != 0)
-   continue;
-
LIST_FOREACH(gp, classp-lg_geom, lg_geom) {
if (LIST_EMPTY(gp-lg_provider))
continue;
@@ -81,6 +75,11 @@ part_config(char *disk, const char *sche
scheme = default_scheme();
 
error = geom_gettree(mesh);
+   if (provider_for_name(mesh, disk) == NULL) {
+   fprintf(stderr, GEOM provider %s not found\n, disk);
+   geom_deletetree(mesh);
+   return (-1);
+   }
 
/* Remove any existing partitioning and create new scheme */
LIST_FOREACH(classp, mesh.lg_class, lg_class)
@@ -183,7 +182,7 @@ int parse_disk_config(char *input)
} while (input != NULL  *input != 0);
 
if (disk != NULL)
-   part_config(disk, scheme, partconfig);
+   return (part_config(disk, scheme, partconfig));
 
return (0);
 }
@@ -192,7 +191,7 @@ int
 scripted_editor(int argc, const char **argv)
 {
char *token;
-   int i, len = 0;
+   int i, error = 0, len = 0;
 
for (i = 1; i  argc; i++)
len += strlen(argv[i]) + 1;
@@ -203,8 +202,11 @@ scripted_editor(int argc, const char **a
strcat(input, argv[i]);
}
 
-   while ((token = strsep(input, ;)) != NULL)
-   parse_disk_config(token);
+   while ((token = strsep(input, ;)) != NULL) {
+   error = parse_disk_config(token);
+   if (error != 0)
+   return (error);
+   }
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r245536 - head/tools/tools/notescheck

2013-01-22 Thread John Baldwin
On Wednesday, January 16, 2013 11:20:54 pm Eitan Adler wrote:
 Author: eadler
 Date: Thu Jan 17 04:20:53 2013
 New Revision: 245536
 URL: http://svnweb.freebsd.org/changeset/base/245536
 
 Log:
   Convert to Python 3
   
   Approved by:cperciva

Do we really want to do this?  The ports tree still installs 2.7 by default 
IIRC, and I for one always use 2.x (and I wrote this script originally).  Your 
changes make this script no longer work with 2.x.  I think we should defer 
switching various scripts to Python 3 until we start installing it as the 
default python.

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


svn commit: r245803 - in head: . gnu/usr.bin share/man/man5 share/mk usr.bin/dtc

2013-01-22 Thread David Chisnall
Author: theraven
Date: Tue Jan 22 17:49:51 2013
New Revision: 245803
URL: http://svnweb.freebsd.org/changeset/base/245803

Log:
  Import new (BSDL) device tree compiler.  Now built by default, so that it 
can't
  be used on the host system (and not installed on the device, if required).  
The
  GPL'd one is still available if there are any devices that need it (make
  universe passes with it, including kernels that use fdt, but there may be some
  out-of-tree ones).  WITH_GPL_DTC can be used to select the old one, for now.
  
  Probably won't be MFC'd, but we'll remove the GPL'd version in head after the
  new one has had a lot more testing and ship it in 10.0.

Added:
  head/usr.bin/dtc/
  head/usr.bin/dtc/HACKING   (contents, props changed)
  head/usr.bin/dtc/Makefile   (contents, props changed)
  head/usr.bin/dtc/checking.cc   (contents, props changed)
  head/usr.bin/dtc/checking.hh   (contents, props changed)
  head/usr.bin/dtc/dtb.cc   (contents, props changed)
  head/usr.bin/dtc/dtb.hh   (contents, props changed)
  head/usr.bin/dtc/dtc.1   (contents, props changed)
  head/usr.bin/dtc/dtc.cc   (contents, props changed)
  head/usr.bin/dtc/fdt.cc   (contents, props changed)
  head/usr.bin/dtc/fdt.hh   (contents, props changed)
  head/usr.bin/dtc/input_buffer.cc   (contents, props changed)
  head/usr.bin/dtc/input_buffer.hh   (contents, props changed)
  head/usr.bin/dtc/string.cc   (contents, props changed)
  head/usr.bin/dtc/string.hh   (contents, props changed)
  head/usr.bin/dtc/util.hh   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/gnu/usr.bin/Makefile
  head/share/man/man5/src.conf.5
  head/share/mk/bsd.own.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 22 17:21:08 2013(r245802)
+++ head/Makefile.inc1  Tue Jan 22 17:49:51 2013(r245803)
@@ -1112,7 +1112,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/
 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
 .endif
 
-.if ${MK_FDT} != no
+# Default to building the BSDL DTC, but build the GPL one if users explicitly
+# request it.
+_dtc= /usr.bin/dtc
+.if ${MK_GPL_DTC} != no
 _dtc= gnu/usr.bin/dtc
 .endif
 

Modified: head/gnu/usr.bin/Makefile
==
--- head/gnu/usr.bin/Makefile   Tue Jan 22 17:21:08 2013(r245802)
+++ head/gnu/usr.bin/Makefile   Tue Jan 22 17:49:51 2013(r245803)
@@ -30,7 +30,7 @@ _groff=   groff
 _cvs=  cvs
 .endif
 
-.if ${MK_FDT}  != no
+.if ${MK_GPL_DTC} != no
 _dtc=  dtc
 .endif
 

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Jan 22 17:21:08 2013
(r245802)
+++ head/share/man/man5/src.conf.5  Tue Jan 22 17:49:51 2013
(r245803)
@@ -476,6 +476,9 @@ Set to not build GPIB bus support.
 Set to not build
 .Xr gpioctl 8
 as part of the base system.
+.It Va WITH_GPL_DTC
+Set to build the GPL'd version of the device tree compiler from elinux.org,
+instead of the BSD licensed one.
 .It Va WITHOUT_GROFF
 .\ from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 
08:13:49Z uqs
 Set to not build

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Jan 22 17:21:08 2013(r245802)
+++ head/share/mk/bsd.own.mkTue Jan 22 17:49:51 2013(r245803)
@@ -364,6 +364,7 @@ __DEFAULT_NO_OPTIONS = \
 BSD_GREP \
 CLANG_EXTRAS \
 CTF \
+GPL_DTC \
 HESIOD \
 ICONV \
 IDEA \

Added: head/usr.bin/dtc/HACKING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/dtc/HACKINGTue Jan 22 17:49:51 2013(r245803)
@@ -0,0 +1,65 @@
+$FreeBSD$
+
+Notes for people hacking on dtc
+===
+
+This file contains some notes for people wishing to hack on dtc.
+
+Upstreaming
+---
+
+This code is developed in the FreeBSD svn repository:
+
+https://svn.freebsd.org/base/head/usr.bin/dtc
+
+If you got the source from anywhere else and wish to make changes, please
+ensure that you are working against the latest version, or you may end up
+fixing bugs that are already fixed upstream.  Although the license makes no
+requirement that you share any improvements that you make, patches are very
+welcome.
+
+C++11
+-
+
+This project currently aims to compile with g++ 4.2.1 and so doesn't make any
+use of C++11 features.  It would be a good idea to relax this restriction once
+clang is the default compiler for ARM, MIPS and PowerPC.
+
+This code makes use of a lot of iterator loops, which would be cleaner using
+the new syntax in C++11.  It also explicitly deletes a lot of objects held in

Re: svn commit: r245752 - in head: etc share/mk

2013-01-22 Thread Chris Rees
On 21 January 2013 22:40, Brooks Davis bro...@freebsd.org wrote:
 Author: brooks
 Date: Mon Jan 21 22:40:39 2013
 New Revision: 245752
 URL: http://svnweb.freebsd.org/changeset/base/245752

 Log:
   Replace all known uses of ln in the build process with appropriate
   install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK
   variables.

   Sponsored by: DARPA, AFRL
   Reviewed by:  ian, ray, rpaulo

 Modified:
   head/etc/Makefile
   head/share/mk/bsd.incs.mk
   head/share/mk/bsd.info.mk
   head/share/mk/bsd.lib.mk
   head/share/mk/bsd.links.mk
   head/share/mk/bsd.man.mk
   head/share/mk/bsd.own.mk

 Modified: head/etc/Makefile
 ==
 --- head/etc/Makefile   Mon Jan 21 22:32:00 2013(r245751)
 +++ head/etc/Makefile   Mon Jan 21 22:40:39 2013(r245752)
 @@ -324,26 +324,29 @@ distrib-dirs:
 -f $$m -p $$d; \
 ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
 done; true
 -   ln -sfh usr/src/sys ${DESTDIR}/sys
 +   ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys

This broke installworld for me, because of the different behaviour.

ln -sf overwrites existing symlinks, whereas install -l a b puts a
symlink to a inside itself... which fails on a read-only src (NFS
mounted).

Perhaps it's install misbehaving?  I can't work out if it's
bootstrapped properly; we should be using new install(1), are we?

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


Re: svn commit: r245751 - head/tools

2013-01-22 Thread Pawel Jakub Dawidek
On Mon, Jan 21, 2013 at 10:32:00PM +, Brooks Davis wrote:
 Author: brooks
 Date: Mon Jan 21 22:32:00 2013
 New Revision: 245751
 URL: http://svnweb.freebsd.org/changeset/base/245751
 
 Log:
   Implement the -l option using ln(1) to facilitate boostrapping.
   
   Ignore the new options -D, -h, -T, and -U.  Adjust -M support to ignore
   an argument.

I was doing installworld today and it failed on 'install -l ...' saying
'/sys/sys' is not empty. When I removed /sys symlink it installed ok.
Was this because of your change?

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpExhybM1Aph.pgp
Description: PGP signature


svn commit: r245804 - head/tools/tools/notescheck

2013-01-22 Thread Ed Maste
Author: emaste
Date: Tue Jan 22 18:02:48 2013
New Revision: 245804
URL: http://svnweb.freebsd.org/changeset/base/245804

Log:
  Restore Python 2.6+ compatibility
  
  SVN r245536 ported this to Python 3.  The major change was the use of the
  print function.  Unfortunately this is incompatible with Python 2, which
  is still the default version in the ports tree.
  
  Use a __future__ import to make this compatible with Python 2.6 and later.

Modified:
  head/tools/tools/notescheck/notescheck.py

Modified: head/tools/tools/notescheck/notescheck.py
==
--- head/tools/tools/notescheck/notescheck.py   Tue Jan 22 17:49:51 2013
(r245803)
+++ head/tools/tools/notescheck/notescheck.py   Tue Jan 22 18:02:48 2013
(r245804)
@@ -7,6 +7,8 @@
 #
 # $FreeBSD$
 
+from __future__ import print_function
+
 import glob
 import os.path
 import sys
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245805 - head/bin/sh

2013-01-22 Thread Joel Dahl
Author: joel (doc committer)
Date: Tue Jan 22 18:02:58 2013
New Revision: 245805
URL: http://svnweb.freebsd.org/changeset/base/245805

Log:
  Add FILES section.
  
  Discussed with:   jilles

Modified:
  head/bin/sh/sh.1

Modified: head/bin/sh/sh.1
==
--- head/bin/sh/sh.1Tue Jan 22 18:02:48 2013(r245804)
+++ head/bin/sh/sh.1Tue Jan 22 18:02:58 2013(r245805)
@@ -32,7 +32,7 @@
 .\from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\ $FreeBSD$
 .\
-.Dd January 20, 2013
+.Dd January 22, 2013
 .Dt SH 1
 .Os
 .Sh NAME
@@ -2674,6 +2674,17 @@ Additionally, all environment variables 
 at startup,
 which may affect the shell as described under
 .Sx Special Variables .
+.Sh FILES
+.Bl -tag -width /etc/suid_profileXX -compact
+.It Pa ~/.profile
+User's login profile.
+.It Pa /etc/profile
+System login profile.
+.It Pa /etc/shells
+Shell database.
+.It Pa /etc/suid_profile
+Privileged shell profile.
+.El
 .Sh EXIT STATUS
 Errors that are detected by the shell, such as a syntax error, will
 cause the shell to exit with a non-zero exit status.
@@ -2699,7 +2710,8 @@ will return the argument.
 .Xr getrlimit 2 ,
 .Xr umask 2 ,
 .Xr wctype 3 ,
-.Xr editrc 5
+.Xr editrc 5 ,
+.Xr shells 5
 .Sh HISTORY
 A
 .Nm
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r245751 - head/tools

2013-01-22 Thread Pawel Jakub Dawidek
On Tue, Jan 22, 2013 at 07:00:05PM +0100, Pawel Jakub Dawidek wrote:
 On Mon, Jan 21, 2013 at 10:32:00PM +, Brooks Davis wrote:
  Author: brooks
  Date: Mon Jan 21 22:32:00 2013
  New Revision: 245751
  URL: http://svnweb.freebsd.org/changeset/base/245751
  
  Log:
Implement the -l option using ln(1) to facilitate boostrapping.

Ignore the new options -D, -h, -T, and -U.  Adjust -M support to ignore
an argument.
 
 I was doing installworld today and it failed on 'install -l ...' saying
 '/sys/sys' is not empty. When I removed /sys symlink it installed ok.
 Was this because of your change?

I see it is fixed already, sorry for the noice.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpjrJFtm5K39.pgp
Description: PGP signature


Re: svn commit: r245536 - head/tools/tools/notescheck

2013-01-22 Thread Ed Maste
On 22 January 2013 10:50, John Baldwin j...@freebsd.org wrote:
 On Wednesday, January 16, 2013 11:20:54 pm Eitan Adler wrote:
 Author: eadler
 Date: Thu Jan 17 04:20:53 2013
 New Revision: 245536
 URL: http://svnweb.freebsd.org/changeset/base/245536

 Log:
   Convert to Python 3

   Approved by:cperciva

 Do we really want to do this?  The ports tree still installs 2.7 by default
 IIRC, and I for one always use 2.x (and I wrote this script originally).  Your
 changes make this script no longer work with 2.x.  I think we should defer
 switching various scripts to Python 3 until we start installing it as the
 default python.

I agree that this is premature while Python 3 is not the default.

Fortunately there's an easy fix for Python 2.6+ (from __future__
import print_function), which I just committed in r245804.

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


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

2013-01-22 Thread Gleb Smirnoff
Author: glebius
Date: Tue Jan 22 18:07:59 2013
New Revision: 245806
URL: http://svnweb.freebsd.org/changeset/base/245806

Log:
  Use pluralies() for entry/entries.

Modified:
  head/usr.bin/netstat/inet.c

Modified: head/usr.bin/netstat/inet.c
==
--- head/usr.bin/netstat/inet.c Tue Jan 22 18:02:58 2013(r245805)
+++ head/usr.bin/netstat/inet.c Tue Jan 22 18:07:59 2013(r245806)
@@ -699,7 +699,7 @@ tcp_stats(u_long off, const char *name, 
p(tcps_sc_sendcookie, \t%lu cookie%s sent\n);
p(tcps_sc_recvcookie, \t%lu cookie%s received\n);
 
-   p(tcps_hc_added, \t%lu hostcache entrie%s added\n);
+   p3(tcps_hc_added, \t%lu hostcache entr%s added\n);
p1a(tcps_hc_bucketoverflow, \t\t%lu bucket overflow\n);
 
p(tcps_sack_recovery_episode, \t%lu SACK recovery episode%s\n);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245807 - head/usr.bin/dtc

2013-01-22 Thread David Chisnall
Author: theraven
Date: Tue Jan 22 18:12:31 2013
New Revision: 245807
URL: http://svnweb.freebsd.org/changeset/base/245807

Log:
  Fix logic error in explicitly specified dtb versions spotted by gavin.

Modified:
  head/usr.bin/dtc/dtc.cc

Modified: head/usr.bin/dtc/dtc.cc
==
--- head/usr.bin/dtc/dtc.cc Tue Jan 22 18:07:59 2013(r245806)
+++ head/usr.bin/dtc/dtc.cc Tue Jan 22 18:12:31 2013(r245807)
@@ -164,7 +164,7 @@ main(int argc, char **argv)
debug_mode = true;
break;
case 'V':
-   if (string(optarg) == string(17))
+   if (string(optarg) != string(17))
{
fprintf(stderr, Unknown output format version: 
%s\n, optarg);
return EXIT_FAILURE;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245809 - head/usr.bin/dtc

2013-01-22 Thread David Chisnall
Author: theraven
Date: Tue Jan 22 18:15:43 2013
New Revision: 245809
URL: http://svnweb.freebsd.org/changeset/base/245809

Log:
  Fix the missing sentence that ended in the middle in the man page for dtc 
(also
  spotted by gavin).

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

Modified: head/usr.bin/dtc/dtc.1
==
--- head/usr.bin/dtc/dtc.1  Tue Jan 22 18:14:35 2013(r245808)
+++ head/usr.bin/dtc/dtc.1  Tue Jan 22 18:15:43 2013(r245809)
@@ -250,7 +250,10 @@ specification, but is in fact a label.
 The /include/ directive is not part of the standard, however it is implemented
 with the semantics compatible with the elinux.org tool.  It must appear in the
 top level of a file, and imports a new root definition.  If a file, plus all of
-its inclusions, contains multiple roots then they 
+its inclusions, contains multiple roots then they are merged.  All nodes that
+are present in the second but not the first are imported.  Any that appear in
+both are recursively merged, with properties from the second replacing those
+from the first and properties child nodes being recursively merged.
 .Sh HISTORY
 A dtc tool first appeared in
 .Fx 9.0 .
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245813 - head/share/misc

2013-01-22 Thread Dru Lavigne
Author: dru (doc committer)
Date: Tue Jan 22 18:27:19 2013
New Revision: 245813
URL: http://svnweb.freebsd.org/changeset/base/245813

Log:
  add myself to committers-doc.dot
  
  Approved by: bcr (mentor)

Modified:
  head/share/misc/committers-doc.dot

Modified: head/share/misc/committers-doc.dot
==
--- head/share/misc/committers-doc.dot  Tue Jan 22 18:25:55 2013
(r245812)
+++ head/share/misc/committers-doc.dot  Tue Jan 22 18:27:19 2013
(r245813)
@@ -58,6 +58,7 @@ brueffer [label=Christian Brueffer\nbru
 chinsan [label=Chinsan Huang\nchin...@freebsd.org\n2006/09/20]
 danger [label=Daniel Gerzo\ndan...@freebsd.org\n2006/08/20]
 delphij [label=Xin Li\ndelp...@freebsd.org\n2004/09/14]
+dru [label=Dru Lavigne\n...@freebsd.org\n2013/01/22]
 eadler [label=Eitan Adler\nead...@freebsd.org\n2012/10/15]
 ebrandi [label=Edson Brandi\nebra...@freebsd.org\n2012/09/13]
 gabor [label=Gabor Kovesdan\nga...@freebsd.org\n2007/02/02]
@@ -93,6 +94,7 @@ zeising [label=Niclas Zeising\nzeising@
 bcr - gavin
 bcr - wblock
 bcr - eadler
+bcr - dru
 
 blackend - ale
 
@@ -117,8 +119,10 @@ gabor - ebrandi
 
 gjb - wblock
 gjb - rene
+gjb - dru
 
 hrs - ryusuke
+hrs - dru
 
 jesusr - jcamou
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245815 - head/usr.bin/dtc

2013-01-22 Thread Joel Dahl
Author: joel (doc committer)
Date: Tue Jan 22 18:33:31 2013
New Revision: 245815
URL: http://svnweb.freebsd.org/changeset/base/245815

Log:
  Minor mdoc fixes.

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

Modified: head/usr.bin/dtc/dtc.1
==
--- head/usr.bin/dtc/dtc.1  Tue Jan 22 18:30:46 2013(r245814)
+++ head/usr.bin/dtc/dtc.1  Tue Jan 22 18:33:31 2013(r245815)
@@ -173,7 +173,6 @@ end of the strings table.
 .It dt_blob_end
 end of the device tree blob.
 .El
-.Pp
 .Sh CHECKERS
 The utility provides a number of semantic checks on the correctness of the
 tree.  These can be disabled with the
@@ -232,6 +231,8 @@ The warnings and errors supported by the
 This tool supports the warnings described in the
 .Sx CHECKERS
 section.
+.Sh SEE ALSO
+.Xr fdt 4
 .Sh STANDARDS
 The device tree formats understood by this tool conform to the Power.org
 Standard for Embedded Power Architecture Platform Requirements
@@ -278,6 +279,3 @@ hard to add, but will probably not be ad
 .Pp
 The current version performs a very limited set of semantic checks on the tree.
 This will be improved in future versions.
-.Sh SEE ALSO
-.Xr fdt 4
-.Pp
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r245752 - in head: etc share/mk

2013-01-22 Thread Chris Rees
On 22 January 2013 18:13, Brooks Davis bro...@freebsd.org wrote:
 On Tue, Jan 22, 2013 at 05:55:31PM +, Chris Rees wrote:
 On 21 January 2013 22:40, Brooks Davis bro...@freebsd.org wrote:
  Author: brooks
  Date: Mon Jan 21 22:40:39 2013
  New Revision: 245752
  URL: http://svnweb.freebsd.org/changeset/base/245752
 
  Log:
Replace all known uses of ln in the build process with appropriate
install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK
variables.
 
Sponsored by: DARPA, AFRL
Reviewed by:  ian, ray, rpaulo
 
  Modified:
head/etc/Makefile
head/share/mk/bsd.incs.mk
head/share/mk/bsd.info.mk
head/share/mk/bsd.lib.mk
head/share/mk/bsd.links.mk
head/share/mk/bsd.man.mk
head/share/mk/bsd.own.mk
 
  Modified: head/etc/Makefile
  ==
  --- head/etc/Makefile   Mon Jan 21 22:32:00 2013(r245751)
  +++ head/etc/Makefile   Mon Jan 21 22:40:39 2013(r245752)
  @@ -324,26 +324,29 @@ distrib-dirs:
  -f $$m -p $$d; \
  ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; 
  \
  done; true
  -   ln -sfh usr/src/sys ${DESTDIR}/sys
  +   ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys

 This broke installworld for me, because of the different behaviour.

 ln -sf overwrites existing symlinks, whereas install -l a b puts a
 symlink to a inside itself... which fails on a read-only src (NFS
 mounted).

 Perhaps it's install misbehaving?  I can't work out if it's
 bootstrapped properly; we should be using new install(1), are we?

 Sorry about that.  It's fixed.


I presume r245793, thank you :)

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


svn commit: r245816 - head/usr.bin/dtc

2013-01-22 Thread Joel Dahl
Author: joel (doc committer)
Date: Tue Jan 22 18:35:42 2013
New Revision: 245816
URL: http://svnweb.freebsd.org/changeset/base/245816

Log:
  Remove EOL whitespace.

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

Modified: head/usr.bin/dtc/dtc.1
==
--- head/usr.bin/dtc/dtc.1  Tue Jan 22 18:33:31 2013(r245815)
+++ head/usr.bin/dtc/dtc.1  Tue Jan 22 18:35:42 2013(r245816)
@@ -83,7 +83,7 @@ checker.  The full list of checkers is g
 Force the tool to attempt to generate the output, even if the input had errors.
 .It Fl h
 Display the help text and exit.
-.It Fl H Ar phandle_format 
+.It Fl H Ar phandle_format
 Specifies the type of phandle nodes to generate in the output.  Valid values
 are:
 .Pp
@@ -121,7 +121,7 @@ if the output format is not explicitly s
 Device tree source.  The ASCII representation of the FDT.
 .El
 .It Fl o Ar output_file
-The file to which to write the output.  
+The file to which to write the output.
 .It Fl R Ar entries
 The number of empty reservation table entries to pad the table with.  This is
 useful if you are generating a device tree blob for bootloader or similar that
@@ -129,11 +129,11 @@ needs to reserve some memory before pass
 .It Fl S Ar bytes
 The minimum size in bytes of the blob.  The blob will be padded after the
 strings table to ensure that it is the correct size.  This is useful for
-environments where the device tree blob must be modified in place.  
+environments where the device tree blob must be modified in place.
 .It Fl p Ar bytes
 The number of bytes of padding to add to the blob.  The blob will be padded
 after the strings table to ensure that it is the correct size.  This is useful
-for environments where the device tree blob must be modified in place.  
+for environments where the device tree blob must be modified in place.
 .It Fl W Ar [no-]checker_name
 Enable or disable a specified checker.  This is an alias for
 .Fl E .
@@ -183,16 +183,16 @@ will disable the phandle type check.  Th
 .Pp
 .Bl -tag -width no-type-phandle -compact -offset indent
 .It type-compatible
-Checks the type of the 
+Checks the type of the
 .Va compatible
 property.
 .It type-model
-Checks the type of the 
+Checks the type of the
 .Va model
 property.
 .It type-compatible
-Checks the type of the 
-.Va compatible 
+Checks the type of the
+.Va compatible
 property.
 .El
 .Sh EXAMPLES
@@ -200,7 +200,7 @@ The command:
 .Pp
 .Dl dtc -o blob.S -O asm device.dts
 .Pp
-will generate a 
+will generate a
 .Pa blob.S
 file from the device tree source
 .Pa device.dts
@@ -220,7 +220,7 @@ provided by elinux.org.  Currently, it i
 required to build FreeBSD and others that have been requested by FreeBSD
 developers.
 .Pp
-The 
+The
 .Ar fs
 input format is not supported.  This builds a tree from a Linux
 .Pa  /proc/device-tree ,
@@ -258,7 +258,7 @@ from the first and properties child node
 .Sh HISTORY
 A dtc tool first appeared in
 .Fx 9.0 .
-This version of the tool first appeared in 
+This version of the tool first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
 .An David T. Chisnall
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245817 - head/sys/fs/ext2fs

2013-01-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jan 22 18:36:31 2013
New Revision: 245817
URL: http://svnweb.freebsd.org/changeset/base/245817

Log:
  ext2fs: temporarily disable the reallocation code.
  
  Testing with fsx has revealed problems and in order to
  hunt the bugs properly we need reduce the complexity.
  
  This seems to help but is not a complete solution.
  
  MFC after:3 days

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Tue Jan 22 18:35:42 2013
(r245816)
+++ head/sys/fs/ext2fs/ext2_alloc.c Tue Jan 22 18:36:31 2013
(r245817)
@@ -151,11 +151,11 @@ nospace:
 
 static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, EXT2FS filesystem);
 
-static int doasyncfree = 1;
+static int doasyncfree = 0;
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, doasyncfree, 0,
 Use asychronous writes to update block pointers when freeing blocks);
 
-static int doreallocblks = 1;
+static int doreallocblks = 0;
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, doreallocblks, 
0, );
 
 int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r245536 - head/tools/tools/notescheck

2013-01-22 Thread Eitan Adler
On 22 January 2013 10:50, John Baldwin j...@freebsd.org wrote:
 On Wednesday, January 16, 2013 11:20:54 pm Eitan Adler wrote:
 Author: eadler
 Date: Thu Jan 17 04:20:53 2013
 New Revision: 245536
 URL: http://svnweb.freebsd.org/changeset/base/245536

 Log:
   Convert to Python 3

   Approved by:cperciva

 Do we really want to do this?  The ports tree still installs 2.7 by default
 IIRC, and I for one always use 2.x (and I wrote this script originally).  Your
 changes make this script no longer work with 2.x.  I think we should defer
 switching various scripts to Python 3 until we start installing it as the
 default python.

Okay.  I will try make sure that such changes work in both python 2
and python 3 in the future.

FWIW Python 2 is considered extended support and the end-of-life
release so we should be thinking about preparing for the future
already.


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r245803 - in head: . gnu/usr.bin share/man/man5 share/mk usr.bin/dtc

2013-01-22 Thread John Baldwin
On Tuesday, January 22, 2013 12:49:51 pm David Chisnall wrote:
 Author: theraven
 Date: Tue Jan 22 17:49:51 2013
 New Revision: 245803
 URL: http://svnweb.freebsd.org/changeset/base/245803
 
 Log:
   Import new (BSDL) device tree compiler.  Now built by default, so that it 
 can't
   be used on the host system (and not installed on the device, if required).  
 The
   GPL'd one is still available if there are any devices that need it (make
   universe passes with it, including kernels that use fdt, but there may be 
 some
   out-of-tree ones).  WITH_GPL_DTC can be used to select the old one, for now.
   
   Probably won't be MFC'd, but we'll remove the GPL'd version in head after 
 the
   new one has had a lot more testing and ship it in 10.0.
 
 Modified:
   head/Makefile.inc1
 
 Modified: head/Makefile.inc1
 ==
 --- head/Makefile.inc1Tue Jan 22 17:21:08 2013(r245802)
 +++ head/Makefile.inc1Tue Jan 22 17:49:51 2013(r245803)
 @@ -1112,7 +1112,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/
  lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
  .endif
  
 -.if ${MK_FDT} != no
 +# Default to building the BSDL DTC, but build the GPL one if users explicitly
 +# request it.
 +_dtc= /usr.bin/dtc
 +.if ${MK_GPL_DTC} != no
  _dtc= gnu/usr.bin/dtc
  .endif

Should this use usr.bin/dtc rather than /usr.bin/dtc?

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


svn commit: r245818 - head/sys/dev/altera/sdcard

2013-01-22 Thread Brooks Davis
Author: brooks
Date: Tue Jan 22 18:48:45 2013
New Revision: 245818
URL: http://svnweb.freebsd.org/changeset/base/245818

Log:
  MFP4 change 219819
  
  Remove a duplicate computation of C_SIZE_MULT.  Once is sufficient.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/altera/sdcard/altera_sdcard_io.c

Modified: head/sys/dev/altera/sdcard/altera_sdcard_io.c
==
--- head/sys/dev/altera/sdcard/altera_sdcard_io.c   Tue Jan 22 18:36:31 
2013(r245817)
+++ head/sys/dev/altera/sdcard/altera_sdcard_io.c   Tue Jan 22 18:48:45 
2013(r245818)
@@ -93,13 +93,6 @@ altera_sdcard_process_csd0(struct altera
read_bl_len = sc-as_csd.csd_data[ALTERA_SDCARD_CSD_READ_BL_LEN_BYTE];
read_bl_len = ALTERA_SDCARD_CSD_READ_BL_LEN_MASK;
 
-   byte0 = sc-as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE0];
-   byte0 = ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK0;
-   byte1 = sc-as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE1];
-   byte1 = ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK1;
-   c_size_mult = (byte0  ALTERA_SDCARD_CSD_C_SIZE_MULT_RSHIFT0) |
-   (byte0  ALTERA_SDCARD_CSD_C_SIZE_MULT_LSHIFT1);
-
byte0 = sc-as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE0];
byte0 = ALTERA_SDCARD_CSD_C_SIZE_MASK0;
byte1 = sc-as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE1];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245819 - head/sys/dev/altera/sdcard

2013-01-22 Thread Brooks Davis
Author: brooks
Date: Tue Jan 22 18:51:14 2013
New Revision: 245819
URL: http://svnweb.freebsd.org/changeset/base/245819

Log:
  MFP4 change 219820
  
  Add a missing 0 to the mask for byte0 of C_SIZE.
  
  The previous mask (0xc) worked except that the last 0-1536K of the disk
  could not be accessed since we were shifting the (wrong) bits we did
  mask off the right edge.

Modified:
  head/sys/dev/altera/sdcard/altera_sdcard.h

Modified: head/sys/dev/altera/sdcard/altera_sdcard.h
==
--- head/sys/dev/altera/sdcard/altera_sdcard.h  Tue Jan 22 18:48:45 2013
(r245818)
+++ head/sys/dev/altera/sdcard/altera_sdcard.h  Tue Jan 22 18:51:14 2013
(r245819)
@@ -138,7 +138,7 @@ voidaltera_sdcard_io_start(struct alter
  * data.  Software ease of use was not a design consideration.
  */
 #defineALTERA_SDCARD_CSD_C_SIZE_BYTE0  7
-#defineALTERA_SDCARD_CSD_C_SIZE_MASK0  0xc /* top 2 bits */
+#defineALTERA_SDCARD_CSD_C_SIZE_MASK0  0xc0/* top 2 bits */
 #defineALTERA_SDCARD_CSD_C_SIZE_RSHIFT06
 
 #defineALTERA_SDCARD_CSD_C_SIZE_BYTE1  8
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245820 - head/sys/fs/ext2fs

2013-01-22 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Jan 22 18:54:03 2013
New Revision: 245820
URL: http://svnweb.freebsd.org/changeset/base/245820

Log:
  ext2fs: make some inode fields match the ext2 spec.
  
  Ext2fs uses unsigned fields in its dinode struct.
  FreeBSD can have negative values in some of those
  fields and the inode is meant to interact with the
  system so we have never respected the unsigned
  nature of most of those fields.
  
  Block numbers and the NFS generation number do
  not need to be signed so redefine them as
  unsigned to better match the on-disk information.
  
  MFC after:1 week

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_balloc.c
  head/sys/fs/ext2fs/ext2_inode.c
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Tue Jan 22 18:51:14 2013
(r245819)
+++ head/sys/fs/ext2fs/ext2_alloc.c Tue Jan 22 18:54:03 2013
(r245820)
@@ -169,7 +169,7 @@ ext2_reallocblks(ap)
struct inode *ip;
struct vnode *vp;
struct buf *sbp, *ebp;
-   int32_t *bap, *sbap, *ebap = 0;
+   uint32_t *bap, *sbap, *ebap = 0;
struct ext2mount *ump;
struct cluster_save *buflist;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;

Modified: head/sys/fs/ext2fs/ext2_balloc.c
==
--- head/sys/fs/ext2fs/ext2_balloc.cTue Jan 22 18:51:14 2013
(r245819)
+++ head/sys/fs/ext2fs/ext2_balloc.cTue Jan 22 18:54:03 2013
(r245820)
@@ -69,7 +69,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
struct buf *bp, *nbp;
struct vnode *vp = ITOV(ip);
struct indir indirs[NIADDR + 2];
-   int32_t newb, *bap, pref;
+   uint32_t newb, *bap, pref;
int osize, nsize, num, i, error;
 
*bpp = NULL;

Modified: head/sys/fs/ext2fs/ext2_inode.c
==
--- head/sys/fs/ext2fs/ext2_inode.c Tue Jan 22 18:51:14 2013
(r245819)
+++ head/sys/fs/ext2fs/ext2_inode.c Tue Jan 22 18:54:03 2013
(r245820)
@@ -119,7 +119,7 @@ ext2_truncate(vp, length, flags, cred, t
int32_t lastblock;
struct inode *oip;
int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR];
-   int32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR];
+   uint32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR];
struct bufobj *bo;
struct m_ext2fs *fs;
struct buf *bp;
@@ -342,7 +342,9 @@ done:
 */
oip-i_size = length;
oip-i_blocks -= blocksreleased;
-   if (oip-i_blocks  0)  /* sanity */
+   if (oip-i_blocks  blocksreleased)
+   oip-i_blocks -= blocksreleased;
+   else/* sanity */
oip-i_blocks = 0;
oip-i_flag |= IN_CHANGE;
vnode_pager_setsize(ovp, length);

Modified: head/sys/fs/ext2fs/inode.h
==
--- head/sys/fs/ext2fs/inode.h  Tue Jan 22 18:51:14 2013(r245819)
+++ head/sys/fs/ext2fs/inode.h  Tue Jan 22 18:54:03 2013(r245820)
@@ -90,11 +90,11 @@ struct inode {
int32_t i_atimensec;/* Last access time. */
int32_t i_ctimensec;/* Last inode change time. */
int32_t i_birthnsec;/* Inode creation time. */
-   int32_t i_db[NDADDR];   /* Direct disk blocks. */
-   int32_t i_ib[NIADDR];   /* Indirect disk blocks. */
+   uint32_ti_db[NDADDR];   /* Direct disk blocks. */
+   uint32_ti_ib[NIADDR];   /* Indirect disk blocks. */
uint32_ti_flags;/* Status flags (chflags). */
-   int32_t i_blocks;   /* Blocks actually held. */
-   int32_t i_gen;  /* Generation number. */
+   uint32_ti_blocks;   /* Blocks actually held. */
+   uint32_ti_gen;  /* Generation number. */
uint32_ti_uid;  /* File owner. */
uint32_ti_gid;  /* File group. */
 };
@@ -162,7 +162,7 @@ struct ufid {
uint16_t ufid_len;  /* Length of structure. */
uint16_t ufid_pad;  /* Force 32-bit alignment. */
ino_tufid_ino;  /* File number (ino). */
-   int32_t  ufid_gen;  /* Generation number. */
+   uint32_t ufid_gen;  /* Generation number. */
 };
 #endif /* _KERNEL */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245821 - head/usr.bin/xinstall

2013-01-22 Thread Brooks Davis
Author: brooks
Date: Tue Jan 22 18:57:51 2013
New Revision: 245821
URL: http://svnweb.freebsd.org/changeset/base/245821

Log:
  Remove documentation of the old -M option.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/usr.bin/xinstall/install.1

Modified: head/usr.bin/xinstall/install.1
==
--- head/usr.bin/xinstall/install.1 Tue Jan 22 18:54:03 2013
(r245820)
+++ head/usr.bin/xinstall/install.1 Tue Jan 22 18:57:51 2013
(r245821)
@@ -36,7 +36,7 @@
 .Nd install binaries
 .Sh SYNOPSIS
 .Nm
-.Op Fl bCcMpSsUv
+.Op Fl bCcpSsUv
 .Op Fl B Ar suffix
 .Op Fl D Ar destdir
 .Op Fl f Ar flags
@@ -50,7 +50,7 @@
 .Op Fl T Ar tags
 .Ar file1 file2
 .Nm
-.Op Fl bCcMpSsUv
+.Op Fl bCcpSsUv
 .Op Fl B Ar suffix
 .Op Fl D Ar destdir
 .Op Fl f Ar flags
@@ -194,9 +194,6 @@ are:
 Absolute and relative have effect only for symbolic links.
 Mixed links
 are hard links for files on the same filesystem, symbolic otherwise.
-.It Fl M
-Disable all use of
-.Xr mmap 2 .
 .It Fl M Ar metalog
 Write the metadata associated with each item installed to
 .Ar metalog
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245822 - head

2013-01-22 Thread David Chisnall
Author: theraven
Date: Tue Jan 22 19:40:26 2013
New Revision: 245822
URL: http://svnweb.freebsd.org/changeset/base/245822

Log:
  Fix spurious leading / on dtc path in Makefile.inc1.  Spotted by jhb.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 22 18:57:51 2013(r245821)
+++ head/Makefile.inc1  Tue Jan 22 19:40:26 2013(r245822)
@@ -1114,7 +1114,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/
 
 # Default to building the BSDL DTC, but build the GPL one if users explicitly
 # request it.
-_dtc= /usr.bin/dtc
+_dtc= usr.bin/dtc
 .if ${MK_GPL_DTC} != no
 _dtc= gnu/usr.bin/dtc
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245823 - head/sys/netinet

2013-01-22 Thread John Baldwin
Author: jhb
Date: Tue Jan 22 19:45:04 2013
New Revision: 245823
URL: http://svnweb.freebsd.org/changeset/base/245823

Log:
  Use decimal values for UDP and TCP socket options rather than hex to avoid
  implying that these constants should be treated as bit masks.
  
  Reviewed by:  net
  MFC after:1 week

Modified:
  head/sys/netinet/tcp.h
  head/sys/netinet/udp.h

Modified: head/sys/netinet/tcp.h
==
--- head/sys/netinet/tcp.h  Tue Jan 22 19:40:26 2013(r245822)
+++ head/sys/netinet/tcp.h  Tue Jan 22 19:45:04 2013(r245823)
@@ -149,20 +149,22 @@ struct tcphdr {
 #endif /* __BSD_VISIBLE */
 
 /*
- * User-settable options (used with setsockopt).
+ * User-settable options (used with setsockopt).  These are discrete
+ * values and are not masked together.  Some values appear to be
+ * bitmasks for historical reasons.
  */
-#defineTCP_NODELAY 0x01/* don't delay send to coalesce packets 
*/
+#defineTCP_NODELAY 1   /* don't delay send to coalesce packets 
*/
 #if __BSD_VISIBLE
-#defineTCP_MAXSEG  0x02/* set maximum segment size */
-#define TCP_NOPUSH 0x04/* don't push last block of write */
-#define TCP_NOOPT  0x08/* don't use TCP options */
-#define TCP_MD5SIG 0x10/* use MD5 digests (RFC2385) */
-#defineTCP_INFO0x20/* retrieve tcp_info structure */
-#defineTCP_CONGESTION  0x40/* get/set congestion control algorithm 
*/
-#defineTCP_KEEPINIT0x80/* N, time to establish connection */
-#defineTCP_KEEPIDLE0x100   /* L,N,X start keeplives after this 
period */
-#defineTCP_KEEPINTVL   0x200   /* L,N interval between keepalives */
-#defineTCP_KEEPCNT 0x400   /* L,N number of keepalives before 
close */
+#defineTCP_MAXSEG  2   /* set maximum segment size */
+#define TCP_NOPUSH 4   /* don't push last block of write */
+#define TCP_NOOPT  8   /* don't use TCP options */
+#define TCP_MD5SIG 16  /* use MD5 digests (RFC2385) */
+#defineTCP_INFO32  /* retrieve tcp_info structure */
+#defineTCP_CONGESTION  64  /* get/set congestion control algorithm 
*/
+#defineTCP_KEEPINIT128 /* N, time to establish connection */
+#defineTCP_KEEPIDLE256 /* L,N,X start keeplives after this 
period */
+#defineTCP_KEEPINTVL   512 /* L,N interval between keepalives */
+#defineTCP_KEEPCNT 1024/* L,N number of keepalives before 
close */
 
 #defineTCP_CA_NAME_MAX 16  /* max congestion control name length */
 

Modified: head/sys/netinet/udp.h
==
--- head/sys/netinet/udp.h  Tue Jan 22 19:40:26 2013(r245822)
+++ head/sys/netinet/udp.h  Tue Jan 22 19:45:04 2013(r245823)
@@ -48,7 +48,7 @@ struct udphdr {
 /* 
  * User-settable options (used with setsockopt).
  */
-#defineUDP_ENCAP   0x01
+#defineUDP_ENCAP   1
 
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245824 - head/sys/sys

2013-01-22 Thread John Baldwin
Author: jhb
Date: Tue Jan 22 20:37:31 2013
New Revision: 245824
URL: http://svnweb.freebsd.org/changeset/base/245824

Log:
  Similar to r245823, use decimal constants for UNIX domain socket options.
  
  MFC after:1 week

Modified:
  head/sys/sys/un.h

Modified: head/sys/sys/un.h
==
--- head/sys/sys/un.h   Tue Jan 22 19:45:04 2013(r245823)
+++ head/sys/sys/un.h   Tue Jan 22 20:37:31 2013(r245824)
@@ -53,9 +53,9 @@ struct sockaddr_un {
 #if __BSD_VISIBLE
 
 /* Socket options. */
-#defineLOCAL_PEERCRED  0x001   /* retrieve peer credentials */
-#defineLOCAL_CREDS 0x002   /* pass credentials to receiver 
*/
-#defineLOCAL_CONNWAIT  0x004   /* connects block until 
accepted */
+#defineLOCAL_PEERCRED  1   /* retrieve peer credentials */
+#defineLOCAL_CREDS 2   /* pass credentials to receiver 
*/
+#defineLOCAL_CONNWAIT  4   /* connects block until 
accepted */
 
 #ifndef _KERNEL
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245825 - in head: . etc

2013-01-22 Thread Brooks Davis
Author: brooks
Date: Tue Jan 22 21:10:03 2013
New Revision: 245825
URL: http://svnweb.freebsd.org/changeset/base/245825

Log:
  Introduce a new option -DNO_ROOT that allows install and distribution
  targets to be run without root privilege.
  
  Information about ownership, group, flags, and suid bits are stored in
  the file specified by METALOG which defaults to ${DESTDIR}/METALOG.
  This file can be used in conjunction with bsdtar or makefs to generate
  archives or file system images with correct permissions.
  
  The packageworld target has been altered to use this metadata allowing
  non-root releases (subject to further changes in release/Makefile.)
  
  Sponsored by: DARPA, AFRL
  Reviewed by:  ian, ray

Modified:
  head/Makefile.inc1
  head/etc/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jan 22 20:37:31 2013(r245824)
+++ head/Makefile.inc1  Tue Jan 22 21:10:03 2013(r245825)
@@ -4,6 +4,8 @@
 # Make command line options:
 #  -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
 #  -DNO_CLEAN do not clean at all
+#  -DDB_FROM_SRC use the user/group databases in src/etc instead of
+#  the system database when installing.
 #  -DNO_SHARE do not go into share subdir
 #  -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
 #  -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
@@ -11,9 +13,8 @@
 #  -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
 #  -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
 #  -DNO_PORTSUPDATE do not update ports in ${MAKE} update
+#  -DNO_ROOT install without using root privilege
 #  -DNO_DOCUPDATE do not update doc in ${MAKE} update
-#  -DDB_FROM_SRC use the user/group databases in src/etc instead of
-#  the system database when installing.
 #  -DNO_CTF do not run the DTrace CTF conversion tools on built objects
 #  LOCAL_DIRS=list of dirs to add additional dirs to the SUBDIR list
 #  LOCAL_LIB_DIRS=list of dirs to add additional dirs to libraries target
@@ -21,6 +22,8 @@
 #  to be created before files are installed
 #  LOCAL_TOOL_DIRS=list of dirs to add additional dirs to the build-tools
 #  list
+#  METALOG=path to metadata log to write permission and ownership
+#  when NO_ROOT is set.  (default: ${DESTDIR}/METALOG)
 #  TARGET=machine to crossbuild world for a different machine type
 #  TARGET_ARCH= may be required when a TARGET supports multiple endians
 #  BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh)
@@ -358,8 +361,19 @@ IMAKE+=__MAKE_SHELL=${INSTALLTMP}/sh
 IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
 .endif
 .if defined(DB_FROM_SRC)
-IMAKE_INSTALL= INSTALL=install -N ${.CURDIR}/etc
-IMAKE_MTREE=   MTREE_CMD=nmtree -N ${.CURDIR}/etc
+INSTALLFLAGS+= -N ${.CURDIR}/etc
+MTREEFLAGS+=   -N ${.CURDIR}/etc
+.endif
+.if defined(NO_ROOT)
+METALOG?=  ${DESTDIR}/${DISTDIR}/METALOG
+IMAKE+=-DNO_ROOT METALOG=${METALOG}
+INSTALL_DDIR=  ${DESTDIR}/${DISTDIR}
+INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR:S://:/:g}
+MTREEFLAGS+=   -W
+.endif
+.if defined(DB_FROM_SRC) || defined(NO_ROOT)
+IMAKE_INSTALL= INSTALL=install ${INSTALLFLAGS}
+IMAKE_MTREE=   MTREE_CMD=nmtree ${MTREEFLAGS}
 .endif
 
 # kernel stage
@@ -658,7 +672,7 @@ _zoneinfo=  zic tzsetup
 .endif
 
 ITOOLS=[ awk cap_mkdb cat chflags chmod chown \
-   date echo egrep find grep ${_install-info} \
+   date echo egrep find grep id install ${_install-info} \
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
test true uname wc ${_zoneinfo}
 
@@ -681,6 +695,8 @@ EXTRA_DISTRIBUTIONS+=   games
 EXTRA_DISTRIBUTIONS+=  lib32
 .endif
 
+MTREE_MAGIC?=  mtree 2.0
+
 distributeworld installworld: installcheck
mkdir -p ${INSTALLTMP}
progs=$$(for prog in ${ITOOLS}; do \
@@ -703,6 +719,9 @@ distributeworld installworld: installche
done); \
cp $$libs $$progs ${INSTALLTMP}
cp -R $${PATH_LOCALE:-/usr/share/locale} ${INSTALLTMP}/locale
+.if defined(NO_ROOT)
+   echo #${MTREE_MAGIC}  ${METALOG}
+.endif
 .if make(distributeworld)
 .for dist in ${EXTRA_DISTRIBUTIONS}
-mkdir ${DESTDIR}/${DISTDIR}/${dist}
@@ -712,10 +731,20 @@ distributeworld installworld: installche
-p ${DESTDIR}/${DISTDIR}/${dist}/usr /dev/null
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include /dev/null
+.if defined(NO_ROOT)
+   ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
+   sed -e 's#^\./#./${dist}/#'  ${METALOG}
+   ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
+   sed -e 's#^\./#./${dist}/usr/#'  ${METALOG}
+   ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
+   sed -e 

svn commit: r245828 - head/usr.sbin/pkg_install/lib

2013-01-22 Thread Baptiste Daroussin
Author: bapt
Date: Tue Jan 22 22:41:12 2013
New Revision: 245828
URL: http://svnweb.freebsd.org/changeset/base/245828

Log:
  Use snprintf instead of strc* functions and add bounds checking when creating
  pkgngpath
  
  Submitted by: sbz, gahr

Modified:
  head/usr.sbin/pkg_install/lib/lib.h
  head/usr.sbin/pkg_install/lib/pkgng.c

Modified: head/usr.sbin/pkg_install/lib/lib.h
==
--- head/usr.sbin/pkg_install/lib/lib.h Tue Jan 22 22:31:38 2013
(r245827)
+++ head/usr.sbin/pkg_install/lib/lib.h Tue Jan 22 22:41:12 2013
(r245828)
@@ -99,7 +99,7 @@
  * Version of the package tools - increase whenever you make a change
  * in the code that is not cosmetic only.
  */
-#define PKG_INSTALL_VERSION20121109
+#define PKG_INSTALL_VERSION20130122
 
 #define PKG_WRAPCONF_FNAME /var/db/pkg_install.conf
 #define main(argc, argv)   real_main(argc, argv)

Modified: head/usr.sbin/pkg_install/lib/pkgng.c
==
--- head/usr.sbin/pkg_install/lib/pkgng.c   Tue Jan 22 22:31:38 2013
(r245827)
+++ head/usr.sbin/pkg_install/lib/pkgng.c   Tue Jan 22 22:41:12 2013
(r245828)
@@ -38,9 +38,10 @@ this system.;
 
 void warnpkgng(void)
 {
-   char pkgngpath[MAXPATHLEN];
+   char pkgngpath[MAXPATHLEN + 1];
char *pkgngdir;
char *dontwarn;
+   int rc;
 
dontwarn = getenv(PKG_OLD_NOWARN);
if (dontwarn != NULL)
@@ -48,8 +49,12 @@ void warnpkgng(void)
pkgngdir = getenv(PKG_DBDIR);
if (pkgngdir == NULL)
pkgngdir = /var/db/pkg;
-   strcpy(pkgngpath, pkgngdir);
-   strcat(pkgngpath, /local.sqlite);
+
+   rc = snprintf(pkgngpath, sizeof(pkgngpath) %s/local.sqlite, pkgngdir);
+   if (rc = sizeof(pkgngpath)) {
+   warnx(path too long: %s/local.sqlite, pkgngdir);
+   return;
+   }
 
if (access(pkgngpath, F_OK) == 0)
warnx(message);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245832 - head/bin/cp

2013-01-22 Thread David E. O'Brien
Author: obrien
Date: Wed Jan 23 02:06:20 2013
New Revision: 245832
URL: http://svnweb.freebsd.org/changeset/base/245832

Log:
  Return failure as we do for 'cp -i' and a n answer.
  
  Otherwise with '-v' we print out the file name as if it was copied:
 /tmp/2gb-card/M0132.CTG not overwritten
 /mnt/DCIM/CANONMSC/M0132.CTG - /tmp/2gb-card/M0132.CTG

Modified:
  head/bin/cp/utils.c

Modified: head/bin/cp/utils.c
==
--- head/bin/cp/utils.c Wed Jan 23 00:49:05 2013(r245831)
+++ head/bin/cp/utils.c Wed Jan 23 02:06:20 2013(r245832)
@@ -104,7 +104,7 @@ copy_file(const FTSENT *entp, int dne)
if (vflag)
printf(%s not overwritten\n, to.p_path);
(void)close(from_fd);
-   return (0);
+   return (1);
} else if (iflag) {
(void)fprintf(stderr, overwrite %s? %s, 
to.p_path, YESNO);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245834 - head/sys/net

2013-01-22 Thread Luigi Rizzo
Author: luigi
Date: Wed Jan 23 03:49:48 2013
New Revision: 245834
URL: http://svnweb.freebsd.org/changeset/base/245834

Log:
  leftover from r245579... flags for semi transparent mode and direct
  forwarding through a VALE switch

Modified:
  head/sys/net/netmap.h

Modified: head/sys/net/netmap.h
==
--- head/sys/net/netmap.h   Wed Jan 23 02:29:05 2013(r245833)
+++ head/sys/net/netmap.h   Wed Jan 23 03:49:48 2013(r245834)
@@ -32,7 +32,7 @@
 
 /*
  * $FreeBSD$
- * $Id: netmap.h 10601 2012-02-21 16:40:14Z luigi $
+ * $Id: netmap.h 11997 2013-01-17 21:59:12Z luigi $
  *
  * Definitions of constants and the structures used by the netmap
  * framework, for the part visible to both kernel and userspace.
@@ -113,15 +113,28 @@
  * In the kernel, buffers do not necessarily need to be contiguous,
  * and the virtual and physical addresses are derived through
  * a lookup table.
- * To associate a different buffer to a slot, applications must
- * write the new index in buf_idx, and set NS_BUF_CHANGED flag to
- * make sure that the kernel updates the hardware ring as needed.
- *
- * Normally the driver is not requested to report the result of
- * transmissions (this can dramatically speed up operation).
- * However the user may request to report completion by setting
- * NS_REPORT.
+ *
+ * struct netmap_slot:
+ *
+ * buf_idx is the index of the buffer associated to the slot.
+ * len is the length of the payload
+ * NS_BUF_CHANGED  must be set whenever userspace wants
+ * to change buf_idx (it might be necessary to
+ * reprogram the NIC slot)
+ * NS_REPORT   must be set if we want the NIC to generate an interrupt
+ * when this slot is used. Leaving it to 0 improves
+ * performance.
+ * NS_FORWARD  if set on a receive ring, and the device is in
+ * transparent mode, buffers released with the flag set
+ * will be forwarded to the 'other' side (host stack
+ * or NIC, respectively) on the next select() or ioctl()
+ * NS_NO_LEARN on a VALE switch, do not 'learn' the source port for
+ * this packet.
+ * NS_PORT_MASKthe high 8 bits of the flag, if not zero, indicate the
+ * destination port for the VALE switch, overriding
+ * the lookup table.
  */
+
 struct netmap_slot {
uint32_t buf_idx; /* buffer index */
uint16_t len;   /* packet length, to be copied to/from the hw ring */
@@ -130,6 +143,12 @@ struct netmap_slot {
 #defineNS_REPORT   0x0002  /* ask the hardware to report results
 * e.g. by generating an interrupt
 */
+#defineNS_FORWARD  0x0004  /* pass packet to the other endpoint
+* (host stack or device)
+*/
+#defineNS_NO_LEARN 0x0008
+#defineNS_PORT_SHIFT   8
+#defineNS_PORT_MASK(0xff  NS_PORT_SHIFT)
 };
 
 /*
@@ -186,6 +205,18 @@ struct netmap_slot {
  * a system call.
  *
  * The netmap_kring is only modified by the upper half of the kernel.
+ *
+ * FLAGS
+ * NR_TIMESTAMPupdates the 'ts' field on each syscall. This is
+ * a global timestamp for all packets.
+ * NR_RX_TSTMP if set, the last 64 byte in each buffer will
+ * contain a timestamp for the frame supplied by
+ * the hardware (if supported)
+ * NR_FORWARD  if set, the NS_FORWARD flag in each slot of the
+ * RX ring is checked, and if set the packet is
+ * passed to the other side (host stack or device,
+ * respectively). This permits bpf-like behaviour
+ * or transparency for selected packets.
  */
 struct netmap_ring {
/*
@@ -202,6 +233,8 @@ struct netmap_ring {
const uint16_t  nr_buf_size;
uint16_tflags;
 #defineNR_TIMESTAMP0x0002  /* set timestamp on *sync() */
+#defineNR_FORWARD  0x0004  /* enable NS_FORWARD for ring */
+#defineNR_RX_TSTMP 0x0008  /* set rx timestamp in slots */
 
struct timeval  ts; /* time of last *sync() */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-01-22 Thread Luigi Rizzo
Author: luigi
Date: Wed Jan 23 03:51:47 2013
New Revision: 245835
URL: http://svnweb.freebsd.org/changeset/base/245835

Log:
  control some debugging messages with dev.netmap.verbose
  
  add infrastracture to adapt to changes in number of queues
  and buffers at runtime

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

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cWed Jan 23 03:49:48 2013
(r245834)
+++ head/sys/dev/netmap/netmap.cWed Jan 23 03:51:47 2013
(r245835)
@@ -275,6 +275,51 @@ nm_find_bridge(const char *name)
 }
 #endif /* NM_BRIDGE */
 
+
+/*
+ * Fetch configuration from the device, to cope with dynamic
+ * reconfigurations after loading the module.
+ */
+static int
+netmap_update_config(struct netmap_adapter *na)
+{
+   struct ifnet *ifp = na-ifp;
+   u_int txr, txd, rxr, rxd;
+
+   txr = txd = rxr = rxd = 0;
+   if (na-nm_config) {
+   na-nm_config(ifp, txr, txd, rxr, rxd);
+   } else {
+   /* take whatever we had at init time */
+   txr = na-num_tx_rings;
+   txd = na-num_tx_desc;
+   rxr = na-num_rx_rings;
+   rxd = na-num_rx_desc;
+   }   
+
+   if (na-num_tx_rings == txr  na-num_tx_desc == txd 
+   na-num_rx_rings == rxr  na-num_rx_desc == rxd)
+   return 0; /* nothing changed */
+   if (netmap_verbose || na-refcount  0) {
+   D(stored config %s: txring %d x %d, rxring %d x %d,
+   ifp-if_xname,
+   na-num_tx_rings, na-num_tx_desc,
+   na-num_rx_rings, na-num_rx_desc);
+   D(new config %s: txring %d x %d, rxring %d x %d,
+   ifp-if_xname, txr, txd, rxr, rxd);
+   }
+   if (na-refcount == 0) {
+   D(configuration changed (but fine));
+   na-num_tx_rings = txr;
+   na-num_tx_desc = txd;
+   na-num_rx_rings = rxr;
+   na-num_rx_desc = rxd;
+   return 0;
+   }
+   D(configuration changed while active, this is bad...);
+   return 1;
+}
+
 /*- memory allocator -*/
 #ifdef NETMAP_MEM2
 #include netmap_mem2.c
@@ -351,7 +396,8 @@ netmap_dtor_locked(void *data)
if (na-refcount = 0) {/* last instance */
u_int i, j, lim;
 
-   D(deleting last netmap instance for %s, ifp-if_xname);
+   if (netmap_verbose)
+   D(deleting last instance for %s, ifp-if_xname);
/*
 * there is a race here with *_netmap_task() and
 * netmap_poll(), which don't run under NETMAP_REG_LOCK.
@@ -482,7 +528,8 @@ static int
 netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot,
 vm_ooffset_t foff, struct ucred *cred, u_short *color)
 {
-   D(first mmap for %p, handle);
+   if (netmap_verbose)
+   D(first mmap for %p, handle);
return saved_cdev_pager_ops.cdev_pg_ctor(handle,
size, prot, foff, cred, color);
 }
@@ -491,7 +538,7 @@ static void
 netmap_dev_pager_dtor(void *handle)
 {
saved_cdev_pager_ops.cdev_pg_dtor(handle);
-   D(ready to release memory for %p, handle);
+   ND(ready to release memory for %p, handle);
 }
 
 
@@ -507,7 +554,7 @@ netmap_mmap_single(struct cdev *cdev, vm
 {
vm_object_t obj;
 
-   D(cdev %p foff %jd size %jd objp %p prot %d, cdev,
+   ND(cdev %p foff %jd size %jd objp %p prot %d, cdev,
(intmax_t )*foff, (intmax_t )objsize, objp, prot);
obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff,
 curthread-td_ucred);
@@ -515,7 +562,7 @@ netmap_mmap_single(struct cdev *cdev, vm
if (obj == NULL)
return EINVAL;
if (saved_cdev_pager_ops.cdev_pg_fault == NULL) {
-   D(initialize cdev_pager_ops);
+   ND(initialize cdev_pager_ops);
saved_cdev_pager_ops = *(obj-un_pager.devp.ops);
netmap_cdev_pager_ops.cdev_pg_fault =
saved_cdev_pager_ops.cdev_pg_fault;
@@ -572,7 +619,9 @@ netmap_mmap(__unused struct cdev *dev,
 static int
 netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
 {
-   D(dev %p fflag 0x%x devtype %d td %p, dev, fflag, devtype, td);
+   if (netmap_verbose)
+   D(dev %p fflag 0x%x devtype %d td %p,
+   dev, fflag, devtype, td);
return 0;
 }
 
@@ -877,6 +926,7 @@ netmap_set_ringid(struct netmap_priv_d *
priv-np_txpoll = (ringid  NETMAP_NO_TX_POLL) ? 0 : 1;
if (need_lock)
na-nm_lock(ifp, NETMAP_CORE_UNLOCK, 0);
+if (netmap_verbose) {
if (ringid  NETMAP_SW_RING)

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

2013-01-22 Thread Luigi Rizzo
Author: luigi
Date: Wed Jan 23 05:37:45 2013
New Revision: 245836
URL: http://svnweb.freebsd.org/changeset/base/245836

Log:
  Add support for transparent mode while in netmap.
  
  By setting dev.netmap.fwd=1 (or enabling the feature with a per-ring flag),
  packets are forwarded between the NIC and the host stack unless the
  netmap client clears the NS_FORWARD flag on the individual descriptors.
  
  This feature greatly simplifies applications where some traffic
  (think of ARP, control traffic, ssh sessions...) must be processed
  by the host stack, whereas the bulk is handled by the netmap process
  which simply (un)marks packets that should not be forwarded.
  The default is chosen so that now a netmap receiver operates
  in a mode very similar to bpf.
  
  Of course there is no free lunch: traffic to/from the host stack
  still operates at OS speed (or less, as there is one extra copy in
  one direction).
  HOWEVER, since traffic goes to the user process before being
  reinjected, and reinjection occurs in a user context, you get some
  form of livelock protection for free.

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

Modified: head/sys/dev/netmap/netmap.c
==
--- head/sys/dev/netmap/netmap.cWed Jan 23 03:51:47 2013
(r245835)
+++ head/sys/dev/netmap/netmap.cWed Jan 23 05:37:45 2013
(r245836)
@@ -120,10 +120,12 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen
 
 int netmap_drop = 0;   /* debugging */
 int netmap_flags = 0;  /* debug flags */
+int netmap_fwd = 0;/* force transparent mode */
 int netmap_copy = 0;   /* debugging, copy content */
 
 SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, netmap_drop, 0 , );
 SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, netmap_flags, 0 , );
+SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, netmap_fwd, 0 , );
 SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, netmap_copy, 0 , );
 
 #ifdef NM_BRIDGE /* support for netmap bridge */
@@ -647,63 +649,170 @@ netmap_open(struct cdev *dev, int oflags
 
 /*
  * Handlers for synchronization of the queues from/to the host.
- *
- * netmap_sync_to_host() passes packets up. We are called from a
- * system call in user process context, and the only contention
- * can be among multiple user threads erroneously calling
- * this routine concurrently. In principle we should not even
- * need to lock.
+ * Netmap has two operating modes:
+ * - in the default mode, the rings connected to the host stack are
+ *   just another ring pair managed by userspace;
+ * - in transparent mode (XXX to be defined) incoming packets
+ *   (from the host or the NIC) are marked as NS_FORWARD upon
+ *   arrival, and the user application has a chance to reset the
+ *   flag for packets that should be dropped.
+ *   On the RXSYNC or poll(), packets in RX rings between
+ *   kring-nr_kcur and ring-cur with NS_FORWARD still set are moved
+ *   to the other side.
+ * The transfer NIC -- host is relatively easy, just encapsulate
+ * into mbufs and we are done. The host -- NIC side is slightly
+ * harder because there might not be room in the tx ring so it
+ * might take a while before releasing the buffer.
+ */
+
+/*
+ * pass a chain of buffers to the host stack as coming from 'dst'
  */
 static void
-netmap_sync_to_host(struct netmap_adapter *na)
+netmap_send_up(struct ifnet *dst, struct mbuf *head)
 {
-   struct netmap_kring *kring = na-tx_rings[na-num_tx_rings];
-   struct netmap_ring *ring = kring-ring;
-   struct mbuf *head = NULL, *tail = NULL, *m;
-   u_int k, n, lim = kring-nkr_num_slots - 1;
+   struct mbuf *m;
 
-   k = ring-cur;
-   if (k  lim) {
-   netmap_ring_reinit(kring);
-   return;
+   /* send packets up, outside the lock */
+   while ((m = head) != NULL) {
+   head = head-m_nextpkt;
+   m-m_nextpkt = NULL;
+   if (netmap_verbose  NM_VERB_HOST)
+   D(sending up pkt %p size %d, m, MBUF_LEN(m));
+   NM_SEND_UP(dst, m);
}
-   // na-nm_lock(na-ifp, NETMAP_CORE_LOCK, 0);
+}
 
-   /* Take packets from hwcur to cur and pass them up.
+struct mbq {
+   struct mbuf *head;
+   struct mbuf *tail;
+   int count;
+};
+
+/*
+ * put a copy of the buffers marked NS_FORWARD into an mbuf chain.
+ * Run from hwcur to cur - reserved
+ */
+static void
+netmap_grab_packets(struct netmap_kring *kring, struct mbq *q, int force)
+{
+   /* Take packets from hwcur to cur-reserved and pass them up.
 * In case of no buffers we give up. At the end of the loop,
 * the queue is drained in all cases.
+* XXX handle reserved
 */
+   int k = kring-ring-cur - kring-ring-reserved;
+   u_int n, lim = kring-nkr_num_slots - 1;
+   struct mbuf *m, *tail = q-tail;
+
+   if (k  0)
+   k = k + kring-nkr_num_slots;
for (n = kring-nr_hwcur; n != 

svn commit: r245837 - head/usr.sbin/pkg_install/lib

2013-01-22 Thread Jason Evans
Author: jasone
Date: Wed Jan 23 07:22:33 2013
New Revision: 245837
URL: http://svnweb.freebsd.org/changeset/base/245837

Log:
  Fix compilation errors.

Modified:
  head/usr.sbin/pkg_install/lib/pkgng.c

Modified: head/usr.sbin/pkg_install/lib/pkgng.c
==
--- head/usr.sbin/pkg_install/lib/pkgng.c   Wed Jan 23 05:37:45 2013
(r245836)
+++ head/usr.sbin/pkg_install/lib/pkgng.c   Wed Jan 23 07:22:33 2013
(r245837)
@@ -50,8 +50,8 @@ void warnpkgng(void)
if (pkgngdir == NULL)
pkgngdir = /var/db/pkg;
 
-   rc = snprintf(pkgngpath, sizeof(pkgngpath) %s/local.sqlite, pkgngdir);
-   if (rc = sizeof(pkgngpath)) {
+   rc = snprintf(pkgngpath, sizeof(pkgngpath), %s/local.sqlite, 
pkgngdir);
+   if ((size_t)rc = sizeof(pkgngpath)) {
warnx(path too long: %s/local.sqlite, pkgngdir);
return;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r245838 - head/sys/conf

2013-01-22 Thread Andrew Turner
Author: andrew
Date: Wed Jan 23 07:27:38 2013
New Revision: 245838
URL: http://svnweb.freebsd.org/changeset/base/245838

Log:
  Don't build the kernel with Thumb interworking as we don't support Thumb.

Modified:
  head/sys/conf/Makefile.arm

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Wed Jan 23 07:22:33 2013(r245837)
+++ head/sys/conf/Makefile.arm  Wed Jan 23 07:27:38 2013(r245838)
@@ -39,6 +39,8 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscri
 STRIP_FLAGS = -S
 .endif
 
+CFLAGS += -mno-thumb-interwork
+
 .if empty(DDB_ENABLED)
 CFLAGS += -mno-apcs-frame
 .elif defined(WITH_ARM_EABI)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org