4 * Copyright(c) 2014-2017 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__
39 #include <rte_bus_pci.h>
43 #include "cxgbe_compat.h"
44 #include "t4_regs_values.h"
47 MAX_ETH_QSETS = 64, /* # of Ethernet Tx/Rx queue sets */
54 PORT_RSS_DONE = (1 << 0),
58 struct adapter *adapter; /* adapter that this port belongs to */
59 struct rte_eth_dev *eth_dev; /* associated rte eth device */
60 struct port_stats stats_base; /* port statistics base */
61 struct link_config link_cfg; /* link configuration info */
63 unsigned long flags; /* port related flags */
64 short int xact_addr_filt; /* index of exact MAC address filter */
66 u16 viid; /* associated virtual interface id */
67 s8 mdio_addr; /* address of the PHY */
68 u8 port_type; /* firmware port type */
69 u8 mod_type; /* firmware module type */
70 u8 port_id; /* physical port ID */
71 u8 tx_chan; /* associated channel */
73 u8 n_rx_qsets; /* # of rx qsets */
74 u8 n_tx_qsets; /* # of tx qsets */
75 u8 first_qset; /* index of first qset */
77 u16 *rss; /* rss table */
78 u8 rss_mode; /* rss mode */
79 u16 rss_size; /* size of VI's RSS table slice */
82 /* Enable or disable autonegotiation. If this is set to enable,
83 * the forced link modes above are completely ignored.
85 #define AUTONEG_DISABLE 0x00
86 #define AUTONEG_ENABLE 0x01
88 enum { /* adapter flags */
89 FULL_INIT_DONE = (1 << 0),
91 USING_MSIX = (1 << 2),
92 FW_QUEUE_BOUND = (1 << 3),
94 CFG_QUEUES = (1 << 5),
98 struct rx_sw_desc { /* SW state per Rx descriptor */
99 void *buf; /* struct page or mbuf */
103 struct sge_fl { /* SGE free-buffer queue state */
105 struct rx_sw_desc *sdesc; /* address of SW Rx descriptor ring */
107 dma_addr_t addr; /* bus address of HW ring start */
108 __be64 *desc; /* address of HW Rx descriptor ring */
110 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
111 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
113 unsigned int cntxt_id; /* SGE relative QID for the free list */
114 unsigned int size; /* capacity of free list */
116 unsigned int avail; /* # of available Rx buffers */
117 unsigned int pend_cred; /* new buffers since last FL DB ring */
118 unsigned int cidx; /* consumer index */
119 unsigned int pidx; /* producer index */
121 unsigned long alloc_failed; /* # of times buffer allocation failed */
122 unsigned long low; /* # of times momentarily starving */
125 #define MAX_MBUF_FRAGS (16384 / 512 + 2)
127 /* A packet gather list */
130 struct rte_mbuf *mbufs[MAX_MBUF_FRAGS];
132 void *va; /* virtual address of first byte */
133 unsigned int nfrags; /* # of fragments */
134 unsigned int tot_len; /* total length of fragments */
135 bool usembufs; /* use mbufs for fragments */
138 typedef int (*rspq_handler_t)(struct sge_rspq *q, const __be64 *rsp,
139 const struct pkt_gl *gl);
141 struct sge_rspq { /* state for an SGE response queue */
142 struct adapter *adapter; /* adapter that this queue belongs to */
143 struct rte_eth_dev *eth_dev; /* associated rte eth device */
144 struct rte_mempool *mb_pool; /* associated mempool */
146 dma_addr_t phys_addr; /* physical address of the ring */
147 __be64 *desc; /* address of HW response ring */
148 const __be64 *cur_desc; /* current descriptor in queue */
150 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
151 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
152 struct sge_qstat *stat;
154 unsigned int cidx; /* consumer index */
155 unsigned int gts_idx; /* last gts write sent */
156 unsigned int iqe_len; /* entry size */
157 unsigned int size; /* capacity of response queue */
158 int offset; /* offset into current Rx buffer */
160 u8 gen; /* current generation bit */
161 u8 intr_params; /* interrupt holdoff parameters */
162 u8 next_intr_params; /* holdoff params for next interrupt */
163 u8 pktcnt_idx; /* interrupt packet threshold */
164 u8 port_id; /* associated port-id */
165 u8 idx; /* queue index within its group */
166 u16 cntxt_id; /* SGE relative QID for the response Q */
167 u16 abs_id; /* absolute SGE id for the response q */
169 rspq_handler_t handler; /* associated handler for this response q */
172 struct sge_eth_rx_stats { /* Ethernet rx queue statistics */
173 u64 pkts; /* # of ethernet packets */
174 u64 rx_bytes; /* # of ethernet bytes */
175 u64 rx_cso; /* # of Rx checksum offloads */
176 u64 vlan_ex; /* # of Rx VLAN extractions */
177 u64 rx_drops; /* # of packets dropped due to no mem */
180 struct sge_eth_rxq { /* a SW Ethernet Rx queue */
181 struct sge_rspq rspq;
183 struct sge_eth_rx_stats stats;
184 bool usembufs; /* one ingress packet per mbuf FL buffer */
185 } __rte_cache_aligned;
188 * Currently there are two types of coalesce WR. Type 0 needs 48 bytes per
189 * packet (if one sgl is present) and type 1 needs 32 bytes. This means
190 * that type 0 can fit a maximum of 10 packets per WR and type 1 can fit
191 * 15 packets. We need to keep track of the mbuf pointers in a coalesce WR
192 * to be able to free those mbufs when we get completions back from the FW.
193 * Allocating the maximum number of pointers in every tx desc is a waste
194 * of memory resources so we only store 2 pointers per tx desc which should
195 * be enough since a tx desc can only fit 2 packets in the best case
196 * scenario where a packet needs 32 bytes.
198 #define ETH_COALESCE_PKT_NUM 15
199 #define ETH_COALESCE_PKT_PER_DESC 2
201 struct tx_eth_coal_desc {
202 struct rte_mbuf *mbuf[ETH_COALESCE_PKT_PER_DESC];
203 struct ulptx_sgl *sgl[ETH_COALESCE_PKT_PER_DESC];
211 struct tx_sw_desc { /* SW state per Tx descriptor */
212 struct rte_mbuf *mbuf;
213 struct ulptx_sgl *sgl;
214 struct tx_eth_coal_desc coalesce;
218 EQ_STOPPED = (1 << 0),
221 struct eth_coalesce {
231 struct tx_desc *desc; /* address of HW Tx descriptor ring */
232 struct tx_sw_desc *sdesc; /* address of SW Tx descriptor ring */
233 struct sge_qstat *stat; /* queue status entry */
234 struct eth_coalesce coalesce; /* coalesce info */
236 uint64_t phys_addr; /* physical address of the ring */
238 void __iomem *bar2_addr; /* address of BAR2 Queue registers */
239 unsigned int bar2_qid; /* Queue ID for BAR2 Queue registers */
241 unsigned int cntxt_id; /* SGE relative QID for the Tx Q */
242 unsigned int in_use; /* # of in-use Tx descriptors */
243 unsigned int size; /* # of descriptors */
244 unsigned int cidx; /* SW consumer index */
245 unsigned int pidx; /* producer index */
246 unsigned int dbidx; /* last idx when db ring was done */
247 unsigned int equeidx; /* last sent credit request */
248 unsigned int last_pidx; /* last pidx recorded by tx monitor */
249 unsigned int last_coal_idx;/* last coal-idx recorded by tx monitor */
251 int db_disabled; /* doorbell state */
252 unsigned short db_pidx; /* doorbell producer index */
253 unsigned short db_pidx_inc; /* doorbell producer increment */
256 struct sge_eth_tx_stats { /* Ethernet tx queue statistics */
257 u64 pkts; /* # of ethernet packets */
258 u64 tx_bytes; /* # of ethernet bytes */
259 u64 tso; /* # of TSO requests */
260 u64 tx_cso; /* # of Tx checksum offloads */
261 u64 vlan_ins; /* # of Tx VLAN insertions */
262 u64 mapping_err; /* # of I/O MMU packet mapping errors */
263 u64 coal_wr; /* # of coalesced wr */
264 u64 coal_pkts; /* # of coalesced packets */
267 struct sge_eth_txq { /* state for an SGE Ethernet Tx queue */
269 struct rte_eth_dev *eth_dev; /* port that this queue belongs to */
270 struct sge_eth_tx_stats stats; /* queue statistics */
271 rte_spinlock_t txq_lock;
273 unsigned int flags; /* flags for state of the queue */
274 } __rte_cache_aligned;
277 struct sge_eth_txq ethtxq[MAX_ETH_QSETS];
278 struct sge_eth_rxq ethrxq[MAX_ETH_QSETS];
279 struct sge_rspq fw_evtq __rte_cache_aligned;
281 u16 max_ethqsets; /* # of available Ethernet queue sets */
282 u32 stat_len; /* length of status page at ring end */
283 u32 pktshift; /* padding between CPL & packet data */
285 /* response queue interrupt parameters */
286 u16 timer_val[SGE_NTIMERS];
287 u8 counter_val[SGE_NCOUNTERS];
289 u32 fl_align; /* response queue message alignment */
290 u32 fl_pg_order; /* large page allocation size */
291 u32 fl_starve_thres; /* Free List starvation threshold */
294 #define T4_OS_NEEDS_MBOX_LOCKING 1
297 * OS Lock/List primitives for those interfaces in the Common Code which
302 TAILQ_ENTRY(mbox_entry) next;
305 TAILQ_HEAD(mbox_list, mbox_entry);
308 struct rte_pci_device *pdev; /* associated rte pci device */
309 struct rte_eth_dev *eth_dev; /* first port's rte eth device */
310 struct adapter_params params; /* adapter parameters */
311 struct port_info port[MAX_NPORTS]; /* ports belonging to this adapter */
312 struct sge sge; /* associated SGE */
314 /* support for single-threading access to adapter mailbox registers */
315 struct mbox_list mbox_list;
316 rte_spinlock_t mbox_lock;
318 u8 *regs; /* pointer to registers region */
319 u8 *bar2; /* pointer to bar2 region */
320 unsigned long flags; /* adapter flags */
321 unsigned int mbox; /* associated mailbox */
322 unsigned int pf; /* associated physical function id */
324 unsigned int vpd_busy;
325 unsigned int vpd_flag;
327 int use_unpacked_mode; /* unpacked rx mode state */
330 #define CXGBE_PCI_REG(reg) rte_read32(reg)
332 static inline uint64_t cxgbe_read_addr64(volatile void *addr)
334 uint64_t val = CXGBE_PCI_REG(addr);
335 uint64_t val2 = CXGBE_PCI_REG(((volatile uint8_t *)(addr) + 4));
337 val2 = (uint64_t)(val2 << 32);
342 static inline uint32_t cxgbe_read_addr(volatile void *addr)
344 return CXGBE_PCI_REG(addr);
347 #define CXGBE_PCI_REG_ADDR(adap, reg) \
348 ((volatile uint32_t *)((char *)(adap)->regs + (reg)))
350 #define CXGBE_READ_REG(adap, reg) \
351 cxgbe_read_addr(CXGBE_PCI_REG_ADDR((adap), (reg)))
353 #define CXGBE_READ_REG64(adap, reg) \
354 cxgbe_read_addr64(CXGBE_PCI_REG_ADDR((adap), (reg)))
356 #define CXGBE_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
358 #define CXGBE_PCI_REG_WRITE_RELAXED(reg, value) \
359 rte_write32_relaxed((value), (reg))
361 #define CXGBE_WRITE_REG(adap, reg, value) \
362 CXGBE_PCI_REG_WRITE(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
364 #define CXGBE_WRITE_REG_RELAXED(adap, reg, value) \
365 CXGBE_PCI_REG_WRITE_RELAXED(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
367 static inline uint64_t cxgbe_write_addr64(volatile void *addr, uint64_t val)
369 CXGBE_PCI_REG_WRITE(addr, val);
370 CXGBE_PCI_REG_WRITE(((volatile uint8_t *)(addr) + 4), (val >> 32));
374 #define CXGBE_WRITE_REG64(adap, reg, value) \
375 cxgbe_write_addr64(CXGBE_PCI_REG_ADDR((adap), (reg)), (value))
378 * t4_read_reg - read a HW register
379 * @adapter: the adapter
380 * @reg_addr: the register address
382 * Returns the 32-bit value of the given HW register.
384 static inline u32 t4_read_reg(struct adapter *adapter, u32 reg_addr)
386 u32 val = CXGBE_READ_REG(adapter, reg_addr);
388 CXGBE_DEBUG_REG(adapter, "read register 0x%x value 0x%x\n", reg_addr,
394 * t4_write_reg - write a HW register with barrier
395 * @adapter: the adapter
396 * @reg_addr: the register address
397 * @val: the value to write
399 * Write a 32-bit value into the given HW register.
401 static inline void t4_write_reg(struct adapter *adapter, u32 reg_addr, u32 val)
403 CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
405 CXGBE_WRITE_REG(adapter, reg_addr, val);
409 * t4_write_reg_relaxed - write a HW register with no barrier
410 * @adapter: the adapter
411 * @reg_addr: the register address
412 * @val: the value to write
414 * Write a 32-bit value into the given HW register.
416 static inline void t4_write_reg_relaxed(struct adapter *adapter, u32 reg_addr,
419 CXGBE_DEBUG_REG(adapter, "setting register 0x%x to 0x%x\n", reg_addr,
421 CXGBE_WRITE_REG_RELAXED(adapter, reg_addr, val);
425 * t4_read_reg64 - read a 64-bit HW register
426 * @adapter: the adapter
427 * @reg_addr: the register address
429 * Returns the 64-bit value of the given HW register.
431 static inline u64 t4_read_reg64(struct adapter *adapter, u32 reg_addr)
433 u64 val = CXGBE_READ_REG64(adapter, reg_addr);
435 CXGBE_DEBUG_REG(adapter, "64-bit read register %#x value %#llx\n",
436 reg_addr, (unsigned long long)val);
441 * t4_write_reg64 - write a 64-bit HW register
442 * @adapter: the adapter
443 * @reg_addr: the register address
444 * @val: the value to write
446 * Write a 64-bit value into the given HW register.
448 static inline void t4_write_reg64(struct adapter *adapter, u32 reg_addr,
451 CXGBE_DEBUG_REG(adapter, "setting register %#x to %#llx\n", reg_addr,
452 (unsigned long long)val);
454 CXGBE_WRITE_REG64(adapter, reg_addr, val);
457 #define PCI_STATUS 0x06 /* 16 bits */
458 #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
459 #define PCI_CAPABILITY_LIST 0x34
460 /* Offset of first capability list entry */
461 #define PCI_CAP_ID_EXP 0x10 /* PCI Express */
462 #define PCI_CAP_LIST_ID 0 /* Capability ID */
463 #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
464 #define PCI_EXP_DEVCTL 0x0008 /* Device control */
465 #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
466 #define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
467 #define PCI_EXP_DEVCTL_PAYLOAD 0x00E0 /* Max payload */
468 #define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
469 #define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
470 #define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
471 #define PCI_VPD_DATA 4 /* 32-bits of data returned here */
474 * t4_os_pci_write_cfg4 - 32-bit write to PCI config space
475 * @adapter: the adapter
476 * @addr: the register address
477 * @val: the value to write
479 * Write a 32-bit value into the given register in PCI config space.
481 static inline void t4_os_pci_write_cfg4(struct adapter *adapter, size_t addr,
486 if (rte_pci_write_config(adapter->pdev, &val32, sizeof(val32),
488 dev_err(adapter, "Can't write to PCI config space\n");
492 * t4_os_pci_read_cfg4 - read a 32-bit value from PCI config space
493 * @adapter: the adapter
494 * @addr: the register address
495 * @val: where to store the value read
497 * Read a 32-bit value from the given register in PCI config space.
499 static inline void t4_os_pci_read_cfg4(struct adapter *adapter, size_t addr,
502 if (rte_pci_read_config(adapter->pdev, val, sizeof(*val),
504 dev_err(adapter, "Can't read from PCI config space\n");
508 * t4_os_pci_write_cfg2 - 16-bit write to PCI config space
509 * @adapter: the adapter
510 * @addr: the register address
511 * @val: the value to write
513 * Write a 16-bit value into the given register in PCI config space.
515 static inline void t4_os_pci_write_cfg2(struct adapter *adapter, size_t addr,
520 if (rte_pci_write_config(adapter->pdev, &val16, sizeof(val16),
522 dev_err(adapter, "Can't write to PCI config space\n");
526 * t4_os_pci_read_cfg2 - read a 16-bit value from PCI config space
527 * @adapter: the adapter
528 * @addr: the register address
529 * @val: where to store the value read
531 * Read a 16-bit value from the given register in PCI config space.
533 static inline void t4_os_pci_read_cfg2(struct adapter *adapter, size_t addr,
536 if (rte_pci_read_config(adapter->pdev, val, sizeof(*val),
538 dev_err(adapter, "Can't read from PCI config space\n");
542 * t4_os_pci_read_cfg - read a 8-bit value from PCI config space
543 * @adapter: the adapter
544 * @addr: the register address
545 * @val: where to store the value read
547 * Read a 8-bit value from the given register in PCI config space.
549 static inline void t4_os_pci_read_cfg(struct adapter *adapter, size_t addr,
552 if (rte_pci_read_config(adapter->pdev, val, sizeof(*val),
554 dev_err(adapter, "Can't read from PCI config space\n");
558 * t4_os_find_pci_capability - lookup a capability in the PCI capability list
559 * @adapter: the adapter
560 * @cap: the capability
562 * Return the address of the given capability within the PCI capability list.
564 static inline int t4_os_find_pci_capability(struct adapter *adapter, int cap)
571 t4_os_pci_read_cfg2(adapter, PCI_STATUS, &status);
572 if (!(status & PCI_STATUS_CAP_LIST)) {
573 dev_err(adapter, "PCIe capability reading failed\n");
577 t4_os_pci_read_cfg(adapter, PCI_CAPABILITY_LIST, &pos);
578 while (ttl-- && pos >= 0x40) {
580 t4_os_pci_read_cfg(adapter, (pos + PCI_CAP_LIST_ID), &id);
588 t4_os_pci_read_cfg(adapter, (pos + PCI_CAP_LIST_NEXT), &pos);
594 * t4_os_set_hw_addr - store a port's MAC address in SW
595 * @adapter: the adapter
596 * @port_idx: the port index
597 * @hw_addr: the Ethernet address
599 * Store the Ethernet address of the given port in SW. Called by the
600 * common code when it retrieves a port's Ethernet address from EEPROM.
602 static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx,
605 struct port_info *pi = &adapter->port[port_idx];
607 ether_addr_copy((struct ether_addr *)hw_addr,
608 &pi->eth_dev->data->mac_addrs[0]);
612 * t4_os_lock_init - initialize spinlock
613 * @lock: the spinlock
615 static inline void t4_os_lock_init(rte_spinlock_t *lock)
617 rte_spinlock_init(lock);
621 * t4_os_lock - spin until lock is acquired
622 * @lock: the spinlock
624 static inline void t4_os_lock(rte_spinlock_t *lock)
626 rte_spinlock_lock(lock);
630 * t4_os_unlock - unlock a spinlock
631 * @lock: the spinlock
633 static inline void t4_os_unlock(rte_spinlock_t *lock)
635 rte_spinlock_unlock(lock);
639 * t4_os_trylock - try to get a lock
640 * @lock: the spinlock
642 static inline int t4_os_trylock(rte_spinlock_t *lock)
644 return rte_spinlock_trylock(lock);
648 * t4_os_init_list_head - initialize
649 * @head: head of list to initialize [to empty]
651 static inline void t4_os_init_list_head(struct mbox_list *head)
656 static inline struct mbox_entry *t4_os_list_first_entry(struct mbox_list *head)
658 return TAILQ_FIRST(head);
662 * t4_os_atomic_add_tail - Enqueue list element atomically onto list
663 * @new: the entry to be addded to the queue
664 * @head: current head of the linked list
665 * @lock: lock to use to guarantee atomicity
667 static inline void t4_os_atomic_add_tail(struct mbox_entry *entry,
668 struct mbox_list *head,
669 rte_spinlock_t *lock)
672 TAILQ_INSERT_TAIL(head, entry, next);
677 * t4_os_atomic_list_del - Dequeue list element atomically from list
678 * @entry: the entry to be remove/dequeued from the list.
679 * @lock: the spinlock
681 static inline void t4_os_atomic_list_del(struct mbox_entry *entry,
682 struct mbox_list *head,
683 rte_spinlock_t *lock)
686 TAILQ_REMOVE(head, entry, next);
691 * adap2pinfo - return the port_info of a port
693 * @idx: the port index
695 * Return the port_info structure for the port of the given index.
697 static inline struct port_info *adap2pinfo(struct adapter *adap, int idx)
699 return &adap->port[idx];
702 void *t4_alloc_mem(size_t size);
703 void t4_free_mem(void *addr);
704 #define t4_os_alloc(_size) t4_alloc_mem((_size))
705 #define t4_os_free(_ptr) t4_free_mem((_ptr))
707 void t4_os_portmod_changed(const struct adapter *adap, int port_id);
708 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
710 void reclaim_completed_tx(struct sge_txq *q);
711 void t4_free_sge_resources(struct adapter *adap);
712 void t4_sge_tx_monitor_start(struct adapter *adap);
713 void t4_sge_tx_monitor_stop(struct adapter *adap);
714 int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,
716 int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
717 const struct pkt_gl *gl);
718 int t4_sge_init(struct adapter *adap);
719 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
720 struct rte_eth_dev *eth_dev, uint16_t queue_id,
721 unsigned int iqid, int socket_id);
722 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *rspq, bool fwevtq,
723 struct rte_eth_dev *eth_dev, int intr_idx,
724 struct sge_fl *fl, rspq_handler_t handler,
725 int cong, struct rte_mempool *mp, int queue_id,
727 int t4_sge_eth_txq_start(struct sge_eth_txq *txq);
728 int t4_sge_eth_txq_stop(struct sge_eth_txq *txq);
729 void t4_sge_eth_txq_release(struct adapter *adap, struct sge_eth_txq *txq);
730 int t4_sge_eth_rxq_start(struct adapter *adap, struct sge_rspq *rq);
731 int t4_sge_eth_rxq_stop(struct adapter *adap, struct sge_rspq *rq);
732 void t4_sge_eth_rxq_release(struct adapter *adap, struct sge_eth_rxq *rxq);
733 void t4_sge_eth_clear_queues(struct port_info *pi);
734 int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us,
736 int cxgbe_poll(struct sge_rspq *q, struct rte_mbuf **rx_pkts,
737 unsigned int budget, unsigned int *work_done);
738 int cxgb4_write_rss(const struct port_info *pi, const u16 *queues);
740 #endif /* __T4_ADAPTER_H__ */