Commit Graph

93969 Commits

Author SHA1 Message Date
Michael Tuexen
e5aeb83c42 Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics
accounting.

X-MFC with: r252026
2013-07-09 14:38:26 +00:00
Pedro F. Giffuni
db20714a87 Reinstate the assertion from r253045.
UFS r232732 reverted the change as the real problem was to be fixed
at the syscall level.

Reported by:	bde
2013-07-09 14:23:00 +00:00
Konstantin Belousov
56ce850bf8 Fix typo in comment.
MFC after:	3 days
2013-07-09 13:22:30 +00:00
Konstantin Belousov
89d02670ab Use MSI for xhci(4), if supported.
Reviewed by:	jhb
Tested by:	dchagin
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-07-09 12:55:01 +00:00
Steven Hartland
7f1c77876f Added 4K QUIRK for OCZ Vertex 4 SSDs
Submitted by:	Borja Marcos <borjam@sarenet.es>
MFC after:	2 days
2013-07-09 10:41:17 +00:00
Robert Millan
f19122edbf Allow assert() to operate correctly when building userland code. 2013-07-09 10:27:26 +00:00
Andrey V. Elsukov
b40e2b6d14 Bump __FreeBSD_version to reflect changes in statistics structures. 2013-07-09 10:20:27 +00:00
Andrey V. Elsukov
db8c087944 Migrate structs ahstat, espstat, ipcompstat, ipipstat, pfkeystat,
ipsec4stat, ipsec6stat to PCPU counters.
2013-07-09 10:08:13 +00:00
Andrey V. Elsukov
69edf037d7 Migrate struct carpstats to PCPU counters. 2013-07-09 10:02:51 +00:00
Andrey V. Elsukov
2841260cd6 Migrate structs in6_ifstat and icmp6_ifstat to PCPU counters. 2013-07-09 09:59:46 +00:00
Andrey V. Elsukov
a786f67981 Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters. 2013-07-09 09:54:54 +00:00
Andrey V. Elsukov
5b7cb97c2b Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU
counters.
2013-07-09 09:50:15 +00:00
Andrey V. Elsukov
5da0521fce Use new macros to implement ipstat and tcpstat using PCPU counters.
Change interface of kread_counters() similar ot kread() in the netstat(1).
2013-07-09 09:43:03 +00:00
Andrey V. Elsukov
7daad711df Add several macros to help migrate statistics structures to PCPU counters. 2013-07-09 09:37:21 +00:00
Andrey V. Elsukov
c80211e3cf Prepare network statistics structures for migration to PCPU counters.
Use uint64_t as type for all fields of structures.

Changed structures: ahstat, arpstat, espstat, icmp6_ifstat, icmp6stat,
in6_ifstat, ip6stat, ipcompstat, ipipstat, ipsecstat, mrt6stat, mrtstat,
pfkeystat, pim6stat, pimstat, rip6stat, udpstat.

Discussed with:	arch@
2013-07-09 09:32:06 +00:00
Andriy Gapon
37b8b2d4d8 dtrace/fasttrap: install hook functions only after all data is
initialized

Sponsored by:	HybridCluster
MFC after:	 7 days
2013-07-09 09:05:00 +00:00
Andriy Gapon
a01669ea96 audit_proc_coredump: check return value of audit_new
audit_new may return NULL if audit is disabled or suspended.

Sponsored by:	HybridCluster
MFC after:	7 days
2013-07-09 09:03:01 +00:00
Andriy Gapon
d6fc869ebd should_yield: protect from td_swvoltick being uninitialized or too stale
The distance between ticks and td_swvoltick should be calculated as
an unsigned number.  Previously we could end up comparing a negative
number with hogticks in which case should_yield() would give incorrect
answer.

We should probably ensure that td_swvoltick is properly initialized.

Sponsored by:	HybridCluster
MFC after:	5 days
2013-07-09 09:01:44 +00:00
Andriy Gapon
4633a4c379 namecache sdt: freebsd doesn't support structured characters yet
:-)

MFC after:	 7 days
2013-07-09 08:58:34 +00:00
Alexander Motin
122ecf1eca Add ID for Marvell 88SE9215 AHCI SATA controller.
MFC after:	3 days
2013-07-09 08:49:17 +00:00
Andriy Gapon
9c1f50af0a zfs: try to properly handle i/o errors in mappedread_sf
Unconditionally freeing a page is not good, especially if it is the page
that was wired by the caller.  The checks are picked up from
kern_sendfile.

MFC after:	3 weeks
2013-07-09 08:47:11 +00:00
Andriy Gapon
2565edc426 amd64: use -mno-omit-leaf-frame-pointer in addition to -fno-omit-frame-pointer
... in kernel builds.  This is to make behavior of clang consistent with
behavior of gcc.

MFC after:	2 weeks
2013-07-09 08:42:02 +00:00
Andriy Gapon
e4616f7bfb default loader.conf: there is no need to load zpool.cache now
kernel does not need it for importing a root pool.

MFC after:	4 weeks
2013-07-09 08:40:05 +00:00
Andriy Gapon
78ed7a7855 zfs: load zpool.cache after a root fs is mounted
MFC after:	3 weeks
2013-07-09 08:37:42 +00:00
Alexander Motin
c4aea6be90 Add one more ID of Marvell SATA controller.
Submitted by:	marck
MFC after:	3 days
2013-07-09 08:32:17 +00:00
Rui Paulo
88e07d922d Use meaningful names when creating mmc/sd threads.
This can be useful when we want to be able to identify which mmcsd is stuck.
2013-07-09 03:00:06 +00:00
Rui Paulo
b2b175ba30 Improve a comment. 2013-07-09 02:50:05 +00:00
Ed Maste
37a1b03c4b Remove extraneous format string converison specifier
Submitted by:	wxs@
2013-07-09 01:55:34 +00:00
Pedro F. Giffuni
bf3c9330ba Enhancement when writing an entire block of a file.
Merge from UFS r231313:

This change first attempts the uiomove() to the newly allocated
(and dirty) buffer and only zeros it if the uiomove() fails. The
effect is to eliminate the gratuitous zeroing of the buffer in
the usual case where the uiomove() successfully fills it.

MFC after:	3 days
2013-07-09 01:31:04 +00:00
Rick Macklem
88a2437a65 Add support for host-based (Kerberos 5 service principal) initiator
credentials to the kernel rpc. Modify the NFSv4 client to add
support for the gssname and allgssname mount options to use this
capability. Requires the gssd daemon to be running with the "-h" option.

Reviewed by:	jhb
2013-07-09 01:05:28 +00:00
John Baldwin
335349690f Allow mlx4 devices to switch from Ethernet to Infiniband (and vice versa):
- Fix sysctl wrapper for sysfs attributes to properly handle new string
  values similar to sysctl_handle_string() (only copyin the user's
  supplied length and nul-terminate the string).
- Don't check for a trailing newline when evaluating the desired operating
  mode of a mlx4 device.

PR:		kern/179999
Submitted by:	Shahar Klein <shahark@mellanox.com>
MFC after:	1 week
2013-07-08 21:25:12 +00:00
John Baldwin
c64bc3a076 Fix build with INVARIANT_SUPPORT enabled but not INVARIANTS.
Reported by:	"Matthew D. Fuller" <fullermd@over-yonder.net>
2013-07-08 21:17:20 +00:00
Pedro F. Giffuni
7ce75e5f1f Avoid a panic and return EINVAL instead.
Merge from UFS r232692:
syscall() fuzzing can trigger this panic.

MFC after:	3 days
2013-07-08 20:21:36 +00:00
Alexander Motin
fff11ae8af Add quirk to configure headphones redirection on ASUS UX31A laptop.
MFC after:	3 days
2013-07-08 15:28:09 +00:00
Adrian Chadd
93286afa73 Import the initial SoC register definitions for the AR934x MIPS74k SoC.
Obtained from:	Linux/OpenWRT
2013-07-08 06:12:38 +00:00
Adrian Chadd
4178f27320 Add AR9341, AR9342, AR9344 SoC types. 2013-07-08 06:10:29 +00:00
Oleksandr Tymoshenko
c0195195d5 Add IDs for TPS65217C and TPS65217D 2013-07-08 05:06:32 +00:00
Oleksandr Tymoshenko
4bab064ca8 - MMC1 (internal eMMC) pins should be configured as input-pullup, except
for reset pin
2013-07-08 04:30:12 +00:00
Oleksandr Tymoshenko
f1fa19dfe7 - AM335x requires updated soft-reset logic too 2013-07-08 04:27:03 +00:00
Mark Johnston
55d78cc78b Also define SDT_PROBE_DEFINE0 for the !KDTRACE_HOOKS case. 2013-07-08 02:03:18 +00:00
Alfred Perlstein
d7b5c50b92 Make kassert_printf use __printflike.
Fix associated errors/warnings while I'm here.

Requested by: avg
2013-07-07 21:39:37 +00:00
Rui Paulo
279cd1010a Convert bcm2835_mbox to the new mbox interface.
Reviewed by:	gonzo
2013-07-07 21:23:58 +00:00
Rui Paulo
8c78ddbaa3 Another warning. 2013-07-07 21:20:52 +00:00
Rui Paulo
9a0c3479e2 Add a mailbox interface.
Mailboxes are an IPC mechanism found on several ARM architectures, namely
OMAP4, BCM2385, Sitara, etc.

Reviewed by:	gonzo
2013-07-07 19:47:22 +00:00
Rui Paulo
175a0c9859 armadaxp_idcache_wbinv_all() is in this file. 2013-07-07 19:22:31 +00:00
Rui Paulo
afed56936c Fix all the compiler warnings in elf_trampoline.c. 2013-07-07 19:19:18 +00:00
Warner Losh
8d77cd5069 Remove all the NOPs after SYNC. They aren't needed.
They originated in the original Octeon port. They weren't present, as
far as I can tell, on the projects/mips branch until after this
point. They were in the original Octeon port in code picked up from
the vendor, who I've been able to find out trolling old email put them
there to get around an SMP problem that most likely was fixed in other
ways.

NetBSD and Linux don't have these, except for some specific uses of
SYNC on the alchemy parts (which we don't support, but even if we did
it is only a specific case and would be specifically coded
anyway). This is true of the current Linux code, as well as one old
version I polled.

I looked back at the old R12000, R8000, R6000, R4000, R4400 errata
that I have, and could find no mention of SYNC needing NOPs for
silicon bugs (although plenty of other cases where NOPs and other
contortions were needed).

An Google search turned up no old mailing list discussions on this on
Linux, NetBSD or FreeBSD (except the disussion that kicked off these
studies).

I've test booted this on my Octeon Plus eval board and survived a
buildworld. Adrian Chadd reports that this patch has no ill effects on
the Ahteros platforms he tested it on.

I conclude it is safe to just remove the NOPs. But added
__MIPS_PLATFORM_SYNC_NOPS as a failsafe in case we find some platform
where these are, in fact, required.

Reviewed by:	adrian@
2013-07-07 16:12:22 +00:00
Pedro F. Giffuni
bdf1d79884 Implement SEEK_HOLE/SEEK_DATA for ext2fs.
Merged from r236044 on UFS.

