]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMerge ^/head r339015 through r339669.
dim [Tue, 23 Oct 2018 21:09:37 +0000 (21:09 +0000)]
Merge ^/head r339015 through r339669.

5 years agoPull in r345002 from upstream lld trunk:
dim [Tue, 23 Oct 2018 20:56:59 +0000 (20:56 +0000)]
Pull in r345002 from upstream lld trunk:

  Don't mess up RelIplt symbols during relocatable processing

  Summary:
  During upgrading of the FreeBSD source tree with lld 7.0.0, I noticed
  that it started complaining about crt1.o having an "index past the
  end of the symbol table".

  Such a symbol table looks approximately like this, viewed with
  readelf -s (note the Ndx field being messed up):

  Symbol table '.symtab' contains 4 entries:
     Num:    Value  Size Type    Bind   Vis      Ndx Name
       0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
       1: 00000000     0 SECTION LOCAL  DEFAULT    1
       2: 00000000     0 NOTYPE  WEAK   HIDDEN  RSV[0xffff] __rel_iplt_end
       3: 00000000     0 NOTYPE  WEAK   HIDDEN  RSV[0xffff] __rel_iplt_start

  At first, it seemed that recent ifunc relocation work had caused this:
  <https://reviews.freebsd.org/rS339351>, but it turned out that it was
  due to incorrect processing of the object files by lld, when using -r
  (a.k.a. --relocatable).

  Bisecting showed that rL324421 ("Convert a use of Config->Static") was
  the commit where this new behavior began.  Simply reverting it solved
  the issue, and the __rel_iplt symbols had an index of UND again.

  Looking at Rafael's commit message, I think he simply missed the
  possibility of --relocatable being in effect, so I have added an
  additional check for it.

  I also added a simple regression test case.

  Reviewers: grimar, ruiu, emaste, espindola

  Reviewed By: ruiu

  Subscribers: arichardson, krytarowski, llvm-commits

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

This fixes a problem in lld where it places incorrect indexes for ifunc
related symbols in crt1.o and friends, making it impossible to link most
normal programs with it.

5 years agoFor the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
imp [Tue, 23 Oct 2018 20:45:46 +0000 (20:45 +0000)]
For the moment, put back the MOUSE_PROTO_{BUS,INPORT} #defines until
some ports can be updated.

5 years agocxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.
np [Tue, 23 Oct 2018 18:32:55 +0000 (18:32 +0000)]
cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.

Submitted By: Lily Wang @ Netapp

MFC after: 1 week

5 years agoSupport the SHA224 HMAC algorithm in ccr(4).
jhb [Tue, 23 Oct 2018 18:31:39 +0000 (18:31 +0000)]
Support the SHA224 HMAC algorithm in ccr(4).

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoAdd sha224 to the authctx union.
jhb [Tue, 23 Oct 2018 18:07:37 +0000 (18:07 +0000)]
Add sha224 to the authctx union.

MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoInitialize static domainsets regardless of whether an SRAT is present.
markj [Tue, 23 Oct 2018 18:07:16 +0000 (18:07 +0000)]
Initialize static domainsets regardless of whether an SRAT is present.

Reported by: yuripv
X-MFC with: r339452
Sponsored by: The FreeBSD Foundation

5 years agoInitializer error variable in nvdimm_spa_uio().
kib [Tue, 23 Oct 2018 17:53:35 +0000 (17:53 +0000)]
Initializer error variable in nvdimm_spa_uio().

Several code paths might result in returning uninitialized value.

Reported by: coverity through cem
CID: 1396315
Sponsored by: The FreeBSD Foundation

5 years agoRevert r339634.
erj [Tue, 23 Oct 2018 17:06:36 +0000 (17:06 +0000)]
Revert r339634.

That commit is causing kernel panics in em(4), so this will be reverted
until those are fixed.

Reported by: ae@, pho@, et al
Sponsored by: Intel Corporation

5 years agoRefactor domainset iterators for use by malloc(9) and UMA.
markj [Tue, 23 Oct 2018 16:35:58 +0000 (16:35 +0000)]
Refactor domainset iterators for use by malloc(9) and UMA.

Before this change we had two flavours of vm_domainset iterators: "page"
and "malloc".  The latter was only used for kmem_*() and hard-coded its
behaviour based on kernel_object's policy.  Moreover, its use contained
a race similar to that fixed by r338755 since the kernel_object's
iterator was being run without the object lock.

In some cases it is useful to be able to explicitly specify a policy
(domainset) or policy+iterator (domainset_ref) when performing memory
allocations.  To that end, refactor the vm_dominset_* KPI to permit
this, and get rid of the "malloc" domainset_iter KPI in the process.

Reviewed by: jeff (previous version)
Tested by: pho (part of a larger patch)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17417

5 years agonetmap: add man page for the bridge program
vmaffione [Tue, 23 Oct 2018 15:34:43 +0000 (15:34 +0000)]
netmap: add man page for the bridge program

Added bridge(8).
Also, minor fixes to the netmap "bridge" application:
 - indentation fixes and code cleanup
 - better usage description
 - better processing of netmap flags

Reviewed by: 0mp
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17664

5 years agoloader: biosdisk interface should be able to cope with 4k sectors
tsoome [Tue, 23 Oct 2018 14:44:32 +0000 (14:44 +0000)]
loader: biosdisk interface should be able to cope with 4k sectors

