]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMFC
attilio [Fri, 21 Sep 2012 03:07:34 +0000 (03:07 +0000)]
MFC

11 years agoReplace redirections to /dev/null with "close file-descriptor" syntax (>&-).
dteske [Fri, 21 Sep 2012 01:36:20 +0000 (01:36 +0000)]
Replace redirections to /dev/null with "close file-descriptor" syntax (>&-).

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

11 years agoChange all invocations of dialog(1) to no-longer require temporary files.
dteske [Thu, 20 Sep 2012 23:44:13 +0000 (23:44 +0000)]
Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media.

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

11 years agoRestore handling of the third argument (id) of hid_start_parse(), same as
mav [Thu, 20 Sep 2012 18:56:27 +0000 (18:56 +0000)]
Restore handling of the third argument (id) of hid_start_parse(), same as
it is done in NetBSD/OpenBSD, and as it was here before r205728.

I personally think this API or its implementation is incorrect, as it is not
correct to filter collections based on report ID, as they are orthogonal
in general case, but I see no harm from supporting this feature.

PR: usb/171810
Submitted by: Vitaly Magerya <vmagerya@gmail.com>
MFC after: 1 month

11 years agoFix typo.
hselasky [Thu, 20 Sep 2012 15:11:59 +0000 (15:11 +0000)]
Fix typo.

11 years agoFix typo: s/protocl/protocol
kevlo [Thu, 20 Sep 2012 10:07:31 +0000 (10:07 +0000)]
Fix typo: s/protocl/protocol

11 years agoConvert lagg(4) to use if_transmit instead of if_start.
glebius [Thu, 20 Sep 2012 10:05:10 +0000 (10:05 +0000)]
Convert lagg(4) to use if_transmit instead of if_start.

In collaboration with: thompsa, sbruno, fabient

11 years agoPlug the accounting leak for the wired pages when msync(MS_INVALIDATE)
kib [Thu, 20 Sep 2012 09:52:57 +0000 (09:52 +0000)]
Plug the accounting leak for the wired pages when msync(MS_INVALIDATE)
is performed on the vnode mapping which is wired in other address space.

While there, explicitely assert that the page is unwired and zero the
wire_count instead of substract. The condition is rechecked later in
vm_page_free(_toq) already.

Reported and tested by: zont
Reviewed by: alc (previous version)
MFC after: 1 week

11 years agounbreak build: rescue now needs -ljail if MK_ZFS is on
bapt [Thu, 20 Sep 2012 08:50:39 +0000 (08:50 +0000)]
unbreak build: rescue now needs -ljail if MK_ZFS is on

11 years agoThe correct generic term for PCIS_STORAGE_NVM is "NVM" not "NVM Express".
gavin [Thu, 20 Sep 2012 08:30:17 +0000 (08:30 +0000)]
The correct generic term for PCIS_STORAGE_NVM is "NVM" not "NVM Express".

Submitted by: jimharris
MFC after: 6 days

11 years agoRemove references to brelse and bremfree, which don't actually exist.
kevlo [Thu, 20 Sep 2012 07:07:35 +0000 (07:07 +0000)]
Remove references to brelse and bremfree, which don't actually exist.

11 years agoReduce copy/paste when freeing an source node.
glebius [Thu, 20 Sep 2012 07:04:08 +0000 (07:04 +0000)]
Reduce copy/paste when freeing an source node.

11 years agoUtilize Jenkins hash with random seed for source nodes storage.
glebius [Thu, 20 Sep 2012 06:52:05 +0000 (06:52 +0000)]
Utilize Jenkins hash with random seed for source nodes storage.

11 years agoRedo r240386 providing more correct information.
glebius [Thu, 20 Sep 2012 05:49:31 +0000 (05:49 +0000)]
Redo r240386 providing more correct information.

11 years agoRe-do r240271:
glebius [Thu, 20 Sep 2012 05:41:20 +0000 (05:41 +0000)]
Re-do r240271:
- Set IP_RECVDSTADDR sockopt on the socket only in case if
  it is INADDR_ANY bound.
- Supply IP_SENDSRCADDR control message only if we did receive
  IP_RECVDSTADDR control message.

This fixes operation of snmpd bound to a specific local IP address.

PR: bin/171279

11 years agomdoc: remove superfluous paragraph macro.
joel [Thu, 20 Sep 2012 04:53:12 +0000 (04:53 +0000)]
mdoc: remove superfluous paragraph macro.

11 years agoUpgrade to 9.8.3-P3:
dougb [Thu, 20 Sep 2012 04:12:09 +0000 (04:12 +0000)]
Upgrade to 9.8.3-P3:

Prevents a crash when queried for a record whose RDATA exceeds
65535 bytes.

Prevents a crash when validating caused by using "Bad cache" data
before it has been initialized.

ISC_QUEUE handling for recursive clients was updated to address
a race condition that could cause a memory leak. This rarely
occurred with UDP clients, but could be a significant problem
for a server handling a steady rate of TCP queries.

A condition has been corrected where improper handling of
zero-length RDATA could cause undesirable behavior, including
termination of the named process.

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

11 years agoRewrite portions of development.7 to make sense
eadler [Thu, 20 Sep 2012 03:48:36 +0000 (03:48 +0000)]
Rewrite portions of development.7 to make sense
in the world of subversion.

Approved by: gjb
MFC after: 2 weeks

