]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agosh: Don't modify exit status when break/continue/return passes !.
Jilles Tjoelker [Fri, 12 Apr 2013 15:19:35 +0000 (15:19 +0000)]
sh: Don't modify exit status when break/continue/return passes !.

This matches what would happen if  ! P  were to be replaced with
if P; then false; else true; fi.

Example:
  f() { ! return 0; }; f

11 years ago- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
Pietro Cerutti [Fri, 12 Apr 2013 14:32:16 +0000 (14:32 +0000)]
- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
  happens if another atrm process removes a job while we're scanning through
  the directory.
- While at it, optimize a bit the directory scanning, so that we quit looping
  as soon as all jobs specified in argv have been dealt with.

Approved by: cognet

11 years ago- Switch order of setting real uid and gid. If we set uid first, then we
Pietro Cerutti [Fri, 12 Apr 2013 14:19:44 +0000 (14:19 +0000)]
- Switch order of setting real uid and gid. If we set uid first, then we
  don't have enough privileges to set gid.

  This looks like a long standing bug, just recently revealed by r241852.

Approved by: cognet

11 years agoisa_if.h is indirectly included.
Bjoern A. Zeeb [Fri, 12 Apr 2013 13:56:21 +0000 (13:56 +0000)]
isa_if.h is indirectly included.
Depend on it to unbreak pc98 builds.

11 years agoAttempt to clean up spacing and long lines.
Gleb Smirnoff [Fri, 12 Apr 2013 08:52:19 +0000 (08:52 +0000)]
Attempt to clean up spacing and long lines.

11 years agoUpdate with several early mentor/mentee relationships and dates commit
Gavin Atkinson [Fri, 12 Apr 2013 08:39:18 +0000 (08:39 +0000)]
Update with several early mentor/mentee relationships and dates commit
bits were granted.  Relationships have been provided by the mentees,
dates have been sourced from either the mentees or the CVS mailing list
archives.

Obtained from: mux, wilko, msmith, peter, schweikh
Obtained from: gallatin, dfr, murray, jkoshy

11 years agoFree memory after deleting an address policy entry.
Andrey V. Elsukov [Fri, 12 Apr 2013 07:59:54 +0000 (07:59 +0000)]
Free memory after deleting an address policy entry.

MFC after: 1 week

11 years agoFix a few typos.
Xin LI [Fri, 12 Apr 2013 02:01:17 +0000 (02:01 +0000)]
Fix a few typos.

Reviewed by: gjb
MFC after: 3 days

11 years agoIf vmm.ko could not be initialized correctly then prevent the creation of
Neel Natu [Fri, 12 Apr 2013 01:16:52 +0000 (01:16 +0000)]
If vmm.ko could not be initialized correctly then prevent the creation of
virtual machines subsequently.

Submitted by: Chris Torek

11 years agoIf doing buildworld -DWITH_BMAKE make sure bmake does the build.
Simon J. Gerraty [Fri, 12 Apr 2013 00:34:19 +0000 (00:34 +0000)]
If doing buildworld -DWITH_BMAKE make sure bmake does the build.

11 years agoAdd pciids of the T5 based cards. The ones that I haven't tested with
Navdeep Parhar [Thu, 11 Apr 2013 23:40:05 +0000 (23:40 +0000)]
Add pciids of the T5 based cards.  The ones that I haven't tested with
cxgbe(4) are disabled for now.  This will change.

MFC after: 2 weeks

11 years agoCosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/).
Navdeep Parhar [Thu, 11 Apr 2013 22:49:29 +0000 (22:49 +0000)]
Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/).

MFC after: 3 days.

11 years agoAuto-reduce the holdoff timers that are greater than the maximum value
Navdeep Parhar [Thu, 11 Apr 2013 22:46:39 +0000 (22:46 +0000)]
Auto-reduce the holdoff timers that are greater than the maximum value
allowed by the hardware.

MFC after: 3 days

11 years agoGenerate a LINT for powerpc and for powerpc64.
Bjoern A. Zeeb [Thu, 11 Apr 2013 22:18:20 +0000 (22:18 +0000)]
Generate a LINT for powerpc and for powerpc64.

Discussed with: nwhitehorn

11 years agoAlways enable TXOK interrupts when setting up TX queues for EDMA NICs.
Adrian Chadd [Thu, 11 Apr 2013 22:02:35 +0000 (22:02 +0000)]
Always enable TXOK interrupts when setting up TX queues for EDMA NICs.

11 years agocxgbe/tom: Slight simplification of code that calculates options2.
Navdeep Parhar [Thu, 11 Apr 2013 21:36:01 +0000 (21:36 +0000)]
cxgbe/tom: Slight simplification of code that calculates options2.

MFC after: 3 days

