diff options
author | Balasubramanian Manoharan <bala.manoharan@linaro.org> | 2014-12-08 17:32:56 +0530 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-12-10 16:09:13 +0300 |
commit | 5b0cb951dc3d9732496cb7d18cd0c9fe5d6375c6 (patch) | |
tree | 132f08ca4913a1e6abc7ade9f5a5894407de087b /platform/linux-generic/include | |
parent | 08c99facf9962c0dd2d0ef2e4b4e21cee2d6735c (diff) |
linux-generic: classification initial implementation
The following features are implemented in this classification implementation:
* Attaches PMR, PMR_SET to a Pktio entry
* Adds classifier object to pktio entry
* Attaches CoS values for L2 and L3 QoS to a Pktio entry
* Selects ClassOfService for a packet based on PMR, L2 QoS and L3 QoS values
* Selects a default CoS if packet does not match any of the assigned rules
* Selects an Error CoS for an Error packet
* Enqueues the packet to the queue associated with the selected CoS
Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include')
7 files changed, 647 insertions, 0 deletions
diff --git a/platform/linux-generic/include/api/odp.h b/platform/linux-generic/include/api/odp.h index 6e4f69e51..b7b1ca996 100644 --- a/platform/linux-generic/include/api/odp.h +++ b/platform/linux-generic/include/api/odp.h @@ -47,6 +47,7 @@ extern "C" { #include <odp_packet_flags.h> #include <odp_packet_io.h> #include <odp_crypto.h> +#include <odp_classification.h> #include <odp_rwlock.h> #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp_buffer_pool_internal.h b/platform/linux-generic/include/odp_buffer_pool_internal.h index e0210bdd2..07602feb9 100644 --- a/platform/linux-generic/include/odp_buffer_pool_internal.h +++ b/platform/linux-generic/include/odp_buffer_pool_internal.h @@ -22,6 +22,7 @@ extern "C" { #include <odp_buffer_pool.h> #include <odp_buffer_internal.h> #include <odp_align.h> +#include <odp_align_internal.h> #include <odp_hints.h> #include <odp_config.h> #include <odp_debug.h> @@ -64,6 +65,10 @@ struct pool_entry_s { size_t hdr_size; }; +typedef union pool_entry_u { + struct pool_entry_s s; + uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pool_entry_s))]; +} pool_entry_t; extern void *pool_entry_ptr[]; @@ -73,6 +78,10 @@ static inline void *get_pool_entry(uint32_t pool_id) return pool_entry_ptr[pool_id]; } +static inline uint32_t pool_handle_to_index(odp_buffer_pool_t pool_hdl) +{ + return pool_hdl - 1; +} static inline odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf) { diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h new file mode 100644 index 000000000..18846bc2e --- /dev/null +++ b/platform/linux-generic/include/odp_classification_datamodel.h @@ -0,0 +1,201 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP Classification Datamodel + * Describes the classification internal data model + */ + +#ifndef ODP_CLASSIFICATION_DATAMODEL_H_ +#define ODP_CLASSIFICATION_DATAMODEL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp_spinlock.h> +#include <odp_classification.h> +#include <odp_buffer_pool_internal.h> +#include <odp_packet_internal.h> +#include <odp_packet_io_internal.h> +#include <odp_queue_internal.h> + +/* Maximum Class Of Service Entry */ +#define ODP_COS_MAX_ENTRY 64 +/* Maximum PMR Set Entry */ +#define ODP_PMRSET_MAX_ENTRY 64 +/* Maximum PMR Entry */ +#define ODP_PMR_MAX_ENTRY 64 +/* Maximum PMR Terms in a PMR Set */ +#define ODP_PMRTERM_MAX 8 +/* Maximum PMRs attached in PKTIO Level */ +#define ODP_PKTIO_MAX_PMR 8 +/* L2 Priority Bits */ +#define ODP_COS_L2_QOS_BITS 3 +/* Max L2 QoS value */ +#define ODP_COS_MAX_L2_QOS (1 << ODP_COS_L2_QOS_BITS) +/* L2 DSCP Bits */ +#define ODP_COS_L3_QOS_BITS 6 +/* Max L3 QoS Value */ +#define ODP_COS_MAX_L3_QOS (1 << ODP_COS_L3_QOS_BITS) +/* Max PMR Term bits */ +#define ODP_PMR_TERM_BYTES_MAX 8 + +/* forward declaration */ +typedef union pmr_u pmr_t; + +/** +Packet Matching Rule Term Value + +Stores the Term and Value mapping for a PMR. +The maximum size of value currently supported in 64 bits +**/ +typedef struct pmr_term_value { + odp_pmr_match_type_e match_type; /**< Packet Match Type*/ + odp_pmr_term_e term; /* PMR Term */ + union { + struct { + uint64_t val; + uint64_t mask; + } mask; /**< Match a masked set of bits */ + struct { + uint64_t val1; + uint64_t val2; + } range; /**< Match an integer range */ + }; +} pmr_term_value_t; + +typedef union cos_u cos_t; +/* +Class Of Service +*/ +struct cos_s { + queue_entry_t *queue; /* Associated Queue */ + pool_entry_t *pool; /* Associated Buffer pool */ + pmr_t *pmr; /* Chained PMR */ + cos_t *linked_cos; /* CoS linked with the PMR */ + uint32_t valid; /* validity Flag */ + odp_drop_e drop_policy; /* Associated Drop Policy */ + odp_queue_group_t queue_group; /* Associated Queue Group */ + odp_cos_flow_set_t flow_set; /* Assigned Flow Set */ + char name[ODP_COS_NAME_LEN]; /* name */ + size_t headroom; /* Headroom for this CoS */ + odp_spinlock_t lock; /* cos lock */ +}; + +typedef union cos_u { + struct cos_s s; + uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct cos_s))]; +} cos_t; + + +/** +Packet Matching Rule + +**/ +struct pmr_s { + uint32_t valid; /* Validity Flag */ + odp_atomic_u32_t count; /* num of packets matching this rule */ + uint32_t num_pmr; /* num of PMR Term Values*/ + odp_spinlock_t lock; /* pmr lock*/ + pmr_term_value_t pmr_term_value[1]; /* Associated PMR Term */ +}; + +typedef union pmr_u { + struct pmr_s s; + uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pmr_s))]; +} pmr_t; + +/** +Packet Matching Rule Set + +This structure is implemented as a extension over struct pmr_s +In order to use same pointer to access both pmr_s and pmr_set_s +'num_pmr' value is used to differentiate between pmr_s and pmr_set_s struct +**/ +struct pmr_set_s { + pmr_t pmr; + pmr_term_value_t pmr_term_value[ODP_PMRTERM_MAX - 1]; + /* List of associated PMR Terms */ +}; + +typedef union pmr_set_u { + struct pmr_set_s s; + uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pmr_set_s))]; +} pmr_set_t; + +/** +L2 QoS and CoS Map + +This structure holds the mapping between L2 QoS value and +corresponding cos_t object +**/ +typedef struct pmr_l2_cos { + odp_spinlock_t lock; /* pmr_l2_cos lock */ + cos_t *cos[ODP_COS_MAX_L2_QOS]; /* Array of CoS objects */ +} pmr_l2_cos_t; + +/** +L3 QoS and CoS Map + +This structure holds the mapping between L3 QoS value and +corresponding cos_t object +**/ +typedef struct pmr_l3_cos { + odp_spinlock_t lock; /* pmr_l3_cos lock */ + cos_t *cos[ODP_COS_MAX_L3_QOS]; /* Array of CoS objects */ +} pmr_l3_cos_t; + +/** +Linux Generic Classifier + +This structure is stored in pktio_entry and holds all +the classifier configuration value. +**/ +typedef struct classifier { + odp_spinlock_t lock; /*pktio_cos lock */ + uint32_t num_pmr; /* num of PMRs linked to given PKTIO*/ + pmr_t *pmr[ODP_PKTIO_MAX_PMR]; /* PMRs linked with this PKTIO */ + cos_t *cos[ODP_PKTIO_MAX_PMR]; /* CoS linked with this PKTIO */ + cos_t *error_cos; /* Associated Error CoS */ + cos_t *default_cos; /* Associated Default CoS */ + uint32_t l3_precedence; /* L3 QoS precedence */ + pmr_l2_cos_t l2_cos_table; /* L2 QoS-CoS table map */ + pmr_l3_cos_t l3_cos_table; /* L3 Qos-CoS table map */ + odp_cos_flow_set_t flow_set; /* Flow Set to be calculated + for this pktio */ + size_t headroom; /* Pktio Headroom */ + size_t skip; /* Pktio Skip Offset */ +} classifier_t; + +/** +Class of Service Table +**/ +typedef struct odp_cos_table { + cos_t cos_entry[ODP_COS_MAX_ENTRY]; +} cos_tbl_t; + +/** +PMR set table +**/ +typedef struct pmr_set_tbl { + pmr_set_t pmr_set[ODP_PMRSET_MAX_ENTRY]; +} pmr_set_tbl_t; + +/** +PMR table +**/ +typedef struct pmr_tbl { + pmr_t pmr[ODP_PMR_MAX_ENTRY]; +} pmr_tbl_t; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h new file mode 100644 index 000000000..6b2011972 --- /dev/null +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -0,0 +1,259 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP Classification Inlines + * Classification Inlines Functions + */ +#ifndef __ODP_CLASSIFICATION_INLINES_H_ +#define __ODP_CLASSIFICATION_INLINES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp_debug.h> +#include <odph_eth.h> +#include <odph_ip.h> +#include <odph_udp.h> +#include <odph_tcp.h> + +/* PMR term value verification function +These functions verify the given PMR term value with the value in the packet +These following functions return 1 on success and 0 on failure +*/ + +static inline int verify_pmr_packet_len(odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (pkt_hdr->frame_len & + term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= pkt_hdr->frame_len) && + (pkt_hdr->frame_len <= term_value->range.val2)) + return 1; + } + return 0; +} +static inline int verify_pmr_ip_proto(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + odph_ipv4hdr_t *ip; + uint8_t proto; + if (!pkt_hdr->input_flags.ipv4) + return 0; + ip = (odph_ipv4hdr_t *)(pkt_addr + pkt_hdr->l3_offset); + proto = ip->proto; + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (proto & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= proto) && + (proto <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_ipv4_saddr(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + odph_ipv4hdr_t *ip; + uint32_t ipaddr; + if (!pkt_hdr->input_flags.ipv4) + return 0; + ip = (odph_ipv4hdr_t *)(pkt_addr + pkt_hdr->l3_offset); + ipaddr = odp_be_to_cpu_32(ip->src_addr); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (ipaddr & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= ipaddr) && + (ipaddr <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_ipv4_daddr(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + odph_ipv4hdr_t *ip; + uint32_t ipaddr; + if (!pkt_hdr->input_flags.ipv4) + return 0; + ip = (odph_ipv4hdr_t *)(pkt_addr + pkt_hdr->l3_offset); + ipaddr = odp_be_to_cpu_32(ip->dst_addr); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (ipaddr & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= ipaddr) && + (ipaddr <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_tcp_sport(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + uint16_t sport; + odph_tcphdr_t *tcp; + if (!pkt_hdr->input_flags.tcp) + return 0; + tcp = (odph_tcphdr_t *)(pkt_addr + pkt_hdr->l4_offset); + sport = odp_be_to_cpu_16(tcp->src_port); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (sport & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= sport) && + (sport <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_tcp_dport(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + uint16_t dport; + odph_tcphdr_t *tcp; + if (!pkt_hdr->input_flags.tcp) + return 0; + tcp = (odph_tcphdr_t *)(pkt_addr + pkt_hdr->l4_offset); + dport = odp_be_to_cpu_16(tcp->dst_port); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (dport & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= dport) && + (dport <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_udp_dport(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + uint16_t dport; + odph_udphdr_t *udp; + if (!pkt_hdr->input_flags.udp) + return 0; + udp = (odph_udphdr_t *)(pkt_addr + pkt_hdr->l4_offset); + dport = odp_be_to_cpu_16(udp->dst_port); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (dport & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= dport) && + (dport <= term_value->range.val2)) + return 1; + } + return 0; +} +static inline int verify_pmr_udp_sport(uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr, + pmr_term_value_t *term_value) +{ + uint16_t sport; + odph_udphdr_t *udp; + if (!pkt_hdr->input_flags.udp) + return 0; + udp = (odph_udphdr_t *)(pkt_addr + pkt_hdr->l4_offset); + sport = odp_be_to_cpu_16(udp->src_port); + if (term_value->match_type == ODP_PMR_MASK) { + if (term_value->mask.val == (sport & term_value->mask.mask)) + return 1; + } else { + if ((term_value->range.val1 <= sport) && + (sport <= term_value->range.val2)) + return 1; + } + return 0; +} + +static inline int verify_pmr_dmac(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} + +static inline int verify_pmr_ipv6_saddr(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_ipv6_daddr(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_vlan_id_0(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_vlan_id_x(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_ipsec_spi(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_ld_vni(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_eth_type_0(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +static inline int verify_pmr_eth_type_x(uint8_t *pkt_addr ODP_UNUSED, + odp_packet_hdr_t *pkt_hdr ODP_UNUSED, + pmr_term_value_t *term_value ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} +#ifdef __cplusplus +} +#endif +#endif diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h new file mode 100644 index 000000000..fd2c6afbb --- /dev/null +++ b/platform/linux-generic/include/odp_classification_internal.h @@ -0,0 +1,173 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP Classification Internal + * Describes the classification internal Functions + */ + +#ifndef __ODP_CLASSIFICATION_INTERNAL_H_ +#define __ODP_CLASSIFICATION_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp_classification.h> +#include <odp_queue.h> +#include <odp_packet_internal.h> +#include <odp_packet_io.h> +#include <odp_packet_io_internal.h> +#include <odp_classification_datamodel.h> + +/** Classification Internal function **/ + +/** +@internal +Select a CoS for the given Packet based on pktio + +This function will call all the PMRs associated with a pktio for +a given packet and will return the matched COS object. +This function will check PMR, L2 and L3 QoS COS object associated +with the PKTIO interface. + +Returns the default cos if the packet does not match any PMR +Returns the error_cos if the packet has an error +**/ +cos_t *pktio_select_cos(pktio_entry_t *pktio, uint8_t *pkt_addr, + odp_packet_hdr_t *pkt_hdr); + +/** +@internal +match_qos_cos + +Select a CoS for the given Packet based on QoS values +This function returns the COS object matching the L2 and L3 QoS +based on the l3_preference value of the pktio +**/ +cos_t *match_qos_cos(pktio_entry_t *entry, uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); +/** +Packet Classifier + +Start function for Packet Classifier +This function calls Classifier module internal functions for a given packet and +enqueues the packet to specific Queue based on PMR and CoS selected. +**/ +int packet_classifier(odp_pktio_t pktio, odp_packet_t pkt); +/** +Packet IO classifier init + +This function does initialization of classifier object associated with pktio. +This function should be called during pktio initialization. +**/ +int pktio_classifier_init(pktio_entry_t *pktio); + +/** +@internal +match_pmr_cos + +Match a PMR chain with a Packet and return matching CoS +This function gets called recursively to check the chained PMR Term value +with the packet. + +**/ +cos_t *match_pmr_cos(cos_t *cos, uint8_t *pkt_addr, pmr_t *pmr, + odp_packet_hdr_t *hdr); +/** +@internal +CoS associated with L3 QoS value + +This function returns the CoS associated with L3 QoS value +**/ +cos_t *match_qos_l3_cos(pmr_l3_cos_t *l3_cos, uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); + +/** +@internal +CoS associated with L2 QoS value + +This function returns the CoS associated with L2 QoS value +**/ +cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, uint8_t *pkt_addr, + odp_packet_hdr_t *hdr); +/** +@internal +Flow Signature Calculation + +This function calculates the Flow Signature for a packet based on +CoS and updates in Packet Meta Data +**/ +int update_flow_signature(uint8_t *pkt_addr, cos_t *cos); + +/** +@internal +Allocate a odp_pmr_set_t Handle +*/ +odp_pmr_set_t alloc_pmr_set(pmr_t **pmr); + +/** +@internal +Allocate a odp_pmr_t Handle +*/ +odp_pmr_t alloc_pmr(pmr_t **pmr); + +/** +@internal +Pointer to pmr_set_t Handle +This function checks for validity of pmr_set_t Handle +*/ +pmr_set_t *get_pmr_set_entry(odp_pmr_set_t pmr_set_id); + +/** +@internal +Pointer to pmr_set_t Handle +*/ +pmr_set_t *get_pmr_set_entry_internal(odp_pmr_set_t pmr_set_id); + +/** +@internal +Pointer to pmr_set_t Handle +This function checks for validity of pmr_set_t Handle +*/ +pmr_t *get_pmr_entry(odp_pmr_t pmr_id); + +/** +@internal +Pointer to pmr_set_t Handle +*/ +pmr_t *get_pmr_entry_internal(odp_pmr_t pmr_id); + +/** +@internal +Pointer to odp_cos_t Handle +*/ +cos_t *get_cos_entry(odp_cos_t cos_id); + +/** +@internal +Pointer to odp_cos_t Handle +This function checks for validity of odp_cos_t Handle +*/ +cos_t *get_cos_entry_internal(odp_cos_t cos_id); + +/** +@internal +Verify PMR with a Packet + +This function goes through each PMR_TERM value in pmr_t structure and +calls verification function for each term.Returns 1 if PMR matches or 0 +Otherwise. +**/ +int verify_pmr(pmr_t *pmr, uint8_t *pkt_addr, odp_packet_hdr_t *pkt_hdr); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index f8c159694..04c1030b3 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -32,6 +32,8 @@ int odp_buffer_pool_init_global(void); int odp_pktio_init_global(void); int odp_pktio_init_local(void); +int odp_classification_init_global(void); + int odp_queue_init_global(void); int odp_crypto_init_global(void); diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index d129f2259..465127b5c 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -20,6 +20,7 @@ extern "C" { #include <odp_spinlock.h> #include <odp_packet_socket.h> +#include <odp_classification_datamodel.h> #include <odp_align_internal.h> #include <odp_config.h> @@ -43,6 +44,7 @@ struct pktio_entry { odp_pktio_type_t type; /**< pktio type */ pkt_sock_t pkt_sock; /**< using socket API for IO */ pkt_sock_mmap_t pkt_sock_mmap; /**< using socket mmap API for IO */ + classifier_t cls; /**< classifier linked with this pktio*/ char name[IFNAMSIZ]; /**< name of pktio provided to pktio_open() */ }; |