Commit Graph

57128 Commits

Author SHA1 Message Date
Gleb Smirnoff
3b33fbe7d4 Add ktr(9) hooks to easier tracing of the netgraph item flow through
netgraph.
2006-01-11 15:29:48 +00:00
Colin Percival
9ed97bee65 Correct insecure temporary file usage in texindex. [06:01]
Correct insecure temporary file usage in ee. [06:02]
Correct a race condition when setting file permissions, sanitize file
names by default, and fix a buffer overflow when handling files
larger than 4GB in cpio. [06:03]
Fix an error in the handling of IP fragments in ipfw which can cause
a kernel panic. [06:04]

Security:	FreeBSD-SA-06:01.texindex
Security:	FreeBSD-SA-06:02.ee
Security:	FreeBSD-SA-06:03.cpio
Security:	FreeBSD-SA-06:04.ipfw
2006-01-11 08:02:16 +00:00
Ariff Abdullah
40c012dd6d - Locking fixes. Release lock while chn_intr().
- Mark MPSAFE since most of the locking procedures already implemented.
- Turn on inverted external amplifier sense flag for selected boards.

Tested by:	bland
MFC after:	1 week
2006-01-11 08:02:15 +00:00
Brooks Davis
118b438d73 Get rid of the bogus IFP2FC() macro and use IFP2FWC(). IFP2FC()
attempted to cast a struct ifnet to a struct fw_com which resulted in
data corruption.

PR:		kern/91307
Submitted by:	Alex Semenyaka <alex at semenyaka do ru>
MFC After:	6 days
2006-01-11 05:37:21 +00:00
Ian Dowse
d3ef345454 When deregistering a bus, attempt to flush out all outstanding
operations before returning. Point the bus at a dummy cam_sim
structure so that any CCBs will complete immediately with a
CAM_DEV_NOT_THERE status, and ensure that any xpt_schedule() calls
on the bus's devices will immediately call the peripheral's
periph_start() routine. Also repeat the async messages because
devices that were part of the way through being probed may appear
after the original AC_LOST_DEVICE was sent, and would otherwise
never go away.

These changes make it possible to deregister a bus and free the SIM
at most stages during bus probing without the usual crashes in
camisr(). In particular, plugging in a umass device and then
unplugging it as soon as the first probe messages appeared would
almost always result in a crash. Now the device just goes away with
a few CAM errors and all references to the CAM bus, target and
device are dropped correctly.
2006-01-11 02:06:08 +00:00
Scott Long
1c3a3b0bd0 The interlock in taskqueue_terminate() is completely wrong for taskqueues
that use spinlocks.  Remove it for now.
2006-01-11 00:37:13 +00:00
Scott Long
2ff7d1b635 Significant performance improvements for the if_em driver:
- Only update the rx ring consumer pointer after running through the rx loop,
  not with each iteration through the loop.
- If possible, use a fast interupt handler instead of an ithread handler.  Use
  the interrupt handler to check and squelch the interrupt, then schedule a
  taskqueue to do the actual work.  This has three benefits:
  - Eliminates the 'interrupt aliasing' problem found in many chipsets by
    allowing the driver to mask the interrupt in the NIC instead of the
    OS masking the interrupt in the APIC.
  - Allows the driver to control the amount of work done in the interrupt
    handler.  This results in what I call 'adaptive polling', where you get
    the latency benefits of a quick response to interrupts with the
    interrupt mitigation and work partitioning of polling.  Polling is still
    an option in the driver, but I consider it orthogonal to this work.
  - Don't hold the driver lock in the RX handler.  The handler and all data
    associated is effectively serialized already.  This eliminates the cost of
    dropping and reaquiring the lock for every receieved packet.  The result
    is much lower contention for the driver lock, resulting in lower CPU usage
    and lower latency for interactive workloads.

The amount of work done in the taskqueue is controlled by the sysctl
dev.em.N.rx_processing_limit

and tunable
hw.em.rx_process_limit

Setting these to -1 effectively removes the limit.

The fast interrupt and taskqueue can be disabled by defining NO_EM_FASTINTR.
This work has been shown to increase fast-forwarding from ~570 kpps to
~750 kpps (note that the same NIC hardware seems unable to transmit more than
800 kpps, so this increase appears to be limited almost solely by the
hardware).  Gains have been shown in other workloads, ranging from better
performance to elimination of over-saturation livelocks.

