Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/adapter.h
Show All 29 Lines | |||||
* | * | ||||
*/ | */ | ||||
#ifndef __T4_ADAPTER_H__ | #ifndef __T4_ADAPTER_H__ | ||||
#define __T4_ADAPTER_H__ | #define __T4_ADAPTER_H__ | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/counter.h> | |||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sx.h> | #include <sys/sx.h> | ||||
#include <sys/vmem.h> | #include <sys/vmem.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | enum { | ||||
FULL_INIT_DONE = (1 << 0), | FULL_INIT_DONE = (1 << 0), | ||||
FW_OK = (1 << 1), | FW_OK = (1 << 1), | ||||
CHK_MBOX_ACCESS = (1 << 2), | CHK_MBOX_ACCESS = (1 << 2), | ||||
MASTER_PF = (1 << 3), | MASTER_PF = (1 << 3), | ||||
ADAP_SYSCTL_CTX = (1 << 4), | ADAP_SYSCTL_CTX = (1 << 4), | ||||
ADAP_ERR = (1 << 5), | ADAP_ERR = (1 << 5), | ||||
BUF_PACKING_OK = (1 << 6), | BUF_PACKING_OK = (1 << 6), | ||||
IS_VF = (1 << 7), | IS_VF = (1 << 7), | ||||
KERN_TLS_OK = (1 << 8), | |||||
CXGBE_BUSY = (1 << 9), | CXGBE_BUSY = (1 << 9), | ||||
/* port flags */ | /* port flags */ | ||||
HAS_TRACEQ = (1 << 3), | HAS_TRACEQ = (1 << 3), | ||||
FIXED_IFMEDIA = (1 << 4), /* ifmedia list doesn't change. */ | FIXED_IFMEDIA = (1 << 4), /* ifmedia list doesn't change. */ | ||||
/* VI flags */ | /* VI flags */ | ||||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | |||||
enum { | enum { | ||||
CPL_COOKIE_RESERVED = 0, | CPL_COOKIE_RESERVED = 0, | ||||
CPL_COOKIE_FILTER, | CPL_COOKIE_FILTER, | ||||
CPL_COOKIE_DDP0, | CPL_COOKIE_DDP0, | ||||
CPL_COOKIE_DDP1, | CPL_COOKIE_DDP1, | ||||
CPL_COOKIE_TOM, | CPL_COOKIE_TOM, | ||||
CPL_COOKIE_HASHFILTER, | CPL_COOKIE_HASHFILTER, | ||||
CPL_COOKIE_ETHOFLD, | CPL_COOKIE_ETHOFLD, | ||||
CPL_COOKIE_AVAILABLE3, | CPL_COOKIE_KERN_TLS, | ||||
NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ | NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ | ||||
}; | }; | ||||
struct sge_iq; | struct sge_iq; | ||||
struct rss_header; | struct rss_header; | ||||
typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, | typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, | ||||
struct mbuf *); | struct mbuf *); | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | struct sge_txq { | ||||
uint64_t imm_wrs; /* # of work requests with immediate data */ | uint64_t imm_wrs; /* # of work requests with immediate data */ | ||||
uint64_t sgl_wrs; /* # of work requests with direct SGL */ | uint64_t sgl_wrs; /* # of work requests with direct SGL */ | ||||
uint64_t txpkt_wrs; /* # of txpkt work requests (not coalesced) */ | uint64_t txpkt_wrs; /* # of txpkt work requests (not coalesced) */ | ||||
uint64_t txpkts0_wrs; /* # of type0 coalesced tx work requests */ | uint64_t txpkts0_wrs; /* # of type0 coalesced tx work requests */ | ||||
uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ | uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ | ||||
uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ | uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ | ||||
uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ | uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ | ||||
uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ | uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ | ||||
uint64_t tls_wrs; /* # of TLS work requests */ | |||||
uint64_t kern_tls_records; | |||||
uint64_t kern_tls_short; | |||||
uint64_t kern_tls_partial; | |||||
uint64_t kern_tls_full; | |||||
uint64_t kern_tls_octets; | |||||
uint64_t kern_tls_waste; | |||||
uint64_t kern_tls_options; | |||||
uint64_t kern_tls_header; | |||||
uint64_t kern_tls_fin; | |||||
uint64_t kern_tls_fin_short; | |||||
uint64_t kern_tls_cbc; | |||||
uint64_t kern_tls_gcm; | |||||
/* stats for not-that-common events */ | /* stats for not-that-common events */ | ||||
/* Optional scratch space for constructing work requests. */ | |||||
uint8_t ss[SGE_MAX_WR_LEN] __aligned(16); | |||||
} __aligned(CACHE_LINE_SIZE); | } __aligned(CACHE_LINE_SIZE); | ||||
/* rxq: SGE ingress queue + SGE free list + miscellaneous items */ | /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ | ||||
struct sge_rxq { | struct sge_rxq { | ||||
struct sge_iq iq; /* MUST be first */ | struct sge_iq iq; /* MUST be first */ | ||||
struct sge_fl fl; /* MUST follow iq */ | struct sge_fl fl; /* MUST follow iq */ | ||||
struct ifnet *ifp; /* the interface this rxq belongs to */ | struct ifnet *ifp; /* the interface this rxq belongs to */ | ||||
▲ Show 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | struct adapter { | ||||
void *iwarp_softc; /* (struct c4iw_dev *) */ | void *iwarp_softc; /* (struct c4iw_dev *) */ | ||||
struct iw_tunables iwt; | struct iw_tunables iwt; | ||||
void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ | void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ | ||||
void *ccr_softc; /* (struct ccr_softc *) */ | void *ccr_softc; /* (struct ccr_softc *) */ | ||||
struct l2t_data *l2t; /* L2 table */ | struct l2t_data *l2t; /* L2 table */ | ||||
struct smt_data *smt; /* Source MAC Table */ | struct smt_data *smt; /* Source MAC Table */ | ||||
struct tid_info tids; | struct tid_info tids; | ||||
vmem_t *key_map; | vmem_t *key_map; | ||||
struct tls_tunables tlst; | |||||
uint8_t doorbells; | uint8_t doorbells; | ||||
int offload_map; /* ports with IFCAP_TOE enabled */ | int offload_map; /* ports with IFCAP_TOE enabled */ | ||||
int active_ulds; /* ULDs activated on this adapter */ | int active_ulds; /* ULDs activated on this adapter */ | ||||
int flags; | int flags; | ||||
int debug_flags; | int debug_flags; | ||||
char ifp_lockname[16]; | char ifp_lockname[16]; | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | struct adapter { | ||||
struct mtx tc_lock; | struct mtx tc_lock; | ||||
struct task tc_task; | struct task tc_task; | ||||
const char *last_op; | const char *last_op; | ||||
const void *last_op_thr; | const void *last_op_thr; | ||||
int last_op_flags; | int last_op_flags; | ||||
int swintr; | int swintr; | ||||
struct callout ktls_tick; | |||||
}; | }; | ||||
#define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) | #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) | ||||
#define ADAPTER_UNLOCK(sc) mtx_unlock(&(sc)->sc_lock) | #define ADAPTER_UNLOCK(sc) mtx_unlock(&(sc)->sc_lock) | ||||
#define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) | #define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) | ||||
#define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) | #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) | ||||
#define ASSERT_SYNCHRONIZED_OP(sc) \ | #define ASSERT_SYNCHRONIZED_OP(sc) \ | ||||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | |||||
void t4_sysctls(struct adapter *); | void t4_sysctls(struct adapter *); | ||||
int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); | int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); | ||||
void doom_vi(struct adapter *, struct vi_info *); | void doom_vi(struct adapter *, struct vi_info *); | ||||
void end_synchronized_op(struct adapter *, int); | void end_synchronized_op(struct adapter *, int); | ||||
int update_mac_settings(struct ifnet *, int); | int update_mac_settings(struct ifnet *, int); | ||||
int adapter_full_init(struct adapter *); | int adapter_full_init(struct adapter *); | ||||
int adapter_full_uninit(struct adapter *); | int adapter_full_uninit(struct adapter *); | ||||
uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); | uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); | ||||
void cxgbe_snd_tag_init(struct cxgbe_snd_tag *, struct ifnet *, int); | |||||
int vi_full_init(struct vi_info *); | int vi_full_init(struct vi_info *); | ||||
int vi_full_uninit(struct vi_info *); | int vi_full_uninit(struct vi_info *); | ||||
void vi_sysctls(struct vi_info *); | void vi_sysctls(struct vi_info *); | ||||
void vi_tick(void *); | void vi_tick(void *); | ||||
int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); | int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); | ||||
int alloc_atid_tab(struct tid_info *, int); | |||||
void free_atid_tab(struct tid_info *); | |||||
int alloc_atid(struct adapter *, void *); | int alloc_atid(struct adapter *, void *); | ||||
void *lookup_atid(struct adapter *, int); | void *lookup_atid(struct adapter *, int); | ||||
void free_atid(struct adapter *, int); | void free_atid(struct adapter *, int); | ||||
void release_tid(struct adapter *, int, struct sge_wrq *); | void release_tid(struct adapter *, int, struct sge_wrq *); | ||||
int cxgbe_media_change(struct ifnet *); | int cxgbe_media_change(struct ifnet *); | ||||
void cxgbe_media_status(struct ifnet *, struct ifmediareq *); | void cxgbe_media_status(struct ifnet *, struct ifmediareq *); | ||||
bool t4_os_dump_cimla(struct adapter *, int, bool); | bool t4_os_dump_cimla(struct adapter *, int, bool); | ||||
void t4_os_dump_devlog(struct adapter *); | void t4_os_dump_devlog(struct adapter *); | ||||
#ifdef KERN_TLS | |||||
/* t4_kern_tls.c */ | |||||
int cxgbe_tls_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, | |||||
struct m_snd_tag **); | |||||
void cxgbe_tls_tag_free(struct m_snd_tag *); | |||||
void t6_ktls_modload(void); | |||||
void t6_ktls_modunload(void); | |||||
int t6_ktls_try(struct ifnet *, struct socket *, struct ktls_session *); | |||||
int t6_ktls_parse_pkt(struct mbuf *, int *, int *); | |||||
int t6_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int, u_int); | |||||
#endif | |||||
#ifdef DEV_NETMAP | #ifdef DEV_NETMAP | ||||
/* t4_netmap.c */ | /* t4_netmap.c */ | ||||
struct sge_nm_rxq; | struct sge_nm_rxq; | ||||
void cxgbe_nm_attach(struct vi_info *); | void cxgbe_nm_attach(struct vi_info *); | ||||
void cxgbe_nm_detach(struct vi_info *); | void cxgbe_nm_detach(struct vi_info *); | ||||
void service_nm_rxq(struct sge_nm_rxq *); | void service_nm_rxq(struct sge_nm_rxq *); | ||||
#endif | #endif | ||||
Show All 27 Lines | |||||
void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); | void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); | ||||
int tnl_cong(struct port_info *, int); | int tnl_cong(struct port_info *, int); | ||||
void t4_register_an_handler(an_handler_t); | void t4_register_an_handler(an_handler_t); | ||||
void t4_register_fw_msg_handler(int, fw_msg_handler_t); | void t4_register_fw_msg_handler(int, fw_msg_handler_t); | ||||
void t4_register_cpl_handler(int, cpl_handler_t); | void t4_register_cpl_handler(int, cpl_handler_t); | ||||
void t4_register_shared_cpl_handler(int, cpl_handler_t, int); | void t4_register_shared_cpl_handler(int, cpl_handler_t, int); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
int ethofld_transmit(struct ifnet *, struct mbuf *); | int ethofld_transmit(struct ifnet *, struct mbuf *); | ||||
void send_etid_flush_wr(struct cxgbe_snd_tag *); | void send_etid_flush_wr(struct cxgbe_rate_tag *); | ||||
#endif | #endif | ||||
/* t4_tracer.c */ | /* t4_tracer.c */ | ||||
struct t4_tracer; | struct t4_tracer; | ||||
void t4_tracer_modload(void); | void t4_tracer_modload(void); | ||||
void t4_tracer_modunload(void); | void t4_tracer_modunload(void); | ||||
void t4_tracer_port_detach(struct adapter *); | void t4_tracer_port_detach(struct adapter *); | ||||
int t4_get_tracer(struct adapter *, struct t4_tracer *); | int t4_get_tracer(struct adapter *, struct t4_tracer *); | ||||
Show All 9 Lines | |||||
void t4_update_tx_sched(struct adapter *); | void t4_update_tx_sched(struct adapter *); | ||||
int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); | int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); | ||||
void t4_release_cl_rl(struct adapter *, int, int); | void t4_release_cl_rl(struct adapter *, int, int); | ||||
int sysctl_tc(SYSCTL_HANDLER_ARGS); | int sysctl_tc(SYSCTL_HANDLER_ARGS); | ||||
int sysctl_tc_params(SYSCTL_HANDLER_ARGS); | int sysctl_tc_params(SYSCTL_HANDLER_ARGS); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
void t4_init_etid_table(struct adapter *); | void t4_init_etid_table(struct adapter *); | ||||
void t4_free_etid_table(struct adapter *); | void t4_free_etid_table(struct adapter *); | ||||
struct cxgbe_snd_tag *lookup_etid(struct adapter *, int); | struct cxgbe_rate_tag *lookup_etid(struct adapter *, int); | ||||
int cxgbe_snd_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, | int cxgbe_rate_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, | ||||
struct m_snd_tag **); | struct m_snd_tag **); | ||||
int cxgbe_snd_tag_modify(struct m_snd_tag *, union if_snd_tag_modify_params *); | int cxgbe_rate_tag_modify(struct m_snd_tag *, union if_snd_tag_modify_params *); | ||||
int cxgbe_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); | int cxgbe_rate_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); | ||||
void cxgbe_snd_tag_free(struct m_snd_tag *); | void cxgbe_rate_tag_free(struct m_snd_tag *); | ||||
void cxgbe_snd_tag_free_locked(struct cxgbe_snd_tag *); | void cxgbe_rate_tag_free_locked(struct cxgbe_rate_tag *); | ||||
void cxgbe_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); | void cxgbe_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); | ||||
#endif | #endif | ||||
/* t4_filter.c */ | /* t4_filter.c */ | ||||
int get_filter_mode(struct adapter *, uint32_t *); | int get_filter_mode(struct adapter *, uint32_t *); | ||||
int set_filter_mode(struct adapter *, uint32_t); | int set_filter_mode(struct adapter *, uint32_t); | ||||
int get_filter(struct adapter *, struct t4_filter *); | int get_filter(struct adapter *, struct t4_filter *); | ||||
int set_filter(struct adapter *, struct t4_filter *); | int set_filter(struct adapter *, struct t4_filter *); | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |