Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_protocol_type.h
/* SPDX-License-Identifier: BSD-3-Clause */ | /* SPDX-License-Identifier: BSD-3-Clause */ | ||||
/* Copyright (c) 2022, Intel Corporation | /* Copyright (c) 2023, Intel Corporation | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions are met: | * modification, are permitted provided that the following conditions are met: | ||||
* | * | ||||
* 1. Redistributions of source code must retain the above copyright notice, | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* this list of conditions and the following disclaimer. | * this list of conditions and the following disclaimer. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | enum ice_protocol_type { | ||||
ICE_SCTP_IL, | ICE_SCTP_IL, | ||||
ICE_VXLAN, | ICE_VXLAN, | ||||
ICE_GENEVE, | ICE_GENEVE, | ||||
ICE_VXLAN_GPE, | ICE_VXLAN_GPE, | ||||
ICE_NVGRE, | ICE_NVGRE, | ||||
ICE_GTP, | ICE_GTP, | ||||
ICE_GTP_NO_PAY, | ICE_GTP_NO_PAY, | ||||
ICE_PPPOE, | ICE_PPPOE, | ||||
ICE_L2TPV3, | |||||
ICE_PROTOCOL_LAST | ICE_PROTOCOL_LAST | ||||
}; | }; | ||||
enum ice_sw_tunnel_type { | enum ice_sw_tunnel_type { | ||||
ICE_NON_TUN = 0, | ICE_NON_TUN = 0, | ||||
ICE_SW_TUN_AND_NON_TUN, | ICE_SW_TUN_AND_NON_TUN, | ||||
ICE_SW_TUN_VXLAN_GPE, | ICE_SW_TUN_VXLAN_GPE, | ||||
ICE_SW_TUN_GENEVE, /* GENEVE matches only non-VLAN pkts */ | ICE_SW_TUN_GENEVE, /* GENEVE matches only non-VLAN pkts */ | ||||
ICE_SW_TUN_GENEVE_VLAN, /* GENEVE matches both VLAN and non-VLAN pkts */ | ICE_SW_TUN_GENEVE_VLAN, /* GENEVE matches both VLAN and non-VLAN pkts */ | ||||
ICE_SW_TUN_VXLAN, /* VXLAN matches only non-VLAN pkts */ | ICE_SW_TUN_VXLAN, /* VXLAN matches only non-VLAN pkts */ | ||||
ICE_SW_TUN_VXLAN_VLAN, /* VXLAN matches both VLAN and non-VLAN pkts */ | ICE_SW_TUN_VXLAN_VLAN, /* VXLAN matches both VLAN and non-VLAN pkts */ | ||||
ICE_SW_TUN_NVGRE, | ICE_SW_TUN_NVGRE, | ||||
ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN | ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN | ||||
* and GENEVE | * and GENEVE | ||||
*/ | */ | ||||
ICE_SW_TUN_IPV4_GTP_IPV4_TCP, | |||||
ICE_SW_TUN_IPV4_GTP_IPV4_UDP, | |||||
ICE_SW_TUN_IPV4_GTP_IPV6_TCP, | |||||
ICE_SW_TUN_IPV4_GTP_IPV6_UDP, | |||||
ICE_SW_TUN_IPV6_GTP_IPV4_TCP, | |||||
ICE_SW_TUN_IPV6_GTP_IPV4_UDP, | |||||
ICE_SW_TUN_IPV6_GTP_IPV6_TCP, | |||||
ICE_SW_TUN_IPV6_GTP_IPV6_UDP, | |||||
/* following adds support for GTP, just using inner protocols, | |||||
* outer L3 and L4 protocols can be anything | |||||
*/ | |||||
ICE_SW_TUN_GTP_IPV4_TCP, | |||||
ICE_SW_TUN_GTP_IPV4_UDP, | |||||
ICE_SW_TUN_GTP_IPV6_TCP, | |||||
ICE_SW_TUN_GTP_IPV6_UDP, | |||||
ICE_SW_TUN_GTPU, | ICE_SW_TUN_GTPU, | ||||
ICE_SW_TUN_GTPC, | ICE_SW_TUN_GTPC, | ||||
ICE_SW_TUN_IPV4_GTPU_IPV4, | |||||
ICE_SW_TUN_IPV4_GTPU_IPV6, | |||||
ICE_SW_TUN_IPV6_GTPU_IPV4, | |||||
ICE_SW_TUN_IPV6_GTPU_IPV6, | |||||
ICE_SW_TUN_GTP_IPV4, | |||||
ICE_SW_TUN_GTP_IPV6, | |||||
ICE_ALL_TUNNELS /* All tunnel types including NVGRE */ | ICE_ALL_TUNNELS /* All tunnel types including NVGRE */ | ||||
}; | }; | ||||
/* Decoders for ice_prot_id: | /* Decoders for ice_prot_id: | ||||
* - F: First | * - F: First | ||||
* - I: Inner | * - I: Inner | ||||
* - L: Last | * - L: Last | ||||
* - O: Outer | * - O: Outer | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
#define ICE_VLAN_OL_HW 17 | #define ICE_VLAN_OL_HW 17 | ||||
#define ICE_IPV4_OFOS_HW 32 | #define ICE_IPV4_OFOS_HW 32 | ||||
#define ICE_IPV4_IL_HW 33 | #define ICE_IPV4_IL_HW 33 | ||||
#define ICE_IPV6_OFOS_HW 40 | #define ICE_IPV6_OFOS_HW 40 | ||||
#define ICE_IPV6_IL_HW 41 | #define ICE_IPV6_IL_HW 41 | ||||
#define ICE_TCP_IL_HW 49 | #define ICE_TCP_IL_HW 49 | ||||
#define ICE_UDP_ILOS_HW 53 | #define ICE_UDP_ILOS_HW 53 | ||||
#define ICE_SCTP_IL_HW 96 | #define ICE_SCTP_IL_HW 96 | ||||
#define ICE_PPPOE_HW 103 | |||||
#define ICE_L2TPV3_HW 104 | |||||
/* ICE_UDP_OF is used to identify all 3 tunnel types | /* ICE_UDP_OF is used to identify all 3 tunnel types | ||||
* VXLAN, GENEVE and VXLAN_GPE. To differentiate further | * VXLAN, GENEVE and VXLAN_GPE. To differentiate further | ||||
* need to use flags from the field vector | * need to use flags from the field vector | ||||
*/ | */ | ||||
#define ICE_UDP_OF_HW 52 /* UDP Tunnels */ | #define ICE_UDP_OF_HW 52 /* UDP Tunnels */ | ||||
#define ICE_GRE_OF_HW 64 /* NVGRE */ | #define ICE_GRE_OF_HW 64 /* NVGRE */ | ||||
#define ICE_PPPOE_HW 103 | #define ICE_META_DATA_ID_HW 255 /* this is used for tunnel and VLAN type */ | ||||
#define ICE_META_DATA_ID_HW 255 /* this is used for tunnel type */ | |||||
#define ICE_MDID_SIZE 2 | #define ICE_MDID_SIZE 2 | ||||
#define ICE_TUN_FLAG_MDID 20 | #define ICE_TUN_FLAG_MDID 20 | ||||
#define ICE_TUN_FLAG_MDID_OFF(word) \ | #define ICE_TUN_FLAG_MDID_OFF(word) \ | ||||
(ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word))) | (ICE_MDID_SIZE * (ICE_TUN_FLAG_MDID + (word))) | ||||
#define ICE_TUN_FLAG_MASK 0xFF | #define ICE_TUN_FLAG_MASK 0xFF | ||||
#define ICE_DIR_FLAG_MASK 0x10 | #define ICE_DIR_FLAG_MASK 0x10 | ||||
#define ICE_TUN_FLAG_IN_VLAN_MASK 0x80 /* VLAN inside tunneled header */ | |||||
#define ICE_TUN_FLAG_VLAN_MASK 0x01 | #define ICE_TUN_FLAG_VLAN_MASK 0x01 | ||||
#define ICE_TUN_FLAG_FV_IND 2 | #define ICE_TUN_FLAG_FV_IND 2 | ||||
#define ICE_VLAN_FLAG_MDID 20 | |||||
#define ICE_VLAN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_VLAN_FLAG_MDID) | |||||
#define ICE_PKT_FLAGS_0_TO_15_VLAN_FLAGS_MASK 0xD000 | |||||
#define ICE_PROTOCOL_MAX_ENTRIES 16 | #define ICE_PROTOCOL_MAX_ENTRIES 16 | ||||
/* Mapping of software defined protocol ID to hardware defined protocol ID */ | /* Mapping of software defined protocol ID to hardware defined protocol ID */ | ||||
struct ice_protocol_entry { | struct ice_protocol_entry { | ||||
enum ice_protocol_type type; | enum ice_protocol_type type; | ||||
u8 protocol_id; | u8 protocol_id; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
struct ice_pppoe_hdr { | struct ice_pppoe_hdr { | ||||
u8 rsrvd_ver_type; | u8 rsrvd_ver_type; | ||||
u8 rsrvd_code; | u8 rsrvd_code; | ||||
__be16 session_id; | __be16 session_id; | ||||
__be16 length; | __be16 length; | ||||
__be16 ppp_prot_id; /* control and data only */ | __be16 ppp_prot_id; /* control and data only */ | ||||
}; | }; | ||||
struct ice_l2tpv3_sess_hdr { | |||||
__be32 session_id; | |||||
__be64 cookie; | |||||
}; | |||||
struct ice_nvgre { | struct ice_nvgre { | ||||
__be16 flags; | __be16 flags; | ||||
__be16 protocol; | __be16 protocol; | ||||
__be32 tni_flow; | __be32 tni_flow; | ||||
}; | }; | ||||
union ice_prot_hdr { | union ice_prot_hdr { | ||||
struct ice_ether_hdr eth_hdr; | struct ice_ether_hdr eth_hdr; | ||||
struct ice_ethtype_hdr ethertype; | struct ice_ethtype_hdr ethertype; | ||||
struct ice_vlan_hdr vlan_hdr; | struct ice_vlan_hdr vlan_hdr; | ||||
struct ice_ipv4_hdr ipv4_hdr; | struct ice_ipv4_hdr ipv4_hdr; | ||||
struct ice_ipv6_hdr ipv6_hdr; | struct ice_ipv6_hdr ipv6_hdr; | ||||
struct ice_l4_hdr l4_hdr; | struct ice_l4_hdr l4_hdr; | ||||
struct ice_sctp_hdr sctp_hdr; | struct ice_sctp_hdr sctp_hdr; | ||||
struct ice_udp_tnl_hdr tnl_hdr; | struct ice_udp_tnl_hdr tnl_hdr; | ||||
struct ice_nvgre nvgre_hdr; | struct ice_nvgre nvgre_hdr; | ||||
struct ice_udp_gtp_hdr gtp_hdr; | struct ice_udp_gtp_hdr gtp_hdr; | ||||
struct ice_pppoe_hdr pppoe_hdr; | struct ice_pppoe_hdr pppoe_hdr; | ||||
struct ice_l2tpv3_sess_hdr l2tpv3_sess_hdr; | |||||
}; | }; | ||||
/* This is mapping table entry that maps every word within a given protocol | /* This is mapping table entry that maps every word within a given protocol | ||||
* structure to the real byte offset as per the specification of that | * structure to the real byte offset as per the specification of that | ||||
* protocol header. | * protocol header. | ||||
* for e.g. dst address is 3 words in ethertype header and corresponding bytes | * for e.g. dst address is 3 words in ethertype header and corresponding bytes | ||||
* are 0, 2, 3 in the actual packet header and src address is at 4, 6, 8 | * are 0, 2, 3 in the actual packet header and src address is at 4, 6, 8 | ||||
*/ | */ | ||||
Show All 37 Lines |