]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r345264:
ae [Sun, 14 Apr 2019 12:39:09 +0000 (12:39 +0000)]
MFC r345264:
  Add NAT64 CLAT implementation as defined in RFC6877.

  CLAT is customer-side translator that algorithmically translates 1:1
  private IPv4 addresses to global IPv6 addresses, and vice versa.
  It is implemented as part of ipfw_nat64 kernel module. When module
  is loaded or compiled into the kernel, it registers "nat64clat" external
  action. External action named instance can be created using `create`
  command and then used in ipfw rules. The create command accepts two
  IPv6 prefixes `plat_prefix` and `clat_prefix`. If plat_prefix is ommitted,
  IPv6 NAT64 Well-Known prefix 64:ff9b::/96 will be used.

    # ipfw nat64clat CLAT create clat_prefix SRC_PFX plat_prefix DST_PFX
    # ipfw add nat64clat CLAT ip4 from IPv4_PFX to any out
    # ipfw add nat64clat CLAT ip6 from DST_PFX to SRC_PFX in

  Obtained from: Yandex LLC
  Submitted by: Boris N. Lytochkin
  Relnotes: yes
  Sponsored by: Yandex LLC

5 years agoMFC r345263:
ae [Sun, 14 Apr 2019 12:35:58 +0000 (12:35 +0000)]
MFC r345263:
  Add SPDX-License-Identifier and update year in copyright.

5 years agoMFC r345262:
ae [Sun, 14 Apr 2019 12:34:30 +0000 (12:34 +0000)]
MFC r345262:
  Modify struct nat64_config.

  Add second IPv6 prefix to generic config structure and rename another
  fields to conform to RFC6877. Now it contains two prefixes and length:
  PLAT is provider-side translator that translates N:1 global IPv6 addresses
  to global IPv4 addresses. CLAT is customer-side translator (XLAT) that
  algorithmically translates 1:1 IPv4 addresses to global IPv6 addresses.
  Use PLAT prefix in stateless (nat64stl) and stateful (nat64lsn)
  translators.

  Modify nat64_extract_ip4() and nat64_embed_ip4() functions to accept
  prefix length and use plat_plen to specify prefix length.

  Retire net.inet.ip.fw.nat64_allow_private sysctl variable.
  Add NAT64_ALLOW_PRIVATE flag and use "allow_private" config option to
  configure this ability separately for each NAT64 instance.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC r339542:
ae [Sun, 14 Apr 2019 12:28:41 +0000 (12:28 +0000)]
MFC r339542:
  Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
  to switch the output method in run-time. Also document some sysctl
  variables that can by changed for NAT64 module.

  NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use
  if_output directly from nat64 module. By default is used netisr based
  output method. Now both methods can be used, but they require different
  handling by rules.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D16647

5 years agoMFC r344709 (by ygy):
ae [Sun, 14 Apr 2019 12:14:25 +0000 (12:14 +0000)]
MFC r344709 (by ygy):
  Fix typos and caps for ipfw(8) man page.

  PR: 236030
  Submitted by: olgeni

5 years agoMFC r344665 (by trhodes):
ae [Sun, 14 Apr 2019 12:10:23 +0000 (12:10 +0000)]
MFC r344665 (by trhodes):
  Grammar tweaks in ipfw manual page.

5 years agoMFC r341471:
ae [Sun, 14 Apr 2019 12:05:08 +0000 (12:05 +0000)]
MFC r341471:
  Reimplement how net.inet.ip.fw.dyn_keep_states works.

  Turning on of this feature allows to keep dynamic states when parent
  rule is deleted. But it works only when the default rule is
  "allow from any to any".

  Now when rule with dynamic opcode is going to be deleted, and
  net.inet.ip.fw.dyn_keep_states is enabled, existing states will reference
  named objects corresponding to this rule, and also reference the rule.
  And when ipfw_dyn_lookup_state() will find state for deleted parent rule,
  it will return the pointer to the deleted rule, that is still valid.
  This implementation doesn't support O_LIMIT_PARENT rules.

  The refcnt field was added to struct ip_fw to keep reference, also
  next pointer added to be able iterate rules and not damage the content
  when deleted rules are chained.

  Named objects are referenced only when states are going to be deleted to
  be able reuse kidx of named objects when new parent rules will be
  installed.

  ipfw_dyn_get_count() function was modified and now it also looks into
  dynamic states and constructs maps of existing named objects. This is
  needed to correctly export orphaned states into userland.

  ipfw_free_rule() was changed to be global, since now dynamic state can
  free rule, when it is expired and references counters becomes 1.

  External actions subsystem also modified, since external actions can be
  deregisterd and instances can be destroyed. In these cases deleted rules,
  that are referenced by orphaned states, must be modified to prevent access
  to freed memory. ipfw_dyn_reset_eaction(), ipfw_reset_eaction_instance()
  functions added for these purposes.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D17532

MFC r341472:
  Add ability to request listing and deleting only for dynamic states.

  This can be useful, when net.inet.ip.fw.dyn_keep_states is enabled, but
  after rules reloading some state must be deleted. Added new flag '-D'
  for such purpose.

  Retire '-e' flag, since there can not be expired states in the meaning
  that this flag historically had.

  Also add "verbose" mode for listing of dynamic states, it can be enabled
  with '-v' flag and adds additional information to states list. This can
  be useful for debugging.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

