Commit Graph

134966 Commits

Author SHA1 Message Date
netchild
4af9918bc0 Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components:

 * sample configuration file for sensorsd
 * rc(8) script and glue code for sensorsd(8)
 * sysctl(3) doc fixes for CTL_HW tree
 * sysctl(3) documentation for hardware sensors
 * sysctl(8) documentation for hardware sensors
 * support for the sensor structure for sysctl(8)
 * rc.conf(5) documentation for starting sensorsd(8)
 * sensor_attach(9) et al documentation
 * /sys/kern/kern_sensors.c
   o sensor_attach(9) API for drivers to register ksensors
   o sensor_task_register(9) API for the update task
   o sysctl(3) glue code
   o hw.sensors shadow tree for sysctl(8) internal magic
 * <sys/sensors.h>
 * HW_SENSORS definition for <sys/sysctl.h>
 * sensors display for systat(1), including documentation
 * sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and  -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by:	Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by:	Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by:	syrinx
Tested by:	many
OKed by:	kensmith
Obtained from:	OpenBSD (parts)
2007-10-14 10:45:31 +00:00
ache
57a6302920 Back out iswascii change from prev. commit, iswascii was right,
some overlook from me.
2007-10-14 10:23:54 +00:00
mav
bc7eda2e9a Split ng_pppoe_rcvdata() function into three hook-specific ones
to simplify code and reduce stack usage.
2007-10-14 09:58:22 +00:00
mav
b5f6701dea Remove ng_pppoe_sendpacket() function to simplify code as it is called
as much times as it has cases inside of it.
2007-10-14 09:51:19 +00:00
maxim
23403e167c o Fix a typo in ipfw table usage example.
PR:		docs/117172
Submitted by:	novel
MFC after:	1 week
2007-10-14 09:12:46 +00:00
maxim
7f8124e3c0 o Pablo Picasso's birthday is October 25 not October 5.
PR:		conf/116952
Submitted by:	Pablo Picasso <comet@transbay.net>
2007-10-14 08:52:29 +00:00
thompsa
0a03699452 Print the ZFS ereport to the console if vfs.zfs.debug is set to help diagnose
problems with zfs-on-root since devd isnt running yet.

Reviewed by:	pjd
2007-10-14 07:58:50 +00:00
mpp
493a307fe2 Document quotachecks use of the passno field. 2007-10-14 07:46:49 +00:00
ache
fc1cd65c82 Add comment stating that UCS-4 really used here, not UTF-8 2007-10-14 02:18:52 +00:00
csjp
3a572f38ad Fix id -A when the subject has an extended subject token associated with
them (for example when they have logged in from an ip6 source).

- Stick with the initial call to getaudit(2), if it returns E2BIG, use
  getaudit_addr(2) instead and set the "extended" flag to indicate that
  we the calling credential has an extended subject state.
- Additionally, add the printing of the machine/at_addr (the ip/ip6
  addresses)

MFC after:	1 week
Obtained from:	TrustedBSD Project
2007-10-14 00:52:30 +00:00
sam
3b49571934 revert 1.18: the negotiated rate set may not match the hal
rate tables, so using the hal's rateCodeToIndex array
will produce wrong indices for the negotiated rate set

MFC after:	3 days
2007-10-13 22:30:41 +00:00
ache
a5038f060d The problem is: currently our single byte ctype(3) functions are broken
for wide characters locales in the argument range >= 0x80 - they may
return false positives.

Example 1: for UTF-8 locale we currently have:
iswspace(0xA0)==1 and isspace(0xA0)==1
(because iswspace() and isspace() are the same code)
but must have
iswspace(0xA0)==1 and isspace(0xA0)==0
(because there is no such character and all others in the range
0x80..0xff for the UTF-8 locale, it keeps ASCII only in the single byte
range because our internal wchar_t representation for UTF-8 is UCS-4).

Example 2: for all wide character locales isalpha(arg) when arg > 0xFF may
return false positives (must be 0).
(because iswalpha() and isalpha() are the same code)

This change address this issue separating single byte and wide ctype
and also fix iswascii() (currently iswascii() is broken for
arguments > 0xFF).
This change is 100% binary compatible with old binaries.

Reviewied by: i18n@
2007-10-13 16:28:22 +00:00
deischen
5b067f00c5 Remove symbols that should not be exported.
Submitted by:	das
MFC after re@ approval
2007-10-13 14:40:16 +00:00
des
62062f6473 Rewrite puc_pci_match() to handle non-trivial cases correctly.
MFC after:	1 week
2007-10-13 12:14:20 +00:00
cognet
270e0a1e33 MFKernel: do not use __XSCALE__ to detect if clz/pld/ldrd/strd are
available, use _ARM_ARCH_5/_ARM_ARCH_5E instead.

