FreeBSD kernel CXGBE device code
t4_sge.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_kern_tls.h"
#include "opt_ratelimit.h"
#include <sys/types.h>
#include <sys/eventhandler.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/kernel.h>
#include <sys/ktls.h>
#include <sys/malloc.h>
#include <sys/msan.h>
#include <sys/queue.h>
#include <sys/sbuf.h>
#include <sys/taskqueue.h>
#include <sys/time.h>
#include <sys/sglist.h>
#include <sys/sysctl.h>
#include <sys/smp.h>
#include <sys/socketvar.h>
#include <sys/counter.h>
#include <net/bpf.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_vlan_var.h>
#include <net/if_vxlan.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <machine/in_cksum.h>
#include <machine/md_var.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include "common/common.h"
#include "common/t4_regs.h"
#include "common/t4_regs_values.h"
#include "common/t4_msg.h"
#include "t4_l2t.h"
#include "t4_mp_ring.h"
Include dependency graph for t4_sge.c:

Go to the source code of this file.

Macros

#define RX_COPY_THRESHOLD   MINCLSIZE
 
#define MC_NOMAP   0x01
 
#define MC_RAW_WR   0x02
 
#define MC_TLS   0x04
 
#define MAX_PACK_BOUNDARY   512
 
#define VM_TX_L2HDR_LEN   16 /* ethmacdst to vlantci */
 