MFC r344018:
  Remove `set' field from state structure and use set from parent rule.

  Initially it was introduced because parent rule pointer could be freed,
  and rule's information could become inaccessible. In r341471 this was
  changed. And now we don't need this information, and also it can become
  stale. E.g. rule can be moved from one set to another. This can lead
  to parent's set and state's set will not match. In this case it is
  possible that static rule will be freed, but dynamic state will not.
  This can happen when `ipfw delete set N` command is used to delete
  rules, that were moved to another set.
  To fix the problem we will use the set number from parent rule.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

MFC r344870:
  Fix the problem with O_LIMIT states introduced in r344018.

  dyn_install_state() uses `rule` pointer when it creates state.
  For O_LIMIT states this pointer actually is not struct ip_fw,
  it is pointer to O_LIMIT_PARENT state, that keeps actual pointer
  to ip_fw parent rule. Thus we need to cache rule id and number
  before calling dyn_get_parent_state(), so we can use them later
  when the `rule` pointer is overrided.

  PR: 236292

5 years agoMFC r340792 (by ygy):
ae [Sun, 14 Apr 2019 11:52:00 +0000 (11:52 +0000)]
MFC r340792 (by ygy):
  Fix a minor typo in ipfw(8) manual page.

  PR: 230747
  Submitted by: f.toscan@hotmail.it

5 years agoMFC r340717 (by ygy):
ae [Sun, 14 Apr 2019 11:50:07 +0000 (11:50 +0000)]
MFC r340717 (by ygy):
  Fix incorrect DSCP value range from 0..64 to 0..63.

  PR: 232786
  Submitted by: Sergey Akhmatov <sergey@akhmatov.ru>

5 years agoMFC r342908:
ae [Sun, 14 Apr 2019 11:06:42 +0000 (11:06 +0000)]
MFC r342908:
  Reduce the size of struct ip_fw_args from 240 to 128 bytes on amd64.
  And refactor the code to avoid unneeded initialization to reduce overhead
  of per-packet processing.

  ipfw(4) can be invoked by pfil(9) framework for each packet several times.
  Each call uses on-stack variable of type struct ip_fw_args to keep the
  state of ipfw(4) processing. Currently this variable has 240 bytes size
  on amd64.  Each time ipfw(4) does bzero() on it, and then it initializes
  some fields.

  glebius@ has reported that they at Netflix discovered, that initialization
  of this variable produces significant overhead on packet processing.
  After patching I managed to increase performance of packet processing on
  simple routing with ipfw(4) firewalling to about 11% from 9.8Mpps up to
  11Mpps (Xeon E5-2660 v4@ + Mellanox 100G card).

  Introduced new field flags, it is used to keep track of what fields was
  initialized. Some fields were moved into the anonymous union, to reduce
  the size. They all are mutually exclusive. dummypar field was unused, and
  therefore it is removed.  The hopstore6 field type was changed from
  sockaddr_in6 to a bit smaller struct ip_fw_nh6. And now the size of struct
  ip_fw_args is 128 bytes.

  ipfw_chk() was modified to properly handle ip_fw_args.flags instead of
  rely on checking for NULL pointers.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D18690

MFC r342909:
  Fix the build with INVARIANTS.

MFC r343551:
  Fix the bug introduced in r342908, that causes problems with dynamic
  handling for protocols without ports numbers.

  Since port numbers were uninitialized for protocols like ICMP/ICMPv6,
  ipfw_chk() used some non-zero values to create dynamic states, and due
  this it failed to match replies with created states.

  Reported by: Oliver Hartmann, Boris Lytochkin
  Obtained from: Yandex LLC

5 years agoMFC r344755 (by fsu@)
pfg [Sat, 13 Apr 2019 20:49:16 +0000 (20:49 +0000)]
MFC r344755 (by fsu@)
Fix integer overflow possibility.

Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert
of Fraunhofer FKIE
Reported as:    FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by:    pfg
MFC after:      1 week

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

5 years agoMFC r345450:
ae [Sat, 13 Apr 2019 09:06:36 +0000 (09:06 +0000)]
MFC r345450:
  Add ability to automatically load ipfw_nat64, ipfw_nptv6 and ipfw_pmod

  modules by declaring corresponding variables in rc.conf. Also document
  them in rc.conf(5).

  Submitted by: Dries Michiels
  Differential Revision: https://reviews.freebsd.org/D19673

MFC r345985:
  Add firewall_[nat64|nptv6|pmod]_enable variables to /etc/defaults/rc.conf

5 years agoFix some grammar nits.
gjb [Sat, 13 Apr 2019 00:54:56 +0000 (00:54 +0000)]
Fix some grammar nits.

Submitted by: adamw
Sponsored by: The FreeBSD Foundation

5 years agoRelease notes documentation:
gjb [Fri, 12 Apr 2019 19:05:47 +0000 (19:05 +0000)]
Release notes documentation:
- r336040, jail(8) name support for cpuset(1), sockstat(1), ipfw(8),
           and ugidfw(8).
- r336328, newfs_msdos(8) '-T' (timestamp) option added.
- r337461, ipfw(8) new rule options added.
- r338364, dd(1) status=progress support.
- r338451, last(1) libxo(3) support.
- r339160, diff(1) '-B' and '--ignore-blank-lines' support.
- r341758, bhyve(8) support for NumLock, ScrollLock and keypad keys.
- r342706, ktrdump(8) '-l' (live) support.
- r343538, newfs(8) and tunefs(8) support for '_' in label names.
- r343251, gzip(1) '-l' xz(1) support.
- r344020, pfctl(8) reference to net.pf.request_maxcount if a table
           definition fails.
- r344490, fdisk(8) support for sectors larger than 2048 bytes.
- r344052, newfs(8) and tunefs(8) support for '-' in label names.
- r345561, sh(1) '-o pipefail'.
- r345878, patch(1) exit successfully if fed a 0-length patch.

Remove a stray entry leftover from 11.2-RELEASE.

Sponsored by: The FreeBSD Foundation

5 years agoRelease notes documentation:
gjb [Fri, 12 Apr 2019 19:05:46 +0000 (19:05 +0000)]
Release notes documentation:
- r340611, rc.initdiskless support for auxiliary RAM.
- r340966, rcorder(8) rc.resume support.
- r341792, jail.conf(5) definition moved in rc.d/jail script.
- r341794, 340.noid periodic(8) no longer decends to jail(8)s.
- r342103, PATH now set in system crontab(5).
- r343046, rc_service addition to rc.subr(8).
- r343469, devd.conf(5) update to prevent duplicate hostapd(8)
           and wpa_supplicant(8) startup.

Sponsored by: The FreeBSD Foundation

5 years agoRelease notes documentation:
gjb [Fri, 12 Apr 2019 19:05:44 +0000 (19:05 +0000)]
Release notes documentation:
- r334607, xz(1) 5.2.4.
- r337817, WPA 2.6.
- r337827, file(1) 5.34.
- r338414, ELF Tool Chain r3614.
- r338795, libarchive(3) 3.3.3.
- r339100, lld '-z interpose' support added.
- r343079, file(1) dumpdate reporting fix.
- r344213, clang (and related) 7.0.1.
- r344220, lualoader merged.
- r344604, OpenSSL 1.0.2r.
- r344884, ntpd 4.2.8p13.
- r345670, tzdata 2019a.

Sponsored by: The FreeBSD Foundation

5 years agoBump copyright year.
gjb [Fri, 12 Apr 2019 19:05:43 +0000 (19:05 +0000)]
Bump copyright year.

Sponsored by: The FreeBSD Foundation

5 years agoPrune release notes entries from 11.2-RELEASE.
gjb [Fri, 12 Apr 2019 19:05:42 +0000 (19:05 +0000)]
Prune release notes entries from 11.2-RELEASE.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r345703:
kib [Fri, 12 Apr 2019 15:15:27 +0000 (15:15 +0000)]
MFC r345703:
Fix initial exec TLS mode for dynamically loaded shared objects.

5 years agoMFC r345955:
kib [Fri, 12 Apr 2019 15:02:30 +0000 (15:02 +0000)]
MFC r345955:
vn_vmap_seekhole(): align running offset to the block boundary.

5 years agoMFC r345647:
delphij [Fri, 12 Apr 2019 02:27:03 +0000 (02:27 +0000)]
MFC r345647:

Distinguish between lseek errors and read errores.

5 years agoMFC r344936: MFV/ZoL: Disable LBA weighting on files and SSDs
mav [Thu, 11 Apr 2019 13:21:10 +0000 (13:21 +0000)]
MFC r344936: MFV/ZoL: Disable LBA weighting on files and SSDs

The LBA weighting makes sense on rotational media where the outer tracks
have twice the bandwidth of the inner tracks. However, it is detrimental
on nonrotational media such as solid state disks, where the only effect
is to ensure that metaslabs enter the best-fit allocation behavior
sooner, which is detrimental to performance. It also makes no sense on
files where the underlying filesystem can arrange things however it
wants.

Author: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3712
zfsonlinux/zfs@fb40095f5f0853946f8150481ca22602d1334dfe

To reduce code divergence this merge replaces equivalent but different
FreeBSD code detecting non-rotating medium vdevs.

5 years agoMFC r344934, r345014: Add separate aggregation limit for non-rotating media.
mav [Thu, 11 Apr 2019 13:19:46 +0000 (13:19 +0000)]
MFC r344934, r345014: Add separate aggregation limit for non-rotating media.

Before sequential scrub patches ZFS never aggregated I/Os above 128KB.
Sequential scrub bumped that to 1MB, which motivation I understand for
spinning disks, since it should reduce number of head seeks.  But for
SSDs it makes much less sense to me, especially on FreeBSD, where due
to MAXPHYS limitation device will likely still see bunch of 128KB I/Os
instead of one large.  Having more strict aggregation limit allows to
avoid allocation of large memory buffer and memcpy to/from it, that is
a serious problem when bandwidth reaches few GB/s.

Sponsored by:   iXsystems, Inc.

5 years agoMFC r344926:
mav [Thu, 11 Apr 2019 13:18:09 +0000 (13:18 +0000)]
MFC r344926:
MFV/ZoL: Fix zfs_vdev_aggregation_limit bounds checking

Update the bounds checking for zfs_vdev_aggregation_limit so that
it has a floor of zero and a maximum value of the supported block
size for the pool.

Additionally add an early return when zfs_vdev_aggregation_limit
equals zero to disable aggregation.  For very fast solid state or
memory devices it may be more expensive to perform the aggregation
than to issue the IO immediately.

Author: Brian Behlendorf <behlendorf1@llnl.gov>
zfsonlinux/zfs@a58df6f53687ac6d1dee21f60de41b2552a43201

MFV/ZoL: Cap maximum aggregate IO size

Commit 8542ef8 allowed optional IOs to be aggregated beyond
the specified aggregation limit.  Since the aggregation limit
was also used to enforce the maximum block size, setting
`zfs_vdev_aggregation_limit=16777216` could result in an
attempt to allocate an ABD larger than 16M.

Author: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6259
Closes #6270
zfsonlinux/zfs@2d678f779aba26a93314c8ee1142c3985fa25cb6

5 years agoMFC r345850: Fix typos in r345849.
mav [Thu, 11 Apr 2019 13:12:43 +0000 (13:12 +0000)]
MFC r345850: Fix typos in r345849.

5 years agoMFC r345849: List few more ATA commands.
mav [Thu, 11 Apr 2019 13:11:45 +0000 (13:11 +0000)]
MFC r345849: List few more ATA commands.

5 years agoMFC r345497:
mm [Wed, 10 Apr 2019 21:46:06 +0000 (21:46 +0000)]
MFC r345497:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1153: fixed 2 bugs in ZIP reader [1]
  PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
  Changes to file flags code, support more file flags on FreeBSD:
    UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
    UF_ARCHIVE is not supported by intention (yet)

PR: 236300 [1]

5 years agoMFC r345847:
kib [Wed, 10 Apr 2019 10:50:48 +0000 (10:50 +0000)]
MFC r345847:
msdosfs: zero tail of the last block on truncation for VREG vnodes as well.

5 years agoMFC r345512: Correct contradictory information on default syslog logging
grembo [Tue, 9 Apr 2019 12:28:12 +0000 (12:28 +0000)]
MFC r345512: Correct contradictory information on default syslog logging
priority.

5 years agoMFC r344161: stand: dev_net: correct net_open's interpretation of params
kevans [Mon, 8 Apr 2019 18:38:18 +0000 (18:38 +0000)]
MFC r344161: stand: dev_net: correct net_open's interpretation of params

net_open previously casted the first vararg to a char * and this was
half-OK: at first, it is passed to netif_open, which would cast it back to
the struct devdesc * that it really is and use it properly. It is then
strdup()d and used as the netdev_name, which is objectively wrong.

Correct it so that the first vararg is properly casted to a struct devdesc *
and the netdev_name gets set properly to make it more clear at a glance that
it's not doing something horribly wrong.

5 years agoMFC r345680: NOTES: Use non-default value for BOOT_TAG
kevans [Mon, 8 Apr 2019 18:36:47 +0000 (18:36 +0000)]
MFC r345680: NOTES: Use non-default value for BOOT_TAG

5 years agoMFC r343240: iwm(4): Fix possible null pointer indirection
kevans [Mon, 8 Apr 2019 17:55:04 +0000 (17:55 +0000)]
MFC r343240: iwm(4): Fix possible null pointer indirection

5 years agoAdd _PC_ACL_* to vop_stdpathconf
sjg [Mon, 8 Apr 2019 15:52:13 +0000 (15:52 +0000)]
Add _PC_ACL_* to vop_stdpathconf

This avoid EINVAL from tmpfs etc.

Merge of r345024

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D19512

5 years agoMFC r345763:
ae [Mon, 8 Apr 2019 11:54:45 +0000 (11:54 +0000)]
MFC r345763:
  Correct a port number assignment.

  PR: 236930

5 years agoMFC r345741:
jah [Sun, 7 Apr 2019 19:08:07 +0000 (19:08 +0000)]
MFC r345741:

freebsd32: fix padding of computed control message length for recvmsg()

Each control message region must be aligned on a 4-byte boundary on 32-bit
architectures. The 32-bit compat shim for recvmsg() gets the actual layout
right, but doesn't pad the payload length when computing msg_controllen for
the output message header. If a control message contains an unaligned
payload, such as the 1-byte TTL field in the example attached to PR 236737,
this can produce control message payload boundaries that extend beyond
the boundary reported by msg_controllen.

PR: 236737

5 years agoMFC r345754:
avos [Sun, 7 Apr 2019 13:26:45 +0000 (13:26 +0000)]
MFC r345754:
run(4): properly set F_DATAPAD radiotap flag if frame has padding between
frame header and data.

This will fix 'Mysterious OLPC stuff' for received frames and wrong
CCMP / TKIP / data decoding for transmitted frames in net/wireshark
dissector.

While here, drop unneeded comment - net80211 handles padding requirements
for Tx & Rx without driver adjustment.

Was tested with D-Link DWA-140 rev B3, STA mode.

5 years agoMFC r345751:
avos [Sun, 7 Apr 2019 13:11:40 +0000 (13:11 +0000)]
MFC r345751:
uath(4), urtw(4): restart driver if device does not respond after Tx request

5 years agoMFC r345753:
avos [Sun, 7 Apr 2019 13:04:25 +0000 (13:04 +0000)]
MFC r345753:
run(4): do not clear PROTECTED bit if frame was not decrypted by NIC.

Was tested with D-Link DWA-140 rev B3, STA / MONITOR modes.

5 years agoMFC r345729:
avos [Sun, 7 Apr 2019 12:57:38 +0000 (12:57 +0000)]
MFC r345729:
urtw(4): export TSF timestamp for received frames via radiotap

Was tested with Netgear WG111 v3 (RTL8187B), STA mode.

5 years agoBackport fixes from FreeBSD-12 to help the random(4) device thread
markm [Sat, 6 Apr 2019 09:00:06 +0000 (09:00 +0000)]
Backport fixes from FreeBSD-12 to help the random(4) device thread
not overwhelm the OS:

a) Use the correct symbolic constant when calculating 10'ths of a
second. This means that expensive reseeds happen at ony 1/10 Hz,
not some kHz.

b) Rate limit internal high-rate harveting efforts. This stops the
harvesting thread from total overkilling the high-grade entropy-
gathering work, while still being very conservatively safe.

PR: 230808
Reported by: danilo,eugen
Tested by: eugen
Approved by: so (blanket permission granted as I am the authour of this code)
Relnotes: Yes

5 years agoMFC r345806:
dim [Fri, 5 Apr 2019 16:09:23 +0000 (16:09 +0000)]
MFC r345806:

Pull in r357362 from upstream clang trunk (by David Chisnall):

  [objc-gnustep] Use .init_array not .ctors when requested.

  This doesn't make a difference most of the time but FreeBSD/ARM
  doesn't run anything in the .ctors array.

This should help with updating the libobjc2 port for armv7.

Requested by: theraven
Upstream PR: https://github.com/gnustep/libobjc2/issues/83

5 years agoMFC r345633:
hselasky [Fri, 5 Apr 2019 11:39:21 +0000 (11:39 +0000)]
MFC r345633:
Add new USB PCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r345499:
hselasky [Fri, 5 Apr 2019 11:34:13 +0000 (11:34 +0000)]
MFC r345499:
Change all kernel C-type macros into static inline functions.

The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.

This breaks code like:
isalpha(*ptr++)

Use static inline functions instead of macros to fix this.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies

5 years agoMFC r345109:
hselasky [Fri, 5 Apr 2019 11:32:57 +0000 (11:32 +0000)]
MFC r345109:
Implement sg_virt() function in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345108:
hselasky [Fri, 5 Apr 2019 11:31:52 +0000 (11:31 +0000)]
MFC r345108:
Define SG_CHAIN and SG_END in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345107:
hselasky [Fri, 5 Apr 2019 11:30:27 +0000 (11:30 +0000)]
MFC r345107:
Implement pr_info_ratelimited() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345106:
hselasky [Fri, 5 Apr 2019 11:29:05 +0000 (11:29 +0000)]
MFC r345106:
Define some RCU debug macros in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345105:
hselasky [Fri, 5 Apr 2019 11:27:35 +0000 (11:27 +0000)]
MFC r345105:
Honor SYSCTL function return values when creating sysfs nodes in the LinuxKPI.
Return proper error code upon failure.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345104:
hselasky [Fri, 5 Apr 2019 11:26:33 +0000 (11:26 +0000)]
MFC r345104:
Implement more malloc function macros in the LinuxKPI.
Fix arguments for currently unused kvmalloc().

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345101:
hselasky [Fri, 5 Apr 2019 11:24:05 +0000 (11:24 +0000)]
MFC r345101:
Implement si_meminfo() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345099:
hselasky [Fri, 5 Apr 2019 11:21:00 +0000 (11:21 +0000)]
MFC r345099:
Implement get_task_comm() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345098:
hselasky [Fri, 5 Apr 2019 11:19:23 +0000 (11:19 +0000)]
MFC r345098:
Implement current_exiting() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345097:
hselasky [Fri, 5 Apr 2019 11:17:27 +0000 (11:17 +0000)]
MFC r345097:
Implement list_for_each_entry_from_reverse() and
list_bulk_move_tail() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345096:
hselasky [Fri, 5 Apr 2019 11:16:06 +0000 (11:16 +0000)]
MFC r345096:
Implement dma_map_page_attrs() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345095 and r345110:
hselasky [Fri, 5 Apr 2019 11:14:01 +0000 (11:14 +0000)]
MFC r345095 and r345110:
Implement ida_free() and ida_alloc_max() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345094:
hselasky [Fri, 5 Apr 2019 11:11:35 +0000 (11:11 +0000)]
MFC r345094:
Implement DEFINE_STATIC_SRCU() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345093:
hselasky [Fri, 5 Apr 2019 11:10:27 +0000 (11:10 +0000)]
MFC r345093:
Implement BITS_PER_TYPE() function macro in the LinuxKPI.
Fix some style while at it.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345092:
hselasky [Fri, 5 Apr 2019 11:08:35 +0000 (11:08 +0000)]
MFC r345092:
Properly define the DMA attribute values in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345091:
hselasky [Fri, 5 Apr 2019 11:07:29 +0000 (11:07 +0000)]
MFC r345091:
Implement dev_err_once() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r345090:
hselasky [Fri, 5 Apr 2019 11:05:55 +0000 (11:05 +0000)]
MFC r345090:
Implement dma_set_mask_and_coherent() in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limelight Networks
Sponsored by: Mellanox Technologies

5 years agoMFC r336832:
hselasky [Fri, 5 Apr 2019 10:00:40 +0000 (10:00 +0000)]
MFC r336832:
Implement atomic_swap_{32,64,int,long,ptr}(9).

5 years agoMFC r344243, r345517-r345518: lualoader: More intelligent screen clearing
kevans [Thu, 4 Apr 2019 17:29:43 +0000 (17:29 +0000)]
MFC r344243, r345517-r345518: lualoader: More intelligent screen clearing

r344243:
lualoader: only clear the screen before first password prompt

This was previously an unconditional screen clear, regardless of whether or
not we would be prompting for any passwords. This is pointless, given that
the screen clear is only there to put our screen into a consistent state
before we draw the prompts and do cursor manipulation.

This is also the only screen clear besides that to draw the menu.  One can
now see early pre-loader and loader output with the menu disabled, which may
be useful for diagnostics.

r345517:
lualoader: Clear the screen before prompting for password

Assuming that the autoboot sequence was interrupted, we've done enough
cursor manipulation that the prompt for the password will be sufficiently
obscured a couple of lines up. Clear the screen and reset the cursor
position here, too.

r345518:
lualoader: Fix up some luacheck concerns

- Garbage collect an unused (removed because it was useless) constant
- Don't bother with vararg notation if args will not be used

5 years agoMFC r345628: dtc(1): Update to 1a79f5f26631
kevans [Thu, 4 Apr 2019 17:27:01 +0000 (17:27 +0000)]
MFC r345628: dtc(1): Update to 1a79f5f26631

Highlights:
- Bugfix for order in which /delete-node/ and /delete-property/ are
  processed [0]
- /omit-if-no-ref/ support has been added (used only by U-Boot at this
  point, in theory)
- GPL dtc compat version bumped to 1.4.7
- Various small fixes and compatibility improvements

5 years agoMFC r344677: patch(1): Exit successfully if we're fed a 0-length patch
kevans [Thu, 4 Apr 2019 17:21:30 +0000 (17:21 +0000)]
MFC r344677: patch(1): Exit successfully if we're fed a 0-length patch

This change is made in the name of GNU patch compatibility. If GNU patch is
fed a zero-length patch, it will exit successfully with no output. This is
used in at least one port to date (comms/wsjtx), and we break on this usage.

It seems unlikely that anyone relies on patch(1) calling their completely
empty patch garbage and failing, and GNU compatibility is a plus if it helps
with porting, so make the switch.

5 years agoMFC r345373: Add bus_release_resource() method to nexus on arm64
mw [Thu, 4 Apr 2019 12:02:41 +0000 (12:02 +0000)]
MFC r345373: Add bus_release_resource() method to nexus on arm64

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345371: Prevent double activation of admin interrupt in ENA
mw [Thu, 4 Apr 2019 09:06:56 +0000 (09:06 +0000)]
MFC r345371: Prevent double activation of admin interrupt in ENA

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345359, r345384:
markj [Thu, 4 Apr 2019 02:07:24 +0000 (02:07 +0000)]
MFC r345359, r345384:
Don't attempt to measure TSC skew when running as a VM guest.

PR: 218452

5 years agoMFC r345611:
rpokala [Wed, 3 Apr 2019 06:37:03 +0000 (06:37 +0000)]
MFC r345611:

Teach jedec_dimm(4) to be more forgiving of non-fatal errors.

It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.

5 years agoMFC r345457:
rpokala [Wed, 3 Apr 2019 03:30:57 +0000 (03:30 +0000)]
MFC r345457:

Add descriptions for sysctls in kern_mib.c and sysctl.3 which lack them.

r343532 noted the difference between "hw.realmem" and "hw.physmem", which I
was previously unaware of. I discovered that neither sysctl had a
description visible via `sysctl -d', so I found where they were defined and
added suitable descriptions. While in the file, I went ahead and added
descriptions for all the others which lacked them. I also updated sysctl.3
accordingly.

