cxgb_adapter.h (9b4de886f9780a973727a4d46fbc21a9fa999398) cxgb_adapter.h (25292deb42c1c99213f6d603cf461b950691cc79)
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

42#include <sys/socket.h>
43#include <sys/sockio.h>
44#include <sys/condvar.h>
45
46#include <net/ethernet.h>
47#include <net/if.h>
48#include <net/if_media.h>
49#include <net/if_dl.h>
1/**************************************************************************
2
3Copyright (c) 2007, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

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

42#include <sys/socket.h>
43#include <sys/sockio.h>
44#include <sys/condvar.h>
45
46#include <net/ethernet.h>
47#include <net/if.h>
48#include <net/if_media.h>
49#include <net/if_dl.h>
50#include <netinet/tcp_lro.h>
50
51#include <machine/bus.h>
52#include <machine/resource.h>
53
54#include <sys/bus_dma.h>
55#include <dev/pci/pcireg.h>
56#include <dev/pci/pcivar.h>
57

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

167
168
169/*
170 * work request size in bytes
171 */
172#define WR_LEN (WR_FLITS * 8)
173#define PIO_LEN (WR_LEN - sizeof(struct cpl_tx_pkt_lso))
174
51
52#include <machine/bus.h>
53#include <machine/resource.h>
54
55#include <sys/bus_dma.h>
56#include <dev/pci/pcireg.h>
57#include <dev/pci/pcivar.h>
58

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

168
169
170/*
171 * work request size in bytes
172 */
173#define WR_LEN (WR_FLITS * 8)
174#define PIO_LEN (WR_LEN - sizeof(struct cpl_tx_pkt_lso))
175
175
176/* careful, the following are set on priv_flags and must not collide with
177 * IFF_ flags!
178 */
179enum {
180 LRO_ACTIVE = (1 << 8),
181};
182
183/* Max concurrent LRO sessions per queue set */
184#define MAX_LRO_SES 8
185
186struct t3_lro_session {
187 struct mbuf *head;
188 struct mbuf *tail;
189 uint32_t seq;
190 uint16_t ip_len;
191 uint16_t mss;
192 uint16_t vtag;
193 uint8_t npkts;
194};
195
196struct lro_state {
197 unsigned short enabled;
176struct lro_state {
177 unsigned short enabled;
198 unsigned short active_idx;
199 unsigned int nactive;
200 struct t3_lro_session sess[MAX_LRO_SES];
178 struct lro_ctrl ctrl;
201};
202
203#define RX_BUNDLE_SIZE 8
204
205struct rsp_desc;
206
207struct sge_rspq {
208 uint32_t credits;

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

311
312
313enum {
314 SGE_PSTAT_TSO, /* # of TSO requests */
315 SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */
316 SGE_PSTAT_TX_CSUM, /* # of TX checksum offloads */
317 SGE_PSTAT_VLANEX, /* # of VLAN tag extractions */
318 SGE_PSTAT_VLANINS, /* # of VLAN tag insertions */
179};
180
181#define RX_BUNDLE_SIZE 8
182
183struct rsp_desc;
184
185struct sge_rspq {
186 uint32_t credits;

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

289
290
291enum {
292 SGE_PSTAT_TSO, /* # of TSO requests */
293 SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */
294 SGE_PSTAT_TX_CSUM, /* # of TX checksum offloads */
295 SGE_PSTAT_VLANEX, /* # of VLAN tag extractions */
296 SGE_PSTAT_VLANINS, /* # of VLAN tag insertions */
319 SGE_PSTATS_LRO_QUEUED, /* # of LRO appended packets */
320 SGE_PSTATS_LRO_FLUSHED, /* # of LRO flushed packets */
321 SGE_PSTATS_LRO_X_STREAMS, /* # of exceeded LRO contexts */
322};
323
297};
298
324#define SGE_PSTAT_MAX (SGE_PSTATS_LRO_X_STREAMS+1)
299#define SGE_PSTAT_MAX (SGE_PSTAT_VLANINS+1)
325
326#define QS_EXITING 0x1
327#define QS_RUNNING 0x2
328#define QS_BOUND 0x4
329
330struct sge_qset {
331 struct sge_rspq rspq;
332 struct sge_fl fl[SGE_RXQ_PER_SET];

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

582
583int t3_sge_init_adapter(adapter_t *);
584int t3_sge_reset_adapter(adapter_t *);
585int t3_sge_init_port(struct port_info *);
586void t3_sge_deinit_sw(adapter_t *);
587void t3_free_tx_desc(struct sge_txq *q, int n);
588void t3_free_tx_desc_all(struct sge_txq *q);
589
300
301#define QS_EXITING 0x1
302#define QS_RUNNING 0x2
303#define QS_BOUND 0x4
304
305struct sge_qset {
306 struct sge_rspq rspq;
307 struct sge_fl fl[SGE_RXQ_PER_SET];

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

557
558int t3_sge_init_adapter(adapter_t *);
559int t3_sge_reset_adapter(adapter_t *);
560int t3_sge_init_port(struct port_info *);
561void t3_sge_deinit_sw(adapter_t *);
562void t3_free_tx_desc(struct sge_txq *q, int n);
563void t3_free_tx_desc_all(struct sge_txq *q);
564
590void t3_rx_eth_lro(adapter_t *adap, struct sge_rspq *rq, struct mbuf *m,
591 int ethpad, uint32_t rss_hash, uint32_t rss_csum, int lro);
592void t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad);
565void t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad);
593void t3_lro_flush(adapter_t *adap, struct sge_qset *qs, struct lro_state *state);
594
595void t3_add_attach_sysctls(adapter_t *sc);
596void t3_add_configured_sysctls(adapter_t *sc);
597int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
598 unsigned char *data);
599void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
600/*
601 * XXX figure out how we can return this to being private to sge

--- 47 unchanged lines hidden ---
566
567void t3_add_attach_sysctls(adapter_t *sc);
568void t3_add_configured_sysctls(adapter_t *sc);
569int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
570 unsigned char *data);
571void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
572/*
573 * XXX figure out how we can return this to being private to sge

--- 47 unchanged lines hidden ---