Thanks to Andre Opperman for his time and resources from his network
performance project in performing much of the testing.  Thanks to Gleb
Smirnoff and Danny Braniss for their help in testing also.
2006-01-11 00:30:25 +00:00
Scott Long
2ffb18fec1 Don't use the ALLOCNOW flag for tags that will only be used for static
allocations.
2006-01-10 22:55:35 +00:00
Jim Rees
85bfb1d55c add nfsclient/, nfs4client/, and rpc/ directories to the
top Makefile's rule to build a cscope database.

Submitted by:	cel@citi.umich.edu
Approved by:	alfred
2006-01-10 20:58:27 +00:00
Poul-Henning Kamp
d3e64681d6 Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)
to COMPAT_43TTY.

Add COMPAT_43TTY to NOTES and */conf/GENERIC

Compile tty_compat.c only under the new option.

Spit out
	#warning "Old BSD tty API used, please upgrade."
if ioctl_compat.h gets #included from userland.
2006-01-10 09:19:10 +00:00
Ariff Abdullah
c02b454deb More thorough fixes to enable inverted external amplifier sense flag.
Instead of dragging the entire ICH4/82801DB into this mess, select
only few boards based on pci subdevice / subvendor.

Tested by:	Daisuke Orikasa <luxury-acura-3.5rl at nifty.com>
MFC after:	3 days
2006-01-10 06:52:59 +00:00
Scott Long
9df1a6dd61 Add functions and macros and refactor code to make it easier to manage
fast taskqueues.  The following have been added:

TASKQUEUE_FAST_DEFINE() - create a global task queue.
    an arbitrary execution context.
TASKQUEUE_FAST_DEFINE_THREAD() - create a global taskqueue that uses a
    dedicated kthread.
taskqueue_create_fast() - create a local/private taskqueue.

These are all complimentary of the standard taskqueue functions.  They are
primarily useful for fast interrupt handlers that can only use spinlock for
synchronization.

I personally think that the taskqueue API is starting to get too narrow and
hairy, but fixing it will require a major redesign on the API.  Such a
redesign would be good but would break compatibility with FreeBSD 6.x, so
it really isn't desirable at this time.

Submitted by: sam
2006-01-10 06:31:12 +00:00
Warner Losh
9b9c5e1cb1 Remove code describing pre 5.x system 2006-01-10 05:21:01 +00:00
Scott Long
174cda8010 Don't free the ap object if it was never created.
Submitted by: jkim
2006-01-10 01:55:17 +00:00
Takanori Watanabe
9f793d762d Hook ufoma module to build.
Pointed out by:thompsa
2006-01-10 00:54:18 +00:00
Tor Egge
82be0a5a24 Add marker vnodes to ensure that all vnodes associated with the mount point are
iterated over when using MNT_VNODE_FOREACH.

Reviewed by:	truckman
2006-01-09 20:42:19 +00:00
Tor Egge
6c62b2acd0 If the lock passed to getdirtybuf() is the softdep lock then the background
write completed wakeup could be missed.  Close the race by grabbing the lock
normally used for protection of bp->b_xflags.

Reviewed by:	truckman
2006-01-09 19:32:21 +00:00
Tor Egge
c8c7711d66 Broaden scope of softdep_worklist_busy rwlock protection of softdep processing
to avoid some dependencies being missed by softdep_flushworklist().

Reviewed by:	truckman
2006-01-09 19:16:56 +00:00
Tor Egge
012cbd3181 Obtain mount point lock before restarting sync loop if vget() failed.
Reviewed by:	truckman
2006-01-09 18:57:35 +00:00
Maxim Konovalov
036cd12a8d o Fix typo in the define: s/MRAK_INT_GEN/MARK_INT_GEN/. The typo
was harmless because the define is not used in coda_vfsops.c.

Submitted by:	Hugo Meiland
2006-01-09 18:07:06 +00:00
Takanori Watanabe
3db831b3d2 Add ufoma drivers in 'files', too. 2006-01-09 17:49:21 +00:00
Takanori Watanabe
a0fe548a14 Add FOMA (NTT DoCoMo 3G mobile phone system) driver.
This is based on MCPC USB mobile phone guide line (MCPC-GL005)
Some other 3G system or so will work with this driver.
Kyocera PHS terminal (a.k.a. Kyopon) is known to work, which
is now supported by umodem(4) driver.
2006-01-09 17:46:36 +00:00
Sam Leffler
7b0c77eca9 Update monitoring support:
o record tsf in tx+rx frames
o switch from raw rssi to dbm for signal data and record both
  signal and noise floor data (hacked for now to assume a fixed
  noise floor; is correct with new hal)
