]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoetire the cpumask_t type and replace it with cpuset_t usage.
attilio [Tue, 7 Jun 2011 08:46:13 +0000 (08:46 +0000)]
etire the cpumask_t type and replace it with cpuset_t usage.

This is intended to fix the bug where cpu mask objects are
capped to 32.  MAXCPU, then, can now arbitrarely bumped to whatever
value.  Anyway, as long as several structures in the kernel are
statically allocated and sized as MAXCPU, it is suggested to keep it
as low as possible for the time being.

Technical notes on this commit itself:
- More functions to handle with cpuset_t objects are introduced.
  The most notable are cpusetobj_ffs() (which calculates a ffs(3)
  for a cpuset_t object), cpusetobj_strprint() (which prepares a string
  representing a cpuset_t object) and cpusetobj_strscan() (which
  creates a valid cpuset_t starting from a string representation).
- pc_cpumask and pc_other_cpus are target to be removed soon.
  With the moving from cpumask_t to cpuset_t they are now inefficient
  and not really useful.  Anyway, for the time being, please note that
  access to pcpu datas is protected by sched_pin() in order to avoid
  migrating the CPU while reading more than one (possible) word
- Please note that size of cpuset_t objects may differ between kernel
  and userland.  While this is not directly related to the patch itself,
  it is good to understand that concept and possibly use the patch
  as a reference on how to deal with cpuset_t objects in userland, when
  accessing kernland members.
- KTR_CPUMASK is changed and now is represented through a string, to be
  set as the example reported in NOTES.

Please additively note that no MAXCPU is bumped in this patch, but
private testing has been done until to MAXCPU=128 on a real 8x8x2(htt)
machine (amd64).

Please note that the FreeBSD version is not yet bumped because of
the upcoming pcpu changes.  However, note that this patch is not
targeted for MFC.

People to thank for the time spent on this patch:
- sbruno, pluknet and Nicholas Esborn (nick AT desert DOT net) tested
  several revision of the patches and really helped in improving
  stability of this work.
- marius fixed several bugs in the sparc64 implementation and reviewed
  patches related to ktr.
- jeff and jhb discussed the basic approach followed.
- kib and marcel made targeted review on some specific part of the
  patch.
- marius, art, nwhitehorn and andreast reviewed MD specific part of
  the patch.
- marius, andreast, gonzo, nwhitehorn and jceel tested MD specific
  implementations of the patch.
- Other people have made contributions on other patches that have been
  already committed and have been listed separately.

Companies that should be mentioned for having participated at several
degrees:
- Yahoo! for having offered the machines used for testing on big
  count of CPUs.
- The FreeBSD Foundation for having sponsored my devsummit attendance,
  which has been instrumental.
- Sandvine for having offered offices and infrastructure during
  development.

(I really hope I didn't forget anyone, if it happened I apologize in
advance).

13 years agoMFC
attilio [Tue, 7 Jun 2011 08:24:29 +0000 (08:24 +0000)]
MFC

13 years agoAdd an UPDATE entry.
attilio [Tue, 7 Jun 2011 08:07:41 +0000 (08:07 +0000)]
Add an UPDATE entry.

13 years agoBring back the number of CPU to 32.
attilio [Tue, 7 Jun 2011 08:05:23 +0000 (08:05 +0000)]
Bring back the number of CPU to 32.

13 years agoFix indentation.
ae [Tue, 7 Jun 2011 06:57:22 +0000 (06:57 +0000)]
Fix indentation.

13 years agoSync ng_nat with recent (r222806) ipfw_nat changes:
ae [Tue, 7 Jun 2011 06:48:42 +0000 (06:48 +0000)]
Sync ng_nat with recent (r222806) ipfw_nat changes:

  Make a behaviour of the libalias based in-kernel NAT a bit closer to
  how natd(8) does work. natd(8) drops packets only when libalias returns
  PKT_ALIAS_IGNORED and "deny_incoming" option is set, but ipfw_nat
  always did drop packets that were not aliased, even if they should
  not be aliased and just are going through.

Also add SCTP support: mark response packets to skip firewall processing.

MFC after: 1 month

13 years agoMake a behaviour of the libalias based in-kernel NAT a bit closer to
ae [Tue, 7 Jun 2011 06:42:29 +0000 (06:42 +0000)]
Make a behaviour of the libalias based in-kernel NAT a bit closer to
how natd(8) does work. natd(8) drops packets only when libalias returns
PKT_ALIAS_IGNORED and "deny_incoming" option is set, but ipfw_nat
always did drop packets that were not aliased, even if they should
not be aliased and just are going through.

PR: kern/122109, kern/129093, kern/157379
Submitted by: Alexander V. Chernikov (previous version)
MFC after: 1 month

13 years agoamdsbwd: update to support SB8xx southbridges
avg [Tue, 7 Jun 2011 06:18:02 +0000 (06:18 +0000)]
amdsbwd: update to support SB8xx southbridges

Many thanks to Tino <tinotom@gmail.com> for drawing my attention to
this, for doing a lot of testing and providing great feedback.
Many thanks to AMD for continuing to release public specifications for
their chipsets.

PR: kern/157568
Tested by: Tino <tinotom@gmail.com>
MFC after: 1 week

13 years agoSet pca.p_bufr to NULL when we haven't allocated a buffer.
ken [Tue, 7 Jun 2011 05:04:37 +0000 (05:04 +0000)]
Set pca.p_bufr to NULL when we haven't allocated a buffer.

Otherwise, p_bufr is set to garbage on the stack, and if that garbage
happens to be non-NULL, and the TOLOG or TOCONS flag is set, putbuf()
will get called and attempt to fill the non-existent buffer.

This is really only relevant for tprintf() (and only when the priority is
not -1), but set it in uprintf() and ttyprintf() for completeness.

The next step, to avoid log buffer scrambling, would be to add the
PRINTF_BUFR_SIZE code to tprintf(), but this should prevent panics.

