]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
9 years agoMFC r280345:
hselasky [Wed, 25 Mar 2015 13:01:51 +0000 (13:01 +0000)]
MFC r280345:
Fix for out of order device destruction notifications when using the
delist_dev() function. In addition to this change:
- add a proper description of this function
- add a proper witness assert inside this function
- switch a nearby line to use the "cdp" pointer instead of cdev2priv()

git-svn-id: svn://svn.freebsd.org/base/stable/10@280579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279174
arybchik [Wed, 25 Mar 2015 13:01:10 +0000 (13:01 +0000)]
MFC: 279174

sfxge: add missing Siena sensors to common code

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280578 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279173
arybchik [Wed, 25 Mar 2015 12:59:49 +0000 (12:59 +0000)]
MFC: 279173

sfxge: add missing common code NVRAM types and map from MCDI

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280577 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279172
arybchik [Wed, 25 Mar 2015 12:59:01 +0000 (12:59 +0000)]
MFC: 279172

sfxge: add new identities to Siena static config

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280576 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279147
arybchik [Wed, 25 Mar 2015 12:57:43 +0000 (12:57 +0000)]
MFC: 279147

sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279725:
hselasky [Wed, 25 Mar 2015 11:12:48 +0000 (11:12 +0000)]
MFC r279725:
Add more USB IDs.

PR: 197753

git-svn-id: svn://svn.freebsd.org/base/stable/10@280569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279146
arybchik [Wed, 25 Mar 2015 11:10:56 +0000 (11:10 +0000)]
MFC: 279146

sfxge: use sparse index to retrieve sensor value

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279145
arybchik [Wed, 25 Mar 2015 11:09:35 +0000 (11:09 +0000)]
MFC: 279145

sfxge: use macros to acquire and release BAR locks everywhere

It was the result of invalid merge of the patch from out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280567 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279144
arybchik [Wed, 25 Mar 2015 11:08:41 +0000 (11:08 +0000)]
MFC: 279144

sfxge: packet can't require more than n_dma_seg descriptors plus one

Use remaining number of DMA segment instead of maximum number in mapping
when checking space for one more TSO segment packet.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279143
arybchik [Wed, 25 Mar 2015 11:07:56 +0000 (11:07 +0000)]
MFC: 279143

sfxge: use common definitions of MC shared memory offsets and PDU length

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279142
arybchik [Wed, 25 Mar 2015 11:07:10 +0000 (11:07 +0000)]
MFC: 279142

sfxge: synchronize EF10 registers header

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280564 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279141
arybchik [Wed, 25 Mar 2015 11:06:16 +0000 (11:06 +0000)]
MFC: 279141

sfxge: style fixes and cleanup

Sync endif comment with conditional.
BOOTROM and SIENA_BOOTROM are the same, but highlight that it is Siena.
Restore commented out assertion.
Sync comments with out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279098
arybchik [Wed, 25 Mar 2015 11:04:12 +0000 (11:04 +0000)]
MFC: 279098

sfxge: allow TX and RX queue limits to be changed

Before the common code had hard coded limits on the IDs RXQs and TXQs could
be created with which were suited for the Windows driver with VMQ, and so
would prevent queues with IDs greater than or equal to 259 (for TXQs) or 768
(for RXQs) from being created. This change allows the limits to be set in
efsys.h, so that all 1024 queues can be created during new manftest tests.
Also, the descriptor cache sizes were also hard coded to values suited to
the smaller queue counts, and so it was necessary to make them configurable
as well.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279097
arybchik [Wed, 25 Mar 2015 11:01:58 +0000 (11:01 +0000)]
MFC: 279097

sfxge: check allocations are non-NULL before freeing them

Caught when efx_filter_init() failed and called efx_filter_fini() in the
teardown path.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280561 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279096
arybchik [Wed, 25 Mar 2015 11:01:03 +0000 (11:01 +0000)]
MFC: 279096

sfxge: keep fw and driver view of autoneg parameters consistent

Previously the driver's view was the expected outcome of any
reconfiguration even if that reconfiguration failed.

Submitted by:   Ben Horgan
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280560 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279095
arybchik [Wed, 25 Mar 2015 11:00:09 +0000 (11:00 +0000)]
MFC: 279095

sfxge: never set RX_DESCQ_EN during self-test

We must not enable RX queues with random parameters when they are
mapped into a VF with an untrusted driver.  It's probably not a good
idea to do this anyway, so take this bit out of the table test masks.

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280559 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279094
arybchik [Wed, 25 Mar 2015 10:59:24 +0000 (10:59 +0000)]
MFC: 279094

sfxge: more accurate calculation of maximum number of TSO segments

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279080
arybchik [Wed, 25 Mar 2015 10:58:21 +0000 (10:58 +0000)]
MFC: 279080

sfxge: reap Tx descriptors on unblock

Otherwise when processing finally comes to efx_tx_qdesc_post() it could
be insufficient space between reaped and added to post pending
descriptors.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279078
arybchik [Wed, 25 Mar 2015 10:57:26 +0000 (10:57 +0000)]
MFC: 279078

sfxge: add assertions that required event handlers are implemented

efx_ev_mcdi() does not assert or check that all event handlers it
calls are non-null.  Add assertions at the top for all required
event handlers, as some events (in the case of this bug, monitor
events) are rare.

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279077
arybchik [Wed, 25 Mar 2015 10:56:10 +0000 (10:56 +0000)]
MFC: 279077

sfxge: style fixes

