API Reference Manual  1.45.0
ODP CLASSIFICATION

API Description

Packet input classification.

Data Structures

union  odp_cls_pmr_terms_t
 Supported PMR term values. More...
 
struct  odp_pmr_param_t
 Packet Matching Rule parameter structure. More...
 
struct  odp_pmr_create_opt_t
 Packet Matching Rule creation options. More...
 
struct  odp_red_param_t
 Random Early Detection (RED) Random Early Detection is enabled to initiate a drop probability for the incoming packet when the packets in the queue/pool cross the specified threshold values. More...
 
struct  odp_bp_param_t
 Back pressure (BP) When back pressure is enabled for a particular flow, the HW can send back pressure information to the remote peer indicating a network congestion. More...
 
struct  odp_cls_cos_stats_t
 Classifier CoS specific statistics counters. More...
 
struct  odp_cls_queue_stats_t
 Classifier queue specific statistics counters. More...
 
struct  odp_cls_stats_capability_t
 Classifier statistics capabilities. More...
 
struct  odp_cls_capability_t
 Classification capabilities This capability structure defines system level classification capability. More...
 
struct  odp_cls_cos_param
 Class of service parameters Used to communicate class of service creation options. More...
 

Macros

#define ODP_COS_INVALID   ((odp_cos_t)0)
 Invalid class of service handle.
 
#define ODP_PMR_INVALID   ((odp_pmr_t)0)
 Invalid packet matching rule handle.
 
#define ODP_COS_NAME_LEN   32
 Maximum class of service name length, including the null character.
 

Typedefs

typedef _odp_abi_cos_todp_cos_t
 Class of service handle.
 
typedef _odp_abi_pmr_todp_pmr_t
 Packet matching rule handle.
 
typedef union odp_cls_pmr_terms_t odp_cls_pmr_terms_t
 Supported PMR term values. More...
 
typedef struct odp_pmr_param_t odp_pmr_param_t
 Packet Matching Rule parameter structure. More...
 
typedef struct odp_pmr_create_opt_t odp_pmr_create_opt_t
 Packet Matching Rule creation options.
 
typedef 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 incoming packet when the packets in the queue/pool cross the specified threshold values. More...
 
typedef struct odp_bp_param_t odp_bp_param_t
 Back pressure (BP) When back pressure is enabled for a particular flow, the HW can send back pressure information to the remote peer indicating a network congestion.
 
typedef struct odp_cls_cos_stats_t odp_cls_cos_stats_t
 Classifier CoS specific statistics counters. More...
 
typedef struct odp_cls_queue_stats_t odp_cls_queue_stats_t
 Classifier queue specific statistics counters. More...
 
typedef struct odp_cls_stats_capability_t odp_cls_stats_capability_t
 Classifier statistics capabilities.
 
typedef struct odp_cls_capability_t odp_cls_capability_t
 Classification capabilities This capability structure defines system level classification capability.
 
typedef struct odp_cls_cos_param odp_cls_cos_param_t
 Class of service parameters Used to communicate class of service creation options.
 

Enumerations

enum  odp_cls_pmr_term_t {
  ODP_PMR_LEN , ODP_PMR_ETHTYPE_0 , ODP_PMR_ETHTYPE_X , ODP_PMR_VLAN_ID_0 ,
  ODP_PMR_VLAN_ID_X , ODP_PMR_VLAN_PCP_0 , ODP_PMR_DMAC , ODP_PMR_IPPROTO ,
  ODP_PMR_IP_DSCP , ODP_PMR_UDP_DPORT , ODP_PMR_TCP_DPORT , ODP_PMR_UDP_SPORT ,
  ODP_PMR_TCP_SPORT , ODP_PMR_SIP_ADDR , ODP_PMR_DIP_ADDR , ODP_PMR_SIP6_ADDR ,
  ODP_PMR_DIP6_ADDR , ODP_PMR_IPSEC_SPI , ODP_PMR_LD_VNI , ODP_PMR_CUSTOM_FRAME ,
  ODP_PMR_CUSTOM_L3 , ODP_PMR_IGMP_GRP_ADDR , ODP_PMR_ICMP_ID , ODP_PMR_ICMP_TYPE ,
  ODP_PMR_ICMP_CODE , ODP_PMR_SCTP_SPORT , ODP_PMR_SCTP_DPORT , ODP_PMR_GTPV1_TEID ,
  ODP_PMR_INNER_HDR_OFF = 32
}
 Packet Matching Rule terms. More...
 
