freebsd.git
7 years agoComment
dteske [Tue, 13 Dec 2016 02:25:23 +0000 (02:25 +0000)]
Comment

7 years agoWhitespace alignment
dteske [Tue, 13 Dec 2016 02:23:48 +0000 (02:23 +0000)]
Whitespace alignment

7 years agoRelying on dialog auto-sizing (width/height/rows = 0) is a mistake
dteske [Tue, 13 Dec 2016 02:22:21 +0000 (02:22 +0000)]
Relying on dialog auto-sizing (width/height/rows = 0) is a mistake
Use the provided API for calculating the appropriate size of menus

7 years agoRemove unnecessary quotes
dteske [Tue, 13 Dec 2016 02:16:00 +0000 (02:16 +0000)]
Remove unnecessary quotes

7 years agoAdd missing quotes
dteske [Tue, 13 Dec 2016 02:15:36 +0000 (02:15 +0000)]
Add missing quotes

7 years agoIn awk, if you're going to append a newline to your printf
dteske [Tue, 13 Dec 2016 02:14:40 +0000 (02:14 +0000)]
In awk, if you're going to append a newline to your printf
AND you're going to print only the argument, just use print

7 years agoThis statement has too many backslashes
dteske [Tue, 13 Dec 2016 02:13:20 +0000 (02:13 +0000)]
This statement has too many backslashes

7 years agoNeither printf (and as is commonly known) nor print need parens in awk
dteske [Tue, 13 Dec 2016 02:12:00 +0000 (02:12 +0000)]
Neither printf (and as is commonly known) nor print need parens in awk

7 years agoWhitespace and alignment
dteske [Tue, 13 Dec 2016 02:11:09 +0000 (02:11 +0000)]
Whitespace and alignment

7 years agoYou don't need parentheses for awk's printf
dteske [Tue, 13 Dec 2016 02:07:12 +0000 (02:07 +0000)]
You don't need parentheses for awk's printf

7 years agoContinued resolution of conveluted statement
dteske [Tue, 13 Dec 2016 02:04:50 +0000 (02:04 +0000)]
Continued resolution of conveluted statement
We shouldn't be coding things like "x || (x && x) || x || x || x ..."

7 years agoThese two error messages have always been backwards since inception
dteske [Tue, 13 Dec 2016 02:02:14 +0000 (02:02 +0000)]
These two error messages have always been backwards since inception

7 years agoWhy use $? when you can use the command itself
dteske [Tue, 13 Dec 2016 01:59:35 +0000 (01:59 +0000)]
Why use $? when you can use the command itself

7 years agoIf the first ping succeeded, why on Earth should we ping it again?
dteske [Tue, 13 Dec 2016 01:56:28 +0000 (01:56 +0000)]
If the first ping succeeded, why on Earth should we ping it again?

7 years agoStart deconstructing a conveluted hunk of code
dteske [Tue, 13 Dec 2016 01:54:44 +0000 (01:54 +0000)]
Start deconstructing a conveluted hunk of code

7 years agoRemove completely unnecesary parentheses
dteske [Tue, 13 Dec 2016 01:52:10 +0000 (01:52 +0000)]
Remove completely unnecesary parentheses

7 years agoWhy repeat yourself when you can send stderr to the same place as stdout?
dteske [Tue, 13 Dec 2016 01:50:22 +0000 (01:50 +0000)]
Why repeat yourself when you can send stderr to the same place as stdout?

7 years agoProperly quote variable
dteske [Tue, 13 Dec 2016 01:44:18 +0000 (01:44 +0000)]
Properly quote variable

7 years agoUse more generic f_yesno() from provided API
dteske [Tue, 13 Dec 2016 01:42:13 +0000 (01:42 +0000)]
Use more generic f_yesno() from provided API

7 years agoThe output of dialog needs to be sanitized
dteske [Tue, 13 Dec 2016 01:41:06 +0000 (01:41 +0000)]
The output of dialog needs to be sanitized
for portability/compatibility requirements

7 years agoWhitespace alignment
dteske [Tue, 13 Dec 2016 01:39:09 +0000 (01:39 +0000)]
Whitespace alignment

7 years agoSort the domains
dteske [Tue, 13 Dec 2016 01:36:46 +0000 (01:36 +0000)]
Sort the domains

7 years agoThe --no-items and --stdout options are non-standard and should be avoided
dteske [Tue, 13 Dec 2016 01:35:26 +0000 (01:35 +0000)]
The --no-items and --stdout options are non-standard and should be avoided

From the dialog(1) manual:
using [--stdout] in portable scripts is not recommended

7 years agoMore efficiently make use of the exit status
dteske [Tue, 13 Dec 2016 00:27:56 +0000 (00:27 +0000)]
More efficiently make use of the exit status

7 years agoStop repeating strings (centralize prompt string)
dteske [Tue, 13 Dec 2016 00:22:01 +0000 (00:22 +0000)]
Stop repeating strings (centralize prompt string)
NB: Changes to strings now only affect a single line

7 years agoAdd missing backslash (no real effect; it's pedantic and correct for
dteske [Tue, 13 Dec 2016 00:18:51 +0000 (00:18 +0000)]
Add missing backslash (no real effect; it's pedantic and correct for
the interpolation level)

7 years agoUse the oft-neglected awk syntax "startcondition, stopcondition { ... }" to
dteske [Tue, 13 Dec 2016 00:02:59 +0000 (00:02 +0000)]
Use the oft-neglected awk syntax "startcondition, stopcondition { ... }" to
process the range of country labels which appear as columnar list from the
"ifconfig DEV list countries" command. Not only improving maintainability,
but also properly encapsulating arguments in single-quotes instead of
trying to escape whitespace. It is also completely unnecessary to collapse
newlines into whitespace (shell will do this for you automatically upon
expansion of the contents where necessary).

NB: This also changes the sorting algorithm to sort on the country code,
not the country name. The type-ahead feature of dialog is destroyed if the
tags are not sorted properly.

7 years agoQuote WLAN_IFACE (pedantic)
dteske [Mon, 12 Dec 2016 22:57:07 +0000 (22:57 +0000)]
Quote WLAN_IFACE (pedantic)

7 years agoAdd tests for reaper receiving SIGCHLD (r309886).
jilles [Mon, 12 Dec 2016 22:51:29 +0000 (22:51 +0000)]
Add tests for reaper receiving SIGCHLD (r309886).

PR: 213928
MFC after: 2 weeks

7 years agoIn awk, casting a variable as a boolean condition is the same as testing if
dteske [Mon, 12 Dec 2016 21:29:48 +0000 (21:29 +0000)]
In awk, casting a variable as a boolean condition is the same as testing if
the length of the variable contents is greater than zero

This allows us to also move the secondary condition into the action clause

7 years agoRemove an unnecessary call to f_dialog_title_restore()
dteske [Mon, 12 Dec 2016 21:27:29 +0000 (21:27 +0000)]
Remove an unnecessary call to f_dialog_title_restore()

7 years agoWhitespace
dteske [Mon, 12 Dec 2016 21:26:36 +0000 (21:26 +0000)]
Whitespace

7 years agoUtilize provided i18n strings
dteske [Mon, 12 Dec 2016 21:23:47 +0000 (21:23 +0000)]
Utilize provided i18n strings

7 years agoRemove incomplete and unnecessary creation of fd3
dteske [Mon, 12 Dec 2016 21:20:56 +0000 (21:20 +0000)]
Remove incomplete and unnecessary creation of fd3

The provided API already provides a passthru descriptor and even
gives you a varaible for referring to it.

7 years agoRemove unnecessary semi-colons
dteske [Mon, 12 Dec 2016 21:18:24 +0000 (21:18 +0000)]
Remove unnecessary semi-colons

7 years agoUse awk the following (more succinct) awk syntax:
dteske [Mon, 12 Dec 2016 21:16:37 +0000 (21:16 +0000)]
Use awk the following (more succinct) awk syntax:

condition1 { action1 }
condition2 { action2 }

instead of the following syntax:

{
if (condition1) { action1 }
else if (condition2) { action2 }
}

7 years ago1 is the default descriptor for redirects without an fd prefix
dteske [Mon, 12 Dec 2016 21:11:55 +0000 (21:11 +0000)]
1 is the default descriptor for redirects without an fd prefix

7 years agoFix invalid parameter expansion (change $@ to "$@")
dteske [Mon, 12 Dec 2016 21:04:11 +0000 (21:04 +0000)]
Fix invalid parameter expansion (change $@ to "$@")

Without quotes, $@ loses its special meanining (see below)

% sh -c 'echo $@' /bin/sh "   1   " "   2   "
1 2
% sh -c 'echo "$@"' /bin/sh "   1   " "   2   "
   1       2

The quotes are required to get ARGV to be unperterped

7 years agoAllow the script path to contain whitespace and special characters
dteske [Mon, 12 Dec 2016 21:01:20 +0000 (21:01 +0000)]
Allow the script path to contain whitespace and special characters

7 years agoUse provided API to centralize dialog title strings
dteske [Mon, 12 Dec 2016 21:00:09 +0000 (21:00 +0000)]
Use provided API to centralize dialog title strings

7 years agoReorder dialog parameters based on commonality for readability
dteske [Mon, 12 Dec 2016 20:54:20 +0000 (20:54 +0000)]
Reorder dialog parameters based on commonality for readability

7 years agoFix incorrect use of provided API
dteske [Mon, 12 Dec 2016 20:49:49 +0000 (20:49 +0000)]
Fix incorrect use of provided API
The result of which was incorrectly sized menu dialogs

7 years agoUse provided API (change "dialog" to "$DIALOG")
dteske [Mon, 12 Dec 2016 20:43:09 +0000 (20:43 +0000)]
Use provided API (change "dialog" to "$DIALOG")

7 years agoWhitespace (dialog options separated to minimize diffs)
dteske [Mon, 12 Dec 2016 20:41:27 +0000 (20:41 +0000)]
Whitespace (dialog options separated to minimize diffs)

7 years agoed(1): Simplify some checks.
pfg [Mon, 12 Dec 2016 20:25:59 +0000 (20:25 +0000)]
ed(1): Simplify some checks.

The return type for both fread(3) and fwrite(3) cannot be negative, this
renders some checks invalid and variable 'ct' unnecessary.
Also bump 'len' to size_t to avoid signed/unsigned comparison warnings.

7 years agoUse the spibus accessor when applicable.
manu [Mon, 12 Dec 2016 20:04:31 +0000 (20:04 +0000)]
Use the spibus accessor when applicable.

MFC after: 3 days

7 years agoConsolidate redirects into here documents, with proper code indentation
dteske [Mon, 12 Dec 2016 19:46:49 +0000 (19:46 +0000)]
Consolidate redirects into here documents, with proper code indentation

7 years ago- Refactor listening socket list. All of the listening sockets are
hrs [Mon, 12 Dec 2016 19:33:40 +0000 (19:33 +0000)]
- Refactor listening socket list.  All of the listening sockets are
  now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.

There is no functional change except for some minor debug messages.

7 years agoRemove an unnecessary "return $?" at end of function
dteske [Mon, 12 Dec 2016 19:26:55 +0000 (19:26 +0000)]
Remove an unnecessary "return $?" at end of function

7 years agoTemporarily backout the previous commit because it was totally broken due to
hrs [Mon, 12 Dec 2016 19:24:52 +0000 (19:24 +0000)]
Temporarily backout the previous commit because it was totally broken due to
unresolved merge conflicts.

Pointy hat to: hrs

7 years agoUse ternary operator
dteske [Mon, 12 Dec 2016 19:24:32 +0000 (19:24 +0000)]
Use ternary operator

7 years agovfs: use vrefact in getcwd and fchdir
mjg [Mon, 12 Dec 2016 19:16:35 +0000 (19:16 +0000)]
vfs: use vrefact in getcwd and fchdir

7 years agoIf you're not going to make use of the products of a match() in awk
dteske [Mon, 12 Dec 2016 19:12:31 +0000 (19:12 +0000)]
If you're not going to make use of the products of a match() in awk
(e.g., RSTART and RLENGTH variables) then use ~ instead of match()

7 years agoUndo r309891. Konstantin is right in that this condition normally
trasz [Mon, 12 Dec 2016 19:11:04 +0000 (19:11 +0000)]
Undo r309891.  Konstantin is right in that this condition normally
cannot happen - the um_dev field is assigned at mount and never written
to afterwards.

7 years agoNow that these variables do not contain the --default-item flag itself,
dteske [Mon, 12 Dec 2016 19:10:39 +0000 (19:10 +0000)]
Now that these variables do not contain the --default-item flag itself,
change the name of the variable from $def_item_... to $default_...

7 years ago- Refactor listening socket list. All of the listening sockets are
hrs [Mon, 12 Dec 2016 19:10:14 +0000 (19:10 +0000)]
- Refactor listening socket list.  All of the listening sockets are
  now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.

There is no functional change except for some minor debug messages.

7 years agoAlways pass --default-item parameter to dialog
dteske [Mon, 12 Dec 2016 19:09:17 +0000 (19:09 +0000)]
Always pass --default-item parameter to dialog

7 years agoThere is zero harm in always passing --default-item to dialog
dteske [Mon, 12 Dec 2016 19:07:42 +0000 (19:07 +0000)]
There is zero harm in always passing --default-item to dialog

7 years agoCentralize backtitle string
dteske [Mon, 12 Dec 2016 19:01:04 +0000 (19:01 +0000)]
Centralize backtitle string

7 years agoFix regression when stdin/out/err fds are are overridden by shell.
robak [Mon, 12 Dec 2016 18:56:40 +0000 (18:56 +0000)]
Fix regression when stdin/out/err fds are are overridden by shell.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reported by: ngie
Approved by: ngie
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8543

7 years agoUse provided API instead of hard-coded status integers
dteske [Mon, 12 Dec 2016 18:55:41 +0000 (18:55 +0000)]
Use provided API instead of hard-coded status integers

7 years agoWhitespace
dteske [Mon, 12 Dec 2016 18:52:22 +0000 (18:52 +0000)]
Whitespace

7 years agoRemove unnecessary `-n' parameter to head/tail
dteske [Mon, 12 Dec 2016 18:48:00 +0000 (18:48 +0000)]
Remove unnecessary `-n' parameter to head/tail

7 years agoawk(1) match() takes a regex, use /.../ to remind ourselves of this
dteske [Mon, 12 Dec 2016 18:45:52 +0000 (18:45 +0000)]
awk(1) match() takes a regex, use /.../ to remind ourselves of this
NB: The difference between "..." and /.../ for a regex in awk is that
quoted strings go through escape expansion first (e.g., \\ becomes \)

7 years agoBe internally consistent (": > ..." is used elsewhere in this file)
dteske [Mon, 12 Dec 2016 18:43:42 +0000 (18:43 +0000)]
Be internally consistent (": > ..." is used elsewhere in this file)

7 years ago"echo | sed | sed | awk" is silly (changed to "echo | awk")
dteske [Mon, 12 Dec 2016 18:42:55 +0000 (18:42 +0000)]
"echo | sed | sed | awk" is silly (changed to "echo | awk")

7 years agoAdd missing `-e' parameter to sed invocations
dteske [Mon, 12 Dec 2016 18:39:26 +0000 (18:39 +0000)]
Add missing `-e' parameter to sed invocations

7 years agoAllow $BSDINSTALL_TMPETC to contain whitespace or special chars
dteske [Mon, 12 Dec 2016 18:38:18 +0000 (18:38 +0000)]
Allow $BSDINSTALL_TMPETC to contain whitespace or special chars

7 years agoCS ivar is uint32_t, not int.
manu [Mon, 12 Dec 2016 18:36:46 +0000 (18:36 +0000)]
CS ivar is uint32_t, not int.

MFC after: 3 days

7 years agoGroup fallbacks together
dteske [Mon, 12 Dec 2016 18:34:21 +0000 (18:34 +0000)]
Group fallbacks together

7 years agoRemove unnecessary quotes around number in test
dteske [Mon, 12 Dec 2016 18:33:40 +0000 (18:33 +0000)]
Remove unnecessary quotes around number in test

7 years agoChange "[ ! ... ] && ..." to "[ ... ] || ..."
dteske [Mon, 12 Dec 2016 18:29:24 +0000 (18:29 +0000)]
Change "[ ! ... ] && ..." to "[ ... ] || ..."

7 years agoCollapse tiny if statements
dteske [Mon, 12 Dec 2016 18:28:20 +0000 (18:28 +0000)]
Collapse tiny if statements

7 years agoReplace funny block with something easy to digest
dteske [Mon, 12 Dec 2016 18:24:41 +0000 (18:24 +0000)]
Replace funny block with something easy to digest

7 years agoConsolidate locals
dteske [Mon, 12 Dec 2016 18:21:56 +0000 (18:21 +0000)]
Consolidate locals

7 years agoRemove unnecessary local initializers
dteske [Mon, 12 Dec 2016 18:20:56 +0000 (18:20 +0000)]
Remove unnecessary local initializers

7 years agoChange "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]"
dteske [Mon, 12 Dec 2016 18:17:30 +0000 (18:17 +0000)]
Change "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]"

7 years agoEnable ACPI on arm64. It's not yet functional, but it will help keeping the
andrew [Mon, 12 Dec 2016 18:13:03 +0000 (18:13 +0000)]
Enable ACPI on arm64. It's not yet functional, but it will help keeping the
code building until it is ready.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoUse $( ... ) instead of `...`
dteske [Mon, 12 Dec 2016 18:10:33 +0000 (18:10 +0000)]
Use $( ... ) instead of `...`

7 years agoComments
dteske [Mon, 12 Dec 2016 18:05:54 +0000 (18:05 +0000)]
Comments

7 years agoEliminate every mention of PG_CACHED pages from the comments in the machine-
alc [Mon, 12 Dec 2016 17:47:09 +0000 (17:47 +0000)]
Eliminate every mention of PG_CACHED pages from the comments in the machine-
independent layer of the virtual memory system.  Update some of the nearby
comments to eliminate redundancy and improve clarity.

In vm/vm_reserv.c, do not use hyphens after adverbs ending in -ly per
The Chicago Manual of Style.

Update the comment in vm/vm_page.h defining the four types of page queues to
reflect the elimination of PG_CACHED pages and the introduction of the
laundry queue.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8752

7 years agoAdd basic ATF tests for Capability mode .. lookups
cem [Mon, 12 Dec 2016 17:23:09 +0000 (17:23 +0000)]
Add basic ATF tests for Capability mode .. lookups

A follow-up to r309887.

Several tests copied verbatim from
https://github.com/emaste/snippets/blob/master/test_openat.c .

Reviewed by: kib@, ngie@ (earlier version)
X-MFC-With: r309887
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8748

7 years agoApply clear_mask correctly.
br [Mon, 12 Dec 2016 17:08:52 +0000 (17:08 +0000)]
Apply clear_mask correctly.

Reviewed by: jmcneill, kan
Sponsored by: DARPA, AFRL

7 years agoOn non-Intel platforms don't ignore the PCI root bridge mapping in
andrew [Mon, 12 Dec 2016 16:53:55 +0000 (16:53 +0000)]
On non-Intel platforms don't ignore the PCI root bridge mapping in
acpi_set_resource, the mappings are needed on arm64.

Obtained from: ABT Systenms Ltd
Sponsored by: The FreeBSD Foundation

7 years agoclk_div: Add a div lookup table
manu [Mon, 12 Dec 2016 16:43:31 +0000 (16:43 +0000)]
clk_div: Add a div lookup table

Some clocks on SoC have a diff between the value written in the register
and the real divider.
Add a table that where we can lookup the real value of the divider.

Reviewed by: mmel (earlier revision)
Differential Revision: https://reviews.freebsd.org/D8728

7 years agovfs: add vrefact, to be used when the vnode has to be already active
mjg [Mon, 12 Dec 2016 15:37:11 +0000 (15:37 +0000)]
vfs: add vrefact, to be used when the vnode has to be already active

This allows blind increment of relevant counters which under contention
is cheaper than inc-not-zero loops at least on amd64.

Use it in some of the places which are guaranteed to see already active
vnodes.

Reviewed by: kib (previous version)

7 years agoFix gic_cpu_mask() calculation in ARM GIC
jchandra [Mon, 12 Dec 2016 15:35:57 +0000 (15:35 +0000)]
Fix gic_cpu_mask() calculation in ARM GIC

r309616 changed the definition of GICD_ITARGETSR(n) to take the irq
id as argument, but the usage of the macro in gic_cpu_mask() was not
updated to reflect this. This causes the cpu mask to be computed
incorrectly.

Update the GICD_ITARGETSR() call to fix this, this fixes a hang seen
while booting freebsd on qemu-system-aarch64 with SMP enabled.

7 years agoAvoid dereferencing NULL pointers in devtoname(). I've seen it panic,
trasz [Mon, 12 Dec 2016 15:22:21 +0000 (15:22 +0000)]
Avoid dereferencing NULL pointers in devtoname().  I've seen it panic,
called from ufs_print() in DDB.

MFC after: 1 month

7 years agoIncrease interrupt cells in generic_pcie_fdt_route_interrupt
jchandra [Mon, 12 Dec 2016 15:17:56 +0000 (15:17 +0000)]
Increase interrupt cells in generic_pcie_fdt_route_interrupt

ARM GIC specification in device trees use 3 cells, so the current
limit of 2 causes the last cell to be dropped. This in turn can
cause the interrupt polarity and trigger settings to be incorrect.

Increase the limit to 4 which should handle all reasonable cases.
This fixes issues seen in QEMU when registering PCI interrupts.

7 years agoModify IPv6 statistic accounting in ip6_input().
ae [Mon, 12 Dec 2016 11:26:59 +0000 (11:26 +0000)]
Modify IPv6 statistic accounting in ip6_input().

Add rcvif local variable to keep inbound interface pointer. Count
ifs6_in_discard errors in all "goto bad" cases. Now it will count
errors even if mbuf was freed. Modify all places where m->m_pkthdr.rcvif
is used to use local rcvif variable.

Obtained from: Yandex LLC
MFC after: 1 month

7 years agoEnable lookup_cap_dotdot and lookup_cap_dotdot_nonlocal.
kib [Mon, 12 Dec 2016 11:12:04 +0000 (11:12 +0000)]
Enable lookup_cap_dotdot and lookup_cap_dotdot_nonlocal.

Requested and reviewed by: cem
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D8746

7 years agoWhen a zombie gets reparented due to the parent exit, send SIGCHLD to
kib [Mon, 12 Dec 2016 11:11:50 +0000 (11:11 +0000)]
When a zombie gets reparented due to the parent exit, send SIGCHLD to
the reaper.

The traditional reaper init(8) is aware of zombies silently reparented
to it after the parents exit, it loops around waitpid(2) to collect
them.  For other reapers, the silent reparenting is surprising and
collecting zombies requires a thread blocking in waitpid(2) just for
that purpose.  It seems that sending second SIGCHLD is a better
workaround than forcing all reapers to obey the setup.

Reported by:  Michael Zuo <muh.muhten@gmail.com>, jilles
PR: 213928
Reviewed by: jilles (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAdd ip6_tryforward() - a run to completion forwarding implementation
ae [Mon, 12 Dec 2016 10:57:32 +0000 (10:57 +0000)]
Add ip6_tryforward() - a run to completion forwarding implementation
for IPv6.

It gets performance benefits from reduced number of checks. It doesn't
copy mbuf to be able send ICMPv6 error message, because it keeps mbuf
unchanged until the moment, when the route decision has been made.
It doesn't do IPsec checks, and when some IPsec security policies present,
ip6_input() uses normal slow path.

Reviewed by: bz, gnn
Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D8527

7 years agohyperv/hn: Add polling support
sephe [Mon, 12 Dec 2016 05:18:03 +0000 (05:18 +0000)]
hyperv/hn: Add polling support

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8739

7 years agohyperv/vmbus: Add channel polling support.
sephe [Mon, 12 Dec 2016 05:04:55 +0000 (05:04 +0000)]
hyperv/vmbus: Add channel polling support.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8738

7 years agoed(1): Prevent possible overflows during allocation.
pfg [Mon, 12 Dec 2016 03:46:40 +0000 (03:46 +0000)]
ed(1): Prevent possible overflows during allocation.

Make sure the parameters used for malloc(3) can hold size_t sizes.
This should help ed(1) handle bigger data in the future.

MFC after: 2 weeks

7 years agoMerge changes from vendor to address several Coverity issues with
ngie [Mon, 12 Dec 2016 02:21:56 +0000 (02:21 +0000)]
Merge changes from vendor to address several Coverity issues with
contrib/libarchive's tests

MFC after: 2 weeks
Obtained from: libarchive (ebe29c, fd0ea2, f9e3de)
Reported by: Coverity

7 years agoWe currently don't do TSO if ip options are present. In case of IPv6, we look at
hiren [Sun, 11 Dec 2016 23:14:47 +0000 (23:14 +0000)]
We currently don't do TSO if ip options are present. In case of IPv6, we look at
in6p_options to check that. That is incorrect as we carry ip options in
in6p_outputopts. Also, just checking for in6p_outputopts being NULL won't
suffice as we combine ip options and ip header fields both in that one field.
The commit fixes this by using ip6_optlen() which correctly calculates length
of only ip options for IPv6.

Reviewed by:     ae, bz
MFC after:     3 weeks
Sponsored by:     Limelight Networks

7 years agoPostpone ZVOL media/block size caching till first open.
mav [Sun, 11 Dec 2016 19:50:39 +0000 (19:50 +0000)]
Postpone ZVOL media/block size caching till first open.

At least on FreeBSD there are no legal way to access media or get its
size without opening device/provider first.  Postponing this caching
allows to skip several disk seeks per ZVOL/snapshot during import.

For HDD pool with 1 ZVOL in dev mode with 1000 snapshots this reduces
pool import time from 40 to 10 seconds.

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

7 years agoWhen tmpfs and POSIX shm pagein a page for the sole purpose of performing
alc [Sun, 11 Dec 2016 19:24:41 +0000 (19:24 +0000)]
When tmpfs and POSIX shm pagein a page for the sole purpose of performing
truncation, immediately queue the page for asynchronous laundering rather
than making the page pass through inactive queue first.

Reviewed by: kib, markj