Commit Graph

218969 Commits

Author SHA1 Message Date
Alexander Motin
49fe3b378b Fix build with enabled debug after r310778.
MFC after:	2 weeks
2016-12-29 18:08:04 +00:00
Adrian Chadd
0013dd123f [ar71xx] add EARLY_PRINTF support for the AR933x (Hornet) UART.
Tested:

* Carambola 2
2016-12-29 17:31:38 +00:00
Adrian Chadd
ccfb1ab87c [ar71xx] put in an implicit read-after-write to flush things out.
Note: I may need to revisit this for mips74k.
2016-12-29 17:31:07 +00:00
Mateusz Guzik
4938d86764 cache: sprinkle __predict_false 2016-12-29 16:35:49 +00:00
Alexander Motin
9cbbfd2f5c Improve use of I/O's private area.
- Since I/Os are allocates from per-port pools, make allocations store
pointer to CTL softc there, and use it where needed instead of global.
 - Created bunch of helper macros to access LUN, port and CTL softc.

MFC after:	 2 weeks
2016-12-29 15:09:34 +00:00
Jared McNeill
6443acaa6c Add support for audio on I2S based DesignWare HDMI controllers.
Relnotes:	yes
2016-12-29 14:08:24 +00:00
Jared McNeill
7fd348080f The JZ4780 I2S can feed either the internal audio codec or the HDMI
transmitter, but not both at the same time. This patch:

 - Adds a dev.pcm.0.internal_codec sysctl node for selecting between
   internal and external codec
 - Changes playback sample rate from 96 kHz to 48 kHz for HDMI compatibility
 - Enables i2s clock on codec access

Reviewed by:		br
Differential Revision:	https://reviews.freebsd.org/D8960
2016-12-29 14:00:10 +00:00
Dimitry Andric
1357722508 Move llvm-objdump from CLANG_EXTRAS to installed by default
We currently install three tools from binutils 2.17.50: as, ld, and
objdump. Work is underway to migrate to a permissively-licensed
tool-chain, with one goal being the retirement of binutils 2.17.50.

LLVM's llvm-objdump is intended to be compatible with GNU objdump
although it is currently missing some options and may have formatting
differences. Enable it by default for testing and further investigation.
It may later be changed to install as /usr/bin/objdump, it becomes a
fully viable replacement.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D8879
2016-12-29 13:27:04 +00:00
Mateusz Guzik
b37707533e cache: move shrink lock init to nchinit
This gets rid of unnecesary sysinit usage.

While here also rename the lock to be consistent with the rest.
2016-12-29 12:01:54 +00:00
Andrew Rybchenko
1e2b4cef91 sfxge(4): cleanup: clarify/unify variable name used for put-list length
get_count is used for get-list.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-29 09:15:27 +00:00
Mateusz Guzik
0569bc9ca9 cache: depessimize hashing macros/inlines
All hash sizes are power-of-2, but the compiler does not know that for sure
and 'foo % size' forces doing a division.

Store the size - 1 and use 'foo & hash' instead which allows mere shift.
2016-12-29 08:41:25 +00:00
Mateusz Guzik
6dd9661b77 cache: drop the NULL check from VP2VNODELOCK
Now that negative entries are annotated with a dedicated flag, NULL vnodes
are no longer passed.
2016-12-29 08:34:50 +00:00
Andrew Rybchenko
e9c123a567 sfxge(4): add support for firmware-verified NVRAM updates to the common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8942
2016-12-29 08:28:42 +00:00
Andrew Rybchenko
4af6e4df7c sfxge(4): sync up tlv_layout.h (from firmwaresrc 82cd8a5715e9)
Submitted by:   Matthew Slattery <mslattery at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-29 08:25:00 +00:00
Enji Cooper
b8882958b3 Use uint32_t instead of u_int32_t for or_last_change and services in "struct systemg"
This is being done to match "struct systemg" in snmpmod(3)

No functional change

MFC after:	3 days
2016-12-29 08:16:43 +00:00
Andrew Rybchenko
cff68e1ab7 sfxge(4): regenerate MCDI headers from firmwaresrc .yml
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-29 08:10:51 +00:00
Andrew Rybchenko
54c1459c81 sfxge(4): fix typo in pseudo header accessor function names
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-29 07:20:53 +00:00
Andrew Rybchenko
ecd9d64f0d sfxge(4): delete hunt_phy.c
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-29 07:10:25 +00:00
Andrew Rybchenko
19734dbb1e sfxge(4): do not use enum type when values are bitmask
ICC complains that enumerated type mixed with another type.