11 years agoFix typo: s/pakcet/packet
kevlo [Thu, 20 Sep 2012 03:29:43 +0000 (03:29 +0000)]
Fix typo: s/pakcet/packet

11 years agoIntroduce the CLRDMASK gating based on tid->clrdmask, enabling filtered
adrian [Thu, 20 Sep 2012 03:13:20 +0000 (03:13 +0000)]
Introduce the CLRDMASK gating based on tid->clrdmask, enabling filtered
frames to occur.

* Create a new function which will set the bf_flags CLRDMASK bit
  if required.
* For raw frames, always set CLRDMASK.
* For BAR, ADDBA frames, always set CLRDMASK.
* For everything else, check if CLRDMASK needs to be set before
  calling tx_setds() or tx_setds11n().
* When unpausing a queue or drain/resetting it, set tid->clrdmask=1
  just to ensure traffic starts flowing.

What I need to do:

* Modify that function to _clear_ the CLRDMASK if it's not required,
  or retried frames may have CLRDMASK set when they don't need to.
  (Which isn't a huge deal, but..)

Whilst I'm here:

* ath_tx_normal_xmit() should really act like the AMPDU session TX
  functions - any incomplete frames will end up being assigned
  ath_tx_normal_comp() which will decrement tid->hwq_depth - but that
  won't have been incremented.

  So whilst I'm here, add a comment to do that.

* Fix the debug print function to be slightly clearer about things;
  it's not a good sign when I can't interpret my own debugging output.

I've done some testing on AR9280/AR5416/AR9160 STA and AP modes.

11 years agoAdd missing break.
glebius [Thu, 20 Sep 2012 03:09:58 +0000 (03:09 +0000)]
Add missing break.

Pointy hat to: glebius

11 years agoPlace the comment where it should be.
adrian [Thu, 20 Sep 2012 03:04:19 +0000 (03:04 +0000)]
Place the comment where it should be.

11 years agoAdd a work-around for some strange net80211 BAR races in the wireless
adrian [Thu, 20 Sep 2012 03:03:01 +0000 (03:03 +0000)]
Add a work-around for some strange net80211 BAR races in the wireless
stack.

There are unfortunately quite a few odd cases in BAR TX and BAR TX
retransmission that I haven't yet fully diagnosed.  So for now, add
this work-around so the resume() function isn't called too often,
decrementing pause to -1 (and causing things to stay paused.)

11 years agoModify the NFSv4 client so that it can handle owner
rmacklem [Thu, 20 Sep 2012 02:49:25 +0000 (02:49 +0000)]
Modify the NFSv4 client so that it can handle owner
and owner_group strings that consist entirely of
digits, interpreting them as the uid/gid number.
This change was needed since new (>= 3.3) Linux
servers reply with these strings by default.
This change is mandated by the rfc3530bis draft.
Reported on freebsd-stable@ under the Subject
heading "Problem with Linux >= 3.3 as NFSv4 server"
by Norbert Aschendorff on Aug. 20, 2012.

Tested by: norbert.aschendorff at yahoo.de
Reviewed by: jhb
MFC after: 2 weeks

11 years agoRemove the restrict qualifier to match function prototype.
kevlo [Thu, 20 Sep 2012 02:25:18 +0000 (02:25 +0000)]
Remove the restrict qualifier to match function prototype.

11 years agoMerge ACPICA 20120913.
jkim [Wed, 19 Sep 2012 23:25:24 +0000 (23:25 +0000)]
Merge ACPICA 20120913.

11 years agoAdd Intel RdRand.
obrien [Wed, 19 Sep 2012 20:42:55 +0000 (20:42 +0000)]
Add Intel RdRand.

11 years agostrsignal(): Reindent.
jilles [Wed, 19 Sep 2012 19:22:24 +0000 (19:22 +0000)]
strsignal(): Reindent.

11 years agostrsignal(): Do not append signal numbers to messages for known signals.
jilles [Wed, 19 Sep 2012 19:21:22 +0000 (19:21 +0000)]
strsignal(): Do not append signal numbers to messages for known signals.

Messages for known signals looked like "Terminated: 15" instead of
"Terminated".

11 years agoFix a panic when trying to play invalid audio tracks.
tijl [Wed, 19 Sep 2012 18:42:31 +0000 (18:42 +0000)]
Fix a panic when trying to play invalid audio tracks.

11 years agoIn nvme(4), set device description for BUS_PROBE_GENERIC case.
jimharris [Wed, 19 Sep 2012 18:25:25 +0000 (18:25 +0000)]
In nvme(4), set device description for BUS_PROBE_GENERIC case.

Reported by: jhb

11 years agoRecognise NVM Express devices and pretty-print their name.
gavin [Wed, 19 Sep 2012 18:22:14 +0000 (18:22 +0000)]
Recognise NVM Express devices and pretty-print their name.

MFC after: 1 week

11 years agoUpdate usage to show the possiblity to use jail name
bapt [Wed, 19 Sep 2012 16:28:38 +0000 (16:28 +0000)]
Update usage to show the possiblity to use jail name

Reported by: bdrewery
MFC after: 1 month

11 years agoReport nvme(4) as a generic driver for NVMe devices if PCI class, subclass
jimharris [Wed, 19 Sep 2012 16:21:23 +0000 (16:21 +0000)]
Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass
and programming interface codes match.

Sponsored by: Intel

11 years agoAllow zfs jail and zfs unjail to use both jailnames and jailid
bapt [Wed, 19 Sep 2012 16:20:49 +0000 (16:20 +0000)]
Allow zfs jail and zfs unjail to use both jailnames and jailid

Reviewed by: pjd
MFC after: 1 month

11 years agoAdd constants for programming interfaces for NVM/solid state storage
jimharris [Wed, 19 Sep 2012 15:43:30 +0000 (15:43 +0000)]
Add constants for programming interfaces for NVM/solid state storage
controller sub-class code.

Reference:  PCI Code and ID Assignment Specification Rev 1.2

Sponsored by: Intel
Inspired by: gavin
MFC after:  1 week
X-MFC-With: r240694

11 years agoAdd PCI subclass for NVM Express devices.
gavin [Wed, 19 Sep 2012 12:54:25 +0000 (12:54 +0000)]
Add PCI subclass for NVM Express devices.

Reference:
http://www.nvmexpress.org/index.php/download_file/view/42/1/NVM_Express_1_0b.pdf
section 2.1.5.

MFC after: 1 week

11 years agoSwitch some PCI register reads from using magic numbers to using the names
gavin [Wed, 19 Sep 2012 12:27:23 +0000 (12:27 +0000)]
Switch some PCI register reads from using magic numbers to using the names
defined in pcireg.h

MFC after: 1 week

11 years agoAs a followup to r234501, ensure that the native ioctl path always allocates
jhb [Wed, 19 Sep 2012 11:54:32 +0000 (11:54 +0000)]
As a followup to r234501, ensure that the native ioctl path always allocates
a 4kb buffer if a request uses a buffer size of 0.  (The Linux ioctl path
already did this.)

PR: kern/155658
Submitted by: Andreas Longwitz
MFC after: 1 week

11 years agoRegen for r240690
zeising [Wed, 19 Sep 2012 11:40:17 +0000 (11:40 +0000)]
Regen for r240690

Approved by: joel (mentor)

11 years agoAdd documentation for the WITHOUT_KDUMP switch.
zeising [Wed, 19 Sep 2012 11:38:37 +0000 (11:38 +0000)]
Add documentation for the WITHOUT_KDUMP switch.
This swtich was introduced in r240404

Approved by: joel (mentor)

11 years agoDo not install pf related man pages if WITHOUT_PF is set.
zeising [Wed, 19 Sep 2012 09:34:21 +0000 (09:34 +0000)]
Do not install pf related man pages if WITHOUT_PF is set.

PR: bin/171767
Submitted by: zeising
Approved by: joel (mentor), glebius

11 years agoDo not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD
kib [Wed, 19 Sep 2012 05:11:25 +0000 (05:11 +0000)]
Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD
for a non-absolute path.

PR: bin/171604
MFC after: 3 days

11 years agoMove major includes into /usr/share/bsdconfig for easy external access.
dteske [Tue, 18 Sep 2012 22:28:42 +0000 (22:28 +0000)]
Move major includes into /usr/share/bsdconfig for easy external access.

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

11 years agoAdd entries for two USB devices I have locally.
gavin [Tue, 18 Sep 2012 22:25:49 +0000 (22:25 +0000)]
Add entries for two USB devices I have locally.

MFC after: 1 week

11 years agoif a file in plist starts with / then do not prefix it with "prefix" [1]
bapt [Tue, 18 Sep 2012 22:09:23 +0000 (22:09 +0000)]
if a file in plist starts with / then do not prefix it with "prefix" [1]
pkg info -g returns 1 if a file mismatch [2]
flush stdout in pkg info -g [3]
clean up quiet mode (-q | --quiet) output of pkg_version(1) [4]
fix missing error call in uname check added to pkg_version(1) [5]
fix pkg_add(1) fails to install with -C from bad path [6]
only resolve path from pkg_add(1) -p if the given prefix do not start with a '/' [7]

PR: bin/13128 [1]
bin/139015 [2]
bin/113702 [3]
bin/142570 [4]
bin/146857 [5]
bin/157543 [6]
Submitted by: cy [1]
Anton Yuzhaninov <citrin@citrin.ru> [2]
Ighighi <ighighi@gmail.com> [3]
"N.J. Mann" <njm@njm.me.uk> [4]
gcooper [5]
David Naylor <naylor.b.david@gmail.com> [6]
netchild [7]
MFC after: 2 weeks

11 years agoAlign the PCI Express #defines with the style used for the PCI-X
gavin [Tue, 18 Sep 2012 22:04:59 +0000 (22:04 +0000)]
Align the PCI Express #defines with the style used for the PCI-X
#defines.  This also has the advantage that it makes the names more
compact, iand also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.

This is a mostly mechanical rename:
  s/PCIR_EXPRESS_/PCIER_/g
  s/PCIM_EXP_/PCIEM_/g
  s/PCIM_LINK_/PCIEM_LINK_/g

When this is MFC'd, #defines will be added for the old names to assist
out-of-tree drivers.

Discussed with: jhb
MFC after: 1 week

11 years agoOops - take a copy of ath_tx_status from the buffer before the TX processing
adrian [Tue, 18 Sep 2012 20:33:04 +0000 (20:33 +0000)]
Oops - take a copy of ath_tx_status from the buffer before the TX processing
is done.

The aggregate path was definitely accessing 'ts' before it was actually
being assigned.

This had the side effect of over-filtering frames, since occasionally that
bit would be '1'.

Whilst here, do the same thing in the non-aggregate completion function -
as calling the filter function may also invalidate bf.

Pointy hat to: adrian, for not noticing this over many, many code reviews.

11 years agoIf caller specifies UMA_ZONE_OFFPAGE explicitly, then do not waste memory
glebius [Tue, 18 Sep 2012 20:28:55 +0000 (20:28 +0000)]
If caller specifies UMA_ZONE_OFFPAGE explicitly, then do not waste memory
in an allocation for a slab.

Reviewed by: jeff

11 years agoAdd #if 0 around nvme_async_event_cb() until NVMe AER functionality
jimharris [Tue, 18 Sep 2012 18:23:21 +0000 (18:23 +0000)]
Add #if 0 around nvme_async_event_cb() until NVMe AER functionality
can be tested.

This fixes a build warning found only with clang.

11 years agoAdd __aligned(4) to NVMe defined data structures.
jimharris [Tue, 18 Sep 2012 18:16:52 +0000 (18:16 +0000)]
Add __aligned(4) to NVMe defined data structures.

This fixes issue in nvmecontrol(8), where clang throws a cast-align
warning when casting a __packed structure pointer to a uint32_t
pointer as part of printing raw hex output.

Reported by: dhw

11 years agoFix grammar in the portion about FIBs. Also, cross-reference
bjk [Tue, 18 Sep 2012 16:00:44 +0000 (16:00 +0000)]
Fix grammar in the portion about FIBs.  Also, cross-reference
setfib(2) instead of setfib(1) for the 16-FIB limit.

PR: docs/157452
Approved by: hrs (mentor)

11 years agoFix panics on attempt to dereference uninitizlized pointer, returned via
mav [Tue, 18 Sep 2012 15:38:42 +0000 (15:38 +0000)]
Fix panics on attempt to dereference uninitizlized pointer, returned via
'path' argument of ofw_parsedev() if devspec refers raw device with no path.

For example, `ls /pci@1f,0/ide@d/disk@0,0:a/` works fine, while
`ls /pci@1f,0/ide@d/disk@0,0:a` panicked before this change.

11 years agohwpmc amd_pcpu_fini: fix a bug in code locked under DEBUG
avg [Tue, 18 Sep 2012 13:33:39 +0000 (13:33 +0000)]
hwpmc amd_pcpu_fini: fix a bug in code locked under DEBUG

MFC after: 16 days

11 years ago- Bump date.
zont [Tue, 18 Sep 2012 13:24:14 +0000 (13:24 +0000)]
- Bump date.

Submitted by: pluknet
Approved by: kib (mentor)
X-MFC-With: r240645

11 years agoDo more than r236298 did in the projects/pf branch: use M_NOWAIT in
glebius [Tue, 18 Sep 2012 12:34:35 +0000 (12:34 +0000)]
Do more than r236298 did in the projects/pf branch: use M_NOWAIT in
altq_add() and its descendants. Currently altq(4) in FreeBSD is configured
via pf(4) ioctls, which can't configure altq(4) w/o holding locks.
Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive
NULL from malloc(9), so change is mostly mechanical. While here, utilize
M_ZERO instead of bzero().

A large redesign needed to achieve M_WAITOK usage when configuring altq(4).
Or an alternative (not pf(4)) configuration interface should be implemented.

Reported by: pluknet

11 years ago- Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.
zont [Tue, 18 Sep 2012 12:25:14 +0000 (12:25 +0000)]
- Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.

Approved by: kib (mentor)
MFC after: 1 week

11 years agoFix build, pass the pointy hat please.
glebius [Tue, 18 Sep 2012 12:21:32 +0000 (12:21 +0000)]
Fix build, pass the pointy hat please.

11 years agoProvide kernel compile time option to make pf(4) default rule to drop.
glebius [Tue, 18 Sep 2012 11:07:19 +0000 (11:07 +0000)]
Provide kernel compile time option to make pf(4) default rule to drop.

This is important to secure a small timeframe at boot time, when
network is already configured, but pf(4) is not yet.

PR: kern/171622
Submitted by: Olivier Cochard-LabbИ <olivier cochard.me>

11 years agoMake ruleset anchors in pf(4) reentrant. We've got two problems here:
glebius [Tue, 18 Sep 2012 10:54:56 +0000 (10:54 +0000)]
Make ruleset anchors in pf(4) reentrant. We've got two problems here:

1) Ruleset parser uses a global variable for anchor stack.
2) When processing a wildcard anchor, matching anchors are marked.