The 4kn support in current bios specific biosdisk.c is broken, as the code
is only implementing the support for the 512B sector size.

This work is building the support for custom size sectors, we still do assume
the requested data to be multiple of 512B blocks and we only do address the
biosdisk.c interface here.

For reference, see also:
https://www.illumos.org/issues/8303
https://www.illumos.org/rb/r/547

As the GELI is moved above biosdisk "layer", the GELI should just work

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D11174

5 years agoAdd debug.witness.trace=0 back to the installer sysctl.conf(5),
gjb [Tue, 23 Oct 2018 14:38:08 +0000 (14:38 +0000)]
Add debug.witness.trace=0 back to the installer sysctl.conf(5),
incorrectly removed from head when it should have been removed
from stable/12 post-branch.

Reported by: bdrewery
Sponsored by: The FreeBSD Foundation

5 years agoFollow up on r331936. gets_s(3) will also fail in the same way that
cy [Tue, 23 Oct 2018 14:16:02 +0000 (14:16 +0000)]
Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by: emaste@
MFC after: 3 days

5 years agoPick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:
trasz [Tue, 23 Oct 2018 14:11:35 +0000 (14:11 +0000)]
Pick f80c97e477d1b3fe7778c65d9439d673738b4131 from upstream:

    Rework the way jemalloc uses mmap(2) on FreeBSD.

    This makes it directly use MAP_EXCL and MAP_ALIGNED() instead
    of weird workarounds involving mapping at random places and then
    unmapping parts of them.

Discussed with: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoPick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:
trasz [Tue, 23 Oct 2018 13:54:54 +0000 (13:54 +0000)]
Pick 676cdd66792ccb629a978837ea2a066d5db342cc from upstream:

    Disable runtime detection of lazy purging support on FreeBSD.

    The check doesn't seem to serve any purpose here, and this shaves
    off three syscalls on binary startup.

Discussed by: jasone
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd an IMPLEMENTATION NOTES section to ldd.1.
markj [Tue, 23 Oct 2018 13:49:53 +0000 (13:49 +0000)]
Add an IMPLEMENTATION NOTES section to ldd.1.

PR: 231926
Reviewed by: emaste
MFC after: 1 month

5 years agolibsa: re-send ACK for older data packets in tftp
tsoome [Tue, 23 Oct 2018 13:38:39 +0000 (13:38 +0000)]
libsa: re-send ACK for older data packets in tftp

In current tftp code we drop out-of-order packets; however, we should play
nice and re-send ACK for older data packets we are receiving. This will
hopefully stop server repeating those packets we already have received.
Note we do not answer duplicates from "previous" session (that is, session
with different port number), those will eventually time out.

Differential Revision: https://reviews.freebsd.org/D17087

5 years agoAdd the check that current VNET is ready and access to srchash is allowed.
ae [Tue, 23 Oct 2018 13:11:45 +0000 (13:11 +0000)]
Add the check that current VNET is ready and access to srchash is allowed.

This change is similar to r339646. The callback that checks for appearing
and disappearing of tunnel ingress address can be called during VNET
teardown. To prevent access to already freed memory, add check to the
callback and epoch_wait() call to be sure that callback has finished its
work.

MFC after: 20 days

5 years agoar: report errno on warning/error
emaste [Tue, 23 Oct 2018 13:07:03 +0000 (13:07 +0000)]
ar: report errno on warning/error

Previously ar would report an error like "ar: fatal: Write error"
without including additional errno information.  Change warnings and
errors to include archive_errno() so that the user may have some idea
of the reason for the failure.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17650

5 years agoarch.7: update final ia64 release to 10.4
emaste [Tue, 23 Oct 2018 13:03:24 +0000 (13:03 +0000)]
arch.7: update final ia64 release to 10.4

No more 10.x releases are planned.

5 years agoAdd the check that current VNET is ready and access to srchash is
ae [Tue, 23 Oct 2018 13:03:03 +0000 (13:03 +0000)]
Add the check that current VNET is ready and access to srchash is
allowed.

ipsec_srcaddr() callback can be called during VNET teardown, since
ingress address checking subsystem isn't VNET specific. And thus
callback can make access to already freed memory. To prevent this,
use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make
epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to
be sure that ipsec_srcaddr() is finished its work.

Reported by: kp
MFC after: 20 days

5 years agosort {delete,check}-old* output
emaste [Tue, 23 Oct 2018 13:00:11 +0000 (13:00 +0000)]
sort {delete,check}-old* output

It is more convenient to review old libraries, files, and directories
in order.

Sort check-* after checking for existence of files for efficiency, and
because /usr/lib/debug entries are added while iterating over the list.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17649

5 years agoFix ipw_start(), where logic was reverted in r287197.
glebius [Tue, 23 Oct 2018 12:53:09 +0000 (12:53 +0000)]
Fix ipw_start(), where logic was reverted in r287197.

PR: 232554
Submitted by: gl00my@mail.ru

5 years agoRemove softc from idhash when interface is destroyed.
ae [Tue, 23 Oct 2018 12:50:28 +0000 (12:50 +0000)]
Remove softc from idhash when interface is destroyed.

MFC after: 20 days