MFC after:	3 days
2013-07-07 15:51:28 +00:00
Oleksandr Tymoshenko
9afdeb10e4 - Add USFS driver as an example of device mode for AM335x-based devices 2013-07-07 04:24:38 +00:00
Oleksandr Tymoshenko
36b2854b79 - Add musb node to shared dtsi and proper pin configuratin for every
AM553x-based device
2013-07-07 04:23:29 +00:00
Oleksandr Tymoshenko
5a2168b2ef - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors Graphic
USB OTG core.
2013-07-07 04:22:08 +00:00
Oleksandr Tymoshenko
860e12e971 - Add initial host mode support for Mentor Graphics USB OTG controller
- Sync musb_otg_atmelarm with new core logic API
2013-07-07 04:18:35 +00:00
Pedro F. Giffuni
d66aed2e76 Fix some typos.
MFC after:	1 week
2013-07-07 01:32:52 +00:00
Pedro F. Giffuni
5f5458322a Add files related to ext2 HTree implementation
These should've been added along with r252890

Reported by:	gonzo
PointyHat:	pfg
MFC after:	1 week
2013-07-07 01:12:29 +00:00
Mark Johnston
d63fca7a07 Add SDT_PROBE_DEFINE0 for consistency with SDT_PROBE0.
MFC after:	1 week
2013-07-06 20:21:35 +00:00
Alexander Leidinger
b85e1f7d05 - Move videodev headers from compat/linux to contrib/v4l (cp from vendor and
apply diff to compat/linux versions).
- The cp implies an update of videodev2.h to the linux kernel 2.6.34.14 one.

The update makes video in skype v4 work on FreeBSD.

Tested by:	Artyom Mirgorodskiy <artyom.mirgorodsky@gmail.com>
		(update of header only)
2013-07-06 19:59:06 +00:00
Pedro F. Giffuni
91f5a4670f Initial implementation of the HTree directory index.
This is a port of NetBSD's GSoC 2012 Ext3 HTree directory indexing
by Vyacheslav Matyushin.  It was cleaned up and enhanced for FreeBSD
by Zheng Liu (lz@).

This is an excellent example of work shared among different projects:
Vyacheslav was able to look at an early prototype from Zheng Liu who
was also able to check the code from Haiku (with permission).

As in linux, the feature is not available by default and must be
enabled explicitly with tune2fs. We still do not support the
workarounds required in readdir for NFS.

Submitted by:	Zheng Liu
Tested by:	Mike Ma
Sponsored by:	Google Inc.
MFC after:	1 week
2013-07-06 18:28:06 +00:00
Xin LI
291a1934fa Update driver with recent vendor improvements, most notably support
of Skyhawk adapters.

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	"Duvvuru,Venkat Kumar" <VenkatKumar.Duvvuru Emulex.Com>
MFC after:	1 day
2013-07-06 08:30:45 +00:00
Xin LI
1fdeb1651c Import HighPoint DC Series Data Center HBA (DC7280 and R750) driver.
This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms.

Many thanks to HighPoint for providing this driver.

MFC after:	1 day
2013-07-06 07:49:41 +00:00
Konstantin Belousov
5af68df670 Remove unneeded page lock around vm_page_insert().
Submitted by:	alc
2013-07-06 04:46:42 +00:00
Rui Paulo
522b93a92a Don't clear the SYSCONFIG register on boot.
This follows section 18.4.2.2 SD Soft Reset Flow in the TI AM335x Technical
Reference Manual and seems to fix the "ti_mmchs0: Error: current cmd NULL,
already done?" messages.
2013-07-06 04:18:34 +00:00
Xin LI
abfdbca922 Refresh vendor driver version which fixes command queue
full issue with ARC-1214 and ARC-1224.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
MFC after:	1 day
2013-07-06 01:46:58 +00:00
Jamie Gritton
1e7df84305 Make the comments a little more clear about PRIV_KMEM_*, explicitly
referring to /dev/[k]mem and noting it's about opening the files rather
than actually reading and writing.

Reviewed by:	jmallett
2013-07-06 00:10:52 +00:00
Colin Percival
d36ed80a7b Fix typo: minmum -> minimum.
Submitted by:	@z3ndrag0n
2013-07-05 23:40:08 +00:00
Xin LI
e587249b7f Update hpt27xx(4) driver to address a problem reported by FreeNAS
user, where when more than one hpt27xx adapters are being used,
the "unit number" stays at 0.

Many thanks to HighPoint for providing this driver update.

MFC after:	1 day
2013-07-05 23:13:54 +00:00
Xin LI
bba8d13ed9 Add PCI IDs for HighPoint RocketRAID 4521, 3620, 3622 and 3640
controllers.  Update the hptiop(4) manual page to reflect this
as well as mentioning that some cards are already end-of-life.

Many thanks to Highpoint for providing this driver update.

MFC after:	1 day
2013-07-05 23:10:02 +00:00
Mark Johnston
46d27dbb38 Hide references to mod_lock. In FreeBSD it is always acquired with the
provider lock held, so its use has no effect.
2013-07-05 22:42:10 +00:00
Adrian Chadd
0933e74b10 Add a missing unlock. 2013-07-05 22:10:50 +00:00
Jamie Gritton
fd311def5b Bump up _PRIV_HIGHEST to account for PRIV_KMEM_READ/WRITE.
Submitted by:	mdf
2013-07-05 21:41:05 +00:00
Jamie Gritton
c71e336230 Add new privileges, PRIV_KMEM_READ and PRIV_KMEM_WRITE, used in opening
/dev/kmem and /dev/mem (in addition to traditional file permission checks).
PRIV_KMEM_READ is different from other PRIV_* checks in that it's allowed
by default.

Reviewed by:	kib, mckusick
2013-07-05 21:31:16 +00:00
Martin Matuska
12df7d65b0 MFV r252839:
Quoting illumos issue #3836:
  Currently zio_free() always puts the zio on a list for subsequent
  processing by zio_free_sync().  This is only necessary for frees that
  might need to issue reads (gang and dedup blocks).

  By processing the majority of the frees as we encounter them, we reduce
  the amount of time that the spa_sync() thread spends burning CPU and
  not doing any i/o, thus increasing the overall write throughput of the
  system.

Illumos ZFS issues:
  3836 zio_free() can be processed immediately in the common case