To fix the first one:

o Allocate anchor processing stack on stack. To make this allocation
  as small as possible, following measures taken:
  - Maximum stack size reduced from 64 to 32.
  - The struct pf_anchor_stackframe trimmed by one pointer - parent.
    We can always obtain the parent via the rule pointer.
  - When pf_test_rule() calls pf_get_translation(), the former lends
    its stack to the latter, to avoid recursive allocation 32 entries.

The second one appeared more tricky. The code, that marks anchors was
added in OpenBSD rev. 1.516 of pf.c. According to commit log, the idea
is to enable the "quick" keyword on an anchor rule. The feature isn't
documented anywhere. The most obscure part of the 1.516 was that code
examines the "match" mark on a just processed child, which couldn't be
put here by current frame. Since this wasn't documented even in the
commit message and functionality of this is not clear to me, I decided
to drop this examination for now. The rest of 1.516 is redone in a
thread safe manner - the mark isn't put on the anchor itself, but on
current stack frame. To avoid growing stack frame, we utilize LSB
from the rule pointer, relying on kernel malloc(9) returning pointer
aligned addresses.

Discussed with: dhartmei

11 years ago- Add $FreeBSD$ to allow modifications to this file.
glebius [Tue, 18 Sep 2012 10:52:46 +0000 (10:52 +0000)]
- Add $FreeBSD$ to allow modifications to this file.
- Move $OpenBSD$ to a more standard place.

