Commit Graph

163629 Commits

Author SHA1 Message Date
Ed Maste
aacea6e251 There are a couple of structs in mfireg.h with members named 'class'.
These cause problems when trying to include the header in a C++ project.
Rename them to 'evt_class', and track the change in mfi and mfiutil.

Submitted by:	Mark Johnston
Sponsored by:	Sandvine Incorporated
Reviewed by:	jhb@
MFC after:	1 week
2011-06-02 00:43:16 +00:00
Jack F Vogel
b6582d0066 First off: update the driver README, the old one was horribly
crusty, and this still isn't perfect, but its at least a bit
more recent.

Secondly, a few improvements to the driver from Andrew Boyer,
support hint to allow devices to not attach, add VLAN_HWTSO
capability so vlans can use TSO, fix in the interrupt handler
to make sure the stack TX queue is processed. Oh, and also
make sure IPv6 does not cause a re-init in the ioctl routine.
Thanks for your efforts Andrew!

Thanks to Claudio Jeker for noticing the ixgbe_xmit() routine
was not correctly swapping the dma map from the first to the
last descriptor in a multi-descriptor transmission, corrected
this.
2011-06-02 00:34:57 +00:00
Konstantin Belousov
031ec8c10a In the VOP_PUTPAGES() implementations, change the default error from
VM_PAGER_AGAIN to VM_PAGER_ERROR for the uwritten pages. Return
VM_PAGER_AGAIN for the partially written page. Always forward at least
one page in the loop of vm_object_page_clean().

VM_PAGER_ERROR causes the page reactivation and does not clear the
page dirty state, so the write is not lost.

The change fixes an infinite loop in vm_object_page_clean() when the
filesystem returns permanent errors for some page writes.

Reported and tested by:	gavin
Reviewed by:	alc, rmacklem
MFC after:	1 week
2011-06-01 21:00:28 +00:00
Adrian Chadd
48237774e4 Flesh out the radar detection related operations for the ath driver.
This is in no way a complete DFS/radar detection implementation!
It merely creates an abstracted interface which allows for future
development of the DFS radar detection code.

Note: Net80211 already handles the bulk of the DFS machinery,
all we need to do here is figure out that a radar event has occured
and inform it as such. It then drives the DFS state engine for us.

The "null" DFS radar detection module is included by default;
it doesn't require a device line.

This commit:

* Adds a simple abstracted layer for radar detection state -
  sys/dev/ath/ath_dfs/;
* Implements a null DFS module which doesn't do anything;
  (ie, implements the exact behaviour at the moment);
* Adds hooks to the ath driver to process received radar events
  and gives the DFS module a chance to determine whether
  a radar has been detected.

Obtained from:	Atheros
2011-06-01 20:09:49 +00:00
Adrian Chadd
2cb5233b43 Add some missing DFS chipset functionality to the FreeBSD HAL.
Please note - this doesn't in any way constitute a full DFS
implementation, it merely adds the relevant capability bits and
radar detection threshold register access.

The particulars:

* Add new capability bits outlining what the DFS capabilities
  are of the various chipsets.
* Add HAL methods to set and get the radar related register values.
* Add AR5212 and AR5416+ DFS radar related register value
  routines.
* Add a missing HAL phy error code that's related to radar event
  processing.
* Add HAL_PHYERR_PARAM, a data type that encapsulates the radar
  register values.

The AR5212 routines are just for completeness. The AR5416 routines
are a super-set of those; I may later on do a drive-by pass to
tidy up duplicate code.

Obtained from:	Linux, Atheros
2011-06-01 20:01:02 +00:00
Robert Watson
6cb52192fe Add an optional netisr dispatch point at ether_input(), but set the
default dispatch method to NETISR_DISPATCH_DIRECT in order to force
direct dispatch.  This adds a fairly negligble overhead without
changing default behavior, but in the future will allow deferred or
hybrid dispatch to other worker threads before link layer processing
has taken place.

For example, this could allow redistribution using RSS hashes
without ethernet header cache line hits, if the NIC was unable to
adequately implement load balancing to too small a number of input
queues -- perhaps due to hard queueset counts of 1, 3, or 8, but in
a modern system with 16-128 threads.  This can happen on highly
threaded systems, where you want want an ithread per core,
redistributing work to other queues, but also on virtualised systems
where hardware hashing is (or is not) available, but only a single
queue has been directed to one VCPU on a VM.

