]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoSplit you the syscall handling to a separate file.
andrew [Wed, 1 Oct 2014 12:44:16 +0000 (12:44 +0000)]
Split you the syscall handling to a separate file.

9 years agoFix couple issues with ROD tokens content.
mav [Wed, 1 Oct 2014 11:30:20 +0000 (11:30 +0000)]
Fix couple issues with ROD tokens content.

MFC after: 3 days

9 years agoFix off by one in lagg_port_destroy().
glebius [Wed, 1 Oct 2014 11:23:54 +0000 (11:23 +0000)]
Fix off by one in lagg_port_destroy().

Reported by: "Max N. Boyarov" <zotrix bsd.by>

9 years agoRemove MK_ARM_EABI, the armeb issues have been fixed. The code to support
andrew [Wed, 1 Oct 2014 08:26:51 +0000 (08:26 +0000)]
Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D876

9 years agoSet default cycle state in case of early interrupts.
hselasky [Wed, 1 Oct 2014 07:34:49 +0000 (07:34 +0000)]
Set default cycle state in case of early interrupts.

MFC after: 3 days

9 years agoConsistently cast tty and user to const char * in printf()-like contexts.
des [Wed, 1 Oct 2014 07:15:02 +0000 (07:15 +0000)]
Consistently cast tty and user to const char * in printf()-like contexts.

9 years agoThe default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
tuexen [Wed, 1 Oct 2014 05:43:29 +0000 (05:43 +0000)]
The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
that this means full checksum coverage for received packets.
If an application is willing to accept packets with partial
coverage, it is expected to use the socekt option and provice
the minimum coverage it accepts.

Reviewed by: kevlo
MFC after: 3 days

9 years agoCorrect the way that libelf is linked when USDT is used.
markj [Wed, 1 Oct 2014 04:28:39 +0000 (04:28 +0000)]
Correct the way that libelf is linked when USDT is used.

9 years agoAdd ObsoleteFiles.inc OLD_FILES entries for libnv
ngie [Wed, 1 Oct 2014 01:56:51 +0000 (01:56 +0000)]
Add ObsoleteFiles.inc OLD_FILES entries for libnv

X-MFC with: r271241
Submitted by: pjd
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division

9 years agoTest for absence of M_NOFREE before attempting to purge the mbuf's tags.
np [Tue, 30 Sep 2014 23:16:26 +0000 (23:16 +0000)]
Test for absence of M_NOFREE before attempting to purge the mbuf's tags.
This will leave more state intact should the assertion go off.

MFC after: 1 month

9 years agoReturn the actual baud rate programmed in the hardware rather than 115200.
ian [Tue, 30 Sep 2014 23:01:11 +0000 (23:01 +0000)]
Return the actual baud rate programmed in the hardware rather than 115200.
This allows the "3wire" entry in /etc/ttys (with no speed specified) to work.

9 years agoWhen building the lists of available memory, actually honor the exclusion
ian [Tue, 30 Sep 2014 21:28:05 +0000 (21:28 +0000)]
When building the lists of available memory, actually honor the exclusion
flags, like the comment says it does.

Pointy hat: ian
Submitted by: Svatopluk Kraus <onwahe@gmail.com>

9 years agoSupport tunable to control Tx deferred packet list limits
gnn [Tue, 30 Sep 2014 20:57:25 +0000 (20:57 +0000)]
Support tunable to control Tx deferred packet list limits

Also increase default for Tx queue get-list limit.
Too small limit results in TCP packets drops especiall when many
streams are running simultaneously.
Put list may be kept small enough since it is just a temporary
location if transmit function can't get Tx queue lock.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoThe patch allows to check state of the software Tx queues at run time.
gnn [Tue, 30 Sep 2014 20:43:21 +0000 (20:43 +0000)]
The patch allows to check state of the software Tx queues at run time.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoUpdate SolarFlare driver manual page with new tunables.
gnn [Tue, 30 Sep 2014 20:38:36 +0000 (20:38 +0000)]
Update SolarFlare driver manual page with new tunables.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoMake size of Tx and Rx rings configurable
gnn [Tue, 30 Sep 2014 20:36:07 +0000 (20:36 +0000)]
Make size of Tx and Rx rings configurable

Required size of event queue is calculated now.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoUDPLite requires a checksum. Therefore, discard a received packet if
tuexen [Tue, 30 Sep 2014 20:29:58 +0000 (20:29 +0000)]
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.

MFC after: 3 days

9 years agocleanup: code style fixes
gnn [Tue, 30 Sep 2014 20:18:10 +0000 (20:18 +0000)]
cleanup: code style fixes

Remove trailing whitespaces and tabs.
Enclose value in return statements in parentheses.
Use tabs after #define.
Do not skip comparison with 0/NULL in boolean expressions.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

9 years agoFix a mismerge in r260183 which prevents snapshot zvol devices being
delphij [Tue, 30 Sep 2014 18:50:45 +0000 (18:50 +0000)]
Fix a mismerge in r260183 which prevents snapshot zvol devices being
removed and re-instate the fix in r242862.

