DPDK 25.03.0-rc0
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#include <stdint.h>
56
57#include <rte_compat.h>
58#include <rte_ether.h>
59#include <rte_ip6.h>
60#include <rte_meter.h>
61#include <rte_table_hash.h>
62
63#include "rte_pipeline.h"
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
73
76
79
82
85
88
91
94
97
100
103
106};
107
114
118 uint32_t ip_offset;
119};
120
128
130 uint32_t id;
131};
132
137#define RTE_TABLE_ACTION_LB_KEY_SIZE_MIN 8
138
140#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX 64
141
143#define RTE_TABLE_ACTION_LB_TABLE_SIZE 8
144
148 uint32_t key_size;
149
153 uint32_t key_offset;
154
157
160
162 uint64_t seed;
163
167 uint32_t out_offset;
168};
169
179};
180
185#define RTE_TABLE_ACTION_TC_MAX 16
186
188#define RTE_TABLE_ACTION_TC_QUEUE_MAX 16
189
196 uint32_t tc_id;
197
201 uint32_t tc_queue_id;
202
207};
208
213};
214
219
222};
223
228
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
390 struct rte_ether_addr da;
391 struct rte_ether_addr sa;
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
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
490 union {
493 };
494
497};
498
507 uint64_t encap_mask;
508
510 union {
511 struct {
517 uint32_t data_offset;
518
522 int vlan;
523
530 };
531};
532
535
541};
542
547
548 union {
551
554
557
560
563
566
569 };
570};
571
582
587 uint8_t proto;
588};
589
594
596 union {
598 uint32_t ipv4;
599
603
605 uint16_t port;
606};
607
619 int drop;
620
627};
628
636};
637
643 uint64_t n_packets;
644};
645
657
664};
665
672 uint64_t n_packets;
673
678 uint64_t n_bytes;
679};
680
684 uint64_t n_packets;
685
687 uint64_t n_bytes;
688
691
694};
695
702 uint64_t time;
703};
704
708#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX
709#define RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX (16)
710#endif
711
712#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX
713#define RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX (16)
714#endif
715
716#ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET
717#define RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET \
718 (sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op))
719#endif
720
723 uint8_t *val;
724 uint32_t length;
725 uint32_t offset;
726};
727
732
737 uint32_t op_offset;
738
741
744};
745
748
751
757 uint32_t data_offset;
758
759 union {
760 struct {
763
766
769
772
773 } cipher_auth;
774
775 struct {
778
781
784
787
788 } aead;
789 };
790};
791
798 uint32_t tag;
799};
800
807 uint16_t n;
808};
809
813struct rte_table_action_profile;
814
823__rte_experimental
824struct rte_table_action_profile *
826
835__rte_experimental
836int
837rte_table_action_profile_free(struct rte_table_action_profile *profile);
838
854__rte_experimental
855int
856rte_table_action_profile_action_register(struct rte_table_action_profile *profile,
857 enum rte_table_action_type type,
858 void *action_config);
859
875__rte_experimental
876int
877rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
878
882struct rte_table_action;
883
899__rte_experimental
900struct rte_table_action *
901rte_table_action_create(struct rte_table_action_profile *profile,
902 uint32_t socket_id);
903
912__rte_experimental
913int
914rte_table_action_free(struct rte_table_action *action);
915
926__rte_experimental
927int
928rte_table_action_table_params_get(struct rte_table_action *action,
929 struct rte_pipeline_table_params *params);
930
949__rte_experimental
950int
951rte_table_action_apply(struct rte_table_action *action,
952 void *data,
953 enum rte_table_action_type type,
954 void *action_params);
955
969__rte_experimental
970int
971rte_table_action_dscp_table_update(struct rte_table_action *action,
972 uint64_t dscp_mask,
973 struct rte_table_action_dscp_table *table);
974
989__rte_experimental
990int
991rte_table_action_meter_profile_add(struct rte_table_action *action,
992 uint32_t meter_profile_id,
993 struct rte_table_action_meter_profile *profile);
994
1006__rte_experimental
1007int
1008rte_table_action_meter_profile_delete(struct rte_table_action *action,
1009 uint32_t meter_profile_id);
1010
1038__rte_experimental
1039int
1040rte_table_action_meter_read(struct rte_table_action *action,
1041 void *data,
1042 uint32_t tc_mask,
1043 struct rte_table_action_mtr_counters *stats,
1044 int clear);
1045
1065__rte_experimental
1066int
1067rte_table_action_ttl_read(struct rte_table_action *action,
1068 void *data,
1069 struct rte_table_action_ttl_counters *stats,
1070 int clear);
1071
1091__rte_experimental
1092int
1093rte_table_action_stats_read(struct rte_table_action *action,
1094 void *data,
1095 struct rte_table_action_stats_counters *stats,
1096 int clear);
1097
1112__rte_experimental
1113int
1114rte_table_action_time_read(struct rte_table_action *action,
1115 void *data,
1116 uint64_t *timestamp);
1117
1128__rte_experimental
1129struct rte_cryptodev_sym_session *
1130rte_table_action_crypto_sym_session_get(struct rte_table_action *action,
1131 void *data);
1132
1133#ifdef __cplusplus
1134}
1135#endif
1136
1137#endif /* __INCLUDE_RTE_TABLE_ACTION_H__ */
rte_color
Definition: rte_meter.h:32
@ RTE_COLORS
Definition: rte_meter.h:36
rte_pipeline_action
Definition: rte_pipeline.h:178
__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::@404::@406 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::@409 addr
struct rte_ipv6_addr ipv6
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