Note: this adds a previously non-present assertion about the
equivalence of the ifnet from which the packet is received, and the
ifnet stamped in the mbuf header.  I believe this assertion to
generally be true, but we'll find out soon -- if it's not, we might
have to add additional overhead in some cases to add an m_tag with
the originating ifnet pointer stored in it.

Reviewed by:    bz
MFC after:      3 weeks
Sponsored by:   Juniper Networks, Inc.
2011-06-01 20:00:25 +00:00
Andrey V. Elsukov
281d42c371 O_FORWARD_IP is only action which depends from the result of lookup of
dynamic rules. We are doing forwarding in the following cases:
 o For the simple ipfw fwd rule, e.g.

	fwd 10.0.0.1 ip from any to any out xmit em0
	fwd 127.0.0.1,3128 tcp from any to any 80 in recv em1

 o For the dynamic fwd rule, e.g.

 	fwd 192.168.0.1 tcp from any to 10.0.0.3 3333 setup keep-state

        When this rule triggers it creates a dynamic rule, but this
	dynamic rule should forward packets only in forward direction.

 o And the last case that does not work before - simple fwd rule which
 triggers when some dynamic rule is already executed.

PR:		kern/147720, kern/150798
MFC after:	1 month
2011-06-01 19:44:52 +00:00
Pyun YongHyeon
082b754397 Poke correct GPIO pins for newer axe(4) controllers with Marvell
PHY. Newer models seem to use different LED mode that requires
enabling both GPIO1 and GPIO2.

Tested by:	marcel
2011-06-01 18:42:44 +00:00
Hans Petter Selasky
0c38ca8cf4 Add support for new USB serial driver.
Submitted by:	Lev Serebryakov, lev @
MFC after:	14 days
2011-06-01 17:58:27 +00:00
Jaakko Heinonen
b2ce2d693f Don't try to close the stream if fopen(3) fails.
PR:		bin/155349
Submitted by:	Urankar Mikael
2011-06-01 15:48:43 +00:00
Andrey V. Elsukov
88eb7833cb Hide some debug messages under debug macro.
MFC after:	1 week
2011-06-01 12:33:05 +00:00
Andrey V. Elsukov
e35a05d3e7 Hide useless warning under debug macro.
PR:		kern/69963
MFC after:	1 week
2011-06-01 12:05:35 +00:00
Jayachandran C.
d38ea3bc9e Add .interp back into INITIAL_READONLY_SECTIONS in MIPS n64 ABI.
The binutils update in r218822 caused the MIPS n64 dynamic binaries to
fail because the ".interp" section is not in the initial sections.
This happens because elf64bmip-defs.sh overrides INITIAL_READONLY_SECTIONS
to add ".MIPS.options" sections instead of the ".reginfo" section used
by n32.
This used to work fine, but after r218822, INITIAL_READONLY_SECTIONS also
contains the .interp section, so the override has to be done differently.

Reported by : aduane at juniper

Obtained from:	gonzo (Initial version)
2011-06-01 10:23:03 +00:00
Navdeep Parhar
272cba15b8 Provide hit-count with rest of the information about a filter.
MFC after:	1 week
2011-06-01 01:32:58 +00:00
Navdeep Parhar
136e410ceb Firmware device log.
# sysctl dev.t4nex.0.devlog

MFC after:	mdf's sysctl+sbuf changes are MFC'd
2011-05-31 23:49:13 +00:00
Kenneth D. Merry
534917efef Fix a bug introduced in revision 222537.
In msgbuf_reinit() and msgbuf_init(), we weren't initializing the mutex.
Depending on the contents of memory, the LO_INITIALIZED flag might be
set on the mutex (either due to a warm reboot, and the message buffer
remaining in place, or due to garbage in memory) and in that case, with
INVARIANTS turned on, we would trigger an assertion that the mutex had
already been initialized.

Fix this by bzeroing the message buffer mutex for the _init() and _reinit()
paths.

Reported by:	mdf
2011-05-31 22:39:32 +00:00
Jung-uk Kim
42e58c0372 Merge ACPICA 20110527. 2011-05-31 19:45:58 +00:00
Bernhard Schmidt
129145a426 Add module version to iwi/ipw/wpi and iwn.
The version is used to check if a module is already preset, not setting
it results in:

can't re-use a leaf (ipw)!
module_register: module pci/ipw already exists!
Module pci/ipw failed to register: 17

while trying to load the module due to an entry in loader.conf. With this
commit we get the expected:

module ipw already present!