11 years agoImplement my first cut at filtered frames in aggregation sessions.
adrian [Tue, 18 Sep 2012 10:14:17 +0000 (10:14 +0000)]
Implement my first cut at filtered frames in aggregation sessions.

The hardware can optionally "filter" frames if successive transmissions
to a given node (ie, "entry in the keycache") fail.  That way the hardware
can implement a kind of early abort of all the other frames queued to
that destination, rather than simply trying to TX each frame to that
destination (and failing.)

The background:

* If a frame comes back as being filtered, the hardware didn't try to
  TX it (or it was outside the TX burst opportunity.) So, take it as a hint
  that some (but not all, see below) frames to the destination may be
  filtered.

* If the CLRDMASK bit is set in a TX descriptor, the "filter to this
  destination" bit in the keycache entry is cleared and TX to that host
  will be unconditionally retried.

* Right now everything has the CLRDMASK bit set, so filtered frames
  tend to be aggregates and frames that fall outside of the WME burst
  window. It was a bit worse in the past as I had messed up the TX
  flags and CLRDMASK wasn't being set on aggregate frames.

The annoying bits:

* It's easy (ish) to do for aggregate session frames - firstly, they
  can be retried in any order as long as they're within the BAW, and
  there's already a bunch of infrastructure tracking how many frames
  the TID has queued to the hardware (tid->hwq_depth.) However, for
  frames that bypassed the software queue, hwq_depth doesn't get
  incremented. I'll fix that in a subsequent commit.

