Commit Graph

30759 Commits

Author SHA1 Message Date
Alexander Kabaev
19a8851f7b Do nothing if requested clk frequency is already correct.
Reviewed by: mmel
2016-03-27 23:19:20 +00:00
Navdeep Parhar
fddd4f6273 Plug leak in m_unshare.
m_unshare passes on the source mbuf's flags as-is to m_getcl and this
results in a leak if the flags include M_NOFREE.  The fix is to clear
the bits not listed in M_COPYALL before calling m_getcl.  M_RDONLY
should probably be filtered out too but that's outside the scope of this
fix.

Add assertions in the zone_mbuf and zone_pack ctors to catch similar
bugs.

Update netmap_get_mbuf to not pass M_NOFREE to m_getcl.  It's not clear
what the original code was trying to do but it's likely incorrect.
Updated code is no different functionally but it avoids the newly added
assertions.

Reviewed by:	gnn@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D5698
2016-03-26 23:39:53 +00:00
Michal Meloun
e64c374375 ARM: Parse command line delivered by U-Boot:
- in atags
- in DT blob (by using 'fdt chosen' U-Boot command)

The command line must start with guard's string 'FreeBSD:' and can contain
list of comma separated kenv strings. Also, boot modifier strings from
boot.h are recognised and parsed into boothowto.

The command line must be passed from U-Boot by setting of bootargs variable:
'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a'
followed by 'fdt chosen' (only for DT based boot)
2016-03-26 06:59:01 +00:00
Edward Tomasz Napierala
938bcb04fc Fix iSCSI initiator crash that could happen with out-of-memory
conditions with in-flight IO and subsequent reconnection.

PR:		199117
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5673
2016-03-25 16:01:40 +00:00
Bryan Drewery
3733897532 Remove unneeded return left from refactoring.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 00:14:56 +00:00
Alexander Motin
fc6eef7aa8 Unify ichwd(4) attachment messages in dmesg.
MFC after:	2 weeks
2016-03-24 23:24:00 +00:00
Alexander Motin
baa7dd65be Polish wbwd(4) driver and add more supported chips.
MFC after:	1 month
2016-03-24 20:52:35 +00:00
Konstantin Belousov
58a236093c Handle the driver KPI change from r292373. Ensure that managed device
pagers fault routines always return with a result page, be it the
proper and valid result page, or initially passed freshly allocated
placeholder.  Do not free the passed in page until we are able to
provide the replacement, and do not assign NULL to *mres.

Reported and tested by:	dumbbell
Reviewed by:	royger (who also verified that Xen code is safe)
Sponsored by:	The FreeBSD Foundation
2016-03-24 09:56:53 +00:00
Hans Petter Selasky
6227e59635 Add more UHCI PCI IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2016-03-24 09:35:29 +00:00
Sepherosa Ziehau
4793a1da1c hyperv/vmbus: Create per-cpu fast taskqueue for msg handling
Using one taskqueue does not work, since the EOM MSR must be written
on the msg's owner CPU.

Noticed by:	Jun Su <junsu microsoft com>
Discussed with:	Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-24 02:15:23 +00:00
Sepherosa Ziehau
0fc8db6eed hyperv/utils: Allow hint to disable individual utility
Reviewed by:	kib, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5714
2016-03-24 01:12:28 +00:00
Sepherosa Ziehau
25a40f12b0 hyperv/vmbus: use a better retry method in hv_vmbus_post_message()
Most often, hv_vmbus_post_message() doesn't fail.  However, it fails
intermittently when GPADLs of large shared memory is to be established
with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf
is created, for which lots of messages will be flooded to the host.
The host side tries to throttle the message rate by returning
HV_STATUS_INSUFFICIENT_BUFFERS.

Before this commit, we do several retries for failed messages, but the
delay between each retry is pretty/too low, which will cause sporadic
message posting failure.  We now use large delay (>=1ms) between each
retry to fix the message posting failure.

Submitted by:	Dexuan Cui <decui microsoft com>
Reviewed by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5715
2016-03-24 00:40:41 +00:00
Jared McNeill
64f86dc4cb Fix support for fixed factor clocks.
- Use a different device description for fixed and fixed factor clocks.
 - Fix a bug where the "clock-div" property was stored in the "mult" field
   of the clock definition.
 - Get the fixed factor parent clock by index instead of by name, as a
   clock-names property is not required to be present here.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5703
2016-03-23 19:26:53 +00:00
Jared McNeill
694f5cae46 clk_parse_ofw_out_names is supposed to return a list of indices when the
clock-indices property is present, so change the "uint32_t *indices" parameter
to "uint32_t **indices" to allow this.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5702
2016-03-23 19:24:09 +00:00
Jared McNeill
e1f3a8ce54 Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving
platform specific drivers a chance to override the generic driver.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5701
2016-03-23 19:21:21 +00:00
Bryan Drewery
9b511ce96b Handle copyin failures.
Skip the log entry as there is nothing good to write out.  Don't fail
the syscall though since it already succeeded.  There's no reason
filemon's tracing failure should fail the already-succeeded syscall.

Record the error for later to return from close(2) on the filemon devfs
file descriptor.

Discussed with:	markj, sjg, kib (briefly with kib)
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:14 +00:00
Bryan Drewery
eac5c9f26f Remove unused done argument to copyinstr(9).
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:10 +00:00
Bryan Drewery
4177d9f7d3 Return any log write failure encountered when closing the filemon fd.
Discussed with:	sjg, markj
Reviewed by:	sjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:07 +00:00
Bryan Drewery
4d9fbc5518 Follow-up r297156: Close the log in filemon_dtr rather than in the last reference.
If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns.  This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited.  This was only really part of the
daemonized process case which is abnormal.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:03 +00:00
Justin Hibbits
f8fd3fb518 Fix the resource_list_print_type() calls to use uintmax_t.
Missed a bunch from r297000.
2016-03-22 22:25:08 +00:00
Navdeep Parhar
78552b23a5 cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
to the descriptor ring no matter what path the frame takes within the
driver's tx.
2016-03-22 18:56:23 +00:00
Michael Tuexen
e180827abc Support checksum offloading for TCP/IPV6 and UDP/IPV6.
Support SCTP checksum offloading for SCTP/IPV6.
Support SCTP checksum offloading on all controllers except 82575.

Reviewed by:	sbruno@, erj@
MFC after: 	4 weeks
Differential Revision:	D5193
2016-03-22 12:40:09 +00:00
Sepherosa Ziehau
2e4dba97bd hyperv/hn: When short of mbufs on the RX path, don't spam the console.
Instead, increase the IQDROPS counter.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5693
2016-03-22 07:08:47 +00:00
Sepherosa Ziehau
59526d4ac7 hyperv/hn: Factor out hn_set_lro_lenlim()
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5692
2016-03-22 06:42:24 +00:00
Sepherosa Ziehau
16ac3db526 hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings
This mainly used to improve ACK timeliness when multiple RX rings
are enabled.

This value gives the best performance in both Azure and Hyper-V
environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS}
kernel.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5691
2016-03-22 06:31:39 +00:00
Alexander Motin
ea2ef9931c Optimize IPMI watchdog patting.
Set watchdog timer parameters only when they really need to be changed.
In other cases just restart the timer with single Reset command instead
of two (Set and Reset).

From one side this visually reduces amount of CPU time burned in tight
loop waiting while some slow BMC configures its watchdog hardware, that
seems to be much more complicated task then just resetting the timer.

From another side on some BMCs those slow Set commands sometimes tend to
timeout, that leads to noisy log messages and even more CPU time burned,
so avoiding them can provide even bigger bonuses.

MFC after:	2 weeks
2016-03-22 06:24:52 +00:00
Sepherosa Ziehau
1f0dfd9918 hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK)
Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5215
2016-03-22 06:23:09 +00:00
Sepherosa Ziehau
595a21e69e hyperv/vmbus: Use taskqueue_fast for non-performance critical messages
This gets rid of the per-cpu SWIs.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5215
2016-03-22 06:13:27 +00:00
Sepherosa Ziehau
1948628a54 hyperv/evttimer: Use an independent message slot so that it can work
Using the same message slot as the other types of the messages has
the side effect that the event timer message could be deferred to
the swi threads to run (lacking of trapframe and the original code
didn't even handle that, so the event timer was actually broken).

As of this commit we use an independent message slot for event timer,
so that we could handle all of event timer messages in the interrupt
handler directly.  Note, the message slot for event timer is still
bind to the same interrupt vector as the other types of messages.

Submitted by:	Jun Su <junsu microsoft com>
Reviewed by:	sephe
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5696
2016-03-22 05:48:51 +00:00
Adrian Chadd
cf9be7c92a [urtwn] welcome basic 11n support to urtwn.
This is a pretty good reference for teaching an almost-11n-capable
driver about 11n.

It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support
for transmit.  That'll come later.  This means that receive throughput
should be higher, but transmit throughput won't have changed much.

* Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX,
  so until we correctly handle it in software driven scans, disable.
* Add null 11n methods for channel width / ampdu_enable.
  the firmware can apparently handle ampdu tx (and hopefully block-ack
  handling and retransmission) so I'll go review the linux code and
  figure it out.
* Set the number of tx/rx streams.  I /hope/ that nchains == nstreams
  here.
* Add 11n channels in the call to ieee80211_init_channels().
* Don't enable HT40 for now - I'll have to verify the channel set command
  and tidy it up a bit first.
* Teach the RX path about M_AMPDU for 11n nodes.  Kinda wonder why
  we aren't just doing this in net80211 already, this is the fourth
  driver I've had to do this to.
* Teach rate2ridx() about MCS rates and what hardware rates to use.
* Teach the urtwn_tx_data() routine about MCS/11ng transmission.
  It doesn't know about short-gi and 40MHz modes yet; that'll come
  later.
* For 8192CU firmware, teach the rate table code about MCS rates.
* Ensure that the fixed rate transmit sets the right transmit flag
  so the firmware obeys the driver transmit path.
* Set the default transmit rate to MCS4 if no rate control is available.
* Add HT protection (RTS-CTS exchange) support.

* Add appropriate XXX TODO entries.

TODO:

* 40MHz, short-gi, etc - channel tuning, TX, RX;
* teach urtwn_tx_raw() about (more) 11n stuff;
* A-MPDU TX would be nice!

Thanks to Andriy (avos@) for reviewing the code and testing it on IRC.

Tested:

* RTL8188EU - STA (me)
* RTL8192CU - STA (me)
* RTL8188EU - hostap (avos)
* RTL8192CU - STA (avos)

Reviewed by:	avos
2016-03-22 01:09:15 +00:00
Andriy Voskoboinyk
abd89aa292 wpi: remove internal taskqueue
- Replace sc_reinittask() by ieee80211_restart_all() (mostly the same).
- Revert r282377 (seems to be unneeded now).

Tested with Intel 3945BG, STA mode.

Differential Revision:	https://reviews.freebsd.org/D5056
2016-03-21 23:25:41 +00:00
Bryan Drewery
d77f7e8c9d Consolidate common link(2) logic.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 23:22:19 +00:00
Andriy Voskoboinyk
349156a945 rum: add legacy power saving support (STA mode).
Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5546
2016-03-21 22:29:24 +00:00
Justin Hibbits
d8d7c6b11e Fix some more long -> rman_res_t
Reported by:	Michael Butler (siis breakage)
2016-03-21 22:19:53 +00:00
Andriy Voskoboinyk
96e29c261d rum: simplify error handling in rum_newstate().
Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5544
2016-03-21 22:14:48 +00:00
Andriy Voskoboinyk
3770442708 rum: do not try to restore bssid/TSF synchronization when device
is not associated.

Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5543
2016-03-21 21:33:30 +00:00
Andriy Voskoboinyk
fd7dae9c98 rum: separate some microcontroller vendor-specific requests into
rum_do_mcu_request()

This change should be no-op.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5542
2016-03-21 21:02:57 +00:00
Bryan Drewery
8536d1b7e1 Attempt to use the namecache for openat(2) path resolution.
This finishes the work done in D2810.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:53 +00:00
Bryan Drewery
4f0d785142 Use curthread for vn_fullpath.
No functional change.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:46 +00:00
Bryan Drewery
4d3cfa1d9c Consolidate open(2) and openat(2) code.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:43 +00:00
Bryan Drewery
6d2077c2be Stop tracking stat(2).
None of lstat(2), fstat(2), fstatat(2) were tracked either.

The other filemon implementations also do not track stat(2), nor
does bmake utilize it.  The act of opening a file for read should
be enough to decide that a file is a dependency.  There could be
rare cases where just having a file would cause a dependency but it
is unlikely.

MFC after:	2 weeks
Also noted by:	sjg
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 20:29:39 +00:00
Bryan Drewery
e0d84b9ee9 Track filemon usage via a proc.p_filemon pointer rather than its own lists.
- proc.p_filemon is added which is protected by PROC_LOCK.  This improves
  performance and avoids double-fork issues, taking allproc_lock
  while in syscalls, and walking the process tree in syscalls.  A
  particular proc.p_filemon can only be changed to NULL or another
  filemon, or the filemon inherited, while the filemon->lock is held.
- Filemon are reference counted.  On the last reference the log will be closed.
- When closing the devfs file handle, the filemon will be detached from all
  processes and inheritance prevented.
- Disallow attaching to a process already being traced since filemon is
  typically intended to be used on children only.  This is allowed for
  curproc as bmake relies on this behavior for rare cases when combining
  .MAKE with .META.
- Detach any previously tracked process on ioctl(FILEMON_SET_PID).
- Handle error from devfs_set_cdevpriv() in filemon_open().
- The global filemon lock and lists are removed.
- A free list is no longer kept.  Previously this list was
  forever-expanding and never garbage cleaned.
- No longer loses track of double-forks.  If the process holding the filemon
  handle closes it will close the log rather than wait on a daemonized process,
  but it will log all activity until it closes its handle.  The filemon
  will be removed from the process and not inherited.
- A separate process count is kept only as an optimization for
  forced detachment to avoid taking allproc_lock and walking the entire
  process tree.
- struct filemon access is protected by sx(9) filemon->lock as it was before.
- Add more comments and KASSERTS.

MFC after:	2 weeks
Reviewed by:	kib, mjg, markj (all on previous versions)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5520
2016-03-21 20:29:27 +00:00
David C Somayajulu
32020557a6 Modifications to achieve a common source base from FreeBSD7.x thru 10.x
MFC after:5 days
2016-03-21 18:48:20 +00:00
Sepherosa Ziehau
b6ba8b778a hyperv/vmbus: Implement bus_child_pnpinfo_str method
Submitted by:	Jun Su <junsu microsoft com>
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5669
2016-03-21 07:16:30 +00:00
Sepherosa Ziehau
57a339543d hyperv: Factor out snprinf_hv_guid()
Submitted by:	Ju Sun <junsu microsoft com>
Reviewed by:	Dexuan Cui <decui microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5651
2016-03-21 06:54:21 +00:00
Ed Maste
7fd08d3b59 i915: disable GEN6_MBCTL write in gen6_init_clock_gating
This write came from Linux commit b4ae3f22d238 which has been implicated
in Sandy Bridge power consumption issues (albeit under different
conditions on Linux). Disabling it restores normal power consumption on
my Sandy Bridge laptop (Thinkpad X220).

PR:		207889
Reviewed by:	cem, dumbbell
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5665
2016-03-21 00:59:30 +00:00
Ian Lepore
dec4873723 Fix fallout from r292180 (Dec 2015)... ensure that every driver which has
a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc.  This
is because the kernel linker only searches for symbols in dependent modules,
so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc
was not compiled into the kernel (even if you hand-loaded mmc first).

(Thanks to jilles@ for providing the vital clue about the kernel linker.)
2016-03-21 00:52:24 +00:00
Navdeep Parhar
8d814a458c iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux
iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4.

This commit includes internal changesets 6785 8111 8149 8478 8617 8648
8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730
11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2016-03-21 00:29:45 +00:00
Justin Hibbits
d6f8b9168f Convert a long to rman_res_t, fixing a sign extension bug.
ahci.c had one signed long, which was passed into rman, rather than u_long.
After the switch of rman_res_t from size u_long to size uintmax_t, the sign
extension caused ranges to get messed up, and ahcich* to not attach.

There may be more signed longs used in this way, which will be fixed as they're
reported.

Reported by:	pho
2016-03-20 14:21:07 +00:00
Adrian Chadd
0c91dc1d08 [urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by:	kevlo
2016-03-20 03:54:57 +00:00