Reported by: Leon Dang <ldang nahannisys com>, smh
MFC after: 3 days

9 years agoIf the checksum coverage field in the UDPLITE header is the length
tuexen [Tue, 30 Sep 2014 18:17:28 +0000 (18:17 +0000)]
If the checksum coverage field in the UDPLITE header is the length
of the complete UDPLITE packet, the packet has full checksum coverage.
SO fix the condition.

Reviewed by: kevlo
MFC after: 3 days

9 years agoxen: fix blkback pushing responses before releasing internal resources
royger [Tue, 30 Sep 2014 17:41:16 +0000 (17:41 +0000)]
xen: fix blkback pushing responses before releasing internal resources

Fix a problem where the blockback driver could run out of requests,
despite the fact that we allocate enough request and reqlist
structures to satisfy the maximum possible number of requests.

The problem was that we were sending responses back to the other
end (blockfront) before freeing resources. The Citrix Windows
driver is pretty agressive about queueing, and would queue more I/O
to us immediately after we sent responses to it. We would run into
a resource shortage and stall out I/O until we freed resources.

It isn't clear whether the request shortage condition was an
indirect cause of the I/O hangs we've been seeing between Windows
with the Citrix PV drivers and FreeBSD's blockback, but the above
problem is certainly a bug.

Sponsored by: Spectra Logic
Submitted by: ken
Reviewed by: royger

dev/xen/blkback/blkback.c:
 - Break xbb_send_response() into two sub-functions,
   xbb_queue_response() and xbb_push_responses().
   Remove xbb_send_response(), because it is no longer
   used.

 - Adjust xbb_complete_reqlist() so that it calls the
   two new functions, and holds the mutex around both
   calls.  The mutex insures that another context
   can't come along and push responses before we've
   freed our resources.

 - Change xbb_release_reqlist() so that it requires
   the mutex to be held instead of acquiring the mutex
   itself.  Both callers could easily hold the mutex
   while calling it, and one really needs to hold the
   mutex during the call.

 - Add two new counters, accessible via sysctl
   variables.  The first one counts the number of
   I/Os that are queued and waiting to be pushed
   (reqs_queued_for_completion).  The second one
   (reqs_completed_with_error) counts the number of
   requests we've completed with an error status.

9 years agoxen/balloon: fix accounting of current memory pages on PVH
royger [Tue, 30 Sep 2014 17:38:21 +0000 (17:38 +0000)]
xen/balloon: fix accounting of current memory pages on PVH

Using realmem on PVH is not realiable, since in this case the realmem value
is computed from Maxmem, which contains the higher memory address found. Use
HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and
contains the exact number of memory pages assigned to the domain.

Sponsored by: Citrix Systems R&D

9 years agoxen: add xenstored user-space device
royger [Tue, 30 Sep 2014 17:37:26 +0000 (17:37 +0000)]
xen: add xenstored user-space device

This device is used by the user-space daemon that runs xenstore
(xenstored). It allows xenstored to map the xenstore memory page, and
reports the event channel xenstore is using.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstored_dev.c:
 - Add the xenstored character device that's used to map the xenstore
   memory into user-space, and to report the event channel used by
   xenstore.

conf/files:
 - Add the device to the build process.

9 years agoxen: convert the xenstore user-space char device to a newbus device
royger [Tue, 30 Sep 2014 17:31:04 +0000 (17:31 +0000)]
xen: convert the xenstore user-space char device to a newbus device

Convert the xenstore user-space device (/dev/xen/xenstore) to a device
using the newbus interface. This allows us to make the device
initialization dependant on the initialization of xenstore itself in
the kernel.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstore.c:
 - Convert to a newbus device, this removes the xs_dev_init function.

xen/xenstore/xenstore_internal.h:
 - Remove xs_dev_init prototype.

dev/xen/xenstore/xenstore.c:
 - Don't call xs_dev_init anymore, the device will attach itself when
   xenstore is started.

9 years agoxen: defer xenstore initialization until xenstored is started
royger [Tue, 30 Sep 2014 17:27:56 +0000 (17:27 +0000)]
xen: defer xenstore initialization until xenstored is started

The xenstore related devices in the kernel cannot be started until
xenstored is running, which will happen later in the Dom0 case. If
start_info_t doesn't contain a valid xenstore event channel, defer all
xenstore related devices attachment to later.

Sponsored by: Citrix Systems R&D

dev/xen/xenstore/xenstore.c:
 - Prevent xenstore from trying to attach it's descendant devices if
   xenstore is not initialized.
 - Add a callback in the xenstore interrupt filter that will trigger
   the plug of xenstore descendant devices on the first received
   interrupt. This interrupt is generated when xenstored attaches to
   the event channel, and serves as a notification that xenstored is
   running.

9 years agoOnly define the full inm_print() if KTR_IGMPV3 is enabled at compile time.
jhb [Tue, 30 Sep 2014 17:26:34 +0000 (17:26 +0000)]
Only define the full inm_print() if KTR_IGMPV3 is enabled at compile time.