o add monpass sysctl to control which rx'd frames are passed
  up with errors; especially useful to see frames with CRC errors
o mark 'd packets w/ a CRC error with radiotap's BADFCS flag

Also add placeholder code for calibrating the noise floor when
using newer hals.

Reviewed by:	avatar
MFC after:	1 week
2006-01-09 17:13:20 +00:00
Sam Leffler
2204bcfd7c add flag to tag frames w/ a known bad FCS
Obtained from:	netbsd
MFC after:	1 week
2006-01-09 17:04:56 +00:00
Ariff Abdullah
be0fee94a7 Turn on inverted external amplifier sense flags for ICH4/82801DB.
PR:		kern/66422, kern/75687, kern/84471
MFC after:	2 days
2006-01-09 11:20:37 +00:00
SUZUKI Shinsuke
02ff33e2d0 added a note about the assumption for m->m_pkthdr.rcvif
Obtained from: KAME
MFC After: 1 day
2006-01-09 09:08:43 +00:00
Warner Losh
d5e61c97a6 By popular demand, move __HAVE_ACPI and __PCI_REROUTE_INTERRUPT into
param.h.  Per request, I've placed these just after the
_NO_NAMESPACE_POLLUTION ifndef.  I've not renamed anything yet, but
may since we don't need the __.

Submitted by: bde, jhb, scottl, many others.
2006-01-09 06:05:57 +00:00
Ariff Abdullah
7659fda352 Fix obvious capabilities (rate) violation. Should be 5500, not 4000.
MFC after:	1 day
2006-01-09 06:05:25 +00:00
Florent Thoumie
465ad22910 Enable NO_GETMAXLUN quirk.
PR:		usb/90670
Submitted by:	Wojciech A. Koszek <dunstan@freebsd.czest.pl>
Approved by:	iedowse
MFC after:	1 week
2006-01-09 01:33:53 +00:00
Ian Dowse
9a014e6f69 There should be no need to retry when the CCB status code is
CAM_LUN_INVALID or CAM_TID_INVALID. Retries were being triggered
here when a umass device was unplugged, and while the retries
themselves are probably harmless, they complicated finding the real
SIM removal problems.
2006-01-08 20:04:55 +00:00
Alexander Leidinger
b85f5cf149 Add support for Canon CanoScan D660U.
PR:		87395
Submitted by:	Eirik Mikkelsen <eirik@bsdbox.org>
2006-01-08 14:17:04 +00:00
Doug Barton
dfdae5534f Add a mechanism to include files added by ports which contain
the names of directories to include in the base ldconfig script.
This will eliminate the need for each port to install its own
boot script which does nothing but ldocnfig a given directory.

This code was developed by flz (ports committer), discussed on
freebsd-rc@, and modified slightly by me.

Submitted by:	flz
Reviewed by:	brooks
2006-01-08 10:15:31 +00:00
Ian Dowse
662f5fb6d9 Remove the UQ_NO_OPEN_CLEARSTALL quirk, as this is now the default
behaviour for all devices.
2006-01-08 03:34:29 +00:00
Ian Dowse
dd35c3642c Don't perform an endpoint stall clear every time a pipe is opened.
This should not be necessary, and it is known to confuse certain
devices.

Obtained from:	NetBSD
Requested by:	many
2006-01-08 03:27:43 +00:00
Florent Thoumie
d908e8fa84 Add Product ID for Acerscan 1240u and the corresponding entry in uscanner.c.
PR:		usb/91466
Submitted by:	Cameron Lerch <cam@zarya.org>
MFC after:	3 days
Approved by:	ssouhlal
2006-01-08 01:43:00 +00:00
Scott Long
861a23087b If destroying a spinlock, make sure that it is exited properly.
Submitted by: jhb
MFC After: 3 days
2006-01-08 00:18:34 +00:00
Warner Losh
1851bd711a While reviewing if_sn in an attempt to understand network drivers
better, I discovered sn doing too many pointer dereferences.  This
driver would do silly things like:
	sn_foo(struct ifnet *ifp)
	{
		struct sn_softc *sc = ifp->if_softc;

		sc->ifp->mumble
		/* Other stuff */
	}

