]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r314657:
ngie [Tue, 30 May 2017 04:13:06 +0000 (04:13 +0000)]
MFC r314657:

kerberos5: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

7 years agoMFC r314651,r318439,r318440:
ngie [Tue, 30 May 2017 04:11:12 +0000 (04:11 +0000)]
MFC r314651,r318439,r318440:

r314651:

sys/modules: normalize .CURDIR-relative paths to SRCTOP

This simplifies make output/logic

Tested with: `cd sys/modules; make ALL_MODULES=` on amd64

r318439:

Normalize .PATH on SRCTOP

This will help Jenkins dedupe 9 warnings between the static build and
the module build of ipsec(4).

Missed in SRCTOP conversion in r314651.

MFC with: r314651

r318440:

Normalize SYSDIR on SRCTOP instead of .CURDIR

This is being done to simplify pathing for CFLAGS and source files.

7 years agoMFC r307698:
ngie [Tue, 30 May 2017 04:00:26 +0000 (04:00 +0000)]
MFC r307698:
r307698 (by lwhsu):

- Add required header for fixing `make` in sys/modules/gpio

7 years agoMFC r308161:
ngie [Tue, 30 May 2017 03:55:38 +0000 (03:55 +0000)]
MFC r308161:
r308161 (by lwhsu):

- Fix `make` in sys/modules/bhnd

7 years agoMFC r318606:
cy [Tue, 30 May 2017 03:33:48 +0000 (03:33 +0000)]
MFC r318606:

Refactor & compact struct i6addr_t #ifdef: remove redundant structure
definintion when USE_INET6 is false.

7 years agoMFC r318588:
cy [Tue, 30 May 2017 03:30:53 +0000 (03:30 +0000)]
MFC r318588:

Fix up two assertions following malloc(). vangyzen@ notified me of
the second one. The first one is fixed as well.

Reported by: vangyzen@

7 years agoMFC r318578:
cy [Tue, 30 May 2017 03:27:59 +0000 (03:27 +0000)]
MFC r318578:

Fix non-recoverable name resolution failures due to negative cache
entries never expiring. This patch honours the negative cache timeout.

To test/experience the failure do the following:

1. Edit /etc/ncd.conf to adjust the cache timeouts as follows:

positive-time-to-live hosts 30
negative-time-to-live hosts 1

2. Ensure that nsswitch.conf hosts line contains something like:

hosts: files cache dns

Note that cache must be specified before dns.

3. Start nscd.

4. Run the following command:

while true; do nc -z -w 3 www.google.com 80; sleep 5; done

5. While running the command, remove or comment out all nameserver
   statements in /etc/resolv.conf. After a short while you will notice
   non-recoverable name rsolution failures.

6. Uncomment or replace all nameserver statements back into
   /etc/resolv.conf. Take note that name resolution never recovers.
   To recover nscd must be restarted. This patch fixes this.

PR: 207804
Submitted by: Jov <amutu@amutu.com>

7 years agoMFC r318745:
cy [Tue, 30 May 2017 03:25:05 +0000 (03:25 +0000)]
MFC r318745:

Remove redundant variable declaration.

7 years agoMFC r315368:
cy [Tue, 30 May 2017 03:22:18 +0000 (03:22 +0000)]
MFC r315368:

calloc() and realloc() modernization.

This commit replaces calloc calls, which called calloc() as if it were
malloc() by allocating a multiple of objects as a sizeof multiplied by
the number of objects. The patch rectifies this by calling calloc() as
it was meant to be called.

This commit also replaces realloc() with reallocarray() in a similar
fashion as above. Instead of calculating the memory to reallocated
(changed) by multiplying sizeof by the number of objects, the sizeof
and number are passed as separate arguments to reallocarray(), letting
reallocarray() do the multiplication instead. Like the calloc()
adjustment above, this is approach is cleaner and more elegant than
than the previous code.

This has been tested on my production firewall and a laptop (also
running ipfilter).

Submitted by: pfg

7 years agoMFC r318006:
ngie [Tue, 30 May 2017 03:10:05 +0000 (03:10 +0000)]
MFC r318006:

style(9): sort headers and remove duplicates

7 years agoMFC r312913,r318100,r318107:
ngie [Tue, 30 May 2017 03:09:01 +0000 (03:09 +0000)]
MFC r312913,r318100,r318107:

r312913 (by asomers):

Improve the aio tests

* Add tests for aio_suspend(2).
* Add tests for polled completion notification.
* Test the full matrix of file descriptor types and completion notification
  mechanisms.
* Don't bother with mkstemp, because ATF runs every test in its own temp dir.
* Fix some typos.
* Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.

r318100:

style(9): move function definition curly braces to column 0

r318107:

Remove unused constant (PATH_TEMPLATE)

It was made unnecessary in r312913.

MFC with: r312913

7 years agoMFC r318094,r318098,r318099:
ngie [Tue, 30 May 2017 03:05:22 +0000 (03:05 +0000)]
MFC r318094,r318098,r318099:

r318094:

style(9): clean up trailing whitespace

r318098:

Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO

This is being done to reduce duplication between the two macros.

r318099:

Print out when unsafe AIO is enabled to debugging purposes

7 years agoMFC r318007,r318008,r318009,r318011:
ngie [Tue, 30 May 2017 03:02:07 +0000 (03:02 +0000)]
MFC r318007,r318008,r318009,r318011:

r318007:

Add intermediary Makefile for compiling all items in the directory

r318008:

Only compile tests/ if MK_TESTS != no or ALL_MODULES is defined

r318009:

Add MK_TESTS to kern.opts.mk to support r31800

MFC with: r318008
Pointyhat to: ngie

r318011:

Mark this Makefile SUBDIR_PARALLEL

