]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoCorrect description of minfree to kilobytes rather than blocks.
wblock [Mon, 13 Aug 2012 15:16:25 +0000 (15:16 +0000)]
Correct description of minfree to kilobytes rather than blocks.

PR: 125921
Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
MFC after: 3 days

11 years agoRestore the old behaviour. If requested partition is a BSD slice,
ae [Mon, 13 Aug 2012 13:33:21 +0000 (13:33 +0000)]
Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its
first partition.

11 years agoRemove colons from the debug message, device name returned by the
ae [Mon, 13 Aug 2012 13:10:50 +0000 (13:10 +0000)]
Remove colons from the debug message, device name returned by the
disk_fmtdev() already has the colons.

11 years agoUnbreak booting from the true dedicated disks.
ae [Mon, 13 Aug 2012 13:08:30 +0000 (13:08 +0000)]
Unbreak booting from the true dedicated disks.
When we open the disk, check the type of partition table, that has
been detected. If this is BSD label, then we assume this is DD mode.

Reported by: dim@

11 years agoBuild modules along with the XENHVM kernels.
cperciva [Mon, 13 Aug 2012 07:36:57 +0000 (07:36 +0000)]
Build modules along with the XENHVM kernels.

No objections from: freebsd-xen mailing list
MFC after: 1 week

11 years agoRemove extraneous newline.
mjacob [Sun, 12 Aug 2012 20:49:25 +0000 (20:49 +0000)]
Remove extraneous newline.

MFC after: 1 month

11 years agoFix an oops where we wiped out DMA maps. Don't allocate extended
mjacob [Sun, 12 Aug 2012 20:45:47 +0000 (20:45 +0000)]
Fix an oops where we wiped out DMA maps. Don't allocate extended
command space for anything less than a 2300.

MFC after: 1 month
X-MFC: 238869

11 years ago- Fix source dataset snapshot name in Example 15.
gjb [Sun, 12 Aug 2012 20:30:15 +0000 (20:30 +0000)]
- Fix source dataset snapshot name in Example 15.
- Bump date.

MFC after: 3 days
X-MFC-With: r239216

11 years agoRemove a leading space that breaks rendering.
gjb [Sun, 12 Aug 2012 20:23:59 +0000 (20:23 +0000)]
Remove a leading space that breaks rendering.

MFC after: 3 days

11 years agoCompile fix.
hselasky [Sun, 12 Aug 2012 19:58:56 +0000 (19:58 +0000)]
Compile fix.

MFC after: 2 weeks

11 years agoAdd support for the so-called streams feature of BULK endpoints
hselasky [Sun, 12 Aug 2012 17:53:06 +0000 (17:53 +0000)]
Add support for the so-called streams feature of BULK endpoints
in SUPER-speed mode, USB 3.0.

This feature has not been tested yet, due to lack of hardware.

This feature is useful when implementing protocols like UASP,
USB attached SCSI which promises higher USB mass storage throughput.

This patch also implements support for hardware processing of endpoints
for increased performance. The switching to hardware processing
of an endpoint is done via a callback to the USB controller driver. The
stream feature is implemented like a variant of a hardware USB protocol.

USB controller drivers implementing device mode needs to be updated to
implement the new "xfer_stall" USB controller method and remove the
"xfer" argument from the "set_stall" method.

The API's toward existing USB drivers are preserved. To setup a USB transfer
in stream mode, set the "stream_id" field of the USB config structure to
the desired value.

The maximum number of BULK streams is currently hardcoded and limited to 8
via a define in usb_freebsd.h.

All USB drivers should be re-compiled after this change.

LibUSB will be updated next week to support streams mode. A new IOCTL to
setup BULK streams as already been implemented. The ugen device nodes
currently only supports stream ID zero.

The FreeBSD version has been bumped.

MFC after: 2 weeks

11 years ago1. Remove SEN support. I doubt there are any working examples
mjacob [Sun, 12 Aug 2012 17:01:07 +0000 (17:01 +0000)]
1. Remove SEN support. I doubt there are any working examples
of this hardware still running (close to twenty years now).

2. Quiesece and use ENC_VLOG instead of ENC_LOG for most
complaints. That is, they're visible with bootverbose, but
otherwise quiesced and not repeatedly spamming messages
with constant reminders that hardware in this space is
rarely fully compliant.

MFC after: 1 month

11 years agoAdd missing VERIFY_10 definition.
mjacob [Sun, 12 Aug 2012 16:58:38 +0000 (16:58 +0000)]
Add missing VERIFY_10 definition.

MFC after: 1 month

11 years agoAdd another debug message.
ae [Sun, 12 Aug 2012 14:32:30 +0000 (14:32 +0000)]
Add another debug message.

11 years agoAdd more debug messages.
ae [Sun, 12 Aug 2012 14:16:21 +0000 (14:16 +0000)]
Add more debug messages.

