102298 Commits

Author SHA1 Message Date
np
854a7e5a12 MFC r259150 (by adrian@) and r283864.
r259150:
Print out the full PCIe link negotiation during dmesg.

I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot
or not.

r283864:
cxgbe: no need to display the per-lane GT/s rating of the pcie link.
2015-06-06 20:01:06 +00:00
ian
72a6278f84 MFC r279824, r279827, r279825:
Add a dtb module for AM335x systems (just Beaglebone right now).

  Remove the static DTB config and instead build modules/dtb/am335x.

  Also, remove WITHOUT_MODULES="ahc" which was added long ago to work
  around build problems that have long since been fixed correctly.

  Revert accidentally commited modules/Makefile file from r279824.
2015-06-06 19:15:48 +00:00
ian
98d314ee2c MFC r278338, r278340, r278458, r278519:
Create a module to install the Raspberry Pi dtb files.

  Pull in the rpi.dts -> rpi.dtb module (dtb/rpi) and have it install
  rpi.dtb in /boot/dtb by default.

  Add a module to build the dtb files for all supported imx6 systems.

  Remove imx6s-wandboard.dts, there is no such file.
2015-06-06 18:49:02 +00:00
np
49e34859d1 MFC r283858 and r284007.
r283858:
cxgbe: set minimum burst size when fetching freelist buffers to 128B.

r284007:
cxgbe: set the minimum burst size when fetching fl buffers to 128B for
netmap rx queues too.  This should have gone in as part of r283858.
2015-06-06 18:46:37 +00:00
np
e60231f03b MFC r280878:
cxgbe/tom: return rx credits promptly if the socket buffer's low water
mark cannot be reached because the window advertised to the peer isn't
wide enough.  While here, tweak the normal credit return too.
2015-06-06 18:31:28 +00:00
ian
88ef926e03 MFC r278458, r278519:
Pass MODULES_EXTRA to the modules build. While I'm here, also always
  pass WITHOUT_MODULES down. There's no need to make this conditional.

  Properly quote EXTRA_MODULES and WITHOUT_MODULES to ensure that they
  are passed down properly when there's more than one.
2015-06-06 18:21:16 +00:00
ian
f4aec12940 MFC r279385, r279902, r281412:
Merge latest dts files (commit c8c1b3a77934768c7f7a4a9c10140c8bec529059)
  from the git tree.

  File names with commas in them cause issues for freebsd-update. We
  don't actually use these files at the moment, so eliminate them until
  we actually do. In the mean time, freebsd-update will be updated
  to eliminate the issues.

  The GNU Amlogic DTS files have some errors (e.g. bad register
  address, bad IRQ, etc) which are fixed by this patch.
2015-06-06 18:03:36 +00:00
np
edfdc5c75d MFC r278239 and r278374.
r278239:
cxgbe(4): reserve id for iSCSI upper layer driver.

r278374:
cxgbe(4): tidy up some of the interaction between the Upper Layer
Drivers (ULDs) and the base if_cxgbe driver.

Track the per-adapter activation of ULDs in a new "active_ulds" field.
This was done pretty arbitrarily before this change -- via TOM_INIT_DONE
in adapter->flags for TOM, and the (1 << MAX_NPORTS) bit in
adapter->offload_map for iWARP.

iWARP and hw-accelerated iSCSI rely on the TOE (supported by the TOM
ULD).  The rules are:
a) If the iWARP and/or iSCSI ULDs are available when TOE is enabled then
   iWARP and/or iSCSI are enabled too.
b) When the iWARP and iSCSI modules are loaded they go looking for
   adapters with TOE enabled and enable themselves on that adapter.
c) You cannot deactivate or unload the TOM module from underneath iWARP
   or iSCSI.  Any such attempt will fail with EBUSY.