5 years agonetmap: align codebase to the current upstream (sha 8374e1a7e6941)
vmaffione [Tue, 23 Oct 2018 08:55:16 +0000 (08:55 +0000)]
netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
    - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
      This is useful to reuse the code within upcoming projects.
    - Improvements and bug fixes to pipes and monitors.
    - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
      handle differences between FreeBSD and Linux.
    - Introduce some new helper functions to handle more host rings and fake
      rings (netmap_all_rings(), netmap_real_rings(), ...)
    - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
    - nm_inject: add support for NS_MOREFRAG

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17364

5 years agoFix ncurses fallback.c build with a strict build shell
arichardson [Tue, 23 Oct 2018 06:31:31 +0000 (06:31 +0000)]
Fix ncurses fallback.c build with a strict build shell

The script uses shift three times and when building with a strict /bin/sh
shifting without any arguments will cause the script to fail. In this case
the target will fail and we write an empty output file. When doing a
NO_CLEAN build after this will mean fallback.c is up to date and clang
will happily compile the empty input file which leads to strange build
errors later.

Fixed by passing three empty arguments to MkFallback.sh and only creating
fallback.c if MKfallback.sh succeeds.

Aproved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16867

5 years agoOnly compute the X_COMPILER_*/X_LINKER_* variables when needed
arichardson [Tue, 23 Oct 2018 06:31:25 +0000 (06:31 +0000)]
Only compute the X_COMPILER_*/X_LINKER_* variables when needed

When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
in bsd.linker.mk) which causes it to call ${XCC} --version and
${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
For incremental builds and stages that only walk the source tree this is
often the majority of the time spent in that directory.

By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
_WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
to once per build stage instead of once per recursive make.

With this change (and no changes to the sources) the `make includes` stage
now takes 28 seconds at -j1 instead of 86 seconds.

Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D17046

5 years agoFix regex for extracting SHM_* values for libsysdecode
arichardson [Tue, 23 Oct 2018 06:31:19 +0000 (06:31 +0000)]
Fix regex for extracting SHM_* values for libsysdecode

There was an additional + after the {6} which is apparently ignored by the
FreeBSD regex implementation but was giving me an error when compiling on
MacOS.

While changing this also make sure that tables.h is not created if mktables
fails. The current rule would create a partial tables.h which causes following
incremental builds to use that broken file and fail with an unrelated
compilation error or even succeed even though they shouldn't.

Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D17069

5 years agoiflib: drain enqueued tasks before detaching from taskqgroup
erj [Tue, 23 Oct 2018 04:37:29 +0000 (04:37 +0000)]
iflib: drain enqueued tasks before detaching from taskqgroup

The taskqgroup_detach function does not check if task is already enqueued when
detaching it. This may lead to kernel panic if enqueued task starts after
context state lock is destroyed. Ensure that the already enqueued admin tasks
are executed before detaching them.

The issue was discovered during validation of D16429. Unloading of if_ixlv
followed by immediate removal of VFs with iovctl -D may lead to panic on
NODEBUG kernel.

As well, check if iflib is in detach before enqueueing new admin or iov
tasks, to prevent new tasks from executing while the taskqgroup tasks
are being drained.

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: shurd@, erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D17404

5 years agodpaa: Mark BMan and QMan as earlier driver modules
jhibbits [Tue, 23 Oct 2018 01:56:52 +0000 (01:56 +0000)]
dpaa: Mark BMan and QMan as earlier driver modules

The BMan softc must exist when dtsec devices are created, else a NULL
pointer is dereferenced.  QMan likely as well.  Until now, we have relied on
order within the fdt parsing to attach correctly, but this obviously is not
foolproof.  Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached
explicitly before dtsec devices.

5 years agocxgbe(4): improve the accuracy of various TSO limits reported to the kernel.
np [Mon, 22 Oct 2018 23:57:59 +0000 (23:57 +0000)]
cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.

Sponsored by: Chelsio Communications

5 years agopf tests: Fix incorrect test for PR 231323
kp [Mon, 22 Oct 2018 23:33:48 +0000 (23:33 +0000)]
pf tests: Fix incorrect test for PR 231323

Fix r339466.  The test result file did not list the rdr rule.
Additionally, the route-to rule needs a redirection address.

X-MFC-with: 339466

5 years agocxgbe(4): Use automatic cidx updates with ofld and ctrl queues.
np [Mon, 22 Oct 2018 23:06:23 +0000 (23:06 +0000)]
cxgbe(4): Use automatic cidx updates with ofld and ctrl queues.

The bits that explicitly request cidx updates do not work reliably with
all possible WRs that can be sent over the queue.  The F_FW_WR_EQUIQ
requests that still remain may also have to be replaced with explicit
credit flush WRs in the future.

MFC after: 2 days
Sponsored by: Chelsio Communications

5 years agoConsolidate identical ELF auxargs type defintions.
brooks [Mon, 22 Oct 2018 22:24:32 +0000 (22:24 +0000)]
Consolidate identical ELF auxargs type defintions.

All platforms except powerpc use the same values and powerpc shares a
majority of them.

Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the
unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc.

Reviewed by: jhb, imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17397

5 years agoRemove the need for backslashes in syscalls.master.
brooks [Mon, 22 Oct 2018 22:13:00 +0000 (22:13 +0000)]
Remove the need for backslashes in syscalls.master.

Join non-special lines together until we hit a line containing a '}'
character. This allows the function declaration body to be split
across multiple lines without backslash continuation characters.

Continue to join lines ending with backslashes to allow gradual
migration and to support out-of-tree syscall vectors

Reviewed by: emaste, kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17488

5 years agoRegen after r339622.
brooks [Mon, 22 Oct 2018 21:51:59 +0000 (21:51 +0000)]
Regen after r339622.

Note: changes to freebsd32 syscalls.master impacted no generated files.

5 years agoRemove __restrict qualifiers from syscalls.master.
brooks [Mon, 22 Oct 2018 21:50:43 +0000 (21:50 +0000)]
Remove __restrict qualifiers from syscalls.master.

The restruct qualifier is intended to aid code generation in the
compiler, but the only access to storage through these pointers is via
structs using copyin/copyout and the like which can not be written in C
or C++ and thus the compiler gains nothing from the qualifiers.

As such, the qualifiers add no value in current usage.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17574

5 years agoAdd a "live" mode to ktrdump.
jhb [Mon, 22 Oct 2018 21:25:28 +0000 (21:25 +0000)]
Add a "live" mode to ktrdump.

Support a "live" mode in ktrdump enabled via the -l flag.  In this
mode, ktrdump polls the kernel's trace buffer periodically (currently
hardcoded as a 50 millisecond interval) and dumps any newly added
entries.  Fancier logic for the timeout (e.g. a command line option or
some kind of backoff based on the time since the last entry) can be
added later as the need arises.

