Commit Graph

6080 Commits

Author SHA1 Message Date
Luigi Rizzo
b74331bfb8 accept lower case m as a synonym for Mega (bit/s or bytes/s). 2010-03-15 18:26:09 +00:00
Luigi Rizzo
f68f58e5eb print correctly commands of the form
ipfw add 100 allow ip from { 1.2.3.4 or 5.6.7.8 }

(note that the above example could be better written as

	ipfw add 100 allow dst-ip 1.2.3.4,5.6.7.8

Submitted by:	Riccardo Panicucci
2010-03-15 18:20:51 +00:00
Luigi Rizzo
f9f7bde3bc + implement (two lines) the kernel side of 'lookup dscp N' to use the
dscp as a search key in table lookups;

+ (re)implement a sysctl variable to control the expire frequency of
  pipes and queues when they become empty;

+ add 'queue number' as optional part of the flow_id. This can be
  enabled with the command

        queue X config mask queue ...

  and makes it possible to support priority-based schedulers, where
  packets should be grouped according to the priority and not some
  fields in the 5-tuple.
  This is implemented as follows:
  - redefine a field in the ipfw_flow_id (in sys/netinet/ip_fw.h) but
    without changing the size or shape of the structure, so there are
    no ABI changes. On passing, also document how other fields are
    used, and remove some useless assignments in ip_fw2.c

  - implement small changes in the userland code to set/read the field;

  - revise the functions in ip_dummynet.c to manipulate masks so they
    also handle the additional field;

There are no ABI changes in this commit.
2010-03-15 17:14:27 +00:00
Luigi Rizzo
72662a7566 Implement "lookup dscp N" which does a lookup of the DSCP (top 6 bits
of ip->ip_tos) in a table. This can be useful to direct traffic to
different pipes/queues according to the DSCP of the packet, as follows:

    ipfw add 100 queue tablearg lookup dscp 3 // table 3 maps dscp->queue

This change is a no-op (but harmless) until the two-line kernel
side is committed, which will happen shortly.
2010-03-15 15:43:35 +00:00
Rebecca Cran
f2359a2473 Free the memory allocated via strdup.
PR:		bin/113881
Submitted by:	Alexander Drozdov  dzal_mail mtu-net.ru
Approved by:	rrs (mentor)
MFC after:	1 week
2010-03-13 11:08:57 +00:00
Ulrich Spörlein
63d46d1d5e Fix several typos in macros or macro misusage.
Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-03-12 10:01:06 +00:00
Luigi Rizzo
5007b59f26 implement listing of a subset of pipes/queues/schedulers.
The filtering of the output is done in the kernel instead of userland
to reduce the amount of data transfered.
2010-03-11 22:42:33 +00:00
Ulrich Spörlein
b927953652 nos-tun(8): make WARNS=3 clean
The renames are in spirit of DragonflyBSD, to keep diff minimal.

PR:		bin/140060
Approved by:	ed (co-mentor)
2010-03-10 18:51:13 +00:00
Maxim Sobolev
8c04d588c5 Fix "Empty input line" mdoc warning.
Submitted by:	Alexander Best
2010-03-10 00:47:09 +00:00
Maxim Sobolev
e0999e592b o bdeficize expand_number_int() function;
o revert most of the recent changes (int -> int64_t conversion) by using
this functon for parsing all options.
2010-03-09 19:31:08 +00:00
Maxim Sobolev
eb8d193be2 Change secrorsize back to int, since that's the data type expected by the
ioctl(DIOCGSECTORSIZE). It creates issues on some architectures.

MFC after:	1 week
Reported by:	Jayachandran C.
2010-03-09 10:31:03 +00:00
Luigi Rizzo
a63e8ce9e7 add back DPADD (removed by mistake in a previous commit) 2010-03-08 14:43:55 +00:00
Bjoern A. Zeeb
9df3a16421 As statfs.f_flags are uint64_t the local variables should be as well.
We'll start noticing this with the next flag introduced as the lower
32bit are all used.
As this is old code we might need to do a full tree sweep one day, unless
changing our strategy to use a different `API' for getting/setting flags
along with the rest of the statfs data.

While here compare to 0 explicitly [1].

Suggested by:	kib [1]
Reviewed by:	kib
MFC after:	5 days
2010-03-07 16:45:18 +00:00
Luigi Rizzo
34ae843479 more documentation on new dummynet features. 2010-03-05 14:13:58 +00:00
Joel Dahl
a4481a8745 Use our standard license text. No more voices in the authors head. :-)
Approved by:	trasz
2010-03-04 19:38:24 +00:00
Luigi Rizzo
f10f583fec make the listing of queues/pipes/schedulers handle the case of
data size increasing while we fetch the info.
2010-03-04 16:56:36 +00:00
Luigi Rizzo
c751221af4 fix handling of sets 2010-03-04 16:55:32 +00:00
Luigi Rizzo
6429067819 reduce diffs with the cross-platform version (windows needs
some extra initialization)
2010-03-04 16:54:56 +00:00
Luigi Rizzo
1009f2c9dd remove stale comment 2010-03-04 16:08:51 +00:00
Warner Losh
683d4eac76 Cast these to intmax_t before printing to fix build bustage. Better
solutions welcome.
2010-03-03 21:53:25 +00:00
Ulf Lilleengen
bdefa4b708 - Make function of finding an available drive name a macro.
- Move check of /dev/ prefix and copy into a function to save code duplication.
  This also fixes a bug where the /dev/ prefix could not be used when creating
  volumes on the command line.

Tested by:	Niclas Zeising <niclas.zeising - at - gmail.com>
2010-03-03 21:27:54 +00:00
Maxim Sobolev
32bdc2b685 Use expand_number(3) from libutil instead of home-grown function to parse
human-friendly power-of-two numbers (i.e. 2k, 5M etc).

Suggested by:	many
MFC after:	1 week
2010-03-03 19:25:28 +00:00
Maxim Sobolev
83b5ab2770 Teach newfs(8) to understand size modifiers for all options taking
size or size-like argument. I.e. "-s 32k" instead of "-s 32768".
Size parsing function has been shamelessly stolen from the truncate(1).
I'm sure many sysadmins out there will appreciate this small
improvement.

MFC after:	1 week
2010-03-03 02:05:09 +00:00
Ulrich Spörlein
7729e3ba40 Remove redundant WARNS?=6 overrides and inherit the WARNS setting from
the toplevel directory.

This does not change any WARNS level and survives a make universe.

Approved by:        ed (co-mentor)
2010-03-02 18:44:08 +00:00
Luigi Rizzo
cc4d3c30ea Bring in the most recent version of ipfw and dummynet, developed
and tested over the past two months in the ipfw3-head branch.  This
also happens to be the same code available in the Linux and Windows
ports of ipfw and dummynet.

The major enhancement is a completely restructured version of
dummynet, with support for different packet scheduling algorithms
(loadable at runtime), faster queue/pipe lookup, and a much cleaner
internal architecture and kernel/userland ABI which simplifies
future extensions.

In addition to the existing schedulers (FIFO and WF2Q+), we include
a Deficit Round Robin (DRR or RR for brevity) scheduler, and a new,
very fast version of WF2Q+ called QFQ.

Some test code is also present (in sys/netinet/ipfw/test) that
lets you build and test schedulers in userland.

Also, we have added a compatibility layer that understands requests
from the RELENG_7 and RELENG_8 versions of the /sbin/ipfw binaries,
and replies correctly (at least, it does its best; sometimes you
just cannot tell who sent the request and how to answer).
The compatibility layer should make it possible to MFC this code in a
relatively short time.

Some minor glitches (e.g. handling of ipfw set enable/disable,
and a workaround for a bug in RELENG_7's /sbin/ipfw) will be
fixed with separate commits.

CREDITS:
This work has been partly supported by the ONELAB2 project, and
mostly developed by Riccardo Panicucci and myself.
The code for the qfq scheduler is mostly from Fabio Checconi,
and Marta Carbone and Francesco Magno have helped with testing,
debugging and some bug fixes.
2010-03-02 17:40:48 +00:00
Ulrich Spörlein
47e1a877c5 Always assign WARNS using ?=
- fix some nearby style bugs
- include Makefile.inc where it makes sense and reduces duplication

Approved by:	ed (co-mentor)
2010-03-02 16:58:04 +00:00
Ulrich Spörlein
bd2c49af72 rtsol(8)/rtsold(8): make WARNS=3 clean
It is actually WARNS=6 clean for non-strict alignment archs.

Approved by:	ed (co-mentor)
2010-02-27 10:19:39 +00:00
Ulrich Spörlein
f62e48f536 route(8): make WARNS=3 clean
- add static and const where appropriate
- check pointers against NULL
- minor styling nits
- it is actually WARNS=6 clean for non-strict alignment platforms

This is shamelessly stolen from DragonflyBSD and reduces our diff.

PR:		bin/140078
Approved by:	ed (co-mentor)
2010-02-27 10:18:33 +00:00
Ulrich Spörlein
b108792d90 routed(8)/rtquery(8) bump/demote to WARNS=3 for all archs
- The MACHINE_ARCH check is not exhaustive (missing at least powerpc),
  and generally not worth maintaining.
- While here, fix whitespace and ordering of the Makefile

PR:		bin/140081
Approved by:	ed (co-mentor)
2010-02-27 10:17:27 +00:00
Ulrich Spörlein
115d0d95a1 mount_ntfs(8): make WARNS=6 clean
PR:		bin/140000
Approved by:	ed (co-mentor)
2010-02-27 10:16:14 +00:00
Ulrich Spörlein
9ee81f583a mount_hpfs(8): make WARNS=6 clean
PR:		bin/139995
Approved by:	ed (co-mentor)
2010-02-27 10:14:59 +00:00
Ruslan Ermilov
c59ee18a21 Fixed static linkage. 2010-02-26 09:41:16 +00:00
Ruslan Ermilov
bee10047c0 Fixed dependencies (make checkdpadd). 2010-02-25 20:24:19 +00:00
Alexander Motin
6a5d28b93a Improve output for controllers that doesn't report SATA speed. 2010-02-22 10:45:40 +00:00
Pawel Jakub Dawidek
2e1facf96f Changing proto_socketpair.c compilation and linking order revealed
a problem - we should simply ignore proto_server() if address
doesn't start with socketpair://, and not abort.
2010-02-21 19:56:47 +00:00
Gavin Atkinson
ebae8e93f7 Document the interaction between /etc/devfs.conf and
/etc/defaults/devfs.conf

PR:		docs/117308
Submitted by:	Mel <mel.xyzzy rachie.is-a-geek.net> (partially)
MFC after:	1 week
2010-02-21 10:29:45 +00:00
Pyun YongHyeon
0f686c0fc9 Add TSO support on VLAN in fconfig(8).
Reviewed by:	thompsa
2010-02-20 23:01:09 +00:00
Ulrich Spörlein
8fa03d08ca Fix common misspelling of hierarchy
Pointed out by:		bf1783 at gmail
Approved by:		np (cxgb), kientzle (tar, etc.), philip (mentor)
2010-02-20 10:19:19 +00:00
Pawel Jakub Dawidek
32115b105a Please welcome HAST - Highly Avalable Storage.
HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by:	FreeBSD Foundation
Sponsored by:	OMCnet Internet Service GmbH
Sponsored by:	TransIP BV
2010-02-18 23:16:19 +00:00
Pawel Jakub Dawidek
d44dbcbb33 Style nits. 2010-02-18 23:04:01 +00:00
Warner Losh
a8c422af92 The NetBSD Foundation has granted permission for people to remove
clause 3 and 4 from their software.
2010-02-16 21:39:20 +00:00
Ulrich Spörlein
6d7a8f6cba sysctl(8): make WARNS=3 clean
Fixes inspired by work done in DragonflyBSD.

PR:		bin/140016
Approved by:	ed (Co-mentor)
2010-02-15 14:08:06 +00:00
Ulrich Spörlein
2b6974bf61 Bump WARNS where possible.
Checked by:	make universe
Approved by:	ed (co-mentor)
2010-02-15 14:07:40 +00:00
Konstantin Belousov
75fb535394 Rename fields to match better the msdosfs headers. This work is still
incomplete as some info doesn't really belong to the structs where it is
defined.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Reviewed by:	bde
MFC after:	2 weeks
2010-02-14 12:31:28 +00:00
Konstantin Belousov
6069db97f6 Bug fixes from NetBSD
- fix sign-compare issues.
- ANSIfy a couple of functions.
- Remove more duplicate #includes.
- Memory leak found by Coverity on NetBSD.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Reviewed by:	bde
MFC after:	2 weeks
2010-02-14 12:30:30 +00:00
Konstantin Belousov
a1882ff2a2 License changes from NetBSD.
Move to 2 clause license, approved by Wolfgang Solfrank.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
MFC after:	2 weeks
2010-02-14 12:28:43 +00:00
Konstantin Belousov
2490c5654b Rename variables to match msdosfs headers.
Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Reviewed by:	bde
MFC after:	2 weeks
2010-02-14 12:25:39 +00:00
Konstantin Belousov
fb95e056a5 Some cleanups from NetBSD:
- C99 initializers.
- Change the default volume label from "NO NAME" to "NO_NAME".
- Set OEM String to "BSD4.4 " following the unnamed spacing convention
  in that other OS that suggests "MSWIN4.1"
Also, David Naylor's changes for Clang, mostly changing the signess
of constants.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Clang fixes by:	David Naylor <naylor.b.david gmail com>
Reviewed by:	bde (with some disagreement about Clang issues)
MFC after:	2 weeks
2010-02-14 12:25:03 +00:00
Gavin Atkinson
08f353ebe3 When growing a UFS1 filesystem, we need to initialise all inodes in any new
cylinder groups that are created.  When the filesystem is first created,
newfs always initialises the first two blocks of inodes, and then in the
UFS1 case will also initialise the remaining inode blocks.  The changes in
growfs.c 1.23 broke the initialisation of all inodes, seemingly based on
this implementation detail in newfs(8).  The result was that instead of
initialising all inodes, we would actually end up initialising all but the
first two blocks of inodes.  If the filesystem was grown into empty
(all-zeros) space then the resulting filesystem was fine, however when
grown onto non-zeroed space the filesystem produced would appear to have
massive corruption on the first fsck after growing.
A test case for this problem can be found in the PR audit trail.

Fix this by once again initialising all inodes in the UFS1 case.

PR:		bin/115174
Submitted by:	Nate Eldredgei  nge cs.hmc.edu
Reviewed by:	mjacob
MFC after:	1 month
2010-02-13 16:22:08 +00:00
Jaakko Heinonen
384e3c00a0 Don't try to determine tape block size when the -P option is used.
This was missed in r203157.

PR:		bin/121502
2010-02-13 10:22:07 +00:00