Commit Graph

84134 Commits

Author SHA1 Message Date
Marius Strobl
dcf47c2ba5 There's no need export the device interface methods of miibus(4). 2011-11-18 22:58:13 +00:00
Marius Strobl
99172ab4b8 - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY
addresses from being probed and attaching something including ukphy(4)
  to it. This is mainly necessarily for PHY switches that create duplicate
  or fake PHYs on the bus that can corrupt the PHY state when accessed or
  simply cause problems when ukphy(4) isolates the additional instances.
- Change miibus(4) to be a hinted bus, allowing to add child devices via
  hints and to set their attach arguments (including for automatically
  probed PHYs). This is mainly needed for PHY switches that violate IEEE
  802.3 and don't even implement the basic register set so we can't probe
  them automatically. However, the ability to alter the attach arguments
  for automatically probed PHYs is also useful as for example it allows
  to test (or tell a user to test) new variant of a PHY with a specific
  driver by letting an existing driver attach to it via manipulating the
  IDs without the need to touch the source code or to limit a Gigabit
  Ethernet PHY to only announce up to Fast Ethernet in order to save
  energy  by limiting the capability mask. Generally, a driver has to
  be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z"
  (which already is sufficient to add phydrvX at miibusY at PHY address
  Z). Then optionally the following attach arguments additionally can
  be configured:
  hint.phydrv.X.id1
  hint.phydrv.X.id2
  hint.phydrv.X.capmask
- Some minor cleanup.

Reviewed by:	adrian, ray
2011-11-18 22:39:46 +00:00
Marius Strobl
bab10b961f There's no need to read DC_10BTSTAT twice in dcphy_status(). 2011-11-18 21:23:13 +00:00
Marius Strobl
166e31d988 - There's no need to ignore the return value of mii_attach(9) when attaching
dcphy(4) (CID 9283).
- In dc_detach(), check whether ifp is NULL as dc_attach() may call the
  former without ifp being allocated (CID 4288).

Found with:	Coverity Prevent(tm)
2011-11-18 21:22:43 +00:00
Pyun YongHyeon
89b2411bc3 Partially revert r218788. r218788 removed calling dc_setcfg() for
!DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link
establishment of Intel 21143 with dcphy(4) where it stuck in
"ability detect" state without completing auto-negotiation.
Also nuke dc_if_media as it's not actually used.

Submitted by:	marius
2011-11-18 19:38:19 +00:00
Peter Holm
7bbcd22d38 Added check for negative seconds value. Found by syscall() fuzzing.
MFC after:	1 week
2011-11-18 19:14:42 +00:00
Jayachandran C.
c82deda35b Rearrange XLP configuration files.
Create std.XLP for configuration options, which is included by the
conf files. The files XLP, XLPN32 and XLP64 will have mostly ABI related
options.

Also move uart and pci to mips/nlm/std.xlp since all XLP configurations
needs these devices.

Obtained from:	prabhath at netlogicmicro com (intial version)
2011-11-18 11:18:59 +00:00
Philip Paeps
5bd64b65f9 Limit building sfxge(4) to amd64 only to unbreak the tinderboxen. The driver
should also work on (at least) i386 but hasn't been built/tested for a while.

MFC after:	3 weeks
2011-11-18 11:10:14 +00:00
Jayachandran C.
eeb41c230d Fix COP0 hazards for XLR and XLP
The XLR CPUs do not have any software visible hazards for COP0 operations.
On XLP the hazard is a ehb, since it is mips64r2.
2011-11-18 09:30:24 +00:00
Konstantin Belousov
7b5190779b Consistently use process spin lock for protection of the
p->p_boundary_count. Race could cause the execve(2) from the threaded
process to hung since thread boundary counter was incorrect and
single-threading never finished.

Reported by:	pluknet, pho
Tested by:	pho
MFC after:	1 week
2011-11-18 09:12:26 +00:00
Konstantin Belousov
dfdda19266 Use the alternate form of the gcc extension that works even with
-ansi -pedantic without issuing a warning, and which is recommended
by gcc manual.

MFC after:	1 week
2011-11-18 09:05:25 +00:00
Michael Tuexen
363114118b Cleanup comparison of interface names.
MFC after: 1 month.
2011-11-18 09:01:08 +00:00
Hans Petter Selasky
8c09f3a15f Make some XHCI command timeouts less strict.
Reported by:	Jan Henrik Sylvester
MFC after:	1 week
2011-11-18 08:31:24 +00:00
Peter Grehan
10b59a9b4a Import virtio base, PCI front-end, and net/block/balloon drivers.
Tested on Qemu/KVM, VirtualBox, and BHyVe.

Currently built as modules-only on i386/amd64. Man pages not yet hooked
up, pending review.

