ice: base code update batch 2
cover ice: base code update batch 2
Qi Zhang (8):
net/ice/base: code cleanup
net/ice/base: support removing VSI from flow profile net/ice/base: print link configure error net/ice/base: remove unused ptype field in PTT definition net/ice/base: set MAC type for E823C device net/ice/base: change protocol ID for VLAN in case of DVM net/ice/base: enable I2C read/write commands net/ice/base: add RSS support for PPPoL2TPv2oUDP
drivers/net/ice/base/ice_adminq_cmd.h | 29 ++++++ drivers/net/ice/base/ice_common.c | 104 +++++++++++++++++++- drivers/net/ice/base/ice_common.h | 8 ++ drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 4 +- drivers/net/ice/base/ice_flow.c | 120 ++++++++++++++++++++--- drivers/net/ice/base/ice_flow.h | 4 + drivers/net/ice/base/ice_lan_tx_rx.h | 10 +- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_sched.c | 11 +-- drivers/net/ice/base/ice_switch.c | 34 +++++-- drivers/net/ice/base/ice_switch.h | 1 + drivers/net/ice/base/ice_type.h | 2 - drivers/net/ice/base/ice_vlan_mode.c | 3 +- 15 files changed, 289 insertions(+), 46 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/8 net/ice/base: code cleanup
1. There are a lots of function header mismatch its function name.
2. remove unnecessary header file include.
3. remove unnecessary macro.
4. remove unnecessary comment.
--- drivers/net/ice/base/ice_common.c | 4 ++-- drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 1 - drivers/net/ice/base/ice_sched.c | 11 +++++------ drivers/net/ice/base/ice_switch.c | 15 +++++++-------- drivers/net/ice/base/ice_type.h | 2 -- drivers/net/ice/base/ice_vlan_mode.c | 3 +-- 8 files changed, 17 insertions(+), 23 deletions(-)
drivers/net/ice/base/ice_common.c +2 -2
@@ -638,7 +638,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) }/** -* ice_cleanup_all_fltr_mgmt - cleanup filter management list and locks +* ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks * @hw: pointer to the HW struct */ void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw)
@@ -4903,7 +4903,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, }/** -* ice_fw_supports_lldp_fltr - check NVM version supports lldp_fltr_ctrl +* ice_fw_supports_lldp_fltr_ctrl - check NVM version supports lldp_fltr_ctrl * @hw: pointer to HW struct */ bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw)
drivers/net/ice/base/ice_dcb.c +1 -1
@@ -857,7 +857,7 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, }/** -* ice_get_ieee_dcb_cfg +* ice_get_ieee_or_cee_dcb_cfg * @pi: port information structure * @dcbx_mode: mode of DCBX (IEEE or CEE) *
drivers/net/ice/base/ice_fdir.c +1 -1
@@ -1845,7 +1845,7 @@ bool ice_fdir_has_frag(enum ice_fltr_ptype flow) }/** -* ice_fdir_find_by_idx - find filter with idx +* ice_fdir_find_fltr_by_idx - find filter with idx * @hw: pointer to hardware structure * @fltr_idx: index to find. *
drivers/net/ice/base/ice_flex_pipe.c +0 -1
@@ -357,7 +357,6 @@ ice_marker_ptype_tcam_handler(u32 sect_type, void *section, u32 index,if (sect_type !=ICE_SID_RXPARSER_MARKER_PTYPE )return NULL ; -/* cppcheck-suppress nullPointer */ if (index >ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF )return NULL ;
drivers/net/ice/base/ice_sched.c +5 -6
@@ -1984,7 +1984,7 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs, }/** -* ice_sched_rm_agg_vsi_entry - remove aggregator related VSI info entry +* ice_sched_rm_agg_vsi_info - remove aggregator related VSI info entry * @pi: port information structure * @vsi_handle: software VSI handle *
@@ -3360,7 +3360,7 @@ ice_cfg_vsi_bw_lmt_per_tc(struct ice_port_info *pi, u16 vsi_handle, u8 tc, }/** -* ice_cfg_dflt_vsi_bw_lmt_per_tc - configure default VSI BW limit per TC +* ice_cfg_vsi_bw_dflt_lmt_per_tc - configure default VSI BW limit per TC * @pi: port information structure * @vsi_handle: software VSI handle * @tc: traffic class
@@ -3515,7 +3515,7 @@ ice_cfg_agg_bw_no_shared_lmt(struct ice_port_info *pi, u32 agg_id) }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_shared_lmt_per_tc - config aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3535,7 +3535,7 @@ ice_cfg_agg_bw_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc, }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_no_shared_lmt_per_tc - cfg aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3553,7 +3553,7 @@ ice_cfg_agg_bw_no_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc) }/** -* ice_config_vsi_queue_priority - config VSI queue priority of node +* ice_cfg_vsi_q_priority - config VSI queue priority of node * @pi: port information structure * @num_qs: number of VSI queues * @q_ids: queue IDs array
@@ -3649,7 +3649,6 @@ ice_cfg_agg_vsi_priority_per_tc(struct ice_port_info *pi, u32 agg_id,LIST_FOR_EACH_ENTRY (agg_vsi_info, &agg_info->agg_vsi_list, ice_sched_agg_vsi_info, list_entry)if (agg_vsi_info->vsi_handle == vsi_handle) { -/* cppcheck-suppress unreadVariable */ vsi_handle_valid = true;break ; }
drivers/net/ice/base/ice_switch.c +7 -8
@@ -2298,7 +2298,7 @@ enum ice_status ice_alloc_rss_global_lut(struct ice_hw *hw, bool shared_res, u16 }/** -* ice_free_global_lut - free a RSS global LUT +* ice_free_rss_global_lut - free a RSS global LUT * @hw: pointer to the HW struct * @global_lut_id: ID of the RSS global LUT to free */
@@ -3174,7 +3174,6 @@ ice_aq_get_recipe(struct ice_hw *hw, buf_size = *num_recipes *sizeof (*s_recipe_list); status =ice_aq_send_cmd (hw, &desc, s_recipe_list, buf_size, cd); -/* cppcheck-suppress constArgument */ *num_recipes =LE16_TO_CPU (cmd->num_sub_recipes);return status;
@@ -4979,7 +4978,7 @@ enum ice_status ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list) }/** -* ice_add_mac_vlan - Add MAC and VLAN pair based filter rule +* ice_add_mac_vlan_rule - Add MAC and VLAN pair based filter rule * @hw: pointer to the hardware structure * @mv_list: list of MAC and VLAN filters * @sw: pointer to switch info struct for which function add rule
@@ -5671,7 +5670,7 @@ ice_get_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 *promisc_mask, }/** -* ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI +* _ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI * @hw: pointer to the hardware structure * @vsi_handle: VSI handle to retrieve info from * @promisc_mask: pointer to mask to be filled in
@@ -6664,7 +6663,7 @@ static bool ice_prot_type_to_id(enum ice_protocol_type type, u8 *id) }/** -* ice_find_valid_words - count valid words +* ice_fill_valid_words - count valid words * @rule: advanced rule with lookup information * @lkup_exts: byte offset extractions of the words that are valid *
@@ -7263,7 +7262,7 @@ ice_get_fv(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }/** -* ice_tun_type_match_mask - determine if tun type needs a match mask +* ice_tun_type_match_word - determine if tun type needs a match mask * @tun_type: tunnel type * @mask: mask to be used for the tunnel */
@@ -8860,7 +8859,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw, }/** -* ice_rem_adv_for_vsi - removes existing advanced switch rules for a +* ice_rem_adv_rule_for_vsi - removes existing advanced switch rules for a * given VSI handle * @hw: pointer to the hardware structure * @vsi_handle: VSI handle for which we are supposed to remove all the rules.
@@ -9142,7 +9141,7 @@ ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi, }/** -* ice_rm_all_sw_replay_rule - helper function to delete filter replay rules +* ice_rm_sw_replay_rule_info - helper function to delete filter replay rules * @hw: pointer to the HW struct * @sw: pointer to switch info struct for which function removes filters *
drivers/net/ice/base/ice_type.h +0 -2
@@ -44,9 +44,7 @@#define ice_struct_size (ptr, field, num) \ (sizeof(*(ptr)) + sizeof(*(ptr)->field) * (num)) -#ifndef FLEX_ARRAY_SIZE #define FLEX_ARRAY_SIZE (_ptr, _mem, cnt) ((cnt) * sizeof(_ptr->_mem[0])) -#endif /* FLEX_ARRAY_SIZE */ #include "ice_status.h" #include "ice_hw_autogen.h"
drivers/net/ice/base/ice_vlan_mode.c +1 -2
@@ -2,11 +2,10 @@* Copyright(c) 2001-2021 Intel Corporation */ -#include "ice_vlan_mode.h" #include "ice_common.h" /** -* ice_pkg_supports_dvm - determine if DDP supports Double VLAN mode (DVM) +* ice_pkg_get_supported_vlan_mode - chk if DDP supports Double VLAN mode (DVM) * @hw: pointer to the HW struct * @dvm: output variable to determine if DDP supports DVM(true) or SVM(false) */
Signature · 1 line
2.26.2
PATCH 2/8 net/ice/base: support removing VSI from flow profile
In reply to Qi ZhangAdding a function ice_flow_rem_vsi_prof() to remove flow entries associated to the sw vsi handle. Once complete clear the vsi index from the flow profile bitmap. This will ensure that the a vsi once removed can be re-added and the package block rules will be added again.
--- drivers/net/ice/base/ice_flow.c | 55 +++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_flow.h | 2 ++ 2 files changed, 57 insertions(+)
drivers/net/ice/base/ice_flow.c +55 -0
@@ -3295,6 +3295,61 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, seg->raws_cnt++; } +/** +* ice_flow_rem_vsi_prof - remove vsi from flow profile +* @hw: pointer to the hardware structure +* @blk: classification stage +* @vsi_handle: software VSI handle +* @prof_id: unique ID to identify this flow profile +* +* This function removes the flow entries associated to the input +* vsi handle and disassociates the vsi from the flow profile. +*/ +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk,u16 vsi_handle, +u64 prof_id) +{ +struct ice_flow_prof *prof =NULL ; +enum ice_status status =ICE_SUCCESS ; + +if (blk >=ICE_BLK_COUNT || !ice_is_vsi_valid (hw, vsi_handle)) +return ICE_ERR_PARAM ; + +/* find flow profile pointer with input package block and profile id */ + prof =ice_flow_find_prof_id (hw,ICE_BLK_FD , prof_id); +if (!prof) { +ice_debug (hw,ICE_DBG_PKG , +"Cannot find flow profile id=%lu\n" , prof_id); +return ICE_ERR_DOES_NOT_EXIST ; + } + +/* Remove all remaining flow entries before removing the flow profile */ +if (!LIST_EMPTY (&prof->entries)) { +struct ice_flow_entry *e, *t; + +ice_acquire_lock (&prof->entries_lock); +LIST_FOR_EACH_ENTRY_SAFE (e, t, &prof->entries, ice_flow_entry, + l_entry) { +if (e->vsi_handle != vsi_handle) +continue ; + + status =ice_flow_rem_entry_sync (hw, blk, e); +if (status) +break ; + } +ice_release_lock (&prof->entries_lock); + } +if (status) +return status; + +/* disassociate the flow profile from sw vsi handle */ + status =ice_flow_disassoc_prof (hw, blk, prof, vsi_handle); +if (status) +ice_debug (hw,ICE_DBG_PKG , +"ice_flow_disassoc_prof() failed with status=%d\n" , + status); +return status; +} +#define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \ (ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
drivers/net/ice/base/ice_flow.h +2 -0
@@ -553,6 +553,8 @@ ice_flow_set_fld_prefix(struct ice_flow_seg_info *seg, enum ice_flow_field fld,void ice_flow_add_fld_raw (struct ice_flow_seg_info *seg,u16 off,u8 len,u16 val_loc,u16 mask_loc); +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk, +u16 vsi_handle,u64 prof_id);void ice_rem_vsi_rss_list (struct ice_hw *hw,u16 vsi_handle);enum ice_status ice_replay_rss_cfg (struct ice_hw *hw,u16 vsi_handle);enum ice_status
Signature · 1 line
2.26.2
PATCH 3/8 net/ice/base: print link configure error
In reply to Qi ZhangNewer NVMs return link_cfg_err for get_link_status AQ. Print it for debug use.
--- drivers/net/ice/base/ice_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/base/ice_common.c +1 -0
@@ -460,6 +460,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, (unsigned long long)li->phy_type_high);ice_debug (hw,ICE_DBG_LINK ," media_type = 0x%x\n" , *hw_media_type);ice_debug (hw,ICE_DBG_LINK ," link_info = 0x%x\n" , li->link_info); +ice_debug (hw,ICE_DBG_LINK ," link_cfg_err = 0x%x\n" , li->link_cfg_err);ice_debug (hw,ICE_DBG_LINK ," an_info = 0x%x\n" , li->an_info);ice_debug (hw,ICE_DBG_LINK ," ext_info = 0x%x\n" , li->ext_info);ice_debug (hw,ICE_DBG_LINK ," fec_info = 0x%x\n" , li->fec_info);
Signature · 1 line
2.26.2
PATCH 4/8 net/ice/base: remove unused ptype field in PTT definition
In reply to Qi ZhangRemove the unused ptype entry, and use the gcc extension for ranged initializers in arrays for Linux, and explicitly target each table entry by index when initializing under Linux.
--- drivers/net/ice/base/ice_lan_tx_rx.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_lan_tx_rx.h +4 -6
@@ -296,7 +296,6 @@ enum ice_rx_l2_ptype { };struct ice_rx_ptype_decoded { -u32 ptype:10 ;u32 known:1 ;u32 outer_ip:1 ;u32 outer_ip_ver:2 ;
@@ -1217,8 +1216,7 @@ struct ice_tx_drbell_q_ctx {/* macro to make the table lines short */ #define ICE_PTT (PTYPE ,OUTER_IP ,OUTER_IP_VER ,OUTER_FRAG ,T ,TE ,TEF ,I ,PL )\ - { PTYPE, \ - 1, \ + { 1, \ ICE_RX_PTYPE_OUTER_##OUTER_IP, \ ICE_RX_PTYPE_OUTER_##OUTER_IP_VER, \ ICE_RX_PTYPE_##OUTER_FRAG, \
@@ -1228,14 +1226,14 @@ struct ice_tx_drbell_q_ctx { ICE_RX_PTYPE_INNER_PROT_##I, \ ICE_RX_PTYPE_PAYLOAD_LAYER_##PL } -#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { PTYPE, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { 0, 0, 0, 0, 0, 0, 0, 0, 0 }/* shorter macros makes the table fit but are terse */ #define ICE_RX_PTYPE_NOF ICE_RX_PTYPE_NOT_FRAG#define ICE_RX_PTYPE_FRG ICE_RX_PTYPE_FRAG -/* Lookup table mapping the HW PTYPE to the bit field for decoding */ -static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = { +/* Lookup table mapping the 10-bit HW PTYPE to the bit field for decoding */ +static const struct ice_rx_ptype_decoded ice_ptype_lkup[1024 ] = {/* L2 Packet types */ ICE_PTT_UNUSED_ENTRY (0 ),ICE_PTT (1 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,PAY2 ),
Signature · 1 line
2.26.2
PATCH 5/8 net/ice/base: set MAC type for E823C device
In reply to Qi ZhangSet E823C device's MAC type as generic.
--- drivers/net/ice/base/ice_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/base/ice_common.c +5 -0
@@ -48,6 +48,11 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)case ICE_DEV_ID_E823L_BACKPLANE :case ICE_DEV_ID_E823L_QSFP :case ICE_DEV_ID_E823L_SFP : +case ICE_DEV_ID_E823C_10G_BASE_T : +case ICE_DEV_ID_E823C_BACKPLANE : +case ICE_DEV_ID_E823C_QSFP : +case ICE_DEV_ID_E823C_SFP : +case ICE_DEV_ID_E823C_SGMII : hw->mac_type =ICE_MAC_GENERIC ;break ;default :
Signature · 1 line
2.26.2
PATCH 6/8 net/ice/base: change protocol ID for VLAN in case of DVM
In reply to Qi ZhangProtocol id for first vlan in Double VLAN Mode (DVM) should be ICE_VLAN_OF_HW = 16, but for Single VLAN Mode (SVM) this should be ICE_VLAN_OL_HW = 17.
Change protocol id in type to id translation array for outer vlan to 17 when DVM is enabled, which means the driver, package, and firmware support DVM.
--- drivers/net/ice/base/ice_flex_pipe.c | 3 +++ drivers/net/ice/base/ice_switch.c | 19 ++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_pipe.c +3 -0
@@ -1244,6 +1244,9 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg)ice_cache_vlan_mode (hw); +if (ice_is_dvm_ena (hw)) +ice_change_proto_id_to_dvm (); +return status; }
drivers/net/ice/base/ice_switch.c +18 -1
@@ -6538,7 +6538,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {* following policy. */ -static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { +static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { {ICE_MAC_OFOS ,ICE_MAC_OFOS_HW }, {ICE_MAC_IL ,ICE_MAC_IL_HW }, {ICE_ETYPE_OL ,ICE_ETYPE_OL_HW },
@@ -6643,6 +6643,23 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,return ICE_MAX_NUM_RECIPES ; } +/** +* ice_change_proto_id_to_dvm - change proto id in prot_id_tbl +* +* As protocol id for outer vlan is different in dvm and svm, if dvm is +* supported protocol array record for outer vlan has to be modified to +* reflect the value proper for DVM. +*/ +void ice_change_proto_id_to_dvm (void ) +{ +u8 i; + +for (i =0 ; i <ARRAY_SIZE (ice_prot_id_tbl); i++) +if (ice_prot_id_tbl[i].type ==ICE_VLAN_OFOS && + ice_prot_id_tbl[i].protocol_id !=ICE_VLAN_OF_HW ) + ice_prot_id_tbl[i].protocol_id =ICE_VLAN_OF_HW ; +} +/** * ice_prot_type_to_id - get protocol ID from protocol type * @type: protocol type
drivers/net/ice/base/ice_switch.h +1 -0
@@ -535,4 +535,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type);enum ice_status ice_update_recipe_lkup_idx (struct ice_hw *hw,struct ice_update_recipe_lkup_idx_params *params); +void ice_change_proto_id_to_dvm (void );#endif /* _ICE_SWITCH_H_ */
Signature · 1 line
2.26.2
PATCH 7/8 net/ice/base: enable I2C read/write commands
In reply to Qi ZhangEnable I2C read/write AQ commands. They are now required for controlling the external physical connectors via external I2C port expander on E810-T adapters.
--- drivers/net/ice/base/ice_adminq_cmd.h | 29 +++++++++ drivers/net/ice/base/ice_common.c | 94 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 8 +++ 3 files changed, 131 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +29 -0
@@ -1665,6 +1665,31 @@ struct ice_aqc_get_link_topo {u8 rsvd[9 ]; }; +/* Read/Write I2C (direct, 0x06E2/0x06E3) */ +struct ice_aqc_i2c { +struct ice_aqc_link_topo_addr topo_addr; +__le16 i2c_addr; +u8 i2c_params; +#define ICE_AQC_I2C_DATA_SIZE_S 0 +#define ICE_AQC_I2C_DATA_SIZE_M (0xF << ICE_AQC_I2C_DATA_SIZE_S) +#define ICE_AQC_I2C_ADDR_TYPE_M BIT(4) +#define ICE_AQC_I2C_ADDR_TYPE_7BIT 0 +#define ICE_AQC_I2C_ADDR_TYPE_10BIT ICE_AQC_I2C_ADDR_TYPE_M +#define ICE_AQC_I2C_DATA_OFFSET_S 5 +#define ICE_AQC_I2C_DATA_OFFSET_M (0x3 << ICE_AQC_I2C_DATA_OFFSET_S) +#define ICE_AQC_I2C_USE_REPEATED_START BIT(7) +u8 rsvd; +__le16 i2c_bus_addr; +#define ICE_AQC_I2C_ADDR_7BIT_MASK 0x7F +#define ICE_AQC_I2C_ADDR_10BIT_MASK 0x3FF +u8 i2c_data[4 ];/* Used only by write command, reserved in read. */ +}; + +/* Read I2C Response (direct, 0x06E2) */ +struct ice_aqc_read_i2c_resp { +u8 i2c_data[16 ]; +}; +/* Set Port Identification LED (direct, 0x06E9) */ struct ice_aqc_set_port_id_led {u8 lport_num;
@@ -2838,6 +2863,8 @@ struct ice_aq_desc {struct ice_aqc_get_phy_caps get_phy;struct ice_aqc_set_phy_cfg set_phy;struct ice_aqc_restart_an restart_an; +struct ice_aqc_i2c read_write_i2c; +struct ice_aqc_read_i2c_resp read_i2c_resp;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led;struct ice_aqc_get_sw_cfg get_sw_conf;
@@ -3074,6 +3101,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_event_mask =0x0613 , ice_aqc_opc_set_mac_lb =0x0620 , ice_aqc_opc_get_link_topo =0x06E0 , + ice_aqc_opc_read_i2c =0x06E2 , + ice_aqc_opc_write_i2c =0x06E3 , ice_aqc_opc_set_port_id_led =0x06E9 , ice_aqc_opc_get_port_options =0x06EA , ice_aqc_opc_set_port_option = 0x06EB,
drivers/net/ice/base/ice_common.c +94 -0
100 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +8 -0
@@ -225,5 +225,13 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw);enum ice_status ice_lldp_fltr_add_remove (struct ice_hw *hw,u16 vsi_num,bool add); +enum ice_status +ice_aq_read_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_write_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd);bool ice_fw_supports_report_dflt_cfg (struct ice_hw *hw);#endif /* _ICE_COMMON_H_ */
Signature · 1 line
2.26.2
PATCH 8/8 net/ice/base: add RSS support for PPPoL2TPv2oUDP
In reply to Qi ZhangAdd support for PPPoL2TPv2oUDP RSS hash. L2TPv2 and PPP ptypes and flow headers are added. Prot id for PPP is added.
--- drivers/net/ice/base/ice_flow.c | 65 ++++++++++++++++++------ drivers/net/ice/base/ice_flow.h | 2 + drivers/net/ice/base/ice_protocol_type.h | 1 + 3 files changed, 52 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_flow.c +49 -16
@@ -212,7 +212,7 @@ static const u32 ice_ptypes_mac_ofos[] = {0xFDC00846 ,0xBFBF7F7E ,0xF70001DF ,0xFEFDFDFB ,0x0000077E ,0x000003FF ,0x00000000 ,0x00000000 ,0x00400000 ,0x03FFF000 ,0xFFFFFFE0 ,0x00100707 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -238,7 +238,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x000002A0 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -252,7 +252,7 @@ static const u32 ice_ptypes_ipv4_ofos_all[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x83E0FAA0 ,0x00000101 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03FFD500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -264,7 +264,7 @@ static const u32 ice_ptypes_ipv4_il[] = {0xE0000000 ,0xB807700E ,0x80000003 ,0xE01DC03B ,0x0000000E ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x001FF800 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC0FC000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -278,7 +278,7 @@ static const u32 ice_ptypes_ipv6_ofos[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -292,7 +292,7 @@ static const u32 ice_ptypes_ipv6_ofos_all[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x7C1F0540 ,0x00000206 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC002A00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -304,7 +304,7 @@ static const u32 ice_ptypes_ipv6_il[] = {0x00000000 ,0x03B80770 ,0x000001DC ,0x0EE00000 ,0x00000770 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x7FE00000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03F00000 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -316,7 +316,7 @@ static const u32 ice_ptypes_ipv4_ofos_no_l4[] = {0x10C00000 ,0x04000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000cc000 ,0x000002A0 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -328,7 +328,7 @@ static const u32 ice_ptypes_ipv4_il_no_l4[] = {0x60000000 ,0x18043008 ,0x80000002 ,0x6010c021 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00139800 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x8C08C000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -340,7 +340,7 @@ static const u32 ice_ptypes_ipv6_ofos_no_l4[] = {0x00000000 ,0x00000000 ,0x43000000 ,0x10002000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x02300000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -352,7 +352,7 @@ static const u32 ice_ptypes_ipv6_il_no_l4[] = {0x00000000 ,0x02180430 ,0x0000010c ,0x086010c0 ,0x00000430 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x4e600000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x02300000 ,0x00000023 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -378,7 +378,7 @@ static const u32 ice_ptypes_udp_il[] = {0x81000000 ,0x20204040 ,0x04000010 ,0x80810102 ,0x00000040 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00410000 ,0x908427E0 ,0x00100007 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x10410000 ,0x00000004 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -390,7 +390,7 @@ static const u32 ice_ptypes_tcp_il[] = {0x04000000 ,0x80810102 ,0x10000040 ,0x02040408 ,0x00000102 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00820000 ,0x21084000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x20820000 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -402,7 +402,7 @@ static const u32 ice_ptypes_sctp_il[] = {0x08000000 ,0x01020204 ,0x20000081 ,0x04080810 ,0x00000204 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x01040000 ,0x00000000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x41040000 ,0x00000010 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -426,7 +426,7 @@ static const u32 ice_ptypes_icmp_il[] = {0x00000000 ,0x02040408 ,0x40000102 ,0x08101020 ,0x00000408 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x42108000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x82080000 ,0x00000020 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -725,6 +725,28 @@ static const u32 ice_ptypes_udp_ecpri_tp0[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +static const u32 ice_ptypes_l2tpv2[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; + +static const u32 ice_ptypes_ppp[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFF000 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; +/* Manage parameters and info. used during the creation of a flow profile */ struct ice_flow_prof_params {enum ice_block blk;
@@ -750,7 +772,8 @@ struct ice_flow_prof_params {ICE_FLOW_SEG_HDR_PFCP_SESSION |ICE_FLOW_SEG_HDR_L2TPV3 | \ICE_FLOW_SEG_HDR_ESP |ICE_FLOW_SEG_HDR_AH | \ICE_FLOW_SEG_HDR_NAT_T_ESP |ICE_FLOW_SEG_HDR_GTPU_NON_IP | \ - ICE_FLOW_SEG_HDR_ECPRI_TP0 | ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0) +ICE_FLOW_SEG_HDR_ECPRI_TP0 |ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0 | \ + ICE_FLOW_SEG_HDR_L2TPV2 | ICE_FLOW_SEG_HDR_PPP) #define ICE_FLOW_SEG_HDRS_L2_MASK \ (ICE_FLOW_SEG_HDR_ETH |ICE_FLOW_SEG_HDR_VLAN )
@@ -1006,6 +1029,10 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)/* Attributes for GTP packet without Extension Header */ params->attr = ice_attr_gtpu_session; params->attr_cnt =ARRAY_SIZE (ice_attr_gtpu_session); + }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV2 ) { + src = (const ice_bitmap_t *)ice_ptypes_l2tpv2; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV3 ) { src = (const ice_bitmap_t *)ice_ptypes_l2tpv3; ice_and_bitmap(params->ptypes, params->ptypes,
@@ -1032,6 +1059,12 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) src, ICE_FLOW_PTYPE_MAX); } +if (hdrs &ICE_FLOW_SEG_HDR_PPP ) { + src = (const ice_bitmap_t *)ice_ptypes_ppp; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); + } +if (hdrs &ICE_FLOW_SEG_HDR_PFCP ) {if (hdrs &ICE_FLOW_SEG_HDR_PFCP_NODE ) src =
drivers/net/ice/base/ice_flow.h +2 -0
@@ -185,6 +185,8 @@ enum ice_flow_seg_hdr {ICE_FLOW_SEG_HDR_VXLAN =0x02000000 ,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 ,/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs */
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -154,6 +154,7 @@ enum ice_prot_id {ICE_PROT_PPPOE =103 ,ICE_PROT_L2TPV3 =104 ,ICE_PROT_ECPRI =105 , +ICE_PROT_PPP =106 ,ICE_PROT_ATAOE_OF =114 ,ICE_PROT_CTRL_OF =116 , ICE_PROT_LLDP_OF = 117,
Signature · 1 line
2.26.2
v2 cover base code update batch 2
In reply to Qi Zhangv2:
- Added patch 9/14 - 14/14.
Qi Zhang (14):
net/ice/base: code cleanup
net/ice/base: support removing VSI from flow profile net/ice/base: print link configure error net/ice/base: remove unused ptype field in PTT definition net/ice/base: set MAC type for E823C device net/ice/base: change protocol ID for VLAN in case of DVM net/ice/base: enable I2C read/write commands net/ice/base: add RSS support for PPPoL2TPv2oUDP net/ice/base: add set/get GPIO helper functions net/ice/base: add priority check of matching recipe net/ice/base: add inner VLAN protocol type for QinQ filter net/ice/base: fix QinQ PPPoE dummy pkt selection net/ice/base: add PTYPE values for PPPoL2TPv2oUDP net/ice/base: allow support for GTP-U filter using only inner
protocols
drivers/net/ice/base/ice_adminq_cmd.h | 40 ++++++ drivers/net/ice/base/ice_common.c | 162 ++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 14 ++ drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 4 +- drivers/net/ice/base/ice_flex_type.h | 31 ++++- drivers/net/ice/base/ice_flow.c | 120 ++++++++++++++--- drivers/net/ice/base/ice_flow.h | 4 + drivers/net/ice/base/ice_lan_tx_rx.h | 10 +- drivers/net/ice/base/ice_protocol_type.h | 4 + drivers/net/ice/base/ice_sched.c | 11 +- drivers/net/ice/base/ice_switch.c | 77 +++++++---- drivers/net/ice/base/ice_switch.h | 1 + drivers/net/ice/base/ice_type.h | 2 - drivers/net/ice/base/ice_vlan_mode.c | 3 +- drivers/net/ice/base/ice_vlan_mode.h | 1 - 17 files changed, 424 insertions(+), 64 deletions(-)
Signature · 1 line
2.26.2
PATCH v2 1/14 net/ice/base: code cleanup
1. There are a lots of function header mismatch its function name.
2. remove unnecessary header file include.
3. remove unnecessary macro.
4. remove unnecessary comment.
--- drivers/net/ice/base/ice_common.c | 4 ++-- drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 1 - drivers/net/ice/base/ice_sched.c | 11 +++++------ drivers/net/ice/base/ice_switch.c | 15 +++++++-------- drivers/net/ice/base/ice_type.h | 2 -- drivers/net/ice/base/ice_vlan_mode.c | 3 +-- drivers/net/ice/base/ice_vlan_mode.h | 1 - 9 files changed, 17 insertions(+), 24 deletions(-)
drivers/net/ice/base/ice_common.c +2 -2
@@ -638,7 +638,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) }/** -* ice_cleanup_all_fltr_mgmt - cleanup filter management list and locks +* ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks * @hw: pointer to the HW struct */ void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw)
@@ -4903,7 +4903,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, }/** -* ice_fw_supports_lldp_fltr - check NVM version supports lldp_fltr_ctrl +* ice_fw_supports_lldp_fltr_ctrl - check NVM version supports lldp_fltr_ctrl * @hw: pointer to HW struct */ bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw)
drivers/net/ice/base/ice_dcb.c +1 -1
@@ -857,7 +857,7 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, }/** -* ice_get_ieee_dcb_cfg +* ice_get_ieee_or_cee_dcb_cfg * @pi: port information structure * @dcbx_mode: mode of DCBX (IEEE or CEE) *
drivers/net/ice/base/ice_fdir.c +1 -1
@@ -1845,7 +1845,7 @@ bool ice_fdir_has_frag(enum ice_fltr_ptype flow) }/** -* ice_fdir_find_by_idx - find filter with idx +* ice_fdir_find_fltr_by_idx - find filter with idx * @hw: pointer to hardware structure * @fltr_idx: index to find. *
drivers/net/ice/base/ice_flex_pipe.c +0 -1
@@ -357,7 +357,6 @@ ice_marker_ptype_tcam_handler(u32 sect_type, void *section, u32 index,if (sect_type !=ICE_SID_RXPARSER_MARKER_PTYPE )return NULL ; -/* cppcheck-suppress nullPointer */ if (index >ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF )return NULL ;
drivers/net/ice/base/ice_sched.c +5 -6
@@ -1984,7 +1984,7 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs, }/** -* ice_sched_rm_agg_vsi_entry - remove aggregator related VSI info entry +* ice_sched_rm_agg_vsi_info - remove aggregator related VSI info entry * @pi: port information structure * @vsi_handle: software VSI handle *
@@ -3360,7 +3360,7 @@ ice_cfg_vsi_bw_lmt_per_tc(struct ice_port_info *pi, u16 vsi_handle, u8 tc, }/** -* ice_cfg_dflt_vsi_bw_lmt_per_tc - configure default VSI BW limit per TC +* ice_cfg_vsi_bw_dflt_lmt_per_tc - configure default VSI BW limit per TC * @pi: port information structure * @vsi_handle: software VSI handle * @tc: traffic class
@@ -3515,7 +3515,7 @@ ice_cfg_agg_bw_no_shared_lmt(struct ice_port_info *pi, u32 agg_id) }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_shared_lmt_per_tc - config aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3535,7 +3535,7 @@ ice_cfg_agg_bw_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc, }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_no_shared_lmt_per_tc - cfg aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3553,7 +3553,7 @@ ice_cfg_agg_bw_no_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc) }/** -* ice_config_vsi_queue_priority - config VSI queue priority of node +* ice_cfg_vsi_q_priority - config VSI queue priority of node * @pi: port information structure * @num_qs: number of VSI queues * @q_ids: queue IDs array
@@ -3649,7 +3649,6 @@ ice_cfg_agg_vsi_priority_per_tc(struct ice_port_info *pi, u32 agg_id,LIST_FOR_EACH_ENTRY (agg_vsi_info, &agg_info->agg_vsi_list, ice_sched_agg_vsi_info, list_entry)if (agg_vsi_info->vsi_handle == vsi_handle) { -/* cppcheck-suppress unreadVariable */ vsi_handle_valid = true;break ; }
drivers/net/ice/base/ice_switch.c +7 -8
@@ -2298,7 +2298,7 @@ enum ice_status ice_alloc_rss_global_lut(struct ice_hw *hw, bool shared_res, u16 }/** -* ice_free_global_lut - free a RSS global LUT +* ice_free_rss_global_lut - free a RSS global LUT * @hw: pointer to the HW struct * @global_lut_id: ID of the RSS global LUT to free */
@@ -3174,7 +3174,6 @@ ice_aq_get_recipe(struct ice_hw *hw, buf_size = *num_recipes *sizeof (*s_recipe_list); status =ice_aq_send_cmd (hw, &desc, s_recipe_list, buf_size, cd); -/* cppcheck-suppress constArgument */ *num_recipes =LE16_TO_CPU (cmd->num_sub_recipes);return status;
@@ -4979,7 +4978,7 @@ enum ice_status ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list) }/** -* ice_add_mac_vlan - Add MAC and VLAN pair based filter rule +* ice_add_mac_vlan_rule - Add MAC and VLAN pair based filter rule * @hw: pointer to the hardware structure * @mv_list: list of MAC and VLAN filters * @sw: pointer to switch info struct for which function add rule
@@ -5671,7 +5670,7 @@ ice_get_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 *promisc_mask, }/** -* ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI +* _ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI * @hw: pointer to the hardware structure * @vsi_handle: VSI handle to retrieve info from * @promisc_mask: pointer to mask to be filled in
@@ -6664,7 +6663,7 @@ static bool ice_prot_type_to_id(enum ice_protocol_type type, u8 *id) }/** -* ice_find_valid_words - count valid words +* ice_fill_valid_words - count valid words * @rule: advanced rule with lookup information * @lkup_exts: byte offset extractions of the words that are valid *
@@ -7263,7 +7262,7 @@ ice_get_fv(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }/** -* ice_tun_type_match_mask - determine if tun type needs a match mask +* ice_tun_type_match_word - determine if tun type needs a match mask * @tun_type: tunnel type * @mask: mask to be used for the tunnel */
@@ -8860,7 +8859,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw, }/** -* ice_rem_adv_for_vsi - removes existing advanced switch rules for a +* ice_rem_adv_rule_for_vsi - removes existing advanced switch rules for a * given VSI handle * @hw: pointer to the hardware structure * @vsi_handle: VSI handle for which we are supposed to remove all the rules.
@@ -9142,7 +9141,7 @@ ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi, }/** -* ice_rm_all_sw_replay_rule - helper function to delete filter replay rules +* ice_rm_sw_replay_rule_info - helper function to delete filter replay rules * @hw: pointer to the HW struct * @sw: pointer to switch info struct for which function removes filters *
drivers/net/ice/base/ice_type.h +0 -2
@@ -44,9 +44,7 @@#define ice_struct_size (ptr, field, num) \ (sizeof(*(ptr)) + sizeof(*(ptr)->field) * (num)) -#ifndef FLEX_ARRAY_SIZE #define FLEX_ARRAY_SIZE (_ptr, _mem, cnt) ((cnt) * sizeof(_ptr->_mem[0])) -#endif /* FLEX_ARRAY_SIZE */ #include "ice_status.h" #include "ice_hw_autogen.h"
drivers/net/ice/base/ice_vlan_mode.c +1 -2
@@ -2,11 +2,10 @@* Copyright(c) 2001-2021 Intel Corporation */ -#include "ice_vlan_mode.h" #include "ice_common.h" /** -* ice_pkg_supports_dvm - determine if DDP supports Double VLAN mode (DVM) +* ice_pkg_get_supported_vlan_mode - chk if DDP supports Double VLAN mode (DVM) * @hw: pointer to the HW struct * @dvm: output variable to determine if DDP supports DVM(true) or SVM(false) */
drivers/net/ice/base/ice_vlan_mode.h +0 -1
@@ -6,7 +6,6 @@#define _ICE_VLAN_MODE_H_#include "ice_osdep.h" -#include "ice_status.h" struct ice_hw ;
Signature · 1 line
2.26.2
PATCH v2 2/14 net/ice/base: support removing VSI from flow profile
In reply to Qi ZhangAdding a function ice_flow_rem_vsi_prof() to remove flow entries associated to the sw vsi handle. Once complete clear the vsi index from the flow profile bitmap. This will ensure that the a vsi once removed can be re-added and the package block rules will be added again.
--- drivers/net/ice/base/ice_flow.c | 55 +++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_flow.h | 2 ++ 2 files changed, 57 insertions(+)
drivers/net/ice/base/ice_flow.c +55 -0
@@ -3295,6 +3295,61 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, seg->raws_cnt++; } +/** +* ice_flow_rem_vsi_prof - remove vsi from flow profile +* @hw: pointer to the hardware structure +* @blk: classification stage +* @vsi_handle: software VSI handle +* @prof_id: unique ID to identify this flow profile +* +* This function removes the flow entries associated to the input +* vsi handle and disassociates the vsi from the flow profile. +*/ +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk,u16 vsi_handle, +u64 prof_id) +{ +struct ice_flow_prof *prof =NULL ; +enum ice_status status =ICE_SUCCESS ; + +if (blk >=ICE_BLK_COUNT || !ice_is_vsi_valid (hw, vsi_handle)) +return ICE_ERR_PARAM ; + +/* find flow profile pointer with input package block and profile id */ + prof =ice_flow_find_prof_id (hw,ICE_BLK_FD , prof_id); +if (!prof) { +ice_debug (hw,ICE_DBG_PKG , +"Cannot find flow profile id=%lu\n" , prof_id); +return ICE_ERR_DOES_NOT_EXIST ; + } + +/* Remove all remaining flow entries before removing the flow profile */ +if (!LIST_EMPTY (&prof->entries)) { +struct ice_flow_entry *e, *t; + +ice_acquire_lock (&prof->entries_lock); +LIST_FOR_EACH_ENTRY_SAFE (e, t, &prof->entries, ice_flow_entry, + l_entry) { +if (e->vsi_handle != vsi_handle) +continue ; + + status =ice_flow_rem_entry_sync (hw, blk, e); +if (status) +break ; + } +ice_release_lock (&prof->entries_lock); + } +if (status) +return status; + +/* disassociate the flow profile from sw vsi handle */ + status =ice_flow_disassoc_prof (hw, blk, prof, vsi_handle); +if (status) +ice_debug (hw,ICE_DBG_PKG , +"ice_flow_disassoc_prof() failed with status=%d\n" , + status); +return status; +} +#define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \ (ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
drivers/net/ice/base/ice_flow.h +2 -0
@@ -553,6 +553,8 @@ ice_flow_set_fld_prefix(struct ice_flow_seg_info *seg, enum ice_flow_field fld,void ice_flow_add_fld_raw (struct ice_flow_seg_info *seg,u16 off,u8 len,u16 val_loc,u16 mask_loc); +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk, +u16 vsi_handle,u64 prof_id);void ice_rem_vsi_rss_list (struct ice_hw *hw,u16 vsi_handle);enum ice_status ice_replay_rss_cfg (struct ice_hw *hw,u16 vsi_handle);enum ice_status
Signature · 1 line
2.26.2
PATCH v2 3/14 net/ice/base: print link configure error
In reply to Qi ZhangNewer NVMs return link_cfg_err for get_link_status AQ. Print it for debug use.
--- drivers/net/ice/base/ice_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/base/ice_common.c +1 -0
@@ -460,6 +460,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, (unsigned long long)li->phy_type_high);ice_debug (hw,ICE_DBG_LINK ," media_type = 0x%x\n" , *hw_media_type);ice_debug (hw,ICE_DBG_LINK ," link_info = 0x%x\n" , li->link_info); +ice_debug (hw,ICE_DBG_LINK ," link_cfg_err = 0x%x\n" , li->link_cfg_err);ice_debug (hw,ICE_DBG_LINK ," an_info = 0x%x\n" , li->an_info);ice_debug (hw,ICE_DBG_LINK ," ext_info = 0x%x\n" , li->ext_info);ice_debug (hw,ICE_DBG_LINK ," fec_info = 0x%x\n" , li->fec_info);
Signature · 1 line
2.26.2
PATCH v2 4/14 net/ice/base: remove unused ptype field in PTT definition
In reply to Qi ZhangRemove the unused ptype entry, and use the gcc extension for ranged initializers in arrays for Linux, and explicitly target each table entry by index when initializing under Linux.
--- drivers/net/ice/base/ice_lan_tx_rx.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_lan_tx_rx.h +4 -6
@@ -296,7 +296,6 @@ enum ice_rx_l2_ptype { };struct ice_rx_ptype_decoded { -u32 ptype:10 ;u32 known:1 ;u32 outer_ip:1 ;u32 outer_ip_ver:2 ;
@@ -1217,8 +1216,7 @@ struct ice_tx_drbell_q_ctx {/* macro to make the table lines short */ #define ICE_PTT (PTYPE ,OUTER_IP ,OUTER_IP_VER ,OUTER_FRAG ,T ,TE ,TEF ,I ,PL )\ - { PTYPE, \ - 1, \ + { 1, \ ICE_RX_PTYPE_OUTER_##OUTER_IP, \ ICE_RX_PTYPE_OUTER_##OUTER_IP_VER, \ ICE_RX_PTYPE_##OUTER_FRAG, \
@@ -1228,14 +1226,14 @@ struct ice_tx_drbell_q_ctx { ICE_RX_PTYPE_INNER_PROT_##I, \ ICE_RX_PTYPE_PAYLOAD_LAYER_##PL } -#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { PTYPE, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { 0, 0, 0, 0, 0, 0, 0, 0, 0 }/* shorter macros makes the table fit but are terse */ #define ICE_RX_PTYPE_NOF ICE_RX_PTYPE_NOT_FRAG#define ICE_RX_PTYPE_FRG ICE_RX_PTYPE_FRAG -/* Lookup table mapping the HW PTYPE to the bit field for decoding */ -static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = { +/* Lookup table mapping the 10-bit HW PTYPE to the bit field for decoding */ +static const struct ice_rx_ptype_decoded ice_ptype_lkup[1024 ] = {/* L2 Packet types */ ICE_PTT_UNUSED_ENTRY (0 ),ICE_PTT (1 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,PAY2 ),
Signature · 1 line
2.26.2
PATCH v2 5/14 net/ice/base: set MAC type for E823C device
In reply to Qi ZhangSet E823C device's MAC type as generic.
--- drivers/net/ice/base/ice_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/base/ice_common.c +5 -0
@@ -48,6 +48,11 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)case ICE_DEV_ID_E823L_BACKPLANE :case ICE_DEV_ID_E823L_QSFP :case ICE_DEV_ID_E823L_SFP : +case ICE_DEV_ID_E823C_10G_BASE_T : +case ICE_DEV_ID_E823C_BACKPLANE : +case ICE_DEV_ID_E823C_QSFP : +case ICE_DEV_ID_E823C_SFP : +case ICE_DEV_ID_E823C_SGMII : hw->mac_type =ICE_MAC_GENERIC ;break ;default :
Signature · 1 line
2.26.2
PATCH v2 6/14 net/ice/base: change protocol ID for VLAN in case of DVM
In reply to Qi ZhangProtocol id for first vlan in Double VLAN Mode (DVM) should be ICE_VLAN_OF_HW = 16, but for Single VLAN Mode (SVM) this should be ICE_VLAN_OL_HW = 17.
Change protocol id in type to id translation array for outer vlan to 17 when DVM is enabled, which means the driver, package, and firmware support DVM.
--- drivers/net/ice/base/ice_flex_pipe.c | 3 +++ drivers/net/ice/base/ice_switch.c | 19 ++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_pipe.c +3 -0
@@ -1244,6 +1244,9 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg)ice_cache_vlan_mode (hw); +if (ice_is_dvm_ena (hw)) +ice_change_proto_id_to_dvm (); +return status; }
drivers/net/ice/base/ice_switch.c +18 -1
@@ -6538,7 +6538,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {* following policy. */ -static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { +static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { {ICE_MAC_OFOS ,ICE_MAC_OFOS_HW }, {ICE_MAC_IL ,ICE_MAC_IL_HW }, {ICE_ETYPE_OL ,ICE_ETYPE_OL_HW },
@@ -6643,6 +6643,23 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,return ICE_MAX_NUM_RECIPES ; } +/** +* ice_change_proto_id_to_dvm - change proto id in prot_id_tbl +* +* As protocol id for outer vlan is different in dvm and svm, if dvm is +* supported protocol array record for outer vlan has to be modified to +* reflect the value proper for DVM. +*/ +void ice_change_proto_id_to_dvm (void ) +{ +u8 i; + +for (i =0 ; i <ARRAY_SIZE (ice_prot_id_tbl); i++) +if (ice_prot_id_tbl[i].type ==ICE_VLAN_OFOS && + ice_prot_id_tbl[i].protocol_id !=ICE_VLAN_OF_HW ) + ice_prot_id_tbl[i].protocol_id =ICE_VLAN_OF_HW ; +} +/** * ice_prot_type_to_id - get protocol ID from protocol type * @type: protocol type
drivers/net/ice/base/ice_switch.h +1 -0
@@ -535,4 +535,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type);enum ice_status ice_update_recipe_lkup_idx (struct ice_hw *hw,struct ice_update_recipe_lkup_idx_params *params); +void ice_change_proto_id_to_dvm (void );#endif /* _ICE_SWITCH_H_ */
Signature · 1 line
2.26.2
PATCH v2 7/14 net/ice/base: enable I2C read/write commands
In reply to Qi ZhangEnable I2C read/write AQ commands. They are now required for controlling the external physical connectors via external I2C port expander on E810-T adapters.
--- drivers/net/ice/base/ice_adminq_cmd.h | 29 +++++++++ drivers/net/ice/base/ice_common.c | 94 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 8 +++ 3 files changed, 131 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +29 -0
@@ -1665,6 +1665,31 @@ struct ice_aqc_get_link_topo {u8 rsvd[9 ]; }; +/* Read/Write I2C (direct, 0x06E2/0x06E3) */ +struct ice_aqc_i2c { +struct ice_aqc_link_topo_addr topo_addr; +__le16 i2c_addr; +u8 i2c_params; +#define ICE_AQC_I2C_DATA_SIZE_S 0 +#define ICE_AQC_I2C_DATA_SIZE_M (0xF << ICE_AQC_I2C_DATA_SIZE_S) +#define ICE_AQC_I2C_ADDR_TYPE_M BIT(4) +#define ICE_AQC_I2C_ADDR_TYPE_7BIT 0 +#define ICE_AQC_I2C_ADDR_TYPE_10BIT ICE_AQC_I2C_ADDR_TYPE_M +#define ICE_AQC_I2C_DATA_OFFSET_S 5 +#define ICE_AQC_I2C_DATA_OFFSET_M (0x3 << ICE_AQC_I2C_DATA_OFFSET_S) +#define ICE_AQC_I2C_USE_REPEATED_START BIT(7) +u8 rsvd; +__le16 i2c_bus_addr; +#define ICE_AQC_I2C_ADDR_7BIT_MASK 0x7F +#define ICE_AQC_I2C_ADDR_10BIT_MASK 0x3FF +u8 i2c_data[4 ];/* Used only by write command, reserved in read. */ +}; + +/* Read I2C Response (direct, 0x06E2) */ +struct ice_aqc_read_i2c_resp { +u8 i2c_data[16 ]; +}; +/* Set Port Identification LED (direct, 0x06E9) */ struct ice_aqc_set_port_id_led {u8 lport_num;
@@ -2838,6 +2863,8 @@ struct ice_aq_desc {struct ice_aqc_get_phy_caps get_phy;struct ice_aqc_set_phy_cfg set_phy;struct ice_aqc_restart_an restart_an; +struct ice_aqc_i2c read_write_i2c; +struct ice_aqc_read_i2c_resp read_i2c_resp;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led;struct ice_aqc_get_sw_cfg get_sw_conf;
@@ -3074,6 +3101,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_event_mask =0x0613 , ice_aqc_opc_set_mac_lb =0x0620 , ice_aqc_opc_get_link_topo =0x06E0 , + ice_aqc_opc_read_i2c =0x06E2 , + ice_aqc_opc_write_i2c =0x06E3 , ice_aqc_opc_set_port_id_led =0x06E9 , ice_aqc_opc_get_port_options =0x06EA , ice_aqc_opc_set_port_option = 0x06EB,
drivers/net/ice/base/ice_common.c +94 -0
100 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +8 -0
@@ -225,5 +225,13 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw);enum ice_status ice_lldp_fltr_add_remove (struct ice_hw *hw,u16 vsi_num,bool add); +enum ice_status +ice_aq_read_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_write_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd);bool ice_fw_supports_report_dflt_cfg (struct ice_hw *hw);#endif /* _ICE_COMMON_H_ */
Signature · 1 line
2.26.2
PATCH v2 8/14 net/ice/base: add RSS support for PPPoL2TPv2oUDP
In reply to Qi ZhangAdd support for PPPoL2TPv2oUDP RSS hash. L2TPv2 and PPP ptypes and flow headers are added. Prot id for PPP is added.
--- drivers/net/ice/base/ice_flow.c | 65 ++++++++++++++++++------ drivers/net/ice/base/ice_flow.h | 2 + drivers/net/ice/base/ice_protocol_type.h | 1 + 3 files changed, 52 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_flow.c +49 -16
@@ -212,7 +212,7 @@ static const u32 ice_ptypes_mac_ofos[] = {0xFDC00846 ,0xBFBF7F7E ,0xF70001DF ,0xFEFDFDFB ,0x0000077E ,0x000003FF ,0x00000000 ,0x00000000 ,0x00400000 ,0x03FFF000 ,0xFFFFFFE0 ,0x00100707 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -238,7 +238,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x000002A0 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -252,7 +252,7 @@ static const u32 ice_ptypes_ipv4_ofos_all[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x83E0FAA0 ,0x00000101 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03FFD500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -264,7 +264,7 @@ static const u32 ice_ptypes_ipv4_il[] = {0xE0000000 ,0xB807700E ,0x80000003 ,0xE01DC03B ,0x0000000E ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x001FF800 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC0FC000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -278,7 +278,7 @@ static const u32 ice_ptypes_ipv6_ofos[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -292,7 +292,7 @@ static const u32 ice_ptypes_ipv6_ofos_all[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x7C1F0540 ,0x00000206 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC002A00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -304,7 +304,7 @@ static const u32 ice_ptypes_ipv6_il[] = {0x00000000 ,0x03B80770 ,0x000001DC ,0x0EE00000 ,0x00000770 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x7FE00000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03F00000 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -316,7 +316,7 @@ static const u32 ice_ptypes_ipv4_ofos_no_l4[] = {0x10C00000 ,0x04000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000cc000 ,0x000002A0 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -328,7 +328,7 @@ static const u32 ice_ptypes_ipv4_il_no_l4[] = {0x60000000 ,0x18043008 ,0x80000002 ,0x6010c021 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00139800 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x8C08C000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -340,7 +340,7 @@ static const u32 ice_ptypes_ipv6_ofos_no_l4[] = {0x00000000 ,0x00000000 ,0x43000000 ,0x10002000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x02300000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -352,7 +352,7 @@ static const u32 ice_ptypes_ipv6_il_no_l4[] = {0x00000000 ,0x02180430 ,0x0000010c ,0x086010c0 ,0x00000430 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x4e600000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x02300000 ,0x00000023 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -378,7 +378,7 @@ static const u32 ice_ptypes_udp_il[] = {0x81000000 ,0x20204040 ,0x04000010 ,0x80810102 ,0x00000040 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00410000 ,0x908427E0 ,0x00100007 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x10410000 ,0x00000004 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -390,7 +390,7 @@ static const u32 ice_ptypes_tcp_il[] = {0x04000000 ,0x80810102 ,0x10000040 ,0x02040408 ,0x00000102 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00820000 ,0x21084000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x20820000 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -402,7 +402,7 @@ static const u32 ice_ptypes_sctp_il[] = {0x08000000 ,0x01020204 ,0x20000081 ,0x04080810 ,0x00000204 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x01040000 ,0x00000000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x41040000 ,0x00000010 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -426,7 +426,7 @@ static const u32 ice_ptypes_icmp_il[] = {0x00000000 ,0x02040408 ,0x40000102 ,0x08101020 ,0x00000408 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x42108000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x82080000 ,0x00000020 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -725,6 +725,28 @@ static const u32 ice_ptypes_udp_ecpri_tp0[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +static const u32 ice_ptypes_l2tpv2[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; + +static const u32 ice_ptypes_ppp[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFF000 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; +/* Manage parameters and info. used during the creation of a flow profile */ struct ice_flow_prof_params {enum ice_block blk;
@@ -750,7 +772,8 @@ struct ice_flow_prof_params {ICE_FLOW_SEG_HDR_PFCP_SESSION |ICE_FLOW_SEG_HDR_L2TPV3 | \ICE_FLOW_SEG_HDR_ESP |ICE_FLOW_SEG_HDR_AH | \ICE_FLOW_SEG_HDR_NAT_T_ESP |ICE_FLOW_SEG_HDR_GTPU_NON_IP | \ - ICE_FLOW_SEG_HDR_ECPRI_TP0 | ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0) +ICE_FLOW_SEG_HDR_ECPRI_TP0 |ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0 | \ + ICE_FLOW_SEG_HDR_L2TPV2 | ICE_FLOW_SEG_HDR_PPP) #define ICE_FLOW_SEG_HDRS_L2_MASK \ (ICE_FLOW_SEG_HDR_ETH |ICE_FLOW_SEG_HDR_VLAN )
@@ -1006,6 +1029,10 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)/* Attributes for GTP packet without Extension Header */ params->attr = ice_attr_gtpu_session; params->attr_cnt =ARRAY_SIZE (ice_attr_gtpu_session); + }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV2 ) { + src = (const ice_bitmap_t *)ice_ptypes_l2tpv2; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV3 ) { src = (const ice_bitmap_t *)ice_ptypes_l2tpv3; ice_and_bitmap(params->ptypes, params->ptypes,
@@ -1032,6 +1059,12 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) src, ICE_FLOW_PTYPE_MAX); } +if (hdrs &ICE_FLOW_SEG_HDR_PPP ) { + src = (const ice_bitmap_t *)ice_ptypes_ppp; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); + } +if (hdrs &ICE_FLOW_SEG_HDR_PFCP ) {if (hdrs &ICE_FLOW_SEG_HDR_PFCP_NODE ) src =
drivers/net/ice/base/ice_flow.h +2 -0
@@ -185,6 +185,8 @@ enum ice_flow_seg_hdr {ICE_FLOW_SEG_HDR_VXLAN =0x02000000 ,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 ,/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs */
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -154,6 +154,7 @@ enum ice_prot_id {ICE_PROT_PPPOE =103 ,ICE_PROT_L2TPV3 =104 ,ICE_PROT_ECPRI =105 , +ICE_PROT_PPP =106 ,ICE_PROT_ATAOE_OF =114 ,ICE_PROT_CTRL_OF =116 , ICE_PROT_LLDP_OF = 117,
Signature · 1 line
2.26.2
PATCH v2 9/14 net/ice/base: add set/get GPIO helper functions
In reply to Qi ZhangAdd helper functions to set the GPIO pin state or get the value of a GPIO signal that's the part of the topology based on AQ commands. This change is needed to setup GPIO pins state for PTP, SyncE etc.
--- drivers/net/ice/base/ice_adminq_cmd.h | 11 +++++ drivers/net/ice/base/ice_common.c | 58 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 6 +++ 3 files changed, 75 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +11 -0
@@ -1701,6 +1701,16 @@ struct ice_aqc_set_port_id_led {u8 rsvd[13 ]; }; +/* Set/Get GPIO (direct, 0x06EC/0x06ED) */ +struct ice_aqc_gpio { +__le16 gpio_ctrl_handle; +#define ICE_AQC_GPIO_HANDLE_S 0 +#define ICE_AQC_GPIO_HANDLE_M (0x3FF << ICE_AQC_GPIO_HANDLE_S) +u8 gpio_num; +u8 gpio_val; +u8 rsvd[12 ]; +}; +/* Read/Write SFF EEPROM command (indirect 0x06EE) */ struct ice_aqc_sff_eeprom {u8 lport_num;
@@ -2865,6 +2875,7 @@ struct ice_aq_desc {struct ice_aqc_restart_an restart_an;struct ice_aqc_i2c read_write_i2c;struct ice_aqc_read_i2c_resp read_i2c_resp; +struct ice_aqc_gpio read_write_gpio;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led;struct ice_aqc_get_sw_cfg get_sw_conf;
drivers/net/ice/base/ice_common.c +58 -0
64 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +6 -0
@@ -220,6 +220,12 @@ enum ice_status ice_sched_query_elem(struct ice_hw *hw, u32 node_teid, struct ice_aqc_txsched_elem_data *buf);enum ice_status +ice_aq_set_gpio (struct ice_hw *hw,u16 gpio_ctrl_handle,u8 pin_idx,bool value, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_get_gpio (struct ice_hw *hw,u16 gpio_ctrl_handle,u8 pin_idx, +bool *value,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);bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw);
Signature · 1 line
2.26.2
PATCH v2 10/14 net/ice/base: add priority check of matching recipe
In reply to Qi ZhangCheck priority when look for a recipe which matches our request to enable flow priority for switch filter.
--- drivers/net/ice/base/ice_switch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ice/base/ice_switch.c +5 -4
@@ -6574,7 +6574,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {* Returns index of matching recipe, or ICE_MAX_NUM_RECIPES if not found. */ static u16 ice_find_recp (struct ice_hw *hw,struct ice_prot_lkup_ext *lkup_exts, -enum ice_sw_tunnel_type tun_type) +enum ice_sw_tunnel_type tun_type,u32 priority) {bool refresh_required = true;struct ice_sw_recipe *recp;
@@ -6636,7 +6636,8 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,/* If for "i"th recipe the found was never set to false * then it means we found our match */ -if (tun_type == recp[i].tun_type && found) +if (tun_type == recp[i].tun_type && found && + priority == recp[i].priority)return i;/* Return the recipe ID */ } }
@@ -7650,7 +7651,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, }/* Look for a recipe which matches our requested fv / mask list */ - *rid =ice_find_recp (hw, lkup_exts, rinfo->tun_type); + *rid =ice_find_recp (hw, lkup_exts, rinfo->tun_type, rinfo->priority);if (*rid <ICE_MAX_NUM_RECIPES )/* Success if found a recipe that match the existing criteria */ goto err_unroll;
@@ -8779,7 +8780,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,if (status)return status; - rid =ice_find_recp (hw, &lkup_exts, rinfo->tun_type); + rid =ice_find_recp (hw, &lkup_exts, rinfo->tun_type, rinfo->priority);/* If did not find a recipe that match the existing criteria */ if (rid ==ICE_MAX_NUM_RECIPES )return ICE_ERR_PARAM ;
Signature · 1 line
2.26.2
PATCH v2 11/14 net/ice/base: add inner VLAN protocol type for QinQ filter
In reply to Qi ZhangSince VLAN protocol type 'ICE_VLAN_OFOS' has been changed to map the hardware VLAN protocol ID to 'ICE_VLAN_OF_HW (16)' when in Double VLAN mode, and to 'ICE_VLAN_OL_HW (17)' when in Single VLAN mode.
So 'ICE_VLAN_OFOS' can't be used with 'ICE_VLAN_EX' which is outer VLAN hardware protocol ID 'ICE_VLAN_OF_HW (16)' to do the QinQ VLAN pattern.
Introduce the new inner VLAN protocol type 'ICE_VLAN_IN', which is inner VLAN hardware protocol ID 'ICE_VLAN_OL_HW (17)'.
Now for QinQ VLAN pattern, the protocol 'ICE_VLAN_EX' and 'ICE_VLAN_IN' should be used to set the related protocol header fields like VLAN ID.
--- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_switch.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -53,6 +53,7 @@ enum ice_protocol_type {ICE_NAT_T ,ICE_GTP_NO_PAY ,ICE_VLAN_EX , +ICE_VLAN_IN , ICE_PROTOCOL_LAST };
drivers/net/ice/base/ice_switch.c +13 -10
@@ -1612,7 +1612,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_ipv4_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_IPV4_OFOS, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1625,7 +1625,7 @@ static const u8 dummy_qinq_ipv4_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x08 ,0x00 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x08 ,0x00 ,/* ICE_VLAN_IN 18 */ 0x45 ,0x00 ,0x00 ,0x1c ,/* ICE_IPV4_OFOS 22 */ 0x00, 0x01, 0x00, 0x00,
@@ -1643,7 +1643,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_ipv6_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_IPV6_OFOS, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1656,7 +1656,7 @@ static const u8 dummy_qinq_ipv6_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x86 ,0xDD ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x86 ,0xDD ,/* ICE_VLAN_IN 18 */ 0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 22 */ 0x00, 0x10, 0x11, 0x00, /* Next header UDP */
@@ -1682,7 +1682,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1692,7 +1692,7 @@ struct ice_dummy_pkt_offsets dummy_qinq_pppoe_ipv4_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_IPV4_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 },
@@ -1706,14 +1706,14 @@ static const u8 dummy_qinq_pppoe_ipv4_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_IN 18 */ 0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 22 */ 0x00 ,0x16 ,0x00 ,0x21 ,/* PPP Link Layer 28 */ -0x45 ,0x00 ,0x00 ,0x14 ,/* ICE_IPV4_IL 30 */ +0x45 ,0x00 ,0x00 ,0x14 ,/* ICE_IPV4_OFOS 30 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , 0x00, 0x00, 0x00, 0x00,
@@ -1727,7 +1727,7 @@ struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_ipv6_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14}, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_IPV6_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 },
@@ -1741,7 +1741,7 @@ static const u8 dummy_qinq_pppoe_ipv6_packet[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_IN 18 */ 0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 22 */ 0x00, 0x2a,
@@ -6530,6 +6530,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = { { ICE_NAT_T, { 8, 10, 12, 14 } }, { ICE_GTP_NO_PAY, { 8, 10, 12, 14 } }, { ICE_VLAN_EX, { 0, 2 } }, + { ICE_VLAN_IN, { 0, 2 } }, };/* The following table describes preferred grouping of recipes.
@@ -6564,6 +6565,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_NAT_T, ICE_UDP_ILOS_HW }, { ICE_GTP_NO_PAY, ICE_UDP_ILOS_HW }, { ICE_VLAN_EX, ICE_VLAN_OF_HW }, + { ICE_VLAN_IN, ICE_VLAN_OL_HW }, };/**
@@ -8139,6 +8141,7 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,break ;case ICE_VLAN_OFOS :case ICE_VLAN_EX : +case ICE_VLAN_IN : len =sizeof (struct ice_vlan_hdr );break ;case ICE_IPV4_OFOS :
Signature · 1 line
2.26.2
PATCH v2 12/14 net/ice/base: fix QinQ PPPoE dummy pkt selection
In reply to Qi ZhangThe dummy packet should be QinQ PPPoE ipv6 when ppp protocol is ipv6.
--- drivers/net/ice/base/ice_switch.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/base/ice_switch.c +5 -0
@@ -7808,6 +7808,11 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, *pkt_len =sizeof (dummy_qinq_pppoe_ipv4_pkt); *offsets = dummy_qinq_pppoe_ipv4_packet_offsets;return ; + }else if (tun_type ==ICE_SW_TUN_PPPOE_QINQ && ipv6) { + *pkt = dummy_qinq_pppoe_ipv6_packet; + *pkt_len =sizeof (dummy_qinq_pppoe_ipv6_packet); + *offsets = dummy_qinq_pppoe_packet_offsets; +return ; }else if (tun_type ==ICE_SW_TUN_PPPOE_QINQ || tun_type ==ICE_SW_TUN_PPPOE_PAY_QINQ ) { *pkt = dummy_qinq_pppoe_ipv4_pkt;
Signature · 1 line
2.26.2
PATCH v2 13/14 net/ice/base: add PTYPE values for PPPoL2TPv2oUDP
In reply to Qi ZhangAdd some new macros of PTYPE values to support PPPoL2TPv2oUDP.
--- drivers/net/ice/base/ice_flex_type.h | 31 +++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_type.h +30 -1
@@ -416,7 +416,36 @@ enum ice_sect {#define ICE_MAC_IPV6_PFCP_SESSION 354#define ICE_MAC_IPV4_L2TPV3 360#define ICE_MAC_IPV6_L2TPV3 361 - +#define ICE_MAC_IPV4_L2TPV2_CONTROL 392 +#define ICE_MAC_IPV6_L2TPV2_CONTROL 393 +#define ICE_MAC_IPV4_L2TPV2 394 +#define ICE_MAC_IPV6_L2TPV2 395 +#define ICE_MAC_IPV4_PPPOL2TPV2 396 +#define ICE_MAC_IPV6_PPPOL2TPV2 397 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_FRAG 398 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_PAY 399 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_UDP_PAY 400 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_TCP 401 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_SCTP 402 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_ICMP 403 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_FRAG 404 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_PAY 405 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_UDP_PAY 406 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_TCP 407 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_SCTP 408 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_ICMPV6 409 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_FRAG 410 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_PAY 411 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_UDP_PAY 412 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_TCP 413 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_SCTP 414 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_ICMP 415 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_FRAG 416 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_PAY 417 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_UDP_PAY 418 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_TCP 419 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_SCTP 420 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_ICMPV6 421/* Attributes that can modify PTYPE definitions. *
Signature · 1 line
2.26.2
PATCH v2 14/14 net/ice/base: allow support for GTP-U filter using only inner protocols
In reply to Qi ZhangAdds a support for switch filter: GTP-U using just inner fields. If user doesn't specify outer protocol and its fields but wants to add switch filter for GTP-U using inner protocols and related fields such as inner L3 and/or inner L4, this patch enables such filtering.
--- drivers/net/ice/base/ice_protocol_type.h | 2 ++ drivers/net/ice/base/ice_switch.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_protocol_type.h +2 -0
@@ -110,6 +110,8 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_IPV4_GTPU_IPV6 ,ICE_SW_TUN_IPV6_GTPU_IPV4 ,ICE_SW_TUN_IPV6_GTPU_IPV6 , +ICE_SW_TUN_GTP_IPV4 , +ICE_SW_TUN_GTP_IPV6 , ICE_ALL_TUNNELS /* All tunnel types including NVGRE */ };
drivers/net/ice/base/ice_switch.c +4 -2
@@ -7980,13 +7980,15 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }/* Support GTP tunnel + L3 */ -if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV4 ) { +if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV4 || + tun_type ==ICE_SW_TUN_GTP_IPV4 ) { *pkt = dummy_ipv4_gtpu_ipv4_packet; *pkt_len =sizeof (dummy_ipv4_gtpu_ipv4_packet); *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;return ; } -if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV6 ) { +if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV6 || + tun_type ==ICE_SW_TUN_GTP_IPV6 ) { *pkt = dummy_ipv4_gtpu_ipv6_packet; *pkt_len =sizeof (dummy_ipv4_gtpu_ipv6_packet); *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
Signature · 1 line
2.26.2
Re: [dpdk-dev] [PATCH v2 00/14] base code update batch 2
In reply to Qi ZhangQuoted 47 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2021年4月13日 13:06
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2 00/14] base code update batch 2v2:
- Added patch 9/14 - 14/14.Qi Zhang (14):
net/ice/base: code cleanup
net/ice/base: support removing VSI from flow profilenet/ice/base: print link configure errornet/ice/base: remove unused ptype field in PTT definitionnet/ice/base: set MAC type for E823C devicenet/ice/base: change protocol ID for VLAN in case of DVMnet/ice/base: enable I2C read/write commandsnet/ice/base: add RSS support for PPPoL2TPv2oUDPnet/ice/base: add set/get GPIO helper functionsnet/ice/base: add priority check of matching recipenet/ice/base: add inner VLAN protocol type for QinQ filternet/ice/base: fix QinQ PPPoE dummy pkt selectionnet/ice/base: add PTYPE values for PPPoL2TPv2oUDPnet/ice/base: allow support for GTP-U filter using only inner
protocolsdrivers/net/ice/base/ice_adminq_cmd.h | 40 ++++++ drivers/net/ice/base/ice_common.c | 162 ++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 14 ++ drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 4 +- drivers/net/ice/base/ice_flex_type.h | 31 ++++- drivers/net/ice/base/ice_flow.c | 120 ++++++++++++++--- drivers/net/ice/base/ice_flow.h | 4 + drivers/net/ice/base/ice_lan_tx_rx.h | 10 +- drivers/net/ice/base/ice_protocol_type.h | 4 + drivers/net/ice/base/ice_sched.c | 11 +- drivers/net/ice/base/ice_switch.c | 77 +++++++---- drivers/net/ice/base/ice_switch.h | 1 + drivers/net/ice/base/ice_type.h | 2 - drivers/net/ice/base/ice_vlan_mode.c | 3 +- drivers/net/ice/base/ice_vlan_mode.h | 1 - 17 files changed, 424 insertions(+), 64 deletions(-)
Quoted 2 lines
--
2.26.2
Re: [dpdk-dev] [PATCH v2 00/14] base code update batch 2
Quoted 47 lines · Qiming
Quoted 47 lines
-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: 2021年4月13日 13:06
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2 00/14] base code update batch 2v2:
- Added patch 9/14 - 14/14.Qi Zhang (14):
net/ice/base: code cleanup
net/ice/base: support removing VSI from flow profilenet/ice/base: print link configure errornet/ice/base: remove unused ptype field in PTT definitionnet/ice/base: set MAC type for E823C devicenet/ice/base: change protocol ID for VLAN in case of DVMnet/ice/base: enable I2C read/write commandsnet/ice/base: add RSS support for PPPoL2TPv2oUDPnet/ice/base: add set/get GPIO helper functionsnet/ice/base: add priority check of matching recipenet/ice/base: add inner VLAN protocol type for QinQ filternet/ice/base: fix QinQ PPPoE dummy pkt selectionnet/ice/base: add PTYPE values for PPPoL2TPv2oUDPnet/ice/base: allow support for GTP-U filter using only inner
protocolsdrivers/net/ice/base/ice_adminq_cmd.h | 40 ++++++ drivers/net/ice/base/ice_common.c | 162 ++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 14 ++ drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 4 +- drivers/net/ice/base/ice_flex_type.h | 31 ++++- drivers/net/ice/base/ice_flow.c | 120 ++++++++++++++--- drivers/net/ice/base/ice_flow.h | 4 + drivers/net/ice/base/ice_lan_tx_rx.h | 10 +- drivers/net/ice/base/ice_protocol_type.h | 4 + drivers/net/ice/base/ice_sched.c | 11 +- drivers/net/ice/base/ice_switch.c | 77 +++++++---- drivers/net/ice/base/ice_switch.h | 1 + drivers/net/ice/base/ice_type.h | 2 - drivers/net/ice/base/ice_vlan_mode.c | 3 +- drivers/net/ice/base/ice_vlan_mode.h | 1 - 17 files changed, 424 insertions(+), 64 deletions(-)
Quoted 5 lines
Quoted 2 lines
--
2.26.2Acked-by Qiming Yang <[email protected]>
Hi Qiming, Qi,
The set fails to build, please check reports on patchwork:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
v3 cover ice: base code update batch 2
In reply to Qi Zhangv3:
- replace %ld by %PRIu64 for u64.
v2:
- Added patch 9/14 - 14/14.
Qi Zhang (14):
net/ice/base: code cleanup
net/ice/base: support removing VSI from flow profile net/ice/base: print link configure error net/ice/base: remove unused ptype field in PTT definition net/ice/base: set MAC type for E823C device net/ice/base: add RSS support for PPPoL2TPv2oUDP net/ice/base: change protocol ID for VLAN in case of DVM net/ice/base: add priority check of matching recipe net/ice/base: enable I2C read/write commands net/ice/base: add set/get GPIO helper functions net/ice/base: add inner VLAN protocol type for QinQ filter net/ice/base: fix QinQ PPPoE dummy pkt selection net/ice/base: add PTYPE values for PPPoL2TPv2oUDP net/ice/base: allow support for GTP-U filter using only inner
protocols
drivers/net/ice/base/ice_adminq_cmd.h | 40 ++++++ drivers/net/ice/base/ice_common.c | 162 ++++++++++++++++++++++- drivers/net/ice/base/ice_common.h | 14 ++ drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 4 +- drivers/net/ice/base/ice_flex_type.h | 31 ++++- drivers/net/ice/base/ice_flow.c | 120 ++++++++++++++--- drivers/net/ice/base/ice_flow.h | 4 + drivers/net/ice/base/ice_lan_tx_rx.h | 10 +- drivers/net/ice/base/ice_protocol_type.h | 4 + drivers/net/ice/base/ice_sched.c | 11 +- drivers/net/ice/base/ice_switch.c | 77 +++++++---- drivers/net/ice/base/ice_switch.h | 1 + drivers/net/ice/base/ice_type.h | 2 - drivers/net/ice/base/ice_vlan_mode.c | 3 +- drivers/net/ice/base/ice_vlan_mode.h | 1 - 17 files changed, 424 insertions(+), 64 deletions(-)
Signature · 1 line
2.26.2
PATCH v3 1/14 net/ice/base: code cleanup
1. There are a lots of function header mismatch its function name.
2. remove unnecessary header file include.
3. remove unnecessary macro.
4. remove unnecessary comment.
--- drivers/net/ice/base/ice_common.c | 4 ++-- drivers/net/ice/base/ice_dcb.c | 2 +- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_flex_pipe.c | 1 - drivers/net/ice/base/ice_sched.c | 11 +++++------ drivers/net/ice/base/ice_switch.c | 15 +++++++-------- drivers/net/ice/base/ice_type.h | 2 -- drivers/net/ice/base/ice_vlan_mode.c | 3 +-- drivers/net/ice/base/ice_vlan_mode.h | 1 - 9 files changed, 17 insertions(+), 24 deletions(-)
drivers/net/ice/base/ice_common.c +2 -2
@@ -638,7 +638,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) }/** -* ice_cleanup_all_fltr_mgmt - cleanup filter management list and locks +* ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks * @hw: pointer to the HW struct */ void ice_cleanup_fltr_mgmt_struct (struct ice_hw *hw)
@@ -4903,7 +4903,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, }/** -* ice_fw_supports_lldp_fltr - check NVM version supports lldp_fltr_ctrl +* ice_fw_supports_lldp_fltr_ctrl - check NVM version supports lldp_fltr_ctrl * @hw: pointer to HW struct */ bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw)
drivers/net/ice/base/ice_dcb.c +1 -1
@@ -857,7 +857,7 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, }/** -* ice_get_ieee_dcb_cfg +* ice_get_ieee_or_cee_dcb_cfg * @pi: port information structure * @dcbx_mode: mode of DCBX (IEEE or CEE) *
drivers/net/ice/base/ice_fdir.c +1 -1
@@ -1845,7 +1845,7 @@ bool ice_fdir_has_frag(enum ice_fltr_ptype flow) }/** -* ice_fdir_find_by_idx - find filter with idx +* ice_fdir_find_fltr_by_idx - find filter with idx * @hw: pointer to hardware structure * @fltr_idx: index to find. *
drivers/net/ice/base/ice_flex_pipe.c +0 -1
@@ -357,7 +357,6 @@ ice_marker_ptype_tcam_handler(u32 sect_type, void *section, u32 index,if (sect_type !=ICE_SID_RXPARSER_MARKER_PTYPE )return NULL ; -/* cppcheck-suppress nullPointer */ if (index >ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF )return NULL ;
drivers/net/ice/base/ice_sched.c +5 -6
@@ -1984,7 +1984,7 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs, }/** -* ice_sched_rm_agg_vsi_entry - remove aggregator related VSI info entry +* ice_sched_rm_agg_vsi_info - remove aggregator related VSI info entry * @pi: port information structure * @vsi_handle: software VSI handle *
@@ -3360,7 +3360,7 @@ ice_cfg_vsi_bw_lmt_per_tc(struct ice_port_info *pi, u16 vsi_handle, u8 tc, }/** -* ice_cfg_dflt_vsi_bw_lmt_per_tc - configure default VSI BW limit per TC +* ice_cfg_vsi_bw_dflt_lmt_per_tc - configure default VSI BW limit per TC * @pi: port information structure * @vsi_handle: software VSI handle * @tc: traffic class
@@ -3515,7 +3515,7 @@ ice_cfg_agg_bw_no_shared_lmt(struct ice_port_info *pi, u32 agg_id) }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_shared_lmt_per_tc - config aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3535,7 +3535,7 @@ ice_cfg_agg_bw_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc, }/** -* ice_cfg_agg_bw_shared_lmt_per_tc - configure aggregator BW shared limit per tc +* ice_cfg_agg_bw_no_shared_lmt_per_tc - cfg aggregator BW shared limit per tc * @pi: port information structure * @agg_id: aggregator ID * @tc: traffic class
@@ -3553,7 +3553,7 @@ ice_cfg_agg_bw_no_shared_lmt_per_tc(struct ice_port_info *pi, u32 agg_id, u8 tc) }/** -* ice_config_vsi_queue_priority - config VSI queue priority of node +* ice_cfg_vsi_q_priority - config VSI queue priority of node * @pi: port information structure * @num_qs: number of VSI queues * @q_ids: queue IDs array
@@ -3649,7 +3649,6 @@ ice_cfg_agg_vsi_priority_per_tc(struct ice_port_info *pi, u32 agg_id,LIST_FOR_EACH_ENTRY (agg_vsi_info, &agg_info->agg_vsi_list, ice_sched_agg_vsi_info, list_entry)if (agg_vsi_info->vsi_handle == vsi_handle) { -/* cppcheck-suppress unreadVariable */ vsi_handle_valid = true;break ; }
drivers/net/ice/base/ice_switch.c +7 -8
@@ -2298,7 +2298,7 @@ enum ice_status ice_alloc_rss_global_lut(struct ice_hw *hw, bool shared_res, u16 }/** -* ice_free_global_lut - free a RSS global LUT +* ice_free_rss_global_lut - free a RSS global LUT * @hw: pointer to the HW struct * @global_lut_id: ID of the RSS global LUT to free */
@@ -3174,7 +3174,6 @@ ice_aq_get_recipe(struct ice_hw *hw, buf_size = *num_recipes *sizeof (*s_recipe_list); status =ice_aq_send_cmd (hw, &desc, s_recipe_list, buf_size, cd); -/* cppcheck-suppress constArgument */ *num_recipes =LE16_TO_CPU (cmd->num_sub_recipes);return status;
@@ -4979,7 +4978,7 @@ enum ice_status ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list) }/** -* ice_add_mac_vlan - Add MAC and VLAN pair based filter rule +* ice_add_mac_vlan_rule - Add MAC and VLAN pair based filter rule * @hw: pointer to the hardware structure * @mv_list: list of MAC and VLAN filters * @sw: pointer to switch info struct for which function add rule
@@ -5671,7 +5670,7 @@ ice_get_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 *promisc_mask, }/** -* ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI +* _ice_get_vsi_vlan_promisc - get VLAN promiscuous mode of given VSI * @hw: pointer to the hardware structure * @vsi_handle: VSI handle to retrieve info from * @promisc_mask: pointer to mask to be filled in
@@ -6664,7 +6663,7 @@ static bool ice_prot_type_to_id(enum ice_protocol_type type, u8 *id) }/** -* ice_find_valid_words - count valid words +* ice_fill_valid_words - count valid words * @rule: advanced rule with lookup information * @lkup_exts: byte offset extractions of the words that are valid *
@@ -7263,7 +7262,7 @@ ice_get_fv(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }/** -* ice_tun_type_match_mask - determine if tun type needs a match mask +* ice_tun_type_match_word - determine if tun type needs a match mask * @tun_type: tunnel type * @mask: mask to be used for the tunnel */
@@ -8860,7 +8859,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw, }/** -* ice_rem_adv_for_vsi - removes existing advanced switch rules for a +* ice_rem_adv_rule_for_vsi - removes existing advanced switch rules for a * given VSI handle * @hw: pointer to the hardware structure * @vsi_handle: VSI handle for which we are supposed to remove all the rules.
@@ -9142,7 +9141,7 @@ ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi, }/** -* ice_rm_all_sw_replay_rule - helper function to delete filter replay rules +* ice_rm_sw_replay_rule_info - helper function to delete filter replay rules * @hw: pointer to the HW struct * @sw: pointer to switch info struct for which function removes filters *
drivers/net/ice/base/ice_type.h +0 -2
@@ -44,9 +44,7 @@#define ice_struct_size (ptr, field, num) \ (sizeof(*(ptr)) + sizeof(*(ptr)->field) * (num)) -#ifndef FLEX_ARRAY_SIZE #define FLEX_ARRAY_SIZE (_ptr, _mem, cnt) ((cnt) * sizeof(_ptr->_mem[0])) -#endif /* FLEX_ARRAY_SIZE */ #include "ice_status.h" #include "ice_hw_autogen.h"
drivers/net/ice/base/ice_vlan_mode.c +1 -2
@@ -2,11 +2,10 @@* Copyright(c) 2001-2021 Intel Corporation */ -#include "ice_vlan_mode.h" #include "ice_common.h" /** -* ice_pkg_supports_dvm - determine if DDP supports Double VLAN mode (DVM) +* ice_pkg_get_supported_vlan_mode - chk if DDP supports Double VLAN mode (DVM) * @hw: pointer to the HW struct * @dvm: output variable to determine if DDP supports DVM(true) or SVM(false) */
drivers/net/ice/base/ice_vlan_mode.h +0 -1
@@ -6,7 +6,6 @@#define _ICE_VLAN_MODE_H_#include "ice_osdep.h" -#include "ice_status.h" struct ice_hw ;
Signature · 1 line
2.26.2
PATCH v3 2/14 net/ice/base: support removing VSI from flow profile
In reply to Qi ZhangAdding a function ice_flow_rem_vsi_prof() to remove flow entries associated to the sw vsi handle. Once complete clear the vsi index from the flow profile bitmap. This will ensure that the a vsi once removed can be re-added and the package block rules will be added again.
--- drivers/net/ice/base/ice_flow.c | 55 +++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_flow.h | 2 ++ 2 files changed, 57 insertions(+)
drivers/net/ice/base/ice_flow.c +55 -0
@@ -3295,6 +3295,61 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, seg->raws_cnt++; } +/** +* ice_flow_rem_vsi_prof - remove vsi from flow profile +* @hw: pointer to the hardware structure +* @blk: classification stage +* @vsi_handle: software VSI handle +* @prof_id: unique ID to identify this flow profile +* +* This function removes the flow entries associated to the input +* vsi handle and disassociates the vsi from the flow profile. +*/ +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk,u16 vsi_handle, +u64 prof_id) +{ +struct ice_flow_prof *prof =NULL ; +enum ice_status status =ICE_SUCCESS ; + +if (blk >=ICE_BLK_COUNT || !ice_is_vsi_valid (hw, vsi_handle)) +return ICE_ERR_PARAM ; + +/* find flow profile pointer with input package block and profile id */ + prof =ice_flow_find_prof_id (hw,ICE_BLK_FD , prof_id); +if (!prof) { +ice_debug (hw,ICE_DBG_PKG , +"Cannot find flow profile id=%" PRIu64"\n" , prof_id); +return ICE_ERR_DOES_NOT_EXIST ; + } + +/* Remove all remaining flow entries before removing the flow profile */ +if (!LIST_EMPTY (&prof->entries)) { +struct ice_flow_entry *e, *t; + +ice_acquire_lock (&prof->entries_lock); +LIST_FOR_EACH_ENTRY_SAFE (e, t, &prof->entries, ice_flow_entry, + l_entry) { +if (e->vsi_handle != vsi_handle) +continue ; + + status =ice_flow_rem_entry_sync (hw, blk, e); +if (status) +break ; + } +ice_release_lock (&prof->entries_lock); + } +if (status) +return status; + +/* disassociate the flow profile from sw vsi handle */ + status =ice_flow_disassoc_prof (hw, blk, prof, vsi_handle); +if (status) +ice_debug (hw,ICE_DBG_PKG , +"ice_flow_disassoc_prof() failed with status=%d\n" , + status); +return status; +} +#define ICE_FLOW_RSS_SEG_HDR_L2_MASKS \ (ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
drivers/net/ice/base/ice_flow.h +2 -0
@@ -553,6 +553,8 @@ ice_flow_set_fld_prefix(struct ice_flow_seg_info *seg, enum ice_flow_field fld,void ice_flow_add_fld_raw (struct ice_flow_seg_info *seg,u16 off,u8 len,u16 val_loc,u16 mask_loc); +enum ice_status ice_flow_rem_vsi_prof (struct ice_hw *hw,enum ice_block blk, +u16 vsi_handle,u64 prof_id);void ice_rem_vsi_rss_list (struct ice_hw *hw,u16 vsi_handle);enum ice_status ice_replay_rss_cfg (struct ice_hw *hw,u16 vsi_handle);enum ice_status
Signature · 1 line
2.26.2
PATCH v3 3/14 net/ice/base: print link configure error
In reply to Qi ZhangNewer NVMs return link_cfg_err for get_link_status AQ. Print it for debug use.
--- drivers/net/ice/base/ice_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ice/base/ice_common.c +1 -0
@@ -460,6 +460,7 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, (unsigned long long)li->phy_type_high);ice_debug (hw,ICE_DBG_LINK ," media_type = 0x%x\n" , *hw_media_type);ice_debug (hw,ICE_DBG_LINK ," link_info = 0x%x\n" , li->link_info); +ice_debug (hw,ICE_DBG_LINK ," link_cfg_err = 0x%x\n" , li->link_cfg_err);ice_debug (hw,ICE_DBG_LINK ," an_info = 0x%x\n" , li->an_info);ice_debug (hw,ICE_DBG_LINK ," ext_info = 0x%x\n" , li->ext_info);ice_debug (hw,ICE_DBG_LINK ," fec_info = 0x%x\n" , li->fec_info);
Signature · 1 line
2.26.2
PATCH v3 4/14 net/ice/base: remove unused ptype field in PTT definition
In reply to Qi ZhangRemove the unused ptype entry, and use the gcc extension for ranged initializers in arrays for Linux, and explicitly target each table entry by index when initializing under Linux.
--- drivers/net/ice/base/ice_lan_tx_rx.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ice/base/ice_lan_tx_rx.h +4 -6
@@ -296,7 +296,6 @@ enum ice_rx_l2_ptype { };struct ice_rx_ptype_decoded { -u32 ptype:10 ;u32 known:1 ;u32 outer_ip:1 ;u32 outer_ip_ver:2 ;
@@ -1217,8 +1216,7 @@ struct ice_tx_drbell_q_ctx {/* macro to make the table lines short */ #define ICE_PTT (PTYPE ,OUTER_IP ,OUTER_IP_VER ,OUTER_FRAG ,T ,TE ,TEF ,I ,PL )\ - { PTYPE, \ - 1, \ + { 1, \ ICE_RX_PTYPE_OUTER_##OUTER_IP, \ ICE_RX_PTYPE_OUTER_##OUTER_IP_VER, \ ICE_RX_PTYPE_##OUTER_FRAG, \
@@ -1228,14 +1226,14 @@ struct ice_tx_drbell_q_ctx { ICE_RX_PTYPE_INNER_PROT_##I, \ ICE_RX_PTYPE_PAYLOAD_LAYER_##PL } -#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { PTYPE, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#define ICE_PTT_UNUSED_ENTRY (PTYPE ) { 0, 0, 0, 0, 0, 0, 0, 0, 0 }/* shorter macros makes the table fit but are terse */ #define ICE_RX_PTYPE_NOF ICE_RX_PTYPE_NOT_FRAG#define ICE_RX_PTYPE_FRG ICE_RX_PTYPE_FRAG -/* Lookup table mapping the HW PTYPE to the bit field for decoding */ -static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = { +/* Lookup table mapping the 10-bit HW PTYPE to the bit field for decoding */ +static const struct ice_rx_ptype_decoded ice_ptype_lkup[1024 ] = {/* L2 Packet types */ ICE_PTT_UNUSED_ENTRY (0 ),ICE_PTT (1 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,PAY2 ),
Signature · 1 line
2.26.2
PATCH v3 5/14 net/ice/base: set MAC type for E823C device
In reply to Qi ZhangSet E823C device's MAC type as generic.
--- drivers/net/ice/base/ice_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/base/ice_common.c +5 -0
@@ -48,6 +48,11 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)case ICE_DEV_ID_E823L_BACKPLANE :case ICE_DEV_ID_E823L_QSFP :case ICE_DEV_ID_E823L_SFP : +case ICE_DEV_ID_E823C_10G_BASE_T : +case ICE_DEV_ID_E823C_BACKPLANE : +case ICE_DEV_ID_E823C_QSFP : +case ICE_DEV_ID_E823C_SFP : +case ICE_DEV_ID_E823C_SGMII : hw->mac_type =ICE_MAC_GENERIC ;break ;default :
Signature · 1 line
2.26.2
PATCH v3 6/14 net/ice/base: add RSS support for PPPoL2TPv2oUDP
In reply to Qi ZhangAdd support for PPPoL2TPv2oUDP RSS hash. L2TPv2 and PPP ptypes and flow headers are added. Prot id for PPP is added.
--- drivers/net/ice/base/ice_flow.c | 65 ++++++++++++++++++------ drivers/net/ice/base/ice_flow.h | 2 + drivers/net/ice/base/ice_protocol_type.h | 1 + 3 files changed, 52 insertions(+), 16 deletions(-)
drivers/net/ice/base/ice_flow.c +49 -16
@@ -212,7 +212,7 @@ static const u32 ice_ptypes_mac_ofos[] = {0xFDC00846 ,0xBFBF7F7E ,0xF70001DF ,0xFEFDFDFB ,0x0000077E ,0x000003FF ,0x00000000 ,0x00000000 ,0x00400000 ,0x03FFF000 ,0xFFFFFFE0 ,0x00100707 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -238,7 +238,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x000002A0 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -252,7 +252,7 @@ static const u32 ice_ptypes_ipv4_ofos_all[] = {0x1DC00000 ,0x24000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000155 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000FC000 ,0x83E0FAA0 ,0x00000101 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03FFD500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -264,7 +264,7 @@ static const u32 ice_ptypes_ipv4_il[] = {0xE0000000 ,0xB807700E ,0x80000003 ,0xE01DC03B ,0x0000000E ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x001FF800 ,0x00100000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC0FC000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -278,7 +278,7 @@ static const u32 ice_ptypes_ipv6_ofos[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -292,7 +292,7 @@ static const u32 ice_ptypes_ipv6_ofos_all[] = {0x00000000 ,0x00000000 ,0x77000000 ,0x10002000 ,0x00000000 ,0x000002AA ,0x00000000 ,0x00000000 ,0x00000000 ,0x03F00000 ,0x7C1F0540 ,0x00000206 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFC002A00 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -304,7 +304,7 @@ static const u32 ice_ptypes_ipv6_il[] = {0x00000000 ,0x03B80770 ,0x000001DC ,0x0EE00000 ,0x00000770 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x7FE00000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x03F00000 ,0x0000003F ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -316,7 +316,7 @@ static const u32 ice_ptypes_ipv4_ofos_no_l4[] = {0x10C00000 ,0x04000800 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x000cc000 ,0x000002A0 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00001500 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -328,7 +328,7 @@ static const u32 ice_ptypes_ipv4_il_no_l4[] = {0x60000000 ,0x18043008 ,0x80000002 ,0x6010c021 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00139800 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x8C08C000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -340,7 +340,7 @@ static const u32 ice_ptypes_ipv6_ofos_no_l4[] = {0x00000000 ,0x00000000 ,0x43000000 ,0x10002000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x02300000 ,0x00000540 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00002A00 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -352,7 +352,7 @@ static const u32 ice_ptypes_ipv6_il_no_l4[] = {0x00000000 ,0x02180430 ,0x0000010c ,0x086010c0 ,0x00000430 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x4e600000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x02300000 ,0x00000023 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -378,7 +378,7 @@ static const u32 ice_ptypes_udp_il[] = {0x81000000 ,0x20204040 ,0x04000010 ,0x80810102 ,0x00000040 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00410000 ,0x908427E0 ,0x00100007 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x10410000 ,0x00000004 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -390,7 +390,7 @@ static const u32 ice_ptypes_tcp_il[] = {0x04000000 ,0x80810102 ,0x10000040 ,0x02040408 ,0x00000102 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00820000 ,0x21084000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x20820000 ,0x00000008 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -402,7 +402,7 @@ static const u32 ice_ptypes_sctp_il[] = {0x08000000 ,0x01020204 ,0x20000081 ,0x04080810 ,0x00000204 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x01040000 ,0x00000000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x41040000 ,0x00000010 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -426,7 +426,7 @@ static const u32 ice_ptypes_icmp_il[] = {0x00000000 ,0x02040408 ,0x40000102 ,0x08101020 ,0x00000408 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x42108000 ,0x00000000 , -0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x82080000 ,0x00000020 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -725,6 +725,28 @@ static const u32 ice_ptypes_udp_ecpri_tp0[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +static const u32 ice_ptypes_l2tpv2[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFFF00 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; + +static const u32 ice_ptypes_ppp[] = { +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0xFFFFF000 ,0x0000003F ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +0x00000000 ,0x00000000 ,0x00000000 ,0x00000000 , +}; +/* Manage parameters and info. used during the creation of a flow profile */ struct ice_flow_prof_params {enum ice_block blk;
@@ -750,7 +772,8 @@ struct ice_flow_prof_params {ICE_FLOW_SEG_HDR_PFCP_SESSION |ICE_FLOW_SEG_HDR_L2TPV3 | \ICE_FLOW_SEG_HDR_ESP |ICE_FLOW_SEG_HDR_AH | \ICE_FLOW_SEG_HDR_NAT_T_ESP |ICE_FLOW_SEG_HDR_GTPU_NON_IP | \ - ICE_FLOW_SEG_HDR_ECPRI_TP0 | ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0) +ICE_FLOW_SEG_HDR_ECPRI_TP0 |ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0 | \ + ICE_FLOW_SEG_HDR_L2TPV2 | ICE_FLOW_SEG_HDR_PPP) #define ICE_FLOW_SEG_HDRS_L2_MASK \ (ICE_FLOW_SEG_HDR_ETH |ICE_FLOW_SEG_HDR_VLAN )
@@ -1006,6 +1029,10 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)/* Attributes for GTP packet without Extension Header */ params->attr = ice_attr_gtpu_session; params->attr_cnt =ARRAY_SIZE (ice_attr_gtpu_session); + }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV2 ) { + src = (const ice_bitmap_t *)ice_ptypes_l2tpv2; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); }else if (hdrs &ICE_FLOW_SEG_HDR_L2TPV3 ) { src = (const ice_bitmap_t *)ice_ptypes_l2tpv3; ice_and_bitmap(params->ptypes, params->ptypes,
@@ -1032,6 +1059,12 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) src, ICE_FLOW_PTYPE_MAX); } +if (hdrs &ICE_FLOW_SEG_HDR_PPP ) { + src = (const ice_bitmap_t *)ice_ptypes_ppp; +ice_and_bitmap (params->ptypes, params->ptypes, + src,ICE_FLOW_PTYPE_MAX ); + } +if (hdrs &ICE_FLOW_SEG_HDR_PFCP ) {if (hdrs &ICE_FLOW_SEG_HDR_PFCP_NODE ) src =
drivers/net/ice/base/ice_flow.h +2 -0
@@ -185,6 +185,8 @@ enum ice_flow_seg_hdr {ICE_FLOW_SEG_HDR_VXLAN =0x02000000 ,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 ,/* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs */
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -154,6 +154,7 @@ enum ice_prot_id {ICE_PROT_PPPOE =103 ,ICE_PROT_L2TPV3 =104 ,ICE_PROT_ECPRI =105 , +ICE_PROT_PPP =106 ,ICE_PROT_ATAOE_OF =114 ,ICE_PROT_CTRL_OF =116 , ICE_PROT_LLDP_OF = 117,
Signature · 1 line
2.26.2
PATCH v3 7/14 net/ice/base: change protocol ID for VLAN in case of DVM
In reply to Qi ZhangProtocol id for first vlan in Double VLAN Mode (DVM) should be ICE_VLAN_OF_HW = 16, but for Single VLAN Mode (SVM) this should be ICE_VLAN_OL_HW = 17.
Change protocol id in type to id translation array for outer vlan to 17 when DVM is enabled, which means the driver, package, and firmware support DVM.
--- drivers/net/ice/base/ice_flex_pipe.c | 3 +++ drivers/net/ice/base/ice_switch.c | 19 ++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_pipe.c +3 -0
@@ -1244,6 +1244,9 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg)ice_cache_vlan_mode (hw); +if (ice_is_dvm_ena (hw)) +ice_change_proto_id_to_dvm (); +return status; }
drivers/net/ice/base/ice_switch.c +18 -1
@@ -6538,7 +6538,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {* following policy. */ -static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { +static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST ] = { {ICE_MAC_OFOS ,ICE_MAC_OFOS_HW }, {ICE_MAC_IL ,ICE_MAC_IL_HW }, {ICE_ETYPE_OL ,ICE_ETYPE_OL_HW },
@@ -6643,6 +6643,23 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,return ICE_MAX_NUM_RECIPES ; } +/** +* ice_change_proto_id_to_dvm - change proto id in prot_id_tbl +* +* As protocol id for outer vlan is different in dvm and svm, if dvm is +* supported protocol array record for outer vlan has to be modified to +* reflect the value proper for DVM. +*/ +void ice_change_proto_id_to_dvm (void ) +{ +u8 i; + +for (i =0 ; i <ARRAY_SIZE (ice_prot_id_tbl); i++) +if (ice_prot_id_tbl[i].type ==ICE_VLAN_OFOS && + ice_prot_id_tbl[i].protocol_id !=ICE_VLAN_OF_HW ) + ice_prot_id_tbl[i].protocol_id =ICE_VLAN_OF_HW ; +} +/** * ice_prot_type_to_id - get protocol ID from protocol type * @type: protocol type
drivers/net/ice/base/ice_switch.h +1 -0
@@ -535,4 +535,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type);enum ice_status ice_update_recipe_lkup_idx (struct ice_hw *hw,struct ice_update_recipe_lkup_idx_params *params); +void ice_change_proto_id_to_dvm (void );#endif /* _ICE_SWITCH_H_ */
Signature · 1 line
2.26.2
PATCH v3 8/14 net/ice/base: add priority check of matching recipe
In reply to Qi ZhangCheck priority when look for a recipe which matches our request to enable flow priority for switch filter.
--- drivers/net/ice/base/ice_switch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ice/base/ice_switch.c +5 -4
@@ -6574,7 +6574,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {* Returns index of matching recipe, or ICE_MAX_NUM_RECIPES if not found. */ static u16 ice_find_recp (struct ice_hw *hw,struct ice_prot_lkup_ext *lkup_exts, -enum ice_sw_tunnel_type tun_type) +enum ice_sw_tunnel_type tun_type,u32 priority) {bool refresh_required = true;struct ice_sw_recipe *recp;
@@ -6636,7 +6636,8 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,/* If for "i"th recipe the found was never set to false * then it means we found our match */ -if (tun_type == recp[i].tun_type && found) +if (tun_type == recp[i].tun_type && found && + priority == recp[i].priority)return i;/* Return the recipe ID */ } }
@@ -7650,7 +7651,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, }/* Look for a recipe which matches our requested fv / mask list */ - *rid =ice_find_recp (hw, lkup_exts, rinfo->tun_type); + *rid =ice_find_recp (hw, lkup_exts, rinfo->tun_type, rinfo->priority);if (*rid <ICE_MAX_NUM_RECIPES )/* Success if found a recipe that match the existing criteria */ goto err_unroll;
@@ -8779,7 +8780,7 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,if (status)return status; - rid =ice_find_recp (hw, &lkup_exts, rinfo->tun_type); + rid =ice_find_recp (hw, &lkup_exts, rinfo->tun_type, rinfo->priority);/* If did not find a recipe that match the existing criteria */ if (rid ==ICE_MAX_NUM_RECIPES )return ICE_ERR_PARAM ;
Signature · 1 line
2.26.2
PATCH v3 9/14 net/ice/base: enable I2C read/write commands
In reply to Qi ZhangEnable I2C read/write AQ commands. They are now required for controlling the external physical connectors via external I2C port expander on E810-T adapters.
--- drivers/net/ice/base/ice_adminq_cmd.h | 29 +++++++++ drivers/net/ice/base/ice_common.c | 94 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 8 +++ 3 files changed, 131 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +29 -0
@@ -1665,6 +1665,31 @@ struct ice_aqc_get_link_topo {u8 rsvd[9 ]; }; +/* Read/Write I2C (direct, 0x06E2/0x06E3) */ +struct ice_aqc_i2c { +struct ice_aqc_link_topo_addr topo_addr; +__le16 i2c_addr; +u8 i2c_params; +#define ICE_AQC_I2C_DATA_SIZE_S 0 +#define ICE_AQC_I2C_DATA_SIZE_M (0xF << ICE_AQC_I2C_DATA_SIZE_S) +#define ICE_AQC_I2C_ADDR_TYPE_M BIT(4) +#define ICE_AQC_I2C_ADDR_TYPE_7BIT 0 +#define ICE_AQC_I2C_ADDR_TYPE_10BIT ICE_AQC_I2C_ADDR_TYPE_M +#define ICE_AQC_I2C_DATA_OFFSET_S 5 +#define ICE_AQC_I2C_DATA_OFFSET_M (0x3 << ICE_AQC_I2C_DATA_OFFSET_S) +#define ICE_AQC_I2C_USE_REPEATED_START BIT(7) +u8 rsvd; +__le16 i2c_bus_addr; +#define ICE_AQC_I2C_ADDR_7BIT_MASK 0x7F +#define ICE_AQC_I2C_ADDR_10BIT_MASK 0x3FF +u8 i2c_data[4 ];/* Used only by write command, reserved in read. */ +}; + +/* Read I2C Response (direct, 0x06E2) */ +struct ice_aqc_read_i2c_resp { +u8 i2c_data[16 ]; +}; +/* Set Port Identification LED (direct, 0x06E9) */ struct ice_aqc_set_port_id_led {u8 lport_num;
@@ -2838,6 +2863,8 @@ struct ice_aq_desc {struct ice_aqc_get_phy_caps get_phy;struct ice_aqc_set_phy_cfg set_phy;struct ice_aqc_restart_an restart_an; +struct ice_aqc_i2c read_write_i2c; +struct ice_aqc_read_i2c_resp read_i2c_resp;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led;struct ice_aqc_get_sw_cfg get_sw_conf;
@@ -3074,6 +3101,8 @@ enum ice_adminq_opc { ice_aqc_opc_set_event_mask =0x0613 , ice_aqc_opc_set_mac_lb =0x0620 , ice_aqc_opc_get_link_topo =0x06E0 , + ice_aqc_opc_read_i2c =0x06E2 , + ice_aqc_opc_write_i2c =0x06E3 , ice_aqc_opc_set_port_id_led =0x06E9 , ice_aqc_opc_get_port_options =0x06EA , ice_aqc_opc_set_port_option = 0x06EB,
drivers/net/ice/base/ice_common.c +94 -0
100 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +8 -0
@@ -225,5 +225,13 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw);enum ice_status ice_lldp_fltr_add_remove (struct ice_hw *hw,u16 vsi_num,bool add); +enum ice_status +ice_aq_read_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_write_i2c (struct ice_hw *hw,struct ice_aqc_link_topo_addr topo_addr, +u16 bus_addr,__le16 addr,u8 params,u8 *data, +struct ice_sq_cd *cd);bool ice_fw_supports_report_dflt_cfg (struct ice_hw *hw);#endif /* _ICE_COMMON_H_ */
Signature · 1 line
2.26.2
PATCH v3 10/14 net/ice/base: add set/get GPIO helper functions
In reply to Qi ZhangAdd helper functions to set the GPIO pin state or get the value of a GPIO signal that's the part of the topology based on AQ commands. This change is needed to setup GPIO pins state for PTP, SyncE etc.
--- drivers/net/ice/base/ice_adminq_cmd.h | 11 +++++ drivers/net/ice/base/ice_common.c | 58 +++++++++++++++++++++++++++ drivers/net/ice/base/ice_common.h | 6 +++ 3 files changed, 75 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +11 -0
@@ -1701,6 +1701,16 @@ struct ice_aqc_set_port_id_led {u8 rsvd[13 ]; }; +/* Set/Get GPIO (direct, 0x06EC/0x06ED) */ +struct ice_aqc_gpio { +__le16 gpio_ctrl_handle; +#define ICE_AQC_GPIO_HANDLE_S 0 +#define ICE_AQC_GPIO_HANDLE_M (0x3FF << ICE_AQC_GPIO_HANDLE_S) +u8 gpio_num; +u8 gpio_val; +u8 rsvd[12 ]; +}; +/* Read/Write SFF EEPROM command (indirect 0x06EE) */ struct ice_aqc_sff_eeprom {u8 lport_num;
@@ -2865,6 +2875,7 @@ struct ice_aq_desc {struct ice_aqc_restart_an restart_an;struct ice_aqc_i2c read_write_i2c;struct ice_aqc_read_i2c_resp read_i2c_resp; +struct ice_aqc_gpio read_write_gpio;struct ice_aqc_sff_eeprom read_write_sff_param;struct ice_aqc_set_port_id_led set_port_id_led;struct ice_aqc_get_sw_cfg get_sw_conf;
drivers/net/ice/base/ice_common.c +58 -0
64 lines not on this page · raw message
drivers/net/ice/base/ice_common.h +6 -0
@@ -220,6 +220,12 @@ enum ice_status ice_sched_query_elem(struct ice_hw *hw, u32 node_teid, struct ice_aqc_txsched_elem_data *buf);enum ice_status +ice_aq_set_gpio (struct ice_hw *hw,u16 gpio_ctrl_handle,u8 pin_idx,bool value, +struct ice_sq_cd *cd); +enum ice_status +ice_aq_get_gpio (struct ice_hw *hw,u16 gpio_ctrl_handle,u8 pin_idx, +bool *value,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);bool ice_fw_supports_lldp_fltr_ctrl (struct ice_hw *hw);
Signature · 1 line
2.26.2
PATCH v3 11/14 net/ice/base: add inner VLAN protocol type for QinQ filter
In reply to Qi ZhangSince VLAN protocol type 'ICE_VLAN_OFOS' has been changed to map the hardware VLAN protocol ID to 'ICE_VLAN_OF_HW (16)' when in Double VLAN mode, and to 'ICE_VLAN_OL_HW (17)' when in Single VLAN mode.
So 'ICE_VLAN_OFOS' can't be used with 'ICE_VLAN_EX' which is outer VLAN hardware protocol ID 'ICE_VLAN_OF_HW (16)' to do the QinQ VLAN pattern.
Introduce the new inner VLAN protocol type 'ICE_VLAN_IN', which is inner VLAN hardware protocol ID 'ICE_VLAN_OL_HW (17)'.
Now for QinQ VLAN pattern, the protocol 'ICE_VLAN_EX' and 'ICE_VLAN_IN' should be used to set the related protocol header fields like VLAN ID.
--- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_switch.c | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/ice/base/ice_protocol_type.h +1 -0
@@ -53,6 +53,7 @@ enum ice_protocol_type {ICE_NAT_T ,ICE_GTP_NO_PAY ,ICE_VLAN_EX , +ICE_VLAN_IN , ICE_PROTOCOL_LAST };
drivers/net/ice/base/ice_switch.c +13 -10
@@ -1612,7 +1612,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_ipv4_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_IPV4_OFOS, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1625,7 +1625,7 @@ static const u8 dummy_qinq_ipv4_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x08 ,0x00 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x08 ,0x00 ,/* ICE_VLAN_IN 18 */ 0x45 ,0x00 ,0x00 ,0x1c ,/* ICE_IPV4_OFOS 22 */ 0x00, 0x01, 0x00, 0x00,
@@ -1643,7 +1643,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_ipv6_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_IPV6_OFOS, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1656,7 +1656,7 @@ static const u8 dummy_qinq_ipv6_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x86 ,0xDD ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x86 ,0xDD ,/* ICE_VLAN_IN 18 */ 0x60 ,0x00 ,0x00 ,0x00 ,/* ICE_IPV6_OFOS 22 */ 0x00, 0x10, 0x11, 0x00, /* Next header UDP */
@@ -1682,7 +1682,7 @@ static const struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_PROTOCOL_LAST, 0 }, };
@@ -1692,7 +1692,7 @@ struct ice_dummy_pkt_offsets dummy_qinq_pppoe_ipv4_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14 }, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_IPV4_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 },
@@ -1706,14 +1706,14 @@ static const u8 dummy_qinq_pppoe_ipv4_pkt[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_IN 18 */ 0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 22 */ 0x00 ,0x16 ,0x00 ,0x21 ,/* PPP Link Layer 28 */ -0x45 ,0x00 ,0x00 ,0x14 ,/* ICE_IPV4_IL 30 */ +0x45 ,0x00 ,0x00 ,0x14 ,/* ICE_IPV4_OFOS 30 */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , 0x00, 0x00, 0x00, 0x00,
@@ -1727,7 +1727,7 @@ struct ice_dummy_pkt_offsets dummy_qinq_pppoe_packet_ipv6_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, { ICE_VLAN_EX, 14}, - { ICE_VLAN_OFOS, 18 }, + { ICE_VLAN_IN, 18 }, { ICE_PPPOE, 22 }, { ICE_IPV6_OFOS, 30 }, { ICE_PROTOCOL_LAST, 0 },
@@ -1741,7 +1741,7 @@ static const u8 dummy_qinq_pppoe_ipv6_packet[] = {0x91 ,0x00 ,/* ICE_ETYPE_OL 12 */ 0x00 ,0x00 ,0x81 ,0x00 ,/* ICE_VLAN_EX 14 */ -0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_OFOS 18 */ +0x00 ,0x00 ,0x88 ,0x64 ,/* ICE_VLAN_IN 18 */ 0x11 ,0x00 ,0x00 ,0x00 ,/* ICE_PPPOE 22 */ 0x00, 0x2a,
@@ -6530,6 +6530,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = { { ICE_NAT_T, { 8, 10, 12, 14 } }, { ICE_GTP_NO_PAY, { 8, 10, 12, 14 } }, { ICE_VLAN_EX, { 0, 2 } }, + { ICE_VLAN_IN, { 0, 2 } }, };/* The following table describes preferred grouping of recipes.
@@ -6564,6 +6565,7 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_NAT_T, ICE_UDP_ILOS_HW }, { ICE_GTP_NO_PAY, ICE_UDP_ILOS_HW }, { ICE_VLAN_EX, ICE_VLAN_OF_HW }, + { ICE_VLAN_IN, ICE_VLAN_OL_HW }, };/**
@@ -8139,6 +8141,7 @@ ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,break ;case ICE_VLAN_OFOS :case ICE_VLAN_EX : +case ICE_VLAN_IN : len =sizeof (struct ice_vlan_hdr );break ;case ICE_IPV4_OFOS :
Signature · 1 line
2.26.2
PATCH v3 12/14 net/ice/base: fix QinQ PPPoE dummy pkt selection
In reply to Qi ZhangThe dummy packet should be QinQ PPPoE ipv6 when ppp protocol is ipv6.
--- drivers/net/ice/base/ice_switch.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ice/base/ice_switch.c +5 -0
@@ -7808,6 +7808,11 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, *pkt_len =sizeof (dummy_qinq_pppoe_ipv4_pkt); *offsets = dummy_qinq_pppoe_ipv4_packet_offsets;return ; + }else if (tun_type ==ICE_SW_TUN_PPPOE_QINQ && ipv6) { + *pkt = dummy_qinq_pppoe_ipv6_packet; + *pkt_len =sizeof (dummy_qinq_pppoe_ipv6_packet); + *offsets = dummy_qinq_pppoe_packet_offsets; +return ; }else if (tun_type ==ICE_SW_TUN_PPPOE_QINQ || tun_type ==ICE_SW_TUN_PPPOE_PAY_QINQ ) { *pkt = dummy_qinq_pppoe_ipv4_pkt;
Signature · 1 line
2.26.2
PATCH v3 13/14 net/ice/base: add PTYPE values for PPPoL2TPv2oUDP
In reply to Qi ZhangAdd some new macros of PTYPE values to support PPPoL2TPv2oUDP.
--- drivers/net/ice/base/ice_flex_type.h | 31 +++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_type.h +30 -1
@@ -416,7 +416,36 @@ enum ice_sect {#define ICE_MAC_IPV6_PFCP_SESSION 354#define ICE_MAC_IPV4_L2TPV3 360#define ICE_MAC_IPV6_L2TPV3 361 - +#define ICE_MAC_IPV4_L2TPV2_CONTROL 392 +#define ICE_MAC_IPV6_L2TPV2_CONTROL 393 +#define ICE_MAC_IPV4_L2TPV2 394 +#define ICE_MAC_IPV6_L2TPV2 395 +#define ICE_MAC_IPV4_PPPOL2TPV2 396 +#define ICE_MAC_IPV6_PPPOL2TPV2 397 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_FRAG 398 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_PAY 399 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_UDP_PAY 400 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_TCP 401 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_SCTP 402 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_ICMP 403 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_FRAG 404 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_PAY 405 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_UDP_PAY 406 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_TCP 407 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_SCTP 408 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_ICMPV6 409 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_FRAG 410 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_PAY 411 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_UDP_PAY 412 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_TCP 413 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_SCTP 414 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_ICMP 415 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_FRAG 416 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_PAY 417 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_UDP_PAY 418 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_TCP 419 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_SCTP 420 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_ICMPV6 421/* Attributes that can modify PTYPE definitions. *
Signature · 1 line
2.26.2
PATCH v3 14/14 net/ice/base: allow support for GTP-U filter using only inner protocols
In reply to Qi ZhangAdds a support for switch filter: GTP-U using just inner fields. If user doesn't specify outer protocol and its fields but wants to add switch filter for GTP-U using inner protocols and related fields such as inner L3 and/or inner L4, this patch enables such filtering.
--- drivers/net/ice/base/ice_protocol_type.h | 2 ++ drivers/net/ice/base/ice_switch.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ice/base/ice_protocol_type.h +2 -0
@@ -110,6 +110,8 @@ enum ice_sw_tunnel_type {ICE_SW_TUN_IPV4_GTPU_IPV6 ,ICE_SW_TUN_IPV6_GTPU_IPV4 ,ICE_SW_TUN_IPV6_GTPU_IPV6 , +ICE_SW_TUN_GTP_IPV4 , +ICE_SW_TUN_GTP_IPV6 , ICE_ALL_TUNNELS /* All tunnel types including NVGRE */ };
drivers/net/ice/base/ice_switch.c +4 -2
@@ -7980,13 +7980,15 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, }/* Support GTP tunnel + L3 */ -if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV4 ) { +if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV4 || + tun_type ==ICE_SW_TUN_GTP_IPV4 ) { *pkt = dummy_ipv4_gtpu_ipv4_packet; *pkt_len =sizeof (dummy_ipv4_gtpu_ipv4_packet); *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;return ; } -if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV6 ) { +if (tun_type ==ICE_SW_TUN_IPV4_GTPU_IPV6 || + tun_type ==ICE_SW_TUN_GTP_IPV6 ) { *pkt = dummy_ipv4_gtpu_ipv6_packet; *pkt_len =sizeof (dummy_ipv4_gtpu_ipv6_packet); *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;
Signature · 1 line
2.26.2