Commit Graph

222628 Commits

Author SHA1 Message Date
Pedro F. Giffuni
0558617b42 <stdio.h>: ftello() and fseeko() were in SUSv2, so extend visibility.
See:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/fseek.html
http://pubs.opengroup.org/onlinepubs/007908799/xsh/ftell.html

Hinted from:	DragonFlyBSD (git 58696e28)
2017-04-29 18:48:05 +00:00
Enji Cooper
9c3595112f usb(4): manpage cleanup
1. Wrap at <80 columns for readability when editing. Rewrap some lines
   prematurely wrapped to better fit in <80 columns and not waste
   vertical space.
2. Fix SEE ALSO sorting (sort by section first, then manpage name).
3. Tweak the compound device description slightly by adding soft stops
   via commas.

MFC after:	1 week
Reported by:	igor [3], manlint [2]
Sponsored by Dell EMC Isilon
2017-04-29 16:44:36 +00:00
Mark Felder
f8824f7be7 Document in ifconfig(8) that gre(4) accepts tunnel commands
- Also ensure wording is consistent for gif and gre

Reviewed by:	wblock
Differential Revision:	https://reviews.freebsd.org/D5667
2017-04-29 15:35:30 +00:00
Michael Tuexen
4f43a14a85 Don't set the DF-bit on timer based retransmissions.
MFC after:	1 week
2017-04-29 09:57:27 +00:00
Yoshihiro Takahashi
9b046370ae Add TUNABLE_INT to radeonkms driver parameters.
They are required by PowerMac G5 DP.

PR:		217852
Submitted by:	Hiroo Ono
MFC after:	1 week
2017-04-29 09:47:15 +00:00
Alexander Motin
ebe4288151 Make if_bridge complain if it can't disable some capabilities.
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2017-04-29 08:52:07 +00:00
Alexander Motin
59150e9141 Propagate IFCAP_LRO from trunk to vlan interface.
False positive here cost nothing, while false negative may lead to some
confusions.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2017-04-29 08:28:59 +00:00
Hans Petter Selasky
90c4a1e4c0 Correct manual page link to usbdi(9).
MFC after:		1 week
2017-04-29 07:59:09 +00:00
Pedro F. Giffuni
336c5fb5cd Fix some cases where an index was used before its limits check.
Obtained from:	DragonFlyBSD (git 799ba435)
MFC after:	5 days
2017-04-29 06:41:51 +00:00
Marius Strobl
5b6bb1668e Fix a bug introduced as part of r287726; use the right device_t for
determining the softc of the bridge in psycho_route_interrupt(). [1]
While at it, update the corresponding comment that the code in
question is also necessary for U30s in addition to E450s (a fact
that has been known for ages).

PR:		218478
Submitted by:	Yoshihiko Iwama
2017-04-29 00:53:17 +00:00
Rick Macklem
845eb84c56 Modify the NFSv4.1/pNFS client to ask for a maximum length of layout.
The code specified the length of a layout as INT64_MAX instead of
UINT64_MAX. This could result in getting a layout for less than the
full file for extremely large files. Although having little practical
effect, this patch corrects this in the code.
Detected during recent testing of the pNFS server.

MFC after:	2 weeks
2017-04-29 00:34:53 +00:00
Mark Johnston
babf030fd6 Get rid of some ifdef soup in the fasttrap ioctl handler.
No functional change intended.

MFC after:	1 week
2017-04-28 22:25:22 +00:00
Conrad Meyer
bb4877783c editline.3: Add missing argument to H_SET description
The H_SET operation of the history() function takes an int argument which is
the position of the item to which the cursor should be moved to.

Submitted by:	Abhinav Upadhyay <abhinav@NetBSD.org>
2017-04-28 21:05:28 +00:00
Hans Petter Selasky
8b48354659 Improve sysadmin visibility of physical port error counters in the
mlx5en driver.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-04-28 19:38:57 +00:00
Conrad Meyer
1c5df7bd01 x86 MCA: Fix a deadlock in MCA exception processing
In exceptional circumstances, an MCA exception will trigger when the
freelist is exhausted. In such a case, no error will be logged on the list
and 'mca_count' will not be incremented.

Prior to this patch, all CPUs that received the exception would spin
forever.

