8 hours agokernel: Don't include <sys/mutex.h> in some drivers that don't need it. master
Sascha Wildner [Sat, 24 Jun 2017 20:45:53 +0000 (22:45 +0200)]
kernel: Don't include <sys/mutex.h> in some drivers that don't need it.

2 days agotcp: Reindent a bit.
Sepherosa Ziehau [Fri, 23 Jun 2017 01:16:56 +0000 (09:16 +0800)]
tcp: Reindent a bit.

44 hours agoRevert "tcp: Fix comment, while I'm here."
Sepherosa Ziehau [Fri, 23 Jun 2017 08:40:05 +0000 (16:40 +0800)]
Revert "tcp: Fix comment, while I'm here."

This reverts commit 0358cc7b162d3691aa84a06d67472c3947a7157d.

The "feasible timer" is 2 ticks; so it will not expire too earlier:

      X    Y
     set timer

If tick is 1, timer will expire too earlier (1/5 tick later), 2 ticks
obviously are better choice and safe here.

2 days agotcp: Fix comment, while I'm here.
Sepherosa Ziehau [Thu, 22 Jun 2017 23:13:17 +0000 (07:13 +0800)]
tcp: Fix comment, while I'm here.

2 days agotcp: Fix comment, which I'm here.
Sepherosa Ziehau [Thu, 22 Jun 2017 22:55:28 +0000 (06:55 +0800)]
tcp: Fix comment, which I'm here.

2 days agotcp: Reduce minimum retransmit timeout to 190ms.
Sepherosa Ziehau [Thu, 22 Jun 2017 22:06:31 +0000 (06:06 +0800)]
tcp: Reduce minimum retransmit timeout to 190ms.

Increase retransmit timeout slop to ~160ms and reduce TCPTV_MIN
to ~30ms.  Bring in dillon's comment about TCPTV_MIN reduction
and retransmit timeout slop from FreeBSD.  And make sure that
tcp_rexmit_min is valid for a low kern.hz setting.

2 days agotcp: Don't depend on PR_FASTHZ.
Sepherosa Ziehau [Thu, 22 Jun 2017 20:25:58 +0000 (04:25 +0800)]
tcp: Don't depend on PR_FASTHZ.

TCP timers are callout based for more than one decade.

2 days agoem/emx: Disable flow control by default.
Sepherosa Ziehau [Thu, 22 Jun 2017 19:11:45 +0000 (03:11 +0800)]
em/emx: Disable flow control by default.

2 days agoigb: Disable flow control by default.
Sepherosa Ziehau [Thu, 22 Jun 2017 19:09:27 +0000 (03:09 +0800)]
igb: Disable flow control by default.

2 days agoix: Disable flow control by default.
Sepherosa Ziehau [Thu, 22 Jun 2017 19:07:29 +0000 (03:07 +0800)]
ix: Disable flow control by default.

2 days agomxge: Disable flow control by default.
Sepherosa Ziehau [Thu, 22 Jun 2017 18:55:49 +0000 (02:55 +0800)]
mxge: Disable flow control by default.

2 days agotcp: Cache align ACK queue header.
Sepherosa Ziehau [Thu, 22 Jun 2017 18:11:35 +0000 (02:11 +0800)]
tcp: Cache align ACK queue header.

2 days agolibc/gmon: Replace sbrk() with mmap()
Antonio Huete Jimenez [Thu, 22 Jun 2017 23:40:14 +0000 (01:40 +0200)]
libc/gmon: Replace sbrk() with mmap()

- Fixes profiling for C++ programs compiled with lang/gcc5.

Taken-from: FreeBSD (svn 288009)

2 days agoUpdate the pciconf(8) database.
Sascha Wildner [Thu, 22 Jun 2017 19:49:55 +0000 (21:49 +0200)]
Update the pciconf(8) database.

June 22, 2017 snapshot from http://pciids.sourceforge.net/

3 days agodomain: Explicitly setup inet/inet6/route/local domain.
Sepherosa Ziehau [Thu, 22 Jun 2017 01:48:08 +0000 (09:48 +0800)]
domain: Explicitly setup inet/inet6/route/local domain.

3 days agoifnet: Remove unused functions
Sepherosa Ziehau [Wed, 21 Jun 2017 23:21:30 +0000 (07:21 +0800)]
ifnet: Remove unused functions

5 days agoloopback: Free ifnet memory in clone_destroy method.
Sepherosa Ziehau [Tue, 20 Jun 2017 03:16:02 +0000 (11:16 +0800)]
loopback: Free ifnet memory in clone_destroy method.

5 days agoloopback: Function renaming
Sepherosa Ziehau [Tue, 20 Jun 2017 03:03:06 +0000 (11:03 +0800)]
loopback: Function renaming

5 days agoloopback: Use ifclone APIs to create loopback interfaces.
Sepherosa Ziehau [Tue, 20 Jun 2017 02:58:55 +0000 (10:58 +0800)]
loopback: Use ifclone APIs to create loopback interfaces.

This paves way for multiple FIB support.

2 weeks agobridge: Fix comment.
Sepherosa Ziehau [Sun, 4 Jun 2017 14:38:38 +0000 (22:38 +0800)]
bridge: Fix comment.

2 weeks agovlan: Fix comment.
Sepherosa Ziehau [Sun, 4 Jun 2017 11:21:48 +0000 (19:21 +0800)]
vlan: Fix comment.

2 weeks agoipfw: Fix comment.
Sepherosa Ziehau [Sun, 4 Jun 2017 11:01:06 +0000 (19:01 +0800)]
ipfw: Fix comment.

6 days agoLINT64: Remove old LINPROCFS option.
Sascha Wildner [Sun, 18 Jun 2017 07:53:36 +0000 (09:53 +0200)]
LINT64: Remove old LINPROCFS option.

7 days agokernel/acpi: Match _HID instead of relying on _CID for PCIe.
Sascha Wildner [Sat, 17 Jun 2017 17:34:07 +0000 (19:34 +0200)]
kernel/acpi: Match _HID instead of relying on _CID for PCIe.

In practice this has probably no effect because usually _HID == PNP0A08
and _CID == PNP0A03 (or vice versa, like seen in VMware).

8 days agoig4 - Interrupt handling was mpsafe already, just set INTR_MPSAFE
Imre Vadász [Fri, 16 Jun 2017 19:06:04 +0000 (21:06 +0200)]
ig4 - Interrupt handling was mpsafe already, just set INTR_MPSAFE

8 days agoig4 - Recognize Haswell, the Atom SoCs and Skylake/Kaby Lake accordingly.
Imre Vadász [Thu, 15 Jun 2017 22:21:11 +0000 (00:21 +0200)]
ig4 - Recognize Haswell, the Atom SoCs and Skylake/Kaby Lake accordingly.

* Some of the registers only exist in some of Intel's i2c controller
  versions, and some registers have different locations or content.

* This should make ig4 attach successfully on Skylake-U/Y and Kaby Lake-U/Y.

9 days agokernel/acpi_sysresource: Don't be quiet when booting verbosely.
Sascha Wildner [Thu, 15 Jun 2017 22:34:44 +0000 (00:34 +0200)]
kernel/acpi_sysresource: Don't be quiet when booting verbosely.

9 days agoig4 - Fix typo, pci_get_devid() -> pci_get_device.
Imre Vadász [Thu, 15 Jun 2017 19:48:04 +0000 (21:48 +0200)]
ig4 - Fix typo, pci_get_devid() -> pci_get_device.

* Make intel_i2c_ids static const as well, while there.

9 days agokernel: Add 'static' to some function definitions.
Sascha Wildner [Thu, 15 Jun 2017 17:22:44 +0000 (19:22 +0200)]
kernel: Add 'static' to some function definitions.

The declarations already have it, so no functional difference.

10 days agoig4 - Recognize PCI device IDs for Skylake-U/Y and Kaby Lake-U/Y CPUs.
Imre Vadász [Wed, 14 Jun 2017 19:41:41 +0000 (21:41 +0200)]
ig4 - Recognize PCI device IDs for Skylake-U/Y and Kaby Lake-U/Y CPUs.

2 weeks agoipfw3sync: release mbuf after sync
Bill Yuan [Sat, 10 Jun 2017 16:36:48 +0000 (00:36 +0800)]
ipfw3sync: release mbuf after sync

