]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoRewrite the ARCH check another way for backward compatibility.
Jayachandran C. [Sat, 29 Jan 2011 10:32:00 +0000 (10:32 +0000)]
Rewrite the ARCH check another way for backward compatibility.

Compilation fails now, if TARGET_ARCH=mips instead of mipsel/mipseb.

13 years agoAdd a check for the AR9285E; I have no idea what this is.
Adrian Chadd [Sat, 29 Jan 2011 08:52:06 +0000 (08:52 +0000)]
Add a check for the AR9285E; I have no idea what this is.

The only other changes in ath9k for the AR9285E revolve around sleep modes
which are not fully implemented here yet.

13 years agoMy style(9) bug.
Dmitry Chagin [Sat, 29 Jan 2011 07:22:33 +0000 (07:22 +0000)]
My style(9) bug.

Pointed out by: kib

MFC after: 1 Month.

13 years agoBreak out the debug macros from if_ath.c into if_ath_debug.[ch] .
Adrian Chadd [Sat, 29 Jan 2011 05:08:21 +0000 (05:08 +0000)]
Break out the debug macros from if_ath.c into if_ath_debug.[ch] .

This is prep work for breaking out the TX path into a separate
set of source files.

13 years agoKeep this in sync with the ar5212 power rate table size.
Adrian Chadd [Sat, 29 Jan 2011 04:34:30 +0000 (04:34 +0000)]
Keep this in sync with the ar5212 power rate table size.
This doesn't yet know about the 802.11n radios or rates.

13 years agoFix bug in the netfront driver that caused excessive packet drops during
Justin T. Gibbs [Sat, 29 Jan 2011 02:36:45 +0000 (02:36 +0000)]
Fix bug in the netfront driver that caused excessive packet drops during
receive processing.

Remove unnecessary restrictions on the mbuf chain length built during an
LRO receive.  This restriction was copied from the Linux netfront driver
where the LRO implementation cannot handle more than 18 discontinuities.
The FreeBSD implementation has no such restriction.

MFC after: 1 week

13 years agoUse bus space functions rather than inw/outw
Andrew Turner [Sat, 29 Jan 2011 00:53:58 +0000 (00:53 +0000)]
Use bus space functions rather than inw/outw
to help a future port of the driver to ARM.

Approved by: imp (mentor)

13 years agoMove the load address of the kernel to the start of KVA as the
Andrew Turner [Sat, 29 Jan 2011 00:46:11 +0000 (00:46 +0000)]
Move the load address of the kernel to the start of KVA as the
s3c24x0 copy of initarm expects the kernel to be loaded there.

Approved by: imp (mentor)

13 years agoEliminate the use of symlook_needed function in favor of DAGS.
Alexander Kabaev [Fri, 28 Jan 2011 23:44:57 +0000 (23:44 +0000)]
Eliminate the use of symlook_needed function in favor of DAGS.

Place elements on DAG lists in breadth-first order. This allows us to
walk pre-built list in all cases where breadth-first dependency chain
enumeration is required.

Fix dlsym on special handle obtained by dlopen(NULL, ...) to do what
comment claims it does. Take advantage of recently added symlook_global
function to iterate over main objects and global DAGs lists properly in
search of a symbol. Since rtld itself provides part of the global
namespace, search rtld_obj too.

Remove recursion from init_dag and symlook_needed functions. Use
symlook_needed for ELF filtee processing only and change lookup order
used in the function to match the order used by Solaris runtime linker
under same circumstances. While there, fix weak symbol handling in the
loop so that we return the first weak symbol definition if no strong one
was found, instead of the last one.

Reviewed by: kib
MFC after:   1 month

13 years agoDon't use the MAC address in the device tree if it's all zeroes
Marcel Moolenaar [Fri, 28 Jan 2011 23:40:13 +0000 (23:40 +0000)]
Don't use the MAC address in the device tree if it's all zeroes
(i.e. 00-00-00-00-00-00). Use the currently programmed address
instead.

While here, simplify the function.

13 years agoDrop privileges in worker processes.
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:35:46 +0000 (22:35 +0000)]
Drop privileges in worker processes.

Accepting connections and handshaking in secondary is still done before
dropping privileges. It should be implemented by only accepting connections in
privileged main process and passing connection descriptors to the worker, but
is not implemented yet.

MFC after: 1 week