5 years agoMFC r345332: Tune chipset naming.
mav [Wed, 3 Apr 2019 01:30:59 +0000 (01:30 +0000)]
MFC r345332: Tune chipset naming.

5 years agoMFC r345333: Add some Cannon Lake chipset IDs.
mav [Wed, 3 Apr 2019 01:29:54 +0000 (01:29 +0000)]
MFC r345333: Add some Cannon Lake chipset IDs.

5 years agoMFC r344280: freebsd-update: Clarify help text
emaste [Tue, 2 Apr 2019 13:58:31 +0000 (13:58 +0000)]
MFC r344280: freebsd-update: Clarify help text

Improve help text to include example release numbers for reference
and clarify the -F option.

PR: 231185, 214619
Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by: delphij, rgrimes
Sponsored by: The FreeBSD Foundation

5 years agoMFC r345292:
ae [Tue, 2 Apr 2019 09:33:30 +0000 (09:33 +0000)]
MFC r345292:
  Convert allocation of bpf_if in bpfattach2 from M_NOWAIT to M_WAITOK
  and remove possible panic condition.

  It is already allowed to sleep in bpfattach[2], since BPF_LOCK was
  converted to SX lock in r332388. Also move KASSERT() to the top of
  function and make full initialization before bpf_if will be linked
  to BPF's list of interfaces.

