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) 2020, Intel Corporation | /* Copyright (c) 2021, 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 56 Lines • ▼ Show 20 Lines | enum ice_protocol_type { | ||||
ICE_TCP_IL, | ICE_TCP_IL, | ||||
ICE_UDP_OF, | ICE_UDP_OF, | ||||
ICE_UDP_ILOS, | ICE_UDP_ILOS, | ||||
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_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, | |||||
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 All 40 Lines | enum ice_prot_id { | ||||
ICE_PROT_INVALID = 255 /* when offset == ICE_FV_OFFSET_INVAL */ | ICE_PROT_INVALID = 255 /* when offset == ICE_FV_OFFSET_INVAL */ | ||||
}; | }; | ||||
#define ICE_VNI_OFFSET 12 /* offset of VNI from ICE_PROT_UDP_OF */ | #define ICE_VNI_OFFSET 12 /* offset of VNI from ICE_PROT_UDP_OF */ | ||||
#define ICE_MAC_OFOS_HW 1 | #define ICE_MAC_OFOS_HW 1 | ||||
#define ICE_MAC_IL_HW 4 | #define ICE_MAC_IL_HW 4 | ||||
#define ICE_ETYPE_OL_HW 9 | #define ICE_ETYPE_OL_HW 9 | ||||
#define ICE_VLAN_OF_HW 16 | |||||
#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 | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
struct ice_udp_tnl_hdr { | struct ice_udp_tnl_hdr { | ||||
__be16 field; | __be16 field; | ||||
__be16 proto_type; | __be16 proto_type; | ||||
__be32 vni; /* only use lower 24-bits */ | __be32 vni; /* only use lower 24-bits */ | ||||
}; | }; | ||||
struct ice_udp_gtp_hdr { | |||||
u8 flags; | |||||
u8 msg_type; | |||||
__be16 rsrvd_len; | |||||
__be32 teid; | |||||
__be16 rsrvd_seq_nbr; | |||||
u8 rsrvd_n_pdu_nbr; | |||||
u8 rsrvd_next_ext; | |||||
u8 rsvrd_ext_len; | |||||
u8 pdu_type; | |||||
u8 qfi; | |||||
u8 rsvrd; | |||||
}; | |||||
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; | |||||
}; | }; | ||||
/* 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 |