]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r310785:
ae [Sun, 8 Jan 2017 13:38:17 +0000 (13:38 +0000)]
MFC r310785:
  Convert ipv4_flags and ipv4_offset fields into host byte order.
  Also save only high bits in the ipv4_flags, because it is defined
  as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20.

7 years agoMFC r310783:
ae [Sun, 8 Jan 2017 13:35:10 +0000 (13:35 +0000)]
MFC r310783:
  When we are sending IP fragments, update ip pointers in IP_PROBE() for
  each fragment.

7 years agoMFC r309883:
ae [Sun, 8 Jan 2017 13:31:24 +0000 (13:31 +0000)]
MFC r309883:
  Add ip6_tryforward() - a run to completion forwarding implementation
  for IPv6.

  It gets performance benefits from reduced number of checks. It doesn't
  copy mbuf to be able send ICMPv6 error message, because it keeps mbuf
  unchanged until the moment, when the route decision has been made.
  It doesn't do IPsec checks, and when some IPsec security policies present,
  ip6_input() uses normal slow path.

Relnotes: yes
Sponsored by: Yandex LLC

7 years agoMFC r311014:
kib [Sun, 8 Jan 2017 09:18:08 +0000 (09:18 +0000)]
MFC r311014:
Style fixes for vm_map_insert().

7 years agoMFC r311426:
ume [Sun, 8 Jan 2017 08:53:34 +0000 (08:53 +0000)]
MFC r311426:
  When displaying netstat details with libxo in JSON
  or XML modes, the value conversion for tcp6 and udp6
  port numbers drops last digit.

PR: 215682

7 years agoMFC r311446: Fix bootverbose affecting code logic in r294558.
mav [Sun, 8 Jan 2017 08:52:16 +0000 (08:52 +0000)]
MFC r311446: Fix bootverbose affecting code logic in r294558.

Reported by: Jilles Tjoelker <jilles@stack.nl>

7 years agoMFC r311392:
delphij [Sun, 8 Jan 2017 07:25:22 +0000 (07:25 +0000)]
MFC r311392:

Use strlcpy and snprintf in netstat(1).

Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf
in various places.

Reported by: Anton Yuzhaninov <citrin citrin ru>

7 years agoMFC 306563: Decode arguments to truncate and ftruncate.
jhb [Sat, 7 Jan 2017 19:16:53 +0000 (19:16 +0000)]
MFC 306563: Decode arguments to truncate and ftruncate.

In particular, decode the off_t argument as a 64-bit argument to fix
decoding for 32-bit processes.

7 years agoMFC r310481:
jah [Sat, 7 Jan 2017 18:54:57 +0000 (18:54 +0000)]
MFC r310481:

Move the objects used to create temporary mappings for i386 pmap zero
and copy operations to the MD PCPU region.  Change sysmap
initialization to only allocate KVA pages for CPUs that are actually
present.  As a minor optimization, this also prevents false sharing
between adjacent sysmap objects since the pcpu struct is already
cacheline-aligned.

While here, move pc_qmap_addr initialization for the BSP into
pmap_bootstrap(), which allows use of pmap_quick* functions during
early boot.

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

7 years agoMFC r310496:
kib [Sat, 7 Jan 2017 11:48:44 +0000 (11:48 +0000)]
MFC r310496:
Fix argument type and microoptimize swp_pager_meta_free().

7 years agoMFC r310982:
kib [Sat, 7 Jan 2017 11:44:41 +0000 (11:44 +0000)]
MFC r310982:
Ansify vm/vm_pager.c.  Style.

7 years agoMFC r310925:
kib [Sat, 7 Jan 2017 11:32:54 +0000 (11:32 +0000)]
MFC r310925:
Remove unused declaration.

7 years agoMFC r311245:
ngie [Sat, 7 Jan 2017 09:44:57 +0000 (09:44 +0000)]
MFC r311245:

tty: don't leak s after opening it with openpty

CID: 978321

7 years agoMFC r311247:
ngie [Sat, 7 Jan 2017 09:44:05 +0000 (09:44 +0000)]
MFC r311247:

mkfifoat_fd: close dfd after use to avoid leaking it

CID: 978286

7 years agoMFC r311248:
ngie [Sat, 7 Jan 2017 09:42:42 +0000 (09:42 +0000)]
MFC r311248:

