]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAdd a new '-S' option to mountd, which tells it to suspend
rmacklem [Mon, 15 Oct 2012 00:17:16 +0000 (00:17 +0000)]
Add a new '-S' option to mountd, which tells it to suspend
execution of the nfsd threads while it is reloading the exports.
This avoids clients from getting intermittent access errors
when the exports are being reloaded non-atomically.
It is not an ideal solution, since requests will back up while
the nfsd threads are suspended. Also, when this option is used,
if mountd crashes while reloading exports, mountd will have to
be restarted to get the nfsd threads to resume execution.
This has been tested by Vincent Hoffman (vince at unsane.co.uk)
and John Hickey (jh at deterlab.net).
The nfse patch offers a more comprehensive solution for this issue.

PR: kern/9619, kern/131342
Reviewed by: kib
MFC after: 2 weeks

11 years agoTrack the total number of software queued frames in an atomic variable
adrian [Mon, 15 Oct 2012 00:07:18 +0000 (00:07 +0000)]
Track the total number of software queued frames in an atomic variable
stashed away in ath_node.

As much as I tried to stuff that behind the ATH_NODE lock, unfortunately
the locking is just too plain hairy (for me! And I wrote it!) to do
cleanly. Hence using atomics here instead of a lock. The ATH_NODE lock
just isn't currently used anywhere besides the rate control updates.

If in the future everything gets migrated back to using a single ATH_NODE
lock or a single global ATH_TX lock (ie, a single TX lock for all TX and
TX completion) then fine, I'll remove the atomics.

11 years agoStop abusing the ATH_TID_*() queue macros for filtered frames and give
adrian [Sun, 14 Oct 2012 23:52:30 +0000 (23:52 +0000)]
Stop abusing the ATH_TID_*() queue macros for filtered frames and give
them their own macro set.

11 years agoMirror the changes made in SVN r240798:
dteske [Sun, 14 Oct 2012 23:45:56 +0000 (23:45 +0000)]
Mirror the changes made in SVN r240798:

Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoCut-and-paste dropped semicolon.
kientzle [Sun, 14 Oct 2012 23:07:54 +0000 (23:07 +0000)]
Cut-and-paste dropped semicolon.

11 years agoName cpsw_stop to cpsw_stop_locked consistently with other functions
kientzle [Sun, 14 Oct 2012 23:00:24 +0000 (23:00 +0000)]
Name cpsw_stop to cpsw_stop_locked consistently with other functions
in this file that assume locks are already held.

11 years agoReturn correct packet size.
kientzle [Sun, 14 Oct 2012 22:58:12 +0000 (22:58 +0000)]
Return correct packet size.

11 years agoAdd two new options to the nfssvc(2) syscall that allow
rmacklem [Sun, 14 Oct 2012 22:33:17 +0000 (22:33 +0000)]
Add two new options to the nfssvc(2) syscall that allow
processes running as root to suspend/resume execution
of the kernel nfsd threads. An earlier version of this
patch was tested by Vincent Hoffman (vince at unsane.co.uk)
and John Hickey (jh at deterlab.net).

Reviewed by: kib
MFC after: 2 weeks

11 years agoPush the actual TX processing into the ath taskqueue, rather than having
adrian [Sun, 14 Oct 2012 20:44:08 +0000 (20:44 +0000)]
Push the actual TX processing into the ath taskqueue, rather than having
it run out of multiple concurrent contexts.

Right now the ath(4) TX processing is a bit hairy. Specifically:

* It was running out of ath_start(), which could occur from multiple
  concurrent sending processes (as if_start() can be started from multiple
  sending threads nowdays.. sigh)

* during RX if fast frames are enabled (so not really at the moment, not
  until I fix this particular feature again..)

* during ath_reset() - so anything which calls that

* during ath_tx_proc*() in the ath taskqueue - ie, TX is attempted again
  after TX completion, as there's now hopefully some ath_bufs available.

* Then, the ic_raw_xmit() method can queue raw frames for transmission
  at any time, from any net80211 TX context. Ew.

This has caused packet ordering issues in the past - specifically,
there's absolutely no guarantee that preemption won't occuring _during_
ath_start() by the TX completion processing, which will call ath_start()
again. It's a mess - 802.11 really, really wants things to be in
sequence or things go all kinds of loopy.

So:

* create a new task struct for TX'ing;
* make the if_start method simply queue the task on the ath taskqueue;
* make ath_start() just be called by the new TX task;
* make ath_tx_kick() just schedule the ath TX task, rather than directly
  calling ath_start().

Now yes, this means that I've taken a step backwards in terms of
concurrency - TX -and- RX now occur in the same single-task taskqueue.
But there's nothing stopping me from separating out the TX / TX completion
code into a separate taskqueue which runs in parallel with the RX path,
if that ends up being appropriate for some platforms.

This fixes the CCMP/seqno concurrency issues that creep up when you
transmit large amounts of uni-directional UDP traffic (>200MBit) on a
FreeBSD STA -> AP, as now there's only one TX context no matter what's
going on (TX completion->retry/software queue,
userland->net80211->ath_start(), TX completion -> ath_start());
but it won't fix any concurrency issues between raw transmitted frames
and non-raw transmitted frames (eg EAPOL frames on TID 16 and any other
TID 16 multicast traffic that gets put on the CABQ.)  That is going to
require a bunch more re-architecture before it's feasible to fix.

In any case, this is a big step towards making the majority of the TX
path locking irrelevant, as now almost all TX activity occurs in the
taskqueue.

Phew.

11 years agoBreak the RX processing up into smaller chunks of 128 frames each.
adrian [Sun, 14 Oct 2012 20:31:38 +0000 (20:31 +0000)]
Break the RX processing up into smaller chunks of 128 frames each.

Right now processing a full 512 frame queue takes quite a while (measured
on the order of milliseconds.) Because of this, the TX processing ends up
sometimes preempting the taskqueue:

* userland sends a frame
* it goes in through net80211 and out to ath_start()
* ath_start() will end up either direct dispatching or software queuing a
  frame.

If TX had to wait for RX to finish, it would add quite a few ms of
additional latency to the packet transmission.  This in the past has
caused issues with TCP throughput.

Now, as part of my attempt to bring sanity to the TX/RX paths, the first
step is to make the RX processing happen in smaller 'parts'. That way
when TX is pushed into the ath taskqueue, there won't be so much latency
in the way of things.

The bigger scale change (which will come much later) is to actually
process the frames in the ath_intr taskqueue but process _frames_ in
the ath driver taskqueue.  That would reduce the latency between
processing and requeuing new descriptors. But that'll come later.

The actual work:

* Add ATH_RX_MAX at 128 (static for now);
* break out of the processing loop if npkts reaches ATH_RX_MAX;
* if we processed ATH_RX_MAX or more frames during the processing loop,
  immediately reschedule another RX taskqueue run.  This will handle
  the further frames in the taskqueue.

This should have very minimal impact on the general throughput case,
unless the scheduler is being very very strange or the ath taskqueue
ends up spending a lot of time on non-RX operations (such as TX
completion.)

11 years agoAdd a KPI to allow to reserve some amount of space in the numvnodes
kib [Sun, 14 Oct 2012 19:43:37 +0000 (19:43 +0000)]
Add a KPI to allow to reserve some amount of space in the numvnodes
counter, without actually allocating the vnodes. The supposed use of
the getnewvnode_reserve(9) is to reclaim enough free vnodes while the
code still does not hold any resources that might be needed during the
reclamation, and to consume the slack later for getnewvnode() calls
made from the innards. After the critical block is finished, the
caller shall free any reserve left, by getnewvnode_drop_reserve(9).

Reviewed by: avg
Tested by: pho
MFC after: 1 week

11 years agoImplement modem control in u3g. Tested on Option GTM382W, Huawei E220,
n_hibma [Sun, 14 Oct 2012 19:15:54 +0000 (19:15 +0000)]
Implement modem control in u3g. Tested on Option GTM382W, Huawei E220,
and Sierra Wireless MC8790V. Also implement the .ucom_poll method.

Note: This makes it possible to use lqr/echo in ppp.conf. And it
resolves ppp hanging during the PPp> phase.

Reviewed by: hps
MFC after: 1 week

11 years agoGrammar fixes.
kib [Sun, 14 Oct 2012 18:13:33 +0000 (18:13 +0000)]
Grammar fixes.

Submitted by: bf
MFC after: 1 week

11 years agoAdd support for the extrememory Snippy
eadler [Sun, 14 Oct 2012 17:26:45 +0000 (17:26 +0000)]
Add support for the extrememory Snippy

PR: usb/159611
Submitted by: Fabian Keil <fk@fabiankeil.de>
Approved by: cperciva (implicit)
MFC after: 3 days

11 years agoAdd support for Feiya Elango USB MicroSD
eadler [Sun, 14 Oct 2012 17:26:40 +0000 (17:26 +0000)]
Add support for  Feiya Elango USB MicroSD

PR: usb/153599
Submitted by: CyberLeo <cyberleo@cyberleo.net>
Approved by: cperciva (implicit)
MFC after: 3 days

11 years agoAdd support for the Buffalo RUF2 flash drive.
eadler [Sun, 14 Oct 2012 17:26:32 +0000 (17:26 +0000)]
Add support for the Buffalo RUF2 flash drive.

PR: usb/166848
Submitted by: Andrew Gregory <andrew@scss.com.au>
Reviewed by: hselasky
Approved by: cperciva (implicit)
MFC after: 3 days

