Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_lib.h
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | |||||
#define ICE_MAX_DMA_SEG_SIZE ((16*1024) - 1) | #define ICE_MAX_DMA_SEG_SIZE ((16*1024) - 1) | ||||
#define ICE_MAX_RX_SEGS 5 | #define ICE_MAX_RX_SEGS 5 | ||||
#define ICE_MAX_TSO_HDR_SEGS 3 | #define ICE_MAX_TSO_HDR_SEGS 3 | ||||
#define ICE_MSIX_BAR 3 | #define ICE_MSIX_BAR 3 | ||||
#define ICE_MAX_DCB_TCS 8 | |||||
#define ICE_DEFAULT_DESC_COUNT 1024 | #define ICE_DEFAULT_DESC_COUNT 1024 | ||||
#define ICE_MAX_DESC_COUNT 8160 | #define ICE_MAX_DESC_COUNT 8160 | ||||
#define ICE_MIN_DESC_COUNT 64 | #define ICE_MIN_DESC_COUNT 64 | ||||
#define ICE_DESC_COUNT_INCR 32 | #define ICE_DESC_COUNT_INCR 32 | ||||
/* List of hardware offloads we support */ | /* List of hardware offloads we support */ | ||||
#define ICE_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_TCP | CSUM_IP_UDP | CSUM_IP_SCTP | \ | #define ICE_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_TCP | CSUM_IP_UDP | CSUM_IP_SCTP | \ | ||||
CSUM_IP6_TCP| CSUM_IP6_UDP | CSUM_IP6_SCTP | \ | CSUM_IP6_TCP| CSUM_IP6_UDP | CSUM_IP6_SCTP | \ | ||||
Show All 32 Lines | |||||
* @brief Private ioctl command number for NVM access ioctls | * @brief Private ioctl command number for NVM access ioctls | ||||
* | * | ||||
* The ioctl command number used by NVM update for accessing the driver for | * The ioctl command number used by NVM update for accessing the driver for | ||||
* NVM access commands. | * NVM access commands. | ||||
*/ | */ | ||||
#define ICE_NVM_ACCESS \ | #define ICE_NVM_ACCESS \ | ||||
(((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) | (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) | ||||
#define ICE_AQ_LEN 512 | #define ICE_AQ_LEN 1023 | ||||
erj: FW logging can generate a lot of messages in a short span of time, so this value was increased… | |||||
#define ICE_MBXQ_LEN 512 | #define ICE_MBXQ_LEN 512 | ||||
#define ICE_SBQ_LEN 512 | #define ICE_SBQ_LEN 512 | ||||
#define ICE_CTRLQ_WORK_LIMIT 256 | #define ICE_CTRLQ_WORK_LIMIT 256 | ||||
#define ICE_DFLT_TRAFFIC_CLASS BIT(0) | #define ICE_DFLT_TRAFFIC_CLASS BIT(0) | ||||
/* wait up to 50 microseconds for queue state change */ | /* wait up to 50 microseconds for queue state change */ | ||||
Show All 31 Lines | |||||
* Alternative solutions require changing the TCP stack to disable offloading | * Alternative solutions require changing the TCP stack to disable offloading | ||||
* the segmentation when the requested segment size goes below 64 bytes. | * the segmentation when the requested segment size goes below 64 bytes. | ||||
*/ | */ | ||||
#define ICE_MIN_MTU 112 | #define ICE_MIN_MTU 112 | ||||
#define ICE_DEFAULT_VF_QUEUES 4 | #define ICE_DEFAULT_VF_QUEUES 4 | ||||
/* | /* | ||||
* The maximum number of RX queues allowed per TC in a VSI. | |||||
*/ | |||||
#define ICE_MAX_RXQS_PER_TC 256 | |||||
/* | |||||
* There are three settings that can be updated independently or | * There are three settings that can be updated independently or | ||||
* altogether: Link speed, FEC, and Flow Control. These macros allow | * altogether: Link speed, FEC, and Flow Control. These macros allow | ||||
* the caller to specify which setting(s) to update. | * the caller to specify which setting(s) to update. | ||||
*/ | */ | ||||
#define ICE_APPLY_LS BIT(0) | #define ICE_APPLY_LS BIT(0) | ||||
#define ICE_APPLY_FEC BIT(1) | #define ICE_APPLY_FEC BIT(1) | ||||
#define ICE_APPLY_FC BIT(2) | #define ICE_APPLY_FC BIT(2) | ||||
#define ICE_APPLY_LS_FEC (ICE_APPLY_LS | ICE_APPLY_FEC) | #define ICE_APPLY_LS_FEC (ICE_APPLY_LS | ICE_APPLY_FEC) | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | struct ice_pf_sw_stats { | ||||
u32 pfr_count; | u32 pfr_count; | ||||
/* # of detected MDD events for Tx and Rx */ | /* # of detected MDD events for Tx and Rx */ | ||||
u32 tx_mdd_count; | u32 tx_mdd_count; | ||||
u32 rx_mdd_count; | u32 rx_mdd_count; | ||||
}; | }; | ||||
/** | /** | ||||
* @struct ice_tc_info | |||||
* @brief Traffic class information for a VSI | |||||
* | |||||
* Stores traffic class information used in configuring | |||||
* a VSI. | |||||
*/ | |||||
struct ice_tc_info { | |||||
u16 qoffset; /* Offset in VSI queue space */ | |||||
u16 qcount_tx; /* TX queues for this Traffic Class */ | |||||
u16 qcount_rx; /* RX queues */ | |||||
}; | |||||
/** | |||||
* @struct ice_vsi | * @struct ice_vsi | ||||
* @brief VSI structure | * @brief VSI structure | ||||
* | * | ||||
* Contains data relevant to a single VSI | * Contains data relevant to a single VSI | ||||
*/ | */ | ||||
struct ice_vsi { | struct ice_vsi { | ||||
/* back pointer to the softc */ | /* back pointer to the softc */ | ||||
struct ice_softc *sc; | struct ice_softc *sc; | ||||
Show All 24 Lines | struct ice_vsi { | ||||
u16 rss_table_size; /* HW RSS table size */ | u16 rss_table_size; /* HW RSS table size */ | ||||
u8 rss_lut_type; /* Used to configure Get/Set RSS LUT AQ call */ | u8 rss_lut_type; /* Used to configure Get/Set RSS LUT AQ call */ | ||||
int max_frame_size; | int max_frame_size; | ||||
u16 mbuf_sz; | u16 mbuf_sz; | ||||
struct ice_aqc_vsi_props info; | struct ice_aqc_vsi_props info; | ||||
/* DCB configuration */ | |||||
u8 num_tcs; /* Total number of enabled TCs */ | |||||
u16 tc_map; /* bitmap of enabled Traffic Classes */ | |||||
/* Information for each traffic class */ | |||||
struct ice_tc_info tc_info[ICE_MAX_TRAFFIC_CLASS]; | |||||
/* context for per-VSI sysctls */ | /* context for per-VSI sysctls */ | ||||
struct sysctl_ctx_list ctx; | struct sysctl_ctx_list ctx; | ||||
struct sysctl_oid *vsi_node; | struct sysctl_oid *vsi_node; | ||||
/* context for per-txq sysctls */ | /* context for per-txq sysctls */ | ||||
struct sysctl_ctx_list txqs_ctx; | struct sysctl_ctx_list txqs_ctx; | ||||
struct sysctl_oid *txqs_node; | struct sysctl_oid *txqs_node; | ||||
Show All 21 Lines | enum ice_state { | ||||
ICE_STATE_RESET_PFR_REQ, | ICE_STATE_RESET_PFR_REQ, | ||||
ICE_STATE_PREPARED_FOR_RESET, | ICE_STATE_PREPARED_FOR_RESET, | ||||
ICE_STATE_RESET_FAILED, | ICE_STATE_RESET_FAILED, | ||||
ICE_STATE_DRIVER_INITIALIZED, | ICE_STATE_DRIVER_INITIALIZED, | ||||
ICE_STATE_NO_MEDIA, | ICE_STATE_NO_MEDIA, | ||||
ICE_STATE_RECOVERY_MODE, | ICE_STATE_RECOVERY_MODE, | ||||
ICE_STATE_ROLLBACK_MODE, | ICE_STATE_ROLLBACK_MODE, | ||||
ICE_STATE_LINK_STATUS_REPORTED, | ICE_STATE_LINK_STATUS_REPORTED, | ||||
ICE_STATE_ATTACHING, | |||||
ICE_STATE_DETACHING, | ICE_STATE_DETACHING, | ||||
ICE_STATE_LINK_DEFAULT_OVERRIDE_PENDING, | ICE_STATE_LINK_DEFAULT_OVERRIDE_PENDING, | ||||
ICE_STATE_LLDP_RX_FLTR_FROM_DRIVER, | ICE_STATE_LLDP_RX_FLTR_FROM_DRIVER, | ||||
ICE_STATE_MULTIPLE_TCS, | |||||
Done Inline ActionsThis state is used to track when multiple traffic classes are in use by the hardware/driver erj: This state is used to track when multiple traffic classes are in use by the hardware/driver | |||||
/* This entry must be last */ | /* This entry must be last */ | ||||
ICE_STATE_LAST, | ICE_STATE_LAST, | ||||
}; | }; | ||||
/* Functions for setting and checking driver state. Note the functions take | /* Functions for setting and checking driver state. Note the functions take | ||||
* bit positions, not bitmasks. The atomic_testandset_32 and | * bit positions, not bitmasks. The atomic_testandset_32 and | ||||
* atomic_testandclear_32 operations require bit positions, while the | * atomic_testandclear_32 operations require bit positions, while the | ||||
* atomic_set_32 and atomic_clear_32 require bitmasks. This can easily lead to | * atomic_set_32 and atomic_clear_32 require bitmasks. This can easily lead to | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
struct ice_str_buf { | struct ice_str_buf { | ||||
char str[ICE_STR_BUF_LEN]; | char str[ICE_STR_BUF_LEN]; | ||||
}; | }; | ||||
struct ice_str_buf _ice_aq_str(enum ice_aq_err aq_err); | struct ice_str_buf _ice_aq_str(enum ice_aq_err aq_err); | ||||
struct ice_str_buf _ice_status_str(enum ice_status status); | struct ice_str_buf _ice_status_str(enum ice_status status); | ||||
struct ice_str_buf _ice_err_str(int err); | struct ice_str_buf _ice_err_str(int err); | ||||
struct ice_str_buf _ice_fltr_flag_str(u16 flag); | struct ice_str_buf _ice_fltr_flag_str(u16 flag); | ||||
struct ice_str_buf _ice_log_sev_str(u8 log_level); | |||||
struct ice_str_buf _ice_mdd_tx_tclan_str(u8 event); | struct ice_str_buf _ice_mdd_tx_tclan_str(u8 event); | ||||
struct ice_str_buf _ice_mdd_tx_pqm_str(u8 event); | struct ice_str_buf _ice_mdd_tx_pqm_str(u8 event); | ||||
struct ice_str_buf _ice_mdd_rx_str(u8 event); | struct ice_str_buf _ice_mdd_rx_str(u8 event); | ||||
struct ice_str_buf _ice_fw_lldp_status(u32 lldp_status); | struct ice_str_buf _ice_fw_lldp_status(u32 lldp_status); | ||||
#define ice_aq_str(err) _ice_aq_str(err).str | #define ice_aq_str(err) _ice_aq_str(err).str | ||||
#define ice_status_str(err) _ice_status_str(err).str | #define ice_status_str(err) _ice_status_str(err).str | ||||
#define ice_err_str(err) _ice_err_str(err).str | #define ice_err_str(err) _ice_err_str(err).str | ||||
#define ice_fltr_flag_str(flag) _ice_fltr_flag_str(flag).str | #define ice_fltr_flag_str(flag) _ice_fltr_flag_str(flag).str | ||||
#define ice_mdd_tx_tclan_str(event) _ice_mdd_tx_tclan_str(event).str | #define ice_mdd_tx_tclan_str(event) _ice_mdd_tx_tclan_str(event).str | ||||
#define ice_mdd_tx_pqm_str(event) _ice_mdd_tx_pqm_str(event).str | #define ice_mdd_tx_pqm_str(event) _ice_mdd_tx_pqm_str(event).str | ||||
#define ice_mdd_rx_str(event) _ice_mdd_rx_str(event).str | #define ice_mdd_rx_str(event) _ice_mdd_rx_str(event).str | ||||
#define ice_log_sev_str(log_level) _ice_log_sev_str(log_level).str | |||||
#define ice_fw_lldp_status(lldp_status) _ice_fw_lldp_status(lldp_status).str | #define ice_fw_lldp_status(lldp_status) _ice_fw_lldp_status(lldp_status).str | ||||
/** | /** | ||||
* ice_enable_intr - Enable interrupts for given vector | * ice_enable_intr - Enable interrupts for given vector | ||||
* @hw: the device private HW structure | * @hw: the device private HW structure | ||||
* @vector: the interrupt index in PF space | * @vector: the interrupt index in PF space | ||||
* | * | ||||
* In MSI or Legacy interrupt mode, interrupt 0 is the only valid index. | * In MSI or Legacy interrupt mode, interrupt 0 is the only valid index. | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* Details of how to re-initialize depend on the networking stack */ | /* Details of how to re-initialize depend on the networking stack */ | ||||
void ice_request_stack_reinit(struct ice_softc *sc); | void ice_request_stack_reinit(struct ice_softc *sc); | ||||
/* Details of how to check if the network stack is detaching us */ | /* Details of how to check if the network stack is detaching us */ | ||||
bool ice_driver_is_detaching(struct ice_softc *sc); | bool ice_driver_is_detaching(struct ice_softc *sc); | ||||
const char * ice_fw_module_str(enum ice_aqc_fw_logging_mod module); | |||||
void ice_add_fw_logging_tunables(struct ice_softc *sc, | |||||
struct sysctl_oid *parent); | |||||
void ice_handle_fw_log_event(struct ice_softc *sc, struct ice_aq_desc *desc, | |||||
void *buf); | |||||
int ice_process_ctrlq(struct ice_softc *sc, enum ice_ctl_q q_type, u16 *pending); | int ice_process_ctrlq(struct ice_softc *sc, enum ice_ctl_q q_type, u16 *pending); | ||||
int ice_map_bar(device_t dev, struct ice_bar_info *bar, int bar_num); | int ice_map_bar(device_t dev, struct ice_bar_info *bar, int bar_num); | ||||
void ice_free_bar(device_t dev, struct ice_bar_info *bar); | void ice_free_bar(device_t dev, struct ice_bar_info *bar); | ||||
void ice_set_ctrlq_len(struct ice_hw *hw); | void ice_set_ctrlq_len(struct ice_hw *hw); | ||||
void ice_release_vsi(struct ice_vsi *vsi); | void ice_release_vsi(struct ice_vsi *vsi); | ||||
struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type); | struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type); | ||||
int ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, | int ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, | ||||
const int max_rx_queues); | const int max_rx_queues); | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
int ice_module_event_handler(module_t mod, int what, void *arg); | int ice_module_event_handler(module_t mod, int what, void *arg); | ||||
int ice_handle_nvm_access_ioctl(struct ice_softc *sc, struct ifdrv *ifd); | int ice_handle_nvm_access_ioctl(struct ice_softc *sc, struct ifdrv *ifd); | ||||
int ice_handle_i2c_req(struct ice_softc *sc, struct ifi2creq *req); | int ice_handle_i2c_req(struct ice_softc *sc, struct ifi2creq *req); | ||||
int ice_read_sff_eeprom(struct ice_softc *sc, u16 dev_addr, u16 offset, u8* data, u16 length); | int ice_read_sff_eeprom(struct ice_softc *sc, u16 dev_addr, u16 offset, u8* data, u16 length); | ||||
int ice_alloc_intr_tracking(struct ice_softc *sc); | int ice_alloc_intr_tracking(struct ice_softc *sc); | ||||
void ice_free_intr_tracking(struct ice_softc *sc); | void ice_free_intr_tracking(struct ice_softc *sc); | ||||
void ice_set_default_local_lldp_mib(struct ice_softc *sc); | void ice_set_default_local_lldp_mib(struct ice_softc *sc); | ||||
void ice_init_health_events(struct ice_softc *sc); | void ice_init_health_events(struct ice_softc *sc); | ||||
void ice_cfg_pba_num(struct ice_softc *sc); | |||||
#endif /* _ICE_LIB_H_ */ | #endif /* _ICE_LIB_H_ */ |
FW logging can generate a lot of messages in a short span of time, so this value was increased to the maximum possible one.