Use nitem() to get number of array elements.
Remove unused define.
Use TAB to indent.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280553 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279281:
hselasky [Wed, 25 Mar 2015 10:55:08 +0000 (10:55 +0000)]
MFC r279281:
Fix a special case in ip_fragment() to produce a more sensible chain
of packets. When the data payload length excluding any headers, of an
outgoing IPv4 packet exceeds PAGE_SIZE bytes, a special case in
ip_fragment() can kick in to optimise the outgoing payload(s). The
code which was added in r98849 as part of zero copy socket support
assumes that the beginning of any MTU sized payload is aligned to
where a MBUF's "m_data" pointer points. This is not always the case
and can sometimes cause large IPv4 packets, as part of ping replies,
to be split more than needed.

Instead of iterating the MBUFs to figure out how much data is in the
current chain, use the value already in the "m_pkthdr.len" field of
the first MBUF in the chain.

Reviewed by: ken @
Differential Revision: https://reviews.freebsd.org/D1893
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@280552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279076
arybchik [Wed, 25 Mar 2015 10:54:23 +0000 (10:54 +0000)]
MFC: 279076

sfxge: regenerate sensor map

Add Florence R7 and Modena sensors.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279048
arybchik [Wed, 25 Mar 2015 10:53:27 +0000 (10:53 +0000)]
MFC: 279048

sfxge: add Florence R7 turbo mode support to common code

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279047
arybchik [Wed, 25 Mar 2015 10:52:35 +0000 (10:52 +0000)]
MFC: 279047

sfxge: regenerate MCDI protocol headers

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279046
arybchik [Wed, 25 Mar 2015 10:51:08 +0000 (10:51 +0000)]
MFC: 279046

sfxge: handle fragmented TCP header in mbuf

TCP header is fragmented in the case of VLAN tagged IPv6 traffic without
HW VLAN tagging.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280547 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280264:
hselasky [Wed, 25 Mar 2015 10:50:13 +0000 (10:50 +0000)]
MFC r280264:
Define BINDIR for some test utilities.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@280546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278942
arybchik [Wed, 25 Mar 2015 10:49:45 +0000 (10:49 +0000)]
MFC: 278942

sfxge: fix broken MCDI_EV_FIELD() macro

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280545 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278941
arybchik [Wed, 25 Mar 2015 10:48:28 +0000 (10:48 +0000)]
MFC: 278941

sfxge: support variable-length response to MCDI GET_BOARD_CFG

Allocate the minimum or maximum response length for GET_BOARD_CFG as
appropriate.  When looking up firmware subtypes by partition ID,
check the ID against the actual response length.

Merge of the patch made by Ben Hutchings in 2011.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280544 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 279180
arybchik [Wed, 25 Mar 2015 10:46:04 +0000 (10:46 +0000)]
MFC: 279180

sfxge: list header in SRCS

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280542 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278940
arybchik [Wed, 25 Mar 2015 10:44:30 +0000 (10:44 +0000)]
MFC: 278940

sfxge: add driver context member with number of event queues

Mainly to unify with similar member for transmit and receive queues.
It will be used in the future for resources allocation processing.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280541 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280211:
hselasky [Wed, 25 Mar 2015 10:44:09 +0000 (10:44 +0000)]
MFC r280211:
Add missing void pointer argument to SYSINIT() functions.

Sponsored by:   Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@280540 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278939
arybchik [Wed, 25 Mar 2015 10:43:06 +0000 (10:43 +0000)]
MFC: 278939

sfxge: add driver context member with number of receive queues

Mainly to unify with similar member for transmit queues.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280539 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278938
arybchik [Wed, 25 Mar 2015 10:42:19 +0000 (10:42 +0000)]
MFC: 278938

sfxge: add driver context member with number of transmit queues

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280538 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278937
arybchik [Wed, 25 Mar 2015 10:41:09 +0000 (10:41 +0000)]
MFC: 278937

sfxge: add TCP segment size to sfxge_tso_state

It avoids access to m_pkthdr when TSO packet is started and also makes
tso_start_new_packet() function smaller.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280537 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278841
arybchik [Wed, 25 Mar 2015 10:40:17 +0000 (10:40 +0000)]
MFC: 278841

sfxge: flush all Tx queues from if_qflush

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

git-svn-id: svn://svn.freebsd.org/base/stable/10@280536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278839
arybchik [Wed, 25 Mar 2015 10:39:18 +0000 (10:39 +0000)]
MFC: 278839

sfxge: style fixes

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280535 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278838
arybchik [Wed, 25 Mar 2015 10:38:22 +0000 (10:38 +0000)]
MFC: 278838

sfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held

The problem is found using WITNESS option enabled.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280533 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278837
arybchik [Wed, 25 Mar 2015 10:37:36 +0000 (10:37 +0000)]
MFC: 278837

sfxge: remove inline specifiers

Now compiler does not need any help.
The patch does not change generated code.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

git-svn-id: svn://svn.freebsd.org/base/stable/10@280532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278836
arybchik [Wed, 25 Mar 2015 10:36:37 +0000 (10:36 +0000)]
MFC: 278836

sfxge: remove used sfxge_tso_state member dma_seg_i

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280530 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279854:
hselasky [Wed, 25 Mar 2015 10:35:54 +0000 (10:35 +0000)]
MFC r279854:
Lock softc before clearing bits.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278835
arybchik [Wed, 25 Mar 2015 10:35:19 +0000 (10:35 +0000)]
MFC: 278835

sfxge: remove full_packet_size from sfxge_tso_state

It makes sfxge_tso_state smaller and even makes tso_start_new_packet()
few bytes smaller. Data used to calculate packet size are used nearby,
so it should be no problems with cache etc.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

git-svn-id: svn://svn.freebsd.org/base/stable/10@280528 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278833
arybchik [Wed, 25 Mar 2015 10:34:20 +0000 (10:34 +0000)]
MFC: 278833

sfxge: remove unused variable

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

git-svn-id: svn://svn.freebsd.org/base/stable/10@280527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278255
arybchik [Wed, 25 Mar 2015 10:32:49 +0000 (10:32 +0000)]
MFC: 278255