11 years agoFix bugs in the elapsed time calculation in ctlstat_standard()
Kenneth D. Merry [Thu, 11 Apr 2013 21:18:04 +0000 (21:18 +0000)]
Fix bugs in the elapsed time calculation in ctlstat_standard()
pointed out by bde:

- Casting to long double isn't needed.
- The division isn't needed, multiplication can be used.
  "When 1 nanosecond is in a floating point literal, the whole
  expression is automatically promoted correctly."
- non-KNF indentation (1 tab) for the newly split line
- different non-KNF indentation (5 spaces) for the previously split
  line
- exessive parentheses around the division operation
- bogus blank line which splits up the etime initialization
- general verboseness from the above.

Submitted by: bde
MFC after: 3 days

11 years agoGet rid of a couple of stray \n's.
Navdeep Parhar [Thu, 11 Apr 2013 21:17:49 +0000 (21:17 +0000)]
Get rid of a couple of stray \n's.

MFC after: 3 days.

11 years agoThere is no need for elaborate queries and error checking when trying to
Navdeep Parhar [Thu, 11 Apr 2013 21:15:35 +0000 (21:15 +0000)]
There is no need for elaborate queries and error checking when trying to
set FW4MSG_ENCAP.

MFC after: 3 days

11 years agoSpelling correction
Ed Maste [Thu, 11 Apr 2013 20:15:37 +0000 (20:15 +0000)]
Spelling correction

11 years agoDocument sbuf_start_section() and sbuf_end_section() functions.
Mikolaj Golub [Thu, 11 Apr 2013 19:51:53 +0000 (19:51 +0000)]
Document sbuf_start_section() and sbuf_end_section() functions.

MFC after: 1 month

11 years agoAdd sbuf_start_section and sbuf_end_section to the libsbuf symbol map.
Mikolaj Golub [Thu, 11 Apr 2013 19:50:10 +0000 (19:50 +0000)]
Add sbuf_start_section and sbuf_end_section to the libsbuf symbol map.

MFC after: 1 month

11 years agoAdd sbuf_start_section() and sbuf_end_section() functions, which can
Mikolaj Golub [Thu, 11 Apr 2013 19:49:18 +0000 (19:49 +0000)]
Add sbuf_start_section() and sbuf_end_section() functions, which can
be used for automatic section alignment.

Discussed with: kib
Reviewed by: kib
MFC after: 1 month

11 years ago- Explain clearly why a different firmware is being installed (if/when
Navdeep Parhar [Thu, 11 Apr 2013 19:39:40 +0000 (19:39 +0000)]
- Explain clearly why a different firmware is being installed (if/when
  it is being installed).  Improve other error messages while here.

- Select special FPGA specific configuration profile when appropriate.

MFC after: 3 days

11 years agoMinor spelling and grammar fixes.
Joel Dahl [Thu, 11 Apr 2013 19:05:24 +0000 (19:05 +0000)]
Minor spelling and grammar fixes.

11 years agoRemove contractions.
Joel Dahl [Thu, 11 Apr 2013 18:46:41 +0000 (18:46 +0000)]
Remove contractions.

11 years agoFix tcp_output() so that tcpcb is updated in the same manner when an
Gleb Smirnoff [Thu, 11 Apr 2013 18:23:56 +0000 (18:23 +0000)]
Fix tcp_output() so that tcpcb is updated in the same manner when an
mbuf allocation fails, as in a case when ip_output() returns error.

To achieve that, move large block of code that updates tcpcb below
the out: label.

This fixes a panic, that requires the following sequence to happen:

1) The SYN was sent to the network, tp->snd_nxt = iss + 1, tp->snd_una = iss
2) The retransmit timeout happened for the SYN we had sent,
   tcp_timer_rexmt() sets tp->snd_nxt = tp->snd_una, and calls tcp_output().
   In tcp_output m_get() fails.
3) Later on the SYN|ACK for the SYN sent in step 1) came,
   tcp_input sets tp->snd_una += 1, which leads to
   tp->snd_una > tp->snd_nxt inconsistency, that later panics in
   socket buffer code.

For reference, this bug fixed in DragonflyBSD repo:

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ff9b7d322dc5a26f7173aa8c38ecb79da80e419

Reviewed by: andre
Tested by: pho
Sponsored by: Nginx, Inc.
PR: kern/177456
Submitted by: HouYeFei&XiBoLiu <lglion718 163.com>

11 years agoRemove kernel options from the SYNOPSIS. They are already documented in the
Joel Dahl [Thu, 11 Apr 2013 18:02:42 +0000 (18:02 +0000)]
Remove kernel options from the SYNOPSIS. They are already documented in the
geom(4) manual page SYNOPSIS.

11 years agocxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or
Navdeep Parhar [Thu, 11 Apr 2013 17:50:50 +0000 (17:50 +0000)]
cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or
t5nex attach to their devices.

MFC after: 3 days

11 years ago- Add entries for alc and akoszek, alredy referenced elsewhere
Gavin Atkinson [Thu, 11 Apr 2013 17:16:08 +0000 (17:16 +0000)]
- Add entries for alc and akoszek, alredy referenced elsewhere
- Add phk -> mux relationship, confirmed by mux@
- Add scottl -> sbruno relationship
- Move four ex-committers to the alumni section
- Sort.

11 years agoSet and display the IP fragment bit correctly when dealing with
Navdeep Parhar [Thu, 11 Apr 2013 16:50:58 +0000 (16:50 +0000)]
Set and display the IP fragment bit correctly when dealing with
the filter mode.

MFC after: 3 days.

11 years agoDTrace: option for time-ordered output
Pedro F. Giffuni [Thu, 11 Apr 2013 16:24:36 +0000 (16:24 +0000)]
DTrace: option for time-ordered output

Merge changes from illumos:

3021 option for time-ordered output from dtrace(1M)
3022 DTrace: keys should not affect the sort order when sorting by value
3023 it should be possible to dereference dynamic variables
3024 D integer narrowing needs some work
3025 register leak in D code generation
3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider

This brings yet another feature implemented in upstream DTrace.
A complete description is available here:
http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/

This change bumps the DT_VERS_* number to 1.9.1 in
accordance to what is done in illumos.

This change was somewhat complicated because upstream is mixed many
changes in an individual commit and some of the tests don't really
apply to us.

There are also appear to be differences in timestamping with Solaris
so we had to workaround some assertions making sure no regression
happened.

Special thanks to Fabian Keil for changes and testing.

Illumos Revisions: 13758:23432da34147

Reference:
https://www.illumos.org/issues/3021
https://www.illumos.org/issues/3022
https://www.illumos.org/issues/3023
https://www.illumos.org/issues/3024
https://www.illumos.org/issues/3025
https://www.illumos.org/issues/1694

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 1 months

11 years agoRemove EOL whitespace.
Joel Dahl [Thu, 11 Apr 2013 13:05:38 +0000 (13:05 +0000)]
Remove EOL whitespace.

11 years agoRemove unused atomic header
Ed Maste [Thu, 11 Apr 2013 12:49:42 +0000 (12:49 +0000)]
Remove unused atomic header

11 years agofuser(1) requires a filename.
Eitan Adler [Thu, 11 Apr 2013 12:24:29 +0000 (12:24 +0000)]
fuser(1) requires a filename.

Reviewed by: lstewart
Approved by: bcr (mentor)
MFC after: 3 days

11 years agoFix typo.
Gleb Smirnoff [Thu, 11 Apr 2013 10:14:28 +0000 (10:14 +0000)]
Fix typo.

11 years agoFix libzfs to report error instead of returning zero if trying to hold or
Martin Matuska [Thu, 11 Apr 2013 07:49:16 +0000 (07:49 +0000)]
Fix libzfs to report error instead of returning zero if trying to hold or
release a non-existing snapshot of a existing dataset. In recursive case
error is reported if no snapshots with the requested name have been found.

Problem and proposed solution reported to illumos:
  3699 zfs hold or release of a non-existent snapshot does not output error

MFC after: 8 days

11 years agoMFV r249354:
Martin Matuska [Thu, 11 Apr 2013 07:40:30 +0000 (07:40 +0000)]
MFV r249354:
Merge bugfixes accepted and integrated by vendor. Underlying problems
have been reported by us and fixed in r240942 and r249196.

Illumos ZFS issues:
  3645 dmu_send_impl: possibilty of pool hold leak
  3692 Panic on zfs receive of a recursive deduplicated stream

MFC after: 8 days

11 years agoInclude types.h for C99 uintXX_t types.
Gleb Smirnoff [Thu, 11 Apr 2013 07:30:49 +0000 (07:30 +0000)]
Include types.h for C99 uintXX_t types.

11 years agoUpdate vendor-sys/illumos/dist to illumos-gate 14008:0a1a841641da
Martin Matuska [Thu, 11 Apr 2013 07:02:27 +0000 (07:02 +0000)]
Update vendor-sys/illumos/dist to illumos-gate 14008:0a1a841641da

Illumos ZFS issues:
  3645 dmu_send_impl: possibilty of pool hold leak
  3692 Panic on zfs receive of a recursive deduplicated stream

11 years agoDo not sent 120 TEST UNIT READY requests on generic NOT READY statuses.
Alexander Motin [Thu, 11 Apr 2013 06:34:41 +0000 (06:34 +0000)]
Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses.

Some failing disks tend to return vendor-specific ASC/ASCQ codes with
NOT READY sense key.  It caused extremely long recovery attempts, repeating
these 120 TURs (it takes at least 1 minute) for every I/O request.
Instead of that use default error handling, doing just few retries.

