DPDK  21.02.0
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
56 extern "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 
254 };
255 
260 
263 };
264 
272 
277  uint64_t n_bytes[RTE_COLORS];
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 
476  int unicast;
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 
531  } vxlan;
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];
605  } addr;
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 
734  uint8_t cryptodev_id;
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 
816 struct rte_table_action_profile;
817 
826 __rte_experimental
827 struct rte_table_action_profile *
829 
838 __rte_experimental
839 int
840 rte_table_action_profile_free(struct rte_table_action_profile *profile);
841 
857 __rte_experimental
858 int
859 rte_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
879 int
880 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
881 
885 struct rte_table_action;
886 
902 __rte_experimental
903 struct rte_table_action *
904 rte_table_action_create(struct rte_table_action_profile *profile,
905  uint32_t socket_id);
906 
915 __rte_experimental
916 int
917 rte_table_action_free(struct rte_table_action *action);
918 
929 __rte_experimental
930 int
931 rte_table_action_table_params_get(struct rte_table_action *action,
932  struct rte_pipeline_table_params *params);
933 
952 __rte_experimental
953 int
954 rte_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
973 int
974 rte_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
993 int
994 rte_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
1010 int
1011 rte_table_action_meter_profile_delete(struct rte_table_action *action,
1012  uint32_t meter_profile_id);
1013 
1041 __rte_experimental
1042 int
1043 rte_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
1069 int
1070 rte_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
1095 int
1096 rte_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
1116 int
1117 rte_table_action_time_read(struct rte_table_action *action,
1118  void *data,
1119  uint64_t *timestamp);
1120 
1131 __rte_experimental
1133 rte_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__ */
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_vlo iv_update
rte_table_hash_op_hash f_hash
struct rte_table_action_encap_config::@282::@284 vxlan
struct rte_table_action_udp_header udp
enum rte_table_action_policer policer[RTE_COLORS]
struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]
struct rte_table_action_ipv4_header ipv4
__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_TC_MAX
struct rte_table_action_vlo auth_iv
struct rte_table_action_encap_qinq_params qinq
enum rte_table_action_encap_type type
enum rte_color color
__rte_experimental int rte_table_action_stats_read(struct rte_table_action *action, void *data, struct rte_table_action_stats_counters *stats, int clear)
struct rte_table_action_encap_vlan_params vlan
struct rte_table_action_vlo auth_iv_update
uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE]
struct rte_meter_trtcm_params trtcm
__rte_experimental struct rte_table_action * rte_table_action_create(struct rte_table_action_profile *profile, uint32_t socket_id)
__rte_experimental struct rte_cryptodev_sym_session * rte_table_action_crypto_sym_session_get(struct rte_table_action *action, void *data)
struct rte_table_action_ether_hdr ether
union rte_table_action_nat_params::@287 addr
rte_pipeline_action
Definition: rte_pipeline.h:181
struct rte_table_action_vlan_hdr vlan
struct rte_table_action_vlo aad
struct rte_table_action_ether_hdr ether
#define RTE_TABLE_ACTION_LB_TABLE_SIZE
__rte_experimental int rte_table_action_profile_freeze(struct rte_table_action_profile *profile)
uint32_t tc_id
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_vlan_hdr cvlan
__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)
enum rte_table_action_meter_algorithm alg
#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX
struct rte_table_action_dscp_table_entry entry[64]
struct rte_table_action_vlan_hdr vlan
__rte_experimental int rte_table_action_profile_free(struct rte_table_action_profile *profile)
struct rte_table_action_mtr_counters_tc stats[RTE_TABLE_ACTION_TC_MAX]
rte_table_action_policer
__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 struct rte_table_action_profile * rte_table_action_profile_create(struct rte_table_action_common_config *common)
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_ether_hdr ether
struct rte_table_action_ether_hdr ether
uint64_t(* rte_table_hash_op_hash)(void *key, void *key_mask, uint32_t key_size, uint64_t seed)
struct rte_table_action_vlo aad_update
struct rte_table_action_vlo cipher_iv_update
struct rte_table_action_ipv6_header ipv6
uint8_t key_mask[RTE_TABLE_ACTION_LB_KEY_SIZE_MAX]
struct rte_table_action_encap_ether_params ether
struct rte_table_action_encap_vxlan_params vxlan
rte_color
Definition: rte_meter.h:36
struct rte_table_action_vlan_hdr cvlan
#define RTE_STD_C11
Definition: rte_common.h:40
struct rte_table_action_encap_mpls_params mpls
enum rte_table_action_meter_algorithm alg
rte_table_action_type
enum rte_pipeline_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)
struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX]
__rte_experimental int rte_table_action_meter_profile_delete(struct rte_table_action *action, uint32_t meter_profile_id)
struct rte_ether_addr da
struct rte_table_action_vlo iv
struct rte_table_action_vlo cipher_iv
rte_table_action_encap_type
struct rte_meter_srtcm_params srtcm
__rte_experimental int rte_table_action_profile_action_register(struct rte_table_action_profile *profile, enum rte_table_action_type type, void *action_config)
#define RTE_TABLE_ACTION_MPLS_LABELS_MAX
rte_table_action_meter_algorithm
__rte_experimental int rte_table_action_time_read(struct rte_table_action *action, void *data, uint64_t *timestamp)
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
struct rte_table_action_encap_pppoe_params pppoe
struct rte_table_encap_ether_qinq_pppoe qinq_pppoe
uint32_t tc_queue_id
__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_table_params_get(struct rte_table_action *action, struct rte_pipeline_table_params *params)
__rte_experimental int rte_table_action_free(struct rte_table_action *action)
struct rte_table_action_ether_hdr ether
struct rte_crypto_sym_xform * xform
struct rte_ether_addr sa
struct rte_table_action_ether_hdr ether
struct rte_table_action_vxlan_hdr vxlan