]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
6 years agoMFC r320644:
allanjude [Tue, 4 Jul 2017 15:53:54 +0000 (15:53 +0000)]
MFC r320644:
Add deprecation notices for all rcmd tools

git-svn-id: svn://svn.freebsd.org/base/stable/10@320646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r320062, r320070, r320126
rmacklem [Tue, 4 Jul 2017 01:28:17 +0000 (01:28 +0000)]
MFC: r320062, r320070, r320126
This is a partial merge of only the NFS changes and not the maxbcachebuf
tunable.

The NFS client changes make the code handle different I/O sizes more
correctly. However, with the limit at 64K, they are not actually
necessary.
This MFC is mainly being done so that subsequent MFCs to the NFS
code will merge easily.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319699
alc [Mon, 3 Jul 2017 22:21:44 +0000 (22:21 +0000)]
MFC r319699
  When allocating swap blocks, if the available number of free blocks in a
  subtree is already zero, then setting the "largest contiguous free block"
  hint for that subtree to anything other than zero makes no sense.  (To be
  clear, assigning a value to the hint that is too large is not a correctness
  problem, only a pessimization.)

MFC r319755
  blist_fill()'s return type is too narrow.  blist_fill() accepts a 64-bit
  quantity as the size of the range to fill, but returns a 32-bit quantity
  as the number of blocks that were allocated to fill that range.  This
  revision corrects that mismatch.

MFC r319793
  Remove an unnecessary field from struct blist.  (The comment describing
  what this field represented was also inaccurate.)

  In r178792, blist_create() grew a malloc flag, allowing M_NOWAIT to be
  specified.  However, blist_create() was not modified to handle the
  possibility that a malloc() call failed.  Address this omission.

  Increase the width of the local variable "radix" to 64 bits.  This
  matches the width of the corresponding field in struct blist.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: r319882
rmacklem [Mon, 3 Jul 2017 20:12:31 +0000 (20:12 +0000)]
MFC: r319882
Define NFS_MAXXDR as the upper bound on XDR overhead in an NFS RPC.

This definition is a part of the maxiotune2 patch that will be
committed soon.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320421:
ken [Mon, 3 Jul 2017 15:34:19 +0000 (15:34 +0000)]
MFC r320421:

  ------------------------------------------------------------------------
  r320421 | ken | 2017-06-27 13:26:02 -0600 (Tue, 27 Jun 2017) | 37 lines

  Fix a panic in camperiphfree().

  If a peripheral driver (e.g. da, sa, cd) is added or removed from the
  peripheral driver list while an unrelated peripheral driver instance (e.g.
  da0, sa5, cd2) is going away and is inside camperiphfree(), we could
  dereference an invalid pointer.

  When peripheral drivers are added or removed (see periphdriver_register()
  and periphdriver_unregister()), the peripheral driver array is resized
  and existing entries are moved.

  Although we hold the topology lock while we traverse the peripheral driver
  list, we retain a pointer to the location of the peripheral driver pointer
  and then drop the topology lock.  So we are still vulnerable to the list
  getting moved around while the lock is dropped.

  To solve the problem, cache a copy of the peripheral driver pointer.  If
  its storage location in the list changes while we have the lock dropped, it
  won't have any effect.

  This doesn't solve the issue that peripheral drivers ("da", "cd", as opposed
  to individual instances like "da0", "cd0") are not generally part of a
  reference counting scheme to guard against deregistering them while there
  are instances active.  The caller (generally the person unloading a module)
  has to be aware of active drivers and not unload something that is in use.

  sys/cam/cam_periph.c:
   In camperiphfree(), cache a pointer to the peripheral driver
   instance to avoid holding a pointer to an invalid memory location
   in the event that the peripheral driver list changes while we have
   the topology lock dropped.

  PR: kern/219701
  Submitted by: avg
  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------
PR: kern/219701
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@320601 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320488:
gjb [Mon, 3 Jul 2017 13:02:21 +0000 (13:02 +0000)]
MFC r320488:
 Correct the branch naming convention in param.h.
 While here, consistently use upper-case 'X' to represent the
 version number.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@320596 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320093: Check return value of seteuid() and bail out if we fail.
delphij [Mon, 3 Jul 2017 05:30:31 +0000 (05:30 +0000)]
MFC r320093: Check return value of seteuid() and bail out if we fail.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320494: Fix double free by reverting r300385 and r300624 which was
delphij [Mon, 3 Jul 2017 02:14:42 +0000 (02:14 +0000)]
MFC r320494: Fix double free by reverting r300385 and r300624 which was
false positive reported by cppcheck.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320332:
kib [Sun, 2 Jul 2017 03:50:22 +0000 (03:50 +0000)]
MFC r320332:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320049
alc [Sat, 1 Jul 2017 22:21:11 +0000 (22:21 +0000)]
MFC r320049
  Pages that are passed to swap_pager_putpages() should already be fully
  dirty.  Assert that they are fully dirty rather than redundantly calling
  vm_page_dirty() on them.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320181
alc [Sat, 1 Jul 2017 20:08:45 +0000 (20:08 +0000)]
MFC r320181
  Eliminate an unused macro.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319605
alc [Sat, 1 Jul 2017 19:24:53 +0000 (19:24 +0000)]
MFC r319605
  The variable "breakout" is used like a Boolean, so actually define it as
  one.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318592: compress: Allow uncompress -c with multiple pathnames,
jilles [Sat, 1 Jul 2017 13:03:02 +0000 (13:03 +0000)]
MFC r318592: compress: Allow uncompress -c with multiple pathnames,
as required by POSIX.

Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating
the uncompressed data.

Passing multiple pathnames to compress -c remains disallowed, since the
result cannot be decompressed.

PR: 219387

git-svn-id: svn://svn.freebsd.org/base/stable/10@320532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317912: sh: Fix INTOFF leak after a builtin with different locale
jilles [Sat, 1 Jul 2017 12:57:00 +0000 (12:57 +0000)]
MFC r317912: sh: Fix INTOFF leak after a builtin with different locale
settings.

After executing a builtin with different locale settings such as
  LC_ALL=C true