5 years agoMFC r344676: Prevent detaching driver if the attach is not finished
mw [Tue, 2 Apr 2019 08:43:19 +0000 (08:43 +0000)]
MFC r344676: Prevent detaching driver if the attach is not finished

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r345252:
avos [Mon, 1 Apr 2019 07:54:27 +0000 (07:54 +0000)]
MFC r345252:
net80211: correct check for SMPS node flags updates

Update node flags when driver supports SMPS, not when it is disabled or
in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).

Was checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
from 'ifconfig wlan0' output.

5 years agoMFC r345493:
avos [Sun, 31 Mar 2019 11:31:01 +0000 (11:31 +0000)]
MFC r345493:
run(4): merge some common TSF-related code into run_disable_tsf()

No functional change intended.

5 years agoMFC r345620:
kib [Sat, 30 Mar 2019 10:12:00 +0000 (10:12 +0000)]
MFC r345620:
rtld: disable relro enforcement for irelative relocation processing.

5 years agoMFC r345177:
kp [Fri, 29 Mar 2019 14:34:50 +0000 (14:34 +0000)]
MFC r345177:

pf :Use counter(9) in pf tables.

The counters of pf tables are updated outside the rule lock. That means state
updates might overwrite each other. Furthermore allocation and
freeing of counters happens outside the lock as well.

