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.
mav [Thu, 5 Jan 2017 11:35:10 +0000 (11:35 +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.
mav [Thu, 5 Jan 2017 11:23:55 +0000 (11:23 +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.
mav [Thu, 5 Jan 2017 11:03:04 +0000 (11:03 +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.
mav [Thu, 5 Jan 2017 11:01:17 +0000 (11:01 +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.
sephe [Wed, 4 Jan 2017 05:32:29 +0000 (05:32 +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
arybchik [Mon, 2 Jan 2017 09:34:45 +0000 (09:34 +0000)]
MFC r310749
sfxge(4): use correct port number in sensor decoding
The port mask used for per-port sensors in mcdi_sensor_map
assumes zero-based port numbering. The port mask used in
the code is based on the one-based MCDI port number.
Fix this to lookup the correct per-port sensors, and to
allow reporting of sensor events from higher port numbers.
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.