11 years agoDo defered mutex wakeup once.
davidxu [Sun, 12 Aug 2012 00:56:56 +0000 (00:56 +0000)]
Do defered mutex wakeup once.

11 years agoRevert the ath_tx_draintxq() method, and instead teach it the minimum
adrian [Sun, 12 Aug 2012 00:46:15 +0000 (00:46 +0000)]
Revert the ath_tx_draintxq() method, and instead teach it the minimum
necessary to "do" EDMA.

It was just using the TX completion status for logging information about
the descriptor completion.  Since with EDMA we don't know this without
checking the TX completion FIFO, we can't provide this information.
So don't.

11 years agoBreak out ath_draintxq() into a method and un-methodize ath_tx_processq().
adrian [Sun, 12 Aug 2012 00:37:29 +0000 (00:37 +0000)]
Break out ath_draintxq() into a method and un-methodize ath_tx_processq().

Now that I understand what's going on with this, I've realised that
it's going to be quite difficult to implement a processq method in
the EDMA case.  Because there's a separate TX status FIFO, I can't
just run processq() on each EDMA TXQ to see what's finished.
i have to actually run the TX status queue and handle individual
TXQs.

So:

* unmethodize ath_tx_processq();
* leave ath_tx_draintxq() as a method, as it only uses the completion status
  for debugging rather than actively completing the frames (ie, all frames
  here are failed);
* Methodize ath_draintxq().

The EDMA ath_draintxq() will have to take care of running the TX
completion FIFO before (potentially) freeing frames in the queue.

The only two places where ath_tx_draintxq() (on a single TXQ) are used:

* ath_draintxq(); and
* the CABQ handling in the beacon setup code - it drains the CABQ before
  populating the CABQ with frames for a new beacon (when doing multi-VAP
  operation.)

So it's quite possible that once I methodize the CABQ and beacon handling,
I can just drop ath_tx_draintxq() in its entirety.

Finally, it's also quite possible that I can remove ath_tx_draintxq()
in the future and just "teach" it to not check the status when doing
EDMA.

11 years agoSome style fixes inspired by @bde.
davidxu [Sat, 11 Aug 2012 23:48:39 +0000 (23:48 +0000)]
Some style fixes inspired by @bde.

11 years agoExtend the beacon code slightly to support AP mode beaconing for the
adrian [Sat, 11 Aug 2012 23:26:19 +0000 (23:26 +0000)]
Extend the beacon code slightly to support AP mode beaconing for the
EDMA HAL hardware.

* The EDMA HAL code assumes the nexttbtt and intval values are in TU/8
  units, rather than TU.  For now, just "hack" around that here, at least
  until I code up something to translate it in the HAL.
* Setup some different TXQ flags for EDMA hardware.
* The EDMA HAL doesn't support setting the first rate series via
  ath_hal_setuptxdesc() - instead, a call to ath_hal_set11nratescenario()
  is always required.  So for now, just do an 11n rate series setup
  for EDMA beacon frames.

This allows my AR9380 to successfully transmit beacon frames.

However, CABQ TX and all normal data frame TX and TX completion is
still not functional and will require some more significant code churn
to make work.

11 years agoMFp4:
davidxu [Sat, 11 Aug 2012 23:17:02 +0000 (23:17 +0000)]
MFp4:
Further decreases unexpected context switches by defering mutex wakeup
until internal sleep queue lock is released.

11 years agoAdd the AR9380 HAL to the TX descriptor debugging, in order to dump all
adrian [Sat, 11 Aug 2012 22:39:27 +0000 (22:39 +0000)]
Add the AR9380 HAL to the TX descriptor debugging, in order to dump all
of the descriptor contents.

11 years agoAdd the AR9300 HAL ID in to the 11n check routine.
adrian [Sat, 11 Aug 2012 22:25:28 +0000 (22:25 +0000)]
Add the AR9300 HAL ID in to the 11n check routine.

I was having TX hang issues, which I root caused to having the
legacy ath_hal_setupxtxdesc() called, rather than the 11n rate scenario
setup code.  This meant that rate control information wasn't being
put into frames, causing the MAC to stall/hang.

11 years agoBegin fleshing out the TX FIFO support.
adrian [Sat, 11 Aug 2012 22:20:28 +0000 (22:20 +0000)]
Begin fleshing out the TX FIFO support.

* Add ATH_TXQ_FIRST() for easy tasting of what's on the list;
* Add an "axq_fifo_depth" for easy tracking of how deep the current
  FIFO is;
* Flesh out the handoff (mcast, hw) functions;
* Begin fleshing out a TX ISR proc, which tastes the TX status FIFO.

The legacy hardware stuffs the TX completion at the end of the final frame
descriptor (or final sub-frame when doing aggregate.)  So it's feasible
to do a per-TXQ drain and process, as the needed info is right there.

For EDMA hardware, there's a separate TX completion FIFO.  So the TX
process routine needs to read the single FIFO and then process the
frames in each hardware queue.