mknodat_fd: close dfd after use to avoid leaking it

CID: 978287

7 years agoMFC r311235:
ngie [Sat, 7 Jan 2017 09:41:21 +0000 (09:41 +0000)]
MFC r311235:

ttyname_err: close fd if it was opened successfully

CID: 978292

7 years agoMFC r311240:
ngie [Sat, 7 Jan 2017 09:39:12 +0000 (09:39 +0000)]
MFC r311240:

kqueue_desc_passing: initialize m.msg_flags to 0

This mutes an uninitialized scalar warning from Coverity

CID: 979620

7 years agoMFC r311273:
ngie [Sat, 7 Jan 2017 09:36:27 +0000 (09:36 +0000)]
MFC r311273:

setrlimit_basic: don't leak buf; free it on completion

CID: 978311

7 years agoMFC r311233,r311377:
ngie [Sat, 7 Jan 2017 09:30:53 +0000 (09:30 +0000)]
MFC r311233,r311377:

r311233:

Fix Coverity issues

- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error

CID: 978283, 979581

r311377:

Redo fix for CID 979581

The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

7 years agoMFC r311228:
ngie [Sat, 7 Jan 2017 09:27:46 +0000 (09:27 +0000)]
MFC r311228:

ftok_link: don't leak fd

CID: 978291

7 years agoMFC r311250:
ngie [Sat, 7 Jan 2017 09:25:53 +0000 (09:25 +0000)]
MFC r311250:

mincore_resid: free buf after use

CID: 978304

7 years agoMFC r311229:
ngie [Sat, 7 Jan 2017 09:24:37 +0000 (09:24 +0000)]
MFC r311229:

humanize_number_basic: don't leak buf

CID: 1251407

7 years agoMFC r311271:
ngie [Sat, 7 Jan 2017 09:21:21 +0000 (09:21 +0000)]
MFC r311271:

stat_symlink: don't leak fd; close the file descriptor when done

CID: 978314

7 years agoMFC r311269:
ngie [Sat, 7 Jan 2017 09:19:55 +0000 (09:19 +0000)]
MFC r311269:

swapcontext1: test for getcontext(3) and swapcontext(3) success properly

The beforementioned libcalls both succeed if the return codes aren't -1

CID: 976790, 976791

7 years agoMFC r311249:
ngie [Sat, 7 Jan 2017 09:18:11 +0000 (09:18 +0000)]
MFC r311249:

{strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use

CID: 978299, 978300

7 years agoMFC r311272:
ngie [Sat, 7 Jan 2017 09:16:18 +0000 (09:16 +0000)]
MFC r311272:

revoke_perm: don't leak fd at the end of the test; close it

This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD

CID: 978311

7 years agoMFC r311246:
ngie [Sat, 7 Jan 2017 09:14:12 +0000 (09:14 +0000)]
MFC r311246:

fexecve: don't leak fd on fexecve(2) failure; close before calling err

CID: 978285

7 years agoMFC r311270:
ngie [Sat, 7 Jan 2017 09:11:48 +0000 (09:11 +0000)]
MFC r311270:

pipe_restart: free f on function exit to quell complaint from Coverity

CID: 978307

7 years agoMFC r310501:
ngie [Sat, 7 Jan 2017 09:07:12 +0000 (09:07 +0000)]
MFC r310501:

Be more strict about IpAddress type in snmp_value_parse(..)

- Use inet_pton with AF_INET instead of doing longhand with sscanf.
- Use gethostbyname2 with AF_INET to ensure that the hostname isn't
  accidentally parsed with another address family, e.g. AF_INET6.

NB: IpAddress per RFC-2578 is IPv4 only. Work is in progress to add
    the InetAddress type and friends documented in RFC-4001 and
    elsewhere (which supports IPv4, IPv6, and more).

7 years agoMFC r311291:
ngie [Sat, 7 Jan 2017 08:58:07 +0000 (08:58 +0000)]
MFC r311291:

bridge_get_pfval: use nitems instead of spelling it out longhand

7 years agoMFC r310952:
ngie [Sat, 7 Jan 2017 08:54:02 +0000 (08:54 +0000)]
MFC r310952:

MIB-II: use strlcpy instead of strcpy when copying {descr,name}

This is of course to avoid buffer overruns

The remaining strcpy instance in the module needs to be audited for
correctness

CID: 10068271006828

7 years agoMFC r310957,r310958,r310960:
ngie [Sat, 7 Jan 2017 08:47:27 +0000 (08:47 +0000)]
MFC r310957,r310958,r310960:

r310957:

Use strlcpy when copying `com` to pdu->community to avoid potential
buffer overruns

CID: 10068231006824

r310958:

Initialize ret to SNMPD_INPUT_OK at the top of snmp_input_start(..) to
avoid returning an uninitialized value

There are some really complicated, snakey if-statements combined with
switch statements that could result in an invalid value being returned
as `ret`

CID: 1006551

r310960:

Similar to r310954, set .len to 0 on malloc failure and to `len` only
on success

7 years agoMFC r310497:
ngie [Sat, 7 Jan 2017 08:44:43 +0000 (08:44 +0000)]
MFC r310497:

Warning message cleanup

- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls

7 years agoMFC r310931,r310942,r310988:
ngie [Sat, 7 Jan 2017 08:42:14 +0000 (08:42 +0000)]
MFC r310931,r310942,r310988:

r310931:

Use strdup in snmp_parse_server(..) when possible instead of malloc+strcpy

This simplifies the code and mutes a Coverity warning about sc->cport being
improperly allocated

CID: 1018247

r310942:

Unbreak the build by passing the string to strdup, not its length

Pointyhat to: ngie

r310988:

snmp_discover_engine: fix up req/resp (PDU object) handling a bit

- Call snmp_pdu_free on req and resp when done with the objects
- Call snmp_pdu_free on req before calling snmp_pdu_create on it
  again

7 years agoMFC r310954,r310987,r311222:
ngie [Sat, 7 Jan 2017 08:28:51 +0000 (08:28 +0000)]
MFC r310954,r310987,r311222:

r310954:

Set value->v.octetstring.len to a correct value on malloc success/failure

The previous code always set value->v.octetstring.len to len, regardless
of the result from the malloc call. This misleads the caller on malloc
failure. Set .len to len on success and 0 on failure.

CID: 1007590

r310987:

snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not
on the stack

Some of the callers try to determine whether or not `object` is valid by
testing the value for NULL, which will never be true if it's a stack value,
so in order to be clear and correct down the call stack, use a heap
allocated object.

This also addresses a Coverity issue by initializing all of `object` via
calloc

CID: 1006392

r311222:

Fix logical inversion when checking result from calloc
in snmp_output_err_resp(..)

CID: 1368195

7 years agoMFC r311242:
ngie [Sat, 7 Jan 2017 08:24:49 +0000 (08:24 +0000)]
MFC r311242:

listen_low_port: check for errors from socket(2) before continuing

CID: 976778

7 years agoMFC r311239:
ngie [Sat, 7 Jan 2017 08:16:52 +0000 (08:16 +0000)]
MFC r311239:

umask_open: don't leak fd on success

CID: 978315

7 years agoMFC r310612:
gonzo [Sat, 7 Jan 2017 00:18:51 +0000 (00:18 +0000)]
MFC r310612:

[evdev] Fix build for older versions of clang

There was report of stable/11 build failure on older versions of
FreeBSD. The problem was a reference to static variable in inline
function. Although fairly recent versions of clang can cope with this
situation just fine there is no strict requirement to make functions
in question inline, they're not in any time-critical codepath. So to
keep HEAD and 11-STABLE buildable on older FreeBSDs some of the util
functions were converted from inline to normal.

Reported by: hselasky

7 years agoMFC r309999, r310012
gonzo [Fri, 6 Jan 2017 22:46:02 +0000 (22:46 +0000)]
MFC r309999, r310012

r309999:
[iMX6] Fix platform compatibility string for i.MX6 Dual

i.MX6 Dual boot was broken since r308533 because ofw_bus_node_is_compatible
is more strict than fdt_is_compatible and does not accept partial matches

r310012:
[iMX6] Add compatibility string for GPT timer on i.MX6 Dual

Up until r295436 GPT timer in i.MX6 Dual dts used the same compatiblity
string as i.MX6 Quad. After the sync up with Linux in r295436, GPT timer
stopped getting attached on the i.MX6 Dual

7 years agoMFC r311131:
dim [Fri, 6 Jan 2017 22:09:00 +0000 (22:09 +0000)]
MFC r311131:

Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped.  This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase.  The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
Differential Revision: https://reviews.freebsd.org/D9026

7 years agoRegenerate src.conf(5)
ngie [Fri, 6 Jan 2017 21:31:30 +0000 (21:31 +0000)]
Regenerate src.conf(5)

7 years agoMFC r311136:
ngie [Fri, 6 Jan 2017 21:28:49 +0000 (21:28 +0000)]
MFC r311136:

Add WITH_SSP to silence complaints from mkman about there not being a file

7 years agoMFC 306562: Handle 64-bit system call arguments (off_t, id_t).
jhb [Fri, 6 Jan 2017 20:32:34 +0000 (20:32 +0000)]
MFC 306562: Handle 64-bit system call arguments (off_t, id_t).

In particular, 64-bit system call arguments use up two register_t
arguments for 32-bit processes.  They must also be aligned on a 64-bit
boundary on 32-bit powerpc processes.  This fixes the decoding of
lseek(), procctl(), and wait6() arguments for 32-bit processes (both
native and via freebsd32).

Note that the ktrace system call return record only returns a single
register, so the return value of lseek is always truncated to the low
32-bits for 32-bit processes.

7 years agoMFC r306966: Correct sense of WITHOUT_MANDOCDB knob
emaste [Fri, 6 Jan 2017 18:08:42 +0000 (18:08 +0000)]
MFC r306966: Correct sense of WITHOUT_MANDOCDB knob

WITHOUT_MANDOCDB *disables* the use of mandoc's makewhatis.

PR: 215831
Sponsored by: The FreeBSD Foundation

7 years agoMFC r310977:
pfg [Fri, 6 Jan 2017 16:16:30 +0000 (16:16 +0000)]
MFC r310977:
Addition of clang nullability qualifiers.

Add two new qualifiers for use by the static checkers:

_Nonnull
The _Nonnull nullability qualifier indicates that null is not a meaningful
value for a value of the _Nonnull pointer type.

_Nullable
The _Nullable nullability qualifier indicates that a value of the
_Nullable pointer type can be null.

These were introduced in Clang 3.7. For more information, see:
http://clang.llvm.org/docs/AttributeReference.html#nonnull

We add these now without using them so that the GCC ports have time to
pick up the header change.

Hinted by: Android Bionic libc
Also seen in: Apple's Libc-1158.20.4

7 years agoMFC r310821:
kib [Fri, 6 Jan 2017 11:49:13 +0000 (11:49 +0000)]
MFC r310821:
Style.

7 years agoMFC r310834:
kib [Fri, 6 Jan 2017 11:46:24 +0000 (11:46 +0000)]
MFC r310834:
Assert that the pages found on the object queue by vm_page_next() and
vm_page_prev() have correct ownership.

7 years agoMFC r310151 and r311173.
np [Fri, 6 Jan 2017 08:42:04 +0000 (08:42 +0000)]
MFC r310151 and r311173.

r310151:
cxgbe(4): Changes to the default T6 firmware configuration file.

- Disable features that are not supported or not used on FreeBSD.
- Increase the RSS table slice per interface.
- Increase the share of the TCAM reserved for filtering.

r311173:
cxgbe(4):  Update T4, T5 and T6 firmwares to 1.16.26.0.

Sponsored by: Chelsio Communications

7 years agoMFC r310817
arybchik [Fri, 6 Jan 2017 07:24:02 +0000 (07:24 +0000)]
MFC r310817

sfxge(4): remove obsolete Wake-On-LAN support

Wake-on-lan is not supported in production on any of our adapters, as
they don't have the required AUX power connector. (It's possible that
AUX power is supplied to some of our ALOM or mezz adapters, but if so
then we've never implemented or tested WoL support.)

Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310815
arybchik [Fri, 6 Jan 2017 07:22:45 +0000 (07:22 +0000)]
MFC r310815

sfxge(4): add functions to efx_bootcfg supporting whole partition access

Expose expcfg partition layout discovery and validating buffer copy
routines.  Needed for whole-partition expcfg operations.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310814
arybchik [Fri, 6 Jan 2017 07:21:30 +0000 (07:21 +0000)]
MFC r310814

sfxge(4): make verified update result available from ef10_nvram_partn_unlock()

Manftest needs to know exactly what went wrong with the verified update
so that failing boards can be correctly diagnosed.

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310818
arybchik [Fri, 6 Jan 2017 07:20:20 +0000 (07:20 +0000)]
MFC r310818

sfxge(4): support per-command MCDI timeout

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310813
arybchik [Fri, 6 Jan 2017 07:19:03 +0000 (07:19 +0000)]
MFC r310813

sfxge(4): add per-command timeout reporting to the common code

In newer firmware that supports multithreaded MCDI processing,
longer running commands may be run ina background thread. Add
support for drivers to query the appropriate timeout for each
MCDI request.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310816
arybchik [Fri, 6 Jan 2017 07:16:05 +0000 (07:16 +0000)]
MFC r310816

sfxge(4): fix efx_filter_supported_filters API

The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.

To fix it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return the
  required length
- ensure that the list contents are valid and add comments
  describing it

It is safe to change this API as, unsuprisingly, it has no users.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310753
arybchik [Fri, 6 Jan 2017 07:12:27 +0000 (07:12 +0000)]
MFC r310753

sfxge(4): split EFX_FILTER_MATCH_LOC_MAC_IG back into separate flags

The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the
individual/group bit of the MAC address (with the two cases being
distingusished by the MAC address in the filter specification) was
introduced to mirror the Linux driver filtering code, but the
implementations are different enough anyway that it isn't of much value.

Having separate flags for unknown unicast and multicast simplifies
the code and allows the set of flags to match those used by MCDI.

It will also makes it easier to report whether these filters are
supported.

In the MCDI definitions, the unknown multicast and unicast flags have
the values 0x40000000 and 0x80000000 respectively, and so using the
same values for simplicity requires 32 bits in the filter specification
to store the flags. This means the structure is now a little bigger
than 64 bytes, but filters are not often used on critical paths so this
shouldn't have much impact - on Linux they are also bigger than they
used to be.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310750
arybchik [Fri, 6 Jan 2017 07:09:11 +0000 (07:09 +0000)]
MFC r310750

sfxge(4): add missing barrier in common code MCDI response handling

The semantics of the MCDI interfacve require reading the first
dword of the header before any other data in the buffer. Add
a barrier to the common code MCDI handler to enforce this.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310744
arybchik [Fri, 6 Jan 2017 07:08:09 +0000 (07:08 +0000)]
MFC r310744

sfxge(4): fix efx_ev_qpoll for non-Siena builds

Both Siena and EF10 use the siena_ev_qpoll() implementation, but this
function is not defined in builds without EFSYS_OPT_SIENA.

Remove siena_ev_qpoll and inline it into efx_ev_qpoll to allow it
to be used in non-Siena builds.

Also remove outdated FIXME comment, as EF10 event batching/merging has
been implemented long ago without needing to modify this code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310765
arybchik [Fri, 6 Jan 2017 07:05:02 +0000 (07:05 +0000)]
MFC r310765

sfxge(4): add support for firmware-verified NVRAM updates to the common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310873:
ngie [Fri, 6 Jan 2017 03:54:26 +0000 (03:54 +0000)]
MFC r310873:

Guard against use-after-free after calling mibif_free(..)

Set variables to NULL after calling free.

Also, remove unnecessary if (x != NULL) checks before calling free(x)

7 years agoMFC r311175:
ngie [Fri, 6 Jan 2017 03:53:01 +0000 (03:53 +0000)]
MFC r311175:

Swap parameters around with parse_syntax_strval(..) for consistency with
other parse_* APIs in bsnmp*

Noted by: bz

7 years agoMFC r310534: Improve third-party copy error reporting.
mav [Thu, 5 Jan 2017 11:56:17 +0000 (11:56 +0000)]
MFC r310534: Improve third-party copy error reporting.

For EXTENDED COPY:
 - improve parameters checking to report some errors before copy start;
 - forward sense data from copy target as descriptor in case of error;
 - report which CSCD reported error in sense key specific information.
For WRITE USING TOKEN:
 - pass through real sense data from copy target instead of reporting
our copy error, since for initiator its a "simple" write, not a copy.

7 years agoMFC r310524: Improve length handling when writing sense data.
mav [Thu, 5 Jan 2017 11:54:36 +0000 (11:54 +0000)]
MFC r310524: Improve length handling when writing sense data.

 - Allow maximal sense size limitation via Control Extension mode page.
 - When sense size limited, include descriptors atomically: whole or none.
 - Set new SDAT_OVFL bit if some descriptors don't fit the limit.
 - Report real written sense length instead of static maximal 252 bytes.

7 years agoMFC r310489: Implement printing forwarded sense data.
mav [Thu, 5 Jan 2017 11:53:07 +0000 (11:53 +0000)]
MFC r310489: Implement printing forwarded sense data.

7 years agoMFC r310478: Add place-holders for TAPE STREAM MIRRORING subcommands of XCOPY.
mav [Thu, 5 Jan 2017 11:51:38 +0000 (11:51 +0000)]
MFC r310478: Add place-holders for TAPE STREAM MIRRORING subcommands of XCOPY.

We do not support tapes, so this is only a comments.

7 years agoMFC r310390: Add support for REPD bit in RSTMF command.
mav [Thu, 5 Jan 2017 11:50:50 +0000 (11:50 +0000)]
MFC r310390: Add support for REPD bit in RSTMF command.

We have no real timeout values to report there, but its better then error.

7 years agor310389:
mav [Thu, 5 Jan 2017 11:48:24 +0000 (11:48 +0000)]
r310389:
Fix REPORT SUPPORTED OPERATION CODES for READ/WRITE BUFFER commands.

Specifications require MODE parameter of those commands to be treated
the same as SERVICE ACTION parameter of other commands.

7 years agoMFC r310373:
mav [Thu, 5 Jan 2017 11:46:46 +0000 (11:46 +0000)]
MFC r310373:
Add support for REPORTING OPTIONS == 3 in REPORT SUPPORTED OPERATION CODES.

7 years agoMFC r310366: Add support for SITUA bit in Logical Block Provisioning mode page.
mav [Thu, 5 Jan 2017 11:44:56 +0000 (11:44 +0000)]
MFC r310366: Add support for SITUA bit in Logical Block Provisioning mode page.

VMware tries to enable this bit to avoid multiple threshold notifications
in case of multiple initiators connected to the same LUN.  Unfortunately
their code sends MODE SELECT(6) request with parameter length hardcoded
for the page without any thresholds.  Since we have four threshold and our
page is bigger, this attempt fails, that is correct in my understanding.
So all we can do about this now is to report proper error code and hope
VMware fix their code one day.

7 years agoMFC r310360, r310361: Report UUID and MD5 LUN IDs.
mav [Thu, 5 Jan 2017 11:43:01 +0000 (11:43 +0000)]
MFC r310360, r310361: Report UUID and MD5 LUN IDs.

7 years agoMFC r310356: Add support for locally assigned RFC 4122 UUID LUN identifiers.
mav [Thu, 5 Jan 2017 11:41:02 +0000 (11:41 +0000)]
MFC r310356: Add support for locally assigned RFC 4122 UUID LUN identifiers.

7 years agoMFC r310339: Bump specifications support to SAM-6/SPC-5.
mav [Thu, 5 Jan 2017 11:39:11 +0000 (11:39 +0000)]
MFC r310339: Bump specifications support to SAM-6/SPC-5.

7 years agoMFC r310298: Improve error handling when I/O split between several BIOs.
mav [Thu, 5 Jan 2017 11:37:46 +0000 (11:37 +0000)]
MFC r310298: Improve error handling when I/O split between several BIOs.

If we get several error codes, handle one with lowest offset.

7 years agoMFC r310285:
mav [Thu, 5 Jan 2017 11:36:08 +0000 (11:36 +0000)]
MFC r310285:
When reporting "Logical block address out of range" error, report the LBA
in sense data INFORMATION field.

7 years agoMFC r310284:
mav [Thu, 5 Jan 2017 11:34:30 +0000 (11:34 +0000)]
MFC r310284:
When writing fixed format sense data, set VALID bit only if provided value
for INFORMATION field fit into available 4 bytes (has no non-zero bytes
except last 4), as explicitly required by SPC-5 specification.

7 years agoMFC r310275: Fix typo in function name.
mav [Thu, 5 Jan 2017 11:32:57 +0000 (11:32 +0000)]
MFC r310275: Fix typo in function name.

7 years agoMFC r310272: Add new bits into Extended Inquiry VPD page.
mav [Thu, 5 Jan 2017 11:31:17 +0000 (11:31 +0000)]
MFC r310272: Add new bits into Extended Inquiry VPD page.

7 years agoMFC r310266: Add support for NUAR bit in Control mode page.
mav [Thu, 5 Jan 2017 11:29:42 +0000 (11:29 +0000)]
MFC r310266: Add support for NUAR bit in Control mode page.

7 years agoMFC r310265: Add set of macros to simplify code access to mode pages fields.
mav [Thu, 5 Jan 2017 11:28:01 +0000 (11:28 +0000)]
MFC r310265: Add set of macros to simplify code access to mode pages fields.

7 years agoMFC r310259:
mav [Thu, 5 Jan 2017 11:27:01 +0000 (11:27 +0000)]
MFC r310259:
Following SPC-5, make REQUEST SENSE report "Logical unit not supported"
in returned parameter data for not accessible LUNs.

7 years agoMFC r310257: Improve support for informational exceptions.
mav [Thu, 5 Jan 2017 11:03:58 +0000 (11:03 +0000)]
MFC r310257: Improve support for informational exceptions.

While CTL still has no real events to report in this way (like SMART),
it is possible to trigger false event by manually setting TEST bit in
Informational Exceptions Control mode page, that can be useful for
initiator testing.  This code supports all flavours of IE reporting:
UNIT ATTENTION, RECOVERED ERROR and NO SENSE sense keys, REQUEST SENSE
command and Informational Exceptions log page.

7 years agoMFC r310230:
mav [Thu, 5 Jan 2017 11:02:27 +0000 (11:02 +0000)]
MFC r310230:
Don't treat informational exceptions (warnings and impending failures)
a.k.a. SCSI SMART events as errors.  Log them to console and continue.

7 years agoMFC r309297: Make SES status updates more aggressive.
mav [Thu, 5 Jan 2017 11:00:27 +0000 (11:00 +0000)]
MFC r309297: Make SES status updates more aggressive.

 - On control request update all status pages, since they may also be
affected if user enables/disables enclosure slots.
 - Periodically update element descriptors too, since there is some
hardware where they are changed dynamically.

7 years agoMFC 310652,310657,310658
sephe [Thu, 5 Jan 2017 08:57:49 +0000 (08:57 +0000)]
MFC 310652,310657,310658

310652
    hyperv/hn: Consolidate hn_{suspend,resume}

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8907

310657
    hyperv/hn: Function renaming; no functional changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8908

310658
    hyperv/hn: Factor out function to set rxfilter.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8928

7 years agoMFC 310651
sephe [Thu, 5 Jan 2017 08:42:58 +0000 (08:42 +0000)]
MFC 310651

    hyperv/vmbus: Nuke unnecessary critical sections.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8906

7 years agoMFC 310462,310465
sephe [Thu, 5 Jan 2017 08:41:29 +0000 (08:41 +0000)]
MFC 310462,310465

310462
    hyperv/ic: Fix version4 timesync message format.

    It is not compat w/ the old timesync message format, which the message
    type stays the same as the old timesync message.

    Sponsored by:   Microsoft

310465
    hyperv/ic: Allow applying the samples from hypervisor unconditionally.

    Sponsored by:   Microsoft

7 years agoMFC 310347
sephe [Thu, 5 Jan 2017 08:38:27 +0000 (08:38 +0000)]
MFC 310347

    hyperv/storvsc: The max channel in PDU actually means the max sub-chans.

    Use proper name for local variables. PDU fields' name was not changed yet.
    While I'm here, make # of usable channels tunable. This eases further
    testing.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8851

7 years agoMFC 310324
sephe [Thu, 5 Jan 2017 08:34:08 +0000 (08:34 +0000)]
MFC 310324

    hyperv/ic: Rename cleaned up files.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8850

7 years agoMFC 310318
sephe [Thu, 5 Jan 2017 08:27:55 +0000 (08:27 +0000)]
MFC 310318

    hyperv/ic: Cleanup driver glue.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8849

7 years agoMFC 310317
sephe [Thu, 5 Jan 2017 08:21:46 +0000 (08:21 +0000)]
MFC 310317

    hyperv/ic: Rname cleaned up file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8848

7 years agoMFC 310315
sephe [Thu, 5 Jan 2017 08:04:04 +0000 (08:04 +0000)]
MFC 310315

    hyperv/ic: Inclusion cleanup

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8847

7 years agoMFC 310312-310314
sephe [Thu, 5 Jan 2017 08:02:37 +0000 (08:02 +0000)]
MFC 310312-310314

310312
    hyperv/ic: Factor out function to send IC response

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8844

310313
    hyperv/ic: Cleanup common struct and functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8845

310314
    hyperv/ic: Rename cleaned up header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8846

7 years agoMFC 310048,310101,310239
sephe [Thu, 5 Jan 2017 07:42:08 +0000 (07:42 +0000)]
MFC 310048,310101,310239

310048
    hyperv: Implement "enlightened" time counter, which is rdtsc based.

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8763

310101
    hyperv: Allow userland to ro-mmap reference TSC page

    This paves way to implement VDSO for the enlightened time counter.

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8768

310239
    hyperv: Implement userspace gettimeofday(2) with Hyper-V reference TSC

    This 6 times gettimeofday performance, as measured by
    tools/tools/syscall_timing

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8789

7 years agoMFC 309874,309875
sephe [Thu, 5 Jan 2017 06:25:16 +0000 (06:25 +0000)]
MFC 309874,309875

309874
    hyperv/vmbus: Add channel polling support.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8738

309875
    hyperv/hn: Add polling support

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8739

7 years agoMFC 309726,309728
sephe [Thu, 5 Jan 2017 06:21:14 +0000 (06:21 +0000)]
MFC 309726,309728

309726

    hyperv/storvsc: Fix the SCSI disk attachment issue.

    On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks
    fails to attach.  Mainly because those versions of Hyper-V do not set
    SRB_STATUS properly and deliver junky INQUERY responses.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Reported by:    Hongxiong Xian <v-hoxian microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8724

309728
    hyperv/storvsc: Minor style changes; no functional changes.

    Reported by:    rpokala
    Sponsored by:   Microsoft

7 years agoMFC 309705
sephe [Thu, 5 Jan 2017 06:19:07 +0000 (06:19 +0000)]
MFC 309705

    hyperv/timesync: Support "sent TC" to improve accuracy.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8723

7 years agoMFC 309704
sephe [Thu, 5 Jan 2017 06:15:14 +0000 (06:15 +0000)]
MFC 309704

    hyperv/vmbus: Utilize vmbus_chan_run_task()

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8686

7 years agoMFC 309346,309348,309353
sephe [Thu, 5 Jan 2017 06:11:53 +0000 (06:11 +0000)]
MFC 309346,309348,309353

309346
    hyperv/hn: Add HN_DEBUG kernel option.

    If bufring is used for per-TX ring descs, don't update "available"
    counter, which is only used to help debugging.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8674

309348
    hyperv/hn: Don't hold txdesc, if no BPFs are attached.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8675

309353
    hyperv/hn: Add 'options RSS' support.

    Reviewed by:    adrian
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8676

7 years agoMFC 309320
sephe [Thu, 5 Jan 2017 05:59:15 +0000 (05:59 +0000)]
MFC 309320

    hyperv/storvsc: Don't use timedwait.

    The timeout is unnecessary.

    Reviewed by:    jhb
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8656

7 years agoMFC 309319
sephe [Thu, 5 Jan 2017 05:54:22 +0000 (05:54 +0000)]
MFC 309319

    hypver/vmbus: Remove extra assertion.

    It is asserted by vmbus_chan_gpadl_connect() now.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8660

7 years agoMFC 309310,309311,309316,309318
sephe [Thu, 5 Jan 2017 05:51:00 +0000 (05:51 +0000)]
MFC 309310,309311,309316,309318

309310
    hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.

    It was an experimental tunable, and is now deemed to be road blocker
    for further changes.  Time to retire it.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8654

309311
    hyperv/hn: Allow multiple TX taskqueues.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8655

309316
    hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8658

309318
    hyperv/hn: Allow TX to share event taskqueues.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8659