I inserted the necessary SUBDIR+= .WAIT in the previous commit

7 years agoMFC r319015:
ngie [Tue, 30 May 2017 02:56:17 +0000 (02:56 +0000)]
MFC r319015:

Use calloc instead of malloc + memset

7 years agoMFC r318010:
ngie [Tue, 30 May 2017 02:53:00 +0000 (02:53 +0000)]
MFC r318010:

style(9): sort headers

7 years agoMFC r318591: compress: Add basic tests.
jilles [Mon, 29 May 2017 21:48:02 +0000 (21:48 +0000)]
MFC r318591: compress: Add basic tests.

7 years agoMFC r317313:
ngie [Mon, 29 May 2017 18:19:32 +0000 (18:19 +0000)]
MFC r317313:

gctl_test.t: catch errors with the mdcfg directive

While here, add a note about certain testcases relying on `count=1024` in
the "create" portion.

7 years agoMFC r314659,r314676:
ngie [Mon, 29 May 2017 18:17:34 +0000 (18:17 +0000)]
MFC r314659,r314676:

r314659:

usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

r314676:

Fix build after r314656

Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
          committing them.

(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery

7 years agoMFC r318788:
pfg [Mon, 29 May 2017 15:24:45 +0000 (15:24 +0000)]
MFC r318788:
bhyvegc_resize: make use of reallocarray(3) for bounds-checking.

Also add __FBSDID.

Reviewed by: grehan

7 years agoMFC r318446:
kib [Mon, 29 May 2017 13:25:55 +0000 (13:25 +0000)]
MFC r318446:
Update my copyright, note The FreeBSD Foundation involvement.

7 years agoMFC direct execution mode for rtld.
kib [Mon, 29 May 2017 13:24:27 +0000 (13:24 +0000)]
MFC direct execution mode for rtld.

MFC r318313:
Make ld-elf.so.1 directly executable.

MFC r318352 (by jonathan):
Rename rtld's parse_libdir to parse_integer.

MFC r318380:
Pretend that there is some security when executing in direct mode.

MFC r318431 (by jonathan):
Allow rtld direct-exec to take a file descriptor.

MFC r318445:
Fix style, add static keyword before static function definition.

MFC r318739:
For ld.so direct execution mode, implement -p option.

7 years agoMFC r318312:
kib [Mon, 29 May 2017 13:18:20 +0000 (13:18 +0000)]
MFC r318312:
Fix the AT_EXECFD functionality.

7 years agoMFC r318318:
kib [Mon, 29 May 2017 13:17:00 +0000 (13:17 +0000)]
MFC r318318:
Ensure that resume path on amd64 only accesses page tables for normal
operation after processor is configured to allow all required
features.

7 years agoMFC r318303:
kib [Mon, 29 May 2017 12:55:26 +0000 (12:55 +0000)]
MFC r318303:
Style.

7 years agoMFC r318299:
kib [Mon, 29 May 2017 12:53:44 +0000 (12:53 +0000)]
MFC r318299:
Simplify cleanup on failure in realpath(3).

7 years agoMFC r318298:
kib [Mon, 29 May 2017 12:52:13 +0000 (12:52 +0000)]
MFC r318298:
Fix several buffer overflows in realpath(3), and other minor issues.

PR: 219154

7 years agoMFC r318632, r318633:
royger [Mon, 29 May 2017 11:37:08 +0000 (11:37 +0000)]
MFC r318632, r318633:

bsdinstall: mount is not needed for the ZFS install case
bsdinstall: do not use distextract in scripted mode

7 years agoMFC r314659,r314676:
ngie [Mon, 29 May 2017 10:15:41 +0000 (10:15 +0000)]
MFC r314659,r314676:

r314659:

usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

r314676:

Fix build after r314656

Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
          committing them.

(YUGE) Pointyhat to: ngie
In collaboration with: bdrewery

7 years agoMFC r315561:
ngie [Mon, 29 May 2017 06:31:07 +0000 (06:31 +0000)]
MFC r315561:
r315561 (by trasz):

Bring back the "i".  The point is to make it easy to find via "apropos
iscsi", along with all the other relevant components.

7 years agoMFC r316179,r316180,r316181,r316260:
ngie [Mon, 29 May 2017 06:26:00 +0000 (06:26 +0000)]
MFC r316179,r316180,r316181,r316260:

r316179 (by cem):

t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow

msgsnd's msgsz argument is the size of the message following the 'long'
message type.  Don't include the message type in the size of the message
when invoking msgsnd(2).

CID: 1368712

r316180 (by cem):

Follow-up to r316179: More of the same

CIDs: 1368705136870613687071368710

r316181 (by cem):

t_msgctl: Fix the same msgsnd() misuse as t_msgsnd

msgsnd(2)'s msgsz argument does not describe the full structure, only the
message component.

CIDs: 13687031368711

r316260:

Annotate all changes made in r316178-r316180 with __FreeBSD__

Restore the stock (upstream) code under an #else block, so it's easier
for me to visualize and understand the code that needs to be upstreamed.

7 years agoMFC r318315:
ngie [Mon, 29 May 2017 06:15:41 +0000 (06:15 +0000)]
MFC r318315:

lib/libc/gen/realpath_test: make check result from getcwd(3)

This is being done to avoid dereferencing a NULL pointer via strlcat,
obscuring the underlying issue with the getcwd(3) call.

7 years agoMFC r308826: zfs: fix up after the removal of PG_CACHED pages in r308691
avg [Mon, 29 May 2017 06:15:06 +0000 (06:15 +0000)]
MFC r308826: zfs: fix up after the removal of PG_CACHED pages in r308691

Now that r308691 has been MFC-ed as a part of r318716,
r308826 must be MFC-ed as well.

PR: 214629
Reported by: mshirk@daemon-security.com [head], lev [stable/11]

7 years agoMFC r318688: "struct ata_params" field "reserved206[2]" actually starts at
rpokala [Mon, 29 May 2017 05:22:34 +0000 (05:22 +0000)]
MFC r318688: "struct ata_params" field "reserved206[2]" actually starts at
offset 20*7*.

Sponsored by: Panasas

7 years agoMFC r318906:
dim [Sun, 28 May 2017 18:18:01 +0000 (18:18 +0000)]
MFC r318906:

Pull in r303257 from upstream llvm trunk (by Krzysztof Parzyszek)

  [PPC] Properly update register save area offsets

  The variables MinGPR/MinG8R were not updated properly when resetting the
  offsets, which in the included testcase lead to saving the CR register
  in the same location as R30.

  This fixes another issue reported in PR26519.

  Differential Revision: https://reviews.llvm.org/D33017

Reported by: Mark Millard
PR: 206990

7 years agoMFC r318860:
hselasky [Sun, 28 May 2017 10:43:16 +0000 (10:43 +0000)]
MFC r318860:
Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of
binary data from sound.ko and the kernel.

7 years agoMFC r315698:
ngie [Sun, 28 May 2017 06:31:52 +0000 (06:31 +0000)]
MFC r315698:

libkvm: bump WARNS to 6 after recent commits done to resolve warnings issues

Tested with: make tinderbox; clang 4.0.0 (amd64), gcc 4.2.1/6.3.0 (amd64)

7 years agoMFC r318872:
gjb [Sun, 28 May 2017 03:59:33 +0000 (03:59 +0000)]
MFC r318872:
 Enable DHCP and IPv6 autoconfig on non-cloud VM images.

PR: 203653
Sponsored by: The FreeBSD Foundation

7 years agoMFC r309412,r316109,r316132:
ngie [Sun, 28 May 2017 01:08:46 +0000 (01:08 +0000)]
MFC r309412,r316109,r316132:

r309412 (by imp):

dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

r316109:

Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead

This is a better pattern to follow when creating the bootloaders and doing
the relevant space checks to make sure that the sizes aren't exceeded (and
thus, copy-pasting is a bit less error prone).

r316132:

Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/...

This is being done to make it easier to change in the future--this action might be
needed sooner rather than later because of gcc 6.3.0 bailing, stating that there
is negative free space left (deficit) in the boot2 bootloader.

7 years agoMFC r316131:
ngie [Sun, 28 May 2017 00:45:02 +0000 (00:45 +0000)]
MFC r316131:

Fix up r316081 by using nitems(cam_errbuf) instead of sizeof(cam_errbuf)

Part of my original reasoning as far as converting the snprintf
calls was to permit switching over from char[] to wchar_t[] in the
future, as well as futureproof in case cam_errbuf's size was ever
changed.

Unfortunately, my approach was bugged because it conflated the
number of items with the size of the buffer, instead of the number of
elements being a fixed size != 1 byte.

Use nitems(..) instead which counts the quantity of items of a specific
type, as opposed to an unqualified sizeof(..) (which assumes that the
number of characters is equal to the buffer size).

Noted by: cem

7 years agoMFC r317310,r317316:
ngie [Sun, 28 May 2017 00:25:41 +0000 (00:25 +0000)]
MFC r317310,r317316:

r317310:

Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

r317316:

Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

7 years agoMFC r314833
rgrimes [Sun, 28 May 2017 00:13:44 +0000 (00:13 +0000)]
MFC r314833
Convert absolute links to relative links.
Style.Makefile(9) has been ignored to produce minimal diffs.

MFC r314837
The relative symlink fix causes downstream issues for
EMC DELL Isilon so revert the relative symlink fix
pending a better solution.

Reported by: ngie

MFC r315091
Revert r314833 until the problem with INSTALL_RSYMLINKS can be found
as it appears to break arm release builds.

PR: 217705
Reported by: cyclaero@gmail.com

Approved by: grehan (mentor)

7 years agoMFC r317290,r317291,r317292,r317293,r317294,r317295,r317304,r317306,r317307,r317308...
ngie [Sat, 27 May 2017 23:31:51 +0000 (23:31 +0000)]
MFC r317290,r317291,r317292,r317293,r317294,r317295,r317304,r317306,r317307,r317308,r317309:

r317290:

Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h
#include below the stdio.h #include.

gctl_dump(3) needs stdio.h, per reasoning noted in r317289.

PR: 218809

r317291:

Rename gctl.t to gctl_test.t and test.c to gctl_test_helper.c

This is being done to reduce ambiguity and to make the tests more portable
in the future to other locations in the source tree.

r317292:

gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly

r317293:

gctl_test_helper: apply polish

- Staticize variables to fix warnings.
- Sprinkle asserts around for calls that can fail
- Apply style(9) for main(..) definition.
- ANSIify usage(..) definition.

r317294:

Bump WARNS to 6 per previous commits which fixed warnings

Tested with: clang (4.0), gcc (4.2.1, 6.3.0)

r317295:

The GPT class no longer exists; use the PART class instead

r317304:

gctl_test_helper: add diagnostic output for parse_retval(..)

This will help end-users better diagnose issues with the function.

r317306:

gctl_test.t: minor tweaks

- Declare $count with the `my` scope operator to permit `use strict`.
- Add `use strict`.
- Use `use warnings` instead of using `-w` in the shebang.
- Don't unlink $cmd when done (prevents unnecessary rebuilding).
- Improve the error message when running with insufficient permissions, e.g.,
  non-root.

r317307:

Use verb=delete not verb=remove