This makes it difficult to do a per-queue process, as you'll end up with
frames in the TX completion FIFO for a different TXQ to the one you've
passed to ath_tx_draintxq() or ath_tx_processq().

Testing:

I've tested the TX queue and TX completion code in hostap mode on an
AR9380.  Beacon frames successfully transmit and the completion routine
is called.  Occasional data frames end up in TXQ 1 and are also
successfully completed.

However, this requires some changes to the beacon code path as:

* The AR9380 beacon configuration API is now in TU/8, rather than
  TU;
* The AR9380 TX API requires the rate control is setup using a call
  to setup11nratescenario, rather than having the try0 series setup
  (rate/tries for the first series); so the beacon won't go out.

I'll follow this up with commits to the beacon code.

11 years agoSome more minor tunings inspired by bde@.
mav [Sat, 11 Aug 2012 20:24:39 +0000 (20:24 +0000)]
Some more minor tunings inspired by bde@.

11 years agoAdd __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(),
dim [Sat, 11 Aug 2012 15:47:22 +0000 (15:47 +0000)]
Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(),
since some older versions of gcc refuse to inline these otherwise.

Requested by: bde
MFC after: 1 week

11 years agoAllow idle threads to steal second threads from other cores on systems with
mav [Sat, 11 Aug 2012 15:08:19 +0000 (15:08 +0000)]
Allow idle threads to steal second threads from other cores on systems with
8 or more cores to improve utilization.  None of my tests on 2xXeon (2x6x2)
system shown any slowdown from mentioned "excess thrashing".  Same time in
pbzip2 test with number of threads more then number of CPUs I see up to 10%
speedup with SMT disabled and up 5% with SMT enabled.  Thinking about
trashing I was trying to limit that stealing within same last level cache,
but got only worse results.  Present code any way prefers to steal threads
from topologically closer cores.

Sponsored by: iXsystems, Inc.

11 years agoRename aux.c to auxv.c.
ed [Sat, 11 Aug 2012 12:07:24 +0000 (12:07 +0000)]
Rename aux.c to auxv.c.

On Windows, AUX is the auxiliary device, usually pointing to COM1.
Therefore it is forbidden to create a file named aux.c. To make it a bit
easier for Windows users to check out our source code, rename this file
to auxv.c.

MFC after: 1 month
Discussed with: kib
Suggested by: Eric van Gyzen <eric vangyzen net>

11 years agoChange a few extern inline functions in libm to static inline, since
dim [Sat, 11 Aug 2012 11:13:48 +0000 (11:13 +0000)]
Change a few extern inline functions in libm to static inline, since
they need to refer to static constants, which C99 does not allow for
extern inline functions.

While here, change a comment in e_rem_pio2f.c to mention the correct
number of bits.

Reviewed by: bde
MFC after: 1 week

11 years agoMove the decoding of the swi instruction to the syscall function. With the
andrew [Sat, 11 Aug 2012 05:58:56 +0000 (05:58 +0000)]
Move the decoding of the swi instruction to the syscall function. With the
ARM EABI the syscall value will be moved to a register to ease adding thumb
support. When this happens decoding of the instruction will no longer be
required.

11 years agoCorrect the PLLA setting functions and centralize.
imp [Sat, 11 Aug 2012 05:45:19 +0000 (05:45 +0000)]
Correct the PLLA setting functions and centralize.

11 years agoUpdate comments about setting PLLA and refernce the tables in the
imp [Sat, 11 Aug 2012 05:12:46 +0000 (05:12 +0000)]
Update comments about setting PLLA and refernce the tables in the
datasheet that express the limits.

11 years agoDon't use C++ comments.
imp [Sat, 11 Aug 2012 05:03:30 +0000 (05:03 +0000)]
Don't use C++ comments.

11 years agotvtohz will print out an error message if a negative value is given
davidxu [Sat, 11 Aug 2012 00:06:56 +0000 (00:06 +0000)]
tvtohz will print out an error message if a negative value is given
to it, avoid this problem by detecting timeout earlier.

Reported by: pho

11 years agoSome minor tunings/cleanups inspired by bde@ after previous commits:
mav [Fri, 10 Aug 2012 19:02:49 +0000 (19:02 +0000)]
Some minor tunings/cleanups inspired by bde@ after previous commits:
 - remove extra dynamic variable initializations;
 - restore (4BSD) and implement (ULE) hogticks variable setting;
 - make sched_rr_interval() more tolerant to options;
 - restore (4BSD) and implement (ULE) kern.sched.quantum sysctl, a more
user-friendly wrapper for sched_slice;
 - tune some sysctl descriptions;
 - make some style fixes.

11 years agoAlways initialize sc_ekey, because as of r238116 it is always used.
pjd [Fri, 10 Aug 2012 18:43:29 +0000 (18:43 +0000)]
Always initialize sc_ekey, because as of r238116 it is always used.

If GELI provider was created on FreeBSD HEAD r238116 or later (but before this
change), it is using very weak keys and the data is not protected.
The bug was introduced on 4th July 2012.