2 weeks agoipfw3: seperate socreate & sobind to support socreate_fast
Bill Yuan [Sat, 10 Jun 2017 16:35:33 +0000 (00:35 +0800)]
ipfw3: seperate socreate & sobind to support socreate_fast

2 weeks agoipfw3: match_token func
Bill Yuan [Sat, 10 Jun 2017 16:29:52 +0000 (00:29 +0800)]
ipfw3: match_token func

2 weeks agoipfw3_basic: keep-state is a pseudo filter
Bill Yuan [Sat, 10 Jun 2017 16:25:46 +0000 (00:25 +0800)]
ipfw3_basic: keep-state is a pseudo filter

2 weeks agoipfw3sync: dont call the sync func when centre not running
Bill Yuan [Thu, 8 Jun 2017 16:35:55 +0000 (00:35 +0800)]
ipfw3sync: dont call the sync func when centre not running

2 weeks agodrm - Fix hrtimer, don't reset timer->function to NULL in timeout handler.
Imre Vadász [Wed, 7 Jun 2017 21:21:01 +0000 (23:21 +0200)]
drm - Fix hrtimer, don't reset timer->function to NULL in timeout handler.

* The same hrtimer object is activated multiple times by i915(4), so we
  mustn't clear timer->function in the timeout handler.

* This seems to fix the powersaving issues in i915(4) from the update to
  Linux 4.7.10 code in 8621f4070e7cb342161183c980ae7fce2fd8124e.

2 weeks agokernel - Move PAT indices 4, 5 to 5, 6
Matthew Dillon [Wed, 7 Jun 2017 18:59:15 +0000 (11:59 -0700)]
kernel - Move PAT indices 4, 5 to 5, 6

* Move the PAT indices to solve a stale cache issue on MacBooks that
  prevents proper booting.

Submitted-by: profmakx, peeter
Taken-from: FreeBSD

2 weeks agokernel - Add quirk for additional MCP79 AHCI chipset
Matthew Dillon [Wed, 7 Jun 2017 18:21:10 +0000 (11:21 -0700)]
kernel - Add quirk for additional MCP79 AHCI chipset

* Add quirk to ignore FIS status to yet another MCP79 chipset.  These NVidia
  chipsets do not implement the AHCI spec properly and need a quirk to probe

Reported-by: peeter
2 weeks agoipfw3sync: comment out the printing
Bill Yuan [Thu, 8 Jun 2017 00:59:10 +0000 (08:59 +0800)]
ipfw3sync: comment out the printing

2 weeks agoipfw3_basic: move netisr_domsg out of callout func
Bill Yuan [Wed, 7 Jun 2017 13:02:55 +0000 (21:02 +0800)]
ipfw3_basic: move netisr_domsg out of callout func

2 weeks agosdhci - Add missing BROKEN_DMA quirk for Apollo Lake in sdhci_acpi(4).
Imre Vadász [Mon, 5 Jun 2017 19:48:36 +0000 (21:48 +0200)]
sdhci - Add missing BROKEN_DMA quirk for Apollo Lake in sdhci_acpi(4).

* Because of the APL18 erratum, DMA should be disabled on the Apollo Lake
  controllers for now, until we have 64bit ADMA2, which should work
  reliably on these models. I forgot to add this flag in sdhci_acpi(4) in
  commit 7ba10b88109826f7f4b59e318458760d74f2452e.

3 weeks agodhclient - Fix bug last commit
Matthew Dillon [Sat, 3 Jun 2017 22:05:18 +0000 (15:05 -0700)]
dhclient - Fix bug last commit

* Missing 'fi' in script prevented it from working properly.

3 weeks agodrm/radeon: Sync firmware with Linux
Michael Neumann [Fri, 2 Jun 2017 23:17:55 +0000 (01:17 +0200)]
drm/radeon: Sync firmware with Linux

3 weeks agodrm/radeon: Add missing radeon firmware
Michael Neumann [Fri, 2 Jun 2017 22:39:05 +0000 (00:39 +0200)]
drm/radeon: Add missing radeon firmware

