Commit Graph

86870 Commits

Author SHA1 Message Date
John Baldwin
ddac8cc944 Fix a couple of bugs that prevented windows in PCI-PCI bridges from
growing "downward" (moving the start address down).  First, an off by
one error caused the end address to be moved down an extra alignment
chunk unnecessarily.  Second, when aligning the new candidate starting
address, the wrong bits were masked off.

Tested by:	Andrey Zonov  andrey zonov org
MFC after:	3 days
2012-06-13 15:04:50 +00:00
Martin Matuska
253a9c296c Fix ZFS boot with pre-features pools (version <= 28) broken in r236884
Reported by:	mav
MFC after:	1 month
2012-06-13 08:00:32 +00:00
Adrian Chadd
af33d486ab Implement a separate, smaller pool of ath_buf entries for use by management
traffic.

* Create sc_mgmt_txbuf and sc_mgmt_txdesc, initialise/free them appropriately.
* Create an enum to represent buffer types in the API.
* Extend ath_getbuf() and _ath_getbuf_locked() to take the above enum.
* Right now anything sent via ic_raw_xmit() allocates via ATH_BUFTYPE_MGMT.
  This may not be very useful.
* Add ATH_BUF_MGMT flag (ath_buf.bf_flags) which indicates the current buffer
  is a mgmt buffer and should go back onto the mgmt free list.
* Extend 'txagg' to include debugging output for both normal and mgmt txbufs.
* When checking/clearing ATH_BUF_BUSY, do it on both TX pools.

Tested:

* STA mode, with heavy UDP injection via iperf.  This filled the TX queue
  however BARs were still going out successfully.

TODO:

* Initialise the mgmt buffers with ATH_BUF_MGMT and then ensure the right
  type is being allocated and freed on the appropriate list.  That'd save
  a write operation (to bf->bf_flags) on each buffer alloc/free.

* Test on AP mode, ensure that BAR TX and probe responses go out nicely
  when the main TX queue is filled (eg with paused traffic to a TID,
  awaiting a BAR to complete.)

PR:		kern/168170
2012-06-13 06:57:55 +00:00
Fabien Thomas
790fb4edf2 Add ARM callchain support for hwpmc.
Sponsored by: NETASQ
MFC after:	3 days
2012-06-13 06:38:25 +00:00
Adrian Chadd
46f5390139 Remove a duplicate definition. 2012-06-13 05:47:24 +00:00
Adrian Chadd
32c387f76a Oops, return the newly allocated buffer to the queue, not the completed
buffer.

PR:	kern/168170
2012-06-13 05:41:00 +00:00
Adrian Chadd
e1a50456b6 Replace the direct sc_txbuf manipulation with a pair of functions.
This is preparation work for having a separate ath_buf queue for
management traffic.

PR:		kern/168170
2012-06-13 05:39:16 +00:00
Warner Losh
ee5cac8ab0 trim trailing whitespace 2012-06-13 05:02:51 +00:00
Warner Losh
5e92d389b2 Final whitespace trim. 2012-06-13 04:59:55 +00:00
Warner Losh
c358d6a2b0 Trim trailing whitespace... 2012-06-13 04:59:00 +00:00
Warner Losh
6a7be52dbe Strip trailing whitespace before other changes. 2012-06-13 04:52:19 +00:00
Warner Losh
c6e675f9e5 Strip trailing whitespace. 2012-06-13 04:40:29 +00:00
Warner Losh
a698b62cf5 trim trailing spaces that have accumulated over the years (these files
served as the basis for too many other platforms).
2012-06-13 04:38:09 +00:00
John Baldwin
56d20d01b5 Replace a reference to the non-existent SI_ORDER_LAST in a comment with
SI_ORDER_ANY.

Submitted by:	Brandon Gooch  brandongooch yahoo com
2012-06-12 18:19:46 +00:00
Dag-Erling Smørgrav
9189ae71fa auth.conf is dead. 2012-06-12 17:04:56 +00:00
Michael Tuexen
f584d74b4d Add a cmsg of type IP_TOS for UDP/IPv4 sockets to specify the TOS byte.
MFC after: 3 days
2012-06-12 14:56:08 +00:00
Michael Tuexen
3cca425b29 Add a IP_RECVTOS socket option to receive for received UDP/IPv4
packets a cmsg of type IP_RECVTOS which contains the TOS byte.
Much like IP_RECVTTL does for TTL. This allows to implement a
protocol on top of UDP and implementing ECN.

MFC after: 3 days
2012-06-12 14:02:38 +00:00
Michael Tuexen
b36dcb9a39 Deliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (if
requested) on IPV6 sockets, which have been marked to be not IPV6_V6ONLY,
for each received IPV4 packet.

MFC after: 3 days
2012-06-12 13:57:56 +00:00
Randall Stewart
4013878828 Fix comment to better reflect how we are
cheating and using the csum_data. Also fix
style issues with the comments.
2012-06-12 13:31:32 +00:00
Michael Tuexen
c9e089587c Unify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks.
While there: Fix also some minor bugs and prepare for SCTP/DTLS.