11 years agoMFamd64: add machdep.uprintf_signal.
kib [Sun, 14 Oct 2012 17:09:50 +0000 (17:09 +0000)]
MFamd64: add machdep.uprintf_signal.

MFC after: 1 week

11 years agoPrint the %rip value for uprintf_signal.
kib [Sun, 14 Oct 2012 17:08:46 +0000 (17:08 +0000)]
Print the %rip value for uprintf_signal.

MFC after: 1 week

11 years agoReplace the XXX comment with the proper description.
kib [Sun, 14 Oct 2012 17:07:34 +0000 (17:07 +0000)]
Replace the XXX comment with the proper description.

MFC after: 1 week

11 years agoFix a miss from r241344: in ip_mloopback() we need to go to
glebius [Sun, 14 Oct 2012 15:08:07 +0000 (15:08 +0000)]
Fix a miss from r241344: in ip_mloopback() we need to go to
net byte order prior to calling in_delayed_cksum().

Reported by:  Olivier Cochard-Labbe <olivier cochard.me>

11 years agoFix defines in r241245. We actually don't define FreeBSD.
glebius [Sun, 14 Oct 2012 15:03:06 +0000 (15:03 +0000)]
Fix defines in r241245. We actually don't define FreeBSD.

Reported & tested by: Oleg Ginzburg

11 years agomdoc: avoid nested displays.
joel [Sun, 14 Oct 2012 14:45:54 +0000 (14:45 +0000)]
mdoc: avoid nested displays.

11 years agomdoc: don't nest displays. The markup here isn't adding anything anyway.
joel [Sun, 14 Oct 2012 13:59:17 +0000 (13:59 +0000)]
mdoc: don't nest displays. The markup here isn't adding anything anyway.
Fixes a mandoc lint warning.

Discussed with: brueffer, Jason McIntyre <jmc@kerhand.co.uk>

11 years agoBump .Dd
eadler [Sun, 14 Oct 2012 13:45:13 +0000 (13:45 +0000)]
Bump .Dd
Approved by: joel

11 years agoDon't document the PORTSSUPFILE variable. Even though this still works,
eadler [Sun, 14 Oct 2012 13:41:42 +0000 (13:41 +0000)]
Don't document the PORTSSUPFILE variable. Even though this still works,
try to discourage users from depending on it.

Approved by: joel
MFC after: 3 days

11 years agoMinor mdoc improvements. Also remove unnecessary csup reference.
joel [Sun, 14 Oct 2012 10:26:29 +0000 (10:26 +0000)]
Minor mdoc improvements. Also remove unnecessary csup reference.

11 years agopciereg_cfg*: use assembly to access the mem-mapped cfg space
avg [Sun, 14 Oct 2012 10:13:50 +0000 (10:13 +0000)]
pciereg_cfg*: use assembly to access the mem-mapped cfg space

AMD BKDG for CPU families 10h and later requires that the memory
mapped config is always read into or written from al/ax/eax register.

Discussed with: kib, alc
Reviewed by: kib (earlier version)
MFC after: 25 days

11 years agoRemove cvs/cvsup reference.
joel [Sun, 14 Oct 2012 10:12:32 +0000 (10:12 +0000)]
Remove cvs/cvsup reference.

11 years agoacpi_thermal: when _ACx is tripped, all _ALi i>= x should be on
avg [Sun, 14 Oct 2012 09:32:38 +0000 (09:32 +0000)]
acpi_thermal: when _ACx is tripped, all _ALi i>= x should be on

... and not just _ALx as it is now.

MFC after: 20 days

11 years agoacpi_wmi: move wmi_info_list into sc
avg [Sun, 14 Oct 2012 09:31:11 +0000 (09:31 +0000)]
acpi_wmi: move wmi_info_list into sc

different instances of acpi_wmi couldn't properly share it and, in fact,
there was no reason to do that

MFC after: 10 days

11 years agoAdd explicit check for not set time inside cam_periph_freeze_after_event().
mav [Sun, 14 Oct 2012 08:50:05 +0000 (08:50 +0000)]
Add explicit check for not set time inside cam_periph_freeze_after_event().

System time is set later on boot process then initial bus scan by CAM.
Until that moment microtime() is equal to microuptime(), and if system
boots quickly, the value can be close to zero. That causes settle time
waiting even for buses that don't use reset during probe.

On my test system this reduces boot time by 1 second if USB enabled, or
by 4 seconds if USB disabled.  CAM waited for ctl2cam0 bus "settle".

11 years agoRemove trailing whitespace.
joel [Sun, 14 Oct 2012 07:22:56 +0000 (07:22 +0000)]
Remove trailing whitespace.

11 years agoMinor mdoc and language fixes.
joel [Sun, 14 Oct 2012 07:19:42 +0000 (07:19 +0000)]
Minor mdoc and language fixes.

11 years agoSince the introduction of the new advanced boot menu (r222417), options like
dteske [Sun, 14 Oct 2012 06:52:49 +0000 (06:52 +0000)]
Since the introduction of the new advanced boot menu (r222417), options like
"boot verbose", "single user mode", "ACPI" and more are now stateful boolean
menuitems rather than direct action-items.

A short-coming in this new menu system is that when a user sets a non-default
value in loader.conf(5), this non-default state is not reflected in the menu
-- leading to confusion as to whether the option was taking effect or not.

This patch adds dynamic menuitem constructors _and_ the necessary Forth
callbacks to initialize these stateful menuitems -- causing the aforementioned
menuitems to adhere to loader.conf(5) settings.

PR: bin/172529
Approved by: adrian (co-mentor)
MFC after: 21 days

11 years agogetopt_long() returns an int. Use the return value accordingly.
attilio [Sun, 14 Oct 2012 03:59:17 +0000 (03:59 +0000)]
getopt_long() returns an int. Use the return value accordingly.

Pointy hat to: me
MFC after: 2 months
X-MFC: r241519,241521

11 years agoRename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to
attilio [Sun, 14 Oct 2012 03:51:59 +0000 (03:51 +0000)]
Rename s/DEBUG()/FS_DEBUG() and s/DEBUG2G()/FS_DEBUG2G() in order to
avoid a name clash in sparc64.

MFC after: 2 months
X-MFC: r241519

11 years agoCorrect an error in pmap_pv_reclaim(). It can legitimately encounter
alc [Sun, 14 Oct 2012 03:40:08 +0000 (03:40 +0000)]
Correct an error in pmap_pv_reclaim().  It can legitimately encounter
wired mappings.  If it does, it should just skip them.

11 years agoImport a FreeBSD port of the FUSE Linux module.
attilio [Sat, 13 Oct 2012 23:54:26 +0000 (23:54 +0000)]
Import a FreeBSD port of the FUSE Linux module.
This has been developed during 2 summer of code mandates and being revived
by gnn recently.
The functionality in this commit mirrors entirely content of fusefs-kmod
port, which doesn't need to be installed anymore for -CURRENT setups.

In order to get some sparse technical notes, please refer to:
http://lists.freebsd.org/pipermail/freebsd-fs/2012-March/013876.html

or to the project branch:
svn://svn.freebsd.org/base/projects/fuse/

which also contains granular history of changes happened during port
refinements. This commit does not came from the branch reintegration
itself because it seems svn is not behaving properly for this functionaly
at the moment.

Partly Sponsored by: Google, Summer of Code program 2005, 2011
Originally submitted by: ilya, Csaba Henk <csaba-ml AT creo DOT hu >
In collabouration with: pho
Tested by: flo, gnn, Gustau Perez,
Kevin Oberman <rkoberman AT gmail DOT com>
MFC after: 2 months

11 years agoMove vm_page_requeue() to the only file that uses it.
alc [Sat, 13 Oct 2012 20:19:43 +0000 (20:19 +0000)]
Move vm_page_requeue() to the only file that uses it.

MFC after: 3 weeks

11 years ago* Update the comment that explains the choice of values in the
kargl [Sat, 13 Oct 2012 19:53:11 +0000 (19:53 +0000)]
* Update the comment that explains the choice of values in the
  table and the requirement on trailing zero bits.

* Remove the __aligned() compiler directives as these were found
  to have a negative effect on the produced code.

Submitted by: bde
Approved by: das (mentor)

11 years ago- Fix typo
gabor [Sat, 13 Oct 2012 19:37:58 +0000 (19:37 +0000)]
- Fix typo

Spotted by: glebius

11 years ago- Regen after GNU sort removal
gabor [Sat, 13 Oct 2012 19:29:38 +0000 (19:29 +0000)]
- Regen after GNU sort removal

11 years ago- Remove WITH_GNU_SORT support
gabor [Sat, 13 Oct 2012 19:29:07 +0000 (19:29 +0000)]
- Remove WITH_GNU_SORT support

11 years agoEliminate the conditional for releasing the page queues lock in
alc [Sat, 13 Oct 2012 18:46:46 +0000 (18:46 +0000)]
Eliminate the conditional for releasing the page queues lock in
vm_page_sleep().  vm_page_sleep() is no longer called with this lock
held.

Eliminate assertions that the page queues lock is NOT held.  These
assertions won't translate well to having distinct locks on the active
and inactive page queues, and they really aren't that useful.

MFC after: 3 weeks

11 years ago- Remove GNU sort and the WITH_GNU_SORT knob
gabor [Sat, 13 Oct 2012 18:40:39 +0000 (18:40 +0000)]
- Remove GNU sort and the WITH_GNU_SORT knob