* For non-aggregate session frames, the only retries that can occur
  are ones for sequence numbers that hvaen't successfully been TXed yet.
  Since there's no re-ordering going on in non-aggregate sessions, if any
  subsequent seqno frames make it out, any filtered frames before that
  seqno need to be dropped.

  Hence why this initially is just for aggregate session frames.

* Since there may be intermediary frames to the destination that
  have CLRDMASK set - for example, any directly dispatched management
  frames to that destination - it's possible that there will be some
  filtered frames followed up by some non filtered frames.  Thus,
  it can't be assumed that once you see a filtered frame for the given
  destination node, all subsequent frames for all TIDs will be filtered.

Ok, with that in mind:

* Create a per-TID filtered frame queue for frames that the hardware
  returns as filtered.

* Track filtered frames per-tid, rather than per-node.  It just makes
  the locking much easier.

* When a filtered frame appears in the completion function, the node
  transitions to "filtered", and all subsequent completed error frames
  (filtered or otherwise) are put on the filtered frame queue.  The TID
  is paused once (during the transition from non-filtered to filtered).

* If a filtered frame retry count exceeds SWMAX_RETRIES, a BAR should be
  sent.

* Once all the frames queued to the hardware for the given filtered frame
  TID, transition back from filtered frame to non-filtered frame, which
  means pre-pending all the filtered frames onto the head of the software
  queue, clearing the filtered frame state and unpausing the TID.

Things get quite hairy around handling completion (aggr, non-aggr, norm,
direct-dispatched frames to a hardware queue); whether it's an "error",
"cleanup" or "BAR" state as well as filtered, which order to do things
in (eg do filtered BEFORE checking for BAR, as the filter completion
may be needed to actually transmit a BAR frame.)

This work has definitely reminded me that I have to tidy up all the locking
and remove some of the ridiculous lock/unlock/lock/unlock going on in the
completion functions.

It's also reminded me that I should really split out TID versus hardware TXQ
locking, even if the underlying locking is still the destination hardware TXQ.

Finally, this is all pre-requisite for working on AP mode power save support
(PS-POLL, uAPSD) as well as improving performance to misbehaving nodes (as
they can transition into filter mode, stopping any TX until everything has
caught up.)

Finally (ish) - this should also be done for non-aggregate sessions as
there are still plenty of laptops and mobile devices that don't speak
802.11n but do wish for stable, useful power save AP support where packets
aren't simply dropped.  This requires software retransmission for
non-aggregate sessions to be implemented, which includes the caveats I've
mentioned above.

Finally finally - this doesn't yet do anything about the CLRDMASK bit in the
TX descriptor.  That's still unconditionally set to 1.  I'll debug the
current work (mostly ensuring I haven't busted up the hairy transitions
between BAR, filtered, error (all frames in an aggregate failing) and
cleanup (when transitioning from aggregation -> non-aggregation.))

Finally finally finally - this is all original work by yours truely, rather
than ported from the Atheros internal driver codebase or Linux ath9k.

Tested:
 * AR9280, AR5416 in STA mode
 * AR9280, AR9130 in hostap mode
 * Lots and lots of iperf testing in very marginal and non-marginal conditions,
   complete with inducing filtered frames + BAR TX conditions.

11 years agoFix DIOCNATLOOK: zero key padding before performing lookup.
glebius [Tue, 18 Sep 2012 09:15:32 +0000 (09:15 +0000)]
Fix DIOCNATLOOK: zero key padding before performing lookup.

11 years agoloader/i386: replace ugly inb/outb re-implementations with cpufunc.h
avg [Tue, 18 Sep 2012 08:53:11 +0000 (08:53 +0000)]
loader/i386: replace ugly inb/outb re-implementations with cpufunc.h

