]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoRefactor some code in mps.c to reduce header pollution.
Scott Long [Tue, 1 Jul 2014 04:33:36 +0000 (04:33 +0000)]
Refactor some code in mps.c to reduce header pollution.

Reviewed by: gibbs
Obtained from: Netflix, Inc.
MFC after: 2 days

10 years agoAdd vt(4) devices and options to NOTES
Ed Maste [Tue, 1 Jul 2014 00:22:54 +0000 (00:22 +0000)]
Add vt(4) devices and options to NOTES

Reviewed by: marius (earlier version)

10 years agoInitialise these variables so gcc doesn't complain.
Adrian Chadd [Mon, 30 Jun 2014 23:34:36 +0000 (23:34 +0000)]
Initialise these variables so gcc doesn't complain.

Submitted by: luigi

10 years agoregex(3): Add support for \< and \> word delimiters
Pedro F. Giffuni [Mon, 30 Jun 2014 20:54:25 +0000 (20:54 +0000)]
regex(3): Add support for \< and \> word delimiters

Solaris and other OSs have support for \< and \> as word
delimiters in utilities like sed(1). These are useful to
have for general compatiblity with Solaris but should be
avoided for portability with other systems, including the
traditional BSDs.

Bump __FreeBSD_version as this is likely to affect some
userland utilities.

Reference:
https://www.illumos.org/issues/516

PR: bin/153257
Obtained from: Illumos
MFC after: 1 month

10 years agoActivate the condition for WITHOUT_INFO
Baptiste Daroussin [Mon, 30 Jun 2014 20:24:00 +0000 (20:24 +0000)]
Activate the condition for WITHOUT_INFO

Submitted by: antoine

10 years agofill in the list of obsolete files when base is built with WITHOUT_INFO
Baptiste Daroussin [Mon, 30 Jun 2014 20:22:00 +0000 (20:22 +0000)]
fill in the list of obsolete files when base is built with WITHOUT_INFO

10 years agoAdd missing VT_ kernel config knobs
Ed Maste [Mon, 30 Jun 2014 19:34:16 +0000 (19:34 +0000)]
Add missing VT_ kernel config knobs

MFC after: 1 week

10 years agoWorkaround for bug in GCC on powerpc64. Symbols that are exported are
Hans Petter Selasky [Mon, 30 Jun 2014 18:11:22 +0000 (18:11 +0000)]
Workaround for bug in GCC on powerpc64. Symbols that are exported are
by fault required to be all "static" or all "extern".

10 years agoAdd a vt(4) cross reference to syscons(4)
Ed Maste [Mon, 30 Jun 2014 16:49:00 +0000 (16:49 +0000)]
Add a vt(4) cross reference to syscons(4)

10 years agoFix ifconfig to show pltime and vltime with -L option,
Hajimu UMEMOTO [Mon, 30 Jun 2014 16:39:37 +0000 (16:39 +0000)]
Fix ifconfig to show pltime and vltime with -L option,
again after usage change from time_second to time_uptime.

PR: 188520
Submitted by: Guy Yur <guyyur__at__gmail.com>
MFC after: 1 week

10 years agoAdd vt(4) to GENERIC and retire the separate VT config
Ed Maste [Mon, 30 Jun 2014 16:18:38 +0000 (16:18 +0000)]
Add vt(4) to GENERIC and retire the separate VT config

vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
driver, set the loader tunable kern.vty=vt .

10 years agochown: add a test
Eitan Adler [Mon, 30 Jun 2014 05:33:52 +0000 (05:33 +0000)]
chown: add a test

Add a test for the chown utility. This sets up chown(8) to be capable of being
tested.  As such, only add one test for now as an example.

10 years agoAdd initial RSS awareness to the ixgbe(4) driver.
Adrian Chadd [Mon, 30 Jun 2014 04:38:29 +0000 (04:38 +0000)]
Add initial RSS awareness to the ixgbe(4) driver.

The ixgbe(4) hardware is capable of RSS hashing RX packets and doing RSS
queue selection for up to 8 queues.

However, even if multi-queue is enabled for ixgbe(4), the RX path doesn't use
the RSS flowid from the received descriptor.  It just uses the MSIX queue id.

This patch does a handful of things if RSS is enabled:

* Instead of using a random key at boot, fetch the RSS key from the RSS code
  and program that in to the RSS redirection table.

  That whole chunk of code should be double checked for endian correctness.

* Use the RSS queue mapping to CPU ID to figure out where to thread pin
  the RX swi thread and the taskqueue threads for each queue.

* The software queue is now really an "RSS bucket".

* When programming the RSS indirection table, use the RSS code to
  figure out which RSS bucket each slot in the indirection table maps
  to.

* When transmitting, use the flowid RSS mapping if the mbuf has
  an RSS aware hash.  The existing method wasn't guaranteed to align
  correctly with the destination RSS bucket (and thus CPU ID.)