The `remove` verb hasn't been present in geom_part*(4) for well
over a decade, if ever. I couldn't find any references to it in
^/stable/5 at least, which is around the timeframe that this test
was written.

r317308:

gctl_test.t: more tweaks to try and update the code and get it functional (again?)

- Make the logfile for $out be built off the basename for $cmd, instead of $cmd.
  (r317292 broke this assumption).
- Rename $mntpt to $mntpt_prefix for clarity, as this variable is a prefix for
  mountpoints.
- Reindent the umount directive block while here to match the rest of the code.

r317309:

gctl_test.t: improve error reporting with mdcfg and mount directives

If the commands had failed previously, it would press on and result in a
series of cascading failures. Fail early and continue on to the next case
instead of executing additional commands after a previously failed series
of steps.

7 years agoMFC r319010:
ngie [Sat, 27 May 2017 23:24:33 +0000 (23:24 +0000)]
MFC r319010:

Fix #if conditional added in r319008

I committed an earlier version of the file by accident

This is a no-op on ^/head and ^/stable/11.

7 years agoMFC r319008:
ngie [Sat, 27 May 2017 23:20:28 +0000 (23:20 +0000)]
MFC r319008:

kvm_geterr_test: Compile out the portions that require kvm_open2(3) on
systems that lack the libcall, based on __FreeBSD_version.

kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11,
but not ^/stable/10. This makes some of kvm_geterr_test available for testing
on ^/stable/10.

7 years agoMFC r316099:
ngie [Sat, 27 May 2017 23:04:40 +0000 (23:04 +0000)]
MFC r316099:

lib/libkvm: start adding basic tests for kvm(3)

- kvm_close: add a testcase to verify support for errno = EINVAL / -1
  (see D10065) when kd == NULL is provided to the libcall.
- kvm_geterr:
-- Add a negative testcase for kd == NULL returning "" (see D10022).
-- Add two positive testcases:
--- test the error case using kvm_write on a O_RDONLY descriptor.
--- test the "no error" case using kvm_read(3) and kvm_nlist(3) as
    helper routines and by injecting a bogus error message via
    _kvm_err (an internal API) _kvm_err was used as there isn't a
    formalized way to clear the error output, and because
    kvm_nlist always returns ENOENT with the NULL terminator today.
- kvm_open, kvm_open2:
-- Add some basic negative tests for kvm_open(3) and kvm_open2(3).
   Testing positive cases with a specific
   `corefile`/`execfile`/`resolver` requires more work and would require
   user intervention today in order to reliably test this out.

7 years agoMFC r318546:
ngie [Sat, 27 May 2017 22:59:23 +0000 (22:59 +0000)]
MFC r318546:

sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic

The previous logic was flawed in the sense that it assumed that /dev/md3
was always available. This was a caveat I noted in r306038, that I hadn't
gotten around to solving before now.

Cache the device for the mountpoint after executing mdmfs, then use the
cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
device.

Apply sed expressions to use reuse logic in the NetBSD code that could
also be applied to FreeBSD, just with different tools.

7 years agoMFC r317288,r317289:
ngie [Sat, 27 May 2017 22:57:10 +0000 (22:57 +0000)]
MFC r317288,r317289:

r317288:

libgeom(3): apply minor polish

- Use .Dv when mentioning NULL per mdoc(7).
- Reword `g_device_path`, `g_open_by_ident`, and `g_providername`'s descriptions
  so they're less wordy.
- Fix a typo in `g_device_path` (can not -> cannot).

Tested with: igor, make manlint

r317289:

libgeom(3): note that stdio.h is required when referencing gctl_dump(3)

gctl_dump(3) is only exposed when stdio.h is #include'd first, per its
addition in r112510. The reasoning noted for the conditional "exposure"
of the function was to "limit #include pollution".

This addresses an issue I found with the documentation when looking at
bug 218809, which in turn addresses a -Wimplicit-function-declaration
compiler warning in `tools/regression/geom_gpt/test.c` (it uses
gctl_dump(3)).

7 years agoMFC r318900:
bapt [Sat, 27 May 2017 11:12:11 +0000 (11:12 +0000)]
MFC r318900:

update pci_vendors to 2017.05.25

7 years agoMFC r318820:
hselasky [Sat, 27 May 2017 08:25:08 +0000 (08:25 +0000)]
MFC r318820:
Increase the allowed maximum number of audio channels from 31 to 127
in the PCM feeder mixer. Without this change a value of 32 channels is
treated like zero, due to using a mask of 0x1f, causing a kernel
assert when trying to playback bitperfect 32-channel audio. Also
update the AWK script which is generating the division tables to
handle more than 18 channels. This commit complements r282650.

7 years agoMFC r318353:
hselasky [Sat, 27 May 2017 07:47:52 +0000 (07:47 +0000)]
MFC r318353:
Avoid use of contiguous memory allocations in busdma when possible.

This patch improves the boundary checks in busdma to allow more cases
using the regular page based kernel memory allocator. Especially in
the case of having a non-zero boundary in the parent DMA tag. For
example AMD64 based platforms set the PCI DMA tag boundary to
PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous
memory allocations to be preferred when allocating more than PAGE_SIZE
bytes. Even if the required alignment was less than PAGE_SIZE bytes.

This patch also fixes the nsegments check for using kmem_alloc_attr()
when the maximum segment size is less than PAGE_SIZE bytes.

Updated some comments describing the code in question.

Differential Revision: https://reviews.freebsd.org/D10645
Reviewed by: kib, jhb, gallatin, scottl
Sponsored by: Mellanox Technologies

7 years agoMFC r312599 (cem): Add remaining ELF compression definitions and structs
emaste [Sat, 27 May 2017 01:35:59 +0000 (01:35 +0000)]
MFC r312599 (cem): Add remaining ELF compression definitions and structs

