Commit Graph

155743 Commits

Author SHA1 Message Date
Andrey V. Elsukov
d359a62d44 New netgraph node ng_patch(4). It performs data modification of packets
passing through. Modifications are restricted to a subset of C language
operations on unsigned integers of 8, 16, 32 or 64 bit size.
These are: set to new value (=), addition (+=), subtraction (-=),
multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
shift right (>>=). Several operations are all applied to a packet
sequentially in order they were specified by user.

Submitted by:	Maxim Ignatenko <gelraen.ua at gmail.com>
		Vadim Goncharov <vadimnuclight at tpu.ru>
Discussed with:	net@
Approved by:	mav (mentor)
MFC after:	1 month
2010-06-09 12:25:57 +00:00
Edwin Groothuis
0a76c6484c fix memset() calls.
Found with:   Coverity Prevent(tm)
CID:          8531
2010-06-09 10:36:25 +00:00
Ulrich Spörlein
aa64588d28 Remove -mdoc macros from -man page
Neither groff nor mandoc render these when in -man mode.
This was introduced in r38083 as a local change, therefore no commit to
the vendor branch.
2010-06-09 08:53:50 +00:00
Ulrich Spörlein
df26753b39 mdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts
It is referred to as "theta" later in the document anyway,
so stop being fancy.
2010-06-09 07:31:32 +00:00
Alexander Motin
c4219fc1b0 Add set of codec IDs.
PR:		kern/147466
2010-06-09 05:49:02 +00:00
Matt Jacob
63ebd216e7 Rearrange how things are done to avoid dereferencing stale pointers in
the case of immediate unconfigure after configure. Hold the periph an
extra count while we have the task to create sysctl context outstanding
so that the periph doesn't go away unexpectedly.

Sponsored by:	Panasas
Reviewed by:	scsi@
MFC after:	1 month
2010-06-08 22:46:44 +00:00
Matt Jacob
59ccfe8176 Try and narrow the gap in which you act on an event that has been canceled.
Obtained from:	Jaako Heinonen
MFC after:	1 month
2010-06-08 22:40:02 +00:00
Matt Jacob
8d7b838eee Add the VHBA package. It is here in tools because it's really a testbed.
Sponsored by:	Panasas
MFC after:	1 month
2010-06-08 22:26:47 +00:00
John Baldwin
374d9c4d18 The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().

Reported by:	mav
MFC after:	3 days
2010-06-08 21:27:05 +00:00
John Baldwin
b9cd2f771a Move the MD support for PCI message signalled interrupts to the x86 tree
as it is identical for i386 and amd64.
2010-06-08 18:36:03 +00:00
John Baldwin
2465e30f0c Move the machine check support code to the x86 tree since it is identical
on i386 and amd64.

Requested by:	alc
2010-06-08 18:04:07 +00:00
Konstantin Belousov
8d4a7be84d Reorganize the code in bdwrite() which handles move of dirtiness
from the buffer pages to buffer. Combine the code to set buffer
dirty range (previously in vfs_setdirty()) and to clean the pages
(vfs_clean_pages()) into new function vfs_clean_pages_dirty_buf(). Now
the vm object lock is acquired only once.

Drain the VPO_BUSY bit of the buffer pages before setting valid
and clean bits in vfs_clean_pages_dirty_buf() with new helper
vfs_drain_busy_pages(). pmap_clear_modify() asserts that page is not
busy.

In vfs_busy_pages(), move the wait for draining of VPO_BUSY before
the dirtyness handling, to follow the structure of
vfs_clean_pages_dirty_buf().

Reported and tested by:	pho
Suggested and reviewed by:	alc
MFC after:	2 weeks
2010-06-08 17:54:28 +00:00
John Baldwin
53a908cb07 Move the I/O APIC code to the x86 tree since it is identical on i386 and
amd64.
2010-06-08 17:51:21 +00:00
Matt Jacob
8c52d7f70c One byte off for scsi_target_group cdb.
MFC after:	2 weeks
2010-06-08 17:44:49 +00:00
Pyun YongHyeon
77982948d1 Remove unused macros.
Reviewed by:	bde
2010-06-08 17:28:28 +00:00
John Baldwin
bfc7a4fc48 - Use a bit more care when moving I/O APIC interrupts between CPUs. Mask
the interrupt followed by a brief delay if it is not currently masked
  before moving the interrupt.