enum  odp_cos_action_t { ODP_COS_ACTION_ENQUEUE , ODP_COS_ACTION_DROP }
 Enumeration of actions for CoS. More...
 

Functions

void odp_cls_cos_param_init (odp_cls_cos_param_t *param)
 Initialize class of service parameters. More...
 
int odp_cls_capability (odp_cls_capability_t *capability)
 Query classification capabilities. More...
 
odp_cos_t odp_cls_cos_create (const char *name, const odp_cls_cos_param_t *param)
 Create a class-of-service. More...
 
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. More...
 
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 on the packet parameters and hash protocol field configured with the class of service. More...
 
int odp_cos_destroy (odp_cos_t cos)
 Discard a class-of-service along with all its associated resources. More...
 
int odp_cos_destroy_multi (odp_cos_t cos[], int num)
 Destroy multiple class-of-services. More...
 
int odp_cos_queue_set (odp_cos_t cos, odp_queue_t queue)
 Assign a queue for a class-of-service. More...
 
odp_queue_t odp_cos_queue (odp_cos_t cos)
 Get the queue associated with the specific class-of-service. More...
 
uint32_t odp_cls_cos_num_queue (odp_cos_t cos)
 Get the number of queues linked with the specific class-of-service. More...
 
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. More...
 
int odp_cls_cos_stats (odp_cos_t cos, odp_cls_cos_stats_t *stats)
 Get statistics for a CoS. More...
 
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. More...
 
void odp_cls_pmr_param_init (odp_pmr_param_t *param)
 Initialize packet matching rule parameters. More...
 
void odp_cls_pmr_create_opt_init (odp_pmr_create_opt_t *opt)
 Initialize packet matching rule creation option. More...
 
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) More...
 
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. More...
 
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. More...
 
int odp_cls_pmr_destroy (odp_pmr_t pmr)
 Function to destroy a packet match rule. More...
 
int odp_cls_pmr_destroy_multi (odp_pmr_t pmr[], int num)
 Destroy multiple packet matching rules. More...
 
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. More...
 
odp_pool_t odp_cls_cos_pool (odp_cos_t cos)
 Get the pool associated with the given class of service. More...
 
uint64_t odp_cos_to_u64 (odp_cos_t cos)
 Get printable value for an odp_cos_t. More...
 
uint64_t odp_pmr_to_u64 (odp_pmr_t pmr)
 Get printable value for an odp_pmr_t. More...
 
void odp_cls_print_all (void)
 Print classifier info. More...
 

Typedef Documentation

◆ odp_cls_pmr_terms_t

Supported PMR term values.

Supported Packet Matching Rule term values in a bit field structure.

◆ odp_pmr_param_t

Packet Matching Rule parameter structure.

Match value/mask size and endianness are defined in PMR term documentation (see odp_cls_pmr_term_t). Most values and masks are passed in big endian format without data alignment requirement. ODP_PMR_LEN is an exception to this (uint32_t in CPU endian).

◆ odp_red_param_t

Random Early Detection (RED) Random Early Detection is enabled to initiate a drop probability for the incoming packet when the packets in the queue/pool cross the specified threshold values.

RED is enabled when 'red_enable' boolean is true and the resource usage is equal to or greater than the minimum threshold value. Resource usage could be defined either as the percentage of pool being full or the number of packets/bytes occupied in the queue depending on the platform capabilities.

When RED is enabled for a particular flow then further incoming packets are assigned a drop probability based on the size of the pool/queue.

Drop probability is configured as follows

  • Drop probability is 100%, when resource usage >= threshold.max
  • Drop probability is 0%, when resource usage <= threshold.min
  • Drop probability is between 0...100 % when resource usage is between threshold.min and threshold.max