13 years agoImplement function that drops privileges by:
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:33:47 +0000 (22:33 +0000)]
Implement function that drops privileges by:
- chrooting to /var/empty (user hast home directory),
- setting groups to 'hast' (user hast primary group),
- setting real group id, effective group id and saved group id to 'hast',
- setting real user id, effective user id and saved user id to 'hast'.
At the end verify that those operations where successfull.

MFC after: 1 week

13 years agoChange hast user home directory to /var/empty.
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:29:38 +0000 (22:29 +0000)]
Change hast user home directory to /var/empty.

MFC after: 1 week

13 years agoAdd 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl)
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:28:12 +0000 (22:28 +0000)]
Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl)
to drop privileges.

MFC after: 1 week

13 years agoUse newly added descriptors_assert() function to ensure only expected
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:57:42 +0000 (21:57 +0000)]
Use newly added descriptors_assert() function to ensure only expected
descriptors are open.

MFC after: 1 week

13 years agoAdd function to assert that the only descriptors we have open are the ones
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:56:47 +0000 (21:56 +0000)]
Add function to assert that the only descriptors we have open are the ones
we expect to be open. Also assert that they point at expected type.

Because openlog(3) API is unable to tell us descriptor number it is using, we
have to close syslog socket, remember assert message in local buffer and if we
fail on assertion, reopen syslog socket and log the message.

MFC after: 1 week

13 years agoClose all unneeded descriptors after fork(2).
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:52:37 +0000 (21:52 +0000)]
Close all unneeded descriptors after fork(2).

MFC after: 1 week

13 years agoAdd comments to places where we treat errors as ciritical, but it is possible
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:51:40 +0000 (21:51 +0000)]
Add comments to places where we treat errors as ciritical, but it is possible
to handle them more gracefully.

MFC after: 1 week

13 years agoAdd function to close all unneeded descriptors after fork(2).
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:48:15 +0000 (21:48 +0000)]
Add function to close all unneeded descriptors after fork(2).

MFC after: 1 week

13 years agoInitialize all global variables on pjdlog_init().
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:36:01 +0000 (21:36 +0000)]
Initialize all global variables on pjdlog_init().

MFC after: 1 week

13 years agoKeep track of the real last RTT on each net.
Randall Stewart [Fri, 28 Jan 2011 21:05:21 +0000 (21:05 +0000)]
Keep track of the real last RTT on each net.
This will be used for Data Center congestion
control, we won't want to engage it in the
ECN code unless we KNOW that the RTT is less
than 500us.

MFC after: 1 week

13 years agoFix logic error. Due to the bug, it incorrectly checked TXQ status
Pyun YongHyeon [Fri, 28 Jan 2011 21:03:32 +0000 (21:03 +0000)]
Fix logic error. Due to the bug, it incorrectly checked TXQ status
which in turn can leave TXQ active.

Submitted by: Brad ( brad <> comstyle dot com )
MFC after: 3 days

13 years agoFix a bug in the way ECN-Echo chunk
Randall Stewart [Fri, 28 Jan 2011 20:49:15 +0000 (20:49 +0000)]
Fix a bug in the way ECN-Echo chunk
sends were being accounted for. The
counting was such that we counted only
when we queued a chunk, not when we sent it.
Now keep an additional counter for queuing and
one for sending.

MFC after: 1 week

13 years agoStyle(9) fixes.
Dmitry Chagin [Fri, 28 Jan 2011 19:04:15 +0000 (19:04 +0000)]
Style(9) fixes.

MFC after: 1 Month.

13 years agoImplement a variation of the linux_common_wait() which should
Dmitry Chagin [Fri, 28 Jan 2011 18:47:07 +0000 (18:47 +0000)]
Implement a variation of the linux_common_wait() which should
be used by linuxolator itself.

Move linux_wait4() to MD path as it requires native struct
rusage translation to struct l_rusage on linux32/amd64.

MFC after: 1 Month.

13 years agoTo avoid excessive code duplication move struct rusage translation
Dmitry Chagin [Fri, 28 Jan 2011 18:28:06 +0000 (18:28 +0000)]
To avoid excessive code duplication move struct rusage translation
to a separate function.

MFC after: 1 Month.

13 years agoIf more than one thread allocated sf buffers for sendfile(2), and
Konstantin Belousov [Fri, 28 Jan 2011 17:37:09 +0000 (17:37 +0000)]
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