while /* other stuff */ usually needed sc, the extra deref isn't
needed.  Eliminate a few dozen of them.
2006-01-07 19:29:25 +00:00
John Baldwin
3b783acd2a Revert an untested local change that crept in with the lo_class changes
and subsequently broke the build.  This change is supposed to fix the
case where doing a mtx_destroy() off a spin mutex while you hold it fails.
If it had been tested I would just leave it in, but it hasn't been tested
yet, so it will have to wait until later.
2006-01-07 14:03:15 +00:00
Ariff Abdullah
e1e05d5d12 Add codec id support for Analog Device AD1986 AC'97 codec.
Submitted by:	UMENO Takashi <umeno at rr.iij4u.or.jp>
PR:		kern/80234
MFC after:	2 days
2006-01-07 05:20:46 +00:00
David Xu
0a5cd498bb Add a new feature to thr_kill, if thread ID argument is -1, send
signals to all threads except current sender.
2006-01-07 03:15:21 +00:00
Tai-hwa Liang
75d6a87fa3 Trying to fix compilation bustage introduced in rev1.160 by converting
a missing lo_class to LO_CLASSINDEX().
2006-01-07 02:07:08 +00:00
Peter Grehan
162138c989 Set the siginfo si_addr field, and also the mysterious 3rd parameter
to old-style signals, to be the DAR register for DSI miss exceptions.
This gives the address of the access rather than the instruction
address. The behaviour is now the same as on i386.

Found by:  libsigsegv tests
2006-01-07 01:55:12 +00:00
Marcel Moolenaar
6d85ea7820 Fix FD_ISSET() on LP64 platforms. The FD_ISSET() function/macro is
defined to return an int, but on LP64 platforms the return value of
FD_ISSET() for file descriptors with a bit-index larger than 31 would
not fit an int (due to __fd_mask being defined as an unsigned long).
The fix is to explicitly test against 0.

PR: ia64/91421
Submitted by: Tanaka Akira (akr at m17n dot org)
MFC after: 1 week
2006-01-06 22:12:46 +00:00
John Baldwin
1d1767e89a - Update copyright years from the Specialix SDK.
- Update comment as this firmware is not used for the SX cards, they use
  the si3_t225 firmware instead.
2006-01-06 20:17:48 +00:00
John Baldwin
5a0793f174 Update the firmware image used for the SIJET cards to the latest available
in the SDK from Specialix/Perle.  The prior version was
JET.BIN Version 3.0.6 Beta I and the new version is JET__.BIN Version 4.0.1.

MFC after:	1 week
2006-01-06 19:58:08 +00:00
John Baldwin
8fa19acad6 - Fix cards with multiple modules. Prior to this, the ports on the various
modules would have overlapping names.
- Only create /dev/si_control for unit 0.

Tested by:	Joerg Lehners Joerg dot Lehners at informatik dot
		uni-oldenburg dot de (on 6.x)
MFC after:	1 week
2006-01-06 19:56:12 +00:00
John Baldwin
04dda605c5 - Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all the
various pcib drivers to use their own private devclass_t variables for
  their modules.
- Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib
  drivers while I'm here.
2006-01-06 19:22:19 +00:00
John Baldwin
3c6decc327 Trim another pointer from struct lock_object (and thus from struct mtx and
struct sx).  Instead of storing a direct pointer to a our lock_class
struct in lock_object, reserve 4 bits in the lo_flags field to serve as an
index into a global lock_classes array that contains pointers to the lock
classes.  Only debugging code such as WITNESS or INVARIANTS checks and KTR
logging need to access the lock_class member, so this shouldn't add any
overhead to production kernels.  It might add some slight overhead to
kernels using those debug options however.

As with the previous set of changes to lock_object, this is going to
completely obliterate the kernel ABI, so be sure to recompile all your
modules.
2006-01-06 18:07:32 +00:00
John Baldwin
ca49f12fdb Reduce the scope of one #ifdef to avoid duplicating a SYSCTL_INT() macro
and trim another unneeded #ifdef (it was just around a macro that is
already conditionally defined).
2006-01-06 18:03:45 +00:00
Lukas Ertl
d5817a5009 Get rid of the gv_bioq hack in most parts of the I/O path and
use the standard bioq structures.
2006-01-06 18:03:17 +00:00