sfxge_tx.h (263649) | sfxge_tx.h (272325) |
---|---|
1/*- 2 * Copyright (c) 2010-2011 Solarflare Communications, Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2010-2011 Solarflare Communications, Inc. 3 * All rights reserved. 4 * 5 * This software was developed in part by Philip Paeps under contract for 6 * Solarflare Communications, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/dev/sfxge/sfxge_tx.h 263649 2014-03-22 18:24:44Z glebius $ | 29 * $FreeBSD: head/sys/dev/sfxge/sfxge_tx.h 272325 2014-09-30 20:18:10Z gnn $ |
30 */ 31 32#ifndef _SFXGE_TX_H | 30 */ 31 32#ifndef _SFXGE_TX_H |
33#define _SFXGE_TX_H | 33#define _SFXGE_TX_H |
34 35#include <netinet/in.h> 36#include <netinet/ip.h> 37#include <netinet/tcp.h> 38 39/* Maximum number of DMA segments needed to map an mbuf chain. With 40 * TSO, the mbuf length may be just over 64K, divided into 2K mbuf 41 * clusters. (The chain could be longer than this initially, but can 42 * be shortened with m_collapse().) 43 */ 44#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) 45 46/* Maximum number of DMA segments needed to map an output packet. It 47 * could overlap all mbufs in the chain and also require an extra 48 * segment for a TSO header. 49 */ | 34 35#include <netinet/in.h> 36#include <netinet/ip.h> 37#include <netinet/tcp.h> 38 39/* Maximum number of DMA segments needed to map an mbuf chain. With 40 * TSO, the mbuf length may be just over 64K, divided into 2K mbuf 41 * clusters. (The chain could be longer than this initially, but can 42 * be shortened with m_collapse().) 43 */ 44#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) 45 46/* Maximum number of DMA segments needed to map an output packet. It 47 * could overlap all mbufs in the chain and also require an extra 48 * segment for a TSO header. 49 */ |
50#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1) | 50#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1) |
51 52/* 53 * Buffer mapping flags. 54 * 55 * Buffers and DMA mappings must be freed when the last descriptor 56 * referring to them is completed. Set the TX_BUF_UNMAP and 57 * TX_BUF_MBUF flags on the last descriptor generated for an mbuf 58 * chain. Set only the TX_BUF_UNMAP flag on a descriptor referring to --- 47 unchanged lines hidden (view full) --- 106 SFXGE_TXQ_NTYPES 107}; 108 109#define SFXGE_TXQ_UNBLOCK_LEVEL (EFX_TXQ_LIMIT(SFXGE_NDESCS) / 4) 110 111#define SFXGE_TX_BATCH 64 112 113#ifdef SFXGE_HAVE_MQ | 51 52/* 53 * Buffer mapping flags. 54 * 55 * Buffers and DMA mappings must be freed when the last descriptor 56 * referring to them is completed. Set the TX_BUF_UNMAP and 57 * TX_BUF_MBUF flags on the last descriptor generated for an mbuf 58 * chain. Set only the TX_BUF_UNMAP flag on a descriptor referring to --- 47 unchanged lines hidden (view full) --- 106 SFXGE_TXQ_NTYPES 107}; 108 109#define SFXGE_TXQ_UNBLOCK_LEVEL (EFX_TXQ_LIMIT(SFXGE_NDESCS) / 4) 110 111#define SFXGE_TX_BATCH 64 112 113#ifdef SFXGE_HAVE_MQ |
114#define SFXGE_TXQ_LOCK(txq) (&(txq)->lock) 115#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc) | 114#define SFXGE_TXQ_LOCK(txq) (&(txq)->lock) 115#define SFXGE_TX_SCALE(sc) ((sc)->intr.n_alloc) |
116#else | 116#else |
117#define SFXGE_TXQ_LOCK(txq) (&(txq)->sc->tx_lock) 118#define SFXGE_TX_SCALE(sc) 1 | 117#define SFXGE_TXQ_LOCK(txq) (&(txq)->sc->tx_lock) 118#define SFXGE_TX_SCALE(sc) 1 |
119#endif 120 121struct sfxge_txq { 122 /* The following fields should be written very rarely */ 123 struct sfxge_softc *sc; 124 enum sfxge_txq_state init_state; 125 enum sfxge_flush_state flush_state; 126 enum sfxge_txq_type type; --- 61 unchanged lines hidden --- | 119#endif 120 121struct sfxge_txq { 122 /* The following fields should be written very rarely */ 123 struct sfxge_softc *sc; 124 enum sfxge_txq_state init_state; 125 enum sfxge_flush_state flush_state; 126 enum sfxge_txq_type type; --- 61 unchanged lines hidden --- |