9 years agoExplicitly return None for negative event indices. Prior to this,
jhb [Tue, 30 Sep 2014 17:19:07 +0000 (17:19 +0000)]
Explicitly return None for negative event indices.  Prior to this,
eventat(-1) would return the next-to-last event causing the back button
to cycle back to the end of an event source instead of stopping at the
start.

9 years agoxen: move xenstore devices
royger [Tue, 30 Sep 2014 17:14:11 +0000 (17:14 +0000)]
xen: move xenstore devices

Move xenstore related devices (xenstore.c and xenstore_dev.c) from
xen/xenstore to dev/xen/xenstore. This is just code motion, no
functional changes.

Sponsored by: Citrix Systems R&D

9 years agoxen: make xen balloon a driver that depends on xenstore
royger [Tue, 30 Sep 2014 16:53:08 +0000 (16:53 +0000)]
xen: make xen balloon a driver that depends on xenstore

This is done so we can prevent the Xen Balloon driver from attaching
before xenstore is setup.

Sponsored by: Citrix Systems R&D

dev/xen/balloon/balloon.c:
 - Make xen balloon a driver that depends on xenstore.

9 years agoxen: add the Xen implementation of pci_child_added method
royger [Tue, 30 Sep 2014 16:49:17 +0000 (16:49 +0000)]
xen: add the Xen implementation of pci_child_added method

Add the Xen specific implementation of pci_child_added to the Xen PCI
bus. This is needed so FreeBSD can register the devices it finds with
the hypervisor.

Sponsored by: Citrix Systems R&D

x86/xen/xen_pci.c:
 - Add the Xen pci_child_added method.

9 years agomsi: add Xen MSI implementation
royger [Tue, 30 Sep 2014 16:46:45 +0000 (16:46 +0000)]
msi: add Xen MSI implementation

This patch adds support for MSI interrupts when running on Xen. Apart
from adding the Xen related code needed in order to register MSI
interrupts this patch also makes the msi_init function a hook in
init_ops, so different MSI implementations can have different
initialization functions.

Sponsored by: Citrix Systems R&D

xen/interface/physdev.h:
 - Add the MAP_PIRQ_TYPE_MULTI_MSI to map multi-vector MSI to the Xen
   public interface.

x86/include/init.h:
 - Add a hook for setting custom msi_init methods.

amd64/amd64/machdep.c:
i386/i386/machdep.c:
 - Set the default msi_init hook to point to the native MSI
   initialization method.

x86/xen/pv.c:
 - Set the Xen MSI init hook when running as a Xen guest.

x86/x86/local_apic.c:
 - Call the msi_init hook instead of directly calling msi_init.

xen/xen_intr.h:
x86/xen/xen_intr.c:
 - Introduce support for registering/releasing MSI interrupts with
   Xen.
 - The MSI interrupts will use the same PIC as the IO APIC interrupts.

xen/xen_msi.h:
x86/xen/xen_msi.c:
 - Introduce a Xen MSI implementation.

x86/xen/xen_nexus.c:
 - Overwrite the default MSI hooks in the Xen Nexus to use the Xen MSI
   implementation.

x86/xen/xen_pci.c:
 - Introduce a Xen specific PCI bus that inherits from the ACPI PCI
   bus and overwrites the native MSI methods.
 - This is needed because when running under Xen the MSI messages used
   to configure MSI interrupts on PCI devices are written by Xen
   itself.

dev/acpica/acpi_pci.c:
 - Lower the quality of the ACPI PCI bus so the newly introduced Xen
   PCI bus can take over when needed.

conf/files.i386:
conf/files.amd64:
 - Add the newly created files to the build process.

9 years agoFix old iSCSI initiator to work with new CAM locking.
mav [Tue, 30 Sep 2014 16:17:12 +0000 (16:17 +0000)]
Fix old iSCSI initiator to work with new CAM locking.

This switches code to using xpt_scan() routine, irrelevant to locking.
Using xpt_action() directly requires knowledge about higher level locks,
that SIM does not need to have.

This code is obsoleted, but that is not a reason to crash.

MFC after: 3 days

9 years agoFix pkill unit tests.
rodrigc [Tue, 30 Sep 2014 15:27:49 +0000 (15:27 +0000)]
Fix pkill unit tests.

- use daemon(8) to write out a pid file for processes,
  and check for for the existence of that file after
  killing processes
- use explict named parameters to jail(8)

9 years agoMake sure __ARM_ARCH is defined in sysreg.h by including acle-compat.h
andrew [Tue, 30 Sep 2014 13:32:45 +0000 (13:32 +0000)]
Make sure __ARM_ARCH is defined in sysreg.h by including acle-compat.h

9 years agoRemove redundant call to ipsec_getpolicybyaddr().
ae [Tue, 30 Sep 2014 13:15:19 +0000 (13:15 +0000)]
Remove redundant call to ipsec_getpolicybyaddr().
ipsec_hdrsiz() will call it internally.

Sponsored by: Yandex LLC