3 weeks agodrm/radeon: Fix firmware paths and add missing modules
Michael Neumann [Fri, 2 Jun 2017 22:25:57 +0000 (00:25 +0200)]
drm/radeon: Fix firmware paths and add missing modules

3 weeks agodrm/linux: Add work_busy()
François Tigeot [Fri, 2 Jun 2017 19:13:31 +0000 (21:13 +0200)]
drm/linux: Add work_busy()

3 weeks agodhclient - Implement RFC 3442
Matthew Dillon [Fri, 2 Jun 2017 17:57:44 +0000 (10:57 -0700)]
dhclient - Implement RFC 3442

* Implement RFC 3442

Taken-from: FreeBSD

3 weeks agobce: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Tue, 30 May 2017 13:09:46 +0000 (21:09 +0800)]
bce: Use ringmap to do MSI-X cpu assignment and fill redirect table.

3 weeks agodrm/linux: make flush_work() more robust
François Tigeot [Thu, 1 Jun 2017 08:28:04 +0000 (10:28 +0200)]
drm/linux: make flush_work() more robust

3 weeks agoifnet: Fix regression if netisr_ncpus consisted of a large primary number
Sepherosa Ziehau [Thu, 1 Jun 2017 03:28:26 +0000 (11:28 +0800)]
ifnet: Fix regression if netisr_ncpus consisted of a large primary number

e.g. # of rings == 8, and netisr_ncpus == 22

Previous algorithm will only use 2 rings instead of 8 rings.

3 weeks agoifnet: Stringent if_ringmap assertion
Sepherosa Ziehau [Thu, 1 Jun 2017 03:22:34 +0000 (11:22 +0800)]
ifnet: Stringent if_ringmap assertion

3 weeks agoacpi - The UniqueId (from the _UID method) can be a string as well.
Imre Vadász [Tue, 30 May 2017 21:35:53 +0000 (23:35 +0200)]
acpi - The UniqueId (from the _UID method) can be a string as well.

* So converting the UniqueId.String value to a number, and back to a
  string for generating the pnpinfo string is a bad idea.

3 weeks agojme: Enable RSS only after Toeplitz key and redirect table are configured
Sepherosa Ziehau [Wed, 31 May 2017 13:34:26 +0000 (21:34 +0800)]
jme: Enable RSS only after Toeplitz key and redirect table are configured

3 weeks agojme: Use callout_init_mp
Sepherosa Ziehau [Wed, 31 May 2017 13:19:07 +0000 (21:19 +0800)]
jme: Use callout_init_mp

3 weeks agojme: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Sun, 28 May 2017 11:35:23 +0000 (19:35 +0800)]
jme: Use ringmap to do MSI-X cpu assignment and fill redirect table.

3 weeks agoifnet: Remove redundant check.
Sepherosa Ziehau [Sun, 28 May 2017 11:07:40 +0000 (19:07 +0800)]
ifnet: Remove redundant check.

3 weeks agoifnet: Add support to create ringmap requiring power-of-2 ring count.
Sepherosa Ziehau [Sun, 28 May 2017 11:04:08 +0000 (19:04 +0800)]
ifnet: Add support to create ringmap requiring power-of-2 ring count.

3 weeks agoPort initial UHS-1 support from FreeBSD (Only DDR52 for eMMC so far).
Imre Vadász [Sun, 21 May 2017 12:11:44 +0000 (14:11 +0200)]
Port initial UHS-1 support from FreeBSD (Only DDR52 for eMMC so far).

* Fix typo from FreeBSD commit:
  And these Driver Type capability bits are in the CAPABILITIES2 register.

* Hide 1.8V VDD capability when the slot is detected as a removable card
  slot, as the spec explicitly states that the 1.8V VDD is only meant to
  be for embedded slots.

* This gives ca. 75 MiB/s read speed with the eMMC in my HP X2 210
  detachable with the Intel Cherry Trail eMMC controller, in DDR52 mode.

Taken-From: FreeBSD (svn r315598)

3 weeks agoefivar.8: Fix typo.
Sascha Wildner [Tue, 30 May 2017 20:49:10 +0000 (22:49 +0200)]
efivar.8: Fix typo.