While here, fix some bugs from when this was Capsicum-ized:
- Use caph_limit_stream() for the output stream so that isatty() works
  and the output can be line-buffered (especially useful for live
  mode).
- Use caph_limit_stderr() to permit error messages to be displayed if
  an error occurs after cap_enter().

Reviewed by: kib, 0mp (manpage)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D17315

5 years agoA couple of style fixes in recent TCP changes.
jhb [Mon, 22 Oct 2018 21:17:36 +0000 (21:17 +0000)]
A couple of style fixes in recent TCP changes.

- Add a blank line before a block comment to match other block comments
  in the same function.
- Sort the prototype for sbsndptr_adv and fix whitespace between return
  type and function name.

Reviewed by: gallatin, bz
Differential Revision: https://reviews.freebsd.org/D17474

5 years agoDefine linuxkpi readq for 64-bit architectures. It is used by drm-kmod.
tijl [Mon, 22 Oct 2018 20:55:35 +0000 (20:55 +0000)]
Define linuxkpi readq for 64-bit architectures.  It is used by drm-kmod.
Currently the compiler picks up the definition in machine/cpufunc.h.

Add compiler memory barriers to read* and write*.  The Linux x86
implementation of these functions uses inline asm with "memory" clobber.
The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
same inline asm without "memory" clobber.

Implement ioread* and iowrite* in terms of read* and write* so they also
have memory barriers.

Qualify the addr parameter in write* as volatile.

Like Linux, define macros with the same name as the inline functions.

Only define 64-bit versions on 64-bit architectures because generally
32-bit architectures can't do atomic 64-bit loads and stores.

Regroup the functions a bit and add brief comments explaining what they do:
- __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
- read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
- read*, write*: atomic, with barriers, little-endian

Add a comment that says our implementation of ioread* and iowrite*
only handles MMIO and does not support port IO.

Reviewed by: hselasky
MFC after: 3 days

5 years agoMake it possible to disable NUMA support with a tunable.
markj [Mon, 22 Oct 2018 20:13:51 +0000 (20:13 +0000)]
Make it possible to disable NUMA support with a tunable.

This provides a chicken switch for anyone negatively impacted by
enabling NUMA in the amd64 GENERIC kernel configuration.  With
NUMA disabled at boot-time, information about the NUMA topology
is not exposed to the rest of the kernel, and all of physical
memory is viewed as coming from a single domain.

This method still has some performance overhead relative to disabling
NUMA support at compile time.

PR: 231460
Reviewed by: alc, gallatin, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17439

5 years agorelease: set -e to exit on error in iso image scripts
emaste [Mon, 22 Oct 2018 19:39:20 +0000 (19:39 +0000)]
release: set -e to exit on error in iso image scripts

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D17651

5 years agoarch.7: first appeared in FreeBSD 11.1
emaste [Mon, 22 Oct 2018 18:41:22 +0000 (18:41 +0000)]
arch.7: first appeared in FreeBSD 11.1

5 years agoMakefile.inc1: clean up stale dependency hacks
emaste [Mon, 22 Oct 2018 18:40:21 +0000 (18:40 +0000)]
Makefile.inc1: clean up stale dependency hacks

Our dependency tracking cannot directly cope with certain source tree
changes, particularly with respect to removing or moving source files or
replacing generated files.  We have a collection of ad-hoc workarounds
to handle these cases.  As there is a (small) build-time cost inherent
in these workarounds, we do not want to keep them indefinitely.  Thus,
remove workarounds from 2017.

Sponsored by: The FreeBSD Foundation

5 years agoUpdate to Zstandard 1.3.7
cem [Mon, 22 Oct 2018 18:29:12 +0000 (18:29 +0000)]
Update to Zstandard 1.3.7

Relnotes: yes
Sponsored by: Dell EMC Isilon

5 years agoConditionalize kern.tty_info_kstacks feature on STACKS option
cem [Mon, 22 Oct 2018 17:42:57 +0000 (17:42 +0000)]
Conditionalize kern.tty_info_kstacks feature on STACKS option

Fix tinderbox (mips XLPN32) after r339471.

Reported by: tinderbox
X-MFC-With: r339471
Sponsored by: Dell EMC Isilon

