net/ice: base update update batch 3.
cover net/ice: base update update batch 3.
Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expected net/ice/base: modififcation to support L3 DSCP QoS net/ice/base: signed External Device Package Programming net/ice/base: support IP fragment RSS and FDIR
drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++--- drivers/net/ice/base/ice_common.c | 119 ++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 ++ drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_fdir.c | 51 ++++++- drivers/net/ice/base/ice_fdir.h | 20 ++- drivers/net/ice/base/ice_flex_pipe.c | 5 +- drivers/net/ice/base/ice_flow.c | 51 ++++++- drivers/net/ice/base/ice_flow.h | 9 +- drivers/net/ice/base/ice_type.h | 24 +++- drivers/net/ice/base/ice_vlan_mode.c | 97 ++++++++++++-- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 14 files changed, 565 insertions(+), 65 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/6 net/ice/base: add IP fragment flags
Add the IPv6 fragment flags and the IPv4 fragment field shift.
--- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_fdir.h | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/net/ice/base/ice_fdir.c +1 -1
@@ -1505,7 +1505,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,ice_pkt_insert_u8 (loc,ICE_IPV4_TTL_OFFSET , input->ip.v4.ttl);ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac);if (frag) - loc[20 ] =ICE_FDIR_IPV4_PKT_FLAG_DF ; + loc[20 ] =ICE_FDIR_IPV4_PKT_FLAG_MF ;break ;case ICE_FLTR_PTYPE_NONF_IPV4_UDP :ice_pkt_insert_mac_addr (pkt, input->ext_data_outer.dst_mac);
drivers/net/ice/base/ice_fdir.h +12 -4
@@ -83,12 +83,20 @@#define ICE_FDIR_MAX_FLTRS 16384 -/* IP v4 has 2 flag bits that enable fragment processing: DF and MF. DF +/* IPv4 has 2 flag bits that enable fragment processing: DF and MF. DF * requests that the packet not be fragmented. MF indicates that a packet has -* been fragmented. +* been fragmented, except that for the last fragment has a non-zero +* Fragment Offset field with zero MF. */ -#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x20 -#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x40 +#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x20 +#define ICE_FDIR_IPV4_PKT_FLAG_MF_SHIFT 8 +#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x40 + +/* For IPv6 fragmented packets, all fragments except the last have +* the MF flag set. +*/ +#define ICE_FDIR_IPV6_PKT_FLAG_MF 0x100 +#define ICE_FDIR_IPV6_PKT_FLAG_MF_SHIFT 8enum ice_fltr_prgm_desc_dest {ICE_FLTR_PRGM_DESC_DEST_DROP_PKT ,
Signature · 1 line
2.26.2
PATCH 2/6 net/ice/base: add function for post DDP download VLAN mode configuration
In reply to Qi ZhangCurrently it's not clear that only the first PF downloads the package and configures the VLAN mode. When this is happening all other PFs are blocked on the global configuration lock. Once the package is successfully downloaded and the global configuration lock has been released then all PFs resume initialization. This includes some post package download VLAN mode configuration. To make this more obvious add the new function ice_post_pkg_dwnld_vlan_mode_cfg() so any/all post download VLAN mode configuration code can be put in here.
This also makes it more clear that all PFs will call this new function.
--- drivers/net/ice/base/ice_flex_pipe.c | 5 +---- drivers/net/ice/base/ice_vlan_mode.c | 25 ++++++++++++++++++++++++- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_flex_pipe.c +1 -4
@@ -1242,10 +1242,7 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) status =ice_dwnld_cfg_bufs (hw, ice_buf_tbl->buf_array,LE32_TO_CPU (ice_buf_tbl->buf_count)); -ice_cache_vlan_mode (hw); - -if (ice_is_dvm_ena (hw)) -ice_change_proto_id_to_dvm (); +ice_post_pkg_dwnld_vlan_mode_cfg (hw);return status; }
drivers/net/ice/base/ice_vlan_mode.c +24 -1
@@ -124,7 +124,7 @@ bool ice_is_dvm_ena(struct ice_hw *hw)* configuration lock has been released because all ports on a device need to * cache the VLAN mode. */ -void ice_cache_vlan_mode (struct ice_hw *hw) +static void ice_cache_vlan_mode (struct ice_hw *hw) { hw->dvm_ena =ice_aq_is_dvm_ena (hw) ? true : false; }
@@ -374,3 +374,26 @@ enum ice_status ice_set_vlan_mode(struct ice_hw *hw)return ice_set_svm (hw); } + +/** +* ice_post_pkg_dwnld_vlan_mode_cfg - configure VLAN mode after DDP download +* @hw: pointer to the HW structure +* +* This function is meant to configure any VLAN mode specific functionality +* after the global configuration lock has been released and the DDP has been +* downloaded. +* +* Since only one PF downloads the DDP and configures the VLAN mode there needs +* to be a way to configure the other PFs after the DDP has been downloaded and +* the global configuration lock has been released. All such code should go in +* this function. +*/ +void ice_post_pkg_dwnld_vlan_mode_cfg (struct ice_hw *hw) +{ +ice_cache_vlan_mode (hw); + +if (ice_is_dvm_ena (hw)) +ice_change_proto_id_to_dvm (); +else +ice_print_dvm_not_supported (hw); +}
drivers/net/ice/base/ice_vlan_mode.h +1 -1
@@ -10,7 +10,7 @@struct ice_hw ;bool ice_is_dvm_ena (struct ice_hw *hw); -void ice_cache_vlan_mode (struct ice_hw *hw);enum ice_status ice_set_vlan_mode (struct ice_hw *hw); +void ice_post_pkg_dwnld_vlan_mode_cfg (struct ice_hw *hw);#endif /* _ICE_VLAN_MODE_H */
Signature · 1 line
2.26.2
PATCH 3/6 net/ice/base: add print if DDP/FW don't support QinQ as expected
In reply to Qi ZhangCurrently if the driver supports QinQ there is no message/information if the DDP and/or FW don't support QinQ. Add functionality that prints if the DDP and/or FW don't support QinQ if the driver attempts to configured DVM. This will make it more obvious to users in the field that they need to update their DDP and/or FW.
This required a small refactor so some of the existing code could be shared and used by this new print functionality.
--- drivers/net/ice/base/ice_vlan_mode.c | 72 +++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_vlan_mode.c +60 -12
@@ -130,18 +130,11 @@ static void ice_cache_vlan_mode(struct ice_hw *hw) }/** -* ice_is_dvm_supported - check if Double VLAN Mode is supported -* @hw: pointer to the hardware structure -* -* Returns true if Double VLAN Mode (DVM) is supported and false if only Single -* VLAN Mode (SVM) is supported. In order for DVM to be supported the DDP and -* firmware must support it, otherwise only SVM is supported. This function -* should only be called while the global config lock is held and after the -* package has been successfully downloaded. +* ice_pkg_supports_dvm - find out if DDP supports DVM +* @hw: pointer to the HW structure */ -static bool ice_is_dvm_supported (struct ice_hw *hw) +static bool ice_pkg_supports_dvm (struct ice_hw *hw) { -struct ice_aqc_get_vlan_mode get_vlan_mode = {0 };enum ice_status status;bool pkg_supports_dvm;
@@ -152,8 +145,17 @@ static bool ice_is_dvm_supported(struct ice_hw *hw)return false; } -if (!pkg_supports_dvm) -return false; +return pkg_supports_dvm; +} + +/** +* ice_fw_supports_dvm - find out if FW supports DVM +* @hw: pointer to the HW structure +*/ +static bool ice_fw_supports_dvm (struct ice_hw *hw) +{ +struct ice_aqc_get_vlan_mode get_vlan_mode = {0 }; +enum ice_status status;/* If firmware returns success, then it supports DVM, else it only * supports SVM
@@ -168,6 +170,31 @@ static bool ice_is_dvm_supported(struct ice_hw *hw)return true; } +/** +* ice_is_dvm_supported - check if Double VLAN Mode is supported +* @hw: pointer to the hardware structure +* +* Returns true if Double VLAN Mode (DVM) is supported and false if only Single +* VLAN Mode (SVM) is supported. In order for DVM to be supported the DDP and +* firmware must support it, otherwise only SVM is supported. This function +* should only be called while the global config lock is held and after the +* package has been successfully downloaded. +*/ +static bool ice_is_dvm_supported (struct ice_hw *hw) +{ +if (!ice_pkg_supports_dvm (hw)) { +ice_debug (hw,ICE_DBG_PKG ,"DDP doesn't support DVM\n" ); +return false; + } + +if (!ice_fw_supports_dvm (hw)) { +ice_debug (hw,ICE_DBG_PKG ,"FW doesn't support DVM\n" ); +return false; + } + +return true; +} +#define ICE_EXTERNAL_VLAN_ID_FV_IDX 11#define ICE_SW_LKUP_VLAN_LOC_LKUP_IDX 1#define ICE_SW_LKUP_VLAN_PKT_FLAGS_LKUP_IDX 2
@@ -375,6 +402,27 @@ enum ice_status ice_set_vlan_mode(struct ice_hw *hw)return ice_set_svm (hw); } +/** +* ice_print_dvm_not_supported - print if DDP and/or FW doesn't support DVM +* @hw: pointer to the HW structure +* +* The purpose of this function is to print that QinQ is not supported due to +* incompatibilty from the DDP and/or FW. This will give a hint to the user to +* update one and/or both components if they expect QinQ functionality. +*/ +static void ice_print_dvm_not_supported (struct ice_hw *hw) +{ +bool pkg_supports_dvm =ice_pkg_supports_dvm (hw); +bool fw_supports_dvm =ice_fw_supports_dvm (hw); + +if (!fw_supports_dvm && !pkg_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. Update your DDP package and NVM to versions that support QinQ.\n" ); +else if (!pkg_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. Update your DDP package to a version that supports QinQ.\n" ); +else if (!fw_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. Update your NVM to a version that supports QinQ.\n" ); +} +/** * ice_post_pkg_dwnld_vlan_mode_cfg - configure VLAN mode after DDP download * @hw: pointer to the HW structure
Signature · 1 line
2.26.2
PATCH 4/6 net/ice/base: modififcation to support L3 DSCP QoS
In reply to Qi ZhangThe base code support to build configuration TLVs in DSCP mode has not been implemented before, so the functions to do so and the flow control to determine if we are in VLAN or DSCP mode need to be added.
The current value for maximum number of DCB APPs (ICE_DCBX_MAX_APPS) is not sufficient when supporting DSCP mode. Each DSCP->TC mapping will come in as a single APP value. So, there can be up to 64 APPs for DSCP mapping.
Need to keep track of the current DSCP to TC mapping so that TLVs can be built up to send to the FW. Add an u8 array to hold this info.
A u64 is also needed to keep track of the DSCP values that have had an APP submitted to map its value to a TC. Since it would be unwise to allow an APP to be overwritten by subsequent APPs, reject mappings for a DSCP value that already has a user mapped value. This will allow us to easily track which DSCP values have been mapped, and when the last one has been deleted.
--- drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_type.h | 10 +- 3 files changed, 194 insertions(+), 17 deletions(-)
drivers/net/ice/base/ice_dcb.c +169 -16
@@ -1207,7 +1207,140 @@ ice_add_ieee_app_pri_tlv(struct ice_lldp_org_tlv *tlv, }/** -* ice_add_dcb_tlv - Add all IEEE TLVs +* ice_add_dscp_up_tlv - Prepare DSCP to UP TLV +* @tlv: location to build the TLV data +* @dcbcfg: location of data to convert to TLV +*/ +static void +ice_add_dscp_up_tlv (struct ice_lldp_org_tlv *tlv,struct ice_dcbx_cfg *dcbcfg) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; +int i; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_UP_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_DSCP2UP ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* bytes 0 - 63 - IPv4 DSCP2UP LUT */ +for (i =0 ; i <ICE_DSCP_NUM_VAL ; i++) { +/* IPv4 mapping */ + buf[i] = dcbcfg->dscp_map[i]; +/* IPv6 mapping */ + buf[i +ICE_DSCP_IPV6_OFFSET ] = dcbcfg->dscp_map[i]; + } + +/* byte 64 - IPv4 untagged traffic */ + buf[i] =0 ; + +/* byte 144 - IPv6 untagged traffic */ + buf[i +ICE_DSCP_IPV6_OFFSET ] =0 ; +} + +#define ICE_BYTES_PER_TC 8 +/** +* ice_add_dscp_enf_tlv - Prepare DSCP Enforcement TLV +* @tlv: location to build the TLV data +*/ +static void +ice_add_dscp_enf_tlv (struct ice_lldp_org_tlv *tlv) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_ENF_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_ENFORCE ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* Allow all DSCP values to be valid for all TC's (IPv4 and IPv6) */ +memset (buf,0 ,2 * (ICE_MAX_TRAFFIC_CLASS *ICE_BYTES_PER_TC )); +} + +/** +* ice_add_dscp_tc_bw_tlv - Prepare DSCP BW for TC TLV +* @tlv: location to build the TLV data +* @dcbcfg: location of the data to convert to TLV +*/ +static void +ice_add_dscp_tc_bw_tlv (struct ice_lldp_org_tlv *tlv, +struct ice_dcbx_cfg *dcbcfg) +{ +struct ice_dcb_ets_cfg *etscfg; +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u8 offset =0 ; +u16 typelen; +int i; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_TC_BW_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_TCBW ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* First Octect after subtype +* ---------------------------- +* | RSV | CBS | RSV | Max TCs | +* | 1b | 1b | 3b | 3b | +* ---------------------------- +*/ + etscfg = &dcbcfg->etscfg; + buf[0 ] = etscfg->maxtcs &ICE_IEEE_ETS_MAXTC_M ; + +/* bytes 1 - 4 reserved */ + offset =5 ; + +/* TC BW table +* bytes 0 - 7 for TC 0 - 7 +* +* TSA Assignment table +* bytes 8 - 15 for TC 0 - 7 +*/ +for (i =0 ; i <ICE_MAX_TRAFFIC_CLASS ; i++) { + buf[offset] = etscfg->tcbwtable[i]; + buf[offset +ICE_MAX_TRAFFIC_CLASS ] = etscfg->tsatable[i]; + offset++; + } +} + +/** +* ice_add_dscp_pfc_tlv - Prepare DSCP PFC TLV +* @tlv: Fill PFC TLV in IEEE format +* @dcbcfg: Local store which holds the PFC CFG data +*/ +static void +ice_add_dscp_pfc_tlv (struct ice_lldp_org_tlv *tlv,struct ice_dcbx_cfg *dcbcfg) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_PFC_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_PFC ); + tlv->ouisubtype =HTONL (ouisubtype); + + buf[0 ] = dcbcfg->pfc.pfccap &0xF ; + buf[1 ] = dcbcfg->pfc.pfcena &0xF ; +} + +/** +* ice_add_dcb_tlv - Add all IEEE or DSCP TLVs * @tlv: Fill TLV data in IEEE format * @dcbcfg: Local store which holds the DCB Config * @tlvid: Type of IEEE TLV
@@ -1218,21 +1351,41 @@ static void ice_add_dcb_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg, u16 tlvid) { - switch (tlvid) { - case ICE_IEEE_TLV_ID_ETS_CFG: -ice_add_ieee_ets_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_ETS_REC : -ice_add_ieee_etsrec_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_PFC_CFG : -ice_add_ieee_pfc_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_APP_PRI : -ice_add_ieee_app_pri_tlv (tlv, dcbcfg); -break ; -default : -break ; + if (dcbcfg->pfc_mode == ICE_QOS_MODE_VLAN) { + switch (tlvid) { + case ICE_IEEE_TLV_ID_ETS_CFG: +ice_add_ieee_ets_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_ETS_REC : +ice_add_ieee_etsrec_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_PFC_CFG : +ice_add_ieee_pfc_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_APP_PRI : +ice_add_ieee_app_pri_tlv (tlv, dcbcfg); +break ; +default : +break ; + } + } else { +/* pfc_mode == ICE_QOS_MODE_DSCP */ +switch (tlvid) { +case ICE_TLV_ID_DSCP_UP : +ice_add_dscp_up_tlv (tlv, dcbcfg); +break ; +case ICE_TLV_ID_DSCP_ENF : +ice_add_dscp_enf_tlv (tlv); +break ; +case ICE_TLV_ID_DSCP_TC_BW : +ice_add_dscp_tc_bw_tlv (tlv, dcbcfg); +break ; +case ICE_TLV_ID_DSCP_TO_PFC : +ice_add_dscp_pfc_tlv (tlv, dcbcfg); +break ; +default : +break ; + } } }
drivers/net/ice/base/ice_dcb.h +16 -0
@@ -29,6 +29,13 @@#define ICE_CEE_DCBX_OUI 0x001B21#define ICE_CEE_DCBX_TYPE 2 +#define ICE_DSCP_OUI 0xFFFFFF +#define ICE_DSCP_SUBTYPE_DSCP2UP 0x41 +#define ICE_DSCP_SUBTYPE_ENFORCE 0x42 +#define ICE_DSCP_SUBTYPE_TCBW 0x43 +#define ICE_DSCP_SUBTYPE_PFC 0x44 +#define ICE_DSCP_IPV6_OFFSET 80 +#define ICE_CEE_SUBTYPE_CTRL 1#define ICE_CEE_SUBTYPE_PG_CFG 2#define ICE_CEE_SUBTYPE_PFC_CFG 3
@@ -97,11 +104,20 @@#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_TLV_ID_DSCP_UP 3 +#define ICE_TLV_ID_DSCP_ENF 4 +#define ICE_TLV_ID_DSCP_TC_BW 5 +#define ICE_TLV_ID_DSCP_TO_PFC 6#define ICE_IEEE_ETS_TLV_LEN 25#define ICE_IEEE_PFC_TLV_LEN 6#define ICE_IEEE_APP_TLV_LEN 11 +#define ICE_DSCP_UP_TLV_LEN 148 +#define ICE_DSCP_ENF_TLV_LEN 132 +#define ICE_DSCP_TC_BW_TLV_LEN 25 +#define ICE_DSCP_PFC_TLV_LEN 6 +#pragma pack(1)/* IEEE 802.1AB LLDP Organization specific TLV */ struct ice_lldp_org_tlv {
drivers/net/ice/base/ice_type.h +9 -1
@@ -797,7 +797,8 @@ struct ice_dcb_app_priority_table { };#define ICE_MAX_USER_PRIORITY 8 -#define ICE_DCBX_MAX_APPS 32 +#define ICE_DCBX_MAX_APPS 64 +#define ICE_DSCP_NUM_VAL 64#define ICE_LLDPDU_SIZE 1500#define ICE_TLV_STATUS_OPER 0x1#define ICE_TLV_STATUS_SYNC 0x2
@@ -817,7 +818,14 @@ struct ice_dcbx_cfg {struct ice_dcb_ets_cfg etscfg;struct ice_dcb_ets_cfg etsrec;struct ice_dcb_pfc_cfg pfc; +#define ICE_QOS_MODE_VLAN 0x0 +#define ICE_QOS_MODE_DSCP 0x1 +u8 pfc_mode;struct ice_dcb_app_priority_table app[ICE_DCBX_MAX_APPS ]; +/* when DSCP mapping defined by user set its bit to 1 */ +ice_declare_bitmap (dscp_mapped,ICE_DSCP_NUM_VAL ); +/* array holding DSCP -> UP/TC values for DSCP L3 QoS mode */ +u8 dscp_map[ICE_DSCP_NUM_VAL ];u8 dcbx_mode;#define ICE_DCBX_MODE_CEE 0x1#define ICE_DCBX_MODE_IEEE 0x2
Signature · 1 line
2.26.2
PATCH 5/6 net/ice/base: signed External Device Package Programming
In reply to Qi ZhangExternal topology devices (e.g. PHYs) connected to 100G or to SoC that includes 100G IP might have a firmware engine within the device and the firmware is usually loaded from NVM connected to the topology device.
The topology device NVM images can be updated using SW tools but such solution poses a security risk if there is no validation of the integrity of an image before programming it to the device NVM. In order to prevent security risk, the topology device NVM image might be included as part of 100G NVM image. When the topology device NVM image is present in the 100G NVM image, it is authenticated and might be loaded to the topology device at startup or on command of SW using dedicated AQ.
This patch provides support for this functionality.
--- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++++---- drivers/net/ice/base/ice_common.c | 119 +++++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 +++ drivers/net/ice/base/ice_type.h | 13 +++ 4 files changed, 162 insertions(+), 19 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +23 -16
@@ -113,6 +113,10 @@ struct ice_aqc_list_caps_elem {#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076#define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077#define ICE_AQC_CAPS_NVM_MGMT 0x0080 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG0 0x0081 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG1 0x0082 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG2 0x0083 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG3 0x0084u8 major_ver;u8 minor_ver;
@@ -1614,7 +1618,7 @@ struct ice_aqc_set_mac_lb {u8 reserved[15 ]; }; -struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params {u8 lport_num;u8 lport_num_valid;#define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0)
@@ -1640,6 +1644,10 @@ struct ice_aqc_link_topo_addr {#define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4#define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5u8 index; +}; + +struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params topo_params;__le16 handle;#define ICE_AQC_LINK_TOPO_HANDLE_S 0#define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
@@ -1754,23 +1762,18 @@ struct ice_aqc_sw_gpio {u8 rsvd[12 ]; }; -/* Program topology device NVM (direct, 0x06F2) */ -struct ice_aqc_program_topology_device_nvm { -u8 lport_num; -u8 lport_num_valid; -u8 node_type_ctx; -u8 index; +/* Program Topology Device NVM (direct, 0x06F2) */ +struct ice_aqc_prog_topo_dev_nvm { +struct ice_aqc_link_topo_params topo_params;u8 rsvd[12 ]; }; -/* Read topology device NVM (indirect, 0x06F3) */ -struct ice_aqc_read_topology_device_nvm { -u8 lport_num; -u8 lport_num_valid; -u8 node_type_ctx; -u8 index; +/* Read Topology Device NVM (direct, 0x06F3) */ +struct ice_aqc_read_topo_dev_nvm { +struct ice_aqc_link_topo_params topo_params;__le32 start_address; -u8 data_read[8 ]; +#define ICE_AQC_READ_TOPO_DEV_NVM_DATA_READ_SIZE 8 +u8 data_read[ICE_AQC_READ_TOPO_DEV_NVM_DATA_READ_SIZE ]; };/* NVM Read command (indirect 0x0701)
@@ -2744,6 +2747,8 @@ struct ice_aqc_set_health_status_config {#define ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS 0x115#define ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME 0x116#define ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT 0x117 +#define ICE_AQC_HEALTH_STATUS_ERR_PHY_NVM_PROG 0x120 +#define ICE_AQC_HEALTH_STATUS_ERR_PHY_FW_LOAD 0x121#define ICE_AQC_HEALTH_STATUS_INFO_RECOVERY 0x500#define ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS 0x501#define ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH 0x502
@@ -2946,6 +2951,8 @@ struct ice_aq_desc { get_supported_health_status_codes;struct ice_aqc_get_health_status get_health_status;struct ice_aqc_clear_health_status clear_health_status; +struct ice_aqc_prog_topo_dev_nvm prog_topo_dev_nvm; +struct ice_aqc_read_topo_dev_nvm read_topo_dev_nvm; } params; };
@@ -3122,8 +3129,8 @@ enum ice_adminq_opc { ice_aqc_opc_sff_eeprom =0x06EE , ice_aqc_opc_sw_set_gpio =0x06EF , ice_aqc_opc_sw_get_gpio =0x06F0 , - ice_aqc_opc_program_topology_device_nvm =0x06F2 , - ice_aqc_opc_read_topology_device_nvm =0x06F3 , + ice_aqc_opc_prog_topo_dev_nvm =0x06F2 , + ice_aqc_opc_read_topo_dev_nvm =0x06F3 ,/* NVM commands */ ice_aqc_opc_nvm_read = 0x0701,
drivers/net/ice/base/ice_common.c +116 -3
139 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +10 -0
@@ -187,6 +187,16 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, bool write, struct ice_sq_cd *cd); +enum ice_status +ice_aq_prog_topo_dev_nvm (struct ice_hw *hw, +struct ice_aqc_link_topo_params *topo_params, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_read_topo_dev_nvm (struct ice_hw *hw, +struct ice_aqc_link_topo_params *topo_params, +u32 start_address,u8 *buf,u8 buf_size, +struct ice_sq_cd *cd); +enum ice_status ice_get_ctx (u8 *src_ctx,u8 *dest_ctx,struct ice_ctx_ele *ce_info);enum ice_status
drivers/net/ice/base/ice_type.h +13 -0
@@ -449,6 +449,19 @@ struct ice_hw_common_caps {#define ICE_NVM_MGMT_SEC_REV_DISABLED BIT(0)#define ICE_NVM_MGMT_UPDATE_DISABLED BIT(1)#define ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT BIT(3) + +/* External topology device images within the NVM */ +#define ICE_EXT_TOPO_DEV_IMG_COUNT 4 +u32 ext_topo_dev_img_ver_high[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +u32 ext_topo_dev_img_ver_low[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +u8 ext_topo_dev_img_part_num[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_PART_NUM_S 8 +#define ICE_EXT_TOPO_DEV_IMG_PART_NUM_M \ + MAKEMASK(0xFF, ICE_EXT_TOPO_DEV_IMG_PART_NUM_S) +bool ext_topo_dev_img_load_en[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_LOAD_EN BIT(0) +bool ext_topo_dev_img_prog_en[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_PROG_EN BIT(1) };/* Function specific capabilities */
Signature · 1 line
2.26.2
PATCH 6/6 net/ice/base: support IP fragment RSS and FDIR
In reply to Qi ZhangAdd support for IP fragment RSS hash and FDIR function. Separate IP fragment and IP other packet types.
The patch also update the release date in README.
--- drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_fdir.c | 49 ++++++++++++++++++++++++++++++- drivers/net/ice/base/ice_fdir.h | 4 +++ drivers/net/ice/base/ice_flow.c | 51 ++++++++++++++++++++++++++++++++- drivers/net/ice/base/ice_flow.h | 9 ++++-- drivers/net/ice/base/ice_type.h | 1 + 6 files changed, 110 insertions(+), 6 deletions(-)
drivers/net/ice/base/README +1 -1
@@ -6,7 +6,7 @@ Intel® ICE driver ================== This directory contains source code of FreeBSD ice driver of version -2021.01.20 released by the team which develops +2021.04.29 released by the team which develops basic drivers for any ice NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below
drivers/net/ice/base/ice_fdir.c +48 -1
73 lines not on this page · raw message
drivers/net/ice/base/ice_fdir.h +4 -0
@@ -42,10 +42,12 @@#define ICE_MAC_ETHTYPE_OFFSET 12#define ICE_IPV4_TOS_OFFSET 15 +#define ICE_IPV4_ID_OFFSET 18#define ICE_IPV4_TTL_OFFSET 22#define ICE_IPV6_TC_OFFSET 14#define ICE_IPV6_HLIM_OFFSET 21#define ICE_IPV6_PROTO_OFFSET 20 +#define ICE_IPV6_ID_OFFSET 58/* For TUN inner (without inner MAC) */ #define ICE_IPV4_NO_MAC_TOS_OFFSET 1#define ICE_IPV4_NO_MAC_TTL_OFFSET 8
@@ -158,6 +160,7 @@ struct ice_fdir_v4 {u8 ip_ver;u8 proto;u8 ttl; +__be16 packet_id; };#define ICE_IPV6_ADDR_LEN_AS_U32 4
@@ -172,6 +175,7 @@ struct ice_fdir_v6 {u8 tc;u8 proto;u8 hlim; +__be32 packet_id; };struct ice_fdir_udp_gtp {
drivers/net/ice/base/ice_flow.c +50 -1
99 lines not on this page · raw message
drivers/net/ice/base/ice_flow.h +6 -3
@@ -186,11 +186,12 @@ enum ice_flow_seg_hdr {ICE_FLOW_SEG_HDR_ECPRI_TP0 =0x04000000 ,ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0 =0x08000000 ,ICE_FLOW_SEG_HDR_L2TPV2 =0x10000000 , -ICE_FLOW_SEG_HDR_PPP =0x40000000 , +ICE_FLOW_SEG_HDR_PPP =0x20000000 ,/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and -* ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs +* ICE_FLOW_SEG_HDR_IPV6. */ - ICE_FLOW_SEG_HDR_IPV_OTHER = 0x20000000, +ICE_FLOW_SEG_HDR_IPV_FRAG =0x40000000 , + ICE_FLOW_SEG_HDR_IPV_OTHER = 0x80000000, };/* These segements all have the same PTYPES, but are otherwise distinguished by
@@ -227,6 +228,8 @@ enum ice_flow_field {ICE_FLOW_FIELD_IDX_IPV4_DA ,ICE_FLOW_FIELD_IDX_IPV6_SA ,ICE_FLOW_FIELD_IDX_IPV6_DA , +ICE_FLOW_FIELD_IDX_IPV4_ID , +ICE_FLOW_FIELD_IDX_IPV6_ID ,ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA ,ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA , ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA,
drivers/net/ice/base/ice_type.h +1 -0
@@ -347,6 +347,7 @@ enum ice_fltr_ptype {ICE_FLTR_PTYPE_NONF_ECPRI_TP0 ,ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0 ,ICE_FLTR_PTYPE_FRAG_IPV4 , +ICE_FLTR_PTYPE_FRAG_IPV6 ,ICE_FLTR_PTYPE_NONF_IPV6_UDP ,ICE_FLTR_PTYPE_NONF_IPV6_TCP , ICE_FLTR_PTYPE_NONF_IPV6_SCTP,
Signature · 1 line
2.26.2
Hi,
Quoted 35 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2021年4月29日 8:42
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH 0/6] net/ice: base update update batch 3.Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expectednet/ice/base: modififcation to support L3 DSCP QoSnet/ice/base: signed External Device Package Programmingnet/ice/base: support IP fragment RSS and FDIRdrivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++--- drivers/net/ice/base/ice_common.c | 119 ++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 ++ drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_fdir.c | 51 ++++++- drivers/net/ice/base/ice_fdir.h | 20 ++- drivers/net/ice/base/ice_flex_pipe.c | 5 +- drivers/net/ice/base/ice_flow.c | 51 ++++++- drivers/net/ice/base/ice_flow.h | 9 +- drivers/net/ice/base/ice_type.h | 24 +++- drivers/net/ice/base/ice_vlan_mode.c | 97 ++++++++++++-- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 14 files changed, 565 insertions(+), 65 deletions(-)
Quoted 2 lines
--
2.26.2
Zhang, Qi Z
AppliedQuoted 47 lines
-----Original Message-----
From: Yang, Qiming <[email protected]>
Sent: Thursday, April 29, 2021 10:30 AM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH 0/6] net/ice: base update update batch 3.Hi,
Quoted 19 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2021年4月29日 8:42
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH 0/6] net/ice: base update update batch 3.Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expectednet/ice/base: modififcation to support L3 DSCP QoSnet/ice/base: signed External Device Package Programmingnet/ice/base: support IP fragment RSS and FDIRQuoted 5 lines
drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++--- drivers/net/ice/base/ice_common.c | 119 ++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 ++ drivers/net/ice/base/ice_dcb.c | 185+++++++++++++++++++++++---
Quoted 11 lines
drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_fdir.c | 51 ++++++- drivers/net/ice/base/ice_fdir.h | 20 ++- drivers/net/ice/base/ice_flex_pipe.c | 5 +- drivers/net/ice/base/ice_flow.c | 51 ++++++- drivers/net/ice/base/ice_flow.h | 9 +- drivers/net/ice/base/ice_type.h | 24 +++- drivers/net/ice/base/ice_vlan_mode.c | 97 ++++++++++++-- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 14 files changed, 565 insertions(+), 65 deletions(-)
Quoted 4 lines
Quoted 2 lines
--
2.26.2Acked-by Qiming Yang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 12 lines · Qi Zhang
Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expectednet/ice/base: modififcation to support L3 DSCP QoSnet/ice/base: signed External Device Package Programmingnet/ice/base: support IP fragment RSS and FDIR
Hi Qi,
Patch by patch build fails, can you please check it?
Also some of the above patches title doesn't match to our convention, plus there is a checkpatch warning, can you please fix them too?
And in 4/6, the message logs are too long, yes we allow long lines instead of breaking them, this is to help searching log in the code, but those lines are ~150 chars and I think makes harder to read the code, what do you think indent the message and break in the sentences boundary, something like:
"
ice_info(hw
"QinQ functionality cannot be enabled on this device. "
"Update your DDP package and NVM to versions that support QinQ.\n");"
Quoted 31 lines
-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Friday, April 30, 2021 7:57 PM
To: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 0/6] net/ice: base update update batch 3.Quoted 12 lines · Qi Zhang
Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expectednet/ice/base: modififcation to support L3 DSCP QoSnet/ice/base: signed External Device Package Programmingnet/ice/base: support IP fragment RSS and FDIRHi Qi,
Patch by patch build fails, can you please check it?
Also some of the above patches title doesn't match to our convention, plus there is a checkpatch warning, can you please fix them too?
Quoted 9 lines
And in 4/6, the message logs are too long, yes we allow long lines instead of breaking them, this is to help searching log in the code, but those lines are ~150 chars and I think makes harder to read the code, what do you think indent the message and break in the sentences boundary, something like:
"
ice_info(hw
"QinQ functionality cannot be enabled on this device. " "Update your DDP package and NVM to versions that support
QinQ.\n"); "
Thanks for the capture, all issue fixed in v2.
v2 cover net/ice: base update update batch 3
In reply to Qi ZhangAdd IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
v2:
- fix compile error in patch 2/6
- wrap long strin gin patch 3/6
- fix typo in patch 4/6
- fix title convetion in patch 4/6 and 5/6
Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expected net/ice/base: support L3 DSCP QoS
net/ice/base: sign external device package programming net/ice/base: support IP fragment RSS and FDIR
drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++--- drivers/net/ice/base/ice_common.c | 119 ++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 ++ drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_fdir.c | 51 ++++++- drivers/net/ice/base/ice_fdir.h | 20 ++- drivers/net/ice/base/ice_flex_pipe.c | 5 +- drivers/net/ice/base/ice_flow.c | 51 ++++++- drivers/net/ice/base/ice_flow.h | 9 +- drivers/net/ice/base/ice_type.h | 24 +++- drivers/net/ice/base/ice_vlan_mode.c | 100 ++++++++++++-- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 14 files changed, 568 insertions(+), 65 deletions(-)
Signature · 1 line
2.26.2
PATCH v2 1/6 net/ice/base: add IP fragment flags
Add the IPv6 fragment flags and the IPv4 fragment field shift.
--- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_fdir.h | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/net/ice/base/ice_fdir.c +1 -1
@@ -1505,7 +1505,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,ice_pkt_insert_u8 (loc,ICE_IPV4_TTL_OFFSET , input->ip.v4.ttl);ice_pkt_insert_mac_addr (loc, input->ext_data.dst_mac);if (frag) - loc[20 ] =ICE_FDIR_IPV4_PKT_FLAG_DF ; + loc[20 ] =ICE_FDIR_IPV4_PKT_FLAG_MF ;break ;case ICE_FLTR_PTYPE_NONF_IPV4_UDP :ice_pkt_insert_mac_addr (pkt, input->ext_data_outer.dst_mac);
drivers/net/ice/base/ice_fdir.h +12 -4
@@ -83,12 +83,20 @@#define ICE_FDIR_MAX_FLTRS 16384 -/* IP v4 has 2 flag bits that enable fragment processing: DF and MF. DF +/* IPv4 has 2 flag bits that enable fragment processing: DF and MF. DF * requests that the packet not be fragmented. MF indicates that a packet has -* been fragmented. +* been fragmented, except that for the last fragment has a non-zero +* Fragment Offset field with zero MF. */ -#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x20 -#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x40 +#define ICE_FDIR_IPV4_PKT_FLAG_MF 0x20 +#define ICE_FDIR_IPV4_PKT_FLAG_MF_SHIFT 8 +#define ICE_FDIR_IPV4_PKT_FLAG_DF 0x40 + +/* For IPv6 fragmented packets, all fragments except the last have +* the MF flag set. +*/ +#define ICE_FDIR_IPV6_PKT_FLAG_MF 0x100 +#define ICE_FDIR_IPV6_PKT_FLAG_MF_SHIFT 8enum ice_fltr_prgm_desc_dest {ICE_FLTR_PRGM_DESC_DEST_DROP_PKT ,
Signature · 1 line
2.26.2
PATCH v2 2/6 net/ice/base: add function for post DDP download VLAN mode configuration
In reply to Qi ZhangCurrently it's not clear that only the first PF downloads the package and configures the VLAN mode. When this is happening all other PFs are blocked on the global configuration lock. Once the package is successfully downloaded and the global configuration lock has been released then all PFs resume initialization. This includes some post package download VLAN mode configuration. To make this more obvious add the new function ice_post_pkg_dwnld_vlan_mode_cfg() so any/all post download VLAN mode configuration code can be put in here.
This also makes it more clear that all PFs will call this new function.
--- drivers/net/ice/base/ice_flex_pipe.c | 5 +---- drivers/net/ice/base/ice_vlan_mode.c | 23 ++++++++++++++++++++++- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_flex_pipe.c +1 -4
@@ -1242,10 +1242,7 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) status =ice_dwnld_cfg_bufs (hw, ice_buf_tbl->buf_array,LE32_TO_CPU (ice_buf_tbl->buf_count)); -ice_cache_vlan_mode (hw); - -if (ice_is_dvm_ena (hw)) -ice_change_proto_id_to_dvm (); +ice_post_pkg_dwnld_vlan_mode_cfg (hw);return status; }
drivers/net/ice/base/ice_vlan_mode.c +22 -1
@@ -124,7 +124,7 @@ bool ice_is_dvm_ena(struct ice_hw *hw)* configuration lock has been released because all ports on a device need to * cache the VLAN mode. */ -void ice_cache_vlan_mode (struct ice_hw *hw) +static void ice_cache_vlan_mode (struct ice_hw *hw) { hw->dvm_ena =ice_aq_is_dvm_ena (hw) ? true : false; }
@@ -374,3 +374,24 @@ enum ice_status ice_set_vlan_mode(struct ice_hw *hw)return ice_set_svm (hw); } + +/** +* ice_post_pkg_dwnld_vlan_mode_cfg - configure VLAN mode after DDP download +* @hw: pointer to the HW structure +* +* This function is meant to configure any VLAN mode specific functionality +* after the global configuration lock has been released and the DDP has been +* downloaded. +* +* Since only one PF downloads the DDP and configures the VLAN mode there needs +* to be a way to configure the other PFs after the DDP has been downloaded and +* the global configuration lock has been released. All such code should go in +* this function. +*/ +void ice_post_pkg_dwnld_vlan_mode_cfg (struct ice_hw *hw) +{ +ice_cache_vlan_mode (hw); + +if (ice_is_dvm_ena (hw)) +ice_change_proto_id_to_dvm (); +}
drivers/net/ice/base/ice_vlan_mode.h +1 -1
@@ -10,7 +10,7 @@struct ice_hw ;bool ice_is_dvm_ena (struct ice_hw *hw); -void ice_cache_vlan_mode (struct ice_hw *hw);enum ice_status ice_set_vlan_mode (struct ice_hw *hw); +void ice_post_pkg_dwnld_vlan_mode_cfg (struct ice_hw *hw);#endif /* _ICE_VLAN_MODE_H */
Signature · 1 line
2.26.2
PATCH v2 3/6 net/ice/base: add print if DDP/FW don't support QinQ as expected
In reply to Qi ZhangCurrently if the driver supports QinQ there is no message/information if the DDP and/or FW don't support QinQ. Add functionality that prints if the DDP and/or FW don't support QinQ if the driver attempts to configured DVM. This will make it more obvious to users in the field that they need to update their DDP and/or FW.
This required a small refactor so some of the existing code could be shared and used by this new print functionality.
--- drivers/net/ice/base/ice_vlan_mode.c | 77 +++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 12 deletions(-)
drivers/net/ice/base/ice_vlan_mode.c +65 -12
@@ -130,18 +130,11 @@ static void ice_cache_vlan_mode(struct ice_hw *hw) }/** -* ice_is_dvm_supported - check if Double VLAN Mode is supported -* @hw: pointer to the hardware structure -* -* Returns true if Double VLAN Mode (DVM) is supported and false if only Single -* VLAN Mode (SVM) is supported. In order for DVM to be supported the DDP and -* firmware must support it, otherwise only SVM is supported. This function -* should only be called while the global config lock is held and after the -* package has been successfully downloaded. +* ice_pkg_supports_dvm - find out if DDP supports DVM +* @hw: pointer to the HW structure */ -static bool ice_is_dvm_supported (struct ice_hw *hw) +static bool ice_pkg_supports_dvm (struct ice_hw *hw) { -struct ice_aqc_get_vlan_mode get_vlan_mode = {0 };enum ice_status status;bool pkg_supports_dvm;
@@ -152,8 +145,17 @@ static bool ice_is_dvm_supported(struct ice_hw *hw)return false; } -if (!pkg_supports_dvm) -return false; +return pkg_supports_dvm; +} + +/** +* ice_fw_supports_dvm - find out if FW supports DVM +* @hw: pointer to the HW structure +*/ +static bool ice_fw_supports_dvm (struct ice_hw *hw) +{ +struct ice_aqc_get_vlan_mode get_vlan_mode = {0 }; +enum ice_status status;/* If firmware returns success, then it supports DVM, else it only * supports SVM
@@ -168,6 +170,31 @@ static bool ice_is_dvm_supported(struct ice_hw *hw)return true; } +/** +* ice_is_dvm_supported - check if Double VLAN Mode is supported +* @hw: pointer to the hardware structure +* +* Returns true if Double VLAN Mode (DVM) is supported and false if only Single +* VLAN Mode (SVM) is supported. In order for DVM to be supported the DDP and +* firmware must support it, otherwise only SVM is supported. This function +* should only be called while the global config lock is held and after the +* package has been successfully downloaded. +*/ +static bool ice_is_dvm_supported (struct ice_hw *hw) +{ +if (!ice_pkg_supports_dvm (hw)) { +ice_debug (hw,ICE_DBG_PKG ,"DDP doesn't support DVM\n" ); +return false; + } + +if (!ice_fw_supports_dvm (hw)) { +ice_debug (hw,ICE_DBG_PKG ,"FW doesn't support DVM\n" ); +return false; + } + +return true; +} +#define ICE_EXTERNAL_VLAN_ID_FV_IDX 11#define ICE_SW_LKUP_VLAN_LOC_LKUP_IDX 1#define ICE_SW_LKUP_VLAN_PKT_FLAGS_LKUP_IDX 2
@@ -375,6 +402,30 @@ enum ice_status ice_set_vlan_mode(struct ice_hw *hw)return ice_set_svm (hw); } +/** +* ice_print_dvm_not_supported - print if DDP and/or FW doesn't support DVM +* @hw: pointer to the HW structure +* +* The purpose of this function is to print that QinQ is not supported due to +* incompatibilty from the DDP and/or FW. This will give a hint to the user to +* update one and/or both components if they expect QinQ functionality. +*/ +static void ice_print_dvm_not_supported (struct ice_hw *hw) +{ +bool pkg_supports_dvm =ice_pkg_supports_dvm (hw); +bool fw_supports_dvm =ice_fw_supports_dvm (hw); + +if (!fw_supports_dvm && !pkg_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. " +"Update your DDP package and NVM to versions that support QinQ.\n" ); +else if (!pkg_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. " +"Update your DDP package to a version that supports QinQ.\n" ); +else if (!fw_supports_dvm) +ice_info (hw,"QinQ functionality cannot be enabled on this device. " +"Update your NVM to a version that supports QinQ.\n" ); +} +/** * ice_post_pkg_dwnld_vlan_mode_cfg - configure VLAN mode after DDP download * @hw: pointer to the HW structure
@@ -394,4 +445,6 @@ void ice_post_pkg_dwnld_vlan_mode_cfg(struct ice_hw *hw)if (ice_is_dvm_ena (hw))ice_change_proto_id_to_dvm (); +else +ice_print_dvm_not_supported (hw); }
Signature · 1 line
2.26.2
PATCH v2 4/6 net/ice/base: support L3 DSCP QoS
In reply to Qi ZhangThe base code support to build configuration TLVs in DSCP mode has not been implemented before, so the functions to do so and the flow control to determine if we are in VLAN or DSCP mode need to be added.
The current value for maximum number of DCB APPs (ICE_DCBX_MAX_APPS) is not sufficient when supporting DSCP mode. Each DSCP->TC mapping will come in as a single APP value. So, there can be up to 64 APPs for DSCP mapping.
Need to keep track of the current DSCP to TC mapping so that TLVs can be built up to send to the FW. Add an u8 array to hold this info.
A u64 is also needed to keep track of the DSCP values that have had an APP submitted to map its value to a TC. Since it would be unwise to allow an APP to be overwritten by subsequent APPs, reject mappings for a DSCP value that already has a user mapped value. This will allow us to easily track which DSCP values have been mapped, and when the last one has been deleted.
--- drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_type.h | 10 +- 3 files changed, 194 insertions(+), 17 deletions(-)
drivers/net/ice/base/ice_dcb.c +169 -16
@@ -1207,7 +1207,140 @@ ice_add_ieee_app_pri_tlv(struct ice_lldp_org_tlv *tlv, }/** -* ice_add_dcb_tlv - Add all IEEE TLVs +* ice_add_dscp_up_tlv - Prepare DSCP to UP TLV +* @tlv: location to build the TLV data +* @dcbcfg: location of data to convert to TLV +*/ +static void +ice_add_dscp_up_tlv (struct ice_lldp_org_tlv *tlv,struct ice_dcbx_cfg *dcbcfg) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; +int i; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_UP_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_DSCP2UP ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* bytes 0 - 63 - IPv4 DSCP2UP LUT */ +for (i =0 ; i <ICE_DSCP_NUM_VAL ; i++) { +/* IPv4 mapping */ + buf[i] = dcbcfg->dscp_map[i]; +/* IPv6 mapping */ + buf[i +ICE_DSCP_IPV6_OFFSET ] = dcbcfg->dscp_map[i]; + } + +/* byte 64 - IPv4 untagged traffic */ + buf[i] =0 ; + +/* byte 144 - IPv6 untagged traffic */ + buf[i +ICE_DSCP_IPV6_OFFSET ] =0 ; +} + +#define ICE_BYTES_PER_TC 8 +/** +* ice_add_dscp_enf_tlv - Prepare DSCP Enforcement TLV +* @tlv: location to build the TLV data +*/ +static void +ice_add_dscp_enf_tlv (struct ice_lldp_org_tlv *tlv) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_ENF_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_ENFORCE ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* Allow all DSCP values to be valid for all TC's (IPv4 and IPv6) */ +memset (buf,0 ,2 * (ICE_MAX_TRAFFIC_CLASS *ICE_BYTES_PER_TC )); +} + +/** +* ice_add_dscp_tc_bw_tlv - Prepare DSCP BW for TC TLV +* @tlv: location to build the TLV data +* @dcbcfg: location of the data to convert to TLV +*/ +static void +ice_add_dscp_tc_bw_tlv (struct ice_lldp_org_tlv *tlv, +struct ice_dcbx_cfg *dcbcfg) +{ +struct ice_dcb_ets_cfg *etscfg; +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u8 offset =0 ; +u16 typelen; +int i; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_TC_BW_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_TCBW ); + tlv->ouisubtype =HTONL (ouisubtype); + +/* First Octet after subtype +* ---------------------------- +* | RSV | CBS | RSV | Max TCs | +* | 1b | 1b | 3b | 3b | +* ---------------------------- +*/ + etscfg = &dcbcfg->etscfg; + buf[0 ] = etscfg->maxtcs &ICE_IEEE_ETS_MAXTC_M ; + +/* bytes 1 - 4 reserved */ + offset =5 ; + +/* TC BW table +* bytes 0 - 7 for TC 0 - 7 +* +* TSA Assignment table +* bytes 8 - 15 for TC 0 - 7 +*/ +for (i =0 ; i <ICE_MAX_TRAFFIC_CLASS ; i++) { + buf[offset] = etscfg->tcbwtable[i]; + buf[offset +ICE_MAX_TRAFFIC_CLASS ] = etscfg->tsatable[i]; + offset++; + } +} + +/** +* ice_add_dscp_pfc_tlv - Prepare DSCP PFC TLV +* @tlv: Fill PFC TLV in IEEE format +* @dcbcfg: Local store which holds the PFC CFG data +*/ +static void +ice_add_dscp_pfc_tlv (struct ice_lldp_org_tlv *tlv,struct ice_dcbx_cfg *dcbcfg) +{ +u8 *buf = tlv->tlvinfo; +u32 ouisubtype; +u16 typelen; + + typelen = ((ICE_TLV_TYPE_ORG <<ICE_LLDP_TLV_TYPE_S ) | +ICE_DSCP_PFC_TLV_LEN ); + tlv->typelen =HTONS (typelen); + + ouisubtype = (u32)((ICE_DSCP_OUI <<ICE_LLDP_TLV_OUI_S ) | +ICE_DSCP_SUBTYPE_PFC ); + tlv->ouisubtype =HTONL (ouisubtype); + + buf[0 ] = dcbcfg->pfc.pfccap &0xF ; + buf[1 ] = dcbcfg->pfc.pfcena &0xF ; +} + +/** +* ice_add_dcb_tlv - Add all IEEE or DSCP TLVs * @tlv: Fill TLV data in IEEE format * @dcbcfg: Local store which holds the DCB Config * @tlvid: Type of IEEE TLV
@@ -1218,21 +1351,41 @@ static void ice_add_dcb_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg, u16 tlvid) { - switch (tlvid) { - case ICE_IEEE_TLV_ID_ETS_CFG: -ice_add_ieee_ets_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_ETS_REC : -ice_add_ieee_etsrec_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_PFC_CFG : -ice_add_ieee_pfc_tlv (tlv, dcbcfg); -break ; -case ICE_IEEE_TLV_ID_APP_PRI : -ice_add_ieee_app_pri_tlv (tlv, dcbcfg); -break ; -default : -break ; + if (dcbcfg->pfc_mode == ICE_QOS_MODE_VLAN) { + switch (tlvid) { + case ICE_IEEE_TLV_ID_ETS_CFG: +ice_add_ieee_ets_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_ETS_REC : +ice_add_ieee_etsrec_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_PFC_CFG : +ice_add_ieee_pfc_tlv (tlv, dcbcfg); +break ; +case ICE_IEEE_TLV_ID_APP_PRI : +ice_add_ieee_app_pri_tlv (tlv, dcbcfg); +break ; +default : +break ; + } + } else { +/* pfc_mode == ICE_QOS_MODE_DSCP */ +switch (tlvid) { +case ICE_TLV_ID_DSCP_UP : +ice_add_dscp_up_tlv (tlv, dcbcfg); +break ; +case ICE_TLV_ID_DSCP_ENF : +ice_add_dscp_enf_tlv (tlv); +break ; +case ICE_TLV_ID_DSCP_TC_BW : +ice_add_dscp_tc_bw_tlv (tlv, dcbcfg); +break ; +case ICE_TLV_ID_DSCP_TO_PFC : +ice_add_dscp_pfc_tlv (tlv, dcbcfg); +break ; +default : +break ; + } } }
drivers/net/ice/base/ice_dcb.h +16 -0
@@ -29,6 +29,13 @@#define ICE_CEE_DCBX_OUI 0x001B21#define ICE_CEE_DCBX_TYPE 2 +#define ICE_DSCP_OUI 0xFFFFFF +#define ICE_DSCP_SUBTYPE_DSCP2UP 0x41 +#define ICE_DSCP_SUBTYPE_ENFORCE 0x42 +#define ICE_DSCP_SUBTYPE_TCBW 0x43 +#define ICE_DSCP_SUBTYPE_PFC 0x44 +#define ICE_DSCP_IPV6_OFFSET 80 +#define ICE_CEE_SUBTYPE_CTRL 1#define ICE_CEE_SUBTYPE_PG_CFG 2#define ICE_CEE_SUBTYPE_PFC_CFG 3
@@ -97,11 +104,20 @@#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_TLV_ID_DSCP_UP 3 +#define ICE_TLV_ID_DSCP_ENF 4 +#define ICE_TLV_ID_DSCP_TC_BW 5 +#define ICE_TLV_ID_DSCP_TO_PFC 6#define ICE_IEEE_ETS_TLV_LEN 25#define ICE_IEEE_PFC_TLV_LEN 6#define ICE_IEEE_APP_TLV_LEN 11 +#define ICE_DSCP_UP_TLV_LEN 148 +#define ICE_DSCP_ENF_TLV_LEN 132 +#define ICE_DSCP_TC_BW_TLV_LEN 25 +#define ICE_DSCP_PFC_TLV_LEN 6 +#pragma pack(1)/* IEEE 802.1AB LLDP Organization specific TLV */ struct ice_lldp_org_tlv {
drivers/net/ice/base/ice_type.h +9 -1
@@ -797,7 +797,8 @@ struct ice_dcb_app_priority_table { };#define ICE_MAX_USER_PRIORITY 8 -#define ICE_DCBX_MAX_APPS 32 +#define ICE_DCBX_MAX_APPS 64 +#define ICE_DSCP_NUM_VAL 64#define ICE_LLDPDU_SIZE 1500#define ICE_TLV_STATUS_OPER 0x1#define ICE_TLV_STATUS_SYNC 0x2
@@ -817,7 +818,14 @@ struct ice_dcbx_cfg {struct ice_dcb_ets_cfg etscfg;struct ice_dcb_ets_cfg etsrec;struct ice_dcb_pfc_cfg pfc; +#define ICE_QOS_MODE_VLAN 0x0 +#define ICE_QOS_MODE_DSCP 0x1 +u8 pfc_mode;struct ice_dcb_app_priority_table app[ICE_DCBX_MAX_APPS ]; +/* when DSCP mapping defined by user set its bit to 1 */ +ice_declare_bitmap (dscp_mapped,ICE_DSCP_NUM_VAL ); +/* array holding DSCP -> UP/TC values for DSCP L3 QoS mode */ +u8 dscp_map[ICE_DSCP_NUM_VAL ];u8 dcbx_mode;#define ICE_DCBX_MODE_CEE 0x1#define ICE_DCBX_MODE_IEEE 0x2
Signature · 1 line
2.26.2
PATCH v2 5/6 net/ice/base: sign external device package programming
In reply to Qi ZhangExternal topology devices (e.g. PHYs) connected to 100G or to SoC that includes 100G IP might have a firmware engine within the device and the firmware is usually loaded from NVM connected to the topology device.
The topology device NVM images can be updated using SW tools but such solution poses a security risk if there is no validation of the integrity of an image before programming it to the device NVM. In order to prevent security risk, the topology device NVM image might be included as part of 100G NVM image. When the topology device NVM image is present in the 100G NVM image, it is authenticated and might be loaded to the topology device at startup or on command of SW using dedicated AQ.
This patch provides support for this functionality.
--- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++++---- drivers/net/ice/base/ice_common.c | 119 +++++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 +++ drivers/net/ice/base/ice_type.h | 13 +++ 4 files changed, 162 insertions(+), 19 deletions(-)
drivers/net/ice/base/ice_adminq_cmd.h +23 -16
@@ -113,6 +113,10 @@ struct ice_aqc_list_caps_elem {#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076#define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077#define ICE_AQC_CAPS_NVM_MGMT 0x0080 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG0 0x0081 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG1 0x0082 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG2 0x0083 +#define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG3 0x0084u8 major_ver;u8 minor_ver;
@@ -1614,7 +1618,7 @@ struct ice_aqc_set_mac_lb {u8 reserved[15 ]; }; -struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params {u8 lport_num;u8 lport_num_valid;#define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0)
@@ -1640,6 +1644,10 @@ struct ice_aqc_link_topo_addr {#define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4#define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5u8 index; +}; + +struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params topo_params;__le16 handle;#define ICE_AQC_LINK_TOPO_HANDLE_S 0#define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
@@ -1754,23 +1762,18 @@ struct ice_aqc_sw_gpio {u8 rsvd[12 ]; }; -/* Program topology device NVM (direct, 0x06F2) */ -struct ice_aqc_program_topology_device_nvm { -u8 lport_num; -u8 lport_num_valid; -u8 node_type_ctx; -u8 index; +/* Program Topology Device NVM (direct, 0x06F2) */ +struct ice_aqc_prog_topo_dev_nvm { +struct ice_aqc_link_topo_params topo_params;u8 rsvd[12 ]; }; -/* Read topology device NVM (indirect, 0x06F3) */ -struct ice_aqc_read_topology_device_nvm { -u8 lport_num; -u8 lport_num_valid; -u8 node_type_ctx; -u8 index; +/* Read Topology Device NVM (direct, 0x06F3) */ +struct ice_aqc_read_topo_dev_nvm { +struct ice_aqc_link_topo_params topo_params;__le32 start_address; -u8 data_read[8 ]; +#define ICE_AQC_READ_TOPO_DEV_NVM_DATA_READ_SIZE 8 +u8 data_read[ICE_AQC_READ_TOPO_DEV_NVM_DATA_READ_SIZE ]; };/* NVM Read command (indirect 0x0701)
@@ -2744,6 +2747,8 @@ struct ice_aqc_set_health_status_config {#define ICE_AQC_HEALTH_STATUS_ERR_LINK_HW_ACCESS 0x115#define ICE_AQC_HEALTH_STATUS_ERR_LINK_RUNTIME 0x116#define ICE_AQC_HEALTH_STATUS_ERR_DNL_INIT 0x117 +#define ICE_AQC_HEALTH_STATUS_ERR_PHY_NVM_PROG 0x120 +#define ICE_AQC_HEALTH_STATUS_ERR_PHY_FW_LOAD 0x121#define ICE_AQC_HEALTH_STATUS_INFO_RECOVERY 0x500#define ICE_AQC_HEALTH_STATUS_ERR_FLASH_ACCESS 0x501#define ICE_AQC_HEALTH_STATUS_ERR_NVM_AUTH 0x502
@@ -2946,6 +2951,8 @@ struct ice_aq_desc { get_supported_health_status_codes;struct ice_aqc_get_health_status get_health_status;struct ice_aqc_clear_health_status clear_health_status; +struct ice_aqc_prog_topo_dev_nvm prog_topo_dev_nvm; +struct ice_aqc_read_topo_dev_nvm read_topo_dev_nvm; } params; };
@@ -3122,8 +3129,8 @@ enum ice_adminq_opc { ice_aqc_opc_sff_eeprom =0x06EE , ice_aqc_opc_sw_set_gpio =0x06EF , ice_aqc_opc_sw_get_gpio =0x06F0 , - ice_aqc_opc_program_topology_device_nvm =0x06F2 , - ice_aqc_opc_read_topology_device_nvm =0x06F3 , + ice_aqc_opc_prog_topo_dev_nvm =0x06F2 , + ice_aqc_opc_read_topo_dev_nvm =0x06F3 ,/* NVM commands */ ice_aqc_opc_nvm_read = 0x0701,
drivers/net/ice/base/ice_common.c +116 -3
139 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +10 -0
@@ -187,6 +187,16 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, bool write, struct ice_sq_cd *cd); +enum ice_status +ice_aq_prog_topo_dev_nvm (struct ice_hw *hw, +struct ice_aqc_link_topo_params *topo_params, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_read_topo_dev_nvm (struct ice_hw *hw, +struct ice_aqc_link_topo_params *topo_params, +u32 start_address,u8 *buf,u8 buf_size, +struct ice_sq_cd *cd); +enum ice_status ice_get_ctx (u8 *src_ctx,u8 *dest_ctx,struct ice_ctx_ele *ce_info);enum ice_status
drivers/net/ice/base/ice_type.h +13 -0
@@ -449,6 +449,19 @@ struct ice_hw_common_caps {#define ICE_NVM_MGMT_SEC_REV_DISABLED BIT(0)#define ICE_NVM_MGMT_UPDATE_DISABLED BIT(1)#define ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT BIT(3) + +/* External topology device images within the NVM */ +#define ICE_EXT_TOPO_DEV_IMG_COUNT 4 +u32 ext_topo_dev_img_ver_high[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +u32 ext_topo_dev_img_ver_low[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +u8 ext_topo_dev_img_part_num[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_PART_NUM_S 8 +#define ICE_EXT_TOPO_DEV_IMG_PART_NUM_M \ + MAKEMASK(0xFF, ICE_EXT_TOPO_DEV_IMG_PART_NUM_S) +bool ext_topo_dev_img_load_en[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_LOAD_EN BIT(0) +bool ext_topo_dev_img_prog_en[ICE_EXT_TOPO_DEV_IMG_COUNT ]; +#define ICE_EXT_TOPO_DEV_IMG_PROG_EN BIT(1) };/* Function specific capabilities */
Signature · 1 line
2.26.2
PATCH v2 6/6 net/ice/base: support IP fragment RSS and FDIR
In reply to Qi ZhangAdd support for IP fragment RSS hash and FDIR function. Separate IP fragment and IP other packet types.
The patch also update the release date in README.
--- drivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_fdir.c | 49 ++++++++++++++++++++++++++++++- drivers/net/ice/base/ice_fdir.h | 4 +++ drivers/net/ice/base/ice_flow.c | 51 ++++++++++++++++++++++++++++++++- drivers/net/ice/base/ice_flow.h | 9 ++++-- drivers/net/ice/base/ice_type.h | 1 + 6 files changed, 110 insertions(+), 6 deletions(-)
drivers/net/ice/base/README +1 -1
@@ -6,7 +6,7 @@ Intel® ICE driver ================== This directory contains source code of FreeBSD ice driver of version -2021.01.20 released by the team which develops +2021.04.29 released by the team which develops basic drivers for any ice NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below
drivers/net/ice/base/ice_fdir.c +48 -1
73 lines not on this page · raw message
drivers/net/ice/base/ice_fdir.h +4 -0
@@ -42,10 +42,12 @@#define ICE_MAC_ETHTYPE_OFFSET 12#define ICE_IPV4_TOS_OFFSET 15 +#define ICE_IPV4_ID_OFFSET 18#define ICE_IPV4_TTL_OFFSET 22#define ICE_IPV6_TC_OFFSET 14#define ICE_IPV6_HLIM_OFFSET 21#define ICE_IPV6_PROTO_OFFSET 20 +#define ICE_IPV6_ID_OFFSET 58/* For TUN inner (without inner MAC) */ #define ICE_IPV4_NO_MAC_TOS_OFFSET 1#define ICE_IPV4_NO_MAC_TTL_OFFSET 8
@@ -158,6 +160,7 @@ struct ice_fdir_v4 {u8 ip_ver;u8 proto;u8 ttl; +__be16 packet_id; };#define ICE_IPV6_ADDR_LEN_AS_U32 4
@@ -172,6 +175,7 @@ struct ice_fdir_v6 {u8 tc;u8 proto;u8 hlim; +__be32 packet_id; };struct ice_fdir_udp_gtp {
drivers/net/ice/base/ice_flow.c +50 -1
99 lines not on this page · raw message
drivers/net/ice/base/ice_flow.h +6 -3
@@ -186,11 +186,12 @@ enum ice_flow_seg_hdr {ICE_FLOW_SEG_HDR_ECPRI_TP0 =0x04000000 ,ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0 =0x08000000 ,ICE_FLOW_SEG_HDR_L2TPV2 =0x10000000 , -ICE_FLOW_SEG_HDR_PPP =0x40000000 , +ICE_FLOW_SEG_HDR_PPP =0x20000000 ,/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and -* ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs +* ICE_FLOW_SEG_HDR_IPV6. */ - ICE_FLOW_SEG_HDR_IPV_OTHER = 0x20000000, +ICE_FLOW_SEG_HDR_IPV_FRAG =0x40000000 , + ICE_FLOW_SEG_HDR_IPV_OTHER = 0x80000000, };/* These segements all have the same PTYPES, but are otherwise distinguished by
@@ -227,6 +228,8 @@ enum ice_flow_field {ICE_FLOW_FIELD_IDX_IPV4_DA ,ICE_FLOW_FIELD_IDX_IPV6_SA ,ICE_FLOW_FIELD_IDX_IPV6_DA , +ICE_FLOW_FIELD_IDX_IPV4_ID , +ICE_FLOW_FIELD_IDX_IPV6_ID ,ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA ,ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA , ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA,
drivers/net/ice/base/ice_type.h +1 -0
@@ -347,6 +347,7 @@ enum ice_fltr_ptype {ICE_FLTR_PTYPE_NONF_ECPRI_TP0 ,ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0 ,ICE_FLTR_PTYPE_FRAG_IPV4 , +ICE_FLTR_PTYPE_FRAG_IPV6 ,ICE_FLTR_PTYPE_NONF_IPV6_UDP ,ICE_FLTR_PTYPE_NONF_IPV6_TCP , ICE_FLTR_PTYPE_NONF_IPV6_SCTP,
Signature · 1 line
2.26.2
Zhang, Qi Z
AppliedRe: [dpdk-dev] [PATCH v2 0/6] net/ice: base update update batch 3
In reply to Qi ZhangQuoted 44 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Friday, April 30, 2021 9:59 PM
To: Yigit, Ferruh <[email protected]>
Cc: Yang, Qiming <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2 0/6] net/ice: base update update batch 3Add IP fragment support in base code and couple QinQ improvement. update the release date as the last base patch for DPDK 21.05.
v2:
- fix compile error in patch 2/6
- wrap long strin gin patch 3/6
- fix typo in patch 4/6
- fix title convetion in patch 4/6 and 5/6Qi Zhang (6):
net/ice/base: add IP fragment flags
net/ice/base: add function for post DDP download VLAN mode
configuration
net/ice/base: add print if DDP/FW don't support QinQ as expectednet/ice/base: support L3 DSCP QoS
net/ice/base: sign external device package programmingnet/ice/base: support IP fragment RSS and FDIRdrivers/net/ice/base/README | 2 +- drivers/net/ice/base/ice_adminq_cmd.h | 39 +++--- drivers/net/ice/base/ice_common.c | 119 ++++++++++++++++- drivers/net/ice/base/ice_common.h | 10 ++ drivers/net/ice/base/ice_dcb.c | 185 +++++++++++++++++++++++--- drivers/net/ice/base/ice_dcb.h | 16 +++ drivers/net/ice/base/ice_fdir.c | 51 ++++++- drivers/net/ice/base/ice_fdir.h | 20 ++- drivers/net/ice/base/ice_flex_pipe.c | 5 +- drivers/net/ice/base/ice_flow.c | 51 ++++++- drivers/net/ice/base/ice_flow.h | 9 +- drivers/net/ice/base/ice_type.h | 24 +++- drivers/net/ice/base/ice_vlan_mode.c | 100 ++++++++++++-- drivers/net/ice/base/ice_vlan_mode.h | 2 +- 14 files changed, 568 insertions(+), 65 deletions(-)
Quoted 2 lines
--
2.26.2
Applied to dpdk-next-net-intel.
Thanks
Qi