Reported by:	Dru Lavigne, bz
Tested by:	bz
MFC after:	1 week
2011-05-31 19:08:25 +00:00
Pyun YongHyeon
20e43c4aac If driver is not running, disable interrupts and do not try to
process received frames.  Previously it was possible to handle RX
interrupts even if controller is not fully initialized. This
resulted in non-working driver after system is up and running.

Reported by:	hselasky
Tested by:	hselasky
2011-05-31 18:45:15 +00:00
Rick Macklem
6b43e31fe7 Add a sentence to the umount.8 man page to clarify the behaviour
for forced dismount when used on an NFS mount point. Requested by
Jeremy Chadwick.
This is a content change.

MFC after:	2 weeks
2011-05-31 18:27:18 +00:00
Rick Macklem
b398d10657 Fix the new NFS client so that it doesn't do an NFSv3
Pathconf RPC for cases where the reply doesn't include
the answer. This fixes a problem reported by avg@ where
the NFSv3 Pathconf RPC would fail when "ls -l" did an
lpathconf(2) for _PC_ACL_NFS4.

Tested by:	avg
MFC after:	2 weeks
2011-05-31 17:43:25 +00:00
Jung-uk Kim
eb16cf140e Import ACPICA 20110527. 2011-05-31 17:33:30 +00:00
Kenneth D. Merry
d42a4eb507 Fix apparent garbage in the message buffer.
While we have had a fix in place (options PRINTF_BUFR_SIZE=128) to fix
scrambled console output, the message buffer and syslog were still getting
log messages one character at a time.  While all of the characters still
made it into the log (courtesy of atomic operations), they were often
interleaved when there were multiple threads writing to the buffer at the
same time.

This fixes message buffer accesses to use buffering logic as well, so that
strings that are less than PRINTF_BUFR_SIZE will be put into the message
buffer atomically.  So now dmesg output should look the same as console
output.

subr_msgbuf.c:		Convert most message buffer calls to use a new spin
			lock instead of atomic variables in some places.

			Add a new routine, msgbuf_addstr(), that adds a
			NUL-terminated string to a message buffer.  This
			takes a priority argument, which allows us to
			eliminate some races (at least in the the string
			at a time case) that are present in the
			implementation of msglogchar().  (dangling and
			lastpri are static variables, and are subject to
			races when multiple callers are present.)

			msgbuf_addstr() also allows the caller to request
			that carriage returns be stripped out of the
			string.  This matches the behavior of msglogchar(),
			but in testing so far it doesn't appear that any
			newlines are being stripped out.  So the carriage
			return removal functionality may be a candidate
			for removal later on if further analysis shows
			that it isn't necessary.

subr_prf.c:		Add a new msglogstr() routine that calls
			msgbuf_logstr().

			Rename putcons() to putbuf().  This now handles
			buffered output to the message log as well as
			the console.  Also, remove the logic in putcons()
			(now putbuf()) that added a carriage return before
			a newline.  The console path was the only path that
			needed it, and cnputc() (called by cnputs())
			already adds a carriage return.  So this
			duplication resulted in kernel-generated console
			output lines ending in '\r''\r''\n'.

			Refactor putchar() to handle the new buffering
			scheme.

			Add buffering to log().

			Change log_console() to use msglogstr() instead of
			msglogchar().  Don't add extra newlines by default
			in log_console().  Hide that behavior behind a
			tunable/sysctl (kern.log_console_add_linefeed) for
			those who would like the old behavior.  The old
			behavior led to the insertion of extra newlines
			for log output for programs that print out a
			string, and then a trailing newline on a separate
			write.  (This is visible with dmesg -a.)

msgbuf.h:		Add a prototype for msgbuf_addstr().

			Add three new fields to struct msgbuf, msg_needsnl,
			msg_lastpri and msg_lock.  The first two are needed
			for log message functionality previously handled
			by msglogchar().  (Which is still active if
			buffering isn't enabled.)

			Include sys/lock.h and sys/mutex.h for the new
			mutex.

Reviewed by:	gibbs
2011-05-31 17:29:58 +00:00
Warner Losh
1d6fbefd90 Don't need (and can't use) -L to copy links here. 2011-05-31 17:14:06 +00:00
Warner Losh
f471745a98 Fix a couple of spelling errors.
Submitted by:	bcr@
2011-05-31 16:59:14 +00:00
John Baldwin
35b23f5d86 - Document the -H option and 'H' key alongside other options and keys
rather than at the bottom of the manpage.
- Remove an obsolete comment about SWAIT being a stale state.  It was
  resurrected for a different purpose in FreeBSD 5 to mark idle ithreads.