5 years agoFix the build after r339601.
markj [Mon, 22 Oct 2018 17:19:48 +0000 (17:19 +0000)]
Fix the build after r339601.

I committed some patches out of order and didn't build-test one of them.

Reported by: Jenkins, O. Hartmann <ohartmann@walstatt.org>
X-MFC with: r339601

5 years agoAvoid a redundancy in a comment updated by r339601.
markj [Mon, 22 Oct 2018 17:17:30 +0000 (17:17 +0000)]
Avoid a redundancy in a comment updated by r339601.

Reported by: alc
X-MFC with: r339601

5 years agoSwap in processes unless there's a global memory shortage.
markj [Mon, 22 Oct 2018 17:04:04 +0000 (17:04 +0000)]
Swap in processes unless there's a global memory shortage.

On NUMA systems, we would not swap in processes unless all domains
had some free pages.  This is too conservative in general.  Instead,
permit swapins so long as at least one domain has free pages, and add
a kernel stack NUMA policy which ensures that we will try to allocate
kernel stack pages from any domain.

Reported and tested by: pho, Jan Bramkamp <crest@bultmann.eu>
Reviewed by: alc, kib
Discussed with: jeff
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17304

5 years agoMake sure returned value is checked and assert a valid refcount.
hselasky [Mon, 22 Oct 2018 16:21:50 +0000 (16:21 +0000)]
Make sure returned value is checked and assert a valid refcount.
While at it fix a print: Unsigned types cannot be negative.

Reviewed by: kib, mjg
Differential revision: https://reviews.freebsd.org/D17616
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoDon't import 0 into vmem quantum caches.
markj [Mon, 22 Oct 2018 16:16:42 +0000 (16:16 +0000)]
Don't import 0 into vmem quantum caches.

vmem uses UMA cache zones to implement the quantum cache.  Since
uma_zalloc() returns 0 (NULL) to signal an allocation failure, UMA
should not be used to cache resource 0.  Fix this by ensuring that 0 is
never cached in UMA in the first place, and by modifying vmem_alloc()
to fall back to a search of the free lists if the cache is depleted,
rather than blocking in qc_import().

Reported by and discussed with: Brett Gutstein <bgutstein@rice.edu>
Reviewed by: alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17483

5 years agoFix style bugs in in6_pcblookup_lbgroup().
markj [Mon, 22 Oct 2018 16:09:01 +0000 (16:09 +0000)]
Fix style bugs in in6_pcblookup_lbgroup().

This should have been a part of r338470.  No functional changes
intended.

Reported by: gallatin
Reviewed by: gallatin, Johannes Lundberg <johalun0@gmail.com>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17109

5 years agoIf we lost race or were migrated during bucket allocation for the per-CPU
glebius [Mon, 22 Oct 2018 15:48:07 +0000 (15:48 +0000)]
If we lost race or were migrated during bucket allocation for the per-CPU
cache, then we put new bucket on generic bucket cache. However, code didn't
honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache
on a zone that clearly forbids that. Fix this.

Reviewed by: markj

5 years agonfsrvd_readdirplus: for some errors, do not fail the entire request
avg [Mon, 22 Oct 2018 15:33:05 +0000 (15:33 +0000)]
nfsrvd_readdirplus: for some errors, do not fail the entire request

Instead, a failing entry is skipped.
This change consist of two logical changes.

A failure to vget or lookup an entry is considered to be a result of a
concurrent removal, which is the only reasonable explanation given that
the filesystem is busied.  So, the entry would be silently skipped.

In the case of a failure to get attributes of an entry for an NFSv3
request, the entry would be silently skipped.  There can be legitimate
reasons for the failure, but NFSv3 does not provide any means to report
the error, so we have two options: either fail the whole request or
ignore the failed entry.  Traditionally, the old NFS server used the
latter option, so the code is reverted to it.  Making the whole
directory unreadable because of a single entry seems to be unpractical.

Additionally, some bits of code are slightly re-arranged to account for
the new control flow and to honor style(9).

Reviewed by: rmacklem
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D15424

5 years agoStop advertising ARMv8.3 Pointer Authentication
andrew [Mon, 22 Oct 2018 15:18:49 +0000 (15:18 +0000)]
Stop advertising ARMv8.3 Pointer Authentication

This needs firmware and kernel support before userspace can use it. Until
then don't advertise it's available.

MFC after: 3 days

5 years agoFix the ID_AA64ISAR0_EL1 dot product field shift.
andrew [Mon, 22 Oct 2018 15:06:14 +0000 (15:06 +0000)]
Fix the ID_AA64ISAR0_EL1 dot product field shift.

It's 44 in the documentation, use this correct value.

MFC after: 3 days

5 years agoCorrectly set the DAIF bits in new threads
andrew [Mon, 22 Oct 2018 14:58:59 +0000 (14:58 +0000)]
Correctly set the DAIF bits in new threads

We should only unmask interrupts when creating a new thread and leave the
other exceptions in teh same state as before creating the thread.

Reported by: jhibbits
Reviewed by: jhibbits
MFC after: 1 month
Sponsored by: https://reviews.freebsd.org/D17497

5 years agoichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)
avg [Mon, 22 Oct 2018 14:44:44 +0000 (14:44 +0000)]
ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)

The change is based on public documents listed below as well as Linux
changes and the code developed by Kostik.

