0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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,
+};
+
static const u8 ice_fdir_tcpv6_pkt[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x60, 0x00,
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,
+ },
{
ICE_FLTR_PTYPE_NONF_IPV6_TCP,
sizeof(ice_fdir_tcpv6_pkt), ice_fdir_tcpv6_pkt,
ice_memcpy(pkt, addr, ETH_ALEN, ICE_NONDMA_TO_NONDMA);
}
+/**
+ * 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 enum ice_status
+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 ICE_ERR_DOES_NOT_EXIST;
+ break;
+ default:
+ if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, port) &&
+ !ice_get_open_tunnel_port(hw, TNL_GENEVE, port))
+ return ICE_ERR_DOES_NOT_EXIST;
+ }
+
+ return ICE_SUCCESS;
+}
+
/**
* ice_fdir_get_gen_prgm_pkt - generate a training packet
* @hw: pointer to the hardware structure
ice_fdir_pkt[idx].pkt_len, ICE_NONDMA_TO_NONDMA);
loc = pkt;
} else {
- if (!ice_get_open_tunnel_port(hw, TNL_ALL, &tnl_port))
- return ICE_ERR_DOES_NOT_EXIST;
+ enum ice_status ret;
+
+ ret = ice_fdir_get_open_tunnel_port(hw, flow, &tnl_port);
+ if (ret)
+ return ret;
+
if (!ice_fdir_pkt[idx].tun_pkt)
return ICE_ERR_PARAM;
ice_memcpy(pkt, ice_fdir_pkt[idx].tun_pkt,
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 outer 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_IPV6_TCP:
ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
input->ip.v6.src_ip);
/* 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),
};
/* Bitmaps indicating relevant packet types for a particular protocol header
static const u32 ice_ptypes_mac_ofos[] = {
0xFDC00846, 0xBFBF7F7E, 0xF70001DF, 0xFEFDFDFB,
0x0000077E, 0x000003FF, 0x00000000, 0x00000000,
- 0x00400000, 0x03FFF000, 0xFFFFFFE0, 0x00000707,
+ 0x00400000, 0x03FFF000, 0xFFFFFFE0, 0x00100707,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
static const u32 ice_ptypes_ipv4_ofos[] = {
0x1DC00000, 0x24000800, 0x00000000, 0x00000000,
0x00000000, 0x00000155, 0x00000000, 0x00000000,
- 0x00000000, 0x000FC000, 0x000002A0, 0x00000000,
+ 0x00000000, 0x000FC000, 0x000002A0, 0x00100000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
static const u32 ice_ptypes_ipv4_il[] = {
0xE0000000, 0xB807700E, 0x80000003, 0xE01DC03B,
0x0000000E, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x001FF800, 0x00000000,
+ 0x00000000, 0x00000000, 0x001FF800, 0x00100000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
static const u32 ice_ptypes_udp_il[] = {
0x81000000, 0x20204040, 0x04000010, 0x80810102,
0x00000040, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00410000, 0x908427E0, 0x00000007,
+ 0x00000000, 0x00410000, 0x908427E0, 0x00100007,
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,
+};
+
/* Manage parameters and info. used during the creation of a flow profile */
struct ice_flow_prof_params {
enum ice_block blk;
ICE_FLOW_SEG_HDR_PFCP_SESSION | ICE_FLOW_SEG_HDR_L2TPV3 | \
ICE_FLOW_SEG_HDR_ESP | ICE_FLOW_SEG_HDR_AH | \
ICE_FLOW_SEG_HDR_NAT_T_ESP | ICE_FLOW_SEG_HDR_GTPU_NON_IP | \
- ICE_FLOW_SEG_HDR_ECPRI_TP0)
+ ICE_FLOW_SEG_HDR_ECPRI_TP0 | ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0)
#define ICE_FLOW_SEG_HDRS_L2_MASK \
(ICE_FLOW_SEG_HDR_ETH | ICE_FLOW_SEG_HDR_VLAN)
src = (const ice_bitmap_t *)ice_ptypes_vxlan_vni;
ice_and_bitmap(params->ptypes, params->ptypes,
src, ICE_FLOW_PTYPE_MAX);
+ } else if (hdrs & ICE_FLOW_SEG_HDR_UDP_ECPRI_TP0) {
+ src = (const ice_bitmap_t *)ice_ptypes_udp_ecpri_tp0;
+ ice_and_bitmap(params->ptypes, params->ptypes,
+ src, ICE_FLOW_PTYPE_MAX);
}
if (hdrs & ICE_FLOW_SEG_HDR_PFCP) {
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: