4 * Copyright(c) 2014-2016 Chelsio Communications.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Chelsio Communications nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 /* This file should not be included directly. Include common.h instead. */
36 #ifndef __T4_ADAPTER_H__
37 #define __T4_ADAPTER_H__
42 #include "cxgbe_compat.h"
43 #include "t4_regs_values.h"
46 MAX_ETH_QSETS = 64, /* # of Ethernet Tx/Rx queue sets */
53 PORT_RSS_DONE = (1 << 0),
57 struct adapter *adapter; /* adapter that this port belongs to */
58 struct rte_eth_dev *eth_dev; /* associated rte eth device */
59 struct port_stats stats_base; /* port statistics base */
60 struct link_config link_cfg; /* link configuration info */
62 unsigned long flags; /* port related flags */
63 short int xact_addr_filt; /* index of exact MAC address filter */
65 u16 viid; /* associated virtual interface id */
66 s8 mdio_addr; /* address of the PHY */
67 u8 port_type; /* firmware port type */
68 u8 mod_type; /* firmware module type */
69 u8 port_id; /* physical port ID */
70 u8 tx_chan; /* associated channel */
72 u8 n_rx_qsets; /* # of rx qsets */
73 u8 n_tx_qsets; /* # of tx qsets */
74 u8 first_qset; /* index of first qset */
76 u16 *rss; /* rss table */
77 u8 rss_mode; /* rss mode */
78 u16 rss_size; /* size of VI's RSS table slice */
81 /* Enable or disable autonegotiation. If this is set to enable,
82 * the forced link modes above are completely ignored.
84 #define AUTONEG_DISABLE 0x00
85 #define AUTONEG_ENABLE 0x01
87 enum { /* adapter flags */
88 FULL_INIT_DONE = (1 << 0),
90 USING_MSIX = (1 << 2),
91 FW_QUEUE_BOUND = (1 << 3),
93 CFG_QUEUES = (1 << 5),
97 struct rx_sw_desc { /* SW state per Rx descriptor */
98 void *buf; /* struct page or mbuf */
102 struct sge_fl { /* SGE free-buffer queue state */
104 struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
106 dma_addr_t addr; /* bus address of HW ring start */
107 __be64 *desc; /* address of HW Rx descriptor ring */
109 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
110 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
112 unsigned int cntxt_id; /* SGE relative QID for the free list */
113 unsigned int size; /* capacity of free list */
115 unsigned int avail; /* # of available Rx buffers */
116 unsigned int pend_cred; /* new buffers since last FL DB ring */
117 unsigned int cidx; /* consumer index */
118 unsigned int pidx; /* producer index */
120 unsigned long alloc_failed; /* # of times buffer allocation failed */
121 unsigned long low; /* # of times momentarily starving */
124 #define MAX_MBUF_FRAGS (16384 / 512 + 2)
126 /* A packet gather list */
129 struct rte_mbuf *mbufs[MAX_MBUF_FRAGS];
131 void *va; /* virtual address of first byte */
132 unsigned int nfrags; /* # of fragments */
133 unsigned int tot_len; /* total length of fragments */
134 bool usembufs; /* use mbufs for fragments */
137 typedef int (*rspq_handler_t)(struct sge_rspq *q, const __be64 *rsp,
138 const struct pkt_gl *gl);
140 struct sge_rspq { /* state for an SGE response queue */
141 struct adapter *adapter; /* adapter that this queue belongs to */
142 struct rte_eth_dev *eth_dev; /* associated rte eth device */
143 struct rte_mempool *mb_pool; /* associated mempool */
145 dma_addr_t phys_addr; /* physical address of the ring */
146 __be64 *desc; /* address of HW response ring */
147 const __be64 *cur_desc; /* current descriptor in queue */
149 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
150 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
152 unsigned int cidx; /* consumer index */
153 unsigned int gts_idx; /* last gts write sent */
154 unsigned int iqe_len; /* entry size */
155 unsigned int size; /* capacity of response queue */
156 int offset; /* offset into current Rx buffer */
158 u8 gen; /* current generation bit */
159 u8 intr_params; /* interrupt holdoff parameters */
160 u8 next_intr_params; /* holdoff params for next interrupt */
161 u8 pktcnt_idx; /* interrupt packet threshold */
162 u8 port_id; /* associated port-id */
163 u8 idx; /* queue index within its group */
164 u16 cntxt_id; /* SGE relative QID for the response Q */
165 u16 abs_id; /* absolute SGE id for the response q */
167 rspq_handler_t handler; /* associated handler for this response q */
170 struct sge_eth_rx_stats { /* Ethernet rx queue statistics */
171 u64 pkts; /* # of ethernet packets */
172 u64 rx_bytes; /* # of ethernet bytes */
173 u64 rx_cso; /* # of Rx checksum offloads */
174 u64 vlan_ex; /* # of Rx VLAN extractions */
175 u64 rx_drops; /* # of packets dropped due to no mem */
178 struct sge_eth_rxq { /* a SW Ethernet Rx queue */
179 struct sge_rspq rspq;
181 struct sge_eth_rx_stats stats;
182 bool usembufs; /* one ingress packet per mbuf FL buffer */
183 } __rte_cache_aligned;
186 * Currently there are two types of coalesce WR. Type 0 needs 48 bytes per
187 * packet (if one sgl is present) and type 1 needs 32 bytes. This means
188 * that type 0 can fit a maximum of 10 packets per WR and type 1 can fit
189 * 15 packets. We need to keep track of the mbuf pointers in a coalesce WR
190 * to be able to free those mbufs when we get completions back from the FW.
191 * Allocating the maximum number of pointers in every tx desc is a waste
192 * of memory resources so we only store 2 pointers per tx desc which should
193 * be enough since a tx desc can only fit 2 packets in the best case
194 * scenario where a packet needs 32 bytes.
196 #define ETH_COALESCE_PKT_NUM 15
197 #define ETH_COALESCE_PKT_PER_DESC 2
199 struct tx_eth_coal_desc {
200 struct rte_mbuf *mbuf[ETH_COALESCE_PKT_PER_DESC];
201 struct ulptx_sgl *sgl[ETH_COALESCE_PKT_PER_DESC];
209 struct tx_sw_desc { /* SW state per Tx descriptor */
210 struct rte_mbuf *mbuf;
211 struct ulptx_sgl *sgl;
212 struct tx_eth_coal_desc coalesce;
216 EQ_STOPPED = (1 << 0),
219 struct eth_coalesce {
229 struct tx_desc *desc; /* address of HW Tx descriptor ring */
230 struct tx_sw_desc *sdesc; /* address of SW Tx descriptor ring */
231 struct sge_qstat *stat; /* queue status entry */
232 struct eth_coalesce coalesce; /* coalesce info */
234 uint64_t phys_addr; /* physical address of the ring */
236 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
237 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
239 unsigned int cntxt_id; /* SGE relative QID for the Tx Q */
240 unsigned int in_use; /* # of in-use Tx descriptors */
241 unsigned int size; /* # of descriptors */
242 unsigned int cidx; /* SW consumer index */
243 unsigned int pidx; /* producer index */
244 unsigned int dbidx; /* last idx when db ring was done */
245 unsigned int equeidx; /* last sent credit request */
246 unsigned int last_pidx; /* last pidx recorded by tx monitor */
247 unsigned int last_coal_idx;/* last coal-idx recorded by tx monitor */
249 int db_disabled; /* doorbell state */
250 unsigned short db_pidx; /* doorbell producer index */
251 unsigned short db_pidx_inc; /* doorbell producer increment */
254 struct sge_eth_tx_stats { /* Ethernet tx queue statistics */
255 u64 pkts; /* # of ethernet packets */
256 u64 tx_bytes; /* # of ethernet bytes */
257 u64 tso; /* # of TSO requests */
258 u64 tx_cso; /* # of Tx checksum offloads */
259 u64 vlan_ins; /* # of Tx VLAN insertions */
260 u64 mapping_err; /* # of I/O MMU packet mapping errors */
261 u64 coal_wr; /* # of coalesced wr */
262 u64 coal_pkts; /* # of coalesced packets */
265 struct sge_eth_txq { /* state for an SGE Ethernet Tx queue */
267 struct rte_eth_dev *eth_dev; /* port that this queue belongs to */
268 struct sge_eth_tx_stats stats; /* queue statistics */
269 rte_spinlock_t txq_lock;
271 unsigned int flags; /* flags for state of the queue */
272 } __rte_cache_aligned;
275 struct sge_eth_txq ethtxq[MAX_ETH_QSETS];
276 struct sge_eth_rxq ethrxq[MAX_ETH_QSETS];
277 struct sge_rspq fw_evtq __rte_cache_aligned;
279 u16 max_ethqsets; /* # of available Ethernet queue sets */
280 u32 stat_len; /* length of status page at ring end */
281 u32 pktshift; /* padding between CPL & packet data */
283 /* response queue interrupt parameters */
284 u16 timer_val[SGE_NTIMERS];
285 u8 counter_val[SGE_NCOUNTERS];
287 u32 fl_align; /* response queue message alignment */
288 u32 fl_pg_order; /* large page allocation size */
289 u32 fl_starve_thres; /* Free List starvation threshold */
292 #define T4_OS_NEEDS_MBOX_LOCKING 1
295 * OS Lock/List primitives for those interfaces in the Common Code which
300 TAILQ_ENTRY(mbox_entry) next;
303 TAILQ_HEAD(mbox_list, mbox_entry);
306 struct rte_pci_device *pdev; /* associated rte pci device */
307 struct rte_eth_dev *eth_dev; /* first port's rte eth device */
308 struct adapter_params params; /* adapter parameters */
309 struct port_info port[MAX_NPORTS]; /* ports belonging to this adapter */
310 struct sge sge; /* associated SGE */
312 /* support for single-threading access to adapter mailbox registers */
313 struct mbox_list mbox_list;
314 rte_spinlock_t mbox_lock;
316 u8 *regs; /* pointer to registers region */
317 u8 *bar2; /* pointer to bar2 region */
318 unsigned long flags; /* adapter flags */
319 unsigned int mbox; /* associated mailbox */
320 unsigned int pf; /* associated physical function id */
322 unsigned int vpd_busy;
323 unsigned int vpd_flag;
325 int use_unpacked_mode; /* unpacked rx mode state */
328 #define CXGBE_PCI_REG(reg) rte_read32(reg)
330 static inline uint64_t cxgbe_read_addr64(volatile void *addr)
332 uint64_t val = CXGBE_PCI_REG(addr);
333 uint64_t val2 = CXGBE_PCI_REG(((volatile uint8_t *)(addr) + 4));
335 val2 = (uint64_t)(val2 << 32);
340 static inline uint32_t cxgbe_read_addr(volatile void *addr)
342 return CXGBE_PCI_REG(addr);
345 #define CXGBE_PCI_REG_ADDR(adap, reg) \
346 ((volatile uint32_t *)((char *)(adap)->regs + (reg)))
348 #define CXGBE_READ_REG(adap, reg) \
349 cxgbe_read_addr(CXGBE_PCI_REG_ADDR((adap), (reg)))
351 #define CXGBE_READ_REG64(adap, reg) \
352 cxgbe_read_addr64(CXGBE_PCI_REG_ADDR((adap), (reg)))
354 #define CXGBE_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
356 #define CXGBE_PCI_REG_WRITE_RELAXED(reg, value) \
357 rte_write32_relaxed((value), (reg))
359 #define CXGBE_WRITE_REG(adap, reg, value) \
360 CXGBE_PCI_REG_WRITE(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
362 #define CXGBE_WRITE_REG_RELAXED(adap, reg, value) \
363 CXGBE_PCI_REG_WRITE_RELAXED(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
365 static inline uint64_t cxgbe_write_addr64(volatile void *addr, uint64_t val)
367 CXGBE_PCI_REG_WRITE(addr, val);
368 CXGBE_PCI_REG_WRITE(((volatile uint8_t *)(addr) + 4), (val >> 32));
372 #define CXGBE_WRITE_REG64(adap, reg, value) \
373 cxgbe_write_addr64(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
376 * t4_read_reg - read a HW register
377 * @adapter: the adapter
378 * @reg_addr: the register address
380 * Returns the 32-bit value of the given HW register.
382 static inline u32 t4_read_reg(struct adapter *adapter, u32 reg_addr)
384 u32 val = CXGBE_READ_REG(adapter, reg_addr);
386 CXGBE_DEBUG_REG(adapter, "read register 0x%x value 0x%x\n", reg_addr,
392 * t4_write_reg - write a HW register with barrier
393 * @adapter: the adapter
394 * @reg_addr: the register address
395 * @val: the value to write
397 * Write a 32-bit value into the given HW register.
399 static inline void t4_write_reg(struct adapter *adapter, u32 reg_addr, u32 val)
401 CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
403 CXGBE_WRITE_REG(adapter, reg_addr, val);
407 * t4_write_reg_relaxed - write a HW register with no barrier
408 * @adapter: the adapter
409 * @reg_addr: the register address
410 * @val: the value to write
412 * Write a 32-bit value into the given HW register.
414 static inline void t4_write_reg_relaxed(struct adapter *adapter, u32 reg_addr,
417 CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
419 CXGBE_WRITE_REG_RELAXED(adapter, reg_addr, val);
423 * t4_read_reg64 - read a 64-bit HW register
424 * @adapter: the adapter
425 * @reg_addr: the register address
427 * Returns the 64-bit value of the given HW register.
429 static inline u64 t4_read_reg64(struct adapter *adapter, u32 reg_addr)
431 u64 val = CXGBE_READ_REG64(adapter, reg_addr);
433 CXGBE_DEBUG_REG(adapter, "64-bit read register %#x value %#llx\n",
434 reg_addr, (unsigned long long)val);
439 * t4_write_reg64 - write a 64-bit HW register
440 * @adapter: the adapter
441 * @reg_addr: the register address
442 * @val: the value to write
444 * Write a 64-bit value into the given HW register.
446 static inline void t4_write_reg64(struct adapter *adapter, u32 reg_addr,
449 CXGBE_DEBUG_REG(adapter, "setting register %#x to %#llx\n", reg_addr,
450 (unsigned long long)val);
452 CXGBE_WRITE_REG64(adapter, reg_addr, val);
455 #define PCI_STATUS 0x06 /* 16 bits */
456 #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
457 #define PCI_CAPABILITY_LIST 0x34
458 /* Offset of first capability list entry */
459 #define PCI_CAP_ID_EXP 0x10 /* PCI Express */
460 #define PCI_CAP_LIST_ID 0 /* Capability ID */
461 #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
462 #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
463 #define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
464 #define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
465 #define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
466 #define PCI_VPD_DATA 4 /* 32-bits of data returned here */
469 * t4_os_pci_write_cfg4 - 32-bit write to PCI config space
470 * @adapter: the adapter
471 * @addr: the register address
472 * @val: the value to write
474 * Write a 32-bit value into the given register in PCI config space.
476 static inline void t4_os_pci_write_cfg4(struct adapter *adapter, size_t addr,
481 if (rte_eal_pci_write_config(adapter->pdev, &val32, sizeof(val32),
483 dev_err(adapter, "Can't write to PCI config space\n");
487 * t4_os_pci_read_cfg4 - read a 32-bit value from PCI config space
488 * @adapter: the adapter
489 * @addr: the register address
490 * @val: where to store the value read
492 * Read a 32-bit value from the given register in PCI config space.
494 static inline void t4_os_pci_read_cfg4(struct adapter *adapter, size_t addr,
497 if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val),
499 dev_err(adapter, "Can't read from PCI config space\n");
503 * t4_os_pci_write_cfg2 - 16-bit write to PCI config space
504 * @adapter: the adapter
505 * @addr: the register address
506 * @val: the value to write
508 * Write a 16-bit value into the given register in PCI config space.
510 static inline void t4_os_pci_write_cfg2(struct adapter *adapter, size_t addr,
515 if (rte_eal_pci_write_config(adapter->pdev, &val16, sizeof(val16),
517 dev_err(adapter, "Can't write to PCI config space\n");
521 * t4_os_pci_read_cfg2 - read a 16-bit value from PCI config space
522 * @adapter: the adapter
523 * @addr: the register address
524 * @val: where to store the value read
526 * Read a 16-bit value from the given register in PCI config space.
528 static inline void t4_os_pci_read_cfg2(struct adapter *adapter, size_t addr,
531 if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val),
533 dev_err(adapter, "Can't read from PCI config space\n");
537 * t4_os_pci_read_cfg - read a 8-bit value from PCI config space
538 * @adapter: the adapter
539 * @addr: the register address
540 * @val: where to store the value read
542 * Read a 8-bit value from the given register in PCI config space.
544 static inline void t4_os_pci_read_cfg(struct adapter *adapter, size_t addr,
547 if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val),
549 dev_err(adapter, "Can't read from PCI config space\n");
553 * t4_os_find_pci_capability - lookup a capability in the PCI capability list
554 * @adapter: the adapter
555 * @cap: the capability
557 * Return the address of the given capability within the PCI capability list.
559 static inline int t4_os_find_pci_capability(struct adapter *adapter, int cap)
566 t4_os_pci_read_cfg2(adapter, PCI_STATUS, &status);
567 if (!(status & PCI_STATUS_CAP_LIST)) {
568 dev_err(adapter, "PCIe capability reading failed\n");
572 t4_os_pci_read_cfg(adapter, PCI_CAPABILITY_LIST, &pos);
573 while (ttl-- && pos >= 0x40) {
575 t4_os_pci_read_cfg(adapter, (pos + PCI_CAP_LIST_ID), &id);
583 t4_os_pci_read_cfg(adapter, (pos + PCI_CAP_LIST_NEXT), &pos);
589 * t4_os_set_hw_addr - store a port's MAC address in SW
590 * @adapter: the adapter
591 * @port_idx: the port index
592 * @hw_addr: the Ethernet address
594 * Store the Ethernet address of the given port in SW. Called by the
595 * common code when it retrieves a port's Ethernet address from EEPROM.
597 static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx,
600 struct port_info *pi = &adapter->port[port_idx];
602 ether_addr_copy((struct ether_addr *)hw_addr,
603 &pi->eth_dev->data->mac_addrs[0]);
607 * t4_os_lock_init - initialize spinlock
608 * @lock: the spinlock
610 static inline void t4_os_lock_init(rte_spinlock_t *lock)
612 rte_spinlock_init(lock);
616 * t4_os_lock - spin until lock is acquired
617 * @lock: the spinlock
619 static inline void t4_os_lock(rte_spinlock_t *lock)
621 rte_spinlock_lock(lock);
625 * t4_os_unlock - unlock a spinlock
626 * @lock: the spinlock
628 static inline void t4_os_unlock(rte_spinlock_t *lock)
630 rte_spinlock_unlock(lock);
634 * t4_os_trylock - try to get a lock
635 * @lock: the spinlock
637 static inline int t4_os_trylock(rte_spinlock_t *lock)
639 return rte_spinlock_trylock(lock);
643 * t4_os_init_list_head - initialize
644 * @head: head of list to initialize [to empty]
646 static inline void t4_os_init_list_head(struct mbox_list *head)
651 static inline struct mbox_entry *t4_os_list_first_entry(struct mbox_list *head)
653 return TAILQ_FIRST(head);
657 * t4_os_atomic_add_tail - Enqueue list element atomically onto list
658 * @new: the entry to be addded to the queue
659 * @head: current head of the linked list
660 * @lock: lock to use to guarantee atomicity
662 static inline void t4_os_atomic_add_tail(struct mbox_entry *entry,
663 struct mbox_list *head,
664 rte_spinlock_t *lock)
667 TAILQ_INSERT_TAIL(head, entry, next);
672 * t4_os_atomic_list_del - Dequeue list element atomically from list
673 * @entry: the entry to be remove/dequeued from the list.
674 * @lock: the spinlock
676 static inline void t4_os_atomic_list_del(struct mbox_entry *entry,
677 struct mbox_list *head,
678 rte_spinlock_t *lock)
681 TAILQ_REMOVE(head, entry, next);
686 * adap2pinfo - return the port_info of a port
688 * @idx: the port index
690 * Return the port_info structure for the port of the given index.
692 static inline struct port_info *adap2pinfo(struct adapter *adap, int idx)
694 return &adap->port[idx];
697 void *t4_alloc_mem(size_t size);
698 void t4_free_mem(void *addr);
699 #define t4_os_alloc(_size) t4_alloc_mem((_size))
700 #define t4_os_free(_ptr) t4_free_mem((_ptr))
702 void t4_os_portmod_changed(const struct adapter *adap, int port_id);
703 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
705 void reclaim_completed_tx(struct sge_txq *q);
706 void t4_free_sge_resources(struct adapter *adap);
707 void t4_sge_tx_monitor_start(struct adapter *adap);
708 void t4_sge_tx_monitor_stop(struct adapter *adap);
709 int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf);
710 int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
711 const struct pkt_gl *gl);
712 int t4_sge_init(struct adapter *adap);
713 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
714 struct rte_eth_dev *eth_dev, uint16_t queue_id,
715 unsigned int iqid, int socket_id);
716 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *rspq, bool fwevtq,
717 struct rte_eth_dev *eth_dev, int intr_idx,
718 struct sge_fl *fl, rspq_handler_t handler,
719 int cong, struct rte_mempool *mp, int queue_id,
721 int t4_sge_eth_txq_start(struct sge_eth_txq *txq);
722 int t4_sge_eth_txq_stop(struct sge_eth_txq *txq);
723 void t4_sge_eth_txq_release(struct adapter *adap, struct sge_eth_txq *txq);
724 int t4_sge_eth_rxq_start(struct adapter *adap, struct sge_rspq *rq);
725 int t4_sge_eth_rxq_stop(struct adapter *adap, struct sge_rspq *rq);
726 void t4_sge_eth_rxq_release(struct adapter *adap, struct sge_eth_rxq *rxq);
727 void t4_sge_eth_clear_queues(struct port_info *pi);
728 int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us,
730 int cxgbe_poll(struct sge_rspq *q, struct rte_mbuf **rx_pkts,
731 unsigned int budget, unsigned int *work_done);
732 int cxgb4_write_rss(const struct port_info *pi, const u16 *queues);
734 #endif /* __T4_ADAPTER_H__ */