Deleted Added
full compact
sfxge.h (272325) sfxge.h (272328)
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.h 272325 2014-09-30 20:18:10Z gnn $
29 * $FreeBSD: head/sys/dev/sfxge/sfxge.h 272328 2014-09-30 20:36:07Z gnn $
30 */
31
32#ifndef _SFXGE_H
33#define _SFXGE_H
34
35#include <sys/param.h>
36#include <sys/kernel.h>
37#include <sys/condvar.h>

--- 44 unchanged lines hidden (view full) ---

82#endif
83#ifndef CTLTYPE_U64
84#define CTLTYPE_U64 CTLTYPE_QUAD
85#endif
86
87#include "sfxge_rx.h"
88#include "sfxge_tx.h"
89
30 */
31
32#ifndef _SFXGE_H
33#define _SFXGE_H
34
35#include <sys/param.h>
36#include <sys/kernel.h>
37#include <sys/condvar.h>

--- 44 unchanged lines hidden (view full) ---

82#endif
83#ifndef CTLTYPE_U64
84#define CTLTYPE_U64 CTLTYPE_QUAD
85#endif
86
87#include "sfxge_rx.h"
88#include "sfxge_tx.h"
89
90#define ROUNDUP_POW_OF_TWO(_n) (1ULL << flsl((_n) - 1))
91
90#define SFXGE_IP_ALIGN 2
91
92#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */
93
94enum sfxge_evq_state {
95 SFXGE_EVQ_UNINITIALIZED = 0,
96 SFXGE_EVQ_INITIALIZED,
97 SFXGE_EVQ_STARTING,
98 SFXGE_EVQ_STARTED
99};
100
101#define SFXGE_EV_BATCH 16384
102
103struct sfxge_evq {
104 struct sfxge_softc *sc __aligned(CACHE_LINE_SIZE);
105 struct mtx lock __aligned(CACHE_LINE_SIZE);
106
107 enum sfxge_evq_state init_state;
108 unsigned int index;
92#define SFXGE_IP_ALIGN 2
93
94#define SFXGE_ETHERTYPE_LOOPBACK 0x9000 /* Xerox loopback */
95
96enum sfxge_evq_state {
97 SFXGE_EVQ_UNINITIALIZED = 0,
98 SFXGE_EVQ_INITIALIZED,
99 SFXGE_EVQ_STARTING,
100 SFXGE_EVQ_STARTED
101};
102
103#define SFXGE_EV_BATCH 16384
104
105struct sfxge_evq {
106 struct sfxge_softc *sc __aligned(CACHE_LINE_SIZE);
107 struct mtx lock __aligned(CACHE_LINE_SIZE);
108
109 enum sfxge_evq_state init_state;
110 unsigned int index;
111 unsigned int entries;
109 efsys_mem_t mem;
110 unsigned int buf_base_id;
111
112 boolean_t exception;
113
114 efx_evq_t *common;
115 unsigned int read_ptr;
116 unsigned int rx_done;
117 unsigned int tx_done;
118
119 /* Linked list of TX queues with completions to process */
120 struct sfxge_txq *txq;
121 struct sfxge_txq **txqs;
122};
123
112 efsys_mem_t mem;
113 unsigned int buf_base_id;
114
115 boolean_t exception;
116
117 efx_evq_t *common;
118 unsigned int read_ptr;
119 unsigned int rx_done;
120 unsigned int tx_done;
121
122 /* Linked list of TX queues with completions to process */
123 struct sfxge_txq *txq;
124 struct sfxge_txq **txqs;
125};
126
124#define SFXGE_NEVS 4096
125#define SFXGE_NDESCS 1024
126#define SFXGE_MODERATION 30
127
128enum sfxge_intr_state {
129 SFXGE_INTR_UNINITIALIZED = 0,
130 SFXGE_INTR_INITIALIZED,
131 SFXGE_INTR_TESTING,
132 SFXGE_INTR_STARTED

--- 71 unchanged lines hidden (view full) ---

204 struct task task_reset;
205
206 efx_family_t family;
207 caddr_t vpd_data;
208 size_t vpd_size;
209 efx_nic_t *enp;
210 struct mtx enp_lock;
211
127#define SFXGE_NDESCS 1024
128#define SFXGE_MODERATION 30
129
130enum sfxge_intr_state {
131 SFXGE_INTR_UNINITIALIZED = 0,
132 SFXGE_INTR_INITIALIZED,
133 SFXGE_INTR_TESTING,
134 SFXGE_INTR_STARTED

--- 71 unchanged lines hidden (view full) ---

206 struct task task_reset;
207
208 efx_family_t family;
209 caddr_t vpd_data;
210 size_t vpd_size;
211 efx_nic_t *enp;
212 struct mtx enp_lock;
213
214 unsigned int rxq_entries;
215 unsigned int txq_entries;
216
212 bus_dma_tag_t parent_dma_tag;
213 efsys_bar_t bar;
214
215 struct sfxge_intr intr;
216 struct sfxge_mcdi mcdi;
217 struct sfxge_port port;
218 uint32_t buffer_table_next;
219

--- 21 unchanged lines hidden (view full) ---

241#ifndef SFXGE_HAVE_MQ
242 struct mtx tx_lock __aligned(CACHE_LINE_SIZE);
243#endif
244};
245
246#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
247#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
248
217 bus_dma_tag_t parent_dma_tag;
218 efsys_bar_t bar;
219
220 struct sfxge_intr intr;
221 struct sfxge_mcdi mcdi;
222 struct sfxge_port port;
223 uint32_t buffer_table_next;
224

--- 21 unchanged lines hidden (view full) ---

246#ifndef SFXGE_HAVE_MQ
247 struct mtx tx_lock __aligned(CACHE_LINE_SIZE);
248#endif
249};
250
251#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
252#define SFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
253
254#define SFXGE_PARAM(_name) "hw.sfxge." #_name
255
256SYSCTL_DECL(_hw_sfxge);
257
249/*
250 * From sfxge.c.
251 */
252extern void sfxge_schedule_reset(struct sfxge_softc *sc);
253extern void sfxge_sram_buf_tbl_alloc(struct sfxge_softc *sc, size_t n,
254 uint32_t *idp);
255
256/*

--- 48 unchanged lines hidden ---
258/*
259 * From sfxge.c.
260 */
261extern void sfxge_schedule_reset(struct sfxge_softc *sc);
262extern void sfxge_sram_buf_tbl_alloc(struct sfxge_softc *sc, size_t n,
263 uint32_t *idp);
264
265/*

--- 48 unchanged lines hidden ---