MFC after: 3 days
2012-06-12 13:15:27 +00:00
Randall Stewart
cef68c63ec Note to self. Have morning coffee *before* committing things.
There is no mac_addr in the mbuf for BSD.. cheat like
we are supposed to and use the csum field since our friend
the gif tunnel itself will never use offload.
2012-06-12 12:44:17 +00:00
Randall Stewart
6f17e3a31a Opps forgot to commit the flag. 2012-06-12 12:40:15 +00:00
Bjoern A. Zeeb
b0a576ce8e Fix a problem where zero-length RDATA fields can cause named(8) to crash.
[12:03]

Correct a privilege escalation when returning from kernel if
running FreeBSD/amd64 on non-AMD processors. [12:04]

Fix reference count errors in IPv6 code. [EN-12:02]

Security:	CVE-2012-1667
Security:	FreeBSD-SA-12:03.bind
Security:	CVE-2012-0217
Security:	FreeBSD-SA-12:04.sysret
Security:	FreeBSD-EN-12:02.ipv6refcount
Approved by:	so (simon, bz)
2012-06-12 12:10:10 +00:00
Alexander Motin
b30c7d5167 - Limit r214102 workaround to only x86. On arm it causes more problems
then solves because of cache coherency issues. This fixes periodic error
messages on console and command timeouts.
 - Patch SATA PHY configuration for 65nm SoCs to improve SNR same as
Linux does.

MFC after:	2 weeks
2012-06-12 11:08:51 +00:00
Randall Stewart
776b728856 Allow a gif tunnel to be used with ALTq.
Reviewed by:	gnn
2012-06-12 10:44:09 +00:00
Pawel Jakub Dawidek
faf0db351d Revert part of the r236935 for now, until I figure out why it doesn't
work properly.

Reported by:	davidxu
2012-06-12 10:25:11 +00:00
Michael Tuexen
17267b32d8 Small cleanup.
MFC after: 3 days
2012-06-12 09:18:28 +00:00
Mitsuru IWASAKI
77c80e2e5b Share IPI init and startup code of mp_machdep.c with acpi_wakeup.c
as ipi_startup().
2012-06-12 00:14:54 +00:00
Kirk McKusick
aa445c9d7c In softdep_setup_inomapdep() we may have to allocate both inodedep
and bmsafemap dependency structures in inodedep_lookup() and
bmsafemap_lookup() respectively. The setup of these structures must
be done while holding the soft-dependency mutex. If the inodedep is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the bmsafemap. If the bmsafemap is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the inodedep.

To resolve this problem, bmsafemap_lookup has had a parameter added
that allows a pre-malloc'ed bmsafemap to be passed in so that it does
not need to release the mutex to create a new bmsafemap. The
softdep_setup_inomapdep() routine pre-malloc's a bmsafemap dependency
before acquiring the mutex and starting to build the inodedep with a
call to inodedep_lookup(). The subsequent call to bmsafemap_lookup()
is passed this pre-allocated bmsafemap entry so that it need not
release the mutex if it needs to create a new one.

Reported by: Peter Holm
Tested by:   Peter Holm
MFC after:   1 week
2012-06-11 23:07:21 +00:00
Pawel Jakub Dawidek
039dc89f0d fdgrowtable() no longer drops the filedesc lock so it is enough to
retry finding free file descriptor only once after fdgrowtable().

Spotted by:	pluknet
MFC after:	1 month
2012-06-11 22:05:26 +00:00
Alan Cox
efab609272 Avoid unnecessary atomic operations for clearing PGA_WRITEABLE in
pmap_remove_pages().  This reduces pmap_remove_pages()'s running time by
4 to 11% in my tests.

MFC after:	1 week
2012-06-11 21:41:16 +00:00
Pawel Jakub Dawidek
21877e81ec Use consistent way of checking if descriptor number is valid.
MFC after:	1 month
2012-06-11 20:19:24 +00:00
Pawel Jakub Dawidek
d3ec30e525 Use consistent way of checking if descriptor number is valid.
MFC after:	1 month
2012-06-11 20:17:20 +00:00
Andrew Thompson
08e348234c Fix a panic I introduced in r234487, the bridge softc pointer is set to null
early in the detach so rearrange things not to explode.

Reported by:	David Roffiaen, Gustau Perez Querol
Tested by:	David Roffiaen
MFC after:	3 days
2012-06-11 20:12:13 +00:00
Pawel Jakub Dawidek
fd45a47ba6 Be consistent with white spaces.
MFC after:	1 month
2012-06-11 20:01:50 +00:00
Pawel Jakub Dawidek
19d9c0e11e Remove code duplicated in kern_close() and do_dup() and use closefp() function
introduced a minute ago.

This code duplication was responsible for the bug fixed in r236853.

Discussed with:	kib
Tested by:	pho
MFC after:	1 month
2012-06-11 20:00:44 +00:00
Pawel Jakub Dawidek
642db963ab Introduce closefp() function that we will be able to use to eliminate
code duplication in kern_close() and do_dup().