MFC after:	1 week
2013-07-05 21:29:59 +00:00
Andrew Turner
4bfe2da96a Fix the build with gcc.
Gcc outputs pre-UAL asm and expects the ldcl instruction with a condition
in the form ldc<c>l, where the code produces the instruction in the UAL
form ldcl<c>. Work around this by checking if we are using clang or gcc and
adjusting the instruction.

While here correct the cmp instruction's value to include the # before the
immediate value.
2013-07-05 20:21:59 +00:00
Aleksandr Rybalko
959631351b o Make fields names short.
o Slim down reg fields comments.
2013-07-05 13:37:57 +00:00
Michael Tuexen
ee1ccd9258 Fix a bug were only 2048 streams where usable even though more than
2048 streams were negotiated on the wire. While there, remove the
hard coded limit of 2048 streams.

MFC after: 3 days
2013-07-05 10:08:49 +00:00
Navdeep Parhar
3a760ee793 - Show the reason why link is down if this information is available.
- Display the temperature and PHY firmware version of the BT PHY.

MFC after:	1 day
2013-07-05 01:53:51 +00:00
Adrian Chadd
f8d390be65 Document the current 11n rate selection shortcoming in the AMRR code. 2013-07-05 00:03:53 +00:00
Navdeep Parhar
6eb3180fb2 - Make note of interface MTU change if the rx queues exist, and not just
when the interface is up.
- Add a tunable to control the TOE's rx coalesce feature (enabled by
  default as it always has been).  Consider the interface MTU or the
  coalesce size when deciding which cluster zone to use to fill the
  offload rx queue's free list.  The tunable is:
  dev.{t4nex,t5nex}.<N>.toe.rx_coalesce

MFC after:	1 day
2013-07-04 21:19:01 +00:00
Adrian Chadd
f8bf74f232 Implement basic 802.11n awareness in the PHY and AMRR rate control code.
* Add 802.11n 2ghz and 5ghz tables, including legacy rates and up to
  MCS23 rates (3x3.)

* Populate the rate code -> rate index lookup table with MCS _and_
  normal rates, but _not_ the basic rate flag.  Since the basic rate flag
  is the same as the MCS flag, we can only use one.

* Introduce some accessor inlines that do PLCP and rate table lookup/access
  and enforce that it doesn't set the basic rate bit.  They're not
  designed for MCS rates, so it will panic.

* Start converting drivers that use the rate table stuff to use the
  accessor inlines and strip the basic flag.

* Teach AMRR about basic 11n - it's still as crap for MCS as it is
  being used by iwn, so it's not a step _backwardS_.

* Convert iwn over to accept 11n MCS rates rather than 'translate' legacy
  to MCS rates.  It doesn't use a lookup table any longer; instead it's a
  function which takes the current node (for HT parameters) and the
  rate code, and returns the hardware PLCP code to use.

Tested:

* ath - it's a no-op, and it works that way
* iwn - both 11n and non-11n
2013-07-04 21:16:49 +00:00
Rui Paulo
2173825bac Set ic_cryptocaps to make sure wpa_supplicant works with WEP. 2013-07-04 20:57:15 +00:00
Navdeep Parhar
6300655cc1 On-the-fly changes to the interrupt coalescing timer should apply to the
TOE rx queues too.

MFC after:	1 day
2013-07-04 20:17:39 +00:00
Oleksandr Tymoshenko
179232d853 Add support for ePWM submodule of PWMSS
ePWM is controlled by sysctl nodes dev.am335x_pwm.N.period,
dev.am335x_pwm.N.dutyA and dev.am335x_pwm.N.dutyB that controls
PWM period and duty cycles for channels A and B respectively.

Period and duty cycle are measured in clock ticks. Default
clock frequency for AM335x PWM subsystem is 100MHz
2013-07-04 20:13:22 +00:00
Oleksandr Tymoshenko
ef2f66be5b Add nodes for PWMSS1 and PWMSS2 2013-07-04 20:08:42 +00:00
Michael Tuexen
5db47b3def When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related)
chunk, take always the T-bit into account, when checking the verification
tag.

MFC after: 3 days
2013-07-04 19:47:46 +00:00
Adrian Chadd
2fc5db16ed Enable the station-side power management flag.
It's not enabled by default in net80211 so this is a no-op unless
if you enable it (ifconfig wlan0 powersave).

Tested:

* iwn0: <Intel WiFi Link 5100> mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3

TODO:

* .. test on all the other NICs
* See if I have to disable it during scan and such
* Make it configurable live, rather than only after it's done its initial
  receive calibration.
2013-07-04 19:45:34 +00:00
Navdeep Parhar
50ce3d40aa Pay attention to TCP_NODELAY when it's set/unset after the connection
is established.

MFC after:	1 day
2013-07-04 19:44:30 +00:00
Navdeep Parhar
7e2fb22f81 Ring the egress queue's doorbell as soon as there are 8 or more
descriptors ready to be processed.

MFC after:	1 day
2013-07-04 19:15:41 +00:00
Konstantin Belousov
18a8d3d7f8 The tvp vnode on rename is usually unlinked. Drop the cached null
vnode for tvp to allow the free of the lower vnode, if needed.

PR:	kern/180236
Tested by:	smh
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-07-04 19:01:18 +00:00
Navdeep Parhar
054a2dc11c The T5 allows the driver to specify the ISS. Do so; use the ISS picked
by the kernel.

MFC after:	1 day
2013-07-04 18:41:21 +00:00
Mikolaj Golub
efdf104bca In r227207, to fix the issue with possible NULL inp_socket pointer
dereferencing, when checking for SO_REUSEPORT option (and SO_REUSEADDR
for multicast), INP_REUSEPORT flag was introduced to cache the socket
option.  It was decided then that one flag would be enough to cache
both SO_REUSEPORT and SO_REUSEADDR: when processing SO_REUSEADDR
setsockopt(2), it was checked if it was called for a multicast address
and INP_REUSEPORT was set accordingly.