One can verify if its provider was created with weak keys by running:

# geli dump <provider> | grep version

If the version is 7 and the system didn't include this fix when provider was
initialized, then the data has to be backed up, underlying provider overwritten
with random data, system upgraded and provider recreated.

Reported by: Fabian Keil <fk@fabiankeil.de>
Tested by: Fabian Keil <fk@fabiankeil.de>
Discussed with: so
MFC after: 3 days

11 years agosched_rr_interval() seems always returned period in hz ticks, but same
mav [Fri, 10 Aug 2012 18:19:57 +0000 (18:19 +0000)]
sched_rr_interval() seems always returned period in hz ticks, but same
always it was used as rate.  Fix use side units to period in hz ticks.

11 years agoStyle.
hselasky [Fri, 10 Aug 2012 17:43:20 +0000 (17:43 +0000)]
Style.

MFC after: 2 weeks

11 years agoRemove unused structure field.
hselasky [Fri, 10 Aug 2012 17:42:14 +0000 (17:42 +0000)]
Remove unused structure field.

MFC after: 2 weeks

11 years agoTake advantage of new UCOM and bus functionality so that
hselasky [Fri, 10 Aug 2012 15:29:41 +0000 (15:29 +0000)]
Take advantage of new UCOM and bus functionality so that
the device_detach() function doesn't block on UCOM device
drivers until the TTY handle is closed by the userspace
application. This is implemented by a postpone of the
softc free where the UCOM structures reside until the
TTY references are gone.

Discussed with: kib, ed
MFC after: 2 weeks

11 years agoSwitch unit management in UCOM to unrhdr.
hselasky [Fri, 10 Aug 2012 15:21:12 +0000 (15:21 +0000)]
Switch unit management in UCOM to unrhdr.

Extend the callback table of UCOM to include a
"ucom_free" function pointer which is called when
all refs on a UCOM super structure is gone.

Implement various helper functions to handle
refcounting and draining on the UCOM super
structure.

Implement macro which can be used in device
drivers to avoid module unload before all
pending TTY references are gone.

The UCOM API is backwards compatible after this
change and device drivers require no changes
to function with this change. Only a recompilation
of UCOM device drivers is required. The FreeBSD
version has been bumped in that regard.

Discussed with: kib, ed
MFC after: 2 weeks

11 years agoAdd new device method to free the automatically
hselasky [Fri, 10 Aug 2012 15:02:49 +0000 (15:02 +0000)]
Add new device method to free the automatically
allocated softc structure which is returned by
device_get_softc(). This method can be used to
easily implement softc refcounting. This can be
desirable when the softc has memory references
which are controlled by userspace handles for
example.

This solves the problem of blocking the caller
of device_detach() for a non-deterministic time.

Discussed with: kib, ed
MFC after: 2 weeks

11 years agoStyle.
hselasky [Fri, 10 Aug 2012 14:51:41 +0000 (14:51 +0000)]
Style.

MFC after: 2 weeks

11 years agoFix spelling.
hselasky [Fri, 10 Aug 2012 14:44:04 +0000 (14:44 +0000)]
Fix spelling.

MFC after: 2 weeks

11 years agoAdd missing FAILED event to g_raid_subdisk_event2str() to print it properly
mav [Fri, 10 Aug 2012 13:36:33 +0000 (13:36 +0000)]
Add missing FAILED event to g_raid_subdisk_event2str() to print it properly
in debug messages.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

11 years agoEliminate an unnecessary acquisition and release of the page queues lock
alc [Fri, 10 Aug 2012 05:47:04 +0000 (05:47 +0000)]
Eliminate an unnecessary acquisition and release of the page queues lock
from pmap_pte().  PT_SET_MA() is not a queued mapping update, but instead
an immediate mapping update, so the page queues lock is not required here.

Reviewed by: cperciva

11 years agoMerge r134393 from amd64/i386:
alc [Fri, 10 Aug 2012 05:00:50 +0000 (05:00 +0000)]
Merge r134393 from amd64/i386:
  The machine-independent parts of the virtual memory system always pass a
  valid pmap to the pmap functions that require one.  Remove the checks for
  NULL.  (These checks have their origins in the Mach pmap.c that was
  integrated into BSD.  None of the new code written specifically for
  FreeBSD included them.)

11 years agoRFC 2289 requires all hashes be stored in little endian format before
delphij [Fri, 10 Aug 2012 04:48:58 +0000 (04:48 +0000)]
RFC 2289 requires all hashes be stored in little endian format before
folding to 64 bits, while SHA1 code is big endian.  Therefore, a bswap32
is required before using the value.

Without this change, the implementation does not conform to test vector
found in RFC 2289.

PR: bin/170519
Submitted by: Arthur Mesh <arthurmesh gmail com> (with changes)
MFC after: 1 week

11 years agoMore comments about setting PLLA, or rather that we never do.
imp [Fri, 10 Aug 2012 04:48:06 +0000 (04:48 +0000)]
More comments about setting PLLA, or rather that we never do.