sfxge: Add statistics for partially dropped TSO packets

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280526 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278254
arybchik [Wed, 25 Mar 2015 10:31:43 +0000 (10:31 +0000)]
MFC: 278254

sfxge: using 64-bit access for x86-64

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278250
arybchik [Wed, 25 Mar 2015 10:30:45 +0000 (10:30 +0000)]
MFC: 278250

sfxge: make lock names unique

Lock name should include interface name.
Tx queue and event queue lock name should include queue number.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278248
arybchik [Wed, 25 Mar 2015 10:29:08 +0000 (10:29 +0000)]
MFC: 278248

sfxge: access statistics buffers under port lock

Allow access to statistics data not only from sysctl handlers.

Submitted by:   Boris Misenov <Boris.Misenov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278221
arybchik [Wed, 25 Mar 2015 10:27:54 +0000 (10:27 +0000)]
MFC: 278221

sfxge: Add macros to init, destroy, acquire, release and assert locks

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 278220
arybchik [Wed, 25 Mar 2015 10:26:45 +0000 (10:26 +0000)]
MFC: 278220

sfxge: Implement EFSYS_MEM_READ_BARRIER()

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277895
arybchik [Wed, 25 Mar 2015 10:25:45 +0000 (10:25 +0000)]
MFC: 277895

sfxge: Separate software Tx queue limit for non-TCP traffic

Add separate software Tx queue limit for non-TCP traffic to make total
limit higher and avoid local drops of TCP packets because of no
backpressure.
There is no point to make non-TCP limit high since without backpressure
UDP stream easily overflows any sensible limit.

Split early drops statistics since it is better to have separate counter
for each drop reason to make it unabmiguous.

Add software Tx queue high watermark. The information is very useful to
understand how big queues grow under traffic load.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277894
arybchik [Wed, 25 Mar 2015 10:23:00 +0000 (10:23 +0000)]
MFC: 277894

sfxge: implemented parameter to restrict RSS channels

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277893
arybchik [Wed, 25 Mar 2015 10:21:42 +0000 (10:21 +0000)]
MFC: 277893

sfxge: Use SFXGE_MODERATION to initialize event moderation

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277892
arybchik [Wed, 25 Mar 2015 10:20:42 +0000 (10:20 +0000)]
MFC: 277892

sfxge: Pass correct address to free allocated memory in the case of load error

Most likely is was just memory leak on the error handling path since
typically efsys_mem_t is filled in by zeros on allocation.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277891
arybchik [Wed, 25 Mar 2015 10:19:43 +0000 (10:19 +0000)]
MFC: 277891

sfxge: Remove unused esm_size member of the efsys_mem_t structure

esm_size is not even initialized properly when memory is allocated.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277890
arybchik [Wed, 25 Mar 2015 10:18:23 +0000 (10:18 +0000)]
MFC: 277890

sfxge: Do not bzero() DMA allocated memory once again

sfxge_dma_alloc() calls bus_dmamem_alloc() with BUS_DMA_ZERO flag, so
allocated memory is already filled in by zeros

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277889
arybchik [Wed, 25 Mar 2015 10:17:24 +0000 (10:17 +0000)]
MFC: 277889

sfxge: Add evq argument to sfxge_tx_qcomplete()

It removes necessity to get evq pointer by its index in soft context.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277888
arybchik [Wed, 25 Mar 2015 10:16:33 +0000 (10:16 +0000)]
MFC: 277888

sfxge: fixed TSO code to cope with VLAN headers

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277887
arybchik [Wed, 25 Mar 2015 10:14:30 +0000 (10:14 +0000)]
MFC: 277887

sfxge: Remove extra cache-line alignment and reorder sfxge_evq_t

Remove the first member alignment to cacheline since it is nop.
Use __aligned() for the whole structure to make sure that the structure
size is cacheline aligned.
Remove lock alignment to make the structure smaller and fit all members
used on event queue processing into one cacheline (128 bytes) on x86-64.
The lock is obtained as well from different context when event queue
statistics are retrived from sysctl context, but it is infrequent.
Reorder members to avoid padding and go in usage order on event
processing.
As the result all structure members used on event queue processing fit
into exactly one cacheline (128 byte) now.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277886
arybchik [Wed, 25 Mar 2015 10:13:19 +0000 (10:13 +0000)]
MFC: 277886

sfxge: Make it possible to build without EVQ statistics

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277885
arybchik [Wed, 25 Mar 2015 10:12:13 +0000 (10:12 +0000)]
MFC: 277885

sfxge: Move txq->next pointer to part writable on completion path

In fact the pointer is used only if more than one TXQ is processed in
one interrupt.
It is used (read-write) on completion path only.
Also it makes the first part of the structure smaller and it fits now
into one 128byte cache line. So, TXQ structure becomes 128 bytes
smaller.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 277884
arybchik [Wed, 25 Mar 2015 10:11:17 +0000 (10:11 +0000)]
MFC: 277884

sfxge: Change sfxge_ev_qpoll() proto to avoid EVQ pointers array access

It was the only place on data path where sc->evq array is accessed.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272411
arybchik [Wed, 25 Mar 2015 10:08:28 +0000 (10:08 +0000)]
MFC: 272411

Properly handle a case that should never happen (the bus_dma
callback being called with error set to non-zero).

git-svn-id: svn://svn.freebsd.org/base/stable/10@280507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272377
arybchik [Wed, 25 Mar 2015 10:06:26 +0000 (10:06 +0000)]
MFC: 272377

Some cleanup for sfxge.4

Use standard mdoc macros instead of pure roff, fix some other mdoc
usage,
make the style consistent, and fix some grammar issues.