Submitted by: rmacklem
Found by: pho

13 years agoLower WARNS level to 3 to eliminate alignment warnings related to
marcel [Tue, 7 Jun 2011 04:38:33 +0000 (04:38 +0000)]
Lower WARNS level to 3 to eliminate alignment warnings related to
casting inherent in CMSG_DATA().

13 years agoUse p4prio_to_tsprio to calculate TS priority instead of using
davidxu [Tue, 7 Jun 2011 02:50:14 +0000 (02:50 +0000)]
Use p4prio_to_tsprio to calculate TS priority instead of using
p4prio_to_rtpprio which is for RT priority.

PR: kern/157657
Submitted by: krivenok.dmitry at gmail dot com
MFC after: 3 days

13 years agoFix making kernel dumps from the debugger by creating a command
marcel [Tue, 7 Jun 2011 01:28:12 +0000 (01:28 +0000)]
Fix making kernel dumps from the debugger by creating a command
for it. Do not not expect a developer to call doadump(). Calling
doadump does not necessarily work when it's declared static. Nor
does it necessarily do what was intended in the context of text
dumps. The dump command always creates a core dump.

Move printing of error messages from doadump to the dump command,
now that we don't have to worry about being called from DDB.

13 years agoCall set_cputicker() to have the time counter use the ITC register.
marcel [Tue, 7 Jun 2011 01:06:49 +0000 (01:06 +0000)]
Call set_cputicker() to have the time counter use the ITC register.
Note that the ITC frequency is fixed.

13 years agoo Bump the EFI loader version to 3.1.
marcel [Tue, 7 Jun 2011 00:59:31 +0000 (00:59 +0000)]
o   Bump the EFI loader version to 3.1.
o   Add the about, pbvm and reboot commands.
o   Trim the banner (suppress maker and date).

13 years agoAdd ia64_sync_icache() and use it to make the I-cache coherent
marcel [Tue, 7 Jun 2011 00:39:15 +0000 (00:39 +0000)]
Add ia64_sync_icache() and use it to make the I-cache coherent
after loading the kernel's text segment. The kernel will do the
same for loaded modules, so don't worry about that.

13 years agoAdd myself to committers-ports.dot
jlaffaye [Mon, 6 Jun 2011 23:48:48 +0000 (23:48 +0000)]
Add myself to committers-ports.dot

Approved by: tabthorpe@ (mentor)

13 years agoValidate INT 15h and 16h vectors more strictly. Traditionally these entry
jkim [Mon, 6 Jun 2011 23:03:37 +0000 (23:03 +0000)]
Validate INT 15h and 16h vectors more strictly.  Traditionally these entry
points are fixed addresses and (U)EFI CSM specification also mandated that.
Unfortunately, (U)EFI CSM specification does not specifically mention this
is to call service routine via interrupt vector table or to jump directly
to the entry point.  As a result, some CSM seems to install two routines
and acts differently, depending on how it was executed, unfortunately.
When INT 15h is used, it calls a function pointer (which is probably a UEFI
service function).  When it jumps directly to the entry point, it executes
a simple and traditional INT 15h service routine.  Therefore, actually there
are two possible fixes, i. e., this fix or jumping directly to the fixed
entry point.  However, we chose this fix because a) keyboard typematic
support via BIOS is becoming extremely rarer and b) we cannot support random
service routine installed by a firmware or a boot loader.  This should fix
Lenovo X220 laptop, specifically.

Reviewed by: delphij
MFC after: 3 days

13 years agoRevert r222152. The root cause was analysed and better fix is upcoming.
jkim [Mon, 6 Jun 2011 22:18:40 +0000 (22:18 +0000)]
Revert r222152.  The root cause was analysed and better fix is upcoming.

Discussed with: delphij

13 years agoMFC
attilio [Mon, 6 Jun 2011 22:06:42 +0000 (22:06 +0000)]
MFC

13 years agoReset clear-stall error counter before setting up the USB control transfers.
hselasky [Mon, 6 Jun 2011 22:03:09 +0000 (22:03 +0000)]
Reset clear-stall error counter before setting up the USB control transfers.

MFC after: 14 days

13 years agoUnbreak kernels with non-default PCBGROUP included but no WITNESS.
bz [Mon, 6 Jun 2011 21:45:32 +0000 (21:45 +0000)]
Unbreak kernels with non-default PCBGROUP included but no WITNESS.
Rather than including lock.h in in_pcbgroup.c in right order, fix it
for all consumers of in_pcb.h by further header file pollution under
#ifdef KERNEL.

Reported by: Pan Tsu (inyaoo gmail.com)

13 years agoImprove enumeration of Low- and Full-speed devices connected through a
hselasky [Mon, 6 Jun 2011 21:45:09 +0000 (21:45 +0000)]
Improve enumeration of Low- and Full-speed devices connected through a
High-speed USB HUB by resetting the transaction translator (TT)
before trying re-enumeration. Also when clear-stall fails multiple times
try a re-enumeration.

Suggested by: Trevor Blackwell
MFC after: 14 days

13 years agoMFC
attilio [Mon, 6 Jun 2011 21:38:39 +0000 (21:38 +0000)]
MFC

13 years agoRework parts of this man page to improve grammar.
gavin [Mon, 6 Jun 2011 21:02:26 +0000 (21:02 +0000)]
Rework parts of this man page to improve grammar.

Inspired by, and parts submitted by...
PR: docs/157467
Submitted by: Ben Kaduk <kaduk mit.edu>
MFC after: 2 weeks

13 years agoRemove redundant assignments to WARNS.
ed [Mon, 6 Jun 2011 20:24:17 +0000 (20:24 +0000)]
Remove redundant assignments to WARNS.

For these directories, WARNS is already implied to be 6.