Use of __builtin_constant_p in a function that is only called via
a pointer is a good example of how out-of-date it was.

Suggested by: bde
MFC after: 1 week

11 years agoacpi_cpu: explicitly notify userland about c-state changes
avg [Tue, 18 Sep 2012 08:17:29 +0000 (08:17 +0000)]
acpi_cpu: explicitly notify userland about c-state changes

... after they are committed.
A notification is sent per CPU.

Reviewed by: imp
MFC after: 3 weeks

11 years agomdoc: remove superfluous paragraph macro.
joel [Tue, 18 Sep 2012 08:12:28 +0000 (08:12 +0000)]
mdoc: remove superfluous paragraph macro.

11 years agozfs: correctly calculate dn_bonuslen for saving SAs to disk
avg [Tue, 18 Sep 2012 08:02:54 +0000 (08:02 +0000)]
zfs: correctly calculate dn_bonuslen for saving SAs to disk

Since all attribute values start at 8-byte aligned boundary, we would
previously incorrectly calculate dn_bonuslen if any attribute but the
last had a variable-length value with length not multiple of 8.

Reported by: Nicolas Rachinsky <fbsd-mas-0@ml.turing-complete.org>
Tested by: Nicolas Rachinsky <fbsd-mas-0@ml.turing-complete.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com> (for upstream)
MFC after: 2 weeks

11 years agozfs: allow both DEBUG and ZFS_DEBUG to be defined on command line
avg [Tue, 18 Sep 2012 08:00:56 +0000 (08:00 +0000)]
zfs: allow both DEBUG and ZFS_DEBUG to be defined on command line

Discussed with: pjd
MFC after: 10 days

11 years agoAdd missing break
kevlo [Tue, 18 Sep 2012 08:00:43 +0000 (08:00 +0000)]
Add missing break

11 years agog_disk_flushcache definitely should not be traced under G_T_TOPOLOGY
avg [Tue, 18 Sep 2012 07:57:34 +0000 (07:57 +0000)]
g_disk_flushcache definitely should not be traced under G_T_TOPOLOGY

... use G_T_BIO instead

MFC after: 1 week

11 years agoWhitespace cleanup for ipfw.8 -- start each sentence on a new line,
bjk [Tue, 18 Sep 2012 02:33:23 +0000 (02:33 +0000)]
Whitespace cleanup for ipfw.8 -- start each sentence on a new line,
and put a comma after e.g. and i.e..  While here, wrap long lines.

PR: docs/157452
Approved by: hrs (mentor)

11 years agoRemove bogus break statements.
kevlo [Tue, 18 Sep 2012 02:19:43 +0000 (02:19 +0000)]
Remove bogus break statements.

Obtained from: DragonFly

11 years agoAdd a couple of accessor inline functions for state that exists in net80211.
adrian [Tue, 18 Sep 2012 01:27:24 +0000 (01:27 +0000)]
Add a couple of accessor inline functions for state that exists in net80211.

Obtained from: Qualcomm Atheros

11 years agoRemove namespace pollution in _rmlock.h by defining rm_queue structure
attilio [Tue, 18 Sep 2012 00:43:15 +0000 (00:43 +0000)]
Remove namespace pollution in _rmlock.h by defining rm_queue structure
directly in _rmlock.h and then including it (and its dependencies)
in pcpu.h. This leads to few _*.h headers to be included in pcpu.h
but this is not considered a big deal.

Really pc_rm_queue should be implemented as a dynamic member with
DPCPU interface, but we really want to keep the read acquisition as
fast as possible, so even the further pc_dynamic indirection should be
avoided, and the pollution is dealt like this.

Discussed with: jhb
MFC after: 1 week

11 years agoRename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with
adrian [Mon, 17 Sep 2012 23:24:45 +0000 (23:24 +0000)]
Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with
internal atheros HAL code.

11 years agoyes(1) actually comes from V7.
obrien [Mon, 17 Sep 2012 23:04:15 +0000 (23:04 +0000)]
yes(1) actually comes from V7.

Submitted by: Simon Gerraty <sjg@juniper.net>

11 years agoIntegrate nvmecontrol(8) into the amd64 and i386 builds.
jimharris [Mon, 17 Sep 2012 21:41:38 +0000 (21:41 +0000)]
Integrate nvmecontrol(8) into the amd64 and i386 builds.

This includes adding NVMe header files to /usr/include/dev/nvme.

Sponsored by:  Intel

11 years agoAdd nvmecontrol(8) source code and beginnings of a man page to the tree.
jimharris [Mon, 17 Sep 2012 21:26:55 +0000 (21:26 +0000)]
Add nvmecontrol(8) source code and beginnings of a man page to the tree.

Sponsored by: Intel
Contributions from: Joe Golio/EMC <joseph dot golio at emc dot com>

11 years agoAdd nvme(4) and nvd(4) Makefiles to the tree.
jimharris [Mon, 17 Sep 2012 19:58:02 +0000 (19:58 +0000)]
Add nvme(4) and nvd(4) Makefiles to the tree.

Noticed by: pluknet
Pointy-hat to:  jimharris

11 years agoIntegrate nvme(4) and nvd(4) into the amd64 and i386 builds.
jimharris [Mon, 17 Sep 2012 19:26:33 +0000 (19:26 +0000)]
Integrate nvme(4) and nvd(4) into the amd64 and i386 builds.

Sponsored by: Intel