9 years agoBe prepared that set_dumper() might fail even when resetting it or prefix
pjd [Tue, 30 Sep 2014 12:00:50 +0000 (12:00 +0000)]
Be prepared that set_dumper() might fail even when resetting it or prefix
the call with (void) to document that we intentionally ignore the return
value - no way to handle an error in case of device disappearing.

9 years agoStyle fixes.
pjd [Tue, 30 Sep 2014 11:51:32 +0000 (11:51 +0000)]
Style fixes.

9 years agoWhen plen != ulen, it should only be checked when this is UDP.
kevlo [Tue, 30 Sep 2014 07:28:31 +0000 (07:28 +0000)]
When plen != ulen, it should only be checked when this is UDP.

Spotted by: bryanv

9 years agoAdd a missing file from the last commit.
adrian [Tue, 30 Sep 2014 05:50:34 +0000 (05:50 +0000)]
Add a missing file from the last commit.

Noticed by: jhibbits

9 years agoMake clear in the ipheth(4) hardware notes that this driver is for the
gavin [Tue, 30 Sep 2014 05:36:16 +0000 (05:36 +0000)]
Make clear in the ipheth(4) hardware notes that this driver is for the
tethering functionality only.  Add a "bugs" section to give a pointer
to usbconfig set_config if the device isn't automatically detected.

MFC after: 3 days

9 years agoRemove this stuff - it's no longer needed here.
adrian [Tue, 30 Sep 2014 03:29:46 +0000 (03:29 +0000)]
Remove this stuff - it's no longer needed here.

9 years agoAdd initial support for the AR9485 CUS198 / CUS230 variants.
adrian [Tue, 30 Sep 2014 03:19:29 +0000 (03:19 +0000)]
Add initial support for the AR9485 CUS198 / CUS230 variants.

These variants have a few differences from the default AR9485 NIC,
namely:

* a non-default antenna switch config;
* slightly different RX gain table setup;
* an external XLNA hooked up to a GPIO pin;
* (and not yet done) RSSI threshold differences when
  doing slow diversity.

To make this possible:

* Add the PCI device list from Linux ath9k, complete with vendor and
  sub-vendor IDs for various things to be enabled;
* .. and until FreeBSD learns about a PCI device list like this,
  write a search function inspired by the USB device enumeration code;
* add HAL_OPS_CONFIG to the HAL attach methods; the HAL can use this
  to initialise its local driver parameters upon attach;
* copy these parameters over in the AR9300 HAL;
* don't default to override the antenna switch - only do it for
  the chips that require it;
* I brought over ar9300_attenuation_apply() from ath9k which is cleaner
  and easier to read for this particular NIC.

This is a work in progress.  I'm worried that there's some post-AR9380
NIC out there which doesn't work without the antenna override set as
I currently haven't implemented bluetooth coexistence for the AR9380
and later HAL.  But I'd rather have this code in the tree and fix it
up before 11.0-RELEASE happens versus having a set of newer NICs
in laptops be effectively RX deaf.

Tested:

* AR9380 (STA)
* AR9485 CUS198 (STA)

Obtained from: Qualcomm Atheros, Linux ath9k

9 years agoDocument [EPERM] for UNIX sockets.
bdrewery [Tue, 30 Sep 2014 00:06:53 +0000 (00:06 +0000)]
Document [EPERM] for UNIX sockets.

MFC after: 2 weeks

9 years agoUse bzero instead of explicitly zeroing stuff in do_execve.
mjg [Mon, 29 Sep 2014 23:59:19 +0000 (23:59 +0000)]
Use bzero instead of explicitly zeroing stuff in do_execve.

While strictly speaking this is not correct since some fields are pointers,
it makes no difference on all supported archs and we already rely on it doing
the right thing in other places.

No functional changes.

9 years agoSigh, remove a line that needs to be removed along with previous commit.
delphij [Mon, 29 Sep 2014 21:54:46 +0000 (21:54 +0000)]
Sigh, remove a line that needs to be removed along with previous commit.

Submitted by: mjg
MFC after: 3 days
X-MFC-with: 272288

9 years agoWhen setting environment variables in the atrun script, use the
delphij [Mon, 29 Sep 2014 21:45:57 +0000 (21:45 +0000)]
When setting environment variables in the atrun script, use the
"export foo=bar" form instead of "foo=bar; export foo" since the
former allows the shell to catch variable names that are not valid
shell identifiers.  This will cause /bin/sh to exit with an error
(which gets mailed to the at user) and it will not run the script.

Obtained from: OpenBSD (r1.63 millert)
MFC after: 3 days

9 years agoEnsure that ixl_flush() uses a defined register on VFs
rstone [Mon, 29 Sep 2014 17:51:39 +0000 (17:51 +0000)]
Ensure that ixl_flush() uses a defined register on VFs

In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by: Eric Joyner <ricera10 AT gmail.com>
MFC after: 3 days
Sponsored by: Sandvine Inc

9 years agoFix integer truncation in affecting systat -ifstat
rstone [Mon, 29 Sep 2014 17:38:50 +0000 (17:38 +0000)]
Fix integer truncation in affecting systat -ifstat