RED is logically configured in the CoS and could be implemented in either pool or queue linked to the CoS depending on platform capabilities. Application should make sure not to link multiple CoS with different RED or BP configuration to the same queue or pool.

◆ odp_cls_cos_stats_t

Classifier CoS specific statistics counters.

Counters are incremented per packet classified to the CoS. In a CoS chain, counters are incremented in every CoS for which counters are enabled.

◆ odp_cls_queue_stats_t

Classifier queue specific statistics counters.

Counters are incremented per packet destined to the queue per originating CoS. Note that a single queue can be a destination for multiple CoS's.

Enumeration Type Documentation

◆ odp_cls_pmr_term_t

Packet Matching Rule terms.

This enumeration selects the protocol field that is matched against PMR value/mask or value range. Protocol field values and masks are passed in big endian (network endian) format. However, ODP_PMR_LEN value and range are passed in CPU native endian (uint32_t words), as the term does not represent a protocol field.

PMR value/mask data size is term specific. This size must be set into val_sz field of odp_pmr_param_t. There is no alignment requirement for PMR value/mask data.

Enumerator
ODP_PMR_LEN 

Total length of received packet.

Exceptionally, value and mask are uint32_t (val_sz = 4) in CPU endian.

ODP_PMR_ETHTYPE_0 

Initial (outer) Ethertype only (val_sz = 2)

PMR matches Ethertype field when packet does not have VLAN headers. When there are
VLAN headers, it matches Tag protocol identifier (TPID) field of the first VLAN header.
I.e. it matches a field in the same offset from the start of the packet in both cases.
ODP_PMR_ETHTYPE_X 

Ethertype of most inner VLAN tag (val_sz = 2)

ODP_PMR_VLAN_ID_0 

First (outer) VLAN ID (val_sz = 2)

VLAN ID value and mask are stored into 12 least significant bits of a 16-bit word.
The word is passed in big endian format.
ODP_PMR_VLAN_ID_X 

Last (most inner) VLAN ID (val_sz = 2)

VLAN ID value and mask are stored into 12 least significant bits of a 16-bit word.
The word is passed in big endian format.
ODP_PMR_VLAN_PCP_0 

PCP bits in the first (outer) VLAN header (val_sz = 1)

Priority Code Point (PCP) value is stored into three least significant bits of
the octet pointed by odp_pmr_param_t::value. The same applies for odp_pmr_param_t::mask.
ODP_PMR_DMAC 

Destination MAC address (val_sz = 6)

ODP_PMR_IPPROTO 

IPv4 Protocol or IPv6 Next Header (val_sz = 1)

ODP_PMR_IP_DSCP 

Differentiated Services Code Point (DSCP) bits in IPv4 or IPv6 header (val_sz = 1)

DSCP value is stored into six least significant bits of the octet pointed by
odp_pmr_param_t::value. The same applies for odp_pmr_param_t::mask.
ODP_PMR_UDP_DPORT 

Destination UDP port (val_sz = 2)

ODP_PMR_TCP_DPORT 

Destination TCP port (val_sz = 2)

ODP_PMR_UDP_SPORT 

Source UDP port (val_sz = 2)

ODP_PMR_TCP_SPORT 

Source TCP port (val_sz = 2)

ODP_PMR_SIP_ADDR 

Source IPv4 address (val_sz = 4)

ODP_PMR_DIP_ADDR 

Destination IPv4 address (val_sz = 4)

ODP_PMR_SIP6_ADDR 

Source IPv6 address (val_sz = 16)

ODP_PMR_DIP6_ADDR 

Destination IPv6 address (val_sz = 16)

ODP_PMR_IPSEC_SPI 

IPsec session identifier (val_sz = 4)

ODP_PMR_LD_VNI 

NVGRE/VXLAN network identifier (val_sz = 4)

ODP_PMR_CUSTOM_FRAME 

Custom frame match rule.

PMR offset is counted from the start of the packet. The match is defined by the offset, the expected value, and its size. Custom frame rules must be applied before any other PMR.

ODP_PMR_CUSTOM_L3 

Custom layer 3 match rule.