11 years agoThis is the first of several commits which will add NVM Express (NVMe)
jimharris [Mon, 17 Sep 2012 19:23:01 +0000 (19:23 +0000)]
This is the first of several commits which will add NVM Express (NVMe)
support to FreeBSD.  A full description of the overall functionality
being added is below.  nvmexpress.org defines NVM Express as "an optimized
register interface, command set and feature set fo PCI Express (PCIe)-based
Solid-State Drives (SSDs)."

This commit adds nvme(4) and nvd(4) driver source code and Makefiles
to the tree.

Full NVMe functionality description:
Add nvme(4) and nvd(4) drivers and nvmecontrol(8) for NVM Express (NVMe)
device support.

There will continue to be ongoing work on NVM Express support, but there
is more than enough to allow for evaluation of pre-production NVM Express
devices as well as soliciting feedback.  Questions and feedback are welcome.

nvme(4) implements NVMe hardware abstraction and is a provider of NVMe
namespaces.  The closest equivalent of an NVMe namespace is a SCSI LUN.
nvd(4) is an NVMe consumer, surfacing NVMe namespaces as GEOM disks.
nvmecontrol(8) is used for NVMe configuration and management.

The following are currently supported:
nvme(4)
- full mandatory NVM command set support
- per-CPU IO queues (enabled by default but configurable)
- per-queue sysctls for statistics and full command/completion queue
     dumps for debugging
- registration API for NVMe namespace consumers
- I/O error handling (except for timeoutsee below)
- compilation switches for support back to stable-7

nvd(4)
- BIO_DELETE and BIO_FLUSH (if supported by controller)
- proper BIO_ORDERED handling

nvmecontrol(8)
- devlist: list NVMe controllers and their namespaces
- identify: display controller or namespace identify data in
      human-readable or hex format
- perftest: quick and dirty performance test to measure raw
      performance of NVMe device without userspace/physio/GEOM
      overhead

The following are still work in progress and will be completed over the
next 3-6 months in rough priority order:
- complete man pages
- firmware download and activation
- asynchronous error requests
- command timeout error handling
- controller resets
- nvmecontrol(8) log page retrieval

This has been primarily tested on amd64, with light testing on i386.  I
would be happy to provide assistance to anyone interested in porting
this to other architectures, but am not currently planning to do this
work myself.  Big-endian and dmamap sync for command/completion queues
are the main areas that would need to be addressed.

The nvme(4) driver currently has references to Chatham, which is an
Intel-developed prototype board which is not fully spec compliant.
These references will all be removed over time.

Sponsored by:        Intel
Contributions from:  Joe Golio/EMC <joseph dot golio at emc dot com>

11 years agoAdd UQ_UMS_IGNORE quirk.
hselasky [Mon, 17 Sep 2012 19:06:35 +0000 (19:06 +0000)]
Add UQ_UMS_IGNORE quirk.
Wrap two long lines.
Some minor spelling correction.

PR: usb/171721

11 years agoImplement support for USB Audio v2.0. Remove some redundant
hselasky [Mon, 17 Sep 2012 15:43:57 +0000 (15:43 +0000)]
Implement support for USB Audio v2.0. Remove some redundant
USB audio v1.0 debug data, hence userspace tools like lsusb
exist to show this information properly.

11 years agoAdd locking to mlx(4) to make it MPSAFE along with some other fixes:
jhb [Mon, 17 Sep 2012 15:27:30 +0000 (15:27 +0000)]
Add locking to mlx(4) to make it MPSAFE along with some other fixes:
- Use callout(9) rather than timeout(9).
- Add a mutex as an I/O lock that protects the adapter and is used
  for the I/O path.
- Add an sx lock as a configuration lock that protects the relationship
  of configured volumes.
- Freeze the request queue when a DMA load is deferred with EINPROGRESS
  and unfreeze the queue when the DMA callback is invoked.
- Explicitly poll the hardware while waiting to submit a command to
  allow completed commands to free up slots in the command ring.
- Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines.
  That state should be per-controller instead.  Add it as an argument
  since the first caller knows when it is the first caller.
- Remove explicit bus_space tag/handle and use bus_*() rather than
  bus_space_*().
- Move duplicated PCI device ID probing into a  mlx_pci_match() routine.
- Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when
  allocating the resource) and use pci_enable_busmaster() rather than
  manipulating the register directly.

Tested by: no one despite multiple requests (hope it works)

11 years agoMake systat(1) accept fractional number of seconds.
melifaro [Mon, 17 Sep 2012 13:36:47 +0000 (13:36 +0000)]
Make systat(1) accept fractional number of seconds.
Make old alarm(3)-based code use select(2).

MFC after: 2 weeks

11 years ago- Add #defines for the bits within the iPCI Express PCIR_EXPRESS_LINK_CTL
gavin [Mon, 17 Sep 2012 12:51:48 +0000 (12:51 +0000)]
- Add #defines for the bits within the iPCI Express PCIR_EXPRESS_LINK_CTL
  register
- Add missing register PCIR_EXPRESS_ROOT_CAP
- Correct a spelling mistake (SLAT -> SLOT) [1]

Reviewed by: jhb [1]

11 years agoRemove unused variable cd.
kevlo [Mon, 17 Sep 2012 09:32:11 +0000 (09:32 +0000)]
Remove unused variable cd.
This variable is initialized but not used.

11 years agoAdd a kernel config for the Toshiba AC100. The AC100 is an ARM laptop with
andrew [Mon, 17 Sep 2012 09:22:59 +0000 (09:22 +0000)]
Add a kernel config for the Toshiba AC100. The AC100 is an ARM laptop with
an NVidia Tegra 2 CPU.