Unfortunately that approach does not work when setsockopt(2) is called
before binding to a multicast address: the multicast check fails and
INP_REUSEPORT is not set.

Fix this by adding INP_REUSEADDR flag to unconditionally cache
SO_REUSEADDR.

PR:		179901
Submitted by:	Michael Gmelin freebsd grem.de (initial version)
Reviewed by:	rwatson
MFC after:	1 week
2013-07-04 18:38:00 +00:00
Bryan Venteicher
4d5919ec0b Merge virtio_scsi change from projects/virtio
r252680:
    Fix SIM lock not owned panic

    The CAM locking requirements of registering an async
    callback has changed so the SIM lock must be held. Remove
    code that explicitly dropped the lock around the register.

    Also return CAM_SEL_TIMEOUT instead of CAM_TID_INVALID
    for bad targets to avoid a lot console spam during bus
    scans.

MFC after:	1 month
2013-07-04 18:00:27 +00:00
Bryan Venteicher
62a69c4153 Merge virtio_pci changes from projects/virtio
This commit is primarily a significant cleanup to the interrupt
allocation code that had gotten a bit jumbled from having to
support per-vq MSIX, shared MSIX, MSI, and legacy style interrupts.

Contains projects/virtio commits:

r246064:
    virtio_pci: Rewrite allocation of interrupts
r246065:
    virtio_pci: Remove spaces before a tab
r246066:
    virtio_pci: Dynamically allocate the virtqueue array
r246304:
    virtio_pci: Clean up after failed virtqueue alloc attempt
r246305:
    virtio_pci: Move no interrupt check into the PCI interrupt handlers
r246308:
    virtio_pci: Remove unused variable

MFC after:	1 month
2013-07-04 17:59:09 +00:00
Bryan Venteicher
abd6790ce8 Merge virtio changes from projects/virtio
Contains projects/virtio commits:

r245738:
    virtio: Minor man page tweaks
r246060:
    virtio: Cleanup feature description printing
r246306:
    virtio: Remove old debugging flag
r247238:
    virtio: Remove PRIx64 macros from format strings
r247239:
    virtio: Constify some fields
r247240:
    virtio: Minor code simplifications
r249962:
    virtio: Update to my freebsd.org email address

MFC after:	1 month
2013-07-04 17:57:26 +00:00
Bryan Venteicher
3dd8d840ed Merge vtnet changes from projects/virtio
Minor changes to the network driver. A multiqueue driver that is
a significant rewrite will be in merged shortly.

Contains projects/virtio commits:

r246058:
    vtnet: Move an mbuf ASSERT to the calling function
r246059:
    vtnet: Tweak ASSERT message

MFC after:	1 month
2013-07-04 17:55:58 +00:00
Navdeep Parhar
c337fa30af - Read all TP parameters in one place.
- Read the filter mode, calculate various shifts, and use them
  properly during active open (in select_ntuple).

MFC after:	1 day
2013-07-04 17:55:52 +00:00
Bryan Venteicher
6f7e608220 Merge virtio_balloon changes from projects/virtio
Contains projects/virtio commits:

r245717:
    virtio_balloon: Make the softc lock a regular mutex
r245718:
    virtio_balloon: Remove two unuseful ASSERTs
r245719:
    virtio_balloon: More verbose ASSERT messages
r245720:
    virtio_balloon: Simplify lowmem handling in vtballoon_inflate()
r252530:
    virtio_balloon: Use just a kthread instead of dedciated kproc
r252568:
    virtio_balloon: Need to use kthread_exit() after r252530

MFC after:	1 month
2013-07-04 17:54:46 +00:00
Bryan Venteicher
118619ac60 Merge several virtio_blk changes from projects/virtio
The notable changes of this commit are support for disk resizing
and chases updates to the spec regarding write caching.

Contains projects/virtio commits:

r245713:
    virtio_blk: Replace __FUNCTION__ with __func__
r245714:
    virtio_blk: Use more consistent mutex name
r245715:
    virtio_blk: Print device name too if failed to reinit during dump
r245716:
    virtio_blk: Remove an unuseful ASSERT
r245723:
    virtio_blk: Record the vendor and device information
r245724:
    virtio_blk: Add resize support
r245726:
    virtio_blk: More verbose ASSERT messages
r245730:
    virtio_blk: Tweak resize announcement message
r246061:
    virtio_blk: Do not always read entire config
r246062:
    virtio_blk: Use topology to set the stripe size/offset
r246307:
    virtio_blk: Correct stripe offset calculation
r246063:
    virtio_blk: Add support for write cache enable feature
r246303:
    virtio_blk: Expand a comment
r252529:
    virtio_blk: Improve write cache handling
r252681:
    virtio_blk: Remove unneeded curly braces

MFC after:	1 month
2013-07-04 17:53:02 +00:00
Bryan Venteicher
6632efe40d Convert VirtIO to use ithreads instead of taskqueues
Contains projects/virtio commits:

r245709:
    Each VirtIO device was scheduling its own taskqueue(9) to do the
    off-level interrupt handling. ithreads(9) is the more nature way
    to do this. The primary motivation for this work to better support
    network multiqueue.
r245710:
    virtio: Change virtqueue intr handlers to return void
r245711:
    virtio_blk: Remove interrupt taskqueue
r245721:
    vtnet: Remove interrupt taskqueue
r245722:
    virtio_scsi: Remove interrupt taskqueue
r245747:
    vtnet: Remove taskqueue fields missed in r245721

MFC after:	1 month
2013-07-04 17:50:11 +00:00
Grzegorz Bernacki
fc4c2354ff Remove redundant clearing of the PGA_WRITEABLE flag in
pmap_remove_all()

This flag should already be cleared by pmap_nuke_pv()

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf
2013-07-04 10:40:24 +00:00
Grzegorz Bernacki
ad55cd76a6 Fix modified bit emulation for ARMv6/v7
When doing pmap_enter_locked(), enable write permission only when access
type indicates attempt to write. Otherwise, leave the page read only but
mark it writable in pv_flags.

This will result in:
1. Marking page writable during pmap_enter() but only when ensured that it
   will be written right away so that we will not get redundant permissions
   fault on write attempt.
2. Keeping page read only when it is permitted to be written but there was
   no actual write attempt. Hence, we will get permissions fault on write
   access and mark page writable in pmap_fault_fixup() what will indicate
   modification status.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf
2013-07-04 10:38:14 +00:00
Adrian Chadd
e243f3cef2 Oops - fix bad hint numbering for the ART section. 2013-07-04 08:42:20 +00:00
Adrian Chadd
eb12447d83 Add in a configuration file and hints for the Engenius ENH-200.
This is an AR7240 based device with an AR9285 on-board.

I've tested the initial boot and wifi support; however at the moment
the ethernet switch driver doesn't seem to be picking up carrier on the
active ethernet port. Basic flood pinging works however, so I think
we're on the right track.

Thank you to Adrian Woodley <adrian@diskworld.com.au> for purchasing me
one of these devices to bootstrap FreeBSD-HEAD on.
2013-07-04 08:13:14 +00:00
Adrian Chadd
eaa0f58f05 Add the missing link back to the EEPROM firmware name. 2013-07-04 08:09:54 +00:00
Jung-uk Kim
54eb21db1f Make it little bit more C++ friendly. This explicit casting fixes some
ports, emulators/virtualbox-ose and sysutils/smartmontools for example.
2013-07-04 05:58:53 +00:00
Alfred Perlstein
3eebd44d0c The change in r236456 (atomic_store_rel not locked) exposed a bug
in the ithread code where we could lose ithread interrupts if
intr_event_schedule_thread() is called while the ithread is already
running.  Effectively memory writes could be ordered incorrectly
such that the unatomic write of 0 to ithd->it_need (in ithread_loop)
could be delayed until after it was set to be triggered again by
intr_event_schedule_thread().

This was particularly a big problem for CAM because CAM optimizes
scheduling of ithreads such that it only signals camisr() when it
queues to an empty queue.  This means that additional completion
events would not unstick CAM and quickly lead to a complete lockup
of the CAM stack.

To fix this use atomics in all places where ithd->it_need is accessed.

Submitted by: delphij, mav
Obtained from: TrueOS, iXsystems
MFC After: 1 week
2013-07-04 05:53:05 +00:00
Rick Macklem
913df8fd72 A problem with the old NFS client where large writes to large files
would sometimes result in a corrupted file was reported via email.
This problem appears to have been caused by r251719 (reverting
r251719 fixed the problem). Although I have not been able to
reproduce this problem, I suspect it is caused by another thread
increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
updates to np->n_size, doing the vnode_pager_setsize() with the
mutex locked appears to avoid the problem.
Unfortunately, vnode_pager_setsize() where the new size is smaller,
cannot be called with a mutex held.
This patch returns the semantics to be close to pre-r251719 such that the
call to the vnode_pager_setsize() is only delayed until after the mutex is
unlocked when np->n_size is shrinking. Since the file is growing
when being written, I believe this will fix the corruption.

Reported by:	David G. Lawrence (dg@dglawrence.com)
Tested by:	David G. Lawrence (pending, to happen soon)
Reviewed by:	kib
MFC after:	1 week
2013-07-04 00:54:23 +00:00
Navdeep Parhar
f72b68a1bf - Include the T5 firmware with the driver.
- Update the T4 firmware to the latest.
- Minor reorganization and updates to the version macros, etc.

Obtained from:	Chelsio
MFC after:	1 day
2013-07-03 23:52:15 +00:00
Steven Hartland
8383a92e5b Bump disk(9) ABI version to signify the addition of d_delmaxsize by r249940.
Ensure that d_delmaxsize is always set, removing init to 0 which could cause
future issues if use cases change.

Allow kern.cam.da.X.delete_max (which maps to d_delmaxsize) to be increased
up to the calculated max after being reduced.

MFC after:	1 day
X-MFC-With: r249940
2013-07-03 23:46:30 +00:00
Neel Natu
6b5fbc1225 vm_phys_fictitious_reg_range() was losing the 'memattr' because it would be
reset by pmap_page_init() right after being initialized in vm_page_initfake().

The statement above is with reference to the amd64 implementation of
pmap_page_init().

Fix this by calling 'pmap_page_init()' in 'vm_page_initfake()' before changing
the 'memattr'.

Reviewed by:	kib
MFC after:	2 weeks
2013-07-03 23:38:37 +00:00
Oleksandr Tymoshenko
64cf3edab8 Fix one of INVARIANTS-related UMA panics on ARM
Force UMA zone to allocate service structures like slabs using own
allocator.  uma_debug code performs atomic ops on uma_slab_t fields
and safety of this operation is not guaranteed for write-back caches
2013-07-03 23:38:02 +00:00
Neel Natu
be28275d00 If a superpage mapping is being removed then we need to ignore the PG_PDE_PAT
bit when looking up the vm_page associated with the superpage's physical
address.

If the caching attribute for the mapping is write combining or write protected
then the PG_PDE_PAT bit will be set and thus cause an 'off-by-one' error
when looking up the vm_page.

Fix this by using the PG_PS_FRAME mask to compute the physical address for
a superpage mapping instead of PG_FRAME.

This is a theoretical issue at this point since non-writeback attributes are
currently used only for fictitious mappings and fictitious mappings are not
subject to promotion.