11 years agoAdd charge pump current register.
imp [Fri, 10 Aug 2012 04:47:20 +0000 (04:47 +0000)]
Add charge pump current register.

11 years agoAdd a missing HAL_DMA_ADDR definition.
adrian [Thu, 9 Aug 2012 23:08:22 +0000 (23:08 +0000)]
Add a missing HAL_DMA_ADDR definition.

11 years agoAdd HAL_DMA_ADDR.
adrian [Thu, 9 Aug 2012 23:04:20 +0000 (23:04 +0000)]
Add HAL_DMA_ADDR.

11 years agonftw(): POSIX says directories causing loops should be silently skipped.
jilles [Thu, 9 Aug 2012 22:05:40 +0000 (22:05 +0000)]
nftw(): POSIX says directories causing loops should be silently skipped.

Formerly, loops caused nftw() to abort the traversal with ELOOP.

11 years agoRework r220198 change (by fabient). I believe it solves the problem from
mav [Thu, 9 Aug 2012 19:26:13 +0000 (19:26 +0000)]
Rework r220198 change (by fabient). I believe it solves the problem from
the wrong direction. Before it, if preemption and end of time slice happen
same time, thread was put to the head of the queue as for only preemption.
It could cause single thread to run for indefinitely long time. r220198
handles it by not clearing TDF_NEEDRESCHED in case of preemption. But that
causes delayed context switch every time preemption happens, even when not
needed.

Solve problem by introducing scheduler-specifoc thread flag TDF_SLICEEND,
set when thread's time slice is over and it should be put to the tail of
queue. Using SW_PREEMPT flag for that purpose as it was before just not
enough informative to work correctly.

On my tests this by 2-3 times reduces run time deviation (improves fairness)
in cases when several threads share one CPU.

Reviewed by: fabient
MFC after: 2 months
Sponsored by: iXsystems, Inc.

11 years agoRefresh with OpenBSD RCS ID changes to reflect that we now have essentionally
delphij [Thu, 9 Aug 2012 19:22:54 +0000 (19:22 +0000)]
Refresh with OpenBSD RCS ID changes to reflect that we now have essentionally
the same file.

11 years agoSCHED_4BSD scheduling quantum mechanism appears to be broken for some time.
mav [Thu, 9 Aug 2012 18:09:59 +0000 (18:09 +0000)]
SCHED_4BSD scheduling quantum mechanism appears to be broken for some time.
With switchticks variable being reset each time thread preempted (that is
done regularly by interrupt threads) scheduling quantum may never expire.
It was not noticed in time because several other factors still regularly
trigger context switches.

Handle the problem by replacing that mechanism with its equivalent from
SCHED_ULE called time slice. It is effectively the same, just measured in
context of stathz instead of hz. Some unification is probably not bad.

11 years agoMerge r132141 and r111272 from amd64/i386:
alc [Thu, 9 Aug 2012 16:38:17 +0000 (16:38 +0000)]
Merge r132141 and r111272 from amd64/i386:
  Reduce the size of a PV entry by eliminating pv_ptem.  There is no need
  to store a pointer to the page table page in the PV entry because it is
  easily computed during the walk down the page table.

  Eliminate the ptphint from the pmap.  Long, long ago, page table pages
  belonged to a vm object, and we would look up page table pages based
  upon their offset within this vm object.  In those days, this hint may
  have had tangible benefits.

Tested by: jchandra

11 years agoftw(): Do not check the maxfds argument against OPEN_MAX.
jilles [Thu, 9 Aug 2012 15:11:38 +0000 (15:11 +0000)]
ftw(): Do not check the maxfds argument against OPEN_MAX.

Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed
to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX
does not require us to check this. POSIX does have a requirement on the
application that maxfds not exceed {OPEN_MAX}, but does not require the
implementation to check it ("may fail").

PR: 95239

11 years agonftw(): Do not check the maxfds argument against OPEN_MAX.
jilles [Thu, 9 Aug 2012 15:04:06 +0000 (15:04 +0000)]
nftw(): Do not check the maxfds argument against OPEN_MAX.

Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed
to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX
does not require us to check this.

PR: 95239
Submitted by: Todd Miller

11 years agoImprove lock and unlock symmetry
emaste [Thu, 9 Aug 2012 14:46:52 +0000 (14:46 +0000)]
Improve lock and unlock symmetry

- Move destruction of per-ring locks to netmap_dtor_locked to mirror the
initialization that happens in NIOCREGIF.  Otherwise unloading a netmap-
capable interface that was never put into netmap mode would try to
mtx_destroy an uninitialized mutex, and panic.

- Destroy core_lock in netmap_detach, mirroring init in netmap_attach.

- Also comment out the knlist_destroy for now as there is currently no
knlist_init.

Sponsored by:   ADARA Networks
Reviewed by:    luigi@