PR: 219417

7 years agoMFC r318794, r318795:
gjb [Sat, 27 May 2017 00:30:51 +0000 (00:30 +0000)]
MFC r318794, r318795:
 Update the "first appeared in" version in several manual pages.

Sponsored by: The FreeBSD Foundation

7 years agoMFC 317729:
n_hibma [Fri, 26 May 2017 19:19:47 +0000 (19:19 +0000)]
MFC 317729:

Silence sysctl in startup scripts.

This makes 'stop' behave consistently with 'start' in the script.
Also use $SYSCTL instead of sysctl for consistency within that script.

7 years agoMFC r314935 (thompsa):
gjb [Fri, 26 May 2017 19:02:46 +0000 (19:02 +0000)]
MFC r314935 (thompsa):
 Change ec2.conf to use the pkg tool from a chroot rather than trying
 to bootstrap it and fail from the livecd readonly filesystem.

Sponsored by: The FreeBSD Foundation

7 years agoMFC 315335,315336,315496,315497,315500,315502,315504,315509,315523,315524,
jhb [Fri, 26 May 2017 17:11:27 +0000 (17:11 +0000)]
MFC 315335,315336,315496,315497,315500,315502,315504,315509,315523,315524,
315525: Decode more system call arguments in truss.

315335:
Remove duplicate argument from linux_stat64() decoding.

315336:
Automate the handling of QUAD_ALIGN and QUAD_SLOTS.

Previously, the offset in a system call description specified the
array index of the start of a system call argument.  For most system
call arguments this was the same as the index of the argument in the
function signature.  64-bit arguments (off_t and id_t values) passed
on 32-bit platforms use two slots in the array however.  This was
handled by adding (QUAD_SLOTS - 1) to the slot indicies of any
subsequent arguments after a 64-bit argument (though written as ("{
Quad, 1 }, { Int, 1 + QUAD_SLOTS }" rather than "{ Quad, 1 }, { Int, 2
+ QUAD_SLOTS - 1 }").  If a system call contained multiple 64-bit
arguments (such as posix_fadvise()), then additional arguments would
need to use 'QUAD_SLOTS * 2' but remember to subtract 2 from the
initial number, etc.  In addition, 32-bit powerpc requires 64-bit
arguments to be 64-bit aligned, so if the effective index in the array
of a 64-bit argument is odd, it needs QUAD_ALIGN added to the current
and any subsequent slots.  However, if the effective index in the
array of a 64-bit argument was even, QUAD_ALIGN was omitted.

This approach was messy and error prone.  This commit replaces it with
automated pre-processing of the system call table to do fixups for
64-bit argument offsets.  The offset in a system call description now
indicates the index of an argument in the associated function call's
signature.  A fixup function is run against each decoded system call
description during startup on 32-bit platforms.  The fixup function
maintains an 'offset' value which holds an offset to be added to each
remaining system call argument's index.  Initially offset is 0.  When
a 64-bit system call argument is encountered, the offset is first
aligned to a 64-bit boundary (only on powerpc) and then incremented to
account for the second argument slot used by the argument.  This
modified 'offset' is then applied to any remaining arguments.  This
approach does require a few things that were not previously required:

1) Each system call description must now list arguments in ascending
   order (existing ones all do) without using duplicate slots in the
   register array.  A new assert() should catch any future
   descriptions which violate this rule.

2) A system call description is still permitted to omit arguments
   (though none currently do), but if the call accepts 64-bit
   arguments those cannot be omitted or incorrect results will be
   displated on 32-bit systems.

315496:
Decode the arguments passed to cap_fcntls_get() and cap_fcntls_limit().

315497:
Decode arguments passed to posix_fadvise().

315500:
Decode file flags passed to *chflags*().

While here, decode arguments passed to fchflags() and chflagsat().

315502:
Decode flock() operation.

315504:
Decode arguments passed to getfsstat().

Note that this does not yet decode the statfs structures returned by
getfsstat().

315509:
Decode arguments passed to kldsym() and kldunloadf().

This does not currently decode the kld_sym_lookup structure passed to
kldsym().

315523:
Add a Sizet type for 'size_t' values and use it instead of Int.

Various size_t arguments were previously decoded as Int values instead
which would have truncated values above 2^31 on 64-bit systems.

315524:
Decode arguments to madvise().

315525:
Improve decoding of last arguments to ioctl() and sendto().

Decode the last argument to ioctl() as a pointer rather than an int.
Eventually this could use 'int' for the _IOWINT() case and pointers for
all others.

The last argument to sendto() is a socklen_t value, not a pointer.

7 years agoMFC r318755: Extend libblacklist support with new action types
lidl [Fri, 26 May 2017 15:13:46 +0000 (15:13 +0000)]
MFC r318755: Extend libblacklist support with new action types

The original blacklist library supported two notification types:
 - failed auth attempt, which incremented the failed login count
   by one for the remote address
 - successful auth attempt, which reset the failed login count
   to zero for that remote address

When the failed login count reached the limit in the configuration
file, the remote address would be blocked by a packet filter.

This patch implements a new notification type, "abusive behavior",
and accepts, but does not act on an additional type, "bad username".
It is envisioned that a system administrator will configure a small
list of "known bad usernames" that should be blocked immediately.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r318748:
gjb [Fri, 26 May 2017 13:06:13 +0000 (13:06 +0000)]
MFC r318748:
 Honor WITHOUT_TFTP for check-old* and delete-old* targets.

PR: 217949
Sponsored by: The FreeBSD Foundation

7 years agoMFC r318523, r318631:
royger [Fri, 26 May 2017 08:59:16 +0000 (08:59 +0000)]
MFC r318523, r318631:

xen/netfront: don't drop the ring RX lock with inconsistent ring state
xen/netfront: don't drop the RX lock in xn_rxeof

7 years agoMFC r318520:
royger [Fri, 26 May 2017 08:57:00 +0000 (08:57 +0000)]
MFC r318520:

xen/blkfront: correctly detach a disk with active users

7 years agoMFC r318516: Fix time handling in cv_timedwait_hires().
mav [Fri, 26 May 2017 00:25:08 +0000 (00:25 +0000)]
MFC r318516: Fix time handling in cv_timedwait_hires().

pthread_cond_timedwait() receives absolute time, not relative.  Passing
wrong time there caused two threads of zdb to spin in a tight loop.

7 years agoMFC r318527
truckman [Thu, 25 May 2017 22:39:48 +0000 (22:39 +0000)]
MFC r318527

Fix the queue delay estimation in PIE/FQ-PIE when the timestamp
(TS) method is used.  When packet timestamp is used, the "current_qdelay"
keeps storing the last queue delay value calculated in the dequeue
function.  Therefore, when a burst of packets arrives followed by
a pause, the "current_qdelay" will store a high value caused by the
burst and stick to that value during the pause because the queue
delay measurement is done inside the dequeue function.  This causes
the drop probability calculation function to calculate high drop
probability value instead of zero and prevents the burst allowance
mechanism from working properly.  Fix this problem by resetting
"current_qdelay" inside the drop probability calculation function
when the queue length is zero and TS option is used.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>

7 years agoMFC r318314
stevek [Thu, 25 May 2017 18:55:10 +0000 (18:55 +0000)]
MFC r318314

Add information to open(2) man page about the O_VERIFY flag.

PR: 219262
Reviewed by: bjk wblock
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.

7 years agoMFC r318511
truckman [Thu, 25 May 2017 17:22:13 +0000 (17:22 +0000)]
MFC r318511

The result of right shifting a negative signed value is implementation
defined.  On machines without arithmetic shift instructions, zero bits
may be shifted in from the left, giving a large positive result instead
of the desired divide-by power-of-2.  Fix this by operating on the
absolute value and compensating for the possible negation later.

Reverse the order of the underflow/overflow tests and the exponential
decay calculation to avoid the possibility of an erroneous overflow
detection if p is a sufficiently small non-negative value.  Also
check for negative values of prob before doing the exponential decay
to avoid another instance of of right shifting a negative value.

Tested by: Rasool Al-Saadi <ralsaadi@swin.edu.au>

7 years agoMFC r318655:
dim [Thu, 25 May 2017 16:15:19 +0000 (16:15 +0000)]
MFC r318655:

Pull in r302416 from upstream llvm trunk (by Martin Storsjö):

  [ARM] Clear the constant pool cache on explicit .ltorg directives

  Multiple ldr pseudoinstructions with the same constant value will
  reuse the same constant pool entry. However, if the constant pool is
  explicitly flushed with a .ltorg directive, we should not try to
  reference constants in the previous pool any longer, since they may
  be out of range.

  This fixes assembling hand-written assembler source which repeatedly
  loads the same constant value, across a binary size larger than the
  pc-relative fixup range for ldr instructions (4096 bytes). Such
  assembler source already uses explicit .ltorg instructions to emit
  constant pools with regular intervals. However if we try to reuse
  constants emitted in earlier pools, they end up out of range.

  This makes the output of the testcase match what binutils gas does
  (prior to this patch, it would fail to assemble).

  Differential Revision: https://reviews.llvm.org/D32847

This should fix "out of range pc-relative fixup value" errors, when
compiling certain ARM inline assembly for www/webkit-gtk[23].

Reported by: mmel

7 years agoFurther expand the r318785 entry, noting vfs.zfs.debugflags can be
gjb [Thu, 25 May 2017 12:04:23 +0000 (12:04 +0000)]
Further expand the r318785 entry, noting vfs.zfs.debugflags can be
set in loader.conf(5), whereas vfs.zfs.debug_flags could not.

Submitted by: avg
Sponsored by: The FreeBSD Foundation

7 years agoDocument r312790, EC2 IPv6 by default.
gjb [Thu, 25 May 2017 11:05:19 +0000 (11:05 +0000)]
Document r312790, EC2 IPv6 by default.

Sponsored by: The FreeBSD Foundation

7 years agoDocument r318660, Amazon EFS support in the NFS client.
gjb [Thu, 25 May 2017 11:05:19 +0000 (11:05 +0000)]
Document r318660, Amazon EFS support in the NFS client.

Sponsored by: The FreeBSD Foundation

7 years agoDocument r318660, various NFS client fixes.
gjb [Thu, 25 May 2017 10:56:33 +0000 (10:56 +0000)]
Document r318660, various NFS client fixes.

Sponsored by: The FreeBSD Foundation

7 years agoDocument r318785, vfs.zfs.debug_flags -> vfs.zfs.debugflags rename.
gjb [Thu, 25 May 2017 10:47:18 +0000 (10:47 +0000)]
Document r318785, vfs.zfs.debug_flags -> vfs.zfs.debugflags rename.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r318863:
jlh [Thu, 25 May 2017 09:27:33 +0000 (09:27 +0000)]
MFC r318863:
  Replace stale handbook URL with the proper one.

7 years agoMFC r318014, r318091, r318125, and r318263.
np [Thu, 25 May 2017 01:59:58 +0000 (01:59 +0000)]
MFC r318014, r318091, r318125, and r318263.

r318014:
cxgbe(4): Fixes related to the knob that controls link autonegotiation.