Use counter(9) for the counters, and always allocate the counter table
element, so that the race condition cannot happen any more.

PR: 230619
Submitted by: Kajetan Staszkiewicz <vegeta@tuxpowered.net>

5 years agoMFC r345560:
markj [Fri, 29 Mar 2019 13:38:47 +0000 (13:38 +0000)]
MFC r345560:
Add CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition.

5 years agoMFC r345178:
kp [Fri, 29 Mar 2019 11:59:54 +0000 (11:59 +0000)]
MFC r345178:

bridge: Fix panic if the STP root is removed

If the spanning tree root interface is removed from the bridge we panic
on the next 'ifconfig'.
While the STP code is notified whenever a bridge member interface is
removed from the bridge it does not clear the bs_root_port. This means
bs_root_port can still point at an bridge_iflist which has been free()d.
The next access to it will panic.

Explicitly check if the interface we're removing in bstp_destroy() is
the root, and if so re-assign the roles, which clears bs_root_port.

Reviewed by: philip

5 years agoMFC r345526:
philip [Fri, 29 Mar 2019 01:51:41 +0000 (01:51 +0000)]
MFC r345526:

SZ has been known as Eswatini since April 2018 (formerly Swaziland).

5 years agoMFC r345524: Import tzdata 2019a
philip [Fri, 29 Mar 2019 01:40:44 +0000 (01:40 +0000)]
MFC r345524: Import tzdata 2019a