MFC After:	3 days
2007-10-13 12:06:31 +00:00
cognet
746a165a98 Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead.
MFC After:	3 days
2007-10-13 12:05:36 +00:00
cognet
23ec7d7ba3 Do not use __XSCALE__ to detect if pld/strd/ldrd is available, use
_ARM_ARCH_5E instead.

MFC After:	3 days
2007-10-13 12:05:03 +00:00
cognet
66c3bb340b Define _ARM_ARCH_5E too, so that we know if pld/strd/ldrd are available.
MFC After:	3 days
2007-10-13 12:04:10 +00:00
des
73606ae492 I don't know what I was smoking when I wrote these three years ago; the
return value is an error code, hence always an int.

While I'm here, add getenv_uint() for completeness.
2007-10-13 11:30:19 +00:00
simon
15a00681b7 Minor mdoc cleanup: Every sentence should start on its own line. 2007-10-13 11:09:45 +00:00
jkoshy
8ade0fd468 Describe an error return that was missed out earlier. 2007-10-13 06:03:47 +00:00
ru
130dc0a6e8 Back out last commit -- it breaks sparc64 build which has
more than one .c file in SRCS.
2007-10-13 05:50:43 +00:00
iwasaki
f337cc48b9 Add NOP-message polling to ciss_periodic().
Disable adapter by detecting adapter is dead.

Tested by:	Masaki YATSU(on RELENG_6)
Reviewed by:	scottl
MFC after:	1 week
2007-10-13 05:45:45 +00:00
yongari
e6740735fe Fix a NULL pointer dereference in Tx checksum calculation.
Pointed out by: marius
2007-10-13 00:24:09 +00:00
scottl
be5e74a598 Add definitions for the 3rd ATA support word. 2007-10-12 22:18:56 +00:00
scottl
efeabb4e37 Add a bunch of definitions and structures to support newer drivers. 2007-10-12 22:11:22 +00:00
jhb
3126e49584 The ukbd driver has some questionable "magic" to for a default keyboard
which is ukbd0.  Specifically, the keyboard driver structures for ukbd0
are not allocated/freed but are statically allocated via a persistent
global variable.  There is some additional magic for the ukbd0 such that
if the keyboard is marked as probed in this global variable, then we
don't check to see if the device_t we are probing has an interface.

This causes a problem if an attach of ukbd0 fails without fulling clearing
the state in the global variable.  Specifically, if the keyboard fails to
initialize in init_keyboard() or kbd_register(), then the keyboard will
still be marked as probed.  The USB layer will then try to offer the
"generic" version of the USB keyboard device (as opposed to the
per-interface sub-devices) and the ukbd(4) driver will see that the
keyboard is marked probe and will skip the "is this a per-interface device"
check.  Later in ukbd_attach() it panics because it tries to dereference
the interface pointer which is NULL.

The fix is to clear the flags in the persistent keyboard data for ukbd0
when init_keyboard() or kbd_register() fail.

MFC after:	1 week
Reviewed by:	imp
2007-10-12 19:47:42 +00:00
mohans
77c0dc0000 NFS MP scaling changes.
- Eliminate the hideous nfs_sndlock that serialized NFS/TCP request senders
  thru the sndlock.
- Institute a new nfs_connectlock that serializes NFS/TCP reconnects. Add
  logic to wait for pending request senders to finish sending before
  reconnecting. Dial down the sb_timeo for NFS/TCP sockets to 1 sec.
- Break out the nfs xid manipulation under a new nfs xid lock, rather than
  over loading the nfs request lock for this purpose.
- Fix some of the locking in nfs_request.
Many thanks to Kris Kennaway for his help with this and for initiating the
MP scaling analysis and work. Kris also tested this patch thorougly.
Approved by: re@ (Ken Smith)
2007-10-12 19:12:21 +00:00
delphij
b3ebdff90d This commit was generated by cvs2svn to compensate for changes in r172597,
which included commits to RCS files with non-trunk default branches.
2007-10-12 19:03:03 +00:00
delphij
9680b7d49a Import less v409, fixes a rather serious bug which causes
crashes when searching for invalid UTF-8 sequence.
2007-10-12 19:03:03 +00:00
obrien
3c326e5bed Adjust HISTORY. 2007-10-12 18:16:35 +00:00
obrien
d4ac5dba18 style.Makefile(5) 2007-10-12 18:15:40 +00:00
obrien
c52e58f8fd Minor tweak to finding BEG/END source. 2007-10-12 18:14:41 +00:00
obrien
5847d42878 style.Makefile(5) 2007-10-12 18:03:00 +00:00
obrien
55bf4412df Welcome FreeBSD 8. 2007-10-12 17:49:12 +00:00
ps
957a55dee1 Do not attempt to make an NFS rpc call if using tftp
PR:		kern/91720
Submitted by:	Ruben Kerkhof
2007-10-12 17:09:43 +00:00
scottl
805629b231 Fix a mistake made in the MPSAFE commit that caused CAM to serialize requests
to the controller.
2007-10-12 17:03:41 +00:00
scottl
5cb4d15a40 For some blasted reason the SATA WC change frees a structure right in the
middle of using it.
2007-10-12 16:54:51 +00:00
scottl
2e24a542de Play better with CAM so that there aren't so many spurious warnings at boot. 2007-10-12 16:52:55 +00:00
scottl
98878fd53d Deferred interrupts don't work yet, disable them.
Submitted by: Manjunath Ranganathaiah
2007-10-12 16:51:22 +00:00
emax
42544287c5 Teach /etc/rc.d/ppp to start multiple instances of ppp.
ppp_profile variable can now contain multiple profiles.
Overrides for ppp mode and nat can go into ppp_$profile_mode
and ppp_$profile_nat variables respectively. If those are
not specified, defaults from ppp_mode and ppp_nat are used.