Submitted by:	Bryan Venteicher  bryanv at daemoninthecloset dot org
Reviewed by:	bz
MFC after:	4 weeks or so
2011-11-18 05:43:43 +00:00
Adrian Chadd
ef27340c5b Flesh out some slightly dirty reset/channel change serialisation code
for the ath(4) driver.

Currently, there's nothing stopping reset, channel change and general
TX/RX from overlapping with each other. This wasn't a big deal with
pre-11n traffic as it just results in some dropped frames.
It's possible this may have also caused some inconsistencies and
badly-setup hardware.

Since locks can't be held across all of this (the Linux solution)
due to LORs with the network stack locks, some state counter
variables are used to track what parts of the code the driver is
currently in.

When the hardware is being reset, it disables the taskqueue and
waits for pending interrupts, tx, rx and tx completion before
it begins the reset or channel change.

TX and RX both abort if called during an active reset or channel
change.

Finally, the reset path now doesn't flush frames if ATH_RESET_NOLOSS
is set. Instead, completed TX and RX frames are passed back up to
net80211 before the reset occurs.

This is not without problems:

* Raw frame xmit are just dropped, rather than placed on a queue.
  The net80211 stack should be the one which queues these frames
  rather than the driver.

* It's all very messy. It'd be better if these hardware operations
  were serialised on some kind of work queue, rather than hoping
  they can be run in parallel.

* The taskqueue block/unblock may occur in parallel with the
  newstate() function - which shuts down the taskqueue and restarts
  it once the new state is known. It's likely these operations should
  be refcounted so the taskqueue is restored once no other areas
  in the code wish to suspend operations.

* .. interrupt disable/enable should likely be refcounted as well.

With this work, the driver does not drop frames during stuck beacon
or fatal errors and thus 11n traffic continues to run correctly.
Default and full resets however do still drop frames and it's possible
this may occur, causing traffic loss and session stalls.

Sponsored by:	Hobnob, Inc.
2011-11-18 05:06:30 +00:00
Kevin Lo
41f1dccceb Add unicode support to msdosfs and smbfs; original pathes from imura,
bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>.

Tested by me in production for several days at work.
2011-11-18 03:05:20 +00:00
Eitan Adler
5d0d7ea8df - be more precise about the unit of measurement
Approved by:	jhb
MFC after:	3 days
2011-11-17 23:04:43 +00:00
Marius Strobl
dc1788e8b0 Implement prefetch_read_{many,once}() for sparc64 and fix compilation on
other !x86 architectures.
2011-11-17 22:59:16 +00:00
Marius Strobl
fb8ccc7840 Fix compilation on ILP32. 2011-11-17 22:56:40 +00:00
Pyun YongHyeon
d467ffaa66 Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.
H/W donated by:	RealTek Semiconductor Corp.
2011-11-17 22:07:50 +00:00
Pyun YongHyeon
6b0a8e0476 Add preliminary support for second generation RTL8105E PCIe
FastEthernet.

H/W donated by:	RealTek Semiconductor Corp.
2011-11-17 21:24:56 +00:00
Alexander Motin
4a612489cc Introduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode.
It blocks CAM SWI usage on requests completion, unneeded because of polling
and denied during kernel dumping because of blocked scheduler.

Before r198899 there was periph flag CAM_PERIPH_POLLED, but that was wrong,
because there is whole SIM is polled or handled by SWI, not a single periph.

Tested by:	kib
MFC after:	1 month
2011-11-17 21:07:56 +00:00
Alexander Motin
72a61203fc Change the way how "not implemented" AHCI channels handled. Instead of
completely skipping them, create ahcich devices for them to allocate unit
numbers, but mark them as disabled to prevent driver probe and attach.

Last time some BIOSes tend to report unused channels as "not implemented".
This change makes ahcichX devices numbering consistent, independently of
connected disks. It makes per-channel driver hints usable and CAM devices
wiring possible on such systems.
2011-11-17 20:46:51 +00:00
Marcel Moolenaar
1e6ca2a464 Wire the kernel text RWX, rather than RX. We're not quite ready
for having kernel text non-writable, because we still need to
apply relocations. On top of that, the PBVM page table has all
pages marked as RWX, so it's an inconsistency to begin with.
2011-11-17 15:51:03 +00:00
Nathan Whitehorn
a897298940 Use a global __pure2 function instead of a global register variable for
curthread, like on x86 and sparc64. This makes the kernel somewhat more
clang friendly, which doesn't support global register variables.
2011-11-17 15:49:42 +00:00
Nathan Whitehorn
46e93cbbc5 Add an extra invariant here which was useful on 64-bit CPUs. 2011-11-17 15:48:12 +00:00
Eitan Adler
f28cf62d17 - be more precise about the unit of measurement
Submitted by:	Oliver Pinter <oliver.pntr@gmail.com>
Approved by:	jhb
MFC after:	3 days
2011-11-17 15:46:37 +00:00
Jayachandran C.
cca2c4b446 Do pmap update only on active CPUs.
The pmap update_page/invalidate_page/invalidate_all operations has to be
done only on active cpus. In the simplest case, if the process is not
active on any other CPUs, we can just do the operation on the current CPU.

