kib [Wed, 18 Mar 2015 22:05:15 +0000 (22:05 +0000)]
Cosmetics:
- Move to ANSI definitions syntax, removing warnings about type promotions.
- Remove __P().
- Staticise everything.
- Remove warnings about unused args for signal handlers.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
ken [Wed, 18 Mar 2015 20:54:54 +0000 (20:54 +0000)]
Improve the mt(1) rblim display.
The granularity reported by READ BLOCK LIMITS is an exponent, not a
byte value. So a granularity of 0 means 2^0, or 1 byte. A
granularity of 1 means 2^1, or 2 bytes.
Print out the individual block limits on separate lines to improve
readability and avoid exceeding 80 columns.
usr.bin/mt/mt.c:
Fix and improve the 'mt rblim' output. Add a MT_PLURAL()
macro so we can print "byte" or "bytes" as appropriate.
ken [Wed, 18 Mar 2015 20:52:34 +0000 (20:52 +0000)]
Fix a couple of problems in the sa(4) media type reports.
The only drives I have discovered so far that support medium type
reports are newer HP LTO (LTO-5 and LTO-6) drives. IBM drives
only support the density reports.
sys/cam/scsi/scsi_sa.h:
The number of possible density codes in the medium type
report is 9, not 8. This caused problems parsing all of
the medium type report after this point in the structure.
usr.bin/mt/mt.c:
Run the density codes returned in the medium type report
through denstostring(), just like the primary and secondary
density codes in the density report. This will print the
density code in hex, and give a text description if it
is available.
Thanks to Rudolf Cejka for doing extensive testing with HP LTO drives
and Bacula and discovering these problems.
Tested by: Rudolf Cejka <cejkar at fit.vutbr.cz>
Sponsored by: Spectra Logic
MFC after: 4 days
jhb [Wed, 18 Mar 2015 14:51:03 +0000 (14:51 +0000)]
Clear an mbuf's external storage flags in m_extaddref(). They are cleared
in other places that set the external storage type (ext_type) such as
m_cljset(), m_extadd(), mb_ctor_clust(), and vn_sendfile().
hselasky [Wed, 18 Mar 2015 10:49:17 +0000 (10:49 +0000)]
Fix problems about 32-bit ticks wraparound and unsigned long
conversion:
- The linux compat API layer casts the ticks to unsigned long which
might cause problems when the ticks value is negative.
- Guard against already expired ticks values, by checking if the
passed expiry tick is already elapsed.
- While at it avoid referring the address of an inlined function.
MFC after: 3 days
Sponsored by: Mellanox Technologies
jfv [Tue, 17 Mar 2015 22:40:50 +0000 (22:40 +0000)]
Resolve a few build issues, add module directories back into Makefile,
then correct a NETMAP problem resulting from the split, and finally
temporarily disable the X550 functionality.
kib [Tue, 17 Mar 2015 22:00:11 +0000 (22:00 +0000)]
When initial placement of the new entry crosses the boundary,
allocator tries to move the entry up, after the boundary. The new
location may still fail to satisfy boundary requirement, for instance,
if the boundary is set to page size, and allocation is of multiple
pages.
Recheck that boundary is not crossed after the move. If it is
crossed, give up on allocating the whole entry and split it.
Reported by: Michael Fuckner <michael@fuckner.net>, running nvme(4)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kib [Tue, 17 Mar 2015 21:55:33 +0000 (21:55 +0000)]
When inserting new entry into the address map, ensure that not only
next entry does not intersect with the tail of the new entry, but also
that previous entry is also before new entry start.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
ian [Tue, 17 Mar 2015 21:15:24 +0000 (21:15 +0000)]
Fix fdt_platform_fixups() mem region handling. It turns out u-boot puts
several types of data into the mem-info array (DRAM, SRAM, flash). We
need to extract just the DRAM entries for translation into fdt memory
properties.
Also, increase the number of regions we can handle from 5 to 16.
ian [Tue, 17 Mar 2015 21:00:31 +0000 (21:00 +0000)]
The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that.
Values smaller than two lead to strange asserts that have nothing to do
with the actual problem (in the case of size=0), or to writing beyond the
end of the allocated buffer in sbuf_finish() (in the case of size=1).
glebius [Tue, 17 Mar 2015 19:19:19 +0000 (19:19 +0000)]
o Enhance vm_pager_free_nonreq() function:
- Allow to call the function with vm object lock held.
- Allow to specify reqpage that doesn't match any page in the region,
meaning freeing all pages.
o Utilize the new function in couple more places in vnode pager.
zbb [Tue, 17 Mar 2015 18:59:47 +0000 (18:59 +0000)]
Introduce Annapurna Labs AHCI support
Overview:
* implemented quirk for forcing SATA interface enable
* restore value to status register - this enables link autonegotiation
Modifications:
* devid:vendorid field
* quirk for forcing PI setting (BIOS is doing that on PC-like systems)
* write to capabilites field to enable phy link initialization
dumbbell [Tue, 17 Mar 2015 18:50:33 +0000 (18:50 +0000)]
drm: Update the device-independent code to match Linux 3.8.13
This update brings few features:
o Support for the setmaster/dropmaster ioctls. For instance, they
are used to run multiple X servers simultaneously.
o Support for minor devices. The only user-visible change is a new
entry in /dev/dri but it is useless at the moment. This is a
first step to support render nodes [1].
The main benefit is to greatly reduce the diff with Linux (at the
expense of an unreadable commit diff). Hopefully, next upgrades will be
easier.
No updates were made to the drivers, beside adapting them to API
changes.
jfv [Tue, 17 Mar 2015 18:32:28 +0000 (18:32 +0000)]
Update to the Intel ixgbe driver:
- Split the driver into independent pf and vf loadables. This is
in preparation for SRIOV support which will be following shortly.
This also allows us to keep a seperate revision control over the
two parts, making for easier sustaining.
- Make the TX/RX code a shared/seperated file, in the old code base
the ixv code would miss fixes that went into ixgbe, this model
will eliminate that problem.
- The driver loadables will now match the device names, something that
has been requested for some time.
- Rather than a modules/ixgbe there is now modules/ix and modules/ixv
- It will also be possible to make your static kernel with only one
or the other for streamlined installs, or both.
bdrewery [Tue, 17 Mar 2015 15:16:36 +0000 (15:16 +0000)]
Add LIB_CXX so that C++ libraries will use CXX to link.
This fixes C++ libraries not implicitly linking in libc++. This is
generally not an issue because the final linking with the compiled binary
will involve CXX via PROG_CXX or other means. It is however
inconsistent with libraries implicitly linking in libc and problematic
for trying to build libraries with '-z defs' to ensure all direct
dependencies are linked in.
libatf-c++ is currently the only consumer of this new feature.
feld [Tue, 17 Mar 2015 12:40:33 +0000 (12:40 +0000)]
Use 24h timestamps in the ps(1) STARTED column
The previous 12h AM/PM format was perplexing as it didn't follow the
locale of the user and was a minor annoyance to FreeBSD users coming
from Linux. Additionally, the man page was incorrect about the strftime
format.
There are three time formats that may be displayed in the STARTED
column depending on the age of the process. Below is an example.
For a process started at 14:30 on Monday 16 March 2015, the following
formats may be used:
14:30 for process < 24h old (24h Timestamp)
Mon14 for process > 24h, < 1 week old (Weekday Hour)
16Mar15 for process > 1 week old (Day Month Year)
arybchik [Tue, 17 Mar 2015 08:23:15 +0000 (08:23 +0000)]
sfxge: prefetch txq->common if TxQ is started only
Transmit may be called when TxQ is not started yet (i.e. txq->common is
invalid). TxQ state is checked below when mbuf is processed and dropped
if TxQ is not started.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
ian [Mon, 16 Mar 2015 21:09:11 +0000 (21:09 +0000)]
Fix minor fallout from sysctl strings being nulterminated now. The dmesg
code can read the buffer via sysctl or from a core file. In the core file
case there will be no nulterm, and the code copes with that, but now in the
sysctl case there is a nulterm (there didn't used to be). The least
disruptive way to restore the old behavior (and eliminate a spurious '\000'
at the end of the output) is to remove the nulterm (by decrementing the
buffer length) in the sysctl case.
ian [Mon, 16 Mar 2015 19:29:19 +0000 (19:29 +0000)]
Trivial change / forced-commit to document prior change that slipped in
without a commit message...
Use sbuf_new() + SYSCTL_OUT() instead of wiring the userland buffer and
using sbuf_new_for_sysctl(). The preallocated 256 byte buffer is always
going to be big enough to hold these results, and this should be more
efficient than wiring the old buffer.
ian [Mon, 16 Mar 2015 17:45:41 +0000 (17:45 +0000)]
Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag. If
INCLUDENUL is set and sbuf_finish() has been called, the length has been
incremented to count the nulterm byte, and in that case current length is
allowed to be equal to buffer size, otherwise it must be less than.
Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to
be consistant with the style in the rest of this file.
rwatson [Mon, 16 Mar 2015 17:42:53 +0000 (17:42 +0000)]
Introduce a cap_ioctl_t used for the 'cmds' arguments to cap_ioctls_limit()
and cap_ioctls_get(). On FreeBSD, these are 'unsigned long', but on Linux,
ioctl(2) takes an 'int', making mild abstraction desirable.
nwhitehorn [Mon, 16 Mar 2015 16:29:33 +0000 (16:29 +0000)]
Convert PTE eviction lock from an RW lock to a RM lock. It is held for
writing approximately never (< 0.00000001% under heavy VM load, and it can
go for months without ever being acquired in normal operation). This
provides a 10% (2-minute) improvement in wall clock time for make -j32
buildworld on a 4-core 32-thread POWER8.
jhb [Mon, 16 Mar 2015 15:56:06 +0000 (15:56 +0000)]
Move special DDP handling for closing a connection into a new
handle_ddp_close() function in t4_ddp.c as the logic is similar
to handle_ddp_data(). This allows all knowledge of the special
DDP mbufs to be private to t4_ddp.c as well.
mav [Mon, 16 Mar 2015 11:57:03 +0000 (11:57 +0000)]
Report ARAT (APIC-Timer-always-running) feature for virtual CPU.
This makes FreeBSD guest to not avoid using LAPIC timer, preferring HPET
due to worries about non-existing for virtual CPUs deep sleep states.
Benchmarks of usleep(1) on guest and host show such extra latencies:
- 51us for virtual HPET,
- 22us for virtual LAPIC timer,
- 22us for host HPET and
- 3us for host LAPIC timer.
markj [Mon, 16 Mar 2015 01:15:08 +0000 (01:15 +0000)]
Remove unused upstream DTrace provider implementations that are duplicates
of providers under sys/cddl/dev/. Also remove sdt_subr.c, which isn't used
in FreeBSD's SDT implementation.
mjg [Mon, 16 Mar 2015 01:09:49 +0000 (01:09 +0000)]
proc: get rid of proc lock + unlock pair in proc_reap
A comment in the code stated we PROC_LOCK and as a side effect guarantee
all writers released process lock. But at that point such lock was already
taken while we were removing the process from all lists, so it should be already
unreachable.
adrian [Sun, 15 Mar 2015 21:56:12 +0000 (21:56 +0000)]
Start fleshing out some MAC address helper functions.
A lot of these embedded boards don't have a unique MAC address per
device stored somewhere unique - sometimes they'll have one MAC
for both arge NICs; someties they'll have one MAC for both arge NICs
/and/ the ath NICs. In these instances, we need to derive device
specific MAC addresses from the base MAC address.
These functions will be used by some follow-up code that'll slot
into if_arge and if_ath.
adrian [Sun, 15 Mar 2015 21:32:11 +0000 (21:32 +0000)]
Add a new taskqueue (device specific, not net80211 ic->tq); use it for
device restart.
(Committers note - once scan overhaul and a few other things have been
fixed in net80211 to not block things in the taskqueue, this can disappear
and the device specific taskqueues in other drivers can also go away.)