11 years agoDon't exclude XPT SIM from locking in xpt_create_path_unlocked().
mav [Sat, 13 Oct 2012 18:24:52 +0000 (18:24 +0000)]
Don't exclude XPT SIM from locking in xpt_create_path_unlocked().
We don't want xpt periph, device, target or bus disappeared because of
incorrect reference counting.

11 years agoUse xpt_create_path_unlocked() for initial debug path compilation because
mav [Sat, 13 Oct 2012 18:11:50 +0000 (18:11 +0000)]
Use xpt_create_path_unlocked() for initial debug path compilation because
we are not holding respective SIM lock.

11 years agoExtend SIM lock coverage during the bus registration process.
mav [Sat, 13 Oct 2012 17:55:06 +0000 (17:55 +0000)]
Extend SIM lock coverage during the bus registration process.

11 years agoMake a command for pkg_info changeable like pkg_version in
ume [Sat, 13 Oct 2012 14:45:42 +0000 (14:45 +0000)]
Make a command for pkg_info changeable like pkg_version in
/etc/periodic/weekly/400.status-pkg to be friendly with pkgng.

MFC after: 1 week

11 years agoFix XPT_DEBUG paths operations locking:
mav [Sat, 13 Oct 2012 11:23:16 +0000 (11:23 +0000)]
Fix XPT_DEBUG paths operations locking:
 - Extend the lock to cover xpt_path_release() for the new path.
 - While xpt_action() is called while holding right SIM lock for the new
   bus, the old path release may require different SIM lock. So we have
   to temporary drop the new lock and get the old one.

11 years agoXPT_DEV_MATCH is probably the only xpt_action() method that is called
mav [Sat, 13 Oct 2012 10:18:36 +0000 (10:18 +0000)]
XPT_DEV_MATCH is probably the only xpt_action() method that is called
without holding SIM lock. It really doesn't need that lock, but adding it
removes that specific exception, allowing to assert locking there later.

Submitted by: ken@ (earlier version)

11 years agoCleanup documentation: cloning route support has been removed in r186119.
melifaro [Sat, 13 Oct 2012 09:31:01 +0000 (09:31 +0000)]
Cleanup documentation: cloning route support has been removed in r186119.

MFC after: 2 weeks

11 years agoAdd forgotten documentation for new NGM_NETFLOW_V9INFO message.
melifaro [Sat, 13 Oct 2012 09:25:29 +0000 (09:25 +0000)]
Add forgotten documentation for new NGM_NETFLOW_V9INFO message.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC with: r241446

11 years agoFix the non-TDMA build.
adrian [Sat, 13 Oct 2012 06:27:34 +0000 (06:27 +0000)]
Fix the non-TDMA build.

11 years agoSVN r240684 broke the ability of the dot module to map include dependencies.
dteske [Sat, 13 Oct 2012 03:56:33 +0000 (03:56 +0000)]
SVN r240684 broke the ability of the dot module to map include dependencies.
Teach the dot module about the new location these includes moved to (as part
of r240684) and clean things up a bit.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoReplace all uses of the vm page queues lock by a new R/W lock.
alc [Fri, 12 Oct 2012 23:26:00 +0000 (23:26 +0000)]
Replace all uses of the vm page queues lock by a new R/W lock.
Unfortunately, this lock cannot be defined as static under Xen because it
is (ab)used to serialize queued page table changes.

Tested by: sbruno

11 years agoSome 3G modems return the wrong signature in echo packets and make it
n_hibma [Fri, 12 Oct 2012 22:48:33 +0000 (22:48 +0000)]
Some 3G modems return the wrong signature in echo packets and make it
impossible to use LQR/ECHO. They return want_magic instead.

With this change it is now possible to use

enable lqr
set lqrperiod 5
enable echo
set echoperiod 5

in your ppp.conf file.

MFC after: 3 days

11 years agoFix build with PAE enabled. I doubt any code uses CAM_SCATTER_VALID or
mav [Fri, 12 Oct 2012 22:06:06 +0000 (22:06 +0000)]
Fix build with PAE enabled.  I doubt any code uses CAM_SCATTER_VALID or
CAM_DATA_PHYS, or they ever correctly worked, but make this build at least.

11 years agoTemporary fix for kern/172364.
np [Fri, 12 Oct 2012 21:58:21 +0000 (21:58 +0000)]
Temporary fix for kern/172364.

PR: kern/172364
MFC after: 3 days

11 years agoUse global knob in the TP_PARA_REG3 register to disable congestion
np [Fri, 12 Oct 2012 21:48:21 +0000 (21:48 +0000)]
Use global knob in the TP_PARA_REG3 register to disable congestion
drops if the user has chosen this behaviour.