Submitted by:	Yuri Kurenkov < y dot kurenkov at init dot ru >
Reviewed by:	mtm
MFC after:	1 week
2007-10-12 16:35:36 +00:00
bmah
4f35ee7413 Bump version numbers to reflect that HEAD represents 8.0-CURRENT. 2007-10-12 15:35:56 +00:00
csjp
d250020a68 - Change the wakeup logic associated with having multiple sleepers
on multiple different audit pipes.  The old method used cv_signal()
  which would result in only one thread being woken up after we
  appended a record to it's queue.  This resulted in un-timely wake-ups
  when processing audit records real-time.

- Assign PSOCK priority to threads that have been sleeping on a read(2).
  This is the same priority threads are woken up with when they select(2)
  or poll(2).  This yields fairness between various forms of sleep on
  the audit pipes.

Obtained from:	TrustedBSD Project
Discussed with:	rwatson
MFC after:	1 week
2007-10-12 15:09:02 +00:00
csjp
e5337493b3 Make sure that we refresh the PID on read(2) and write(2) operations.
This fixes the process portion of the bpf(4) stats if the peer forks
into the background after it's opened the descriptor.  This bug
results in the following behavior for netstat -B:

# netstat -B
  Pid  Netif  Flags      Recv      Drop     Match Sblen Hblen Command
netstat: kern.proc.pid failed: No such process
78023    em0 p--s--   2237404     43119   2237404 13986     0 ??????

MFC after:	1 week
2007-10-12 14:58:34 +00:00
csjp
dd1d7df604 Add a signal handler for SIGINT to make sure that the PID file
gets cleaned up upon receiving SIGINT.  This un-breaks subsequent
executions of ipfwpcap and helps when debugging network/divert
issues like this:

ipfwpcap -r 6000 - | tcpdump -r -

MFC after:	1 week
2007-10-12 14:57:39 +00:00
csjp
11b9e24e5b Revision 1.12 of lockf.c fixed a "thundering herd" scenario when the
lock experienced contention a number of processes would race to acquire
lock when it was released.  This problem resulted in a lot of CPU
load as well as locks being picked up out of order.

Unfortunately, a regression snuck in which allowed multiple threads
to pickup the same lock when -k was not used.  This could occur when
multiple processes open a file descriptor to inode X (one process
will be blocked) and the file is unlinked on unlock (thereby removing
the directory entry allow another process to create a new directory
entry for the same file name and lock it).

This changes restores the old algorithm of: wait for the lock, then
acquire lock when we want to unlink the file on exit (specifically
when -k is not used) and keeps the new algorithm for when -k is used,
which yields fairness and improved performance.

Also, update the man page to inform users that if lockf(1) is being
used to facilitate concurrency between a number of processes, it
is recommended that -k be used to reduce CPU load and yeld
fairness with regard to lock ordering.

Collaborated with:	jdp
PR:		bin/114341
PR:		bin/116543
PR:		bin/111101
MFC after:	1 week
2007-10-12 14:56:52 +00:00
csjp
f0a91906f8 Add pts/pty to the un-hidden devices for logins. This un-breaks
logins to jailed environments when the system is using PTS style
ptys (kern.pts.enable=1).

Discussed with:	rwatson
MFc after:	1 week
2007-10-12 14:55:41 +00:00
kib
6a0967dff6 When pidfile is already locked and has zero length, do not return
success and zero pid from pidfile_read(). Return EAGAIN instead. Sleep
up to three times for 5 ms while waiting for pidfile to be written.

mount(8) does the kill(mountpid, SIGHUP). If mountd pidfile is truncated,
that would result in the SIGHUP delivered to the mount' process group
instead of the mountd.

Found and analyzed by:	Peter Holm
Tested by:	Peter Holm, kris
Reviewed by:	pjd
MFC after:	1 week
2007-10-12 10:38:05 +00:00
ru
85b2571640 Style (whitespace-only) change. 2007-10-12 10:35:24 +00:00
thompsa
48b5d78a41 Remove unneeded debug printf that is broken on 64bit arches. 2007-10-12 10:00:26 +00:00