Discussed with:	alc, kib
MFC after:	2 weeks
2013-07-03 23:21:25 +00:00
Neel Natu
de16308c48 Verify that all bytes in the instruction buffer are consumed during decoding.
Suggested by:	grehan
2013-07-03 23:05:17 +00:00
Rui Paulo
8606701fc4 Increase the microcode max size to 16K to accomodate more recent Intel
firmware.
2013-07-03 20:29:15 +00:00
Peter Wemm
6c6f1f0185 Add an entry for filemon. 2013-07-03 20:22:12 +00:00
Peter Wemm
4271368368 Move static ZFS compile option to the other static file system options. 2013-07-03 20:21:39 +00:00
Rui Paulo
ecf28f6d07 Typos in comments. 2013-07-03 20:19:23 +00:00
Warren Block
9ce127ad76 Add descriptions to the FILES list, fix some mdoc complaints, move the
"neither" entry out of the table in BOOTING.

Submitted by:	joeld
Reviewed by:	joeld
MFC after:	1 week
2013-07-03 18:53:36 +00:00
Michael Tuexen
56f778aadf Code cleanups.
MFC after: 3 days
2013-07-03 18:48:43 +00:00
David C Somayajulu
bcafe87486 Port 0 needs to wait for ACK only if it issued the RESET. 2013-07-03 17:57:35 +00:00
Navdeep Parhar
e364d8c44a Catch up with r238990. LLE_DELETED does not clobber everything else in
la_flags since said revision.
2013-07-03 17:27:32 +00:00
John Baldwin
8f4c2e526b Don't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges. If
we are probing a PCI-PCI bridge it is because we found one by enumerating
the devices on a PCI bus, so the bridge is definitely present.  A few
BIOSes report incorrect status (_STA) for some bridges that claimed they
were not present when in fact they were.

While here, move this check earlier for Host-PCI bridges so attach fails
before doing any work that needs to be torn down.

PR:		kern/91594
Tested by:	Jack Vogel @ Intel
MFC after:	1 week
2013-07-03 17:26:05 +00:00
Alexander Motin
ce300fbfb7 Fix NULL-deference kernel panic on attempt of destroying non-existing
ramdisk-backed CTL LUN.
2013-07-03 14:58:11 +00:00
Davide Italiano
9e9421bcdf - Fix double frees/user after free.
- Allocate using smb_rq_alloc() instead of inlining it.

Reported by:	uqs
Found with:	Coverity Scan
2013-07-03 10:31:45 +00:00
Hiroki Sato
6facd7a6b8 Fix a compiler warning.
MFC after:	1 week
2013-07-03 07:31:07 +00:00
Rick Macklem
a820822ec8 A problem with the old NFS client where large writes to large files
would sometimes result in a corrupted file was reported via email.
This problem appears to have been caused by r251719 (reverting
r251719 fixed the problem). Although I have not been able to
reproduce this problem, I suspect it is caused by another thread
increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
updates to np->n_size, doing the vnode_pager_setsize() with the
mutex locked appears to avoid the problem.
Unfortunately, vnode_pager_setsize() where the new size is smaller,
cannot be called with a mutex held.
This patch returns the semantics to be close to pre-r251719 (actually
pre-r248567, r248581, r248567 for the new client) such that the call to
vnode_pager_setsize() is only delayed until after the mutex is
unlocked when np->n_size is shrinking. Since the file is growing
when being written, I believe this will fix the corruption.
A better solution might be to replace the mutex with a sleep lock,
but that is a non-trivial conversion, so this fix is hoped to be
sufficient in the meantime.

Reported by:	David G. Lawrence (dg@dglawrence.com)
Tested by:	David G. Lawrence (to be done soon)
Reviewed by:	kib
MFC after:	1 week
2013-07-03 00:19:03 +00:00
Kirk McKusick
3f8db5b147 Make better use of metadata area by avoiding using it for data blocks
that no should no longer immediately follow their indirect blocks.

MFC after:	2 weeks
2013-07-02 21:07:08 +00:00
Andrew Turner
4579f5e5c1 Enable VFP on Raspberry Pi. This has worked as of r251712. 2013-07-02 19:35:04 +00:00
Pedro F. Giffuni
5f3a9c4000 Style fix: spaces.
Cleanup the incomplete revert.

Reported by:	bde
MFC after:	4 weeks
2013-07-02 18:45:37 +00:00
Hiroki Sato
af8056441e - Allow ND6_IFF_AUTO_LINKLOCAL for IFT_BRIDGE. An interface with IFT_BRIDGE
is initialized with !ND6_IFF_AUTO_LINKLOCAL && !ND6_IFF_ACCEPT_RTADV
  regardless of net.inet6.ip6.accept_rtadv and net.inet6.ip6.auto_linklocal.
  To configure an autoconfigured link-local address (RFC 4862), the
  following rc.conf(5) configuration can be used:

   ifconfig_bridge0_ipv6="inet6 auto_linklocal"

- if_bridge(4) now removes IPv6 addresses on a member interface to be
  added when the parent interface or one of the existing member
  interfaces has an IPv6 address.  if_bridge(4) merges each link-local
  scope zone which the member interfaces form respectively, so it causes
  address scope violation.  Removal of the IPv6 addresses prevents it.

- if_lagg(4) now removes IPv6 addresses on a member interfaces
  unconditionally.

- Set reasonable flags to non-IPv6-capable interfaces. [*]

Submitted by:	rpaulo [*]
MFC after:	1 week
2013-07-02 16:58:15 +00:00
Hiroki Sato
e32d93954d Fix a panic when leaving MC group in a kernel with VIMAGE enabled.
in_leavegroup() is called from an asynchronous task, and
igmp_change_state() requires that curvnet is set by the caller.
2013-07-02 16:39:12 +00:00
Glen Barber
92994bd3ba - Update newvers.sh to include svn revision in uname(1) if the
system has svnliteversion.
- If svnliteversion is not found, look for svnversion in /usr/bin
  and /usr/local/bin, since svnlite can be installed as svn if
  WITH_SVN is set.[1]