13 years agoSet WARNS=1 temporarily to unbreak universe.
hrs [Mon, 6 Jun 2011 20:14:50 +0000 (20:14 +0000)]
Set WARNS=1 temporarily to unbreak universe.

13 years agoAttempt to clear up some confusion in the following example, by stating
gjb [Mon, 6 Jun 2011 19:33:19 +0000 (19:33 +0000)]
Attempt to clear up some confusion in the following example, by stating
the '-c' argument is passed to the shell, not to su(1), which would
indicate the login class.

'su -m <user> -c <command>'

Submitted by: Warren Block <wblock@wonkity.com> (followup to 157078)
MFC after: 5 days

13 years agoImprove cpu_idle():
marcel [Mon, 6 Jun 2011 19:06:15 +0000 (19:06 +0000)]
Improve cpu_idle():
o   cpu_idle_hook is expected to be called with interrupts
    disabled and re-enables interrupts on return.
o   sync with x86: don't idle when the CPU has runnable tasks
o   have callers of ia64_call_pal_static() disable interrupts
    and re-enable interrupts.
o   add, but compile-out, support for idle mode. This will be
    enabled at some later time, after proper testing.

13 years agoFix regex for ptraceopname().
dchagin [Mon, 6 Jun 2011 19:00:38 +0000 (19:00 +0000)]
Fix regex for ptraceopname().

PR: bin/157663
Submitted by: jason wright <jason@thought.net>
MFC after: 10 days

13 years agoAllow custom files to be opened and allow sorting by timestamp.
ed [Mon, 6 Jun 2011 18:40:01 +0000 (18:40 +0000)]
Allow custom files to be opened and allow sorting by timestamp.

While implementing a tool to import lastlog entries into utmpx, I
noticed lastlogin doesn't allow custom database files to be opened. Add
a -f switch to support this. Also, add -r and -t similar to ls(1),
ruptime(1), etc. where you can sort entries by timestamp and reverse
them. This allows you to spot active/idle users more easily.

13 years agoDon't clobber the hosts /etc/fstab. $1 is empty at this point.
marcel [Mon, 6 Jun 2011 18:25:11 +0000 (18:25 +0000)]
Don't clobber the hosts /etc/fstab. $1 is empty at this point.

13 years agoInclude param.h for CACHE_LINE_SIZE to unbreak the build.
bz [Mon, 6 Jun 2011 17:07:38 +0000 (17:07 +0000)]
Include param.h for CACHE_LINE_SIZE to unbreak the build.

13 years agoMake a couple of debug printfs DEVPRINTF.
imp [Mon, 6 Jun 2011 16:27:38 +0000 (16:27 +0000)]
Make a couple of debug printfs DEVPRINTF.

13 years agoSome style fixes.
jhb [Mon, 6 Jun 2011 15:33:15 +0000 (15:33 +0000)]
Some style fixes.

Submitted by: bde

