Commit Graph

27553 Commits

Author SHA1 Message Date
Bryan Venteicher
2a87457c75 Increment the pending packets more aggressively for TSO
Assume the number of description used is reasonable value to
increment this otherwise opaque field by.

While here, reduce a minor difference between the legacy and
multiqueue transmit paths.

MFC after:	1 week
2014-06-20 02:54:04 +00:00
Bryan Venteicher
1204e3745a Handle multiple calls to rxq_eof for single packet completion
This requires the VMware vmxnet3 device to flip the start of packet
descriptor's generation before the rest of the packet's descriptors
have been loaded into the Rx ring. I've never observed this behavior,
and it seems to make the most sense not to do it this way. But it is
not a lot of work for the driver to handle this situation just in case.

MFC after:	1 week
2014-06-20 02:49:03 +00:00
Bryan Venteicher
d701c1992d Remove an unnecessary kick of the host at the end of transmitting
MFC after:	1 week
2014-06-20 02:31:52 +00:00
Alexander Kabaev
2d5d61a46d Set target->sbp field to valid value when sbp device is created.
The sbp_cam_detach_target can be called from sbp_post_explore function
on the first target that is not really attached and it was written with
the corresponding safety check in place to tolerate that. Unfortunately
the recent locking cleanup did add a locking assertion that tries to
dereference the target->sbp pointer unconditionally, which causes less
than desirable outcome. Since the assertion is useful, just initialize
the target sbp pointer once when sbp device is being initialized instead
of when the target is being attached. This makes assertion work in all
cases and fixes the crash on boot.
2014-06-20 01:45:03 +00:00
Attilio Rao
aa1cb7501f Following comments in r242565 add the possibility to specify ecx when
performing cpuid calls.
Add also a new way to specify the level type to cpucontrol(8) as
reported in the manpage.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	bdrewery, gcooper
Testerd by:	bdrewery
2014-06-19 21:54:41 +00:00
John Baldwin
2f951d2989 Trust the state of a power resource that get from a working _STA method
instead of trying to cache it.

Previously, we only trusted the state if we did not have a cached state.
However, once a state was cached, the _STA method was always ignored.
Specifically, once a power resource had been turned on once (e.g.
during resume), the driver assumed it was always on even if _STA said it
was off and never turned it back on.  This prevented the power resource
from being turned back on if a laptop was resumed twice, for example.

To fix, just remove the cached state entirely and always use the results
of _STA.  The loops already skip any resources where _STA fails.

Submitted by:	trasz (initial patch to invoke _ON)
MFC after:	1 week
2014-06-19 18:35:14 +00:00
Hans Petter Selasky
5098dbb20d Fix GCC compile warning: Variable(s) can be used uninitialized. 2014-06-19 05:10:03 +00:00
Aleksandr Rybalko
b229e4727b Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:30:22 +00:00
Aleksandr Rybalko
3fc3ca2652 Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:23:10 +00:00
Aleksandr Rybalko
c358638038 syscons(4) and vt(4) can be built together now.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:18:58 +00:00
Aleksandr Rybalko
a401c53acb Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:10:10 +00:00
Edward Tomasz Napierala
51be90b522 Implement redirection handling in initiator.
Sponsored by:	The FreeBSD Foundation
2014-06-18 17:35:40 +00:00
Navdeep Parhar
ccc69b2fa9 cxgbe(4): Fix bug in the fast rx buffer recycle path. In some cases rx
buffers were getting recycled when they should have been left alone.

MFC after:	3 days
2014-06-18 00:16:35 +00:00
John Baldwin
a2677ff239 Don't bother clearing maps for static DMA allocations to NULL. Instead,
leave them as purely opaque values that are only set by bus_dmamem_alloc().
2014-06-17 18:10:06 +00:00
John Baldwin
86843ea8de Fix various bugs with freeing static DMA allocations in sound drivers:
- Don't compare the DMA map to NULL to determine if bus_dmamap_unload()
  should be called when releasing a static allocation.  Instead, compare
  the bus address against 0.
- Don't assume that the DMA map for static allocations is NULL.  Instead,
  save the value set by bus_dmamem_alloc() so it can later be passed to
  bus_dmamem_free().  Also, add missing calls to bus_dmamap_unload() in
  these cases before freeing the buffer.
