Sam Leffler [Tue, 27 Jan 2009 23:42:14 +0000 (23:42 +0000)]
Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
arrays instead of a fixed (compile-time) value; we do this in a way
that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
to hold MAXCHAN entries (1536); this, for example, allows the kernel
to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
Sam Leffler [Tue, 27 Jan 2009 23:09:55 +0000 (23:09 +0000)]
o add country codes from Atheros regulatory; these are not listed in
the ISO tables, mark them accordingly
o add sku's for handling 900MHz cards
o add opaque struct defs and change []'s to *'s so this file can be
included w/o requiring all of net80211 to be pulled in
o make CTRY_DEBUG and CTRY_DEFAULT public
Robert Watson [Tue, 27 Jan 2009 21:48:47 +0000 (21:48 +0000)]
Following a fair amount of real world experience with ACLs and
extended attributes since FreeBSD 5, make the following semantic
changes:
- Don't update the inode modification time (mtime) when extended
attributes (and hence also ACLs) are added, modified, or removed.
- Don't update the inode access tie (atime) when extended attributes
(and hence also ACLs) are queried.
This means that rsync (and related tools) won't improperly think
that the data in the file has changed when only the ACL has changed.
Note that ffs_reallocblks() has not been changed to not update on an
IO_EXT transaction, but currently EAs don't use the cluster write
routines so this shouldn't be a problem. If EAs grow support for
clustering, then VOP_REALLOCBLKS() will need to grow a flag argument
to carry down IO_EXT to UFS.
MFC after: 1 week
PR: ports/125739
Reported by: Alexander Zagrebin <alexz@visp.ru>
Tested by: pluknet <pluknet@gmail.com>,
Greg Byshenk <freebsd@byshenk.net>
Discussed with: kib, kientzle, timur, Alexander Bokovoy <ab@samba.org>
When synchronizing the clock at system startup time, use both
the -g and -q options. They do a slightly different thing and
both are necessary when the time difference is large.
Noticed by: danger, in the forums
Approved by: roberto
MFC after: 1 week
Nick Hibma [Tue, 27 Jan 2009 19:37:30 +0000 (19:37 +0000)]
Fix the input buffer at 1024. The previous calculated buffer size
exceeded the maximum size of 1 page for OHCI controllers. Other serial
drivers use the same size, so I assume this should be enough (1MB/s
throughput?).
Luigi Rizzo [Tue, 27 Jan 2009 11:06:59 +0000 (11:06 +0000)]
Put dummynet-related code in a separate file.
To this purpose, add prototypes for global functions in ipfw2.h
and move there also the list of tokens used in various places in the code.
Luigi Rizzo [Tue, 27 Jan 2009 10:18:55 +0000 (10:18 +0000)]
Start splitting the monster file in smaller blocks.
In this episode:
- introduce a common header with a minimal set of common definitions;
- bring the main() function and options parser in main.c
- rename the main functions with an ipfw_ prefix
No code changes except for the introduction of a global variable,
resvd_set_number, which stores the RESVD_SET value from ip_fw.h
and is used to remove the dependency of main.c from ip_fw.h
(and the subtree of dependencies) for just a single constant.
Luigi Rizzo [Tue, 27 Jan 2009 09:27:13 +0000 (09:27 +0000)]
put the usage() function inline, it was only 1 line and used once;
slightly reformat the help() text;
slightly correct the text for the 'extraneous filename' error message;
Jeff Roberson [Tue, 27 Jan 2009 07:29:37 +0000 (07:29 +0000)]
- Add support for nehalem/corei7 cpus. This supports all of the core
counters defined in the reference manual. It does not support the
'uncore' events.
Tom Rhodes [Tue, 27 Jan 2009 00:22:16 +0000 (00:22 +0000)]
Add ENOMEM to the return values.
Remove invalid return values.
Remove reference to non-existent manual pages.
Remove reference to rfork (it does not discuss RFSTOPPED).
Add sys/unistd.h to the list of includes (required for RFSTOPPED).
PR: 126227
Submitted by: Mateusz Guzik <mjguzik@gmail.com> (based on, original version)
Reviewed by: jhb, Christoph Mallon <christoph.mallon@gmx.de>
Maksim Yevmenkin [Mon, 26 Jan 2009 20:59:41 +0000 (20:59 +0000)]
Clean up ng_ubt2. Get rid of excessive use of NG_NODE_REF/UNREF().
Make detach() completely synchronous. Properly handle stalled USB
transfers (use internal mechanism instead of submitting own control
transfers). Rename/remove a couple of variables and update comments.
This work was done in close collaboration with HPS.
Roman Divacky [Mon, 26 Jan 2009 17:00:58 +0000 (17:00 +0000)]
kmod.mk includes bsd.sys.mk anyway so use CSTD instead of homegrown
reimplementation of the same. Note that this changes -std=c99
to -std=iso9899:1999 but those two are synonyms.
John Baldwin [Mon, 26 Jan 2009 15:01:47 +0000 (15:01 +0000)]
Now that mtx_sleep/msleep can accept Giant as the interlock, simplify the
CAM locking code slightly to no longer special case sleeping when a sim
uses Giant for its lock.
Nathan Whitehorn [Mon, 26 Jan 2009 14:43:18 +0000 (14:43 +0000)]
Change the way our softc is stored to use the devinfo facility provided by pcm
instead of the regular device softc interface. This brings the AOA driver in
line with the other pcm drivers.
The kernel may do unbalanced calls to fifo_close() for fifo vnode,
without corresponding number of fifo_open(). This causes assertion
failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel
with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may
ignore excess calls to fifo_close() without bad consequences.
Turn KASSERT() into the return, and print warning for now.
Luigi Rizzo [Mon, 26 Jan 2009 14:03:39 +0000 (14:03 +0000)]
Some implementations of getopt() expect that argv[0] is always the
program name, and ignore that entry. ipfw2.c code instead skips
this entry and starts with options at offset 0, relying on a more
tolerant implementation of the library.
This change fixes the issue by always passing a program name
in the first entry to getopt. The motivation for this change
is to remove a potential compatibility issue should we use
a different getopt() implementation in the future.
No functional changes.
Submitted by: Marta Carbone (parts)
MFC after: 4 weeks
Bjoern A. Zeeb [Mon, 26 Jan 2009 12:59:11 +0000 (12:59 +0000)]
Update jail startup script for multi-IPv4/v6/no-IP jails.
Note: this is only really necessary because of the ifconfig
logic to add/remove the jail IPs upon start/stop.
Consensus among simon and I is that the logic should
really be factored out from the startup script and put
into a proper management solution.
- We now support starting of no-IP jails.
- Remove the global jail_<jname>_netmask option as it is only
helpful to set netmasks/prefixes for the right address
family and per address.
- Implement jail_<jname>_ip options to support both
address familes with regard to ifconfig logic.
- Implement _multi<n> support suffix to the jail_<jname>_ip
option to configure additional addresses to avoid overlong,
unreadbale jail_<jname>_ip lines with lots of addresses.
Submitted by: initial work from Ruben van Staveren
Discussed on: freebsd-jail in Nov 2008.
Reviewed by: simon, ru (partial, older version)
MFC after: 1 week
Jeff Roberson [Sun, 25 Jan 2009 18:38:42 +0000 (18:38 +0000)]
- bit has to be fd_mask to work properly on 64bit platforms. Constants
must also be cast even though the result ultimately is promoted
to 64bit.
- Correct a loop index upper bound in selscan().
Nathan Whitehorn [Sun, 25 Jan 2009 17:50:53 +0000 (17:50 +0000)]
Fix a race condition where interrupts set up after boot could be enabled in
the PIC before the interrupt handler was set. If the interrupt triggered in
that window, then the interrupt vector would be disabled.
Ed Schouten [Sun, 25 Jan 2009 16:52:41 +0000 (16:52 +0000)]
Revert my previous two changes.
Even though the code seems to be FreeBSD kernel code, it isn't compiled
on FreeBSD. I could have known this, because I was a little amazed that
I couldn't find a prototype of pfopen()/pfclose() somewhere else,
because it isn't marked as static.
Apart from that, removing these functions wouldn't have been harmful
anyway, because there are some other strange things about them (the
implementation isn't consistent with the prototype at the top). Still,
it's better to leave it, because it makes merging code back to older
branches a little harder.
Ed Schouten [Sun, 25 Jan 2009 14:39:15 +0000 (14:39 +0000)]
Remove pfopen() and pfclose() entirely.
It turns out I was patching functions that weren't used by pf(4) anyway.
They still seem to use `struct proc *' instead of `struct thread *'.
They weren't listed in pf_cdevsw.
Ed Schouten [Sun, 25 Jan 2009 14:00:00 +0000 (14:00 +0000)]
Remove unneeded checking for invalid minor numbers from pf(4).
Because it is not possible to access the pf(4) character device through
any other device node as the one in devfs, there is no need to check for
unknown device minor numbers.
Robert Watson [Sun, 25 Jan 2009 12:07:43 +0000 (12:07 +0000)]
When a statically linked binary is executed (or at least, one without
an interpreter definition in its program header), set the auxiliary
ELF argument AT_BASE to 0 rather than to the address that we would
have mapped the interpreter at if there had been one.
The ELF ABI specifications appear to be ambiguous as to the desired
behavior in this situation, as they define AT_BASE as the base address
of the interpreter, but do not mention what to do if there is none.
On Solaris, AT_BASE will be set to the base address of the static
binary if there is no interpreter, and on Linux, AT_BASE is set to 0.
We go with the Linux semantics as they are of more immediate utility
and allow the early runtime environment to know that the kernel has
not mapped an interpreter, but because AT_PHDR points at the ELF
header for the running binary, it is still possible to retrieve all
required mapping information when the process starts should it be
required. Either approach would be preferable to our current behavior
of passing a pointer to an unmapped region of user memory as AT_BASE.
Bjoern A. Zeeb [Sun, 25 Jan 2009 10:31:45 +0000 (10:31 +0000)]
Instead of killing the 'watchdog' subshell and leaving a sleep for
rcshutdown_timeout (normally 30s) around re-parented to init, make
sure both go away using pkill -P.
While noone normally notices this for the system shutdown, it helps for
cleanly shutting down trusted jails.
Found without a killall in the base system, which in rc.d/jail normally
ensures that all processes of a jail to be stopped will be killed.
Reviewed by: silence on current@
MFC after: 4 weeks
Jeff Roberson [Sun, 25 Jan 2009 09:11:24 +0000 (09:11 +0000)]
- Make the keg abstraction more complete. Permit a zone to have multiple
backend kegs so it may source compatible memory from multiple backends.
This is useful for cases such as NUMA or different layouts for the same
memory type.
- Provide a new api for adding new backend kegs to secondary zones.
- Provide a new flag for adjusting the layout of zones to stagger
allocations better across cache lines.
Jeff Roberson [Sun, 25 Jan 2009 07:35:10 +0000 (07:35 +0000)]
- Use __XSTRING where I want the define to be expanded. This resulted in
sizeof("MAXCPU") being used to calculate a string length rather than
something more reasonable such as sizeof("32"). This shouldn't have
caused any ill effect until we run on machines with 1000000 or more
cpus.
Andrew Thompson [Sun, 25 Jan 2009 07:31:51 +0000 (07:31 +0000)]
If the parent up/down task was queued then sync with it before returning from
the vap ioctl. This means that the parent interface should hopefully be up
before we return to userland, it does not depend on the parent init succeeding,
just that it was run.
This fixes wpa_supplicant with ndis and USB where the parent interfaces can be
slow to init.
Jeff Roberson [Sun, 25 Jan 2009 07:24:34 +0000 (07:24 +0000)]
Fix errors introduced when I rewrote select.
- Restructure selscan() and selrescan() to avoid producing extra selfps
when we have a fd in multiple sets. As described below multiple selfps
may still exist for other reasons.
- Make selrescan() tolerate multiple selfds for a given descriptor
set since sockets use two selinfos per fd. If an event on each selinfo
fires selrescan() will see the descriptor twice. This could result in
select() returning 2x the number of fds actually existing in fd sets.
Ed Schouten [Sat, 24 Jan 2009 18:23:19 +0000 (18:23 +0000)]
Remove unused unrhdr from GEOM character device module.
Now that make_dev() doesn't require unit numbers to be unique, there is
no need to use an unrhdr here to generate the numbers. Remove the entire
init-routine, because it is optional.
Robert Watson [Sat, 24 Jan 2009 10:57:32 +0000 (10:57 +0000)]
Begin to add SDT tracing of the MAC Framework: add policy modevent,
register, and unregister hooks that give access to the mac_policy_conf
for the policy.
Obtained from: TrustedBSD Project
MFC after: 3 days
Robert Watson [Sat, 24 Jan 2009 10:22:49 +0000 (10:22 +0000)]
Add explicit static DTrace tracing to the callout mechanism, capturing
pointers to the callout handler just before and just after the callout
it invoked. I attempted to do this in a manner congruent to tracing in
Solaris's callout mechanism, but couldn't quite use the same names due
to convention and syntax differences.
Example DTrace script to generate a distribution graph of callout
execution times:
Tom Rhodes [Sat, 24 Jan 2009 05:32:11 +0000 (05:32 +0000)]
When "-b" is specified, one could easily create "smaller" files
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.
John Baldwin [Fri, 23 Jan 2009 22:49:23 +0000 (22:49 +0000)]
- Mark all standalone INT/LONG/QUAD sysctl's MPSAFE. This is done
inside the SYSCTL() macros and thus does not need to be done for
all of the nodes scattered across the source tree.
- Mark the name-cache related sysctl's (including debug.hashstat.*) MPSAFE.
- Mark vm.loadavg MPSAFE.
- Remove GIANT_REQUIRED from vmtotal() (everything in this routine already
has sufficient locking) and mark vm.vmtotal MPSAFE.
- Mark the vm.stats.(sys|vm).* sysctls MPSAFE.
John Baldwin [Fri, 23 Jan 2009 22:13:00 +0000 (22:13 +0000)]
Tweak the wording for vfs_mark_atime() since the I/O it is avoiding by not
updating va_atime via VOP_SETATTR() isn't always synchronous. For some
filesystems it is asynchronous.
John Baldwin [Fri, 23 Jan 2009 22:08:54 +0000 (22:08 +0000)]
Push down Giant in the vlnru kproc main loop so that it is only acquired
around calls to vlrureclaim() on non-MPSAFE filesystems. Specifically,
vnlru no longer needs Giant for the common case of waking up and deciding
there is nothing for it to do.
John Baldwin [Fri, 23 Jan 2009 20:53:01 +0000 (20:53 +0000)]
Only start the if_slowtimo timer (which drives the if_watchdog methods of
network interfaces) if we have at least one interface with an if_watchdog
routine.