From 05d45effe727e9fe51124559cba919221c558792 Mon Sep 17 00:00:00 2001 From: Aleksandr Loktionov Date: Tue, 14 Jan 2025 14:03:07 +0000 Subject: [PATCH] ice: Add PF GTP-U RSS/FDIR configuration support for VFs This patch adds support for configuring GTP-U and PPPoE RSS and Flow Director (FDIR) offloads for Virtual Functions (VFs) in the ice driver. Key features introduced: - Support for GTP-U over IPv4/IPv6 with optional extension headers. - Inner IPv4/UDP/TCP matching for AVF FDIR: - ipv4 + gtpu/gtpu_eh + ipv4 + udp/tcp - PPPoE session ID-based flow classification. - Raw pattern-based RSS and FDIR programming via virtchnl. - Symmetric hashing support for raw and protocol-based flows. - Enhanced virtchnl interface to support new offload capabilities. The implementation includes: - Flow engine and parser updates to support new protocol fields. - Virtchnl interface extensions for VF-PF communication. - RSS and FDIR profile management improvements. - Conflict resolution and rollback logic for overlapping profiles. - Backward compatibility with existing AVF and DCF implementations. Tested with AVF and DCF drivers supporting the extended virtchnl interface and validated with representative GTP-U and PPPoE traffic patterns. Signed-off-by: Aleksandr Loktionov --- .../net/ethernet/intel/iavf/iavf_adv_rss.c | 48 + .../net/ethernet/intel/iavf/iavf_adv_rss.h | 32 + .../net/ethernet/intel/iavf/iavf_ethtool.c | 74 + drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- .../net/ethernet/intel/ice/ice_adminq_cmd.h | 12 + drivers/net/ethernet/intel/ice/ice_ethtool.c | 15 +- .../net/ethernet/intel/ice/ice_ethtool_fdir.c | 26 +- drivers/net/ethernet/intel/ice/ice_fdir.c | 4203 +++++++++++++++-- drivers/net/ethernet/intel/ice/ice_fdir.h | 131 +- .../net/ethernet/intel/ice/ice_flex_pipe.c | 223 +- .../net/ethernet/intel/ice/ice_flex_pipe.h | 14 +- .../net/ethernet/intel/ice/ice_flex_type.h | 252 +- drivers/net/ethernet/intel/ice/ice_flow.c | 974 +++- drivers/net/ethernet/intel/ice/ice_flow.h | 211 +- .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 2 + drivers/net/ethernet/intel/ice/ice_lib.c | 13 +- drivers/net/ethernet/intel/ice/ice_main.c | 8 +- drivers/net/ethernet/intel/ice/ice_parser.c | 4 +- drivers/net/ethernet/intel/ice/ice_parser.h | 1 + .../ethernet/intel/ice/ice_protocol_type.h | 24 +- drivers/net/ethernet/intel/ice/ice_switch.c | 4 +- drivers/net/ethernet/intel/ice/ice_type.h | 195 + drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 46 + drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1439 +++++- .../ethernet/intel/ice/ice_virtchnl_fdir.c | 171 +- include/linux/avf/virtchnl.h | 64 +- 27 files changed, 7460 insertions(+), 732 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_adv_rss.c b/drivers/net/ethernet/intel/iavf/iavf_adv_rss.c index a9e1da35e24898..194d6e5d9261a1 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_adv_rss.c +++ b/drivers/net/ethernet/intel/iavf/iavf_adv_rss.c @@ -90,6 +90,38 @@ iavf_fill_adv_rss_sctp_hdr(struct virtchnl_proto_hdr *hdr, u64 hash_flds) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, SCTP, DST_PORT); } +/** + * iavf_fill_adv_rss_gtpeh_hdr - fill the GTP-EH RSS protocol header + * @hdr: the virtchnl message protocol header data structure + * @hash_flds: the RSS configuration protocol hash fields + */ +static int +iavf_fill_adv_rss_gtp_hdr(struct virtchnl_proto_hdrs *proto_hdrs, u32 packet_hdrs, u64 hash_flds) +{ + struct virtchnl_proto_hdr *hdr; + + hdr = &proto_hdrs->proto_hdr[proto_hdrs->count++]; + switch (packet_hdrs & IAVF_ADV_RSS_FLOW_SEG_HDR_GTP) { + case IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC: + VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GTPC); + break; + case IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_EH: + VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GTPU_EH); + break; + case IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_UP: + VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GTPU_EH_PDU_UP); + break; + case IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_DWN: + VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GTPU_EH_PDU_DWN); + break; + default: + return -EINVAL; + + } + + return 0; +} + /** * iavf_fill_adv_rss_cfg_msg - fill the RSS configuration into virtchnl message * @rss_cfg: the virtchnl message to be filled with RSS configuration setting @@ -125,6 +157,10 @@ iavf_fill_adv_rss_cfg_msg(struct virtchnl_rss_cfg *rss_cfg, return -EINVAL; } + if(packet_hdrs & IAVF_ADV_RSS_FLOW_SEG_HDR_GTP) { + return iavf_fill_adv_rss_gtp_hdr(proto_hdrs, packet_hdrs, hash_flds); + } + hdr = &proto_hdrs->proto_hdr[proto_hdrs->count++]; switch (packet_hdrs & IAVF_ADV_RSS_FLOW_SEG_HDR_L4) { case IAVF_ADV_RSS_FLOW_SEG_HDR_TCP: @@ -186,6 +222,8 @@ iavf_print_adv_rss_cfg(struct iavf_adapter *adapter, struct iavf_adv_rss *rss, proto = "UDP"; else if (packet_hdrs & IAVF_ADV_RSS_FLOW_SEG_HDR_SCTP) proto = "SCTP"; + else if (packet_hdrs & IAVF_ADV_RSS_FLOW_SEG_HDR_GTP) + proto = "GTP"; else return; @@ -211,6 +249,16 @@ iavf_print_adv_rss_cfg(struct iavf_adapter *adapter, struct iavf_adv_rss *rss, IAVF_ADV_RSS_HASH_FLD_UDP_DST_PORT | IAVF_ADV_RSS_HASH_FLD_SCTP_DST_PORT)) strcat(hash_opt, "dst port,"); + if (hash_flds & IAVF_ADV_RSS_HASH_FLD_GTPC_TEID) + strcat(hash_opt, "gtp-c,"); + if (hash_flds & IAVF_ADV_RSS_HASH_FLD_GTPU_IP_TEID) + strcat(hash_opt, "gtp-u ip,"); + if (hash_flds & IAVF_ADV_RSS_HASH_FLD_GTPU_EH_TEID) + strcat(hash_opt, "gtp-u ext,"); + if (hash_flds & IAVF_ADV_RSS_HASH_FLD_GTPU_UP_TEID) + strcat(hash_opt, "gtp-u ul,"); + if (hash_flds & IAVF_ADV_RSS_HASH_FLD_GTPU_DWN_TEID) + strcat(hash_opt, "gtp-u dl,"); if (!action) action = ""; diff --git a/drivers/net/ethernet/intel/iavf/iavf_adv_rss.h b/drivers/net/ethernet/intel/iavf/iavf_adv_rss.h index e31eb2afebeabd..01d86e211d0603 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_adv_rss.h +++ b/drivers/net/ethernet/intel/iavf/iavf_adv_rss.h @@ -22,6 +22,13 @@ enum iavf_adv_rss_flow_seg_hdr { IAVF_ADV_RSS_FLOW_SEG_HDR_TCP = 0x00000004, IAVF_ADV_RSS_FLOW_SEG_HDR_UDP = 0x00000008, IAVF_ADV_RSS_FLOW_SEG_HDR_SCTP = 0x00000010, + /* RESERVED */ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC = 0x00000400, + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC_TEID = 0x00000800, + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_IP = 0x00001000, + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_EH = 0x00002000, + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_DWN = 0x00004000, + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_UP = 0x00008000, }; #define IAVF_ADV_RSS_FLOW_SEG_HDR_L3 \ @@ -33,6 +40,14 @@ enum iavf_adv_rss_flow_seg_hdr { IAVF_ADV_RSS_FLOW_SEG_HDR_UDP | \ IAVF_ADV_RSS_FLOW_SEG_HDR_SCTP) +#define IAVF_ADV_RSS_FLOW_SEG_HDR_GTP \ + (IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC | \ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC_TEID| \ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_IP| \ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_EH| \ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_DWN| \ + IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_UP) + enum iavf_adv_rss_flow_field { /* L3 */ IAVF_ADV_RSS_FLOW_FIELD_IDX_IPV4_SA, @@ -46,6 +61,17 @@ enum iavf_adv_rss_flow_field { IAVF_ADV_RSS_FLOW_FIELD_IDX_UDP_DST_PORT, IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_SRC_PORT, IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_DST_PORT, + /* GTPC_TEID */ + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPC_TEID, + /* GTPU_IP */ + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_IP_TEID, + /* GTPU_EH */ + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_EH_TEID, + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_EH_QFI, + /* GTPU_UP */ + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_UP_TEID, + /* GTPU_DWN */ + IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_DWN_TEID, /* The total number of enums must not exceed 64 */ IAVF_ADV_RSS_FLOW_FIELD_IDX_MAX @@ -72,6 +98,12 @@ enum iavf_adv_rss_flow_field { BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_SRC_PORT) #define IAVF_ADV_RSS_HASH_FLD_SCTP_DST_PORT \ BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_DST_PORT) +#define IAVF_ADV_RSS_HASH_FLD_GTPC_TEID BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPC_TEID) +#define IAVF_ADV_RSS_HASH_FLD_GTPU_IP_TEID BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_IP_TEID) +#define IAVF_ADV_RSS_HASH_FLD_GTPU_EH_TEID BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_EH_TEID) +#define IAVF_ADV_RSS_HASH_FLD_GTPU_UP_TEID BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_UP_TEID) +#define IAVF_ADV_RSS_HASH_FLD_GTPU_DWN_TEID \ + BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_GTPU_DWN_TEID) /* bookkeeping of advanced RSS configuration */ struct iavf_adv_rss { diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index 74a1e9fe182128..3fc13dcebc2af6 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1349,6 +1349,42 @@ static u32 iavf_adv_rss_parse_hdrs(struct ethtool_rxnfc *cmd) hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_SCTP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; break; + case GTPU_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_IP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPC_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPC_TEID_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC_TEID | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPU_EH_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_EH | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPU_UL_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_UP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPU_DL_V4_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_DWN | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4; + break; + case GTPU_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_IP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; + case GTPC_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; + case GTPC_TEID_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPC_TEID | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; + case GTPU_EH_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_EH | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; + case GTPU_UL_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_UP | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; + case GTPU_DL_V6_FLOW: + hdrs |= IAVF_ADV_RSS_FLOW_SEG_HDR_GTPU_DWN | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6; + break; default: break; } @@ -1373,6 +1409,12 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd, bool symm) case TCP_V4_FLOW: case UDP_V4_FLOW: case SCTP_V4_FLOW: + case GTPU_V4_FLOW: + case GTPC_V4_FLOW: + case GTPC_TEID_V4_FLOW: + case GTPU_EH_V4_FLOW: + case GTPU_UL_V4_FLOW: + case GTPU_DL_V4_FLOW: if (cmd->data & RXH_IP_SRC) hfld |= IAVF_ADV_RSS_HASH_FLD_IPV4_SA; if (cmd->data & RXH_IP_DST) @@ -1381,6 +1423,12 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd, bool symm) case TCP_V6_FLOW: case UDP_V6_FLOW: case SCTP_V6_FLOW: + case GTPU_V6_FLOW: + case GTPC_V6_FLOW: + case GTPC_TEID_V6_FLOW: + case GTPU_EH_V6_FLOW: + case GTPU_UL_V6_FLOW: + case GTPU_DL_V6_FLOW: if (cmd->data & RXH_IP_SRC) hfld |= IAVF_ADV_RSS_HASH_FLD_IPV6_SA; if (cmd->data & RXH_IP_DST) @@ -1418,6 +1466,32 @@ static u64 iavf_adv_rss_parse_hash_flds(struct ethtool_rxnfc *cmd, bool symm) break; } } + if (cmd->data & RXH_GTP_TEID) { + switch (cmd->flow_type) { + case GTPC_TEID_V4_FLOW: + case GTPC_TEID_V6_FLOW: + hfld |= IAVF_ADV_RSS_HASH_FLD_GTPC_TEID; + break; + case GTPU_V4_FLOW: + case GTPU_V6_FLOW: + hfld |= IAVF_ADV_RSS_HASH_FLD_GTPU_IP_TEID; + break; + case GTPU_EH_V4_FLOW: + case GTPU_EH_V6_FLOW: + hfld |= IAVF_ADV_RSS_HASH_FLD_GTPU_EH_TEID; + break; + case GTPU_UL_V4_FLOW: + case GTPU_UL_V6_FLOW: + hfld |= IAVF_ADV_RSS_HASH_FLD_GTPU_UP_TEID; + break; + case GTPU_DL_V4_FLOW: + case GTPU_DL_V6_FLOW: + hfld |= IAVF_ADV_RSS_HASH_FLD_GTPU_DWN_TEID; + break; + default: + break; + } + } return hfld; } diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index f782402cd78986..827180b239783d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -20,7 +20,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw); char iavf_driver_name[] = "iavf"; static const char iavf_driver_string[] = - "Intel(R) Ethernet Adaptive Virtual Function Network Driver"; + "Intel(R) Ethernet Adaptive Virtual Function Network Driver +GTP-Uv15"; static const char iavf_copyright[] = "Copyright (c) 2013 - 2018 Intel Corporation."; diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h index 0be1a98d7cc1b5..ad9c5038b90bf8 100644 --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h @@ -2033,6 +2033,16 @@ struct ice_aqc_get_set_rss_lut { __le32 addr_low; }; +/* Clear FD Table Command (direct, 0x0B06) */ +struct ice_aqc_clear_fd_table { + u8 clear_type; +#define CL_FD_VM_VF_TYPE_VSI_IDX 1 +#define CL_FD_VM_VF_TYPE_PF_IDX 2 + u8 rsvd; + __le16 vsi_index; + u8 reserved[12]; +}; + /* Sideband Control Interface Commands */ /* Neighbor Device Request (indirect 0x0C00); also used for the response. */ struct ice_aqc_neigh_dev_req { @@ -2596,6 +2606,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; + struct ice_aqc_clear_fd_table clear_fd_table; struct ice_aqc_neigh_dev_req neigh_dev; struct ice_aqc_add_txqs add_txqs; struct ice_aqc_dis_txqs dis_txqs; @@ -2791,6 +2802,7 @@ enum ice_adminq_opc { ice_aqc_opc_set_rss_lut = 0x0B03, ice_aqc_opc_get_rss_key = 0x0B04, ice_aqc_opc_get_rss_lut = 0x0B05, + ice_aqc_opc_clear_fd_table = 0x0B06, /* Sideband Control Interface commands */ ice_aqc_opc_neighbour_device_request = 0x0C00, diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index d5cc934d135949..4a85d6b199f855 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -2883,6 +2883,19 @@ static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc) return hdrs; } +#define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) +#define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) +#define ICE_FLOW_HASH_FLD_IPV4_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) +#define ICE_FLOW_HASH_FLD_IPV6_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA) +#define ICE_FLOW_HASH_FLD_TCP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT) +#define ICE_FLOW_HASH_FLD_TCP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT) +#define ICE_FLOW_HASH_FLD_UDP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT) +#define ICE_FLOW_HASH_FLD_UDP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT) +#define ICE_FLOW_HASH_FLD_SCTP_SRC_PORT \ + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT) +#define ICE_FLOW_HASH_FLD_SCTP_DST_PORT \ + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT) + /** * ice_parse_hash_flds - parses hash fields from RSS hash input * @nfc: ethtool rxnfc command @@ -3033,7 +3046,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc) cfg.hdr_type = ICE_RSS_ANY_HEADERS; cfg.symm = symm; - status = ice_add_rss_cfg(&pf->hw, vsi, &cfg); + status = ice_add_rss_cfg(&pf->hw, vsi->idx, &cfg); if (status) { dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n", vsi->vsi_num, status); diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c index ee9862ddfe15e0..e0d95b716b36f3 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c @@ -327,7 +327,7 @@ void ice_fdir_rem_adq_chnl(struct ice_hw *hw, u16 vsi_idx) /* find flow profile corresponding to prof_id and clear * vsi_idx from bitmap. */ - status = ice_flow_rem_vsi_prof(hw, vsi_idx, prof_id); + status = ice_flow_rem_vsi_prof(hw, ICE_BLK_FD, vsi_idx, prof_id); if (status) { dev_err(ice_hw_to_dev(hw), "ice_flow_rem_vsi_prof() failed status=%d\n", status); @@ -449,7 +449,7 @@ void ice_fdir_replay_flows(struct ice_hw *hw) prof = hw->fdir_prof[flow]; ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof->fdir_seg[tun], TNL_SEG_CNT(tun), - false, &hw_prof); + NULL, 0, false, &hw_prof); for (j = 0; j < prof->cnt; j++) { enum ice_flow_priority prio; u64 entry_h = 0; @@ -461,7 +461,8 @@ void ice_fdir_replay_flows(struct ice_hw *hw) prof->vsi_h[0], prof->vsi_h[j], prio, prof->fdir_seg, - &entry_h); + NULL, 0, &entry_h); + if (err) { dev_err(ice_hw_to_dev(hw), "Could not replay Flow Director, flow type %d\n", flow); @@ -689,17 +690,20 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg, * actions (NULL) and zero actions 0. */ err = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, seg, - TNL_SEG_CNT(tun), false, &prof); + TNL_SEG_CNT(tun), NULL, 0, false, &prof); + if (err) return err; + err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, main_vsi->idx, - main_vsi->idx, ICE_FLOW_PRIO_NORMAL, - seg, &entry1_h); + main_vsi->idx, ICE_FLOW_PRIO_NORMAL, seg, NULL, + 0, &entry1_h); if (err) goto err_prof; + err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, main_vsi->idx, - ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL, - seg, &entry2_h); + ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL, seg, NULL, + 0, &entry2_h); if (err) goto err_entry; @@ -724,7 +728,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg, err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, main_vsi->idx, vsi_h, ICE_FLOW_PRIO_NORMAL, seg, - &entry1_h); + NULL, 0, &entry1_h); if (err) { dev_err(dev, "Could not add Channel VSI %d to flow group\n", idx); @@ -1570,7 +1574,7 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool is_tun = tun == ICE_FD_HW_SEG_TUN; int err; - if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num, TNL_ALL)) + if (is_tun && !ice_get_open_tunnel_port(&pf->hw, TNL_ALL, &port_num)) continue; err = ice_fdir_write_fltr(pf, input, add, is_tun); if (err) @@ -2026,7 +2030,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) } /* return error if not an update and no available filters */ - fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port, TNL_ALL) ? 2 : 1; + fltrs_needed = ice_get_open_tunnel_port(hw, TNL_ALL, &tunnel_port) ? 2 : 1; if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) && ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) { dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n"); diff --git a/drivers/net/ethernet/intel/ice/ice_fdir.c b/drivers/net/ethernet/intel/ice/ice_fdir.c index 26b357c0ae153d..ea3e729f813541 100644 --- a/drivers/net/ethernet/intel/ice/ice_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_fdir.c @@ -1,10 +1,11 @@ -// SPDX-License-Identifier: GPL-2.0 -/* Copyright (C) 2018-2020, Intel Corporation. */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2018-2025 Intel Corporation */ #include "ice_common.h" +#include "ice_fdir.h" /* These are training packet headers used to program flow director filters. */ -static const u8 ice_fdir_eth_pkt[22]; +static const u8 ice_fdir_eth_pkt[22] = { 0x00 }; static const u8 ice_fdir_tcpv4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -42,35 +43,389 @@ static const u8 ice_fdir_ipv4_pkt[] = { 0x00, 0x00 }; -static const u8 ice_fdir_udp4_gtpu4_pkt[] = { +static const u8 ice_fdir_udp4_vxlan_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x4e, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x00, - 0x00, 0x00, 0x34, 0xff, 0x00, 0x28, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, - 0x00, 0x1c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x45, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x40, 0x00, + 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_gtpu4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x24, + 0xbf, 0xc0, 0x30, 0xff, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x14, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x3a, 0x3d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x40, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2c, + 0x00, 0x6f, 0x30, 0xff, 0x00, 0x1c, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x3a, 0x24, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0xbe, 0xc7, 0x00, 0x00, }; static const u8 ice_fdir_tcp4_gtpu4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x58, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x38, + 0x00, 0x4c, 0x30, 0xff, 0x00, 0x28, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x28, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x3a, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x00, - 0x00, 0x00, 0x34, 0xff, 0x00, 0x28, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, - 0x00, 0x28, 0x00, 0x00, 0x40, 0x00, 0x40, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x4e, 0xd2, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x38, + 0x24, 0x42, 0x30, 0xff, 0x00, 0x28, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x54, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x40, + 0x4e, 0x3d, 0x30, 0xff, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0xff, 0xdc, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4e, + 0x59, 0x08, 0x30, 0xff, 0x00, 0x3e, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0x7b, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x1d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x23, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x01, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb8, 0x00, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0xde, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x9d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x9a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0xff, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x6b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0xdf, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x1d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x23, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x01, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb8, 0x00, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0xde, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x9d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x9a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0xff, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x6b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0xdf, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x0d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x13, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x01, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb7, 0xf0, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0xde, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x8d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x8a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0xff, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x5b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0xdf, 0x00, 0x00, 0x00, 0x00, }; static const u8 ice_fdir_icmp4_gtpu4_pkt[] = { @@ -88,18 +443,78 @@ static const u8 ice_fdir_icmp4_gtpu4_pkt[] = { 0x00, 0x00, }; -static const u8 ice_fdir_ipv4_gtpu4_pkt[] = { +static const u8 ice_fdir_ipv6_gtpu6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x44, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x68, 0x08, 0x68, 0x00, 0x00, - 0x00, 0x00, 0x34, 0xff, 0x00, 0x28, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x38, 0x22, 0x43, 0x30, 0xff, + 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3b, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu6_eh_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x44, 0x1b, 0x9a, 0x34, 0xff, + 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu6_eh_dw_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x44, 0x1b, 0x9a, 0x34, 0xff, + 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_gtpu6_eh_up_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x44, 0x1b, 0x8a, 0x34, 0xff, + 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; static const u8 ice_fdir_ipv4_l2tpv3_pkt[] = { @@ -240,313 +655,2687 @@ static const u8 ice_fdir_non_ip_l2_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_tcpv6_pkt[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x14, 0x06, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +static const u8 ice_fdir_ecpri_tp0_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xAE, 0xFE, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, }; -static const u8 ice_fdir_udpv6_pkt[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x11, 0x40, 0x00, 0x00, +static const u8 ice_fdir_ipv4_udp_ecpri_tp0_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x1C, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, }; -static const u8 ice_fdir_sctpv6_pkt[] = { +static const u8 ice_fdir_ipv6_frag_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x0C, 0x84, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2C, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv4_frag_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x14, 0x00, 0x00, 0x20, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, + 0x00, 0x00 }; -static const u8 ice_fdir_ipv6_pkt[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3B, 0x40, 0x00, 0x00, +/* IPV4 GRE INNER IPV4 */ +static const u8 ice_fdir_ipv4_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x2e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x9e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, + 0x7c, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x36, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x96, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xcc, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x01, 0xd8, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x8a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x2a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, + 0x7c, 0xcb, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x91, 0xde, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_tcp4_tun_pkt[] = { +/* IPV4 GRE INNER IPV6 */ +static const u8 ice_fdir_ipv6_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x5a, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x8a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x45, 0x00, 0x00, 0x28, 0x00, 0x00, 0x40, 0x00, - 0x40, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x82, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0xff, 0xd8, 0x00, 0x00, }; -static const u8 ice_fdir_udp4_tun_pkt[] = { +static const u8 ice_fdir_tcp6_gre4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x4e, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x76, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x16, 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x45, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x40, 0x00, - 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8f, 0xdf, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_sctp4_tun_pkt[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, +/* IPV6 GRE INNER IPV4 */ +static const u8 ice_fdir_ipv4_gre6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x2F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x45, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, - 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x14, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7A, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_ip4_tun_pkt[] = { +static const u8 ice_fdir_udp4_gre6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x46, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x2F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x1C, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7A, 0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x45, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0xFF, 0xDE, 0x00, 0x00, }; -static const u8 ice_fdir_tcp6_tun_pkt[] = { +static const u8 ice_fdir_tcp4_gre6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x6e, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x2C, 0x2F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x28, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7A, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x14, 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8F, 0xE3, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE INNER IPV6 */ +static const u8 ice_fdir_ipv6_gre6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x2C, 0x2F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x86, 0xDD, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3B, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x20, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gre6_pkt[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x34, 0x2F, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x86, 0xDD, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x08, + 0xFF, 0x72, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gre6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x2F, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x86, 0xDD, 0x60, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8F, 0xE1, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x52, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x7a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x3a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xb0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x26, + 0xbf, 0xba, 0x30, 0xff, 0x00, 0x16, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x72, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xbd, 0xc0, 0x30, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x66, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x66, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x3a, + 0xbd, 0x9d, 0x30, 0xff, 0x00, 0x2a, 0x00, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0x7a, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_udp6_tun_pkt[] = { +/* IPV4 GRE IPV4 GTPU IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x66, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x66, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x3a, + 0x24, 0x3a, 0x30, 0xff, 0x00, 0x2a, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x4e, 0x37, 0x30, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x7a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x52, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x88, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4e, + 0x59, 0x08, 0x30, 0xff, 0x00, 0x3e, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0x7b, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x3a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xb0, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x26, 0xbf, 0xba, 0x30, 0xff, + 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, + 0x7c, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x42, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa8, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x2e, 0xbd, 0xc0, 0x30, 0xff, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xcc, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x4e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x9c, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x3a, 0xbd, 0x9d, 0x30, 0xff, + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x2a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, + 0x7c, 0xcb, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x91, 0x7a, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x52, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x4e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x9c, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x3a, 0x24, 0x3a, 0x30, 0xff, + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x3b, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0x4e, 0x37, 0x30, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x66, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x62, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x88, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x4e, 0x59, 0x08, 0x30, 0xff, + 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x16, 0x06, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8f, 0x7b, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU EH IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x62, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x5a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x72, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x1d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x6a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x23, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb8, 0x00, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0x7a, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU EH IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x9d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x76, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x56, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x9a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x82, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x4a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x6b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0x7b, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU EH IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x42, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa8, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x2e, 0xba, 0x1d, 0x34, 0xff, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, + 0x7c, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x4e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x4a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa0, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x36, 0xb8, 0x23, 0x34, 0xff, + 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xcc, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0xb8, 0x00, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x2a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, + 0x7c, 0xcb, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x91, 0x7a, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU EH IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0x1e, 0x9d, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x3b, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x62, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x5e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x8c, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x4a, 0x48, 0x9a, 0x34, 0xff, + 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x6e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x80, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x56, 0x53, 0x6b, 0x34, 0xff, + 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x16, 0x06, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8f, 0x7b, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU DW IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x72, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x1d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x6a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x23, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb8, 0x00, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0x7a, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU DW IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x9d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x76, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x56, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x9a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_dw_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x82, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x4a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x6b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0x7b, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU DW IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x42, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa8, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x2e, 0xba, 0x1d, 0x34, 0xff, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, + 0x7c, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x4e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x4a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa0, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x36, 0xb8, 0x23, 0x34, 0xff, + 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xcc, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0xb8, 0x00, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x2a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, + 0x7c, 0xcb, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x91, 0x7a, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU DW IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0x1e, 0x9d, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x3b, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x62, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x5e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x8c, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x4a, 0x48, 0x9a, 0x34, 0xff, + 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_dw_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x6e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x80, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x56, 0x53, 0x6b, 0x34, 0xff, + 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x16, 0x06, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8f, 0x7b, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU UP IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x72, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x2e, + 0xba, 0x0d, 0x34, 0xff, 0x00, 0x1e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x16, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe5, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x6a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x36, + 0xb8, 0x13, 0x34, 0xff, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x1e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xcc, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0xb7, 0xf0, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x2a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcb, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x91, 0x7a, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 GRE IPV4 GTPU UP IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x5e, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x42, + 0x1e, 0x8d, 0x34, 0xff, 0x00, 0x32, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x76, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x56, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x8c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x4a, + 0x48, 0x8a, 0x34, 0xff, 0x00, 0x3a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_up_gre4_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x82, 0x00, 0x01, 0x00, 0x00, 0x40, 0x2f, + 0x7c, 0x4a, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x08, 0x68, 0x08, 0x68, 0x00, 0x56, + 0x53, 0x5b, 0x34, 0xff, 0x00, 0x46, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x01, 0x10, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x16, + 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x8f, 0x7b, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU UP IPV4 */ +static const u8 ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x46, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x42, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa8, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x2e, 0xba, 0x0d, 0x34, 0xff, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, + 0x7c, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x4e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x4a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0xa0, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x36, 0xb8, 0x13, 0x34, 0xff, + 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xcc, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, 0x00, 0x0a, + 0x01, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0xb7, 0xf0, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x2a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, + 0x7c, 0xcb, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, + 0x20, 0x00, 0x91, 0x7a, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 GRE IPV4 GTPU UP IPV6 */ +static const u8 ice_fdir_ipv6_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x5a, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x56, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x94, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x42, 0x1e, 0x8d, 0x34, 0xff, + 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x3b, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x62, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x5e, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x8c, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x4a, 0x48, 0x8a, 0x34, 0xff, + 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, + 0x00, 0x35, 0x00, 0x0a, 0xff, 0x6e, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_gtpu4_eh_up_gre6_pkt[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x6e, 0x2f, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x08, 0x00, 0x45, 0x00, 0x00, 0x6a, 0x00, 0x01, + 0x00, 0x00, 0x40, 0x11, 0x7c, 0x80, 0x7f, 0x00, + 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, 0x08, 0x68, + 0x08, 0x68, 0x00, 0x56, 0x53, 0x5b, 0x34, 0xff, + 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x85, 0x01, 0x10, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x16, 0x06, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, 0x8f, 0x7b, + 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 L2TPV2 control */ +static const u8 ice_fdir_ipv4_l2tpv2_ctrl_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x28, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xc2, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x14, + 0x2c, 0x6b, 0xc8, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, +}; + +/* IPV4 L2TPV2 */ +static const u8 ice_fdir_ipv4_l2tpv2_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x11, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x28, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xc2, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x14, + 0x2c, 0x6b, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 */ +static const u8 ice_fdir_ipv4_l2tpv2_ppp_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x26, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xc4, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x12, + 0xf5, 0x77, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 IPV4 */ +static const u8 ice_fdir_ipv4_l2tpv2_ppp4_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x3a, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xb0, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x26, + 0xf5, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x21, 0x45, 0x00, 0x00, 0x14, + 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x7c, 0xe7, + 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, + 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 IPV4 UDP */ +static const u8 ice_fdir_udp4_l2tpv2_ppp4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0xa8, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x2e, + 0xf3, 0x3a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x21, 0x45, 0x00, 0x00, 0x1c, + 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, 0x7c, 0xce, + 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, + 0x00, 0x35, 0x00, 0x35, 0x00, 0x08, 0x01, 0x72, + 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 IPV4 TCP */ +static const u8 ice_fdir_tcp4_l2tpv2_ppp4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x3a, + 0xf3, 0x23, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x21, 0x45, 0x00, 0x00, 0x28, + 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, 0x7c, 0xcd, + 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, 0x00, 0x01, + 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, + 0x91, 0x7c, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 IPV6 */ +static const u8 ice_fdir_ipv6_l2tpv2_ppp4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4e, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x9c, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x3a, + 0x59, 0x8e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x57, 0x60, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, }; -static const u8 ice_fdir_sctp6_tun_pkt[] = { +/* IPV4 PPPOL2TPV2 IPV6 UDP */ +static const u8 ice_fdir_udp6_l2tpv2_ppp4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x66, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x94, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x42, + 0x83, 0x91, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x57, 0x60, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, + 0x00, 0x08, 0xff, 0x72, 0x00, 0x00, +}; + +/* IPV4 PPPOL2TPV2 IPV6 TCP */ +static const u8 ice_fdir_tcp6_l2tpv2_ppp4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, - 0x60, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x84, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, + 0x7c, 0x88, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, + 0x00, 0x01, 0x06, 0xa5, 0x06, 0xa5, 0x00, 0x4e, + 0x8e, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x03, 0x00, 0x57, 0x60, 0x00, 0x00, 0x00, + 0x00, 0x14, 0x06, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x02, 0x20, 0x00, 0x8f, 0x7d, 0x00, 0x00, + 0x00, 0x00, +}; + +/* IPV6 L2TPV2 control */ +static const u8 ice_fdir_ipv6_l2tpv2_ctrl_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x14, 0x2a, 0x6c, 0xc8, 0x02, + 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static const u8 ice_fdir_ip6_tun_pkt[] = { +/* IPV6 L2TPV2 */ +static const u8 ice_fdir_ipv6_l2tpv2_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, - 0x00, 0x5a, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x14, 0x2a, 0x6c, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 */ +static const u8 ice_fdir_ipv6_l2tpv2_ppp_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x12, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x12, 0xf3, 0x78, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, + 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 IPV4 */ +static const u8 ice_fdir_ipv4_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x26, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x26, 0xf3, 0x2f, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x21, + 0x45, 0x00, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x00, 0x7c, 0xe7, 0x7f, 0x00, 0x00, 0x01, + 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 IPV4 UDP */ +static const u8 ice_fdir_udp4_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x2e, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x2e, 0xf1, 0x3b, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x21, + 0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x11, 0x7c, 0xce, 0x7f, 0x00, 0x00, 0x01, + 0x7f, 0x00, 0x00, 0x01, 0x00, 0x35, 0x00, 0x35, + 0x00, 0x08, 0x01, 0x72, 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 IPV4 TCP */ +static const u8 ice_fdir_tcp4_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x3a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x3a, 0xf1, 0x24, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x21, + 0x45, 0x00, 0x00, 0x28, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x06, 0x7c, 0xcd, 0x7f, 0x00, 0x00, 0x01, + 0x7f, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x02, 0x20, 0x00, 0x91, 0x7c, 0x00, 0x00, + 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 IPV6 */ +static const u8 ice_fdir_ipv6_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x3a, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x3a, 0x57, 0x8f, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x57, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, +}; + +/* IPV6 PPPOL2TPV2 IPV6 UDP */ +static const u8 ice_fdir_udp6_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x42, 0x11, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x42, 0x81, 0x92, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x57, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x11, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x35, 0x00, 0x35, 0x00, 0x08, 0xff, 0x72, + 0x00, 0x00, }; -/* Flow Director no-op training packet table */ -static const struct ice_fdir_base_pkt ice_fdir_pkt[] = { +/* IPV6 PPPOL2TPV2 IPV6 TCP */ +static const u8 ice_fdir_tcp6_l2tpv2_ppp6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x4e, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0xa5, + 0x06, 0xa5, 0x00, 0x4e, 0x8c, 0x6f, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x57, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x14, 0x06, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x02, 0x20, 0x00, + 0x8f, 0x7d, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcpv6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x06, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +static const u8 ice_fdir_udpv6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x11, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, +}; + +static const u8 ice_fdir_sctpv6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x0C, 0x84, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +static const u8 ice_fdir_ipv6_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3B, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp4_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5a, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x45, 0x00, 0x00, 0x28, 0x00, 0x00, 0x40, 0x00, + 0x40, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp4_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4e, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x45, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x40, 0x00, + 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_sctp4_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x52, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x45, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, + 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ip4_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x46, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x45, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_tcp6_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x6e, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x14, 0x06, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_udp6_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x62, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x11, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_sctp6_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x66, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x84, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const u8 ice_fdir_ip6_tun_pkt[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x5a, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* Flow Director no-op training packet table */ +static const struct ice_fdir_base_pkt ice_fdir_pkt[] = { + { + ICE_FLTR_PTYPE_NONF_ETH, + sizeof(ice_fdir_eth_pkt), ice_fdir_eth_pkt, + sizeof(ice_fdir_eth_pkt), ice_fdir_eth_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_TCP, + sizeof(ice_fdir_tcpv4_pkt), ice_fdir_tcpv4_pkt, + sizeof(ice_fdir_tcp4_tun_pkt), ice_fdir_tcp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP, + sizeof(ice_fdir_udpv4_pkt), ice_fdir_udpv4_pkt, + sizeof(ice_fdir_udp4_tun_pkt), ice_fdir_udp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_SCTP, + sizeof(ice_fdir_sctpv4_pkt), ice_fdir_sctpv4_pkt, + sizeof(ice_fdir_sctp4_tun_pkt), ice_fdir_sctp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_OTHER, + sizeof(ice_fdir_ipv4_pkt), ice_fdir_ipv4_pkt, + sizeof(ice_fdir_ip4_tun_pkt), ice_fdir_ip4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_FRAG_IPV4, + sizeof(ice_fdir_ipv4_frag_pkt), ice_fdir_ipv4_frag_pkt, + sizeof(ice_fdir_ipv4_frag_pkt), ice_fdir_ipv4_frag_pkt, + }, + { + ICE_FLTR_PTYPE_FRAG_IPV6, + sizeof(ice_fdir_ipv6_frag_pkt), ice_fdir_ipv6_frag_pkt, + sizeof(ice_fdir_ipv6_frag_pkt), ice_fdir_ipv6_frag_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_pkt), + ice_fdir_ipv4_gtpu4_eh_up_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_pkt), + ice_fdir_ipv4_gtpu4_eh_up_pkt, + }, + /* IPV4 GRE IPV4 GTPU */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU, + sizeof(ice_fdir_ipv4_gtpu4_gre4_pkt), + ice_fdir_ipv4_gtpu4_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_gre4_pkt), + ice_fdir_ipv4_gtpu4_gre4_pkt, + }, + /* IPV4 GRE IPV4 GTPU EH */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_gre4_pkt, + }, + /* IPV4 GRE IPV4 GTPU DW */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt, + }, + /* IPV4 GRE IPV4 GTPU UP */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt, + }, + /* IPV6 GRE IPV4 GTPU */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU, + sizeof(ice_fdir_ipv4_gtpu4_gre6_pkt), + ice_fdir_ipv4_gtpu4_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_gre6_pkt), + ice_fdir_ipv4_gtpu4_gre6_pkt, + }, + /* IPV6 GRE IPV4 GTPU EH */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_gre6_pkt, + }, + /* IPV6 GRE IPV4 GTPU DW */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt, + }, + /* IPV6 GRE IPV4 GTPU UP */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_pkt), + ice_fdir_udp4_gtpu4_pkt, + sizeof(ice_fdir_udp4_gtpu4_pkt), + ice_fdir_udp4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_pkt), + ice_fdir_tcp4_gtpu4_pkt, + sizeof(ice_fdir_tcp4_gtpu4_pkt), + ice_fdir_tcp4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_pkt), + ice_fdir_ipv6_gtpu4_pkt, + sizeof(ice_fdir_ipv6_gtpu4_pkt), + ice_fdir_ipv6_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_pkt), + ice_fdir_udp6_gtpu4_pkt, + sizeof(ice_fdir_udp6_gtpu4_pkt), + ice_fdir_udp6_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_pkt), + ice_fdir_tcp6_gtpu4_pkt, + sizeof(ice_fdir_tcp6_gtpu4_pkt), + ice_fdir_tcp6_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_pkt), + ice_fdir_udp4_gtpu4_eh_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_pkt), + ice_fdir_udp4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_pkt), + ice_fdir_tcp4_gtpu4_eh_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_pkt), + ice_fdir_tcp4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_pkt), + ice_fdir_ipv6_gtpu4_eh_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_pkt), + ice_fdir_ipv6_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_pkt), + ice_fdir_udp6_gtpu4_eh_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_pkt), + ice_fdir_udp6_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_pkt), + ice_fdir_tcp6_gtpu4_eh_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_pkt), + ice_fdir_tcp6_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_pkt), + ice_fdir_udp4_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_pkt), + ice_fdir_udp4_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_pkt), + ice_fdir_udp6_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_pkt), + ice_fdir_udp6_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_pkt), + ice_fdir_ipv4_gtpu4_eh_up_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_pkt), + ice_fdir_ipv4_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_up_pkt), + ice_fdir_udp4_gtpu4_eh_up_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_up_pkt), + ice_fdir_udp4_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_pkt), + ice_fdir_tcp4_gtpu4_eh_up_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_pkt), + ice_fdir_tcp4_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_pkt), + ice_fdir_ipv6_gtpu4_eh_up_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_pkt), + ice_fdir_ipv6_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_up_pkt), + ice_fdir_udp6_gtpu4_eh_up_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_up_pkt), + ice_fdir_udp6_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_pkt), + ice_fdir_tcp6_gtpu4_eh_up_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_pkt), + ice_fdir_tcp6_gtpu4_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP, + sizeof(ice_fdir_icmp4_gtpu4_pkt), + ice_fdir_icmp4_gtpu4_pkt, + sizeof(ice_fdir_icmp4_gtpu4_pkt), + ice_fdir_icmp4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_pkt), + ice_fdir_ipv4_gtpu4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU, + sizeof(ice_fdir_ipv6_gtpu6_pkt), + ice_fdir_ipv6_gtpu6_pkt, + sizeof(ice_fdir_ipv6_gtpu6_pkt), + ice_fdir_ipv6_gtpu6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_DW, + sizeof(ice_fdir_ipv6_gtpu6_eh_dw_pkt), + ice_fdir_ipv6_gtpu6_eh_dw_pkt, + sizeof(ice_fdir_ipv6_gtpu6_eh_dw_pkt), + ice_fdir_ipv6_gtpu6_eh_dw_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_UP, + sizeof(ice_fdir_ipv6_gtpu6_eh_up_pkt), + ice_fdir_ipv6_gtpu6_eh_up_pkt, + sizeof(ice_fdir_ipv6_gtpu6_eh_up_pkt), + ice_fdir_ipv6_gtpu6_eh_up_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER, + sizeof(ice_fdir_ipv6_gtpu6_pkt), + ice_fdir_ipv6_gtpu6_pkt, + sizeof(ice_fdir_ipv6_gtpu6_pkt), + ice_fdir_ipv6_gtpu6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_pkt), + ice_fdir_ipv4_gtpu4_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + sizeof(ice_fdir_ipv6_gtpu6_eh_pkt), + ice_fdir_ipv6_gtpu6_eh_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3, + sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt, + sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV3, + sizeof(ice_fdir_ipv6_l2tpv3_pkt), ice_fdir_ipv6_l2tpv3_pkt, + sizeof(ice_fdir_ipv6_l2tpv3_pkt), ice_fdir_ipv6_l2tpv3_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_ESP, + sizeof(ice_fdir_ipv4_esp_pkt), ice_fdir_ipv4_esp_pkt, + sizeof(ice_fdir_ipv4_esp_pkt), ice_fdir_ipv4_esp_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_ESP, + sizeof(ice_fdir_ipv6_esp_pkt), ice_fdir_ipv6_esp_pkt, + sizeof(ice_fdir_ipv6_esp_pkt), ice_fdir_ipv6_esp_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_AH, + sizeof(ice_fdir_ipv4_ah_pkt), ice_fdir_ipv4_ah_pkt, + sizeof(ice_fdir_ipv4_ah_pkt), ice_fdir_ipv4_ah_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_AH, + sizeof(ice_fdir_ipv6_ah_pkt), ice_fdir_ipv6_ah_pkt, + sizeof(ice_fdir_ipv6_ah_pkt), ice_fdir_ipv6_ah_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_NAT_T_ESP, + sizeof(ice_fdir_ipv4_nat_t_esp_pkt), + ice_fdir_ipv4_nat_t_esp_pkt, + sizeof(ice_fdir_ipv4_nat_t_esp_pkt), + ice_fdir_ipv4_nat_t_esp_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_NAT_T_ESP, + sizeof(ice_fdir_ipv6_nat_t_esp_pkt), + ice_fdir_ipv6_nat_t_esp_pkt, + sizeof(ice_fdir_ipv6_nat_t_esp_pkt), + ice_fdir_ipv6_nat_t_esp_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_PFCP_NODE, + sizeof(ice_fdir_ipv4_pfcp_node_pkt), + ice_fdir_ipv4_pfcp_node_pkt, + sizeof(ice_fdir_ipv4_pfcp_node_pkt), + ice_fdir_ipv4_pfcp_node_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_PFCP_SESSION, + sizeof(ice_fdir_ipv4_pfcp_session_pkt), + ice_fdir_ipv4_pfcp_session_pkt, + sizeof(ice_fdir_ipv4_pfcp_session_pkt), + ice_fdir_ipv4_pfcp_session_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_PFCP_NODE, + sizeof(ice_fdir_ipv6_pfcp_node_pkt), + ice_fdir_ipv6_pfcp_node_pkt, + sizeof(ice_fdir_ipv6_pfcp_node_pkt), + ice_fdir_ipv6_pfcp_node_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_PFCP_SESSION, + sizeof(ice_fdir_ipv6_pfcp_session_pkt), + ice_fdir_ipv6_pfcp_session_pkt, + sizeof(ice_fdir_ipv6_pfcp_session_pkt), + ice_fdir_ipv6_pfcp_session_pkt, + }, + { + ICE_FLTR_PTYPE_NON_IP_L2, + sizeof(ice_fdir_non_ip_l2_pkt), ice_fdir_non_ip_l2_pkt, + sizeof(ice_fdir_non_ip_l2_pkt), ice_fdir_non_ip_l2_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN, + sizeof(ice_fdir_udp4_vxlan_pkt), ice_fdir_udp4_vxlan_pkt, + sizeof(ice_fdir_udp4_vxlan_pkt), ice_fdir_udp4_vxlan_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP, + sizeof(ice_fdir_udp4_tun_pkt), ice_fdir_udp4_tun_pkt, + sizeof(ice_fdir_udp4_tun_pkt), ice_fdir_udp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP, + sizeof(ice_fdir_tcp4_tun_pkt), ice_fdir_tcp4_tun_pkt, + sizeof(ice_fdir_tcp4_tun_pkt), ice_fdir_tcp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP, + sizeof(ice_fdir_sctp4_tun_pkt), ice_fdir_sctp4_tun_pkt, + sizeof(ice_fdir_sctp4_tun_pkt), ice_fdir_sctp4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER, + sizeof(ice_fdir_ip4_tun_pkt), ice_fdir_ip4_tun_pkt, + sizeof(ice_fdir_ip4_tun_pkt), ice_fdir_ip4_tun_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_ECPRI_TP0, + sizeof(ice_fdir_ecpri_tp0_pkt), ice_fdir_ecpri_tp0_pkt, + sizeof(ice_fdir_ecpri_tp0_pkt), ice_fdir_ecpri_tp0_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0, + sizeof(ice_fdir_ipv4_udp_ecpri_tp0_pkt), + ice_fdir_ipv4_udp_ecpri_tp0_pkt, + sizeof(ice_fdir_ipv4_udp_ecpri_tp0_pkt), + ice_fdir_ipv4_udp_ecpri_tp0_pkt, + }, + /* IPV4 GRE INNER IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4, + sizeof(ice_fdir_ipv4_gre4_pkt), + ice_fdir_ipv4_gre4_pkt, + sizeof(ice_fdir_ipv4_gre4_pkt), + ice_fdir_ipv4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_UDP, + sizeof(ice_fdir_udp4_gre4_pkt), + ice_fdir_udp4_gre4_pkt, + sizeof(ice_fdir_udp4_gre4_pkt), + ice_fdir_udp4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_TCP, + sizeof(ice_fdir_tcp4_gre4_pkt), + ice_fdir_tcp4_gre4_pkt, + sizeof(ice_fdir_tcp4_gre4_pkt), + ice_fdir_tcp4_gre4_pkt, + }, + /* IPV4 GRE INNER IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6, + sizeof(ice_fdir_ipv6_gre4_pkt), + ice_fdir_ipv6_gre4_pkt, + sizeof(ice_fdir_ipv6_gre4_pkt), + ice_fdir_ipv6_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_UDP, + sizeof(ice_fdir_udp6_gre4_pkt), + ice_fdir_udp6_gre4_pkt, + sizeof(ice_fdir_udp6_gre4_pkt), + ice_fdir_udp6_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_TCP, + sizeof(ice_fdir_tcp6_gre4_pkt), + ice_fdir_tcp6_gre4_pkt, + sizeof(ice_fdir_tcp6_gre4_pkt), + ice_fdir_tcp6_gre4_pkt, + }, + /* IPV6 GRE INNER IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4, + sizeof(ice_fdir_ipv4_gre6_pkt), + ice_fdir_ipv4_gre6_pkt, + sizeof(ice_fdir_ipv4_gre6_pkt), + ice_fdir_ipv4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_UDP, + sizeof(ice_fdir_udp4_gre6_pkt), + ice_fdir_udp4_gre6_pkt, + sizeof(ice_fdir_udp4_gre6_pkt), + ice_fdir_udp4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_TCP, + sizeof(ice_fdir_tcp4_gre6_pkt), + ice_fdir_tcp4_gre6_pkt, + sizeof(ice_fdir_tcp4_gre6_pkt), + ice_fdir_tcp4_gre6_pkt, + }, + /* IPV4 GRE INNER IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6, + sizeof(ice_fdir_ipv6_gre6_pkt), + ice_fdir_ipv6_gre6_pkt, + sizeof(ice_fdir_ipv6_gre6_pkt), + ice_fdir_ipv6_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_UDP, + sizeof(ice_fdir_udp6_gre6_pkt), + ice_fdir_udp6_gre6_pkt, + sizeof(ice_fdir_udp6_gre6_pkt), + ice_fdir_udp6_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_TCP, + sizeof(ice_fdir_tcp6_gre6_pkt), + ice_fdir_tcp6_gre6_pkt, + sizeof(ice_fdir_tcp6_gre6_pkt), + ice_fdir_tcp6_gre6_pkt, + }, + /* IPV4 GRE IPV4 GTPU IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_gre4_pkt), + ice_fdir_ipv4_gtpu4_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_gre4_pkt), + ice_fdir_ipv4_gtpu4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_gre4_pkt), + ice_fdir_udp4_gtpu4_gre4_pkt, + sizeof(ice_fdir_udp4_gtpu4_gre4_pkt), + ice_fdir_udp4_gtpu4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_gre4_pkt), + ice_fdir_tcp4_gtpu4_gre4_pkt, + sizeof(ice_fdir_tcp4_gtpu4_gre4_pkt), + ice_fdir_tcp4_gtpu4_gre4_pkt, + }, + /* IPV4 GRE IPV4 GTPU IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_gre4_pkt), + ice_fdir_ipv6_gtpu4_gre4_pkt, + sizeof(ice_fdir_ipv6_gtpu4_gre4_pkt), + ice_fdir_ipv6_gtpu4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_gre4_pkt), + ice_fdir_udp6_gtpu4_gre4_pkt, + sizeof(ice_fdir_udp6_gtpu4_gre4_pkt), + ice_fdir_udp6_gtpu4_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_gre4_pkt), + ice_fdir_tcp6_gtpu4_gre4_pkt, + sizeof(ice_fdir_tcp6_gtpu4_gre4_pkt), + ice_fdir_tcp6_gtpu4_gre4_pkt, + }, + /* IPV6 GRE IPV4 GTPU IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_gre6_pkt), + ice_fdir_ipv4_gtpu4_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_gre6_pkt), + ice_fdir_ipv4_gtpu4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_gre6_pkt), + ice_fdir_udp4_gtpu4_gre6_pkt, + sizeof(ice_fdir_udp4_gtpu4_gre6_pkt), + ice_fdir_udp4_gtpu4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_gre6_pkt), + ice_fdir_tcp4_gtpu4_gre6_pkt, + sizeof(ice_fdir_tcp4_gtpu4_gre6_pkt), + ice_fdir_tcp4_gtpu4_gre6_pkt, + }, + /* IPV6 GRE IPV4 GTPU IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_gre6_pkt), + ice_fdir_ipv6_gtpu4_gre6_pkt, + sizeof(ice_fdir_ipv6_gtpu4_gre6_pkt), + ice_fdir_ipv6_gtpu4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_gre6_pkt), + ice_fdir_udp6_gtpu4_gre6_pkt, + sizeof(ice_fdir_udp6_gtpu4_gre6_pkt), + ice_fdir_udp6_gtpu4_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_gre6_pkt), + ice_fdir_tcp6_gtpu4_gre6_pkt, + sizeof(ice_fdir_tcp6_gtpu4_gre6_pkt), + ice_fdir_tcp6_gtpu4_gre6_pkt, + }, + /* IPV4 GRE IPV4 GTPU EH IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_gre4_pkt, + }, { - ICE_FLTR_PTYPE_NONF_ETH, - sizeof(ice_fdir_eth_pkt), ice_fdir_eth_pkt, - sizeof(ice_fdir_eth_pkt), ice_fdir_eth_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_TCP, - sizeof(ice_fdir_tcpv4_pkt), ice_fdir_tcpv4_pkt, - sizeof(ice_fdir_tcp4_tun_pkt), ice_fdir_tcp4_tun_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_gre4_pkt, }, + /* IPV4 GRE IPV4 GTPU EH IPV6 */ { - ICE_FLTR_PTYPE_NONF_IPV4_UDP, - sizeof(ice_fdir_udpv4_pkt), ice_fdir_udpv4_pkt, - sizeof(ice_fdir_udp4_tun_pkt), ice_fdir_udp4_tun_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_SCTP, - sizeof(ice_fdir_sctpv4_pkt), ice_fdir_sctpv4_pkt, - sizeof(ice_fdir_sctp4_tun_pkt), ice_fdir_sctp4_tun_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_OTHER, - sizeof(ice_fdir_ipv4_pkt), ice_fdir_ipv4_pkt, - sizeof(ice_fdir_ip4_tun_pkt), ice_fdir_ip4_tun_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_gre4_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_gre4_pkt, }, + /* IPV6 GRE IPV4 GTPU EH IPV4 */ { - ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP, - sizeof(ice_fdir_udp4_gtpu4_pkt), - ice_fdir_udp4_gtpu4_pkt, - sizeof(ice_fdir_udp4_gtpu4_pkt), - ice_fdir_udp4_gtpu4_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP, - sizeof(ice_fdir_tcp4_gtpu4_pkt), - ice_fdir_tcp4_gtpu4_pkt, - sizeof(ice_fdir_tcp4_gtpu4_pkt), - ice_fdir_tcp4_gtpu4_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP, - sizeof(ice_fdir_icmp4_gtpu4_pkt), - ice_fdir_icmp4_gtpu4_pkt, - sizeof(ice_fdir_icmp4_gtpu4_pkt), - ice_fdir_icmp4_gtpu4_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_gre6_pkt, }, + /* IPV6 GRE IPV4 GTPU EH IPV6 */ { - ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER, - sizeof(ice_fdir_ipv4_gtpu4_pkt), - ice_fdir_ipv4_gtpu4_pkt, - sizeof(ice_fdir_ipv4_gtpu4_pkt), - ice_fdir_ipv4_gtpu4_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3, - sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt, - sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV6_L2TPV3, - sizeof(ice_fdir_ipv6_l2tpv3_pkt), ice_fdir_ipv6_l2tpv3_pkt, - sizeof(ice_fdir_ipv6_l2tpv3_pkt), ice_fdir_ipv6_l2tpv3_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_gre6_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_gre6_pkt, }, + /* IPV4 GRE IPV4 GTPU DW IPV4 */ { - ICE_FLTR_PTYPE_NONF_IPV4_ESP, - sizeof(ice_fdir_ipv4_esp_pkt), ice_fdir_ipv4_esp_pkt, - sizeof(ice_fdir_ipv4_esp_pkt), ice_fdir_ipv4_esp_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV6_ESP, - sizeof(ice_fdir_ipv6_esp_pkt), ice_fdir_ipv6_esp_pkt, - sizeof(ice_fdir_ipv6_esp_pkt), ice_fdir_ipv6_esp_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_dw_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_AH, - sizeof(ice_fdir_ipv4_ah_pkt), ice_fdir_ipv4_ah_pkt, - sizeof(ice_fdir_ipv4_ah_pkt), ice_fdir_ipv4_ah_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_gre4_pkt, }, + /* IPV4 GRE IPV4 GTPU DW IPV6 */ { - ICE_FLTR_PTYPE_NONF_IPV6_AH, - sizeof(ice_fdir_ipv6_ah_pkt), ice_fdir_ipv6_ah_pkt, - sizeof(ice_fdir_ipv6_ah_pkt), ice_fdir_ipv6_ah_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_NAT_T_ESP, - sizeof(ice_fdir_ipv4_nat_t_esp_pkt), - ice_fdir_ipv4_nat_t_esp_pkt, - sizeof(ice_fdir_ipv4_nat_t_esp_pkt), - ice_fdir_ipv4_nat_t_esp_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_dw_gre4_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV6_NAT_T_ESP, - sizeof(ice_fdir_ipv6_nat_t_esp_pkt), - ice_fdir_ipv6_nat_t_esp_pkt, - sizeof(ice_fdir_ipv6_nat_t_esp_pkt), - ice_fdir_ipv6_nat_t_esp_pkt, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_gre4_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_gre4_pkt, }, + /* IPV6 GRE IPV4 GTPU DW IPV4 */ { - ICE_FLTR_PTYPE_NONF_IPV4_PFCP_NODE, - sizeof(ice_fdir_ipv4_pfcp_node_pkt), - ice_fdir_ipv4_pfcp_node_pkt, - sizeof(ice_fdir_ipv4_pfcp_node_pkt), - ice_fdir_ipv4_pfcp_node_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_dw_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV4_PFCP_SESSION, - sizeof(ice_fdir_ipv4_pfcp_session_pkt), - ice_fdir_ipv4_pfcp_session_pkt, - sizeof(ice_fdir_ipv4_pfcp_session_pkt), - ice_fdir_ipv4_pfcp_session_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_dw_gre6_pkt, }, { - ICE_FLTR_PTYPE_NONF_IPV6_PFCP_NODE, - sizeof(ice_fdir_ipv6_pfcp_node_pkt), - ice_fdir_ipv6_pfcp_node_pkt, - sizeof(ice_fdir_ipv6_pfcp_node_pkt), - ice_fdir_ipv6_pfcp_node_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_dw_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_dw_gre6_pkt, }, + /* IPV6 GRE IPV4 GTPU DW IPV6 */ { - ICE_FLTR_PTYPE_NONF_IPV6_PFCP_SESSION, - sizeof(ice_fdir_ipv6_pfcp_session_pkt), - ice_fdir_ipv6_pfcp_session_pkt, - sizeof(ice_fdir_ipv6_pfcp_session_pkt), - ice_fdir_ipv6_pfcp_session_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_dw_gre6_pkt, }, { - ICE_FLTR_PTYPE_NON_IP_L2, - sizeof(ice_fdir_non_ip_l2_pkt), ice_fdir_non_ip_l2_pkt, - sizeof(ice_fdir_non_ip_l2_pkt), ice_fdir_non_ip_l2_pkt, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_dw_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_gre6_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_dw_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_dw_gre6_pkt, + }, + /* IPV4 GRE IPV4 GTPU UP IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_up_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_up_gre4_pkt), + ice_fdir_udp4_gtpu4_eh_up_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_gre4_pkt), + ice_fdir_tcp4_gtpu4_eh_up_gre4_pkt, + }, + /* IPV4 GRE IPV4 GTPU UP IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_gre4_pkt), + ice_fdir_ipv6_gtpu4_eh_up_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_up_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_up_gre4_pkt), + ice_fdir_udp6_gtpu4_eh_up_gre4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_up_gre4_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_gre4_pkt), + ice_fdir_tcp6_gtpu4_eh_up_gre4_pkt, + }, + /* IPV6 GRE IPV4 GTPU UP IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv4_gtpu4_eh_up_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_UDP, + sizeof(ice_fdir_udp4_gtpu4_eh_up_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_udp4_gtpu4_eh_up_gre6_pkt), + ice_fdir_udp4_gtpu4_eh_up_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_TCP, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_tcp4_gtpu4_eh_up_gre6_pkt), + ice_fdir_tcp4_gtpu4_eh_up_gre6_pkt, + }, + /* IPV6 GRE IPV4 GTPU UP IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_ipv6_gtpu4_eh_up_gre6_pkt), + ice_fdir_ipv6_gtpu4_eh_up_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_UDP, + sizeof(ice_fdir_udp6_gtpu4_eh_up_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_udp6_gtpu4_eh_up_gre6_pkt), + ice_fdir_udp6_gtpu4_eh_up_gre6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_TCP, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_up_gre6_pkt, + sizeof(ice_fdir_tcp6_gtpu4_eh_up_gre6_pkt), + ice_fdir_tcp6_gtpu4_eh_up_gre6_pkt, + }, + /* IPV4 L2TPV2 CONTROL */ + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_CONTROL, + sizeof(ice_fdir_ipv4_l2tpv2_ctrl_pkt), + ice_fdir_ipv4_l2tpv2_ctrl_pkt, + sizeof(ice_fdir_ipv4_l2tpv2_ctrl_pkt), + ice_fdir_ipv4_l2tpv2_ctrl_pkt, + }, + /* IPV4 L2TPV2 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2, + sizeof(ice_fdir_ipv4_l2tpv2_pkt), + ice_fdir_ipv4_l2tpv2_pkt, + sizeof(ice_fdir_ipv4_l2tpv2_pkt), + ice_fdir_ipv4_l2tpv2_pkt, + }, + /* IPV4 L2TPV2 PPP */ + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP, + sizeof(ice_fdir_ipv4_l2tpv2_ppp_pkt), + ice_fdir_ipv4_l2tpv2_ppp_pkt, + sizeof(ice_fdir_ipv4_l2tpv2_ppp_pkt), + ice_fdir_ipv4_l2tpv2_ppp_pkt, + }, + /* IPV4 L2TPV2 PPP IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4, + sizeof(ice_fdir_ipv4_l2tpv2_ppp4_pkt), + ice_fdir_ipv4_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_ipv4_l2tpv2_ppp4_pkt), + ice_fdir_ipv4_l2tpv2_ppp4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_UDP, + sizeof(ice_fdir_udp4_l2tpv2_ppp4_pkt), + ice_fdir_udp4_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_udp4_l2tpv2_ppp4_pkt), + ice_fdir_udp4_l2tpv2_ppp4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_TCP, + sizeof(ice_fdir_tcp4_l2tpv2_ppp4_pkt), + ice_fdir_tcp4_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_tcp4_l2tpv2_ppp4_pkt), + ice_fdir_tcp4_l2tpv2_ppp4_pkt, + }, + /* IPV4 L2TPV2 PPP IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6, + sizeof(ice_fdir_ipv6_l2tpv2_ppp4_pkt), + ice_fdir_ipv6_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_ipv6_l2tpv2_ppp4_pkt), + ice_fdir_ipv6_l2tpv2_ppp4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_UDP, + sizeof(ice_fdir_udp6_l2tpv2_ppp4_pkt), + ice_fdir_udp6_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_udp6_l2tpv2_ppp4_pkt), + ice_fdir_udp6_l2tpv2_ppp4_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_TCP, + sizeof(ice_fdir_tcp6_l2tpv2_ppp4_pkt), + ice_fdir_tcp6_l2tpv2_ppp4_pkt, + sizeof(ice_fdir_tcp6_l2tpv2_ppp4_pkt), + ice_fdir_tcp6_l2tpv2_ppp4_pkt, + }, + /* IPV6 L2TPV2 CONTROL */ + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_CONTROL, + sizeof(ice_fdir_ipv6_l2tpv2_ctrl_pkt), + ice_fdir_ipv6_l2tpv2_ctrl_pkt, + sizeof(ice_fdir_ipv6_l2tpv2_ctrl_pkt), + ice_fdir_ipv6_l2tpv2_ctrl_pkt, + }, + /* IPV6 L2TPV2 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2, + sizeof(ice_fdir_ipv6_l2tpv2_pkt), + ice_fdir_ipv6_l2tpv2_pkt, + sizeof(ice_fdir_ipv6_l2tpv2_pkt), + ice_fdir_ipv6_l2tpv2_pkt, + }, + /* IPV6 L2TPV2 PPP */ + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP, + sizeof(ice_fdir_ipv6_l2tpv2_ppp_pkt), + ice_fdir_ipv6_l2tpv2_ppp_pkt, + sizeof(ice_fdir_ipv6_l2tpv2_ppp_pkt), + ice_fdir_ipv6_l2tpv2_ppp_pkt, + }, + /* IPV6 L2TPV2 PPP IPV4 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4, + sizeof(ice_fdir_ipv4_l2tpv2_ppp6_pkt), + ice_fdir_ipv4_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_ipv4_l2tpv2_ppp6_pkt), + ice_fdir_ipv4_l2tpv2_ppp6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_UDP, + sizeof(ice_fdir_udp4_l2tpv2_ppp6_pkt), + ice_fdir_udp4_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_udp4_l2tpv2_ppp6_pkt), + ice_fdir_udp4_l2tpv2_ppp6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_TCP, + sizeof(ice_fdir_tcp4_l2tpv2_ppp6_pkt), + ice_fdir_tcp4_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_tcp4_l2tpv2_ppp6_pkt), + ice_fdir_tcp4_l2tpv2_ppp6_pkt, + }, + /* IPV6 L2TPV2 PPP IPV6 */ + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6, + sizeof(ice_fdir_ipv6_l2tpv2_ppp6_pkt), + ice_fdir_ipv6_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_ipv6_l2tpv2_ppp6_pkt), + ice_fdir_ipv6_l2tpv2_ppp6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_UDP, + sizeof(ice_fdir_udp6_l2tpv2_ppp6_pkt), + ice_fdir_udp6_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_udp6_l2tpv2_ppp6_pkt), + ice_fdir_udp6_l2tpv2_ppp6_pkt, + }, + { + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_TCP, + sizeof(ice_fdir_tcp6_l2tpv2_ppp6_pkt), + ice_fdir_tcp6_l2tpv2_ppp6_pkt, + sizeof(ice_fdir_tcp6_l2tpv2_ppp6_pkt), + ice_fdir_tcp6_l2tpv2_ppp6_pkt, }, { ICE_FLTR_PTYPE_NONF_IPV6_TCP, @@ -576,7 +3365,7 @@ static const struct ice_fdir_base_pkt ice_fdir_pkt[] = { * ice_set_dflt_val_fd_desc * @fd_fltr_ctx: pointer to fd filter descriptor */ -static void ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx) +void ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx) { fd_fltr_ctx->comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO; fd_fltr_ctx->comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW_FAIL; @@ -604,7 +3393,7 @@ static void ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx) * @ctx: pointer to fd filter descriptor context * @fdir_desc: populated with fd filter descriptor values */ -static void +void ice_set_fd_desc_val(struct ice_fd_fltr_desc_ctx *ctx, struct ice_fltr_desc *fdir_desc) { @@ -719,7 +3508,8 @@ int ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id) * @cntr_id: returns counter index * @num_fltr: number of filter entries to be allocated */ -int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) +int +ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) { return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES, ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr, @@ -732,7 +3522,8 @@ int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) * @cntr_id: returns counter index * @num_fltr: number of filter entries to be allocated */ -int ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) +int +ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) { return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES, ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr, @@ -782,7 +3573,7 @@ static void ice_pkt_insert_u6_qfi(u8 *pkt, int offset, u8 data) } /** - * ice_pkt_insert_u8 - insert a u8 value into a memory buffer. + * ice_pkt_insert_u8 - insert a u8 value into a memory buffer * @pkt: packet buffer * @offset: offset into buffer * @data: 8 bit value to convert and insert into pkt at offset @@ -793,7 +3584,7 @@ static void ice_pkt_insert_u8(u8 *pkt, int offset, u8 data) } /** - * ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC ipv6. + * ice_pkt_insert_u8_tc - insert a u8 value into a memory buffer for TC IPv6 * @pkt: packet buffer * @offset: offset into buffer * @data: 8 bit value to convert and insert into pkt at offset @@ -837,7 +3628,7 @@ static void ice_pkt_insert_u32(u8 *pkt, int offset, __be32 data) } /** - * ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer. + * ice_pkt_insert_mac_addr - insert a MAC addr into a memory buffer * @pkt: packet buffer * @addr: MAC address to convert and insert into pkt at offset */ @@ -846,6 +3637,125 @@ static void ice_pkt_insert_mac_addr(u8 *pkt, u8 *addr) ether_addr_copy(pkt, addr); } +/** + * ice_fdir_get_open_tunnel_port + * @hw: pointer to the hardware structure + * @flow: flow ptype + * @port: returns open port + * + * returns an open tunnel port specified for this flow type + */ +static int +ice_fdir_get_open_tunnel_port(struct ice_hw *hw, enum ice_fltr_ptype flow, + u16 *port) +{ + switch (flow) { + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0: + /* eCPRI tunnel */ + if (!ice_get_open_tunnel_port(hw, TNL_ECPRI, port)) + return -ENOENT; + break; + default: + if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, port) && + !ice_get_open_tunnel_port(hw, TNL_GENEVE, port)) + return -ENOENT; + } + + return 0; +} + +/** + * ice_fdir_gen_l2tpv2_pkt - generate L2TPv2 training packet + * @pkt: pointer to return filter packet + * @l2tpv2_data: pointer to ice_fdir_l2tpv2 data structure + * @idx: the matched packet index of FDIR training packet table + * @offset: position of end byte for PPPoL2TPv2 packet + * @tun: true implies generate a tunnel packet + */ +static u16 +ice_fdir_gen_l2tpv2_pkt(u8 *pkt, struct ice_fdir_l2tpv2 *l2tpv2_data, + u16 idx, u16 offset, bool tun) +{ + u16 flags_version; + u16 offset_size; + u16 pos; + + /* get outer packet end pos, 10 = l2tpv2 default len 6 + ppp len 4 */ + pos = offset - ICE_L2TPV2_PKT_LENGTH - ICE_PPP_PKT_LENGTH; + + /* copy outer packet */ + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, pos); + + /* copy l2tpv2 packet common header */ + memcpy(pkt + pos, &l2tpv2_data->flags_version, + sizeof(l2tpv2_data->flags_version)); + pos += sizeof(l2tpv2_data->flags_version); + + flags_version = be16_to_cpu(l2tpv2_data->flags_version); + if (flags_version == 0) { + l2tpv2_data->flags_version = cpu_to_be16(ICE_L2TPV2_FLAGS_VER); + flags_version = ICE_L2TPV2_FLAGS_VER; + } + + /* copy l2tpv2 length */ + if (flags_version & ICE_L2TPV2_FLAGS_LEN) { + memcpy(pkt + pos, &l2tpv2_data->length, + sizeof(l2tpv2_data->length)); + pos += sizeof(l2tpv2_data->length); + } + + /* copy l2tpv2 tunnel id */ + memcpy(pkt + pos, &l2tpv2_data->tunnel_id, + sizeof(l2tpv2_data->tunnel_id)); + pos += sizeof(l2tpv2_data->tunnel_id); + + /* copy l2tpv2 session id */ + memcpy(pkt + pos, &l2tpv2_data->session_id, + sizeof(l2tpv2_data->session_id)); + pos += sizeof(l2tpv2_data->session_id); + + /* copy l2tpv2 ns + nr */ + if (flags_version & ICE_L2TPV2_FLAGS_SEQ) { + memcpy(pkt + pos, &l2tpv2_data->ns, sizeof(l2tpv2_data->ns)); + pos += sizeof(l2tpv2_data->ns); + + memcpy(pkt + pos, &l2tpv2_data->nr, sizeof(l2tpv2_data->nr)); + pos += sizeof(l2tpv2_data->nr); + } + + /* copy l2tpv2 offset size + offset padding */ + if (flags_version & ICE_L2TPV2_FLAGS_OFF) { + memcpy(pkt + pos, &l2tpv2_data->offset_size, + sizeof(l2tpv2_data->offset_size)); + pos += sizeof(l2tpv2_data->offset_size); + /* insert 0 into offset padding */ + offset_size = be16_to_cpu(l2tpv2_data->offset_size); + if (offset_size > ICE_FDIR_MAX_RAW_PKT_SIZE - + ice_fdir_pkt[idx].tun_pkt_len) { + offset_size = ICE_FDIR_MAX_RAW_PKT_SIZE - + ice_fdir_pkt[idx].tun_pkt_len; + } + memset(pkt + pos, 0, offset_size); + pos += offset_size; + } + + if (ice_fdir_pkt[idx].tun_pkt_len > offset) { + /* copy ppp packet */ + memcpy(pkt + pos, + ice_fdir_pkt[idx].tun_pkt + offset - ICE_PPP_PKT_LENGTH, + ICE_PPP_PKT_LENGTH); + pos += ICE_PPP_PKT_LENGTH; + + /* copy inner packets */ + if (tun) { + memcpy(pkt + pos, ice_fdir_pkt[idx].tun_pkt + offset, + ice_fdir_pkt[idx].tun_pkt_len - offset); + } + } + + return pos; +} + /** * ice_fdir_get_gen_prgm_pkt - generate a training packet * @hw: pointer to the hardware structure @@ -862,6 +3772,9 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, u16 tnl_port; u8 *loc; u16 idx; + u16 flags_version; + u16 pos; + u16 offset; if (input->flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER) { switch (input->ip.v4.proto) { @@ -902,19 +3815,183 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, break; if (idx == ICE_FDIR_NUM_PKT) return -EINVAL; + if (!tun) { - memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len); + switch (flow) { + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_CONTROL: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP: + offset = ICE_FDIR_IPV4_L2TPV2_PPP_PKT_OFF; + ice_fdir_gen_l2tpv2_pkt(pkt, &input->l2tpv2_data, + idx, offset, tun); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_CONTROL: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP: + offset = ICE_FDIR_IPV6_L2TPV2_PPP_PKT_OFF; + ice_fdir_gen_l2tpv2_pkt(pkt, &input->l2tpv2_data, + idx, offset, tun); + break; + default: + memcpy(pkt, ice_fdir_pkt[idx].pkt, + ice_fdir_pkt[idx].pkt_len); + break; + } loc = pkt; } else { - if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL)) - return -ENOENT; if (!ice_fdir_pkt[idx].tun_pkt) return -EINVAL; - memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, - ice_fdir_pkt[idx].tun_pkt_len); - ice_pkt_insert_u16(pkt, ICE_IPV4_UDP_DST_PORT_OFFSET, - htons(tnl_port)); - loc = &pkt[ICE_FDIR_TUN_PKT_OFF]; + + switch (flow) { + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_GTPU_IP_INNER_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_GTPU_EH_INNER_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_IPV4_GRE_INNER_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_IPV6_GRE_INNER_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_V4_V4_GTPOGRE_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_V6_V4_GTPOGRE_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_V4_V4_GTPOGRE_EH_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_TCP: + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + loc = &pkt[ICE_FDIR_V6_V4_GTPOGRE_EH_PKT_OFF]; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_TCP: + offset = ICE_FDIR_IPV4_L2TPV2_PPP_PKT_OFF; + pos = ice_fdir_gen_l2tpv2_pkt(pkt, &input->l2tpv2_data, + idx, offset, tun); + loc = &pkt[pos]; + break; + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_TCP: + offset = ICE_FDIR_IPV6_L2TPV2_PPP_PKT_OFF; + pos = ice_fdir_gen_l2tpv2_pkt(pkt, &input->l2tpv2_data, + idx, offset, tun); + loc = &pkt[pos]; + break; + default: + if (ice_fdir_get_open_tunnel_port(hw, flow, &tnl_port)) + return -ENOENT; + + memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, + ice_fdir_pkt[idx].tun_pkt_len); + ice_pkt_insert_u16(pkt, ICE_IPV4_UDP_DST_PORT_OFFSET, + htons(tnl_port)); + loc = &pkt[ICE_FDIR_TUN_PKT_OFF]; + break; + } } /* Reverse the src and dst, since the HW expects them to be from Tx @@ -936,22 +4013,79 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->eth.h_proto); } break; - case ICE_FLTR_PTYPE_NONF_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_TCP: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_TCP_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_TCP_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + if (frag) + loc[20] = ICE_FDIR_IPV4_PKT_FLAG_MF; + break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, input->ip_outer.v4.tos); + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_UDP_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_UDP_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data.src_mac); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_SCTP: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_SCTP_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_SCTP_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_OTHER: ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); - ice_pkt_insert_u16(loc, ICE_IPV4_TCP_DST_PORT_OFFSET, - input->ip.v4.src_port); ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, input->ip.v4.dst_ip); - ice_pkt_insert_u16(loc, ICE_IPV4_TCP_SRC_PORT_OFFSET, - input->ip.v4.dst_port); ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_u8(loc, ICE_IPV4_PROTO_OFFSET, + input->ip.v4.proto); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); - if (frag) - loc[20] = ICE_FDIR_IPV4_PKT_FLAG_MF; break; - case ICE_FLTR_PTYPE_NONF_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, input->ip_outer.v4.tos); + ice_pkt_insert_u32(pkt, ICE_IPV4_VXLAN_VNI_OFFSET, + input->vxlan_data.vni); ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u16(loc, ICE_IPV4_UDP_DST_PORT_OFFSET, @@ -963,10 +4097,48 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, input->ext_data.src_mac); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, + input->ip_outer.v4.tos); + ice_pkt_insert_u32(pkt, ICE_IPV4_VXLAN_VNI_OFFSET, + input->vxlan_data.vni); + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_TCP_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_IPV4_TCP_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); ice_pkt_insert_mac_addr(loc + ETH_ALEN, input->ext_data.src_mac); + if (frag) + loc[20] = ICE_FDIR_IPV4_PKT_FLAG_MF; break; - case ICE_FLTR_PTYPE_NONF_IPV4_SCTP: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, + input->ip_outer.v4.tos); + ice_pkt_insert_u32(pkt, ICE_IPV4_VXLAN_VNI_OFFSET, + input->vxlan_data.vni); ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u16(loc, ICE_IPV4_SCTP_DST_PORT_OFFSET, @@ -978,8 +4150,21 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data.src_mac); break; - case ICE_FLTR_PTYPE_NONF_IPV4_OTHER: + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, + input->ip_outer.v4.tos); + ice_pkt_insert_u32(pkt, ICE_IPV4_VXLAN_VNI_OFFSET, + input->vxlan_data.vni); ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, @@ -989,11 +4174,41 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u8(loc, ICE_IPV4_PROTO_OFFSET, input->ip.v4.proto); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data.src_mac); break; - case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP: - case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: - case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP: - case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_GTPU_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_PROTO_OFFSET, + input->ip.v4.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP: ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, @@ -1003,6 +4218,181 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u6_qfi(loc, ICE_IPV4_GTPU_QFI_OFFSET, input->gtpu_data.qfi); break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_GTPOGRE_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_GTPOGRE_TEID_OFFSET, + input->gtpu_data.teid); + ice_pkt_insert_u6_qfi(loc, ICE_IPV4_GTPOGRE_QFI_OFFSET, + input->gtpu_data.qfi); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_UDP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_TCP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, input->ip.v4.ttl); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, input->ip.v6.hlim); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_PROTO_OFFSET, + input->ip.v6.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_UDP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, input->ip.v6.hlim); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_TCP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, input->ip.v6.hlim); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU: + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV6_GTPU_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH: + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_DW: + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_UP: + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV6_GTPU_TEID_OFFSET, + input->gtpu_data.teid); + ice_pkt_insert_u6_qfi(loc, ICE_IPV6_GTPU_QFI_OFFSET, + input->gtpu_data.qfi); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV6_GTPOGRE_TEID_OFFSET, + input->gtpu_data.teid); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u32(loc, ICE_IPV6_GTPOGRE_TEID_OFFSET, + input->gtpu_data.teid); + ice_pkt_insert_u6_qfi(loc, ICE_IPV6_GTPOGRE_QFI_OFFSET, + input->gtpu_data.qfi); + break; case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3: ice_pkt_insert_u32(loc, ICE_IPV4_L2TPV3_SESS_ID_OFFSET, input->l2tpv3_data.session_id); @@ -1012,10 +4402,18 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->l2tpv3_data.session_id); break; case ICE_FLTR_PTYPE_NONF_IPV4_ESP: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); ice_pkt_insert_u32(loc, ICE_IPV4_ESP_SPI_OFFSET, input->ip.v4.sec_parm_idx); break; case ICE_FLTR_PTYPE_NONF_IPV6_ESP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); ice_pkt_insert_u32(loc, ICE_IPV6_ESP_SPI_OFFSET, input->ip.v6.sec_parm_idx); break; @@ -1057,6 +4455,221 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_pkt_insert_u16(loc, ICE_MAC_ETHTYPE_OFFSET, input->ext_data.ether_type); break; + case ICE_FLTR_PTYPE_NONF_ECPRI_TP0: + ice_pkt_insert_u16(loc, ICE_ECPRI_TP0_PC_ID_OFFSET, + input->ecpri_data.pc_id); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0: + /* Use pkt instead of loc, since PC_ID is in outter part */ + ice_pkt_insert_u16(pkt, ICE_IPV4_UDP_ECPRI_TP0_PC_ID_OFFSET, + input->ecpri_data.pc_id); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_PROTO_OFFSET, + input->ip.v4.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_TCP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_UDP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_PROTO_OFFSET, + input->ip.v6.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_TCP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_UDP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_CONTROL: + ice_pkt_insert_mac_addr(loc, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u16(loc, ICE_IPV4_L2TPV2_LEN_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2: + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP: + ice_pkt_insert_mac_addr(loc, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data_outer.src_mac); + flags_version = be16_to_cpu(input->l2tpv2_data.flags_version); + if (flags_version & ICE_L2TPV2_FLAGS_LEN) { + ice_pkt_insert_u16(loc, + ICE_IPV4_L2TPV2_LEN_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + } else { + ice_pkt_insert_u16(loc, + ICE_IPV4_L2TPV2_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + } + break; + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_CONTROL: + ice_pkt_insert_mac_addr(loc, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u16(loc, ICE_IPV6_L2TPV2_LEN_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + break; + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP: + ice_pkt_insert_mac_addr(loc, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(loc + ETH_ALEN, + input->ext_data_outer.src_mac); + flags_version = be16_to_cpu(input->l2tpv2_data.flags_version); + if (flags_version & ICE_L2TPV2_FLAGS_LEN) { + ice_pkt_insert_u16(loc, + ICE_IPV6_L2TPV2_LEN_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + } else { + ice_pkt_insert_u16(loc, + ICE_IPV6_L2TPV2_SESS_ID_OFFSET, + input->l2tpv2_data.session_id); + } + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, + input->ip.v4.ttl); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_PROTO_OFFSET, + input->ip.v4.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_UDP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, + input->ip.v4.ttl); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_TCP: + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_DST_PORT_OFFSET, + input->ip.v4.src_port); + ice_pkt_insert_u32(loc, ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP4_NO_MAC_SRC_PORT_OFFSET, + input->ip.v4.dst_port); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TOS_OFFSET, + input->ip.v4.tos); + ice_pkt_insert_u8(loc, ICE_IPV4_NO_MAC_TTL_OFFSET, + input->ip.v4.ttl); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, + input->ip.v6.hlim); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_PROTO_OFFSET, + input->ip.v6.proto); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_UDP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_UDP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_UDP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, + input->ip.v6.hlim); + break; + case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_TCP: + case ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_TCP: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_DST_PORT_OFFSET, + input->ip.v6.src_port); + ice_pkt_insert_u16(loc, ICE_TCP6_NO_MAC_SRC_PORT_OFFSET, + input->ip.v6.dst_port); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_NO_MAC_TC_OFFSET, + input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_NO_MAC_HLIM_OFFSET, + input->ip.v6.hlim); + break; case ICE_FLTR_PTYPE_NONF_IPV6_TCP: ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, input->ip.v6.src_ip); @@ -1107,6 +4720,30 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, input->ip.v6.proto); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); break; + case ICE_FLTR_PTYPE_FRAG_IPV4: + ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, + input->ip.v4.src_ip); + ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip.v4.dst_ip); + ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos); + ice_pkt_insert_u16(loc, ICE_IPV4_ID_OFFSET, + input->ip.v4.packet_id); + ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl); + ice_pkt_insert_u8(loc, ICE_IPV4_PROTO_OFFSET, + input->ip.v4.proto); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + break; + case ICE_FLTR_PTYPE_FRAG_IPV6: + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET, + input->ip.v6.src_ip); + ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET, + input->ip.v6.dst_ip); + ice_pkt_insert_u8_tc(loc, ICE_IPV6_TC_OFFSET, input->ip.v6.tc); + ice_pkt_insert_u8(loc, ICE_IPV6_HLIM_OFFSET, input->ip.v6.hlim); + ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); + ice_pkt_insert_u32(loc, ICE_IPV6_ID_OFFSET, + input->ip.v6.packet_id); + break; default: return -EINVAL; } @@ -1125,7 +4762,8 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, */ bool ice_fdir_has_frag(enum ice_fltr_ptype flow) { - if (flow == ICE_FLTR_PTYPE_NONF_IPV4_OTHER) + if (flow == ICE_FLTR_PTYPE_FRAG_IPV4 || + flow == ICE_FLTR_PTYPE_FRAG_IPV6) return true; else return false; @@ -1179,6 +4817,7 @@ void ice_fdir_list_add_fltr(struct ice_hw *hw, struct ice_fdir_fltr *fltr) * ice_fdir_update_cntrs - increment / decrement filter counter * @hw: pointer to hardware structure * @flow: filter flow type + * @acl_fltr: true indicates an ACL filter * @add: true implies filters added */ void @@ -1196,76 +4835,64 @@ ice_fdir_update_cntrs(struct ice_hw *hw, enum ice_fltr_ptype flow, bool add) } /** - * ice_cmp_ipv6_addr - compare 2 IP v6 addresses - * @a: IP v6 address - * @b: IP v6 address + * ice_fdir_comp_rules_basic - compare 2 filters + * @a: a Flow Director filter data structure + * @b: a Flow Director filter data structure * - * Returns 0 on equal, returns non-0 if different + * Returns true if the filters match */ -static int ice_cmp_ipv6_addr(__be32 *a, __be32 *b) +bool +ice_fdir_comp_rules_basic(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b) { - return memcmp(a, b, 4 * sizeof(__be32)); + if (a->flow_type != b->flow_type) + return false; + if (memcmp(&a->ip, &b->ip, sizeof(a->ip))) + return false; + if (memcmp(&a->mask, &b->mask, sizeof(a->mask))) + return false; + if (memcmp(&a->eth, &b->eth, sizeof(a->eth))) + return false; + + return true; } /** - * ice_fdir_comp_rules - compare 2 filters + * ice_fdir_comp_rules_extended - compare 2 filters * @a: a Flow Director filter data structure * @b: a Flow Director filter data structure * * Returns true if the filters match */ -static bool -ice_fdir_comp_rules(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b) +bool +ice_fdir_comp_rules_extended(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b) { - enum ice_fltr_ptype flow_type = a->flow_type; + if (!ice_fdir_comp_rules_basic(a, b)) + return false; - /* The calling function already checks that the two filters have the - * same flow_type. - */ - switch (flow_type) { - case ICE_FLTR_PTYPE_NONF_ETH: - if (!memcmp(&a->eth, &b->eth, sizeof(a->eth))) - return true; - break; - case ICE_FLTR_PTYPE_NONF_IPV4_TCP: - case ICE_FLTR_PTYPE_NONF_IPV4_UDP: - case ICE_FLTR_PTYPE_NONF_IPV4_SCTP: - if (a->ip.v4.dst_ip == b->ip.v4.dst_ip && - a->ip.v4.src_ip == b->ip.v4.src_ip && - a->ip.v4.dst_port == b->ip.v4.dst_port && - a->ip.v4.src_port == b->ip.v4.src_port) - return true; - break; - case ICE_FLTR_PTYPE_NONF_IPV4_OTHER: - if (a->ip.v4.dst_ip == b->ip.v4.dst_ip && - a->ip.v4.src_ip == b->ip.v4.src_ip && - a->ip.v4.l4_header == b->ip.v4.l4_header && - a->ip.v4.proto == b->ip.v4.proto && - a->ip.v4.ip_ver == b->ip.v4.ip_ver && - a->ip.v4.tos == b->ip.v4.tos) - return true; - break; - case ICE_FLTR_PTYPE_NONF_IPV6_UDP: - case ICE_FLTR_PTYPE_NONF_IPV6_TCP: - case ICE_FLTR_PTYPE_NONF_IPV6_SCTP: - if (a->ip.v6.dst_port == b->ip.v6.dst_port && - a->ip.v6.src_port == b->ip.v6.src_port && - !ice_cmp_ipv6_addr(a->ip.v6.dst_ip, - b->ip.v6.dst_ip) && - !ice_cmp_ipv6_addr(a->ip.v6.src_ip, - b->ip.v6.src_ip)) - return true; - break; - case ICE_FLTR_PTYPE_NONF_IPV6_OTHER: - if (a->ip.v6.dst_port == b->ip.v6.dst_port && - a->ip.v6.src_port == b->ip.v6.src_port) - return true; - break; - default: - break; - } + if (memcmp(&a->gtpu_data, &b->gtpu_data, sizeof(a->gtpu_data))) + return false; + if (memcmp(&a->gtpu_mask, &b->gtpu_mask, sizeof(a->gtpu_mask))) + return false; + if (memcmp(&a->l2tpv3_data, &b->l2tpv3_data, sizeof(a->l2tpv3_data))) + return false; + if (memcmp(&a->l2tpv3_mask, &b->l2tpv3_mask, sizeof(a->l2tpv3_mask))) + return false; + if (memcmp(&a->ext_data, &b->ext_data, sizeof(a->ext_data))) + return false; + if (memcmp(&a->ext_mask, &b->ext_mask, sizeof(a->ext_mask))) + return false; + if (memcmp(&a->ecpri_data, &b->ecpri_data, sizeof(a->ecpri_data))) + return false; + if (memcmp(&a->ecpri_mask, &b->ecpri_mask, sizeof(a->ecpri_mask))) + return false; + if (memcmp(&a->l2tpv2_data.session_id, &b->l2tpv2_data.session_id, + sizeof(a->l2tpv2_data.session_id))) + return false; + if (memcmp(&a->l2tpv2_mask.session_id, &b->l2tpv2_mask.session_id, + sizeof(a->l2tpv2_mask.session_id))) + return false; - return false; + return true; } /** @@ -1281,10 +4908,8 @@ bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input) bool ret = false; list_for_each_entry(rule, &hw->fdir_list_head, fltr_node) { - if (rule->flow_type != input->flow_type) - continue; + ret = ice_fdir_comp_rules_basic(rule, input); - ret = ice_fdir_comp_rules(rule, input); if (ret) { if (rule->fltr_id == input->fltr_id && rule->q_index != input->q_index) @@ -1296,3 +4921,25 @@ bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input) return ret; } + +/** + * ice_clear_vsi_fd_table - admin command to clear FD table for a VSI + * @hw: hardware data structure + * @vsi_num: vsi_num (HW VSI num) + * + * Clears FD table entries by issuing admin command (direct, 0x0B06) + * Must to pass valid vsi_num as returned by "AddVSI". + */ +int ice_clear_vsi_fd_table(struct ice_hw *hw, u16 vsi_num) +{ + struct ice_aqc_clear_fd_table *cmd; + struct ice_aq_desc desc; + + cmd = &desc.params.clear_fd_table; + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_clear_fd_table); + cmd->clear_type = CL_FD_VM_VF_TYPE_VSI_IDX; + + cmd->vsi_index = cpu_to_le16(vsi_num); + return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); +} + diff --git a/drivers/net/ethernet/intel/ice/ice_fdir.h b/drivers/net/ethernet/intel/ice/ice_fdir.h index 820023c0271fd5..80bd1fa0767cfc 100644 --- a/drivers/net/ethernet/intel/ice/ice_fdir.h +++ b/drivers/net/ethernet/intel/ice/ice_fdir.h @@ -1,9 +1,27 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* Copyright (C) 2018-2020, Intel Corporation. */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2018-2025 Intel Corporation */ #ifndef _ICE_FDIR_H_ #define _ICE_FDIR_H_ +#include "ice_type.h" +#include + +#define ICE_FDIR_GTPU_IP_INNER_PKT_OFF 50 +#define ICE_FDIR_GTPU_EH_INNER_PKT_OFF 58 +#define ICE_FDIR_IPV4_GRE_INNER_PKT_OFF 38 +#define ICE_FDIR_IPV6_GRE_INNER_PKT_OFF 58 +#define ICE_FDIR_V4_V4_GTPOGRE_PKT_OFF 74 +#define ICE_FDIR_V4_V6_GTPOGRE_PKT_OFF 94 +#define ICE_FDIR_V6_V4_GTPOGRE_PKT_OFF 94 +#define ICE_FDIR_V6_V6_GTPOGRE_PKT_OFF 114 +#define ICE_FDIR_V4_V4_GTPOGRE_EH_PKT_OFF 82 +#define ICE_FDIR_V4_V6_GTPOGRE_EH_PKT_OFF 102 +#define ICE_FDIR_V6_V4_GTPOGRE_EH_PKT_OFF 102 +#define ICE_FDIR_V6_V6_GTPOGRE_EH_PKT_OFF 122 +#define ICE_FDIR_IPV4_L2TPV2_PPP_PKT_OFF 52 +#define ICE_FDIR_IPV6_L2TPV2_PPP_PKT_OFF 72 + #define ICE_FDIR_TUN_PKT_OFF 50 #define ICE_FDIR_MAX_RAW_PKT_SIZE (512 + ICE_FDIR_TUN_PKT_OFF) @@ -28,14 +46,42 @@ #define ICE_IPV6_UDP_DST_PORT_OFFSET 56 #define ICE_IPV6_SCTP_SRC_PORT_OFFSET 54 #define ICE_IPV6_SCTP_DST_PORT_OFFSET 56 + #define ICE_MAC_ETHTYPE_OFFSET 12 #define ICE_IPV4_TOS_OFFSET 15 +#define ICE_IPV4_ID_OFFSET 18 #define ICE_IPV4_TTL_OFFSET 22 #define ICE_IPV6_TC_OFFSET 14 #define ICE_IPV6_HLIM_OFFSET 21 #define ICE_IPV6_PROTO_OFFSET 20 +#define ICE_IPV6_ID_OFFSET 58 +/* For TUN inner (without inner MAC) */ +#define ICE_IPV4_NO_MAC_TOS_OFFSET 1 +#define ICE_IPV4_NO_MAC_TTL_OFFSET 8 +#define ICE_IPV4_NO_MAC_PROTO_OFFSET 9 +#define ICE_IPV4_NO_MAC_SRC_ADDR_OFFSET 12 +#define ICE_IPV4_NO_MAC_DST_ADDR_OFFSET 16 +#define ICE_TCP4_NO_MAC_SRC_PORT_OFFSET 20 +#define ICE_TCP4_NO_MAC_DST_PORT_OFFSET 22 +#define ICE_UDP4_NO_MAC_SRC_PORT_OFFSET 20 +#define ICE_UDP4_NO_MAC_DST_PORT_OFFSET 22 +#define ICE_IPV6_NO_MAC_TC_OFFSET 0 +#define ICE_IPV6_NO_MAC_HLIM_OFFSET 7 +#define ICE_IPV6_NO_MAC_PROTO_OFFSET 6 +#define ICE_IPV6_NO_MAC_SRC_ADDR_OFFSET 8 +#define ICE_IPV6_NO_MAC_DST_ADDR_OFFSET 24 +#define ICE_TCP6_NO_MAC_SRC_PORT_OFFSET 40 +#define ICE_TCP6_NO_MAC_DST_PORT_OFFSET 42 +#define ICE_UDP6_NO_MAC_SRC_PORT_OFFSET 40 +#define ICE_UDP6_NO_MAC_DST_PORT_OFFSET 42 #define ICE_IPV4_GTPU_TEID_OFFSET 46 #define ICE_IPV4_GTPU_QFI_OFFSET 56 +#define ICE_IPV6_GTPU_TEID_OFFSET 66 +#define ICE_IPV6_GTPU_QFI_OFFSET 76 +#define ICE_IPV4_GTPOGRE_TEID_OFFSET 70 +#define ICE_IPV4_GTPOGRE_QFI_OFFSET 80 +#define ICE_IPV6_GTPOGRE_TEID_OFFSET 90 +#define ICE_IPV6_GTPOGRE_QFI_OFFSET 100 #define ICE_IPV4_L2TPV3_SESS_ID_OFFSET 34 #define ICE_IPV6_L2TPV3_SESS_ID_OFFSET 54 #define ICE_IPV4_ESP_SPI_OFFSET 34 @@ -44,16 +90,31 @@ #define ICE_IPV6_AH_SPI_OFFSET 58 #define ICE_IPV4_NAT_T_ESP_SPI_OFFSET 42 #define ICE_IPV6_NAT_T_ESP_SPI_OFFSET 62 +#define ICE_IPV4_VXLAN_VNI_OFFSET 46 +#define ICE_ECPRI_TP0_PC_ID_OFFSET 18 +#define ICE_IPV4_UDP_ECPRI_TP0_PC_ID_OFFSET 46 +#define ICE_IPV4_L2TPV2_SESS_ID_OFFSET 46 +#define ICE_IPV6_L2TPV2_SESS_ID_OFFSET 66 +#define ICE_IPV4_L2TPV2_LEN_SESS_ID_OFFSET 48 +#define ICE_IPV6_L2TPV2_LEN_SESS_ID_OFFSET 68 #define ICE_FDIR_MAX_FLTRS 16384 -/* IP v4 has 2 flag bits that enable fragment processing: DF and MF. DF +/* IPv4 has 2 flag bits that enable fragment processing: DF and MF. DF * requests that the packet not be fragmented. MF indicates that a packet has - * been fragmented. + * been fragmented, except that for the last fragment has a non-zero + * Fragment Offset field with zero MF. */ #define ICE_FDIR_IPV4_PKT_FLAG_MF 0x20 +#define ICE_FDIR_IPV4_PKT_FLAG_MF_SHIFT 8 -#define ICE_FDIR_NO_QUEUE_IDX -1 +/* For IPv6 fragmented packets, all fragments except the last have + * the MF flag set. + */ +#define ICE_FDIR_IPV6_PKT_FLAG_MF 0x100 +#define ICE_FDIR_IPV6_PKT_FLAG_MF_SHIFT 8 + +#define ICE_FDIR_NO_QUEUE_IDX -1 enum ice_fltr_prgm_desc_dest { ICE_FLTR_PRGM_DESC_DEST_DROP_PKT, @@ -65,6 +126,8 @@ enum ice_fltr_prgm_desc_dest { enum ice_fltr_prgm_desc_fd_status { ICE_FLTR_PRGM_DESC_FD_STATUS_NONE, ICE_FLTR_PRGM_DESC_FD_STATUS_FD_ID, + ICE_FLTR_PRGM_DESC_FD_STATUS_FD_ID_4FLEX_BYTES, + ICE_FLTR_PRGM_DESC_FD_STATUS_8FLEX_BYTES, }; /* Flow Director (FD) Filter Programming descriptor */ @@ -113,6 +176,7 @@ struct ice_fdir_v4 { u8 ip_ver; u8 proto; u8 ttl; + __be16 packet_id; }; #define ICE_IPV6_ADDR_LEN_AS_U32 4 @@ -127,6 +191,7 @@ struct ice_fdir_v6 { u8 tc; u8 proto; u8 hlim; + __be32 packet_id; }; struct ice_fdir_udp_gtp { @@ -151,10 +216,28 @@ struct ice_fdir_l2tpv3 { __be32 session_id; }; +struct ice_fdir_udp_vxlan { + __be32 vni; /* 8 bits reserved, always be zero */ +}; + +struct ice_fdir_ecpri { + __be16 pc_id; +}; + +struct ice_fdir_l2tpv2 { + __be16 flags_version; + __be16 length; + __be16 tunnel_id; + __be16 session_id; + __be16 ns; + __be16 nr; + __be16 offset_size; +}; + struct ice_fdir_extra { u8 dst_mac[ETH_ALEN]; /* dest MAC address */ u8 src_mac[ETH_ALEN]; /* src MAC address */ - __be16 ether_type; /* for NON_IP_L2 */ + __be16 ether_type; /* for NON_IP_L2 */ u32 usr_def[2]; /* user data */ __be16 vlan_type; /* VLAN ethertype */ __be16 vlan_tag; /* VLAN tag info */ @@ -171,12 +254,30 @@ struct ice_fdir_fltr { struct ice_fdir_v6 v6; } ip, mask; + /* for tunnel outer part */ + union { + struct ice_fdir_v4 v4; + struct ice_fdir_v6 v6; + } ip_outer, mask_outer; + + struct ice_fdir_extra ext_data_outer; + struct ice_fdir_extra ext_mask_outer; + + struct ice_fdir_udp_vxlan vxlan_data; + struct ice_fdir_udp_vxlan vxlan_mask; + struct ice_fdir_udp_gtp gtpu_data; struct ice_fdir_udp_gtp gtpu_mask; struct ice_fdir_l2tpv3 l2tpv3_data; struct ice_fdir_l2tpv3 l2tpv3_mask; + struct ice_fdir_ecpri ecpri_data; + struct ice_fdir_ecpri ecpri_mask; + + struct ice_fdir_l2tpv2 l2tpv2_data; + struct ice_fdir_l2tpv2 l2tpv2_mask; + struct ice_fdir_extra ext_data; struct ice_fdir_extra ext_mask; @@ -198,6 +299,8 @@ struct ice_fdir_fltr { u32 fltr_id; u8 fdid_prio; u8 comp_report; + /* Set to true for an ACL filter */ + bool acl_fltr; }; /* Dummy packet filter definition structure */ @@ -209,12 +312,22 @@ struct ice_fdir_base_pkt { const u8 *tun_pkt; }; -struct ice_vsi; +bool +ice_fdir_comp_rules_basic(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b); +bool +ice_fdir_comp_rules_extended(struct ice_fdir_fltr *a, struct ice_fdir_fltr *b); int ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id); int ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id); -int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); -int ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); +void +ice_set_fd_desc_val(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx, + struct ice_fltr_desc *fdir_desc); +void ice_set_dflt_val_fd_desc(struct ice_fd_fltr_desc_ctx *fd_fltr_ctx); +int +ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); +int +ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); +int ice_clear_vsi_fd_table(struct ice_hw *hw, u16 vsi_num); void ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, struct ice_fltr_desc *fdesc, bool add); diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c index ed95072ca6e316..3effcecab59678 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c @@ -292,15 +292,16 @@ void ice_release_change_lock(struct ice_hw *hw) ice_release_res(hw, ICE_CHANGE_LOCK_RES_ID); } + /** * ice_get_open_tunnel_port - retrieve an open tunnel port * @hw: pointer to the HW structure + * @type: tunnel type (TNL_ALL will return any open port) * @port: returns open port - * @type: type of tunnel, can be TNL_LAST if it doesn't matter */ bool -ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port, - enum ice_tunnel_type type) +ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type, + u16 *port) { bool res = false; u16 i; @@ -1232,7 +1233,7 @@ ice_find_prof_id_with_mask(struct ice_hw *hw, enum ice_block blk, /* For FD, we don't want to re-use a existed profile with the same * field vector and mask. This will cause rule interference. */ - if (blk == ICE_BLK_FD) + if (blk == ICE_BLK_FD || blk == ICE_BLK_RSS) return -ENOENT; for (i = 0; i < (u8)es->count; i++) { @@ -3043,16 +3044,16 @@ ice_disable_fd_swap(struct ice_hw *hw, u8 prof_id) * the ID value used here. */ int -ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[], - const struct ice_ptype_attributes *attr, u16 attr_cnt, - struct ice_fv_word *es, u16 *masks, bool symm, bool fd_swap) +ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, + unsigned long *ptypes, const struct ice_ptype_attributes *attr, + u16 attr_cnt, struct ice_fv_word *es, u16 *masks, bool symm, + bool fd_swap) { - u32 bytes = DIV_ROUND_UP(ICE_FLOW_PTYPE_MAX, BITS_PER_BYTE); DECLARE_BITMAP(ptgs_used, ICE_XLT1_CNT); struct ice_prof_map *prof; - u8 byte = 0; - u8 prof_id; int status; + u8 prof_id; + u16 ptype; bitmap_zero(ptgs_used, ICE_XLT1_CNT); @@ -3102,57 +3103,35 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[], prof->context = 0; /* build list of ptgs */ - while (bytes && prof->ptg_cnt < ICE_MAX_PTG_PER_PROFILE) { - u8 bit; + for_each_set_bit(ptype, ptypes, ICE_FLOW_PTYPE_MAX) { + u8 ptg; - if (!ptypes[byte]) { - bytes--; - byte++; + /* The package should place all ptypes in a non-zero + * PTG, so the following call should never fail. + */ + if (ice_ptg_find_ptype(hw, blk, ptype, &ptg)) continue; - } - /* Examine 8 bits per byte */ - for_each_set_bit(bit, (unsigned long *)&ptypes[byte], - BITS_PER_BYTE) { - u16 ptype; - u8 ptg; - - ptype = byte * BITS_PER_BYTE + bit; - - /* The package should place all ptypes in a non-zero - * PTG, so the following call should never fail. - */ - if (ice_ptg_find_ptype(hw, blk, ptype, &ptg)) - continue; + /* If PTG is already added, skip and continue */ + if (test_bit(ptg, ptgs_used)) + continue; - /* If PTG is already added, skip and continue */ - if (test_bit(ptg, ptgs_used)) - continue; + set_bit(ptg, ptgs_used); + /* Check to see there are any attributes for this ptype, and + * add them if found. + */ + status = ice_add_prof_attrib(prof, ptg, ptype, attr, attr_cnt); + if (status == -ENOSPC) + break; + if (status) { + /* This is simple a ptype/PTG with no attribute */ + prof->ptg[prof->ptg_cnt] = ptg; + prof->attr[prof->ptg_cnt].flags = 0; + prof->attr[prof->ptg_cnt].mask = 0; - __set_bit(ptg, ptgs_used); - /* Check to see there are any attributes for - * this PTYPE, and add them if found. - */ - status = ice_add_prof_attrib(prof, ptg, ptype, - attr, attr_cnt); - if (status == -ENOSPC) + if (++prof->ptg_cnt >= ICE_MAX_PTG_PER_PROFILE) break; - if (status) { - /* This is simple a PTYPE/PTG with no - * attribute - */ - prof->ptg[prof->ptg_cnt] = ptg; - prof->attr[prof->ptg_cnt].flags = 0; - prof->attr[prof->ptg_cnt].mask = 0; - - if (++prof->ptg_cnt >= - ICE_MAX_PTG_PER_PROFILE) - break; - } } - - bytes--; - byte++; } list_add(&prof->list, &hw->blk[blk].es.prof_map); @@ -3555,6 +3534,7 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, p->tcam[i].prof_id = map->prof_id; p->tcam[i].tcam_idx = ICE_INVALID_TCAM; p->tcam[i].ptg = map->ptg[i]; + p->tcam[i].attr = map->attr[i]; } list_add(&p->list, lst); @@ -3603,6 +3583,20 @@ ice_move_vsi(struct ice_hw *hw, enum ice_block blk, u16 vsi, u16 vsig, return 0; } +/** + * ice_set_tcam_flags - set TCAM flag don't care mask + * @mask: mask for flags + * @dc_mask: pointer to the don't care mask + */ +static void ice_set_tcam_flags(u16 mask, u8 dc_mask[ICE_TCAM_KEY_VAL_SZ]) +{ + u16 *flag_word; + + /* flags are lowest u16 */ + flag_word = (u16 *)dc_mask; + *flag_word = ~mask; +} + /** * ice_rem_chg_tcam_ent - remove a specific TCAM entry from change list * @hw: pointer to the HW struct @@ -3673,6 +3667,9 @@ ice_prof_tcam_ena_dis(struct ice_hw *hw, enum ice_block blk, bool enable, if (!p) return -ENOMEM; + /* set don't care masks for TCAM flags */ + ice_set_tcam_flags(tcam->attr.mask, dc_msk); + status = ice_tcam_write_entry(hw, blk, tcam->tcam_idx, tcam->prof_id, tcam->ptg, vsig, 0, tcam->attr.flags, vl_msk, dc_msk, nm_msk); @@ -3698,6 +3695,32 @@ ice_prof_tcam_ena_dis(struct ice_hw *hw, enum ice_block blk, bool enable, return status; } +/** + * ice_ptg_attr_in_use - determine if PTG and attribute pair is in use + * @ptg_attr: pointer to the PTG and attribute pair to check + * @ptgs_used: bitmap that denotes which PTGs are in use + * @attr_used: array of PTG and attributes pairs already used + * @attr_cnt: count of entries in the attr_used array + */ +static bool +ice_ptg_attr_in_use(struct ice_tcam_inf *ptg_attr, unsigned long *ptgs_used, + struct ice_tcam_inf *attr_used[], u16 attr_cnt) +{ + u16 i; + + if (!test_bit(ptg_attr->ptg, ptgs_used)) + return false; + + /* the PTG is used, so now look for correct attributes */ + for (i = 0; i < attr_cnt; i++) + if (attr_used[i]->ptg == ptg_attr->ptg && + attr_used[i]->attr.flags == ptg_attr->attr.flags && + attr_used[i]->attr.mask == ptg_attr->attr.mask) + return true; + + return false; +} + /** * ice_adj_prof_priorities - adjust profile based on priorities * @hw: pointer to the HW struct @@ -3710,10 +3733,18 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, struct list_head *chg) { DECLARE_BITMAP(ptgs_used, ICE_XLT1_CNT); + struct ice_tcam_inf **attr_used; struct ice_vsig_prof *t; - int status; + u16 attr_used_cnt = 0; + int status = 0; u16 idx; +#define ICE_MAX_PTG_ATTRS 1024 + attr_used = devm_kcalloc(ice_hw_to_dev(hw), ICE_MAX_PTG_ATTRS, + sizeof(*attr_used), GFP_KERNEL); + if (!attr_used) + return -ENOMEM; + bitmap_zero(ptgs_used, ICE_XLT1_CNT); idx = vsig & ICE_VSIG_IDX_M; @@ -3731,11 +3762,15 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, u16 i; for (i = 0; i < t->tcam_count; i++) { + bool used; + /* Scan the priorities from newest to oldest. * Make sure that the newest profiles take priority. */ - if (test_bit(t->tcam[i].ptg, ptgs_used) && - t->tcam[i].in_use) { + used = ice_ptg_attr_in_use(&t->tcam[i], ptgs_used, + attr_used, attr_used_cnt); + + if (used && t->tcam[i].in_use) { /* need to mark this PTG as never match, as it * was already in use and therefore duplicate * (and lower priority) @@ -3745,9 +3780,8 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, &t->tcam[i], chg); if (status) - return status; - } else if (!test_bit(t->tcam[i].ptg, ptgs_used) && - !t->tcam[i].in_use) { + goto err_ice_adj_prof_priorities; + } else if (!used && !t->tcam[i].in_use) { /* need to enable this PTG, as it in not in use * and not enabled (highest priority) */ @@ -3756,15 +3790,21 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig, &t->tcam[i], chg); if (status) - return status; + goto err_ice_adj_prof_priorities; } /* keep track of used ptgs */ - __set_bit(t->tcam[i].ptg, ptgs_used); + set_bit(t->tcam[i].ptg, ptgs_used); + if (attr_used_cnt < ICE_MAX_PTG_ATTRS) + attr_used[attr_used_cnt++] = &t->tcam[i]; + else + ice_debug(hw, ICE_DBG_INIT, "Warn: ICE_MAX_PTG_ATTRS exceeded\n"); } } - return 0; +err_ice_adj_prof_priorities: + devm_kfree(ice_hw_to_dev(hw), attr_used); + return status; } /** @@ -3847,11 +3887,15 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, p->vsig = vsig; p->tcam_idx = t->tcam[i].tcam_idx; + /* set don't care masks for TCAM flags */ + ice_set_tcam_flags(t->tcam[i].attr.mask, dc_msk); + /* write the TCAM entry */ status = ice_tcam_write_entry(hw, blk, t->tcam[i].tcam_idx, t->tcam[i].prof_id, - t->tcam[i].ptg, vsig, 0, 0, - vl_msk, dc_msk, nm_msk); + t->tcam[i].ptg, vsig, 0, + t->tcam[i].attr.flags, vl_msk, + dc_msk, nm_msk); if (status) { devm_kfree(ice_hw_to_dev(hw), p); goto err_ice_add_prof_id_vsig; @@ -4145,6 +4189,55 @@ ice_add_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl) return status; } +/** + * ice_flow_assoc_hw_prof - add profile id flow for main/ctrl VSI flow entry + * @hw: pointer to the HW struct + * @blk: HW block + * @dest_vsi_handle: dest VSI handle + * @fdir_vsi_handle: fdir programming VSI handle + * @id: profile id (handle) + * + * Calling this function will update the hardware tables to enable the + * profile indicated by the ID parameter for the VSIs specified in the VSI + * array. Once successfully called, the flow will be enabled. + */ +int +ice_flow_assoc_hw_prof(struct ice_hw *hw, enum ice_block blk, + u16 dest_vsi_handle, u16 fdir_vsi_handle, int id) +{ + int status = 0; + u16 vsi_num; + + vsi_num = ice_get_hw_vsi_num(hw, dest_vsi_handle); + status = ice_add_prof_id_flow(hw, blk, vsi_num, id); + if (status) { + ice_debug(hw, ICE_DBG_FLOW, "HW profile add failed for main VSI flow entry, %d\n", + status); + goto err_add_prof; + } + + if (blk != ICE_BLK_FD) + return status; + + vsi_num = ice_get_hw_vsi_num(hw, fdir_vsi_handle); + status = ice_add_prof_id_flow(hw, blk, vsi_num, id); + if (status) { + ice_debug(hw, ICE_DBG_FLOW, "HW profile add failed for ctrl VSI flow entry, %d\n", + status); + goto err_add_entry; + } + + return status; + +err_add_entry: + vsi_num = ice_get_hw_vsi_num(hw, dest_vsi_handle); + ice_rem_prof_id_flow(hw, blk, vsi_num, id); +err_add_prof: + ice_flow_rem_prof(hw, blk, id); + + return status; +} + /** * ice_flow_assoc_fdir_prof - add an FDIR profile for main/ctrl VSI * @hw: pointer to the HW struct diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h index 90b9b09931221d..5f0ffb2b65d88f 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.h +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.h @@ -29,8 +29,8 @@ int ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf, u16 buf_size, struct ice_sq_cd *cd); bool -ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port, - enum ice_tunnel_type type); +ice_get_open_tunnel_port(struct ice_hw *hw, enum ice_tunnel_type type, + u16 *port); int ice_udp_tunnel_set_port(struct net_device *netdev, unsigned int table, unsigned int idx, struct udp_tunnel_info *ti); int ice_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table, @@ -42,9 +42,10 @@ bool ice_hw_ptype_ena(struct ice_hw *hw, u16 ptype); /* XLT2/VSI group functions */ int -ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[], - const struct ice_ptype_attributes *attr, u16 attr_cnt, - struct ice_fv_word *es, u16 *masks, bool symm, bool fd_swap); +ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, + unsigned long *ptypes, const struct ice_ptype_attributes *attr, + u16 attr_cnt, struct ice_fv_word *es, u16 *masks, bool symm, + bool fd_swap); struct ice_prof_map * ice_search_prof_id(struct ice_hw *hw, enum ice_block blk, u64 id); int @@ -52,6 +53,9 @@ ice_add_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl); int ice_rem_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl); int +ice_flow_assoc_hw_prof(struct ice_hw *hw, enum ice_block blk, + u16 dest_vsi_handle, u16 fdir_vsi_handle, int id); +int ice_flow_assoc_fdir_prof(struct ice_hw *hw, enum ice_block blk, u16 dest_vsi, u16 fdir_vsi, u64 hdl); enum ice_ddp_state ice_init_pkg(struct ice_hw *hw, u8 *buff, u32 len); diff --git a/drivers/net/ethernet/intel/ice/ice_flex_type.h b/drivers/net/ethernet/intel/ice/ice_flex_type.h index 817beca591e0c2..792131a78aca75 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_type.h +++ b/drivers/net/ethernet/intel/ice/ice_flex_type.h @@ -7,46 +7,232 @@ /* Packet Type (PTYPE) values */ #define ICE_PTYPE_MAC_PAY 1 +#define ICE_MAC_PTP 2 +#define ICE_MAC_LLDP 6 +#define ICE_MAC_ARP 11 +#define ICE_PTYPE_IPV4FRAG_PAY 22 #define ICE_PTYPE_IPV4_PAY 23 #define ICE_PTYPE_IPV4_UDP_PAY 24 #define ICE_PTYPE_IPV4_TCP_PAY 26 #define ICE_PTYPE_IPV4_SCTP_PAY 27 +#define ICE_PTYPE_IPV4_ICMP_PAY 28 +#define ICE_MAC_IPV4_IPV4_FRAG 29 +#define ICE_MAC_IPV4_IPV4_PAY 30 +#define ICE_MAC_IPV4_IPV4_UDP_PAY 31 +#define ICE_MAC_IPV4_IPV4_TCP 33 +#define ICE_MAC_IPV4_IPV4_SCTP 34 +#define ICE_MAC_IPV4_IPV4_ICMP 35 +#define ICE_MAC_IPV4_IPV6_FRAG 36 +#define ICE_MAC_IPV4_IPV6_PAY 37 +#define ICE_MAC_IPV4_IPV6_UDP_PAY 38 +#define ICE_MAC_IPV4_IPV6_TCP 40 +#define ICE_MAC_IPV4_IPV6_SCTP 41 +#define ICE_MAC_IPV4_IPV6_ICMPV6 42 +#define ICE_MAC_IPV4_TUN_PAY 43 +#define ICE_MAC_IPV4_TUN_IPV4_FRAG 44 +#define ICE_MAC_IPV4_TUN_IPV4_PAY 45 +#define ICE_MAC_IPV4_TUN_IPV4_UDP_PAY 46 +#define ICE_MAC_IPV4_TUN_IPV4_TCP 48 +#define ICE_MAC_IPV4_TUN_IPV4_SCTP 49 +#define ICE_MAC_IPV4_TUN_IPV4_ICMP 50 +#define ICE_MAC_IPV4_TUN_IPV6_FRAG 51 +#define ICE_MAC_IPV4_TUN_IPV6_PAY 52 +#define ICE_MAC_IPV4_TUN_IPV6_UDP_PAY 53 +#define ICE_MAC_IPV4_TUN_IPV6_TCP 55 +#define ICE_MAC_IPV4_TUN_IPV6_SCTP 56 +#define ICE_MAC_IPV4_TUN_IPV6_ICMPV6 57 +#define ICE_MAC_IPV4_TUN_ICE_MAC_PAY 58 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_FRAG 59 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_PAY 60 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_UDP_PAY 61 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_TCP 63 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_SCTP 64 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV4_ICMP 65 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_FRAG 66 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_PAY 67 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_UDP_PAY 68 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_TCP 70 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_SCTP 71 +#define ICE_MAC_IPV4_TUN_ICE_MAC_IPV6_ICMPV6 72 +#define ICE_PTYPE_IPV6FRAG_PAY 88 #define ICE_PTYPE_IPV6_PAY 89 #define ICE_PTYPE_IPV6_UDP_PAY 90 #define ICE_PTYPE_IPV6_TCP_PAY 92 #define ICE_PTYPE_IPV6_SCTP_PAY 93 -#define ICE_MAC_IPV4_ESP 160 -#define ICE_MAC_IPV6_ESP 161 -#define ICE_MAC_IPV4_AH 162 -#define ICE_MAC_IPV6_AH 163 -#define ICE_MAC_IPV4_NAT_T_ESP 164 -#define ICE_MAC_IPV6_NAT_T_ESP 165 -#define ICE_MAC_IPV4_GTPU 329 -#define ICE_MAC_IPV6_GTPU 330 -#define ICE_MAC_IPV4_GTPU_IPV4_FRAG 331 -#define ICE_MAC_IPV4_GTPU_IPV4_PAY 332 -#define ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY 333 -#define ICE_MAC_IPV4_GTPU_IPV4_TCP 334 -#define ICE_MAC_IPV4_GTPU_IPV4_ICMP 335 -#define ICE_MAC_IPV6_GTPU_IPV4_FRAG 336 -#define ICE_MAC_IPV6_GTPU_IPV4_PAY 337 -#define ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY 338 -#define ICE_MAC_IPV6_GTPU_IPV4_TCP 339 -#define ICE_MAC_IPV6_GTPU_IPV4_ICMP 340 -#define ICE_MAC_IPV4_GTPU_IPV6_FRAG 341 -#define ICE_MAC_IPV4_GTPU_IPV6_PAY 342 -#define ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY 343 -#define ICE_MAC_IPV4_GTPU_IPV6_TCP 344 -#define ICE_MAC_IPV4_GTPU_IPV6_ICMPV6 345 -#define ICE_MAC_IPV6_GTPU_IPV6_FRAG 346 -#define ICE_MAC_IPV6_GTPU_IPV6_PAY 347 -#define ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY 348 -#define ICE_MAC_IPV6_GTPU_IPV6_TCP 349 -#define ICE_MAC_IPV6_GTPU_IPV6_ICMPV6 350 -#define ICE_MAC_IPV4_PFCP_SESSION 352 -#define ICE_MAC_IPV6_PFCP_SESSION 354 -#define ICE_MAC_IPV4_L2TPV3 360 -#define ICE_MAC_IPV6_L2TPV3 361 +#define ICE_PTYPE_IPV6_ICMP_PAY 94 +#define ICE_MAC_IPV6_IPV4_FRAG 95 +#define ICE_MAC_IPV6_IPV4_PAY 96 +#define ICE_MAC_IPV6_IPV4_UDP_PAY 97 +#define ICE_MAC_IPV6_IPV4_TCP 99 +#define ICE_MAC_IPV6_IPV4_SCTP 100 +#define ICE_MAC_IPV6_IPV4_ICMP 101 +#define ICE_MAC_IPV6_IPV6_FRAG 102 +#define ICE_MAC_IPV6_IPV6_PAY 103 +#define ICE_MAC_IPV6_IPV6_UDP_PAY 104 +#define ICE_MAC_IPV6_IPV6_TCP 106 +#define ICE_MAC_IPV6_IPV6_SCTP 107 +#define ICE_MAC_IPV6_IPV6_ICMPV6 108 +#define ICE_MAC_IPV6_TUN_PAY 109 +#define ICE_MAC_IPV6_TUN_IPV4_FRAG 110 +#define ICE_MAC_IPV6_TUN_IPV4_PAY 111 +#define ICE_MAC_IPV6_TUN_IPV4_UDP_PAY 112 +#define ICE_MAC_IPV6_TUN_IPV4_TCP 114 +#define ICE_MAC_IPV6_TUN_IPV4_SCTP 115 +#define ICE_MAC_IPV6_TUN_IPV4_ICMP 116 +#define ICE_MAC_IPV6_TUN_IPV6_FRAG 117 +#define ICE_MAC_IPV6_TUN_IPV6_PAY 118 +#define ICE_MAC_IPV6_TUN_IPV6_UDP_PAY 119 +#define ICE_MAC_IPV6_TUN_IPV6_TCP 121 +#define ICE_MAC_IPV6_TUN_IPV6_SCTP 122 +#define ICE_MAC_IPV6_TUN_IPV6_ICMPV6 123 +#define ICE_MAC_IPV6_TUN_MAC_PAY 124 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_FRAG 125 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_PAY 126 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_UDP_PAY 127 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_TCP 129 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_SCTP 130 +#define ICE_MAC_IPV6_TUN_MAC_IPV4_ICMP 131 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_FRAG 132 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_PAY 133 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_UDP_PAY 134 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_TCP 136 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_SCTP 137 +#define ICE_MAC_IPV6_TUN_MAC_IPV6_ICMPV6 138 +#define ICE_MAC_IPV4_ESP 160 +#define ICE_MAC_IPV6_ESP 161 +#define ICE_MAC_IPV4_AH 162 +#define ICE_MAC_IPV6_AH 163 +#define ICE_MAC_IPV4_NAT_T_ESP 164 +#define ICE_MAC_IPV6_NAT_T_ESP 165 +#define ICE_MAC_IPV4_NAT_T_IKE 166 +#define ICE_MAC_IPV6_NAT_T_IKE 167 +#define ICE_MAC_IPV4_NAT_T_KEEP 168 +#define ICE_MAC_IPV6_NAT_T_KEEP 169 +#define ICE_MAC_CONTROL 278 +#define ICE_MAC_PPPOD_PAY 300 +#define ICE_MAC_PPPOE_PAY 301 +#define ICE_MAC_PPPOE_IPV4_FRAG 302 +#define ICE_MAC_PPPOE_IPV4_PAY 303 +#define ICE_MAC_PPPOE_IPV4_UDP_PAY 304 +#define ICE_MAC_PPPOE_IPV4_TCP 305 +#define ICE_MAC_PPPOE_IPV4_SCTP 306 +#define ICE_MAC_PPPOE_IPV4_ICMP 307 +#define ICE_MAC_PPPOE_IPV6_FRAG 308 +#define ICE_MAC_PPPOE_IPV6_PAY 309 +#define ICE_MAC_PPPOE_IPV6_UDP_PAY 310 +#define ICE_MAC_PPPOE_IPV6_TCP 311 +#define ICE_MAC_PPPOE_IPV6_SCTP 312 +#define ICE_MAC_PPPOE_IPV6_ICMPV6 313 +#define ICE_MAC_IPV4_GTPC_TEID 325 +#define ICE_MAC_IPV6_GTPC_TEID 326 +#define ICE_MAC_IPV4_GTPC 327 +#define ICE_MAC_IPV6_GTPC 328 +#define ICE_MAC_IPV4_GTPU 329 +#define ICE_MAC_IPV6_GTPU 330 +#define ICE_MAC_IPV4_GTPU_IPV4_FRAG 331 +#define ICE_MAC_IPV4_GTPU_IPV4_PAY 332 +#define ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY 333 +#define ICE_MAC_IPV4_GTPU_IPV4_TCP 334 +#define ICE_MAC_IPV4_GTPU_IPV4_ICMP 335 +#define ICE_MAC_IPV6_GTPU_IPV4_FRAG 336 +#define ICE_MAC_IPV6_GTPU_IPV4_PAY 337 +#define ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY 338 +#define ICE_MAC_IPV6_GTPU_IPV4_TCP 339 +#define ICE_MAC_IPV6_GTPU_IPV4_ICMP 340 +#define ICE_MAC_IPV4_GTPU_IPV6_FRAG 341 +#define ICE_MAC_IPV4_GTPU_IPV6_PAY 342 +#define ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY 343 +#define ICE_MAC_IPV4_GTPU_IPV6_TCP 344 +#define ICE_MAC_IPV4_GTPU_IPV6_ICMPV6 345 +#define ICE_MAC_IPV6_GTPU_IPV6_FRAG 346 +#define ICE_MAC_IPV6_GTPU_IPV6_PAY 347 +#define ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY 348 +#define ICE_MAC_IPV6_GTPU_IPV6_TCP 349 +#define ICE_MAC_IPV6_GTPU_IPV6_ICMPV6 350 +#define ICE_MAC_IPV4_PFCP_NODE 351 +#define ICE_MAC_IPV4_PFCP_SESSION 352 +#define ICE_MAC_IPV6_PFCP_NODE 353 +#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 396 +#define ICE_MAC_IPV6_L2TPV2_CONTROL 397 +#define ICE_MAC_IPV4_L2TPV2 398 +#define ICE_MAC_IPV6_L2TPV2 399 +#define ICE_MAC_IPV4_PPPOL2TPV2 400 +#define ICE_MAC_IPV6_PPPOL2TPV2 401 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_FRAG 402 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_PAY 403 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_UDP_PAY 404 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_TCP 405 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_SCTP 406 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV4_ICMP 407 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_FRAG 408 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_PAY 409 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_UDP_PAY 410 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_TCP 411 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_SCTP 412 +#define ICE_MAC_IPV4_PPPOL2TPV2_IPV6_ICMPV6 413 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_FRAG 414 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_PAY 415 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_UDP_PAY 416 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_TCP 417 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_SCTP 418 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV4_ICMP 419 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_FRAG 420 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_PAY 421 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_UDP_PAY 422 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_TCP 423 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_SCTP 424 +#define ICE_MAC_IPV6_PPPOL2TPV2_IPV6_ICMPV6 425 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG 450 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY 451 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY 452 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP 453 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_SCTP 454 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP 455 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG 456 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY 457 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY 458 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP 459 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_SCTP 460 +#define MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6 461 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG 462 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY 463 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY 464 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP 465 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_SCTP 466 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP 467 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG 468 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY 469 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY 470 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP 471 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_SCTP 472 +#define MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6 473 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG 474 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY 475 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY 476 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP 477 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_SCTP 478 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP 479 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG 480 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY 481 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY 482 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP 483 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_SCTP 484 +#define MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6 485 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG 486 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY 487 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY 488 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP 489 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_SCTP 490 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP 491 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG 492 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY 493 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY 494 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP 495 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_SCTP 496 +#define MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6 497 /* Attributes that can modify PTYPE definitions. * @@ -91,8 +277,10 @@ enum ice_tunnel_type { TNL_VXLAN = 0, TNL_GENEVE, TNL_GRETAP, + TNL_GTP, TNL_GTPC, TNL_GTPU, + TNL_ECPRI, TNL_PFCP, __TNL_TYPE_CNT, TNL_LAST = 0xFF, diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c b/drivers/net/ethernet/intel/ice/ice_flow.c index d97b751052f221..2808212f63963c 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.c +++ b/drivers/net/ethernet/intel/ice/ice_flow.c @@ -5,6 +5,42 @@ #include "ice_flow.h" #include +/* Size of known protocol header fields */ +#define ICE_FLOW_FLD_SZ_ETH_TYPE 2 +#define ICE_FLOW_FLD_SZ_VLAN 2 +#define ICE_FLOW_FLD_SZ_IPV4_ADDR 4 +#define ICE_FLOW_FLD_SZ_IPV6_ADDR 16 +#define ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR 4 +#define ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR 6 +#define ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR 8 +#define ICE_FLOW_FLD_SZ_IPV4_ID 2 +#define ICE_FLOW_FLD_SZ_IPV6_ID 4 +#define ICE_FLOW_FLD_SZ_IP_CHKSUM 2 +#define ICE_FLOW_FLD_SZ_TCP_CHKSUM 2 +#define ICE_FLOW_FLD_SZ_UDP_CHKSUM 2 +#define ICE_FLOW_FLD_SZ_SCTP_CHKSUM 4 +#define ICE_FLOW_FLD_SZ_IP_DSCP 1 +#define ICE_FLOW_FLD_SZ_IP_TTL 1 +#define ICE_FLOW_FLD_SZ_IP_PROT 1 +#define ICE_FLOW_FLD_SZ_PORT 2 +#define ICE_FLOW_FLD_SZ_TCP_FLAGS 1 +#define ICE_FLOW_FLD_SZ_ICMP_TYPE 1 +#define ICE_FLOW_FLD_SZ_ICMP_CODE 1 +#define ICE_FLOW_FLD_SZ_ARP_OPER 2 +#define ICE_FLOW_FLD_SZ_GRE_KEYID 4 +#define ICE_FLOW_FLD_SZ_GTP_TEID 4 +#define ICE_FLOW_FLD_SZ_GTP_QFI 2 +#define ICE_FLOW_FLD_SZ_PPPOE_SESS_ID 2 +#define ICE_FLOW_FLD_SZ_PFCP_SEID 8 +#define ICE_FLOW_FLD_SZ_L2TPV3_SESS_ID 4 +#define ICE_FLOW_FLD_SZ_ESP_SPI 4 +#define ICE_FLOW_FLD_SZ_AH_SPI 4 +#define ICE_FLOW_FLD_SZ_NAT_T_ESP_SPI 4 +#define ICE_FLOW_FLD_SZ_VXLAN_VNI 4 +#define ICE_FLOW_FLD_SZ_ECPRI_TP0_PC_ID 2 +#define ICE_FLOW_FLD_SZ_L2TPV2_SESS_ID 2 +#define ICE_FLOW_FLD_SZ_L2TPV2_LEN_SESS_ID 2 + /* Describe properties of a protocol header field */ struct ice_flow_field_info { enum ice_flow_seg_hdr hdr; @@ -61,7 +97,33 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { /* ICE_FLOW_FIELD_IDX_IPV6_SA */ ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, sizeof(struct in6_addr)), /* ICE_FLOW_FIELD_IDX_IPV6_DA */ - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, sizeof(struct in6_addr)), + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, ICE_FLOW_FLD_SZ_IPV6_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV4_CHKSUM */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV4, 10, ICE_FLOW_FLD_SZ_IP_CHKSUM), + /* ICE_FLOW_FIELD_IDX_IPV4_FRAG */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4, + ICE_FLOW_FLD_SZ_IPV4_ID), + /* ICE_FLOW_FIELD_IDX_IPV6_FRAG */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV_FRAG, 4, + ICE_FLOW_FLD_SZ_IPV6_ID), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, + ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, + ICE_FLOW_FLD_SZ_IPV6_PRE32_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, + ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, + ICE_FLOW_FLD_SZ_IPV6_PRE48_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 8, + ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR), + /* ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_IPV6, 24, + ICE_FLOW_FLD_SZ_IPV6_PRE64_ADDR), /* Transport */ /* ICE_FLOW_FIELD_IDX_TCP_SRC_PORT */ ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 0, sizeof(__be16)), @@ -76,7 +138,14 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { /* ICE_FLOW_FIELD_IDX_SCTP_DST_PORT */ ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 2, sizeof(__be16)), /* ICE_FLOW_FIELD_IDX_TCP_FLAGS */ - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 13, 1), + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 13, ICE_FLOW_FLD_SZ_TCP_FLAGS), + /* ICE_FLOW_FIELD_IDX_TCP_CHKSUM */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_TCP, 16, ICE_FLOW_FLD_SZ_TCP_CHKSUM), + /* ICE_FLOW_FIELD_IDX_UDP_CHKSUM */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_UDP, 6, ICE_FLOW_FLD_SZ_UDP_CHKSUM), + /* ICE_FLOW_FIELD_IDX_SCTP_CHKSUM */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_SCTP, 8, + ICE_FLOW_FLD_SZ_SCTP_CHKSUM), /* ARP */ /* ICE_FLOW_FIELD_IDX_ARP_SIP */ ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_ARP, 14, sizeof(struct in_addr)), @@ -108,9 +177,17 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_EH, 22, sizeof(__be16), 0x3f00), /* ICE_FLOW_FIELD_IDX_GTPU_UP_TEID */ - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_UP, 12, sizeof(__be32)), + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_UP, 12, + ICE_FLOW_FLD_SZ_GTP_TEID), + /* ICE_FLOW_FIELD_IDX_GTPU_UP_QFI */ + ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_UP, 22, + ICE_FLOW_FLD_SZ_GTP_QFI, 0x3f00), /* ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID */ - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_DWN, 12, sizeof(__be32)), + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_GTPU_DWN, 12, + ICE_FLOW_FLD_SZ_GTP_TEID), + /* ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI */ + ICE_FLOW_FLD_INFO_MSK(ICE_FLOW_SEG_HDR_GTPU_DWN, 22, + ICE_FLOW_FLD_SZ_GTP_QFI, 0x3f00), /* PPPoE */ /* ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID */ ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_PPPOE, 2, sizeof(__be16)), @@ -128,7 +205,27 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_AH, 4, sizeof(__be32)), /* NAT_T_ESP */ /* ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI */ - ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_NAT_T_ESP, 8, sizeof(__be32)), + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_NAT_T_ESP, 8, + ICE_FLOW_FLD_SZ_NAT_T_ESP_SPI), + /* ICE_FLOW_FIELD_IDX_VXLAN_VNI */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_VXLAN, 12, + ICE_FLOW_FLD_SZ_VXLAN_VNI), + /* ECPRI_TP0 */ + /* ICE_FLOW_FIELD_IDX_ECPRI_TP0_PC_ID */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_ECPRI_TP0, 4, + ICE_FLOW_FLD_SZ_ECPRI_TP0_PC_ID), + /* UDP_ECPRI_TP0 */ + /* ICE_FLOW_FIELD_IDX_UDP_ECPRI_TP0_PC_ID */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0, 12, + ICE_FLOW_FLD_SZ_ECPRI_TP0_PC_ID), + /* L2TPV2 */ + /* ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_L2TPV2, 12, + ICE_FLOW_FLD_SZ_L2TPV2_SESS_ID), + /* L2TPV2_LEN */ + /* ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID */ + ICE_FLOW_FLD_INFO(ICE_FLOW_SEG_HDR_L2TPV2, 14, + ICE_FLOW_FLD_SZ_L2TPV2_LEN_SESS_ID), }; /* Bitmaps indicating relevant packet types for a particular protocol header @@ -137,9 +234,9 @@ struct ice_flow_field_info ice_flds_info[ICE_FLOW_FIELD_IDX_MAX] = { */ static const u32 ice_ptypes_mac_ofos[] = { 0xFDC00846, 0xBFBF7F7E, 0xF70001DF, 0xFEFDFDFB, - 0x0000077E, 0x00000000, 0x00000000, 0x00000000, - 0x00400000, 0x03FFF000, 0x7FFFFFE0, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x0000077E, 0x000003FF, 0x00000000, 0x00000000, + 0x00400000, 0x03FFF000, 0xFFFFFFE0, 0x00100707, + 0xFFFFF000, 0x000003FF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -162,10 +259,10 @@ static const u32 ice_ptypes_macvlan_il[] = { * include IPv4 other PTYPEs */ static const u32 ice_ptypes_ipv4_ofos[] = { - 0x1DC00000, 0x04000800, 0x00000000, 0x00000000, + 0x1D800000, 0xBFBF7800, 0x000001DF, 0x00000000, 0x00000000, 0x00000155, 0x00000000, 0x00000000, - 0x00000000, 0x000FC000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000FC000, 0x000002A0, 0x00100000, + 0x00015000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -176,10 +273,10 @@ static const u32 ice_ptypes_ipv4_ofos[] = { * IPv4 other PTYPEs */ static const u32 ice_ptypes_ipv4_ofos_all[] = { - 0x1DC00000, 0x04000800, 0x00000000, 0x00000000, + 0x1D800000, 0x27BF7800, 0x00000000, 0x00000000, 0x00000000, 0x00000155, 0x00000000, 0x00000000, - 0x00000000, 0x000FC000, 0x83E0F800, 0x00000101, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000FC000, 0x83E0FAA0, 0x00000101, + 0x3FFD5000, 0x00000000, 0x02FBEFBC, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -190,8 +287,8 @@ static const u32 ice_ptypes_ipv4_ofos_all[] = { static const u32 ice_ptypes_ipv4_il[] = { 0xE0000000, 0xB807700E, 0x80000003, 0xE01DC03B, 0x0000000E, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x001FF800, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x001FF800, 0x00100000, + 0xC0FC0000, 0x0000000F, 0xBC0BC0BC, 0x00000BC0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -202,10 +299,10 @@ static const u32 ice_ptypes_ipv4_il[] = { * include IPv6 other PTYPEs */ static const u32 ice_ptypes_ipv6_ofos[] = { - 0x00000000, 0x00000000, 0x77000000, 0x10002000, + 0x00000000, 0x00000000, 0x76000000, 0x10002000, 0x00000000, 0x000002AA, 0x00000000, 0x00000000, - 0x00000000, 0x03F00000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x03F00000, 0x00000540, 0x00000000, + 0x0002A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -216,10 +313,10 @@ static const u32 ice_ptypes_ipv6_ofos[] = { * IPv6 other PTYPEs */ static const u32 ice_ptypes_ipv6_ofos_all[] = { - 0x00000000, 0x00000000, 0x77000000, 0x10002000, - 0x00000000, 0x000002AA, 0x00000000, 0x00000000, - 0x00080F00, 0x03F00000, 0x7C1F0000, 0x00000206, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x76000000, 0xFEFDE000, + 0x0000077E, 0x000002AA, 0x00000000, 0x00000000, + 0x00000000, 0x03F00000, 0x7C1F0540, 0x00000206, + 0xC002A000, 0x000003FF, 0xBC000000, 0x0002FBEF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -231,7 +328,7 @@ static const u32 ice_ptypes_ipv6_il[] = { 0x00000000, 0x03B80770, 0x000001DC, 0x0EE00000, 0x00000770, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7FE00000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x3F000000, 0x000003F0, 0x02F02F00, 0x0002F02F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -240,19 +337,7 @@ static const u32 ice_ptypes_ipv6_il[] = { /* Packet types for packets with an Outer/First/Single IPv4 header - no L4 */ static const u32 ice_ptypes_ipv4_ofos_no_l4[] = { - 0x10C00000, 0x04000800, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, -}; - -/* Packet types for packets with an Outermost/First ARP header */ -static const u32 ice_ptypes_arp_of[] = { - 0x00000800, 0x00000000, 0x00000000, 0x00000000, + 0x10800000, 0x04000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -276,7 +361,7 @@ static const u32 ice_ptypes_ipv4_il_no_l4[] = { /* Packet types for packets with an Outer/First/Single IPv6 header - no L4 */ static const u32 ice_ptypes_ipv6_ofos_no_l4[] = { - 0x00000000, 0x00000000, 0x43000000, 0x10002000, + 0x00000000, 0x00000000, 0x42000000, 0x10002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -298,14 +383,26 @@ static const u32 ice_ptypes_ipv6_il_no_l4[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +/* Packet types for packets with an Outermost/First ARP header */ +static const u32 ice_ptypes_arp_of[] = { + 0x00000800, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + /* UDP Packet types for non-tunneled packets or tunneled * packets with inner UDP. */ static const u32 ice_ptypes_udp_il[] = { 0x81000000, 0x20204040, 0x04000010, 0x80810102, 0x00000040, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00410000, 0x90842000, 0x00000007, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00410000, 0x908427E0, 0x00100007, + 0x0413F000, 0x00000041, 0x10410410, 0x00004104, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -317,7 +414,7 @@ static const u32 ice_ptypes_tcp_il[] = { 0x04000000, 0x80810102, 0x10000040, 0x02040408, 0x00000102, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00820000, 0x21084000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x08200000, 0x00000082, 0x20820820, 0x00008208, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -329,7 +426,7 @@ static const u32 ice_ptypes_sctp_il[] = { 0x08000000, 0x01020204, 0x20000081, 0x04080810, 0x00000204, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01040000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x10400000, 0x00000104, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -353,7 +450,7 @@ static const u32 ice_ptypes_icmp_il[] = { 0x00000000, 0x02040408, 0x40000102, 0x08101020, 0x00000408, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x42108000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x20800000, 0x00000208, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -365,7 +462,7 @@ static const u32 ice_ptypes_gre_of[] = { 0x00000000, 0xBFBF7800, 0x000001DF, 0xFEFDE000, 0x0000017E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xBEFBEFBC, 0x0002FBEF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -374,7 +471,7 @@ static const u32 ice_ptypes_gre_of[] = { /* Packet types for packets with an Innermost/Last MAC header */ static const u32 ice_ptypes_mac_il[] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -388,7 +485,19 @@ static const u32 ice_ptypes_mac_il[] = { static const u32 ice_ptypes_gtpc[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000180, 0x00000000, + 0x00000000, 0x00000000, 0x000001E0, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +/* Packet types for VXLAN with VNI */ +static const u32 ice_ptypes_vxlan_vni[] = { + 0x00000000, 0xBFBFF800, 0x00EFDFDF, 0xFEFDE000, + 0x03BF7F7E, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -430,6 +539,46 @@ static const struct ice_ptype_attributes ice_attr_gtpu_session[] = { { ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, { ICE_MAC_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, { ICE_MAC_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_SESSION }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_SESSION }, }; static const struct ice_ptype_attributes ice_attr_gtpu_eh[] = { @@ -453,6 +602,46 @@ static const struct ice_ptype_attributes ice_attr_gtpu_eh[] = { { ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, { ICE_MAC_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, { ICE_MAC_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_PDU_EH }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_PDU_EH }, }; static const struct ice_ptype_attributes ice_attr_gtpu_down[] = { @@ -476,6 +665,46 @@ static const struct ice_ptype_attributes ice_attr_gtpu_down[] = { { ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, { ICE_MAC_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, { ICE_MAC_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_DOWNLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_DOWNLINK }, }; static const struct ice_ptype_attributes ice_attr_gtpu_up[] = { @@ -499,13 +728,53 @@ static const struct ice_ptype_attributes ice_attr_gtpu_up[] = { { ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, { ICE_MAC_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, { ICE_MAC_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV4_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV4_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV4_ICMP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_FRAG, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_UDP_PAY, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_TCP, ICE_PTYPE_ATTR_GTP_UPLINK }, + { MAC_IPV6_TUN_IPV6_GTPU_IPV6_ICMPV6, ICE_PTYPE_ATTR_GTP_UPLINK }, }; static const u32 ice_ptypes_gtpu[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7FFFFE00, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x0000003F, 0xBEFBEFBC, 0x0002FBEF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -607,6 +876,83 @@ static const u32 ice_ptypes_mac_non_ip_ofos[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; +static const u32 ice_ptypes_gtpu_no_ip[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000600, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const u32 ice_ptypes_ecpri_tp0[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000400, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const u32 ice_ptypes_udp_ecpri_tp0[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00100000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const u32 ice_ptypes_l2tpv2[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFF000, 0x000003FF, 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, + 0xFFFF0000, 0x000003FF, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const u32 ice_ptypes_ipv4_frag[] = { + 0x00400000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const u32 ice_ptypes_ipv6_frag[] = { + 0x00000000, 0x00000000, 0x01000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 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; @@ -631,8 +977,13 @@ struct ice_flow_prof_params { ICE_FLOW_SEG_HDR_GTPC_TEID | ICE_FLOW_SEG_HDR_GTPU | \ 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_NAT_T_ESP | ICE_FLOW_SEG_HDR_GTPU_NON_IP | \ + ICE_FLOW_SEG_HDR_VXLAN | ICE_FLOW_SEG_HDR_GRE | \ + 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) #define ICE_FLOW_SEG_HDRS_L3_MASK \ (ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_ARP) #define ICE_FLOW_SEG_HDRS_L4_MASK \ @@ -755,6 +1106,12 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) ICE_FLOW_PTYPE_MAX); } + if (hdrs & ICE_FLOW_SEG_HDR_ECPRI_TP0) { + src = (const unsigned long *)ice_ptypes_ecpri_tp0; + bitmap_and(params->ptypes, params->ptypes, src, + ICE_FLOW_PTYPE_MAX); + } + if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) && (hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER)) { src = i ? (const unsigned long *)ice_ptypes_ipv4_il : @@ -767,6 +1124,16 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) (const unsigned long *)ice_ptypes_ipv6_ofos_all; bitmap_and(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); + } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) && + (hdrs & ICE_FLOW_SEG_HDR_IPV_FRAG)) { + src = (const unsigned long *)ice_ptypes_ipv4_frag; + bitmap_and(params->ptypes, params->ptypes, src, + ICE_FLOW_PTYPE_MAX); + } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV6) && + (hdrs & ICE_FLOW_SEG_HDR_IPV_FRAG)) { + src = (const unsigned long *)ice_ptypes_ipv6_frag; + bitmap_and(params->ptypes, params->ptypes, src, + ICE_FLOW_PTYPE_MAX); } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) && !(hdrs & ICE_FLOW_SEG_HDRS_L4_MASK_NO_OTHER)) { src = !i ? (const unsigned long *)ice_ptypes_ipv4_ofos_no_l4 : @@ -825,19 +1192,21 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) bitmap_and(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GRE) { - if (!i) { - src = (const unsigned long *)ice_ptypes_gre_of; - bitmap_and(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); - } + src = (const unsigned long *)ice_ptypes_gre_of; + bitmap_and(params->ptypes, params->ptypes, src, + ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPC) { src = (const unsigned long *)ice_ptypes_gtpc; bitmap_and(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPC_TEID) { src = (const unsigned long *)ice_ptypes_gtpc_tid; - bitmap_and(params->ptypes, params->ptypes, src, - ICE_FLOW_PTYPE_MAX); + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); + } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_NON_IP) { + src = (const unsigned long *)ice_ptypes_gtpu_no_ip; + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_DWN) { src = (const unsigned long *)ice_ptypes_gtpu; bitmap_and(params->ptypes, params->ptypes, src, @@ -864,8 +1233,16 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) params->attr_cnt = ARRAY_SIZE(ice_attr_gtpu_eh); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_IP) { src = (const unsigned long *)ice_ptypes_gtpu; - bitmap_and(params->ptypes, params->ptypes, src, - ICE_FLOW_PTYPE_MAX); + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); + + /* 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 unsigned long *)ice_ptypes_l2tpv2; + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_L2TPV3) { src = (const unsigned long *)ice_ptypes_l2tpv3; bitmap_and(params->ptypes, params->ptypes, src, @@ -880,8 +1257,22 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_NAT_T_ESP) { src = (const unsigned long *)ice_ptypes_nat_t_esp; - bitmap_and(params->ptypes, params->ptypes, src, - ICE_FLOW_PTYPE_MAX); + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); + } else if (hdrs & ICE_FLOW_SEG_HDR_VXLAN) { + src = (const unsigned long *)ice_ptypes_vxlan_vni; + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); + } else if (hdrs & ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0) { + src = (const unsigned long *)ice_ptypes_udp_ecpri_tp0; + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); + } + + if (hdrs & ICE_FLOW_SEG_HDR_PPP) { + src = (const unsigned long *)ice_ptypes_ppp; + bitmap_and(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } if (hdrs & ICE_FLOW_SEG_HDR_PFCP) { @@ -906,13 +1297,49 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) return 0; } +/** + * ice_flow_xtract_pkt_flags - Create an extr sequence entry for packet flags + * @hw: pointer to the HW struct + * @params: information about the flow to be processed + * @flags: The value of pkt_flags[x:x] in Rx/Tx MDID metadata. + * + * This function will allocate an extraction sequence entries for a DWORD size + * chunk of the packet flags. + */ +static int +ice_flow_xtract_pkt_flags(struct ice_hw *hw, + struct ice_flow_prof_params *params, + enum ice_flex_mdid_pkt_flags flags) +{ + u8 fv_words = (u8)hw->blk[params->blk].es.fvw; + u8 idx; + + /* Make sure the number of extraction sequence entries required does not + * exceed the block's capacity. + */ + if (params->es_cnt >= fv_words) + return -ENOSPC; + + /* some blocks require a reversed field vector layout */ + if (hw->blk[params->blk].es.reverse) + idx = fv_words - params->es_cnt - 1; + else + idx = params->es_cnt; + + params->es[idx].prot_id = ICE_PROT_META_ID; + params->es[idx].off = (u16)flags; + params->es_cnt++; + + return 0; +} + /** * ice_flow_xtract_fld - Create an extraction sequence entry for the given field * @hw: pointer to the HW struct * @params: information about the flow to be processed * @seg: packet segment index of the field to be extracted * @fld: ID of field to be extracted - * @match: bit field of all fields + * @match: bitfield of all fields * * This function determines the protocol ID, offset, and size of the given * field. It then allocates one or more extraction sequence entries for the @@ -920,11 +1347,11 @@ static int ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) */ static int ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, - u8 seg, enum ice_flow_field fld, u64 match) + u8 seg, enum ice_flow_field fld, unsigned long *match) { enum ice_flow_field sib = ICE_FLOW_FIELD_IDX_MAX; + u8 fv_words = (u8)hw->blk[params->blk].es.fvw; enum ice_prot_id prot_id = ICE_PROT_ID_INVAL; - u8 fv_words = hw->blk[params->blk].es.fvw; struct ice_flow_fld_info *flds; u16 cnt, ese_bits, i; u16 sib_mask = 0; @@ -952,68 +1379,103 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, case ICE_FLOW_FIELD_IDX_IPV4_TTL: case ICE_FLOW_FIELD_IDX_IPV4_PROT: prot_id = seg == 0 ? ICE_PROT_IPV4_OF_OR_S : ICE_PROT_IPV4_IL; - + if (params->prof->segs[0].hdrs & ICE_FLOW_SEG_HDR_GRE && + params->prof->segs[1].hdrs & ICE_FLOW_SEG_HDR_GTPU && + seg == 1) + prot_id = ICE_PROT_IPV4_IL_IL; /* TTL and PROT share the same extraction seq. entry. * Each is considered a sibling to the other in terms of sharing * the same extraction sequence entry. */ if (fld == ICE_FLOW_FIELD_IDX_IPV4_TTL) sib = ICE_FLOW_FIELD_IDX_IPV4_PROT; - else if (fld == ICE_FLOW_FIELD_IDX_IPV4_PROT) + else sib = ICE_FLOW_FIELD_IDX_IPV4_TTL; /* If the sibling field is also included, that field's * mask needs to be included. */ - if (match & BIT(sib)) + if (test_bit(sib, match)) sib_mask = ice_flds_info[sib].mask; break; case ICE_FLOW_FIELD_IDX_IPV6_TTL: case ICE_FLOW_FIELD_IDX_IPV6_PROT: prot_id = seg == 0 ? ICE_PROT_IPV6_OF_OR_S : ICE_PROT_IPV6_IL; - + if (params->prof->segs[0].hdrs & ICE_FLOW_SEG_HDR_GRE && + params->prof->segs[1].hdrs & ICE_FLOW_SEG_HDR_GTPU && + seg == 1) + prot_id = ICE_PROT_IPV6_IL_IL; /* TTL and PROT share the same extraction seq. entry. * Each is considered a sibling to the other in terms of sharing * the same extraction sequence entry. */ if (fld == ICE_FLOW_FIELD_IDX_IPV6_TTL) sib = ICE_FLOW_FIELD_IDX_IPV6_PROT; - else if (fld == ICE_FLOW_FIELD_IDX_IPV6_PROT) + else sib = ICE_FLOW_FIELD_IDX_IPV6_TTL; /* If the sibling field is also included, that field's * mask needs to be included. */ - if (match & BIT(sib)) + if (test_bit(sib, match)) sib_mask = ice_flds_info[sib].mask; break; case ICE_FLOW_FIELD_IDX_IPV4_SA: case ICE_FLOW_FIELD_IDX_IPV4_DA: + case ICE_FLOW_FIELD_IDX_IPV4_CHKSUM: prot_id = seg == 0 ? ICE_PROT_IPV4_OF_OR_S : ICE_PROT_IPV4_IL; + if (params->prof->segs[0].hdrs & ICE_FLOW_SEG_HDR_GRE && + params->prof->segs[1].hdrs & ICE_FLOW_SEG_HDR_GTPU && + seg == 1) + prot_id = ICE_PROT_IPV4_IL_IL; + break; + case ICE_FLOW_FIELD_IDX_IPV4_ID: + prot_id = ICE_PROT_IPV4_OF_OR_S; break; case ICE_FLOW_FIELD_IDX_IPV6_SA: case ICE_FLOW_FIELD_IDX_IPV6_DA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA: + case ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA: prot_id = seg == 0 ? ICE_PROT_IPV6_OF_OR_S : ICE_PROT_IPV6_IL; + if (params->prof->segs[0].hdrs & ICE_FLOW_SEG_HDR_GRE && + params->prof->segs[1].hdrs & ICE_FLOW_SEG_HDR_GTPU && + seg == 1) + prot_id = ICE_PROT_IPV6_IL_IL; + break; + case ICE_FLOW_FIELD_IDX_IPV6_ID: + prot_id = ICE_PROT_IPV6_FRAG; break; case ICE_FLOW_FIELD_IDX_TCP_SRC_PORT: case ICE_FLOW_FIELD_IDX_TCP_DST_PORT: case ICE_FLOW_FIELD_IDX_TCP_FLAGS: + case ICE_FLOW_FIELD_IDX_TCP_CHKSUM: prot_id = ICE_PROT_TCP_IL; break; case ICE_FLOW_FIELD_IDX_UDP_SRC_PORT: case ICE_FLOW_FIELD_IDX_UDP_DST_PORT: + case ICE_FLOW_FIELD_IDX_UDP_CHKSUM: prot_id = ICE_PROT_UDP_IL_OR_S; break; case ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT: case ICE_FLOW_FIELD_IDX_SCTP_DST_PORT: + case ICE_FLOW_FIELD_IDX_SCTP_CHKSUM: prot_id = ICE_PROT_SCTP_IL; break; + case ICE_FLOW_FIELD_IDX_VXLAN_VNI: case ICE_FLOW_FIELD_IDX_GTPC_TEID: case ICE_FLOW_FIELD_IDX_GTPU_IP_TEID: case ICE_FLOW_FIELD_IDX_GTPU_UP_TEID: case ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID: case ICE_FLOW_FIELD_IDX_GTPU_EH_TEID: case ICE_FLOW_FIELD_IDX_GTPU_EH_QFI: + case ICE_FLOW_FIELD_IDX_GTPU_UP_QFI: + case ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI: + case ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID: + case ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID: /* GTP is accessed through UDP OF protocol */ prot_id = ICE_PROT_UDP_OF; break; @@ -1035,6 +1497,12 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, case ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI: prot_id = ICE_PROT_UDP_IL_OR_S; break; + case ICE_FLOW_FIELD_IDX_ECPRI_TP0_PC_ID: + prot_id = ICE_PROT_ECPRI; + break; + case ICE_FLOW_FIELD_IDX_UDP_ECPRI_TP0_PC_ID: + prot_id = ICE_PROT_UDP_IL_OR_S; + break; case ICE_FLOW_FIELD_IDX_ARP_SIP: case ICE_FLOW_FIELD_IDX_ARP_DIP: case ICE_FLOW_FIELD_IDX_ARP_SHA: @@ -1046,7 +1514,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, case ICE_FLOW_FIELD_IDX_ICMP_CODE: /* ICMP type and code share the same extraction seq. entry */ prot_id = (params->prof->segs[seg].hdrs & ICE_FLOW_SEG_HDR_IPV4) ? - ICE_PROT_ICMP_IL : ICE_PROT_ICMPV6_IL; + ICE_PROT_ICMP_IL : ICE_PROT_ICMPV6_IL; sib = fld == ICE_FLOW_FIELD_IDX_ICMP_TYPE ? ICE_FLOW_FIELD_IDX_ICMP_CODE : ICE_FLOW_FIELD_IDX_ICMP_TYPE; @@ -1063,7 +1531,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, */ ese_bits = ICE_FLOW_FV_EXTRACT_SZ * BITS_PER_BYTE; - flds[fld].xtrct.prot_id = prot_id; + flds[fld].xtrct.prot_id = (u8)prot_id; flds[fld].xtrct.off = (ice_flds_info[fld].off / ese_bits) * ICE_FLOW_FV_EXTRACT_SZ; flds[fld].xtrct.disp = (u8)(ice_flds_info[fld].off % ese_bits); @@ -1101,7 +1569,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, else idx = params->es_cnt; - params->es[idx].prot_id = prot_id; + params->es[idx].prot_id = (u8)prot_id; params->es[idx].off = off; params->mask[idx] = mask | sib_mask; params->es_cnt++; @@ -1200,20 +1668,30 @@ static int ice_flow_create_xtrct_seq(struct ice_hw *hw, struct ice_flow_prof_params *params) { - struct ice_flow_prof *prof = params->prof; int status = 0; u8 i; - for (i = 0; i < prof->segs_cnt; i++) { - u64 match = params->prof->segs[i].match; + /* For ACL, we also need to extract the direction bit (Rx,Tx) data from + * packet flags + */ + if (params->blk == ICE_BLK_ACL) { + status = ice_flow_xtract_pkt_flags(hw, params, + ICE_RX_MDID_PKT_FLAGS_15_0); + if (status) + return status; + } + + for (i = 0; i < params->prof->segs_cnt; i++) { + DECLARE_BITMAP(match, ICE_FLOW_FIELD_IDX_MAX); enum ice_flow_field j; - for_each_set_bit(j, (unsigned long *)&match, - ICE_FLOW_FIELD_IDX_MAX) { + bitmap_copy(match, params->prof->segs[i].match, + ICE_FLOW_FIELD_IDX_MAX); + for_each_set_bit(j, match, ICE_FLOW_FIELD_IDX_MAX) { status = ice_flow_xtract_fld(hw, params, i, j, match); if (status) return status; - clear_bit(j, (unsigned long *)&match); + clear_bit(j, match); } /* Process raw matching bytes */ @@ -1292,7 +1770,7 @@ ice_flow_find_prof_conds(struct ice_hw *hw, enum ice_block blk, /* Check for symmetric settings */ if ((conds & ICE_FLOW_FIND_PROF_CHK_SYMM) && - p->symm != symm) + p->cfg.symm != symm) continue; /* Protocol headers must be checked. Matched fields are @@ -1301,7 +1779,9 @@ ice_flow_find_prof_conds(struct ice_hw *hw, enum ice_block blk, for (i = 0; i < segs_cnt; i++) if (segs[i].hdrs != p->segs[i].hdrs || ((conds & ICE_FLOW_FIND_PROF_CHK_FLDS) && - segs[i].match != p->segs[i].match)) + (!bitmap_equal(segs[i].match, + p->segs[i].match, + ICE_FLOW_FIELD_IDX_MAX)))) break; /* A match is found if all segments are matched */ @@ -1360,6 +1840,8 @@ ice_flow_rem_entry_sync(struct ice_hw *hw, enum ice_block __always_unused blk, * @dir: flow direction * @segs: array of one or more packet segments that describe the flow * @segs_cnt: number of packet segments provided + * @acts: array of default actions + * @acts_cnt: number of default actions * @symm: symmetric setting for RSS profiles * @prof: stores the returned flow profile added * @@ -1369,6 +1851,7 @@ static int ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, struct ice_flow_seg_info *segs, u8 segs_cnt, + struct ice_flow_action *acts, u8 acts_cnt, bool symm, struct ice_flow_prof **prof) { struct ice_flow_prof_params *params; @@ -1377,12 +1860,12 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, u64 prof_id; u8 i; - if (!prof) + if (!prof || (acts_cnt && !acts)) return -EINVAL; ids = &hw->blk[blk].prof_id; prof_id = find_first_zero_bit(ids->id, ids->count); - if (prof_id >= ids->count) + if (prof_id >= (u64)ids->count) return -ENOSPC; params = kzalloc(sizeof(*params), GFP_KERNEL); @@ -1406,7 +1889,7 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, params->prof->id = prof_id; params->prof->dir = dir; params->prof->segs_cnt = segs_cnt; - params->prof->symm = symm; + params->prof->cfg.symm = symm; /* Make a copy of the segments that need to be persistent in the flow * profile instance @@ -1414,6 +1897,20 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, for (i = 0; i < segs_cnt; i++) memcpy(¶ms->prof->segs[i], &segs[i], sizeof(*segs)); + /* Make a copy of the actions that need to be persistent in the flow + * profile instance. + */ + if (acts_cnt) { + params->prof->acts = devm_kmemdup(ice_hw_to_dev(hw), acts, + acts_cnt * sizeof(*acts), + GFP_KERNEL); + + if (!params->prof->acts) { + status = -ENOMEM; + goto out; + } + } + status = ice_flow_proc_segs(hw, params); if (status) { ice_debug(hw, ICE_DBG_FLOW, "Error processing a flow's packet segments\n"); @@ -1421,7 +1918,7 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, } /* Add a HW profile for this flow profile */ - status = ice_add_prof(hw, blk, prof_id, (u8 *)params->ptypes, + status = ice_add_prof(hw, blk, prof_id, params->ptypes, params->attr, params->attr_cnt, params->es, params->mask, symm, true); if (status) { @@ -1435,8 +1932,11 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk, *prof = params->prof; out: - if (status) + if (status) { + if (params->prof->acts) + devm_kfree(ice_hw_to_dev(hw), params->prof->acts); devm_kfree(ice_hw_to_dev(hw), params->prof); + } free_params: kfree(params); @@ -1559,20 +2059,19 @@ ice_flow_disassoc_prof(struct ice_hw *hw, enum ice_block blk, #define FLAG_GTPU_DW FLAG_GTP_EH_PDU /** - * ice_flow_set_parser_prof - Set flow profile based on the parsed profile info + * ice_flow_set_hw_prof - Set HW flow profile based on the parsed profile info * @hw: pointer to the HW struct - * @dest_vsi: dest VSI - * @fdir_vsi: fdir programming VSI + * @dest_vsi_handle: dest VSI handle + * @fdir_vsi_handle: fdir programming VSI handle * @prof: stores parsed profile info from raw flow - * @blk: classification blk - * - * Return: 0 on success or negative errno on failure. + * @blk: classification stage */ int -ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, - struct ice_parser_profile *prof, enum ice_block blk) +ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle, + u16 fdir_vsi_handle, struct ice_parser_profile *prof, + enum ice_block blk) { - u64 id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX); + int id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX); struct ice_flow_prof_params *params __free(kfree); u8 fv_words = hw->blk[blk].es.fvw; int status; @@ -1594,10 +2093,8 @@ ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, idx = i; params->es[idx].prot_id = prof->fv[i].proto_id; params->es[idx].off = prof->fv[i].offset; - params->mask[idx] = (((prof->fv[i].msk) << BITS_PER_BYTE) & - HI_BYTE_IN_WORD) | - (((prof->fv[i].msk) >> BITS_PER_BYTE) & - LO_BYTE_IN_WORD); + params->mask[idx] = FIELD_PREP(0xff00, (prof->fv[i].msk)) | + (((prof->fv[i].msk) >> 8) & 0x00ff); } switch (prof->flags) { @@ -1617,16 +2114,20 @@ ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, break; } - status = ice_add_prof(hw, blk, id, (u8 *)prof->ptypes, + status = ice_add_prof(hw, blk, id, prof->ptypes, params->attr, params->attr_cnt, params->es, params->mask, false, false); if (status) - return status; + goto free_params; - status = ice_flow_assoc_fdir_prof(hw, blk, dest_vsi, fdir_vsi, id); + status = ice_flow_assoc_hw_prof(hw, blk, dest_vsi_handle, + fdir_vsi_handle, id); if (status) - ice_rem_prof(hw, blk, id); + goto free_params; + return 0; + +free_params: return status; } @@ -1637,12 +2138,15 @@ ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, * @dir: flow direction * @segs: array of one or more packet segments that describe the flow * @segs_cnt: number of packet segments provided + * @acts: array of default actions + * @acts_cnt: number of default actions * @symm: symmetric setting for RSS profiles * @prof: stores the returned flow profile added */ int ice_flow_add_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, struct ice_flow_seg_info *segs, u8 segs_cnt, + struct ice_flow_action *acts, u8 acts_cnt, bool symm, struct ice_flow_prof **prof) { int status; @@ -1663,7 +2167,7 @@ ice_flow_add_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, mutex_lock(&hw->fl_profs_locks[blk]); status = ice_flow_add_prof_sync(hw, blk, dir, segs, segs_cnt, - symm, prof); + acts, acts_cnt, symm, prof); if (!status) list_add(&(*prof)->l_entry, &hw->fl_profs[blk]); @@ -1709,16 +2213,23 @@ int ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id) * @vsi_handle: software VSI handle for the flow entry * @prio: priority of the flow entry * @data: pointer to a data buffer containing flow entry's match values/masks + * @acts: arrays of actions to be performed on a match + * @acts_cnt: number of actions * @entry_h: pointer to buffer that receives the new flow entry's handle */ int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, u64 entry_id, u16 vsi_handle, enum ice_flow_priority prio, - void *data, u64 *entry_h) + void *data, struct ice_flow_action *acts, u8 acts_cnt, + u64 *entry_h) { struct ice_flow_entry *e = NULL; struct ice_flow_prof *prof; - int status; + int status = 0; + + /* ACL entries must indicate an action */ + if (blk == ICE_BLK_ACL && (!acts || !acts_cnt)) + return -EINVAL; /* No flow entry data is expected for RSS */ if (!entry_h || (!data && blk != ICE_BLK_RSS)) @@ -1761,15 +2272,20 @@ ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, goto out; } - mutex_lock(&prof->entries_lock); - list_add(&e->l_entry, &prof->entries); - mutex_unlock(&prof->entries_lock); + if (blk != ICE_BLK_ACL) { + /* ACL will handle the entry management */ + mutex_lock(&prof->entries_lock); + list_add(&e->l_entry, &prof->entries); + mutex_unlock(&prof->entries_lock); + } *entry_h = ICE_FLOW_ENTRY_HNDL(e); out: - if (status) + if (status && e) { + devm_kfree(ice_hw_to_dev(hw), e->entry); devm_kfree(ice_hw_to_dev(hw), e); + } return status; } @@ -1831,11 +2347,9 @@ ice_flow_set_fld_ext(struct ice_flow_seg_info *seg, enum ice_flow_field fld, enum ice_flow_fld_match_type field_type, u16 val_loc, u16 mask_loc, u16 last_loc) { - u64 bit = BIT_ULL(fld); - - seg->match |= bit; + set_bit(fld, seg->match); if (field_type == ICE_FLOW_FLD_TYPE_RANGE) - seg->range |= bit; + set_bit(fld, seg->range); seg->fields[fld].type = field_type; seg->fields[fld].src.val = val_loc; @@ -1912,27 +2426,29 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len, } /** - * ice_flow_rem_vsi_prof - remove VSI from flow profile + * 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 disassociate the VSI from the flow profile. + * vsi handle and disassociates the vsi from the flow profile. */ -int ice_flow_rem_vsi_prof(struct ice_hw *hw, u16 vsi_handle, u64 prof_id) +int ice_flow_rem_vsi_prof(struct ice_hw *hw, enum ice_block blk, u16 vsi_handle, + u64 prof_id) { - struct ice_flow_prof *prof; + struct ice_flow_prof *prof = NULL; int status = 0; - if (!ice_is_vsi_valid(hw, vsi_handle)) + if (blk >= ICE_BLK_COUNT || !ice_is_vsi_valid(hw, vsi_handle)) return -EINVAL; - /* find flow profile pointer with input package block and profile ID */ + /* 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=%llu\n", - prof_id); + ice_debug(hw, ICE_DBG_PKG, + "Cannot find flow profile id=%llu\n", prof_id); return -ENOENT; } @@ -1945,7 +2461,7 @@ int ice_flow_rem_vsi_prof(struct ice_hw *hw, u16 vsi_handle, u64 prof_id) if (e->vsi_handle != vsi_handle) continue; - status = ice_flow_rem_entry_sync(hw, ICE_BLK_FD, e); + status = ice_flow_rem_entry_sync(hw, blk, e); if (status) break; } @@ -1954,10 +2470,11 @@ int ice_flow_rem_vsi_prof(struct ice_hw *hw, u16 vsi_handle, u64 prof_id) if (status) return status; - /* disassociate the flow profile from sw VSI handle */ - status = ice_flow_disassoc_prof(hw, ICE_BLK_FD, prof, vsi_handle); + /* 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", + ice_debug(hw, ICE_DBG_PKG, + "ice_flow_disassoc_prof() failed with status=%d\n", status); return status; } @@ -2115,15 +2632,6 @@ ice_get_rss_hdr_type(struct ice_flow_prof *prof) return ICE_RSS_ANY_HEADERS; } -static bool -ice_rss_match_prof(struct ice_rss_cfg *r, struct ice_flow_prof *prof, - enum ice_rss_cfg_hdr_type hdr_type) -{ - return (r->hash.hdr_type == hdr_type && - r->hash.hash_flds == prof->segs[prof->segs_cnt - 1].match && - r->hash.addl_hdrs == prof->segs[prof->segs_cnt - 1].hdrs); -} - /** * ice_rem_rss_list - remove RSS configuration from list * @hw: pointer to the hardware structure @@ -2137,6 +2645,11 @@ ice_rem_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) { enum ice_rss_cfg_hdr_type hdr_type; struct ice_rss_cfg *r, *tmp; + u64 seg_match; + + /* convert match bitmap to u64 for hash field comparison */ + bitmap_to_arr64(&seg_match, prof->segs[prof->segs_cnt - 1].match, + ICE_FLOW_FIELD_IDX_MAX); /* Search for RSS hash fields associated to the VSI that match the * hash configurations associated to the flow profile. If found @@ -2144,7 +2657,9 @@ ice_rem_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) */ hdr_type = ice_get_rss_hdr_type(prof); list_for_each_entry_safe(r, tmp, &hw->rss_list_head, l_entry) - if (ice_rss_match_prof(r, prof, hdr_type)) { + if (r->hash.hash_flds == seg_match && + r->hash.addl_hdrs == prof->segs[prof->segs_cnt - 1].hdrs && + r->hash.hdr_type == hdr_type) { clear_bit(vsi_handle, r->vsis); if (bitmap_empty(r->vsis, ICE_MAX_VSI)) { list_del(&r->l_entry); @@ -2167,23 +2682,30 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) { enum ice_rss_cfg_hdr_type hdr_type; struct ice_rss_cfg *r, *rss_cfg; + u64 seg_match; + + bitmap_to_arr64(&seg_match, prof->segs[prof->segs_cnt - 1].match, + ICE_FLOW_FIELD_IDX_MAX); hdr_type = ice_get_rss_hdr_type(prof); list_for_each_entry(r, &hw->rss_list_head, l_entry) - if (ice_rss_match_prof(r, prof, hdr_type)) { + if (r->hash.hash_flds == seg_match && + r->hash.addl_hdrs == prof->segs[prof->segs_cnt - 1].hdrs && + r->hash.hdr_type == hdr_type) { set_bit(vsi_handle, r->vsis); return 0; } rss_cfg = devm_kzalloc(ice_hw_to_dev(hw), sizeof(*rss_cfg), GFP_KERNEL); + if (!rss_cfg) return -ENOMEM; - rss_cfg->hash.hash_flds = prof->segs[prof->segs_cnt - 1].match; + rss_cfg->hash.hash_flds = seg_match; rss_cfg->hash.addl_hdrs = prof->segs[prof->segs_cnt - 1].hdrs; rss_cfg->hash.hdr_type = hdr_type; - rss_cfg->hash.symm = prof->symm; + rss_cfg->hash.symm = prof->cfg.symm; set_bit(vsi_handle, rss_cfg->vsis); list_add_tail(&rss_cfg->l_entry, &hw->rss_list_head); @@ -2254,7 +2776,7 @@ ice_rss_config_xor(struct ice_hw *hw, u8 prof_id, u8 src, u8 dst, u8 len) * indexes in GLQF_HSYMM and GLQF_HINSET. This function configures the profile's * GLQF_HSYMM registers. */ -static void ice_rss_set_symm(struct ice_hw *hw, struct ice_flow_prof *prof) +static void ice_rss_update_symm(struct ice_hw *hw, struct ice_flow_prof *prof) { struct ice_prof_map *map; u8 prof_id, m; @@ -2272,7 +2794,7 @@ static void ice_rss_set_symm(struct ice_hw *hw, struct ice_flow_prof *prof) for (m = 0; m < GLQF_HSYMM_REG_PER_PROF; m++) wr32(hw, GLQF_HSYMM(prof_id, m), 0); - if (prof->symm) { + if (prof->cfg.symm) { struct ice_flow_seg_xtrct *ipv4_src, *ipv4_dst; struct ice_flow_seg_xtrct *ipv6_src, *ipv6_dst; struct ice_flow_seg_xtrct *sctp_src, *sctp_dst; @@ -2324,6 +2846,120 @@ static void ice_rss_set_symm(struct ice_hw *hw, struct ice_flow_prof *prof) } } +/** + * ice_rss_cfg_raw_symm - configure symmetric hash parameters + * for raw pattern + * @hw: pointer to the hardware structure + * @prof: pointer to parser profile + * @prof_id: profile ID + * + * Calculate symmetric hash parameters based on input protocol type. + */ +static void +ice_rss_cfg_raw_symm(struct ice_hw *hw, + struct ice_parser_profile *prof, u64 prof_id) +{ + u8 src_idx, dst_idx, proto_id; + int len, i = 0; + + while (i < prof->fv_num) { + proto_id = prof->fv[i].proto_id; + + switch (proto_id) { + case ICE_PROT_IPV4_OF_OR_S: + case ICE_PROT_IPV4_IL: + case ICE_PROT_IPV4_IL_IL: + len = ICE_FLOW_FLD_SZ_IPV4_ADDR / + ICE_FLOW_FV_EXTRACT_SZ; + if (prof->fv[i].offset == + ICE_FLOW_FIELD_IPV4_SRC_OFFSET && + prof->fv[i + len].proto_id == proto_id && + prof->fv[i + len].offset == + ICE_FLOW_FIELD_IPV4_DST_OFFSET) { + src_idx = i; + dst_idx = i + len; + i += 2 * len; + break; + } + i++; + continue; + case ICE_PROT_IPV6_OF_OR_S: + case ICE_PROT_IPV6_IL: + case ICE_PROT_IPV6_IL_IL: + len = ICE_FLOW_FLD_SZ_IPV6_ADDR / + ICE_FLOW_FV_EXTRACT_SZ; + if (prof->fv[i].offset == + ICE_FLOW_FIELD_IPV6_SRC_OFFSET && + prof->fv[i + len].proto_id == proto_id && + prof->fv[i + len].offset == + ICE_FLOW_FIELD_IPV6_DST_OFFSET) { + src_idx = i; + dst_idx = i + len; + i += 2 * len; + break; + } + i++; + continue; + case ICE_PROT_TCP_IL: + case ICE_PROT_UDP_IL_OR_S: + case ICE_PROT_SCTP_IL: + len = ICE_FLOW_FLD_SZ_PORT / + ICE_FLOW_FV_EXTRACT_SZ; + if (prof->fv[i].offset == + ICE_FLOW_FIELD_SRC_PORT_OFFSET && + prof->fv[i + len].proto_id == proto_id && + prof->fv[i + len].offset == + ICE_FLOW_FIELD_DST_PORT_OFFSET) { + src_idx = i; + dst_idx = i + len; + i += 2 * len; + break; + } + i++; + continue; + default: + i++; + continue; + } + ice_rss_config_xor(hw, prof_id, src_idx, dst_idx, len); + } +} + +/* Max registers index per packet profile */ +#define ICE_SYMM_REG_INDEX_MAX 6 + +/** + * ice_rss_update_raw_symm - update symmetric hash configuration + * for raw pattern + * @hw: pointer to the hardware structure + * @cfg: configure parameters for raw pattern + * @id: profile tracking ID + * + * Update symmetric hash configuration for raw pattern if required. + * Otherwise only clear to default. + */ +void +ice_rss_update_raw_symm(struct ice_hw *hw, + struct ice_rss_raw_cfg *cfg, u64 id) +{ + struct ice_prof_map *map; + u8 prof_id, m; + + mutex_lock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock); + map = ice_search_prof_id(hw, ICE_BLK_RSS, id); + if (map) + prof_id = map->prof_id; + mutex_unlock(&hw->blk[ICE_BLK_RSS].es.prof_map_lock); + if (!map) + return; + /* clear to default */ + for (m = 0; m < ICE_SYMM_REG_INDEX_MAX; m++) + wr32(hw, GLQF_HSYMM(prof_id, m), 0); + if (cfg->symm) + ice_rss_cfg_raw_symm(hw, &cfg->prof, prof_id); +} + + /** * ice_add_rss_cfg_sync - add an RSS configuration * @hw: pointer to the hardware structure @@ -2361,10 +2997,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt, cfg->symm, vsi_handle, ICE_FLOW_FIND_PROF_CHK_FLDS | - ICE_FLOW_FIND_PROF_CHK_SYMM | ICE_FLOW_FIND_PROF_CHK_VSI); - if (prof) - goto exit; + if (prof) { + if (prof->cfg.symm == cfg->symm) + goto exit; + prof->cfg.symm = cfg->symm; + goto update_symm; + } /* Check if a flow profile exists with the same protocol headers and * associated with the input VSI. If so disassociate the VSI from @@ -2389,28 +3028,35 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, } } - /* Search for a profile that has the same match fields and symmetric - * setting. If this exists then associate the VSI to this profile. + /* Search for a profile that has same match fields only. If this + * exists then associate the VSI to this profile. */ prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt, cfg->symm, vsi_handle, ICE_FLOW_FIND_PROF_CHK_SYMM | ICE_FLOW_FIND_PROF_CHK_FLDS); if (prof) { - status = ice_flow_assoc_prof(hw, blk, prof, vsi_handle); - if (!status) - status = ice_add_rss_list(hw, vsi_handle, prof); + if (prof->cfg.symm == cfg->symm) { + status = ice_flow_assoc_prof(hw, blk, prof, + vsi_handle); + if (!status) + status = ice_add_rss_list(hw, vsi_handle, + prof); + } else { + /* if a profile exist but with different symmetric + * requirement, just return error. + */ + status = -EOPNOTSUPP; + } goto exit; } /* Create a new flow profile with packet segment information. */ status = ice_flow_add_prof(hw, blk, ICE_FLOW_RX, - segs, segs_cnt, cfg->symm, &prof); + segs, segs_cnt, NULL, 0, cfg->symm, &prof); if (status) goto exit; - prof->symm = cfg->symm; - ice_rss_set_symm(hw, prof); status = ice_flow_assoc_prof(hw, blk, prof, vsi_handle); /* If association to a new flow profile failed then this profile can * be removed. @@ -2422,6 +3068,10 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, status = ice_add_rss_list(hw, vsi_handle, prof); + prof->cfg.symm = cfg->symm; +update_symm: + ice_rss_update_symm(hw, prof); + exit: kfree(segs); return status; @@ -2430,7 +3080,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, /** * ice_add_rss_cfg - add an RSS configuration with specified hashed fields * @hw: pointer to the hardware structure - * @vsi: VSI to add the RSS configuration to + * @vsi_handle: software VSI handle * @cfg: configure parameters * * This function will generate a flow profile based on fields associated with @@ -2438,19 +3088,14 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, * a flow entry to the profile. */ int -ice_add_rss_cfg(struct ice_hw *hw, struct ice_vsi *vsi, +ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, const struct ice_rss_hash_cfg *cfg) { struct ice_rss_hash_cfg local_cfg; - u16 vsi_handle; int status; - if (!vsi) - return -EINVAL; - - vsi_handle = vsi->idx; - if (!ice_is_vsi_valid(hw, vsi_handle) || - !cfg || cfg->hdr_type > ICE_RSS_ANY_HEADERS || + if (!ice_is_vsi_valid(hw, vsi_handle) || !cfg || + cfg->hdr_type > ICE_RSS_ANY_HEADERS || cfg->hash_flds == ICE_HASH_INVALID) return -EINVAL; @@ -2603,24 +3248,19 @@ ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, /** * ice_add_avf_rss_cfg - add an RSS configuration for AVF driver * @hw: pointer to the hardware structure - * @vsi: VF's VSI + * @vsi_handle: software VSI handle * @avf_hash: hash bit fields (ICE_AVF_FLOW_FIELD_*) to configure * * This function will take the hash bitmap provided by the AVF driver via a * message, convert it to ICE-compatible values, and configure RSS flow * profiles. */ -int ice_add_avf_rss_cfg(struct ice_hw *hw, struct ice_vsi *vsi, u64 avf_hash) +int ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 avf_hash) { struct ice_rss_hash_cfg hcfg; - u16 vsi_handle; int status = 0; u64 hash_flds; - if (!vsi) - return -EINVAL; - - vsi_handle = vsi->idx; if (avf_hash == ICE_AVF_FLOW_FIELD_INVALID || !ice_is_vsi_valid(hw, vsi_handle)) return -EINVAL; @@ -2694,7 +3334,7 @@ int ice_add_avf_rss_cfg(struct ice_hw *hw, struct ice_vsi *vsi, u64 avf_hash) hcfg.hash_flds = rss_hash; hcfg.hdr_type = ICE_RSS_ANY_HEADERS; hcfg.symm = false; - status = ice_add_rss_cfg(hw, vsi, &hcfg); + status = ice_add_rss_cfg(hw, vsi_handle, &hcfg); if (status) break; } diff --git a/drivers/net/ethernet/intel/ice/ice_flow.h b/drivers/net/ethernet/intel/ice/ice_flow.h index 6cb7bb879c98ea..1da40ae79b4e1c 100644 --- a/drivers/net/ethernet/intel/ice/ice_flow.h +++ b/drivers/net/ethernet/intel/ice/ice_flow.h @@ -1,5 +1,5 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* Copyright (c) 2019, Intel Corporation. */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (C) 2018-2024 Intel Corporation */ #ifndef _ICE_FLOW_H_ #define _ICE_FLOW_H_ @@ -20,6 +20,15 @@ #define ICE_FLOW_HASH_IPV6 \ (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) | \ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)) +#define ICE_FLOW_HASH_IPV6_PRE32 \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA) | \ + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA)) +#define ICE_FLOW_HASH_IPV6_PRE48 \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA) | \ + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA)) +#define ICE_FLOW_HASH_IPV6_PRE64 \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA) | \ + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA)) #define ICE_FLOW_HASH_TCP_PORT \ (BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT) | \ BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT)) @@ -38,6 +47,36 @@ #define ICE_HASH_SCTP_IPV4 (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_SCTP_PORT) #define ICE_HASH_SCTP_IPV6 (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_SCTP_PORT) +#define ICE_HASH_TCP_IPV6_PRE32 \ + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_TCP_PORT) +#define ICE_HASH_UDP_IPV6_PRE32 \ + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_UDP_PORT) +#define ICE_HASH_SCTP_IPV6_PRE32 \ + (ICE_FLOW_HASH_IPV6_PRE32 | ICE_FLOW_HASH_SCTP_PORT) +#define ICE_HASH_TCP_IPV6_PRE48 \ + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_TCP_PORT) +#define ICE_HASH_UDP_IPV6_PRE48 \ + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_UDP_PORT) +#define ICE_HASH_SCTP_IPV6_PRE48 \ + (ICE_FLOW_HASH_IPV6_PRE48 | ICE_FLOW_HASH_SCTP_PORT) +#define ICE_HASH_TCP_IPV6_PRE64 \ + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_TCP_PORT) +#define ICE_HASH_UDP_IPV6_PRE64 \ + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_UDP_PORT) +#define ICE_HASH_SCTP_IPV6_PRE64 \ + (ICE_FLOW_HASH_IPV6_PRE64 | ICE_FLOW_HASH_SCTP_PORT) + +#define ICE_FLOW_HASH_VXLAN_VNI \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_VXLAN_VNI)) + +#define ICE_FLOW_HASH_GTP_TEID \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)) + +#define ICE_FLOW_HASH_GTP_IPV4_TEID \ + (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_TEID) +#define ICE_FLOW_HASH_GTP_IPV6_TEID \ + (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_TEID) + #define ICE_FLOW_HASH_GTP_C_TEID \ (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)) @@ -126,6 +165,23 @@ #define ICE_FLOW_HASH_NAT_T_ESP_IPV6_SPI \ (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_NAT_T_ESP_SPI) +#define ICE_FLOW_HASH_L2TPV2_SESS_ID \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID)) +#define ICE_FLOW_HASH_L2TPV2_SESS_ID_ETH \ + (ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_L2TPV2_SESS_ID) + +#define ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID)) +#define ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID_ETH \ + (ICE_FLOW_HASH_ETH | ICE_FLOW_HASH_L2TPV2_LEN_SESS_ID) + +#define ICE_FLOW_FIELD_IPV4_SRC_OFFSET 12 +#define ICE_FLOW_FIELD_IPV4_DST_OFFSET 16 +#define ICE_FLOW_FIELD_IPV6_SRC_OFFSET 8 +#define ICE_FLOW_FIELD_IPV6_DST_OFFSET 24 +#define ICE_FLOW_FIELD_SRC_PORT_OFFSET 0 +#define ICE_FLOW_FIELD_DST_PORT_OFFSET 2 + /* Protocol header fields within a packet segment. A segment consists of one or * more protocol headers that make up a logical group of protocol headers. Each * logical group of protocol headers encapsulates or is encapsulated using/by @@ -158,13 +214,20 @@ enum ice_flow_seg_hdr { ICE_FLOW_SEG_HDR_AH = 0x00200000, ICE_FLOW_SEG_HDR_NAT_T_ESP = 0x00400000, ICE_FLOW_SEG_HDR_ETH_NON_IP = 0x00800000, + ICE_FLOW_SEG_HDR_GTPU_NON_IP = 0x01000000, + 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 = 0x20000000, /* The following is an additive bit for ICE_FLOW_SEG_HDR_IPV4 and - * ICE_FLOW_SEG_HDR_IPV6 which include the IPV4 other PTYPEs + * ICE_FLOW_SEG_HDR_IPV6. */ - ICE_FLOW_SEG_HDR_IPV_OTHER = 0x20000000, + ICE_FLOW_SEG_HDR_IPV_FRAG = 0x40000000, + ICE_FLOW_SEG_HDR_IPV_OTHER = 0x80000000, }; -/* These segments all have the same PTYPES, but are otherwise distinguished by +/* These segements all have the same PTYPES, but are otherwise distinguished by * the value of the gtp_eh_pdu and gtp_eh_pdu_link flags: * * gtp_eh_pdu gtp_eh_pdu_link @@ -198,6 +261,15 @@ enum ice_flow_field { ICE_FLOW_FIELD_IDX_IPV4_DA, ICE_FLOW_FIELD_IDX_IPV6_SA, ICE_FLOW_FIELD_IDX_IPV6_DA, + ICE_FLOW_FIELD_IDX_IPV4_CHKSUM, + ICE_FLOW_FIELD_IDX_IPV4_ID, + ICE_FLOW_FIELD_IDX_IPV6_ID, + ICE_FLOW_FIELD_IDX_IPV6_PRE32_SA, + ICE_FLOW_FIELD_IDX_IPV6_PRE32_DA, + ICE_FLOW_FIELD_IDX_IPV6_PRE48_SA, + ICE_FLOW_FIELD_IDX_IPV6_PRE48_DA, + ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA, + ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA, /* L4 */ ICE_FLOW_FIELD_IDX_TCP_SRC_PORT, ICE_FLOW_FIELD_IDX_TCP_DST_PORT, @@ -206,6 +278,9 @@ enum ice_flow_field { ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT, ICE_FLOW_FIELD_IDX_SCTP_DST_PORT, ICE_FLOW_FIELD_IDX_TCP_FLAGS, + ICE_FLOW_FIELD_IDX_TCP_CHKSUM, + ICE_FLOW_FIELD_IDX_UDP_CHKSUM, + ICE_FLOW_FIELD_IDX_SCTP_CHKSUM, /* ARP */ ICE_FLOW_FIELD_IDX_ARP_SIP, ICE_FLOW_FIELD_IDX_ARP_DIP, @@ -226,13 +301,15 @@ enum ice_flow_field { ICE_FLOW_FIELD_IDX_GTPU_EH_QFI, /* GTPU_UP */ ICE_FLOW_FIELD_IDX_GTPU_UP_TEID, + ICE_FLOW_FIELD_IDX_GTPU_UP_QFI, /* GTPU_DWN */ ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID, - /* PPPoE */ + ICE_FLOW_FIELD_IDX_GTPU_DWN_QFI, + /* PPPOE */ ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID, /* PFCP */ ICE_FLOW_FIELD_IDX_PFCP_SEID, - /* L2TPv3 */ + /* L2TPV3 */ ICE_FLOW_FIELD_IDX_L2TPV3_SESS_ID, /* ESP */ ICE_FLOW_FIELD_IDX_ESP_SPI, @@ -240,10 +317,22 @@ enum ice_flow_field { ICE_FLOW_FIELD_IDX_AH_SPI, /* NAT_T ESP */ ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI, + /* VXLAN VNI */ + ICE_FLOW_FIELD_IDX_VXLAN_VNI, + /* ECPRI_TP0 */ + ICE_FLOW_FIELD_IDX_ECPRI_TP0_PC_ID, + /* UDP_ECPRI_TP0 */ + ICE_FLOW_FIELD_IDX_UDP_ECPRI_TP0_PC_ID, + /* L2TPV2 SESSION ID*/ + ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID, + /* L2TPV2_LEN SESSION ID */ + ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID, /* The total number of enums must not exceed 64 */ ICE_FLOW_FIELD_IDX_MAX }; +static_assert(ICE_FLOW_FIELD_IDX_MAX <= 64, "The total number of enums must not exceed 64"); + #define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) #define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) #define ICE_FLOW_HASH_FLD_IPV4_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) @@ -319,11 +408,15 @@ enum ice_flow_avf_hdr_field { enum ice_rss_cfg_hdr_type { ICE_RSS_OUTER_HEADERS, /* take outer headers as inputset. */ ICE_RSS_INNER_HEADERS, /* take inner headers as inputset. */ - /* take inner headers as inputset for packet with outer ipv4. */ + /* take inner headers as inputset for packet with outer IPv4. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV4, - /* take inner headers as inputset for packet with outer ipv6. */ + /* take inner headers as inputset for packet with outer IPv6. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV6, /* take outer headers first then inner headers as inputset */ + /* take inner as inputset for GTPoGRE with outer IPv4 + GRE. */ + ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE, + /* take inner as inputset for GTPoGRE with outer IPv6 + GRE. */ + ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE, ICE_RSS_ANY_HEADERS }; @@ -336,7 +429,10 @@ struct ice_rss_hash_cfg { }; enum ice_flow_dir { + ICE_FLOW_DIR_UNDEFINED = 0, + ICE_FLOW_TX = 0x01, ICE_FLOW_RX = 0x02, + ICE_FLOW_TX_RX = ICE_FLOW_RX | ICE_FLOW_TX }; enum ice_flow_priority { @@ -393,8 +489,10 @@ struct ice_flow_seg_fld_raw { struct ice_flow_seg_info { u32 hdrs; /* Bitmask indicating protocol headers present */ - u64 match; /* Bitmask indicating header fields to be matched */ - u64 range; /* Bitmask indicating header fields matched as ranges */ + /* Bitmask indicating header fields to be matched */ + DECLARE_BITMAP(match, ICE_FLOW_FIELD_IDX_MAX); + /* Bitmask indicating header fields matched as ranges */ + DECLARE_BITMAP(range, ICE_FLOW_FIELD_IDX_MAX); struct ice_flow_fld_info fields[ICE_FLOW_FIELD_IDX_MAX]; @@ -408,11 +506,22 @@ struct ice_flow_entry { u64 id; struct ice_flow_prof *prof; + /* Action list */ + struct ice_flow_action *acts; + /* Flow entry's content */ + void *entry; + /* Range buffer (For ACL only) */ + struct ice_aqc_acl_profile_ranges *range_buf; enum ice_flow_priority priority; u16 vsi_handle; + u16 entry_sz; + /* Entry index in the ACL's scenario */ + u16 scen_entry_idx; +#define ICE_FLOW_ACL_MAX_NUM_ACT 2 + u8 acts_cnt; }; -#define ICE_FLOW_ENTRY_HNDL(e) ((u64)(uintptr_t)e) +#define ICE_FLOW_ENTRY_HNDL(e) ((u64)(uintptr_t)(e)) #define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(uintptr_t)(h)) struct ice_flow_prof { @@ -421,9 +530,10 @@ struct ice_flow_prof { u64 id; enum ice_flow_dir dir; u8 segs_cnt; + u8 acts_cnt; /* Keep track of flow entries associated with this flow profile */ - struct mutex entries_lock; + struct mutex entries_lock; /* lock for flow entries */ struct list_head entries; struct ice_flow_seg_info segs[ICE_FLOW_SEG_MAX]; @@ -431,7 +541,22 @@ struct ice_flow_prof { /* software VSI handles referenced by this flow profile */ DECLARE_BITMAP(vsis, ICE_MAX_VSI); - bool symm; /* Symmetric Hash for RSS */ + union { + /* struct sw_recipe */ + struct ice_acl_scen *scen; + /* struct fd */ + u32 data; + bool symm; /* Symmetric Hash for RSS */ + } cfg; + + /* Default actions */ + struct ice_flow_action *acts; +}; + +struct ice_rss_raw_cfg { + struct ice_parser_profile prof; + bool raw_ena; + bool symm; }; struct ice_rss_cfg { @@ -439,20 +564,56 @@ struct ice_rss_cfg { /* bitmap of VSIs added to the RSS entry */ DECLARE_BITMAP(vsis, ICE_MAX_VSI); struct ice_rss_hash_cfg hash; + struct ice_rss_raw_cfg raw; +}; + +enum ice_flow_action_type { + ICE_FLOW_ACT_NOP, + ICE_FLOW_ACT_ALLOW, + ICE_FLOW_ACT_DROP, + ICE_FLOW_ACT_CNTR_PKT, + ICE_FLOW_ACT_FWD_VSI, + ICE_FLOW_ACT_FWD_VSI_LIST, /* Should be abstracted away */ + ICE_FLOW_ACT_FWD_QUEUE, /* Can Queues be abstracted away? */ + ICE_FLOW_ACT_FWD_QUEUE_GROUP, /* Can Queues be abstracted away? */ + ICE_FLOW_ACT_PUSH, + ICE_FLOW_ACT_POP, + ICE_FLOW_ACT_MODIFY, + ICE_FLOW_ACT_CNTR_BYTES, + ICE_FLOW_ACT_CNTR_PKT_BYTES, + ICE_FLOW_ACT_GENERIC_0, + ICE_FLOW_ACT_GENERIC_1, + ICE_FLOW_ACT_GENERIC_2, + ICE_FLOW_ACT_GENERIC_3, + ICE_FLOW_ACT_GENERIC_4, + ICE_FLOW_ACT_RPT_FLOW_ID, + ICE_FLOW_ACT_BUILD_PROF_IDX, +}; + +struct ice_flow_action { + enum ice_flow_action_type type; + union { + u32 dummy; + } data; }; int ice_flow_add_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir, struct ice_flow_seg_info *segs, u8 segs_cnt, + struct ice_flow_action *acts, u8 acts_cnt, bool symm, struct ice_flow_prof **prof); -int ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id); int -ice_flow_set_parser_prof(struct ice_hw *hw, u16 dest_vsi, u16 fdir_vsi, - struct ice_parser_profile *prof, enum ice_block blk); +ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id); +int +ice_flow_set_hw_prof(struct ice_hw *hw, u16 dest_vsi_handle, + u16 fdir_vsi_handle, struct ice_parser_profile *prof, + enum ice_block blk); +u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_id); int ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id, u64 entry_id, u16 vsi, enum ice_flow_priority prio, - void *data, u64 *entry_h); + void *data, struct ice_flow_action *acts, u8 acts_cnt, + u64 *entry_h); int ice_flow_rem_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_h); void ice_flow_set_fld(struct ice_flow_seg_info *seg, enum ice_flow_field fld, @@ -460,16 +621,20 @@ ice_flow_set_fld(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); -int ice_flow_rem_vsi_prof(struct ice_hw *hw, u16 vsi_handle, u64 prof_id); +int 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); int ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle); int ice_set_rss_cfg_symm(struct ice_hw *hw, struct ice_vsi *vsi, bool symm); -int ice_add_avf_rss_cfg(struct ice_hw *hw, struct ice_vsi *vsi, - u64 hashed_flds); +int +ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds); int ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle); -int ice_add_rss_cfg(struct ice_hw *hw, struct ice_vsi *vsi, - const struct ice_rss_hash_cfg *cfg); +int +ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, + const struct ice_rss_hash_cfg *cfg); int ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, const struct ice_rss_hash_cfg *cfg); u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs, bool *symm); +void ice_rss_update_raw_symm(struct ice_hw *hw, + struct ice_rss_raw_cfg *cfg, u64 id); #endif /* _ICE_FLOW_H_ */ diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h index 611577ebc29d82..0df4b4625944f7 100644 --- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h +++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h @@ -320,6 +320,8 @@ enum ice_flex_rx_mdid { /* Rx/Tx Flag64 packet flag bits */ enum ice_flg64_bits { ICE_FLG_PKT_DSI = 0, + /* If there is a 1 in this bit position then that means Rx packet */ + ICE_FLG_PKT_DIR = 4, ICE_FLG_EVLAN_x8100 = 14, ICE_FLG_EVLAN_x9100, ICE_FLG_VLAN_x8100, diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 06e712cdc3d9ed..d7eaf8ddc68a58 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1564,7 +1564,7 @@ static void ice_vsi_set_vf_rss_flow_fld(struct ice_vsi *vsi) return; } - status = ice_add_avf_rss_cfg(&pf->hw, vsi, ICE_DEFAULT_RSS_HENA); + status = ice_add_avf_rss_cfg(&pf->hw, vsi->idx, ICE_DEFAULT_RSS_HENA); if (status) dev_dbg(dev, "ice_add_avf_rss_cfg failed for vsi = %d, error = %d\n", vsi->vsi_num, status); @@ -1652,11 +1652,10 @@ static const struct ice_rss_hash_cfg default_rss_cfgs[] = { */ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) { - u16 vsi_num = vsi->vsi_num; + u16 vsi_handle = vsi->idx, vsi_num = vsi->vsi_num; struct ice_pf *pf = vsi->back; struct ice_hw *hw = &pf->hw; struct device *dev; - int status; u32 i; dev = ice_pf_to_dev(pf); @@ -1665,14 +1664,16 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) vsi_num); return; } + for (i = 0; i < ARRAY_SIZE(default_rss_cfgs); i++) { const struct ice_rss_hash_cfg *cfg = &default_rss_cfgs[i]; + int status; - status = ice_add_rss_cfg(hw, vsi, cfg); + status = ice_add_rss_cfg(hw, vsi_handle, cfg); if (status) dev_dbg(dev, "ice_add_rss_cfg failed, addl_hdrs = %x, hash_flds = %llx, hdr_type = %d, symm = %d\n", - cfg->addl_hdrs, cfg->hash_flds, - cfg->hdr_type, cfg->symm); + cfg->addl_hdrs, cfg->hash_flds, cfg->hdr_type, + cfg->symm); } } diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index b1e7727b8677f9..b0e4c2a37e23c3 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -28,7 +28,7 @@ #include "ice_vsi_vlan_ops.h" #include -#define DRV_SUMMARY "Intel(R) Ethernet Connection E800 Series Linux Driver" +#define DRV_SUMMARY "Intel(R) Ethernet Connection E800 Series Linux Driver +GTP-Uv15" static const char ice_driver_string[] = DRV_SUMMARY; static const char ice_copyright[] = "Copyright (c) 2018, Intel Corporation."; @@ -8485,16 +8485,16 @@ static int ice_add_vsi_to_fdir(struct ice_pf *pf, struct ice_vsi *vsi) continue; for (tun = 0; tun < ICE_FD_HW_SEG_MAX; tun++) { + const enum ice_block blk = ICE_BLK_FD; enum ice_flow_priority prio; /* add this VSI to FDir profile for this flow */ prio = ICE_FLOW_PRIO_NORMAL; prof = hw->fdir_prof[flow]; - status = ice_flow_add_entry(hw, ICE_BLK_FD, - prof->prof_id[tun], + status = ice_flow_add_entry(hw, blk, prof->prof_id[tun], prof->vsi_h[0], vsi->idx, prio, prof->fdir_seg[tun], - &entry_h); + NULL, 0, &entry_h); if (status) { dev_err(dev, "channel VSI idx %d, not able to add to group %d\n", vsi->idx, flow); diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c index 664beb64f5570d..4bdad9983c936a 100644 --- a/drivers/net/ethernet/intel/ice/ice_parser.c +++ b/drivers/net/ethernet/intel/ice/ice_parser.c @@ -2355,13 +2355,13 @@ static bool ice_nearest_proto_id(struct ice_parser_result *rslt, u16 offset, * @msk_buf: packet mask buffer * @buf_len: packet length * @blk: FXP pipeline stage + * @prefix_match: match protocol stack exactly or only prefix * @prof: input/output parameter to save the profile - * - * Return: 0 on success or errno on failure. */ int ice_parser_profile_init(struct ice_parser_result *rslt, const u8 *pkt_buf, const u8 *msk_buf, int buf_len, enum ice_block blk, + bool prefix_match, struct ice_parser_profile *prof) { u8 proto_id = U8_MAX; diff --git a/drivers/net/ethernet/intel/ice/ice_parser.h b/drivers/net/ethernet/intel/ice/ice_parser.h index 6509d807627cee..a95338003195b1 100644 --- a/drivers/net/ethernet/intel/ice/ice_parser.h +++ b/drivers/net/ethernet/intel/ice/ice_parser.h @@ -534,6 +534,7 @@ struct ice_parser_profile { int ice_parser_profile_init(struct ice_parser_result *rslt, const u8 *pkt_buf, const u8 *msk_buf, int buf_len, enum ice_block blk, + bool prefix_match, struct ice_parser_profile *prof); void ice_parser_profile_dump(struct ice_hw *hw, struct ice_parser_profile *prof); diff --git a/drivers/net/ethernet/intel/ice/ice_protocol_type.h b/drivers/net/ethernet/intel/ice/ice_protocol_type.h index 7c09ea0f03ba67..eb5d47f85c322f 100644 --- a/drivers/net/ethernet/intel/ice/ice_protocol_type.h +++ b/drivers/net/ethernet/intel/ice/ice_protocol_type.h @@ -82,26 +82,48 @@ enum ice_sw_tunnel_type { enum ice_prot_id { ICE_PROT_ID_INVAL = 0, ICE_PROT_MAC_OF_OR_S = 1, + ICE_PROT_MAC_O2 = 2, ICE_PROT_MAC_IL = 4, + ICE_PROT_MAC_IN_MAC = 7, ICE_PROT_ETYPE_OL = 9, ICE_PROT_ETYPE_IL = 10, + ICE_PROT_PAY = 15, + ICE_PROT_EVLAN_O = 16, + ICE_PROT_VLAN_O = 17, + ICE_PROT_VLAN_IF = 18, + ICE_PROT_MPLS_OL_MINUS_1 = 27, + ICE_PROT_MPLS_OL_OR_OS = 28, + ICE_PROT_MPLS_IL = 29, ICE_PROT_IPV4_OF_OR_S = 32, ICE_PROT_IPV4_IL = 33, + ICE_PROT_IPV4_IL_IL = 34, ICE_PROT_IPV6_OF_OR_S = 40, ICE_PROT_IPV6_IL = 41, + ICE_PROT_IPV6_IL_IL = 42, + ICE_PROT_IPV6_NEXT_PROTO = 43, + ICE_PROT_IPV6_FRAG = 47, ICE_PROT_TCP_IL = 49, ICE_PROT_UDP_OF = 52, ICE_PROT_UDP_IL_OR_S = 53, ICE_PROT_GRE_OF = 64, + ICE_PROT_NSH_F = 84, ICE_PROT_ESP_F = 88, ICE_PROT_ESP_2 = 89, ICE_PROT_SCTP_IL = 96, ICE_PROT_ICMP_IL = 98, ICE_PROT_ICMPV6_IL = 100, + ICE_PROT_VRRP_F = 101, + ICE_PROT_OSPF = 102, 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, ICE_PROT_ARP_OF = 118, - ICE_PROT_META_ID = 255, /* when offset == metadata */ + ICE_PROT_EAPOL_OF = 120, + ICE_PROT_META_ID = 255, /* when offset == metaddata */ ICE_PROT_INVALID = 255 /* when offset == ICE_FV_OFFSET_INVAL */ }; diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 0e740342e2947e..cce65f0f8387c6 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -5773,11 +5773,11 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type, switch (tun_type) { case ICE_SW_TUN_VXLAN: - if (!ice_get_open_tunnel_port(hw, &open_port, TNL_VXLAN)) + if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, &open_port)) return -EIO; break; case ICE_SW_TUN_GENEVE: - if (!ice_get_open_tunnel_port(hw, &open_port, TNL_GENEVE)) + if (!ice_get_open_tunnel_port(hw, TNL_GENEVE, &open_port)) return -EIO; break; default: diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h index 45768796691fec..68e7ac3b718006 100644 --- a/drivers/net/ethernet/intel/ice/ice_type.h +++ b/drivers/net/ethernet/intel/ice/ice_type.h @@ -209,6 +209,17 @@ struct ice_phy_info { struct ice_aqc_set_phy_cfg_data curr_user_phy_cfg; }; +#define ICE_MAX_NUM_MIRROR_RULES 64 + +#define ICE_L2TPV2_FLAGS_CTRL 0x8000 +#define ICE_L2TPV2_FLAGS_LEN 0x4000 +#define ICE_L2TPV2_FLAGS_SEQ 0x0800 +#define ICE_L2TPV2_FLAGS_OFF 0x0200 +#define ICE_L2TPV2_FLAGS_VER 0x0002 + +#define ICE_L2TPV2_PKT_LENGTH 6 +#define ICE_PPP_PKT_LENGTH 4 + /* protocol enumeration for filters */ enum ice_fltr_ptype { /* NONE - used for undef/error */ @@ -218,11 +229,43 @@ enum ice_fltr_ptype { ICE_FLTR_PTYPE_NONF_IPV4_TCP, ICE_FLTR_PTYPE_NONF_IPV4_SCTP, ICE_FLTR_PTYPE_NONF_IPV4_OTHER, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4, ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP, ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_DW_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_UP_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_UP, ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP, ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER, ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER, + ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER, + ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER, ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3, ICE_FLTR_PTYPE_NONF_IPV6_L2TPV3, ICE_FLTR_PTYPE_NONF_IPV4_ESP, @@ -236,11 +279,163 @@ enum ice_fltr_ptype { ICE_FLTR_PTYPE_NONF_IPV6_PFCP_NODE, ICE_FLTR_PTYPE_NONF_IPV6_PFCP_SESSION, ICE_FLTR_PTYPE_NON_IP_L2, + ICE_FLTR_PTYPE_NONF_ECPRI_TP0, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_ECPRI_TP0, ICE_FLTR_PTYPE_FRAG_IPV4, + ICE_FLTR_PTYPE_FRAG_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_DW_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_DW_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_DW_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_DW_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV4_GTPU_EH_UP_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_GRE_IPV6_GTPU_EH_UP_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV4_GTPU_EH_UP_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_GRE_IPV6_GTPU_EH_UP_IPV6_TCP, ICE_FLTR_PTYPE_NONF_IPV6_UDP, ICE_FLTR_PTYPE_NONF_IPV6_TCP, ICE_FLTR_PTYPE_NONF_IPV6_SCTP, ICE_FLTR_PTYPE_NONF_IPV6_OTHER, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_SCTP, + ICE_FLTR_PTYPE_NONF_IPV4_UDP_VXLAN_IPV4_OTHER, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_CONTROL, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV4_L2TPV2_PPP_IPV6_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_CONTROL, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV4_TCP, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_UDP, + ICE_FLTR_PTYPE_NONF_IPV6_L2TPV2_PPP_IPV6_TCP, ICE_FLTR_PTYPE_MAX, }; diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index 8c434689e3f78e..86237de36c7ac0 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2022, Intel Corporation. */ - -#include "ice_vf_lib_private.h" #include "ice.h" +#include "ice_vf_lib_private.h" #include "ice_lib.h" #include "ice_fltr.h" +#include "ice_vf_vsi_vlan_ops.h" #include "ice_virtchnl_allowlist.h" /* Public functions which may be accessed by all driver files */ diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h index be4266899690ab..4f0306ce044f2d 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h @@ -53,12 +53,56 @@ struct ice_mdd_vf_events { u16 last_printed; }; +#define ICE_HASH_IP_CTX_IP 0 +#define ICE_HASH_IP_CTX_IP_ESP 1 +#define ICE_HASH_IP_CTX_IP_UDP_ESP 2 +#define ICE_HASH_IP_CTX_IP_AH 3 +#define ICE_HASH_IP_CTX_IP_L2TPV3 4 +#define ICE_HASH_IP_CTX_IP_PFCP 5 +#define ICE_HASH_IP_CTX_IP_UDP 6 +#define ICE_HASH_IP_CTX_IP_TCP 7 +#define ICE_HASH_IP_CTX_IP_SCTP 8 +#define ICE_HASH_IP_CTX_MAX 9 + +struct ice_vf_hash_ip_ctx { + struct ice_rss_hash_cfg ctx[ICE_HASH_IP_CTX_MAX]; +}; + +#define ICE_HASH_GTPU_CTX_EH_IP 0 +#define ICE_HASH_GTPU_CTX_EH_IP_UDP 1 +#define ICE_HASH_GTPU_CTX_EH_IP_TCP 2 +#define ICE_HASH_GTPU_CTX_UP_IP 3 +#define ICE_HASH_GTPU_CTX_UP_IP_UDP 4 +#define ICE_HASH_GTPU_CTX_UP_IP_TCP 5 +#define ICE_HASH_GTPU_CTX_DW_IP 6 +#define ICE_HASH_GTPU_CTX_DW_IP_UDP 7 +#define ICE_HASH_GTPU_CTX_DW_IP_TCP 8 +#define ICE_HASH_GTPU_CTX_MAX 9 + +struct ice_vf_hash_gtpu_ctx { + struct ice_rss_hash_cfg ctx[ICE_HASH_GTPU_CTX_MAX]; +}; + +struct ice_vf_hash_ctx { + struct ice_vf_hash_ip_ctx v4; + struct ice_vf_hash_ip_ctx v6; + struct ice_vf_hash_gtpu_ctx ipv4; + struct ice_vf_hash_gtpu_ctx ipv6; +}; + + /* Structure to store fdir fv entry */ struct ice_fdir_prof_info { struct ice_parser_profile prof; u64 fdir_active_cnt; }; +/* Structure to store RSS field vector entry */ +struct ice_rss_prof_info { + struct ice_parser_profile prof; + bool symm; +}; + /* VF operations */ struct ice_vf_ops { enum ice_disq_rst_src reset_type; @@ -99,6 +143,8 @@ struct ice_vf { u16 ctrl_vsi_idx; struct ice_vf_fdir fdir; struct ice_fdir_prof_info fdir_prof_info[ICE_MAX_PTGS]; + struct ice_vf_hash_ctx hash_ctx; + struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS]; /* first vector index of this VF in the PF space */ int first_vector_idx; struct ice_sw *vf_sw_id; /* switch ID the VF VSIs connect to */ diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index b6ec01f6fa73e0..3defcca19d29a3 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2022, Intel Corporation. */ +#include "ice.h" #include "ice_virtchnl.h" #include "ice_vf_lib_private.h" -#include "ice.h" #include "ice_base.h" #include "ice_lib.h" #include "ice_fltr.h" @@ -44,6 +44,14 @@ static const struct ice_vc_hdr_match_type ice_vc_hdr_list[] = { {VIRTCHNL_PROTO_HDR_ESP, ICE_FLOW_SEG_HDR_ESP}, {VIRTCHNL_PROTO_HDR_AH, ICE_FLOW_SEG_HDR_AH}, {VIRTCHNL_PROTO_HDR_PFCP, ICE_FLOW_SEG_HDR_PFCP_SESSION}, + {VIRTCHNL_PROTO_HDR_GTPC, ICE_FLOW_SEG_HDR_GTPC}, + {VIRTCHNL_PROTO_HDR_ECPRI, ICE_FLOW_SEG_HDR_ECPRI_TP0 | + ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0}, + {VIRTCHNL_PROTO_HDR_L2TPV2, ICE_FLOW_SEG_HDR_L2TPV2}, + {VIRTCHNL_PROTO_HDR_PPP, ICE_FLOW_SEG_HDR_PPP}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, ICE_FLOW_SEG_HDR_IPV_FRAG}, + {VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG, ICE_FLOW_SEG_HDR_IPV_FRAG}, + {VIRTCHNL_PROTO_HDR_GRE, ICE_FLOW_SEG_HDR_GRE}, }; struct ice_vc_hash_field_match_type { @@ -95,8 +103,125 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, - {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), + {VIRTCHNL_PROTO_HDR_IPV4, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID)}, + {VIRTCHNL_PROTO_HDR_IPV4, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST), + ICE_FLOW_HASH_IPV4}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), + ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT), BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_IPV4_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_PROT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_CHKSUM)}, {VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_SRC), BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)}, {VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_DST), @@ -118,6 +243,35 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { ICE_FLOW_HASH_IPV6 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)}, {VIRTCHNL_PROTO_HDR_IPV6, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG_PKID), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID)}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST), + ICE_FLOW_HASH_IPV6_PRE64}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA)}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA)}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), + ICE_FLOW_HASH_IPV6_PRE64 | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_SA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)}, + {VIRTCHNL_PROTO_HDR_IPV6, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV6_PROT), + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PRE64_DA) | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_PROT)}, {VIRTCHNL_PROTO_HDR_TCP, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT), BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT)}, @@ -128,6 +282,25 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT) | FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT), ICE_FLOW_HASH_TCP_PORT}, + {VIRTCHNL_PROTO_HDR_TCP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_TCP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_TCP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_TCP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_TCP_CHKSUM), + ICE_FLOW_HASH_TCP_PORT | + BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_CHKSUM)}, {VIRTCHNL_PROTO_HDR_UDP, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT), BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)}, @@ -138,6 +311,25 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT), ICE_FLOW_HASH_UDP_PORT}, + {VIRTCHNL_PROTO_HDR_UDP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_UDP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_UDP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_UDP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_UDP_CHKSUM), + ICE_FLOW_HASH_UDP_PORT | + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_CHKSUM)}, {VIRTCHNL_PROTO_HDR_SCTP, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT), BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)}, @@ -148,6 +340,25 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT) | FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT), ICE_FLOW_HASH_SCTP_PORT}, + {VIRTCHNL_PROTO_HDR_SCTP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_SCTP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_SCTP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_CHKSUM), + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT) | + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM)}, + {VIRTCHNL_PROTO_HDR_SCTP, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_DST_PORT) | + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_SCTP_CHKSUM), + ICE_FLOW_HASH_SCTP_PORT | + BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_CHKSUM)}, {VIRTCHNL_PROTO_HDR_PPPOE, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PPPOE_SESS_ID), BIT_ULL(ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID)}, @@ -163,6 +374,19 @@ ice_vc_hash_field_match_type ice_vc_hash_field_list[] = { BIT_ULL(ICE_FLOW_FIELD_IDX_AH_SPI)}, {VIRTCHNL_PROTO_HDR_PFCP, FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_PFCP_SEID), BIT_ULL(ICE_FLOW_FIELD_IDX_PFCP_SEID)}, + {VIRTCHNL_PROTO_HDR_GTPC, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_GTPC_TEID), + BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)}, + {VIRTCHNL_PROTO_HDR_ECPRI, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), + BIT_ULL(ICE_FLOW_FIELD_IDX_ECPRI_TP0_PC_ID) | + BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_ECPRI_TP0_PC_ID)}, + {VIRTCHNL_PROTO_HDR_L2TPV2, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID), + BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_SESS_ID)}, + {VIRTCHNL_PROTO_HDR_L2TPV2, + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID), + BIT_ULL(ICE_FLOW_FIELD_IDX_L2TPV2_LEN_SESS_ID)}, }; /** @@ -428,7 +652,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg) goto err; } - len = virtchnl_struct_size(vfres, vsi_res, 0); + len = virtchnl_ss_vf_resource(vfres, vsi_res, 0); vfres = kzalloc(len, GFP_KERNEL); if (!vfres) { @@ -458,13 +682,16 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg) if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC; - if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF) - vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_FDIR_PF; - if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_TC_U32 && vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_FDIR_PF) vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_TC_U32; + if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF) + vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_FDIR_PF; + + if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FSUB_PF) + vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_FSUB_PF; + if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2) vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2; @@ -580,6 +807,45 @@ static bool ice_vc_isvalid_ring_len(u16 ring_len) !(ring_len % ICE_REQ_DESC_MULTIPLE)); } +static enum virtchnl_status_code +ice_vc_rss_hash_update(struct ice_hw *hw, struct ice_vsi *vsi, u8 hash_type) +{ + enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS; + struct ice_vsi_ctx *ctx; + int status; + + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + if (!ctx) + return VIRTCHNL_STATUS_ERR_NO_MEMORY; + + /* clear previous hash_type */ + ctx->info.q_opt_rss = vsi->info.q_opt_rss & + ~(ICE_AQ_VSI_Q_OPT_RSS_HASH_M); + /* hash_type is passed in as ICE_AQ_VSI_Q_OPT_RSS_info.q_opt_rss |= FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, + hash_type); + + /* Preserve existing queueing option setting */ + ctx->info.q_opt_tc = vsi->info.q_opt_tc; + ctx->info.q_opt_flags = vsi->info.q_opt_flags; + + ctx->info.valid_sections = + cpu_to_le16(ICE_AQ_VSI_PROP_Q_OPT_VALID); + + status = ice_update_vsi(hw, vsi->idx, ctx, NULL); + if (status) { + dev_err(ice_hw_to_dev(hw), "update VSI for RSS failed, err %d aq_err %s\n", + status, ice_aq_str(hw->adminq.sq_last_status)); + v_ret = VIRTCHNL_STATUS_ERR_PARAM; + } else { + vsi->info.q_opt_rss = ctx->info.q_opt_rss; + } + + kfree(ctx); + + return v_ret; +} + /** * ice_vc_validate_pattern * @vf: pointer to the VF info @@ -694,6 +960,11 @@ static bool ice_vc_parse_rss_cfg(struct ice_hw *hw, const struct ice_vc_hash_field_match_type *hf_list; const struct ice_vc_hdr_match_type *hdr_list; int i, hf_list_len, hdr_list_len; + bool outer_ipv4 = false; + bool outer_ipv6 = false; + bool inner_hdr = false; + bool has_gre = false; + u32 *addl_hdrs = &hash_cfg->addl_hdrs; u64 *hash_flds = &hash_cfg->hash_flds; @@ -712,35 +983,139 @@ static bool ice_vc_parse_rss_cfg(struct ice_hw *hw, for (i = 0; i < rss_cfg->proto_hdrs.count; i++) { struct virtchnl_proto_hdr *proto_hdr = - &rss_cfg->proto_hdrs.proto_hdr[i]; - bool hdr_found = false; + &rss_cfg->proto_hdrs.proto_hdr[i]; + u32 hdr_found = 0; int j; - /* Find matched ice headers according to virtchnl headers. */ + /* find matched ice headers according to virtchnl headers. + * Also figure out the outer type of GTPU headers. + */ for (j = 0; j < hdr_list_len; j++) { - struct ice_vc_hdr_match_type hdr_map = hdr_list[j]; + struct ice_vc_hdr_match_type hdr_map = + hdr_list[j]; - if (proto_hdr->type == hdr_map.vc_hdr) { - *addl_hdrs |= hdr_map.ice_hdr; - hdr_found = true; - } + if (proto_hdr->type == hdr_map.vc_hdr) + hdr_found = hdr_map.ice_hdr; } - if (!hdr_found) - return false; - /* Find matched ice hash fields according to * virtchnl hash fields. */ for (j = 0; j < hf_list_len; j++) { - struct ice_vc_hash_field_match_type hf_map = hf_list[j]; + struct ice_vc_hash_field_match_type hf_map = + hf_list[j]; if (proto_hdr->type == hf_map.vc_hdr && - proto_hdr->field_selector == hf_map.vc_hash_field) { + proto_hdr->field_selector == + hf_map.vc_hash_field) { *hash_flds |= hf_map.ice_hash_field; break; } } + + if (!hdr_found) + return false; + + if (proto_hdr->type == VIRTCHNL_PROTO_HDR_IPV4 && !inner_hdr) + outer_ipv4 = true; + else if (proto_hdr->type == VIRTCHNL_PROTO_HDR_IPV6 && + !inner_hdr) + outer_ipv6 = true; + /* for GRE and L2TPv2, take inner header as input set if no + * any field is selected from outer headers. + * for GTPU, take inner header and GTPU teid as input set. + */ + else if ((proto_hdr->type == VIRTCHNL_PROTO_HDR_GTPU_IP || + proto_hdr->type == VIRTCHNL_PROTO_HDR_GTPU_EH || + proto_hdr->type == VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN || + proto_hdr->type == + VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP) || + ((proto_hdr->type == VIRTCHNL_PROTO_HDR_L2TPV2 || + proto_hdr->type == VIRTCHNL_PROTO_HDR_GRE) && + *hash_flds == 0)) { + /* set inner_hdr flag, and clean up outer header */ + inner_hdr = true; + + /* clear outer headers */ + *addl_hdrs = 0; + + if (outer_ipv4 && outer_ipv6) + return false; + + if (outer_ipv4) + hash_cfg->hdr_type = ICE_RSS_INNER_HEADERS_W_OUTER_IPV4; + else if (outer_ipv6) + hash_cfg->hdr_type = ICE_RSS_INNER_HEADERS_W_OUTER_IPV6; + else + hash_cfg->hdr_type = ICE_RSS_INNER_HEADERS; + + if (has_gre && outer_ipv4) + hash_cfg->hdr_type = + ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE; + if (has_gre && outer_ipv6) + hash_cfg->hdr_type = + ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE; + + if (proto_hdr->type == VIRTCHNL_PROTO_HDR_GRE) + has_gre = true; + } + + *addl_hdrs |= hdr_found; + + /* refine hash hdrs and fields for IP fragment */ + if (VIRTCHNL_TEST_PROTO_HDR_FIELD(proto_hdr, + VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID) && + proto_hdr->type == VIRTCHNL_PROTO_HDR_IPV4_FRAG) { + *addl_hdrs |= ICE_FLOW_SEG_HDR_IPV_FRAG; + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_OTHER); + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID); + VIRTCHNL_DEL_PROTO_HDR_FIELD(proto_hdr, + VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID); + } + if (VIRTCHNL_TEST_PROTO_HDR_FIELD(proto_hdr, + VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG_PKID) && + proto_hdr->type == VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG) { + *addl_hdrs |= ICE_FLOW_SEG_HDR_IPV_FRAG; + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_IPV_OTHER); + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_ID); + VIRTCHNL_DEL_PROTO_HDR_FIELD(proto_hdr, + VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG_PKID); + } + } + + /* refine gtpu header if we take outer as input set for a no inner + * ip gtpu flow. + */ + if (hash_cfg->hdr_type == ICE_RSS_OUTER_HEADERS && + *addl_hdrs & ICE_FLOW_SEG_HDR_GTPU_IP) { + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_GTPU_IP); + *addl_hdrs |= ICE_FLOW_SEG_HDR_GTPU_NON_IP; + } + + /* refine hash field for esp and nat-t-esp. */ + if ((*addl_hdrs & ICE_FLOW_SEG_HDR_UDP) && + (*addl_hdrs & ICE_FLOW_SEG_HDR_ESP)) { + *addl_hdrs &= ~(ICE_FLOW_SEG_HDR_ESP | ICE_FLOW_SEG_HDR_UDP); + *addl_hdrs |= ICE_FLOW_SEG_HDR_NAT_T_ESP; + *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_ESP_SPI)); + *hash_flds |= BIT_ULL(ICE_FLOW_FIELD_IDX_NAT_T_ESP_SPI); + } + + /* refine hash hdrs for L4 udp/tcp/sctp. */ + if (*addl_hdrs & (ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | + ICE_FLOW_SEG_HDR_SCTP) && + *addl_hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER) + *addl_hdrs &= ~ICE_FLOW_SEG_HDR_IPV_OTHER; + + /* refine hash field for ecpri over mac or udp */ + if ((*addl_hdrs & ICE_FLOW_SEG_HDR_ECPRI_TP0) && + (*addl_hdrs & ICE_FLOW_SEG_HDR_UDP)) { + *addl_hdrs &= ~ICE_FLOW_SEG_HDR_ECPRI_TP0; + *hash_flds &= ~(BIT_ULL(ICE_FLOW_FIELD_IDX_ECPRI_TP0_PC_ID)); + } else if (*addl_hdrs & ICE_FLOW_SEG_HDR_ECPRI_TP0) { + *addl_hdrs &= ~ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0; + *hash_flds &= + ~(BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_ECPRI_TP0_PC_ID)); } return true; @@ -759,6 +1134,949 @@ static bool ice_vf_adv_rss_offload_ena(u32 caps) return !!(caps & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF); } +/** + * is_hash_cfg_valid - check if the hash context is valid + * @cfg: pointer to the RSS hash configuration + * + * This function will return true if the hash context is valid, otherwise + * return false. + */ +static bool is_hash_cfg_valid(struct ice_rss_hash_cfg *cfg) +{ + return (cfg->hash_flds != 0 && cfg->addl_hdrs != 0) ? + true : false; +} + +/** + * hash_cfg_reset - reset the hash context + * @cfg: pointer to the RSS hash configuration + * + * This function will reset the hash context which stores the valid rule info. + */ +static void hash_cfg_reset(struct ice_rss_hash_cfg *cfg) +{ + cfg->hash_flds = 0; + cfg->addl_hdrs = 0; + cfg->hdr_type = ICE_RSS_OUTER_HEADERS; + cfg->symm = 0; +} + +/** + * hash_cfg_record - record the hash context + * @ctx: pointer to the global RSS hash configuration + * @cfg: pointer to the RSS hash configuration to be recorded + * + * This function will record the hash context which stores the valid rule info. + */ +static void hash_cfg_record(struct ice_rss_hash_cfg *ctx, + struct ice_rss_hash_cfg *cfg) +{ + ctx->hash_flds = cfg->hash_flds; + ctx->addl_hdrs = cfg->addl_hdrs; + ctx->hdr_type = cfg->hdr_type; + ctx->symm = cfg->symm; +} + +/** + * ice_hash_moveout - delete a RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * This function will delete an existing RSS hash configuration but not delete + * the hash context which stores the rule info. + */ +static int +ice_hash_moveout(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + int status; + + if (!is_hash_cfg_valid(cfg)) + return -ENOENT; + + status = ice_rem_rss_cfg(hw, vf->lan_vsi_idx, cfg); + if (status && status != -ENOENT) { + dev_err(dev, "ice_rem_rss_cfg failed for VF %d, VSI %d, error:%d\n", + vf->vf_id, vf->lan_vsi_idx, status); + return -EBUSY; + } + + return 0; +} + +/** + * ice_hash_moveback - add an RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * The function will add a RSS hash configuration if the hash context is valid. + */ +static int +ice_hash_moveback(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + int status; + + if (!is_hash_cfg_valid(cfg)) + return -ENOENT; + + status = ice_add_rss_cfg(hw, vf->lan_vsi_idx, cfg); + if (status) { + dev_err(dev, "ice_add_rss_cfg failed for VF %d, VSI %d, error:%d\n", + vf->vf_id, vf->lan_vsi_idx, status); + return -EBUSY; + } + + return 0; +} + +/** + * ice_hash_remove - remove a RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * This function will delete a RSS hash configuration and also delete the + * hash context which stores the rule info. + */ +static int +ice_hash_remove(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + int ret; + + ret = ice_hash_moveout(vf, cfg); + if (ret && (ret != -ENOENT)) + return ret; + + hash_cfg_reset(cfg); + + return 0; +} + +/** + * ice_add_rss_cfg_pre_gtpu - pre-process the GTPU RSS configuration + * @vf: pointer to the VF info + * @ctx: pointer to the context of the GTPU hash + * @ctx_idx: The index of the hash context + * + * This function pre-process the GTPU hash configuration before adding a hash + * config, it will remove or rotate some prior hash configs which will cause + * conflicts. For example, if a GTPU_UP/DWN rule be configured after a GTPU_EH + * rule, the GTPU_EH hash will be hit at first due to TCAM write sequence from + * top to down, and the hash hit sequence also from top to down. So the + * GTPU_EH rule need roolback to the later of the GTPU_UP/DWN rule. On the + * other hand, when a GTPU_EH rule be configured after a GTPU_UP/DWN rule, + * just need to remove the GTPU_DWN/UP rules. + */ +static int +ice_add_rss_cfg_pre_gtpu(struct ice_vf *vf, struct ice_vf_hash_gtpu_ctx *ctx, + u32 ctx_idx) +{ + int ret; + + switch (ctx_idx) { + case ICE_HASH_GTPU_CTX_EH_IP: + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_EH_IP_UDP: + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_EH_IP_TCP: + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_UP_IP: + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_UP_IP_UDP: + case ICE_HASH_GTPU_CTX_UP_IP_TCP: + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_DW_IP: + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_remove(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_DW_IP_UDP: + case ICE_HASH_GTPU_CTX_DW_IP_TCP: + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveout(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + default: + break; + } + + return 0; +} + +/** + * ice_add_rss_cfg_pre_ip - pre-process the IP RSS configuration + * @vf: pointer to the VF info + * @ctx: pointer to the context of the IP L4 hash + * + * This function will remove all covered and recorded IP RSS configurations, + * including IP with ESP/UDP_ESP/AH/L2TPV3/PFCP and UDP/TCP/SCTP. + */ +static int +ice_add_rss_cfg_pre_ip(struct ice_vf *vf, struct ice_vf_hash_ip_ctx *ctx) +{ + int i, ret; + + for (i = 1; i < ICE_HASH_IP_CTX_MAX; i++) + if (is_hash_cfg_valid(&ctx->ctx[i])) { + ret = ice_hash_remove(vf, &ctx->ctx[i]); + + if (ret) + return ret; + } + + return 0; +} + +/** + * calc_gtpu_ctx_idx - calculate the index of the GTPU hash context + * @hdrs: the protocol headers prefix with ICE_FLOW_SEG_HDR_XXX. + * + * The GTPU hash context use the index to classify for IPV4/IPV6 and + * GTPU_EH/GTPU_UP/GTPU_DWN, this function used to calculate the index + * by the protocol headers. + */ +static u32 calc_gtpu_ctx_idx(u32 hdrs) +{ + u32 eh_idx, ip_idx; + + if (hdrs & ICE_FLOW_SEG_HDR_GTPU_EH) + eh_idx = 0; + else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_UP) + eh_idx = 1; + else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_DWN) + eh_idx = 2; + else + return ICE_HASH_GTPU_CTX_MAX; + + ip_idx = 0; + if (hdrs & ICE_FLOW_SEG_HDR_UDP) + ip_idx = 1; + else if (hdrs & ICE_FLOW_SEG_HDR_TCP) + ip_idx = 2; + + if (hdrs & (ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6)) + return eh_idx * 3 + ip_idx; + else + return ICE_HASH_GTPU_CTX_MAX; +} + +/** + * ice_map_ip_ctx_idx - map the index of the IP L4 hash context + * @hdrs: protocol headers prefix with ICE_FLOW_SEG_HDR_XXX. + * + * The IP L4 hash context use the index to classify for IPv4/IPv6 with + * ESP/UDP_ESP/AH/L2TPV3/PFCP and non-tunnel UDP/TCP/SCTP + * this function map the index based on the protocol headers. + */ +static u8 ice_map_ip_ctx_idx(u32 hdrs) +{ + u8 i; + + static struct { + u32 hdrs; + u8 ctx_idx; + } ip_ctx_idx_map[] = { + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_ESP, + ICE_HASH_IP_CTX_IP_ESP }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_NAT_T_ESP, + ICE_HASH_IP_CTX_IP_UDP_ESP }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_AH, + ICE_HASH_IP_CTX_IP_AH }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_L2TPV3, + ICE_HASH_IP_CTX_IP_L2TPV3 }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_PFCP_SESSION, + ICE_HASH_IP_CTX_IP_PFCP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_UDP, + ICE_HASH_IP_CTX_IP_UDP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_TCP, + ICE_HASH_IP_CTX_IP_TCP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_SCTP, + ICE_HASH_IP_CTX_IP_SCTP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER, + ICE_HASH_IP_CTX_IP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_ESP, + ICE_HASH_IP_CTX_IP_ESP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_NAT_T_ESP, + ICE_HASH_IP_CTX_IP_UDP_ESP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_AH, + ICE_HASH_IP_CTX_IP_AH }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_L2TPV3, + ICE_HASH_IP_CTX_IP_L2TPV3 }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER | + ICE_FLOW_SEG_HDR_PFCP_SESSION, + ICE_HASH_IP_CTX_IP_PFCP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_UDP, + ICE_HASH_IP_CTX_IP_UDP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_TCP, + ICE_HASH_IP_CTX_IP_TCP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_SCTP, + ICE_HASH_IP_CTX_IP_SCTP }, + { ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN | + ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER, + ICE_HASH_IP_CTX_IP }, + /* the remaining mappings are used for default RSS */ + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_UDP, + ICE_HASH_IP_CTX_IP_UDP }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_TCP, + ICE_HASH_IP_CTX_IP_TCP }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_SCTP, + ICE_HASH_IP_CTX_IP_SCTP }, + { ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER, + ICE_HASH_IP_CTX_IP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_UDP, + ICE_HASH_IP_CTX_IP_UDP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_TCP, + ICE_HASH_IP_CTX_IP_TCP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_SCTP, + ICE_HASH_IP_CTX_IP_SCTP }, + { ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_IPV_OTHER, + ICE_HASH_IP_CTX_IP }, + }; + + for (i = 0; i < ARRAY_SIZE(ip_ctx_idx_map); i++) { + if (hdrs == ip_ctx_idx_map[i].hdrs) + return ip_ctx_idx_map[i].ctx_idx; + } + + return ICE_HASH_IP_CTX_MAX; +} + +static int +ice_add_rss_cfg_pre(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + u32 ice_gtpu_ctx_idx = calc_gtpu_ctx_idx(cfg->addl_hdrs); + + u8 ip_ctx_idx = ice_map_ip_ctx_idx(cfg->addl_hdrs); + + if (ip_ctx_idx == ICE_HASH_IP_CTX_IP) { + int ret = 0; + + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) + ret = ice_add_rss_cfg_pre_ip(vf, &vf->hash_ctx.v4); + else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) + ret = ice_add_rss_cfg_pre_ip(vf, &vf->hash_ctx.v6); + + if (ret) + return ret; + } + + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) { + return ice_add_rss_cfg_pre_gtpu(vf, &vf->hash_ctx.ipv4, + ice_gtpu_ctx_idx); + } else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) { + return ice_add_rss_cfg_pre_gtpu(vf, &vf->hash_ctx.ipv6, + ice_gtpu_ctx_idx); + } + + return 0; +} + +/** + * ice_add_rss_cfg_post_gtpu - A wrap function of deleting an RSS configuration + * @vf: pointer to the VF info + * @ctx: pointer to the context of the GTPU hash + * @cfg: pointer to the RSS hash configuration + * @ctx_idx: The index of the hash context + * + * This function post process the hash configuration after the hash config is + * successfully adding, it will re-configure the prior hash config which was + * moveout but need to moveback again. + */ +static int +ice_add_rss_cfg_post_gtpu(struct ice_vf *vf, struct ice_vf_hash_gtpu_ctx *ctx, + struct ice_rss_hash_cfg *cfg, u32 ctx_idx) +{ + int ret; + + if (ctx_idx < ICE_HASH_GTPU_CTX_MAX) { + ctx->ctx[ctx_idx].addl_hdrs = cfg->addl_hdrs; + ctx->ctx[ctx_idx].hash_flds = cfg->hash_flds; + ctx->ctx[ctx_idx].hdr_type = cfg->hdr_type; + ctx->ctx[ctx_idx].symm = cfg->symm; + } + + switch (ctx_idx) { + case ICE_HASH_GTPU_CTX_EH_IP: + break; + case ICE_HASH_GTPU_CTX_EH_IP_UDP: + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_EH_IP_TCP: + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_UP_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_DW_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + case ICE_HASH_GTPU_CTX_UP_IP: + case ICE_HASH_GTPU_CTX_UP_IP_UDP: + case ICE_HASH_GTPU_CTX_UP_IP_TCP: + case ICE_HASH_GTPU_CTX_DW_IP: + case ICE_HASH_GTPU_CTX_DW_IP_UDP: + case ICE_HASH_GTPU_CTX_DW_IP_TCP: + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_UDP]); + if (ret && (ret != -ENOENT)) + return ret; + + ret = ice_hash_moveback(vf, + &ctx->ctx[ICE_HASH_GTPU_CTX_EH_IP_TCP]); + if (ret && (ret != -ENOENT)) + return ret; + + break; + default: + break; + } + + return 0; +} + +static int +ice_add_rss_cfg_post(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + u32 ice_gtpu_ctx_idx = calc_gtpu_ctx_idx(cfg->addl_hdrs); + + u8 ip_ctx_idx = ice_map_ip_ctx_idx(cfg->addl_hdrs); + + if (ip_ctx_idx && ip_ctx_idx < ICE_HASH_IP_CTX_MAX) { + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) + hash_cfg_record(&vf->hash_ctx.v4.ctx[ip_ctx_idx], cfg); + else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) + hash_cfg_record(&vf->hash_ctx.v6.ctx[ip_ctx_idx], cfg); + } + + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) { + return ice_add_rss_cfg_post_gtpu(vf, &vf->hash_ctx.ipv4, + cfg, ice_gtpu_ctx_idx); + } else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) { + return ice_add_rss_cfg_post_gtpu(vf, &vf->hash_ctx.ipv6, + cfg, ice_gtpu_ctx_idx); + } + + return 0; +} + +/** + * ice_rem_rss_cfg_post - post-process the RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * This function post-process the RSS hash configuration after deleting a hash + * config. Such as, it will reset the hash context for the GTPU hash. + */ +static void +ice_rem_rss_cfg_post(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + u32 ice_gtpu_ctx_idx = calc_gtpu_ctx_idx(cfg->addl_hdrs); + + u8 ip_ctx_idx = ice_map_ip_ctx_idx(cfg->addl_hdrs); + + if (ip_ctx_idx && ip_ctx_idx < ICE_HASH_IP_CTX_MAX) { + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) + hash_cfg_reset(&vf->hash_ctx.v4.ctx[ip_ctx_idx]); + else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) + hash_cfg_reset(&vf->hash_ctx.v6.ctx[ip_ctx_idx]); + } + + if (ice_gtpu_ctx_idx >= ICE_HASH_GTPU_CTX_MAX) + return; + + if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV4) + hash_cfg_reset(&vf->hash_ctx.ipv4.ctx[ice_gtpu_ctx_idx]); + else if (cfg->addl_hdrs & ICE_FLOW_SEG_HDR_IPV6) + hash_cfg_reset(&vf->hash_ctx.ipv6.ctx[ice_gtpu_ctx_idx]); +} + +/** + * ice_rem_rss_cfg_wrap - A wrap function of deleting an RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * Wrapper function to delete a flow profile base on an RSS configuration, + * and also post process the hash context base on the rollback mechanism + * which handle some rules conflict by ice_add_rss_cfg_wrap. + */ +static int +ice_rem_rss_cfg_wrap(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + int status; + + status = ice_rem_rss_cfg(hw, vf->lan_vsi_idx, cfg); + /* We just ignore -ENOENT, because if two configurations share the same + * profile remove one of them actually removes both, since the + * profile is deleted. + */ + if (status && status != -ENOENT) { + dev_err(dev, "ice_rem_rss_cfg failed for VF %d, VSI %d, error:%d\n", + vf->vf_id, vf->lan_vsi_idx, status); + return status; + } + + ice_rem_rss_cfg_post(vf, cfg); + + return 0; +} + +/** + * ice_add_rss_cfg_wrap - A wrap function of adding an RSS configuration + * @vf: pointer to the VF info + * @cfg: pointer to the RSS hash configuration + * + * Wapper function to add a flow profile base on a RSS configuration, and + * also use a rollback mechanism to handle some rules conflict due to TCAM + * write sequence from top to down. + */ +static int +ice_add_rss_cfg_wrap(struct ice_vf *vf, struct ice_rss_hash_cfg *cfg) +{ + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + int status; + + if (ice_add_rss_cfg_pre(vf, cfg)) + return -EINVAL; + + status = ice_add_rss_cfg(hw, vf->lan_vsi_idx, cfg); + if (status) { + dev_err(dev, "ice_add_rss_cfg failed for VF %d, VSI %d, error:%d\n", + vf->vf_id, vf->lan_vsi_idx, status); + return status; + } + + if (ice_add_rss_cfg_post(vf, cfg)) + status = -EINVAL; + + return status; +} + +/** + * ice_parse_raw_rss_pattern - Parse raw pattern spec and mask for RSS + * @vf: pointer to the VF info + * @proto: pointer to the virtchnl protocol header + * @raw_cfg: pointer to the RSS raw pattern configuration + * + * Parser function to get spec and mask from virtchnl message, and parse + * them to get the corresponding profile and offset. The profile is used + * to add RSS configuration. + */ +static int +ice_parse_raw_rss_pattern(struct ice_vf *vf, struct virtchnl_proto_hdrs *proto, + struct ice_rss_raw_cfg *raw_cfg) +{ + struct ice_parser_result pkt_parsed; + struct ice_hw *hw = &vf->pf->hw; + struct ice_parser_profile prof; + u16 pkt_len, udp_port = 0; + struct ice_parser *psr; + u8 *pkt_buf, *msk_buf; + int status = 0; + + pkt_len = proto->raw.pkt_len; + if (!pkt_len) + return -EINVAL; + if (pkt_len > VIRTCHNL_MAX_SIZE_RAW_PACKET) + pkt_len = VIRTCHNL_MAX_SIZE_RAW_PACKET; + + pkt_buf = kzalloc(pkt_len, GFP_KERNEL); + msk_buf = kzalloc(pkt_len, GFP_KERNEL); + if (!pkt_buf || !msk_buf) { + status = -ENOMEM; + goto free_alloc; + } + + memcpy(pkt_buf, proto->raw.spec, pkt_len); + memcpy(msk_buf, proto->raw.mask, pkt_len); + + psr = ice_parser_create(hw); + if (IS_ERR(psr)) { + status = PTR_ERR(psr); + goto parser_destroy; + } + + if (ice_get_open_tunnel_port(hw, TNL_VXLAN, &udp_port)) + ice_parser_vxlan_tunnel_set(psr, udp_port, true); + + status = ice_parser_run(psr, pkt_buf, pkt_len, &pkt_parsed); + if (status) + goto parser_destroy; + + status = ice_parser_profile_init(&pkt_parsed, pkt_buf, msk_buf, + pkt_len, ICE_BLK_RSS, + true, &prof); + if (status) + goto parser_destroy; + + memcpy(&raw_cfg->prof, &prof, sizeof(prof)); + +parser_destroy: + ice_parser_destroy(psr); +free_alloc: + kfree(pkt_buf); + kfree(msk_buf); + return status; +} + +/** + * ice_add_raw_rss_cfg - add RSS configuration for raw pattern + * @vf: pointer to the VF info + * @cfg: pointer to the RSS raw pattern configuration + * + * This function adds the RSS configuration for raw pattern. + * Check if current profile is matched. If not, remove the old + * one and add the new profile to HW directly. Update the symmetric + * hash configuration as well. + */ +static int +ice_add_raw_rss_cfg(struct ice_vf *vf, struct ice_rss_raw_cfg *cfg) +{ + struct ice_parser_profile *prof = &cfg->prof; + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_rss_prof_info *rss_prof; + struct ice_hw *hw = &vf->pf->hw; + int i, ptg, status = 0; + u16 vsi_handle; + u64 id; + + vsi_handle = vf->lan_vsi_idx; + id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX); + + ptg = hw->blk[ICE_BLK_RSS].xlt1.t[id]; + rss_prof = &vf->rss_prof_info[ptg]; + + /* check if ptg already has a profile */ + if (rss_prof->prof.fv_num) { + for (i = 0; i < ICE_MAX_FV_WORDS; i++) { + if (rss_prof->prof.fv[i].proto_id != + prof->fv[i].proto_id || + rss_prof->prof.fv[i].offset != + prof->fv[i].offset) + break; + } + + /* current profile is matched, check symmetric hash */ + if (i == ICE_MAX_FV_WORDS) { + if (rss_prof->symm != cfg->symm) + goto update_symm; + return status; + } + + /* current profile is not matched, remove it */ + status = + ice_rem_prof_id_flow(hw, ICE_BLK_RSS, + ice_get_hw_vsi_num(hw, vsi_handle), + id); + if (status) { + dev_err(dev, "remove RSS flow failed\n"); + return status; + } + + status = ice_rem_prof(hw, ICE_BLK_RSS, id); + if (status) { + dev_err(dev, "remove RSS profile failed\n"); + return status; + } + } + + /* add new profile */ + status = ice_flow_set_hw_prof(hw, vsi_handle, 0, prof, ICE_BLK_RSS); + if (status) { + dev_err(dev, "HW profile add failed\n"); + return status; + } + + memcpy(&rss_prof->prof, prof, sizeof(struct ice_parser_profile)); + +update_symm: + rss_prof->symm = cfg->symm; + ice_rss_update_raw_symm(hw, cfg, id); + return status; +} + +/** + * ice_rem_raw_rss_cfg - remove RSS configuration for raw pattern + * @vf: pointer to the VF info + * @cfg: pointer to the RSS raw pattern configuration + * + * This function removes the RSS configuration for raw pattern. + * Check if vsi group is already removed first. If not, remove the + * profile. + */ +static int +ice_rem_raw_rss_cfg(struct ice_vf *vf, struct ice_rss_raw_cfg *cfg) +{ + struct ice_parser_profile *prof = &cfg->prof; + struct device *dev = ice_pf_to_dev(vf->pf); + struct ice_hw *hw = &vf->pf->hw; + int ptg, status = 0; + u16 vsig, vsi; + u64 id; + + id = find_first_bit(prof->ptypes, ICE_FLOW_PTYPE_MAX); + + ptg = hw->blk[ICE_BLK_RSS].xlt1.t[id]; + + memset(&vf->rss_prof_info[ptg], 0, + sizeof(struct ice_rss_prof_info)); + + /* check if vsig is already removed */ + vsi = ice_get_hw_vsi_num(hw, vf->lan_vsi_idx); + if (vsi >= ICE_MAX_VSI) { + status = -EINVAL; + goto err; + } + + vsig = hw->blk[ICE_BLK_RSS].xlt2.vsis[vsi].vsig; + if (vsig) { + status = ice_rem_prof_id_flow(hw, ICE_BLK_RSS, vsi, id); + if (status) + goto err; + + status = ice_rem_prof(hw, ICE_BLK_RSS, id); + if (status) + goto err; + } + + return status; + +err: + dev_err(dev, "HW profile remove failed\n"); + return status; +} + /** * ice_vc_handle_rss_cfg * @vf: pointer to the VF info @@ -769,12 +2087,15 @@ static bool ice_vf_adv_rss_offload_ena(u32 caps) */ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) { - u32 v_opcode = add ? VIRTCHNL_OP_ADD_RSS_CFG : VIRTCHNL_OP_DEL_RSS_CFG; struct virtchnl_rss_cfg *rss_cfg = (struct virtchnl_rss_cfg *)msg; enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS; + u32 v_opcode = add ? VIRTCHNL_OP_ADD_RSS_CFG : + VIRTCHNL_OP_DEL_RSS_CFG; struct device *dev = ice_pf_to_dev(vf->pf); struct ice_hw *hw = &vf->pf->hw; struct ice_vsi *vsi; + u8 hash_type; + bool symm; if (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) { dev_dbg(dev, "VF %d attempting to configure RSS, but RSS is not supported by the PF\n", @@ -810,49 +2131,40 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) goto error_param; } - if (!ice_vc_validate_pattern(vf, &rss_cfg->proto_hdrs)) { - v_ret = VIRTCHNL_STATUS_ERR_PARAM; + if (rss_cfg->rss_algorithm == VIRTCHNL_RSS_ALG_R_ASYMMETRIC) { + hash_type = add ? ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR : + ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ; + + v_ret = ice_vc_rss_hash_update(hw, vsi, hash_type); goto error_param; } - if (rss_cfg->rss_algorithm == VIRTCHNL_RSS_ALG_R_ASYMMETRIC) { - struct ice_vsi_ctx *ctx; - u8 lut_type, hash_type; - int status; + hash_type = add ? ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ : + ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ; + v_ret = ice_vc_rss_hash_update(hw, vsi, hash_type); + if (v_ret) + goto error_param; - lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI; - hash_type = add ? ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR : - ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ; + symm = rss_cfg->rss_algorithm == VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC; + /* Configure RSS hash for raw pattern */ + if (rss_cfg->proto_hdrs.tunnel_level == 0 && + rss_cfg->proto_hdrs.count == 0) { + struct ice_rss_raw_cfg raw_cfg; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); - if (!ctx) { - v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; + if (ice_parse_raw_rss_pattern(vf, &rss_cfg->proto_hdrs, + &raw_cfg)) { + v_ret = VIRTCHNL_STATUS_ERR_PARAM; goto error_param; } - ctx->info.q_opt_rss = - FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_LUT_M, lut_type) | - FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hash_type); - - /* Preserve existing queueing option setting */ - ctx->info.q_opt_rss |= (vsi->info.q_opt_rss & - ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M); - ctx->info.q_opt_tc = vsi->info.q_opt_tc; - ctx->info.q_opt_flags = vsi->info.q_opt_rss; - - ctx->info.valid_sections = - cpu_to_le16(ICE_AQ_VSI_PROP_Q_OPT_VALID); - - status = ice_update_vsi(hw, vsi->idx, ctx, NULL); - if (status) { - dev_err(dev, "update VSI for RSS failed, err %d aq_err %s\n", - status, ice_aq_str(hw->adminq.sq_last_status)); - v_ret = VIRTCHNL_STATUS_ERR_PARAM; + if (add) { + raw_cfg.symm = symm; + if (ice_add_raw_rss_cfg(vf, &raw_cfg)) + v_ret = VIRTCHNL_STATUS_ERR_PARAM; } else { - vsi->info.q_opt_rss = ctx->info.q_opt_rss; + if (ice_rem_raw_rss_cfg(vf, &raw_cfg)) + v_ret = VIRTCHNL_STATUS_ERR_PARAM; } - - kfree(ctx); } else { struct ice_rss_hash_cfg cfg; @@ -861,6 +2173,7 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) v_ret = VIRTCHNL_STATUS_ERR_PARAM; goto error_param; } + cfg.addl_hdrs = ICE_FLOW_SEG_HDR_NONE; cfg.hash_flds = ICE_HASH_INVALID; cfg.hdr_type = ICE_RSS_ANY_HEADERS; @@ -871,24 +2184,12 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) } if (add) { - if (ice_add_rss_cfg(hw, vsi, &cfg)) { + cfg.symm = symm; + if (ice_add_rss_cfg_wrap(vf, &cfg)) v_ret = VIRTCHNL_STATUS_ERR_PARAM; - dev_err(dev, "ice_add_rss_cfg failed for vsi = %d, v_ret = %d\n", - vsi->vsi_num, v_ret); - } } else { - int status; - - status = ice_rem_rss_cfg(hw, vsi->idx, &cfg); - /* We just ignore -ENOENT, because if two configurations - * share the same profile remove one of them actually - * removes both, since the profile is deleted. - */ - if (status && status != -ENOENT) { + if (ice_rem_rss_cfg_wrap(vf, &cfg)) v_ret = VIRTCHNL_STATUS_ERR_PARAM; - dev_err(dev, "ice_rem_rss_cfg failed for VF ID:%d, error:%d\n", - vf->vf_id, status); - } } } @@ -2679,7 +3980,7 @@ static int ice_vc_set_rss_hena(struct ice_vf *vf, u8 *msg) } if (vrh->hena) { - status = ice_add_avf_rss_cfg(&pf->hw, vsi, vrh->hena); + status = ice_add_avf_rss_cfg(&pf->hw, vsi->idx, vrh->hena); v_ret = ice_err_to_virt_err(status); } diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c index 14e3f0f89c78d6..eb0b4db1d376ef 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c @@ -635,9 +635,9 @@ static int ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, struct ice_flow_seg_info *seg, int tun) { + const struct ice_flow_seg_info *old_seg; struct ice_vf_fdir *fdir = &vf->fdir; struct ice_vsi *vf_vsi, *ctrl_vsi; - struct ice_flow_seg_info *old_seg; struct ice_flow_prof *prof = NULL; struct ice_fd_hw_prof *vf_prof; struct device *dev; @@ -661,7 +661,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, vf_prof = fdir->fdir_prof[flow]; old_seg = vf_prof->fdir_seg[tun]; if (old_seg) { - if (!memcmp(old_seg, seg, sizeof(*seg))) { + if (!memcmp(old_seg, seg, sizeof(*seg) * (tun + 1))) { dev_dbg(dev, "Duplicated profile for VF %d!\n", vf->vf_id); return -EEXIST; @@ -679,7 +679,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, } ret = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, seg, - tun + 1, false, &prof); + tun + 1, NULL, 0, false, &prof); if (ret) { dev_dbg(dev, "Could not add VSI flow 0x%x for VF %d\n", flow, vf->vf_id); @@ -688,7 +688,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, ret = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, vf_vsi->idx, vf_vsi->idx, ICE_FLOW_PRIO_NORMAL, - seg, &entry1_h); + seg, NULL, 0, &entry1_h); if (ret) { dev_dbg(dev, "Could not add flow 0x%x VSI entry for VF %d\n", flow, vf->vf_id); @@ -697,7 +697,7 @@ ice_vc_fdir_write_flow_prof(struct ice_vf *vf, enum ice_fltr_ptype flow, ret = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, vf_vsi->idx, ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL, - seg, &entry2_h); + seg, NULL, 0, &entry2_h); if (ret) { dev_dbg(dev, "Could not add flow 0x%x Ctrl VSI entry for VF %d\n", @@ -843,7 +843,7 @@ ice_vc_fdir_parse_raw(struct ice_vf *vf, pkt_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL); msk_buf = kzalloc(proto->raw.pkt_len, GFP_KERNEL); if (!pkt_buf || !msk_buf) - goto err_mem_alloc; + goto err_pkt_msk_buf_alloc; memcpy(pkt_buf, proto->raw.spec, proto->raw.pkt_len); memcpy(msk_buf, proto->raw.mask, proto->raw.pkt_len); @@ -854,49 +854,44 @@ ice_vc_fdir_parse_raw(struct ice_vf *vf, psr = ice_parser_create(hw); if (IS_ERR(psr)) { status = PTR_ERR(psr); - goto err_mem_alloc; + goto err_parser_process; } ice_parser_dvm_set(psr, ice_is_dvm_ena(hw)); - if (ice_get_open_tunnel_port(hw, &udp_port, TNL_VXLAN)) + if (ice_get_open_tunnel_port(hw, TNL_VXLAN, &udp_port)) ice_parser_vxlan_tunnel_set(psr, udp_port, true); - status = ice_parser_run(psr, pkt_buf, proto->raw.pkt_len, &rslt); - if (status) - goto err_parser_destroy; - - if (hw->debug_mask & ICE_DBG_PARSER) - ice_parser_result_dump(hw, &rslt); + if (ice_parser_run(psr, pkt_buf, proto->raw.pkt_len, &rslt)) + goto err_parser_process; + ice_parser_destroy(psr); conf->prof = kzalloc(sizeof(*conf->prof), GFP_KERNEL); - if (!conf->prof) { - status = -ENOMEM; - goto err_parser_destroy; - } + if (!conf->prof) + goto err_conf_prof_alloc; status = ice_parser_profile_init(&rslt, pkt_buf, msk_buf, - proto->raw.pkt_len, ICE_BLK_FD, + proto->raw.pkt_len, ICE_BLK_FD, true, conf->prof); if (status) goto err_parser_profile_init; - if (hw->debug_mask & ICE_DBG_PARSER) - ice_parser_profile_dump(hw, conf->prof); - /* Store raw flow info into @conf */ conf->pkt_len = proto->raw.pkt_len; conf->pkt_buf = pkt_buf; + kfree(msk_buf); + conf->parser_ena = true; - ice_parser_destroy(psr); return 0; err_parser_profile_init: kfree(conf->prof); -err_parser_destroy: +err_conf_prof_alloc: +err_parser_process: ice_parser_destroy(psr); -err_mem_alloc: +err_pkt_msk_buf_alloc: + kfree(msk_buf); kfree(pkt_buf); return status; } @@ -1371,6 +1366,64 @@ static void ice_vc_fdir_flush_entry(struct ice_vf *vf) } } +/** + * ice_vc_fdir_add_del_raw - write raw flow filter rule into hardware + * @vf: pointer to the VF info + * @conf: FDIR configuration for each filter + * @add: true implies add rule, false implies del rules + * + * Return: 0 on success, and other on error. + */ +static int ice_vc_fdir_add_del_raw(struct ice_vf *vf, + struct virtchnl_fdir_fltr_conf *conf, + bool add) +{ + struct ice_fdir_fltr *input = &conf->input; + struct ice_vsi *vsi, *ctrl_vsi; + struct ice_fltr_desc desc; + struct device *dev; + struct ice_pf *pf; + struct ice_hw *hw; + int ret; + u8 *pkt; + + pf = vf->pf; + dev = ice_pf_to_dev(pf); + hw = &pf->hw; + vsi = ice_get_vf_vsi(vf); + if (!vsi) { + dev_dbg(dev, "Invalid vsi for VF %d\n", vf->vf_id); + return -EINVAL; + } + + input->dest_vsi = vsi->idx; + input->comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW; + + ctrl_vsi = pf->vsi[vf->ctrl_vsi_idx]; + if (!ctrl_vsi) { + dev_dbg(dev, "Invalid ctrl_vsi for VF %d\n", vf->vf_id); + return -EINVAL; + } + + pkt = devm_kzalloc(dev, ICE_FDIR_MAX_RAW_PKT_SIZE, GFP_KERNEL); + if (!pkt) + return -ENOMEM; + + memcpy(pkt, conf->pkt_buf, conf->pkt_len); + + ice_fdir_get_prgm_desc(hw, input, &desc, add); + + ret = ice_prgm_fdir_fltr(ctrl_vsi, &desc, pkt); + if (ret) + goto err_free_pkt; + + return 0; + +err_free_pkt: + devm_kfree(dev, pkt); + return ret; +} + /** * ice_vc_fdir_write_fltr - write filter rule into hardware * @vf: pointer to the VF info @@ -1957,7 +2010,6 @@ static void ice_vc_parser_fv_save(struct ice_parser_fv *fv, * ice_vc_add_fdir_raw - add a raw FDIR filter for VF * @vf: pointer to the VF info * @conf: FDIR configuration for each filter - * @v_ret: the final VIRTCHNL code * @stat: pointer to the VIRTCHNL_OP_ADD_FDIR_FILTER * @len: length of the stat * @@ -1966,10 +2018,10 @@ static void ice_vc_parser_fv_save(struct ice_parser_fv *fv, static int ice_vc_add_fdir_raw(struct ice_vf *vf, struct virtchnl_fdir_fltr_conf *conf, - enum virtchnl_status_code *v_ret, struct virtchnl_fdir_add *stat, int len) { struct ice_vsi *vf_vsi, *ctrl_vsi; + enum virtchnl_status_code v_ret; struct ice_fdir_prof_info *pi; struct ice_pf *pf = vf->pf; int ret, ptg, id, i; @@ -1979,28 +2031,31 @@ ice_vc_add_fdir_raw(struct ice_vf *vf, dev = ice_pf_to_dev(pf); hw = &pf->hw; - *v_ret = VIRTCHNL_STATUS_ERR_PARAM; - stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; id = find_first_bit(conf->prof->ptypes, ICE_FLOW_PTYPE_MAX); ptg = hw->blk[ICE_BLK_FD].xlt1.t[id]; + v_ret = VIRTCHNL_STATUS_SUCCESS; vf_vsi = ice_get_vf_vsi(vf); if (!vf_vsi) { + v_ret = VIRTCHNL_STATUS_ERR_PARAM; + stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; dev_err(dev, "Can not get FDIR vf_vsi for VF %d\n", vf->vf_id); - return -ENODEV; + goto err_exit; } ctrl_vsi = pf->vsi[vf->ctrl_vsi_idx]; if (!ctrl_vsi) { + v_ret = VIRTCHNL_STATUS_ERR_PARAM; + stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; dev_err(dev, "Can not get FDIR ctrl_vsi for VF %d\n", vf->vf_id); - return -ENODEV; + goto err_exit; } fv_found = false; - /* Check if profile info already exists, then update the counter */ + /* Check if profile info already existed, then update the counter */ pi = &vf->fdir_prof_info[ptg]; if (pi->fdir_active_cnt != 0) { for (i = 0; i < ICE_MAX_FV_WORDS; i++) @@ -2015,36 +2070,37 @@ ice_vc_add_fdir_raw(struct ice_vf *vf, /* HW profile setting is only required for the first time */ if (!fv_found) { - ret = ice_flow_set_parser_prof(hw, vf_vsi->idx, - ctrl_vsi->idx, conf->prof, - ICE_BLK_FD); + ret = ice_flow_set_hw_prof(hw, vf_vsi->idx, + ctrl_vsi->idx, conf->prof, + ICE_BLK_FD); - if (ret) { - *v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; - dev_dbg(dev, "VF %d: insert hw prof failed\n", - vf->vf_id); - return ret; - } + if (ret) + goto err_free_conf; } ret = ice_vc_fdir_insert_entry(vf, conf, &conf->flow_id); if (ret) { - *v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; + v_ret = VIRTCHNL_STATUS_SUCCESS; + stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; dev_dbg(dev, "VF %d: insert FDIR list failed\n", vf->vf_id); - return ret; + goto err_free_conf; } ret = ice_vc_fdir_set_irq_ctx(vf, conf, VIRTCHNL_OP_ADD_FDIR_FILTER); if (ret) { + v_ret = VIRTCHNL_STATUS_SUCCESS; + stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; dev_dbg(dev, "VF %d: set FDIR context failed\n", vf->vf_id); goto err_rem_entry; } - ret = ice_vc_fdir_write_fltr(vf, conf, true, false); + ret = ice_vc_fdir_add_del_raw(vf, conf, true); if (ret) { + v_ret = VIRTCHNL_STATUS_SUCCESS; + stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE; dev_err(dev, "VF %d: adding FDIR raw flow rule failed, ret:%d\n", vf->vf_id, ret); goto err_clr_irq; @@ -2055,7 +2111,6 @@ ice_vc_add_fdir_raw(struct ice_vf *vf, for (i = 0; i < conf->prof->fv_num; i++) ice_vc_parser_fv_save(&pi->prof.fv[i], &conf->prof->fv[i]); - pi->prof.fv_num = conf->prof->fv_num; pi->fdir_active_cnt = 1; } @@ -2065,6 +2120,16 @@ ice_vc_add_fdir_raw(struct ice_vf *vf, ice_vc_fdir_clear_irq_ctx(vf); err_rem_entry: ice_vc_fdir_remove_entry(vf, conf, conf->flow_id); +err_free_conf: + if (conf->parser_ena) + conf->parser_ena = false; + kfree(conf->prof); + kfree(conf->pkt_buf); + kfree(conf); +err_exit: + ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_FDIR_FILTER, v_ret, + (u8 *)stat, len); + kfree(stat); return ret; } @@ -2111,7 +2176,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) ret = ice_vf_start_ctrl_vsi(vf); if (ret && (ret != -EEXIST)) { v_ret = VIRTCHNL_STATUS_ERR_PARAM; - dev_err(dev, "Init FDIR for VF %d failed, ret:%d\n", + dev_err(dev, "VF %d: FDIR input set configure failed, ret:%d\n", vf->vf_id, ret); goto err_exit; } @@ -2123,7 +2188,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) goto err_exit; } - conf = devm_kzalloc(dev, sizeof(*conf), GFP_KERNEL); + conf = kzalloc(sizeof(*conf), GFP_KERNEL); if (!conf) { v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY; dev_dbg(dev, "Alloc conf for VF %d failed\n", vf->vf_id); @@ -2133,7 +2198,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) len = sizeof(*stat); ret = ice_vc_validate_fdir_fltr(vf, fltr, conf); if (ret) { - v_ret = VIRTCHNL_STATUS_ERR_PARAM; + v_ret = VIRTCHNL_STATUS_SUCCESS; stat->status = VIRTCHNL_FDIR_FAILURE_RULE_INVALID; dev_dbg(dev, "Invalid FDIR filter from VF %d\n", vf->vf_id); goto err_free_conf; @@ -2142,15 +2207,15 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) if (fltr->validate_only) { v_ret = VIRTCHNL_STATUS_SUCCESS; stat->status = VIRTCHNL_FDIR_SUCCESS; - devm_kfree(dev, conf); + kfree(conf); ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_FDIR_FILTER, v_ret, (u8 *)stat, len); goto exit; } - /* For raw FDIR filters created by the parser */ + /* For Protocol Agnostic Flow Offloading case only */ if (conf->parser_ena) { - ret = ice_vc_add_fdir_raw(vf, conf, &v_ret, stat, len); + ret = ice_vc_add_fdir_raw(vf, conf, stat, len); if (ret) goto err_free_conf; goto exit; @@ -2161,7 +2226,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) if (ret) { v_ret = VIRTCHNL_STATUS_SUCCESS; stat->status = VIRTCHNL_FDIR_FAILURE_RULE_CONFLICT; - dev_err(dev, "VF %d: FDIR input set configure failed, ret:%d\n", + dev_err(dev, "VF %d: writing FDIR rule failed, ret:%d\n", vf->vf_id, ret); goto err_free_conf; } @@ -2209,7 +2274,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg) err_rem_entry: ice_vc_fdir_remove_entry(vf, conf, conf->flow_id); err_free_conf: - devm_kfree(dev, conf); + kfree(conf); err_exit: ret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_FDIR_FILTER, v_ret, (u8 *)stat, len); diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h index f41395264dca12..0c0c9966567970 100644 --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h @@ -246,8 +246,13 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource); #define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES BIT(6) /* used to negotiate communicating link speeds in Mbps */ #define VIRTCHNL_VF_CAP_ADV_LINK_SPEED BIT(7) -#define VIRTCHNL_VF_OFFLOAD_CRC BIT(10) + /* BIT(8) is reserved */ +#define VIRTCHNL_VF_LARGE_NUM_QPAIRS BIT(9) +#define VIRTCHNL_VF_OFFLOAD_CRC BIT(10) #define VIRTCHNL_VF_OFFLOAD_TC_U32 BIT(11) +#define VIRTCHNL_VF_OFFLOAD_QGRPS BIT(12) +#define VIRTCHNL_VF_OFFLOAD_FLOW_STEER_TO_QGRP BIT(13) +#define VIRTCHNL_VF_OFFLOAD_FSUB_PF BIT(14) #define VIRTCHNL_VF_OFFLOAD_VLAN_V2 BIT(15) #define VIRTCHNL_VF_OFFLOAD_VLAN BIT(16) #define VIRTCHNL_VF_OFFLOAD_RX_POLLING BIT(17) @@ -257,10 +262,14 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource); #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM BIT(21) #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM BIT(22) #define VIRTCHNL_VF_OFFLOAD_ADQ BIT(23) +#define VIRTCHNL_VF_OFFLOAD_ADQ_V2 BIT(24) #define VIRTCHNL_VF_OFFLOAD_USO BIT(25) #define VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC BIT(26) #define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF BIT(27) #define VIRTCHNL_VF_OFFLOAD_FDIR_PF BIT(28) +#define VIRTCHNL_VF_OFFLOAD_QOS BIT(29) +#define VIRTCHNL_VF_CAP_DCF BIT(30) +#define VIRTCHNL_VF_CAP_PTP BIT(31) #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ VIRTCHNL_VF_OFFLOAD_VLAN | \ @@ -1183,6 +1192,17 @@ enum virtchnl_proto_hdr_type { VIRTCHNL_PROTO_HDR_ESP, VIRTCHNL_PROTO_HDR_AH, VIRTCHNL_PROTO_HDR_PFCP, + VIRTCHNL_PROTO_HDR_GTPC, + VIRTCHNL_PROTO_HDR_ECPRI, + VIRTCHNL_PROTO_HDR_L2TPV2, + VIRTCHNL_PROTO_HDR_PPP, + /* IPv4 and IPv6 Fragment header types are only associated to + * VIRTCHNL_PROTO_HDR_IPV4 and VIRTCHNL_PROTO_HDR_IPV6 respectively, + * cannot be used independently. + */ + VIRTCHNL_PROTO_HDR_IPV4_FRAG, + VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG, + VIRTCHNL_PROTO_HDR_GRE, }; /* Protocol header field within a protocol header. */ @@ -1205,6 +1225,7 @@ enum virtchnl_proto_hdr_field { VIRTCHNL_PROTO_HDR_IPV4_DSCP, VIRTCHNL_PROTO_HDR_IPV4_TTL, VIRTCHNL_PROTO_HDR_IPV4_PROT, + VIRTCHNL_PROTO_HDR_IPV4_CHKSUM, /* IPV6 */ VIRTCHNL_PROTO_HDR_IPV6_SRC = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV6), @@ -1212,18 +1233,34 @@ enum virtchnl_proto_hdr_field { VIRTCHNL_PROTO_HDR_IPV6_TC, VIRTCHNL_PROTO_HDR_IPV6_HOP_LIMIT, VIRTCHNL_PROTO_HDR_IPV6_PROT, + /* IPV6 Prefix */ + VIRTCHNL_PROTO_HDR_IPV6_PREFIX32_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX32_DST, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX40_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX40_DST, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX48_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX48_DST, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX56_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX56_DST, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX64_DST, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX96_SRC, + VIRTCHNL_PROTO_HDR_IPV6_PREFIX96_DST, /* TCP */ VIRTCHNL_PROTO_HDR_TCP_SRC_PORT = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_TCP), VIRTCHNL_PROTO_HDR_TCP_DST_PORT, + VIRTCHNL_PROTO_HDR_TCP_CHKSUM, /* UDP */ VIRTCHNL_PROTO_HDR_UDP_SRC_PORT = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_UDP), VIRTCHNL_PROTO_HDR_UDP_DST_PORT, + VIRTCHNL_PROTO_HDR_UDP_CHKSUM, /* SCTP */ VIRTCHNL_PROTO_HDR_SCTP_SRC_PORT = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_SCTP), VIRTCHNL_PROTO_HDR_SCTP_DST_PORT, + VIRTCHNL_PROTO_HDR_SCTP_CHKSUM, /* GTPU_IP */ VIRTCHNL_PROTO_HDR_GTPU_IP_TEID = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_IP), @@ -1247,6 +1284,28 @@ enum virtchnl_proto_hdr_field { VIRTCHNL_PROTO_HDR_PFCP_S_FIELD = PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_PFCP), VIRTCHNL_PROTO_HDR_PFCP_SEID, + /* GTPC */ + VIRTCHNL_PROTO_HDR_GTPC_TEID = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPC), + /* ECPRI */ + VIRTCHNL_PROTO_HDR_ECPRI_MSG_TYPE = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_ECPRI), + VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID, + /* IPv4 Dummy Fragment */ + VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV4_FRAG), + /* IPv6 Extension Fragment */ + VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG_PKID = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_IPV6_EH_FRAG), + /* GTPU_DWN/UP */ + VIRTCHNL_PROTO_HDR_GTPU_DWN_QFI = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_DWN), + VIRTCHNL_PROTO_HDR_GTPU_UP_QFI = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_GTPU_EH_PDU_UP), + /* L2TPv2 */ + VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID = + PROTO_HDR_FIELD_START(VIRTCHNL_PROTO_HDR_L2TPV2), + VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID, }; struct virtchnl_proto_hdr { @@ -1416,6 +1475,9 @@ struct virtchnl_fdir_del { VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_fdir_del); +#define virtchnl_ss_vf_resource(p, m, c) \ + __vss_full(p, m, c, virtchnl_vf_resource_LEGACY_SIZEOF) + #define __vss_byone(p, member, count, old) \ (struct_size(p, member, count) + (old - 1 - struct_size(p, member, 0)))