With this change, the CPU that detects the error but finds the freelist
empty will proceed to panic the machine, ending the deadlock.

A follow-up to r260457.

Reported by:	Ryan Libby <rlibby at gmail.com>
Reviewed by:	jhb@
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D10536
2017-04-28 18:25:10 +00:00
Brooks Davis
ea703329bf Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
These command take an int. The tests work by accident on little-endian,
64-bit systems.

PR:		218919
Tested with:	qemu-cheri and CheriBSD built for mips64
Reviewed by:	asomers, ngie
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10518
2017-04-28 17:58:15 +00:00
Jung-uk Kim
a0f9777dc4 Simplify the code a bit. No functional change. 2017-04-28 16:42:52 +00:00
Jung-uk Kim
0e37dd1fee Fix end coordinate of the drawable area of border. Although the name tr_end
suggests it is the end coordinate, tr_end.tp_row is width and tr_end.tp_col
is height of the drawable area in reality.

PR:		202288
2017-04-28 16:39:09 +00:00
Jilles Tjoelker
d4993b6db2 sh: Simplify handling of newlines in command substitution.
Unless we need to split on newlines, just append them as normal and remove
them at the end.
2017-04-28 16:16:22 +00:00
Michael Tuexen
b6ecf43450 Set the DF bit for responses to out-of-the-blue packets.
MFC after:	1 week
2017-04-28 15:38:34 +00:00
Alexander Motin
d89baa5aac Allow some control over enabled capabilities for if_vlan.
It improves interoperability with if_bridge, which may need to disable
some capabilities not supported by other members.  IMHO there is still
open question about LRO capability, which may need to be disabled on
physical interface.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2017-04-28 11:00:58 +00:00
Maxim Konovalov
7c415819be o Clean the whole array of IPv4 addresses not just a local part.
PR:		218923
Submitted by:	Daniel McRobb
2017-04-28 09:17:16 +00:00
Gleb Smirnoff
6c87a2c0ee Document raw framebuffer device and XHCI device configurations. 2017-04-28 05:43:27 +00:00
Gleb Smirnoff
bc5d44ec53 - For security reasons by default listen on localhost address,
not on wildcard. [1]
- Move the default port assignment from pci_fbuf.c to rfb.c,
  to avoid polluting pci_fbuf.c with network things.

Suggested by:	grehan
2017-04-28 05:32:26 +00:00
Gleb Smirnoff
3909a600a5 When no "rfb" configuration specified bind to the default VNC
port instead of binding to a random one.
2017-04-28 05:13:27 +00:00
Gleb Smirnoff
60bfcbd605 Make comments match the code. No functional change. 2017-04-28 05:09:51 +00:00
Josh Paetzel
285d85ab04 MFV 316905
7740 fix for 6513 only works in hole punching case, not truncation

illumos/illumos-gate@7de35a3ed0
7de35a3ed0

https://www.illumos.org/issues/7740
  The problem is that dbuf_findbp will return ENOENT if the block it's
  trying to find is beyond the end of the file. If that happens, we assume
  there is no birth time, and so we lose that information when we write
  out new blkptrs. We should teach dbuf_findbp to look for things that are
  beyond the current end, but not beyond the absolute end of the file.
  To verify, create a large file, truncate it to a short length, and then
  write beyond the end. Check with zdb to make sure that there are no
  holes with birth time zero (will appear as gaps).

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Paul Dagnelie <pcd@delphix.com>
2017-04-28 02:11:29 +00:00
Josh Paetzel
358f157522 MFV 316900
7743 per-vdev-zaps have no initialize path on upgrade

illumos/illumos-gate@555da5111b
555da5111b

https://www.illumos.org/issues/7743
  When loading a pool that had been created before the existance of
  per-vdev zaps, on a system that knows about per-vdev zaps, the
  per-vdev zaps will not be allocated and initialized.
  This appears to be because the logic that would have done so, in
  spa_sync_config_object(), is not reached under normal operation. It is
  only reached if spa_config_dirty_list is non-empty.
  The fix is to add another `AVZ_ACTION_` enum that will allow this code
  to be reached when we detect that we're loading an old pool, even when
  there are no dirty configs.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>