This change replaces the call to smp_rendezvous() for these operations with
smp_rendezvous_cpus() in case there more than one active CPU, or with a direct
function call if there is just one active CPU.

This change give significant performance increase in fork/exec benchmarks
on XLR/XLS/XLP with 32 cpus.

Reviewed by:	alc
2011-11-17 13:14:59 +00:00
Luigi Rizzo
68b8534bdf Bring in support for netmap, a framework for very efficient packet
I/O from userspace, capable of line rate at 10G, see

	http://info.iet.unipi.it/~luigi/netmap/

At this time I am bringing in only the generic code (sys/dev/netmap/
plus two headers under sys/net/), and some sample applications in
tools/tools/netmap. There is also a manpage in share/man/man4 [1]

In order to make use of the framework you need to build a kernel
with "device netmap", and patch individual drivers with the code
that you can find in

	sys/dev/netmap/head.diff

The file will go away as the relevant pieces are committed to
the various device drivers, which should happen in a few days
after talking to the driver maintainers.

Netmap support is available at the moment for Intel 10G and 1G
cards (ixgbe, em/lem/igb), and for the Realtek 1G card ("re").
I have partial patches for "bge" and am starting to work on "cxgbe".
Hopefully changes are trivial enough so interested third parties
can submit their patches. Interested people can contact me
for advice on how to add netmap support to specific devices.