The documents:
- Intel® C620 Series Chipset Platform Controller Hub Datasheet
- Intel® 100 Series and Intel® C230 Series Chipset Family Platform
  Controller Hub (PCH) Datasheet - Volume 2 of 2

Interesting Linux commits:
- https://github.com/torvalds/linux/commit/9424693035a57961a8eb09e96aab315a7096535d
- https://github.com/torvalds/linux/commit/2a7a0e9bf7b32e838d873226808ab8a6c00148f7

The peculiarity of the new chipsets is that the watchdog resources are
configured in PCI registers of SMBus controller and Power Management
function as opposed to the LPC bridge.  I took a simplistic approach of
querying the resources from the respective PCI devices.  ichwd is still
a device on isa bus.  The PCI devices are found by their slot and
function defined in the datasheets as siblings of the upstream LPC
bridge.

There are some shortcuts and missing features.

First of all, I have not implemented the functionality required to clear
the no-reboot bit.  That would require writing to a special PCI
configuration register of a hidden / invisible PCI device after which
the device would start responding to accesses to other registers.  The
no-reboot bit was not set on my test hardware, so I decided to leave its
handling for the later time.

Also, I did not try to handle the case where the watchdog resources are
not configured by the hardware as well as the case where ACPI defined
operational region conflicts with the watchdog resources.  My test
system did not have either of those problem, so, again, I decided to
leave those cases until later.
See this Linux commit for some details of the ACPI problem:
https://github.com/torvalds/linux/commit/a7ae81952cdab56a1277bd2f9ed7284c0f575120

Finally, I have added only the PCI ID found on my test system.  I think
that more IDs can be added as the change gets tested.

Tested on Dell PowerEdge R740.

PR: 222079
Reviewed by: mav, kib
MFC after: 3 weeks
Relnotes: maybe
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D17585

5 years agoAdd myself to mentees with sbruno as mentor
skozlov [Mon, 22 Oct 2018 14:01:34 +0000 (14:01 +0000)]
Add myself to mentees with sbruno as mentor

Approved by: sbruno (mentor)

5 years agoppc64: limited 32-bit DMA address range
luporl [Mon, 22 Oct 2018 13:40:50 +0000 (13:40 +0000)]
ppc64: limited 32-bit DMA address range

Further investigation of issues with 32-bit DMA on PowerNV revealed that
its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and
cannot be changed by the OS.
Thus, now jhb suggestion of limiting the range in PCI DMA tag seems
the best way to deal with it.

Reviewed by: jhibbits, nwhitehorn, sbruno
Approved by: jhibbits(mentor)
Differential Revision: https://reviews.freebsd.org/D17601

5 years agoResolve deadlock between epoch(9) and various network interface
hselasky [Mon, 22 Oct 2018 13:25:26 +0000 (13:25 +0000)]
Resolve deadlock between epoch(9) and various network interface
SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch
read lock over typical network IOCTL code paths. This is a regression
issue after r334305.

Reviewed by: ae (network)
Differential revision: https://reviews.freebsd.org/D17647
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdded support for formula-based arbitrary baud rates, in contrast to
hselasky [Mon, 22 Oct 2018 11:58:30 +0000 (11:58 +0000)]
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Differential revision: https://reviews.freebsd.org/D16639
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoIn bhyve's fbuf emulation improve the overall "usage" message and
bz [Mon, 22 Oct 2018 11:43:43 +0000 (11:43 +0000)]
In bhyve's fbuf emulation improve the overall "usage" message and
for the vga option, rather than printing the entire option string,
only print vga (as we do for everything else).

MFC after: 3 days

5 years agoDo not trop UDP traffic when TXCSUM_IPV6 flag is on
whu [Mon, 22 Oct 2018 11:23:51 +0000 (11:23 +0000)]
Do not trop UDP traffic when TXCSUM_IPV6 flag is on

PR: 231797
Submitted by: whu
Reviewed by: dexuan
Obtained from: Kevin Morse
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff

5 years agomlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation
slavash [Mon, 22 Oct 2018 10:38:38 +0000 (10:38 +0000)]
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

MFC after:      3 days
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoThe event bytes should be unsigned char.
hselasky [Mon, 22 Oct 2018 08:59:20 +0000 (08:59 +0000)]
The event bytes should be unsigned char.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoDrop sequencer mutex around uiomove() and make sure we don't move more bytes
hselasky [Mon, 22 Oct 2018 08:58:27 +0000 (08:58 +0000)]
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix off-by-one which can lead to panics.
hselasky [Mon, 22 Oct 2018 08:55:58 +0000 (08:55 +0000)]
Fix off-by-one which can lead to panics.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoamd64: finish the tail in memset with an overlapping store
mjg [Mon, 22 Oct 2018 06:44:20 +0000 (06:44 +0000)]
amd64: finish the tail in memset with an overlapping store

Instead of finding the exact size to fit in we can just shift the target
by -8 + tail. Doing a blind write to a previously rep stosq'ed area comes
with a penalty so do it conditionally.

Sample win on EPYC when zeroing a 257 sized buffer (tail = 1) aligned to
16 bytes:
before: 44782846 ops/s
after:  46118614 ops/s

Idea stolen from NetBSD.

Sponsored by: The FreeBSD Foundation

5 years agopfctl: Fix line numbers when \ is used inside ""
kp [Mon, 22 Oct 2018 04:12:51 +0000 (04:12 +0000)]
pfctl: Fix line numbers when \ is used inside ""