The "systat -ifstat" command was using a u_int to store byte counters.
With a 10Gbps or faster interface, this overflows within the default
5 second refresh period.  Switch to using a uint64_t across the board,
which matches the size used for all counters as of r263102.

PR: 182448
MFC after: 1 week
Sponsored by: Sandvine Inc

9 years agoSearch for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
will [Mon, 29 Sep 2014 15:05:23 +0000 (15:05 +0000)]
Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
This will only take effect if PORTSDIR is not set, as previously supported.

Use .if exists(), for four specific possibilities relative to .CURDIR:
., .., ../.., and ../../..  The fourth possibility is primarily in case
ports ever grows a third level.  If none of these paths exist, fall back to
the old default of /usr/ports.

This removes the need to set PORTSDIR explicitly (or via wrapper script) if
one is running out of a ports tree that is not in /usr/ports, but in a
home directory.

Reviewed by: bapt, bdrewery (older version)
CR: D799
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoHopefully fix build breakage with gcc passing void * instead of char *
bz [Mon, 29 Sep 2014 10:36:14 +0000 (10:36 +0000)]
Hopefully fix build breakage with gcc passing void * instead of char *
to "%s" format string after r272280.

PR: 83099 193927
MFC after: 3 days
X-MFC with: r272280

9 years agoInstead of failing when neither PAM_TTY nor PAM_RHOST are available, call
des [Mon, 29 Sep 2014 08:57:36 +0000 (08:57 +0000)]
Instead of failing when neither PAM_TTY nor PAM_RHOST are available, call
login_access() with "**unknown**" as the second argument.  This will allow
"ALL" rules to match.

Reported by: Tim Daneliuk <tundra@tundraware.com>
Tested by: dim@
PR: 83099 193927
MFC after: 3 days

9 years agoUse snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow).
dteske [Mon, 29 Sep 2014 00:35:12 +0000 (00:35 +0000)]
Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow).
Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512).
Fix the following style(9) nits while here:
- distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN;
  standardize on one (PATH_MAX)