11 years agoBe more descriptive about poll error / timeout when transmitting.
emaste [Wed, 8 Aug 2012 19:15:01 +0000 (19:15 +0000)]
Be more descriptive about poll error / timeout when transmitting.

11 years agoMore rototilling with target mode in an attemp to get multiple
mjacob [Wed, 8 Aug 2012 18:24:33 +0000 (18:24 +0000)]
More rototilling with target mode in an attemp to get multiple
CCB at a time outstanding reliable. It's not there yet, but this
is the direction to go in so might as well commit. So far,
multiple at a time CCBs work (see ISP_INTERNAL_TARGET test mode),
but it fails if there are more downstream than the SIM wants
to handle and SRR is sort of confused when this happens, plus
it is not entirely quite clear what one does if a CCB/CTIO fails
and you have more in flight (that don't fail, say) and more queued
up at the SIM level that haven't been started yet.

Some of this is driven because there apparently is no flow control
to requeue XPT_CONTINUE_IO requests like there are for XPT_SCSI_IO
requests. It is also more driven in that the few target mode
periph drivers there are are not really set up for handling pushback-
heck most of them don't even check for errors (and what would they
really do with them anyway? It's the initiator's problem, really....).

The data transfer arithmetic has been worked over again to handle
multiple outstanding commands, so you have a notion of what's been
moved already as well as what's currently in flight. It turns that
this led to uncovering a REPORT_LUNS bug in the ISP_INTERNAL_TARGET
code which was sending back 24 bytes of rpl data instead of the
specified 16. What happened furthermore here is that sending back
16 bytes and reporting an overrun of 8 bytes made the initiator
(running FC-Tape aware f/w) mad enough to request, and keep
requesting, another FCP response (I guess it didn't like the answer
so kept asking for it again).

Sponsored by: Spectralogic
MFC after: 1 month

11 years agoFix an incorrect comment.
adrian [Wed, 8 Aug 2012 17:16:06 +0000 (17:16 +0000)]
Fix an incorrect comment.

11 years agoFix whitespace (missing newline)
emaste [Wed, 8 Aug 2012 15:28:29 +0000 (15:28 +0000)]
Fix whitespace (missing newline)

11 years agoClarify comments about number of tx / rx rings
emaste [Wed, 8 Aug 2012 15:27:01 +0000 (15:27 +0000)]
Clarify comments about number of tx / rx rings

11 years agoRound displayed pps (instead of truncating)
emaste [Wed, 8 Aug 2012 13:54:26 +0000 (13:54 +0000)]
Round displayed pps (instead of truncating)

11 years agoImport compiler-rt r160957.
andrew [Wed, 8 Aug 2012 09:42:44 +0000 (09:42 +0000)]
Import compiler-rt r160957.

This is mostly a no-op other than for ARM where it adds missing
__aeabi_mem* and __aeabi_*divmod functions. Even on ARM these will remain
unused until the rest of the ARM EABI code is merged.

11 years agoThe assertion that I added in r238889 could legitimately fail when a
alc [Wed, 8 Aug 2012 05:28:30 +0000 (05:28 +0000)]
The assertion that I added in r238889 could legitimately fail when a
debugger creates a breakpoint.  Replace that assertion with a narrower
one that still achieves my objective.

Reported and tested by: kib

11 years agoAlways initialize pl_event.
kib [Wed, 8 Aug 2012 00:20:30 +0000 (00:20 +0000)]
Always initialize pl_event.

Submitted by: Andrey Zonov <andrey@zonov.org>
MFC after: 3 days

11 years agoCommit device IDs for the (eventually upcoming) AR9380 HAL.
adrian [Tue, 7 Aug 2012 23:45:43 +0000 (23:45 +0000)]
Commit device IDs for the (eventually upcoming) AR9380 HAL.

Obtained from: Qualcomm Atheros, Linux ath9k

11 years agoDuring TSC synchronization test, use rdtsc() rather than rdtsc32(), to
jimharris [Tue, 7 Aug 2012 23:16:11 +0000 (23:16 +0000)]
During TSC synchronization test, use rdtsc() rather than rdtsc32(), to
protect against 32-bit TSC overflow while the sync test is running.

On dual-socket Xeon E5-2600 (SNB) systems with up to 32 threads, there
is non-trivial chance (2-3%) that TSC synchronization test fails due to
32-bit TSC overflow while the synchronization test is running.

Sponsored by: Intel
Reviewed by: jkim
Discussed with: jkim, kib

11 years agoClone BIO_ORDERED flag, for disk drivers (namely CAM) that try to
jimharris [Tue, 7 Aug 2012 20:16:10 +0000 (20:16 +0000)]
Clone BIO_ORDERED flag, for disk drivers (namely CAM) that try to
 consume it.

Sponsored by: Intel
Discussed with: gibbs, scottl

11 years agoIn g_gate_dumpconf() always check the result of g_gate_hold().
trociny [Tue, 7 Aug 2012 18:50:33 +0000 (18:50 +0000)]
In g_gate_dumpconf() always check the result of g_gate_hold().