- Do not leak the adapter lock in sysctl_autoneg.
- Accept only 0 or 1 as valid settings for autonegotiation.
- A fixed speed must be requested by the driver when autonegotiation is
  disabled otherwise the firmware will reject the l1cfg command.  Use
  the top speed supported by the port for now.

r318091:
cxgbe(4): Do not assume that if_qflush is always followed by inteface-down.

r318125:
Adjust whitespace and fix a comment.  No functional change.

r318263:
cxgbe(4): netmap-only interrupts for a VI do not have an associated rxq
or ofld_rxq and should be ignored by vi_intr_iq.

Sponsored by: Chelsio Communications

7 years agoMFC r318646:
gjb [Thu, 25 May 2017 01:45:43 +0000 (01:45 +0000)]
MFC r318646:
 Allow PORTSDIR to be overridden in the pkg-stage target.

PR: 218393
Sponsored by: The FreeBSD Foundation

7 years agoMFC r318599, r318643:
gjb [Thu, 25 May 2017 01:43:39 +0000 (01:43 +0000)]
MFC r318599, r318643:
 r318599 (bjk):
  Updates for efivar.8

  Fix spelling, appease igor and mandoc -Tlint, and adopt the
  language style to be more consistent with our corpus.

 r318643:
  Correct the "first appeared in" version for efivar(8).

Sponsored by: The FreeBSD Foundation

7 years agoMFC r317702, r317847, r318307
np [Thu, 25 May 2017 01:40:40 +0000 (01:40 +0000)]
MFC r317702, r317847, r318307

r317702:
cxgbe(4): Support routines for Tx traffic scheduling.

- Create a new file, t4_sched.c, and move all of the code related to
  traffic management from t4_main.c and t4_sge.c to this file.
- Track both Channel Rate Limiter (ch_rl) and Class Rate Limiter (cl_rl)
  parameters in the PF driver.
- Initialize all the cl_rl limiters with somewhat arbitrary default
  rates and provide routines to update them on the fly.
- Provide routines to reserve and release traffic classes.

r317847:
cxgbe(4): The Tx scheduler initialization either works or doesn't.  It
doesn't need a refresh in either case.

r318307:
cxgbe(4): Avoid an out of bounds access when an attempt to unbind a tx
queue from a traffic class fails.

Sponsored by: Chelsio Communications

7 years agoMFC r308737, r308779:
gjb [Thu, 25 May 2017 01:31:12 +0000 (01:31 +0000)]
MFC r308737, r308779:
 r308737:
  Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh, otherwise
  mkimg(1) does not create the second partition after r307008.

 r308779:
  Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh for the
  vm-image target, missed in r308737.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r318479:
markj [Thu, 25 May 2017 01:17:07 +0000 (01:17 +0000)]
MFC r318479:
Don't bother enqueuing a page immediately before freeing it.

7 years agoMFC r318476, r318478:
markj [Thu, 25 May 2017 01:15:53 +0000 (01:15 +0000)]
MFC r318476, r318478:
Fix up some kern_yield() usages.

7 years agoMFC r318124:
np [Thu, 25 May 2017 01:14:34 +0000 (01:14 +0000)]
MFC r318124:

ip6_output runs with the inp lock held, just like ip_output.

7 years agoMFC r318191:
markj [Thu, 25 May 2017 01:09:45 +0000 (01:09 +0000)]
MFC r318191:
Let ptracestop() suspend threads sleeping in an SBDRY section.

7 years agoMFC r317820 and r317837.
np [Thu, 25 May 2017 01:00:57 +0000 (01:00 +0000)]
MFC r317820 and r317837.

r317820:
cxgbe(4): Update the list of PCIe devices claimed by the driver.  At
this point any board with a T6 should just work.

r317837:
cxgbe(4):  Update the VF device ids too.  This should have been part
of r317820.

Sponsored by: Chelsio Communications

7 years agoMFC r317041:
np [Thu, 25 May 2017 00:43:56 +0000 (00:43 +0000)]
MFC r317041:

cxgbe: Add tunables to control the number of LRO entries and the number
of rx mbufs that should be presorted before LRO.  There is no change in
default behavior.

Sponsored by: Chelsio Communications

7 years agoMFC r318603: nm: document 'r' symbol type
emaste [Thu, 25 May 2017 00:34:01 +0000 (00:34 +0000)]
MFC r318603: nm: document 'r' symbol type

PR: 219245
Sponsored by: The FreeBSD Foundation

7 years agoMFC r316971:
np [Thu, 25 May 2017 00:16:01 +0000 (00:16 +0000)]
MFC r316971:

cxgbe: Add a tunable to configure the SGE time scaler, which is
available starting with T6.  The values in the timer holdoff registers
are multiplied by the scaling factor before use.

dev.<nexus>.<n>.holdoff_timers shows the final values of the
timers in microseconds.

Sponsored by: Chelsio Communications

7 years agoMFC r316506:
np [Wed, 24 May 2017 23:08:17 +0000 (23:08 +0000)]
MFC r316506:

cxgbe(4): Program the global RSS key once instead of once per ifnet.

7 years agoMFC r316172:
np [Wed, 24 May 2017 22:47:45 +0000 (22:47 +0000)]
MFC r316172:

cxgbe: Don't call t4_edc_err_read for errors not related to the EDCs.

Sponsored by: Chelsio Communications

7 years agoMFC r309725:
np [Wed, 24 May 2017 21:53:47 +0000 (21:53 +0000)]
MFC r309725:

cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities
any more (since r307394).  Do it in the driver instead.

Sponsored by: Chelsio Communications

7 years agoMFC r317759:
asomers [Wed, 24 May 2017 21:18:13 +0000 (21:18 +0000)]
MFC r317759:

Fix memory leaks in camcontrol

Reported by: Coverity
CID: 13316741331675
Reviewed by: ken
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10588