PMR offset is counted from the start of layer 3 in the packet. The match is defined by the offset, the expected value, and its size. Custom L3 rules may be combined with other PMRs.

ODP_PMR_IGMP_GRP_ADDR 

IGMP Group address (val_sz = 4), implies IPPROTO=2.

ODP_PMR_ICMP_ID 

ICMP identifier (val_sz = 2), implies IPPROTO=1 and ICMP_TYPE=0 or ICMP_TYPE=8.

ODP_PMR_ICMP_TYPE 

ICMP type (val_sz = 1), implies IPPROTO=1.

ODP_PMR_ICMP_CODE 

ICMP code (val_sz = 1), implies IPPROTO=1.

ODP_PMR_SCTP_SPORT 

Source SCTP port (val_sz = 2), implies IPPROTO=132.

ODP_PMR_SCTP_DPORT 

Destination SCTP port (val_sz = 2), implies IPPROTO=132.

ODP_PMR_GTPV1_TEID 

GTPv1 tunnel endpoint identifier (val_sz = 4)

Matches if and only if IP protocol is UDP, UDP destination port is 2152 and the UDP payload interpreted as GTP header has GTP version 1 and TEID as specified.

ODP_PMR_INNER_HDR_OFF 

Inner header may repeat above values with this offset.

Definition at line 68 of file api/spec/classification.h.

◆ odp_cos_action_t

Enumeration of actions for CoS.

Enumerator
ODP_COS_ACTION_ENQUEUE 

Enqueue packet.

Packets that arrive in the CoS are enqueued to a destination queue.

ODP_COS_ACTION_DROP 

Drop packet.

Packets that arrive in the CoS are dropped. Packets are freed into their originating pool.

Definition at line 593 of file api/spec/classification.h.

Function Documentation

◆ odp_cls_cos_param_init()

void odp_cls_cos_param_init ( odp_cls_cos_param_t param)

Initialize class of service parameters.

Initialize an odp_cls_cos_param_t to its default value for all fields

Parameters
paramAddress of the odp_cls_cos_param_t to be initialized
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cls_capability()

int odp_cls_capability ( odp_cls_capability_t capability)

Query classification capabilities.

Outputs classification capabilities on success.

Parameters
[out]capabilityPointer to classification capability structure.
Return values
0on success
<0on failure
Examples
odp_bench_pktio_sp.c, and odp_sysinfo.c.

◆ odp_cls_cos_create()

odp_cos_t odp_cls_cos_create ( const char *  name,
const odp_cls_cos_param_t param 
)

Create a class-of-service.

Depending on the action parameter, packets to the CoS are either enqueued to a destination queue, or dropped.

The use of class-of-service name is optional. Unique names are not required. Use odp_cls_cos_param_init() to initialize parameters into their default values.

Parameters
nameName of the class-of-service or NULL. Maximum string length is ODP_COS_NAME_LEN, including the null character.
paramClass-of-service parameters
Return values
Class-of-servicehandle
ODP_COS_INVALIDon failure.
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cls_cos_create_multi()

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.

Otherwise like odp_cls_cos_create(), but creates multiple CoSes with a single call. The output CoS handles are written in the same order as input parameters. A single odp_cls_cos_create_multi() call is equivalent to calling odp_cls_cos_create() 'num' times in row.

Each parameter array must contain 'num' elements with the exception that 'name' array may also be NULL.

Parameters
nameArray of CoS name pointers or NULL. NULL is also valid CoS name pointer value.
paramArray of CoS parameters
[out]cosArray of CoS handles for output
numNumber of CoSes to create
Returns
Number of CoSes actually created (0 ... num)
Return values
<0on failure

◆ odp_cls_hash_result()

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 on the packet parameters and hash protocol field configured with the class of service.

Parameters
cosCoS handle
packetPacket handle
Return values
Returnsthe queue handle on which this packet will be enqueued.
ODP_QUEUE_INVALIDfor error case
Note
The packet has to be updated with valid header pointers L2, L3 and L4.

◆ odp_cos_destroy()

int odp_cos_destroy ( odp_cos_t  cos)

Discard a class-of-service along with all its associated resources.