3 weeks agokernel/boot: Bring in a number of TianoCore EDK II headers.
Sascha Wildner [Tue, 30 May 2017 19:31:46 +0000 (21:31 +0200)]
kernel/boot: Bring in a number of TianoCore EDK II headers.

No need to maintain our own here, which were just extracts
of Intel's headers anyway.

Taken from the MdePkg of the UDK2017 branch of the
git://github.com/tianocore/edk2 repository.
All I modified was killing CRs using 'tr -d "\015"'.

FreeBSD has been doing some similar work recently, so I went
with their sys/contrib directory path choice.

This is a work in progress.

3 weeks agokernel - Change default kern.ipc.shm_allow_removed=1
Matthew Dillon [Tue, 30 May 2017 19:13:41 +0000 (12:13 -0700)]
kernel - Change default kern.ipc.shm_allow_removed=1

* Change kern.ipc.shm_allow_removed to default to enabled.  This feature
  allows a shared memory segment to be located by its shmid after being
  deleted, as long as some prior reference to the segment is still active.

* Primarily used by chrome these days, this trick is convenient in that
  it allows applications to attach shared memory segments in a manner that
  do ensures they are deleted if the application is killed or seg-faults

3 weeks agoAdd a small vga_switcheroo/apple_gmux manual page.
Sascha Wildner [Tue, 30 May 2017 17:05:36 +0000 (19:05 +0200)]
Add a small vga_switcheroo/apple_gmux manual page.

Submitted-by: Peeter Must <karu.pruun@gmail.com>
3 weeks agodrm/linux: Add list_empty_careful()
François Tigeot [Mon, 29 May 2017 12:15:48 +0000 (14:15 +0200)]
drm/linux: Add list_empty_careful()

3 weeks agoAdjust various manual pages for recent work etc.
Sascha Wildner [Mon, 29 May 2017 07:37:54 +0000 (09:37 +0200)]
Adjust various manual pages for recent work etc.

4 weeks agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 28 May 2017 01:46:17 +0000 (03:46 +0200)]
Update the pciconf(8) database.

May 25, 2017 snapshot from http://pciids.sourceforge.net/

4 weeks agoifnet: Split ringmap declaration into their own header.
Sepherosa Ziehau [Fri, 26 May 2017 11:01:52 +0000 (19:01 +0800)]
ifnet: Split ringmap declaration into their own header.

Avoid bus.h -> device_if.h+bus_if.h pollution.

Suggested-by: swildner
4 weeks agoemx: Use ringmap to do polling cpu assignment and fill redirect table.
Sepherosa Ziehau [Fri, 26 May 2017 14:46:20 +0000 (22:46 +0800)]
emx: Use ringmap to do polling cpu assignment and fill redirect table.

4 weeks agomxge: Share same redirect table for RSS and non-RSS mode.
Sepherosa Ziehau [Fri, 26 May 2017 06:15:22 +0000 (14:15 +0800)]
mxge: Share same redirect table for RSS and non-RSS mode.

4 weeks agokern: Bump __DragonFly_version.
Sepherosa Ziehau [Fri, 26 May 2017 05:21:33 +0000 (13:21 +0800)]
kern: Bump __DragonFly_version.

- Change CPU_SETSIZE to signed int.
- Allow process to change selft CPU affinity.

4 weeks agousched: Allow process to change self cpu affinity
Sepherosa Ziehau [Fri, 26 May 2017 05:21:06 +0000 (13:21 +0800)]
usched: Allow process to change self cpu affinity

4 weeks agosched: Change CPU_SETSIZE to signed int, same as FreeBSD/Linux.
Sepherosa Ziehau [Fri, 26 May 2017 05:20:23 +0000 (13:20 +0800)]
sched: Change CPU_SETSIZE to signed int, same as FreeBSD/Linux.

4 weeks agoemx: Remove unapplied comment
Sepherosa Ziehau [Thu, 25 May 2017 05:53:51 +0000 (13:53 +0800)]
emx: Remove unapplied comment

4 weeks agomxge: Number of entries of the indirect table must be power-of-2
Sepherosa Ziehau [Thu, 25 May 2017 05:48:26 +0000 (13:48 +0800)]
mxge: Number of entries of the indirect table must be power-of-2

