asomers [Thu, 12 Jan 2017 21:46:31 +0000 (21:46 +0000)]
MFC r310118
Fix ls_tests:o_flag with ZFS TMPDIR
Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
updated. The test must explicitly clear uarch to be portable across
filesystems. Also, it doesn't need to run as root.
dim [Wed, 11 Jan 2017 21:01:49 +0000 (21:01 +0000)]
MFC r311688:
Fix logic error in gvinum's gv_set_sd_state()
With clang 4.0.0, I'm getting the following warnings:
sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only
applied to the left hand side of this bitwise operator
[-Werror,-Wlogical-not-parentheses]
if (!flags & GV_SETSTATE_FORCE)
^ ~
The logical not operator should obiously be called after masking.
dim [Wed, 11 Jan 2017 20:45:27 +0000 (20:45 +0000)]
MFC r311649:
Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c:
contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only
applied to the left hand side of this bitwise operator
[-Werror,-Wlogical-not-parentheses]
if (!ifmr.ifm_status & IFM_AVALID) {
^ ~
Obviously, the masking needs to be done before the logical not
operation. Add parentheses to make it so.
mav [Tue, 10 Jan 2017 19:15:37 +0000 (19:15 +0000)]
MFC r309251: Process port interrupt even is PxIS register is zero.
ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside
seems sometimes forgeting to set bits in PxIS, causing command timeouts.
Removal of this check fixes the issue by the theoretical cost of slightly
higher CPU usage in some odd cases, but this is what Linux does too.
1. define the CODE * as const
2. restructure function to eliminate warning about exiting with no return.
severity_map() never returns when it can't find an appropriate sysylog
facility, and it longjmp()'s away into error code handling. Keep this
behavior by stashing the facility value found during our search and
checking for -1 if found.
MFC r257405 (by sbruno):
Quiesce warning, which could be a bug IMO, by correctly defining the host_info
structure name
MFC r257406 (by sbruno):
Queisce warning about undeclared function usage.
yp_get_default_domain is defined in workaround.c but is not declared
in any header file. Tie the declaration to the same #define conditional
used when the function is called, NETGROUP
MFC r311459:
Put proper prototypes in tcpd.h
Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:
/usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
extern int hosts_access(); /* access control */
^
To fix this, turn these declarations into real prototypes. While here,
garbage collect the incompatible rfc931() function from scaffold.c, as
it is never used.
Also remove unnecessary extern keywords from tcpd.h.
Noticed by: kib
MFC r311556:
After r311459, some ports can break, because a few of the newly added
prototypes in <tcpd.h> use FILE. Pull in a minimal forward declaration
of FILE from <stdio.h> to minimize impact. Sorry for the breakage.
hselasky [Mon, 9 Jan 2017 17:13:35 +0000 (17:13 +0000)]
MFC r310242:
Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
The panics happen due to using kernel facilities like callouts too early.
arybchik [Mon, 9 Jan 2017 08:12:22 +0000 (08:12 +0000)]
MFC r311640
sfxge(4): allow DMA descs to cross 4k boundary on EF10
Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.
delphij [Mon, 9 Jan 2017 05:58:48 +0000 (05:58 +0000)]
MFC r310611:
- pstat(8) does not accept any arguments other than getopt() args,
so don't bother to adjust argc/argv after getopt() loop.
- Make a string pointer constant.
jhb [Mon, 9 Jan 2017 00:09:19 +0000 (00:09 +0000)]
MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.
The kernel uses a few negative errno values for internal conditions
such as requesting a system call restart. Normally these errno values
are not exposed to userland. However, kdump needs access to these
values as some of then can be present in a ktrace system call return
record. Previously kdump was defining _KERNEL to gain access to ehse
values, but was then having to manually declare 'errno' (and doing it
incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL
and uses the system-provided declaration of errno.
kib [Sun, 8 Jan 2017 16:59:07 +0000 (16:59 +0000)]
MFC r267546 (by alc):
Tidy up the early parts of vm_map_insert().
MFC r267645 (by alc):
When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
corresponding flag(s) in the new map entry.
Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
extending the stack in the downward direction.
MFC r267850 (by alc):
Place the check that blocks map entry coalescing on stack entries in
vm_map_simplify_entry().
MFC r267917 (by alc):
Delay the call to crhold() in vm_map_insert() until we know that we won't
have to undo it by calling crfree().
Eliminate an unnecessary variable from vm_map_insert().
ngie [Sat, 7 Jan 2017 09:09:54 +0000 (09:09 +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).
ngie [Sat, 7 Jan 2017 08:46:16 +0000 (08:46 +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
ngie [Sat, 7 Jan 2017 08:28:41 +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.
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
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.
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.
arybchik [Fri, 6 Jan 2017 07:38:12 +0000 (07:38 +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.)
arybchik [Fri, 6 Jan 2017 07:32:19 +0000 (07:32 +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.
arybchik [Fri, 6 Jan 2017 07:29:54 +0000 (07:29 +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.
arybchik [Fri, 6 Jan 2017 07:28:43 +0000 (07:28 +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.
arybchik [Fri, 6 Jan 2017 07:27:40 +0000 (07:27 +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.
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.
mav [Thu, 5 Jan 2017 11:55:18 +0000 (11:55 +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.
mav [Thu, 5 Jan 2017 11:45:36 +0000 (11:45 +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.