2017-04-27 23:31:38 +00:00
Ruslan Bukin
bbbb0b5544 Use unconditional jr (jump register) so cerror relocation offset fits.
This fixes libc build on riscv64sf.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
2017-04-27 22:40:39 +00:00
Josh Paetzel
8ad5797208 MFV 316898
7613 ms_freetree[4] is only used in syncing context

illumos/illumos-gate@5f14577801
5f14577801

https://www.illumos.org/issues/7613
  metaslab_t:ms_freetree[TXG_SIZE] is only used in syncing context. We should
  replace it with two trees: the freeing tree (ranges that we are freeing this
  syncing txg) and the freed tree (ranges which have been freed this txg).

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>
2017-04-27 22:00:03 +00:00
Konstantin Belousov
acd9f51725 Add asserts to verify stability of struct proc and struct thread layouts.
Some notes:
- Only i386 and amd64 layouts are checked, other Tier-1 (or close to
  it) architectures would benefit from the same check.
- Unconditional enabling of the asserts depend on the stability of locks
  memory layout.  If locks are optimized to avoid bloat when some debugging
  or profiling features turned off, it makes sense to only assert layout
  for production configs.

Reviewed by:	badger, emaste, jhb, vangyzen
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D10526
2017-04-27 21:24:50 +00:00
Josh Paetzel
e3cb0e99f8 MFV 316897
7586 remove #ifdef __lint hack from dmu.h

illumos/illumos-gate@4ba5b96163
4ba5b96163

https://www.illumos.org/issues/7586
  The #ifdef __lint in dmu.h is ugly, and it would be nice not to duplicate it if
  we add other inline functions into header files in ZFS, especially since it is
  difficult to make any other solution work across all compilation targets. We
  should switch to disabling the lint flags that are failing instead.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>
2017-04-27 21:11:57 +00:00
Zbigniew Bodek
45c98dac39 Import Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/
Import from vendor-sys/ena-com/1.1.4.1
SVN rev.: 317516
Version: 1.1.4.1

Obtained from: Amazon.com, Inc.
2017-04-27 19:57:18 +00:00
Edward Tomasz Napierala
461ef81d0e Advertise kldxref(8) a little better.
MFC after:	2 weeks
2017-04-27 19:48:00 +00:00
Zbigniew Bodek
e1593b114f Introduce HAL for Amazon Elastic Network Adapter (ENA)
This commit adds HAL (Hardware Abstraction Layer) code
for Amazon Elastic Network Adapter (ENA).

Version: 1.1.4.1

Obtained from: Amazon.com, Inc.
2017-04-27 19:40:53 +00:00
Alexander Motin
5e50c20ea1 Fix withered handling of r280687, broken by r286719.
MFC after:	1 week.
2017-04-27 19:03:08 +00:00
Jilles Tjoelker
24b55fb76d sh: Add some tests for command substitution final newline stripping. 2017-04-27 18:52:18 +00:00
Michael Tuexen
d7f27102b5 armv8 has support for optional CRC32C instructions. This patch checks if they are
available and if that is true make use of them.
Thank you very much to Andrew Turner for providing help and review the patch!
Reviewed by:		andrew
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D10499
2017-04-27 17:53:05 +00:00
Josh Paetzel
011275233c MFV 316896
7580 ztest failure in dbuf_read_impl

illumos/illumos-gate@1a01181fdc
1a01181fdc

https://www.illumos.org/issues/7580
  We need to prevent any reader whenever we're about the zero out all the
  blkptrs. To do this we need to grab the dn_struct_rwlock as writer in
  dbuf_write_children_ready and free_children just prior to calling bzero.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>
2017-04-27 16:38:28 +00:00
John Baldwin
1ffd07bde6 Various fixes for PCI _OSC handling so HotPlug works again.
- Rename the default implementation of 'pcib_request_feature' and add
  a pcib_request_feature() wrapper function (as is often done for
  new-bus APIs implemented via kobj) that accepts a single function.
  Previously the call to pcib_request_feature() ended up invoking the
  method on the great-great-grandparent of the bridge device instead
  of the grandparent.  For a bridge that was a direct child of pci0 on
  x86 this resulted in the method skipping over the Host-PCI bridge
  driver and being invoked against nexus0
- When invoking _OSC from a Host-PCI bridge driver, invoke
  device_get_softc() against the Host-PCI bridge device instead of the
  child bridge that is requesting HotPlug.  Using the wrong softc data
  resulted in garbage being passed for the ACPI handle causing the
  _OSC call to fail.
