DPDK 21.11.9
rte_table_action.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
3 */
4
5#ifndef __INCLUDE_RTE_TABLE_ACTION_H__
6#define __INCLUDE_RTE_TABLE_ACTION_H__
7
55#ifdef __cplusplus
56extern "C" {
57#endif
58
59#include <stdint.h>
60
61#include <rte_compat.h>
62#include <rte_ether.h>
63#include <rte_meter.h>
64#include <rte_table_hash.h>
65
66#include "rte_pipeline.h"
67
72
75
78
81
84
87
90
93
96
99
102
105};
106
113
117 uint32_t ip_offset;
118};
119
127
129 uint32_t id;
130};
131
136#define RTE_TABLE_ACTION_LB_KEY_SIZE_MIN 8
137
139#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX 64
140
142#define RTE_TABLE_ACTION_LB_TABLE_SIZE 8
143
147 uint32_t key_size;
148
152 uint32_t key_offset;
153
156
159
161 uint64_t seed;
162
166 uint32_t out_offset;
167};
168
178};
179
184#define RTE_TABLE_ACTION_TC_MAX 16
185
187#define RTE_TABLE_ACTION_TC_QUEUE_MAX 16
188
195 uint32_t tc_id;
196
200 uint32_t tc_queue_id;
201
206};
207
212};
213
218
221};
222
227
229 union {
232
235 };
236};
237
242
245
248
251
255
260
263};
264
272
278
281
284};
285
290
295 uint32_t n_tc;
296
303
310};
311
318
323 uint32_t tc_mask;
324};
325
330
335 uint32_t tc_mask;
336};
337
345
348};
349
353 uint32_t subport_id;
354
356 uint32_t pipe_id;
357};
358
366
369
372
375
378
383
386};
387
392};
393
396 uint8_t pcp;
397 uint8_t dei;
398 uint16_t vid;
399};
400
403 uint32_t label;
404 uint8_t tc;
405 uint8_t ttl;
406};
407
410 uint16_t session_id;
411};
412
415 uint32_t sa;
416 uint32_t da;
417 uint8_t dscp;
418 uint8_t ttl;
419};
420
423 uint8_t sa[16];
424 uint8_t da[16];
425 uint32_t flow_label;
426 uint8_t dscp;
427 uint8_t hop_limit;
428};
429
432 uint16_t sp;
433 uint16_t dp;
434};
435
438 uint32_t vni;
439};
440
444};
445
450};
451
457};
458
460#ifndef RTE_TABLE_ACTION_MPLS_LABELS_MAX
461#define RTE_TABLE_ACTION_MPLS_LABELS_MAX 4
462#endif
463
468
471
473 uint32_t mpls_count;
474
477};
478
483};
484
491 union {
494 };
495
498};
499
508 uint64_t encap_mask;
509
512 union {
513 struct {
519 uint32_t data_offset;
520
524 int vlan;
525
532 };
533};
534
537
543};
544
549
551 union {
554
557
560
563
566
569
572 };
573};
574
585
590 uint8_t proto;
591};
592
597
599 union {
601 uint32_t ipv4;
602
604 uint8_t ipv6[16];
606
608 uint16_t port;
609};
610
622 int drop;
623
630};
631
639};
640
646 uint64_t n_packets;
647};
648
660
667};
668
675 uint64_t n_packets;
676
681 uint64_t n_bytes;
682};
683
687 uint64_t n_packets;
688
690 uint64_t n_bytes;
691
694
697};
698
705 uint64_t time;
706};
707
711#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX
712#define RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX (16)
713#endif
714
715#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX
716#define RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX (16)
717#endif
718
719#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET
720#define RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET \
721 (sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op))
722#endif
723
726 uint8_t *val;
727 uint32_t length;
728 uint32_t offset;
729};
730
735
740 uint32_t op_offset;
741
744
747};
748
751
754
760 uint32_t data_offset;
761
762 union {
763 struct {
766
769
772
775
776 } cipher_auth;
777
778 struct {
781
784
787
790
791 } aead;
792 };
793};
794
801 uint32_t tag;
802};
803
810 uint16_t n;
811};
812
816struct rte_table_action_profile;
817
826__rte_experimental
827struct rte_table_action_profile *
829
838__rte_experimental
839int
840rte_table_action_profile_free(struct rte_table_action_profile *profile);
841
857__rte_experimental
858int
859rte_table_action_profile_action_register(struct rte_table_action_profile *profile,
860 enum rte_table_action_type type,
861 void *action_config);
862
878__rte_experimental
879int
880rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
881
885struct rte_table_action;
886
902__rte_experimental
903struct rte_table_action *
904rte_table_action_create(struct rte_table_action_profile *profile,
905 uint32_t socket_id);
906
915__rte_experimental
916int
917rte_table_action_free(struct rte_table_action *action);
918
929__rte_experimental
930int
931rte_table_action_table_params_get(struct rte_table_action *action,
932 struct rte_pipeline_table_params *params);
933
952__rte_experimental
953int
954rte_table_action_apply(struct rte_table_action *action,
955 void *data,
956 enum rte_table_action_type type,
957 void *action_params);
958
972__rte_experimental
973int
974rte_table_action_dscp_table_update(struct rte_table_action *action,
975 uint64_t dscp_mask,
976 struct rte_table_action_dscp_table *table);
977
992__rte_experimental
993int
994rte_table_action_meter_profile_add(struct rte_table_action *action,
995 uint32_t meter_profile_id,
996 struct rte_table_action_meter_profile *profile);
997
1009__rte_experimental
1010int
1011rte_table_action_meter_profile_delete(struct rte_table_action *action,
1012 uint32_t meter_profile_id);
1013
1041__rte_experimental
1042int
1043rte_table_action_meter_read(struct rte_table_action *action,
1044 void *data,
1045 uint32_t tc_mask,
1046 struct rte_table_action_mtr_counters *stats,
1047 int clear);
1048
1068__rte_experimental
1069int
1070rte_table_action_ttl_read(struct rte_table_action *action,
1071 void *data,
1072 struct rte_table_action_ttl_counters *stats,
1073 int clear);
1074
1094__rte_experimental
1095int
1096rte_table_action_stats_read(struct rte_table_action *action,
1097 void *data,
1098 struct rte_table_action_stats_counters *stats,
1099 int clear);
1100
1115__rte_experimental
1116int
1117rte_table_action_time_read(struct rte_table_action *action,
1118 void *data,
1119 uint64_t *timestamp);
1120
1131__rte_experimental
1133rte_table_action_crypto_sym_session_get(struct rte_table_action *action,
1134 void *data);
1135
1136#ifdef __cplusplus
1137}
1138#endif
1139
1140#endif /* __INCLUDE_RTE_TABLE_ACTION_H__ */
#define RTE_STD_C11
Definition: rte_common.h:42
rte_color
Definition: rte_meter.h:36
@ RTE_COLORS
Definition: rte_meter.h:40
rte_pipeline_action
Definition: rte_pipeline.h:181
__rte_experimental int rte_table_action_table_params_get(struct rte_table_action *action, struct rte_pipeline_table_params *params)
__rte_experimental int rte_table_action_apply(struct rte_table_action *action, void *data, enum rte_table_action_type type, void *action_params)
__rte_experimental int rte_table_action_meter_profile_delete(struct rte_table_action *action, uint32_t meter_profile_id)
#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX
__rte_experimental int rte_table_action_free(struct rte_table_action *action)
__rte_experimental int rte_table_action_meter_profile_add(struct rte_table_action *action, uint32_t meter_profile_id, struct rte_table_action_meter_profile *profile)
rte_table_action_policer
@ RTE_TABLE_ACTION_POLICER_COLOR_RED
@ RTE_TABLE_ACTION_POLICER_COLOR_GREEN
@ RTE_TABLE_ACTION_POLICER_COLOR_YELLOW
@ RTE_TABLE_ACTION_POLICER_MAX
@ RTE_TABLE_ACTION_POLICER_DROP
__rte_experimental struct rte_table_action_profile * rte_table_action_profile_create(struct rte_table_action_common_config *common)
__rte_experimental int rte_table_action_stats_read(struct rte_table_action *action, void *data, struct rte_table_action_stats_counters *stats, int clear)
__rte_experimental struct rte_cryptodev_sym_session * rte_table_action_crypto_sym_session_get(struct rte_table_action *action, void *data)
__rte_experimental int rte_table_action_profile_action_register(struct rte_table_action_profile *profile, enum rte_table_action_type type, void *action_config)
__rte_experimental int rte_table_action_dscp_table_update(struct rte_table_action *action, uint64_t dscp_mask, struct rte_table_action_dscp_table *table)
__rte_experimental int rte_table_action_meter_read(struct rte_table_action *action, void *data, uint32_t tc_mask, struct rte_table_action_mtr_counters *stats, int clear)
__rte_experimental int rte_table_action_ttl_read(struct rte_table_action *action, void *data, struct rte_table_action_ttl_counters *stats, int clear)
#define RTE_TABLE_ACTION_MPLS_LABELS_MAX
__rte_experimental int rte_table_action_time_read(struct rte_table_action *action, void *data, uint64_t *timestamp)
rte_table_action_encap_type
@ RTE_TABLE_ACTION_ENCAP_VLAN
@ RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE
@ RTE_TABLE_ACTION_ENCAP_MPLS
@ RTE_TABLE_ACTION_ENCAP_VXLAN
@ RTE_TABLE_ACTION_ENCAP_QINQ
@ RTE_TABLE_ACTION_ENCAP_PPPOE
@ RTE_TABLE_ACTION_ENCAP_ETHER
rte_table_action_type
@ RTE_TABLE_ACTION_TAG
@ RTE_TABLE_ACTION_STATS
@ RTE_TABLE_ACTION_TIME
@ RTE_TABLE_ACTION_NAT
@ RTE_TABLE_ACTION_TTL
@ RTE_TABLE_ACTION_DECAP
@ RTE_TABLE_ACTION_MTR
@ RTE_TABLE_ACTION_SYM_CRYPTO
@ RTE_TABLE_ACTION_TM
@ RTE_TABLE_ACTION_FWD
@ RTE_TABLE_ACTION_ENCAP
@ RTE_TABLE_ACTION_LB
__rte_experimental int rte_table_action_profile_free(struct rte_table_action_profile *profile)
#define RTE_TABLE_ACTION_TC_MAX
rte_table_action_meter_algorithm
@ RTE_TABLE_ACTION_METER_TRTCM
@ RTE_TABLE_ACTION_METER_SRTCM
__rte_experimental struct rte_table_action * rte_table_action_create(struct rte_table_action_profile *profile, uint32_t socket_id)
#define RTE_TABLE_ACTION_LB_TABLE_SIZE
__rte_experimental int rte_table_action_profile_freeze(struct rte_table_action_profile *profile)
uint64_t(* rte_table_hash_op_hash)(void *key, void *key_mask, uint32_t key_size, uint64_t seed)
uint32_t tc_queue_id
uint32_t tc_id
enum rte_color color
struct rte_table_action_dscp_table_entry entry[64]
struct rte_table_action_encap_config::@326::@328 vxlan
struct rte_table_action_ether_hdr ether
struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]
struct rte_table_action_ether_hdr ether
struct rte_table_action_encap_vlan_params vlan
struct rte_table_action_encap_pppoe_params pppoe
enum rte_table_action_encap_type type
struct rte_table_action_encap_vxlan_params vxlan
struct rte_table_action_encap_qinq_params qinq
struct rte_table_action_encap_mpls_params mpls
struct rte_table_encap_ether_qinq_pppoe qinq_pppoe
struct rte_table_action_encap_ether_params ether
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
struct rte_table_action_ether_hdr ether
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_vlan_hdr cvlan
struct rte_table_action_vlan_hdr vlan
struct rte_table_action_ether_hdr ether
struct rte_table_action_udp_header udp
struct rte_table_action_vxlan_hdr vxlan
struct rte_table_action_vlan_hdr vlan
struct rte_table_action_ipv4_header ipv4
struct rte_table_action_ether_hdr ether
struct rte_table_action_ipv6_header ipv6
struct rte_ether_addr sa
struct rte_ether_addr da
enum rte_pipeline_action action
rte_table_hash_op_hash f_hash
uint8_t key_mask[RTE_TABLE_ACTION_LB_KEY_SIZE_MAX]
uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE]
struct rte_meter_srtcm_params srtcm
struct rte_meter_trtcm_params trtcm
enum rte_table_action_meter_algorithm alg
enum rte_table_action_meter_algorithm alg
struct rte_table_action_mtr_counters_tc stats[RTE_TABLE_ACTION_TC_MAX]
struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX]
enum rte_table_action_policer policer[RTE_COLORS]
union rte_table_action_nat_params::@331 addr
struct rte_table_action_vlo aad_update
struct rte_table_action_vlo aad
struct rte_table_action_vlo cipher_iv_update
struct rte_table_action_vlo cipher_iv
struct rte_table_action_vlo iv
struct rte_table_action_vlo auth_iv_update
struct rte_crypto_sym_xform * xform
struct rte_table_action_vlo auth_iv
struct rte_table_action_vlo iv_update
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_vlan_hdr cvlan