This fixes "Negative sc_ref" panic possible when sysctl_kern_geom_confxml()
is run simultaneously with destroying GATE device.

Reviewed by: pjd
MFC after: 3 days

11 years agoMinor style(9) improvement
emaste [Tue, 7 Aug 2012 13:11:47 +0000 (13:11 +0000)]
Minor style(9) improvement

11 years agoDon't try to stop the IPMI watchdog timer if it is not running.
jhb [Tue, 7 Aug 2012 12:40:31 +0000 (12:40 +0000)]
Don't try to stop the IPMI watchdog timer if it is not running.
Starting or stopping the IPMI watchdog is rather expensive with the
current implementation as all IPMI requests are bounced via thread.
This is not viable during shutdown or dumps, and this avoids headache
in the common case that the watchdog is not enabled.  The IPMI watchdog
should probably be reworked to not use a separate thread to fix this
in the case when the watchdog timer is enabled.

MFC after: 2 weeks

11 years agoAs it turned out, there are some installations, where BSD label
ae [Tue, 7 Aug 2012 09:22:46 +0000 (09:22 +0000)]
As it turned out, there are some installations, where BSD label
contains partitions with type zero. And it has worked.
So, allow detect these partitions.

Reported by: glebius

11 years agoFix obvious problem with emulate_fp sysctl.
imp [Tue, 7 Aug 2012 08:37:35 +0000 (08:37 +0000)]
Fix obvious problem with emulate_fp sysctl.

Submitted by: Paul Ambrose <ambrosehua@gmail.com>

11 years agoDo not apply errata 721 workaround when under hypervisor, since
kib [Tue, 7 Aug 2012 08:36:10 +0000 (08:36 +0000)]
Do not apply errata 721 workaround when under hypervisor, since
typical hypervisor does not implement access to the required MSR,
causing #GP on boot.

Reported and tested by: olgeni
PR: amd64/170388
MFC after: 3 days

11 years agos/lenght/length/ in comments
luigi [Tue, 7 Aug 2012 07:52:25 +0000 (07:52 +0000)]
s/lenght/length/ in comments

11 years agoRemove duplicate header inclusion of <sys/sysent.h>
pluknet [Tue, 7 Aug 2012 05:46:36 +0000 (05:46 +0000)]
Remove duplicate header inclusion of <sys/sysent.h>

Discussed with: bz

11 years agoNever sleep on busy pages in vm_pageout_launder(), always skip them. Long
alc [Tue, 7 Aug 2012 04:48:14 +0000 (04:48 +0000)]
Never sleep on busy pages in vm_pageout_launder(), always skip them.  Long
ago, sleeping on busy pages in vm_pageout_launder() made sense.  The call
to vm_pageout_flush() specified asynchronous I/O and sleeping on busy pages
blocked vm_pageout_launder() until the flush had completed.  However, in
CVS revision 1.35 of vm/vm_contig.c, the call to vm_pageout_flush() was
changed to request synchronous I/O, but the sleep on busy pages was not
removed.

11 years agoCorrect re-initialise the link pointer to be the final descriptor in
adrian [Tue, 7 Aug 2012 00:42:46 +0000 (00:42 +0000)]
Correct re-initialise the link pointer to be the final descriptor in
the last buffer.

This fixes traffic stalls that were occuring with stuck beacon events.

PR: kern/170433

11 years agoRemove unnecessary debugging printf()s.
adrian [Mon, 6 Aug 2012 22:54:10 +0000 (22:54 +0000)]
Remove unnecessary debugging printf()s.

11 years agoRemove a spurious bace which cause build fail in case BCE_DEBUG option
davide [Mon, 6 Aug 2012 22:53:24 +0000 (22:53 +0000)]
Remove a spurious bace which cause build fail in case BCE_DEBUG option
is turned on.

Reviewed by: delphij
Approved by: gnn (mentor)
Sponsored by: Google Summer of Code 2012
MFC after: 1 week

11 years agoMake the polling interface in igb able to handle
jfv [Mon, 6 Aug 2012 22:43:49 +0000 (22:43 +0000)]
Make the polling interface in igb able to handle
multiqueue, and correct the rxdone handling. Update
the polling man page to include igb as well.

Thanks to Mark Johnston for these changes.

11 years agoMFP4 change 214967:
brooks [Mon, 6 Aug 2012 21:24:43 +0000 (21:24 +0000)]
MFP4 change 214967:
Make the process of embedding MDROOT images less perilous by
makeing the target that links kernel and embedding the image
depend on the image.  This means, if the image doesn't exist you
find out before you try to boot from it and that if you change
the image you don't have to touch some random source file to
cause a rebuild.

Don't hide that we're embedding the image.

11 years agoMake sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not
dim [Mon, 6 Aug 2012 21:02:40 +0000 (21:02 +0000)]
Make sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not
return.  This silences a warning from clang 3.2 about uninitialized use
of the variable 'mediasize' in sbin/ggate/shared/ggate.c.

