net/ice/base: support DCB
Add module to support DCB related features. Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Reviewed-by: Qiming Yang <qiming.yang@intel.com> Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
This commit is contained in:
parent
2a1018c4c1
commit
1082f78654
@ -51,6 +51,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_nvm.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flex_pipe.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flow.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcb.c
|
||||
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_ethdev.c
|
||||
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx.c
|
||||
|
@ -100,6 +100,7 @@ struct ice_aqc_list_caps_elem {
|
||||
__le16 cap;
|
||||
#define ICE_AQC_CAPS_VALID_FUNCTIONS 0x0005
|
||||
#define ICE_AQC_CAPS_VSI 0x0017
|
||||
#define ICE_AQC_CAPS_DCB 0x0018
|
||||
#define ICE_AQC_CAPS_RSS 0x0040
|
||||
#define ICE_AQC_CAPS_RXQS 0x0041
|
||||
#define ICE_AQC_CAPS_TXQS 0x0042
|
||||
@ -894,6 +895,40 @@ struct ice_aqc_sw_rules_elem {
|
||||
#pragma pack()
|
||||
|
||||
|
||||
/* PFC Ignore (direct 0x0301)
|
||||
* The command and response use the same descriptor structure
|
||||
*/
|
||||
struct ice_aqc_pfc_ignore {
|
||||
u8 tc_bitmap;
|
||||
u8 cmd_flags; /* unused in response */
|
||||
#define ICE_AQC_PFC_IGNORE_SET BIT(7)
|
||||
#define ICE_AQC_PFC_IGNORE_CLEAR 0
|
||||
u8 reserved[14];
|
||||
};
|
||||
|
||||
/* Set PFC Mode (direct 0x0303)
|
||||
* Query PFC Mode (direct 0x0302)
|
||||
*/
|
||||
struct ice_aqc_set_query_pfc_mode {
|
||||
u8 pfc_mode;
|
||||
/* For Set Command response, reserved in all other cases */
|
||||
#define ICE_AQC_PFC_NOT_CONFIGURED 0
|
||||
/* For Query Command response, reserved in all other cases */
|
||||
#define ICE_AQC_DCB_DIS 0
|
||||
#define ICE_AQC_PFC_VLAN_BASED_PFC 1
|
||||
#define ICE_AQC_PFC_DSCP_BASED_PFC 2
|
||||
u8 rsvd[15];
|
||||
};
|
||||
|
||||
/* Set DCB Parameters (direct 0x0306) */
|
||||
struct ice_aqc_set_dcb_params {
|
||||
u8 cmd_flags; /* unused in response */
|
||||
#define ICE_AQC_LINK_UP_DCB_CFG BIT(0)
|
||||
u8 valid_flags; /* unused in response */
|
||||
#define ICE_AQC_LINK_UP_DCB_CFG_VALID BIT(0)
|
||||
u8 rsvd[14];
|
||||
};
|
||||
|
||||
|
||||
/* Get Default Topology (indirect 0x0400) */
|
||||
struct ice_aqc_get_topo {
|
||||
@ -1027,6 +1062,32 @@ struct ice_aqc_delete_elem {
|
||||
};
|
||||
|
||||
|
||||
/* Query Port ETS (indirect 0x040E)
|
||||
*
|
||||
* This indirect command is used to query port TC node configuration.
|
||||
*/
|
||||
struct ice_aqc_query_port_ets {
|
||||
__le32 port_teid;
|
||||
__le32 reserved;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
struct ice_aqc_port_ets_elem {
|
||||
u8 tc_valid_bits;
|
||||
u8 reserved[3];
|
||||
/* 3 bits for UP per TC 0-7, 4th byte reserved */
|
||||
__le32 up2tc;
|
||||
u8 tc_bw_share[8];
|
||||
__le32 port_eir_prof_id;
|
||||
__le32 port_cir_prof_id;
|
||||
/* 3 bits per Node priority to TC 0-7, 4th byte reserved */
|
||||
__le32 tc_node_prio;
|
||||
#define ICE_TC_NODE_PRIO_S 0x4
|
||||
u8 reserved1[4];
|
||||
__le32 tc_node_teid[8]; /* Used for response, reserved in command */
|
||||
};
|
||||
|
||||
|
||||
/* Rate limiting profile for
|
||||
* Add RL profile (indirect 0x0410)
|
||||
@ -1578,6 +1639,157 @@ struct ice_aqc_nvm_checksum {
|
||||
|
||||
|
||||
|
||||
/* Get LLDP MIB (indirect 0x0A00)
|
||||
* Note: This is also used by the LLDP MIB Change Event (0x0A01)
|
||||
* as the format is the same.
|
||||
*/
|
||||
struct ice_aqc_lldp_get_mib {
|
||||
u8 type;
|
||||
#define ICE_AQ_LLDP_MIB_TYPE_S 0
|
||||
#define ICE_AQ_LLDP_MIB_TYPE_M (0x3 << ICE_AQ_LLDP_MIB_TYPE_S)
|
||||
#define ICE_AQ_LLDP_MIB_LOCAL 0
|
||||
#define ICE_AQ_LLDP_MIB_REMOTE 1
|
||||
#define ICE_AQ_LLDP_MIB_LOCAL_AND_REMOTE 2
|
||||
#define ICE_AQ_LLDP_BRID_TYPE_S 2
|
||||
#define ICE_AQ_LLDP_BRID_TYPE_M (0x3 << ICE_AQ_LLDP_BRID_TYPE_S)
|
||||
#define ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID 0
|
||||
#define ICE_AQ_LLDP_BRID_TYPE_NON_TPMR 1
|
||||
/* Tx pause flags in the 0xA01 event use ICE_AQ_LLDP_TX_* */
|
||||
#define ICE_AQ_LLDP_TX_S 0x4
|
||||
#define ICE_AQ_LLDP_TX_M (0x03 << ICE_AQ_LLDP_TX_S)
|
||||
#define ICE_AQ_LLDP_TX_ACTIVE 0
|
||||
#define ICE_AQ_LLDP_TX_SUSPENDED 1
|
||||
#define ICE_AQ_LLDP_TX_FLUSHED 3
|
||||
/* The following bytes are reserved for the Get LLDP MIB command (0x0A00)
|
||||
* and in the LLDP MIB Change Event (0x0A01). They are valid for the
|
||||
* Get LLDP MIB (0x0A00) response only.
|
||||
*/
|
||||
u8 reserved1;
|
||||
__le16 local_len;
|
||||
__le16 remote_len;
|
||||
u8 reserved2[2];
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Configure LLDP MIB Change Event (direct 0x0A01) */
|
||||
/* For MIB Change Event use ice_aqc_lldp_get_mib structure above */
|
||||
struct ice_aqc_lldp_set_mib_change {
|
||||
u8 command;
|
||||
#define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0
|
||||
#define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1
|
||||
u8 reserved[15];
|
||||
};
|
||||
|
||||
/* Add LLDP TLV (indirect 0x0A02)
|
||||
* Delete LLDP TLV (indirect 0x0A04)
|
||||
*/
|
||||
struct ice_aqc_lldp_add_delete_tlv {
|
||||
u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
|
||||
u8 reserved1[1];
|
||||
__le16 len;
|
||||
u8 reserved2[4];
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Update LLDP TLV (indirect 0x0A03) */
|
||||
struct ice_aqc_lldp_update_tlv {
|
||||
u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */
|
||||
u8 reserved;
|
||||
__le16 old_len;
|
||||
__le16 new_offset;
|
||||
__le16 new_len;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Stop LLDP (direct 0x0A05) */
|
||||
struct ice_aqc_lldp_stop {
|
||||
u8 command;
|
||||
#define ICE_AQ_LLDP_AGENT_STATE_MASK BIT(0)
|
||||
#define ICE_AQ_LLDP_AGENT_STOP 0x0
|
||||
#define ICE_AQ_LLDP_AGENT_SHUTDOWN ICE_AQ_LLDP_AGENT_STATE_MASK
|
||||
#define ICE_AQ_LLDP_AGENT_PERSIST_DIS BIT(1)
|
||||
u8 reserved[15];
|
||||
};
|
||||
|
||||
/* Start LLDP (direct 0x0A06) */
|
||||
struct ice_aqc_lldp_start {
|
||||
u8 command;
|
||||
#define ICE_AQ_LLDP_AGENT_START BIT(0)
|
||||
#define ICE_AQ_LLDP_AGENT_PERSIST_ENA BIT(1)
|
||||
u8 reserved[15];
|
||||
};
|
||||
|
||||
/* Get CEE DCBX Oper Config (0x0A07)
|
||||
* The command uses the generic descriptor struct and
|
||||
* returns the struct below as an indirect response.
|
||||
*/
|
||||
struct ice_aqc_get_cee_dcb_cfg_resp {
|
||||
u8 oper_num_tc;
|
||||
u8 oper_prio_tc[4];
|
||||
u8 oper_tc_bw[8];
|
||||
u8 oper_pfc_en;
|
||||
__le16 oper_app_prio;
|
||||
#define ICE_AQC_CEE_APP_FCOE_S 0
|
||||
#define ICE_AQC_CEE_APP_FCOE_M (0x7 << ICE_AQC_CEE_APP_FCOE_S)
|
||||
#define ICE_AQC_CEE_APP_ISCSI_S 3
|
||||
#define ICE_AQC_CEE_APP_ISCSI_M (0x7 << ICE_AQC_CEE_APP_ISCSI_S)
|
||||
#define ICE_AQC_CEE_APP_FIP_S 8
|
||||
#define ICE_AQC_CEE_APP_FIP_M (0x7 << ICE_AQC_CEE_APP_FIP_S)
|
||||
__le32 tlv_status;
|
||||
#define ICE_AQC_CEE_PG_STATUS_S 0
|
||||
#define ICE_AQC_CEE_PG_STATUS_M (0x7 << ICE_AQC_CEE_PG_STATUS_S)
|
||||
#define ICE_AQC_CEE_PFC_STATUS_S 3
|
||||
#define ICE_AQC_CEE_PFC_STATUS_M (0x7 << ICE_AQC_CEE_PFC_STATUS_S)
|
||||
#define ICE_AQC_CEE_FCOE_STATUS_S 8
|
||||
#define ICE_AQC_CEE_FCOE_STATUS_M (0x7 << ICE_AQC_CEE_FCOE_STATUS_S)
|
||||
#define ICE_AQC_CEE_ISCSI_STATUS_S 11
|
||||
#define ICE_AQC_CEE_ISCSI_STATUS_M (0x7 << ICE_AQC_CEE_ISCSI_STATUS_S)
|
||||
#define ICE_AQC_CEE_FIP_STATUS_S 16
|
||||
#define ICE_AQC_CEE_FIP_STATUS_M (0x7 << ICE_AQC_CEE_FIP_STATUS_S)
|
||||
u8 reserved[12];
|
||||
};
|
||||
|
||||
/* Set Local LLDP MIB (indirect 0x0A08)
|
||||
* Used to replace the local MIB of a given LLDP agent. e.g. DCBx
|
||||
*/
|
||||
struct ice_aqc_lldp_set_local_mib {
|
||||
u8 type;
|
||||
#define SET_LOCAL_MIB_TYPE_DCBX_M BIT(0)
|
||||
#define SET_LOCAL_MIB_TYPE_LOCAL_MIB 0
|
||||
#define SET_LOCAL_MIB_TYPE_CEE_M BIT(1)
|
||||
#define SET_LOCAL_MIB_TYPE_CEE_WILLING 0
|
||||
#define SET_LOCAL_MIB_TYPE_CEE_NON_WILLING SET_LOCAL_MIB_TYPE_CEE_M
|
||||
u8 reserved0;
|
||||
__le16 length;
|
||||
u8 reserved1[4];
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
struct ice_aqc_lldp_set_local_mib_resp {
|
||||
u8 status;
|
||||
#define SET_LOCAL_MIB_RESP_EVENT_M BIT(0)
|
||||
#define SET_LOCAL_MIB_RESP_MIB_CHANGE_SILENT 0
|
||||
#define SET_LOCAL_MIB_RESP_MIB_CHANGE_EVENT SET_LOCAL_MIB_RESP_EVENT_M
|
||||
u8 reserved[15];
|
||||
};
|
||||
|
||||
/* Stop/Start LLDP Agent (direct 0x0A09)
|
||||
* Used for stopping/starting specific LLDP agent. e.g. DCBx.
|
||||
* The same structure is used for the response, with the command field
|
||||
* being used as the status field.
|
||||
*/
|
||||
struct ice_aqc_lldp_stop_start_specific_agent {
|
||||
u8 command;
|
||||
#define ICE_AQC_START_STOP_AGENT_M BIT(0)
|
||||
#define ICE_AQC_START_STOP_AGENT_STOP_DCBX 0
|
||||
#define ICE_AQC_START_STOP_AGENT_START_DCBX ICE_AQC_START_STOP_AGENT_M
|
||||
u8 reserved[15];
|
||||
};
|
||||
|
||||
|
||||
/* Get/Set RSS key (indirect 0x0B04/0x0B02) */
|
||||
struct ice_aqc_get_set_rss_key {
|
||||
@ -1980,10 +2192,22 @@ struct ice_aq_desc {
|
||||
struct ice_aqc_query_txsched_res query_sched_res;
|
||||
struct ice_aqc_query_node_to_root query_node_to_root;
|
||||
struct ice_aqc_cfg_l2_node_cgd cfg_l2_node_cgd;
|
||||
struct ice_aqc_query_port_ets port_ets;
|
||||
struct ice_aqc_rl_profile rl_profile;
|
||||
struct ice_aqc_nvm nvm;
|
||||
struct ice_aqc_nvm_cfg nvm_cfg;
|
||||
struct ice_aqc_nvm_checksum nvm_checksum;
|
||||
struct ice_aqc_pfc_ignore pfc_ignore;
|
||||
struct ice_aqc_set_query_pfc_mode set_query_pfc_mode;
|
||||
struct ice_aqc_set_dcb_params set_dcb_params;
|
||||
struct ice_aqc_lldp_get_mib lldp_get_mib;
|
||||
struct ice_aqc_lldp_set_mib_change lldp_set_event;
|
||||
struct ice_aqc_lldp_add_delete_tlv lldp_add_delete_tlv;
|
||||
struct ice_aqc_lldp_update_tlv lldp_update_tlv;
|
||||
struct ice_aqc_lldp_stop lldp_stop;
|
||||
struct ice_aqc_lldp_start lldp_start;
|
||||
struct ice_aqc_lldp_set_local_mib lldp_set_mib;
|
||||
struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;
|
||||
struct ice_aqc_get_set_rss_lut get_set_rss_lut;
|
||||
struct ice_aqc_get_set_rss_key get_set_rss_key;
|
||||
struct ice_aqc_add_txqs add_txqs;
|
||||
@ -2096,6 +2320,8 @@ enum ice_adminq_opc {
|
||||
/* PXE */
|
||||
ice_aqc_opc_clear_pxe_mode = 0x0110,
|
||||
|
||||
ice_aqc_opc_config_no_drop_policy = 0x0112,
|
||||
|
||||
/* internal switch commands */
|
||||
ice_aqc_opc_get_sw_cfg = 0x0200,
|
||||
|
||||
@ -2127,6 +2353,11 @@ enum ice_adminq_opc {
|
||||
ice_aqc_opc_get_sw_rules = 0x02A3,
|
||||
ice_aqc_opc_clear_pf_cfg = 0x02A4,
|
||||
|
||||
/* DCB commands */
|
||||
ice_aqc_opc_pfc_ignore = 0x0301,
|
||||
ice_aqc_opc_query_pfc_mode = 0x0302,
|
||||
ice_aqc_opc_set_pfc_mode = 0x0303,
|
||||
ice_aqc_opc_set_dcb_params = 0x0306,
|
||||
|
||||
/* transmit scheduler commands */
|
||||
ice_aqc_opc_get_dflt_topo = 0x0400,
|
||||
@ -2136,6 +2367,7 @@ enum ice_adminq_opc {
|
||||
ice_aqc_opc_move_sched_elems = 0x0408,
|
||||
ice_aqc_opc_suspend_sched_elems = 0x0409,
|
||||
ice_aqc_opc_resume_sched_elems = 0x040A,
|
||||
ice_aqc_opc_query_port_ets = 0x040E,
|
||||
ice_aqc_opc_delete_sched_elems = 0x040F,
|
||||
ice_aqc_opc_add_rl_profiles = 0x0410,
|
||||
ice_aqc_opc_query_rl_profiles = 0x0411,
|
||||
@ -2166,6 +2398,17 @@ enum ice_adminq_opc {
|
||||
ice_aqc_opc_nvm_cfg_write = 0x0705,
|
||||
ice_aqc_opc_nvm_checksum = 0x0706,
|
||||
|
||||
/* LLDP commands */
|
||||
ice_aqc_opc_lldp_get_mib = 0x0A00,
|
||||
ice_aqc_opc_lldp_set_mib_change = 0x0A01,
|
||||
ice_aqc_opc_lldp_add_tlv = 0x0A02,
|
||||
ice_aqc_opc_lldp_update_tlv = 0x0A03,
|
||||
ice_aqc_opc_lldp_delete_tlv = 0x0A04,
|
||||
ice_aqc_opc_lldp_stop = 0x0A05,
|
||||
ice_aqc_opc_lldp_start = 0x0A06,
|
||||
ice_aqc_opc_get_cee_dcb_cfg = 0x0A07,
|
||||
ice_aqc_opc_lldp_set_local_mib = 0x0A08,
|
||||
ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09,
|
||||
|
||||
/* RSS commands */
|
||||
ice_aqc_opc_set_rss_key = 0x0B02,
|
||||
|
@ -1930,6 +1930,18 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
|
||||
number);
|
||||
}
|
||||
break;
|
||||
case ICE_AQC_CAPS_DCB:
|
||||
caps->dcb = (number == 1);
|
||||
caps->active_tc_bitmap = logical_id;
|
||||
caps->maxtc = phys_id;
|
||||
ice_debug(hw, ICE_DBG_INIT,
|
||||
"HW caps: DCB = %d\n", caps->dcb);
|
||||
ice_debug(hw, ICE_DBG_INIT,
|
||||
"HW caps: Active TC bitmap = %d\n",
|
||||
caps->active_tc_bitmap);
|
||||
ice_debug(hw, ICE_DBG_INIT,
|
||||
"HW caps: TC Max = %d\n", caps->maxtc);
|
||||
break;
|
||||
case ICE_AQC_CAPS_RSS:
|
||||
caps->rss_table_size = number;
|
||||
caps->rss_table_entry_width = logical_id;
|
||||
|
1393
drivers/net/ice/base/ice_dcb.c
Normal file
1393
drivers/net/ice/base/ice_dcb.c
Normal file
File diff suppressed because it is too large
Load Diff
223
drivers/net/ice/base/ice_dcb.h
Normal file
223
drivers/net/ice/base/ice_dcb.h
Normal file
@ -0,0 +1,223 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2001-2019
|
||||
*/
|
||||
|
||||
#ifndef _ICE_DCB_H_
|
||||
#define _ICE_DCB_H_
|
||||
|
||||
#include "ice_type.h"
|
||||
|
||||
#define ICE_DCBX_OFFLOAD_DIS 0
|
||||
#define ICE_DCBX_OFFLOAD_ENABLED 1
|
||||
|
||||
#define ICE_DCBX_STATUS_NOT_STARTED 0
|
||||
#define ICE_DCBX_STATUS_IN_PROGRESS 1
|
||||
#define ICE_DCBX_STATUS_DONE 2
|
||||
#define ICE_DCBX_STATUS_MULTIPLE_PEERS 3
|
||||
#define ICE_DCBX_STATUS_DIS 7
|
||||
|
||||
#define ICE_TLV_TYPE_END 0
|
||||
#define ICE_TLV_TYPE_ORG 127
|
||||
|
||||
#define ICE_IEEE_8021QAZ_OUI 0x0080C2
|
||||
#define ICE_IEEE_SUBTYPE_ETS_CFG 9
|
||||
#define ICE_IEEE_SUBTYPE_ETS_REC 10
|
||||
#define ICE_IEEE_SUBTYPE_PFC_CFG 11
|
||||
#define ICE_IEEE_SUBTYPE_APP_PRI 12
|
||||
|
||||
#define ICE_CEE_DCBX_OUI 0x001B21
|
||||
#define ICE_CEE_DCBX_TYPE 2
|
||||
|
||||
#define ICE_CEE_SUBTYPE_CTRL 1
|
||||
#define ICE_CEE_SUBTYPE_PG_CFG 2
|
||||
#define ICE_CEE_SUBTYPE_PFC_CFG 3
|
||||
#define ICE_CEE_SUBTYPE_APP_PRI 4
|
||||
|
||||
#define ICE_CEE_MAX_FEAT_TYPE 3
|
||||
#define ICE_LLDP_ADMINSTATUS_DIS 0
|
||||
#define ICE_LLDP_ADMINSTATUS_ENA_RX 1
|
||||
#define ICE_LLDP_ADMINSTATUS_ENA_TX 2
|
||||
#define ICE_LLDP_ADMINSTATUS_ENA_RXTX 3
|
||||
|
||||
/* Defines for LLDP TLV header */
|
||||
#define ICE_LLDP_TLV_LEN_S 0
|
||||
#define ICE_LLDP_TLV_LEN_M (0x01FF << ICE_LLDP_TLV_LEN_S)
|
||||
#define ICE_LLDP_TLV_TYPE_S 9
|
||||
#define ICE_LLDP_TLV_TYPE_M (0x7F << ICE_LLDP_TLV_TYPE_S)
|
||||
#define ICE_LLDP_TLV_SUBTYPE_S 0
|
||||
#define ICE_LLDP_TLV_SUBTYPE_M (0xFF << ICE_LLDP_TLV_SUBTYPE_S)
|
||||
#define ICE_LLDP_TLV_OUI_S 8
|
||||
#define ICE_LLDP_TLV_OUI_M (0xFFFFFFUL << ICE_LLDP_TLV_OUI_S)
|
||||
|
||||
/* Defines for IEEE ETS TLV */
|
||||
#define ICE_IEEE_ETS_MAXTC_S 0
|
||||
#define ICE_IEEE_ETS_MAXTC_M (0x7 << ICE_IEEE_ETS_MAXTC_S)
|
||||
#define ICE_IEEE_ETS_CBS_S 6
|
||||
#define ICE_IEEE_ETS_CBS_M BIT(ICE_IEEE_ETS_CBS_S)
|
||||
#define ICE_IEEE_ETS_WILLING_S 7
|
||||
#define ICE_IEEE_ETS_WILLING_M BIT(ICE_IEEE_ETS_WILLING_S)
|
||||
#define ICE_IEEE_ETS_PRIO_0_S 0
|
||||
#define ICE_IEEE_ETS_PRIO_0_M (0x7 << ICE_IEEE_ETS_PRIO_0_S)
|
||||
#define ICE_IEEE_ETS_PRIO_1_S 4
|
||||
#define ICE_IEEE_ETS_PRIO_1_M (0x7 << ICE_IEEE_ETS_PRIO_1_S)
|
||||
#define ICE_CEE_PGID_PRIO_0_S 0
|
||||
#define ICE_CEE_PGID_PRIO_0_M (0xF << ICE_CEE_PGID_PRIO_0_S)
|
||||
#define ICE_CEE_PGID_PRIO_1_S 4
|
||||
#define ICE_CEE_PGID_PRIO_1_M (0xF << ICE_CEE_PGID_PRIO_1_S)
|
||||
#define ICE_CEE_PGID_STRICT 15
|
||||
|
||||
/* Defines for IEEE TSA types */
|
||||
#define ICE_IEEE_TSA_STRICT 0
|
||||
#define ICE_IEEE_TSA_CBS 1
|
||||
#define ICE_IEEE_TSA_ETS 2
|
||||
#define ICE_IEEE_TSA_VENDOR 255
|
||||
|
||||
/* Defines for IEEE PFC TLV */
|
||||
#define ICE_IEEE_PFC_CAP_S 0
|
||||
#define ICE_IEEE_PFC_CAP_M (0xF << ICE_IEEE_PFC_CAP_S)
|
||||
#define ICE_IEEE_PFC_MBC_S 6
|
||||
#define ICE_IEEE_PFC_MBC_M BIT(ICE_IEEE_PFC_MBC_S)
|
||||
#define ICE_IEEE_PFC_WILLING_S 7
|
||||
#define ICE_IEEE_PFC_WILLING_M BIT(ICE_IEEE_PFC_WILLING_S)
|
||||
|
||||
/* Defines for IEEE APP TLV */
|
||||
#define ICE_IEEE_APP_SEL_S 0
|
||||
#define ICE_IEEE_APP_SEL_M (0x7 << ICE_IEEE_APP_SEL_S)
|
||||
#define ICE_IEEE_APP_PRIO_S 5
|
||||
#define ICE_IEEE_APP_PRIO_M (0x7 << ICE_IEEE_APP_PRIO_S)
|
||||
|
||||
/* TLV definitions for preparing MIB */
|
||||
#define ICE_TLV_ID_CHASSIS_ID 0
|
||||
#define ICE_TLV_ID_PORT_ID 1
|
||||
#define ICE_TLV_ID_TIME_TO_LIVE 2
|
||||
#define ICE_IEEE_TLV_ID_ETS_CFG 3
|
||||
#define ICE_IEEE_TLV_ID_ETS_REC 4
|
||||
#define ICE_IEEE_TLV_ID_PFC_CFG 5
|
||||
#define ICE_IEEE_TLV_ID_APP_PRI 6
|
||||
#define ICE_TLV_ID_END_OF_LLDPPDU 7
|
||||
#define ICE_TLV_ID_START ICE_IEEE_TLV_ID_ETS_CFG
|
||||
|
||||
#define ICE_IEEE_ETS_TLV_LEN 25
|
||||
#define ICE_IEEE_PFC_TLV_LEN 6
|
||||
#define ICE_IEEE_APP_TLV_LEN 11
|
||||
|
||||
#pragma pack(1)
|
||||
/* IEEE 802.1AB LLDP TLV structure */
|
||||
struct ice_lldp_generic_tlv {
|
||||
__be16 typelen;
|
||||
u8 tlvinfo[1];
|
||||
};
|
||||
|
||||
/* IEEE 802.1AB LLDP Organization specific TLV */
|
||||
struct ice_lldp_org_tlv {
|
||||
__be16 typelen;
|
||||
__be32 ouisubtype;
|
||||
u8 tlvinfo[1];
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
struct ice_cee_tlv_hdr {
|
||||
__be16 typelen;
|
||||
u8 operver;
|
||||
u8 maxver;
|
||||
};
|
||||
|
||||
struct ice_cee_ctrl_tlv {
|
||||
struct ice_cee_tlv_hdr hdr;
|
||||
__be32 seqno;
|
||||
__be32 ackno;
|
||||
};
|
||||
|
||||
struct ice_cee_feat_tlv {
|
||||
struct ice_cee_tlv_hdr hdr;
|
||||
u8 en_will_err; /* Bits: |En|Will|Err|Reserved(5)| */
|
||||
#define ICE_CEE_FEAT_TLV_ENA_M 0x80
|
||||
#define ICE_CEE_FEAT_TLV_WILLING_M 0x40
|
||||
#define ICE_CEE_FEAT_TLV_ERR_M 0x20
|
||||
u8 subtype;
|
||||
u8 tlvinfo[1];
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
struct ice_cee_app_prio {
|
||||
__be16 protocol;
|
||||
u8 upper_oui_sel; /* Bits: |Upper OUI(6)|Selector(2)| */
|
||||
#define ICE_CEE_APP_SELECTOR_M 0x03
|
||||
__be16 lower_oui;
|
||||
u8 prio_map;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/* TODO: The below structures related LLDP/DCBX variables
|
||||
* and statistics are defined but need to find how to get
|
||||
* the required information from the Firmware to use them
|
||||
*/
|
||||
|
||||
/* IEEE 802.1AB LLDP Agent Statistics */
|
||||
struct ice_lldp_stats {
|
||||
u64 remtablelastchangetime;
|
||||
u64 remtableinserts;
|
||||
u64 remtabledeletes;
|
||||
u64 remtabledrops;
|
||||
u64 remtableageouts;
|
||||
u64 txframestotal;
|
||||
u64 rxframesdiscarded;
|
||||
u64 rxportframeerrors;
|
||||
u64 rxportframestotal;
|
||||
u64 rxporttlvsdiscardedtotal;
|
||||
u64 rxporttlvsunrecognizedtotal;
|
||||
u64 remtoomanyneighbors;
|
||||
};
|
||||
|
||||
/* IEEE 802.1Qaz DCBX variables */
|
||||
struct ice_dcbx_variables {
|
||||
u32 defmaxtrafficclasses;
|
||||
u32 defprioritytcmapping;
|
||||
u32 deftcbandwidth;
|
||||
u32 deftsaassignment;
|
||||
};
|
||||
|
||||
enum ice_status
|
||||
ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
|
||||
u16 buf_size, u16 *local_len, u16 *remote_len,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
|
||||
struct ice_aqc_get_cee_dcb_cfg_resp *buff,
|
||||
struct ice_sq_cd *cd);
|
||||
u8 ice_get_dcbx_status(struct ice_hw *hw);
|
||||
enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg);
|
||||
enum ice_status
|
||||
ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
|
||||
struct ice_dcbx_cfg *dcbcfg);
|
||||
enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi);
|
||||
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi);
|
||||
enum ice_status ice_init_dcb(struct ice_hw *hw);
|
||||
void ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg);
|
||||
enum ice_status
|
||||
ice_query_port_ets(struct ice_port_info *pi,
|
||||
struct ice_aqc_port_ets_elem *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cmd_details);
|
||||
enum ice_status
|
||||
ice_aq_query_port_ets(struct ice_port_info *pi,
|
||||
struct ice_aqc_port_ets_elem *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_update_port_tc_tree_cfg(struct ice_port_info *pi,
|
||||
struct ice_aqc_port_ets_elem *buf);
|
||||
enum ice_status
|
||||
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
|
||||
bool *dcbx_agent_status, struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
|
||||
struct ice_sq_cd *cd);
|
||||
#endif /* _ICE_DCB_H_ */
|
@ -13,6 +13,7 @@ enum ice_status {
|
||||
ICE_ERR_PARAM = -1,
|
||||
ICE_ERR_NOT_IMPL = -2,
|
||||
ICE_ERR_NOT_READY = -3,
|
||||
ICE_ERR_NOT_SUPPORTED = -4,
|
||||
ICE_ERR_BAD_PTR = -5,
|
||||
ICE_ERR_INVAL_SIZE = -6,
|
||||
ICE_ERR_DEVICE_NOT_SUPPORTED = -8,
|
||||
|
@ -240,6 +240,9 @@ struct ice_hw_common_caps {
|
||||
|
||||
u32 os2bmc;
|
||||
u32 valid_functions;
|
||||
/* DCB capabilities */
|
||||
u32 active_tc_bitmap;
|
||||
u32 maxtc;
|
||||
|
||||
/* RSS related capabilities */
|
||||
u32 rss_table_size; /* 512 for PFs and 64 for VFs */
|
||||
@ -276,6 +279,7 @@ struct ice_hw_common_caps {
|
||||
u8 evb_802_1_qbg; /* Edge Virtual Bridging */
|
||||
u8 evb_802_1_qbh; /* Bridge Port Extension */
|
||||
|
||||
u8 dcb;
|
||||
u8 iscsi;
|
||||
u8 mgmt_cem;
|
||||
|
||||
@ -527,7 +531,6 @@ struct ice_sched_vsi_info {
|
||||
struct ice_bw_type_info bw_t_info[ICE_MAX_TRAFFIC_CLASS];
|
||||
};
|
||||
|
||||
#if !defined(NO_DCB_SUPPORT) || defined(ADQ_SUPPORT)
|
||||
/* CEE or IEEE 802.1Qaz ETS Configuration data */
|
||||
struct ice_dcb_ets_cfg {
|
||||
u8 willing;
|
||||
@ -580,7 +583,6 @@ struct ice_dcbx_cfg {
|
||||
u8 app_mode;
|
||||
#define ICE_DCBX_APPS_NON_WILLING 0x1
|
||||
};
|
||||
#endif /* !NO_DCB_SUPPORT || ADQ_SUPPORT */
|
||||
|
||||
struct ice_port_info {
|
||||
struct ice_sched_node *root; /* Root Node per Port */
|
||||
@ -601,9 +603,13 @@ struct ice_port_info {
|
||||
struct ice_lock sched_lock; /* protect access to TXSched tree */
|
||||
/* List contain profile ID(s) and other params per layer */
|
||||
struct LIST_HEAD_TYPE rl_prof_list[ICE_AQC_TOPO_MAX_LEVEL_NUM];
|
||||
#if !defined(NO_DCB_SUPPORT) || defined(ADQ_SUPPORT)
|
||||
struct ice_dcbx_cfg local_dcbx_cfg; /* Oper/Local Cfg */
|
||||
#endif /* !NO_DCB_SUPPORT || ADQ_SUPPORT */
|
||||
/* DCBX info */
|
||||
struct ice_dcbx_cfg remote_dcbx_cfg; /* Peer Cfg */
|
||||
struct ice_dcbx_cfg desired_dcbx_cfg; /* CEE Desired Cfg */
|
||||
/* LLDP/DCBX Status */
|
||||
u8 dcbx_status;
|
||||
u8 is_sw_lldp;
|
||||
u8 lport;
|
||||
#define ICE_LPORT_MASK 0xff
|
||||
u8 is_vf;
|
||||
|
@ -9,6 +9,7 @@ sources = [
|
||||
'ice_nvm.c',
|
||||
'ice_flex_pipe.c',
|
||||
'ice_flow.c',
|
||||
'ice_dcb.c',
|
||||
]
|
||||
|
||||
error_cflags = ['-Wno-unused-value',
|
||||
|
Loading…
Reference in New Issue
Block a user