X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fethdev%2Frte_flow.h;h=1031fb246b8bf0529633b1b9530542ac3a921f57;hb=edcf22c6d3898efd6ce346f1c6fa1264181c8d09;hp=ba069f2f63c1a59a3fe78a0b12dd2d824e2cdfc6;hpb=dc4d860e8a89e8c037d60466eb93b515af9cd0b2;p=dpdk.git diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index ba069f2f63..1031fb246b 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -35,6 +35,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { @@ -644,6 +646,20 @@ enum rte_flow_item_type { * @see struct rte_flow_item_flex. */ RTE_FLOW_ITEM_TYPE_FLEX, + + /** + * Matches L2TPv2 Header. + * + * See struct rte_flow_item_l2tpv2. + */ + RTE_FLOW_ITEM_TYPE_L2TPV2, + + /** + * Matches PPP Header. + * + * See struct rte_flow_item_ppp. + */ + RTE_FLOW_ITEM_TYPE_PPP, }; /** @@ -901,8 +917,8 @@ struct rte_flow_item_vlan { }; struct rte_vlan_hdr hdr; }; + /** Packet header contains at least one more VLAN, after this VLAN. */ uint32_t has_more_vlan:1; - /**< Packet header contains at least one more VLAN, after this VLAN. */ uint32_t reserved:31; /**< Reserved, must be zero. */ }; @@ -944,26 +960,26 @@ static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = { */ struct rte_flow_item_ipv6 { struct rte_ipv6_hdr hdr; /**< IPv6 header definition. */ + /** Header contains Hop-by-Hop Options extension header. */ uint32_t has_hop_ext:1; - /**< Header contains Hop-by-Hop Options extension header. */ + /** Header contains Routing extension header. */ uint32_t has_route_ext:1; - /**< Header contains Routing extension header. */ + /** Header contains Fragment extension header. */ uint32_t has_frag_ext:1; - /**< Header contains Fragment extension header. */ + /** Header contains Authentication extension header. */ uint32_t has_auth_ext:1; - /**< Header contains Authentication extension header. */ + /** Header contains Encapsulation Security Payload extension header. */ uint32_t has_esp_ext:1; - /**< Header contains Encapsulation Security Payload extension header. */ + /** Header contains Destination Options extension header. */ uint32_t has_dest_ext:1; - /**< Header contains Destination Options extension header. */ + /** Header contains Mobility extension header. */ uint32_t has_mobil_ext:1; - /**< Header contains Mobility extension header. */ + /** Header contains Host Identity Protocol extension header. */ uint32_t has_hip_ext:1; - /**< Header contains Host Identity Protocol extension header. */ + /** Header contains Shim6 Protocol extension header. */ uint32_t has_shim6_ext:1; - /**< Header contains Shim6 Protocol extension header. */ + /** Reserved for future extension headers, must be zero. */ uint32_t reserved:23; - /**< Reserved for future extension headers, must be zero. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */ @@ -1504,11 +1520,12 @@ rte_flow_item_icmp6_nd_opt_tla_eth_mask = { * RTE_FLOW_ITEM_TYPE_META * * Matches a specified metadata value. On egress, metadata can be set - * either by mbuf dynamic metadata field with PKT_TX_DYNF_METADATA flag or - * RTE_FLOW_ACTION_TYPE_SET_META. On ingress, RTE_FLOW_ACTION_TYPE_SET_META + * either by mbuf dynamic metadata field with RTE_MBUF_DYNFLAG_TX_METADATA flag + * or RTE_FLOW_ACTION_TYPE_SET_META. On ingress, RTE_FLOW_ACTION_TYPE_SET_META * sets metadata for a packet and the metadata will be reported via mbuf - * metadata dynamic field with PKT_RX_DYNF_METADATA flag. The dynamic mbuf - * field must be registered in advance by rte_flow_dynf_metadata_register(). + * metadata dynamic field with RTE_MBUF_DYNFLAG_RX_METADATA flag. The dynamic + * mbuf field must be registered in advance by + * rte_flow_dynf_metadata_register(). */ struct rte_flow_item_meta { uint32_t data; @@ -1900,6 +1917,57 @@ static const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask = { }; #endif +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_L2TPV2 + * + * Matches L2TPv2 Header + */ +struct rte_flow_item_l2tpv2 { + struct rte_l2tpv2_combined_msg_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2. */ +#ifndef __cplusplus +static const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask = { + /* + * flags and version bit mask + * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + * T L x x S x O P x x x x V V V V + */ + .hdr = { + .common = { + .flags_version = RTE_BE16(0xcb0f), + }, + }, +}; +#endif + +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_PPP + * + * Matches PPP Header + */ +struct rte_flow_item_ppp { + struct rte_ppp_hdr hdr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_PPP. */ +#ifndef __cplusplus +static const struct rte_flow_item_ppp rte_flow_item_ppp_mask = { + .hdr = { + .addr = 0xff, + .ctrl = 0xff, + .proto_id = RTE_BE16(0xffff), + } +}; +#endif + /** * Matching pattern item definition. * @@ -2172,8 +2240,8 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_JUMP, /** - * Attaches an integer value to packets and sets PKT_RX_FDIR and - * PKT_RX_FDIR_ID mbuf flags. + * Attaches an integer value to packets and sets RTE_MBUF_F_RX_FDIR and + * RTE_MBUF_F_RX_FDIR_ID mbuf flags. * * See struct rte_flow_action_mark. * @@ -2185,7 +2253,7 @@ enum rte_flow_action_type { /** * Flags packets. Similar to MARK without a specific value; only - * sets the PKT_RX_FDIR mbuf flag. + * sets the RTE_MBUF_F_RX_FDIR mbuf flag. * * No associated configuration structure. * @@ -2295,6 +2363,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SECURITY, /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_SET_MPLS_TTL ("MPLS TTL") as defined by the * OpenFlow Switch Specification. * @@ -2303,6 +2374,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_SET_MPLS_TTL, /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_DEC_MPLS_TTL ("decrement MPLS TTL") as defined * by the OpenFlow Switch Specification. * @@ -2311,6 +2385,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_DEC_MPLS_TTL, /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_SET_NW_TTL ("IP TTL") as defined by the OpenFlow * Switch Specification. * @@ -2319,6 +2396,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_SET_NW_TTL, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_DEC_NW_TTL ("decrement IP TTL") as defined by * the OpenFlow Switch Specification. * @@ -2327,6 +2407,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL, /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_COPY_TTL_OUT ("copy TTL "outwards" -- from * next-to-outermost to outermost") as defined by the OpenFlow * Switch Specification. @@ -2336,6 +2419,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_COPY_TTL_OUT, /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Implements OFPAT_COPY_TTL_IN ("copy TTL "inwards" -- from * outermost to next-to-outermost") as defined by the OpenFlow * Switch Specification. @@ -2361,7 +2447,7 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN, /** - * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN id") as + * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN ID") as * defined by the OpenFlow Switch Specification. * * See struct rte_flow_action_of_set_vlan_vid. @@ -2441,6 +2527,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_RAW_DECAP, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv4 source address in the outermost IPv4 header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4, @@ -2451,6 +2540,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv4 destination address in the outermost IPv4 header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4, @@ -2461,6 +2553,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_IPV4_DST, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv6 source address in the outermost IPv6 header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV6, @@ -2471,6 +2566,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv6 destination address in the outermost IPv6 header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV6, @@ -2481,6 +2579,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_IPV6_DST, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify source port number in the outermost TCP/UDP header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP @@ -2492,6 +2593,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_TP_SRC, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify destination port number in the outermost TCP/UDP header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP @@ -2514,6 +2618,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_MAC_SWAP, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Decrease TTL value directly * * No associated configuration structure. @@ -2521,6 +2628,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_DEC_TTL, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Set TTL value * * See struct rte_flow_action_set_ttl @@ -2528,6 +2638,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_TTL, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Set source MAC address from matched flow. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, @@ -2538,6 +2651,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_MAC_SRC, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Set destination MAC address from matched flow. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, @@ -2548,6 +2664,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_MAC_DST, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Increase sequence number in the outermost TCP header. * * Action configuration specifies the value to increase @@ -2562,6 +2681,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Decrease sequence number in the outermost TCP header. * * Action configuration specifies the value to decrease @@ -2576,6 +2698,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Increase acknowledgment number in the outermost TCP header. * * Action configuration specifies the value to increase @@ -2590,6 +2715,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_INC_TCP_ACK, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Decrease acknowledgment number in the outermost TCP header. * * Action configuration specifies the value to decrease @@ -2604,6 +2732,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Set Tag. * * Tag is for internal flow usage only and @@ -2614,6 +2745,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_TAG, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Set metadata on ingress or egress path. * * See struct rte_flow_action_set_meta. @@ -2621,6 +2755,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_META, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv4 DSCP in the outermost IP header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4, @@ -2631,6 +2768,9 @@ enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP, /** + * @warning This is a legacy action. + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * Modify IPv6 DSCP in the outermost IP header. * * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV6, @@ -2725,8 +2865,8 @@ enum rte_flow_action_type { /** * RTE_FLOW_ACTION_TYPE_MARK * - * Attaches an integer value to packets and sets PKT_RX_FDIR and - * PKT_RX_FDIR_ID mbuf flags. + * Attaches an integer value to packets and sets RTE_MBUF_F_RX_FDIR and + * RTE_MBUF_F_RX_FDIR_ID mbuf flags. * * This value is arbitrary and application-defined. Maximum allowed value * depends on the underlying implementation. It is returned in the @@ -2777,8 +2917,8 @@ struct rte_flow_action_queue { struct rte_flow_action_age { uint32_t timeout:24; /**< Time in seconds. */ uint32_t reserved:8; /**< Reserved, must be zero. */ + /** The user flow context, NULL means the rte_flow pointer. */ void *context; - /**< The user flow context, NULL means the rte_flow pointer. */ }; /** @@ -2790,8 +2930,8 @@ struct rte_flow_action_age { struct rte_flow_query_age { uint32_t reserved:6; /**< Reserved, must be zero. */ uint32_t aged:1; /**< 1 if aging timeout expired, 0 otherwise. */ + /** sec_since_last_hit value is valid. */ uint32_t sec_since_last_hit_valid:1; - /**< sec_since_last_hit value is valid. */ uint32_t sec_since_last_hit:24; /**< Seconds since last traffic hit. */ }; @@ -2804,12 +2944,12 @@ struct rte_flow_query_age { * Adds a counter action to a matched flow. * * If more than one count action is specified in a single flow rule, then each - * action must specify a unique id. + * action must specify a unique ID. * * Counters can be retrieved and reset through ``rte_flow_query()``, see * ``struct rte_flow_query_count``. * - * For ports within the same switch domain then the counter id namespace extends + * For ports within the same switch domain then the counter ID namespace extends * to all ports within that switch domain. */ struct rte_flow_action_count { @@ -2890,7 +3030,7 @@ struct rte_flow_action_rss { * through. */ uint32_t level; - uint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */ + uint64_t types; /**< Specific RSS hash types (see RTE_ETH_RSS_*). */ uint32_t key_len; /**< Hash key length in bytes. */ uint32_t queue_num; /**< Number of entries in @p queue. */ const uint8_t *key; /**< Hash key. */ @@ -3001,6 +3141,9 @@ struct rte_flow_action_security { }; /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * RTE_FLOW_ACTION_TYPE_OF_SET_MPLS_TTL * * Implements OFPAT_SET_MPLS_TTL ("MPLS TTL") as defined by the OpenFlow @@ -3011,6 +3154,9 @@ struct rte_flow_action_of_set_mpls_ttl { }; /** + * @deprecated + * @see RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * * RTE_FLOW_ACTION_TYPE_OF_SET_NW_TTL * * Implements OFPAT_SET_NW_TTL ("IP TTL") as defined by the OpenFlow Switch @@ -3033,11 +3179,11 @@ struct rte_flow_action_of_push_vlan { /** * RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID * - * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN id") as defined by + * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN ID") as defined by * the OpenFlow Switch Specification. */ struct rte_flow_action_of_set_vlan_vid { - rte_be16_t vlan_vid; /**< VLAN id. */ + rte_be16_t vlan_vid; /**< VLAN ID. */ }; /** @@ -3269,10 +3415,10 @@ struct rte_flow_action_set_tag { * RTE_FLOW_ACTION_TYPE_SET_META * * Set metadata. Metadata set by mbuf metadata dynamic field with - * PKT_TX_DYNF_DATA flag on egress will be overridden by this action. On - * ingress, the metadata will be carried by mbuf metadata dynamic field - * with PKT_RX_DYNF_METADATA flag if set. The dynamic mbuf field must be - * registered in advance by rte_flow_dynf_metadata_register(). + * RTE_MBUF_DYNFLAG_TX_METADATA flag on egress will be overridden by this + * action. On ingress, the metadata will be carried by mbuf metadata dynamic + * field with RTE_MBUF_DYNFLAG_RX_METADATA flag if set. The dynamic mbuf field + * must be registered in advance by rte_flow_dynf_metadata_register(). * * Altering partial bits is supported with mask. For bits which have never * been set, unpredictable value will be seen depending on driver @@ -3422,7 +3568,7 @@ struct rte_flow_action_conntrack { uint32_t last_direction:1; /** No TCP check will be done except the state change. */ uint32_t liberal_mode:1; - /**