13 years agoBump date from previous commit. :(
gjb [Mon, 6 Jun 2011 15:21:53 +0000 (15:21 +0000)]
Bump date from previous commit. :(

MFC after: 5 days

13 years agoDocument that when running 'su -m <user> -c <command>', <command> is run
gjb [Mon, 6 Jun 2011 15:17:55 +0000 (15:17 +0000)]
Document that when running 'su -m <user> -c <command>', <command> is run
within a shell as <user>.

PR: 157078
Submitted by: Warren Block <wblock@wonkity.com>
MFC after: 5 days

13 years agoRemove empty #ifndef
mm [Mon, 6 Jun 2011 14:46:43 +0000 (14:46 +0000)]
Remove empty #ifndef

MFC after: 3 days

13 years agodon't use cpuid level 4 in x86 cpu topology detection if it's not supported
avg [Mon, 6 Jun 2011 14:23:13 +0000 (14:23 +0000)]
don't use cpuid level 4 in x86 cpu topology detection if it's not supported

This regression was introduced in r213323.
There are probably no Intel cpus that support amd64 mode, but do not
support cpuid level 4, but it's better to keep i386 and amd64 versions
of this code in sync.

Discovered by: pho
Tested by: pho
MFC after: 2 weeks

13 years agoPass correct size to write(2).
jh [Mon, 6 Jun 2011 13:50:29 +0000 (13:50 +0000)]
Pass correct size to write(2).

PR: bin/155915
Submitted by: John Levine
MFC after: 2 weeks

13 years agoAdd another example to mount(8) on using the "-o" argument.
gavin [Mon, 6 Jun 2011 13:24:54 +0000 (13:24 +0000)]
Add another example to mount(8) on using the "-o" argument.

PR: docs/157389
Submitted by: Warren Block <wblock wonkity.com>
MFC after: 1 week

13 years agoMore properly handle Cardbus cards that that store their CIS in a BAR after
jhb [Mon, 6 Jun 2011 13:21:11 +0000 (13:21 +0000)]
More properly handle Cardbus cards that that store their CIS in a BAR after
the recent changes to track BAR state explicitly.  The code would now
attempt to add the same BAR twice in this case.  Instead, change this so
that it recognizes this case and only adds it once and do not delete the
BAR outright after parsing the CIS.

Tested by: bschmidt

13 years agoBump .Dd
gavin [Mon, 6 Jun 2011 13:18:29 +0000 (13:18 +0000)]
Bump .Dd

Forgotten by: gavin
MFC after: 1 week

13 years agoDocument that REQUIRES, PROVIDES and KEYWORDS are alos accepted. This
gavin [Mon, 6 Jun 2011 13:13:48 +0000 (13:13 +0000)]
Document that REQUIRES, PROVIDES and KEYWORDS are alos accepted.  This
chnage is different to the one suggested in the PR to try to avoid
cluttering the man page too much.

PR: docs/154494
Submitted by: kilian <kilian.klimek googlemail.com>
MFC after: 1 week

13 years agoClear the device_t pointer in 'struct resource' when releasing a device
jhb [Mon, 6 Jun 2011 13:12:56 +0000 (13:12 +0000)]
Clear the device_t pointer in 'struct resource' when releasing a device
as otherwise the sysctl to export rman info can dereference a stale
pointer.

PR: kern/115371
Submitted by: Arthur Hartwig
MFC after: 1 week

13 years agoImplement a CPU-affine TCP and UDP connection lookup data structure,
rwatson [Mon, 6 Jun 2011 12:55:02 +0000 (12:55 +0000)]
Implement a CPU-affine TCP and UDP connection lookup data structure,
struct inpcbgroup.  pcbgroups, or "connection groups", supplement the
existing inpcbinfo connection hash table, which when pcbgroups are
enabled, might now be thought of more usefully as a per-protocol
4-tuple reservation table.

Connections are assigned to connection groups base on a hash of their
4-tuple; wildcard sockets require special handling, and are members
of all connection groups.  During a connection lookup, a
per-connection group lock is employed rather than the global pcbinfo
lock.  By aligning connection groups with input path processing,
connection groups take on an effective CPU affinity, especially when
aligned with RSS work placement (see a forthcoming commit for
details).  This eliminates cache line migration associated with
global, protocol-layer data structures in steady state TCP and UDP
processing (with the exception of protocol-layer statistics; further
commit to follow).

Elements of this approach were inspired by Willman, Rixner, and Cox's
2006 USENIX paper, "An Evaluation of Network Stack Parallelization
Strategies in Modern Operating Systems".  However, there are also
significant differences: we maintain the inpcb lock, rather than using
the connection group lock for per-connection state.

Likewise, the focus of this implementation is alignment with NIC
packet distribution strategies such as RSS, rather than pure software
strategies.  Despite that focus, software distribution is supported
through the parallel netisr implementation, and works well in
configurations where the number of hardware threads is greater than
the number of NIC input queues, such as in the RMI XLR threaded MIPS
architecture.

Another important difference is the continued maintenance of existing
hash tables as "reservation tables" -- these are useful both to
distinguish the resource allocation aspect of protocol name management
and the more common-case lookup aspect.  In configurations where
connection tables are aligned with hardware hashes, it is desirable to
use the traditional lookup tables for loopback or encapsulated traffic
rather than take the expense of hardware hashes that are hard to
implement efficiently in software (such as RSS Toeplitz).

Connection group support is enabled by compiling "options PCBGROUP"
into your kernel configuration; for the time being, this is an
experimental feature, and hence is not enabled by default.

Subject to the limited MFCability of change dependencies in inpcb,
and its change to the inpcbinfo init function signature, this change
in principle could be merged to FreeBSD 8.x.

Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.

13 years agoRemove TODO which is not longer needed and the default.
bz [Mon, 6 Jun 2011 12:21:42 +0000 (12:21 +0000)]
Remove TODO which is not longer needed and the default.

13 years agoDo not mark lo0 as IFDISABLED even if there is no $ifconfig_lo0_ipv6 line.
hrs [Mon, 6 Jun 2011 11:36:10 +0000 (11:36 +0000)]
Do not mark lo0 as IFDISABLED even if there is no $ifconfig_lo0_ipv6 line.

13 years agoInitialize co.use_set variable before parsing each new rule.
ae [Mon, 6 Jun 2011 11:10:38 +0000 (11:10 +0000)]
Initialize co.use_set variable before parsing each new rule.

PR: bin/134975
MFC after: 2 weeks

13 years agoIncrease buffer size for the command line.
ae [Mon, 6 Jun 2011 10:52:26 +0000 (10:52 +0000)]
Increase buffer size for the command line.

PR: bin/125370
Submitted by: sem
MFC after: 2 weeks

13 years agoFix build on 64-bit arch.
hrs [Mon, 6 Jun 2011 10:51:00 +0000 (10:51 +0000)]
Fix build on 64-bit arch.

Submitted by: dim
Pointy hat to: hrs

13 years agoDo not return EINVAL when user does `ipfw set N flush` on an empty set.
ae [Mon, 6 Jun 2011 10:39:38 +0000 (10:39 +0000)]
Do not return EINVAL when user does `ipfw set N flush` on an empty set.

MFC after: 2 weeks

13 years agoDo not activate automatic LL addr configuration when 0/1->1 transition of
hrs [Mon, 6 Jun 2011 04:12:57 +0000 (04:12 +0000)]
Do not activate automatic LL addr configuration when 0/1->1 transition of
ND6_IFF_IFDISABLED flag.

13 years agoRemove "ifconfig IF inet6 -accept_rtadv" when ipv6_gateway_enable=YES because
hrs [Mon, 6 Jun 2011 03:37:33 +0000 (03:37 +0000)]
Remove "ifconfig IF inet6 -accept_rtadv" when ipv6_gateway_enable=YES because
this is no longer needed.

13 years ago- Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement
hrs [Mon, 6 Jun 2011 03:06:43 +0000 (03:06 +0000)]
- Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement
  Options for DNS Configuration) into rtadvd(8) and rtsold(8).  DNS
  information received by rtsold(8) will go to resolv.conf(5) by
  resolvconf(8) script.  This is based on work by J.R. Oldroyd (kern/156259)
  but revised extensively[1].

- rtadvd(8) now supports "noifprefix" to disable gathering on-link prefixes
  from interfaces when no "addr" is specified[2].  An entry in rtadvd.conf
  with "noifprefix" + no "addr" generates an RA message with no prefix
  information option.

- rtadvd(8) now supports RTM_IFANNOUNCE message to fix crashes when an
  interface is added or removed.

- Correct bogus ND_OPT_ROUTE_INFO value to one in RFC 4191.

Reviewed by: bz[1]
PR: kern/156259 [1]
PR: bin/152458 [2]

13 years ago- Make the code more proactively clear an ND6_IFF_IFDISABLED flag when
hrs [Mon, 6 Jun 2011 02:37:38 +0000 (02:37 +0000)]
- Make the code more proactively clear an ND6_IFF_IFDISABLED flag when
  an explicit action for INET6 configuration happens.  The changes are:

  1. When an ND6 flag is changed via SIOCSIFINFO_FLAGS ioctl,
     setting ND6_IFF_ACCEPT_RTADV and/or ND6_IFF_AUTO_LINKLOCAL now triggers
     an attempt to clear the ND6_IFF_IFDISABLED flag.

  2. When an AF_INET6 address is added successfully to an interface and
     it is marked as ND6_IFF_IFDISABLED, an attempt to clear the
     ND6_IFF_IFDISABLED happens.

  This simplifies ND6_IFF_IFDISABLED flag manipulation by users via ifconfig(8);
  in most cases manual configuration is no longer needed.

- When ND6_IFF_AUTO_LINKLOCAL is set and no link-local address is assigned to
  an interface, SIOCSIFINFO_FLAGS ioctl now calls in6_ifattach() to configure
  a link-local address.

  This change ensures link-local address configuration when "ifconfig IF inet6"
  command is invoked.  For example, "ifconfig IF inet6 auto_linklocal" now
  always try to configure an LL addr even if ND6_IFF_AUTO_LINKLOCAL is already
  set to 1 (i.e. down/up cycle is no longer needed).

Reviewed by: bz

13 years ago- Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1.
hrs [Mon, 6 Jun 2011 02:14:23 +0000 (02:14 +0000)]
- Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1.

- A new per-interface knob IFF_ND6_NO_RADR and sysctl IPV6CTL_NO_RADR.
  This controls if accepting a route in an RA message as the default route.
  The default value for each interface can be set by net.inet6.ip6.no_radr.
  The system wide default value is 0.

- A new sysctl: net.inet6.ip6.norbit_raif.  This controls if setting R-bit in
  NA on RA accepting interfaces.  The default is 0 (R-bit is set based on
  net.inet6.ip6.forwarding).

Background:

 IPv6 host/router model suggests a router sends an RA and a host accepts it for
 router discovery.  Because of that, KAME implementation does not allow
 accepting RAs when net.inet6.ip6.forwarding=1.  Accepting RAs on a router can
 make the routing table confused since it can change the default router
 unintentionally.

 However, in practice there are cases where we cannot distinguish a host from
 a router clearly.  For example, a customer edge router often works as a host
 against the ISP, and as a router against the LAN at the same time.  Another
 example is a complex network configurations like an L2TP tunnel for IPv6
 connection to Internet over an Ethernet link with another native IPv6 subnet.
 In this case, the physical interface for the native IPv6 subnet works as a
 host, and the pseudo-interface for L2TP works as the default IP forwarding
 route.

Problem:

 Disabling processing RA messages when net.inet6.ip6.forwarding=1 and
 accepting them when net.inet6.ip6.forward=0 cause the following practical
 issues:

 - A router cannot perform SLAAC.  It becomes a problem if a box has
   multiple interfaces and you want to use SLAAC on some of them, for
   example.  A customer edge router for IPv6 Internet access service
   using an IPv6-over-IPv6 tunnel sometimes needs SLAAC on the
   physical interface for administration purpose; updating firmware
   and so on (link-local addresses can be used there, but GUAs by
   SLAAC are often used for scalability).

 - When a host has multiple IPv6 interfaces and it receives multiple RAs on
   them, controlling the default route is difficult.  Router preferences
   defined in RFC 4191 works only when the routers on the links are
   under your control.

Details of Implementation Changes:

 Router Advertisement messages will be accepted even when
 net.inet6.ip6.forwarding=1.  More precisely, the conditions are as
 follow:

 (ACCEPT_RTADV && !NO_RADR && !ip6.forwarding)
=> Normal RA processing on that interface. (as IPv6 host)

 (ACCEPT_RTADV && (NO_RADR || ip6.forwarding))
=> Accept RA but add the router to the defroute list with
   rtlifetime=0 unconditionally.  This effectively prevents
   from setting the received router address as the box's
   default route.

 (!ACCEPT_RTADV)
=> No RA processing on that interface.

 ACCEPT_RTADV and NO_RADR are per-interface knob.  In short, all interface
 are classified as "RA-accepting" or not.  An RA-accepting interface always
 processes RA messages regardless of ip6.forwarding.  The difference caused by
 NO_RADR or ip6.forwarding is whether the RA source address is considered as
 the default router or not.

 R-bit in NA on the RA accepting interfaces is set based on
 net.inet6.ip6.forwarding.  While RFC 6204 W-1 rule (for CPE case) suggests
 a router should disable the R-bit completely even when the box has
 net.inet6.ip6.forwarding=1, I believe there is no technical reason with
 doing so.  This behavior can be set by a new sysctl net.inet6.ip6.norbit_raif
 (the default is 0).

Usage:

 # ifconfig fxp0 inet6 accept_rtadv
=> accept RA on fxp0
 # ifconfig fxp0 inet6 accept_rtadv no_radr
=> accept RA on fxp0 but ignore default route information in it.
 # sysctl net.inet6.ip6.norbit_no_radr=1
=> R-bit in NAs on RA accepting interfaces will always be set to 0.

13 years agoFix ia64 ISO creation:
marcel [Mon, 6 Jun 2011 01:52:15 +0000 (01:52 +0000)]
Fix ia64 ISO creation:
o   boot/mfsroot.gz is no more. Copy it only when it exists so as still
    to be compatible with Makefile.sysinstall.
o   while here, make ispfw.ko optional as well.
o   '-b bootimage' is not a valid argument for makefs. What was meant
    was '-o bootimage'.
o   create the boot image in the current directory so that makefs can
    find the file. Previously it had to be created under $BASE because
    that's how mkisofs wanted it.

13 years agoGrammer fix in comment.
mckusick [Sun, 5 Jun 2011 22:36:30 +0000 (22:36 +0000)]
Grammer fix in comment.

Eliminate one (of several) possible conflicting buffer locks when
trying to reclaim blocks. Rest of fix to be incorporated as part
of SUJ update by jeff.

Pointed out by: Kostik Belousov

13 years agoadd SNDCTL_DSP_HALT specified by OSS
avg [Sun, 5 Jun 2011 21:01:41 +0000 (21:01 +0000)]
add SNDCTL_DSP_HALT specified by OSS

This is really a new name for SNDCTL_DSP_RESET.

PR: kern/156874
Submitted by: gerald
MFC after: 1 week

13 years agoAdd support for flock(2) locks to the new NFSv4 client. I think this
rmacklem [Sun, 5 Jun 2011 20:22:56 +0000 (20:22 +0000)]
Add support for flock(2) locks to the new NFSv4 client. I think this
should be ok, since the client now delays NFSv4 Close operations
until VOP_INACTIVE()/VOP_RECLAIM(). As such, there should be no
risk that the NFSv4 Open is closed while an associated byte range lock
still exists.

Tested by: avg
MFC after: 2 weeks

13 years agoamdsbwd.4: fix history to reflect correct releases
avg [Sun, 5 Jun 2011 19:25:30 +0000 (19:25 +0000)]
amdsbwd.4: fix history to reflect correct releases

Pointed out by: ru
MFC after: 4 days

13 years agoamdsbwd.4: fix spelling of my name
avg [Sun, 5 Jun 2011 19:20:39 +0000 (19:20 +0000)]
amdsbwd.4: fix spelling of my name

Pointed out by: ru
MFC after: 3 days

13 years agoThe new NFSv4 client was erroneously using "p" instead of
rmacklem [Sun, 5 Jun 2011 18:17:37 +0000 (18:17 +0000)]
The new NFSv4 client was erroneously using "p" instead of
"p_leader" for the "id" for POSIX byte range locking. I think
this would only have affected processes created by rfork(2)
with the RFTHREAD flag specified. This patch fixes that by
passing the "id" down through the various functions from
nfs_advlock().

MFC after: 2 weeks

13 years agoFix the new NFSv4 client so that it doesn't crash when
rmacklem [Sun, 5 Jun 2011 17:31:44 +0000 (17:31 +0000)]
Fix the new NFSv4 client so that it doesn't crash when
a mount is done for a VIMAGE kernel.

Tested by: glz at hidden-powers dot com
Reviewed by: bz
MFC after: 2 weeks

13 years agosh: Fix $? in heredocs on simple commands.
jilles [Sun, 5 Jun 2011 14:13:15 +0000 (14:13 +0000)]
sh: Fix $? in heredocs on simple commands.

PR: bin/41410

13 years agosh: Add already working testcases for $? in here-document.
jilles [Sun, 5 Jun 2011 12:46:26 +0000 (12:46 +0000)]
sh: Add already working testcases for $? in here-document.

If the here-document is attached to a compound command or subshell, $?
already works properly. This is both a workaround for bin/41410 and a
requirement for a true fix for bin/41410.

PR: bin/41410
MFC after: 1 week

13 years agoUse uint8_t for sockaddr sa_len.
hrs [Sun, 5 Jun 2011 11:40:30 +0000 (11:40 +0000)]
Use uint8_t for sockaddr sa_len.

Reviewed by: bz

13 years agoAdd the "nd6 options" line handler as af_other_status() of AF_INET6, not as an
hrs [Sun, 5 Jun 2011 11:37:20 +0000 (11:37 +0000)]
Add the "nd6 options" line handler as af_other_status() of AF_INET6, not as an
own address family.

Reviewed by: bz

13 years agoCorrect a last minute merge error for new M_HASHTYPE macros. This didn't
rwatson [Sun, 5 Jun 2011 10:07:12 +0000 (10:07 +0000)]
Correct a last minute merge error for new M_HASHTYPE macros.  This didn't
turn up as a build problem because the macros aren't used (yet).

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoAdd a missing call to sync the DMAed buffer before the radar event data is extracted.
adrian [Sun, 5 Jun 2011 03:33:46 +0000 (03:33 +0000)]
Add a missing call to sync the DMAed buffer before the radar event data is extracted.

13 years agoCause backpressure (instead of dropping frames) on congestion.
np [Sat, 4 Jun 2011 23:36:19 +0000 (23:36 +0000)]
Cause backpressure (instead of dropping frames) on congestion.

MFC after: 3 days

13 years agoAllocate four bits from the mbuf flags field to represent the hash
rwatson [Sat, 4 Jun 2011 23:31:41 +0000 (23:31 +0000)]
Allocate four bits from the mbuf flags field to represent the hash
type of a software- or hardware-generated hash held in the
mbuf.m_pkthdr.flowid field, and provide accessor macros to easily
clear, set, receive, and test for hash values.  Some of these
constants correspond to RSS hash types, but we don't want to limit
ourselves to that, as a number of other hashing techniques are in
use on hardware supported by FreeBSD.

Mark the M_FLOWID flag as deprecated; I hope to remove this before
9.0, changing drivers and the stack over to using the new
M_HASHTYPEBITS, most likely to use M_HASHTYPE_OPAQUE as we don't yet
want to nail down the KPI for RSS key/bucket management for device
drivers.

MFC after:      3 days
Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.

13 years agoAllow lazy fill up of freelists.
np [Sat, 4 Jun 2011 23:31:33 +0000 (23:31 +0000)]
Allow lazy fill up of freelists.

MFC after: 3 days

13 years agosh: Improve error message if the script cannot be opened.
jilles [Sat, 4 Jun 2011 22:19:00 +0000 (22:19 +0000)]
sh: Improve error message if the script cannot be opened.

Avoid "<nosuchfile>: cannot open <nosuchfile>: ...".

13 years agoMFC
attilio [Sat, 4 Jun 2011 22:05:20 +0000 (22:05 +0000)]
MFC

13 years agofind: Exit if there is an unknown option.
jilles [Sat, 4 Jun 2011 21:59:55 +0000 (21:59 +0000)]
find: Exit if there is an unknown option.

Ignoring the parameter with the unknown options is unlikely to be what was
intended.

Example:
  find -n .

Note that things like
  find -n
already caused an exit, equivalent to "find" by itself.

13 years agoRename recently added USB serial driver.
hselasky [Sat, 4 Jun 2011 20:40:24 +0000 (20:40 +0000)]
Rename recently added USB serial driver.

Suggested by: YongHyeon PYUN
MFC after: 7 days

13 years agoAdd _mbuf() variants of various inpcb-related interfaces, including lookup,
rwatson [Sat, 4 Jun 2011 16:33:06 +0000 (16:33 +0000)]
Add _mbuf() variants of various inpcb-related interfaces, including lookup,
hash install, etc.  For now, these are arguments are unused, but as we add
RSS support, we will want to use hashes extracted from mbufs, rather than
manually calculated hashes of header fields, due to the expensive of the
software version of Toeplitz (and similar hashes).

Add notes that it would be nice to be able to pass mbufs into lookup
routines in pf(4), optimising firewall lookup in the same way, but the
code structure there doesn't facilitate that currently.

(In principle there is no reason this couldn't be MFCed -- the change
extends rather than modifies the KBI.  However, it won't be useful without
other previous possibly less MFCable changes.)

Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.

13 years agoIP divert sockets use their inpcbinfo for port reservation, although not
rwatson [Sat, 4 Jun 2011 16:26:02 +0000 (16:26 +0000)]
IP divert sockets use their inpcbinfo for port reservation, although not
for lookup.  I missed its call to in_pcbbind() when preparing previous
patches, which would lead to a lock assertion failure (although problem
not an actual race condition due to global pcbinfo locks providing
required synchronisation -- in this particular case only).  This change
adds the missing locking of the pcbhash lock.

(Existing comments in the ipdivert code question the need for using the
global hash to manage the namespace, as really it's a simple port
namespace and not an address/port namespace.  Also, although in_pcbbind
is used to manage reservations, the hash tables aren't used for lookup.
It might be a good idea to make them use hashed lookup, or to use a
different reservation scheme.)

Reviewed by:    bz
Reported by:    Kristof Provost <kristof at sigsegv.be>
Sponsored by:   Juniper Networks

13 years agoAdd a very simple IPDIVERT test, which creates IP divert sockets and
rwatson [Sat, 4 Jun 2011 16:25:12 +0000 (16:25 +0000)]
Add a very simple IPDIVERT test, which creates IP divert sockets and
checks for collision/non-collision properties in binding them.  This
test would have identified a bug recently reported on current@
involding my disaggregation of the pcbinfo lock.

It would be nice if this test also exercised packet diversion and
injection, but that is for another day.

MFC after: 3 days
Sponsored by: Juniper Networks, Inc.

13 years agoRead from the socket using the same max buffer size as we use while
sobomax [Sat, 4 Jun 2011 16:01:30 +0000 (16:01 +0000)]
Read from the socket using the same max buffer size as we use while
sending. What happens otherwise is that the sender splits all the
traffic into 32k chunks, while the receiver is waiting for the whole
packet. Then for a certain packet sizes, particularly 66607 bytes in
my case, the communication stucks to secondary is expecting to
read one chunk of 66607 bytes, while primary is sending two chunks
of 32768 bytes and third chunk of 1071. Probably due to TCP windowing
and buffering the final chunk gets stuck somewhere, so neither server
not client can make any progress.

This patch also protect from short reads, as according to the manual
page there are some cases when MSG_WAITALL can give less data than
expected.

MFC after: 3 days

13 years agoEnable HT40 (40MHz channel width) support.
bschmidt [Sat, 4 Jun 2011 15:22:01 +0000 (15:22 +0000)]
Enable HT40 (40MHz channel width) support.

13 years agoAdd new fan controller driver for the G4 MDD PowerMac. Submitted and tested
andreast [Sat, 4 Jun 2011 15:17:35 +0000 (15:17 +0000)]
Add new fan controller driver for the G4 MDD PowerMac. Submitted and tested
by Justin Hibbits.

Approved by: nwhitehorn (mentor)

13 years agosh: Reduce more needless differences between error messages.
jilles [Sat, 4 Jun 2011 15:05:52 +0000 (15:05 +0000)]
sh: Reduce more needless differences between error messages.

13 years agoCertain adapters have HT40 support on some but not all channels. The
bschmidt [Sat, 4 Jun 2011 15:05:32 +0000 (15:05 +0000)]
Certain adapters have HT40 support on some but not all channels. The
Intel 4965 devices for example have HT40 on 2GHz completely disabled
but it is still supported for 5GHz. To handle that in sta mode we
need to check if we can "upgrade" to a HT40 channel after the
association, if that is not possible but we are still announcing
support to the remote side we are left with a very flabby connection.

Reviewed by: adrian

13 years agoData frames sent over the mgmt path might be part of a TX aggr session
bschmidt [Sat, 4 Jun 2011 14:28:09 +0000 (14:28 +0000)]
Data frames sent over the mgmt path might be part of a TX aggr session
too. In that case don't fiddle with the seqno as drivers are supposed
to handle that.

Currently only the powersave feature does sent QoS-null-data frames
before and after a background scan which must be handled correctly. Due
to this being quite rare we don't fiddle around with starting of aggr
sessions.

13 years agoFix resolv.conf search list creation:
bz [Sat, 4 Jun 2011 12:51:22 +0000 (12:51 +0000)]
Fix resolv.conf search list creation:
1) do not print out an empty "search ", things do not like it.
2) the search list is not comma separated.

Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems

13 years agoOnly consider QoS frames for TX packet aggregation.
bschmidt [Sat, 4 Jun 2011 11:56:20 +0000 (11:56 +0000)]
Only consider QoS frames for TX packet aggregation.

13 years agoThe firmware of 4965 series adapters seems to die while trying to send
bschmidt [Sat, 4 Jun 2011 11:43:09 +0000 (11:43 +0000)]
The firmware of 4965 series adapters seems to die while trying to send
probe requests at 1Mbps while being associated on a 5GHz channel. Sending
those at 6Mbps does work, so use that instead during a background scan.
This workaround allows us to re-enable background scan support for the
4965 adapters.

Also, just enabling one antenna on 5GHz results in better reception of
beacons:
test            00:26:5a:c6:14:1a   40   54M -71:-95  200 E    WME HTCAP ATH
vs
test            00:26:5a:c6:14:1a   40   54M -92:-95  200 E    WME HTCAP ATH
Due to roam:rssi thresholds set to 7 by default it might have been
impossible to associate to that network. While here use
IEEE80211_IS_CHAN_5GHZ() to determine the band.

13 years agosh: Honour -n while processing -c string.
jilles [Sat, 4 Jun 2011 11:28:42 +0000 (11:28 +0000)]
sh: Honour -n while processing -c string.