4 weeks agomxge: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Thu, 25 May 2017 04:59:57 +0000 (12:59 +0800)]
mxge: Use ringmap to do MSI-X cpu assignment and fill redirect table.

4 weeks agoifnet: Add comment for ringmap
Sepherosa Ziehau [Thu, 25 May 2017 03:19:49 +0000 (11:19 +0800)]
ifnet: Add comment for ringmap

4 weeks agomxge.4: Firmware images can also be embedded into a system.
Jan Sucan [Wed, 24 May 2017 20:35:34 +0000 (20:35 +0000)]
mxge.4: Firmware images can also be embedded into a system.

4 weeks agoigb.4: Update year.
Sepherosa Ziehau [Wed, 24 May 2017 09:37:43 +0000 (17:37 +0800)]
igb.4: Update year.

4 weeks ago<netproto/smb/smb_conn.h>: Add missing include guard.
Sascha Wildner [Wed, 24 May 2017 21:03:38 +0000 (23:03 +0200)]
<netproto/smb/smb_conn.h>: Add missing include guard.

4 weeks agomxge: Unify firmware handling with the rest of the system.
Jan Sucan [Wed, 17 May 2017 11:27:12 +0000 (11:27 +0000)]
mxge: Unify firmware handling with the rest of the system.

* Convert firmware binary data from C arrays in a header files to
  uuencode .uu files.

* Move the .uu images to a sys/contrib/dev/mxge.

* Make it possible to embed the firmware images into a system.

4 weeks agoem: Enable MSI by default on devices has PCI advanced features capability.
Sepherosa Ziehau [Wed, 24 May 2017 06:30:37 +0000 (14:30 +0800)]
em: Enable MSI by default on devices has PCI advanced features capability.

Some versions of I219 does not PCI express capability, but only
PCI advanced features capability.

Dragonfly-bug: http://bugs.dragonflybsd.org/issues/3038

4 weeks agoigb: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Mon, 15 May 2017 09:15:18 +0000 (17:15 +0800)]
igb: Use ringmap to do MSI-X cpu assignment and fill redirect table.

4 weeks agoifnet: Rework if_ringmap_match
Sepherosa Ziehau [Thu, 18 May 2017 06:55:08 +0000 (14:55 +0800)]
ifnet: Rework if_ringmap_match

Original version is kinda broken, if ring count != ringmap grid.
This version fixes it and gives more even ring distribution.

4 weeks agoA step to correctly handling command timeouts in the MMC layer.
Imre Vadász [Sun, 21 May 2017 14:02:20 +0000 (16:02 +0200)]
A step to correctly handling command timeouts in the MMC layer.

    - Now that properly issuing CMD6 is crucial (so data isn't written to
      the wrong partition for example), make a step into the direction of
      correctly handling the timeout for these commands in the MMC layer.
      Also, do a SEND_STATUS when CMD6 is invoked with an R1B response as
      recommended by relevant specifications. However, quite some work is
      left to be done in this regard; all other R1B-type commands done by
      the MMC layer also should be followed by a SEND_STATUS (CMD13), the
      erase timeout calculations/handling as documented in specifications
      are entirely ignored so far, the MMC layer doesn't provide timeouts
      applicable up to the bridge drivers and at least sdhci(4) currently
      is hardcoding 1 s as timeout for all command types unconditionally.
      Let alone already available return codes often not being checked in
      the MMC layer ...

    - For devices following the eMMC specification v4.41 or later, year 0
      is 2013 rather than 1997; so correct this for assembling the device
      ID string properly.

* This omits all the parts specific to eMMC "partitions" from the FreeBSD

* Add the Intel sdhci controller ids to sdhci_pci.c to set the
  This also disables DMA on apollo lake sdhci, while there and whitelists
  ADMA2 on Bay Trail and Braswell sdhci controllers.

Taken-From: FreeBSD (svn r315430)

4 weeks agoMore style, comments, includes and unused params fixes for sdhci and mmc.
Imre Vadász [Sun, 21 May 2017 10:53:03 +0000 (12:53 +0200)]
More style, comments, includes and unused params fixes for sdhci and mmc.