2015-06-06 18:00:36 +00:00
ae
49fd76c05c MFC r282809:
Add new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
  packets on tunnel interfaces. Add support of these ioctls to gre(4),
  gif(4) and me(4) interfaces. For incoming packets M_SETFIB() should use
  if_fib value from ifnet structure, use proper value in gre(4) and me(4).

  Differential Revision:	https://reviews.freebsd.org/D2462
2015-06-06 13:37:11 +00:00
ae
ad4eef6e15 MFC r276902,282536:
Pass mtag argument into m_tag_locate() to continue the search from
  the last found mtag.
2015-06-06 13:29:41 +00:00
ae
f1be259e6a MFC r276148:
Remove in_gif.h and in6_gif.h files. They only contain function
  declarations used by gif(4). Instead declare these functions in C files.
  Also make some variables static.

MFC r276215:
  Extern declarations in C files loses compile-time checking that
  the functions' calls match their definitions. Move them to header files.
2015-06-06 13:26:13 +00:00
ae
920800a21f MFC r274246:
Overhaul if_gre(4).

  Split it into two modules: if_gre(4) for GRE encapsulation and
  if_me(4) for minimal encapsulation within IP.

  gre(4) changes:
  * convert to if_transmit;
  * rework locking: protect access to softc with rmlock,
    protect from concurrent ioctls with sx lock;
  * correct interface accounting for outgoing datagramms (count only payload size);
  * implement generic support for using IPv6 as delivery header;
  * make implementation conform to the RFC 2784 and partially to RFC 2890;
  * add support for GRE checksums - calculate for outgoing datagramms and check
    for inconming datagramms;
  * add support for sending sequence number in GRE header;
  * remove support of cached routes. This fixes problem, when gre(4) doesn't
    work at system startup. But this also removes support for having tunnels with
    the same addresses for inner and outer header.
  * deprecate support for various GREXXX ioctls, that doesn't used in FreeBSD.
    Use our standard ioctls for tunnels.

  me(4):
  * implementation conform to RFC 2004;
  * use if_transmit;
  * use the same locking model as gre(4);

  PR:		164475

MFC r274289 (by bz):
  gcc requires variables to be initialised in two places.  One of them
  is correctly  used only under the same conditional though.

  For module builds properly check if the kernel supports INET or INET6,
  as otherwise various mips kernels without IPv6 support would fail to build.

MFC r274964:
  Add ip_gre.h to ObsoleteFiles.inc.
2015-06-06 12:44:42 +00:00
np
0a68383238 MFC r276480, r276485, r276498, r277225, r277226, r277227, r277230,
r277637, and r283149 (by emaste@).

r276485 is the real change here, the rest deal with the fallout of
mp_ring's reliance on 64b atomics.

Use the incorrectly spelled 'eigth' from struct pkthdr in this branch
instead of MFC'ing r261733, which would have renamed the field of a
public structure in a -STABLE branch.
---

r276480:
Temporarily unplug cxgbe(4) from !amd64 builds.

r276485:
cxgbe(4): major tx rework.

a) Front load as much work as possible in if_transmit, before any driver
lock or software queue has to get involved.

b) Replace buf_ring with a brand new mp_ring (multiproducer ring).  This
is specifically for the tx multiqueue model where one of the if_transmit
producer threads becomes the consumer and other producers carry on as
usual.  mp_ring is implemented as standalone code and it should be
possible to use it in any driver with tx multiqueue.  It also has:
- the ability to enqueue/dequeue multiple items.  This might become
  significant if packet batching is ever implemented.
- an abdication mechanism to allow a thread to give up writing tx
  descriptors and have another if_transmit thread take over.  A thread
  that's writing tx descriptors can end up doing so for an unbounded
  time period if a) there are other if_transmit threads continuously
  feeding the sofware queue, and b) the chip keeps up with whatever the
  thread is throwing at it.
- accurate statistics about interesting events even when the stats come
  at the expense of additional branches/conditional code.

The NIC txq lock is uncontested on the fast path at this point.  I've
left it there for synchronization with the control events (interface
up/down, modload/unload).

c) Add support for "type 1" coalescing work request in the normal NIC tx
path.  This work request is optimized for frames with a single item in
the DMA gather list.  These are very common when forwarding packets.
Note that netmap tx in cxgbe already uses these "type 1" work requests.

d) Do not request automatic cidx updates every 32 descriptors.  Instead,
request updates via bits in individual work requests (still every 32
descriptors approximately).  Also, request an automatic final update
when the queue idles after activity.  This means NIC tx reclaim is still
performed lazily but it will catch up quickly as soon as the queue
idles.  This seems to be the best middle ground and I'll probably do
something similar for netmap tx as well.

e) Implement a faster tx path for WRQs (used by TOE tx and control
queues, _not_ by the normal NIC tx).  Allow work requests to be written
directly to the hardware descriptor ring if room is available.  I will
convert t4_tom and iw_cxgbe modules to this faster style gradually.

r276498:
cxgbe(4): remove buf_ring specific restriction on the txq size.

r277225:
Make cxgbe(4) buildable with the gcc in base.

r277226:
Allow cxgbe(4) to be built on i386.  Driver attach will succeed only on
a subset of i386 systems.

r277227:
Plug cxgbe(4) back into !powerpc && !arm builds, instead of building it
on amd64 only.

r277230:
Build cxgbe(4) on powerpc64 too.

r277637:
Make sure the compiler flag to get cxgbe(4) to compile with gcc is used
only when gcc is being used.  This is what r277225 should have been.
2015-06-06 09:28:40 +00:00
jhb
988e96c82a MFC 281932:
Rename the kld for oce(4) to if_oce.ko.  ifconfig(8) has special knowledge
about kld filenames for network drivers that requires them to follow the
pattern of if_<foo>.  This also fixes the existing documentation in the
manpage which says to use if_oce_load=YES in loader.conf.

PR:		199095
2015-06-05 20:38:22 +00:00
jhb
ea5a6516ae MFC 274633,274639,274663,277233-277235,281870,281871,281873,281874:
Various fixes for suspend and resume of PCI to PCI and PCI to Cardbus
bridges.

274633:

Remove stray empty comment. The code is adequately explained in the
block comment above, so there's nothing to add here.

274639:

Modernize comments about BIOSes being lame since in this detail they
aren't lame, the rules changed along the way. Catch up to 1999 or so
with the new rules.

274663:

Fix typo pointed out by avg@ and Joerg Sonnenberger. Add a clarifying
sentence too.

277233:

Suspend and resume were the only two functions not to follow the brdev
convention here, so fix that.

277234:

Move the suspsned and resume functions to the bus attachment. They
were accessing PCI config registers, which won't work for the ISA
version.

277235:

Always enable I/O, memory and dma cycles. Some BIOSes don't enable
them, sometimes they are reset for power state transitions or during
whatever happens while suspended. Also, it is good practice to always
do this.

281870:

Cosmetic change: use PCIR_SECLAT_2 rather than PCIR_SECLAT_1.

281871:

The minimim grant and maximum latency PCI config registers are only valid
for type 0 devices, not type 1 or 2 bridges.  Don't read them for bridge
devices during bus scans and return an error when attempting to read them
as ivars for bridge devices.

281873:

Don't explicitly manage power states for PCI-PCI bridge devices in the
driver's suspend and resume routines.  These have been redundant no-ops
since r214065 changed the PCI bus driver to manage power states for
all devices (including type 1/2 bridge devices) during suspend and resume.

281874:

Update the pci_cfg_save/restore routines to operate on bridge devices
(type 1 and type 2) as well as leaf devices (type 0).  In particular,
this allows the existing PCI bus logic to save and restore capability
registers such as MSI and PCI-express work for bridge devices rather than
requiring that code to be duplicated in bridge drivers.  It also means
that bridge drivers no longer need to save and restore basic registers
such as the PCI command register or BARs nor manage powerstates for the
bridge device.

While here, pci_setup_secbus() has been changed to initialize the 'sec'
and 'sub' fields in the 'secbus' structure instead of requiring the pcib
and pccbb drivers to do this in the NEW_PCIB + PCI_RES_BUS case.
2015-06-05 17:05:09 +00:00
avg
8f2fc91d60 MFC r283524: dsl_dataset_promote_check: ensure that shared snaps do not
become too long
2015-06-05 16:02:24 +00:00
avg
535b577a78 MFC r282766: zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget 2015-06-05 15:51:23 +00:00
kib
8adebdc1fb MFC r283735:
Remove several write-only variables.
2015-06-05 08:36:25 +00:00
kib
0a8cb339c3 MFC r283745:
Do not raise priority of the idle thread on singal delivery.
2015-06-05 08:26:38 +00:00
kib
c5849be284 MFC r283692:
Explicitely enable queued invalidation completion interrupt.
2015-06-05 08:23:33 +00:00
ae
c84e575eec MFC r271918 (by hrs):
- Virtualize interface cloner for gre(4).  This fixes a panic when destroying
    a vnet jail which has a gre(4) interface.

  - Make net.link.gre.max_nesting vnet-local.
2015-06-05 08:10:08 +00:00
ae
200ce7d836 Rework r281868 to not skip RTM announces for tunneling interfaces.
This is direct commit to stable/10.

Tested by:	tuexen@
2015-06-05 07:23:32 +00:00
hselasky
8707ccbe03 MFC r283922:
Fix for control endpoint handling in the DWC OTG driver. The data
stage processing is only allowed after the setup complete event has
been received. Else a race may occur and the OUT data can be corrupted.
While at it ensure resetting a FIFO has the required wait loop.
2015-06-05 07:17:14 +00:00
mav
ca4dbe2f75 MFC r283936: Restore AHCI quirks printing as base16.
smh@ at r278034 made it base17, that is somewhat odd. :)
2015-06-05 00:35:17 +00:00
imp
f94880e394 MFC: Merge more of the dtb machinery
Merge 278459,278460,278461,278462 which define DTBDIR and other things
needed for install to work. Although the commit in head kinda fixed
install_as_user, it's unknown if that works in 10.x (it didn't the last
time I tried).
2015-06-04 22:11:39 +00:00
slm
ceb5f63b1a MFC: r283661
- Updated all files with 2015 Avago copyright, and updated LSI's copyright
  dates.

- Changed all of the PCI device strings from LSI to Avago Technologies (LSI).

- Added a sysctl variable to control how StartStopUnit behavior works. User can
  select to spin down disks based on if disk is SSD or HDD.

- Inquiry data is required to tell if a disk will support SSU at shutdown or
  not. Due to the addition of mprssas_async, which gets Advanced Info but not
  Inquiry data, the setting of supports_SSU was moved to the
  mprsas_scsiio_complete function, which snoops for any Inquiry commands. And,
  since disks are shutdown as a target and not a LUN, this process was
  simplified by basing it on targets and not LUNs.

- Added a sysctl variable that sets the amount of time to retry after sending a
  failed SATA ID command. This helps with some bad disks and large disks that
  require a lot of time to spin up. Part of this change was to add a callout to
  handle timeouts with the SATA ID command. The callout function is called
  mprsas_ata_id_timeout(). (Fixes PR 191348)

- Changed the way resets work by allowing I/O to continue to devices that are
  not currently under a reset condition. This uses devq's instead of simq's and
  makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a function
  called mprsas_prepare_tm().

- Some changes were made to reduce code duplication when getting a SAS address
  for a SATA disk.

- Fixed some formatting and whitespace.

- Bump version of mpr driver to 9.255.01.00-fbsd

PR:		191348
2015-06-04 16:27:18 +00:00
rmacklem
7e70fa5ddf MFC: r283273
The NFS client wasn't handling getdirentries(2) requests for sizes
that are not an exact multiple of DIRBLKSIZ correctly. Fortunately
readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications
were affected. This patch fixes this problem by reducing the size
of the directory read to an exact multiple of DIRBLKSIZ.
2015-06-04 12:35:00 +00:00
dteske
f38383848a MFC r268254 (jmg):
Add a hint that you can enable this by default if you want;
necessary if you want the keyboard break to work early in boot.
2015-06-03 22:24:57 +00:00
emaste
d77c39991b MFC r259438 by pjd: Fix syscalls that can be loaded as kernel modules
They were not given the flag allowing to call them from capability
  mode sandbox.

And regenerate init_sysent.c

Sponsored by:	The FreeBSD Foundation
2015-06-03 18:33:47 +00:00
hselasky
cec9850b29 MFC r283103:
Fix for DWC OTG device side isochronous transfers. The even or odd
isochronous frame bit needs to be flipped.
2015-06-03 15:41:03 +00:00
hselasky
79cd6230a5 MFC r282650 and r282651:
Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These
definitions are only used inside the kernel and can be changed later
if more than one sub-channel is desired. This has been done to allow
so-called USB audio rack modules to work with FreeBSD.

Add support for more than 8 audio channels per PCM stream for USB
audio class compliant devices under FreeBSD. Tested using 16 recording
and 16 playback audio channels simultaneously.

Bump the FreeBSD version to force recompiling all external modules.
2015-06-03 15:32:43 +00:00
emaste
02441119bc MFC r261220 by csjp: Allow sigwait(2) in capabilities mode.
It's common for multi-threaded processes to create a thread for
  the purpose of synchronously processing signals. Allow such processes to
  utilize a capabilities sandbox.
2015-06-03 13:12:08 +00:00
emaste
e6fee85e82 MFC r259436,259437 by pjd: Allow for pselect(2) in capability mode. 2015-06-03 13:10:25 +00:00
emaste
d97b35fcad Regen for r283940. 2015-06-03 11:39:29 +00:00
emaste
2c4dd777cb MFC r257736 (by pjd):
- Remove mac_get_fd/mac_set_fd - those are not syscalls. The
    __mac_get_fd() and __mac_set_fd() syscalls are listed earlier.
  - Correct typo in syscall name. It should be sched_rr_get_interval,
    not sched_rr_getinterval.
2015-06-03 11:36:47 +00:00
ae
78931b5bd8 MFC r283146:
In the reply to SADB_X_SPDGET message use the same sequence number that
  was in the request. Some IKE deamons expect it will the same. Linux and
  NetBSD also follow this behaviour.

  PR:		137309
2015-06-03 02:50:58 +00:00
imp
44bead40e5 MFC:
r283014: Disable unmapped I/O: it is broken for unaligned pages
r283126: Fix comments
2015-06-02 21:36:45 +00:00
imp
a5587d67f9 MFC:
Merge r276846: Add infrastructure to build dtb files from dts files.
2015-06-02 21:24:47 +00:00
jhb
017f11d1f3 MFC 281887:
Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.
2015-06-02 19:20:39 +00:00
jhb
a5ce7c460f MFC 281601:
Remove THRMISC_VERSION.  The thrmisc structure doesn't include a version
number, so this wasn't used (and can't easily be added).  If at some point
we want to extend thrmisc, we will probably need to just add a new note
type and ensure that the new type includes a version number.
2015-06-02 14:55:55 +00:00
jhb
cb2edec922 MFC 281266:
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.
2015-06-02 14:54:53 +00:00
ae
3c9fd21963 MFC r283101:
Teach key_expire() send SADB_EXPIRE message with the SADB_EXT_LIFETIME_HARD
  extension header type. The key_flush_sad() now will send SADB_EXPIRE
  message when HARD lifetime expires. This is required by RFC 2367 and some
  keying daemons rely on these messages. HARD lifetime messages have
  precedence over SOFT lifetime messages, so now they will be checked first.
  Also now SADB_EXPIRE messages will be send even the SA has not been used,
  because keying daemons might want to rekey such SA.

  PR:		200282, 200283

