Commit graph

122772 commits

Author SHA1 Message Date
Ilya Bakulin e8e5c76419 Fix setting RCA for MMC cards
Unlike SD cards, that publish RCA in response to CMD3,
MMC cards expect the host to set RCA itself.

Since we don't support multiple MMC cards on the bus,
just assign a static RCA of 2 to the attached MMC card.

Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D13063
2018-06-19 20:02:03 +00:00
Li-Wen Hsu b4737a3dcb Really fix the style.
Approved by:	oshogbo
Sponsored by:	The FreeBSD Foundation
2018-06-19 18:43:02 +00:00
Li-Wen Hsu 1ef447f923 style(9) fix, I was also going to silence gcc.
Approved by:	emaste, oshogbo
Sponsored by:	The FreeBSD Foundation
2018-06-19 18:25:43 +00:00
Sean Bruno 843c0f2aaf Set prev to NULL so its garaunteed to have a value of some kind and
gcc doesn't explode.  Feel free to fix this correctly or whatever for
gcc builds.

This *should* quiesce tinderbox after r335347 for the gcc builds.
2018-06-19 18:09:15 +00:00
Andrew Turner 8214ff0f9e Move common GIC interrupt numbers to the common header. These are the same
across the GICv2 and GICv3 drivers so we only need a single copy of them.

Sponsored by:	Turing Robotic Industries
2018-06-19 16:14:23 +00:00
Sean Bruno d6c579b29f Remove "diff" line indicator. Next to see if this code works or not.
Submitted by:	mmacy
Sponsored by:	Limelight Networks
2018-06-19 15:55:21 +00:00
Ilya Bakulin 8b0e085f65 Don't try to turn power down MMC bus if it is already down
Regulator framework doens't like turning off already turned off
regulators, so we get panic on AllWinner boards.

Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D15890
2018-06-19 11:28:50 +00:00
Ilya Bakulin 4c4200c6d9 Correctly define rawscr so initializing it doesn't result in overwriting memory.
We need 8 bytes of storage for rawscr.

Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D15889
2018-06-19 11:25:40 +00:00
Ilya Bakulin 3f1cfdb122 Set MMC_DATA_MULTI flag when doing multi-block transfers
Lower layers (MMC / SDHCI controller drivers) may make certain decisions
based on the presence of this flag. The fact that sdhci.c doesn't
look at this flag is another problem that should be fixed separately.

Found when adding MMCCAM support to AllWinner MMC controller driver
where the presence of this flag actually matters.

Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D15888
2018-06-19 11:23:48 +00:00
Randall Stewart c6f76759ca Make sure that the t_peakrate_thr is not compiled in
by default until NF can upstream it.

Reviewed by:	and suggested lstewart
Sponsored by:	Netflix Inc.
2018-06-19 11:20:28 +00:00
Andrey V. Elsukov ca3cd72b17 Move BPFIF_* macro definitions into .c file, where struct bpf_if is
declared.

They are only used in this file and there is no need to export them via
bpfdesc.h.
2018-06-19 10:34:45 +00:00
Randall Stewart f923a734b3 Move the tp set back to where it was before
we started playing with the VNET sets. This
way we have verified the INP settings before
we go to the trouble of de-referencing it.

Reviewed by:	and suggested by lstewart
Sponsored by:	Netflix Inc.
2018-06-19 05:28:14 +00:00
Eric Joyner 56a382c650 ixl(4): Remove ixlvc.c from files.amd64
ixlvc.c is only used by the VF driver (ixlv), and that driver currently doesn't work.

It will be re-added once the VF driver is finished being ported to iflib.
2018-06-19 03:11:09 +00:00
Matt Macy 92689b3f02 remove ixl iwarp and ixlv from the build until they are in a working state 2018-06-19 02:48:53 +00:00
Matt Macy 9e58ff6ff9 convert inpcbinfo hash and info rwlocks to epoch + mutex
- Convert inpcbinfo info & hash locks to epoch for read and mutex for write
- Garbage collect code that handled INP_INFO_TRY_RLOCK failures as
  INP_INFO_RLOCK which can no longer fail

When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces
unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to
3%.