Reviewed by: ken, gibbs
MFC after: 1 month

11 years agoMake the code to check if VMX is enabled more readable by using macros
Neel Natu [Thu, 11 Apr 2013 04:29:45 +0000 (04:29 +0000)]
Make the code to check if VMX is enabled more readable by using macros
instead of magic numbers.

Discussed with: Chris Torek

11 years agoUpdate ciss(4) man page. We absolutely support performant mode of operation
Sean Bruno [Wed, 10 Apr 2013 23:37:15 +0000 (23:37 +0000)]
Update ciss(4) man page.  We absolutely support performant mode of operation
on this controller.  Indicate that the 5300 is the *only* controller that
will only work in simple mode.

Bus rescans should not be needed now and I consider it a bug if disks do
not appear or dissapear when created or destroyed.

Obtained from: Yahoo! Inc

11 years agoWhile investigating a p/r I noted that the camcontrol devlist output for
Sean Bruno [Wed, 10 Apr 2013 23:31:19 +0000 (23:31 +0000)]
While investigating a p/r I noted that the camcontrol devlist output for
volumes behind a ciss(4) controller were being reported with malformeed
names and identifiers.

Repair that reporting by using the CAM values for the three SCSI indents
reported via camcontrol devlist

PR: kern/171650
Reviewed by: scottl
Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agooptions DPT_HANDLE_TIMEOUTS hasn't worked since dpt(4) was converted to CAM
Sean Bruno [Wed, 10 Apr 2013 23:20:09 +0000 (23:20 +0000)]
options DPT_HANDLE_TIMEOUTS hasn't worked since dpt(4) was converted to CAM
somewhere around svn r39402 to r39234.

I don't know of anyone who really wants to test these changes, but they
only remove the deprecated code in question.  This shreds the driver down a
bit and *removes* options from the kernel configs.

These don't appear to be referenced in the man page, so no need to check it
there.

PR: kern/44587
Obtained from: Yahoo! Inc.
MFC after: 2 weeks

11 years agoAdd a callback to the ada(4) driver so that it knows when GEOM has released
Kenneth D. Merry [Wed, 10 Apr 2013 22:12:21 +0000 (22:12 +0000)]
Add a callback to the ada(4) driver so that it knows when GEOM has released
references to it.

This is the functional equivalent to change r237518, which added this
functionality to the cd(4) and da(4) drivers.

This fix prevents a panic caused by GEOM calling adaopen() while the device
is going away.  We now keep the device around until GEOM has finished
cleaning up its state.

ata_da.c: In adaregister(), add a d_gone callback to the GEOM disk
structure registered for the ada driver.  Increment the
peripheral reference count for GEOM.

Add a new callback, adadiskgonecb(), that GEOM calls when
it is done with its resources.  This callback releases the
reference acquired in adaregister().

Submitted by: Po-Li Soong
Sponsored by: Spectra Logic
MFC After: 5 days

11 years agoCreate controller-level DMA tag, handling range of supported addresses.
Alexander Motin [Wed, 10 Apr 2013 20:38:15 +0000 (20:38 +0000)]
Create controller-level DMA tag, handling range of supported addresses.
That simplifies logic for channels and gives the bus information about what
device actually allocated the tag.

Submitted by: jhb@

11 years agoUse kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat from
Gleb Smirnoff [Wed, 10 Apr 2013 20:29:23 +0000 (20:29 +0000)]
Use kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat from
kernel core files.

Sponsored by: Nginx, Inc.

11 years agoo Provide function kvm_read_zpcpu() to access UMA_ZONE_PCPU allocations.
Gleb Smirnoff [Wed, 10 Apr 2013 20:26:53 +0000 (20:26 +0000)]
o Provide function kvm_read_zpcpu() to access UMA_ZONE_PCPU allocations.
o Provide function kvm_counter_u64_fetch() to fetch valut of a counter(9).

Sponsored by: Nginx, Inc.

11 years agoNeed to call init_mem() to really initialize the MMIO range lookups.
Neel Natu [Wed, 10 Apr 2013 18:59:20 +0000 (18:59 +0000)]
Need to call init_mem() to really initialize the MMIO range lookups.

This was working by accident because:
- the RB_HEADs were being initialized to zero as part of BSS
- the pthread_rwlock functions were implicitly initializing the lock object

Obtained from: NetApp

11 years agoRemove obsolete comment about lack of locking for MMIO range lookup.
Neel Natu [Wed, 10 Apr 2013 18:53:14 +0000 (18:53 +0000)]
Remove obsolete comment about lack of locking for MMIO range lookup.

Pointed out by: Tycho Nightingale (tycho.nightingale@plurisbusnetworks.com)

