hselasky [Wed, 21 May 2014 16:52:55 +0000 (16:52 +0000)]
- Split transmit queue into one for each type. Apparently there will
be a race when using a single active queue for all transmit types.
- Last argument of usb_pause_mtx() is ticks and not milliseconds.
- Remove unused watchdog.
- Remove some unused fields from the RSU softc structure.
- Workaround usbd_transfer_start() recursion from inside of completion
callback.
hrs [Wed, 21 May 2014 10:04:51 +0000 (10:04 +0000)]
- Fix a bug which can make sysctl() fail when -F is specified.
- Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because
we have interfaces with longer names than 6 chars like epairN{a,b}.
- Style fixes.
hselasky [Wed, 21 May 2014 09:26:02 +0000 (09:26 +0000)]
- Replace some constants with macros.
- Need to set the pre-fetch memory address when reading the host memory.
- We currently assume that no endianness conversion is needed.
bjk [Wed, 21 May 2014 03:11:27 +0000 (03:11 +0000)]
Check for mismatched vref()/vdrop()
Assert that the hold count has not fallen below the use count, a situation
that would only happen when a vref() (or similar) is erroneously paired
with a vdrop(). This situation has not been observed in the wild, but
could be helpful for someone implementing a new filesystem.
scottl [Tue, 20 May 2014 22:43:17 +0000 (22:43 +0000)]
Old PCIe implementations cannot allow a DMA transfer to cross a 4GB
boundary. This was addressed several years ago by creating a parent
tag hierarchy for the root buses that set the boundary restriction
for appropriate buses and allowed child deviced to inherit it.
Somewhere along the way, this restriction was turned into a case for
marking the tag as a candidate for needing bounce buffers, instead
of just splitting the segment along the boundary line. This flag
also causes all maps associated with this tag to be non-NULL, which
in turn causes bus_dmamap_sync() to take the slow path of function
pointer indirection to discover that there's no bouncing work to
do. The end result is a lot of pages set aside in bounce pools
that will never be used, and a slow path for data buffers in nearly
every DMA-capable PCIe device. For example, our workload at Netflix
was spending nearly 1% of all CPU time going through this slow path.
Fix this problem by being more selective about when to set the
COULD_BOUNCE flag. Only set it when the boundary restriction
exists and the consumer cannot do more than a single DMA segment
at once. This fixes the case of dynamic buffers (mbufs, bio's)
but doesn't address static buffers allocated from bus_dmamem_alloc().
That case will be addressed in the future.
For those interested, this was discovered thanks to Dtrace Flame
Graphs.
Discussed with: jhb, kib
Obtained from: Netflix, Inc.
MFC after: 3 days
neel [Tue, 20 May 2014 20:30:28 +0000 (20:30 +0000)]
Add PG_RW check when translating a guest linear to guest physical address.
Set the accessed and dirty bits in the page table entry. If it fails then
restart the page table walk from the beginning. This might happen if another
vcpu modifies the page tables simultaneously.
sjg [Tue, 20 May 2014 18:25:46 +0000 (18:25 +0000)]
Use an intermediate target to associate with _SUBDIR which is marked .MAKE
this allows make -n to do tree walks as expected without
doing anything else (as intended).
Use prefix _sub. to help avoid conflict with any real target.
hselasky [Tue, 20 May 2014 14:15:03 +0000 (14:15 +0000)]
Correct some programming details. The layout of the PDTs were
different from what was initially thought. Fix re-programming of
hardware mode register after reset.
kib [Tue, 20 May 2014 09:19:35 +0000 (09:19 +0000)]
When exec_new_vmspace() decides that current vmspace cannot be reused
on execve(2), it calls vmspace_exec(), which frees the current
vmspace. The thread executing an exec syscall gets new vmspace
assigned, and old vmspace is freed if only referenced by the current
process. The free operation includes pmap_release(), which
de-constructs the paging structures used by hardware.
If the calling process is multithreaded, other threads are suspended
in the thread_suspend_check(), and need to be unsuspended and run to
be able to exit on successfull exec. Now, since the old vmspace is
destroyed, paging structures are invalid, threads are resumed on the
non-existent pmaps (page tables), which leads to triple fault on x86.
To fix, postpone the free of old vmspace until the threads are resumed
and exited. To avoid modifications to all image activators all of
which use exec_new_vmspace(), memoize the current (old) vmspace in
kern_execve(), and notify it about the need to call vmspace_free()
with a thread-private flag TDP_EXECVMSPC.
http://bugs.debian.org/743141
Reported by: Ivo De Decker <ivo.dedecker@ugent.be> through secteam
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
grehan [Tue, 20 May 2014 02:59:13 +0000 (02:59 +0000)]
Bump bhyve allocation up to 20 bits to avoid
birthday-paradox style address collisions when
bhyve VMs are connected to the same broadcoast
domain and are using pseudo-random allocations.
sjg [Mon, 19 May 2014 19:08:46 +0000 (19:08 +0000)]
_SUBDIR is marked .MAKE - since it runs a sub-make.
Targets thus marked are supposed to run even with -n.
As such they should not do anything except run the sub-make.
Use an intermediate target _* to associate with _SUBDIR and which
depends on installincludes etc so that we get the correct behavior with -n.
ae [Mon, 19 May 2014 16:05:42 +0000 (16:05 +0000)]
We have two functions from where a geom orphan method could be called:
g_orphan_register and g_resize_provider_event. Both are called from the
event queue. Also we have GEOM_DEV class, which does deferred destroy
for its consumers via g_dev_destroy (also called from the event queue).
So it is possible, that for some consumers an orphan method will be
called twice. This triggers panic in g_dev_orphan.
Check that consumer isn't already orphaned before call orphan method.
truckman [Mon, 19 May 2014 04:44:27 +0000 (04:44 +0000)]
Slightly restructure the final loop in rman_reserve_resource_bound().
Replace with the existing loop termination test with a similar
condition from the nested "if" that may terminate the loop a bit
sooner, but still not too early. This condition can then be removed
from the nested "if". Relocate an operator to be style(9) compliant.
jfv [Mon, 19 May 2014 01:21:02 +0000 (01:21 +0000)]
This is the beta release of the driver for the new
Intel 40G Ethernet Controller XL710 Family. This is
the core driver, a VF driver called i40evf, will be
following soon. Questions or comments to myself or
my co-developer Eric Joyner. Cheers!
adrian [Sun, 18 May 2014 22:32:04 +0000 (22:32 +0000)]
Add a new function to do a CPU ID lookup based on RSS hash information.
This is intended to be used by various places that wish to hash some
information about a TCP/UDP/IP flow but don't necessarily have a
live mbuf to do it with.
Refactor rss_m2cpuid() to use the refactored function.
bjk [Sun, 18 May 2014 21:05:54 +0000 (21:05 +0000)]
Document some user-settable make variables in ports.7
This is not a comprehensive list, as the variables themselves are spread
out over multiple files, but it is a start.
Add a section to make.conf noting that variables may be set there that
affect ports builds, but refer to ports.7 and elsewhere for the actual
listing; any listing in make.conf.5 would likely become out of date
fairly quickly.
ae [Sun, 18 May 2014 14:25:19 +0000 (14:25 +0000)]
Since ipfw nat configures all options in one step, we should set all bits
in the mask when calling LibAliasSetMode() to properly clear unneeded
options.
hselasky [Sun, 18 May 2014 09:13:29 +0000 (09:13 +0000)]
- Add softc pointer argument to FIFO functions as an optimisation.
- Implement support for interrupt filters in the DWC OTG driver, to
reduce the amount of CPU task switching when only feeding the FIFOs.
- Add common spinlock to the USB bus structure.
grehan [Sun, 18 May 2014 03:50:17 +0000 (03:50 +0000)]
Make the vmx asm code dtrace-fbt-friendly by
- inserting frame enter/leave sequences
- restructuring the vmx_enter_guest routine so that it subsumes
the vm_exit_guest block, which was the #vmexit RIP and not a
callable routine.
imp [Sat, 17 May 2014 20:31:40 +0000 (20:31 +0000)]
Move inclusion of /etc/make.conf and others to old location (this also
moves local.sys.mk). The new location broke adding things to CXXFLAGS
in /etc/src.conf with +=. Move it back until that's sorted out...
imp [Sat, 17 May 2014 20:31:34 +0000 (20:31 +0000)]
The time is not yet ripe to break the lack of dependencies between
src/sys and the rest of the tree for builds.
o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk
o No need to include src.opts.mk at all anymore. The reasons for it
are now coverted in sys.mk and src.sys.mk.
jhb [Sat, 17 May 2014 16:11:06 +0000 (16:11 +0000)]
Use 'RESOURCE' instead of the more generic 'TYPE' for the resource name
column header when displaying resource usage. This more closely matches
other procstat displays.
melifaro [Sat, 17 May 2014 13:45:03 +0000 (13:45 +0000)]
Fix wrong formatting of 0.0.0.0/X table records in ipfw(8).
Add `flags` u16 field to the hole in ipfw_table_xentry structure.
Kernel has been guessing address family for supplied record based
on xent length size.
Userland, however, has been getting fixed-size ipfw_table_xentry structures
guessing address family by checking address by IN6_IS_ADDR_V4COMPAT().
Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records.
glebius [Sat, 17 May 2014 12:30:27 +0000 (12:30 +0000)]
o In pf_normalize_ip() we don't need mtag in
!(PFRULE_FRAGCROP|PFRULE_FRAGDROP) case.
o In the (PFRULE_FRAGCROP|PFRULE_FRAGDROP) case we should allocate mtag
if we don't find any.
andrew [Sat, 17 May 2014 11:27:36 +0000 (11:27 +0000)]
Add the start of the ARM platform code. This is based on the PowerPC
platform code, it is expected these will be merged in the future when the
ARM code is more complete.
Until more boards can be tested only use this with the Raspberry Pi and
rrename the functions on the other SoCs.
jhb [Sat, 17 May 2014 03:54:51 +0000 (03:54 +0000)]
- Add support for dumping current resource usage for processes via a new -r
flag to procstat.
- Add an -H flag to request information about threads rather than processes
when dumping statistics. Currently it is only used for -r to display
resource usage for individual threads instead of the entire process.
Reviewed by: kib (older version without -H)
MFC after: 1 month
jhb [Sat, 17 May 2014 02:45:04 +0000 (02:45 +0000)]
Clear the data buffer length field when freeing a command structure so that
it doesn't leak through when the command structure is reused for a user
command without a data buffer.
PR: amd64/189668
Tested by: Pete Long <pete@nrth.org>
MFC after: 1 week
imp [Sat, 17 May 2014 01:47:06 +0000 (01:47 +0000)]
Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.
These are intended to fetch the current flow id, flow hash type
(M_HASHTYPE_* from the sys/mbuf.h) and if RSS is enabled, the
RSS destined CPU ID for the receive path.
hrs [Fri, 16 May 2014 15:53:31 +0000 (15:53 +0000)]
Cancel DAD for an ifa when the ifp has ND6_IFF_IFDISABLED as early as
possible and do not clear IN6_IFF_TENTATIVE. If IFDISABLED was accidentally
set after a DAD started, TENTATIVE could be cleared because no NA was
received due to IFDISABLED, and as a result it could prevent DAD when
manually clearing IFDISABLED after that.
hrs [Fri, 16 May 2014 14:48:21 +0000 (14:48 +0000)]
Move configuration of IPv6 NDP flags to a point before handling ifconfig_IF.
This fixes a race that a non-IPv4 interface can get an EUI64 LLA even if it
has IFDISABLED nd6 flag at boot time.
hselasky [Fri, 16 May 2014 10:35:21 +0000 (10:35 +0000)]
- Add flattended device tree probe-, attach- and detach code for the
SAF1761 driver, compatible to existing Linux based FDT tables for the
same hardware.