1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
5 #ifndef __INCLUDE_RTE_TABLE_ACTION_H__
6 #define __INCLUDE_RTE_TABLE_ACTION_H__
10 * RTE Pipeline Table Actions
12 * This API provides a common set of actions for pipeline tables to speed up
13 * application development.
15 * Each match-action rule added to a pipeline table has associated data that
16 * stores the action context. This data is input to the table action handler
17 * called for every input packet that hits the rule as part of the table lookup
18 * during the pipeline execution. The pipeline library allows the user to define
19 * his own table actions by providing customized table action handlers (table
20 * lookup) and complete freedom of setting the rules and their data (table rule
21 * add/delete). While the user can still follow this process, this API is
22 * intended to provide a quicker development alternative for a set of predefined
25 * The typical steps to use this API are:
26 * - Define a table action profile. This is a configuration template that can
27 * potentially be shared by multiple tables from the same or different
28 * pipelines, with different tables from the same pipeline likely to use
29 * different action profiles. For every table using a given action profile,
30 * the profile defines the set of actions and the action configuration to be
31 * implemented for all the table rules. API functions:
32 * rte_table_action_profile_create(),
33 * rte_table_action_profile_action_register(),
34 * rte_table_action_profile_freeze().
36 * - Instantiate the table action profile to create table action objects. Each
37 * pipeline table has its own table action object. API functions:
38 * rte_table_action_create().
40 * - Use the table action object to generate the pipeline table action handlers
41 * (invoked by the pipeline table lookup operation). API functions:
42 * rte_table_action_table_params_get().
44 * - Use the table action object to generate the rule data (for the pipeline
45 * table rule add operation) based on given action parameters. API functions:
46 * rte_table_action_apply().
48 * - Use the table action object to read action data (e.g. stats counters) for
49 * any given rule. API functions: rte_table_action_XYZ_read().
52 * @b EXPERIMENTAL: this API may change without prior notice
61 #include <rte_compat.h>
62 #include <rte_ether.h>
63 #include <rte_meter.h>
64 #include <rte_table_hash.h>
66 #include "rte_pipeline.h"
69 enum rte_table_action_type {
70 /** Forward to next pipeline table, output port or drop. */
71 RTE_TABLE_ACTION_FWD = 0,
76 /** Traffic Metering and Policing. */
79 /** Traffic Management. */
82 /** Packet encapsulations. */
83 RTE_TABLE_ACTION_ENCAP,
85 /** Network Address Translation (NAT). */
88 /** Time to Live (TTL) update. */
92 RTE_TABLE_ACTION_STATS,
95 RTE_TABLE_ACTION_TIME,
98 /** Common action configuration (per table action profile). */
99 struct rte_table_action_common_config {
100 /** Input packet Internet Protocol (IP) version. Non-zero for IPv4, zero
105 /** IP header offset within the input packet buffer. Offset 0 points to
106 * the first byte of the MBUF structure.
112 * RTE_TABLE_ACTION_FWD
114 /** Forward action parameters (per table rule). */
115 struct rte_table_action_fwd_params {
116 /** Forward action. */
117 enum rte_pipeline_action action;
119 /** Pipeline table ID or output port ID. */
124 * RTE_TABLE_ACTION_LB
126 /** Load balance key size min (number of bytes). */
127 #define RTE_TABLE_ACTION_LB_KEY_SIZE_MIN 8
129 /** Load balance key size max (number of bytes). */
130 #define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX 64
132 /** Load balance table size. */
133 #define RTE_TABLE_ACTION_LB_TABLE_SIZE 8
135 /** Load balance action configuration (per table action profile). */
136 struct rte_table_action_lb_config {
137 /** Key size (number of bytes). */
140 /** Key offset within the input packet buffer. Offset 0 points to the
141 * first byte of the MBUF structure.
145 /** Key mask (*key_size* bytes are valid). */
146 uint8_t key_mask[RTE_TABLE_ACTION_LB_KEY_SIZE_MAX];
148 /** Hash function. */
149 rte_table_hash_op_hash f_hash;
151 /** Seed value for *f_hash*. */
154 /** Output value offset within the input packet buffer. Offset 0 points
155 * to the first byte of the MBUF structure.
160 /** Load balance action parameters (per table rule). */
161 struct rte_table_action_lb_params {
162 /** Table defining the output values and their weights. The weights are
163 * set in 1/RTE_TABLE_ACTION_LB_TABLE_SIZE increments. To assign a
164 * weight of N/RTE_TABLE_ACTION_LB_TABLE_SIZE to a given output value
165 * (0 <= N <= RTE_TABLE_ACTION_LB_TABLE_SIZE), the same output value
166 * needs to show up exactly N times in this table.
168 uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE];
172 * RTE_TABLE_ACTION_MTR
174 /** Max number of traffic classes (TCs). */
175 #define RTE_TABLE_ACTION_TC_MAX 4
177 /** Max number of queues per traffic class. */
178 #define RTE_TABLE_ACTION_TC_QUEUE_MAX 4
180 /** Differentiated Services Code Point (DSCP) translation table entry. */
181 struct rte_table_action_dscp_table_entry {
182 /** Traffic class. Used by the meter or the traffic management actions.
183 * Has to be strictly smaller than *RTE_TABLE_ACTION_TC_MAX*. Traffic
184 * class 0 is the highest priority.
188 /** Traffic class queue. Used by the traffic management action. Has to
189 * be strictly smaller than *RTE_TABLE_ACTION_TC_QUEUE_MAX*.
191 uint32_t tc_queue_id;
193 /** Packet color. Used by the meter action as the packet input color
194 * for the color aware mode of the traffic metering algorithm.
196 enum rte_meter_color color;
199 /** DSCP translation table. */
200 struct rte_table_action_dscp_table {
201 /** Array of DSCP table entries */
202 struct rte_table_action_dscp_table_entry entry[64];
205 /** Supported traffic metering algorithms. */
206 enum rte_table_action_meter_algorithm {
207 /** Single Rate Three Color Marker (srTCM) - IETF RFC 2697. */
208 RTE_TABLE_ACTION_METER_SRTCM,
210 /** Two Rate Three Color Marker (trTCM) - IETF RFC 2698. */
211 RTE_TABLE_ACTION_METER_TRTCM,
214 /** Traffic metering profile (configuration template). */
215 struct rte_table_action_meter_profile {
216 /** Traffic metering algorithm. */
217 enum rte_table_action_meter_algorithm alg;
221 /** Only valid when *alg* is set to srTCM - IETF RFC 2697. */
222 struct rte_meter_srtcm_params srtcm;
224 /** Only valid when *alg* is set to trTCM - IETF RFC 2698. */
225 struct rte_meter_trtcm_params trtcm;
229 /** Policer actions. */
230 enum rte_table_action_policer {
231 /** Recolor the packet as green. */
232 RTE_TABLE_ACTION_POLICER_COLOR_GREEN = 0,
234 /** Recolor the packet as yellow. */
235 RTE_TABLE_ACTION_POLICER_COLOR_YELLOW,
237 /** Recolor the packet as red. */
238 RTE_TABLE_ACTION_POLICER_COLOR_RED,
240 /** Drop the packet. */
241 RTE_TABLE_ACTION_POLICER_DROP,
243 /** Number of policer actions. */
244 RTE_TABLE_ACTION_POLICER_MAX
247 /** Meter action configuration per traffic class. */
248 struct rte_table_action_mtr_tc_params {
249 /** Meter profile ID. */
250 uint32_t meter_profile_id;
252 /** Policer actions. */
253 enum rte_table_action_policer policer[e_RTE_METER_COLORS];
256 /** Meter action statistics counters per traffic class. */
257 struct rte_table_action_mtr_counters_tc {
258 /** Number of packets per color at the output of the traffic metering
259 * and before the policer actions are executed. Only valid when
260 * *n_packets_valid* is non-zero.
262 uint64_t n_packets[e_RTE_METER_COLORS];
264 /** Number of packet bytes per color at the output of the traffic
265 * metering and before the policer actions are executed. Only valid when
266 * *n_bytes_valid* is non-zero.
268 uint64_t n_bytes[e_RTE_METER_COLORS];
270 /** When non-zero, the *n_packets* field is valid. */
273 /** When non-zero, the *n_bytes* field is valid. */
277 /** Meter action configuration (per table action profile). */
278 struct rte_table_action_mtr_config {
279 /** Meter algorithm. */
280 enum rte_table_action_meter_algorithm alg;
282 /** Number of traffic classes. Each traffic class has its own traffic
283 * meter and policer instances. Needs to be equal to either 1 or to
284 * *RTE_TABLE_ACTION_TC_MAX*.
288 /** When non-zero, the *n_packets* meter stats counter is enabled,
289 * otherwise it is disabled.
291 * @see struct rte_table_action_mtr_counters_tc
293 int n_packets_enabled;
295 /** When non-zero, the *n_bytes* meter stats counter is enabled,
296 * otherwise it is disabled.
298 * @see struct rte_table_action_mtr_counters_tc
303 /** Meter action parameters (per table rule). */
304 struct rte_table_action_mtr_params {
305 /** Traffic meter and policer parameters for each of the *tc_mask*
308 struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX];
310 /** Bit mask defining which traffic class parameters are valid in *mtr*.
311 * If bit N is set in *tc_mask*, then parameters for traffic class N are
317 /** Meter action statistics counters (per table rule). */
318 struct rte_table_action_mtr_counters {
319 /** Stats counters for each of the *tc_mask* traffic classes. */
320 struct rte_table_action_mtr_counters_tc stats[RTE_TABLE_ACTION_TC_MAX];
322 /** Bit mask defining which traffic class parameters are valid in *mtr*.
323 * If bit N is set in *tc_mask*, then parameters for traffic class N are
330 * RTE_TABLE_ACTION_TM
332 /** Traffic management action configuration (per table action profile). */
333 struct rte_table_action_tm_config {
334 /** Number of subports per port. */
335 uint32_t n_subports_per_port;
337 /** Number of pipes per subport. */
338 uint32_t n_pipes_per_subport;
341 /** Traffic management action parameters (per table rule). */
342 struct rte_table_action_tm_params {
351 * RTE_TABLE_ACTION_ENCAP
353 /** Supported packet encapsulation types. */
354 enum rte_table_action_encap_type {
355 /** IP -> { Ether | IP } */
356 RTE_TABLE_ACTION_ENCAP_ETHER = 0,
358 /** IP -> { Ether | VLAN | IP } */
359 RTE_TABLE_ACTION_ENCAP_VLAN,
361 /** IP -> { Ether | S-VLAN | C-VLAN | IP } */
362 RTE_TABLE_ACTION_ENCAP_QINQ,
364 /** IP -> { Ether | MPLS | IP } */
365 RTE_TABLE_ACTION_ENCAP_MPLS,
367 /** IP -> { Ether | PPPoE | PPP | IP } */
368 RTE_TABLE_ACTION_ENCAP_PPPOE,
371 /** Pre-computed Ethernet header fields for encapsulation action. */
372 struct rte_table_action_ether_hdr {
373 struct ether_addr da; /**< Destination address. */
374 struct ether_addr sa; /**< Source address. */
377 /** Pre-computed VLAN header fields for encapsulation action. */
378 struct rte_table_action_vlan_hdr {
379 uint8_t pcp; /**< Priority Code Point (PCP). */
380 uint8_t dei; /**< Drop Eligibility Indicator (DEI). */
381 uint16_t vid; /**< VLAN Identifier (VID). */
384 /** Pre-computed MPLS header fields for encapsulation action. */
385 struct rte_table_action_mpls_hdr {
386 uint32_t label; /**< Label. */
387 uint8_t tc; /**< Traffic Class (TC). */
388 uint8_t ttl; /**< Time to Live (TTL). */
391 /** Pre-computed PPPoE header fields for encapsulation action. */
392 struct rte_table_action_pppoe_hdr {
393 uint16_t session_id; /**< Session ID. */
396 /** Ether encap parameters. */
397 struct rte_table_action_encap_ether_params {
398 struct rte_table_action_ether_hdr ether; /**< Ethernet header. */
401 /** VLAN encap parameters. */
402 struct rte_table_action_encap_vlan_params {
403 struct rte_table_action_ether_hdr ether; /**< Ethernet header. */
404 struct rte_table_action_vlan_hdr vlan; /**< VLAN header. */
407 /** QinQ encap parameters. */
408 struct rte_table_action_encap_qinq_params {
409 struct rte_table_action_ether_hdr ether; /**< Ethernet header. */
410 struct rte_table_action_vlan_hdr svlan; /**< Service VLAN header. */
411 struct rte_table_action_vlan_hdr cvlan; /**< Customer VLAN header. */
414 /** Max number of MPLS labels per output packet for MPLS encapsulation. */
415 #ifndef RTE_TABLE_ACTION_MPLS_LABELS_MAX
416 #define RTE_TABLE_ACTION_MPLS_LABELS_MAX 4
419 /** MPLS encap parameters. */
420 struct rte_table_action_encap_mpls_params {
421 /** Ethernet header. */
422 struct rte_table_action_ether_hdr ether;
425 struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX];
427 /** Number of MPLS labels in MPLS header. */
430 /** Non-zero for MPLS unicast, zero for MPLS multicast. */
434 /** PPPoE encap parameters. */
435 struct rte_table_action_encap_pppoe_params {
436 struct rte_table_action_ether_hdr ether; /**< Ethernet header. */
437 struct rte_table_action_pppoe_hdr pppoe; /**< PPPoE/PPP headers. */
440 /** Encap action configuration (per table action profile). */
441 struct rte_table_action_encap_config {
442 /** Bit mask defining the set of packet encapsulations enabled for the
443 * current table action profile. If bit (1 << N) is set in *encap_mask*,
444 * then packet encapsulation N is enabled, otherwise it is disabled.
446 * @see enum rte_table_action_encap_type
451 /** Encap action parameters (per table rule). */
452 struct rte_table_action_encap_params {
453 /** Encapsulation type. */
454 enum rte_table_action_encap_type type;
458 /** Only valid when *type* is set to Ether. */
459 struct rte_table_action_encap_ether_params ether;
461 /** Only valid when *type* is set to VLAN. */
462 struct rte_table_action_encap_vlan_params vlan;
464 /** Only valid when *type* is set to QinQ. */
465 struct rte_table_action_encap_qinq_params qinq;
467 /** Only valid when *type* is set to MPLS. */
468 struct rte_table_action_encap_mpls_params mpls;
470 /** Only valid when *type* is set to PPPoE. */
471 struct rte_table_action_encap_pppoe_params pppoe;
476 * RTE_TABLE_ACTION_NAT
478 /** NAT action configuration (per table action profile). */
479 struct rte_table_action_nat_config {
480 /** When non-zero, the IP source address and L4 protocol source port are
481 * translated. When zero, the IP destination address and L4 protocol
482 * destination port are translated.
486 /** Layer 4 protocol, for example TCP (0x06) or UDP (0x11). The checksum
487 * field is computed differently and placed at different header offset
488 * by each layer 4 protocol.
493 /** NAT action parameters (per table rule). */
494 struct rte_table_action_nat_params {
495 /** IP version for *addr*: non-zero for IPv4, zero for IPv6. */
500 /** IPv4 address; only valid when *ip_version* is non-zero. */
503 /** IPv6 address; only valid when *ip_version* is set to 0. */
512 * RTE_TABLE_ACTION_TTL
514 /** TTL action configuration (per table action profile). */
515 struct rte_table_action_ttl_config {
516 /** When non-zero, the input packets whose updated IPv4 Time to Live
517 * (TTL) field or IPv6 Hop Limit (HL) field is zero are dropped.
518 * When zero, the input packets whose updated IPv4 TTL field or IPv6 HL
519 * field is zero are forwarded as usual (typically for debugging
524 /** When non-zero, the *n_packets* stats counter for TTL action is
525 * enabled, otherwise disabled.
527 * @see struct rte_table_action_ttl_counters
529 int n_packets_enabled;
532 /** TTL action parameters (per table rule). */
533 struct rte_table_action_ttl_params {
534 /** When non-zero, decrement the IPv4 TTL field and update the checksum
535 * field, or decrement the IPv6 HL field. When zero, the IPv4 TTL field
536 * or the IPv6 HL field is not changed.
541 /** TTL action statistics packets (per table rule). */
542 struct rte_table_action_ttl_counters {
543 /** Number of IPv4 packets whose updated TTL field is zero or IPv6
544 * packets whose updated HL field is zero.
550 * RTE_TABLE_ACTION_STATS
552 /** Stats action configuration (per table action profile). */
553 struct rte_table_action_stats_config {
554 /** When non-zero, the *n_packets* stats counter is enabled, otherwise
557 * @see struct rte_table_action_stats_counters
559 int n_packets_enabled;
561 /** When non-zero, the *n_bytes* stats counter is enabled, otherwise
564 * @see struct rte_table_action_stats_counters
569 /** Stats action parameters (per table rule). */
570 struct rte_table_action_stats_params {
571 /** Initial value for the *n_packets* stats counter. Typically set to 0.
573 * @see struct rte_table_action_stats_counters
577 /** Initial value for the *n_bytes* stats counter. Typically set to 0.
579 * @see struct rte_table_action_stats_counters
584 /** Stats action counters (per table rule). */
585 struct rte_table_action_stats_counters {
586 /** Number of packets. Valid only when *n_packets_valid* is non-zero. */
589 /** Number of bytes. Valid only when *n_bytes_valid* is non-zero. */
592 /** When non-zero, the *n_packets* field is valid, otherwise invalid. */
595 /** When non-zero, the *n_bytes* field is valid, otherwise invalid. */
600 * RTE_TABLE_ACTION_TIME
602 /** Timestamp action parameters (per table rule). */
603 struct rte_table_action_time_params {
604 /** Initial timestamp value. Typically set to current time. */
609 * Table action profile.
611 struct rte_table_action_profile;
614 * Table action profile create.
617 * Common action configuration.
619 * Table action profile handle on success, NULL otherwise.
621 struct rte_table_action_profile * __rte_experimental
622 rte_table_action_profile_create(struct rte_table_action_common_config *common);
625 * Table action profile free.
628 * Table profile action handle (needs to be valid).
630 * Zero on success, non-zero error code otherwise.
632 int __rte_experimental
633 rte_table_action_profile_free(struct rte_table_action_profile *profile);
636 * Table action profile action register.
639 * Table profile action handle (needs to be valid and not in frozen state).
641 * Specific table action to be registered for *profile*.
642 * @param[in] action_config
643 * Configuration for the *type* action.
644 * If struct rte_table_action_*type*_config is defined by the Table Action
645 * API, it needs to point to a valid instance of this structure, otherwise it
646 * needs to be set to NULL.
648 * Zero on success, non-zero error code otherwise.
650 int __rte_experimental
651 rte_table_action_profile_action_register(struct rte_table_action_profile *profile,
652 enum rte_table_action_type type,
653 void *action_config);
656 * Table action profile freeze.
658 * Once this function is called successfully, the given profile enters the
659 * frozen state with the following immediate effects: no more actions can be
660 * registered for this profile, so the profile can be instantiated to create
661 * table action objects.
664 * Table profile action handle (needs to be valid and not in frozen state).
666 * Zero on success, non-zero error code otherwise.
668 * @see rte_table_action_create()
670 int __rte_experimental
671 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
676 struct rte_table_action;
679 * Table action create.
681 * Instantiates the given table action profile to create a table action object.
684 * Table profile action handle (needs to be valid and in frozen state).
685 * @param[in] socket_id
686 * CPU socket ID where the internal data structures required by the new table
687 * action object should be allocated.
689 * Handle to table action object on success, NULL on error.
691 * @see rte_table_action_create()
693 struct rte_table_action * __rte_experimental
694 rte_table_action_create(struct rte_table_action_profile *profile,
701 * Handle to table action object (needs to be valid).
703 * Zero on success, non-zero error code otherwise.
705 int __rte_experimental
706 rte_table_action_free(struct rte_table_action *action);
709 * Table action table params get.
712 * Handle to table action object (needs to be valid).
713 * @param[inout] params
714 * Pipeline table parameters (needs to be pre-allocated).
716 * Zero on success, non-zero error code otherwise.
718 int __rte_experimental
719 rte_table_action_table_params_get(struct rte_table_action *action,
720 struct rte_pipeline_table_params *params);
723 * Table action apply.
726 * Handle to table action object (needs to be valid).
728 * Data byte array (typically table rule data) to apply action *type* on.
730 * Specific table action previously registered for the table action profile of
731 * the *action* object.
732 * @param[in] action_params
733 * Parameters for the *type* action.
734 * If struct rte_table_action_*type*_params is defined by the Table Action
735 * API, it needs to point to a valid instance of this structure, otherwise it
736 * needs to be set to NULL.
738 * Zero on success, non-zero error code otherwise.
740 int __rte_experimental
741 rte_table_action_apply(struct rte_table_action *action,
743 enum rte_table_action_type type,
744 void *action_params);
747 * Table action DSCP table update.
750 * Handle to table action object (needs to be valid).
751 * @param[in] dscp_mask
752 * 64-bit mask defining the DSCP table entries to be updated. If bit N is set
753 * in this bit mask, then DSCP table entry N is to be updated, otherwise not.
757 * Zero on success, non-zero error code otherwise.
759 int __rte_experimental
760 rte_table_action_dscp_table_update(struct rte_table_action *action,
762 struct rte_table_action_dscp_table *table);
765 * Table action meter profile add.
768 * Handle to table action object (needs to be valid).
769 * @param[in] meter_profile_id
770 * Meter profile ID to be used for the *profile* once it is successfully added
771 * to the *action* object (needs to be unused by the set of meter profiles
772 * currently registered for the *action* object).
774 * Meter profile to be added.
776 * Zero on success, non-zero error code otherwise.
778 int __rte_experimental
779 rte_table_action_meter_profile_add(struct rte_table_action *action,
780 uint32_t meter_profile_id,
781 struct rte_table_action_meter_profile *profile);
784 * Table action meter profile delete.
787 * Handle to table action object (needs to be valid).
788 * @param[in] meter_profile_id
789 * Meter profile ID of the meter profile to be deleted from the *action*
790 * object (needs to be valid for the *action* object).
792 * Zero on success, non-zero error code otherwise.
794 int __rte_experimental
795 rte_table_action_meter_profile_delete(struct rte_table_action *action,
796 uint32_t meter_profile_id);
799 * Table action meter read.
802 * Handle to table action object (needs to be valid).
804 * Data byte array (typically table rule data) with meter action previously
807 * Bit mask defining which traffic classes should have the meter stats
808 * counters read from *data* and stored into *stats*. If bit N is set in this
809 * bit mask, then traffic class N is part of this operation, otherwise it is
810 * not. If bit N is set in this bit mask, then traffic class N must be one of
811 * the traffic classes that are enabled for the meter action in the table
812 * action profile used by the *action* object.
813 * @param[inout] stats
814 * When non-NULL, it points to the area where the meter stats counters read
815 * from *data* are saved. Only the meter stats counters for the *tc_mask*
816 * traffic classes are read and stored to *stats*.
818 * When non-zero, the meter stats counters are cleared (i.e. set to zero),
819 * otherwise the counters are not modified. When the read operation is enabled
820 * (*stats* is non-NULL), the clear operation is performed after the read
821 * operation is completed.
823 * Zero on success, non-zero error code otherwise.
825 int __rte_experimental
826 rte_table_action_meter_read(struct rte_table_action *action,
829 struct rte_table_action_mtr_counters *stats,
833 * Table action TTL read.
836 * Handle to table action object (needs to be valid).
838 * Data byte array (typically table rule data) with TTL action previously
840 * @param[inout] stats
841 * When non-NULL, it points to the area where the TTL stats counters read from
844 * When non-zero, the TTL stats counters are cleared (i.e. set to zero),
845 * otherwise the counters are not modified. When the read operation is enabled
846 * (*stats* is non-NULL), the clear operation is performed after the read
847 * operation is completed.
849 * Zero on success, non-zero error code otherwise.
851 int __rte_experimental
852 rte_table_action_ttl_read(struct rte_table_action *action,
854 struct rte_table_action_ttl_counters *stats,
858 * Table action stats read.
861 * Handle to table action object (needs to be valid).
863 * Data byte array (typically table rule data) with stats action previously
865 * @param[inout] stats
866 * When non-NULL, it points to the area where the stats counters read from
869 * When non-zero, the stats counters are cleared (i.e. set to zero), otherwise
870 * the counters are not modified. When the read operation is enabled (*stats*
871 * is non-NULL), the clear operation is performed after the read operation is
874 * Zero on success, non-zero error code otherwise.
876 int __rte_experimental
877 rte_table_action_stats_read(struct rte_table_action *action,
879 struct rte_table_action_stats_counters *stats,
883 * Table action timestamp read.
886 * Handle to table action object (needs to be valid).
888 * Data byte array (typically table rule data) with timestamp action
889 * previously applied on it.
890 * @param[inout] timestamp
891 * Pre-allocated memory where the timestamp read from *data* is saved (has to
894 * Zero on success, non-zero error code otherwise.
896 int __rte_experimental
897 rte_table_action_time_read(struct rte_table_action *action,
899 uint64_t *timestamp);
905 #endif /* __INCLUDE_RTE_TABLE_ACTION_H__ */