- Move the icu_lock out of ioapic_program_intpin() and into callers.  This
  closes a race where ioapic_program_intpin() could use a stale value of
  the masked state to compute the masked bit in the register.

Reviewed by:	mav
MFC after:	2 weeks
2010-06-08 17:08:13 +00:00
Ulrich Spörlein
ef8a3e5cf2 mdoc: remove literal tabs where they don't belong 2010-06-08 16:48:59 +00:00
Ulrich Spörlein
c71e97c47e mdoc: replace troff macros with -mdoc equivalents 2010-06-08 16:48:49 +00:00
John Baldwin
8545538b6a Fix a sign bug that caused adaptive spinning in sx_xlock() to not work
properly.  Among other things it did not drop Giant while spinning
leading to livelocks.

Reviewed by:	rookie, kib, jmallett
MFC after:	3 days
2010-06-08 16:17:47 +00:00
Matt Jacob
82b361b11b Implement the usage of Report Luns as part of SCSI probing for SCP3 or
better devices. This can be disabled on a per-device basis using quirks as
well.

This also handles the case where there is actually no connected LUN 0
(which can definitely be the case for storage arrays).

Reviewed by:	scsi@
MFC after:	1 month
2010-06-08 16:17:25 +00:00
Alexander Motin
a47eae85b4 Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
unreliable under load. Linux does the same.
2010-06-08 10:03:08 +00:00
Matt Jacob
36af9f04a3 Make additional definitions up to and including SPC-4. Add in definitions
for REPORT and SET TARGET PORT GROUP commands (foundations for future work).

Regularize opcodes to be upper case hex.

Pick *one* of tab or space after #define (tab) and stick with that.

MFC after:	2 weeks
2010-06-08 05:14:18 +00:00
Randall Stewart
9b2e0767e2 2 Bugs:
1) Only use both mapping arrays when NR sack is off. This
   way we can hold off moving the cumack (not the best but
   workable) when NR-sack is on.

2) We must make sure to just return on the move of the
   bit to the NR array if the cum-ack as already went
   past the TSN. This prevents marking a bit behind the
   array and hitting the invariant code that panic's us.

MFC after:	1 week
2010-06-08 03:39:31 +00:00
Kenneth D. Merry
931eeffaa2 A number of netfront fixes and stability improvements:
- Re-enable TSO.  This was broken previously due to CSUM_TSO clearing the
   CSUM_TCP flag, so our checksum flags were incorrectly set going to the
   netback driver.  That was fixed in r206844 in tcp_output.c, so we can
   turn TSO back on here.

 - Fix the way transmit slots are calculated, so that we can't overfill
   the ring.

 - Avoid sending packets with more fragments/segments than netback can
   handle.  The Linux netback code can only handle packets of
   MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages.  We
   can easily generate packets with 32 or so fragments with TSO turned on.
   Right now the solution is just to drop the packets (since netback
   doesn't seem to handle it gracefully), but we should come up with a way
   to allow a driver to tell the TCP stack the maximum number of fragments
   it can handle in a single packet.

 - Fix the way the consumer is tracked in the receive path.  It could get
   out of sync fairly easily.

 - Use standard Xen ring macros to make it clearer how netfront is using
   the rings.

 - Get rid of Linux-ish negative errno return values.

 - Added more documentation to the driver.

 - Refactored code to make it easier to read.

 - Some other minor fixes.

Reviewed by:	gibbs

Reviewed by:	gibbs
Sponsored by:	Spectra Logic
MFC after:	7 days
2010-06-08 03:13:26 +00:00
Matt Jacob
c8381fba8c redfacedly noting a missing part of a patch.
Pointy Hat To:	Me
MFC after:	2 Week
X-MFC:		208896
2010-06-07 22:43:37 +00:00
Alexander Motin
e7d83347c0 Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
This allows bus to power-down device when driver unloaded on-flight.
2010-06-07 18:47:53 +00:00
Randall Stewart
66bd30bd4f This fixes a BUG in the handling of the cum-ack calculation.
We were only paying attention to the nr-mapping-array. Which
seems to make sense on the surface, by definition things
up to the cum-ack should be deliverable thus in the nr-mapping-array.
However (there is always a gotcha) thats not true when it
comes to large messages. The stack may hold the message
while re-assembling it not not deliver it based on several
thresholds. If that happens (which it would for smaller
large messages) then the cum-ack is figured wrong. We
now properly use both arrays in the cum-ack calculation.

MFC after:	1 week.
2010-06-07 18:29:10 +00:00
Matt Jacob
9d8284a1aa Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists
for a da unit and create a sysctl OID for it.
2010-06-07 17:41:34 +00:00
Matt Jacob
95f7dfb2fa Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
it will figure out the correct target to handle index and be able to find
things like WWPN, etc.

MFC after:	2 weeks
2010-06-07 17:39:36 +00:00
Randall Stewart
b9771f0404 Opps... my bad.. we don't need a SOCK_UNLOCK() after
calling socantrcvmore_locked() since it will unlock
the lock for you.

MFC after:	1 week
2010-06-07 11:33:20 +00:00
Xin LI
1371ad1594 Follow up revision 208888 with purely ident changes.
MFC after:	1 week
2010-06-07 10:10:44 +00:00
Xin LI
09e979e915 Correct a bug in gzip(1): make sure that initialize isb with fstat() on
input file before using it.

PR:		bin/147275
Submitted by:	thomas
MFC after:	1 week
2010-06-07 10:09:40 +00:00
Navdeep Parhar
3a2c6562f3 cxgb(4): add an 'nfilters' tunable that lets the user place an upper
limit on the number of hardware filters (and thus the amount of TCAM
reserved for filtering).
2010-06-07 08:23:16 +00:00
Andrey V. Elsukov
24609c49ca bgeom(3) does strdup of param name.
Don't leak memory when deleting param from gctl_req.

Reviewed by:	marcel
Approved by:	mav (mentor)
MFC after:	2 weeks
2010-06-07 07:41:41 +00:00
Martin Matuska
5995fb97d9 Document ZFS upgrade to version 14, support for NFSv4 ACLs,
changes in L2ARC and zfs send.

Approved by:	delphij (mentor)
2010-06-07 06:38:12 +00:00
Randall Stewart
9ed1e280f6 Fix so we call socantrcvmore_locked so we
don't see a race where we unlock to call
the non-locked version and have the socket
go away.

MFC after:	1 week
2010-06-07 04:01:38 +00:00
Jilles Tjoelker
f3d893fcde sh: Pass through SIGINT from a child if interactive and job control
is enabled.

This already worked if without job control.

In either case, this depends on it that a process that terminates due to
SIGINT exits on it (so not with status 1, or worse, 0).

Example:
  sleep 5; echo continued
This does not print "continued" any more if sleep is aborted via ctrl+c.

MFC after:	1 month
2010-06-06 22:27:32 +00:00
Randall Stewart
8ce4a9a255 1) Optimize the cleanup and don't always depend on
the timer. This is done by considering the locks
   we will destroy and if they are contended we consider
   it the same as a reference count being up. Fixing this
   appears to cleanup another crash that was appearing with
   all the timers where the socket buf lock got corrupted.

2) Fix the sysctl code to take a lot more care when looking
   at INP's that are in the GONE or ALLGONE state.

MFC after:	1 week
2010-06-06 20:34:17 +00:00
Randall Stewart
0c7dc84076 Ok, yet another bug in killing off all the hundreds
of apitesters.. Basically we end up with attempting
to destroy a lock thats contended on. A cookie echo
arrives at the same time that the close is happening.
The close gets the lock but the cookie echo has already
passed the check for the gone flag and is then locked
waiting on the create lock.. when we go to destroy it
bam. For now we do the timer destroy for all calls
to close.. We can probably optimize this later so that
we check whats being contended on and if there is contention
then do the timer thing. but this is probably safest since
the inp has been removed from all lists and references and
only the timer can find it.. once the locks are released all
other places will instantly see the GONE flag and bail (thats
what the change in sctp_input is one place that was lacking
the bail code).

MFC after:	1 week
2010-06-06 19:24:32 +00:00
Konstantin Belousov
4f24f88ebb Style-compilant order of declarations.
Noted by:	bde
MFC after:	1 month
2010-06-06 16:13:50 +00:00
Randall Stewart
faa1e3f4a9 1) Further enhance the INVARIANT lock validation (no locks) are
held by checking the create and inp locks as well.

2) Fix a bug in that when a socket is closed an INIT-ACK
   is returned, we do NOT unlock the locked_tcb unless its
   different (an unlikely scenario). If we blindly unlock as
   we were doing before we can end up unlocking the actual
   stcb thats about to be sent down to the free function which
   requires the lock be held.

MFC after:	1 week
2010-06-06 16:11:16 +00:00
Randall Stewart
7c82e9fa93 Fix a bug in the sctp_inpcb_free. Basically if the socket
was setup to do an abortive close an association that was
in the accept_queue could get stuck and never freed. Now
we properly start the kill timer on the socket and turn
off the flag (same thing we do for the graceful close method).
MFC after:	1 week
2010-06-06 16:09:12 +00:00
Randall Stewart
3d7001cdcb Fix a bug in sctp_abort_assoc(). DON'T call the sctp_inpcb_free
when the gone flag is set. You don't know what locks the
caller has set and there is already a kill timer running.

MFC after:	1 week
2010-06-06 16:07:40 +00:00
Robert Watson
698337f653 Rework tcpp output so that it generates a comma-delimited list of values,
optionally with a header if "-h" is passed.  Toast CPU time measurement
in the server for now.  Remove -C and -T, since we now always report
both connections/sec and Gb/sec.

MFC after:	1 week
Sponsored by:	Juniper Networks
2010-06-06 15:27:08 +00:00
Nathan Whitehorn
4fe8025d65 Add Open Firmware PNP info strings to GPIOs and Uninorth cells.
Submitted by:	Andreas Tobler
2010-06-06 14:29:06 +00:00
Nathan Whitehorn
351129c7bb Some revisions of the Serverworks K2 SATA controller have a data
corruption bug where if an ATA command is issued before DMA is started,
data will become available to the controller before it knows what to do
with it. This results in either data corruption or a controller crash.

This patch remedies the problem by adopting the workaround employed
by Linux and Darwin: starting the DMA engine prior to sending the ATA
command.

Observer on:	Xserve G5
Reviewed by:	mav
MFC after:	1 week
2010-06-06 14:09:48 +00:00
Gabor Kovesdan
85bf7ec797 - Fix signal handling in bc/dc. Now Ctrl-C terminates the execution.
Requested by:	gk (via private mail)
Approved by:	delphij (mentor)
2010-06-06 11:36:08 +00:00
Gabor Kovesdan
31dadaf609 - Fig segmentation fault
Submitted by:	Hizel Ildar <hizel@vyborg.ru> (via current@)
2010-06-06 11:32:38 +00:00
Alan Cox
c99b7cc5c9 Don't set PG_WRITEABLE in init_pte_prot() (and thus pmap_enter()) unless
the page is managed.

Don't set the machine-independent layer's dirty field for the page being
mapped in init_pte_prot().  (The dirty field is only supposed to set when
a mapping is removed or write-protected and the page was managed and
modified.)

Determine whether or not to perform dirty bit emulation based on whether
or not the page is managed, i.e., pageable, not based on whether the page
is being mapped into the kernel address space.  Nearly all of the kernel
address space consists of unmanaged pages, so this has neglible impact on
the overhead of dirty bit emulation for the kernel address space.  However,
there can also exist unmanaged pages in the user address space.  Previously,
dirty bit emulation was unnecessarily performed on these pages.

Tested by:	jchandra@
2010-06-06 06:07:44 +00:00
Randall Stewart
2c6b25b4cd Hopefully this fixes a LOR by making
so we only hold the iterator lock during
updates to the iterators work.

MFC after:	1 week
2010-06-06 02:33:46 +00:00