- Add a comment documenting that the SLEEP and LOCK states typically
  display the name of the event being waited on with lock names being
  prefixed with an asterisk and sleep event names not having a prefix.

MFC after:	1 week
2011-05-31 15:41:10 +00:00
Nathan Whitehorn
d098f93019 On multi-core, multi-threaded PPC systems, it is important that the threads
be brought up in the order they are enumerated in the device tree (in
particular, that thread 0 on each core be brought up first). The SLIST
through which we loop to start the CPUs has all of its entries added with
SLIST_INSERT_HEAD(), which means it is in reverse order of enumeration
and so AP startup would always fail in such situations (causing a machine
check or RTAS failure). Fix this by changing the SLIST into an STAILQ,
and inserting new CPUs at the end.

Reviewed by:	jhb
2011-05-31 15:11:43 +00:00
John Baldwin
c9385548e7 Add a new option to toggle the display of the system idle process (per-CPU
idle threads).  The process is displayed by default (subject to whether or
not system processes are displayed) to preserve existing behavior.  The
system idle process can be hidden via the '-z' command line argument or the
'z' key while top is running.  When it is hidden, top more closely matches
the behavior of FreeBSD <= 4.x where idle time was not accounted to any
process.

MFC after:	2 weeks
2011-05-31 15:11:23 +00:00
Bjoern A. Zeeb
06034940f5 Remove some further INET related symbols from pf to allow the module
to not only compile bu load as well for testing with IPv6-only kernels.
For the moment we ignore the csum change in pf_ioctl.c given the
pending update to pf45.

Reported by:	dru
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	20 days
2011-05-31 15:05:29 +00:00
Bjoern A. Zeeb
decedfc4f9 Start teaching pc-sysinstall about IPv6.
Add some additional empty string checks for IPv4 and try to configure
a netmask along with the address rather than doing things twice.

Contrary to AUTO-DHCP, IPv6-SLAAC will accept static configuration
as well, which we will use at least for resolv.conf currently and
if we were given a static address configure that as an alias as well.

The pc-sysinstaller changes going along were committed to PC-BSD as r10773.

Reviewed by:	kmoore
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	20 days
2011-05-31 15:02:30 +00:00
Bjoern A. Zeeb
5af3fa9a5f Conditionally compile in the af_inet and af_inet6, af_nd6 modules.
If compiled in for dual-stack use, test with feature_present(3)
to see if we should register the IPv4/IPv6 address family related
options.

In case there is no "inet" support we would love to go with the
usage() and make the address family mandatory (as it is for anything
but inet in theory).  Unfortunately people are used to
  ifconfig IF up/down
etc. as well, so use a fallback of "link".  Adjust the man page
to reflect these minor details.

Improve error handling printing a warning in addition to the usage
telling that we do not know the given address family in two places.

Reviewed by:	hrs, rwatson
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	2 weeks
2011-05-31 14:40:21 +00:00
Nathan Whitehorn
d408a341b2 It is generally considered useful for release media to have kernels on them.
Submitted by:	joel
2011-05-31 12:59:15 +00:00
Alexander Motin
d3a460d36c Add quirks to hint 4K physical sector (Advanced Format) for ATA disks not
reporting it properly (none? of known disks now).

Hitachi and WDC AF disks seem could be identified more or less formally.
For Seagate and Samsung enumerate some found models/series.
For other disks it can be forced with kern.cam.ada.X.quirks=1 tunable.
2011-05-31 09:22:52 +00:00
Benedict Reuschling
6b436e6252 Minor wording adjustments to usbdump(8).
PR:		docs/157317
Submitted by:	Warren Block (wblock at wonkity dot com)
Reviewed by:	hps@
MFC after:	5 days
2011-05-31 07:13:07 +00:00
Pawel Jakub Dawidek
12b9f8e47d Imagine situation where a security problem is found in setuid binary.
User upgrades his system to fix the problem, but if he has any ZFS snapshots
for the file system which contains problematic binary, any user can mount the
snapshot and execute vulnerable binary.

Prevent this from happening by always mounting snapshots with setuid turned off.

MFC after:	2 weeks
2011-05-31 07:02:49 +00:00
Pyun YongHyeon
7c017a713e Correctly check MAC running status before disabling TX/RX MACs. 2011-05-31 01:30:58 +00:00
Bjoern A. Zeeb
1dd53eaea3 No logner set an IPv4 loopback address by default in defaults/rc.conf.
If not specified, network.subr will add it automatically if we have
INET support (1).