13 years agoRemove SuperH architecture from a comment as we do not support it.
Sergey Kandaurov [Fri, 28 Jan 2011 17:30:24 +0000 (17:30 +0000)]
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

13 years agoDo not trip a KASSERT if /dev/null cannot be opened for a setuid program.
Jilles Tjoelker [Fri, 28 Jan 2011 15:29:35 +0000 (15:29 +0000)]
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

13 years agoDocument the "bios-boot" partition type.
Andrey V. Elsukov [Fri, 28 Jan 2011 11:56:14 +0000 (11:56 +0000)]
Document the "bios-boot" partition type.

MFC after: 2 weeks

13 years agoAdd new user-friendly aliases for partition types for the MBR and
Andrey V. Elsukov [Fri, 28 Jan 2011 11:13:01 +0000 (11:13 +0000)]
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

13 years ago(Mostly) teach ath_rate_sample about MCS rates.
Adrian Chadd [Fri, 28 Jan 2011 08:57:58 +0000 (08:57 +0000)]
(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@

13 years agoMake space for the extended 802.11n MCS rate tables.
Adrian Chadd [Fri, 28 Jan 2011 08:45:19 +0000 (08:45 +0000)]
Make space for the extended 802.11n MCS rate tables.

13 years agoBring in some 802.11n packet duration calculation functions from a mix of Sam/Rui...
Adrian Chadd [Fri, 28 Jan 2011 08:35:55 +0000 (08:35 +0000)]
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

13 years ago- Remove double semicolon.
Hans Petter Selasky [Fri, 28 Jan 2011 08:00:57 +0000 (08:00 +0000)]
- 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)

13 years agoCDDL fixes for MIPS n32.
Jayachandran C. [Fri, 28 Jan 2011 06:12:59 +0000 (06:12 +0000)]
CDDL fixes for MIPS n32.

Provide 64 bit atomic ops, and use 32 bit pointer.

13 years agoStyle(9) fix.
Dmitry Chagin [Fri, 28 Jan 2011 05:42:14 +0000 (05:42 +0000)]
Style(9) fix.

MFC after: 1 month.

13 years agosh: Add test for EXIT trap in command substitution.
Jilles Tjoelker [Thu, 27 Jan 2011 23:08:20 +0000 (23:08 +0000)]
sh: Add test for EXIT trap in command substitution.

This is not really realistic but is an opposition to $(trap).

13 years agolinux_sigreturn() loads the struct trapframe from l_sigcontext
Konstantin Belousov [Thu, 27 Jan 2011 21:45:38 +0000 (21:45 +0000)]
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

13 years agoixgb(4) does not support altq(4) yet.
Pyun YongHyeon [Thu, 27 Jan 2011 20:08:14 +0000 (20:08 +0000)]
ixgb(4) does not support altq(4) yet.

13 years agoBackout r216577. ixgb(4) does not support altq(4) yet.
Pyun YongHyeon [Thu, 27 Jan 2011 20:06:24 +0000 (20:06 +0000)]
Backout r216577. ixgb(4) does not support altq(4) yet.

13 years agoRemember created control connection so on fork(2) we can close it in child.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:33:57 +0000 (19:33 +0000)]
Remember created control connection so on fork(2) we can close it in child.

Found with: procstat(1)
MFC after: 1 week

13 years agoClose the control socket before exiting, so it will be unlinked.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:31:35 +0000 (19:31 +0000)]
Close the control socket before exiting, so it will be unlinked.

MFC after: 1 week

13 years agoExtend pjdlog_verify() to support the following additional macros:
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:28:29 +0000 (19:28 +0000)]
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

13 years agoAdd functions to initialize/finalize pjdlog. This allows to open/close log
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:24:07 +0000 (19:24 +0000)]
Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

MFC after: 1 week

13 years agoUse my copyright for 2011 work.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:18:42 +0000 (19:18 +0000)]
Use my copyright for 2011 work.

MFC after: 1 week

13 years agoAdd LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:15:25 +0000 (19:15 +0000)]
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

13 years ago- Remove obvious NOTREACHED comment after abort() call.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:12:44 +0000 (19:12 +0000)]
- Remove obvious NOTREACHED comment after abort() call.
- Remove redundant newline at the end of the file.

MFC after: 1 week