CREDITS:
    Netmap has been developed by Luigi Rizzo and other collaborators
    at the Universita` di Pisa, and supported by EU project CHANGE
    (http://www.change-project.eu/)
    The code is distributed under a BSD Copyright.

[1] In my opinion is a bad idea to have all manpage in one directory.
  We should place kernel documentation in the same dir that contains
  the code, which would make it much simpler to keep doc and code
  in sync, reduce the clutter in share/man/ and incidentally is
  the policy used for all of userspace code.
  Makefiles and doc tools can be trivially adjusted to find the
  manpages in the relevant subdirs.
2011-11-17 12:17:39 +00:00
Rafal Jaworowski
a93c40bb62 Add DTS for the Freescale P2020DS.
Obtained from: Freescale
2011-11-17 12:08:12 +00:00
Hans Petter Selasky
b3f52c578b Quirk all of ALCOR's mass storage devices instead of
quirking individual devices.

Submitted by:	Dmitry Luhtionov
MFC after:	1 week
2011-11-17 10:46:51 +00:00
Alan Cox
5ff276b7f4 Eliminate end-of-line white space. 2011-11-17 06:54:49 +00:00
Pyun YongHyeon
017f1c8db9 Disable PCIe ASPM (Active State Power Management) for all
controllers.
More and more RealTek controllers started to implement EEE feature.
Vendor driver seems to load a kind of firmware for EEE with
additional PHY fixups.  It is known that the EEE feature may need
ASPM support.  Unfortunately there is no documentation for EEE of
the controller so enabling ASPM may cause more problems.
2011-11-16 23:29:27 +00:00
Pyun YongHyeon
600af6c29b Add missing driver lock in SIOCSIFCAP handler. 2011-11-16 22:09:14 +00:00
Pyun YongHyeon
d56f7f5284 Add preliminary support for RTL8411 PCIe Gigabit ethernet with
integrated card reader.

H/W donated by:	RealTek Semiconductor Corp.
2011-11-16 22:05:38 +00:00
Pawel Jakub Dawidek
d576deedb5 Constify arguments for locking KPIs where possible.
This enables locking consumers to pass their own structures around as const and
be able to assert locks embedded into those structures.

Reviewed by:	ed, kib, jhb
2011-11-16 21:51:17 +00:00
Pyun YongHyeon
a9e3362a07 Add preliminary support for RTL8402 PCIe FastEthernet with
integrated card reader.

H/W donated by:	RealTek Semiconductor Corp.
2011-11-16 21:37:45 +00:00
Pyun YongHyeon
355a415e92 Enable 64bit DMA addressing support for all msk(4) controllers.
Unnecessarily complex LE format used on Marvell controller was
main reason not to enable 64bit DMA addressing in driver.  If high
32bit address of DMA address of TX/RX buffer is changed, driver has
to generate a new LE.  In TX path, driver will keep track of lastly
used high 32bit address of DMA address and generate a new LE
whenever it sees high address change in the DMA address. In RX path,
driver will always use two LEs to specify 64bit DMA address of RX
buffer.  If the high 32bit address of DMA address of RX buffer is
the same as previous DMA address of RX buffer, driver does not have
to use two LEs but driver will use two LEs for simplicity in RX
ring management.

One of draw back for switching to 64bit DMA addressing is that the
large amount of LEs are used to specify 64bit DMA address such that
number of available LEs for TX/RX buffers are considerably reduced.
To mitigate the issue, increase number of available LEs from 256 to
384 for TX and from 256 to 512 for RX. For 32bit architectures,
msk(4) does not use 64bit DMA addressing to save resources.

Tested by:	das
2011-11-16 19:25:26 +00:00
Pawel Jakub Dawidek
a20358302f Constify stack argument for functions that don't modify it.
Reviewed by:	ed, kib, jhb
2011-11-16 19:06:55 +00:00
Pawel Jakub Dawidek
1859c4740e Fix make universe. 2011-11-16 18:42:43 +00:00
Konstantin Belousov
d185f187b4 The sys/sysctl.h header is needed when MFI_DEBUG is defined.
Nod from:	jhb
2011-11-16 18:42:39 +00:00
Konstantin Belousov
1fb5311e00 Fix build, use %d for int value formatting. 2011-11-16 18:41:59 +00:00
Philip Paeps
e948693ed7 Add the sfxge(4) device driver, providing support for 10Gb Ethernet adapters
based on Solarflare SFC9000 family controllers.  The driver supports jumbo
frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO),
Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side
Scaling (RSS) using MSI-X interrupts.

This work was sponsored by Solarflare Communications, Inc.

My sincere thanks to Ben Hutchings for doing a lot of the hard work!

Sponsored by:	Solarflare Communications, Inc.
MFC after:	3 weeks
2011-11-16 17:11:13 +00:00
Alan Cox
fbd80bd047 Refactor the code that performs physically contiguous memory allocation,
yielding a new public interface, vm_page_alloc_contig().  This new function
addresses some of the limitations of the current interfaces, contigmalloc()
and kmem_alloc_contig().  For example, the physically contiguous memory that
is allocated with those interfaces can only be allocated to the kernel vm
object and must be mapped into the kernel virtual address space.  It also
provides functionality that vm_phys_alloc_contig() doesn't, such as wiring
the returned pages.  Moreover, unlike that function, it respects the low
water marks on the paging queues and wakes up the page daemon when
necessary.  That said, at present, this new function can't be applied to all
types of vm objects.  However, that restriction will be eliminated in the
coming weeks.

From a design standpoint, this change also addresses an inconsistency
between vm_phys_alloc_contig() and the other vm_phys_alloc*() functions.
Specifically, vm_phys_alloc_contig() manipulated vm_page fields that other
functions in vm/vm_phys.c didn't.  Moreover, vm_phys_alloc_contig() knew
about vnodes and reservations.  Now, vm_page_alloc_contig() is responsible
for these things.

Reviewed by:	kib
Discussed with:	jhb
2011-11-16 16:46:09 +00:00
John Baldwin
d1c5fc763a Add single-message MSI support to mfi(4). It is disabled by default but
can be enabled via the hw.mfi.msi tunable.  Many mfi(4) controllers also
support MSI-X, but in testing it seems that many adapters do not work with
MSI-X but do work with MSI.

MFC after:	2 weeks
2011-11-16 15:39:27 +00:00
Peter Holm
50546f8ffe Handle invalid large values for getdirentries(2) data buffer size.
In collaboration with:	kib
Reviewed by:	des
Reported by:	The iknowthis syscall fuzzer.
MFC after:	1 week
2011-11-16 10:11:55 +00:00
Matt Jacob
7d3cea3137 Was chasing down a failure to load f/w on a 2400. It turns out that the card
is actually broken, or needs a BIOS upgrade for 64 bit loads, but this uncovered
a couple of misplaced opcode definitions and some missing continual mbox command
cases, so might as well update them here.
2011-11-16 02:52:24 +00:00
Bjoern A. Zeeb
dcc20f4b7f The maximum TSO frame size should be:
maximum IP datagram size (65535 bytes) +
	Ethernet header size (14 bytes) +
	2 * VLAN tag size (4 bytes) [1].

[1] We need to multiply by 2 to account for the double VLAN tag
    provision added in IEEE 802.1ad.

Submitted by:	David Somayajulu (david.somayajulu qlogic.com)
MFC after:	4 days
2011-11-16 02:00:55 +00:00
Rick Macklem
a5e583eea0 Modify the new NFS client so that nfs_fsync() only calls ncl_flush()
for regular files. Since other file types don't write into the
buffer cache, calling ncl_flush() is almost a no-op. However, it does
clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for
directories.

MFC after:	2 weeks
2011-11-15 23:35:43 +00:00
Hans Petter Selasky
96ef942084 Some brands of XHCI controllers needs more time to reset.
Reported by:	Jan Henrik Sylvester
MFC after:	1 week
2011-11-15 20:48:57 +00:00