- Move $FreeBSD$ from comment to __FBSDID()
- Sort included headers (alphabetically, sys/* at top)
- Add missing header includes (e.g., <stdlib.h> for getenv(3),
  calloc(3)/malloc(3)/free(3), and atoi(3); <string.h> for strdup(3),
  strrchr(3), strsep(3), and strcmp(3); <ctype.h> for isspace(3); and
  <unistd.h> for chdir(2), etc.)
- Remove rogue newline at end of distfetch.c
- Don't declare variables in if-, while-, or other statement
NB: To prevent masking of prior declarations atop function
- Perform stack alignment for variable declarations
- Add missing function prototype for count_files() in distextract.c
- Break out single-line multivariable-declarations
NB: Aligning similarly-named variables with one-char difference(s)
NB: Minimizes diffs and makes future diffs more clear
- Use err(3) family of functions (requires s/int err;/int retval;/g)

Reviewed by: nwhitehorn, julian

9 years agoChange the /var dataset in the default ZFS layout to have the
allanjude [Sun, 28 Sep 2014 21:44:23 +0000 (21:44 +0000)]
Change the /var dataset in the default ZFS layout to have the
ZFS property canmount=off so that /var/db/pkg and other such directories
are part of the / dataset, and only /var/mail, /var/log, and /var/crash
are excluded from the ZFS boot environment (beadm).

PR: 193971
Approved by: jmg
MFC after: ASAP
Relnotes: yes
Sponsored by: ScaleEngine Inc.

9 years agoAdd strptime(3) support for %U and %W (take 2)
pfg [Sun, 28 Sep 2014 21:20:20 +0000 (21:20 +0000)]
Add strptime(3) support for %U and %W (take 2)

Add support for the missing POSIX-2001 %U and %W features: the
existing FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green.
David Carlier added the initial handling of tm_wday/tm_yday.
Major credit goes to Andrey Chernov for detecting much of the
brokenness, and rewriting/cleaning most of the code, making it
much more robust.

Tested independently with the strptime test from the GNU C
library.

PR: 137307
MFC after: 1 month
Relnotes: yes

9 years agotty_rel_free() can be called more than once for the same tty so make sure
neel [Sun, 28 Sep 2014 21:12:23 +0000 (21:12 +0000)]
tty_rel_free() can be called more than once for the same tty so make sure
that the tty is dequeued from 'tty_list' only the first time.

The panic below was seen when a revoke(2) was issued on an nmdm device.
In this case there was also a thread that was blocked on a read(2) on the
device. The revoke(2) woke up the blocked thread which would typically
return an error to userspace. In this case the reader also held the last
reference on the file descriptor so fdrop() ended up calling tty_rel_free()
via ttydev_close().

tty_rel_free() then tried to dequeue 'tp' again which led to the panic.

panic: Bad link elm 0xfffff80042602400 prev->next != elm
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f9c90460
kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f9c90510
vpanic() at vpanic+0x189/frame 0xfffffe00f9c90590
panic() at panic+0x43/frame 0xfffffe00f9c905f0
tty_rel_free() at tty_rel_free+0x29b/frame 0xfffffe00f9c90640
ttydev_close() at ttydev_close+0x1f9/frame 0xfffffe00f9c90690
devfs_close() at devfs_close+0x298/frame 0xfffffe00f9c90720
VOP_CLOSE_APV() at VOP_CLOSE_APV+0x13c/frame 0xfffffe00f9c90770
vn_close() at vn_close+0x194/frame 0xfffffe00f9c90810
vn_closefile() at vn_closefile+0x48/frame 0xfffffe00f9c90890
devfs_close_f() at devfs_close_f+0x2c/frame 0xfffffe00f9c908c0
_fdrop() at _fdrop+0x29/frame 0xfffffe00f9c908e0
sys_read() at sys_read+0x63/frame 0xfffffe00f9c90980
amd64_syscall() at amd64_syscall+0x2b3/frame 0xfffffe00f9c90ab0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f9c90ab0
--- syscall (3, FreeBSD ELF64, sys_read), rip = 0x800b78d8a, rsp = 0x7fffffbfdaf8, rbp = 0x7fffffbfdb30 ---

CR: https://reviews.freebsd.org/D851
Reviewed by: glebius, ed
Reported by: Leon Dang
Sponsored by: Nahanni Systems
MFC after: 1 week

9 years agoConvert most BPF_TAP users to BPF_MTAP.
melifaro [Sun, 28 Sep 2014 19:05:22 +0000 (19:05 +0000)]
Convert most BPF_TAP users to BPF_MTAP.

MFC after: 2 weeks

9 years agoChecksum coverage values larger than 65535 for UDPLite are invalid.
tuexen [Sun, 28 Sep 2014 17:22:45 +0000 (17:22 +0000)]
Checksum coverage values larger than 65535 for UDPLite are invalid.
Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV.

Reviewed by: kevlo
MFC after: 3 days

9 years agoMove the unconditional #include of net/ifq.h to the very end of file.
bz [Sun, 28 Sep 2014 17:09:40 +0000 (17:09 +0000)]
Move the unconditional #include of net/ifq.h to the very end of file.
This seems to allow us to pass a universe with either clang or gcc
after r272244 (and r272260) and probably makes it easier to untabgle
these chained #includes in the future.

9 years agoRemove duplicate declaraton of the if_inc_counter() function after r272244.
bz [Sun, 28 Sep 2014 15:38:21 +0000 (15:38 +0000)]
Remove duplicate declaraton of the if_inc_counter() function after r272244.
if_var.h has the expected on and if_var.h include ifq.h and thus we get
duplicates.  It seems only one cavium ethernet file actually includes ifq.h
directly which might be another cleanup to be done but need to test first.

9 years agoMFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc.
nyan [Sun, 28 Sep 2014 14:39:11 +0000 (14:39 +0000)]
MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc.

9 years ago- Cosmetic changes.
nyan [Sun, 28 Sep 2014 14:25:46 +0000 (14:25 +0000)]
- Cosmetic changes.
- Reduce diffs against i386.

9 years ago- Remove empty wrappers ether_poll_[de]register_drv(). [1]
glebius [Sun, 28 Sep 2014 14:05:18 +0000 (14:05 +0000)]
- Remove empty wrappers ether_poll_[de]register_drv(). [1]
- Move polling(9) declarations out of ifq.h back to if_var.h
  they are absolutely unrelated to queues.

Submitted by: Mikhail <mp lenta.ru> [1]

9 years agoMFi386: r261567
nyan [Sun, 28 Sep 2014 13:34:43 +0000 (13:34 +0000)]
MFi386: r261567

  Switch from lib/libstand to sys/boot/libstand32.

9 years agoMFi386: r268974
nyan [Sun, 28 Sep 2014 13:13:18 +0000 (13:13 +0000)]
MFi386: r268974

  Supress clang warning for FreeBSD printf %b and %D formats.

9 years agoInstead of creating the full range of possible ports, try to figure
hselasky [Sun, 28 Sep 2014 12:55:13 +0000 (12:55 +0000)]
Instead of creating the full range of possible ports, try to figure
out the actual number of so-called "embedded jacks" which are present
when a USB MIDI device is attaching.

MFC after: 3 days

9 years agoRegenerate usb.conf
hselasky [Sun, 28 Sep 2014 12:41:48 +0000 (12:41 +0000)]
Regenerate usb.conf

MFC after: 3 days

9 years agoMFi386: r261520
nyan [Sun, 28 Sep 2014 12:25:27 +0000 (12:25 +0000)]
MFi386: r261520

  Drop the 3rd clause from all 3 clause BSD licenses.

9 years agoReduce diffs against i386.
nyan [Sun, 28 Sep 2014 12:13:51 +0000 (12:13 +0000)]
Reduce diffs against i386.

9 years agoRemove extra '\'.
nyan [Sun, 28 Sep 2014 12:12:54 +0000 (12:12 +0000)]
Remove extra '\'.

9 years ago- Cleanups pc98 code.
nyan [Sun, 28 Sep 2014 11:32:46 +0000 (11:32 +0000)]
- Cleanups pc98 code.
- Remove unworked formats.

9 years agoDo not transfer unneeded training zero bytes in INQUIRY response.
mav [Sun, 28 Sep 2014 11:10:37 +0000 (11:10 +0000)]
Do not transfer unneeded training zero bytes in INQUIRY response.

It is an addition to r269631.

9 years agoRemove duplicate prog.
nyan [Sun, 28 Sep 2014 08:59:38 +0000 (08:59 +0000)]
Remove duplicate prog.

9 years agoFinally, convert counters in struct ifnet to counter(9).
glebius [Sun, 28 Sep 2014 08:57:07 +0000 (08:57 +0000)]
Finally, convert counters in struct ifnet to counter(9).

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoMerged from r183296.
nyan [Sun, 28 Sep 2014 08:23:26 +0000 (08:23 +0000)]
Merged from r183296.

  Add missing library dependencies.

9 years agoConvert to if_inc_counter() last remnantes of bare access to struct ifnet
glebius [Sun, 28 Sep 2014 07:43:38 +0000 (07:43 +0000)]
Convert to if_inc_counter() last remnantes of bare access to struct ifnet
counters.

9 years agoProvide ixgb_get_counter().
glebius [Sun, 28 Sep 2014 07:40:26 +0000 (07:40 +0000)]
Provide ixgb_get_counter().

9 years agoConvert to if_get_counter().
glebius [Sun, 28 Sep 2014 07:29:45 +0000 (07:29 +0000)]
Convert to if_get_counter().

9 years agoFix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices.
adrian [Sun, 28 Sep 2014 07:27:58 +0000 (07:27 +0000)]
Fix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices.

There's a bug in the AR7240 PCIe hardware where a correct BAR will end
up having the device disappear.

It turns out that for the device address it should be all 0's.

However, this meant that the PCI probe code would try writing 0xffffffff
in to see how big the window was, read back 0x0, and think the window
was 32 bits.  It then ended up calculating a resource size of 0 bytes,
failed to find anything via an rman call, and this would fail to attach.

I have quite absolutely no idea how in the various planes of existence
this particular bit of code and how it worked with the PCI bus code
ever worked.  But, well, it did.

Tested:

* Atheros AP93 - AR7240 + AR9280 reference board

9 years agoMechanically switch ixv(4) to if_inc_counter().
glebius [Sun, 28 Sep 2014 07:19:32 +0000 (07:19 +0000)]
Mechanically switch ixv(4) to if_inc_counter().

9 years agoFix the ar724x PCI config space register read.
adrian [Sun, 28 Sep 2014 05:28:11 +0000 (05:28 +0000)]
Fix the ar724x PCI config space register read.

It was doing incorrect things with masks.  This was fixed in the
AR71xx codebase but it wasn't yet fixed in the AR724x code.

This ended up having config space reads return larger/incorrect values
in some situations.

Tested:

* AR7240

TODO:

* test ar7241, AR7242, and AR934x.

9 years agoConvert driver to if_get_counter method.
glebius [Sat, 27 Sep 2014 20:54:57 +0000 (20:54 +0000)]
Convert driver to if_get_counter method.

Submitted by: rstone
Reviewed by: Eric Joyner <ricera10 gmail.com>

9 years agoMechanically convert to if_inc_counter().
glebius [Sat, 27 Sep 2014 20:43:01 +0000 (20:43 +0000)]
Mechanically convert to if_inc_counter().

9 years agoMechanically convert to if_inc_counter().
glebius [Sat, 27 Sep 2014 20:39:24 +0000 (20:39 +0000)]
Mechanically convert to if_inc_counter().

9 years agoFix page length reported for Block Limits VPD page.
mav [Sat, 27 Sep 2014 20:08:34 +0000 (20:08 +0000)]
Fix page length reported for Block Limits VPD page.

9 years agoUse a local STAILQ for unlocked done CCB processing in ahci direct mode
smh [Sat, 27 Sep 2014 19:14:22 +0000 (19:14 +0000)]
Use a local STAILQ for unlocked done CCB processing in ahci direct mode

Previously it was possible for issues e.g. use after free, to result
from processing the done queue while not holding the channel lock.

While this should never happen in practice, unexpected code flows
which result in two threads processing from the same queue may
be possible.

We now use a local STAILQ to prevent this ever being an issue.

Sponsored by: Multiplay

9 years agocxgb(4): implement if_get_counter.
np [Sat, 27 Sep 2014 18:35:16 +0000 (18:35 +0000)]
cxgb(4): implement if_get_counter.

9 years agoUpdate the usage message and the man page to account for the new long
marcel [Sat, 27 Sep 2014 17:58:03 +0000 (17:58 +0000)]
Update the usage message and the man page to account for the new long
options. Bump the version number to 20140927.
While here, use explicit fputc() calls to skip a line in the output.
This to avoid having to hunt for extra '\n' characters in the printf
format strings.

MFC after: 1 week
Relnotes: yes

9 years agoDisable the makeoption with MFS_IMAGE= set as we don't ship that file
bz [Sat, 27 Sep 2014 17:11:51 +0000 (17:11 +0000)]
Disable the makeoption with MFS_IMAGE= set as we don't ship that file
and it thus breaks the default build.   You can still use various other
ways (tools) to embedd the image after the kernel build.

9 years agoDo not pass whole descriptor block size as align to fwdma_malloc_multiseg
kan [Sat, 27 Sep 2014 16:50:24 +0000 (16:50 +0000)]
Do not pass whole descriptor block size as align to fwdma_malloc_multiseg

Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately
to contigalloc. In addition to being wrong, this causes insta-panic in
certain cases due to safety assertion - the alignment is required to be
the power of two and the value we calculate here seldom is.

MFC after:  1 month

9 years agoRemove obsolete compatibility glue and improve firewire code readability.
kan [Sat, 27 Sep 2014 16:50:21 +0000 (16:50 +0000)]
Remove obsolete compatibility glue and improve firewire code readability.

Commit my version of style(9) pass over the firewire code. Now that
other people have started changing the code carrying this is as a
local patch is not longer a viable option.

MFC after: 1 month

9 years agoFix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to
kevlo [Sat, 27 Sep 2014 14:39:00 +0000 (14:39 +0000)]
Fix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to
AT91SAM9G45_IRQ_PIODE.  According to the data sheet, both PIOD and PIOE
use the same IRQ.

While here remove duplicate definitions.

9 years agoUse underlying ports counters to get lagg statistics instead of
melifaro [Sat, 27 Sep 2014 13:57:48 +0000 (13:57 +0000)]
Use underlying ports counters to get lagg statistics instead of
per-packet accounting.
This introduce user-visible changes like aggregating error counters.

Reviewed by: asomers (prev.version), glebius
CR: D781
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoUpdate factor for changes to types in primes, which is a dependency.
sbruno [Sat, 27 Sep 2014 10:57:34 +0000 (10:57 +0000)]
Update factor for changes to types in primes, which is a dependency.

Fixes build-fail on mips32 introduced at 272207.

9 years agoAdd machine/sysreg.h to simplify accessing the system control coprocessor
andrew [Sat, 27 Sep 2014 09:57:34 +0000 (09:57 +0000)]
Add machine/sysreg.h to simplify accessing the system control coprocessor
registers and use it in the ARMv7 CPU functions.

The sysreg.h file has been checked by hand, however it may contain errors
with the comments on when a register was first introduced. The ARMv7 cpu
functions have been checked by compiling both the previous and this version
and comparing the md5 of the object files.

Submitted by: Svatopluk Kraus <onwahe at gmail.com>
Submitted by: Michal Meloun <meloun at miracle.cz>
Reviewed by: ian, rpaulo
Differential Revision: https://reviews.freebsd.org/D795

9 years agoRevert r272189, the committed version was an old version and breaks build.
delphij [Sat, 27 Sep 2014 09:39:19 +0000 (09:39 +0000)]
Revert r272189, the committed version was an old version and breaks build.

Pointy hat to: delphij

9 years agoSwitch primes(6) from using unsigned long to using uint64_t. This fixes
cperciva [Sat, 27 Sep 2014 09:00:38 +0000 (09:00 +0000)]
Switch primes(6) from using unsigned long to using uint64_t.  This fixes
'limited range of type' warnings about comparisons on 32-bit systems, and
allows 32-bit systems to compute the full range of primes.

9 years agoAdd kernel support for the TP-LINK MR3020 Atheros MIPS 24k router.
sbruno [Sat, 27 Sep 2014 08:59:43 +0000 (08:59 +0000)]
Add kernel support for the TP-LINK MR3020 Atheros MIPS 24k router.

AR9331 based system.

Phabric: https://reviews.freebsd.org/D780
Reviewed by: adrian

9 years ago* Split tcp_signature_compute() into 2 pieces:
melifaro [Sat, 27 Sep 2014 07:04:12 +0000 (07:04 +0000)]
* Split tcp_signature_compute() into 2 pieces:
 - tcp_get_sav() - SADB key lookup
 - tcp_signature_do_compute() - actual computation
* Fix TCP signature case for listening socket:
  do not assume EVERY connection coming to socket
  with TCP_SIGNATURE set to be md5 signed regardless
  of SADB key existance for particular address. This
  fixes the case for routing software having _some_
  BGP sessions secured by md5.
* Simplify TCP_SIGNATURE handling in tcp_input()

MFC after: 2 weeks

9 years agocxgbe(4): implement if_get_counter.
np [Sat, 27 Sep 2014 05:50:31 +0000 (05:50 +0000)]
cxgbe(4): implement if_get_counter.

9 years agoRemove an un-needed bit of pre-processor work - it all lives inside
adrian [Sat, 27 Sep 2014 05:14:02 +0000 (05:14 +0000)]
Remove an un-needed bit of pre-processor work - it all lives inside
#ifdef RSS.