13 years agoRemove __dead2 from pjdlog_verify() prototype, it does return sometimes.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:10:24 +0000 (19:10 +0000)]
Remove __dead2 from pjdlog_verify() prototype, it does return sometimes.

MFC after: 1 week

13 years agoAdd support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
Konstantin Belousov [Thu, 27 Jan 2011 16:10:25 +0000 (16:10 +0000)]
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

13 years agoImplement sf_buf using direct map (XKPHYS) in MIPS n64.
Jayachandran C. [Thu, 27 Jan 2011 14:49:22 +0000 (14:49 +0000)]
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)

13 years agoFix n32 compile.
Jayachandran C. [Thu, 27 Jan 2011 14:16:12 +0000 (14:16 +0000)]
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)

13 years agoInitialise the chainmask from the EEPROM rather than the hard-coded defaults.
Adrian Chadd [Thu, 27 Jan 2011 09:26:37 +0000 (09:26 +0000)]
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.

13 years agoAdd missing getCapability call for AR5416.
Adrian Chadd [Thu, 27 Jan 2011 08:42:50 +0000 (08:42 +0000)]
Add missing getCapability call for AR5416.

13 years agoWhile inspecting the disklabel check that start offset of partition is
Andrey V. Elsukov [Thu, 27 Jan 2011 08:02:26 +0000 (08:02 +0000)]
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

13 years agoMake a note to re-check whether that particular check is needed.
Adrian Chadd [Thu, 27 Jan 2011 07:33:17 +0000 (07:33 +0000)]
Make a note to re-check whether that particular check is needed.

13 years agoQuick fix to a comment.
George V. Neville-Neil [Thu, 27 Jan 2011 03:32:16 +0000 (03:32 +0000)]
Quick fix to a comment.

13 years agoWriting to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
Adrian Chadd [Thu, 27 Jan 2011 02:56:03 +0000 (02:56 +0000)]
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

13 years agoExplicitly wire the user buffer rather than doing it implicitly in
Matthew D Fleming [Thu, 27 Jan 2011 00:34:12 +0000 (00:34 +0000)]
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

13 years agoRemove the CTLFLAG_NOLOCK as it seems to be both unused and
Matthew D Fleming [Wed, 26 Jan 2011 22:48:09 +0000 (22:48 +0000)]
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.

13 years agoDocument newly added tunables.
Pyun YongHyeon [Wed, 26 Jan 2011 21:59:59 +0000 (21:59 +0000)]
Document newly added tunables.
 hw.re.intr_filter
 hw.re.msix_disable
 dev.re.%d.int_rx_mod

13 years ago* Use 300 ms as the default for RTO_MIN.
Michael Tuexen [Wed, 26 Jan 2011 21:38:17 +0000 (21:38 +0000)]
* Use 300 ms as the default for RTO_MIN.
* Disable burst mitigation by default.
* Remove unused constant.
Discussed with rrs.
MFC after: 3 months.

13 years agoAdd support for RTL8105E PCIe Fast Ethernet controller. It seems
Pyun YongHyeon [Wed, 26 Jan 2011 21:14:20 +0000 (21:14 +0000)]
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.

13 years agoAdd Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
Pyun YongHyeon [Wed, 26 Jan 2011 21:07:44 +0000 (21:07 +0000)]
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.

13 years agoDo not use interrupt taskqueue on controllers with MSI/MSI-X
Pyun YongHyeon [Wed, 26 Jan 2011 20:25:40 +0000 (20:25 +0000)]
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.

13 years agoAdd macro to test the sv_flags of any process. Change some places to test
Dmitry Chagin [Wed, 26 Jan 2011 20:03:58 +0000 (20:03 +0000)]
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

13 years agoMake SCTP_MAX_BURST compliant with the latest version of
Michael Tuexen [Wed, 26 Jan 2011 19:55:54 +0000 (19:55 +0000)]
Make SCTP_MAX_BURST compliant with the latest version of
the socket API ID. This is not compatible with the API
in stable/8.

13 years agoChange infrastructure for SCTP_MAX_BURST to allow compliance
Michael Tuexen [Wed, 26 Jan 2011 19:49:03 +0000 (19:49 +0000)]
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.

13 years agoUnroll vgrind filter to no longer depend on vgrind(1) during buildworld.
Ulrich Spörlein [Wed, 26 Jan 2011 19:39:31 +0000 (19:39 +0000)]
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.

13 years agoFix typo in example getopt(1) script: $i vs $1 [1]
Ulrich Spörlein [Wed, 26 Jan 2011 18:43:15 +0000 (18:43 +0000)]
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

13 years agoPrison check addresses set with multicast interface options.
Daniel Eischen [Wed, 26 Jan 2011 17:31:03 +0000 (17:31 +0000)]
Prison check addresses set with multicast interface options.

Reviewed by: bz
MFC after: 1 week

13 years agoSet td_kstack_pages for thread0. This was already being done for most
Matthew D Fleming [Wed, 26 Jan 2011 17:06:13 +0000 (17:06 +0000)]
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>

13 years agoAdd missing part of r217877.
Alexander Motin [Wed, 26 Jan 2011 13:10:07 +0000 (13:10 +0000)]
Add missing part of r217877.

13 years agoAdd ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
Adrian Chadd [Wed, 26 Jan 2011 10:48:29 +0000 (10:48 +0000)]
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.

13 years agoAdd an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.
Adrian Chadd [Wed, 26 Jan 2011 10:36:43 +0000 (10:36 +0000)]
Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.

Obtained from: Linux ath9k

13 years agoTreat async buffer writes from the gjournal switcher thread the same as
Konstantin Belousov [Wed, 26 Jan 2011 10:34:21 +0000 (10:34 +0000)]
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

13 years agoBreak out the chainmask init code into a new function - ar5416InitChainMasks() .
Adrian Chadd [Wed, 26 Jan 2011 10:08:37 +0000 (10:08 +0000)]
Break out the chainmask init code into a new function - ar5416InitChainMasks() .

ath9k does a few different things here during config - if it's an early
AR5416 with two chains, it enables all three chains for calibration and
then restores the chainmask to the original values after initial
calibration has completed.

The reason behind this commit is to begin breaking out the chainmask
configuration for this specific reason; follow-up commits will add
the chainmask restore in the ar5416Reset() routine.

13 years ago* fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
Adrian Chadd [Wed, 26 Jan 2011 09:37:43 +0000 (09:37 +0000)]
* fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
  something else
* add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with
  at the moment.

13 years agoHardware supported by siis(4) allows software control over activity LEDs.
Alexander Motin [Wed, 26 Jan 2011 08:54:10 +0000 (08:54 +0000)]
Hardware supported by siis(4) allows software control over activity LEDs.
Expose that functionality to led(4) OR-ing it with regular LED activity.

13 years agoIn addition to r217444 ignore also ATA status errors on DMA Auto-Activation
Alexander Motin [Wed, 26 Jan 2011 06:57:48 +0000 (06:57 +0000)]
In addition to r217444 ignore also ATA status errors on DMA Auto-Activation
enabling request. Some HP disks reported to return ABORT error there while
declaring support for this feature.

13 years agoMake device initialization sequence shorter when possible. Do not enable/
Alexander Motin [Wed, 26 Jan 2011 06:37:51 +0000 (06:37 +0000)]
Make device initialization sequence shorter when possible. Do not enable/
disable already enabled/disabled SATA features.

13 years agoAdd -H flag to print thread id.
Dmitry Chagin [Wed, 26 Jan 2011 06:36:14 +0000 (06:36 +0000)]
Add -H flag to print thread id.

13 years agoFix another broken date
Doug Barton [Wed, 26 Jan 2011 06:07:24 +0000 (06:07 +0000)]
Fix another broken date

13 years agoClarify the availability of the noatime option on network file systems
Doug Barton [Wed, 26 Jan 2011 05:06:11 +0000 (05:06 +0000)]
Clarify the availability of the noatime option on network file systems

13 years agoFix my fix to nfe.4, and also fix re.4
Doug Barton [Wed, 26 Jan 2011 01:07:56 +0000 (01:07 +0000)]
Fix my fix to nfe.4, and also fix re.4

So just when I thought my pointy hat collection was going down ...

13 years agoFix date in .Dd
Doug Barton [Wed, 26 Jan 2011 01:02:39 +0000 (01:02 +0000)]
Fix date in .Dd

13 years agoRemove TX taskqueue and directly invoke re_start in interrupt task.
Pyun YongHyeon [Tue, 25 Jan 2011 23:27:28 +0000 (23:27 +0000)]
Remove TX taskqueue and directly invoke re_start in interrupt task.

13 years agoFix compilation with debug on.
Martin Cracauer [Tue, 25 Jan 2011 22:25:16 +0000 (22:25 +0000)]
Fix compilation with debug on.
Fix segfault when TargetAddress is missing or mis-spelled in config file.

13 years agoRemove dead code.
John Baldwin [Tue, 25 Jan 2011 22:21:05 +0000 (22:21 +0000)]
Remove dead code.

MFC after: 2 weeks

13 years agoPrefer MSI-X to MSI on controllers that support MSI-X. All
Pyun YongHyeon [Tue, 25 Jan 2011 22:18:00 +0000 (22:18 +0000)]
Prefer MSI-X to MSI on controllers that support MSI-X. All
recent PCIe controllers(RTL8102E or later and RTL8168/8111C or
later) supports either 2 or 4 MSI-X messages. Unfortunately vendor
did not publicly release RSS related information yet. However
switching to MSI-X is one-step forward to support RSS.

13 years agoWhen loading dso without PT_GNU_STACK phdr, only call
Konstantin Belousov [Tue, 25 Jan 2011 21:12:31 +0000 (21:12 +0000)]
When loading dso without PT_GNU_STACK phdr, only call
__pthread_map_stacks_exec() on architectures that allow executable
stacks.

Reported and tested by: marcel (ia64)

13 years agoEmit .note.GNU-stack for the syscall stubs generated by libc only on
Konstantin Belousov [Tue, 25 Jan 2011 21:06:49 +0000 (21:06 +0000)]
Emit .note.GNU-stack for the syscall stubs generated by libc only on
architectures that support this .note. In particular, do not unneccessary
emit the notes on ia64 and sparc64, which ABI require non-executable stacks.

Tested by: marcel

13 years agoFix get_program_var_addr() when type of the resolved symbol is functional.
Konstantin Belousov [Tue, 25 Jan 2011 21:04:55 +0000 (21:04 +0000)]
Fix get_program_var_addr() when type of the resolved symbol is functional.
Use make_function_pointer then, otherwise ia64 is broken.

Reported and tested by: marcel

13 years agosh: Clean up some old comments:
Jilles Tjoelker [Tue, 25 Jan 2011 20:56:18 +0000 (20:56 +0000)]
sh: Clean up some old comments:
* There is no plan for an alternative to the command "set".
* Attempting to unset a readonly variable has not raised an error for quite
  a while, so the order of unsetting a variable and a function with the same
  name does not matter.

MFC after: 1 week

13 years agoDo not allocate buffer to hold data for zero-sized sections.
Alexander Kabaev [Tue, 25 Jan 2011 19:17:50 +0000 (19:17 +0000)]
Do not allocate buffer to hold data for zero-sized sections.

13 years agoDisable TSO for all Realtek controllers. Experimentation showed
Pyun YongHyeon [Tue, 25 Jan 2011 19:05:46 +0000 (19:05 +0000)]
Disable TSO for all Realtek controllers. Experimentation showed
RTL8111C generated corrupted frames where TCP option header was
broken. All other sample controllers I have did not show such
problem so it could be RTL8111C specific issue. Because there are
too many variants it's hard to tell how many controllers have such
issue. Just disable TSO by default but have user override it.

13 years agoUse test(1) operators and test for the catpage not being older than the
Ulrich Spörlein [Tue, 25 Jan 2011 18:32:21 +0000 (18:32 +0000)]
Use test(1) operators and test for the catpage not being older than the
manpage.

Identical mtimes (as generated by buildworld for these files) precluded
catpages from working.

Approved by: gordon

13 years agoDocument sbuf_new_for_sysctl(9).
Matthew D Fleming [Tue, 25 Jan 2011 17:39:52 +0000 (17:39 +0000)]
Document sbuf_new_for_sysctl(9).

Pointed out by: lstewart

13 years agoWhen matching an incoming ARP against a bridge, ensure both interfaces belong
Andrew Thompson [Tue, 25 Jan 2011 17:15:23 +0000 (17:15 +0000)]
When matching an incoming ARP against a bridge, ensure both interfaces belong
to the same bridge.

Submitted by: Alexander Zagrebin

13 years agoRemove DOS-style EOLs
Sergey Matveychuk [Tue, 25 Jan 2011 15:06:50 +0000 (15:06 +0000)]
Remove DOS-style EOLs

Approved by: kib