#include <linux/types.h>
#include <linux/crc8.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include "qed_hsi.h"
#include "qed_hw.h"
#include "qed_init_ops.h"
#include "qed_iro_hsi.h"
#include "qed_reg_addr.h"
#define CDU_VALIDATION_DEFAULT_CFG …
static u16 con_region_offsets[3][NUM_OF_CONNECTION_TYPES] = …;
static u16 task_region_offsets[1][NUM_OF_CONNECTION_TYPES] = …;
#define QM_PQ_MEM_4KB(pq_size) …
#define QM_PQ_SIZE_256B(pq_size) …
#define QM_INVALID_PQ_ID …
#define QM_MAX_LINK_SPEED …
#define QM_BYPASS_EN …
#define QM_BYTE_CRD_EN …
#define QM_INITIAL_VOQ_BYTE_CRD …
#define QM_OTHER_PQS_PER_PF …
#define MAX_NUM_VOQS …
#define VOQS_BIT_MASK …
#define QM_PF_WFQ_INC_VAL(weight) …
#define QM_PF_WFQ_UPPER_BOUND …
#define QM_PF_WFQ_MAX_INC_VAL …
#define QM_PF_WFQ_CRD_E5_NUM_VOQS …
#define QM_VP_WFQ_INC_VAL(weight) …
#define QM_VP_WFQ_MIN_INC_VAL …
#define QM_VP_WFQ_MAX_INC_VAL …
#define QM_VP_WFQ_BYPASS_THRESH …
#define QM_VP_RL_CRD_TASK_COST …
#define QM_VP_WFQ_PQ_VOQ_SHIFT …
#define QM_VP_WFQ_PQ_PF_SHIFT …
#define QM_RL_PERIOD …
#define QM_RL_PERIOD_CLK_25M …
#define QM_RL_INC_VAL(rate) …
#define QM_PF_RL_UPPER_BOUND …
#define QM_PF_RL_MAX_INC_VAL …
#define QM_GLOBAL_RL_UPPER_BOUND(speed) …
#define QM_OPPOR_LINE_VOQ_DEF …
#define QM_OPPOR_FW_STOP_DEF …
#define QM_OPPOR_PQ_EMPTY_DEF …
#define PBF_CMDQ_PURE_LB_LINES …
#define PBF_CMDQ_LINES_RT_OFFSET(ext_voq) …
#define PBF_BTB_GUARANTEED_RT_OFFSET(ext_voq) …
#define QM_VOQ_LINE_CRD(pbf_cmd_lines) …
#define BTB_JUMBO_PKT_BLOCKS …
#define BTB_HEADROOM_BLOCKS …
#define BTB_PURE_LB_FACTOR …
#define BTB_PURE_LB_RATIO …
#define QM_STOP_PQ_MASK_WIDTH …
#define QM_STOP_CMD_ADDR …
#define QM_STOP_CMD_STRUCT_SIZE …
#define QM_STOP_CMD_PAUSE_MASK_OFFSET …
#define QM_STOP_CMD_PAUSE_MASK_SHIFT …
#define QM_STOP_CMD_PAUSE_MASK_MASK …
#define QM_STOP_CMD_GROUP_ID_OFFSET …
#define QM_STOP_CMD_GROUP_ID_SHIFT …
#define QM_STOP_CMD_GROUP_ID_MASK …
#define QM_STOP_CMD_PQ_TYPE_OFFSET …
#define QM_STOP_CMD_PQ_TYPE_SHIFT …
#define QM_STOP_CMD_PQ_TYPE_MASK …
#define QM_STOP_CMD_MAX_POLL_COUNT …
#define QM_STOP_CMD_POLL_PERIOD_US …
#define QM_CMD_STRUCT_SIZE(cmd) …
#define QM_CMD_SET_FIELD(var, cmd, field, value) …
#define QM_INIT_TX_PQ_MAP(p_hwfn, map, pq_id, vp_pq_id, rl_valid, \
rl_id, ext_voq, wrr) …
#define WRITE_PQ_INFO_TO_RAM …
#define PQ_INFO_ELEMENT(vp, pf, tc, port, rl_valid, rl) …
#define PQ_INFO_RAM_GRC_ADDRESS(pq_id) …
static const char * const s_protocol_types[] = …;
static const char *s_ramrod_cmd_ids[][28] = …;
static u8 qed_get_ext_voq(struct qed_hwfn *p_hwfn,
u8 port_id, u8 tc, u8 max_phys_tcs_per_port)
{ … }
static void qed_enable_pf_rl(struct qed_hwfn *p_hwfn, bool pf_rl_en)
{ … }
static void qed_enable_pf_wfq(struct qed_hwfn *p_hwfn, bool pf_wfq_en)
{ … }
static void qed_enable_global_rl(struct qed_hwfn *p_hwfn, bool global_rl_en)
{ … }
static void qed_enable_vport_wfq(struct qed_hwfn *p_hwfn, bool vport_wfq_en)
{ … }
static void qed_cmdq_lines_voq_rt_init(struct qed_hwfn *p_hwfn,
u8 ext_voq, u16 cmdq_lines)
{ … }
static void
qed_cmdq_lines_rt_init(struct qed_hwfn *p_hwfn,
u8 max_ports_per_engine,
u8 max_phys_tcs_per_port,
struct init_qm_port_params port_params[MAX_NUM_PORTS])
{ … }
static void
qed_btb_blocks_rt_init(struct qed_hwfn *p_hwfn,
u8 max_ports_per_engine,
u8 max_phys_tcs_per_port,
struct init_qm_port_params port_params[MAX_NUM_PORTS])
{ … }
static int qed_global_rl_rt_init(struct qed_hwfn *p_hwfn)
{ … }
static u32 qed_get_vport_rl_upper_bound(enum init_qm_rl_type vport_rl_type,
u32 link_speed)
{ … }
static int qed_vport_rl_rt_init(struct qed_hwfn *p_hwfn,
u16 start_rl,
u16 num_rls,
u32 link_speed,
struct init_qm_rl_params *rl_params)
{ … }
static int qed_tx_pq_map_rt_init(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_qm_pf_rt_init_params *p_params,
u32 base_mem_addr_4kb)
{ … }
static void qed_other_pq_map_rt_init(struct qed_hwfn *p_hwfn,
u8 pf_id,
bool is_pf_loading,
u32 num_pf_cids,
u32 num_tids, u32 base_mem_addr_4kb)
{ … }
static int qed_pf_wfq_rt_init(struct qed_hwfn *p_hwfn,
struct qed_qm_pf_rt_init_params *p_params)
{ … }
static int qed_pf_rl_rt_init(struct qed_hwfn *p_hwfn, u8 pf_id, u32 pf_rl)
{ … }
static int qed_vp_wfq_rt_init(struct qed_hwfn *p_hwfn,
u16 num_vports,
struct init_qm_vport_params *vport_params)
{ … }
static bool qed_poll_on_qm_cmd_ready(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
static bool qed_send_qm_cmd(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u32 cmd_addr, u32 cmd_data_lsb, u32 cmd_data_msb)
{ … }
u32 qed_qm_pf_mem_size(u32 num_pf_cids,
u32 num_vf_cids,
u32 num_tids, u16 num_pf_pqs, u16 num_vf_pqs)
{ … }
int qed_qm_common_rt_init(struct qed_hwfn *p_hwfn,
struct qed_qm_common_rt_init_params *p_params)
{ … }
int qed_qm_pf_rt_init(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_qm_pf_rt_init_params *p_params)
{ … }
int qed_init_pf_wfq(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u8 pf_id, u16 pf_wfq)
{ … }
int qed_init_pf_rl(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u8 pf_id, u32 pf_rl)
{ … }
int qed_init_vport_wfq(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u16 first_tx_pq_id[NUM_OF_TCS], u16 wfq)
{ … }
int qed_init_vport_tc_wfq(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
u16 first_tx_pq_id, u16 wfq)
{ … }
int qed_init_global_rl(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u16 rl_id, u32 rate_limit,
enum init_qm_rl_type vport_rl_type)
{ … }
bool qed_send_qm_stop_cmd(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
bool is_release_cmd,
bool is_tx_pq, u16 start_pq, u16 num_pqs)
{ … }
#define SET_TUNNEL_TYPE_ENABLE_BIT(var, offset, enable) …
#define PRS_ETH_TUNN_OUTPUT_FORMAT …
#define PRS_ETH_OUTPUT_FORMAT …
#define ARR_REG_WR(dev, ptt, addr, arr, arr_size) …
static int qed_dmae_to_grc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
__le32 *p_data, u32 addr, u32 len_in_dwords)
{ … }
void qed_set_vxlan_dest_port(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u16 dest_port)
{ … }
void qed_set_vxlan_enable(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool vxlan_enable)
{ … }
void qed_set_gre_enable(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
bool eth_gre_enable, bool ip_gre_enable)
{ … }
void qed_set_geneve_dest_port(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, u16 dest_port)
{ … }
void qed_set_geneve_enable(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
bool eth_geneve_enable, bool ip_geneve_enable)
{ … }
#define PRS_ETH_VXLAN_NO_L2_ENABLE_OFFSET …
#define PRS_ETH_VXLAN_NO_L2_OUTPUT_FORMAT …
void qed_set_vxlan_no_l2_enable(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool enable)
{ … }
#define T_ETH_PACKET_ACTION_GFT_EVENTID …
#define PARSER_ETH_CONN_GFT_ACTION_CM_HDR …
#define T_ETH_PACKET_MATCH_RFS_EVENTID …
#define PARSER_ETH_CONN_CM_HDR …
#define CAM_LINE_SIZE …
#define RAM_LINE_SIZE …
#define REG_SIZE …
void qed_gft_disable(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, u16 pf_id)
{ … }
void qed_gft_config(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u16 pf_id,
bool tcp,
bool udp,
bool ipv4, bool ipv6, enum gft_profile_type profile_type)
{ … }
DECLARE_CRC8_TABLE(cdu_crc8_table);
static u8 qed_calc_cdu_validation_byte(u8 conn_type, u8 region, u32 cid)
{ … }
void qed_calc_session_ctx_validation(void *p_ctx_mem,
u16 ctx_size, u8 ctx_type, u32 cid)
{ … }
void qed_calc_task_ctx_validation(void *p_ctx_mem,
u16 ctx_size, u8 ctx_type, u32 tid)
{ … }
void qed_memset_session_ctx(void *p_ctx_mem, u32 ctx_size, u8 ctx_type)
{ … }
void qed_memset_task_ctx(void *p_ctx_mem, u32 ctx_size, u8 ctx_type)
{ … }
void qed_enable_context_validation(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{ … }
const char *qed_get_protocol_type_str(u32 protocol_type)
{ … }
const char *qed_get_ramrod_cmd_id_str(u32 protocol_type, u32 ramrod_cmd_id)
{ … }
static u32 qed_get_rdma_assert_ram_addr(struct qed_hwfn *p_hwfn, u8 storm_id)
{ … }
void qed_set_rdma_error_level(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
u8 assert_level[NUM_STORMS])
{ … }
#define PHYS_ADDR_DWORDS …
#define OVERLAY_HDR_SIZE_DWORDS …
static u32 qed_get_overlay_addr_ram_addr(struct qed_hwfn *p_hwfn, u8 storm_id)
{ … }
struct phys_mem_desc *qed_fw_overlay_mem_alloc(struct qed_hwfn *p_hwfn,
const u32 * const
fw_overlay_in_buf,
u32 buf_size_in_bytes)
{ … }
void qed_fw_overlay_init_ram(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct phys_mem_desc *fw_overlay_mem)
{ … }
void qed_fw_overlay_mem_free(struct qed_hwfn *p_hwfn,
struct phys_mem_desc **fw_overlay_mem)
{ … }