PR: 201520
Obtained from: OpenBSD
MFC after: 2 weeks

5 years agoacpi: Add an interface to obtain DSM information
bwidawsk [Mon, 22 Oct 2018 03:29:54 +0000 (03:29 +0000)]
acpi: Add an interface to obtain DSM information

The Device Specific Method (_DSM) is on optional object that defines
device specific controls. This will be useful for our power management
controller in upcoming patches. More information can be found in ACPI
spec 6.2 section 9.1.1

https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf

This patch had a minor modification changing ENOMEM to AE_NO_MEMORY
after it got review and approval but before committing.

Test Plan: Tested in my s0ix branch

Reviewed by: kib
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D17121

5 years agoRemove newly empty directories, plus a few ohters that have crept into
imp [Mon, 22 Oct 2018 02:42:14 +0000 (02:42 +0000)]
Remove newly empty directories, plus a few ohters that have crept into
tree over time (most my fault).

5 years agoRemove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not been
imp [Mon, 22 Oct 2018 02:36:31 +0000 (02:36 +0000)]
Remove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not been
needed for almost 20 years, and is totally useless now that ncr(4) has
been removed.

Relnotes: yes

5 years agoRemove the ncr(4) drive.
imp [Mon, 22 Oct 2018 02:36:18 +0000 (02:36 +0000)]
Remove the ncr(4) drive.

This driver has been obsolete since the FreeBSD 4.x. It should have
been removed then since the sym(4) driver had subsumed it. The driver
was commented out of GENERIC in 2000.

RelNotes: Yes

5 years agoRetire scsi_low
imp [Mon, 22 Oct 2018 02:36:07 +0000 (02:36 +0000)]
Retire scsi_low

scsi_low was a common set of routines to do the SCSI bus sequencing
for the ncv, nsp and stg drivers. Those have been removed, so it's no
longer needed since nothing else in the tree uses it and nothing
likely ever will (it's for super-low-end 8-bit parallel SCSI cards).

5 years agoRemove stg(4) driver
imp [Mon, 22 Oct 2018 02:35:50 +0000 (02:35 +0000)]
Remove stg(4) driver

stg(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame. It was also only enabled on i386.

Relnote: Yes

5 years agoRemove nsp(4) driver
imp [Mon, 22 Oct 2018 02:35:38 +0000 (02:35 +0000)]
Remove nsp(4) driver

nsp(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame. It was also only enabled on i386.

Relnote: Yes

5 years agoRemove ncv(4) driver
imp [Mon, 22 Oct 2018 02:35:26 +0000 (02:35 +0000)]
Remove ncv(4) driver

ncv(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame..

Relnote: Yes

5 years agoRetire dpt(4)
imp [Mon, 22 Oct 2018 02:35:12 +0000 (02:35 +0000)]
Retire dpt(4)

Marked as gone in 12 and not relevant since the early 90s. No
sightings in nycbug's dmesg database.

Relnotes: yes

5 years agoRemove bt(4) driver
imp [Mon, 22 Oct 2018 02:34:59 +0000 (02:34 +0000)]
Remove bt(4) driver

The buslogic scsi driver has been tagged as gone in 12 for some time
now. Remove it. The nycbug dmesg database shows only one sighting in 6
for this driver. It was very popular in the early days of the project,
but that popularity seems to have died by 2004 when the nycbug
database started up.

Relnotes: yes

5 years agoRemove adv(4) and adw(4)
imp [Mon, 22 Oct 2018 02:34:47 +0000 (02:34 +0000)]
Remove adv(4) and adw(4)

Remove the advanssy drivers (both adv and adw). They were tagged as
gone in 12 a while qgo. The nycbug dmesg database shows this was last
seen in 6 and there were only a few adv sightings then (none for adw).

Relnotes: yes

5 years agoRemove aic(4) driver
imp [Mon, 22 Oct 2018 02:34:35 +0000 (02:34 +0000)]
Remove aic(4) driver

aic was marked to be gone in 12 a while ago. Go ahead and remove it.
nycbug's dmesg database shows this was last seen in 6 and one more
time in 4.x. It never was popular, and what popularity it had was over
before the nycbug databse got going in 2004.

Relnotes: yes

5 years agoRemove aha(4) from the tree.
imp [Mon, 22 Oct 2018 02:34:25 +0000 (02:34 +0000)]
Remove aha(4) from the tree.

We tagged aha as gone in 12 a while ago. Proceed with its removal.
Data from nycbug's database shows the last sighting of this driver in
6, with the prior one in 4.x show its popularity had died prior to
4.x.

Relnotes: yes

5 years agoRemove mse(4) from tree
imp [Mon, 22 Oct 2018 02:34:10 +0000 (02:34 +0000)]
Remove mse(4) from tree

Remove mse and all support for bus and inport devices from the tree.
Data from nycbug's dmesg database shows the last sighting of this
driver was in 4.10 on only one machine.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17628

5 years agoRemove joy(4) driver.
imp [Mon, 22 Oct 2018 02:34:00 +0000 (02:34 +0000)]
Remove joy(4) driver.

This driver was marked as gone in 12. We're at 13 now. Remove it.
Data from nycbug's dmesg cache shows only one potential user,
suggesting it never was used much.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D17629

5 years agoRemove the gone_in(12) devices.
imp [Mon, 22 Oct 2018 02:28:18 +0000 (02:28 +0000)]
Remove the gone_in(12) devices.

We're planning on removing adv, adw, aha, aic, bt, ncv, nsp, and stg
soon. They have been tagged for removal in 12. At least get them out
of GENERIC.

MFC after: 3 days
Relnotes: yes

5 years agoAdd explicit copyright text to trivial header
cem [Mon, 22 Oct 2018 01:27:11 +0000 (01:27 +0000)]
Add explicit copyright text to trivial header

Reported by: rgrimes

5 years agopowerpc: stash off srr0 in si_addr for signals
jhibbits [Mon, 22 Oct 2018 00:27:37 +0000 (00:27 +0000)]
powerpc: stash off srr0 in si_addr for signals

si_addr is the address of the instruction executing at the time the
signal was sent.  Populate this field with srr0, which, though not
always the case, is most often the instruction that triggered the fault.

5 years agopowerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands
jhibbits [Mon, 22 Oct 2018 00:21:27 +0000 (00:21 +0000)]
powerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands

debugf() is unnecessary for the TLB printing functions, as they're only
intended to be used from ddb.  Instead, make them full DDB 'show'
commands, so now it can be written as 'show tlb1' and 'show tlb0'
instead of calling the function, hoping DEBUG has been defined.

5 years agoNew sysctl: net.inet.icmp.error_keeptags
eugen [Sun, 21 Oct 2018 21:29:19 +0000 (21:29 +0000)]
New sysctl: net.inet.icmp.error_keeptags

Currently, icmp_error() function copies FIB number from original packet
into generated ICMP response but not mbuf_tags(9) chain.
This prevents us from easily matching ICMP responses corresponding
to tagged original packets by means of packet filter such as ipfw(8).
For example, ICMP "time-exceeded in-transit" packets usually generated
in response to traceroute probes lose tags attached to original packets.

This change adds new sysctl net.inet.icmp.error_keeptags
that defaults to 0 to avoid extra overhead when this feature not needed.

Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags
from original packet to generated ICMP response.

PR: 215874
MFC after: 1 month

5 years agotcpdump: Log uid on pflog interfaces
kp [Sun, 21 Oct 2018 21:17:42 +0000 (21:17 +0000)]
tcpdump: Log uid on pflog interfaces

If pf logs the user id ('pass out log (user)') have tcpdump also print
this.

Example output:
 00:00:00.000000 rule 0/0(match) [uid 1001]: pass out on vtnet0: (tos 0x0, ttl 64, id 57539, offset 0, flags [none], proto UDP (17), length 55)
    172.16.2.2.18337 > 172.16.2.1.53: [bad udp cksum 0x5c58 -> 0x16e4!] 40222+ A? google.be. (27)

PR: 122773
Differential Revision: https://reviews.freebsd.org/D17625

5 years agoInclude <sys/eventhandler.h> to fix the build.
ae [Sun, 21 Oct 2018 18:39:34 +0000 (18:39 +0000)]
Include <sys/eventhandler.h> to fix the build.

MFC after: 1 month

5 years agoFollow the fix in r339532 (by glebius):
ae [Sun, 21 Oct 2018 18:30:27 +0000 (18:30 +0000)]
Follow the fix in r339532 (by glebius):
  Fix exiting an epoch(9) we never entered. May happen only with MAC.

MFC after: 1 month

5 years agoRework if_ipsec(4) to use epoch(9) instead of rmlock.
ae [Sun, 21 Oct 2018 18:24:20 +0000 (18:24 +0000)]
Rework if_ipsec(4) to use epoch(9) instead of rmlock.

* use CK_LIST and FNV hash to keep chains of softc;
* read access to softc is protected by epoch();
* write access is protected by ipsec_ioctl_sx. Changing of softc fields
  is allowed only when softc is unlinked from CK_LIST chains.
* linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
  exclusive locked.
* the plain LIST of all softc is replaced by hash table that uses ingress
  address of tunnels as a key.
* added support for appearing/disappearing of ingress address handling.
  Now it is allowed configure non-local ingress IP address, and thus the
  problem with if_ipsec(4) configuration that happens on boot, when
  ingress address is not yet configured, is solved.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17190

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_me(4).
ae [Sun, 21 Oct 2018 18:18:37 +0000 (18:18 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_me(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gre(4).
ae [Sun, 21 Oct 2018 18:13:45 +0000 (18:13 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gre(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17214

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gif(4).
ae [Sun, 21 Oct 2018 18:06:15 +0000 (18:06 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gif(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;
* remove the note about ingress address from BUGS section.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoAdd KPI that can be used by tunneling interfaces to handle IP addresses
ae [Sun, 21 Oct 2018 17:55:26 +0000 (17:55 +0000)]
Add KPI that can be used by tunneling interfaces to handle IP addresses
appearing and disappearing on the host system.

Such handling is need, because tunneling interfaces must use addresses,
that are configured on the host as ingress addresses for tunnels.
Otherwise the system can send spoofed packets with source address, that
belongs to foreign host.

The KPI uses ifaddr_event_ext event to implement addresses tracking.
Tunneling interfaces register event handlers and then they are
notified by the kernel, when an address disappears or appears.

ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event()
in the ip_encap.c

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoman: fix vale(4) port naming
vmaffione [Sun, 21 Oct 2018 17:15:09 +0000 (17:15 +0000)]
man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

Approved by: bcr, gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17411