- Remove /bin from binary search paths.[1]

Discussed with:	kib [1]
MFC after:	3 days
Approved by:	kib (mentor)
2013-07-02 10:36:57 +00:00
Lawrence Stewart
92a0637f73 Import an implementation of the CAIA Delay-Gradient (CDG) congestion control
algorithm, which is based on the 2011 v0.1 patch release and described in the
paper "Revisiting TCP Congestion Control using Delay Gradients" by David Hayes
and Grenville Armitage. It is implemented as a kernel module compatible with the
modular congestion control framework.

CDG is a hybrid congestion control algorithm which reacts to both packet loss
and inferred queuing delay. It attempts to operate as a delay-based algorithm
where possible, but utilises heuristics to detect loss-based TCP cross traffic
and will compete effectively as required. CDG is therefore incrementally
deployable and suitable for use on shared networks.

In collaboration with:	David Hayes <david.hayes at ieee.org> and
		Grenville Armitage <garmitage at swin edu au>
MFC after:	4 days
Sponsored by:	Cisco University Research Program and FreeBSD Foundation
2013-07-02 08:44:56 +00:00
Mateusz Guzik
a82a370603 Fix receiving fd over unix socket broken in r247740.
If n fds were passed, it would receive the first one n times.

Reported by:	Shawn Webb <lattera@gmail.com>, koobs, gleb
Tested by:	koobs, gleb
Reviewed by:	pjd
2013-07-02 07:36:04 +00:00
Hiroki Sato
52d5f34490 Add Planex MZK-UE150N.
Submitted by:	Yusuke Tanaka
MFC after:	3 days
2013-07-02 07:35:57 +00:00
Rui Paulo
463de68bf0 Fix indentation.
Submitted by:	jmallet
2013-07-02 07:17:56 +00:00
Rui Paulo
689b225721 Add register definitions for the Wii IPC system. 2013-07-02 06:59:37 +00:00
Rui Paulo
a5dcb0640f Add RealTek 8192SU product IDs. 2013-07-02 06:49:05 +00:00
Mark Johnston
0022f867b4 Be sure to destory the fasttrap cleanup mutex when unloading the fasttrap
module. This should be MFCed with r250953.
2013-07-01 23:12:59 +00:00
Warren Block
42c916d7ee Add a new gptboot(8) man page. Factor out the redundant information
in gpart(8) and boot(8), adding references to gptboot(8) in both.

Reviewed by:	jhb, ae, pjd, Paul Schenkeveld <bsdcan@psconsult.nl>, david_a_bright@dell.com (portions), gjb
MFC after:	1 week
2013-07-01 22:38:36 +00:00
Robert Millan
4310207e25 Wrap cxgbe declaration around MK_SOURCELESS_UCODE check 2013-07-01 22:21:42 +00:00
Pedro F. Giffuni
9a0aea4625 Change i_gen in UFS to an unsigned type.
Revert the simplification of the i_gen calculation.
It is still a good idea to avoid zero values and for the case
of old filesystems there is probably no advantage in using
the complete 32 bits anyways.

Discussed with:	bde
MFC after:	4 weeks
2013-07-01 21:43:40 +00:00
Rick Macklem
28be5427f1 A recent version of the oldnfs NFS client in head/current
will crash when doing a large write, since m_get2() would
return NULL. This patch fixes the problem, since nfsm_uiotombuf()
will allocate additional mbufs, as required.

Reported by:	sbruno
Tested by:	sbruno
Discussed with:	glebius
2013-07-01 21:16:19 +00:00
Peter Grehan
e60f5d779e Ignore guest PAT settings by default in EPT mappings.
From experimentation, other hypervisors also do this.

Diagnosed by:	tycho nightingale at pluribusnetworks com
Reviewed by:	neel
2013-07-01 20:05:43 +00:00
Michael Tuexen
004f2eb2c1 Enable SCTP, since it is also enabled on GENERIC and it works fine on
the Raspberry Pi.

Discussed with: rpaulo
2013-07-01 18:58:59 +00:00
Steven Hartland
5dd4da9f24 Remove forced timeout of in-flight commands from mfi_timeout.
While this prevents commands getting stuck forever there is no way to guarantee
that data from the command hasn't been committed to the device.

In addition older mfi firmware has a bug that would cause the controller to
frequently stall IO for over our timeout value, which when combined with
a forced timeout often resulted in panics in UFS; which would otherwise be
avoided when the command eventually completed if left alone.

For reference this timeout issue is resolved in Dell FW package 21.2.1-0000.
Fixed FW package version for none Dell controller will likely vary.

MFC after:	2 days
2013-07-01 17:57:22 +00:00
Navdeep Parhar
87c7afeb55 Add a sysctl to get the number of filters available.
sysctl dev.t4nex.<N>.nfilters
sysctl dev.t5nex.<N>.nfilters

MFC after:	3 days
2013-07-01 17:31:04 +00:00
Pedro F. Giffuni
bcb2f550be Change i_gen in UFS to an unsigned type.
Further simplify the i_gen calculation for older disks.
Having a zero here is not really a problem and this is more
similar to what is done in newfs_random().

Reported by:	Xin Li
MFC after:	4 weeks
2013-07-01 14:49:23 +00:00
Rui Paulo
95506b814d The mbox driver is actually MP safe, so set the right flag in
bus_setup_intr().
2013-07-01 06:33:35 +00:00
Rui Paulo
623b72a733 Disable debugging. 2013-07-01 06:32:56 +00:00
Rui Paulo
b7a6be5c7c Use the new FDT_FILE rpi.dts. 2013-07-01 05:01:27 +00:00
Rui Paulo
236bc8374d Split bcm2835-rpi-b.dts into bcm2835.dtsi and rpi.dts. This DTS actually works
on all R-Pi models because VideoCore binary patches it during boot.

Reviewed by:	gonzo
2013-07-01 05:01:01 +00:00