- Use the bus address from the bus_dma callback instead of calling
  vtophys() on the address allocated by bus_dmamem_alloc().

Reviewed by:	kan
2014-06-17 16:07:57 +00:00
John Baldwin
c34f1a08c6 Fix teardown of static DMA allocations in various NIC drivers:
- Add missing calls to bus_dmamap_unload() in et(4).
- Check the bus address against 0 to decide when to call
  bus_dmamap_unload() instead of comparing the bus_dma map against NULL.
- Check the virtual address against NULL to decide when to call
  bus_dmamem_free() instead of comparing the bus_dma map against NULL.
- Don't clear bus_dma map pointers to NULL for static allocations.
  Instead, treat the value as completely opaque.
- Pass the correct virtual address to bus_dmamem_free() in wpi(4) instead
  of trying to free a pointer to the virtual address.

Reviewed by:	yongari
2014-06-17 14:47:49 +00:00
Attilio Rao
3ae10f7477 - Modify vm_page_unwire() and vm_page_enqueue() to directly accept
the queue where to enqueue pages that are going to be unwired.
- Add stronger checks to the enqueue/dequeue for the pagequeues when
  adding and removing pages to them.

Of course, for unmanaged pages the queue parameter of vm_page_unwire() will
be ignored, just as the active parameter today.
This makes adding new pagequeues quicker.

This change effectively modifies the KPI.  __FreeBSD_version will be,
however, bumped just when the full cache of free pages will be
evicted.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	alc
Tested by:	pho
2014-06-16 18:15:27 +00:00
Roger Pau Monné
24f7e474cc xen: add missing files
Commit missing files that actually belong to previous commits.

Sponsored by: Citrix Systems R&D
Approved by: gibbs
2014-06-16 08:54:04 +00:00
Roger Pau Monné
a8f2f559f3 xen: unify gnttab initialization for PVHVM and PVH
Switch the initialization of gnttab to use an unused physical memory
range for both PVHVM and PVH.

In the past PVHVM was using the xenpci BAR, but there's no reason to
do that, and in fact FreeBSD was probably doing it because it was the
way it was done in Windows, were drivers cannot probably request for
unused physical memory ranges, but it was never enforced in the
hypervisor.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

xen/gnttab.c:
 - Allocate contiguous physical memory for grant table frames for both
   PVHVM and PVH.
 - Since gnttab is not a device, use the xenpv device in order to
   request for this allocation.

dev/xen/xenpci/xenpcivar.h:
dev/xen/xenpci/xenpci.c:
 - Remove the now unused xenpci_alloc_space and xenpci_alloc_space_int
   functions.

xen/gnttab.h:
 - Change the prototype of gnttab_init and gnttab_resume, that now
   takes a device_t parameter.

dev/xen/control/control.c:
x86/xen/xenpv.c:
 - Changes to accomodate the new prototype of gnttab_init and
   gnttab_resume.
2014-06-16 08:48:42 +00:00
Roger Pau Monné
bd851e636f xen: add shutdown hook for PVH
Add the PV shutdown hook to PVH.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

dev/xen/control/control.c:
 - Make xen_pv_shutdown_final available on XENHVM builds.
 - Register the Xen PV shutdown hook for PVH guests.
2014-06-16 08:46:31 +00:00
Roger Pau Monné
aa64d12bcd xen: introduce xenpv bus
Create a dummy bus so top level Xen devices can attach to it (instead
of attaching directly to the nexus). This allows to have all the Xen
related devices grouped under a single bus.

Sponsored by: Citrix Systems R&D
Approved by: gibbs

x86/xen/xenpv.c:
 - Attach the xenpv bus when running as a Xen guest.
 - Attach the ISA bus if needed, in order to attach syscons.

conf/files.amd6:
conf/files.i386:
 - Include the xenpv.c file in the build of i386/amd64 kernels using
   XENHVM.

dev/xen/console/console.c:
dev/xen/timer/timer.c:
xen/xenstore/xenstore.c:
 - Attach to the xenpv bus instead of the Nexus.

dev/xen/xenpci/xenpci.c:
 - Xen specific devices on PVHVM guests are no longer attached to the
   xenpci device, they are instead attached to the xenpv bus, remove
   the now unused methods.