13 years ago- Improve error handling.
andreast [Sat, 4 Jun 2011 09:25:59 +0000 (09:25 +0000)]
- Improve error handling.
- Add retry loops for the i2c read/write functions.

Approved by: nwhitehorn (mentor)

13 years ago- Improve error handling.
andreast [Sat, 4 Jun 2011 09:23:54 +0000 (09:23 +0000)]
- Improve error handling.
- Add a retry loop for the i2c sensor reading.
- Check on busy status of the chip and on invalid values.
- Fix a typo in a comment.
- Replace the constant 2732 with the ZERO_C_TO_K macro.

Approved by: nwhitehorn (mentor)

13 years agoReplace the FCU_ZERO_C_TO_K with the ZERO_C_TO_K from powermac_thermal.h.
andreast [Sat, 4 Jun 2011 09:19:53 +0000 (09:19 +0000)]
Replace the FCU_ZERO_C_TO_K with the ZERO_C_TO_K from powermac_thermal.h.

Approved by: nwhitehorn (mentor)

13 years agoCommit radar detection changes missed by my previous commit.
adrian [Sat, 4 Jun 2011 08:24:58 +0000 (08:24 +0000)]
Commit radar detection changes missed by my previous commit.

13 years agoAdd support for True IDE mode to the Octeon CF driver. This mode is
imp [Sat, 4 Jun 2011 07:06:05 +0000 (07:06 +0000)]
Add support for True IDE mode to the Octeon CF driver.  This mode is
signalled when the attribute address for the CF is 0 in the octeon
sysinfo structure.  In this mode, the DATA port is 16-bits, but the
other ports are 8-bits, but on a 16-bit bus (so you have to access it
a short at a time, but only believe the lower byte).  See the code for
more details on this slightly odd arrangement.  I'm still not 100%
happy with the abstractions here on many levels (starting with the
globals for these settings, on down to no bus_space use, etc), but the
driver had these problems before the change.

Also, clean up the code a bit to make this support easier, and the
code a bit easier to read.  I tried to follow existing style, but may
have missed a few spots.  Add some comments.

Fix probe/attach routine to return a proper error for the simulator.

With this change, my EBH5200 eval board now recognizes the CF well
enough to boot to the login prompt.  Before it would say it never
became ready.  My CN3010-EVB-HS5 still boots properly.  My older
CN3860-based board won't load the 64-bit kernel, either before or
after the change, and I didn't chase that down.

13 years agoopensolaris compat / zfs: avoid early overflow in ddi_get_lbolt*
avg [Sat, 4 Jun 2011 07:02:06 +0000 (07:02 +0000)]
opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt*

Reported by: David P. Discher <dpd@bitgravity.com>
Tested by: will
Reviewed by: art
Discussed with: dwhite
MFC after: 2 weeks

13 years agoA few changes to make radar detection implementable in a hal_dfs/
adrian [Sat, 4 Jun 2011 04:14:59 +0000 (04:14 +0000)]
A few changes to make radar detection implementable in a hal_dfs/
module.

* If sc->sc_dodfs is set to 1 by the ath_dfs_radar_enable(),
  set the relevant rx filter bit to begin receiving radar PHY
  errors. The HAL code already knows how to set the relevant
  error mask register to enable radar events.

* Add a missing call to ath_dfs_radar_enable() after ath_hal_reset()

* change ath_dfs_process_phyerr() to take a const char *buf for now,
  rather than a descriptor. This way it can get access to the packet
  buffer contents.

13 years agoRetry the memory map-related portions of r222613, written by andreast,
nwhitehorn [Sat, 4 Jun 2011 04:00:40 +0000 (04:00 +0000)]
Retry the memory map-related portions of r222613, written by andreast,
after some minor tweaks and an increase in the early-boot stack space in
r222632.

13 years agoFix a typo derived from a mismerge from mmu_oea that would cause
nwhitehorn [Sat, 4 Jun 2011 03:22:16 +0000 (03:22 +0000)]
Fix a typo derived from a mismerge from mmu_oea that would cause
pmap_sync_icache() to sync random (possibly uncached or nonexisting!)
memory, causing kernel page faults or machine checks, most easily
triggered by using GDB. While here, add an additional safeguard to only
sync cacheable memory.

MFC after: 2 days

13 years agoModify the new NFS server so that the NFSv3 Pathconf RPC
rmacklem [Sat, 4 Jun 2011 01:13:09 +0000 (01:13 +0000)]
Modify the new NFS server so that the NFSv3 Pathconf RPC
doesn't return an error when the underlying file system
lacks support for any of the four _PC_xxx values used, by
falling back to default values.

Tested by: avg
MFC after: 2 weeks