Found by DPDK upstream build sanity check.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8954
2016-12-29 07:06:49 +00:00
Andrew Rybchenko
57b42dbbbc sfxge(4): do not use enum for filter flags
It is not 100% correct to assign non-enum values to enum type
variables.

Found by ICC build (DPDK PMD upstreaming).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8953
2016-12-29 07:05:47 +00:00
Andrew Rybchenko
fd4fbb71da sfxge(4): don't use Tx descriptor push with TSO option descriptors
It is not safe to push TSO option descriptors if pacer bypass is
enabled, so to make sure that doesn't happen never push TSO option
descriptors.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8952
2016-12-29 07:04:26 +00:00
Andrew Rybchenko
a85ebf7757 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>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8951
2016-12-29 07:02:32 +00:00
Andrew Rybchenko
dae5708683 sfxge(4): allow to have no NIC handle on Rx datapath in DPDK PMD
It is required to minimize RxQ context in the driver or avoid chaising
for the NIC handle in adapter (global per-interface) structure.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8950
2016-12-29 07:00:26 +00:00
Andrew Rybchenko
d5a0c7e00a 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>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8949
2016-12-29 06:58:51 +00:00
Andrew Rybchenko
b5a8496927 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>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8947
2016-12-29 06:57:36 +00:00
Andrew Rybchenko
f3cacdeb18 sfxge(4): cleanup: simplify disable scatter logic in ef10_rx_qcreate
Reviewed by:    gnn
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8945
2016-12-29 06:56:18 +00:00
Andrew Rybchenko
58a72cb202 sfxge(4): provide a way to find out which MAC stats are supported
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8944
2016-12-29 06:54:40 +00:00
Andrew Rybchenko
b422f9491d sfxge(4): make the common code determine the number of PFs
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8941
2016-12-29 06:52:42 +00:00
Andrew Rybchenko
9933eabb8e sfxge(4): make the common code retrieve the number of FATSOv2 contexts
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8940
2016-12-29 06:51:06 +00:00
Andrew Rybchenko
0ca76fa98a 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>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8939
2016-12-29 06:49:32 +00:00
Andrew Rybchenko
7b37475fef sfxge(4): fix common code for non-Siena builds
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8938
2016-12-29 06:47:53 +00:00
Andrew Rybchenko
897921fc45 sfxge(4): fix misuse of siena_build_filter in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8937
2016-12-29 06:46:20 +00:00
John Baldwin
a74031a53f Note that the Chelsio T6 also supports 25Gbps.
To avoid overflowing 80 columns, condense the cxgbe description a bit.

Reviewed by:	np
2016-12-29 01:11:57 +00:00
Enji Cooper
6c9b7542ef Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free
snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
could happen if a pdu was reused after calling the function, and
as both stack and heap allocation types are used in contrib/bsnmp
and usr.sbin/bsnmpd.

snmp_value_free: NULL out value->v.octetstring.octets after calling
free on it to prevent a double-free from occurring.

MFC after:      2 weeks
2016-12-29 00:20:03 +00:00
Enji Cooper
027e68613c Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs
they document

Also, alphabetically sort MAN

MFC after:	3 days
2016-12-28 23:55:18 +00:00
Marius Strobl
6d3c367d9c Fix a bug in r272840; given that the optlen parameter of setsockopt(2)
is a 32-bit socklen_t, do_get3() passes the kernel to access the wrong
32-bit half on big-endian LP64 machines when simply casting the 64-bit
size_t optlen to a socklen_t pointer.
While at it and given that the intention of do_get3() apparently is to
hide/wrap the fact that socket options are used for communication with
ipfw(4), change the optlen parameter of do_set3() to be of type size_t
and as such more appropriate than uintptr_t, too.

MFC after:	3 days
2016-12-28 23:34:28 +00:00
Ed Maste
b21e55bfb9 cdboot: add explict suffix to ambiguous or instruction
Clang disallows ambiguous instructions (GNU as has a default based on
chosen .code setting). We only need 'orb' here because KARGS_FLAGS_PXE
fits in a byte; this is the same as done in bxeboot.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8959
2016-12-28 23:02:01 +00:00
Mark Johnston
2ef476c9a2 Follow DW_AT_specification when looking up DW_AT_type attributes.
dwarf_attrval_*() will search the parent DIE referenced by a
DW_AT_abstract_origin attribute for the value of the DW_AT_type attribute.
Do the same thing for the DW_AT_specification attributes in variable
definitions emitted by GCC 6.2, and ensure that we return an error rather
than crashing if neither DW_AT_abstract_origin or DW_AT_specification is
found when looking for the value of the DW_AT_type attribute.

