198611 Commits

Author SHA1 Message Date
arybchik
04d32c238f MFC: 280163
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)
2015-03-25 13:45:20 +00:00
arybchik
71c9b1feb3 MFC: 280162
sfxge: adding version info to device description

The information is required for NIC update and config tools.

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:44:01 +00:00
arybchik
323881a000 MFC: 280161
sfxge: move deferred packet list statistics to dedicated node

It is done to structure sysctl and do not mix with Tx queue statistics
to be added.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:42:37 +00:00
arybchik
716ce1ca36 MFC: 280160
sfxge: add tunables to control LRO parameters on driver load time

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:41:26 +00:00
arybchik
ddeba7284f MFC: 279351
sfxge: expect required init_state on data path and in periodic calls

With the patch applied the number of instruction events is 1% less and
number of mispredicted branch events is 5% less under multistream TCP
traffic load close to line rate.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:18:51 +00:00
arybchik
e601483ad6 MFC: 279266
sfxge: correct limit for number of Rx queues

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:15:47 +00:00
arybchik
972b15c05b MFC: 279231
sfxge: add put-list high watermark

It is interesting to know how long put-list grows.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:14:50 +00:00
hselasky
9c325f67a8 MFC r280322 and r280429:
The synchronisation value returned by the so-called feedback endpoint
appears to be too inaccurate that it can be used to synchronize the
playback data stream. If there is a recording endpoint associated with
the playback endpoint, use that instead. That means if the isochronous
OUT endpoint is asynchronus the USB audio driver will automatically
start recording, if possible, to get exact information about the
needed sample rate adjustments. In no recording endpoint is present,
no rate adaption will be done.

While at it fix an issue where the hardware buffer pointers don't get
reset at the first device PCM trigger.

Make some variables 32-bit to avoid problems with multithreading.

Use the feedback value from the synchronization endpoint as fallback
when there is no recording channel.

PR: 		198444
2015-03-25 13:14:25 +00:00
arybchik
9265dbcd9c MFC: 279230
sfxge: use goto to cleanup to avoid duplicate cleanup code

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:13:32 +00:00
arybchik
ba7bae884a MFC: 279183
sfxge: add common code support for changing TX queue pace

To delay packets from a particular TX queue by a particular time, write a value
into the TX Pace table s.t. pace time <= TX Pace Clock Period * (2 ^ pace value)
- the TX pace clock is 1/13 of the system clock, so its period should be 104 or
52 ns depending on whether turbo mode is active.

EFX_TX_PACE_CLOCK_BASE added by me.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:12:15 +00:00
arybchik
7226fa93ca MFC: 279182
sfxge: correct event queue interrupt moderation timer quanta

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:11:19 +00:00
arybchik
e5108d2f31 MFC: 279181
sfxge: add indefinite article and update timestamp

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:09:46 +00:00
arybchik
4e10773aa1 MFC: 279179
sfxge: DMA allocated memory is set to zeros because of BUS_DMA_ZERO flag

It is not required to set it to zeros once again.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:06:37 +00:00
arybchik
2f95e74aa7 MFC: 279178
sfxge: do no allow EFSYS_MEM_ALLOC sleep

It solves locking problem when EFSYS_MEM_ALLOC is called in
the context holding a mutex (not allowed to sleep).
E.g. on interface bring up or multicast addresses addition.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:05:33 +00:00
arybchik
59a10077f4 MFC: 279177
sfxge: assert event queue lock in event handlers

It is useful to highlight lock context.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:04:28 +00:00
arybchik
8d456b11c8 MFC: 279176
sfxge: pass correct address to free allocated memory in the case of load error

It is one more place missed in the previous fix.
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)
2015-03-25 13:03:36 +00:00
arybchik
24cc1ba6e9 MFC: 279175
sfxge: using bus_space_*_stream_* API for better portability

Host-bus byte order translation is not requred.

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:02:33 +00:00
hselasky
f07b924bdc 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()
2015-03-25 13:01:51 +00:00
arybchik
be80a2b27d MFC: 279174
sfxge: add missing Siena sensors to common code

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 13:01:10 +00:00
arybchik
2d11e05f54 MFC: 279173
sfxge: add missing common code NVRAM types and map from MCDI

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 12:59:49 +00:00
arybchik
15d431ecd8 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)
2015-03-25 12:59:01 +00:00
arybchik
eb99d14089 MFC: 279147
sfxge: TxQ block level should use EFX_TXQ_LIMIT as maximum TxQ size

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 12:57:43 +00:00
hselasky
b416a7471e MFC r279725:
Add more USB IDs.

PR:		197753
2015-03-25 11:12:48 +00:00
arybchik
5550e78279 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)
2015-03-25 11:10:56 +00:00
arybchik
6155128a58 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)
2015-03-25 11:09:35 +00:00
arybchik
8e30d2d6d2 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)
2015-03-25 11:08:41 +00:00
arybchik
0d82d7d167 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)
2015-03-25 11:07:56 +00:00
arybchik
6dd6339d3b MFC: 279142
sfxge: synchronize EF10 registers header

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 11:07:10 +00:00
arybchik
58c0feede7 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)
2015-03-25 11:06:16 +00:00
arybchik
cd01d51435 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)
2015-03-25 11:04:12 +00:00
arybchik
3bb5a22494 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)
2015-03-25 11:01:58 +00:00
arybchik
94a1f15204 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)
2015-03-25 11:01:03 +00:00
arybchik
35a2333ab2 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)
2015-03-25 11:00:09 +00:00
arybchik
db246d0cee MFC: 279094
sfxge: more accurate calculation of maximum number of TSO segments

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 10:59:24 +00:00
arybchik
4f836db713 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)
2015-03-25 10:58:21 +00:00
arybchik
26f590d57c 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)
2015-03-25 10:57:26 +00:00
arybchik
7f3d3b1939 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)
2015-03-25 10:56:10 +00:00
hselasky
da7dc9ab83 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
2015-03-25 10:55:08 +00:00
arybchik
b302acbcb9 MFC: 279076
sfxge: regenerate sensor map

Add Florence R7 and Modena sensors.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 10:54:23 +00:00
arybchik
bb6987378b 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)
2015-03-25 10:53:27 +00:00
arybchik
322c865fce MFC: 279047
sfxge: regenerate MCDI protocol headers

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 10:52:35 +00:00
arybchik
7c9833eb0a 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)
2015-03-25 10:51:08 +00:00
hselasky
8469a4052b MFC r280264:
Define BINDIR for some test utilities.

Sponsored by:	Mellanox Technologies
2015-03-25 10:50:13 +00:00
arybchik
8227b6f52a 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)
2015-03-25 10:49:45 +00:00
arybchik
e472f6b337 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)
2015-03-25 10:48:28 +00:00
arybchik
0509fc47c7 MFC: 279180
sfxge: list header in SRCS

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 10:46:04 +00:00
arybchik
32df0e7029 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)
2015-03-25 10:44:30 +00:00
hselasky
eb5728a24f MFC r280211:
Add missing void pointer argument to SYSINIT() functions.

Sponsored by:   Mellanox Technologies
2015-03-25 10:44:09 +00:00
arybchik
e8248a736a 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)
2015-03-25 10:43:06 +00:00
arybchik
5b1e831026 MFC: 278938
sfxge: add driver context member with number of transmit queues

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-03-25 10:42:19 +00:00