Functions

 __FBSDID ("$FreeBSD$")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, fl_pktshift, CTLFLAG_RDTUN, &fl_pktshift, 0, "payload DMA offset in rx buffer (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, fl_pad, CTLFLAG_RDTUN, &fl_pad, 0, "payload pad boundary (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, spg_len, CTLFLAG_RDTUN, &spg_len, 0, "status page size (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, cong_drop, CTLFLAG_RDTUN, &cong_drop, 0, "Congestion control for RX queues (0 = backpressure, 1 = drop")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, buffer_packing, CTLFLAG_RDTUN, &buffer_packing, 0, "Enable buffer packing")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, fl_pack, CTLFLAG_RDTUN, &fl_pack, 0, "payload pack boundary (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, largest_rx_cluster, CTLFLAG_RDTUN, &largest_rx_cluster, 0, "Largest rx cluster (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, safest_rx_cluster, CTLFLAG_RDTUN, &safest_rx_cluster, 0, "Safe rx cluster (bytes)")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, tscale, CTLFLAG_RDTUN, &tscale, 0, "Interrupt holdoff timer scale on T6+")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, lro_entries, CTLFLAG_RDTUN, &lro_entries, 0, "Number of LRO entries per RX queue")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, lro_mbufs, CTLFLAG_RDTUN, &lro_mbufs, 0, "Enable presorting of LRO frames")
 
 SYSCTL_COUNTER_U64 (_hw_cxgbe, OID_AUTO, pullups, CTLFLAG_RD, &pullups, "Number of mbuf pullups performed")
 
 SYSCTL_COUNTER_U64 (_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, &defrags, "Number of mbuf defrags performed")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, tx_coalesce, CTLFLAG_RWTUN, &t4_tx_coalesce, 0, "tx coalescing allowed")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, tx_coalesce_pkts, CTLFLAG_RWTUN, &t4_tx_coalesce_pkts, 0, "# of consecutive packets (1 - 255) that will trigger tx coalescing")
 
 SYSCTL_INT (_hw_cxgbe, OID_AUTO, tx_coalesce_gap, CTLFLAG_RWTUN, &t4_tx_coalesce_gap, 0, "tx gap (in microseconds)")
 
static int service_iq (struct sge_iq *, int)
 
static int service_iq_fl (struct sge_iq *, int)
 
static struct mbuf * get_fl_payload (struct adapter *, struct sge_fl *, uint32_t)
 
static int eth_rx (struct adapter *, struct sge_rxq *, const struct iq_desc *, u_int)
 
static void init_iq (struct sge_iq *, struct adapter *, int, int, int, int, int)
 
static void init_fl (struct adapter *, struct sge_fl *, int, int, char *)
 
static void init_eq (struct adapter *, struct sge_eq *, int, int, uint8_t, struct sge_iq *, char *)
 
static int alloc_iq_fl (struct vi_info *, struct sge_iq *, struct sge_fl *, struct sysctl_ctx_list *, struct sysctl_oid *)
 
static void free_iq_fl (struct adapter *, struct sge_iq *, struct sge_fl *)
 
static void add_iq_sysctls (struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_iq *)
 
static void add_fl_sysctls (struct adapter *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_fl *)
 
static int alloc_iq_fl_hwq (struct vi_info *, struct sge_iq *, struct sge_fl *)
 
static int free_iq_fl_hwq (struct adapter *, struct sge_iq *, struct sge_fl *)
 
static int alloc_fwq (struct adapter *)
 
static void free_fwq (struct adapter *)
 
static int alloc_ctrlq (struct adapter *, int)
 
static void free_ctrlq (struct adapter *, int)
 
static int alloc_rxq (struct vi_info *, struct sge_rxq *, int, int, int)
 
static void free_rxq (struct vi_info *, struct sge_rxq *)
 
static void add_rxq_sysctls (struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_rxq *)
 
static int ctrl_eq_alloc (struct adapter *, struct sge_eq *)
 
static int eth_eq_alloc (struct adapter *, struct vi_info *, struct sge_eq *)
 
static int alloc_eq (struct adapter *, struct sge_eq *, struct sysctl_ctx_list *, struct sysctl_oid *)
 
static void free_eq (struct adapter *, struct sge_eq *)
 
static void add_eq_sysctls (struct adapter *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_eq *)
 
static int alloc_eq_hwq (struct adapter *, struct vi_info *, struct sge_eq *)
 
static int free_eq_hwq (struct adapter *, struct vi_info *, struct sge_eq *)
 
static int alloc_wrq (struct adapter *, struct vi_info *, struct sge_wrq *, struct sysctl_ctx_list *, struct sysctl_oid *)
 
static void free_wrq (struct adapter *, struct sge_wrq *)
 
static void add_wrq_sysctls (struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_wrq *)
 
static int alloc_txq (struct vi_info *, struct sge_txq *, int)
 
static void free_txq (struct vi_info *, struct sge_txq *)
 
static void add_txq_sysctls (struct vi_info *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_txq *)
 
static void oneseg_dma_callback (void *, bus_dma_segment_t *, int, int)
 
static void ring_fl_db (struct adapter *, struct sge_fl *)
 
static int refill_fl (struct adapter *, struct sge_fl *, int)
 
static void refill_sfl (void *)
 
static int find_refill_source (struct adapter *, int, bool)
 
static void add_fl_to_sfl (struct adapter *, struct sge_fl *)
 
static void get_pkt_gl (struct mbuf *, struct sglist *)
 
static u_int txpkt_len16 (u_int, const u_int)
 
static u_int txpkt_vm_len16 (u_int, const u_int)
 
static void calculate_mbuf_len16 (struct mbuf *, bool)
 
static u_int txpkts0_len16 (u_int)
 
static u_int txpkts1_len16 (void)
 
static u_int write_raw_wr (struct sge_txq *, void *, struct mbuf *, u_int)
 
static u_int write_txpkt_wr (struct adapter *, struct sge_txq *, struct mbuf *, u_int)
 
static u_int write_txpkt_vm_wr (struct adapter *, struct sge_txq *, struct mbuf *)
 
static int add_to_txpkts_vf (struct adapter *, struct sge_txq *, struct mbuf *, int, bool *)
 
static int add_to_txpkts_pf (struct adapter *, struct sge_txq *, struct mbuf *, int, bool *)
 
static u_int write_txpkts_wr (struct adapter *, struct sge_txq *)
 
static u_int write_txpkts_vm_wr (struct adapter *, struct sge_txq *)
 
static void write_gl_to_txd (struct sge_txq *, struct mbuf *, caddr_t *, int)
 
static void copy_to_txd (struct sge_eq *, caddr_t, caddr_t *, int)
 
static void ring_eq_db (struct adapter *, struct sge_eq *, u_int)
 
static uint16_t read_hw_cidx (struct sge_eq *)
 
static u_int reclaimable_tx_desc (struct sge_eq *)
 
static u_int total_available_tx_desc (struct sge_eq *)
 
static u_int reclaim_tx_descs (struct sge_txq *, u_int)
 
static void tx_reclaim (void *, int)
 
static __be64 get_flit (struct sglist_seg *, int, int)
 
static int handle_sge_egr_update (struct sge_iq *, const struct rss_header *, struct mbuf *)
 
static int handle_fw_msg (struct sge_iq *, const struct rss_header *, struct mbuf *)
 
static int t4_handle_wrerr_rpl (struct adapter *, const __be64 *)
 
static void wrq_tx_drain (void *, int)
 
static void drain_wrq_wr_list (struct adapter *, struct sge_wrq *)
 
static int sysctl_bufsizes (SYSCTL_HANDLER_ARGS)
 
void t4_register_an_handler (an_handler_t h)
 
void t4_register_fw_msg_handler (int type, fw_msg_handler_t h)
 
void t4_register_cpl_handler (int opcode, cpl_handler_t h)
 
static int set_tcb_rpl_handler (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
 
static int l2t_write_rpl_handler (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
 
static int act_open_rpl_handler (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
 
static int abort_rpl_rss_handler (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
 
static int fw4_ack_handler (struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
 
static void t4_init_shared_cpl_handlers (void)
 
void t4_register_shared_cpl_handler (int opcode, cpl_handler_t h, int cookie)
 
void t4_sge_modload (void)
 
void t4_sge_modunload (void)
 
uint64_t t4_sge_extfree_refs (void)
 
static void setup_pad_and_pack_boundaries (struct adapter *sc)
 
void t4_tweak_chip_settings (struct adapter *sc)
 
static int hwsz_ok (struct adapter *sc, int hwsz)
 
void t4_init_rx_buf_info (struct adapter *sc)
 
int t4_verify_chip_settings (struct adapter *sc)
 
int t4_create_dma_tag (struct adapter *sc)
 
void t4_sge_sysctls (struct adapter *sc, struct sysctl_ctx_list *ctx, struct sysctl_oid_list *children)
 
int t4_destroy_dma_tag (struct adapter *sc)
 
int t4_setup_adapter_queues (struct adapter *sc)
 
int t4_teardown_adapter_queues (struct adapter *sc)
 
static int max_rx_payload (struct adapter *sc, struct ifnet *ifp, const bool ofld)
 
int t4_setup_vi_queues (struct vi_info *vi)
 
int t4_teardown_vi_queues (struct vi_info *vi)
 
void t4_intr_all (void *arg)
 
void t4_intr_err (void *arg)
 
void t4_intr_evt (void *arg)
 
void t4_intr (void *arg)
 
static uint64_t last_flit_to_ns (struct adapter *sc, uint64_t lf)
 
static void move_to_next_rxbuf (struct sge_fl *fl)
 
static struct cluster_metadatacl_metadata (struct fl_sdesc *sd)
 
static void rxb_free (struct mbuf *m)
 
static struct mbuf * get_scatter_segment (struct adapter *sc, struct sge_fl *fl, int fr_offset, int remaining)
 
static struct mbuf * get_fl_payload (struct adapter *sc, struct sge_fl *fl, const u_int plen)
 
static int skip_scatter_segment (struct adapter *sc, struct sge_fl *fl, int fr_offset, int remaining)
 
static void skip_fl_payload (struct adapter *sc, struct sge_fl *fl, int plen)
 
static int get_segment_len (struct adapter *sc, struct sge_fl *fl, int plen)
 
void t4_wrq_tx_locked (struct adapter *sc, struct sge_wrq *wrq, struct wrqe *wr)
 
void t4_update_fl_bufsize (struct ifnet *ifp)
 
static int mbuf_nsegs (struct mbuf *m)
 
static void set_mbuf_nsegs (struct mbuf *m, uint8_t nsegs)
 
static int mbuf_cflags (struct mbuf *m)
 
static void set_mbuf_cflags (struct mbuf *m, uint8_t flags)
 
static int mbuf_len16 (struct mbuf *m)
 
static void set_mbuf_len16 (struct mbuf *m, uint8_t len16)
 
struct mbuf * alloc_wr_mbuf (int len, int how)
 
static bool needs_hwcsum (struct mbuf *m)
 
static bool needs_tso (struct mbuf *m)
 
static bool needs_vxlan_csum (struct mbuf *m)
 
static bool needs_vxlan_tso (struct mbuf *m)
 
static bool needs_l3_csum (struct mbuf *m)
 
static bool needs_outer_tcp_csum (struct mbuf *m)
 
static bool needs_vlan_insertion (struct mbuf *m)
 
static int count_mbuf_ext_pgs (struct mbuf *m, int skip, vm_paddr_t *nextaddr)
 
static int count_mbuf_nsegs (struct mbuf *m, int skip, uint8_t *cflags)
 
static int max_nsegs_allowed (struct mbuf *m, bool vm_wr)
 
int parse_pkt (struct mbuf **mp, bool vm_wr)
 
void * start_wrq_wr (struct sge_wrq *wrq, int len16, struct wrq_cookie *cookie)
 
void commit_wrq_wr (struct sge_wrq *wrq, void *w, struct wrq_cookie *cookie)
 
static u_int can_resume_eth_tx (struct mp_ring *r)
 
static bool cannot_use_txpkts (struct mbuf *m)
 
static int discard_tx (struct sge_eq *eq)
 
static int wr_can_update_eq (void *p)
 
static void set_txupdate_flags (struct sge_txq *txq, u_int avail, struct fw_eth_tx_pkt_wr *wr)
 
static bool record_eth_tx_time (struct sge_txq *txq)
 
static u_int eth_tx (struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing)
 
int alloc_ring (struct adapter *sc, size_t len, bus_dma_tag_t *tag, bus_dmamap_t *map, bus_addr_t *pa, void **va)
 
int free_ring (struct adapter *sc, bus_dma_tag_t tag, bus_dmamap_t map, bus_addr_t pa, void *va)
 
int tnl_cong (struct port_info *pi, int drop)
 
static u_int qsize_to_fthresh (int qsize)
 
static int free_eq_hwq (struct adapter *sc, struct vi_info *vi __unused, struct sge_eq *eq)
 
void free_fl_buffers (struct adapter *sc, struct sge_fl *fl)
 
static u_int imm_payload (u_int ndesc)
 
static uint64_t csum_to_ctrl (struct adapter *sc, struct mbuf *m)
 
static void * write_lso_cpl (void *cpl, struct mbuf *m0)
 
static void * write_tnl_lso_cpl (void *cpl, struct mbuf *m0)
 
static bool cmp_l2hdr (struct txpkts *txp, struct mbuf *m)
 
static void save_l2hdr (struct txpkts *txp, struct mbuf *m)
 
static void handle_wrq_egr_update (struct adapter *sc, struct sge_eq *eq)
 
static void handle_eth_egr_update (struct adapter *sc, struct sge_eq *eq)
 
 CTASSERT (offsetof(struct cpl_fw4_msg, data)==offsetof(struct cpl_fw6_msg, data))
 
static bool bufidx_used (struct adapter *sc, int idx)
 

Variables

static int fl_pktshift = 0
 
int fl_pad = -1
 
static int spg_len = -1
 
static int cong_drop = 0
 
static int buffer_packing = -1
 
static int fl_pack = -1
 
static int largest_rx_cluster = MJUM16BYTES
 
static int safest_rx_cluster = PAGE_SIZE
 
static int tscale = 1
 
static int lro_entries = TCP_LRO_ENTRIES
 
static int lro_mbufs = 0
 
static counter_u64_t pullups
 
static counter_u64_t defrags
 
static int t4_tx_coalesce = 1
 
static int t4_tx_coalesce_pkts = 32
 
static int t4_tx_coalesce_gap = 5
 
static counter_u64_t extfree_refs
 
static counter_u64_t extfree_rels
 
an_handler_t t4_an_handler
 
fw_msg_handler_t t4_fw_msg_handler [NUM_FW6_TYPES]
 
cpl_handler_t t4_cpl_handler [NUM_CPL_CMDS]
 
cpl_handler_t set_tcb_rpl_handlers [NUM_CPL_COOKIES]
 
cpl_handler_t l2t_write_rpl_handlers [NUM_CPL_COOKIES]
 
cpl_handler_t act_open_rpl_handlers [NUM_CPL_COOKIES]
 
cpl_handler_t abort_rpl_rss_handlers [NUM_CPL_COOKIES]
 
cpl_handler_t fw4_ack_handlers [NUM_CPL_COOKIES]
 
static struct timeval txerr_ratecheck = {0}
 
static const struct timeval txerr_interval = {3, 0}
 

Macro Definition Documentation

◆ MAX_PACK_BOUNDARY

#define MAX_PACK_BOUNDARY   512

Definition at line 634 of file t4_sge.c.

◆ MC_NOMAP

#define MC_NOMAP   0x01

Definition at line 91 of file t4_sge.c.

◆ MC_RAW_WR

#define MC_RAW_WR   0x02

Definition at line 92 of file t4_sge.c.

◆ MC_TLS

#define MC_TLS   0x04

Definition at line 93 of file t4_sge.c.

◆ RX_COPY_THRESHOLD

#define RX_COPY_THRESHOLD   MINCLSIZE

Definition at line 87 of file t4_sge.c.

◆ VM_TX_L2HDR_LEN

#define VM_TX_L2HDR_LEN   16 /* ethmacdst to vlantci */

Definition at line 5384 of file t4_sge.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ abort_rpl_rss_handler()

static int abort_rpl_rss_handler ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 452 of file t4_sge.c.

References abort_rpl_rss_handlers, sge_iq::adapter, CPL_COOKIE_HASHFILTER, CPL_COOKIE_TOM, iq, and is_hashfilter().

Referenced by t4_init_shared_cpl_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ act_open_rpl_handler()

static int act_open_rpl_handler ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 439 of file t4_sge.c.

References act_open_rpl_handlers, cpl_act_open_rpl::atid_status, CPL_COOKIE_RESERVED, G_AOPEN_ATID, G_TID_COOKIE, and iq.

Referenced by t4_init_shared_cpl_handlers().

Here is the caller graph for this function:

◆ add_eq_sysctls()

static void add_eq_sysctls ( struct adapter sc,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid,
struct sge_eq eq 
)
static

Definition at line 4386 of file t4_sge.c.

References sge_eq::abs_id, sge_eq::ba, sge_eq::cidx, sge_eq::cntxt_id, eq, EQ_ESIZE, adapter::params, sge_eq::pidx, adapter_params::sge, sge_eq::sidx, and sge_params::spg_len.

Referenced by alloc_eq().

Here is the caller graph for this function:

◆ add_fl_sysctls()

static void add_fl_sysctls ( struct adapter sc,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid,
struct sge_fl fl 
)
static

◆ add_fl_to_sfl()

static void add_fl_to_sfl ( struct adapter sc,
struct sge_fl fl 
)
static

Definition at line 6284 of file t4_sge.c.

References fl, FL_DOOMED, FL_LOCK, FL_STARVING, FL_UNLOCK, sge_fl::flags, refill_sfl(), adapter::sfl_callout, and adapter::sfl_lock.

Referenced by service_iq_fl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_iq_sysctls()

static void add_iq_sysctls ( struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid,
struct sge_iq iq 
)
static

Definition at line 3734 of file t4_sge.c.

References sge_iq::abs_id, sge_iq::ba, sge_iq::cidx, sge_iq::cntxt_id, iq, IQ_ESIZE, and sge_iq::qsize.

Referenced by alloc_iq_fl().

Here is the caller graph for this function:

◆ add_rxq_sysctls()

static void add_rxq_sysctls ( struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid,
struct sge_rxq rxq 
)
static

Definition at line 4044 of file t4_sge.c.

References sge_rxq::lro, sge_rxq::rxcsum, rxq, SYSCTL_ADD_UQUAD, sge_rxq::vlan_extraction, and sge_rxq::vxlan_rxcsum.

Referenced by alloc_rxq().

Here is the caller graph for this function:

◆ add_to_txpkts_pf()

static int add_to_txpkts_pf ( struct adapter sc,
struct sge_txq txq,
struct mbuf *  m,
int  avail,
bool send 
)
static

Definition at line 5713 of file t4_sge.c.

References cannot_use_txpkts(), adapter::flags, IS_VF, txpkts::len16, txpkts::max_npkt, txpkts::mb, mbuf_nsegs(), txpkts::npkt, txpkts::plen, SGE_MAX_WR_NDESC, tx_len16_to_desc(), txp, sge_txq::txp, txpkts0_len16(), txpkts1_len16(), and txpkts::wr_type.

Referenced by eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_to_txpkts_vf()

static int add_to_txpkts_vf ( struct adapter sc,
struct sge_txq txq,
struct mbuf *  m,
int  avail,
bool send 
)
static

Definition at line 5661 of file t4_sge.c.

References cannot_use_txpkts(), cmp_l2hdr(), txpkts::len16, txpkts::max_npkt, txpkts::mb, mbuf_nsegs(), txpkts::npkt, txpkts::plen, save_l2hdr(), tx_len16_to_desc(), txp, sge_txq::txp, txpkts1_len16(), and txpkts::wr_type.

Referenced by eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_txq_sysctls()

◆ add_wrq_sysctls()

static void add_wrq_sysctls ( struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid,
struct sge_wrq wrq 
)
static

Definition at line 4537 of file t4_sge.c.

References SYSCTL_ADD_UQUAD, sge_wrq::tx_wrs_copied, sge_wrq::tx_wrs_direct, sge_wrq::tx_wrs_ss, and wrq.

Referenced by alloc_wrq().

Here is the caller graph for this function:

◆ alloc_ctrlq()

static int alloc_ctrlq ( struct adapter sc,
int  idx 
)
static

Definition at line 3861 of file t4_sge.c.

References alloc_eq_hwq(), alloc_wrq(), CH_ERR, CTRL_EQ_QSIZE, sge::ctrlq, adapter::ctrlq_oid, adapter::ctx, adapter::dev, sge_wrq::eq, EQ_CTRL, EQ_HW_ALLOCATED, EQ_SW_ALLOCATED, sge_eq::flags, sge::fwq, init_eq(), adapter::port, adapter::sge, and port_info::tx_chan.

Referenced by t4_setup_adapter_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_eq()

static int alloc_eq ( struct adapter sc,
struct sge_eq eq,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid 
)
static

Definition at line 4351 of file t4_sge.c.

References add_eq_sysctls(), alloc_ring(), sge_eq::ba, sge_eq::desc, sge_eq::desc_map, sge_eq::desc_tag, eq, EQ_ESIZE, EQ_SW_ALLOCATED, sge_eq::flags, adapter::params, adapter_params::sge, sge_eq::sidx, and sge_params::spg_len.

Referenced by alloc_txq(), and alloc_wrq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_eq_hwq()

◆ alloc_fwq()

static int alloc_fwq ( struct adapter sc)
static

Definition at line 3800 of file t4_sge.c.

References alloc_iq_fl(), alloc_iq_fl_hwq(), CH_ERR, adapter::ctx, sge_iq::flags, adapter::flags, FW_IQ_QSIZE, sge::fwq, adapter::fwq_oid, init_iq(), adapter::intr_count, IQ_HW_ALLOCATED, IQ_SW_ALLOCATED, IS_VF, adapter::port, adapter::sge, and port_info::vi.

Referenced by t4_setup_adapter_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_iq_fl()

static int alloc_iq_fl ( struct vi_info vi,
struct sge_iq iq,
struct sge_fl fl,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid 
)
static

◆ alloc_iq_fl_hwq()

static int alloc_iq_fl_hwq ( struct vi_info vi,
struct sge_iq iq,
struct sge_fl fl 
)
static

Definition at line 3554 of file t4_sge.c.

References sge_iq::abs_id, vi_info::adapter, fw_iq_cmd::alloc_to_len16, sge_iq::ba, sge_fl::ba, CH_ERR, CHELSIO_T5, chip_id(), adapter::chip_params, sge_iq::cidx, sge_fl::cidx, fl_sdesc::cl, cntxt_id, sge_iq::cntxt_id, sge_fl::cntxt_id, sge_iq::cong, sge_fl::dbidx, sge_fl::dbval, sge_iq::desc, sge_fl::desc, DOORBELL_UDB, adapter::doorbells, EQ_ESIZE, sge_params::eq_s_qpp, sge::eq_start, sge::eqmap, sge::eqmap_sz, F_FW_CMD_EXEC, F_FW_CMD_REQUEST, F_FW_CMD_WRITE, F_FW_IQ_CMD_ALLOC, F_FW_IQ_CMD_FL0CONGCIF, F_FW_IQ_CMD_FL0CONGEN, F_FW_IQ_CMD_FL0DATARO, F_FW_IQ_CMD_FL0FETCHRO, F_FW_IQ_CMD_FL0PACKEN, F_FW_IQ_CMD_FL0PADEN, F_FW_IQ_CMD_IQANDST, F_FW_IQ_CMD_IQASYNCH, F_FW_IQ_CMD_IQFLINTCONGEN, F_FW_IQ_CMD_IQGTSMODE, F_FW_IQ_CMD_IQSTART, F_RSPD_GEN, fl, fw_iq_cmd::fl0addr, fw_iq_cmd::fl0dcaen_to_fl0cidxfthresh, fw_iq_cmd::fl0id, fw_iq_cmd::fl0size, FL_BUF_PACKING, FL_BUF_RESUME, FL_DOOMED, FL_LOCK, fl_pad, FL_STARVING, FL_UNLOCK, sge_iq::flags, sge_fl::flags, adapter::flags, FW_IQ_CMD, FW_IQ_TYPE_FL_INT_CAP, FW_LEN16, FW_PARAMS_MNEM_DMAQ, FW_PARAMS_PARAM_DMAQ_CONM_CTXT, sge::fwq, sge_iq::gen, sge_fl::hw_cidx, ilog2(), adapter::intr_count, sge_iq::intr_idx, sge_iq::intr_params, sge_iq::intr_pktc_idx, iq, IQ_ESIZE, IQ_HW_ALLOCATED, sge::iq_start, fw_iq_cmd::iqaddr, fw_iq_cmd::iqdroprss_to_iqesize, fw_iq_cmd::iqid, sge::iqmap, sge::iqmap_sz, fw_iq_cmd::iqns_to_fl0congen, IQS_IDLE, fw_iq_cmd::iqsize, IS_VF, sge_fl::lowat, adapter::mbox, fw_iq_cmd::op_to_vfn, adapter::params, adapter::pf, fw_iq_cmd::physiqid, vi_info::pi, sge_fl::pidx, sge_iq::qsize, sge_fl::qsize, refill_fl(), sge_fl::rx_offset, sge_fl::sdesc, adapter::sge, adapter_params::sge, chip_params::sge_fl_db, adapter::sge_gts_reg, sge_fl::sidx, sge_params::spg_len, sge_iq::state, t4_set_params(), t4_wr_mbox(), t4_write_reg(), port_info::tx_chan, fw_iq_cmd::type_to_iqandstindex, udb, sge_fl::udb, adapter::udbs_base, UDBS_DB_OFFSET, UDBS_SEG_SHIFT, UDBS_SEG_SIZE, V_FW_CMD_OP, V_FW_IQ_CMD_FL0CNGCHMAP, V_FW_IQ_CMD_FL0FBMAX, V_FW_IQ_CMD_FL0FBMIN, V_FW_IQ_CMD_FL0HOSTFCMODE, V_FW_IQ_CMD_IQANDSTINDEX, V_FW_IQ_CMD_IQANUD, V_FW_IQ_CMD_IQESIZE, V_FW_IQ_CMD_IQINTCNTTHRESH, V_FW_IQ_CMD_IQPCIECH, V_FW_IQ_CMD_PFN, V_FW_IQ_CMD_TYPE, V_FW_IQ_CMD_VFN, V_FW_IQ_CMD_VIID, V_FW_PARAMS_MNEM, V_FW_PARAMS_PARAM_X, V_FW_PARAMS_PARAM_YZ, V_INGRESSQID, V_QID, V_SEINTARM, vi_info::viid, X_FETCHBURSTMAX_256B, X_FETCHBURSTMAX_512B, X_FETCHBURSTMIN_128B, X_FETCHBURSTMIN_64B_T6, X_HOSTFCMODE_NONE, and X_UPDATEDELIVERY_INTERRUPT.

Referenced by alloc_fwq(), and alloc_rxq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_ring()

int alloc_ring ( struct adapter sc,
size_t  len,
bus_dma_tag_t *  tag,
bus_dmamap_t *  map,
bus_addr_t *  pa,
void **  va 
)

Definition at line 3435 of file t4_sge.c.

References CH_ERR, adapter::dmat, free_ring(), oneseg_dma_callback(), and tag.

Referenced by alloc_eq(), and alloc_iq_fl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_rxq()

◆ alloc_txq()

◆ alloc_wr_mbuf()

struct mbuf * alloc_wr_mbuf ( int  len,
int  how 
)

Definition at line 2386 of file t4_sge.c.

References MC_RAW_WR, set_mbuf_cflags(), and set_mbuf_len16().

Here is the call graph for this function:

◆ alloc_wrq()

static int alloc_wrq ( struct adapter sc,
struct vi_info vi,
struct sge_wrq wrq,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  oid 
)
static

Definition at line 4501 of file t4_sge.c.

References sge_wrq::adapter, add_wrq_sysctls(), alloc_eq(), eq, sge_wrq::eq, EQ_SW_ALLOCATED, sge_eq::flags, sge_wrq::ndesc_needed, sge_wrq::nwr_pending, wrq, wrq_tx_drain(), and sge_wrq::wrq_tx_task.

Referenced by alloc_ctrlq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bufidx_used()

static bool bufidx_used ( struct adapter sc,
int  idx 
)
inlinestatic

Definition at line 6431 of file t4_sge.c.

References rx_buf_info::hwidx1, rx_buf_info::hwidx2, largest_rx_cluster, sge::rx_buf_info, adapter::sge, rx_buf_info::size1, and SW_ZONE_SIZES.

Referenced by sysctl_bufsizes().

Here is the caller graph for this function:

◆ calculate_mbuf_len16()

static void calculate_mbuf_len16 ( struct mbuf *  m,
bool  vm_wr 
)
inlinestatic

Definition at line 5158 of file t4_sge.c.

References mbuf_nsegs(), needs_tso(), needs_vxlan_tso(), set_mbuf_len16(), txpkt_len16(), and txpkt_vm_len16().

Referenced by parse_pkt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_resume_eth_tx()

static u_int can_resume_eth_tx ( struct mp_ring r)
static

Definition at line 3073 of file t4_sge.c.

References mp_ring::cookie, eq, r, sge_eq::sidx, and total_available_tx_desc().

Referenced by alloc_txq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cannot_use_txpkts()

static bool cannot_use_txpkts ( struct mbuf *  m)
inlinestatic

Definition at line 3081 of file t4_sge.c.

References mbuf_cflags(), MC_RAW_WR, MC_TLS, and needs_tso().

Referenced by add_to_txpkts_pf(), add_to_txpkts_vf(), and eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cl_metadata()

static struct cluster_metadata * cl_metadata ( struct fl_sdesc sd)
inlinestatic

Definition at line 1697 of file t4_sge.c.

References fl_sdesc::cl, and fl_sdesc::moff.

Referenced by free_fl_buffers(), get_scatter_segment(), and refill_fl().

Here is the caller graph for this function:

◆ cmp_l2hdr()

static bool cmp_l2hdr ( struct txpkts txp,
struct mbuf *  m 
)
inlinestatic

Definition at line 5637 of file t4_sge.c.

References txpkts::ethmacdst, txpkts::ethtype, txpkts::npkt, txp, and VM_TX_L2HDR_LEN.

Referenced by add_to_txpkts_vf().

Here is the caller graph for this function:

◆ commit_wrq_wr()

◆ copy_to_txd()

static void copy_to_txd ( struct sge_eq eq,
caddr_t  from,
caddr_t *  to,
int  len 
)
inlinestatic

Definition at line 6058 of file t4_sge.c.

References sge_eq::desc, eq, and sge_eq::sidx.

Referenced by write_raw_wr(), and write_txpkt_wr().

Here is the caller graph for this function:

◆ count_mbuf_ext_pgs()

static int count_mbuf_ext_pgs ( struct mbuf *  m,
int  skip,
vm_paddr_t *  nextaddr 
)
inlinestatic

Definition at line 2545 of file t4_sge.c.

Referenced by count_mbuf_nsegs().

Here is the caller graph for this function:

◆ count_mbuf_nsegs()

static int count_mbuf_nsegs ( struct mbuf *  m,
int  skip,
uint8_t *  cflags 
)
inlinestatic

Definition at line 2611 of file t4_sge.c.

References count_mbuf_ext_pgs(), and MC_NOMAP.

Referenced by parse_pkt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ csum_to_ctrl()

static uint64_t csum_to_ctrl ( struct adapter sc,
struct mbuf *  m 
)
inlinestatic

◆ CTASSERT()

CTASSERT ( offsetof(struct cpl_fw4_msg, data)  = =offsetof(struct cpl_fw6_msg, data))

◆ ctrl_eq_alloc()

◆ discard_tx()

static int discard_tx ( struct sge_eq eq)
inlinestatic

Definition at line 3089 of file t4_sge.c.

References eq, EQ_ENABLED, EQ_QFLUSH, and sge_eq::flags.

Referenced by eth_tx().

Here is the caller graph for this function:

◆ drain_wrq_wr_list()

static void drain_wrq_wr_list ( struct adapter sc,
struct sge_wrq wrq 
)
static

◆ eth_eq_alloc()

◆ eth_rx()

◆ eth_tx()

◆ find_refill_source()

static int find_refill_source ( struct adapter sc,
int  maxp,
bool  packing 
)
static

Definition at line 6249 of file t4_sge.c.

References CL_METADATA_SIZE, rx_buf_info::hwidx1, rx_buf_info::hwidx2, largest_rx_cluster, sge::rx_buf_info, adapter::sge, rx_buf_info::size1, rx_buf_info::size2, and SW_ZONE_SIZES.

Referenced by init_fl(), and t4_update_fl_bufsize().

Here is the caller graph for this function:

◆ free_ctrlq()

static void free_ctrlq ( struct adapter sc,
int  idx 
)
static

Definition at line 3909 of file t4_sge.c.

References sge::ctrlq, sge_wrq::eq, EQ_HW_ALLOCATED, EQ_SW_ALLOCATED, sge_eq::flags, free_eq_hwq(), free_wrq(), and adapter::sge.

Referenced by t4_teardown_adapter_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_eq()

static void free_eq ( struct adapter sc,
struct sge_eq eq 
)
static

Definition at line 4374 of file t4_sge.c.

References sge_eq::ba, sge_eq::cidx, sge_eq::desc, sge_eq::desc_map, sge_eq::desc_tag, eq, EQ_ETH, sge_eq::eq_lock, EQ_SW_ALLOCATED, sge_eq::flags, free_ring(), sge_eq::pidx, and sge_eq::type.

Referenced by free_txq(), and free_wrq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_eq_hwq() [1/2]

static int free_eq_hwq ( struct adapter ,
struct vi_info ,
struct sge_eq  
)
static

Referenced by free_ctrlq(), and free_txq().

Here is the caller graph for this function:

◆ free_eq_hwq() [2/2]

static int free_eq_hwq ( struct adapter sc,
struct vi_info *vi  __unused,
struct sge_eq eq 
)
static

Definition at line 4470 of file t4_sge.c.

References CH_ERR, sge_eq::cntxt_id, eq, EQ_CTRL, EQ_ETH, EQ_HW_ALLOCATED, EQ_OFLD, sge_eq::flags, adapter::mbox, adapter::pf, t4_ctrl_eq_free(), t4_eth_eq_free(), t4_ofld_eq_free(), and sge_eq::type.

Here is the call graph for this function:

◆ free_fl_buffers()

void free_fl_buffers ( struct adapter sc,
struct sge_fl fl 
)

Definition at line 5066 of file t4_sge.c.

References fl_sdesc::cl, cl_metadata(), extfree_rels, fl, FL_BUF_PACKING, FL_BUF_RESUME, sge_fl::flags, sge_fl::m0, fl_sdesc::nmbuf, cluster_metadata::refcount, sge::rx_buf_info, sge_fl::sdesc, adapter::sge, sge_fl::sidx, fl_sdesc::zidx, and rx_buf_info::zone.

Referenced by free_iq_fl(), and quiesce_iq_fl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_fwq()

static void free_fwq ( struct adapter sc)
static

Definition at line 3840 of file t4_sge.c.

References sge_iq::flags, free_iq_fl(), free_iq_fl_hwq(), sge::fwq, IQ_HW_ALLOCATED, IQ_SW_ALLOCATED, and adapter::sge.

Referenced by t4_teardown_adapter_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_iq_fl()

static void free_iq_fl ( struct adapter sc,
struct sge_iq iq,
struct sge_fl fl 
)
static

Definition at line 3530 of file t4_sge.c.

References sge_iq::ba, sge_fl::ba, sge_iq::desc, sge_fl::desc, sge_iq::desc_map, sge_fl::desc_map, sge_iq::desc_tag, sge_fl::desc_tag, fl, sge_fl::fl_lock, sge_iq::flags, free_fl_buffers(), free_ring(), iq, IQ_HAS_FL, IQ_SW_ALLOCATED, and sge_fl::sdesc.

Referenced by free_fwq(), and free_rxq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_iq_fl_hwq()

static int free_iq_fl_hwq ( struct adapter sc,
struct sge_iq iq,
struct sge_fl fl 
)
static

Definition at line 3717 of file t4_sge.c.

References CH_ERR, sge_iq::cntxt_id, sge_fl::cntxt_id, fl, sge_iq::flags, FW_IQ_TYPE_FL_INT_CAP, iq, IQ_HW_ALLOCATED, adapter::mbox, adapter::pf, and t4_iq_free().

Referenced by free_fwq(), and free_rxq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_ring()

int free_ring ( struct adapter sc,
bus_dma_tag_t  tag,
bus_dmamap_t  map,
bus_addr_t  pa,
void *  va 
)

Definition at line 3467 of file t4_sge.c.

References tag.

Referenced by alloc_iq_fl(), alloc_ring(), free_eq(), and free_iq_fl().

Here is the caller graph for this function:

◆ free_rxq()

static void free_rxq ( struct vi_info vi,
struct sge_rxq rxq 
)
static

Definition at line 4024 of file t4_sge.c.

References vi_info::adapter, sge_rxq::fl, sge_iq::flags, free_iq_fl(), free_iq_fl_hwq(), sge_rxq::iq, IQ_HW_ALLOCATED, IQ_SW_ALLOCATED, sge_rxq::lro, and rxq.

Referenced by t4_teardown_vi_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_txq()

static void free_txq ( struct vi_info vi,
struct sge_txq txq 
)
static

Definition at line 4653 of file t4_sge.c.

References vi_info::adapter, eq, sge_txq::eq, EQ_HW_ALLOCATED, EQ_SW_ALLOCATED, sge_eq::flags, free_eq(), free_eq_hwq(), sge_txq::gl, mp_ring_free(), sge_txq::r, and sge_txq::sdesc.

Referenced by t4_teardown_vi_queues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_wrq()

static void free_wrq ( struct adapter sc,
struct sge_wrq wrq 
)
static

Definition at line 4527 of file t4_sge.c.

References sge_wrq::eq, free_eq(), sge_wrq::nwr_pending, and wrq.

Referenced by free_ctrlq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fw4_ack_handler()

static int fw4_ack_handler ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 468 of file t4_sge.c.

References sge_iq::adapter, CPL_COOKIE_ETHOFLD, CPL_COOKIE_TOM, fw4_ack_handlers, G_CPL_FW4_ACK_FLOWID, iq, is_etid(), and OPCODE_TID.

Referenced by t4_init_shared_cpl_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_fl_payload() [1/2]

static struct mbuf * get_fl_payload ( struct adapter ,
struct sge_fl ,
uint32_t   
)
static

Referenced by eth_rx(), and service_iq_fl().

Here is the caller graph for this function:

◆ get_fl_payload() [2/2]

static struct mbuf * get_fl_payload ( struct adapter sc,
struct sge_fl fl,
const u_int  plen 
)
static

Definition at line 1797 of file t4_sge.c.

References fl, FL_BUF_RESUME, sge_fl::flags, get_scatter_segment(), sge_fl::m0, sge_fl::pnext, sge_fl::remaining, and sge_fl::rx_offset.

Here is the call graph for this function:

◆ get_flit()

static __be64 get_flit ( struct sglist_seg *  segs,
int  nsegs,
int  idx 
)
static

Definition at line 6225 of file t4_sge.c.

References ss_len.

Referenced by write_gl_to_txd().

Here is the caller graph for this function:

◆ get_pkt_gl()

static void get_pkt_gl ( struct mbuf *  m,
struct sglist *  gl 
)
inlinestatic

Definition at line 5097 of file t4_sge.c.

References gl, max_nsegs_allowed(), and mbuf_nsegs().

Referenced by write_gl_to_txd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_scatter_segment()

static struct mbuf * get_scatter_segment ( struct adapter sc,
struct sge_fl fl,
int  fr_offset,
int  remaining 
)
static

◆ get_segment_len()

static int get_segment_len ( struct adapter sc,
struct sge_fl fl,
int  plen 
)
inlinestatic

Definition at line 1891 of file t4_sge.c.

References sge_fl::cidx, fl, FL_BUF_PACKING, sge_fl::flags, sge::rx_buf_info, sge_fl::rx_offset, sge_fl::sdesc, adapter::sge, rx_buf_info::size1, rx_buf_info::size2, and fl_sdesc::zidx.

Referenced by eth_rx().

Here is the caller graph for this function:

◆ handle_eth_egr_update()

static void handle_eth_egr_update ( struct adapter sc,
struct sge_eq eq 
)
static

Definition at line 6307 of file t4_sge.c.

References eq, EQ_ETH, sge_eq::equiq, mp_ring_check_drainage(), mp_ring_is_idle(), sge_txq::r, adapter::tq, sge_eq::tx_chan, sge_txq::tx_reclaim_task, and sge_eq::type.

Referenced by handle_sge_egr_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_fw_msg()

static int handle_fw_msg ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 6347 of file t4_sge.c.

References sge_iq::adapter, cpl_fw6_msg::data, FW6_TYPE_RSSCPL, FW_TYPE_RSSCPL, iq, rss_header::opcode, t4_cpl_handler, t4_fw_msg_handler, and cpl_fw6_msg::type.

Referenced by t4_sge_modload().

Here is the caller graph for this function:

◆ handle_sge_egr_update()

static int handle_sge_egr_update ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 6321 of file t4_sge.c.

References sge_iq::adapter, eq, sge::eq_base, sge::eq_start, sge::eqmap, G_EGR_QID, handle_eth_egr_update(), handle_wrq_egr_update(), iq, rss_header::opcode, cpl_sge_egr_update::opcode_qid, adapter::sge, and sge_eq::type.

Referenced by t4_sge_modload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_wrq_egr_update()

static void handle_wrq_egr_update ( struct adapter sc,
struct sge_eq eq 
)
static

Definition at line 6298 of file t4_sge.c.

References eq, sge_eq::equiq, adapter::tq, sge_eq::tx_chan, wrq, and sge_wrq::wrq_tx_task.

Referenced by handle_sge_egr_update().

Here is the caller graph for this function:

◆ hwsz_ok()

static int hwsz_ok ( struct adapter sc,
int  hwsz 
)
inlinestatic

Definition at line 842 of file t4_sge.c.

References fl_pad, sge_params::pad_boundary, adapter::params, and adapter_params::sge.

Referenced by t4_init_rx_buf_info().

Here is the caller graph for this function:

◆ imm_payload()

static u_int imm_payload ( u_int  ndesc)
inlinestatic

Definition at line 5214 of file t4_sge.c.

References EQ_ESIZE.

Referenced by write_txpkt_wr().

Here is the caller graph for this function:

◆ init_eq()

static void init_eq ( struct adapter sc,
struct sge_eq eq,
int  eqtype,
int  qsize,
uint8_t  tx_chan,
struct sge_iq iq,
char *  name 
)
inlinestatic

Definition at line 3420 of file t4_sge.c.

References eq, EQ_CTRL, EQ_ESIZE, sge_eq::eq_lock, EQ_OFLD, iq, sge_eq::iq, sge_eq::lockname, adapter::params, adapter_params::sge, sge_eq::sidx, sge_params::spg_len, sge_eq::tx_chan, and sge_eq::type.

Referenced by alloc_ctrlq(), and alloc_txq().

Here is the caller graph for this function:

◆ init_fl()

static void init_fl ( struct adapter sc,
struct sge_fl fl,
int  qsize,
int  maxp,
char *  name 
)
inlinestatic

◆ init_iq()

static void init_iq ( struct sge_iq iq,
struct adapter sc,
int  tmr_idx,
int  pktc_idx,
int  qsize,
int  intr_idx,
int  cong 
)
inlinestatic

◆ l2t_write_rpl_handler()

static int l2t_write_rpl_handler ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 426 of file t4_sge.c.

References CPL_COOKIE_FILTER, CPL_COOKIE_TOM, F_SYNC_WR, GET_TID, iq, and l2t_write_rpl_handlers.

Referenced by t4_init_shared_cpl_handlers().

Here is the caller graph for this function:

◆ last_flit_to_ns()

static uint64_t last_flit_to_ns ( struct adapter sc,
uint64_t  lf 
)
inlinestatic

Definition at line 1515 of file t4_sge.c.

References vpd_params::cclk, adapter::params, and adapter_params::vpd.

Referenced by eth_rx().

Here is the caller graph for this function:

◆ max_nsegs_allowed()

static int max_nsegs_allowed ( struct mbuf *  m,
bool  vm_wr 
)
static

Definition at line 2654 of file t4_sge.c.

References needs_tso(), needs_vxlan_tso(), TX_SGL_SEGS, TX_SGL_SEGS_TSO, TX_SGL_SEGS_VM, TX_SGL_SEGS_VM_TSO, and TX_SGL_SEGS_VXLAN_TSO.

Referenced by get_pkt_gl(), and parse_pkt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max_rx_payload()

static int max_rx_payload ( struct adapter sc,
struct ifnet *  ifp,
const bool  ofld 
)
inlinestatic

◆ mbuf_cflags()

static int mbuf_cflags ( struct mbuf *  m)
inlinestatic

Definition at line 2275 of file t4_sge.c.

Referenced by cannot_use_txpkts(), eth_tx(), mbuf_len16(), parse_pkt(), set_mbuf_len16(), and write_txpkt_wr().

Here is the caller graph for this function:

◆ mbuf_len16()

static int mbuf_len16 ( struct mbuf *  m)
inlinestatic

Definition at line 2291 of file t4_sge.c.

References mbuf_cflags(), MC_TLS, and SGE_MAX_WR_LEN.

Referenced by eth_tx(), write_raw_wr(), write_txpkt_vm_wr(), and write_txpkt_wr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbuf_nsegs()

static int mbuf_nsegs ( struct mbuf *  m)
inlinestatic

Definition at line 2256 of file t4_sge.c.

Referenced by add_to_txpkts_pf(), add_to_txpkts_vf(), calculate_mbuf_len16(), eth_tx(), get_pkt_gl(), write_txpkt_wr(), write_txpkts_vm_wr(), and write_txpkts_wr().

Here is the caller graph for this function:

◆ move_to_next_rxbuf()

static void move_to_next_rxbuf ( struct sge_fl fl)
inlinestatic

Definition at line 1526 of file t4_sge.c.

References cidx, sge_fl::cidx, fl, sge_fl::hw_cidx, sge_fl::rx_offset, and sge_fl::sidx.

Referenced by get_scatter_segment(), service_iq_fl(), and skip_scatter_segment().

Here is the caller graph for this function:

◆ needs_hwcsum()

static bool needs_hwcsum ( struct mbuf *  m)
inlinestatic

Definition at line 2406 of file t4_sge.c.

Referenced by csum_to_ctrl(), and parse_pkt().

Here is the caller graph for this function:

◆ needs_l3_csum()

static bool needs_l3_csum ( struct mbuf *  m)
inlinestatic

Definition at line 2464 of file t4_sge.c.

Referenced by csum_to_ctrl().

Here is the caller graph for this function:

◆ needs_outer_tcp_csum()

static bool needs_outer_tcp_csum ( struct mbuf *  m)
inlinestatic

Definition at line 2475 of file t4_sge.c.

Referenced by parse_pkt().

Here is the caller graph for this function:

◆ needs_tso()

static bool needs_tso ( struct mbuf *  m)
inlinestatic

Definition at line 2420 of file t4_sge.c.

Referenced by calculate_mbuf_len16(), cannot_use_txpkts(), max_nsegs_allowed(), parse_pkt(), write_txpkt_vm_wr(), and write_txpkt_wr().

Here is the caller graph for this function:

◆ needs_vlan_insertion()

static bool needs_vlan_insertion ( struct mbuf *  m)
inlinestatic

Definition at line 2509 of file t4_sge.c.

Referenced by write_txpkt_vm_wr(), write_txpkt_wr(), write_txpkts_vm_wr(), and write_txpkts_wr().

Here is the caller graph for this function:

◆ needs_vxlan_csum()

static bool needs_vxlan_csum ( struct mbuf *  m)
inlinestatic

Definition at line 2431 of file t4_sge.c.

Referenced by csum_to_ctrl(), parse_pkt(), write_txpkt_wr(), and write_txpkts_wr().

Here is the caller graph for this function:

◆ needs_vxlan_tso()

static bool needs_vxlan_tso ( struct mbuf *  m)
inlinestatic

Definition at line 2440 of file t4_sge.c.

Referenced by calculate_mbuf_len16(), max_nsegs_allowed(), parse_pkt(), and write_txpkt_wr().

Here is the caller graph for this function:

◆ oneseg_dma_callback()

static void oneseg_dma_callback ( void *  arg,
bus_dma_segment_t *  segs,
int  nseg,
int  error 
)
static

Definition at line 4892 of file t4_sge.c.

References ba.

Referenced by alloc_ring().

Here is the caller graph for this function:

◆ parse_pkt()

int parse_pkt ( struct mbuf **  mp,
bool  vm_wr 
)

◆ qsize_to_fthresh()

static u_int qsize_to_fthresh ( int  qsize)
static

Definition at line 4199 of file t4_sge.c.

References ilog2(), and X_CIDXFLUSHTHRESH_128.

Referenced by ctrl_eq_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_hw_cidx()

static uint16_t read_hw_cidx ( struct sge_eq eq)
inlinestatic

Definition at line 6157 of file t4_sge.c.

References cidx, sge_qstat::cidx, sge_eq::desc, eq, and sge_eq::sidx.

Referenced by drain_wrq_wr_list(), reclaimable_tx_desc(), start_wrq_wr(), and total_available_tx_desc().

Here is the caller graph for this function:

◆ reclaim_tx_descs()

static u_int reclaim_tx_descs ( struct sge_txq txq,
u_int  n 
)
static

Definition at line 6169 of file t4_sge.c.

References sge_eq::cidx, tx_sdesc::desc_used, eq, sge_txq::eq, IDXINCR, tx_sdesc::m, reclaimable_tx_desc(), sge_txq::sdesc, sge_eq::sidx, and TXQ_LOCK_ASSERT_OWNED.

Referenced by eth_tx(), and tx_reclaim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reclaimable_tx_desc()

static u_int reclaimable_tx_desc ( struct sge_eq eq)
inlinestatic

Definition at line 6134 of file t4_sge.c.

References sge_eq::cidx, eq, IDXDIFF, read_hw_cidx(), and sge_eq::sidx.

Referenced by reclaim_tx_descs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ record_eth_tx_time()

static bool record_eth_tx_time ( struct sge_txq txq)
inlinestatic

Definition at line 3135 of file t4_sge.c.

References last_tx, sge_txq::last_tx, and t4_tx_coalesce_gap.

Referenced by eth_tx().

Here is the caller graph for this function:

◆ refill_fl()

◆ refill_sfl()

static void refill_sfl ( void *  arg)
static

Definition at line 5040 of file t4_sge.c.

References fl, FL_DOOMED, FL_LOCK, FL_NOT_RUNNING_LOW, FL_UNLOCK, sge_fl::flags, refill_fl(), adapter::sfl_callout, and adapter::sfl_lock.

Referenced by add_fl_to_sfl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ring_eq_db()

static void ring_eq_db ( struct adapter sc,
struct sge_eq eq,
u_int  n 
)
inlinestatic

Definition at line 6080 of file t4_sge.c.

References sge_eq::cntxt_id, sge_eq::dbidx, sge_eq::desc, DOORBELL_KDB, DOORBELL_UDB, DOORBELL_UDBWC, DOORBELL_WCWR, sge_eq::doorbells, eq, IDXINCR, adapter::sge_kdoorbell_reg, sge_eq::sidx, t4_write_reg(), sge_eq::udb, sge_eq::udb_qid, UDBS_DB_OFFSET, UDBS_WR_OFFSET, V_PIDX, and V_QID.

Referenced by commit_wrq_wr(), drain_wrq_wr_list(), and eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ring_fl_db()

static void ring_fl_db ( struct adapter sc,
struct sge_fl fl 
)
inlinestatic

Definition at line 4903 of file t4_sge.c.

References sge_fl::dbidx, sge_fl::dbval, fl, IDXDIFF, IDXINCR, sge_fl::pidx, adapter::sge_kdoorbell_reg, sge_fl::sidx, t4_write_reg(), sge_fl::udb, and V_PIDX.

Referenced by refill_fl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rxb_free()

static void rxb_free ( struct mbuf *  m)
static

Definition at line 1704 of file t4_sge.c.

References cluster_metadata::cl, extfree_rels, and cluster_metadata::zone.

Referenced by get_scatter_segment().

Here is the caller graph for this function:

◆ save_l2hdr()

static void save_l2hdr ( struct txpkts txp,
struct mbuf *  m 
)
inlinestatic

Definition at line 5653 of file t4_sge.c.

References txpkts::ethmacdst, txp, and VM_TX_L2HDR_LEN.

Referenced by add_to_txpkts_vf().

Here is the caller graph for this function:

◆ service_iq()

◆ service_iq_fl()

◆ set_mbuf_cflags()

static void set_mbuf_cflags ( struct mbuf *  m,
uint8_t  flags 
)
inlinestatic

Definition at line 2283 of file t4_sge.c.

References sge_fl::flags.

Referenced by alloc_wr_mbuf(), and parse_pkt().

Here is the caller graph for this function:

◆ set_mbuf_len16()

static void set_mbuf_len16 ( struct mbuf *  m,
uint8_t  len16 
)
inlinestatic

Definition at line 2304 of file t4_sge.c.

References mbuf_cflags(), MC_TLS, and SGE_MAX_WR_LEN.

Referenced by alloc_wr_mbuf(), calculate_mbuf_len16(), and parse_pkt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_mbuf_nsegs()

static void set_mbuf_nsegs ( struct mbuf *  m,
uint8_t  nsegs 
)
inlinestatic

Definition at line 2267 of file t4_sge.c.

Referenced by parse_pkt().

Here is the caller graph for this function:

◆ set_tcb_rpl_handler()

static int set_tcb_rpl_handler ( struct sge_iq iq,
const struct rss_header rss,
struct mbuf *  m 
)
static

Definition at line 399 of file t4_sge.c.

References sge_iq::adapter, cpl_set_tcb_rpl::cookie, CPL_COOKIE_FILTER, CPL_COOKIE_RESERVED, G_COOKIE, GET_TID, iq, is_ftid(), is_hpftid(), and set_tcb_rpl_handlers.

Referenced by t4_init_shared_cpl_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_txupdate_flags()

static void set_txupdate_flags ( struct sge_txq txq,
u_int  avail,
struct fw_eth_tx_pkt_wr wr 
)
inlinestatic

Definition at line 3114 of file t4_sge.c.

References eq, sge_txq::eq, sge_eq::equeqidx, sge_eq::equiq, fw_eth_tx_pkt_wr::equiq_to_len16, F_FW_WR_EQUEQ, F_FW_WR_EQUIQ, IDXDIFF, txpkts::npkt, sge_eq::pidx, sidx, sge_eq::sidx, txp, and sge_txq::txp.

Referenced by eth_tx().

Here is the caller graph for this function:

◆ setup_pad_and_pack_boundaries()

static void setup_pad_and_pack_boundaries ( struct adapter sc)
inlinestatic

◆ skip_fl_payload()

static void skip_fl_payload ( struct adapter sc,
struct sge_fl fl,
int  plen 
)
inlinestatic

Definition at line 1877 of file t4_sge.c.

References fl, and skip_scatter_segment().

Referenced by eth_rx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip_scatter_segment()

static int skip_scatter_segment ( struct adapter sc,
struct sge_fl fl,
int  fr_offset,
int  remaining 
)
static

Definition at line 1846 of file t4_sge.c.

References sge_fl::buf_boundary, sge_fl::cidx, fl, FL_BUF_PACKING, sge_fl::flags, move_to_next_rxbuf(), sge::rx_buf_info, sge_fl::rx_offset, sge_fl::sdesc, adapter::sge, rx_buf_info::size1, rx_buf_info::size2, and fl_sdesc::zidx.

Referenced by skip_fl_payload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_wrq_wr()

void * start_wrq_wr ( struct sge_wrq wrq,
int  len16,
struct wrq_cookie cookie 
)

◆ sysctl_bufsizes()

static int sysctl_bufsizes ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 6447 of file t4_sge.c.

References bufidx_used(), adapter::params, adapter_params::sge, sge_params::sge_fl_buffer_size, and SGE_FLBUF_SIZES.

Referenced by t4_sge_sysctls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCTL_COUNTER_U64() [1/2]

SYSCTL_COUNTER_U64 ( _hw_cxgbe  ,
OID_AUTO  ,
defrags  ,
CTLFLAG_RD  ,
defrags,
"Number of mbuf defrags performed"   
)

◆ SYSCTL_COUNTER_U64() [2/2]

SYSCTL_COUNTER_U64 ( _hw_cxgbe  ,
OID_AUTO  ,
pullups  ,
CTLFLAG_RD  ,
pullups,
"Number of mbuf pullups performed"   
)

◆ SYSCTL_INT() [1/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
buffer_packing  ,
CTLFLAG_RDTUN  ,
buffer_packing,
,
"Enable buffer packing"   
)

◆ SYSCTL_INT() [2/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
cong_drop  ,
CTLFLAG_RDTUN  ,
cong_drop,
 
)

◆ SYSCTL_INT() [3/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
fl_pack  ,
CTLFLAG_RDTUN  ,
fl_pack,
,
"payload pack boundary (bytes)"   
)

◆ SYSCTL_INT() [4/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
fl_pad  ,
CTLFLAG_RDTUN  ,
fl_pad,
,
"payload pad boundary (bytes)"   
)

◆ SYSCTL_INT() [5/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
fl_pktshift  ,
CTLFLAG_RDTUN  ,
fl_pktshift,
,
"payload DMA offset in rx buffer (bytes)"   
)

◆ SYSCTL_INT() [6/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
largest_rx_cluster  ,
CTLFLAG_RDTUN  ,
largest_rx_cluster,
,
"Largest rx cluster (bytes)"   
)

◆ SYSCTL_INT() [7/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
lro_entries  ,
CTLFLAG_RDTUN  ,
lro_entries,
,
"Number of LRO entries per RX queue"   
)

◆ SYSCTL_INT() [8/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
lro_mbufs  ,
CTLFLAG_RDTUN  ,
lro_mbufs,
,
"Enable presorting of LRO frames"   
)

◆ SYSCTL_INT() [9/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
safest_rx_cluster  ,
CTLFLAG_RDTUN  ,
safest_rx_cluster,
,
"Safe rx cluster (bytes)"   
)

◆ SYSCTL_INT() [10/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
spg_len  ,
CTLFLAG_RDTUN  ,
spg_len,
,
"status page size (bytes)"   
)

◆ SYSCTL_INT() [11/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
tscale  ,
CTLFLAG_RDTUN  ,
tscale,
,
"Interrupt holdoff timer scale on T6+"   
)

◆ SYSCTL_INT() [12/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
tx_coalesce  ,
CTLFLAG_RWTUN  ,
t4_tx_coalesce,
,
"tx coalescing allowed"   
)

◆ SYSCTL_INT() [13/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
tx_coalesce_gap  ,
CTLFLAG_RWTUN  ,
t4_tx_coalesce_gap,
,
"tx gap (in microseconds)"   
)

◆ SYSCTL_INT() [14/14]

SYSCTL_INT ( _hw_cxgbe  ,
OID_AUTO  ,
tx_coalesce_pkts  ,
CTLFLAG_RWTUN  ,
t4_tx_coalesce_pkts,
,
"# of consecutive packets (1 - 255) that will trigger tx coalescing"   
)

◆ t4_create_dma_tag()

int t4_create_dma_tag ( struct adapter sc)

Definition at line 977 of file t4_sge.c.

References adapter::dev, and adapter::dmat.

Referenced by t4_attach(), and t4vf_attach().

Here is the caller graph for this function:

◆ t4_destroy_dma_tag()

int t4_destroy_dma_tag ( struct adapter sc)

Definition at line 1020 of file t4_sge.c.

References adapter::dmat.

Referenced by t4_detach_common().

Here is the caller graph for this function:

◆ t4_handle_wrerr_rpl()

◆ t4_init_rx_buf_info()

◆ t4_init_shared_cpl_handlers()

static void t4_init_shared_cpl_handlers ( void  )
static

Definition at line 485 of file t4_sge.c.

References abort_rpl_rss_handler(), act_open_rpl_handler(), CPL_ABORT_RPL_RSS, CPL_ACT_OPEN_RPL, CPL_FW4_ACK, CPL_L2T_WRITE_RPL, CPL_SET_TCB_RPL, fw4_ack_handler(), l2t_write_rpl_handler(), set_tcb_rpl_handler(), and t4_register_cpl_handler().

Referenced by t4_sge_modload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_intr()

void t4_intr ( void *  arg)

Definition at line 1339 of file t4_sge.c.

References iq, IQS_BUSY, IQS_IDLE, service_iq_fl(), and sge_iq::state.

Referenced by t4_setup_intr_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_intr_all()

void t4_intr_all ( void *  arg)

Definition at line 1282 of file t4_sge.c.

References A_PCIE_PF_CLI, sge::fwq, adapter::intr_count, INTR_INTX, adapter::intr_type, MYPF_REG, adapter::sge, t4_intr_err(), t4_intr_evt(), and t4_write_reg().

Referenced by t4_setup_intr_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_intr_err()

void t4_intr_err ( void *  arg)

Definition at line 1301 of file t4_sge.c.

References A_PL_PF_INT_CAUSE, ADAP_FATAL_ERR, adapter::debug_flags, DF_VERBOSE_SLOWINTR, adapter::error_flags, F_PFSW, MYPF_REG, adapter::swintr, t4_fatal_err(), t4_read_reg(), t4_slow_intr_handler(), and t4_write_reg().

Referenced by t4_intr_all(), and t4_setup_intr_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_intr_evt()

void t4_intr_evt ( void *  arg)

Definition at line 1325 of file t4_sge.c.

References iq, IQS_BUSY, IQS_IDLE, service_iq(), and sge_iq::state.

Referenced by t4_intr_all(), and t4_setup_intr_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_register_an_handler()

void t4_register_an_handler ( an_handler_t  h)

Definition at line 357 of file t4_sge.c.

References t4_an_handler.

◆ t4_register_cpl_handler()

void t4_register_cpl_handler ( int  opcode,
cpl_handler_t  h 
)

Definition at line 387 of file t4_sge.c.

References t4_cpl_handler.

Referenced by ccr_modevent(), mod_event(), t4_init_shared_cpl_handlers(), and t4_sge_modload().

Here is the caller graph for this function:

◆ t4_register_fw_msg_handler()

void t4_register_fw_msg_handler ( int  type,
fw_msg_handler_t  h 
)

Definition at line 368 of file t4_sge.c.

References FW6_TYPE_RSSCPL, FW_TYPE_RSSCPL, and t4_fw_msg_handler.

Referenced by t4_sge_modload().

Here is the caller graph for this function:

◆ t4_register_shared_cpl_handler()

void t4_register_shared_cpl_handler ( int  opcode,
cpl_handler_t  h,
int  cookie 
)

◆ t4_setup_adapter_queues()

int t4_setup_adapter_queues ( struct adapter sc)

Definition at line 1036 of file t4_sge.c.

References ADAPTER_LOCK_ASSERT_NOTOWNED, alloc_ctrlq(), alloc_fwq(), adapter::flags, for_each_port, and IS_VF.

Referenced by adapter_full_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_setup_vi_queues()

int t4_setup_vi_queues ( struct vi_info vi)

◆ t4_sge_extfree_refs()

uint64_t t4_sge_extfree_refs ( void  )

Definition at line 623 of file t4_sge.c.

References extfree_refs, and extfree_rels.

Referenced by mod_event().

Here is the caller graph for this function:

◆ t4_sge_modload()

◆ t4_sge_modunload()

void t4_sge_modunload ( void  )

Definition at line 613 of file t4_sge.c.

References defrags, extfree_refs, extfree_rels, and pullups.

Referenced by mod_event().

Here is the caller graph for this function:

◆ t4_sge_sysctls()

void t4_sge_sysctls ( struct adapter sc,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid_list *  children 
)

Definition at line 994 of file t4_sge.c.

References cong_drop, sge_params::fl_pktshift, sge_params::pack_boundary, sge_params::pad_boundary, adapter::params, adapter_params::sge, sge_params::spg_len, and sysctl_bufsizes().

Referenced by t4_sysctls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_teardown_adapter_queues()

int t4_teardown_adapter_queues ( struct adapter sc)

Definition at line 1075 of file t4_sge.c.

References ADAPTER_LOCK_ASSERT_NOTOWNED, sge::ctrlq, adapter::flags, for_each_port, free_ctrlq(), free_fwq(), IS_VF, and adapter::sge.

Referenced by adapter_full_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_teardown_vi_queues()

int t4_teardown_vi_queues ( struct vi_info vi)

Definition at line 1215 of file t4_sge.c.

References for_each_nm_rxq, for_each_nm_txq, for_each_ofld_rxq, for_each_ofld_txq, for_each_rxq, for_each_txq, free_rxq(), free_txq(), vi_info::ifp, nm_rxq, and rxq.

Referenced by t4_setup_vi_queues(), and vi_full_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_tweak_chip_settings()

void t4_tweak_chip_settings ( struct adapter sc)

Definition at line 712 of file t4_sge.c.

References A_SGE_CONTROL, A_SGE_FL_BUFFER_SIZE0, A_SGE_FL_BUFFER_SIZE1, A_SGE_FL_BUFFER_SIZE15, A_SGE_FL_BUFFER_SIZE2, A_SGE_HOST_PAGE_SIZE, A_SGE_INGRESS_RX_THRESHOLD, A_SGE_ITP_CONTROL, A_SGE_TIMER_VALUE_0_AND_1, A_SGE_TIMER_VALUE_2_AND_3, A_SGE_TIMER_VALUE_4_AND_5, A_TP_CMM_CONFIG, A_TP_PARA_REG5, A_ULP_RX_CTL, A_ULP_RX_ISCSI_PSZ, A_ULP_RX_TDDP_PSZ, vpd_params::cclk, CHELSIO_T6, chip_id(), CL_METADATA_SIZE, adapter::debug_flags, DF_DISABLE_TCB_CACHE, F_EGRSTATUSPAGESIZE, F_ISCSITAGTCB, F_REARMDDPOFFSET, F_RESETDDPOFFSET, F_RXPKTCPLMODE, F_TDDPTAGTCB, F_WRTHRTHRESHEN, fl_pktshift, adapter::flags, M_INDICATESIZE, M_PKTSHIFT, M_RDTHRESHOLD, M_TIMERVALUE0, M_TSCALE, M_WRTHRTHRESH, MASTER_PF, adapter::params, RX_COPY_THRESHOLD, setup_pad_and_pack_boundaries(), SGE_NCOUNTERS, SGE_NTIMERS, spg_len, t4_set_reg_field(), t4_tp_pio_read(), t4_tp_pio_write(), t4_write_reg(), tscale, us_to_core_ticks(), V_EGRSTATUSPAGESIZE, V_HOSTPAGESIZEPF0, V_HOSTPAGESIZEPF1, V_HOSTPAGESIZEPF2, V_HOSTPAGESIZEPF3, V_HOSTPAGESIZEPF4, V_HOSTPAGESIZEPF5, V_HOSTPAGESIZEPF6, V_HOSTPAGESIZEPF7, V_HPZ0, V_HPZ1, V_HPZ2, V_HPZ3, V_INDICATESIZE, V_PKTSHIFT, V_RDTHRESHOLD, V_THRESHOLD_0, V_THRESHOLD_1, V_THRESHOLD_2, V_THRESHOLD_3, V_TIMERVALUE0, V_TIMERVALUE1, V_TIMERVALUE2, V_TIMERVALUE3, V_TIMERVALUE4, V_TIMERVALUE5, V_TSCALE, V_WRTHRTHRESH, and adapter_params::vpd.

Referenced by apply_cfg_and_initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_update_fl_bufsize()

void t4_update_fl_bufsize ( struct ifnet *  ifp)

Definition at line 2222 of file t4_sge.c.

References vi_info::adapter, find_refill_source(), fl, sge_rxq::fl, sge_ofld_rxq::fl, FL_BUF_PACKING, FL_LOCK, FL_UNLOCK, sge_fl::flags, for_each_ofld_rxq, for_each_rxq, ifp, max_rx_payload(), rxq, and sge_fl::zidx.

Referenced by cxgbe_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_verify_chip_settings()

◆ t4_wrq_tx_locked()

void t4_wrq_tx_locked ( struct adapter sc,
struct sge_wrq wrq,
struct wrqe wr 
)

Definition at line 2197 of file t4_sge.c.

References sge_eq::dbidx, drain_wrq_wr_list(), eq, sge_wrq::eq, EQ_ESIZE, EQ_LOCK_ASSERT_OWNED, sge_wrq::ndesc_needed, sge_wrq::nwr_pending, sge_eq::pidx, SGE_MAX_WR_LEN, wrqe::wr_len, and wrq.

Referenced by t4_wrq_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tnl_cong()

int tnl_cong ( struct port_info pi,
int  drop 
)

Definition at line 3927 of file t4_sge.c.

References port_info::rx_e_chan_map.

Referenced by alloc_rxq().

Here is the caller graph for this function:

◆ total_available_tx_desc()

static u_int total_available_tx_desc ( struct sge_eq eq)
inlinestatic

Definition at line 6143 of file t4_sge.c.

References eq, IDXDIFF, pidx, sge_eq::pidx, read_hw_cidx(), and sge_eq::sidx.

Referenced by can_resume_eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tx_reclaim()

static void tx_reclaim ( void *  arg,
int  n 
)
static

Definition at line 6209 of file t4_sge.c.

References sge_eq::cidx, eq, sge_txq::eq, sge_eq::equeqidx, sge_eq::pidx, reclaim_tx_descs(), TXQ_TRYLOCK, and TXQ_UNLOCK.

Referenced by alloc_txq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ txpkt_len16()

static u_int txpkt_len16 ( u_int  nsegs,
const u_int  extra 
)
inlinestatic

Definition at line 5124 of file t4_sge.c.

Referenced by calculate_mbuf_len16().

Here is the caller graph for this function:

◆ txpkt_vm_len16()

static u_int txpkt_vm_len16 ( u_int  nsegs,
const u_int  extra 
)
inlinestatic

Definition at line 5143 of file t4_sge.c.

Referenced by calculate_mbuf_len16().

Here is the caller graph for this function:

◆ txpkts0_len16()

static u_int txpkts0_len16 ( u_int  nsegs)
inlinestatic

Definition at line 5185 of file t4_sge.c.

Referenced by add_to_txpkts_pf(), and write_txpkts_wr().

Here is the caller graph for this function:

◆ txpkts1_len16()

static u_int txpkts1_len16 ( void  )
inlinestatic

Definition at line 5204 of file t4_sge.c.

Referenced by add_to_txpkts_pf(), and add_to_txpkts_vf().

Here is the caller graph for this function:

◆ wr_can_update_eq()

static int wr_can_update_eq ( void *  p)
inlinestatic

Definition at line 3096 of file t4_sge.c.

References FW_ETH_TX_PKT_VM_WR, FW_ETH_TX_PKT_WR, FW_ETH_TX_PKTS2_WR, FW_ETH_TX_PKTS_VM_WR, FW_ETH_TX_PKTS_WR, FW_ULPTX_WR, G_FW_WR_OP, and fw_eth_tx_pkts_wr::op_pkd.

Referenced by eth_tx().

Here is the caller graph for this function:

◆ write_gl_to_txd()

static void write_gl_to_txd ( struct sge_txq txq,
struct mbuf *  m,
caddr_t *  to,
int  checkwrap 
)
static

◆ write_lso_cpl()

static void * write_lso_cpl ( void *  cpl,
struct mbuf *  m0 
)
inlinestatic

◆ write_raw_wr()

static u_int write_raw_wr ( struct sge_txq txq,
void *  wr,
struct mbuf *  m0,
u_int  available 
)
static

Definition at line 5492 of file t4_sge.c.

References copy_to_txd(), tx_sdesc::desc_used, eq, sge_txq::eq, tx_sdesc::m, mbuf_len16(), sge_eq::pidx, sge_txq::raw_wrs, sge_txq::sdesc, and tx_len16_to_desc().

Referenced by eth_tx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_tnl_lso_cpl()

◆ write_txpkt_vm_wr()

◆ write_txpkt_wr()

◆ write_txpkts_vm_wr()

◆ write_txpkts_wr()

◆ wrq_tx_drain()

static void wrq_tx_drain ( void *  arg,
int  n 
)
static

Definition at line 2108 of file t4_sge.c.

References sge_wrq::adapter, drain_wrq_wr_list(), eq, sge_wrq::eq, EQ_LOCK, EQ_UNLOCK, and wrq.

Referenced by alloc_wrq().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ abort_rpl_rss_handlers

cpl_handler_t abort_rpl_rss_handlers[NUM_CPL_COOKIES]

Definition at line 353 of file t4_sge.c.

Referenced by abort_rpl_rss_handler(), and t4_register_shared_cpl_handler().

◆ act_open_rpl_handlers

cpl_handler_t act_open_rpl_handlers[NUM_CPL_COOKIES]

Definition at line 352 of file t4_sge.c.

Referenced by act_open_rpl_handler(), and t4_register_shared_cpl_handler().

◆ buffer_packing

int buffer_packing = -1
static

Definition at line 138 of file t4_sge.c.

Referenced by init_fl(), and setup_pad_and_pack_boundaries().

◆ cong_drop

int cong_drop = 0
static

Definition at line 128 of file t4_sge.c.

Referenced by alloc_rxq(), t4_sge_modload(), and t4_sge_sysctls().

◆ defrags

counter_u64_t defrags
static

Definition at line 212 of file t4_sge.c.

Referenced by parse_pkt(), t4_sge_modload(), and t4_sge_modunload().

◆ extfree_refs

counter_u64_t extfree_refs
static

◆ extfree_rels

counter_u64_t extfree_rels
static

◆ fl_pack

int fl_pack = -1
static

Definition at line 148 of file t4_sge.c.

Referenced by setup_pad_and_pack_boundaries().

◆ fl_pad

int fl_pad = -1

◆ fl_pktshift

int fl_pktshift = 0
static

Definition at line 99 of file t4_sge.c.

Referenced by t4_sge_modload(), and t4_tweak_chip_settings().

◆ fw4_ack_handlers

cpl_handler_t fw4_ack_handlers[NUM_CPL_COOKIES]

Definition at line 354 of file t4_sge.c.

Referenced by fw4_ack_handler(), and t4_register_shared_cpl_handler().

◆ l2t_write_rpl_handlers

cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]

Definition at line 351 of file t4_sge.c.

Referenced by l2t_write_rpl_handler(), and t4_register_shared_cpl_handler().

◆ largest_rx_cluster

int largest_rx_cluster = MJUM16BYTES
static

Definition at line 155 of file t4_sge.c.

Referenced by bufidx_used(), find_refill_source(), and t4_sge_modload().

◆ lro_entries

int lro_entries = TCP_LRO_ENTRIES
static

Definition at line 197 of file t4_sge.c.

Referenced by alloc_rxq().

◆ lro_mbufs

int lro_mbufs = 0
static

Definition at line 204 of file t4_sge.c.

Referenced by alloc_rxq().

◆ pullups

counter_u64_t pullups
static

Definition at line 208 of file t4_sge.c.

Referenced by parse_pkt(), t4_sge_modload(), and t4_sge_modunload().

◆ safest_rx_cluster

int safest_rx_cluster = PAGE_SIZE
static

Definition at line 163 of file t4_sge.c.

Referenced by t4_init_rx_buf_info(), and t4_sge_modload().

◆ set_tcb_rpl_handlers

cpl_handler_t set_tcb_rpl_handlers[NUM_CPL_COOKIES]

Definition at line 350 of file t4_sge.c.

Referenced by set_tcb_rpl_handler(), and t4_register_shared_cpl_handler().

◆ spg_len

int spg_len = -1
static

Definition at line 118 of file t4_sge.c.

Referenced by t4_sge_modload(), and t4_tweak_chip_settings().

◆ t4_an_handler

an_handler_t t4_an_handler

Definition at line 347 of file t4_sge.c.

Referenced by service_iq(), service_iq_fl(), and t4_register_an_handler().

◆ t4_cpl_handler

◆ t4_fw_msg_handler

fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]

Definition at line 348 of file t4_sge.c.

Referenced by handle_fw_msg(), and t4_register_fw_msg_handler().

◆ t4_tx_coalesce

int t4_tx_coalesce = 1
static

Definition at line 216 of file t4_sge.c.

Referenced by eth_tx().

◆ t4_tx_coalesce_gap

int t4_tx_coalesce_gap = 5
static

Definition at line 229 of file t4_sge.c.

Referenced by record_eth_tx_time().

◆ t4_tx_coalesce_pkts

int t4_tx_coalesce_pkts = 32
static

Definition at line 225 of file t4_sge.c.

Referenced by eth_tx().

◆ tscale

int tscale = 1
static

Definition at line 190 of file t4_sge.c.

Referenced by t4_init_sge_params(), t4_sge_modload(), and t4_tweak_chip_settings().

◆ txerr_interval

const struct timeval txerr_interval = {3, 0}
static

Definition at line 2674 of file t4_sge.c.

Referenced by parse_pkt().

◆ txerr_ratecheck

struct timeval txerr_ratecheck = {0}
static

Definition at line 2673 of file t4_sge.c.

Referenced by parse_pkt().