5 years agoMFC r339683:
rpokala [Fri, 29 Mar 2019 01:32:24 +0000 (01:32 +0000)]
MFC r339683:
Remove redundant redeclaration of netmap_vp_reg().
This should unbreak sparc64 and powerpc LINT builds.

-- While this does fix that error, powerpc.LINT, powerpc.LINT64, and
-- sparc64.LINT are broken in stable/11 for other reasons. --rpokala

Sponsored by: Panasas

5 years agoMFC of 343536, 345077, and 345352
mckusick [Fri, 29 Mar 2019 01:16:38 +0000 (01:16 +0000)]
MFC of 343536, 345077, and 345352

Collectively fixing ffs_truncate3 and dangling dependencies panics
when using ACLs.

Sponsored by: Netflix

5 years agoMFC 318562: Exclude ccr(4) from arm LINT since it excludes cxgbe(4).
jhb [Fri, 29 Mar 2019 00:04:50 +0000 (00:04 +0000)]
MFC 318562: Exclude ccr(4) from arm LINT since it excludes cxgbe(4).

5 years agoMFC 330040,330041,330079,330884,330946,330947,331649,333068,333810,337722,
jhb [Thu, 28 Mar 2019 23:43:38 +0000 (23:43 +0000)]
MFC 330040,330041,330079,330884,330946,330947,331649,333068,333810,337722,
340466,340468,340469,340473: Add TOE-based TLS offload.

Note that this requires a modified OpenSSL library.

330040:
Fetch TLS key parameters from the firmware.

The parameters describe how much of the adapter's memory is reserved for
storing TLS keys.  The 'meminfo' sysctl now lists this region of adapter
memory as 'TLS keys' if present.

330041:
Move ccr_aes_getdeckey() from ccr(4) to the cxgbe(4) driver.

This routine will also be used by the TOE module to manage TLS keys.

330079:
Move #include for rijndael.h out of x86-specific region.

The #include was added inside of the conditional by accident and the lack
of it broke non-x86 builds.

330884:
Support for TLS offload of TOE connections on T6 adapters.

The TOE engine in Chelsio T6 adapters supports offloading of TLS
encryption and TCP segmentation for offloaded connections.  Sockets
using TLS are required to use a set of custom socket options to upload
RX and TX keys to the NIC and to enable RX processing.  Currently
these socket options are implemented as TCP options in the vendor
specific range.  A patched OpenSSL library will be made available in a
port / package for use with the TLS TOE support.

TOE sockets can either offload both transmit and reception of TLS
records or just transmit.  TLS offload (both RX and TX) is enabled by
setting the dev.t6nex.<x>.tls sysctl to 1 and requires TOE to be
enabled on the relevant interface.  Transmit offload can be used on
any "normal" or TLS TOE socket by using the custom socket option to
program a transmit key.  This permits most TOE sockets to
transparently offload TLS when applications use a patched SSL library
(e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL
library).  Receive offload can only be used with TOE sockets using the
TLS mode.  The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a
list of TCP port numbers.  Any connection with either a local or
remote port number in that list will be created as a TLS socket rather
than a plain TOE socket.  Note that although this sysctl accepts an
arbitrary list of port numbers, the sysctl(8) tool is only able to set
sysctl nodes to a single value.  A TLS socket will hang without
receiving data if used by an application that is not using a patched
SSL library.  Thus, the tls_rx_ports node should be used with care.
For a server mostly concerned with offloading TLS transmit, this node
is not needed as plain TOE sockets will fall back to software crypto
when using an unpatched SSL library.

New per-interface statistics nodes are added giving counts of TLS
packets and payload bytes (payload bytes do not include TLS headers or
authentication tags/MACs) offloaded via the TOE engine, e.g.:

dev.cc.0.stats.rx_tls_octets: 149
dev.cc.0.stats.rx_tls_records: 13
dev.cc.0.stats.tx_tls_octets: 26501823
dev.cc.0.stats.tx_tls_records: 1620

TLS transmit work requests are constructed by a new variant of
t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c.

TLS transmit work requests require a buffer containing IVs.  If the
IVs are too large to fit into the work request, a separate buffer is
allocated when constructing a work request.  This buffer is associated
with the transmit descriptor and freed when the descriptor is ACKed by
the adapter.

Received TLS frames use two new CPL messages.  The first message is a
CPL_TLS_DATA containing the decryped payload of a single TLS record.
The handler places the mbuf containing the received payload on an
mbufq in the TOE pcb.  The second message is a CPL_RX_TLS_CMP message
which includes a copy of the TLS header and indicates if there were
any errors.  The handler for this message places the TLS header into
the socket buffer followed by the saved mbuf with the payload data.
Both of these handlers are contained in tom/t4_tls.c.

A few routines were exposed from t4_cpl_io.c for use by t4_tls.c
including send_rx_credits(), a new send_rx_modulate(), and
t4_close_conn().

TLS keys for both transmit and receive are stored in onboard memory
in the NIC in the "TLS keys" memory region.

In some cases a TLS socket can hang with pending data available in the
NIC that is not delivered to the host.  As a workaround, TLS sockets
are more aggressive about sending CPL_RX_DATA_ACK messages anytime that
any data is read from a TLS socket.  In addition, a fallback timer will
periodically send CPL_RX_DATA_ACK messages to the NIC for connections
that are still in the handshake phase.  Once the connection has
finished the handshake and programmed RX keys via the socket option,
the timer is stopped.

A new function select_ulp_mode() is used to determine what sub-mode a
given TOE socket should use (plain TOE, DDP, or TLS).  The existing
set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and
handles initialization of TLS-specific state when necessary in
addition to DDP-specific state.

Since TLS sockets do not receive individual TCP segments but always
receive full TLS records, they can receive more data than is available
in the current window (e.g. if a 16k TLS record is received but the
socket buffer is itself 16k).  To cope with this, just drop the window
to 0 when this happens, but track the overage and "eat" the overage as
it is read from the socket buffer not opening the window (or adding
rx_credits) for the overage bytes.

330946:
Remove TLS-related inlines from t4_tom.h to fix iw_cxgbe(4) build.

- Remove the one use of is_tls_offload() and the function.  AIO special
  handling only needs to be disabled when a TOE socket is actively doing
  TLS offload on transmit.  The TOE socket's mode (which affects receive
  operation) doesn't matter, so remove the check for the socket's mode and
  only check if a TOE socket has TLS transmit keys configured to determine
  if an AIO write request should fall back to the normal socket handling
  instead of the TOE fast path.
- Move can_tls_offload() into t4_tls.c.  It is not used in critical paths,
  so inlining isn't that important.  Change return type to bool while here.

330947:
Fix the check for an empty send socket buffer on a TOE TLS socket.

Compare sbavail() with the cached sb_off of already-sent data instead of
always comparing with zero.  This will correctly close the connection and
send the FIN if the socket buffer contains some previously-sent data but
no unsent data.

331649:
Use the offload transmit queue to set flags on TLS connections.

Requests to modify the state of TLS connections need to be sent on the
same queue as TLS record transmit requests to ensure ordering.

However, in order to use the offload transmit queue in t4_set_tcb_field(),
the function needs to be updated to do proper flow control / credit
management when queueing a request to an offload queue.  This required
passing a pointer to the toepcb itself to this function, so while here
remove the 'tid' and 'iqid' parameters and obtain those values from the
toepcb in t4_set_tcb_field() itself.

333068:
Use the correct key address when renegotiating the transmit key.

Previously, get_keyid() was returning the address of the receive key
instead of the transmit key when renegotiating the transmit key.  This
could either hang the card (if a connection was only offloading TLS TX
and thus had a receive key address of -1) or cause the connection to
fail by overwriting the wrong key (if both RX and TX TLS were
offloaded).

333810:
Be more robust against garbage input on a TOE TLS TX socket.

If a socket is closed or shutdown and a partial record (or what
appears to be a partial record) is waiting in the socket buffer,
discard the partial record and close the connection rather than
waiting forever for the rest of the record.

337722:
Whitespace nit in t4_tom.h

340466:
Move the TLS key map into the adapter softc so non-TOE code can use it.

340468:
Change the quantum for TLS key addresses to 32 bytes.

The addresses passed when reading and writing keys are always shifted
right by 5 as the memory locations are addressed in 32-byte chunks, so
the quantum needs to be 32, not 8.

340469:
Remove bogus roundup2() of the key programming work request header.

The key context is always placed immediately after the work request
header.  The total work request length has to be rounded up by 16
however.

340473:
Restore the <sys/vmem.h> header to fix build of cxgbe(4) TOM.

vmem's are not just used for TLS memory in TOM and the #include actually
predates the TLS code so should not have been removed when the TLS vmem
moved in r340466.

Sponsored by: Chelsio Communications