Tegra 2 needs an external patch to pmap for atomic operations to work. Even
with this the Kernel only gets to the mount root prompt. As such Tegra
support is considered experimental, however adding the kernel config will
help ensure the Tegra code builds.

11 years agoIn snmp_hostres, device_map table is used for consistent device table
trociny [Mon, 17 Sep 2012 07:32:53 +0000 (07:32 +0000)]
In snmp_hostres, device_map table is used for consistent device table
indexing. When a device has gone it is not removed from device_map
table but just its entry_p field is set to NULL.

So when traversing device_map in disk_OS_get_ATA_disks() and
disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the
bsnmpd crash is possible when a removed map entry is dereferenced.

Before the fix, for disk_OS_get_ATA_disks() the crash could be easily
reproduced running:

  atacontrol detach ata1

The crash was not observed in disk_OS_get_MD_disks() because currently
snmp_hostres does no see md(4) disks: to get the device list it uses
devinfo(3), which does not return md devices.

Reported by: Miroslav Lachman 000.fbsd quip.cz
MFC after: 1 week

11 years agoAdd the Tegra2 DTS files. Now our dtc supports including other files use
andrew [Mon, 17 Sep 2012 07:14:07 +0000 (07:14 +0000)]
Add the Tegra2 DTS files. Now our dtc supports including other files use
this support to pull out the SoC specific parts of the dts file.

11 years agoTake credit for the work I've done in this source file.
adrian [Mon, 17 Sep 2012 03:17:42 +0000 (03:17 +0000)]
Take credit for the work I've done in this source file.

11 years agoMinor correction.
mjacob [Mon, 17 Sep 2012 02:50:16 +0000 (02:50 +0000)]
Minor correction.

MFC after: 1 day

11 years agoAdd some edits to the changed comments so that they make more sense.
mjacob [Mon, 17 Sep 2012 02:49:02 +0000 (02:49 +0000)]
Add some edits to the changed comments so that they make more sense.

MFC after: 1 day

11 years agoUpdate release(7) to reflect changes from r240586 and r240587:
gjb [Mon, 17 Sep 2012 02:45:52 +0000 (02:45 +0000)]
Update release(7) to reflect changes from r240586 and r240587:

 - Remove cvs(1) references.
 - Remove CVS* environment references.
 - Add default entries for the default SVNROOT for the Ports
   Collection, and Documentation Project.
 - While here, update 'SGML-based documentation' to 'XML-based',
   since the recent SGML->XML conversion.
 - Update an example providing SVNROOT environment usage.

Reminded by: nwhitehorn
MFC After: 1 week
X-MFC-With: r240586, r240587

11 years agoUpdate usage() in comment section.
gjb [Mon, 17 Sep 2012 02:35:00 +0000 (02:35 +0000)]
Update usage() in comment section.
Remove CVS_* variables in comments.

MFC after: 1 week
X-MFC-With: r240586

11 years agoUpdate generate-release.sh script:
gjb [Mon, 17 Sep 2012 02:23:03 +0000 (02:23 +0000)]
Update generate-release.sh script:

 - Use svn for ports and doc trees
 - When installing a binary textproc/docproj package,
   switch pkg_add(1) to pkg(8) [1]

Reviewed by: nwhitehorn
Approved by: nwhitehorn
Enhanced by: glebius [1]
MFC After: 1 week
X-MFC-To: 9-only

11 years agoAdd a per-TID filter queue and filter state bits.
adrian [Mon, 17 Sep 2012 01:21:55 +0000 (01:21 +0000)]
Add a per-TID filter queue and filter state bits.

These are intended for software TX filtering support, where the NIC
decides there has been too many successive failues to a destination
and will filter it.

Although the filtering is done per-destination (via the keycache),
the state and queue is kept per-TID for now.  It simplifies the overall
architecture design and locking.

Whilst here, add ATH_TID_UNLOCK_ASSERT().

11 years agoAdd a debug bit for TX destination filtering.
adrian [Mon, 17 Sep 2012 01:18:47 +0000 (01:18 +0000)]
Add a debug bit for TX destination filtering.

11 years agoImprove performance of the Sample rate algorithm on 802.11n networks.
adrian [Mon, 17 Sep 2012 01:09:17 +0000 (01:09 +0000)]
Improve performance of the Sample rate algorithm on 802.11n networks.

* Don't treat high percentage failures as "sucessive failures" - high
  MCS rates are very picky and will quite happily "fade" from low
  to high failure % and back again within a few seconds.  If they really
  don't work, the aggregate will just plain fail.

* Only sample MCS rates +/- 3 from the current MCS.  Sample will back off
  quite quickly, so there's no need to sample _all_ MCS rates between
  a high MCS rate and MCS0; there may be a lot of them.

* Modify the smoothing rate to be 75% rather than 95% - it's more adaptive
  but it comes with a cost of being slightly less stable at times.
  A per-node, hysterisis behaviour would be nicer.

11 years agoRemove references to userstat(1) and jailstat(1). Those tools were never
trasz [Sun, 16 Sep 2012 23:25:13 +0000 (23:25 +0000)]
Remove references to userstat(1) and jailstat(1).  Those tools were never
merged from the Perforce branch.  They might be brought in when %CPU limits
go into the tree.

PR: docs/171240
MFC after: 2 weeks