7 years agoMFC r307380:
np [Wed, 24 May 2017 20:54:14 +0000 (20:54 +0000)]
MFC r307380:

Fix typo in comments.

7 years agoMFC r317755, r317758
asomers [Wed, 24 May 2017 20:52:47 +0000 (20:52 +0000)]
MFC r317755, r317758

r317755:
Various Coverity fixes in ifconfig(8)

* Exit early if kldload(2) fails (1011259). This is the only change that
  affects ifconfig's behavior.
* Close memory and resource leaks (130562413052051007100)
* Mark usage() as _Noreturn (13058061305750)
* Fix some dereference after null checks (1011474, 270774)

Reported by: Coverity
CID: 130562413052051007100130580613057501011474,
CID: 270774, 1011259
Reviewed by: cem
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10587

r317758:
Unbreak ifconfig for mlx4en(4) after r317755

ifconfig doesn't correctly infer mlx interfaces' module names, so it will
attempt to load the mlx(4) module even when not necessary.

Reported by: rstone
X-MFC-With: 317755
Sponsored by: Spectra Logic Corp

7 years agoMFC r307008:
np [Wed, 24 May 2017 20:33:49 +0000 (20:33 +0000)]
MFC r307008:

Add the ability to override the size of the swap partition when building
VM images.  The default continues to be 1G.

Sponsored by: Chelsio Communications

7 years agoMFC r313318:
np [Wed, 24 May 2017 20:28:48 +0000 (20:28 +0000)]
MFC r313318:

cxgbe(4):  Allow tunables that control the number of queues to be set to
'-n' to tell the driver to create _up to_ 'n' queues if enough cores are
available.  For example, setting hw.cxgbe.nrxq10g="-32" will result in
16 queues if the system has 16 cores, 32 if it has 32.

There is no change in the default number of queues of any type.

Sponsored by: Chelsio Communications

7 years agoMFC r317715:
asomers [Wed, 24 May 2017 20:25:40 +0000 (20:25 +0000)]
MFC r317715:

ifconfig displays ND6_IFF_NO_DAD as "IGNORELOOP"

PR: 218958
Reviewed by: kristof
Differential Revision: https://reviews.freebsd.org/D10543

7 years agoMFC 318401
jpaetzel [Wed, 24 May 2017 20:10:38 +0000 (20:10 +0000)]
MFC 318401

Increase the number of LUNs this hardware can support.

Experimentally we know this value works, but the hardware
may support an even higher value.

PR: 213876
Reported by: J.Catrysse@proximedia.be

7 years agoMFC r313346:
np [Wed, 24 May 2017 19:57:22 +0000 (19:57 +0000)]
MFC r313346:

cxgbe/t4_tom: Fix CLIP entry refcounting on the passive side.  Every
IPv6 connection being handled by the TOE should have a reference on its
CLIP entry.

Sponsored by: Chelsio Communications

7 years agoMFC r314131:
np [Wed, 24 May 2017 19:18:36 +0000 (19:18 +0000)]
MFC r314131:

Avoid NULL dereference in a couple of sysctl handlers in ibcore.
iw_cxgbe sets ib_device->dma_device to NULL (since r311880).

Sponsored by: Chelsio Communications

7 years agoMFC r311880, r314167, r316118, r316571, r316573, r316580, r316936-r316937,
np [Wed, 24 May 2017 18:14:57 +0000 (18:14 +0000)]
MFC r311880, r314167, r316118, r316571, r316573, r316580, r316936-r316937,
r316940, and r317410.

r311880:
The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.

r314167:
cxgbe/iw_cxgbe: Minor changes for T6.

r316118:
cxgbe/iw_cxgbe: T6 has no limit on the amount of memory that can be
registered in one ib_reg_phys_mr.

r316571:
cxgbe/iw_cxgbe: Remove bad cast that resulted in incorrect length for
memory regions larger than 4GB.

r316573:
cxgbe/iw_cxgbe: Replace a magic constant with something more readable
(and accurate).

T4 and later have an extra bit for page shift so the maximum page size
is 8TB (shift of 12 + 31) instead of 128MB (12 + 15).  This saves space
in the chip's PBL (physical buffer list) when registering very large
memory regions.

r316580:
cxgbe/iw_cxgbe: Remove another bad cast.  This should have been
included in r316571.

r316936:
cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains.

r316937:
cxgbe/iw_cxgbe: Report accurate page_size_cap in ib_query_device.

r316940:
cxgbe/iw_cxgbe: Report the actual values of various parameters as
configured by the firmware.

r317410:
cxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
iw_cxgb4 Linux driver.

Sponsored by: Chelsio Communications

7 years agoMFC r316774:
np [Wed, 24 May 2017 17:51:07 +0000 (17:51 +0000)]
MFC r316774:

cxgbe: Query some more RDMA related parameters from the firmware.

Sponsored by: Chelsio Communications

7 years agoMFC r312346:
loos [Wed, 24 May 2017 16:39:19 +0000 (16:39 +0000)]
MFC r312346:

Set the the wp_disabled flag when asked to.

While here, add the missing new line.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoDocument r318763, EARLY_AP_STARTUP enabled by default.
gjb [Wed, 24 May 2017 14:22:22 +0000 (14:22 +0000)]
Document r318763, EARLY_AP_STARTUP enabled by default.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r316854: rename vfs.zfs.debug_flags to vfs.zfs.debugflags
avg [Wed, 24 May 2017 11:38:31 +0000 (11:38 +0000)]
MFC r316854: rename vfs.zfs.debug_flags to vfs.zfs.debugflags

Since this is a stable branch vfs.zfs.debug_flags sysctl is also kept.
The corresponing tunable could never work.