MFC after: 3 days

11 years agoAdd locking to adv(4) driver and mark it MPSAFE.
jhb [Fri, 12 Oct 2012 21:31:44 +0000 (21:31 +0000)]
Add locking to adv(4) driver and mark it MPSAFE.
- Disable the support for the second channel on twin-channel EISA cards as
  the current incarnation can't possibly work correctly (it hasn't worked
  since switching to new-bus where new-bus allocates the softc).  If anyone
  bothers to test this again it can be fixed properly and brought back.
- Use device_printf() and device_get_nameunit() instead of adv_name().
- Remove use of explicit bus space handles and tags.
- Use PCI bus accessors and helper routines rather than accessing
  config registers directly.
- Handle failures from adv_attach().

Tested by: no one (hope it works)

11 years agoFix type in last commit.
glebius [Fri, 12 Oct 2012 19:53:13 +0000 (19:53 +0000)]
Fix type in last commit.

Submitted by: brueffer

11 years agoGet SIM lock in several places while calling CAM functions.
mav [Fri, 12 Oct 2012 18:21:31 +0000 (18:21 +0000)]
Get SIM lock in several places while calling CAM functions.
This fixes several use-after-free panics on systems with SAS enclosures.

Submitted by: ken@, mav@

11 years agoProtect xpt_getattr() calls with the SIM lock and assert that.
mav [Fri, 12 Oct 2012 17:18:24 +0000 (17:18 +0000)]
Protect xpt_getattr() calls with the SIM lock and assert that.

Submitted by: ken@ (earlier version)

11 years agoUse CLOCK_UPTIME to get the uptime.
emaste [Fri, 12 Oct 2012 15:03:28 +0000 (15:03 +0000)]
Use CLOCK_UPTIME to get the uptime.

11 years agoBe more explicit on how "intact" incoming packets in raw sockets are.
glebius [Fri, 12 Oct 2012 12:27:30 +0000 (12:27 +0000)]
Be more explicit on how "intact" incoming packets in raw sockets are.

11 years agoRevert fixup of ip_len from r241480. Now stack isn't yet
glebius [Fri, 12 Oct 2012 09:32:38 +0000 (09:32 +0000)]
Revert fixup of ip_len from r241480. Now stack isn't yet
ready for that change.

11 years agoIn ip_stripoptions():
glebius [Fri, 12 Oct 2012 09:24:24 +0000 (09:24 +0000)]
In ip_stripoptions():
  - Remove unused argument and incorrect comment.
  - Fixup ip_len after stripping.

11 years agoRemove whitespace.
joel [Fri, 12 Oct 2012 06:16:51 +0000 (06:16 +0000)]
Remove whitespace.

11 years agoSince the moduledata structure member priv is a void pointer, using
kevlo [Fri, 12 Oct 2012 01:31:02 +0000 (01:31 +0000)]
Since the moduledata structure member priv is a void pointer, using
NULL instead of 0 when dealing with pointers.

11 years agoVirtio SCSI driver
grehan [Thu, 11 Oct 2012 23:41:18 +0000 (23:41 +0000)]
Virtio SCSI driver

Submitted by: Bryan Venteicher  bryanv at daemoninthecloset dot org
Reviewed by: grehan

11 years agoPatch from Bryan to fix a virtqueue issue:
grehan [Thu, 11 Oct 2012 23:03:42 +0000 (23:03 +0000)]
Patch from Bryan to fix a virtqueue issue:

    virtqueue: Fix non-indirect virtqueues

    We really must walk the entire descriptor chain in order
    to append the to be free'd chain to the existing free
    chain.

Submitted by: Bryan Venteicher (bryanv@daemoninthecloset.org)
Reported by: cognet

11 years agoMake local function static.
emaste [Thu, 11 Oct 2012 21:24:07 +0000 (21:24 +0000)]
Make local function static.

11 years agoFix tiypo.
ray [Thu, 11 Oct 2012 21:19:42 +0000 (21:19 +0000)]
Fix tiypo.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)

11 years agoPoint freebsd.org cluster machines to mx1 for their smarthost.
peter [Thu, 11 Oct 2012 20:46:04 +0000 (20:46 +0000)]
Point freebsd.org cluster machines to mx1 for their smarthost.

11 years agoUse separate malloc buckets for CAM devices, CCBs and paths. This will
mav [Thu, 11 Oct 2012 20:14:11 +0000 (20:14 +0000)]
Use separate malloc buckets for CAM devices, CCBs and paths. This will
make it easier to track down the source of any use after free problems.

Submitted by: ken@

11 years agoDon't duplicate path/ccb allocation code, use existing functions.
mav [Thu, 11 Oct 2012 19:57:11 +0000 (19:57 +0000)]
Don't duplicate path/ccb allocation code, use existing functions.