Taken-From: FreeBSD (svn r314811)

5 weeks agoStyle fixes for sdhci(4) and mmc(4) in comments, includes, unused params.
Imre Vadász [Sat, 20 May 2017 22:06:59 +0000 (00:06 +0200)]
Style fixes for sdhci(4) and mmc(4) in comments, includes, unused params.

Taken-From: FreeBSD (svn r315466)

5 weeks agonvme - Fix interrupt pin support when MSI-X is unavailable.
Matthew Dillon [Fri, 19 May 2017 17:55:10 +0000 (10:55 -0700)]
nvme - Fix interrupt pin support when MSI-X is unavailable.

* Real hardware (so far) all supports MSI-X, but VMs emulating NVMe
  have been found not to.

* Fix numerous assertions that were getting hit due to the non-MSI-X
  case not installing the sc->cputovect[i] mapping.

  Install a fake cputovect[] mapping.  This mapping is primarily to allow
  multiple submission queues (per-cpu when possible).  Completion queues
  will be further limited to reduce loop-check overheads.

* For the non-MSI-X case, limit the number of completion queues to 4,
  since there is really no point having more there being only one interrupt
  vector.  We use 4 to allow the chipset side to run optimally even though
  it is not necessarily useful to have that many on the cpu side.  Though
  to be fair, in cases where the cpu-side driver polls for completions,
  having multiple completion queues CAN help even if there is only one
  interrupt as each completion queue is separately locked.

* Properly set the interrupt masking registers in the non-MSI-X case
  (probably not needed).  Note that these registers are explicitly not
  supposed to be accessed by the host when MSI-X is used.

* Fix a bug where the maximum number of queues possible was one too high.
  This limit is *never* reached anyway, but fix the code just in case.

* Fix a bug where we assumed that the number of queues returned by the
  NVME_FID_NUMQUEUES command would always be <= the number of queues
  requested.  In fact, this is not the case for at least one chipset
  or for some VM emulations.  Limit the returned values to no more than
  the requested values.

* Set the queue->nqe field last when creating a completion queue.  This
  prevents interrupts which poll multiple completion queues from attempting
  to poll a completion queue that has not finished getting set up.  This
  case always occurs when pin-based interrupts are used and sometimes
  occurs when MSI-X vectors are used, depending on the topology.

* NOTES ON DISABLING MSI-X.  Not all chipsets implement pin-based interrupts
  properly for NVMe.  The BPX NVMe card, for example, appears to just leave
  the pin interrupt in a stuck state (the chipset docs say the level
  interrupt is cleared once all doorbell heads are synchronized for the
  completion queues, but this does not happen).  So NVMe users should not
  explicitly disable MSI-X when it is nominally supported, except for

Reported-by: sinetek
5 weeks agokernel - Fix excessive call stack depth on stuck interrupt
Matthew Dillon [Fri, 19 May 2017 17:51:55 +0000 (10:51 -0700)]
kernel - Fix excessive call stack depth on stuck interrupt

* Fix an issue where a stuck level interrupt can result in an excessively
  deep call-stack and possible panic.

* Fixed by disallow thread preemption when curthread->td_nest_count
  is >= 2.  The critical section count test is not sufficient for the
  fast-interrupt unpend -> preemption case.

5 weeks agoImprove markup in some manual pages.
Sascha Wildner [Tue, 16 May 2017 21:42:07 +0000 (23:42 +0200)]
Improve markup in some manual pages.

Use .Fa uniformly for struct members (see mdoc(7)).

5 weeks agosdhci - Define some easy bits from Simplified Controller Spec v4.20.
Imre Vadász [Sun, 14 May 2017 16:19:41 +0000 (18:19 +0200)]
sdhci - Define some easy bits from Simplified Controller Spec v4.20.

* New HOST_CONTROL2 fields, and new controller version values.

5 weeks agosdhci - Check slot type cap, set SDHCI_SLOT_EMBEDDED for an embedded slot.
Imre Vadász [Tue, 17 Jan 2017 23:12:05 +0000 (00:12 +0100)]
sdhci - Check slot type cap, set SDHCI_SLOT_EMBEDDED for an embedded slot.