Approved by:    hrs (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272331
arybchik [Wed, 25 Mar 2015 10:05:19 +0000 (10:05 +0000)]
MFC: 272331

Support tunable to control Tx deferred packet list limits

Also increase default for Tx queue get-list limit.
Too small limit results in TCP packets drops especiall when many
streams are running simultaneously.
Put list may be kept small enough since it is just a temporary
location if transmit function can't get Tx queue lock.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272330
arybchik [Wed, 25 Mar 2015 10:03:41 +0000 (10:03 +0000)]
MFC: 272330

The patch allows to check state of the software Tx queues at run time.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272329
arybchik [Wed, 25 Mar 2015 10:02:14 +0000 (10:02 +0000)]
MFC: 272329

Update SolarFlare driver manual page with new tunables.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272328
arybchik [Wed, 25 Mar 2015 10:01:07 +0000 (10:01 +0000)]
MFC: 272328

Make size of Tx and Rx rings configurable

Required size of event queue is calculated now.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 272325
arybchik [Wed, 25 Mar 2015 09:59:38 +0000 (09:59 +0000)]
MFC: 272325

cleanup: code style fixes

Remove trailing whitespaces and tabs.
Enclose value in return statements in parentheses.
Use tabs after #define.
Do not skip comparison with 0/NULL in boolean expressions.

Submitted by:   Andrew Rybchenko <arybchenko at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 263649
arybchik [Wed, 25 Mar 2015 09:56:48 +0000 (09:56 +0000)]
MFC: 263649

sfxge: limit software Tx queue size.

Previous implementation limits put queue size only (when Tx lock can't
be acquired), but get queue may grow unboundedly which results in mbuf
pools exhaustion and latency growth.

Submitted by:   Andrew Rybchenko <Andrew.Rybchenko at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279776:
dchagin [Wed, 25 Mar 2015 09:54:07 +0000 (09:54 +0000)]
MFC r279776:

Add a cred parameter to the VOP_VPTOCNP(9) manpage.
While here fix igor warning about new line.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 263332
arybchik [Wed, 25 Mar 2015 09:45:07 +0000 (09:45 +0000)]
MFC: 263332

Add counter for Tx errors returned from if_transmit.

Submitted by:   Boris Misenov <Boris.Misenov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: 263297
arybchik [Wed, 25 Mar 2015 09:40:48 +0000 (09:40 +0000)]
MFC: 263297

Return error when packet is dropped because of link down.

Submitted by:   Boris Misenov <Boris.Misenov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280232:
kib [Wed, 25 Mar 2015 08:23:08 +0000 (08:23 +0000)]
MFC r280232:
Cosmetics.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC of r277177 and r279894 with the fixes for the PMC for Haswell.
rrs [Tue, 24 Mar 2015 20:00:11 +0000 (20:00 +0000)]
MFC of r277177 and r279894 with the fixes for the PMC for Haswell.

Sponsored by: Netflix Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280273;
pfg [Tue, 24 Mar 2015 17:37:31 +0000 (17:37 +0000)]
MFC r280273;
Permit multiple arguments for the nonnull attribute.

This is very useful for non-trivial functions and doesn't
affect existing uses.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC, r279336:
ken [Tue, 24 Mar 2015 17:20:20 +0000 (17:20 +0000)]
MFC, r279336:

  ------------------------------------------------------------------------
  r279336 | ken | 2015-02-26 15:22:06 -0700 (Thu, 26 Feb 2015) | 12 lines

  Add FreeBSD stable/10 version checks for the availability of the
  CDAI_FLAG_NONE advanced information CCB flag.

  Support for the flag was merged to stable/10 in r279329, and the
  __FreeBSD_version in stable/10 was bumped to 1001510.

  Check for that version in the mps(4) and mpr(4) drivers when determining
  whether to use the flag.

  Sponsored by: Spectra Logic
  MFC after: 3 days

  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@280448 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC, r279375
ken [Tue, 24 Mar 2015 16:53:16 +0000 (16:53 +0000)]
MFC, r279375

  ------------------------------------------------------------------------
  r279375 | ken | 2015-02-27 14:35:36 -0700 (Fri, 27 Feb 2015) | 26 lines

  Fix I/O size calculation for pass(4) driver requests and add latency
  tracking.

  It is important to subtract the residual from the requested
  transfer size to see how much data was actually transferred.  With
  tape drives in particular, it is common to request more data than is
  returned.

  Also, add I/O latency tracking for CAM requests issued by
  cam_periph_runccb().

  If the caller supplies a struct devstat, and the I/O is a SCSI or
  ATA I/O, we will track the elapsed time to provide I/O latency
  statistics for the request.

  sys/cam/scsi/cam_periph.c:
   In cam_periph_runccb(), subtract the residual when reporting I/O
   totals to devstat(9) for SCSI and ATA passthrough requests.

   In cam_periph_runccb(), grab the I/O start time and supply
   the start time to devstat_end_transaction() so that it can
   calculate the elapsed I/O time.

  Sponsored by: Spectra Logic
  MFC after: 1 week

  ------------------------------------------------------------------------

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@280446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC sa(4) and mt(1) improvements.
ken [Tue, 24 Mar 2015 14:36:10 +0000 (14:36 +0000)]
MFC sa(4) and mt(1) improvements.

This includes these changes: 279219, 279229, 279261, 279534, 279570,
280230, 280231.

In addition, bump __FreeBSD_version for the addition of the new
mtio(4) / sa(4) ioctls.

Thanks to Dan Langille, Harald Schmalzbauer and Rudolf Cejka for spending
a significant amount of time and effort testing these changes.

  ------------------------------------------------------------------------
  r279219 | ken | 2015-02-23 14:59:30 -0700 (Mon, 23 Feb 2015) | 282 lines

  Significant upgrades to sa(4) and mt(1).

  The primary focus of these changes is to modernize FreeBSD's
  tape infrastructure so that we can take advantage of some of the
  features of modern tape drives and allow support for LTFS.

  Significant changes and new features include:

   o sa(4) driver status and parameter information is now exported via an
     XML structure.  This will allow for changes and improvements later
     on that will not break userland applications.  The old MTIOCGET
     status ioctl remains, so applications using the existing interface
     will not break.

   o 'mt status' now reports drive-reported tape position information
     as well as the previously available calculated tape position
     information.  These numbers will be different at times, because
     the drive-reported block numbers are relative to BOP (Beginning
     of Partition), but the block numbers calculated previously via
     sa(4) (and still provided) are relative to the last filemark.
     Both numbers are now provided.  'mt status' now also shows the
     drive INQUIRY information, serial number and any position flags
     (BOP, EOT, etc.) provided with the tape position information.
     'mt status -v' adds information on the maximum possible I/O size,
     and the underlying values used to calculate it.

   o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed.

     The extra devices were originally added as place holders for
     density-specific device nodes.  Some OSes (NetBSD, NetApp's OnTap
     and Solaris) have had device nodes that, when you write to them,
     will automatically select a given density for particular tape drives.

     This is a convenient way of switching densities, but it was never
     implemented in FreeBSD.  Only the device nodes were there, and that
     sometimes confused users.

     For modern tape devices, the density is generally not selectable
     (e.g. with LTO) or defaults to the highest availble density when
     the tape is rewritten from BOT (e.g. TS11X0).  So, for most users,
     density selection won't be necessary.  If they do need to select
     the density, it is easy enough to use 'mt density' to change it.

   o Protection information is now supported.  This is either a
     Reed-Solomon CRC or CRC32 that is included at the end of each block
     read and written.  On write, the tape drive verifies the CRC, and
     on read, the tape drive provides a CRC for the userland application
     to verify.

   o New, extensible tape driver parameter get/set interface.

   o Density reporting information.  For drives that support it,
     'mt getdensity' will show detailed information on what formats the
     tape drive supports, and what formats the tape drive supports.

   o Some mt(1) functionality moved into a new mt(3) library so that
     external applications can reuse the code.

   o The new mt(3) library includes helper routines to aid in parsing
     the XML output of the sa(4) driver, and build a tree of driver
     metadata.

   o Support for the MTLOAD (load a tape in the drive) and MTWEOFI
     (write filemark immediate) ioctls needed by IBM's LTFS
     implementation.

   o Improve device departure behavior for the sa(4) driver.  The previous
     implementation led to hangs when the device was open.

   o This has been tested on the following types of drives:
   IBM TS1150
   IBM TS1140
   IBM LTO-6
   IBM LTO-5
   HP LTO-2
   Seagate DDS-4
   Quantum DLT-4000
   Exabyte 8505
   Sony DDS-2

  contrib/groff/tmac/doc-syms,
  share/mk/bsd.libnames.mk,
  lib/Makefile,
   Add libmt.

  lib/libmt/Makefile,
  lib/libmt/mt.3,
  lib/libmt/mtlib.c,
  lib/libmt/mtlib.h,
   New mt(3) library that contains functions moved from mt(1) and
   new functions needed to interact with the updated sa(4) driver.

   This includes XML parser helper functions that application writers
   can use when writing code to query tape parameters.

  rescue/rescue/Makefile:
   Add -lmt to CRUNCH_LIBS.

  src/share/man/man4/mtio.4
   Clarify this man page a bit, and since it contains what is
   essentially the mtio.h header file, add new ioctls and structure
   definitions from mtio.h.

  src/share/man/man4/sa.4
   Update BUGS and maintainer section.

  sys/cam/scsi/scsi_all.c,
  sys/cam/scsi/scsi_all.h:
   Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building
   functions.

  sys/cam/scsi/scsi_sa.c
  sys/cam/scsi/scsi_sa.h
   Many tape driver changes, largely outlined above.

   Increase the sa(4) driver read/write timeout from 4 to 32
   minutes.  This is based on the recommended values for IBM LTO
   5/6 drives.  This may also avoid timeouts for other tape
   hardware that can take a long time to do retries and error
   recovery.  Longer term, a better way to handle this is to ask
   the drive for recommended timeout values using the REPORT
   SUPPORTED OPCODES command.  Modern IBM and Oracle tape drives
   at least support that command, and it would allow for more
   accurate timeout values.

   Add XML status generation.  This is done with a series of
   macros to eliminate as much duplicate code as possible.  The
   new XML-based status values are reported through the new
   MTIOCEXTGET ioctl.

   Add XML driver parameter reporting, using the new MTIOCPARAMGET
   ioctl.

   Add a new driver parameter setting interface, using the new
   MTIOCPARAMSET and MTIOCSETLIST ioctls.

   Add a new MTIOCRBLIM ioctl to get block limits information.

   Add CCB/CDB building routines scsi_locate_16, scsi_locate_10,
   and scsi_read_position_10().

   scsi_locate_10 implements the LOCATE command, as does the
   existing scsi_set_position() command.  It just supports
   additional arguments and features.  If/when we figure out a
   good way to provide backward compatibility for older
   applications using the old function API, we can just revamp
   scsi_set_position().  The same goes for
   scsi_read_position_10() and the existing scsi_read_position()
   function.

   Revamp sasetpos() to take the new mtlocate structure as an
   argument.  It now will use either scsi_locate_10() or
   scsi_locate_16(), depending upon the arguments the user
   supplies.  As before, once we change position we don't have a
   clear idea of what the current logical position of the tape
   drive is.

   For tape drives that support long form position data, we
   read the current position and store that for later reporting
   after changing the position.  This should help applications
   like Bacula speed tape access under FreeBSD once they are
   modified to support the new ioctls.

   Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all
   drives that report SCSI-2 or older, as well as drives that
   report an Illegal Request type error for READ POSITION with
   the long format.  So we should automatically detect drives
   that don't support the long form and stop asking for it after
   an initial try.

   Add a partition number to the sa(4) softc.

   Improve device departure handling. The previous implementation
   led to hangs when the device was open.

   If an application had the sa(4) driver open, and attempted to
   close it after it went away, the cam_periph_release() call in
   saclose() would cause the periph to get destroyed because that
   was the last reference to it.  Because destroy_dev() was
   called from the sa(4) driver's cleanup routine (sacleanup()),
   and would block waiting for the close to happen, a deadlock
   would result.

   So instead of calling destroy_dev() from the cleanup routine,
   call destroy_dev_sched_cb() from saoninvalidate() and wait for
   the callback.

   Acquire a reference for devfs in saregister(), and release it
   in the new sadevgonecb() routine when all devfs devices for
   the particular sa(4) driver instance are gone.

   Add a new function, sasetupdev(), to centralize setting
   per-instance devfs device parameters instead of repeating the
   code in saregister().

   Add an open count to the softc, so we know how many
   peripheral driver references are a result of open
          sessions.

   Add the D_TRACKCLOSE flag to the cdevsw flags so
   that we get a 1:1 mapping of open to close calls
   instead of a N:1 mapping.

   This should be a no-op for everything except the
   control device, since we don't allow more than one
   open on non-control devices.

   However, since we do allow multiple opens on the
   control device, the combination of the open count
   and the D_TRACKCLOSE flag should result in an
   accurate peripheral driver reference count, and an
   accurate open count.

   The accurate open count allows us to release all
   peripheral driver references that are the result
   of open contexts once we get the callback from devfs.

  sys/sys/mtio.h:
   Add a number of new mt(4) ioctls and the requisite data
   structures.  None of the existing interfaces been removed
   or changed.

   This includes definitions for the following new ioctls:

   MTIOCRBLIM      /* get block limits */
   MTIOCEXTLOCATE /* seek to position */
   MTIOCEXTGET     /* get tape status */
   MTIOCPARAMGET /* get tape params */
   MTIOCPARAMSET /* set tape params */
   MTIOCSETLIST /* set N params */

  usr.bin/mt/Makefile:
   mt(1) now depends on libmt, libsbuf and libbsdxml.

  usr.bin/mt/mt.1:
   Document new mt(1) features and subcommands.

  usr.bin/mt/mt.c:
   Implement support for mt(1) subcommands that need to
   use getopt(3) for their arguments.

   Implement a new 'mt status' command to replace the old
   'mt status' command.  The old status command has been
   renamed 'ostatus'.

   The new status function uses the MTIOCEXTGET ioctl, and
   therefore parses the XML data to determine drive status.
   The -x argument to 'mt status' allows the user to dump out
   the raw XML reported by the kernel.

   The new status display is mostly the same as the old status
   display, except that it doesn't print the redundant density
   mode information, and it does print the current partition
   number and position flags.

   Add a new command, 'mt locate', that will supersede the
   old 'mt setspos' and 'mt sethpos' commands.  'mt locate'
   implements all of the functionality of the MTIOCEXTLOCATE
   ioctl, and allows the user to change the logical position
   of the tape drive in a number of ways.  (Partition,
   block number, file number, set mark number, end of data.)
   The immediate bit and the explicit address bits are
   implemented, but not documented in the man page.

   Add a new 'mt weofi' command to use the new MTWEOFI ioctl.
   This allows the user to ask the drive to write a filemark
   without waiting around for the operation to complete.

   Add a new 'mt getdensity' command that gets the XML-based
   tape drive density report from the sa(4) driver and displays
   it.  This uses the SCSI REPORT DENSITY SUPPORT command
   to get comprehensive information from the tape drive about
   what formats it is able to read and write.

   Add a new 'mt protect' command that allows getting and setting
   tape drive protection information.  The protection information
   is a CRC tacked on to the end of every read/write from and to
   the tape drive.

  Sponsored by: Spectra Logic
  MFC after: 1 month

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r279229 | ken | 2015-02-23 22:43:16 -0700 (Mon, 23 Feb 2015) | 5 lines

  Fix printf format warnings on sparc64 and mips.

  Sponsored by: Spectra Logic
  MFC after: 1 month

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r279261 | ken | 2015-02-24 21:30:23 -0700 (Tue, 24 Feb 2015) | 23 lines

  Fix several problems found by Coverity.

  lib/libmt/mtlib.c:
   In mt_start_element(), make sure we don't overflow the
   cur_sb array.  CID 1271325

  usr.bin/mt/mt.c:
   In main(), bzero the mt_com structure so that we aren't
   using any uninitialized stack variables.  CID 1271319

   In mt_param(), only allow one -s and one -p argument.  This
   will prevent a memory leak caused by overwriting the
   param_name and/or param_value variables.  CID 1271320 and
   CID 1271322

   To make things simpler in mt_param(), make sure there
   there is only one exit path for the function.  Make sure
   the arguments are explicitly freed.

  Sponsored by: Spectra Logic
  Pointed out by: emaste
  MFC after: 1 month

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r279534 | ken | 2015-03-02 11:09:49 -0700 (Mon, 02 Mar 2015) | 18 lines

  Change the sa(4) driver to check for long position support on
  SCSI-2 devices.

  Some older tape devices claim to be SCSI-2, but actually do support
  long position information.  (Long position information includes
  the current file mark.)  For example, the COMPAQ SuperDLT1.

  So we now only disable the check on SCSI-1 and older devices.

  sys/cam/scsi/scsi_sa.c:
   In saregister(), only disable fetching long position
   information on SCSI-1 and older drives.  Update the
   comment to explain why.

  Confirmed by: dvl
  Sponsored by: Spectra Logic
  MFC after: 3 weeks

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r279570 | ken | 2015-03-03 15:49:07 -0700 (Tue, 03 Mar 2015) | 21 lines

  Add density code for DAT-72, and notes on DAT-160.

  As it turns out, the density code for DAT-160 (0x48) is the same
  as for SDLT220.  Since the SDLT values are already in the table,
  we will leave them in place.

  Thanks to Harald Schmalzbauer for confirming the DAT-72 density code.

  lib/libmt/mtlib.c:
   Add DAT-72 density code, and commented out DAT-160 density
   code.  Explain why DAT-160 is commented out.  Add notes
   explaining where the bpi values for these formats came from.

  usr.bin/mt/mt.1:
   Add DAT-72 density code, and add a note explaining that
   the SDLTTapeI(110) density code (0x48) is the same as
   DAT-160.

  Sponsored by: Spectra Logic
  MFC after: 3 weeks

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r280230 | ken | 2015-03-18 14:52:34 -0600 (Wed, 18 Mar 2015) | 25 lines

  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

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r280231 | ken | 2015-03-18 14:54:54 -0600 (Wed, 18 Mar 2015) | 16 lines

  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.

  Sponsored by: Spectra Logic
  MFC after: 4 days

  ------------------------------------------------------------------------

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@280438 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278204:
ngie [Tue, 24 Mar 2015 08:24:55 +0000 (08:24 +0000)]
MFC r278204:

Sort the entries by build knob, then MACHINE_ARCH like other areas of the tree

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@280427 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280196:
kib [Tue, 24 Mar 2015 08:21:36 +0000 (08:21 +0000)]
MFC r280196:
Recheck that boundary is not crossed after the move to satisfy boundary
restriction.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280195:
kib [Tue, 24 Mar 2015 08:18:24 +0000 (08:18 +0000)]
MFC r280195:
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280424 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r271893,r271895,r272043,r278249,r278282,r278466:
ngie [Tue, 24 Mar 2015 07:43:58 +0000 (07:43 +0000)]
MFC r271893,r271895,r272043,r278249,r278282,r278466:

r271893:

Don't install /etc/rc.d/rwho unless MK_RCMDS == yes

Sponsored by: EMC / Isilon Storage Division

r271895:

Don't install /etc/rc.d/ftp-proxy unless MK_PF == yes

Sponsored by: EMC / Isilon Storage Division

r272043:

Don't install /etc/rc.d/keyserv unless MK_OPENSSL == yes

Sponsored by: EMC / Isilon Storage Division

r278249:

Honor the following flags with the following rc.d scripts for services that can
be easily decoupled from the boot process without disrupting other services

- MK_APM && MK_ACPI: powerd
- MK_BOOTPARAMD: bootparams
- MK_FTP: ftpd
- MK_INETD: inetd
- MK_LEGACY_CONSOLE: moused, syscons
- MK_MAIL: othermta
- MK_NS_CACHING: nscd
- MK_NTP: ntpd (ntpdate is required by other services and can't be easily
                conditionalized -- yet..)
- MK_ROUTED: routed
- MK_SENDMAIL: sendmail
- MK_TIMED: timed
- MK_VI: virecover

Sponsored by: EMC / Isilon Storage Division

r278282:

Use FILES+= idiom instead of _inetd when referencing inetd rc.d script

This was a discrepancy between ^/projects/building-blocks and ^/head that I
didn't resolve before committing the change to ^/head

Pointyhat to: me
Reported by: jhb
Sponsored by: EMC / Isilon Storage Division

r278466:

Remove explicit routing/sendmail rc.d inclusion in FILES

Reported by: Guy Yur <guyyur@gmail.com>
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@280422 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoForced commit to note that the previous commit to this file included the
ngie [Tue, 24 Mar 2015 06:59:41 +0000 (06:59 +0000)]
Forced commit to note that the previous commit to this file included the
following MFC as well:

MFC 278251:

Honor the following flags for items that can be conditionalized out of the
build/install without disrupting other dependent services (see r278249, et
al):

- MK_LOCATE
- MK_MAN
- MK_NLS
- MK_OPENSSL
- MK_PKGBOOTSTRAP
- MK_SENDMAIL

Additional flags need to be handled in etc/Makefile, but it requires
refactoring the relevant scripts in etc/rc.d/*

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@280420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278135,r278202:
ngie [Tue, 24 Mar 2015 06:55:08 +0000 (06:55 +0000)]
MFC r278135,r278202:

r278135 (by amdmi3):

- Remove more files when MK_USB == no

Reviewed by: ngie
Approved by: ngie
Differential Revision: D1600

r278202:

Clean up more usb related files when MK_USB == no when dealing with
manpages, libraries, and binaries

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@280419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC of 280413,tzdata10:
edwin [Tue, 24 Mar 2015 06:05:52 +0000 (06:05 +0000)]
MFC of 280413,tzdata10:

Release 2015b - 2015-03-19 23:28:11 -0700

  Changes affecting future time stamps

    Mongolia will start observing DST again this year, from the last
    Saturday in March at 02:00 to the last Saturday in September at 00:00.
    (Thanks to Ganbold Tsagaankhuu.)

    Palestine will start DST on March 28, not March 27.  Also,
    correct the fall 2014 transition from September 26 to October 24.
    Adjust future predictions accordingly.  (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps

    The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
    regression.  (Thanks to Stuart Bishop for reporting the problem.)

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: America/Antigua, America/Cayman,
    Pacific/Midway, and Pacific/Saipan.

  Changes affecting time zone abbreviations

    Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD".
    (Thanks to Hank W.)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280307:
pfg [Tue, 24 Mar 2015 01:31:02 +0000 (01:31 +0000)]
MFC r280307:
bsdgrep: fix regression in the -f option since r268799

Caused by an incomplete merge from NetBSD.

PR: 198725

git-svn-id: svn://svn.freebsd.org/base/stable/10@280408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r275163: ANSIfy b64_pton
emaste [Mon, 23 Mar 2015 20:51:35 +0000 (20:51 +0000)]
MFC r275163: ANSIfy b64_pton

git-svn-id: svn://svn.freebsd.org/base/stable/10@280399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r275060: Fix b64_pton output buffer overrun test for exact-sized buffer
emaste [Mon, 23 Mar 2015 20:50:28 +0000 (20:50 +0000)]
MFC r275060: Fix b64_pton output buffer overrun test for exact-sized buffer

  b64_pton would sometimes erroneously fail to decode a base64 string into
  a precisely sized buffer. The overflow check was a little too greedy.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280398 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277948:
pfg [Mon, 23 Mar 2015 20:00:35 +0000 (20:00 +0000)]
MFC r277948:
msun: use previously ignored "in" value.

This fixes evaluation of exceptional values in scalblnl().
While here, simplify the code as suggested by Bruce Evans.

Reported by: clang static analyzer

git-svn-id: svn://svn.freebsd.org/base/stable/10@280396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279037:
pfg [Mon, 23 Mar 2015 19:50:21 +0000 (19:50 +0000)]
MFC r279037:
dbm_delete(3): correct man page to match current behaviour.

"The dbm_store() and dbm_delete() functions shall return 0 when they
succeed and a negative value when they fail."

Reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html

PR: 42422
Suggested by: delphij

git-svn-id: svn://svn.freebsd.org/base/stable/10@280394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279186:
pfg [Mon, 23 Mar 2015 19:44:18 +0000 (19:44 +0000)]
MFC r279186:
setmode(3): Make sure that setmode sets errno on failure.

Our man page already documented this partially but now
we provide more consistent behavior.

PR: 136669
Obtained from: NetBSD (CVS rev. 1.31, 1.33)
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@280392 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC revisions 274068, 274119, 279624:
dteske [Mon, 23 Mar 2015 19:12:55 +0000 (19:12 +0000)]
MFC revisions 274068, 274119, 279624:
r274068: Add key+=append syntax to sysrc(8)
r279624: Add key-=remove syntax
r274119: Add EXAMPLES-section entries for new syntax

Reviewed by: shurd (r274068)
Thanks to: seanc
Relnotes: sysrc(8) now supports key+=append and key-=remove

git-svn-id: svn://svn.freebsd.org/base/stable/10@280390 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279957, r280017: Add DSM TRIM command support for virtual AHCI disks.
mav [Mon, 23 Mar 2015 14:36:53 +0000 (14:36 +0000)]
MFC r279957, r280017: Add DSM TRIM command support for virtual AHCI disks.

It works only for virtual disks backed by ZVOLs and raw devices supporting
BIO_DELETE.  Virtual disks backed by files won't report this capability.

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@280370 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277487:
kib [Mon, 23 Mar 2015 13:38:33 +0000 (13:38 +0000)]
MFC r277487:
An update for the i915 GPU driver, which brings the code up to Linux
commit 4d93914ae3db4a897ead4b.

MFC r277959 (by adrian):
Fix backlight for ivybridge based laptops (and whatever else comes through
this codepath.)

MFC r278146:
Do not attach to the unsupported chipsets, unless magic tunable is
frobbed.

MFC r278147, r278148:
Fix sign for the error code returned from the driver-specific code.

MFC r278152:
Do not access gmbus_ports array past its end.

MFC r278159 (by emaste):
Remove duplicate intel_fbc_enabled prototype.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280369 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280293: Add missing variable initialization.
mav [Mon, 23 Mar 2015 11:48:25 +0000 (11:48 +0000)]
MFC r280293: Add missing variable initialization.

Reported by: Coverity
CID: 1288938

git-svn-id: svn://svn.freebsd.org/base/stable/10@280363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoDefeat race with texinfo tools built with make bootstrap-tools
ngie [Sun, 22 Mar 2015 22:00:29 +0000 (22:00 +0000)]
Defeat race with texinfo tools built with make bootstrap-tools

This is a direct commit to stable/10 because texinfo has been removed from
head

git-svn-id: svn://svn.freebsd.org/base/stable/10@280356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279919: Using parent DMA tag in drm_pci_alloc(). This can allow
jah [Sun, 22 Mar 2015 18:32:37 +0000 (18:32 +0000)]
MFC r279919: Using parent DMA tag in drm_pci_alloc(). This can allow
drm2 devices to work with Intel DMAR enabled for the system, as long as
DMAR is disabled for the drm2 device.

Reviewed by: kib (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@280353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279842, r279875
scottl [Sun, 22 Mar 2015 12:49:57 +0000 (12:49 +0000)]
MFC r279842, r279875

Implement basic reporting of cpuset info via the -S option

Obtained from: Netflix, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r280253:
kib [Sun, 22 Mar 2015 09:12:44 +0000 (09:12 +0000)]
MFC r280253:
Fix syntax error.

git-svn-id: svn://svn.freebsd.org/base/stable/10@280343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoRemove dependency between usr.bin/m4 and lib/libohash
ngie [Sun, 22 Mar 2015 08:47:35 +0000 (08:47 +0000)]
Remove dependency between usr.bin/m4 and lib/libohash

libohash doesn't exist on stable/10 (only head)

Not sure why my make buildworld didn't catch any issues

This is a direct commit to stable/10 as a followup to r280340

git-svn-id: svn://svn.freebsd.org/base/stable/10@280341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279197,r279198:
ngie [Sun, 22 Mar 2015 08:42:44 +0000 (08:42 +0000)]
MFC r279197,r279198:

r279197:

Parallelize building bootstrap-tools

Differential Revision: https://reviews.freebsd.org/D1901
Reviewed by: ian
No serious objections from: imp

r279198:

Fill in missing dependencies for dtrace related tools so the bootstrap-tools
compiles properly on older hosts

Pointyhat to: me

git-svn-id: svn://svn.freebsd.org/base/stable/10@280340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f