SIGINT handling was left disabled indefinitely.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320531 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320316:
kib [Sat, 1 Jul 2017 03:39:38 +0000 (03:39 +0000)]
MFC r320316:
Do not try to unmark MAP_ENTRY_IN_TRANSITION marked by other thread.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320308:
kib [Sat, 1 Jul 2017 03:38:12 +0000 (03:38 +0000)]
MFC r320308:
Translate between abridged and full x87 tags for compat32 ptrace(PT_GETFPREGS).

git-svn-id: svn://svn.freebsd.org/base/stable/10@320525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318591: compress: Add basic tests.
jilles [Fri, 30 Jun 2017 22:16:28 +0000 (22:16 +0000)]
MFC r318591: compress: Add basic tests.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r315005: sh: Fix executing wrong command with ${x#$(y)}$(z).
jilles [Fri, 30 Jun 2017 21:32:48 +0000 (21:32 +0000)]
MFC r315005: sh: Fix executing wrong command with ${x#$(y)}$(z).

The parsed internal representation of words consists of a byte string with a
list of nodes (commands in command substitution). Each unescaped CTLBACKQ or
CTLBACKQ | CTLQUOTE byte corresponds to an entry in the list.

If param in ${param#%##%%word} is not set, the word is not expanded (in a
deviation of POSIX shared with other ash variants and ksh93). Erroneously,
the pointer in the list of commands (argbackq) was not advanced. This caused
the wrong command to be executed later if the outer word contained another
command substitution.

Example:
  echo "${unsetvar#$(echo a)}$(echo b)"
wrote "a" but should write "b".

git-svn-id: svn://svn.freebsd.org/base/stable/10@320510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r308782:
avg [Fri, 30 Jun 2017 09:34:50 +0000 (09:34 +0000)]
MFC r308782:
After some ZIL changes 6 years ago zil_slog_limit got partially broken
due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
Actually because of other changes about that time zl_itx_list_sz is not
really required to implement the functionality, so this patch removes
some unneeded broken code and variables.

Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
single heavy logger, that increased latency for other (more latency critical)
loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
huge latency increase for heavy writers, this implementation caused double
write of all data, since the log records were explicitly prepared for SLOG.
Since we now have I/O scheduler, I've found it can be much more efficient
to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.

Existing ZIL implementation had problem with space efficiency when it
has to write large chunks of data into log blocks of limited size. In some
cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
spinning rust, that also reduced log write speed in half, since head had to
uselessly fly over allocated but not written areas. This change improves
the situation by offloading problematic operations from z*_log_write() to
zil_lwb_commit(), which knows real situation of log blocks allocation and
can split large requests into pieces much more efficiently. Also as side
effect it removes one of two data copy operations done by ZIL code WR_COPIED
case.

While there, untangle and unify code of z*_log_write() functions.
Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
block boundary, that may also improve efficiency if ZPL is made to do that.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320372:
markj [Thu, 29 Jun 2017 17:29:07 +0000 (17:29 +0000)]
MFC r320372:
Fix a memory leak in ses_get_elm_devnames().

git-svn-id: svn://svn.freebsd.org/base/stable/10@320474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r281771
alc [Wed, 28 Jun 2017 06:40:13 +0000 (06:40 +0000)]
MFC r281771
  Eliminate an unused variable.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320440 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r281720
alc [Wed, 28 Jun 2017 06:13:58 +0000 (06:13 +0000)]
MFC r281720
  Eliminate an unused variable.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320202:
kib [Wed, 28 Jun 2017 05:21:00 +0000 (05:21 +0000)]
MFC r320202:
Call pmap_copy() only for map entries which have the backing object
instantiated.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320437 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320201:
kib [Wed, 28 Jun 2017 04:53:06 +0000 (04:53 +0000)]
MFC r320201:
Assert that the protection of a new map entry is a subset of the max
protection.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314310
alc [Wed, 28 Jun 2017 04:23:20 +0000 (04:23 +0000)]
MFC r314310
  Refine the fix from r312954.  Specifically, add a new PDE-only flag,
  PG_PROMOTED, that indicates whether lingering 4KB page mappings might
  need to be flushed on a PDE change that restricts or destroys a 2MB
  page mapping.  This flag allows the pmap to avoid range invalidations
  that are both unnecessary and costly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320432 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320175
davidcs [Mon, 26 Jun 2017 18:23:40 +0000 (18:23 +0000)]
MFC r320175
Add pkts_cnt_oversized to stats.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320368 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC of 320176:
mckusick [Mon, 26 Jun 2017 17:33:33 +0000 (17:33 +0000)]
MFC of 320176:

Allow '_' in labels when specifying -L to newfs.

PR: 220163
Reported by: Keve Nagy
Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@320366 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320123:
ken [Mon, 26 Jun 2017 15:23:12 +0000 (15:23 +0000)]
MFC r320123:

  Fix a potential sleep while holding a mutex in the sa(4) driver.

  If the user issues a MTIOCEXTGET ioctl, and the tape drive in question has
  a serial number that is longer than 80 characters, we malloc a buffer in
  saextget() to hold the output of cam_strvis().

  Since a mutex is held in that codepath, doing a M_WAITOK malloc could lead
  to sleeping while holding a mutex.  Change it to a M_NOWAIT malloc and bail
  out if we fail to allocate the memory.  Devices with serial numbers longer
  than 80 bytes are very rare (I don't recall seeing one), so this
  should be a very unusual case to hit.  But it is a bug that should be fixed.

  sys/cam/scsi/scsi_sa.c:
   In saextget(), if we need to malloc a buffer to hold the output of
   cam_strvis(), don't wait for the memory.  Fail and return an error
   if we can't allocate the memory immediately.

PR: kern/220094
Submitted by: Jia-Ju Bai <baijiaju1990@163.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@320361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320259: jedec_ts: read device id from the correct register
avg [Mon, 26 Jun 2017 09:34:41 +0000 (09:34 +0000)]
MFC r320259: jedec_ts: read device id from the correct register

git-svn-id: svn://svn.freebsd.org/base/stable/10@320355 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320242, r320256:
cy [Mon, 26 Jun 2017 05:43:44 +0000 (05:43 +0000)]
MFC r320242, r320256:

Update leap-seconds to leap-seconds.3676924800.

As per https://datacenter.iers.org/eop/-/somos/5Rgv/latest/16:

     INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)

SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE

SERVICE DE LA ROTATION TERRESTRE
OBSERVATOIRE DE PARIS
61, Av. de l'Observatoire 75014 PARIS (France)
Tel.      : 33 (0) 1 40 51 23 35
FAX       : 33 (0) 1 40 51 22 91
Internet  : services.iers@obspm.fr

                                             Paris, 9 January 2017

                                             Bulletin C 53

                                             To authorities responsible
                                             for the measurement and
                                             distribution of time

                          INFORMATION ON UTC - TAI

 NO leap second will be introduced at the end of June 2017.
 The difference between Coordinated Universal Time UTC and the
 International Atomic Time TAI is :

     from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s

 Leap seconds can be introduced in UTC at the end of the months of December
 or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
 six months, either to announce a time step in UTC, or to confirm that there
 will be no time step at the next possible date.

                                            Christian BIZOUARD
                                            Director
                                            Earth Orientation Center of IERS
                                            Observatoire de Paris, France

Obtained from:  ftp://time.nist.gov/pub/leap-seconds.3676924800

git-svn-id: svn://svn.freebsd.org/base/stable/10@320350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 320184
sephe [Mon, 26 Jun 2017 02:33:59 +0000 (02:33 +0000)]
MFC 320184

    hyperv/storvsc: Reduce log verbosity

    On some windows hosts TEST_UNIT_READY command will return
    SRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Medium
    not present - tray closed)", this occurs periodically, and
    not hurt anything else.  So, we prefer to ignore this kind
    of errors.

    PR:             219973
    Submitted by:   Hongjiang Zhang <hongzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D11271

git-svn-id: svn://svn.freebsd.org/base/stable/10@320348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r317159: libstdc++: fix symbol version script for LLD
emaste [Mon, 26 Jun 2017 02:00:22 +0000 (02:00 +0000)]
MFC r317159: libstdc++: fix symbol version script for LLD

LLD is less tolerant of inconsistencies in the symbol version script.

- Add a ; on the last entry in a version block
- Remove duplicated symbols, retaining those in the earliest block

PR: 214796
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@320346 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320216: Fix use-after-free introduced in r300388.
delphij [Sun, 25 Jun 2017 05:46:03 +0000 (05:46 +0000)]
MFC r320216: Fix use-after-free introduced in r300388.

In r300388, endnetconfig() was called on nc_handle which would release
the associated netconfig structure, which means tmpnconf->nc_netid
would be a use-after-free.

Solve this by doing endnetconfig() in return paths instead.

Reported by: jemalloc via kevlo
Reviewed by: cem, ngie (earlier version)

git-svn-id: svn://svn.freebsd.org/base/stable/10@320325 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320052:
kib [Sat, 24 Jun 2017 14:44:59 +0000 (14:44 +0000)]
MFC r320052:
Do not leak syslog_mutex on cancellation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320312 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320183: Reduce code duplication in rpc.lockd.
delphij [Sat, 24 Jun 2017 07:44:05 +0000 (07:44 +0000)]
MFC r320183: Reduce code duplication in rpc.lockd.

Reuse create_service code instead of duplicating it in
lookup_addresses for kernel NLM.

As a (good) side effect this also fixed a few issues that were
already fixed in the former but never applied to the latter.

Reviewed by: kevlo

git-svn-id: svn://svn.freebsd.org/base/stable/10@320303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r320038:
kib [Fri, 23 Jun 2017 19:04:40 +0000 (19:04 +0000)]
MFC r320038:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320293 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRevert r320228 as well
ngie [Thu, 22 Jun 2017 07:57:29 +0000 (07:57 +0000)]
Revert r320228 as well

See r320229 for the other related revert commit.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320230 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRevert r320222,r320223,r320224
ngie [Thu, 22 Jun 2017 07:54:12 +0000 (07:54 +0000)]
Revert r320222,r320223,r320224

The committed changes (reverted after this commit) break POLA on
a stable branch.

Requested by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/10@320229 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318545:
ngie [Thu, 22 Jun 2017 07:42:36 +0000 (07:42 +0000)]
MFC r318545:

Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install`

I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file,
and continued using it in r318441 and r318443.

This will fix the files being handled improperly via installworld, preventing tools like
etcupdate, mergemaster, etc from functioning properly when comparing the installed
contents on a system vs the contents in a source tree when doing merges.

PR: 219404
MFC with: r277541, r318441, r318443

git-svn-id: svn://svn.freebsd.org/base/stable/10@320228 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r309194,r309216:
ngie [Thu, 22 Jun 2017 07:14:37 +0000 (07:14 +0000)]
MFC r309194,r309216:

r309194 (by bapt):

initialize *nextp which could be left uninitialized in case the configuration
file cannot be open/read

CID: 1365665

r309216 (by bapt):

Properly initialize nextp

git-svn-id: svn://svn.freebsd.org/base/stable/10@320224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r308158:
ngie [Thu, 22 Jun 2017 07:10:01 +0000 (07:10 +0000)]
MFC r308158:
r308158 (by bapt):

Allow symlinks to be followed in cron.d directories and fix detection of
regular files on NFS

git-svn-id: svn://svn.freebsd.org/base/stable/10@320223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r308139,r308157,r308160,r316818,r318250,r318443:
ngie [Thu, 22 Jun 2017 07:08:18 +0000 (07:08 +0000)]
MFC r308139,r308157,r308160,r316818,r318250,r318443:

r308139 (by bapt):

cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Relnotes: yes

r308157 (by bapt):

Fix typo in cron(8) date

r308160 (by bapt):

syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Relnotes: yes

r316818:

Conditionally install /etc/pam.d/ftp* and /etc/pam.d/telnetd

/etc/pam.d/ftp* should be installed with MK_FTP != no and
/etc/pam.d/telnetd should be installed when MK_TELNET != no.

r318250:

Handle the logfiles in newsyslog and syslogd conditionally, based on
src.conf(5) knobs

This will allow consumers of FreeBSD to use the unmodified configuration
files out of the box more than previously.

Both newsyslog.conf and syslog.conf:
- /var/log/lpd-errs (MK_LPR != no)
- /var/log/ppp.log (MK_PPP != no)
- /var/log/xferlog (MK_FTP != no)

newsyslog.conf:
- /var/log/amd.log (MK_AMD != no)
- /var/log/pflog (MK_PF != no)
- /var/log/sendmail.st (MK_SENDMAIL != no)

r318443:

Conditionally handle the crontab entry for atrun(8)

The default crontab prior to this commit assumes atrun(8) is always
present, which isn't true if MK_AT == no. Move atrun(8) execution
from /etc/crontab to /etc/cron.d/at, and base /etc/cron.d/at's installation
on MK_AT. cron(8) will detect /etc/cron.d/at's presence when the configuration
is loaded and run atrun every 5 minutes like it would prior to this commit.

SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
because atrun(8) executes programs, which may rely on environment
set in the current default /etc/crontab.

Noted by: bdrewery (in an internal review)
Relnotes: yes (may need to add environmental modifications to
     /etc/cron.d/at)

git-svn-id: svn://svn.freebsd.org/base/stable/10@320222 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 313186, 319702: Account for overhead of page structures when sizing page array.
jhb [Wed, 21 Jun 2017 14:39:31 +0000 (14:39 +0000)]
MFC 313186, 319702: Account for overhead of page structures when sizing page array.

313186:

Over the years, the code and comments in vm_page_startup() have diverged in
one respect.  When determining how many page structures to allocate,
contrary to what the comments say, the code does not account for the
overhead of a page structure per page of physical memory.  This revision
changes the code to match the comments.

319702:

Fix an off-by-one error in the VM page array on some systems.

r313186 changed how the size of the VM page array was calculated to be
less wasteful.  For most systems, the amount of memory is divided by
the overhead required by each page (a page of data plus a struct vm_page)
to determine the maximum number of available pages.  However, if the
remainder for the first non-available page was at least a page of data
(so that the only memory missing was a struct vm_page), this last page
was left in phys_avail[] but was not allocated an entry in the VM page
array.  Handle this case by explicitly excluding the page from
phys_avail[].

Requested by: alc

git-svn-id: svn://svn.freebsd.org/base/stable/10@320190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoThe GEOM KPI in stable/10 requires Giant to be unacquired (a requirement
marius [Tue, 20 Jun 2017 19:59:57 +0000 (19:59 +0000)]
The GEOM KPI in stable/10 requires Giant to be unacquired (a requirement
dropped in r300287). So wrap calling into GEOM in {DROP,PICKUP}_GIANT(),
similar to what as been done prio to r300288. This fixes a "Giant owned"
panic with r318159 in place and INVARIANTS enabled.
Reported by: Oliver Pinter

git-svn-id: svn://svn.freebsd.org/base/stable/10@320168 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319964
davidcs [Tue, 20 Jun 2017 18:52:35 +0000 (18:52 +0000)]
MFC r319964
Upgrade STORMFW to 8.30.0.0 and ecore version to 8.30.0.0
Add support for pci deviceID 0x8070 for QLE41xxx product line which
supports 10GbE/25GbE/40GbE

git-svn-id: svn://svn.freebsd.org/base/stable/10@320162 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319932:
markj [Tue, 20 Jun 2017 17:03:06 +0000 (17:03 +0000)]
MFC r319932:
Fix handling of subpage BIO_WRITE and BIO_DELETE requests on swap MDs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 319490: Remove stale cap_rights_get(2) manpage.
jhb [Tue, 20 Jun 2017 15:55:15 +0000 (15:55 +0000)]
MFC 319490: Remove stale cap_rights_get(2) manpage.

The documentation moved to section 3 several years ago, but
'man cap_rights_get' pulls up cap_rights_limit(2) (which is
MLINKed to cap_rights_get.2) instead of cap_rights_get(3).

Approved by: re (gjb)

git-svn-id: svn://svn.freebsd.org/base/stable/10@320150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319916:
kib [Tue, 20 Jun 2017 15:02:59 +0000 (15:02 +0000)]
MFC r319916:
Remove stray return.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320147 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279833: Use the correct event table for Haswell Xeon events
avg [Tue, 20 Jun 2017 08:01:13 +0000 (08:01 +0000)]
MFC r279833: Use the correct event table for Haswell Xeon events

git-svn-id: svn://svn.freebsd.org/base/stable/10@320137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoDirect commit to stable/10 to correctly setting the EIAC and IMS
sbruno [Mon, 19 Jun 2017 15:56:03 +0000 (15:56 +0000)]
Direct commit to stable/10 to correctly setting the EIAC and IMS
registers to the same values when processing interrupts.

This resolves PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211219

PR: 211219
Submitted by: Franco Fitchner <franco@opnsense.org>

git-svn-id: svn://svn.freebsd.org/base/stable/10@320117 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318867: fix vmxnet3 crash when LRO is enabled
avg [Mon, 19 Jun 2017 15:41:39 +0000 (15:41 +0000)]
MFC r318867: fix vmxnet3 crash when LRO is enabled

Sponsored by: Panzura

git-svn-id: svn://svn.freebsd.org/base/stable/10@320116 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r311224: Fix PMC architecture check to handle later IPAs including Skylake
avg [Mon, 19 Jun 2017 15:38:22 +0000 (15:38 +0000)]
MFC r311224: Fix PMC architecture check to handle later IPAs including Skylake

git-svn-id: svn://svn.freebsd.org/base/stable/10@320115 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r292070: More fixes in the various intel processors, fixing missing
avg [Mon, 19 Jun 2017 15:35:41 +0000 (15:35 +0000)]
MFC r292070: More fixes in the various intel processors, fixing missing
IAP_F_FM's...

git-svn-id: svn://svn.freebsd.org/base/stable/10@320114 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r291494: Add support for Intel Skylake and Intel Broadwell PMC's.
avg [Mon, 19 Jun 2017 15:34:07 +0000 (15:34 +0000)]
MFC r291494: Add support for Intel Skylake and Intel Broadwell PMC's.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320113 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r281101: Remove whitespace [in hwpmc]
avg [Mon, 19 Jun 2017 15:24:37 +0000 (15:24 +0000)]
MFC r281101: Remove whitespace [in hwpmc]

git-svn-id: svn://svn.freebsd.org/base/stable/10@320112 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279939: hwpmc: Fix event number to match enum name
avg [Mon, 19 Jun 2017 15:23:07 +0000 (15:23 +0000)]
MFC r279939: hwpmc: Fix event number to match enum name

git-svn-id: svn://svn.freebsd.org/base/stable/10@320111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279836: Add missing counter definitions
avg [Mon, 19 Jun 2017 15:22:05 +0000 (15:22 +0000)]
MFC r279836: Add missing counter definitions

git-svn-id: svn://svn.freebsd.org/base/stable/10@320110 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279835: Fix Ivy Bridge+ MEM_UOPS_RETIRED counters
avg [Mon, 19 Jun 2017 15:20:30 +0000 (15:20 +0000)]
MFC r279835: Fix Ivy Bridge+ MEM_UOPS_RETIRED counters

git-svn-id: svn://svn.freebsd.org/base/stable/10@320109 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279834: Support architectural events on Haswell/Ivy Bridge
avg [Mon, 19 Jun 2017 15:16:47 +0000 (15:16 +0000)]
MFC r279834: Support architectural events on Haswell/Ivy Bridge

git-svn-id: svn://svn.freebsd.org/base/stable/10@320107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279832: Fix Sandy Bridge+ hwpmc branch counters
avg [Mon, 19 Jun 2017 15:13:20 +0000 (15:13 +0000)]
MFC r279832: Fix Sandy Bridge+ hwpmc branch counters

git-svn-id: svn://svn.freebsd.org/base/stable/10@320106 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279829: Add manpage for Haswell Xeon pmc implementation
avg [Mon, 19 Jun 2017 15:09:37 +0000 (15:09 +0000)]
MFC r279829: Add manpage for Haswell Xeon pmc implementation

git-svn-id: svn://svn.freebsd.org/base/stable/10@320105 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279831: Fix pmc unit restrictions to match documentation
avg [Mon, 19 Jun 2017 15:06:37 +0000 (15:06 +0000)]
MFC r279831: Fix pmc unit restrictions to match documentation

git-svn-id: svn://svn.freebsd.org/base/stable/10@320104 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r279830: Fix various bugs in Haswell counter definitions
avg [Mon, 19 Jun 2017 15:04:39 +0000 (15:04 +0000)]
MFC r279830: Fix various bugs in Haswell counter definitions

git-svn-id: svn://svn.freebsd.org/base/stable/10@320103 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r277524: style(9) cleanup in hwpmc
avg [Mon, 19 Jun 2017 15:00:06 +0000 (15:00 +0000)]
MFC r277524: style(9) cleanup in hwpmc

git-svn-id: svn://svn.freebsd.org/base/stable/10@320101 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 281102: hwpmc: add initial Intel Broadwell support.
avg [Mon, 19 Jun 2017 14:50:26 +0000 (14:50 +0000)]
MFC 281102: hwpmc: add initial Intel Broadwell support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320100 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319962:
cy [Mon, 19 Jun 2017 05:02:27 +0000 (05:02 +0000)]
MFC r319962:

Correct example directory location.

Submitted by: olivier@

git-svn-id: svn://svn.freebsd.org/base/stable/10@320090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319676:
pfg [Sun, 18 Jun 2017 21:48:33 +0000 (21:48 +0000)]
MFC r319676:
patch: if reading fails, do not go into infinite loop asking for a filename.

This can happen if no tty is available.

Obtained from: OpenBSD (CVS rev 1.54)

git-svn-id: svn://svn.freebsd.org/base/stable/10@320086 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319972:
hselasky [Sun, 18 Jun 2017 11:48:40 +0000 (11:48 +0000)]
MFC r319972:
Use static device numbering instead of dynamic one when creating
mlx4en network interfaces. This prevents infinite unit number growth
typically when the mlx4en driver is used inside virtual machines which
support runtime PCI attach and detach.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@320067 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC 319670
jpaetzel [Thu, 15 Jun 2017 23:14:04 +0000 (23:14 +0000)]
MFC 319670

Fix SMBFS when saved passwords are greater than 18 characters

PR: 132302
Submitted by: dhorn2000@gmail.com guru@unixarea.de

git-svn-id: svn://svn.freebsd.org/base/stable/10@319992 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319954:
gjb [Thu, 15 Jun 2017 15:50:49 +0000 (15:50 +0000)]
MFC r319954:
 Modernize FreeBSD version numbers in freebsd-update(8).
 While here, expand a contraction to make textproc/igor happy.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@319979 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319852:
delphij [Thu, 15 Jun 2017 04:37:23 +0000 (04:37 +0000)]
MFC r319852:

Fix buffer lengths.

After r319369, the RPC code validates caller supplied buffer length in
taddr2uaddr.  When no -h is specified, the sizeof(ai_addr) is used,
which is always smaller than the required size and therefore uaddr
would be NULL, causing the kernel to copyin() from userland NULL
and fail with EFAULT.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319966 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318995
alc [Thu, 15 Jun 2017 03:58:23 +0000 (03:58 +0000)]
MFC r318995
  In r118390, the swap pager's approach to striping swap allocation over
  multiple devices was changed.  However, swapoff_one() was not fully and
  correctly converted.  In particular, with r118390's introduction of a per-
  device blist, the maximum swap block size, "dmmax", became irrelevant to
  swapoff_one()'s operation.  Moreover, swapoff_one() was performing out-of-
  range operations on the per-device blist that were silently ignored by
  blist_fill().

  This change corrects both of these problems with swapoff_one(), which will
  allow us to potentially increase MAX_PAGEOUT_CLUSTER.  Previously,
  swapoff_one() would panic inside of blist_fill() if you increased
  MAX_PAGEOUT_CLUSTER.

MFC r319001
  After r118390, the variable "dmmax" was neither the correct strip size
  nor the correct maximum block size.  Moreover, after r318995, it serves
  no purpose except to provide information to user space through a read-
  sysctl.

  This change eliminates the variable "dmmax" but retains the sysctl.  It
  also corrects the value returned by the sysctl.

MFC r319604
  Halve the memory being internally allocated by the blist allocator.  In
  short, half of the memory that is allocated to implement the radix tree is
  wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int
  when we changed "daddr_t" to be a 64-bit (signed) int.  (See r96849 and
  r96851.)

MFC r319612
  When the function blist_fill() was added to the kernel in r107913, the swap
  pager used a different scheme for striping the allocation of swap space
  across multiple devices.  And, although blist_fill() was intended to support
  fill operations with large counts, the old striping scheme never performed a
  fill larger than the stripe size.  Consequently, the misplacement of a
  sanity check in blst_meta_fill() went undetected.  Now, moving forward in
  time to r118390, a new scheme for striping was introduced that maintained a
  blist allocator per device, but as noted in r318995, swapoff_one() was not
  fully and correctly converted to the new scheme.  This change completes what
  was started in r318995 by fixing the underlying bug in blst_meta_fill() that
  stops swapoff_one() from simply performing a single blist_fill() operation.

MFC r319627
  Starting in r118390, swaponsomething() began to reserve the blocks at the
  beginning of a swap area for a disk label.  However, neither r118390 nor
  r118544, which increased the reservation from one to two blocks, correctly
  accounted for these blocks when updating the variable "swap_pager_avail".
  This change corrects that error.

MFC r319655
  Originally, this file could be compiled as a user-space application for
  testing purposes.  However, over the years, various changes to the kernel
  have broken this feature.  This revision applies some fixes to get user-
  space compilation working again.  There are no changes in this revision
  to code that is used by the kernel.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC: 319690
dexuan [Wed, 14 Jun 2017 13:23:40 +0000 (13:23 +0000)]
MFC: 319690

r319690
hyperv/pcib: use the device serial number as PCI domain

Currently the PCI domain is initialized with the instance GUID in
vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
while some users want a persistent value for PCI domain. The solution is
that we can change to use the device serial number, which starts with 1
and is unique within a VM.

Obtained from: Haiyang Zhang
Sponsored by: Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@319941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r313021, r319621:
gjb [Thu, 8 Jun 2017 16:04:13 +0000 (16:04 +0000)]
MFC r313021, r319621:

 r313021 (brd):
  Force a few variables to be uppercase when they are evaluated.

 r319621:
  Ensure ${_CW} is uppercase when passing '-c' to mk-vmimage.sh,
  otherwise with 'CLOUDWARE=vagrant-virtualbox', the path to the
  configuration file may be incorrect.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@319701 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318780:
kib [Wed, 7 Jun 2017 11:43:36 +0000 (11:43 +0000)]
MFC r318780:
Use __BSD_VISIBLE test instead checking for absense of _POSIX_SOURCE.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318781:
kib [Wed, 7 Jun 2017 11:42:43 +0000 (11:42 +0000)]
MFC r318781:
Add BIT_OR2(), BIT_AND2(), BIT_NAND2(), BIT_XOR() and BIT_XOR2().

git-svn-id: svn://svn.freebsd.org/base/stable/10@319652 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318998:
cy [Tue, 6 Jun 2017 19:21:35 +0000 (19:21 +0000)]
MFC r318998:

Fix return value of ip_sync_nat. Previously, regardless of error it
always returned a return code of 0.

Obtained from: NetBSD ip_sync.c r1.5

git-svn-id: svn://svn.freebsd.org/base/stable/10@319633 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoWork around a gcc 4.2 bug on powerpc architectures, where using
dim [Tue, 6 Jun 2017 18:40:14 +0000 (18:40 +0000)]
Work around a gcc 4.2 bug on powerpc architectures, where using
-fdata-sections can cause bogus "section type conflict" errors.  See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33168 for more information.

Since the upstream fixes are under GPLv3 and non-trivial, just disable
using function and data sections, at the cost of a slightly larger
executable.

Direct commit to stable/10, since the version of clang in head and
stable/11 cannot be built by gcc 4.2 at all.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319631 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318943 (avg):
gjb [Tue, 6 Jun 2017 14:46:45 +0000 (14:46 +0000)]
MFC r318943 (avg):

 MFV r318942: 8166 zpool scrub thinks it repaired offline device

 https://www.illumos.org/issues/8166
  If we do a scrub while a leaf device is offline (via "zpool offline"),
  we will inadvertently clear the DTL (dirty time log) of the offline
  device, even though it is still damaged. When the device comes back
  online, we will incompletely resilver it, thinking that the scrub
  repaired blocks written before the scrub was started. The incomplete
  resilver can lead to data loss if there is a subsequent failure of a
  different leaf device.
  The fix is to never clear the DTL of offline devices. Note that if a
  device is onlined while a scrub is in progress, the scrub will be
  restarted.
  The problem can be worked around by running "zpool scrub" after
  "zpool online".
  See also https://github.com/zfsonlinux/zfs/issues/5806

PR: 219537
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@319625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319369:
delphij [Tue, 6 Jun 2017 07:22:26 +0000 (07:22 +0000)]
MFC r319369:

 * limit size of buffers to RPC_MAXDATASIZE
 * don't leak memory
 * be more picky about bad parameters

From:

https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt
https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt

via NetBSD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoDocument r319390, cxgbetool(8) addition.
gjb [Mon, 5 Jun 2017 18:54:53 +0000 (18:54 +0000)]
Document r319390, cxgbetool(8) addition.
Document r298427, truss(1) '-H' flag.
Document r304017, ptrace(2) threaded process debugging improvements.
Document r306533, devctl(8) 'clear driver' added.
Document r309560, cxgbe(4) T6 support.
Document r309447, cxgbe(4) VF support for T4/T5 cards.
Document r309560, cxgbe(4) VF support for T6 cards.
Document r308154, cxgbe(4) additional virtual interface support.
Document r306520, PCI passthrough/bhyve improvements.
Document r306472, PCI passthrough/bhyve improvements.

Submitted by: jhb
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@319606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319413:
hselasky [Sun, 4 Jun 2017 08:47:09 +0000 (08:47 +0000)]
MFC r319413:
Free hardware queue resource after port is stopped in the mlx4en(4)
driver. Else if the port is up the resource might still be busy and
the MTT free will fail.

PR: 216493
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@319567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319414:
hselasky [Sun, 4 Jun 2017 08:29:17 +0000 (08:29 +0000)]
MFC r319414:
Allow communication between functions on the same host when using the
mlx4en(4) driver in SRIOV mode.

Place a copy of the destination MAC address in the send WQE only under
SRIOV/eSwitch configuration or when the device is in selftest. This
allows communication between functions on the same host.

PR: 216493
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@319564 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r316503,r316504,r316505:
ngie [Sat, 3 Jun 2017 18:25:36 +0000 (18:25 +0000)]
MFC r316503,r316504,r316505:

r316503:

Clean up trailing whitespace

r316504:

Clean up more trailing whitespace in the licensing tort that
happened to be spaces, not tabs

r316505:

Don't assume NAME_MAX is 255

Query the filesystem limit via getconf(3) instead

git-svn-id: svn://svn.freebsd.org/base/stable/10@319550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318974: uart: add AMT SOL PCI ID
emaste [Sat, 3 Jun 2017 02:47:30 +0000 (02:47 +0000)]
MFC r318974: uart: add AMT SOL PCI ID

I adjusted the description to be similar to existing AMT entries.

PR: 219384

git-svn-id: svn://svn.freebsd.org/base/stable/10@319511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318211:
ngie [Fri, 2 Jun 2017 00:29:23 +0000 (00:29 +0000)]
MFC r318211:

Fix up previous commit

- Apply the logic to the FreeBSD block
- Fix a typo with the getconf(1) call that I would have caught, were
  it not for the fact that I got the blocks wrong.
- Consolidate the hardcoded buffer sizes to the NetBSD block.

This would have been discovered had I run the test on a system where
PATH_MAX != 1024 (I don't have that at my disposal right at this moment).

MFC with: r318210

git-svn-id: svn://svn.freebsd.org/base/stable/10@319484 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318210:
ngie [Fri, 2 Jun 2017 00:27:08 +0000 (00:27 +0000)]
MFC r318210:

ssp_test:read:: query the value of MAXPATHLEN via getconf(1)

In the event the value of PATH_MAX was changed, the assumption that
MAXPATHLEN is 1024 (and hence the buffer length required to trigger
SSP to fail for read(2)) would be invalidated. Query getconf(1) for
the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
increment the value by 1 to ensure that the SSP support tests the
stack smashing support properly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@319483 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318676
davidcs [Thu, 1 Jun 2017 18:37:08 +0000 (18:37 +0000)]
MFC r318676
  Check for IPV6 TCP/UDP CSUM offload in pkt header during transmits.

Submitted by:Shminderjit.Singh@cavium.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@319451 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318895: Fix several problems with mapping code in mps(4).
slm [Thu, 1 Jun 2017 16:54:10 +0000 (16:54 +0000)]
MFC r318895: Fix several problems with mapping code in mps(4).
MFC r318896: Fix several problems with mapping code in mpr(4).

-Add several comments describing what the mapping code is doing.
-Added a callout timer to improve check for missing devices when discovery has
 completed so that missing counts are incremented correctly.
-Fix problems with missing counts not being saved to the HBA.
-Update man pages mps(4) and mpr(4) to include a description of the use
 use_phy_num sysctl variable.
-Remove channel field in the mapping structure because it's not used.
-Improve logging by using mps_dprint or mpr_dprint instead of printf and adding
 more logging where appropriate.
-Add check for a bad index before writing mapping entries to controller.
-The high missing count check in the mapping table was using the incorrect
 initial value, which could lead to a bad result.
-The usage of the IN_USE flag for volume mapping was changed to be more
 intuitive, and was not being used correctly.
-The check for a free DPM entry was changed, as this was completely wrong.
-Updates to the missing count for volumes were not being done correctly, so this
 function was completely rewritten.
-_mapping_add_to_removal_table() was overly complicated and incorrectly used, so
 this function was rewritten.
-Missing counts for all devices were not being incremented properly, so this
 functionality was added.
-The search for space in the mapping table for missing enclosures was not
 calculating the found space correctly due to not breaking out of a loop when
 required, and the num_found variable was not being reset when needed.
-Retries when a device fails to get added due to a full mapping table were
 removed because this is unneccessary.
-mps_mapping_is_reinit_required() and mpr_mapping_is_reinit_required() were
 removed because they were not being used.
-Some functions were renamed to avoid confusion between Target IDs and SAS IDs.
-_mapping_check_update_ir_mt_idx() was removed because it was overly
 complicating volume mapping.
-The setting of the maxtargets variable was changed to include max volumes.
-The setting of the initiator_id variable was changed to be the invalid target
 ID after all targets, including volumes. Previously, this was set to the last
 valid target ID.
-Don't exclude target IDs of RAID components or check for a reuse of a target ID
 for RAID components.
-Some endienness was added.

Approved by: ken, mav

git-svn-id: svn://svn.freebsd.org/base/stable/10@319445 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoDocument r319436, mpr(4) tri-mode support.
gjb [Thu, 1 Jun 2017 15:58:21 +0000 (15:58 +0000)]
Document r319436, mpr(4) tri-mode support.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@319441 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r286567, r286568, r289426, r289429, r295113, r295286, r299367, r299369,
slm [Thu, 1 Jun 2017 15:43:24 +0000 (15:43 +0000)]
MFC r286567, r286568, r289426, r289429, r295113, r295286, r299367, r299369,
    r308217, r308301, r311958, r312437, r318188, r318427, r318679

r286567:
Remove some unused code.

Obtained from: Netflix, Inx.

r286568:
Remove mps_request_polled(), it's redundant to mps_wait_command()

Obtained from: Netflix, Inc.

r289426:
Remove _FreeBSD_version check for something that was only an issue with
9-CURRENT.

Obtained from:  Netlfix, Inc
MFC after:      3 days

r289429:
Revert an extra hunk that crept into the last commit.

Submitted by: emax
Obtained from: Netflix, Inc.
MFC after: 3 days

r295113:
Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: mav, slm
Approved by: rodrigc (mentor)
MFC after: 2 weeks
Sponsored by: gandi.net

r295286:
Add sysctls for dumping out the device mapping tables.  I'm finding this
useful for debugging device-target translation bugs.

MFC after: 3 days
Sponsored by: Netflix

r299367:
Remove NULL checks after M_WAITOK allocations from mps(4).

Reviewed by: asomers@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6296

r299369:
Remove NULL checks after M_WAITOK allocations from mpr(4).

Reviewed by: asomers@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6297

r308217:
Add a fallback to the device mapper logic.  We've seen systems in the field
that are apparently misconfigured by the manufacturer and cause the mapping
logic to fail.  The fallback allows drive numbers to be assigned based on the
PHY number that they're attached to.  Add sysctls and tunables to overrid
this new behavior, but they should be considered only necessary for debugging.

Reviewed by:  imp, smh
Obtained from: Netflix
MFC after: 3 days
Sponsored by: D8403

r308301:
Record the LogInfo field when reporting the IOCStatus.  Helps in
debugging errors.

Submitted by: slm
Obtained from: Netflix
MFC after: 3 days

r311958:
Print out the number of queues/MSIx vectors.

Sponsored by: Netflix

r312437:
Rework the debug print API. Event printing no longer gets special handling.
All of the printing from the tables file now has wrappers so that the
handling is cleaner and it's possible to print something out (say, during
development) without having to fight the global debug flags. This re-org
will also make it easier to have the tables be compiled out at build time
if desired.

Other than fixing some minor bugs, there are no user-visible changes from
this change

Sponsored by: Netflix, Inc.
Differential Revision: D9238

r318188:
Improve error messages during command timeout for the mpr and mps
drivers.

Sponsored by: Netflix

r318427:
Add tri-mode support (SAS/SATA/PCIe).

This includes NVMe device support and adds support for the following adapters:
    SAS 3408
    SAS 3416
    SAS 3508
    SAS 3516
    SAS 3616
    SAS 3708
    SAS 3716

Reviewed by:    ken, scottl, asomers, mav
Approved by: ken, scottl, mav
MFC after:      2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10095

r318679:
Fix powerpc compiler error.

Approved by: ken

git-svn-id: svn://svn.freebsd.org/base/stable/10@319436 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318832: MFV r316923: 8026 retire zfs_throttle_delay and zfs_throttle_resolution
avg [Thu, 1 Jun 2017 14:07:40 +0000 (14:07 +0000)]
MFC r318832: MFV r316923: 8026 retire zfs_throttle_delay and zfs_throttle_resolution

git-svn-id: svn://svn.freebsd.org/base/stable/10@319423 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318830: MFV r316921: 8027 tighten up dsl_pool_dirty_delta
avg [Thu, 1 Jun 2017 14:05:54 +0000 (14:05 +0000)]
MFC r318830: MFV r316921: 8027 tighten up dsl_pool_dirty_delta

git-svn-id: svn://svn.freebsd.org/base/stable/10@319421 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318450:
kib [Thu, 1 Jun 2017 13:22:04 +0000 (13:22 +0000)]
MFC r318450:
Add tests for some cases in r318298.

PR: 219154

git-svn-id: svn://svn.freebsd.org/base/stable/10@319419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r319096: zfs_lookup: fix bogus arguments to lookup of "snapshot" directory
avg [Thu, 1 Jun 2017 11:48:01 +0000 (11:48 +0000)]
MFC r319096: zfs_lookup: fix bogus arguments to lookup of "snapshot" directory

git-svn-id: svn://svn.freebsd.org/base/stable/10@319416 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoRegenerate src.conf(5)
ngie [Thu, 1 Jun 2017 07:10:40 +0000 (07:10 +0000)]
Regenerate src.conf(5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@319391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r314579,r314785:
ngie [Thu, 1 Jun 2017 07:08:26 +0000 (07:08 +0000)]
MFC r314579,r314785:

r314579 (by np):

Add cxgbetool(8) to the base system.

Move cxgbetool from tools/tools to usr.sbin. Compile and install it on
platforms where cxgbe(4) is built by default.  Knobs (WITH_CXGBETOOL and
WITHOUT_CXGBETOOL) have been added so that the user can override the
default setting.

r314785:

Fix some trivial manlint warnings

Sentences should begin on new lines, per manlint.

Bump .Dd for the change

git-svn-id: svn://svn.freebsd.org/base/stable/10@319390 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318437:
ngie [Thu, 1 Jun 2017 06:42:20 +0000 (06:42 +0000)]
MFC r318437:

Revert local changes to find_progenv accidentally committed in r318436

MFC with: r318436

git-svn-id: svn://svn.freebsd.org/base/stable/10@319386 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318436:
ngie [Thu, 1 Jun 2017 06:41:27 +0000 (06:41 +0000)]
MFC r318436:

usr.bin/getconf: add some initial tests

Items tested via this commit are:
- Some basic POSIX constants.
- Some valid programming environments with -v.
- Some invalid programming environments via -v.

NOTE: this test makes assumptions about ILP32/LP32 vs LP64 that are
currently not true on all architectures to avoid hardcoding some
architectures in the tests. I'm working on improving getconf(1) to be
more sane about handling ILP32/LP32 vs LP64. Future commits are coming
soon to address this.

Tested with: amd64, i386

git-svn-id: svn://svn.freebsd.org/base/stable/10@319385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

6 years agoMFC r318434:
ngie [Thu, 1 Jun 2017 06:39:55 +0000 (06:39 +0000)]
MFC r318434:

Make the `.gperf.c` suffix rule depend on fake-gperf.awk

Parameterize out fake-gperf.awk to avoid duplicating the path

git-svn-id: svn://svn.freebsd.org/base/stable/10@319382 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f