This code warns if the number of RSS buckets isn't the same as the
automatically configured number of hardware queues.  The administrator
will have to tweak one of them for better performance.

There's currently no way to re-balance the RSS indirection table after
startup.  I'll worry about that later.

Additionally, it may be worthwhile to always use the full 32 bit flowid if
multi-queue is enabled.  It'll make things like lagg(4) behave better with
respect to traffic distribution.

10 years agoAdd initial RSS awareness to the igb(4) driver.
Adrian Chadd [Mon, 30 Jun 2014 04:34:59 +0000 (04:34 +0000)]
Add initial RSS awareness to the igb(4) driver.

The igb(4) hardware is capable of RSS hashing RX packets and doing RSS
queue selection for up to 8 queues.  (I believe some hardware is limited
to 4 queues, but I haven't tested on that.)

However, even if multi-queue is enabled for igb(4), the RX path doesn't use
the RSS flowid from the received descriptor.  It just uses the MSIX queue id.

This patch does a handful of things if RSS is enabled:

* Instead of using a random key at boot, fetch the RSS key from the RSS code
  and program that in to the RSS redirection table.

  That whole chunk of code should be double checked for endian correctness.

* Use the RSS queue mapping to CPU ID to figure out where to thread pin
  the RX swi thread and the taskqueue threads for each queue.

* The software queue is now really an "RSS bucket".

* When programming the RSS indirection table, use the RSS code to
  figure out which RSS bucket each slot in the indirection table maps
  to.

* When transmitting, use the flowid RSS mapping if the mbuf has
  an RSS aware hash.  The existing method wasn't guaranteed to align
  correctly with the destination RSS bucket (and thus CPU ID.)

This code warns if the number of RSS buckets isn't the same as the
automatically configured number of hardware queues.  The administrator
will have to tweak one of them for better performance.

There's currently no way to re-balance the RSS indirection table after
startup.  I'll worry about that later.

Additionally, it may be worthwhile to always use the full 32 bit flowid if
multi-queue is enabled.  It'll make things like lagg(4) behave better with
respect to traffic distribution.

10 years agoIf we're doing RSS then ensure the TCP timer selection uses the multi-CPU
Adrian Chadd [Mon, 30 Jun 2014 04:26:29 +0000 (04:26 +0000)]
If we're doing RSS then ensure the TCP timer selection uses the multi-CPU
callwheel setup, rather than just dumping all the timers on swi0.

10 years agoIf we're doing RSS then ensure that the callwheel swi's are CPU pinned.
Adrian Chadd [Mon, 30 Jun 2014 04:25:51 +0000 (04:25 +0000)]
If we're doing RSS then ensure that the callwheel swi's are CPU pinned.

10 years agoIn rare cases, a SATA drive can stop responding to commands and trigger a
Scott Long [Mon, 30 Jun 2014 01:01:54 +0000 (01:01 +0000)]
In rare cases, a SATA drive can stop responding to commands and trigger a
reset device task request from the driver.  If the drive fails to respond
with a signature FIS, the driver would previously get into an endless retry
loop, stalling all I/O to the drive and keeping user processes stranded.
Instead, fail the i/o and invalidate the device if the task management
command times out.  This is controllable with the sysctl and tunable
hw.isci.fail_on_task_timeout
dev.isci.0.fail_on_task_timeout

The default for these is 1.

Reviewed by: jimharris
Obtained from: Netflix, Inc.
MFC after: 2 days

10 years agoFix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer.
Scott Long [Mon, 30 Jun 2014 00:41:46 +0000 (00:41 +0000)]
Fix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer.
This impacts some home-rolled SMART tools.

Reviewed by: jimharris
Obtained from: Netflix
MFC after: 2 days

10 years agoRegenerate after r268022
Ed Maste [Mon, 30 Jun 2014 00:22:41 +0000 (00:22 +0000)]
Regenerate after r268022

MFC after: 1 week

10 years agoRename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT
Ed Maste [Mon, 30 Jun 2014 00:20:12 +0000 (00:20 +0000)]
Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT

The _SUPPORT knobs have a consistent meaning which differs from the
behaviour controlled by this knob.  As the knob is opt-out and has not
appeared in a release the impact should be low.

Suggested by: imp, wblock
MFC after: 1 week

10 years agoAdd detection for ciss(4) controllers that are set to non-raid JBOD mode.
Sean Bruno [Sun, 29 Jun 2014 18:53:15 +0000 (18:53 +0000)]
Add detection for ciss(4)  controllers that are set to non-raid JBOD mode.
If a controller is set to JBOD, it has no RAID functions turned on.

Populate even more of the firmware specification headers, copied from
cciss_vol_status.

Reviewed by: Benesh, Scott <scott.benesh@hp.com>
MFC after: 2 weeks

10 years agoCheck return of cam_periph_find() before using it in a printf.
Sean Bruno [Sun, 29 Jun 2014 18:38:44 +0000 (18:38 +0000)]
Check return of cam_periph_find() before using it in a printf.

If cam_periph_find() doesn't locate the path we requested, bail to error
condition.

Acquire ciss->mtx for this operation.

Reviewed by: "Benesh, Scott" <scott.benesh@hp.com>
MFC after: 2 weeks

10 years agoReduce some warnings in the Solaris unicode support.
Pedro F. Giffuni [Sun, 29 Jun 2014 02:28:05 +0000 (02:28 +0000)]
Reduce some warnings in the Solaris unicode support.

Clean some warnings from parenthesis and minor style issues.

MFC after: 3 days

10 years agoGive each interrupt a descriptive name when using MSIX
Bryan Venteicher [Sun, 29 Jun 2014 01:04:11 +0000 (01:04 +0000)]
Give each interrupt a descriptive name when using MSIX

MFC after: 3 days

10 years agoThere might be a potential race condition for the NFSv4 client
Rick Macklem [Sat, 28 Jun 2014 21:47:15 +0000 (21:47 +0000)]
There might be a potential race condition for the NFSv4 client
when a newly created file has another open done on it that
update the open mode. This patch moves the code that updates
the open mode up into the block where the mutex is held to
ensure this cannot happen. No bug caused by this potential
race has been observed, but this fix is a safety belt to ensure
it cannot happen.

MFC after: 2 weeks

10 years agoRevert r267869:
Pedro F. Giffuni [Sat, 28 Jun 2014 19:59:12 +0000 (19:59 +0000)]
Revert r267869:

MFV r260708
4427 pid provider rejects probes with valid UTF-8 names

Use of u8_textprep.c broke the build on powerpc.

Reported by: bz, rpaulo and tinderbox.
Pointyhat: me

10 years agoMove the -I of common/util to the proper place to fix the powerpc build.
Rui Paulo [Sat, 28 Jun 2014 18:53:02 +0000 (18:53 +0000)]
Move the -I of common/util to the proper place to fix the powerpc build.

MFC after: 2 weeks

10 years agoCompile fixes:
Hans Petter Selasky [Sat, 28 Jun 2014 17:36:18 +0000 (17:36 +0000)]
Compile fixes:

Remove duplicate "debug_ktr.mask" sysctl definition.
Remove now unused variable from "kern_ktr.c".
This fixes build of "ktr" which was broken by r267961.

Let the default value for "vm_kmem_size_scale" be zero. It is setup
after that the sysctl has been initialized from "getenv()" in the
"kmeminit()" function to equal the "VM_KMEM_SIZE_MAX" value, if
zero. On Sparc64 the "VM_KMEM_SIZE_MAX" macro is not a constant. This
fixes build of Sparc64 which was broken by r267961.

Add a special macro to dynamically create SYSCTL root nodes, because
root nodes have a special parent. This fixes build of existing OFED
module and CANBUS module for pc98 which was broken by r267961.

Add missing "sysctl.h" includes to get the needed sysctl header file
declarations. This is needed after r267961.

MFC after: 2 weeks

10 years agoDon't accidently skip every second line when calculating the
David Malone [Sat, 28 Jun 2014 15:53:28 +0000 (15:53 +0000)]
Don't accidently skip every second line when calculating the
idle time.

MFC after: 2 weeks

10 years agoFix breakage after r267981.
Dimitry Andric [Sat, 28 Jun 2014 09:53:44 +0000 (09:53 +0000)]
Fix breakage after r267981.

Pointy hat to: dim
MFC after: 3 days
X-MFC-With: r267981

10 years agoCall fdcloseexec right after fdunshare.
Mateusz Guzik [Sat, 28 Jun 2014 05:51:45 +0000 (05:51 +0000)]
Call fdcloseexec right after fdunshare.

No functional changes.

MFC after: 1 week

10 years agoMake fdunshare accept only td parameter.
Mateusz Guzik [Sat, 28 Jun 2014 05:41:53 +0000 (05:41 +0000)]
Make fdunshare accept only td parameter.

Proc had to match the thread anyway and 2 parameters were inconsistent
with the rest.

MFC after: 1 week

10 years agoMake sure to always clear p_fd for process getting rid of its filetable.
Mateusz Guzik [Sat, 28 Jun 2014 05:18:03 +0000 (05:18 +0000)]
Make sure to always clear p_fd for process getting rid of its filetable.

Filetable can be shared with other processes. Previous code failed to
clear the pointer for all but the last process getting rid of the table.
This is mostly cosmetics.

Get rid of 'This should happen earlier' comment. Clearing the pointer in
this place is fine as consumers can reliably check for files availability
by inspecting fd_refcnt and vnodes availabity by NULL-checking them.

MFC after: 1 week

10 years agoFix regression issue after r267961. Handle special string case for
Hans Petter Selasky [Sat, 28 Jun 2014 03:59:04 +0000 (03:59 +0000)]
Fix regression issue after r267961. Handle special string case for
SYSCTLs like previously.

MFC after: 2 weeks
Reported by: several people

10 years agoPull in r267961 and r267973 again. Fix for issues reported will follow.
Hans Petter Selasky [Sat, 28 Jun 2014 03:56:17 +0000 (03:56 +0000)]
Pull in r267961 and r267973 again. Fix for issues reported will follow.

10 years agoMinimal update for cvsup -> svn change.
Gavin Atkinson [Sat, 28 Jun 2014 00:01:18 +0000 (00:01 +0000)]
Minimal update for cvsup -> svn change.

10 years agoRedefine SUNW based on SYSDIR in an attempt to fix a build problem.
Rui Paulo [Fri, 27 Jun 2014 22:38:42 +0000 (22:38 +0000)]
Redefine SUNW based on SYSDIR in an attempt to fix a build problem.

MFC after: 2 weeks

10 years agoRemove odd practice of inverting error codes.
Alexander Motin [Fri, 27 Jun 2014 22:28:14 +0000 (22:28 +0000)]
Remove odd practice of inverting error codes.

-EPERM is equal to ERESTART, returning which from ioctl() handler causes
infinite syscall restart.

MFC after: 2 weeks

10 years agoRevert r267961, r267973:
Glen Barber [Fri, 27 Jun 2014 22:05:21 +0000 (22:05 +0000)]
Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory

10 years agoUse Intel's official name (Secure Key) per IntelĀ® Digital Random Number
Xin LI [Fri, 27 Jun 2014 21:33:15 +0000 (21:33 +0000)]
Use Intel's official name (Secure Key) per IntelĀ® Digital Random Number
Generator (DRNG) Software Implementation Guide.

Reviewed by: kib
Approved by: so
MFC after: 2 weeks

10 years agoAdd the llvm patch for r267981.
Dimitry Andric [Fri, 27 Jun 2014 20:45:17 +0000 (20:45 +0000)]
Add the llvm patch for r267981.

10 years agoPull in r211627 from upstream llvm trunk (by Bill Schmidt):
Dimitry Andric [Fri, 27 Jun 2014 20:41:12 +0000 (20:41 +0000)]
Pull in r211627 from upstream llvm trunk (by Bill Schmidt):

  [PPC64] Fix PR20071 (fctiduz generated for targets lacking that
  instruction)

  PR20071 identifies a problem in PowerPC's fast-isel implementation
  for floating-point conversion to integer.  The fctiduz instruction
  was added in Power ISA 2.06 (i.e., Power7 and later).  However, this
  instruction is being generated regardless of which 64-bit PowerPC
  target is selected.

  The intent is for fast-isel to punt to DAG selection when this
  instruction is not available.  This patch implements that change.
  For testing purposes, the existing fast-isel-conversion.ll test adds
  a RUN line for -mcpu=970 and tests for the expected code generation.
  Additionally, the existing test fast-isel-conversion-p5.ll was found
  to be incorrectly expecting the unavailable instruction to be
  generated.  I've removed these test variants since we have adequate
  coverage in fast-isel-conversion.ll.

This is needed to compile clang with debug+asserts on older powerpc64
and ppc970 targets.

Requested by: jhibbits
MFC after: 3 days

10 years agoIn order to get vt(4) a bit closer to the feature set provided by sc(4),
Marius Strobl [Fri, 27 Jun 2014 19:57:57 +0000 (19:57 +0000)]
In order to get vt(4) a bit closer to the feature set provided by sc(4),
implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
default colors of normal and kernel text respectively.
Note on the naming: Although affecting the output of vt(4), technically
kern/subr_terminal.c is primarily concerned with changing default colors
so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
Actually, if the architecture and abstraction of terminal+teken+vt would
be perfect, dev/vt/* wouldn't be touched by this commit at all.

Reviewed by: emaste
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoAlways set UF_ARCHIVE on target (because they are by definition new files
Xin LI [Fri, 27 Jun 2014 19:57:54 +0000 (19:57 +0000)]
Always set UF_ARCHIVE on target (because they are by definition new files
and should be archived) and ignore error when we can't set it (e.g. NFS).

Reviewed by: ken
MFC after: 2 weeks

10 years agoAdd CTLFLAG_NOFETCH flag; console vty code runs before tunable fetch
Ed Maste [Fri, 27 Jun 2014 19:07:35 +0000 (19:07 +0000)]
Add CTLFLAG_NOFETCH flag; console vty code runs before tunable fetch

Also remove redundant "" assignment for string in BSS.

Submitted by: hselasky@

10 years agoAdd missing variable declarations when using RSS.
Adrian Chadd [Fri, 27 Jun 2014 19:07:00 +0000 (19:07 +0000)]
Add missing variable declarations when using RSS.

Reported by: bryanv@

10 years agoSimplify the code a little bit using the update_sensor_sysctl() routine to
Luiz Otavio O Souza [Fri, 27 Jun 2014 18:58:22 +0000 (18:58 +0000)]
Simplify the code a little bit using the update_sensor_sysctl() routine to
retrieve the sensor temperature.

This also avoid the overflow that could happen on sysctlnametomib(3)
because the code was not checking the length of the mib array.

CID: 1222504

10 years agopw: fix up deletion of users from groups
Mateusz Guzik [Fri, 27 Jun 2014 18:51:19 +0000 (18:51 +0000)]
pw: fix up deletion of users from groups

Previuosly given 'foo,bar' members, removing 'foo' would result in an
infinite loop.

PR: 191427
Submitted by: Voradesh Yenbut <yenbut cs.washington.edu>
MFC after: 1 week

10 years agoCorrect the buffer length check to avoid overflows.
Luiz Otavio O Souza [Fri, 27 Jun 2014 18:40:14 +0000 (18:40 +0000)]
Correct the buffer length check to avoid overflows.

Found with: Coverity Scan
CID: 12225021222503

10 years agoMinor mdoc fix.
Joel Dahl [Fri, 27 Jun 2014 18:32:20 +0000 (18:32 +0000)]
Minor mdoc fix.

10 years ago- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
Marius Strobl [Fri, 27 Jun 2014 18:24:20 +0000 (18:24 +0000)]
- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
- vt_vga(4) is a driver rather than a function so reference it accordingly.
- Uncomment HISTORY section given that vt(4) will first appear in 9.3.

Reviewed by: emaste (modulo last part)
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoAdd post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
Neel Natu [Fri, 27 Jun 2014 18:00:38 +0000 (18:00 +0000)]
Add post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
is hard to reproduce so try to collect all the breadcrumbs when it happens.

Reviewed by: grehan

10 years agoUse a common tunable to choose between vt(4)/sc(4)
Ed Maste [Fri, 27 Jun 2014 17:50:33 +0000 (17:50 +0000)]
Use a common tunable to choose between vt(4)/sc(4)

With this change and previous work from ray@ it will be possible to put
both in GENERIC, and have one enabled by default, but allow the other to
be selected via the loader.

(The previous implementation had separate kern.vt.disable and
hw.syscons.disable tunables, and would panic if both drivers were
compiled in and neither was explicitly disabled.)

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoAfter r267897 brought in a new version of file/libmagic, a filesystem image
Neel Natu [Fri, 27 Jun 2014 17:18:54 +0000 (17:18 +0000)]
After r267897 brought in a new version of file/libmagic, a filesystem image
is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector".

This trips up vmrun.sh when using the new file(1) and makes it want to boot
into the installer instead.

Fix this by just looking for "boot sector" instead.

10 years agoExtend the meaning of the CTLFLAG_TUN flag to automatically check if
Hans Petter Selasky [Fri, 27 Jun 2014 16:33:43 +0000 (16:33 +0000)]
Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies

10 years agoDon't hide zero-length strings when doing sysctl listings.
Hans Petter Selasky [Fri, 27 Jun 2014 15:23:12 +0000 (15:23 +0000)]
Don't hide zero-length strings when doing sysctl listings.

MFC after: 1 week

10 years agoSort command flags in usage output and the manpages.
John Baldwin [Fri, 27 Jun 2014 15:20:34 +0000 (15:20 +0000)]
Sort command flags in usage output and the manpages.

10 years agoAdd proper rangechecks in "axge_rx_frame()" function and
Hans Petter Selasky [Fri, 27 Jun 2014 10:24:36 +0000 (10:24 +0000)]
Add proper rangechecks in "axge_rx_frame()" function and
fix receive loop header parsing.

MFC after: 3 days
PR: 191432

10 years agoFix typo in r267481.
Alexander Motin [Fri, 27 Jun 2014 06:52:37 +0000 (06:52 +0000)]
Fix typo in r267481.

MFC after: 3 days

10 years agoSet the version and date to fixed fields rather than using
Peter Grehan [Fri, 27 Jun 2014 05:27:37 +0000 (05:27 +0000)]
Set the version and date to fixed fields rather than using
preprocessor macros that don't allow reproducible builds.
As a side-effect, the date string is now spec-compliant.

root@bhyve:~ # dmidecode
# dmidecode 2.12
SMBIOS 2.4 present.
12 structures occupying 514 bytes.
Table at 0x000F101F.

Handle 0x0001, DMI type 0, 24 bytes
BIOS Information
        Vendor: BHYVE
        Version: 1.0
        Release Date: 03/14/2014

Submitted by: des (original version)
Reviewed by: tychon
MFC after: 1 week

10 years agoCheck lower bound of cmsg_len.
Mateusz Guzik [Fri, 27 Jun 2014 05:04:36 +0000 (05:04 +0000)]
Check lower bound of cmsg_len.

If passed cm->cmsg_len was below cmsghdr size the experssion:
datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;

would give negative result. However, in practice it would not
result in a crash because the kernel would try to obtain garbage fds
for given process and would error out with EBADF.

PR: 124908
Submitted by: campbell mumble.net (modified a little)
MFC after: 1 week

10 years agoMFV illumos
Rui Paulo [Thu, 26 Jun 2014 23:24:59 +0000 (23:24 +0000)]
MFV illumos

4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails

MFC after: 2 weeks

10 years agoMFV illumos
Rui Paulo [Thu, 26 Jun 2014 23:21:11 +0000 (23:21 +0000)]
MFV illumos

4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation is missing checks

MFC after: 2 weeks

10 years agoAdd stubs for CTF functions which are not yet implemented.
Rui Paulo [Thu, 26 Jun 2014 22:38:06 +0000 (22:38 +0000)]
Add stubs for CTF functions which are not yet implemented.

MFC after: 2 weeks

10 years agouse .Mt to mark up email addresses consistently (final part)
Baptiste Daroussin [Thu, 26 Jun 2014 21:46:14 +0000 (21:46 +0000)]
use .Mt to mark up email addresses consistently (final part)

PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>

10 years agoMFV illumos
Rui Paulo [Thu, 26 Jun 2014 21:45:49 +0000 (21:45 +0000)]
MFV illumos

4477 DTrace should speak JSON

MFC after: 2 weeks

10 years agouse .Mt to mark up email addresses consistently (part6)
Baptiste Daroussin [Thu, 26 Jun 2014 21:44:30 +0000 (21:44 +0000)]
use .Mt to mark up email addresses consistently (part6)

PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>

10 years agoSync the E1000 shared code with Intel internal, this adds fixes,
Jack F Vogel [Thu, 26 Jun 2014 21:33:32 +0000 (21:33 +0000)]
Sync the E1000 shared code with Intel internal, this adds fixes,
and more importantly, new I218 adapter support to the em driver.

MFC after: 1 week

10 years ago- Document -b to enable the bvmcons console (but mark it as deprecated
John Baldwin [Thu, 26 Jun 2014 20:12:38 +0000 (20:12 +0000)]
- Document -b to enable the bvmcons console (but mark it as deprecated
  similar to -g.)
- Document -U to set the SMBIOS UUID.
- Add missing options to the usage output and to the manpage Synopsis.
- Don't claim that bvmdebug is amd64-only (it is also a device, not an
  option).

10 years agoSimplify statistics calculation.
Alexander Motin [Thu, 26 Jun 2014 20:06:37 +0000 (20:06 +0000)]
Simplify statistics calculation.

Instead of trying to guess size of disk I/O operations (it just won't work
that way for newly added commands, and is equal to data move size for old
ones), account data move traffic.  If disk I/Os are that interesting, then
backends have to account and provide that information.

Block backend already exports the information about disk I/Os via devstat,
so having it here too is excessive.

MFC after: 2 weeks

10 years ago OS-1723 DTrace should speak JSON
Rui Paulo [Thu, 26 Jun 2014 19:48:59 +0000 (19:48 +0000)]
OS-1723 DTrace should speak JSON
    Reviewed by: Bryan Cantrill <bmc@joyent.com>

illumos/illumos-gate@8017f1f8eea31bd1160b5e50755242a2a9aabc7d

10 years agoMFV illumos r266986:
Rui Paulo [Thu, 26 Jun 2014 19:38:16 +0000 (19:38 +0000)]
MFV illumos r266986:

2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access

MFC after: 2 weeks

10 years agoRevert r267898.
Rui Paulo [Thu, 26 Jun 2014 17:34:42 +0000 (17:34 +0000)]
Revert r267898.

10 years agoUse dtrace -s instead of /bin/sh for DTrace scripts.
Rui Paulo [Thu, 26 Jun 2014 17:27:36 +0000 (17:27 +0000)]
Use dtrace -s instead of /bin/sh for DTrace scripts.

10 years agoFix whitspace indentation from spaces to tabs.
Bjoern A. Zeeb [Thu, 26 Jun 2014 17:26:33 +0000 (17:26 +0000)]
Fix whitspace indentation from spaces to tabs.

No functional changes.

MFC after: 2 weeks

10 years agoIntroduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel
Bjoern A. Zeeb [Thu, 26 Jun 2014 17:20:45 +0000 (17:20 +0000)]
Introduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel
configs.  Switch the BERI_NETFPGA_MDROOT to 64bit by default.

Give we have working interrupts also cleanup the extra polling CFLAGS from
the module Makefile.

MFC after: 2 weeks

10 years agoAdd support for emulating the move instruction: "mov r/m8, imm8".
Tycho Nightingale [Thu, 26 Jun 2014 17:15:41 +0000 (17:15 +0000)]
Add support for emulating the move instruction: "mov r/m8, imm8".

Reviewed by: neel

10 years agoAllow switching between 32bit and 64bit bus width data access at compile
Bjoern A. Zeeb [Thu, 26 Jun 2014 17:10:07 +0000 (17:10 +0000)]
Allow switching between 32bit and 64bit bus width data access at compile
time by setting NF10BMAC_64BIT and using a REGWTYPE #define to set correct
variable and return value widths.

Adjust comments to indicate the 32 or 64bit register widths.

MFC after: 2 weeks

10 years agoRather than using a constant use sizeof(val) allowing for the length
Bjoern A. Zeeb [Thu, 26 Jun 2014 17:03:08 +0000 (17:03 +0000)]
Rather than using a constant use sizeof(val) allowing for the length
to automatically change as we switch between 32/64bit.

MFC after: 2 weeks

10 years agoIn preparation for 64bit mode remove all the _4 from the function and
Bjoern A. Zeeb [Thu, 26 Jun 2014 16:49:45 +0000 (16:49 +0000)]
In preparation for 64bit mode remove all the _4 from the function and
macro names, rename val4 to val, and m4 to md.

No functional change.

MFC after: 2 weeks

10 years agoDelay the call to crhold() in vm_map_insert() until we know that we won't
Alan Cox [Thu, 26 Jun 2014 16:04:03 +0000 (16:04 +0000)]
Delay the call to crhold() in vm_map_insert() until we know that we won't
have to undo it by calling crfree().  This reduces the total number of calls
by vm_map_insert() to crhold() and crfree() by 45% in my tests.

Eliminate an unnecessary variable from vm_map_insert().

Reviewed by: kib
Tested by: pho

10 years agoFix build with WITHOUT_INET6.
Hajimu UMEMOTO [Thu, 26 Jun 2014 14:24:31 +0000 (14:24 +0000)]
Fix build with WITHOUT_INET6.

Spotted by: bf
MFC after: 1 week

10 years agoRemove duplicated includes.
Pawel Jakub Dawidek [Thu, 26 Jun 2014 13:57:44 +0000 (13:57 +0000)]
Remove duplicated includes.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>

10 years ago- Exclude loopback address rather than loopback interface.
Hajimu UMEMOTO [Thu, 26 Jun 2014 12:12:18 +0000 (12:12 +0000)]
- Exclude loopback address rather than loopback interface.
- style(9)

TODO: When AI_ADDRCONFIG is specified, getaddrinfo() can
be quite slow for system with many interfaces.  We should
have some kernel sysctls to report IPv4/IPv6 status.

Spotted by: melifaro
MFC after: 1 week

10 years agoRemove not needed initialisation code.
Hans Petter Selasky [Thu, 26 Jun 2014 10:48:01 +0000 (10:48 +0000)]
Remove not needed initialisation code.

10 years agoDocument EINVAL as per POSIX.
Sergey Kandaurov [Thu, 26 Jun 2014 10:21:00 +0000 (10:21 +0000)]
Document EINVAL as per POSIX.

This also follows r124335-r124336, r225827.

PR: 191382
MFC after: 1 week
Sponsored by: Nginx, Inc.

10 years agoAllow MODE SENSE commands through Write Exclusive persistent reservation,
Alexander Motin [Thu, 26 Jun 2014 09:42:00 +0000 (09:42 +0000)]
Allow MODE SENSE commands through Write Exclusive persistent reservation,
as required by SPC-4.

Report that fact in persistent reservation capabilities.

MFC after: 2 weeks

10 years agoAdd READ BUFFER and improve WRITE BUFFER SCSI commands support.
Alexander Motin [Thu, 26 Jun 2014 08:56:36 +0000 (08:56 +0000)]
Add READ BUFFER and improve WRITE BUFFER SCSI commands support.

This gives some use to 512KB per-LUN buffers, allocated for Copan-specific
processor code and not used.  It allows, for example, to test transport
performance and/or correctness without accessing the media, as supported
by Linux version of sg3_utils.

MFC after: 2 weeks

10 years agoBring the following change from the illumos-joyent repository:
Rui Paulo [Thu, 26 Jun 2014 07:06:43 +0000 (07:06 +0000)]
Bring the following change from the illumos-joyent repository:

commit 78e24ab6803bbe11ba37642624e1498ede5b239d
Author: Bryan Cantrill <bryan@joyent.com>
Date:   Thu Oct 31 01:20:54 2013

    OS-1688 DTrace count() with histogram
    OS-2360 DTrace full width distribution histograms
    OS-2361 DTrace frequency trails

MFC after: 2 weeks

10 years agoMFV r267843: update file/libmagic to 5.19.
Xin LI [Thu, 26 Jun 2014 06:03:39 +0000 (06:03 +0000)]
MFV r267843: update file/libmagic to 5.19.

MFC after: 2 weeks

10 years agoImprove r264388 removing namespace pollution previously introduced in
Davide Italiano [Thu, 26 Jun 2014 05:23:48 +0000 (05:23 +0000)]
Improve r264388 removing namespace pollution previously introduced in
<sys/time.h>. INT64_MAX actually requires __INT64_C() hack to get the
type right on exotic architectures (e.g. on ones with 63-bit ints or long
0x7fffffffffffffff is unsigned int or long). The hardcoded LL suffix is
good enough to avoid these problems for SBT_MAX (it makes the type always
signed long long, without overflow since long long has at least 64 bits).
Many thanks to Bruce Evans for the time spent me to explain this.

Reported by: bde
Reviewed by: bde

10 years agoRetire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
Adrian Chadd [Thu, 26 Jun 2014 04:12:41 +0000 (04:12 +0000)]
Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
map the bucket to an RSS queue, then map the queue to a CPU ID.
This way the bucket->queue and queue->CPU mapping can change
over time.

Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket.
User applications can then map the RSS bucket to a CPU.

10 years agoAdd another RSS method to query the indirection table entries.
Adrian Chadd [Thu, 26 Jun 2014 02:49:51 +0000 (02:49 +0000)]
Add another RSS method to query the indirection table entries.

There's 128 indirection table entries which correspond to the
low 7 bits of the 32 bit RSS hash.  Each value will correspond
to an RSS bucket.  (Then each RSS bucket currently will map
to a CPU.)

This is a more explicit way of figuring out which RSS bucket
is in each RSS indirection slot.  It can be inferred by the other
methods but I'd rather drivers use something more simplified and
explicit.

10 years agoCorrect buffer size.
Xin LI [Thu, 26 Jun 2014 00:31:58 +0000 (00:31 +0000)]
Correct buffer size.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
MFC after: 2 weeks

10 years agoUse correct length for buffer.
Xin LI [Wed, 25 Jun 2014 23:42:53 +0000 (23:42 +0000)]
Use correct length for buffer.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
MFC after: 2 weeks

10 years agoExpose the amount of resident and wired memory from the guest's vmspace.
Peter Grehan [Wed, 25 Jun 2014 22:13:35 +0000 (22:13 +0000)]
Expose the amount of resident and wired memory from the guest's vmspace.

This is different than the amount shown for the process e.g. by
/usr/bin/top - that is the mappings faulted in by the mmap'd region
of guest memory.

The values can be fetched with bhyvectl

 # bhyvectl --get-stats --vm=myvm
 ...
 Resident memory                          413749248
 Wired memory                             0
 ...

vmm_stat.[ch] -
 Modify the counter code in bhyve to allow direct setting of a counter
as opposed to incrementing, and providing a callback to fetch a
counter's value.

Reviewed by: neel

10 years agoExpand r261243 even further and ignore any I/O port resources assigned to
John Baldwin [Wed, 25 Jun 2014 20:30:47 +0000 (20:30 +0000)]
Expand r261243 even further and ignore any I/O port resources assigned to
PCI root bridges except for the one known-valid case on x86 where bridges
claim the I/O port registers used for PCI config space access.

Tested by: Hilko Meyer <hilko.meyer@gmx.de>
MFC after: 1 week

10 years agoLock devstat updates in block backend to make it usable. Polish lock names.
Alexander Motin [Wed, 25 Jun 2014 17:54:36 +0000 (17:54 +0000)]
Lock devstat updates in block backend to make it usable.  Polish lock names.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoMFV r258381:
Pedro F. Giffuni [Wed, 25 Jun 2014 17:27:15 +0000 (17:27 +0000)]
MFV r258381:

4251 libdtrace leaks open file handles

Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485
(partial)
Reference:
https://www.illumos.org/issues/4251

Discussed with: Robert Mustacchi
Obtained from: Illumos
MFC after: 1 week

10 years agoIntroduce fine-grained CTL locking to improve SMP scalability.
Alexander Motin [Wed, 25 Jun 2014 17:02:01 +0000 (17:02 +0000)]
Introduce fine-grained CTL locking to improve SMP scalability.

Split global ctl_lock, historically protecting most of CTL context:
 - remaining ctl_lock now protects lists of fronends and backends;
 - per-LUN lun_lock(s) protect LUN-specific information;
 - per-thread queue_lock(s) protect request queues.
This allows to radically reduce congestion on ctl_lock.

Create multiple worker threads, depending on number of CPUs, and assign
each LUN to one of them.  This allows to spread load between multiple CPUs,
still avoiging congestion on queues and LUNs locks.

On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs,
accessed via 6 iSCSI connections, this change improves peak request rate
from 250K to 680K IOPS.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.