This is committed separately from the actual removal of the duplicated
code, as the combined diff was very hard to read.

Discussed with:	kib
Tested by:	pho
MFC after:	1 month
2012-06-11 19:57:31 +00:00
Pawel Jakub Dawidek
129c87eb7d Merge two ifs into one to make the code almost identical to the code in
kern_close().

Discussed with:	kib
Tested by:	pho
MFC after:	1 month
2012-06-11 19:53:41 +00:00
Pawel Jakub Dawidek
d327cee241 Move the code around a bit to move two parts of code duplicated from
kern_close() close together.

Discussed with:	kib
Tested by:	pho
MFC after:	1 month
2012-06-11 19:51:27 +00:00
Pawel Jakub Dawidek
8b40793150 Now that fdgrowtable() doesn't drop the filedesc lock we don't need to
check if descriptor changed from under us. Replace the check with an
assert.

Discussed with:	kib
Tested by:	pho
MFC after:	1 month
2012-06-11 19:48:55 +00:00
Mitsuru IWASAKI
c1b0dc80b5 Another fixe for r236772.
- Adjust correct cpuset (stopped_cpus/suspended_cpus) for
  cpu_spinwait() in generic_stop_cpus().
2012-06-11 18:47:26 +00:00
Mateusz Guzik
414d9b2ed0 Fix unloading of libiconv module.
Previously it would either loop infinitely or exit with error leaking a lock.

Reported by:	Will DeVries
Approved by:	trasz (mentor)
MFC after:	1 week
2012-06-11 17:42:39 +00:00
Pawel Jakub Dawidek
f3cd980557 Style fixes and simplifications.
MFC after:	1 month
2012-06-11 16:08:03 +00:00
Adrian Chadd
c7c073413b Fix uninitialised reference.
Noticed by:	John Hay <jhay@meraka.org.za>
2012-06-11 12:26:23 +00:00
Martin Matuska
2d9cf57e18 Introduce "feature flags" for ZFS pools (bump SPA version to 5000).
Add first feature "com.delphix:async_destroy" (asynchronous destroy
of ZFS datasets).
Implement features support in ZFS boot code.

Illumos revisions merged:
13700:2889e2596bd6
13701:1949b688d5fb
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags

References:
https://www.illumos.org/issues/2619
https://www.illumos.org/issues/2747

Obtained from:	illumos (issue #2619, #2747)
MFC after:	1 month
2012-06-11 11:35:22 +00:00
Adrian Chadd
7561cb5c8b Wrap the whole (software) TX path from ifnet dequeue to software queue
(or direct dispatch) behind the TXQ lock (which, remember, is doubling
as the TID lock too for now.)

This ensures that:

 (a) the sequence number and the CCMP PN allocation is done together;
 (b) overlapping transmit paths don't interleave frames, so we don't
     end up with the original issue that triggered kern/166190.

     Ie, that we don't end up with seqno A, B in thread 1, C, D in
     thread 2, and they being queued to the software queue as "A C D B"
     or similar, leading to the BAW stalls.

This has been tested:

* both STA and AP modes with INVARIANTS and WITNESS;
* TCP and UDP TX;
* both STA->AP and AP->STA.

STA is a Routerstation Pro (single CPU MIPS) and the AP is a dual-core
Centrino.

PR:		kern/166190
2012-06-11 07:44:16 +00:00
Adrian Chadd
4b6db4043f Add another TID lock. 2012-06-11 07:35:24 +00:00
Adrian Chadd
ba0e58f4fa Make sure the frames are queued to the head of the list, not the tail.
See previous commit.

PR:		kern/166190
2012-06-11 07:31:50 +00:00
Adrian Chadd
39f24578fb When scheduling frames in an aggregate session, the frames should be
scheduled from the head of the software queue rather than trying to
queue the newly given frame.

This leads to some rather unfortunate out of order (but still valid
as it's inside the BAW) frame TX.

This now:

* Always queues the frame at the end of the software queue;
* Tries to direct dispatch the frame at the head of the software queue,
  to try and fill up the hardware queue.

TODO:

* I should likely try to queue as many frames to the hardware as I can
  at this point, rather than doing one at a time;
* ath_tx_xmit_aggr() may fail and this code assumes that it'll schedule
  the TID.  Otherwise TX may stall.

PR:		kern/166190
2012-06-11 07:29:25 +00:00
Adrian Chadd
4547f047ba Retried frames need to be inserted in the head of the list, not the tail.
This is an unfortunate byproduct of how the routine is used - it's called
with the head frame on the queue, but if the frame is failed, it's inserted
into the tail of the queue.

Because of this, the sequence numbers would get all shuffled around and
the BAW would be bumped past this sequence number, that's now at the
end of the software queue.  Then, whenever it's time for that frame
to be transmitted, it'll be immediately outside of the BAW and TX will
stall until the BAW catches up.

It can also result in all kinds of weird duplicate BAW frames, leading
to hilarious panics.

PR:		kern/166190
2012-06-11 07:15:48 +00:00