Before destroying a CoS, all the PMRs referring to the CoS (as a source or destination CoS) must be destroyed first. Also, the CoS must not be in use as the default CoS in any pktio (see odp_pktio_default_cos_set()) or as the destination CoS of any IPsec SA.

Parameters
cosCoS handle
Return values
0on success
<0on failure
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cos_destroy_multi()

int odp_cos_destroy_multi ( odp_cos_t  cos[],
int  num 
)

Destroy multiple class-of-services.

Otherwise like odp_cos_destroy(), but destroys multiple CoSes with a single call.

Parameters
cosArray of CoS handles
numNumber of CoSes to destroy
Return values
Numberof CoSes actually destroyed (1 ... num)
<0on failure

◆ odp_cos_queue_set()

int odp_cos_queue_set ( odp_cos_t  cos,
odp_queue_t  queue 
)

Assign a queue for a class-of-service.

Action of the given CoS may not be ODP_COS_ACTION_DROP.

Parameters
cosCoS handle
queueHandle of the queue where all packets of this specific class of service will be enqueued. Must not be ODP_QUEUE_INVALID.
Return values
0on success
<0on failure

◆ odp_cos_queue()

odp_queue_t odp_cos_queue ( odp_cos_t  cos)

Get the queue associated with the specific class-of-service.

Parameters
cosCoS handle
Return values
Queuehandle associated with the given class-of-service
ODP_QUEUE_INVALIDon failure, or if there are multiple queues, or if the CoS action is ODP_COS_ACTION_DROP.

◆ odp_cls_cos_num_queue()

uint32_t odp_cls_cos_num_queue ( odp_cos_t  cos)

Get the number of queues linked with the specific class-of-service.

Parameters
cosCoS handle
Returns
Number of queues linked with the class-of-service.

◆ odp_cls_cos_queues()

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.

Parameters
cosCoS handle
[out]queueArray of queue handles associated with the class-of-service.
numMaximum number of queue handles to output.
Returns
Number of queues linked with CoS
Return values
0on failure

◆ odp_cls_cos_stats()

int odp_cls_cos_stats ( odp_cos_t  cos,
odp_cls_cos_stats_t stats 
)

Get statistics for a CoS.

The statistics counters are incremented for packets classified to the given CoS.

Counters that are not supported are set to zero.

It's implementation defined if odp_pktio_stats_reset() call affects these counters.

Parameters
cosCoS handle
[out]statsStatistics structure for output
Return values
0on success
<0on failure

◆ odp_cls_queue_stats()

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.

The statistics counters are incremented only for packets originating from the given CoS. Queue handles can be requested with odp_cos_queue() and odp_cls_cos_queues().

Counters not supported by the queue are set to zero.

It's implementation defined if odp_pktio_stats_reset() call affects these counters.

Parameters
cosCoS handle
queueQueue handle
[out]statsStatistics structure for output
Return values
0on success
<0on failure

◆ odp_cls_pmr_param_init()

void odp_cls_pmr_param_init ( odp_pmr_param_t param)

Initialize packet matching rule parameters.

Initialize an odp_pmr_param_t to its default values for all fields

Parameters
paramAddress of the odp_pmr_param_t to be initialized
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cls_pmr_create_opt_init()

void odp_cls_pmr_create_opt_init ( odp_pmr_create_opt_t opt)

Initialize packet matching rule creation option.

Initialize an odp_pmr_create_opt_t to its default values for all fields

Parameters
optAddress of the odp_pmr_create_opt_t to be initialized

◆ odp_cls_pmr_create()

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)

Creates a PMR between source and destination Class of Service (CoS). A packet arriving to a CoS is matched against all the PMRs that define it as their source CoS. A PMR match moves the packet from the source to the destination CoS. If multiple PMRs of a CoS match with the packet, it is implementation specific which PMR is selected.

A composite PMR is created when PMR parameters define more than one term. A composite PMR is considered to match only if a packet matches with all its terms. It is implementation specific which term combinations are supported as composite PMRs. When creating a composite PMR, application should check the return value and perform appropriate fallback actions if the create call returns failure. See odp_cls_capability_t::max_pmr and odp_cls_capability_t::max_terms_per_pmr for related capabilities.

Use odp_cls_pmr_param_init() to initialize parameters into their default values.

PMRs created with this function are equivant to PMRs created through odp_cls_pmr_create_opt() with the same PMR terms and with all additional options set to their default values (e.g. CLS mark is set to zero in all matching packets).

Parameters
termsArray of odp_pmr_param_t entries, one entry per term
num_termsNumber of terms in the PMR.
src_cossource CoS handle
dst_cosdestination CoS handle
Returns
PMR handle on success
Return values
ODP_PMR_INVALIDon failure
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cls_pmr_create_opt()

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.

Similar to odp_cls_pmr_create() function with additional PMR creation options specified through odp_pmr_create_opt_t.

Use odp_cls_pmr_create_opt_init() to initialize options into their default values.

Parameters
optpoints to PMR create options
src_cossource CoS handle
dst_cosdestination CoS handle
Returns
Handle to the Packet Match Rule.
Return values
ODP_PMR_INVALIDon failure

◆ odp_cls_pmr_create_multi()

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.

Otherwise like odp_cls_pmr_create_opt(), but creates multiple rules with a single call. The output PMR handles are written in the same order as input parameters. A single odp_cls_pmr_create_multi() call is equivalent to calling odp_cls_pmr_create_opt() 'num' times in row.

Each parameter array must contain 'num' elements.

Parameters
optArray of PMR create options
src_cosArray of source CoS handles
dst_cosArray of destination CoS handles
[out]pmrArray of PMR handles for output
numNumber of packet matching rules to create
Returns
Number of PMRs actually created (0 ... num)
Return values
<0on failure

◆ odp_cls_pmr_destroy()

int odp_cls_pmr_destroy ( odp_pmr_t  pmr)

Function to destroy a packet match rule.

Destroying a PMR removes the link between the source and destination class of service and this PMR will no longer be applied for packets arriving at the source class of service. All the resources associated with the PMR will be released but the class of service will remain intact.

Depending on the implementation details, destroying a composite rule may not guarantee the availability of hardware resources to create the same or essentially similar rule.

Parameters
pmrHandle of the PMR to be destroyed
Return values
0on success
<0on failure
Examples
odp_bench_pktio_sp.c, and odp_classifier.c.

◆ odp_cls_pmr_destroy_multi()

int odp_cls_pmr_destroy_multi ( odp_pmr_t  pmr[],
int  num 
)

Destroy multiple packet matching rules.

Otherwise like odp_cls_pmr_destroy(), but destroys multiple PMRs with a single call.

Parameters
pmrArray of PMR handles
numNumber of PMRs to destroy
Return values
Numberof PMRs actually destroyed (1 ... num)
<0on failure

◆ odp_cls_cos_pool_set()

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.

All the packets belonging to the given class of service will be allocated from the assigned packet pool. The packet pool associated with class of service will supersede the packet pool associated with the pktio interface.

Parameters
cosCoS handle
pool_idPacket pool handle
Return values
0on success
<0on failure

◆ odp_cls_cos_pool()

odp_pool_t odp_cls_cos_pool ( odp_cos_t  cos)

Get the pool associated with the given class of service.

Parameters
cosCoS handle
Return values
poolhandle of the associated pool
ODP_POOL_INVALIDon failure, or if the pool has not been set

◆ odp_cos_to_u64()

uint64_t odp_cos_to_u64 ( odp_cos_t  cos)

Get printable value for an odp_cos_t.

Parameters
cosCoS handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_cos_t handle.

◆ odp_pmr_to_u64()

uint64_t odp_pmr_to_u64 ( odp_pmr_t  pmr)

Get printable value for an odp_pmr_t.

Parameters
pmrodp_pmr_t handle to be printed
Returns
uint64_t value that can be used to print/display this handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to generate a printable value that represents an odp_pmr_t handle.

◆ odp_cls_print_all()

void odp_cls_print_all ( void  )

Print classifier info.

Print implementation defined information about classifier. The information is intended to be used for debugging.

Examples
odp_classifier.c.