* Fail in sdhci(4) initialization for slot type shared, which is completely
  unsupported by this driver at the moment.

* We shouldn't need to do any card insertion handling for embedded slots.
  XXX We could also do a couple of consistency checks, if the configuration
      selected by the driver actually makes sense for the slot type.

5 weeks agosdhci - Add tunables for disabling SDMA and/or ADMA2, and for testing ADMA2.
Imre Vadász [Fri, 6 Jan 2017 21:53:26 +0000 (22:53 +0100)]
sdhci - Add tunables for disabling SDMA and/or ADMA2, and for testing ADMA2.

* Also document hw.sdhci.debug tunable while there.

* Limit ADMA2 support to the already tested and working Intel sdhci
  controllers for now. Currently we only explicitly match against the Intel
  models in sdhci_acpi(4).
  XXX sdhci_pci(4) should explicitly match against the Intel sdhci
      controllers as well to whitelist ADMA2 support, via the

* For testing on not-yet whitelisted models, add the hw.sdhci.adma2_test
  tunable to skip the whitelist check.

5 weeks agosdhci - Handle ADMA error interrupt, similar to ACMD12 error interrupt.
Imre Vadász [Sat, 7 Jan 2017 22:53:43 +0000 (23:53 +0100)]
sdhci - Handle ADMA error interrupt, similar to ACMD12 error interrupt.

* Print the DMA descriptor entry that is likely at fault.

5 weeks agosdhci - Implement ADMA2 transfer support. Keep SDMA support for now.
Imre Vadász [Sat, 7 Jan 2017 21:44:07 +0000 (22:44 +0100)]
sdhci - Implement ADMA2 transfer support. Keep SDMA support for now.

* Using ADMA2 transfers, only generates 1 or 2 interrupts for each
  bio transfer, whereas the existing SDMA code was only transferring
  in 4K blocks (with a completion interrupt for each 4K block).

* Since support for UHS high-speed modes is still missing this might
  only give a small performance increase in many cases.
  With very aggressive CPU C-state power-management and/or very slow
  CPUs, this can improve performance a lot however. e.g. on an Atom
  x5-Z8300 at 480MHz using deepest mwait c-state setting:
    - eMMC read speed: ca. 17 MiB/s --> 30 MiB/s
    - SD-card read speed: ca. 11MiB/s --> 18MiB/s

5 weeks agosdhci - Add data structure definitions for ADMA2 DMA descriptors.
Imre Vadász [Fri, 6 Jan 2017 21:50:12 +0000 (22:50 +0100)]
sdhci - Add data structure definitions for ADMA2 DMA descriptors.

6 weeks agobnx: Free ringmap in device_detach device method
Sepherosa Ziehau [Sun, 14 May 2017 05:08:20 +0000 (13:08 +0800)]
bnx: Free ringmap in device_detach device method

6 weeks agobnx: Use modulo to map TX rings.
Sepherosa Ziehau [Sun, 14 May 2017 01:45:38 +0000 (09:45 +0800)]
bnx: Use modulo to map TX rings.

6 weeks agobnx: Use ringmap to do MSI-X cpu assignment and fill redirect table.
Sepherosa Ziehau [Fri, 12 May 2017 07:06:52 +0000 (15:06 +0800)]
bnx: Use ringmap to do MSI-X cpu assignment and fill redirect table.

6 weeks agopf: Normalized, i.e. defragged, packets requiring rehash.
Sepherosa Ziehau [Fri, 12 May 2017 04:42:24 +0000 (12:42 +0800)]
pf: Normalized, i.e. defragged, packets requiring rehash.

DragonFly-bug: https://bugs.dragonflybsd.org/issues/3036
Tested-by: tautology
6 weeks agodevattr.3: Some minor adjustments.
Sascha Wildner [Thu, 11 May 2017 18:56:26 +0000 (20:56 +0200)]
devattr.3: Some minor adjustments.

* Do not point to itself with .Xr

* Add missing space.

6 weeks agotools/toeplitz: Add option to do modulo
Sepherosa Ziehau [Sun, 7 May 2017 06:42:28 +0000 (14:42 +0800)]
tools/toeplitz: Add option to do modulo