5 years agoMFC r345376:
kib [Thu, 28 Mar 2019 13:44:18 +0000 (13:44 +0000)]
MFC r345376:
nullfs: fix unmounts when filesystem is active.

5 years agoMFC r344990:
avos [Thu, 28 Mar 2019 09:50:25 +0000 (09:50 +0000)]
MFC r344990:
Fix ieee80211_radiotap(9) usage in wireless drivers:

- Alignment issues:
 * Add missing __packed attributes + padding across all drivers; in
most places there was an assumption that padding will be always
minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -
padding was just missing.
 * Add __aligned(8) attribute for all Rx radiotap headers since they can
contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so
just drop the attribute here. Refresh ieee80211_radiotap(9) man page
accordingly.

- Since net80211 automatically updates channel frequency / flags in
ieee80211_radiotap_chan_change() drop duplicate setup for these fields
in drivers.

5 years agoMFC r306049:
avos [Thu, 28 Mar 2019 09:18:22 +0000 (09:18 +0000)]
MFC r306049:
net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.

This field may be used for received frames only.

5 years agoMFC r329788 (by jhb@):
np [Thu, 28 Mar 2019 06:10:41 +0000 (06:10 +0000)]
MFC r329788 (by jhb@):

Bring in additional constants and message fields for TLS-related messages.

Sponsored by: Chelsio Communications

5 years agoMFC r344306: sh: Send normal output from bind builtin to stdout
jilles [Wed, 27 Mar 2019 22:09:35 +0000 (22:09 +0000)]
MFC r344306: sh: Send normal output from bind builtin to stdout

PR: 233343

5 years agoMFC r344066:
ngie [Wed, 27 Mar 2019 19:59:36 +0000 (19:59 +0000)]
MFC r344066:

Add rc.resume(8) alias for rc(8) to fix the manpage cross references

This issue was noticed when running `make manlint` as part of MFCing r342597 to
^/stable/11:
```
$ make -C share/man/man8 rc.8lint
mandoc -Tascii -Tlint rc.8
mandoc: rc.8:548:6: STYLE: referenced manual not found: Xr rc.resume 8
$
```

This is a followup commit to r339818.

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

5 years agoMFC: r344982, r345022
wulf [Wed, 27 Mar 2019 19:17:42 +0000 (19:17 +0000)]
MFC: r344982, r345022

atrtc(4): install ACPI RTC/CMOS operation region handler

FreeBSD base system does not provide an ACPI handler for the PC/AT RTC/CMOS
device with PnP ID PNP0B00; on some HP laptops, the absence of this handler
causes suspend/resume and poweroff(8) to hang or fail [1], [2]. On these
laptops EC _REG method queries the RTC date/time registers via ACPI
before suspending/powering off. The handler should be registered before
acpi_ec driver is loaded.

This change adds handler to access CMOS RTC operation region described in
section 9.15 of ACPI-6.2 specification [3]. It is installed only for ACPI
version of atrtc(4) so it should not affect old ACPI-less i386 systems.

It is possible to disable the handler with loader tunable:
debug.acpi.disabled=atrtc

Informational debugging printf can be enabled by setting hw.acpi.verbose=1
in loader.conf

[1] https://wiki.freebsd.org/Laptops/HP_Envy_6Z-1100
[2] https://wiki.freebsd.org/Laptops/HP_Notebook_15-af104ur
[3] https://uefi.org/sites/default/files/resources/ACPI_6_2.pdf

PR: 207419, 213039
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com>
Reviewed by: ian
Discussed on: acpi@, 2013-2015, several threads
Differential Revision: https://reviews.freebsd.org/D19314

5 years agoMFC r345324:
kib [Wed, 27 Mar 2019 11:03:07 +0000 (11:03 +0000)]
MFC r345324:
vm_fault_copy_entry: accept invalid source pages.

5 years agoMFC r344994:
avos [Wed, 27 Mar 2019 09:18:34 +0000 (09:18 +0000)]
MFC r344994:
urtw(4): add promiscuous mode callback

Also, pass control frames to the host while in MONITOR mode and / or
when promiscuous mode is enabled.

Was tested with Netgear WG111 v3 (RTL8187B), STA / MONITOR modes.

5 years agoMFC r345318:
avos [Wed, 27 Mar 2019 08:55:59 +0000 (08:55 +0000)]
MFC r345318:
lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
exist

Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

Was checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?

PR: 210770

5 years agoMFC r344502: sh: Add set -o pipefail
jilles [Tue, 26 Mar 2019 22:34:07 +0000 (22:34 +0000)]
MFC r344502: sh: Add set -o pipefail

The pipefail option allows checking the exit status of all commands in a
pipeline more easily, at a limited cost of complexity in sh itself. It works
similarly to the option in bash, ksh93 and mksh.

Like ksh93 and unlike bash and mksh, the state of the option is saved when a
pipeline is started. Therefore, even in the case of commands like
  A | B &
a later change of the option does not change the exit status, the same way
  (A | B) &
works.

Since SIGPIPE is not handled specially, more work in the script is required
for a proper exit status for pipelines containing commands such as head that
may terminate successfully without reading all input. This can be something
like

(
cmd1
r=$?
if [ "$r" -gt 128 ] && [ "$(kill -l "$r")" = PIPE ]; then
exit 0
else
exit "$r"
fi
) | head

PR: 224270
Relnotes: yes

5 years agoMFC r328818: sh: Refactor job status printing, preparing for -o pipefail and
jilles [Tue, 26 Mar 2019 21:30:26 +0000 (21:30 +0000)]
MFC r328818: sh: Refactor job status printing, preparing for -o pipefail and
similar

No functional change is intended.

PR: 224270

5 years agoMFC r327475: sh: Move various structs from jobs.h to jobs.c
jilles [Tue, 26 Mar 2019 20:47:30 +0000 (20:47 +0000)]
MFC r327475: sh: Move various structs from jobs.h to jobs.c

These implementation details of jobs.c need not be exposed.

PR: 224270

5 years agoMFC r342961:
hselasky [Tue, 26 Mar 2019 13:52:46 +0000 (13:52 +0000)]
MFC r342961:
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.

Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.

PR: 234794
Sponsored by: Mellanox Technologies