11 years agoExclude potential circular symlink when creating src tarball.
emaste [Thu, 11 Oct 2012 18:41:32 +0000 (18:41 +0000)]
Exclude potential circular symlink when creating src tarball.

Normal release builds are not affected by this but it can happen if using
these release bits against a work tree.

Sponsored by: ADARA Networks

11 years agoAdd NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
melifaro [Thu, 11 Oct 2012 16:15:18 +0000 (16:15 +0000)]
Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC after: 2 weeks

11 years agoIncrease device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
mav [Thu, 11 Oct 2012 15:21:07 +0000 (15:21 +0000)]
Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
It is required to store extra recovery requests in case of bus resets.
On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or
possible memory corruptions otherwise if timeout/reset happens when device
CCB queue is already full.

Reported by: gibbs@
MFC after: 1 week

11 years agoFix my last commit. Only call strunvis after properly checking the argument is
stefanf [Thu, 11 Oct 2012 08:18:28 +0000 (08:18 +0000)]
Fix my last commit.  Only call strunvis after properly checking the argument is
not NULL.

11 years agoDecode the first two fstab fields with strunvis(3). This allows having spaces
stefanf [Thu, 11 Oct 2012 07:54:29 +0000 (07:54 +0000)]
Decode the first two fstab fields with strunvis(3). This allows having spaces
in devices and mount paths, encoded as \s or \040.

PR: bin/117687
Submitted by: Martin Kammerhofer
Discussed on: arch

11 years agoApply some style. Checked with md5.
stefanf [Thu, 11 Oct 2012 07:39:51 +0000 (07:39 +0000)]
Apply some style. Checked with md5.

11 years agoAdd APE firmware support and improve firmware handshake procedure.
yongari [Thu, 11 Oct 2012 06:43:43 +0000 (06:43 +0000)]
Add APE firmware support and improve firmware handshake procedure.
This change will enable IPMI access on 5717/5718/5719/5720 and 5761
controllers. Because ASF is not available when APE firmware is
present, bge_allow_asf tunable is ignored when driver detects APE
firmware.  Also bge(4) no longer performs two resets(one blind
reset and the other reset with firmware in mind) in device attach.
Now bge(4) performs a reset with enough information in bge_reset().
The APE firmware also needs special handling to make suspend/resume
work but it was not implemented yet.

With this change, bge(4) should work on any 5717/5718/5719/5720
controllers. Special thanks to Mike Hibler at Emulab who setup
remote debugging on Dell R820. Without his help I couldn't be able
to address several issues happened on Dell Rx20 systems. And many
thanks to Broadcom for continuing to support FreeBSD!

Submitted by: davidch (initial version)
H/W donated by: Broadcom
Tested by: many
Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8

11 years agoFor 5717C/5719C/5720C and 57765 PHYs, do not perform any special
yongari [Thu, 11 Oct 2012 06:07:48 +0000 (06:07 +0000)]
For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
handling(jumbo, wire speed etc) in brgphy_reset().  Touching
BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
it couldn't establish a link.

11 years agoRework controller reset procedure. Previously driver saved
yongari [Thu, 11 Oct 2012 05:48:04 +0000 (05:48 +0000)]
Rework controller reset procedure. Previously driver saved
BGE_PCI_PCISTATE register before issuing global reset. After
issuing reset, it reads BGE_PCI_PCISTATE register again and
compares the saved register value and current value. It was used to
know whether the global reset operation was completed or not.
Unfortunately, this logic caused several issues on recent BCM5717/
5718/5719 and BCM5720 controllers. It seems APE firmware accesses
some registers while global reset is in progress such that reading
BGE_PCI_PCISTATE register after reset does not yield old pre-reset
state value. This resulted in consuming too much time in global
reset and sometimes it couldn't successfully complete reset.

The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is
self-clearing bit so driver is able to know the reset completion.
But the core-lock reset will disable indirect/flat/standard access
modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS
bit of BGE_MISC_CFG register. So just wait enough time for
core-clock reset to complete.
Data sheet says driver should wait 100us for PCI/PCI-X devices and
100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value
was used for many years in bge(4). For PCIe devices, use 100ms as
recommended by data sheet.

bge_chipinit() also cleared BGE_MAC_MODE register which shall clear
firmware configured mode information. I think this will result in
losing ASF/IPMI link in device attachment. Let bge_reset() honor
firmware configured BGE_MAC_MODE register and don't announce driver
is UP in bge_reset(). Firmware should have control over driver until
it's fully initialized by driver.

While I'm here, enable workaround for PCI-X BCM5704 A0 in
bge_reset(). This will prevent internal arbitration logic from
switching to the other DMA engine after a retry cycle.