11 years agoSimplify allocate_legacy code, txr pointer was breaking LEGACY compile,
Jack F Vogel [Wed, 10 Apr 2013 17:51:39 +0000 (17:51 +0000)]
Simplify allocate_legacy code, txr pointer was breaking LEGACY compile,
thanks to Nick Rogers for pointing this out.

11 years agoAdd ID for ASMedia ASM1042 USB 3.0 controller.
Alexander Motin [Wed, 10 Apr 2013 17:43:20 +0000 (17:43 +0000)]
Add ID for ASMedia ASM1042 USB 3.0 controller.

MFC after: 1 week

11 years agoSince UMA_ZONE_PCPU zones put a constraint on sizeof(struct pcpu), declared
Gleb Smirnoff [Wed, 10 Apr 2013 16:09:45 +0000 (16:09 +0000)]
Since UMA_ZONE_PCPU zones put a constraint on sizeof(struct pcpu), declared
as CTASSERT in MI pcpu.h, stop including all possible mutually exclusive
PCPU_MD_FIELDS fields into LINT kernels, due to brekaing
aforementioned CTASSERT.

11 years agoFix a time calculation error in ctlstat_standard().
Kenneth D. Merry [Wed, 10 Apr 2013 16:01:45 +0000 (16:01 +0000)]
Fix a time calculation error in ctlstat_standard().

ctlstat.c: When converting a timeval to a floating point
number in ctlstat_standard(), cast the nanoseconds
calculation to a long double, so we don't lose
precision.  Without the cast, we wind up with a
time in whole seconds only.

Sponsored by: Spectra Logic
MFC after: 3 days

11 years agoRemove the number of addresses restriction from sctp_connectx().
Michael Tuexen [Wed, 10 Apr 2013 11:26:30 +0000 (11:26 +0000)]
Remove the number of addresses restriction from sctp_connectx().
Remove unused code.
While there, do some cleanup of the code.

MFC after: 1 week

11 years agoUpdate vendor/illumos/dist and vendor-sys/illumos/dist
Martin Matuska [Wed, 10 Apr 2013 10:29:30 +0000 (10:29 +0000)]
Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 14005:55fc53126003

Illumos ZFS issues:
  3654 zdb should print number of ganged blocks
  3656 remove unused function zap_cursor_move_to_key()

11 years agoMake ctladm(8) try to load ctl.ko kernel module if needed.
Edward Tomasz Napierala [Wed, 10 Apr 2013 08:48:10 +0000 (08:48 +0000)]
Make ctladm(8) try to load ctl.ko kernel module if needed.

Reviewed by: ken

11 years agoFix build.
Gleb Smirnoff [Wed, 10 Apr 2013 08:09:25 +0000 (08:09 +0000)]
Fix build.

