net/hinic: fix MTU consistency with firmware
[dpdk.git] / drivers / net / hinic / base / hinic_pmd_niccfg.h
index e8ce332..0d0a670 100644 (file)
@@ -116,15 +116,6 @@ enum hinic_link_mode {
 #define HINIC_DEFAULT_RX_MODE  (HINIC_RX_MODE_UC | HINIC_RX_MODE_MC |  \
                                HINIC_RX_MODE_BC)
 
-#define HINIC_MAX_MTU_SIZE             (9600)
-#define HINIC_MIN_MTU_SIZE             (256)
-
-/* MIN_MTU + ETH_HLEN + CRC (256+14+4) */
-#define HINIC_MIN_FRAME_SIZE           274
-
-/* MAX_MTU + ETH_HLEN + CRC + VLAN(9600+14+4+4) */
-#define HINIC_MAX_JUMBO_FRAME_SIZE     (9622)
-
 #define HINIC_PORT_DISABLE             0x0
 #define HINIC_PORT_ENABLE              0x3
 
@@ -471,6 +462,17 @@ struct hinic_rx_mode_config {
        u32     rx_mode;
 };
 
+#define HINIC_MGMT_VERSION_MAX_LEN     32
+#define HINIC_COMPILE_TIME_LEN         20
+#define HINIC_FW_VERSION_NAME          16
+
+struct hinic_version_info {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u8 ver[HINIC_FW_VERSION_NAME];
+       u8 time[HINIC_COMPILE_TIME_LEN];
+};
+
 /* rss */
 struct nic_rss_indirect_tbl {
        u32 group_index;
@@ -578,6 +580,13 @@ struct hinic_link_mode_cmd {
        u16     advertised;
 };
 
+struct hinic_set_xsfp_status {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u32 port_id;
+       u32 xsfp_tx_dis;        /* 0: tx enable; 1: tx disable */
+};
+
 struct hinic_clear_qp_resource {
        struct hinic_mgmt_msg_head mgmt_msg_head;
 
@@ -732,6 +741,86 @@ struct hinic_fdir_tcam_info {
        struct tag_pa_action filter_action;
 };
 
+#define TCAM_SET       0x1
+#define TCAM_CLEAR     0x2
+
+struct hinic_port_qfilter_info {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u16 func_id;
+       u8 normal_type_enable;
+       u8 filter_type_enable;
+       u8 filter_enable;
+       u8 filter_type;
+       u8 qid;
+       u8 fdir_flag;
+       u32 key;
+};
+
+struct hinic_port_tcam_info {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u16 func_id;
+       u8 tcam_enable;
+       u8 rsvd1;
+       u32 rsvd2;
+};
+
+#define HINIC_MAX_TCAM_RULES_NUM   (10240)
+#define HINIC_TCAM_BLOCK_ENABLE      1
+#define HINIC_TCAM_BLOCK_DISABLE     0
+
+struct tag_tcam_result {
+       u32 qid;
+       u32 rsvd;
+};
+
+#define TCAM_FLOW_KEY_SIZE   24
+
+struct tag_tcam_key_x_y {
+       u8 x[TCAM_FLOW_KEY_SIZE];
+       u8 y[TCAM_FLOW_KEY_SIZE];
+};
+
+struct tag_tcam_cfg_rule {
+       u32 index;
+       struct tag_tcam_result data;
+       struct tag_tcam_key_x_y key;
+};
+
+struct tag_fdir_add_rule_cmd {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+       struct tag_tcam_cfg_rule rule;
+};
+
+struct tag_fdir_del_rule_cmd {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u32 index_start;
+       u32 index_num;
+};
+
+struct hinic_cmd_flush_tcam_rules {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u16 func_id;
+       u16 rsvd;
+};
+
+struct hinic_cmd_ctrl_tcam_block {
+       struct hinic_mgmt_msg_head mgmt_msg_head;
+
+       u16 func_id;
+       u8  alloc_en; /* 0: free tcam block, 1: alloc tcam block */
+       /*
+        * 0: alloc 1k size tcam block,
+        * 1: alloc 128 size tcam block, others rsvd
+        */
+       u8  tcam_type;
+       u16 tcam_block_index;
+       u16 rsvd;
+};
+
 int hinic_set_mac(void *hwdev, u8 *mac_addr, u16 vlan_id, u16 func_id);
 
 int hinic_del_mac(void *hwdev, u8 *mac_addr, u16 vlan_id, u16 func_id);
@@ -761,6 +850,8 @@ int hinic_set_rx_vhd_mode(void *hwdev, u16 vhd_mode, u16 rx_buf_sz);
 
 int hinic_set_pause_config(void *hwdev, struct nic_pause_config nic_pause);
 
+int hinic_get_pause_info(void *hwdev, struct nic_pause_config *nic_pause);
+
 int hinic_reset_port_link_cfg(void *hwdev);
 
 int hinic_dcb_set_ets(void *hwdev, u8 *up_tc, u8 *pg_bw, u8 *pgid, u8 *up_bw,
@@ -800,6 +891,8 @@ int hinic_rss_template_free(void *hwdev, u8 tmpl_idx);
 
 int hinic_set_rx_mode(void *hwdev, u32 enable);
 
+int hinic_get_mgmt_version(void *hwdev, char *fw);
+
 int hinic_set_rx_csum_offload(void *hwdev, u32 en);
 
 int hinic_set_link_status_follow(void *hwdev,
@@ -836,4 +929,16 @@ int hinic_set_fdir_tcam(void *hwdev, u16 type_mask,
 
 int hinic_clear_fdir_tcam(void *hwdev, u16 type_mask);
 
+int hinic_add_tcam_rule(void *hwdev, struct tag_tcam_cfg_rule *tcam_rule);
+
+int hinic_del_tcam_rule(void *hwdev, u32 index);
+
+int hinic_alloc_tcam_block(void *hwdev, u8 block_type, u16 *index);
+
+int hinic_free_tcam_block(void *hwdev, u8 block_type, u16 *index);
+
+int hinic_flush_tcam_rule(void *hwdev);
+
+int hinic_set_fdir_tcam_rule_filter(void *hwdev, bool enable);
+
 #endif /* _HINIC_PMD_NICCFG_H_ */