MFC r283102:
  Change SA's state before sending SADB_EXPIRE message. This state will
  be reported to keying daemon.
2015-06-02 03:51:33 +00:00
ae
bf9acc9587 MFC r275390:
Remove unused declartations.

MFC r275437:
  ANSIfy function declarations.

MFC r275438:
  Remove __P() macro.

Sponsored by:	Yandex LLC
2015-06-02 03:43:36 +00:00
ae
fcbaea9548 MFC r275392:
Remove route chaching support from ipsec code. It isn't used for some time.
  * remove sa_route_union declaration and route_cache member from struct secashead;
  * remove key_sa_routechange() call from ICMP and ICMPv6 code;
  * simplify ip_ipsec_mtu();
  * remove #include <net/route.h>;

Sponsored by:	Yandex LLC
2015-06-02 03:14:42 +00:00
ae
f780971d93 MFC r283104:
Read GEOM_UNCOMPRESS metadata using several requests that fit into
  MAXPHYS. For large compressed images the metadata size can be bigger
  than MAXPHYS and this triggers KASSERT in g_read_data().
  Also use g_free() to free memory allocated by g_read_data().

  PR:		199476
2015-06-02 02:05:32 +00:00
jkim
045ad2b6bb MFC: r283261
Do not probe Intel PIIX4 south bridge quirks on amd64.
2015-06-01 19:26:24 +00:00
jhb
34dd7e04e0 MFC 283123:
Fix two bugs that could result in PMC sampling effectively stopping.
In both cases, the the effect of the bug was that a very small positive
number was written to the counter. This means that a large number of
events needed to occur before the next sampling interrupt would trigger.
Even with very frequently occurring events like clock cycles wrapping all
the way around could take a long time. Both bugs occurred when updating
the saved reload count for an outgoing thread on a context switch.

First, the counter-independent code compares the current reload count
against the count set when the thread switched in and generates a delta
to apply to the saved count. If this delta causes the reload counter
to go negative, it would add a full reload interval to wrap it around to
a positive value. The fix is to add the full reload interval if the
resulting counter is zero.

Second, occasionally the raw counter value read during a context switch
has actually wrapped, but an interrupt has not yet triggered. In this
case the existing logic would return a very large reload count (e.g.
2^48 - 2 if the counter had overflowed by a count of 2). This was seen
both for fixed-function and programmable counters on an E5-2643.
Workaround this case by returning a reload count of zero.

PR:		198149
Sponsored by:	Norse Corp, Inc.
2015-06-01 18:08:56 +00:00
jhb
7a2aa2a780 MFC 282641,282658:
- Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
  the broader DEBUG option.
- Convert hwpmc(4) debug printfs over to KTR.

Sponsored by:	Norse Corp, Inc.
2015-06-01 17:57:05 +00:00
kib
082794a940 MFC r283515:
Remove excess Giant acquisition around the dounmount() call.
2015-06-01 06:56:49 +00:00
np
b62b670049 MFC r273480, r273750, r273753, r273797, and r274461.
r273480:
cxgbe/iw_cxgbe: wake up waiters after flushing the qp.

r273750:
Some cxgbe/iw_cxgbe fixes:
- Free rt in c4iw_connect only if it is allocated.
- Call soclose instead of so_shutdown if there is an abort from the peer.
- Close socket and return failure if TOE is not enabled.

r273753:
iwcm_event status needs to be populated for close_complete_upcall

r273797:
Always request a completion for every work request for iWARP.  The
initial MPA exchange must be tracked this way so that t4_tom's state for
the tid is all clean at the time the tid transitions to RDMA mode.  Once
it does, t4_tom is out of the way and iw_cxgbe uses the qp endpoints
directly.

r274461:
iw_cxgbe: don't forget to close the socket in c4iw_connect if soconnect
fails.
2015-05-31 23:47:08 +00:00