11 years agoCast to (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd
Martin Matuska [Wed, 10 Apr 2013 07:01:17 +0000 (07:01 +0000)]
Cast to (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd

MFC after: 9 days

11 years agoUnsynchronized TSCs on the host require special handling in bhyve:
Neel Natu [Wed, 10 Apr 2013 05:59:07 +0000 (05:59 +0000)]
Unsynchronized TSCs on the host require special handling in bhyve:

- use clock_gettime(2) as the time base for the emulated ACPI timer instead
  of directly using rdtsc().

- don't advertise the invariant TSC capability to the guest to discourage it
  from using the TSC as its time base.

Discussed with: jhb@ (about making 'smp_tsc' a global)
Reported by: Dan Mack on freebsd-virtualization@
Obtained from: NetApp

11 years agoswapcontext wrapper can not be implemented in C, the stack pointer saved in
David Xu [Wed, 10 Apr 2013 02:40:03 +0000 (02:40 +0000)]
swapcontext wrapper can not be implemented in C, the stack pointer saved in
the context becomes invalid when the function returns, same as setjmp,
it must be implemented in assemble language, see discussions in PR
misc/177624.

11 years agoChange name of variable from 'rwlock' to more descriptive 'mmio_rwlock'
Neel Natu [Wed, 10 Apr 2013 02:18:17 +0000 (02:18 +0000)]
Change name of variable from 'rwlock' to more descriptive 'mmio_rwlock'

Requested by: grehan
Obtained from: NetApp

11 years agoImprove PCI BAR emulation:
Neel Natu [Wed, 10 Apr 2013 02:12:39 +0000 (02:12 +0000)]
Improve PCI BAR emulation:
- Respect the MEMEN and PORTEN bits in the command register
- Allow the guest to reprogram the address decoded by the BAR

Submitted by: Gopakumar T
Obtained from: NetApp

11 years agoFix the build.
Jim Harris [Wed, 10 Apr 2013 00:35:08 +0000 (00:35 +0000)]
Fix the build.

11 years agoZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl()
Martin Matuska [Tue, 9 Apr 2013 22:27:44 +0000 (22:27 +0000)]
ZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl()
doesn't copyout in this case.

To solve this issue a new struct zfs_iocparm_t is introduced consisting of:
- zfs_ioctl_version (future backwards compatibility purposes)
- user space pointer to zfs_cmd_t (copyin and copyout)
- size of zfs_cmd_t (verification purposes)

The copyin and copyout of zfs_cmd_t is now done the illumos (vendor) way
what makes porting of new changes easier and ensures correct behavior if
returning an error.

MFC after: 10 days

11 years agoChange certain heavily used network related mutexes and rwlocks to
Andre Oppermann [Tue, 9 Apr 2013 21:02:20 +0000 (21:02 +0000)]
Change certain heavily used network related mutexes and rwlocks to
reside on their own cache line to prevent false sharing with other
nearby structures, especially for those in the .bss segment.

NB: Those mutexes and rwlocks with variables next to them that get
changed on every invocation do not benefit from their own cache line.
Actually it may be net negative because two cache misses would be
incurred in those cases.

11 years agoFix a race condition on tcp listen socket teardown with pending
Andre Oppermann [Tue, 9 Apr 2013 20:52:26 +0000 (20:52 +0000)]
Fix a race condition on tcp listen socket teardown with pending
connections in the accept queue and contiguous new incoming SYNs.

Compared to the original submitters patch I've moved the test
next to the SYN handling to have it together in a logical unit
and reworded the comment explaining the issue.

Submitted by: Matt Miller <matt@matthewjmiller.net>
Submitted by: Juan Mojica <jmojica@gmail.com>
Reviewed by: Matt Miller (changes)
Tested by: pho
MFC after: 1 week

11 years agoEnsure make -j N universe works correctly, by checking for an up-to-date
Dimitry Andric [Tue, 9 Apr 2013 20:21:35 +0000 (20:21 +0000)]
Ensure make -j N universe works correctly, by checking for an up-to-date
make before starting the universe targets themselves.  Otherwise, all of
the targets would attempt to build make simultaneously, overwriting each
other's copies of the make object files and executable.  This could lead
to strange errors, for example when partially-written make executables
are invoked.

Also amend r216620, to make the rest of universe wait properly until the
upgrade_checks target is finished, by adding universe_${target}_prologue
to the .ORDER target.  Otherwise, make will be too smart for its own
good, and start building the universe targets simultaneously with the
prologues anyway.

MFC after: 1 week

11 years agoProxy allocation requests for the PCI ROM BAR from child devices similar
John Baldwin [Tue, 9 Apr 2013 19:36:34 +0000 (19:36 +0000)]
Proxy allocation requests for the PCI ROM BAR from child devices similar
to how the VGA bus driver currently proxies allocation requests for other
PCI BARs.

MFC after: 1 week

11 years agoPass the segmented address of the counter, based on %fs, i.e. offset
Konstantin Belousov [Tue, 9 Apr 2013 17:55:39 +0000 (17:55 +0000)]
Pass the segmented address of the counter, based on %fs, i.e. offset
from the pcpu[0] to the counter base, instead of the linear address.

11 years agoConvert UMA code to C99 uintXX_t types.
Gleb Smirnoff [Tue, 9 Apr 2013 17:43:48 +0000 (17:43 +0000)]
Convert UMA code to C99 uintXX_t types.

11 years agoSwap us_freecount and us_flags, achieving same structure size
Gleb Smirnoff [Tue, 9 Apr 2013 17:25:15 +0000 (17:25 +0000)]
Swap us_freecount and us_flags, achieving same structure size
as before previous commit.

Submitted by: alc

11 years agoAdd static/const keywords to the arrays.
Ed Schouten [Tue, 9 Apr 2013 16:16:34 +0000 (16:16 +0000)]
Add static/const keywords to the arrays.

This theoretically allows a compiler to optimize (parts of) the array
away if unused.

While there, make the array size implicit and use a _Static_assert() to
ensure that the definition matches up with the number of elements in the
list.

11 years agoSince now we support 256 items per slab, we need more bits
Gleb Smirnoff [Tue, 9 Apr 2013 15:15:52 +0000 (15:15 +0000)]
Since now we support 256 items per slab, we need more bits
for us_freecount.

This grows uma_slab_head on 32-bit arches, but growth isn't
significant. Taking kmem zones as example, only the 32 byte
zone is affected, ipers is reduced from 113 to 112.

In collaboration with: kib

11 years agoLast remaining prototype issue that still hasn't been fixed upstream.
Dag-Erling Smørgrav [Tue, 9 Apr 2013 13:16:11 +0000 (13:16 +0000)]
Last remaining prototype issue that still hasn't been fixed upstream.

11 years agoRevert local changes and pull in r3828 from upstream.
Dag-Erling Smørgrav [Tue, 9 Apr 2013 13:14:39 +0000 (13:14 +0000)]
Revert local changes and pull in r3828 from upstream.

11 years agoPull in r3828 from upstream (remove dead code, fix prototypes)
Dag-Erling Smørgrav [Tue, 9 Apr 2013 13:08:33 +0000 (13:08 +0000)]
Pull in r3828 from upstream (remove dead code, fix prototypes)

11 years agoFix KASSERTs: maximum number of items per slab is 256.
Gleb Smirnoff [Tue, 9 Apr 2013 12:20:44 +0000 (12:20 +0000)]
Fix KASSERTs: maximum number of items per slab is 256.

11 years agoFix build for AIM 64bit.
Konstantin Belousov [Tue, 9 Apr 2013 12:01:54 +0000 (12:01 +0000)]
Fix build for AIM 64bit.

11 years agoFix the assertions for the state of the object under the map entry
Konstantin Belousov [Tue, 9 Apr 2013 10:04:10 +0000 (10:04 +0000)]
Fix the assertions for the state of the object under the map entry
with the MAP_ENTRY_VN_WRITECNT flag:
- Move the assertion that verifies the state of the v_writecount and
  vnp.writecount, under the block where the object is locked.
- Check that the object type is OBJT_VNODE before asserting.

Reported by: avg
Reviewed by: alc
MFC after: 1 week

11 years agoFix VIMAGE build.
Gleb Smirnoff [Tue, 9 Apr 2013 09:15:26 +0000 (09:15 +0000)]
Fix VIMAGE build.

11 years agoUse IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats.
Andrey V. Elsukov [Tue, 9 Apr 2013 07:11:22 +0000 (07:11 +0000)]
Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats.

MFC after: 1 week

11 years agoImport a new version of NetBSD's mtree.
Ed Schouten [Tue, 9 Apr 2013 06:50:11 +0000 (06:50 +0000)]
Import a new version of NetBSD's mtree.

This version of mtree implements a new flag (-O) that can be used to
restrict the tool to certain pathnames. Also, it fixes a compiler
warning generated by -Wmissing-variable-declarations.

Acked by: brooks

11 years agoAdd missing file dt_pq.h that should have been committed in r239385
Martin Matuska [Tue, 9 Apr 2013 06:33:03 +0000 (06:33 +0000)]
Add missing file dt_pq.h that should have been committed in r239385

Reported by: Pedro Giffuni <pfg@FreeBSD.org>

11 years agoFireWire: Don't allow a tlabel to reference an xfer after free.
Will Andrews [Mon, 8 Apr 2013 23:16:42 +0000 (23:16 +0000)]
FireWire: Don't allow a tlabel to reference an xfer after free.

sys/dev/firewire/firewire.c:
- fw_xfer_unload(): Since we are about to free this xfer, call fw_tl_free()
  to remove the xfer from its tlabel's list, if it has a tlabel.
- In every occasion when a xfer is removed from a tlabel's list, reset
  xfer->tl to -1 while holding fc->tlabel_lock, so that the xfer isn't
  mis-identified as belonging to a tlabel.

This doesn't fix all the use-after-free problems for M_FWMEM, but is an
incremental towards that goal.

Reviewed by: kan, sbruno
Sponsored by: Spectra Logic

11 years agoFix this to compile when ATH_DEBUG_ALQ is defined but ATH_DEBUG isn't.
Adrian Chadd [Mon, 8 Apr 2013 21:15:43 +0000 (21:15 +0000)]
Fix this to compile when ATH_DEBUG_ALQ is defined but ATH_DEBUG isn't.

11 years agoAdd FreeBSD 8.4.
Sergey Kandaurov [Mon, 8 Apr 2013 20:33:51 +0000 (20:33 +0000)]
Add FreeBSD 8.4.

MFC after: 3 days

11 years agoThe per-page act_count can be made very-easily protected by the
Attilio Rao [Mon, 8 Apr 2013 20:02:27 +0000 (20:02 +0000)]
The per-page act_count can be made very-easily protected by the
per-page lock rather than vm_object lock, without any further overhead.
Make the formal switch.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho

11 years agoSwitch some "low-hanging fruit" to acquire read lock on vmobjects
Attilio Rao [Mon, 8 Apr 2013 19:58:32 +0000 (19:58 +0000)]
Switch some "low-hanging fruit" to acquire read lock on vmobjects
rather than write locks.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho

11 years agoMerge from projects/counters: TCP/IP stats.
Gleb Smirnoff [Mon, 8 Apr 2013 19:57:21 +0000 (19:57 +0000)]
Merge from projects/counters: TCP/IP stats.

  Convert 'struct ipstat' and 'struct tcpstat' to counter(9).

  This speeds up IP forwarding at extreme packet rates, and
makes accounting more precise.

Sponsored by: Nginx, Inc.

11 years agoVendor import of NetBSD's mtree at 2013-04-08.
Ed Schouten [Mon, 8 Apr 2013 19:44:30 +0000 (19:44 +0000)]
Vendor import of NetBSD's mtree at 2013-04-08.

11 years agoMerge from projects/counters: counter(9).
Gleb Smirnoff [Mon, 8 Apr 2013 19:40:53 +0000 (19:40 +0000)]
Merge from projects/counters: counter(9).

  Introduce counter(9) API, that implements fast and raceless counters,
provided (but not limited to) for gathering of statistical data.

See http://lists.freebsd.org/pipermail/freebsd-arch/2013-April/014204.html
for more details.

In collaboration with: kib
Reviewed by: luigi
Tested by: ae, ray
Sponsored by: Nginx, Inc.

11 years agoForcibly defining _KERNEL is bad idea. Toss some code so that ip_var.h
Gleb Smirnoff [Mon, 8 Apr 2013 19:20:27 +0000 (19:20 +0000)]
Forcibly defining _KERNEL is bad idea. Toss some code so that ip_var.h
isn't included with forced _KERNEL define.

11 years agoMerge from projects/counters:
Gleb Smirnoff [Mon, 8 Apr 2013 19:19:10 +0000 (19:19 +0000)]
Merge from projects/counters:

  Pad struct pcpu so that its size is denominator of PAGE_SIZE. This
is done to reduce memory waste in UMA_PCPU_ZONE zones.

Sponsored by: Nginx, Inc.

11 years agoMerge from projects/counters: UMA_ZONE_PCPU zones.
Gleb Smirnoff [Mon, 8 Apr 2013 19:10:45 +0000 (19:10 +0000)]
Merge from projects/counters: UMA_ZONE_PCPU zones.

  These zones have slab size == sizeof(struct pcpu), but request from VM
enough pages to fit (uk_slabsize * mp_ncpus). An item allocated from such
zone would have a separate twin for each CPU in the system, and these twins
are at a distance of sizeof(struct pcpu) from each other. This magic value
of distance would allow us to make some optimizations later.

  To address private item from a CPU simple arithmetics should be used:

  item = (type *)((char *)base + sizeof(struct pcpu) * curcpu)

  These arithmetics are available as zpcpu_get() macro in pcpu.h.

  To introduce non-page size slabs a new field had been added to uma_keg
uk_slabsize. This shifted some frequently used fields of uma_keg to the
fourth cache line on amd64. To mitigate this pessimization, uma_keg fields
were a bit rearranged and least frequently used uk_name and uk_link moved
down to the fourth cache line. All other fields, that are dereferenced
frequently fit into first three cache lines.

Sponsored by: Nginx, Inc.

11 years agoFix a potential socket leak in the NFS server. If a client closes its
John Baldwin [Mon, 8 Apr 2013 19:03:01 +0000 (19:03 +0000)]
Fix a potential socket leak in the NFS server.  If a client closes its
connection after it was accepted by the userland nfsd process but before
it was handled off to svc_vc_create() in the kernel, then svc_vc_create()
would see it as a new listen socket and try to listen on it leaving a
dangling reference to the socket.  Instead, check for disconnected sockets
and treat them like a connected socket.  The call to pru_getaddr() should
fail and cause svc_vc_create() to fail.  Note that we need to lock the
socket to get a consistent snapshot of so_state since there is a window
in soisdisconnected() where both flags are clear.

Reviewed by: dfr, rmacklem
MFC after: 1 week

11 years agoSwitch to a 2-clause license.
Mark Johnston [Mon, 8 Apr 2013 18:25:07 +0000 (18:25 +0000)]
Switch to a 2-clause license.

Approved by: emaste (co-mentor)
X-MFC with: r249257

11 years agoAdd support for getting and setting BBU properties related to battery
Mark Johnston [Mon, 8 Apr 2013 17:46:45 +0000 (17:46 +0000)]
Add support for getting and setting BBU properties related to battery
relearning. Specifically, add subcommands to mfiutil(8) which allow the
user to set the BBU and autolearn modes when the firmware supports it,
and add a subcommand which kicks off a battery relearn.

Reviewed by: sbruno, rstone
Tested by: sbruno
Approved by: rstone (co-mentor)
MFC after: 2 weeks
Sponsored by: Sandvine Incorporated

11 years agoFix a memory leak that showed up when we delete LUNs. The memory used for
Kenneth D. Merry [Mon, 8 Apr 2013 15:36:26 +0000 (15:36 +0000)]
Fix a memory leak that showed up when we delete LUNs.  The memory used for
the LUN was never freed.

ctl.c: Adjust ctl_alloc_lun() to make sure we don't clear the
CTL_LUN_MALLOCED flag.

Reported by: Sreenivasa Honnur <shonnur@chelsio.com>
Sponsored by: Spectra Logic
MFC after: 3 days