- While here, perform some other cleanups to _OSC handling in the ACPI
  Host-PCI bridge driver:
  - Don't invoke _OSC when requesting a control that has already been
    granted by the firmware.
  - Don't set the first word of the capability array before invoking
    _OSC.  This word is always set explicitly by acpi_EvaluateOSC()
    since it is UUID-independent.
  - Don't modify the set of granted controls unless _OSC doesn't exist
    (which is treated as always successful), or the _OSC method
    doesn't fail.
  - Don't require an _OSC status of 0 for success.  _OSC always
    returns the updated control mask even if it returns a non-zero
    status in the first word.
  - Whine if _OSC ever tries to revoke a previously-granted control.
    (It is not supposed to do that.)
- While here, add constants for the _OSC status word in acpivar.h
  (though currently unused).

Reported by:	adrian
Reviewed by:	imp
MFC after:	1 week
Tested on:	Lenovo x220
Differential Revision:	https://reviews.freebsd.org/D10520
2017-04-27 16:32:42 +00:00
John Baldwin
32455e8912 Revert r317446 and bring back cy(4).
Requested by:	bde
2017-04-27 16:14:32 +00:00
Brooks Davis
0607c830b3 More ATM and NATM removal
Submitted by:	ak
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D10511
2017-04-27 16:05:12 +00:00
Josh Paetzel
fa88c78914 MFV 316895
7606 dmu_objset_find_dp() takes a long time while importing pool

illumos/illumos-gate@7588687e6b
7588687e6b

https://www.illumos.org/issues/7606
  When importing a pool with a large number of filesystems within the same
  parent filesystem, we see that dmu_objset_find_dp() takes a long time.
  It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(),
  and spa_load_verify().
  There are several ways to improve performance here:
  1. We don't really need to do spa_check_logs() or
         spa_ld_claim_log_blocks() if the pool was closed cleanly.
  2. spa_load_verify() uses dmu_objset_find_dp() to check that no
         datasets have too long of names.
  3. dmu_objset_find_dp() is slow because it's doing
         zap_value_search() (which is O(N sibling datasets)) to determine
         the name of each dsl_dir when it's opened. In this case we
         actually know the name when we are opening it, so we can provide
         it and avoid the lookup.
  This change implements fix #3 from the above list; i.e. make
  dmu_objset_find_dp() provide the name of the dataset so that we don't
  have to search for it.

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>
2017-04-27 15:10:45 +00:00
Takanori Watanabe
4aa92fe2f3 Make cached Bluetooth LE host advertise information visible from userland.
Differential Revision:	https://reviews.freebsd.org/D10362
2017-04-27 15:03:24 +00:00
Hans Petter Selasky
791c9d7848 Don't free uninitialized sysctl contexts in the mlx4en driver. This
can cause NULL pointer panics during failed device attach.

Differential Revision:	https://reviews.freebsd.org/D8876
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-04-27 14:39:52 +00:00
Hans Petter Selasky
a8c348db51 Prefer to use real virtual address over direct map address in the
linux_page_address() function in the LinuxKPI. This solves an issue
where the return value from linux_page_address() is passed to
kmem_free().

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-04-27 14:29:21 +00:00
Gleb Smirnoff
007e172d64 We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap(). 2017-04-27 05:48:52 +00:00
Rick Macklem
ad81354ceb Fix handling of a NFSv4.1 callback reply from the session cache.
The nfsv4_seqsession() call returns NFSERR_REPLYFROMCACHE when it has a
reply in the session, due to a requestor retry. The code erroneously
assumed a return of 0 for this case. This patch fixes this and adds
a KASSERT(). This would be an extremely rare occurrence. It was found
during code inspection during the pNFS server development.

MFC after:	2 weeks
2017-04-26 21:54:53 +00:00
Michael Tuexen
d274bcc661 Fix an issue with MTU calculation if an ICMP messaeg is received
for an SCTP/UDP packet.

MFC after:	1 week
2017-04-26 20:21:05 +00:00
Edward Tomasz Napierala
4f4acb65e8 Add information about device nodes to man pages for USB serial drivers.
MFC after:	2 weeks
2017-04-26 19:51:10 +00:00