Commit Graph

115654 Commits

Author SHA1 Message Date
Navdeep Parhar
3ae36eee9c cxgbe/iw_cxgbe: Minor changes for T6.
Submitted by:	Krishnamraju Eraparaju at Chelsio
Sponsored by:	Chelsio Communications
2017-02-23 19:02:40 +00:00
Pedro F. Giffuni
46f8be3953 vxge(4): Yet another (minor) mismatch.
VXGE_DEFAULT_TTI_RTIMER_VAL and VXGE_DEFAULT_RTI_RTIMER_VAL have value
zero but nevertheless we should use the right value on each.

Pointed by:	jhb
X-MFC with:	r314145
2017-02-23 18:56:31 +00:00
Pedro F. Giffuni
d43e62ddea rt_attach(): double assignment.
Found with:	coccinelle (da.cocci)
2017-02-23 18:15:04 +00:00
Michael Tuexen
8d62aae8df TCP window updates are only sent if the window can be increased by at
least 2 * MSS. However, if the receive buffer size is small, this might
be impossible. Add back a criterion to send a TCP window update if
the window can be increased by at least half of the receive buffer size.
This condition was removed in r242252. This patch simply brings it back.
PR:			211003
Reviewed by:		gnn
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D9475
2017-02-23 18:14:36 +00:00
Enji Cooper
6233db9fac Unbreak if_iwm.ko after r314076
Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made
to sys/conf/files after refactoring done in the commit noted.

PR:		217308
Pointyhat to:	adrian
Submitted by:	Andreas Nilsson <andrnils@gmail.com>
Reported by:	Jakob Alvermark <jakob@alvermark.net>, Juan Ramómon Molina Menor <listjm@club.fr>
Sponsored by:	Dell EMC Isilon
2017-02-23 17:44:06 +00:00
Alan Somers
65244d585f Fix the xnb(4) unit tests
One test was inadvertently expecting a bug in the kernel's sscanf
implementation circa 2012. I don't know when that bug got fixed.

Reported by:	royger
Reviewed by:	royger
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9766
2017-02-23 16:54:30 +00:00
Alan Somers
407d708cc7 Misc Coverity fixes in xnb(4)
Most of these are null pointer dereferences or missing error checks in the
unit tests. One is a missing error check in xnb_attach_failed. None can
cause real problems in running systems.

Reported by:	Coverity
CIDs:		1092469 1092468 1092467 2092466 1092465 1092512 1092511 1092510
CIDs:		1092510 1092509 1092508 1092507
Reviewed by:	royger
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9234
2017-02-23 16:31:04 +00:00
Pedro F. Giffuni
466bc1573f bktr(4): double assignment.
First assignment is obviously overwritten by the next line.
Leave newest assignment: it was introduced in r29233.

Found with:	coccinelle (da.cocci)
2017-02-23 16:18:57 +00:00
Pedro F. Giffuni
0778102b03 dev/vxe: double assignments.
Fix some suspicious code, likely caused by excessive copy-pasting.

Found with:	coccinelle (da.cocci)
MFC after:	2 weeks
2017-02-23 16:10:15 +00:00
Pedro F. Giffuni
e54226a396 dev/ce: double assignment.
The code is not operational right now so just comment away an obviously
useless assignment. Fix some typos while here.

Found with: coccinelle (da.cocci)
2017-02-23 15:30:21 +00:00
Roger Pau Monné
d908d2ef5e xen/gndev: use UOFF_TO_IDX instead of OFF_TO_IDX
The Xen grant table device treats the mmap offset parameter as an unsigned
type, and as so it must use the newly introduced UOFF_TO_IDX.

Sponsored by:   Citrix Systems R&D
MFC after:      2 weeks
X-MFC-with:     r313690
2017-02-23 13:14:28 +00:00
Hans Petter Selasky
cffaf933d7 Implement __test_and_clear_bit() and __test_and_set_bit() in the LinuxKPI.
The clang compiler will optimise these functions down to three AMD64
instructions if the bit argument is a constant during compilation.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-23 09:53:54 +00:00
Dmitry Chagin
c1f156d447 Right clock defines specified in linux_timer.h.
Get rid of spirious clock defines from linux_misc.h.

MFC after:	1 week
2017-02-23 08:17:42 +00:00
Navdeep Parhar
3d4f452402 Avoid NULL dereference in a couple of sysctl handlers in ibcore.
iw_cxgbe sets ib_device->dma_device to NULL (since r311880).

Reviewed by:	hselasky@
Sponsored by:	Chelsio Communications
2017-02-23 07:48:58 +00:00
Emmanuel Vadot
dd165efb5a Do not check divider length if we have a div table.
Reviewed by:	mmel
2017-02-23 05:33:20 +00:00
Jonathan T. Looney
c9cde8251c Fix a panic during boot caused by inadequate locking of some vt(4) driver
data structures.

vt_change_font() calls vtbuf_grow() to change some vt driver data
structures. It uses TF_MUTE to prevent the console from trying to use those
data structures while it changes them.

During the early stage of the boot process, the vt driver's tc_done routine
uses those data structures; however, it is currently called outside the
TF_MUTE check.

Move the tc_done routine inside the locked TF_MUTE check.

PR:		217282
Reviewed by:	ed, ray
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D9709
2017-02-23 01:18:47 +00:00
John Baldwin
0049360352 Use LDFLAGS with CC instead of _LDFLAGS.
This is a followup to r311458.  _LDFLAGS is for use with LD, whereas
LDFLAGS is for use with CC.
2017-02-22 23:58:54 +00:00
Toomas Soome
84a6eddc43 loader: update symlink support in zfs reader
As the current zfs file system is providing symlink via system attributes, need
to update the code accordingly.

Note, as the zfsboot code does not free the memory at this time, the
object list will put some stress on the boot2 heap, eventually we should
address the issue.

Reviewed by:	allanjude, smh
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D9706
2017-02-22 22:00:50 +00:00
Hans Petter Selasky
72ebbe00b3 Convert magic values into macros in the LinuxKPI scatterlist
implementation.

Suggested by:		cem @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-22 20:24:09 +00:00
Hans Petter Selasky
1cdefd084d Optimise unmapped LinuxKPI page allocations.
When allocating unmapped pages, take advantage of the direct map on
AMD64 to get the virtual address corresponding to a page. Else all
pages allocated must be mapped because sometimes the virtual address
of a page is requested.

Move all page allocation and deallocation code into an own C-file.

Add support for GFP_DMA32, GFP_KERNEL, GFP_ATOMIC and __GFP_ZERO
allocation flags.

Make a clear separation between mapped and unmapped allocations.

Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-22 19:39:54 +00:00
Hans Petter Selasky
8306998f5b Improve LinuxKPI scatter list support.
The i915kms driver in Linux 4.9 reimplement parts of the scatter list
functions with regards to performance. In other words there is not so
much room for changing structure layouts and functionality if the
i915kms should be built AS-IS. This patch aligns the scatter list
support to what is expected by the i915kms driver. Remove some
comments not needed while at it.

Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-22 19:31:02 +00:00
Andriy Gapon
a4806d2a62 don't use C99 static array indices with older GCC versions
For example, the FreeBSD GCC (4.2.1) has a spotty support for that
feature.  If the static keyword is used with an unnamed array parameter
in a function declaration, then the compilation fails with:
error: static or type qualifiers in abstract declarator

The feature does work if the parameter is named.
So, the restriction introduced in this commit can be removed when all
affected function prototypes have the workaround.

MFC after:	1 week
Sponsored by:	Panzura
2017-02-22 17:20:18 +00:00
Andriy Gapon
465e69edca fix a typo in __STDC_VERSION__ in __min_size requirements
MFC after:	1 week
Sponsored by:	Panzura
2017-02-22 17:13:00 +00:00
Marius Strobl
4874af73c1 - Allow different slicers for different flash types to be registered
with geom_flashmap(4) and teach it about MMC for slicing enhanced
  user data area partitions. The FDT slicer still is the default for
  CFI, NAND and SPI flash on FDT-enabled platforms.
- In addition to a device_t, also pass the name of the GEOM provider
  in question to the slicers as a single device may provide more than
  provider.
- Build a geom_flashmap.ko.
- Use MODULE_VERSION() so other modules can depend on geom_flashmap(4).
- Remove redundant/superfluous GEOM routines that either do nothing
  or provide/just call default GEOM (slice) functionality.
- Trim/adjust includes

Submitted by:	jhibbits (RouterBoard bits)
Reviewed by:	jhibbits
2017-02-22 10:21:39 +00:00
Roger Pau Monné
de7d5ac603 xen/timer: mark the Xen PV timer as not safe for suspension
Note that the timer itself fully supports suspension, but due to the lack of
ordering during the resume process FreeBSD cannot guarantee that the timer is
resumed before any device attempts to use it.

Submitted by:		Liuyingdong <liuyingdong@huawei.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D9639
2017-02-22 09:22:17 +00:00
Alexander Motin
cfbeb41ccf Slightly polish isp_dump_atpd().
MFC after:	2 weeks
2017-02-22 07:12:20 +00:00
Konstantin Belousov
091326f2ad More fixes for regression in r313898 on i386.
Use long long constants where needed.

Reported and tested by:	kargl
Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2017-02-22 07:07:05 +00:00
Alexander Motin
8290ea90be Fix multiple problems around LUN disable under load.
- Move private data about ATIOs/INOTs from per-LUN to per-channel data.
This allows active commands to continue operation after LUN destruction.
This also simplifies lookup of the data by tag in some situations.
 - Unify three restart_queue processing implementations.
 - Complete all ATIOs from restart_queue on LUN disable.
 - Delete ATIO private data when command completed or aborted, not depending
on the ATIO being requeued, that was ugly hack and could never happen.  CAM
should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT.
 - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful
shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4).
 - Unify isp_endcmd() arguments to make it more usable in generic code.
 - Remove never really used LUN state reference counter.

MFC after:	2 weeks
2017-02-22 06:43:49 +00:00
Adrian Chadd
b28a6ab3bd [iwm] Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c.
Obtained from:	dragonflybsd.git 83a1185edeede081051a6c00417d4c5a8f5988eb
2017-02-22 05:11:24 +00:00
Adrian Chadd
2fd963796d [iwm] Switch 7265D and 3165 devices to 7265D firmware.
Obtained from:	dragonflybsd.git 0cb0a810cb4e04b30937cb4260e779f717a86492
2017-02-22 04:53:33 +00:00
Adrian Chadd
b60b5e75a0 [iwmfw] add 7265D firmware. 2017-02-22 04:50:52 +00:00
Adrian Chadd
d4dd31fd5e add 7265D firmware. 2017-02-22 04:44:08 +00:00
Adrian Chadd
027d4da3e0 Add 7265D firmware. 2017-02-22 04:42:02 +00:00
Adrian Chadd
6c2c3bd86d [iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c
* This is more similar to how code/definitions are distributed in
  Linux's iwlwifi.

* This should make recognizing new chipset variants, and adding additional
  flags from the Linux iwlwifi code easier, without blowing up if_iwm.c

Obtained from:	dragonflybsd.git 27d11320e707d2c41424efc1983762f6799941d6
2017-02-22 04:35:53 +00:00
Adrian Chadd
10e7a12c26 [iwm] Simplify device id matching code a bit.
* Just add the struct iwm_cfg pointers to the iwm_devices array, to get
  rid of the large switch clause.

Obtained from:	dragonflybsd.git 35f0e6c86c1654323d6b19f7a077f4ab8ac85868
2017-02-22 04:28:10 +00:00
Adrian Chadd
e5beb03bc6 [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses.
Obtained from:	dragonflybsd.git 710fdd011c30a1bd9f53b87c843fb8907c4a6cfd
2017-02-22 04:27:07 +00:00
Ian Lepore
c5727c468f Revert to this driver's historic behavior: assume an sd card is writable
if the fdt data doesn't provide a gpio pin for reading the write protect
switch and also doesn't contain a "wp-disable" property.

In r311735 the long-bitrotted code in this driver for using the non-
standard fdt "mmchs-wp-gpio-pin" property was replaced with new common
support code for handling write-protect and card-detect gpio pins.  The
old code never found a property with that name, and the logic was to
assume that no gpio pin meant that the card was not write protected.

The new common code behaves differently.  If there is no fdt data saying
what to do about sensing write protect, the value in the standard SDHCI
PRESENT_STATE register is used.  On this hardware, if there is no signal
for write protect muxed into the sd controller then that bit in the
register indicates write protect.

The real problem here is the fdt data, which should contain "wp-disable"
properties for eMMC and micro-sd slots where write protect is not even
an option in the hardware, but we are not in control of that data, it
comes from linux.  So we have to make the same flawed assumption in our
driver that the corresponding linux driver has: no info means no protect.

Reported by:	several users on the arm@ list
Pointy hat:	me, for not testing enough before committing r311735
2017-02-22 03:49:46 +00:00
Adrian Chadd
0a68d61092 [iwm] Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91.
* The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table,
  and not sc->umac_error_event_table.

Obtained from:	dragonflybsd.git 612855b1a8c321ec9ba34f63edf913e7ecff8363
2017-02-22 02:51:30 +00:00
Adrian Chadd
dfdbaed494 [iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants
* We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory.

Obtained from:	dragonflybsd.git f414b8da30816705e32573cc58097cacac34f161
2017-02-22 02:49:57 +00:00
Pedro F. Giffuni
e099b90b80 sys: Replace zero with NULL for pointers.
Found with:	devel/coccinelle
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D9694
2017-02-22 02:35:59 +00:00
Adrian Chadd
dae82c37b0 [iwm] With the previous commits, this DELAY no longer seems to be needed.
Obtained from:	dragonflybsd.git 516272d3d02c821ace16a91cfdeb28540ac74ecc
2017-02-22 02:24:42 +00:00
Adrian Chadd
9df5244309 [iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.
* Use the notification wait API, like it's done in the Linux iwlwifi code,
  to wait for the IWM_MVM_ALIVE notification.

* This also should fix some firmware load interrupt issues, and errors
  in the nic lock using.

Tested:

* (adrian) Intel 7260, STA mode

Obtained from:	dragonflybsd.git a7697ea01c11fd493aec52260a02f31df680eb91
2017-02-22 02:23:14 +00:00
Adrian Chadd
e97a1048d1 [iwm] Synchronize firmware loading code with Linux iwlwifi.
* While there, rename some functions to match the names and functionality
  of the similarly named functions in Linux iwlwifi.

Obtained from:	dragonflybsd.git e98ee77a816bfd8b4912047b93dfb2c560788f24
2017-02-22 02:18:04 +00:00
Ian Lepore
9063812353 Remove a variable that has been unused since r311735 (it should have been
removed as part of those changes).
2017-02-22 01:07:04 +00:00
David C Somayajulu
08d82f85d7 add bus_dmamap_unload in ql_free_dmabuf()
MFC after:5 days
2017-02-21 23:32:27 +00:00
Ian Lepore
5c65c9998a Fix typos in bootverbose printfs... display the write-protect pin info,
not the card-detect pin info.
2017-02-21 21:21:58 +00:00
Andriy Gapon
b93763e55d zfs: move zio_taskq_basedc under SYSDC
That knob is useless without SDC (or alike) scheduling class support.
That is, it's unused on FreeBSD.

MFC after:	4 days
2017-02-21 21:11:58 +00:00
Andriy Gapon
2b1bedaf06 zfs: lower priority of zio_write_issue threads by four
The difference of one was insignificant because zio_write_issue threads
ended up on the same run queues as other zio threads.
See sys/priority.h and sys/runq.h for more details.

Add a comment describing FreeBSD priority considerations and restore
the illumos variant of the code for comparison.

Obtained from:	Panzura
MFC after:	2 weeks
Sponsored by:	Panzura
2017-02-21 21:09:21 +00:00
Mark Johnston
a384a37df8 ddb show pte: use pmap of kdb_thread
show pte from the pmap of the process of the current DDB thread, instead
of necessarily the PCPU pmap.

Submitted by:	Ryan Libby <rlibby@gmail.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9645
2017-02-21 21:06:12 +00:00
Ed Maste
0e8b3ab348 Exclude -flto when building *genassym.o
The build process generates *assym.h using nm from *genassym.o (which is
in turn created from *genassym.c).

When compiling with link-time optimization (LTO) using -flto, .o files
are LLVM bitcode, not ELF objects. This is not usable by genassym.sh,
so remove -flto from those ${CC} invocations.

Submitted by:	George Rimar
Reviewed by:	dim
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D9659
2017-02-21 18:59:17 +00:00