Reviewed by: pjd
MFC after: 1 week

11 years agoCorrect the mq_start routine to avoid out-of-order
jfv [Mon, 6 Aug 2012 20:44:05 +0000 (20:44 +0000)]
Correct the mq_start routine to avoid out-of-order
packet delivery, always enqueue when possible. Also
correct the DEPLETED test as multiple bits might be
set.  Thanks to Randall Stewart for the changes!

11 years agoIn sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the
dim [Mon, 6 Aug 2012 20:01:32 +0000 (20:01 +0000)]
In sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the
'path' variable to NULL, to avoid using it uninitialized in certain
cases.

Found by: clang
MFC after: 1 week

11 years agoExplicitly enable busmastering on PCI-PCI bridges. Transactions initiated
jhb [Mon, 6 Aug 2012 19:49:57 +0000 (19:49 +0000)]
Explicitly enable busmastering on PCI-PCI bridges.  Transactions initiated
on the secondary side of a bridge will not be propagated to the primary
bus unless this is enabled.  Busmastering is not enabled by default (we
have relied on firmware to set this bit to date).  The OS needs to set it
for any bridges not configured by system firmware.

Tested by: Steve Polyack  korvus comcast net
MFC after: 2 weeks

11 years agoIn sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
dim [Mon, 6 Aug 2012 18:54:17 +0000 (18:54 +0000)]
In sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
'fw_hdr_intfver' into an anonymous enum, which avoids a clang 3.2
warning about all the enum values being the same value.

Reviewed by: np
MFC after: 1 week

11 years agoIn cxgb(4), in function iwch_reregister_phys_mem(), initialize the
dim [Mon, 6 Aug 2012 18:51:14 +0000 (18:51 +0000)]
In cxgb(4), in function iwch_reregister_phys_mem(), initialize the
'npages' variable to zero, to avoid using it uninitialized in certain
cases.

Found by: clang
Reviewed by: np
MFC after: 1 week

11 years agoFix an instance in pam_krb5(8), where the variable 'user' could be used
dim [Mon, 6 Aug 2012 18:44:59 +0000 (18:44 +0000)]
Fix an instance in pam_krb5(8), where the variable 'user' could be used
uninitialized.

Found by: clang 3.2
Reviewed by: des
MFC after: 1 week

11 years agoFix two instances in pam_krb5(8), where the variable 'princ_name' could
dim [Mon, 6 Aug 2012 18:40:14 +0000 (18:40 +0000)]
Fix two instances in pam_krb5(8), where the variable 'princ_name' could
be used uninitialized.

Found by: clang 3.2
Reviewed by: des
MFC after: 1 week

11 years agoDo not add handler to event handlers list until ithread is created.
kan [Mon, 6 Aug 2012 16:37:43 +0000 (16:37 +0000)]
Do not add handler to event handlers list until ithread is created.

In rare event when fast and ithread interrupts share the same vector
and the fast handler was registered first, we can end up trying to
schedule the ithread that is not created yet. The kernel built with
INVARIANTS then triggers an assertion.

Change the order to create the ithread first and only then add the
handler that needs it to the interrupt event handlers list.

Reviewed by: jhb

11 years agomove functions outside the SYSBEGIN/SYSEND block
luigi [Mon, 6 Aug 2012 11:02:23 +0000 (11:02 +0000)]
move functions outside the SYSBEGIN/SYSEND block

(SYSBEGIN/SYSEND are specific to ipfw/dummynet and are used to
emulate sysctl on platforms that do not have them, and they work
by creating an array which contains all the sysctl-ed symbols.)

11 years agouse FREE_PKT instead of m_freem to free an mbuf.
luigi [Mon, 6 Aug 2012 10:50:43 +0000 (10:50 +0000)]
use FREE_PKT instead of m_freem to free an mbuf.
The former is the standard form used in ipfw/dummynet, so that
it is easier to remap it to different memory managers depending
on the platform.

11 years agoFix a bug found by dim@:
tuexen [Mon, 6 Aug 2012 10:50:23 +0000 (10:50 +0000)]
Fix a bug found by dim@:
Don't use an uninitilized variable, if INVARIANTS is on and an illegal
packet with destination 0 is received.

MFC after: 3 days
X-MFC with: 238003

11 years agoAdd supported device.
glebius [Mon, 6 Aug 2012 08:59:39 +0000 (08:59 +0000)]
Add supported device.

11 years ago- Merge from NetBSD:
marius [Mon, 6 Aug 2012 08:58:54 +0000 (08:58 +0000)]
- Merge from NetBSD:
  When issuing a non-DMA command, make sure to set the "remaining length of
  command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise
  we might get confused on command competition interrupt (no DMA active but
  still data left to transfer).
- Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as
  just rejecting these leads to a resend and disconnect loop.
  Reported and tested by: mjacob

MFC after: 3 days