Commit Graph

210342 Commits

Author SHA1 Message Date
Andrey V. Elsukov
4bd916567e Change the type of 'etlv' field in struct named_object to uint16_t.
It should match with the type field in struct ipfw_obj_tlv.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-04-14 21:52:31 +00:00
Warner Losh
a6e0c5da99 New CAM I/O scheduler for FreeBSD. The default I/O scheduler is the same
as before. The common scheduling bits have moved from inline code in
each of the CAM periph drivers into a library that implements the
default scheduling.

In addition, a number of rate-limiting and I/O preference options can
be enabled by adding CAM_IOSCHED_NETFLIX to your config file. A number
of extra stats are also maintained. CAM_IOSCHED_NETFLIX isn't on by
default because it uses a separate BIO_READ and BIO_WRITE queue, so
doesn't honor BIO_ORDERED between these two types of operations. We
already didn't honor it for BIO_DELETE, and we don't depend on
BIO_ORDERED between reads and writes anywhere in the system (it is
currently used with BIO_FLUSH in ZFS to make sure some writes are
complete before others start and as a poor-man's soft dependency in
one place in UFS where we won't be issuing READs until after the
operation completes). However, out of an abundance of caution, it
isn't enabled by default.

Plus, this also brings in NCQ TRIM support for those SSDs that support
it. A black list is also provided for known rogues that use NCQ trim
as an excuse to corrupt the drive. It was difficult to separate out
into a separate commit.

This code has run in production at Netflix for over a year now.

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D4609
2016-04-14 21:47:58 +00:00
Andrey V. Elsukov
f8e26ca319 Adjust some comments and make ref_opcode_object() static. 2016-04-14 21:45:18 +00:00
Andrey V. Elsukov
b2df1f7ea1 o Teach opcode rewriting framework handle several rewriters for
the same opcode.

o Reduce number of times classifier callback is called. It is
  redundant to call it just after find_op_rw(), since the last
  does call it already and can have all results.

o Do immediately opcode rewrite in the ref_opcode_object().
  This eliminates additional classifier lookup later on bulk update.
  For unresolved opcodes the behavior still the same, we save information
  from classifier callback in the obj_idx array, then perform automatic
  objects creation, then perform rewriting for opcodes using indeces
  from created objects.

Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
2016-04-14 21:31:16 +00:00
Enji Cooper
fbcdfe1d5b Clean up trailing whitespace in lib/libcam; no functional change
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-04-14 21:10:53 +00:00
Bryan Drewery
fdff4951ca META_MODE: Pass along the default sysroot in bootstrap-tools to avoid rebuilds later.
Some of the clang libraries build in this phase and the cross-tools
phase.  Later in the cross-tools phase when they build with a default
TOOLS_PREFIX, they see a changed build command in meta mode due to
the changed DEFAULT_SYSROOT.  This is avoided by passing along
TOOLS_PREFIX earlier.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:09:03 +00:00
Bryan Drewery
d1dd034d07 META_MODE: Don't rebuild build-tools targets during normal build.
This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build.  Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:06:10 +00:00
Bryan Drewery
d7296a8fae Implement the dependency condition more safely.
Nested : are not handled well without "".

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:49 +00:00
Bryan Drewery
2d9796bd24 Follow-up r297835: Let the intented default cookie work.
This happened to work for not prepending .OBJDIR twice but broke the
other case of prepending it when needed.

Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:45 +00:00
Bryan Drewery
94086cea27 Rework META_TARGETS so that it automatically adds META_DEPS to the targets.
This will only be done if the target is defined, so if the target is
defined after bsd.sys.mk is included then it needs to manually add
${META_DEPS} still.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:42 +00:00
Bryan Drewery
a561b1060c Mark some more .PHONY targets.
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:37 +00:00
Andrey V. Elsukov
f976a4edc0 Move several functions related to opcode rewriting framework from
ip_fw_table.c into ip_fw_sockopt.c and make them static.

Obtained from:	Yandex LLC
2016-04-14 20:49:27 +00:00
Alexander Motin
212fad7469 Extract virtual port address from RQSTYPE_RPT_ID_ACQ.
This should close the race between request arriving on new target mode
virtual port and its scanner thread finally fetch its address for request
routing.
2016-04-14 20:49:01 +00:00
Michael Tuexen
4d6b853ad6 Allow the handling of ICMP messages sent in response to SCTP packets
containing an INIT chunk. These need to be handled in case the peer
does not support SCTP and returns an ICMP messages indicating destination
unreachable, protocol unreachable.

MFC after:	1 week
2016-04-14 19:59:21 +00:00
Michael Tuexen
f77b842746 When delivering an ICMP packet to the ctlinput function, ensure that
the outer IP header, the ICMP header, the inner IP header and the
first n bytes are stored in contgous memory. The ctlinput functions
currently rely on this for n = 8. This fixes a bug in case the inner IP
header had options.
While there, remove the options from the outer header and provide a
way to increase n to allow improved ICMP handling for SCTP. This will
be added in another commit.

MFC after:	1 week
2016-04-14 19:51:29 +00:00
Bryan Drewery
9b8f7eaf6a Define the *soft targets properly.
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 19:29:35 +00:00
Bryan Drewery
add7a95518 Follow-up r284673: /usr/lib32/libc_pic.a is still installed, just not the profiled libs.
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 19:26:29 +00:00
Alan Somers
f0ac053088 Update a debugging message in vdev_geom_open_by_guids for consistency with
similar messages elsewhere in the file.

MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
2016-04-14 19:20:31 +00:00
Luiz Otavio O Souza
de89d74b70 Do not overwrite the dchg variable.
It does not cause any real issues because the variable is overwritten
only when the packet is forwarded (and the variable is not used anymore).

Obtained from:	pfSense
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
2016-04-14 18:57:30 +00:00
Luiz Otavio O Souza
db1bbde602 Make pfctl(8) more flexible when parsing bandwidth values.
This is the current behaviour in OpenBSD and a similar patch exist in
pfSense too.

Obtained from:	OpenBSD (partly - rev. 1.625)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
2016-04-14 18:37:40 +00:00
Pedro F. Giffuni
ab341f7afd libpcap: fix for simple NULL pointer dereference.
Found with devel/coccinelle.
2016-04-14 18:31:45 +00:00
Mariusz Zaborski
7f6a709bef Set NULL to the ai_next pointer which fix cap_getaddrinfo().
Add regression test case.

PR:		195551
Submitted by:	Mikhail <mp39590@gmail.com>
Approved by:	pjd (mentor)
2016-04-14 18:27:10 +00:00
Andrey V. Elsukov
7b34dbe450 Fix output formatting of O_UNREACH6 opcode.
Obtained from:	Yandex LLC
2016-04-14 18:22:08 +00:00
Mark Johnston
ce2761f128 Include -a in the nextboot(8) usage string.
X-MFC-With: r297772
2016-04-14 18:03:55 +00:00
Pedro F. Giffuni
b93c97c14a risc-v: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change.

Found with devel/coccinelle.
2016-04-14 17:25:50 +00:00
Pedro F. Giffuni
d9ca4bc073 isa/pnp: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change.

Found with devel/coccinelle.
2016-04-14 17:20:35 +00:00
Jamie Gritton
44c16975a2 Clean up some style(9) violations. 2016-04-14 17:07:26 +00:00
Pedro F. Giffuni
7f5b12538b RPC: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change.

Found with devel/coccinelle.
2016-04-14 17:06:37 +00:00
Pedro F. Giffuni
a3269b0863 x86: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change.

Found with devel/coccinelle.
2016-04-14 17:04:06 +00:00
Ed Maste
7481f0978a arm64 libc: hide .cerror, .curbrk, .minbrk for WITHOUT_SYMVER
When symver is in use these are hidden because they're not listed in
the Symbol.map. Add an explicit .hidden so they are also hidden in the
WITHOUT_SYMVER case.

Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5775
2016-04-14 16:32:27 +00:00
Andrew Turner
820d50e549 Sort so pic_if.m is in the correct location with the other kern files.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-04-14 15:52:11 +00:00
Ruslan Bukin
5be589603e Unmagic the thread pointer offset. 2016-04-14 15:31:05 +00:00
Andrew Turner
a48bd01151 Fix the types for the start, end, and count arguments to
arm_gic_fdt_alloc_resource. These were the old u_long where they should be
rman_res_t. Both of these are the same size on arm64 so this is just for
correctness, and would not have led to incorrect behaviour.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2016-04-14 14:44:23 +00:00
Hans Petter Selasky
ebcd5b5b31 Remove some unused fields.
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-04-14 14:11:32 +00:00
Hans Petter Selasky
b03aadaffc Ensure the received IP header gets 32-bits aligned.
The FreeBSD's TCP/IP stack assumes that the IP-header is 32-bits aligned
when decoding it. Else unaligned 32-bit memory access can happen, which
not all processor architectures support.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-04-14 14:10:40 +00:00
Hans Petter Selasky
617e1ff301 Add missing port_up checks.
When downing a mlxen network adapter we need to check the port_up variable
to ensure we don't continue to transmit data or restart timers which can
reside in freed memory.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2016-04-14 14:01:28 +00:00
Marcelo Araujo
a5de41c600 Use NULL instead of 0 for pointers.
fopen(3) will return NULL in case it can't open the STREAM.
2016-04-14 12:53:38 +00:00
Marcelo Araujo
d11537c785 Use NULL instead of 0 for pointers.
The malloc will return a pointer to the allocated memory if successful,
otherwise a NULL pointer is returned.
2016-04-14 12:51:06 +00:00
Alexander Motin
4f6dd82a2f Remove watchdog timer stop check.
There are bunch of reports that this check fails at least on Nuvoton
NCT6776 chips.  I don't see why this check needed there, and Linux does
not have it either.  So far this check only made watchdogd unstopable.

MFC after:	1 month
2016-04-14 12:50:27 +00:00
Marcelo Araujo
45be165f23 Use NULL instead of 0 for pointers.
The strchr(3) returns a NULL if the character does not appears in the string.
The malloc will return NULL if cannot allocate memory.
2016-04-14 12:46:46 +00:00
Marcelo Araujo
fa02fc2d8f Use NULL instead of 0 for pointers.
fopen(3) will return NULL in case it can't open the STREAM.
The malloc will return a pointer to the allocated memory if successful,
otherwise a NULL pointer is returned.

Also add an extra DEBUG1 to print out the error to open a file.

Reviewed by:	ed
Differential Revision:	https://svnweb.freebsd.org/changeset/base/297959
2016-04-14 12:25:00 +00:00
Marcelo Araujo
f9e059ac83 Use NULL instead of 0 for pointers.
fopen(3) returns a FILE pointer, otherwise NULL is returned.

MFC after:	2 weeks
2016-04-14 11:41:30 +00:00
Andrew Turner
f8a39033c2 Set the upper limit of the DMAP region to the limit of RAM as was found in
the physmap. This will reduce the likelihood of an issue where we have
device memory mapped in the DMAP. This can only happen if it is within the
same 1G block of normal memory.

Reviewed by:	kib
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5938
2016-04-14 10:43:28 +00:00
Warner Losh
9a8fa125c1 Bump bio_cmd and bio_*flags from 8 bits to 16.
Differential Revision: https://reviews.freebsd.org/D5784
2016-04-14 05:10:41 +00:00
Warner Losh
bd3bce41db Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the
system. This uses the hints mechnanism. This mostly works today
because when there's no static hints (the default), this value can be
fetched from the hint. When there is a static hints file, the hint
passed from the boot loader to the kernel is ignored, but for the BIOS
case we're able to find it anyway. However, with UEFI, the fallback
doesn't work, so we get a panic instead.

Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to
generate the old values to allow for transitions. In addition, fall
back to the old method if the new method isn't present.

Add comments about all this.

Differential Revision: https://reviews.freebsd.org/D5866
2016-04-14 04:59:51 +00:00
Enji Cooper
47754aa240 Disable fmaxmin_test when compiling it with clang 3.8.0
The testcase always fails today due to how C11 7.6.1/2 is interpreted
with clang 3.8.0 when combined with "#pragma STDC FENV_ACCESS ON".

This testcase passes with clang <3.8.0 and gcc, so continue testing it
with those compiler combinations

More intelligent discussion on the issue is in the PR

MFC after: never
PR: 208703
Sponsored by: EMC / Isilon Storage Division
2016-04-14 04:40:31 +00:00
Warner Losh
d303752b50 Add comment about where b_iocmd and b_ioflags come from. 2016-04-14 04:16:31 +00:00
Bryan Drewery
f79bedf5ad Regenerate 2016-04-14 01:20:00 +00:00
Bryan Drewery
96a3b88510 Build libpam modules in parallel.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 01:17:37 +00:00
Bryan Drewery
7cbd0a2953 Simplify building libpam and fix libpam.a not containing the modules since r284345.
The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.

Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a  The main lib/libpam/libpam will only create a
shared library.  No redundancy in compilation or installation exists
in this solution.

This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 01:17:03 +00:00