In network.subr only call the address family up/down functions
if the respective AF is available.

Switch to new kern.features variables for inet and inet6 as the
inet sysctl tree is also available for IPv6-only kernels leading
to unexpected results.

Suggested by:	hrs (1)
Reviewed by:	hrs
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	20 days
2011-05-31 00:25:52 +00:00
Navdeep Parhar
b400f1ea97 Update to firmware interface 1.3.10
MFC after:	1 week
2011-05-30 21:56:37 +00:00
Jilles Tjoelker
36ae1a9441 sh: Add tests for some somewhat obscure aspects of function definitions. 2011-05-30 21:49:59 +00:00
Jilles Tjoelker
562b28821e posix_spawn(): Do not fail when trying to close an fd that is not open.
As noted in Austin Group issue #370 (an interpretation has been issued),
failing posix_spawn() because an fd specified with
posix_spawn_file_actions_addclose() is not open is unnecessarily harsh, and
there are existing implementations that do not fail posix_spawn() for this
reason.

Reviewed by:	ed
MFC after:	10 days
2011-05-30 21:41:06 +00:00
Navdeep Parhar
56599263c5 - Specialized ingress queues that take interrupts for other ingress
queues.  Try to have a set of these per port when possible, fall back
  to sharing a common pool between all ports otherwise.

- One control queue per port (used to be one per hardware channel).

- t4_eth_rx now handles Ethernet rx only.

- sysctls to display pidx/cidx for some queues.

MFC after:	1 week
2011-05-30 21:34:44 +00:00
Navdeep Parhar
4dba21f17e L2 table code. This is enough to get the T4's switch + L2 rewrite
filters working.  (All other filters - switch without L2 info rewrite,
steer, and drop - were already fully-functional).

Some contrived examples of "switch" filters with L2 rewriting:

# cxgbetool t4nex0  iport 0  dport 80  action switch  vlan +9  eport 3
Intercept all packets received on physical port 0 with TCP port 80 as
destination, insert a vlan tag with VID 9, and send them out of port 3.

# cxgbetool t4nex0  sip 192.168.1.1/32  ivlan 5  action switch \
	vlan =9  smac aa:bb:cc:dd:ee:ff  eport 0
Intercept all packets (received on any port) with source IP address
192.168.1.1 and VLAN id 5, rewrite the VLAN id to 9, rewrite source mac
to aa:bb:cc:dd:ee:ff, and send it out of port 0.

MFC after:	1 week
2011-05-30 21:07:26 +00:00
Steve Kargl
9aa461b570 Clean up the unneeded cpp macro INLINE_REM_PIO2L.
Reviewed by:	das
Approved by:	das (mentor)
2011-05-30 19:41:28 +00:00
Bjoern A. Zeeb
d2025bd0f6 Unbreak NOINET kernels after r222488.
Reviewed by:	rwatson
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems!
Pointy hat:	to myself for missing this during review?
2011-05-30 18:07:35 +00:00
Bjoern A. Zeeb
f07f97be05 Contrary to the rc.conf framework, when manualy enabling IPv6 we have
to -ifdiabled ourselves.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
2011-05-30 17:27:48 +00:00
Adrian Chadd
6246be6e58 Enable setting the short-GI bit when TX'ing HT rates but only if the
hardware supports it.

Since ni->ni_htcap in hostap mode is what the remote end has advertised,
not what has been negotiated/decided, we need to check ourselves what
the current channel width is and what the hardware supports before
enabling short-GI.

It's important that short-GI isn't enabled when it isn't negotiated
and when the hardware doesn't support it (ie, short-gi for 20mhz channels
on any chip < AR9287.)

I've quickly verified this on the AR9285 in 11n mode.
2011-05-30 15:06:57 +00:00
Adrian Chadd
9be25f4a3a Set default A-MPDU density/size. 2011-05-30 14:57:00 +00:00
Andrey V. Elsukov
6f5286dca6 Document kern.geom.part.check_integrity sysctl variable. 2011-05-30 11:17:42 +00:00
Benedict Reuschling
69a2457d15 Bump document date.
I accidently committed the actual change (typo fix) in r222492, which
is a completely unrelated change.
2011-05-30 10:28:55 +00:00
Benedict Reuschling
b7642c92bf Add a short description about NO_CHECKSUM.
PR:		docs/155980
Submitted by	KOIE Hidetaka (koie at suri co jp)
MFC after:	7 days
2011-05-30 10:23:59 +00:00