2014-06-16 08:44:33 +00:00
Bryan Venteicher
bae486f5d7 Force two byte alignment for all control message headers
The header structure consists of two 1-byte elements, but it must always
be describable by a single SG entry. Note for consistency, specify the
alignment everywhere, even if the structure has the appropriate natural
alignment since it contains a uint16_t.

Obtained from:	DragonFlyBSD
MFC after:	1 week
2014-06-16 04:32:27 +00:00
Bryan Venteicher
fd5b395117 Make the feature negotiation code easier to follow
MFC after:	1 week
2014-06-16 04:29:28 +00:00
Bryan Venteicher
45543f0751 Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h
These defines are applicable to userland too, but virtqueue.h contains
the kernel virtqueue interface, and is therefore not usable in userland.

Note that Linux places these defines in virtio_ring.h, but I don't want
the drivers including this header file to keep the VirtIO ring opaque to
everything but the virtqueue.

MFC after:	1 week
2014-06-16 04:25:04 +00:00
Bryan Venteicher
e026de111e Remove kernel specific macro out of the VirtIO PCI header file
The eventual goal is to share this file with userland, so
remove the macro that is only specific for virtio_pci(4).
Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to
get the config size whether MSIX is enabled or not.

MFC after:	1 week
2014-06-16 04:16:31 +00:00
Bryan Venteicher
add526c613 - Remove two write-only local variables
- Remove unused element in the vtnet_rxq structure

MFC after:	1 week
2014-06-16 04:12:33 +00:00
Bryan Venteicher
9945063d70 Don't check the dma map address for a static DMA mapping against NULL
to determine if the mapping is valid.

Submitted by:	jhb
2014-06-14 23:36:17 +00:00
Adrian Chadd
43f2450f5d Shadow RAM support is apparently not at all working on the Intel 5300 Wifi.
Tested:

* Intel 5300 3x3 wifi
* Intel 5100
2014-06-14 06:54:03 +00:00
Xin LI
e1e766bcc4 Correct variable for loader tunable variable hw.mfi.mrsas_enable.
Submitted by:	Sascha Wildner (DragonFly)
MFC after:	3 days
2014-06-13 22:33:41 +00:00
John Baldwin
0f698bd800 - Don't check the dma map address for a static DMA mapping against NULL
to determine if the mapping is valid.
- Don't explicitly destroy the dmap map for static DMA mappings.

Reviewed by:	adrian
2014-06-13 19:40:02 +00:00
John Baldwin
8d461aafd8 Don't check maps for static DMA allocations against NULL to see if an
allocation succeeded.  Instead, check the tag against NULL.
2014-06-13 19:34:34 +00:00
John Baldwin
aced5239b2 Add missing calls to bus_dmamap_unload() when freeing static DMA
allocations.

Reviewed by:	scottl
2014-06-13 18:20:44 +00:00
John Baldwin
896ae82d59 Remove some Giant unlocks I missed in r267290. 2014-06-12 11:21:18 +00:00
John Baldwin
46e89834dc - Don't compare bus_dma map pointers for static DMA allocations against
NULL to determine if bus_dmamap_unload() or bus_dmamem_free() should be
  called.  Instead, check the associated bus and virtual addresses.
- Don't clear static DMA maps to NULL.

Reviewed by:	jfv
2014-06-12 11:15:19 +00:00
John Baldwin
9afa8f431f - Unmap static DMA buffers allocated via bus_dmemem_alloc() before
freeing them instead of after.
- Check the bus address of a static DMA buffer to decide if the associated
  map should be unloaded.
- Don't try to destroy bus dma maps for static DMA buffers.

Reviewed by:	davidcs
2014-06-11 20:46:23 +00:00
John Baldwin
aeeb653ce0 Unload maps for DMA buffers allocated via bus_dmamem_alloc() before
freeing the buffers.

Reviewed by:	davidcs
2014-06-11 20:44:02 +00:00
Xin LI
7634a04b30 Apply vendor fixes to the High Point drivers:
- Don't call xpt_free_path() in os_query_remove_device() and
   always return TRUE.
 - Update os_buildsgl() to support build logical SG table which
   will be used by lower RAID module.
 - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target
   missing.

Many thanks to HighPoint for providing this driver update.