11 years agoCount number of times each queue pair's interrupt handler is invoked.
jimharris [Wed, 10 Oct 2012 23:35:16 +0000 (23:35 +0000)]
Count number of times each queue pair's interrupt handler is invoked.

Also add sysctls to query and reset each queue pair's stats, including
the new count added here.

Sponsored by: Intel

11 years agoPut the nvme_qpair mutex on its own cacheline.
jimharris [Wed, 10 Oct 2012 23:28:58 +0000 (23:28 +0000)]
Put the nvme_qpair mutex on its own cacheline.

Sponsored by: Intel

11 years ago - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
mav [Wed, 10 Oct 2012 22:02:11 +0000 (22:02 +0000)]
 - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
set not-NULL during SIM registration and set to UMASS_GONE on destruction.
Debug messages there look broken for at least 9 years, as they dereference
softc value that was just checked to be equal to NULL.
 - Remove magic pointer value UMASS_GONE and use simple NULL instead.

Found by: Clang Static Analyzer

11 years agoAdd man pages for nvme(4) and nvd(4).
jimharris [Wed, 10 Oct 2012 21:38:17 +0000 (21:38 +0000)]
Add man pages for nvme(4) and nvd(4).

Sponsored by: Intel
Reviewed by: joel

11 years agoPull in r164132 from upstream llvm trunk:
dim [Wed, 10 Oct 2012 21:37:21 +0000 (21:37 +0000)]
Pull in r164132 from upstream llvm trunk:

  When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
  store this and use it to not emit long nops when the CPU is geode which
  doesnt support them.

  Fixes PR11212.

Pull in r164133 from upstream clang trunk:

  Follow up on llvm r164132.

This should prevent illegal instructions when building world on Geode
CPUs (e.g. Soekris).

MFC after: 3 days

11 years agoPull in r163710 from upstream llvm trunk:
dim [Wed, 10 Oct 2012 21:29:00 +0000 (21:29 +0000)]
Pull in r163710 from upstream llvm trunk:

  Add support for AMD Geode.

MFC after: 3 days

11 years agoNULL-ify last previously used pointer instead of last possible pointer.
mav [Wed, 10 Oct 2012 20:41:37 +0000 (20:41 +0000)]
NULL-ify last previously used pointer instead of last possible pointer.
This should be only a cosmetic change.

Found by: Clang Static Analyzer

11 years agoAdd a "clearstats" subcommand to cxgbetool that lets you clear the
np [Wed, 10 Oct 2012 20:09:19 +0000 (20:09 +0000)]
Add a "clearstats" subcommand to cxgbetool that lets you clear the
MAC statistics for any port.

For example:
# cxgbetool t4nex0 clearstats 0

Submitted by: gnn@
MFC after: 3 days

11 years agoUpgrade to 9.8.3-P4:
delphij [Wed, 10 Oct 2012 19:47:52 +0000 (19:47 +0000)]
Upgrade to 9.8.3-P4:

Prevents a lockup when queried a deliberately constructed combination
of records. [CVE-2012-5166]

For more information: https://kb.isc.org/article/AA-00801

11 years agopanic() with reasonable message instead of returning zero frequency causing
mav [Wed, 10 Oct 2012 19:46:46 +0000 (19:46 +0000)]
panic() with reasonable message instead of returning zero frequency causing
division by zero later if event timer's minimal period is above one second.
For now it is just a theoretical possibility.

Found by: Clang Static Analyzer

11 years agoThere are SCSI conditions that are not an errors. In those cases cderror()
mav [Wed, 10 Oct 2012 19:32:40 +0000 (19:32 +0000)]
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP.  That could cause
partial device attach or other unexpected results.

Found by: Clang Static Analyzer

11 years agoAdd a driver ioctl to clear a port's MAC statistics.
np [Wed, 10 Oct 2012 19:27:40 +0000 (19:27 +0000)]
Add a driver ioctl to clear a port's MAC statistics.

Submitted by: gnn@
MFC after: 3 days

11 years agoDo not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
melifaro [Wed, 10 Oct 2012 19:06:11 +0000 (19:06 +0000)]
Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
enabled. This eliminates one mtx_lock() per each routing lookup thus improving
performance in several cases (routing to directly connected interface or routing
to default gateway).

Icmp redirects should not be used to provide routing direction nowadays, even
for end hosts. Routers should not use them too (and this is explicitly restricted
in IPv6, see RFC 4861, clause 8.2).

Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every
AF_INET routing table in given VNET instance on drop_redirect sysctl change.

This change is part of bigger patch eliminating rte locking.

Sponsored by: Yandex LLC
MFC after: 2 weeks

11 years agoReally handle xpt_compile_path() error in xpt_bus_register() instead of
mav [Wed, 10 Oct 2012 18:34:15 +0000 (18:34 +0000)]
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.

Found by: Clang Static Analyzer