Overall packet throughput rate limited by CPU affinity and NIC driver design
choices.

On the receiver unhalted core cycles samples in in_pcblookup_hash went from
13% to to 1.6%

Tested by LLNW and pho@

Reviewed by: jtl
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15686
2018-06-19 01:54:00 +00:00
Navdeep Parhar b605d9cd51 cxgbe(4): Some mailbox commands require access to the Tx pipeline and
can time out if it's backed up due to a non-stop deluge of PAUSE frames
from a misbehaving peer.  Detect this situation and toggle MPS TxEn
to allow forward progress.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2018-06-19 00:50:27 +00:00
Andriy Voskoboinyk 02e3fed58c rtwn(4): decode some bit fields + merge duplicate code.
Add macros for R12A_RXDMA_PRO register (descriptions were seen in the
RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies.

No functional change intended.
2018-06-19 00:38:28 +00:00
Mariusz Zaborski 24881c060c libnv: Add nvlist_append_*_array() family of functions.
The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
allows to dynamically extend array stored in the nvlist.

Submitted by:	Mindaugas Rasiukevicius <rmind@netbsd.org>
2018-06-18 22:57:32 +00:00
Matt Macy 936a20bb1c remove epoch_test from default build 2018-06-18 22:27:29 +00:00
Mariusz Zaborski c11c5fb874 libnv: clean parent in nvlist_array when removing it.
When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

Submitted by:	Mindaugas Rasiukevicius <rmind@netbsd.org>
2018-06-18 22:21:28 +00:00
Mariusz Zaborski d82e41b6b8 libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
All information which are need for those operations is already stored in
the cookie.

We decided not to bump libnv version because this API is not used yet in the
base system.

Reviewed by:	pjd
2018-06-18 21:26:58 +00:00
Mariusz Zaborski 30665f3c42 libnv: add const to cookies arguments
Pointed out by:	pjd@
2018-06-18 21:23:40 +00:00
Mariusz Zaborski 0db44d5550 libnv: change name of cookie from cookiep to cookie.
The name was inconsistent with rest of the library.
No functional change intended.

Pointed out by:	pjd@
2018-06-18 21:18:20 +00:00
Eric Joyner f4cc2d1710 ixl(4): Update version number to 2.0.0-k
And update copyrights to current year.

MFC after:	1 month
Sponsored by:	Intel Corporation
2018-06-18 20:32:53 +00:00
Eric Joyner 1031d839aa ixl(4): Update to use iflib
Update the driver to use iflib in order to bring performance,
maintainability, and (hopefully) stability benefits to the driver.

The driver currently isn't completely ported; features that are missing:

- VF driver (ixlv)
- SR-IOV host support
- RDMA support

The plan is to have these re-added to the driver before the next FreeBSD release.

Reviewed by:	gallatin@
Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com
Tested by:	jeffrey.e.pieper@intel.com
MFC after:	1 month
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D15577
2018-06-18 20:12:54 +00:00
Ed Maste 1fbaf06eba Introduce arm64 linuxulator stubs
This provides stub implementations of arm64 Linux vdso and machdep,
ptrace, and futex sufficient for executing an arm64 Linux 'hello world'
binary.

Reviewed by:	andrew
Sponsored by:	Turing Robotic Industries
Differential Revision:	https://reviews.freebsd.org/D15832
2018-06-18 19:34:34 +00:00
Ed Maste 645f3d4345 linuxulator: add debugging for invalid capget/capset version
Sponsored by:	Turing Robotic Industries Inc.
2018-06-18 18:43:45 +00:00
Ed Maste c4db0baa34 Regen arm64 linuxulator sysent files after r335323 2018-06-18 18:10:11 +00:00
Ed Maste 2842db3325 arm64 linuxulator: add dup syscall entry
Missed in r333027

Sponsored by:	Turing Robotic Industries Inc.
2018-06-18 18:08:19 +00:00
Eric Joyner dfae03b5b5 iflib: Style fixes
MFC after:	1 week
2018-06-18 17:27:43 +00:00
Randall Stewart f994ead330 Move to using the inp->vnet pointer has suggested by lstewart.
This is far better since the hpts system is using the inp
as its basis anyway. Unfortunately his comments came late.

Sponsored by:	Netflix Inc.
2018-06-18 14:10:12 +00:00
Ed Maste bbc8294729 linsysfs: depend on linux_common module on arm64, as on amd64
Sponsored by:	Turing Robotic Industries
2018-06-18 13:26:45 +00:00
Rick Macklem 755e4b7936 Revert r335263, since it can cause crashes in unusual circumstances.
This needs to be fixed in a different way.
2018-06-17 23:08:54 +00:00
Bryan Venteicher 56f63b7364 Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers 2018-06-17 20:45:48 +00:00
Eitan Adler 9cd818a3f4 acpi: Add support for Thinkpads Mic led
PR:		229074
Submitted by:	"Ali Abdallah" <aliovx@gmail.com>
2018-06-17 20:44:20 +00:00
Marius Strobl e4defe55a8 Assorted fixes to MSI-X/MSI/INTx setup in iflib(9):
- In iflib_msix_init(), VMMs with broken MSI-X activation are trying
  to be worked around by manually enabling PCIM_MSIXCTRL_MSIX_ENABLE
  before calling pci_alloc_msix(9). Apart from constituting a layering
  violation, this has the problem of leaving PCIM_MSIXCTRL_MSIX_ENABLE
  enabled when falling back to MSI or INTx when e. g. MSI-X is black-
  listed and initially also when disabled via hw.pci.enable_msix. The
  later in turn was incorrectly worked around in r325166.
  Since r310806, pci(4) itself has code to deal with broken MSI-X
  handling of VMMs, so all of these workarounds in iflib(9) can go,
  fixing non-working interrupts when falling back to MSI/INTx. In
  any case, possibly further adjustments to broken MSI-X activation
  of VMMs like enabling r310806 by default in VM environments need to
  be placed into pci(4), not iflib(9). [1]
- Also remove the pci_enable_busmaster(9) call from iflib_msix_init(),
  which is already more properly invoked from iflib_device_attach().
- When falling back to MSI/INTx, release the MSI-X BAR resource again.
- When falling back to INTx, ensure scctx->isc_vectors is set to 1 and
  not to something higher from a device with more than one MSI message
  supported.
- Make the nearby ring_state(s) stuff (static) const.

Discussed with:	jhb at BSDCan 2018 [1]
Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D15729
2018-06-17 20:33:02 +00:00
Ed Maste 76db6c8773 gpart: add EFI alias for MBR partition scheme
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15870
2018-06-17 20:10:48 +00:00
Ed Maste a0a8412b2a Sort geom/part mbr/ebr/ldm alias table entries
Having the table entries in alpha order simplifies future additions.

Sponsored by:	The FreeBSD Foundation
2018-06-17 20:06:27 +00:00
Dimitry Andric 5494dcfa1c Fix build of ndis with base gcc on i386
Casting from rman_res_t to a pointer results in "cast to pointer from
integer of different size" warnings with base gcc on i386, so use an
intermediate cast to uintptr_t to suppress it.  In this case, the I/O
port range is effectively limited to the range of 0..65535.

Reviewed by:	imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D15746
2018-06-17 19:24:40 +00:00
Dimitry Andric a1e2190c98 Fix build of aibs with base gcc on i386
Add a few intermediate casts to intptr_t to suppress "cast to pointer
from integer of different size" warnings from gcc.  In this case, the
'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an
intermediate intmax_t, so no information is lost.

Reviewed by:	avg
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D15725
2018-06-17 19:14:05 +00:00
Rick Macklem 2bad64241c Make the pNFS NFSv4.1 client return a Flexible File layout upon error.
The Flexible File layout LayoutReturn operation has argument fields where
an I/O error encountered when attempting I/O on a DS can be reported back
to the MDS.
This patch adds code to the client to do this for the Flexible File layout
mirrored case.
This patch should only affect mounts using the "pnfs" option against servers
that support the Flexible File layout.

MFC after:	2 weeks
2018-06-17 16:30:06 +00:00
Rick Macklem 46d30d3d9c Fix NFSv4.1 client side handling of "soft,retrans=2" mounts.
Normally "soft,retrans=2" cannot be safely used on NFSv4 mounts, since
the RPC can fail and leave the open/lock state in an undefined state.
Doing I/O on a pNFS DS is an exception to this, since no open/lock state
is maintained on the DS server.
It is useful to do "soft,retrans=2" connections to a DS when it is mirrored,
so that the client can detect failure of the DS. As such, mounts from the MDS
to the DSs should use these mount options when mirroring is enabled.
However, the NFSv4.1 client still leaves the session in an undefined state
when this happens.
This patch fixes the problem by setting the session defunct, so it will
no longer be used.
The patch also sets "retries=2" on the connections done by the client to
a DS, which is the internal equivalent of "soft,retrans=2".
The client does not know if the server implements mirroring at connection
time, but always doing this should be safe, since it will fall back on doing
I/O via the MDS as a proxy when there is a failure doing an I/O RPC to the DS.

This patch should not affect non-pNFS client mounts.

MFC after:	2 weeks
2018-06-16 19:45:06 +00:00
Andrey V. Elsukov ae11b3829c Fix typo.
Reported by:	rpokala
2018-06-16 19:21:09 +00:00
Andrey V. Elsukov 20efcfc602 Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9).
Using of rwlock with multiqueue NICs for IP forwarding on high pps
produces high lock contention and inefficient. Rmlock fits better for
such workloads.