Submitted by:	Steve Chang
Reviewed by:	mav
MFC after:	3 days
2014-06-11 18:24:51 +00:00
John Baldwin
5d00bfa3cd Fix a few more drivers that were explicitly destroying the bus_dma
map created by bus_dmamem_alloc().
2014-06-11 17:03:14 +00:00
John Baldwin
068d8643ad Fix various NIC drivers to properly cleanup static DMA resources.
In particular, don't check the value of the bus_dma map against NULL
to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded.
Instead, assume that bus_dmamap_load() succeeeded (and thus that
bus_dmamap_unload() should be called) if the bus address for a resource
is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus
that bus_dmamem_free() should be called) if the virtual address for a
resource is not NULL.

In many cases these bugs could result in leaks when a driver was detached.

Reviewed by:	yongari
MFC after:	2 weeks
2014-06-11 14:53:58 +00:00
Jim Harris
2efb5fb1ec Use bitwise OR instead of logical OR when constructing value for
SET_FEATURES/NUMBER_OF_QUEUES command.

Sponsored by:	Intel
MFC after:	3 days
2014-06-10 21:40:43 +00:00
John Baldwin
f07894dbde Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,
don't create a map before calling bus_dmamem_alloc() (such maps were
leaked).  It is believed that the extra destroy of the map was generally
harmless since bus_dmamem_alloc() often uses special maps for which
bus_dmamap_destroy() is a no-op (e.g. on x86).

Reviewed by:	scottl
2014-06-10 20:25:45 +00:00
Luigi Rizzo
63a3395e5d change the netmap mbuf destructor so the same code works also on FreeBSD 9.
For head and 10 this change has no effect, but on stable/9 it would cause
panics when using emulated netmap on top of a standard device driver.
2014-06-10 16:06:59 +00:00
Marius Strobl
cabe79d9d8 Avoid the USB device disconnected and controller shutdown clutter on system
shutdown by putting the former under !rebooting and turning the latter into
debug messages.

Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-06-10 08:20:00 +00:00
Bryan Venteicher
49d5172b34 Always append new bios to the tail of the queue, instead of sorting them
MFC after:	1 week
2014-06-10 03:29:15 +00:00
Ed Maste
4163c83ff6 Correct unicode map for VGA ROM character 0x0e
The character is a beamed pair of sixteenth notes, so should be U+266C
not U+266B (beamed eighth notes).
2014-06-10 01:19:48 +00:00
John Baldwin
238b419f41 Make the hpt27xx(4) driver MPSAFE.
- Use the existing vbus locks instead of Giant for the CAM sim lock.
- Use callout(9) instead of timeout(9).
- Mark the interrupt handler as MPSAFE.
- Don't attempt to pass data in the softc from probe() to attach().

Reviewed by:	Steve Chang <ychang@highpoint-tech.com>
Assisted by:	delphij
2014-06-09 18:15:05 +00:00
Luigi Rizzo
348c44a5be Fixes from Fanco Ficthner on transparent mode
* The way rings are updated changed with the last API bump.
  Also sync ->head when moving slots in netmap_sw_to_nic().

* Remove a crashing selrecord() call.

* Unclog the logic surrounding netmap_rxsync_from_host().

* Add timestamping to RX host ring.

* Remove a couple of obsolete comments.

Submitted by:	Franco Fichtner
MFC after:	3 days
Sponsored by:	Packetwerk
2014-06-09 15:46:11 +00:00
Luigi Rizzo
46aa1303f3 sync the code with the one in stable/10
(wrap the if_t compatibilty function into a __FreeBSD_version
conditional block)
2014-06-09 15:44:31 +00:00
Bryan Venteicher
e41318fc7b Fix TSO support on VMware Fusion
Apparently for VMware Fusion (and presumably VMware Workstation/Player
since the PR states TSO is broken there too, but I cannot test), the
TCP header pseudo checksum calculated should only include the protocol
(IPPROTO_TCP) value, not also the lengths as the stack does instead.

VMware ESXi seems to ignore whatever value is in the TCP header checksum,
and it is a bit surprising there is a different behavior between the
VMware products. And it is unfortunate that on ESXi we are forced to do
this extra bit of work.

PR:		kern/185849
MFC after:	3 days
2014-06-09 02:45:53 +00:00
Bryan Venteicher
75f4c88677 Remove an unnecessary variable reassignment
And it would be bad if 'm' was different from '*m0' at this
point, since we've already populated the SG list.

MFC after:	3 days
2014-06-09 02:39:05 +00:00