12 #ifndef ODP_API_SPEC_CLASSIFICATION_H_
13 #define ODP_API_SPEC_CLASSIFICATION_H_
14 #include <odp/visibility_begin.h>
1143 #include <odp/visibility_end.h>
Standard C language types and definitions for ODP.
int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[], odp_cos_t src_cos[], odp_cos_t dst_cos[], odp_pmr_t pmr[], int num)
Create multiple packet matching rules.
int odp_cls_cos_stats(odp_cos_t cos, odp_cls_cos_stats_t *stats)
Get statistics for a CoS.
uint64_t odp_pmr_to_u64(odp_pmr_t pmr)
Get printable value for an odp_pmr_t.
union odp_cls_pmr_terms_t odp_cls_pmr_terms_t
Supported PMR term values.
struct odp_pmr_param_t odp_pmr_param_t
Packet Matching Rule parameter structure.
struct odp_cls_queue_stats_t odp_cls_queue_stats_t
Classifier queue specific statistics counters.
int odp_cos_queue_set(odp_cos_t cos, odp_queue_t queue)
Assign a queue for a class-of-service.
uint32_t odp_cls_cos_num_queue(odp_cos_t cos)
Get the number of queues linked with the specific class-of-service.
odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt, odp_cos_t src_cos, odp_cos_t dst_cos)
Create a packet matching rule with options.
int odp_cos_destroy(odp_cos_t cos)
Discard a class-of-service along with all its associated resources.
odp_queue_t odp_cls_hash_result(odp_cos_t cos, odp_packet_t packet)
Queue hash result Returns the queue within a CoS in which a particular packet will be enqueued based ...
void odp_cls_pmr_create_opt_init(odp_pmr_create_opt_t *opt)
Initialize packet matching rule creation option.
struct odp_cls_stats_capability_t odp_cls_stats_capability_t
Classifier statistics capabilities.
odp_pmr_t odp_cls_pmr_create(const odp_pmr_param_t *terms, int num_terms, odp_cos_t src_cos, odp_cos_t dst_cos)
Create Packet Matching Rule (PMR)
int odp_cos_destroy_multi(odp_cos_t cos[], int num)
Destroy multiple class-of-services.
int odp_cls_capability(odp_cls_capability_t *capability)
Query classification capabilities.
struct odp_cls_capability_t odp_cls_capability_t
Classification capabilities This capability structure defines system level classification capability.
uint64_t odp_cos_to_u64(odp_cos_t cos)
Get printable value for an odp_cos_t.
struct odp_bp_param_t odp_bp_param_t
Back pressure (BP)
struct odp_cls_aggr_capability_t odp_cls_aggr_capability_t
Event aggregator related capabilities.
uint32_t odp_cls_cos_queues(odp_cos_t cos, odp_queue_t queue[], uint32_t num)
Get the list of queue associated with the specific class-of-service.
odp_cls_pmr_term_t
Packet Matching Rule terms.
struct odp_red_param_t odp_red_param_t
Random Early Detection (RED) Random Early Detection is enabled to initiate a drop probability for the...
int odp_cls_pmr_destroy_multi(odp_pmr_t pmr[], int num)
Destroy multiple packet matching rules.
int odp_cls_cos_create_multi(const char *name[], const odp_cls_cos_param_t param[], odp_cos_t cos[], int num)
Create multiple class-of-services.
int odp_cls_cos_pool_set(odp_cos_t cos, odp_pool_t pool_id)
Assigns a packet pool for a specific class of service.
struct odp_cls_cos_param odp_cls_cos_param_t
Class of service parameters Used to communicate class of service creation options.
int odp_cls_queue_stats(odp_cos_t cos, odp_queue_t queue, odp_cls_queue_stats_t *stats)
Get statistics for a queue assigned to a CoS.
void odp_cls_print_all(void)
Print classifier info.
int odp_cls_pmr_destroy(odp_pmr_t pmr)
Function to destroy a packet match rule.
odp_cos_action_t
Enumeration of actions for CoS.
odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param)
Create a class-of-service.
void odp_cls_cos_param_init(odp_cls_cos_param_t *param)
Initialize class of service parameters.
odp_queue_t odp_cos_queue(odp_cos_t cos)
Get the queue associated with the specific class-of-service.
void odp_cls_pmr_param_init(odp_pmr_param_t *param)
Initialize packet matching rule parameters.
odp_pool_t odp_cls_cos_pool(odp_cos_t cos)
Get the pool associated with the given class of service.
struct odp_pmr_create_opt_t odp_pmr_create_opt_t
Packet Matching Rule creation options.
struct odp_cls_cos_stats_t odp_cls_cos_stats_t
Classifier CoS specific statistics counters.
@ ODP_PMR_IGMP_GRP_ADDR
IGMP Group address (val_sz = 4), implies IPPROTO=2.
@ ODP_PMR_TCP_DPORT
Destination TCP port (val_sz = 2)
@ ODP_PMR_ETHTYPE_0
Initial (outer) Ethertype only (val_sz = 2)
@ ODP_PMR_VLAN_PCP_0
PCP bits in the first (outer) VLAN header (val_sz = 1)
@ ODP_PMR_ICMP_TYPE
ICMP type (val_sz = 1), implies IPPROTO=1.
@ ODP_PMR_SIP_ADDR
Source IPv4 address (val_sz = 4)
@ ODP_PMR_DIP_ADDR
Destination IPv4 address (val_sz = 4)
@ ODP_PMR_SCTP_SPORT
Source SCTP port (val_sz = 2), implies IPPROTO=132.
@ ODP_PMR_TCP_SPORT
Source TCP port (val_sz = 2)
@ ODP_PMR_IPPROTO
IPv4 Protocol or IPv6 Next Header (val_sz = 1)
@ ODP_PMR_LD_VNI
NVGRE/VXLAN network identifier (val_sz = 4)
@ ODP_PMR_VLAN_ID_X
Last (most inner) VLAN ID (val_sz = 2)
@ ODP_PMR_GTPV1_TEID
GTPv1 tunnel endpoint identifier (val_sz = 4)
@ ODP_PMR_DIP6_ADDR
Destination IPv6 address (val_sz = 16)
@ ODP_PMR_SCTP_DPORT
Destination SCTP port (val_sz = 2), implies IPPROTO=132.
@ ODP_PMR_CUSTOM_FRAME
Custom frame match rule.
@ ODP_PMR_IPSEC_SPI
IPsec session identifier (val_sz = 4)
@ ODP_PMR_UDP_SPORT
Source UDP port (val_sz = 2)
@ ODP_PMR_VLAN_ID_0
First (outer) VLAN ID (val_sz = 2)
@ ODP_PMR_ICMP_ID
ICMP identifier (val_sz = 2), implies IPPROTO=1 and ICMP_TYPE=0 or ICMP_TYPE=8.
@ ODP_PMR_ICMP_CODE
ICMP code (val_sz = 1), implies IPPROTO=1.
@ ODP_PMR_UDP_DPORT
Destination UDP port (val_sz = 2)
@ ODP_PMR_LEN
Total length of received packet.
@ ODP_PMR_DMAC
Destination MAC address (val_sz = 6)
@ ODP_PMR_SIP6_ADDR
Source IPv6 address (val_sz = 16)
@ ODP_PMR_ETHTYPE_X
Ethertype of most inner VLAN tag (val_sz = 2)
@ ODP_PMR_INNER_HDR_OFF
Inner header may repeat above values with this offset.
@ ODP_PMR_CUSTOM_L3
Custom layer 3 match rule.
@ ODP_PMR_IP_DSCP
Differentiated Services Code Point (DSCP) bits in IPv4 or IPv6 header (val_sz = 1)
@ ODP_COS_ACTION_DROP
Drop packet.
@ ODP_COS_ACTION_ENQUEUE
Enqueue packet.
bool odp_bool_t
Boolean type.
odp_support_t
ODP support.
Dummy type for strong typing.
Event aggregator enqueuing profile.
odp_bool_t enable
A boolean to enable Back pressure When true, back pressure is enabled and configured with the BP para...
odp_threshold_t threshold
Threshold value for back pressure.
uint8_t pfc_level
PFC priority level.
Event aggregator related capabilities.
struct odp_cls_aggr_capability_t::@20 enq_profile_type
Supported enqueuing profile types in addition to ODP_AEP_TYPE_NONE, which is always supported.
uint64_t ipv6_frag
IPv6 fragment profile (ODP_AEP_TYPE_IPV6_FRAG)
uint64_t custom
Custom profile (ODP_AEP_TYPE_CUSTOM)
uint64_t ipv4_frag
IPv4 fragment profile (ODP_AEP_TYPE_IPV4_FRAG)
Classification capabilities This capability structure defines system level classification capability.
uint32_t max_pmr
Maximum number of single-term PMRs.
uint64_t max_mark
Maximum value of odp_pmr_create_opt_t::mark.
odp_cls_aggr_capability_t aggr
Event aggregator related capabilities.
uint32_t max_hash_queues
Maximum number of queues supported per CoS.
odp_threshold_types_t threshold_red
Supported threshold type for RED.
odp_support_t back_pressure
Support for Back Pressure to the remote peer.
uint32_t max_terms_per_pmr
Maximum number of terms per composite PMR.
odp_threshold_types_t threshold_bp
Supported threshold type for BP.
odp_cls_pmr_terms_t supported_terms
PMR terms supported by the classifier.
uint32_t max_cos
Maximum number of CoS supported.
odp_support_t random_early_detection
Support for Random Early Detection.
odp_pktin_hash_proto_t hash_protocols
Protocol header combination supported for Hashing.
uint32_t max_cos_stats
Maximum number of concurrent CoS stats.
odp_bool_t pmr_range_supported
A Boolean to denote support of PMR range.
uint32_t max_pmr_per_cos
Maximum number of PMRs per CoS.
odp_cls_stats_capability_t stats
Statistics counters capabilities.
Class of service parameters Used to communicate class of service creation options.
odp_queue_t queue
Mapping used when num_queue = 1, hashing is disabled in this case and application has to configure th...
odp_aggr_enq_profile_t aggr_enq_profile
Event aggregator enqueuing profile.
odp_pool_t pool
Pool associated with CoS.
odp_bool_t stats_enable
Enable statistics.
uint32_t num_queue
Number of queues to be linked to this CoS.
odp_pktin_vector_config_t vector
Packet input vector configuration.
odp_bp_param_t bp
Back Pressure configuration.
odp_queue_param_t queue_param
Queue parameters.
odp_red_param_t red
Random Early Detection configuration.
odp_cos_action_t action
Action to take.
odp_pktin_hash_proto_t hash_proto
Protocol header fields which are included in packet input hash calculation.
Classifier CoS specific statistics counters.
uint64_t errors
Number of packets with errors.
uint64_t octets
Number of octets in classified packets.
uint64_t packets
Number of classified packets, including packets dropped due to drop action.
uint64_t discards
Number of discarded packets due to other reasons than packet errors or drop action.
Classifier queue specific statistics counters.
uint64_t errors
Number of packets with errors.
uint64_t octets
Number of octets in successfully delivered packets.
uint64_t discards
Number of discarded packets due to other reasons (e.g.
uint64_t packets
Number of successfully delivered packets.
Classifier statistics capabilities.
struct odp_cls_stats_capability_t::@13 queue
Queue level capabilities.
uint64_t discards
See odp_cls_cos_stats_t::discards.
uint64_t errors
See odp_cls_cos_stats_t::errors.
struct odp_cls_stats_capability_t::@12::@14::@16 counter
Statistics counters in a bit field structure.
struct odp_cls_stats_capability_t::@12 cos
CoS level capabilities.
uint64_t packets
See odp_cls_cos_stats_t::packets.
uint64_t octets
See odp_cls_cos_stats_t::octets.
uint64_t all_counters
All bits of the bit field structure.
Packet input vector configuration.
Packet Matching Rule creation options.
uint64_t mark
Classification mark value.
int num_terms
Number of terms in the match rule.
odp_pmr_param_t * terms
PMR terms.
Packet Matching Rule parameter structure.
const void * val_start
Start value of the range.
uint32_t offset
Offset to the value.
uint32_t val_sz
Size of the value to be matched.
struct odp_pmr_param_t::@8::@10 match
Parameters for single-valued matches.
const void * value
Points to the value to be matched.
odp_bool_t range_term
True if the value is range and false if match.
const void * mask
Mask of the bits to be matched.
odp_cls_pmr_term_t term
Packet Matching Rule term.
const void * val_end
End value of the range.
struct odp_pmr_param_t::@8::@11 range
Parameter for range value matches.
Random Early Detection (RED) Random Early Detection is enabled to initiate a drop probability for the...
odp_threshold_t threshold
Threshold parameters for RED RED is enabled when the resource usage is equal to or greater than the m...
odp_bool_t enable
A boolean to enable RED When true, RED is enabled and configured with RED parameters.
ODP threshold API - platform specific header.
Supported PMR term values.
uint64_t vlan_pcp_0
PCP in the first VLAN header (ODP_PMR_VLAN_PCP_0)
uint64_t dip_addr
Destination IP address.
uint64_t udp_dport
Destination UDP port, implies IPPROTO=17.
uint64_t dmac
destination MAC address
uint64_t tcp_dport
Destination TCP port implies IPPROTO=6.
uint64_t ld_vni
NVGRE/VXLAN network identifier.
uint64_t sip_addr
Source IP address.
uint64_t icmp_id
ICMP identifier, implies IPPROTO=1 and ICMP_TYPE=0 or ICMP_TYPE=8.
uint64_t igmp_grp_addr
IGMP Group address, implies IPPROTO=2.
uint64_t ipsec_spi
IPsec session identifier.
uint64_t vlan_id_0
First VLAN ID (outer)
uint64_t custom_l3
Custom layer 3 match rule.
uint64_t custom_frame
Custom frame match rule.
uint64_t ethtype_0
Initial (outer) Ethertype only.
uint64_t udp_sport
Source UDP Port.
uint64_t sip6_addr
Source IP address.
uint64_t ip_proto
IP Protocol or IPv6 Next Header.
uint64_t dip6_addr
Destination IP address.
uint64_t ethtype_x
Ethertype of most inner VLAN tag.
uint64_t ip_dscp
DSCP in IP header (ODP_PMR_IP_DSCP)
uint64_t icmp_type
ICMP type, implies IPPROTO=1.
uint64_t all_bits
All bits of the bit field structure.
uint64_t sctp_sport
Source SCTP port, implies IPPROTO=132.
uint64_t tcp_sport
Source TCP port.
struct odp_cls_pmr_terms_t::@7 bit
Packet Matching Rule term fields.
uint64_t icmp_code
ICMP code, implies IPPROTO=1.
uint64_t vlan_id_x
Last VLAN ID (inner)
uint64_t sctp_dport
Destination SCTP port, implies IPPROTO=132.
uint64_t gtpv1_teid
GTPv1 tunnel endpoint identifier.
uint64_t len
Total length of received packet.
Packet input hash protocols.
Supported threshold types.