Commit Graph

160809 Commits

Author SHA1 Message Date
Konstantin Belousov
9ca9fc5380 If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.

Switch to nowait allocations after we got first buffer already.

Reported by:	az
Reviewed by:	alc (previous version)
Tested by:	pho
MFC after:	1 week
2011-01-28 17:37:09 +00:00
Sergey Kandaurov
3fce3875e5 Remove SuperH architecture from a comment as we do not support it.
Presumably it was leaked from NetBSD together with rtld-elf mips support.

Approved by:	kib (mentor)
MFC after:	3 days
2011-01-28 17:30:24 +00:00
Jilles Tjoelker
90750179ec Do not trip a KASSERT if /dev/null cannot be opened for a setuid program.
The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening
/dev/null. If this fails (e.g. missing devfs or wrong permissions),
fdcheckstd() will return failure and the process will exit as if it received
SIGABRT. The KASSERT is only to check that kern_open() returns the expected
fd, given that it succeeded.

Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not.

MFC after:	2 weeks
2011-01-28 15:29:35 +00:00
Andrey V. Elsukov
219762ba49 Document the "bios-boot" partition type.
MFC after:	2 weeks
2011-01-28 11:56:14 +00:00
Andrey V. Elsukov
88007f6102 Add new user-friendly aliases for partition types for the MBR and
EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and
linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by
GRUB 2 loader. Also do sorting definitions of types in diskmbr.h
and in g_part.c.

PR:		bin/120990, kern/147664
MFC after:	2 weeks
2011-01-28 11:13:01 +00:00
Adrian Chadd
a6a308a4df (Mostly) teach ath_rate_sample about MCS rates.
This is just the bare minimum needed to teach ath_rate_sample to try
and handle MCS rates. It doesn't at all attempt to find the best
rate by any means - it doesn't know anything about the MCS rate
relations, TX aggregation or any of the much sexier 11n stuff
that's out there.

It's just enough to transmit 11n frames and handle TX completion.

It shouldn't affect legacy (11abg) behaviour.

Obtained from:	rpaulo@
2011-01-28 08:57:58 +00:00
Adrian Chadd
064e40d0ab Make space for the extended 802.11n MCS rate tables. 2011-01-28 08:45:19 +00:00
Adrian Chadd
d054f3a866 Bring in some 802.11n packet duration calculation functions from a mix of Sam/Rui and linux ath9k .
This will eventually be used by rate control modules and by the TX
code for calculating packet duration when handling rts/cts protection.

Obtained from:	sam@, rpaulo@, linux ath9k
2011-01-28 08:35:55 +00:00
Hans Petter Selasky
0ddfc9486b - Remove double semicolon.
- Remove reference to sprintf. Use printf directly. This part of
the code should be optimised further to avoid many small printouts.
Setting a sensible line buffer length could help aswell when printing
out megabytes of data per second.

Approved by:	thompsa (mentor)
2011-01-28 08:00:57 +00:00
Jayachandran C.
baa8c35cb4 CDDL fixes for MIPS n32.
Provide 64 bit atomic ops, and use 32 bit pointer.
2011-01-28 06:12:59 +00:00
Dmitry Chagin
d908c2d2a2 Style(9) fix.
MFC after:	1 month.
2011-01-28 05:42:14 +00:00
Jilles Tjoelker
8c3afde82c sh: Add test for EXIT trap in command substitution.
This is not really realistic but is an opposition to $(trap).
2011-01-27 23:08:20 +00:00
Konstantin Belousov
77185f473b linux_sigreturn() loads the struct trapframe from l_sigcontext
members, thus making a signed extension of 32 bit register
context. If the register is not touched in usermode between
return from signal and next syscall entry, the sign-extension
part of 64bit register is not cleared, causing
linux32_fetch_syscall_args() to read wrong values.

Use unsigned type for the registers in the linux sigcontext.

Reported by:	Jacob Frelinger <jacob.frelinger duke edu>, arundel
In collaboration with:	dchagin
MFC after:	1 week
2011-01-27 21:45:38 +00:00
Pyun YongHyeon
ddc850164c ixgb(4) does not support altq(4) yet. 2011-01-27 20:08:14 +00:00
Pyun YongHyeon
c8e96dae57 Backout r216577. ixgb(4) does not support altq(4) yet. 2011-01-27 20:06:24 +00:00
Pawel Jakub Dawidek
19654a238e Remember created control connection so on fork(2) we can close it in child.
Found with:	procstat(1)
MFC after:	1 week
2011-01-27 19:33:57 +00:00
Pawel Jakub Dawidek
c0dbce0016 Close the control socket before exiting, so it will be unlinked.
MFC after:	1 week
2011-01-27 19:31:35 +00:00
Pawel Jakub Dawidek
94bf851dc1 Extend pjdlog_verify() to support the following additional macros:
PJDLOG_RVERIFY() - always check expression and on false log the given message
	and exit.
PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log
	given message and exit.
PJDLOG_ABORT() - log the given message and exit.

MFC after:	1 week
2011-01-27 19:28:29 +00:00
Pawel Jakub Dawidek
eeb3cd677d Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

MFC after:	1 week
2011-01-27 19:24:07 +00:00
Pawel Jakub Dawidek
6ef7ddd788 Use my copyright for 2011 work.
MFC after:	1 week
2011-01-27 19:18:42 +00:00
Pawel Jakub Dawidek
c62457374f Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open
so there are no surprises once we start chrooting or using capsicum.

MFC after:	1 week
2011-01-27 19:15:25 +00:00
Pawel Jakub Dawidek
c1410d7a90 - Remove obvious NOTREACHED comment after abort() call.
- Remove redundant newline at the end of the file.

MFC after:	1 week
2011-01-27 19:12:44 +00:00
Pawel Jakub Dawidek
6062588f8d Remove __dead2 from pjdlog_verify() prototype, it does return sometimes.
MFC after:	1 week
2011-01-27 19:10:24 +00:00
Konstantin Belousov
4a13a769dc Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
covering the whole page, free the page. Otherwise, clear the region and
mark it clean. Not marking the page dirty could reinstantiate cleared
data, but it is allowed by BIO_DELETE specification and saves unneeded
write to swap.

Reviewed by:	alc
Tested by:	pho
MFC after:	2 weeks
2011-01-27 16:10:25 +00:00
Jayachandran C.
21835e695a Implement sf_buf using direct map (XKPHYS) in MIPS n64.
- Provide trivial implementation of sf_buf_alloc(), sf_buf_free(),
  sf_buf_kva() and sf_buf_page() using direct map for n64.
- uio_machdep.c - use macros so that the direct map will be used in
  case of n64.

Reviewed by:	imp (earlier version)
Obtained from:	jmallett (user/jmallett/octeon)
2011-01-27 14:49:22 +00:00
Jayachandran C.
7b87c35eba Fix n32 compile.
These changes are needed to fix n32 compile after the recent change of
mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el.

Reviewed by:	imp, bz (earlier version)
2011-01-27 14:16:12 +00:00
Adrian Chadd
0fafe07ff3 Initialise the chainmask from the EEPROM rather than the hard-coded defaults.
The defaults enabled three chains on the AR5416 even if the card has two
chains. This restores that and ensures that only the correct TX/RX
chainmasks are used.

When HT modes are enabled, all TX chains will be correctly enabled.

This should now enable analog chain swapping with 2-chain cards.
I'm not sure if this is needed for just the AR5416 or whether
it also applies to AR9160, AR9280 and AR9287 (later on); I'll have
to get clarification.
2011-01-27 09:26:37 +00:00
Adrian Chadd
4ceb85596b Add missing getCapability call for AR5416. 2011-01-27 08:42:50 +00:00
Andrey V. Elsukov
1313160649 While inspecting the disklabel check that start offset of partition is
within provider's bounds. If not then reject this disklabel.
Mark bbarea as NULL to do not free it again in destroy method.

MFC after:	1 week
2011-01-27 08:02:26 +00:00
Adrian Chadd
51fcc8350c Make a note to re-check whether that particular check is needed. 2011-01-27 07:33:17 +00:00
George V. Neville-Neil
64181ef324 Quick fix to a comment. 2011-01-27 03:32:16 +00:00
Adrian Chadd
6ef699a0a6 Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
This, along with an initval change which will appear in a subsequent commit,
fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro
(AR7161 MIPS board.)

Obtained from: Linux ath9k
PR: kern/154220
2011-01-27 02:56:03 +00:00
Matthew D Fleming
00f0e671ff Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.

Inspired by:	rwatson
2011-01-27 00:34:12 +00:00
Matthew D Fleming
73d6f8516d Remove the CTLFLAG_NOLOCK as it seems to be both unused and
unfunctional.  Wiring the user buffer has only been done explicitly
since r101422.

Mark the kern.disks sysctl as MPSAFE since it is and it seems to have
been mis-using the NOLOCK flag.

Partially break the KPI (but not the KBI) for the sysctl_req 'lock'
field since this member should be private and the "REQ_LOCKED" state
seems meaningless now.
2011-01-26 22:48:09 +00:00
Pyun YongHyeon
da65f7d0fe Document newly added tunables.
hw.re.intr_filter
 hw.re.msix_disable
 dev.re.%d.int_rx_mod
2011-01-26 21:59:59 +00:00
Michael Tuexen
f8cdf87663 * Use 300 ms as the default for RTO_MIN.
* Disable burst mitigation by default.
* Remove unused constant.
Discussed with rrs.
MFC after: 3 months.
2011-01-26 21:38:17 +00:00
Pyun YongHyeon
54899a96e1 Add support for RTL8105E PCIe Fast Ethernet controller. It seems
the controller has a kind of embedded controller/memory and vendor
applies a large set of magic code via undocumented PHY registers in
device initialization stage. I guess it's a firmware image for the
embedded controller in RTL8105E since the code is too big compared
to other DSP fixups. However I have no idea what that magic code
does and what's purpose of the embedded controller. Fortunately
driver seems to still work without loading the firmware.

While I'm here change device description of RTL810xE controller.

H/W donated by:	Realtek Semiconductor Corp.
2011-01-26 21:14:20 +00:00
Pyun YongHyeon
ed072c9d1a Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
exact model name is not clear yet. All previous RTL8201 10/100 PHYs
used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20
but this PHY used new model number 0x08.
2011-01-26 21:07:44 +00:00
Pyun YongHyeon
502be0f749 Do not use interrupt taskqueue on controllers with MSI/MSI-X
capability. One of reason using interrupt taskqueue in re(4) was
to reduce number of TX/RX interrupts under load because re(4)
controllers have no good TX/RX interrupt moderation mechanism.
Basic TX interrupt moderation is done by hardware for most
controllers but RX interrupt moderation through undocumented
register showed poor RX performance so it was disabled in r215025.
Using taskqueue to handle RX interrupt greatly reduced number of
interrupts but re(4) consumed all available CPU cycles to run the
taskqueue under high TX/RX network load.  This can happen even with
RTL810x fast ethernet controller and I believe this is not
acceptable for most systems.

To mitigate the issue, use one-shot timer register to moderate RX
interrupts. The timer register provides programmable one-shot timer
and can be used to suppress interrupt generation. The timer runs at
125MHZ on PCIe controllers so the minimum time allowed for the
timer is 8ns. Data sheet says the register is 32 bits but
experimentation shows only lower 13 bits are valid so maximum time
that can be programmed is 65.528us. This yields theoretical maximum
number of RX interrupts that could be generated per second is about
15260. Combined with TX completion interrupts re(4) shall generate
less than 20k interrupts. This number is still slightly high
compared to other intelligent ethernet controllers but system is
very responsive even under high network load.

Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
of time to delay RX interrupt processing in units of us. Value 0
completely disables RX interrupt moderation. To provide old
behavior for controllers that have MSI/MSI-X capability, introduce
a new tunable hw.re.intr_filter. If the tunable is set to non-zero
value, driver will use interrupt taskqueue. The default value of
the tunable is 0. This tunable has no effect on controllers that
has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
by administrator.

While I'm here cleanup interrupt setup/teardown since re(4) uses
single MSI/MSI-X message at this moment.
2011-01-26 20:25:40 +00:00
Dmitry Chagin
a5c1afadeb Add macro to test the sv_flags of any process. Change some places to test
the flags instead of explicit comparing with address of known sysentvec
structures.

MFC after:	1 month
2011-01-26 20:03:58 +00:00
Michael Tuexen
507c72969d Make SCTP_MAX_BURST compliant with the latest version of
the socket API ID. This is not compatible with the API
in stable/8.
2011-01-26 19:55:54 +00:00
Michael Tuexen
90fed1d88e Change infrastructure for SCTP_MAX_BURST to allow compliance
with the latest socket API ID. Especially it can be disabled.

Full compliance needs changing the structure used in the
socket option. Since this breaks the API, it will be a
seperate commit which will not be MFCed to stable/8.

MFC after: 3 months.
2011-01-26 19:49:03 +00:00
Ulrich Spörlein
c3990b4b85 Unroll vgrind filter to no longer depend on vgrind(1) during buildworld.
The source files haven't been touched in ages and this is unlikely
to change in the future.
2011-01-26 19:39:31 +00:00
Ulrich Spörlein
200520dfce Fix typo in example getopt(1) script: $i vs $1 [1]
While here apply style hammer.

PR:		docs/154289 [1]
Submitted by:	Jamie Landeg Jones <jamie@bishopston.net>
MFC after:	1 week
2011-01-26 18:43:15 +00:00
Daniel Eischen
e691be70f9 Prison check addresses set with multicast interface options.
Reviewed by:	bz
MFC after:	1 week
2011-01-26 17:31:03 +00:00
Matthew D Fleming
f89f7ada8d Set td_kstack_pages for thread0. This was already being done for most
architectures, but i386 and amd64 were missing it.

Submitted by:	Mohd Fahadullah <mfahadullah AT isilon DOT com>
2011-01-26 17:06:13 +00:00
Alexander Motin
7f63cad89e Add missing part of r217877. 2011-01-26 13:10:07 +00:00
Adrian Chadd
f68a9f06e1 Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
overriding after calibration.

This will get set for other two chain radios, such as AR9280 and later on,
AR9287. It should however be a nul operation.
2011-01-26 10:48:29 +00:00
Adrian Chadd
b868c6d0b1 Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.
Obtained from:	Linux ath9k
2011-01-26 10:36:43 +00:00
Konstantin Belousov
0ea2e01412 Treat async buffer writes from the gjournal switcher thread the same as
from syncer. We shall not sleep on running buffer space when suspending.

Reproduced and tested by:	pho
PR:	kern/154228
MFC after:	1 week
2011-01-26 10:34:21 +00:00