Reviewed by:	melifaro, olivier
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D15789
2018-06-16 08:26:23 +00:00
Michal Meloun bcc0decdc9 Fix handling of enable counter for shared GPIO line in fixed regulator.
For most regulators, the regulator_stop() method can be transformed to
regulator disable. But, in some cases, we needs to maintain shared data
across multiple regulators (e.g. single GPIO pin which works as enable
for multiple regulates). In this case, the implementation of regulator
should perform his own enable counting therefore it is necessary to
distinguish between the regulator enable/disable method (which
increments/decrements enable counter for shared resource) and regulator
stop method (which don't affect it).

So:
- add regnode_stop() method to regulator framework and default it to
  regnode_enable(..., false, ...)
- implement it in regulator_fixed with proper enable counting.

While I'm in, also fix handling of always_on property. If any of regulators
sharing same GPIO pin have it enabled, then none of them can disable regulator.

Tested by: kevans
MFC after: 3 weeks
2018-06-16 08:25:38 +00:00
Navdeep Parhar 0afe96c7bf cxgbe(4): Add a hw.cxgbe.starve_fl sysctl that can be used to starve the
freelists of netmap receive queues.  This is primarily to test various
congestion scenarios in the chip.

Sponsored by:	Chelsio Communications
2018-06-15 23:42:22 +00:00
Gleb Smirnoff 61f63f47b3 Since 'ticks' is an int, it may wrap around and cr_ticks at a certain
counter_rate will be greater than ticks, resulting in counter_ratecheck()
failure. To fix this take an absolute value of the difference between
ticks and cr_ticks.

Reported by:	jtl
Sponsored by:	Netflix
2018-06-15 21:36:16 +00:00
Navdeep Parhar 31f494cdf5 cxgbe(4): Track the number of received frames separately from the number
of descriptors processed.  Add the ability to gather a certain maximum
number of frames in the driver's rx before waking up netmap rx.  If
there aren't enough frames then netmap rx will be woken up as usual.

hw.cxgbe.nm_rx_nframes

Sponsored by:	Chelsio Communications
2018-06-15 21:23:03 +00:00
Conrad Meyer 8af7453d99 Bump __FreeBSD_version after r335227
The kerneldumpheader ABI is used by at least the netdumpd port.  Bump
__FreeBSD_version to reflect the change.

Reported by:	markj
Sponsored by:	Dell EMC Isilon
2018-06-15 20:57:02 +00:00
Ed Maste 42ac144c32 arm64 linuxulator: add linux_dummy.c based on amd64
A later change should deduplicate the multiple copies of this file.

Sponsored by:	Turing Robotic Industries
2018-06-15 19:42:52 +00:00