PR:		215350, 215395
Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8920
2016-12-28 21:54:33 +00:00
Alexander Kabaev
47abdb10a0 Do not use read-modify-write on MSC control register.
The register is write-only, so just write only bits we want.

Submitted by:	jmcneill
2016-12-28 19:40:59 +00:00
John Baldwin
249579387f Mention T6 and 100GbE in description of cxgbe.
MFC after:	3 days
2016-12-28 18:42:43 +00:00
Alan Cox
920da7e4d2 Relax the object type restrictions on vm_page_alloc_contig(). Specifically,
add support for object types that were previously prohibited because they
could contain PG_CACHED pages.

Roughly halve the number of radix trie operations performed by
vm_page_alloc_contig() using the same approach that is employed by
vm_page_alloc().  Also, eliminate the radix trie lookup performed with the
free page queues lock held.

Tidy up the handling of radix trie insert failures in vm_page_alloc() and
vm_page_alloc_contig().

Reviewed by:	kib, markj
Tested by:	pho
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8878
2016-12-28 18:32:13 +00:00
Andrew Rybchenko
7fb55c62f7 sfxge(4): cleanup: remove last use of deprecated function flags with privilege check
The function flags were changed to mirror the privileges, but
the privileges are preferred.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8936
2016-12-28 18:07:17 +00:00
Dmitry Marakasov
b9c36cc755 bzip2 does not exit after showing license as requested with --version
or --license as most apps would do, instead it waits for data to
compress on stdin. Because of that, if `bzip2 --version' is called,
bogus `bzip2: I won't write compressed data to a terminal' error
message will be displayed, and checking for bzip2 version in scripts
as in

    bzip2 --version 2>&1 | grep -o "Version [^,]*"

will hand as bzip2 would wait for data to compress on stdin. Fix
this by exiting right after showing version/license text.

I've tried to push this upstream for more than a year, but author
is unresponsive, so upstream may be considered dead.

Ubuntu applies similar fix, for the note.

PR:		199443
Approved by:	dim, bapt
MFC after:	2 weeks
Differential Revision:	D8924
2016-12-28 18:04:18 +00:00
Andrew Rybchenko
cc7a82f5da sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8935
2016-12-28 17:56:03 +00:00
Andrew Rybchenko
fa4a3ccff6 sfxge(4): add UEFI ROM support to the common code
Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8934
2016-12-28 17:52:24 +00:00
Andrew Rybchenko
ab72be51e2 sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford
On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end
padding setting is in the ADMIN group, and so fails for
unprivileged functions. In that case, assume the largest size
supported by Medford hardware (256bytes) to prevent overrun.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8933
2016-12-28 17:50:48 +00:00
Andrew Rybchenko
5081d55d40 sfxge(4): support Medford bootcfg partition layout in common code
For Siena and Huntington, the per-port bootcfg (aka expcfg) is
stored in a dedicated 4Kbyte partition for each port.

For Medford, the per-PF bootcfg is stored in a 2Kbyte sector
within a single shared partition. Update the common code to support
the new bootcfg layout.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8932
2016-12-28 17:49:33 +00:00
Andrew Rybchenko
a3fe009ab4 sfxge(4): add possibility to control event queue performance profile
It is ignored on SFN5xxx/6xxx (aka Siena).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8931
2016-12-28 17:45:52 +00:00
Marius Strobl
ed7aec1e45 - Use correct offsets into the keys set array. As the elements of this
zero-length array are dynamically sized at run-time based on the use
  of hints, compilers can't be expected to figure out these offsets on
  their own. [1]
- Fix incorrect comparison in cmp_nans(). [2]

PR:		204571 [1], 202301 [2]
Submitted by:	David Binderman [2]
MFC after:	3 days
2016-12-28 17:13:03 +00:00
Enji Cooper
53c167f98f Don't explicitly build tcp wrappers support into bsnmpd; make it conditional
on MK_TCP_WRAPPERS != "no"

This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't
work as advertised

MFC after:	1 week
2016-12-28 16:34:49 +00:00