DPDK  24.11.0-rc3
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
66 extern "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 
127  enum rte_pipeline_action action;
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 
206  enum rte_color color;
207 };
208 
213 };
214 
219 
222 };
223 
228 
229  union {
232 
235  };
236 };
237 
242 
245 
248 
251 
254 };
255 
260 
263 };
264 
271  uint64_t n_packets[RTE_COLORS];
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 
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 
423  struct rte_ipv6_addr sa;
424  struct rte_ipv6_addr da;
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 
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 
529  } vxlan;
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 
601  struct rte_ipv6_addr ipv6;
602  } addr;
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 
731  uint8_t cryptodev_id;
732 
737  uint32_t op_offset;
738 
741 
744 };
745 
748 
751 
757  uint32_t data_offset;
758 
759  union {
760  struct {
762  struct rte_table_action_vlo cipher_iv;
763 
765  struct rte_table_action_vlo cipher_iv_update;
766 
768  struct rte_table_action_vlo auth_iv;
769 
771  struct rte_table_action_vlo auth_iv_update;
772 
773  } cipher_auth;
774 
775  struct {
778 
781 
783  struct rte_table_action_vlo aad_update;
784 
786  struct rte_table_action_vlo iv_update;
787 
788  } aead;
789  };
790 };
791 
798  uint32_t tag;
799 };
800 
807  uint16_t n;
808 };
809 
813 struct rte_table_action_profile;
814 
823 __rte_experimental
824 struct rte_table_action_profile *
826 
835 __rte_experimental
836 int
837 rte_table_action_profile_free(struct rte_table_action_profile *profile);
838 
854 __rte_experimental
855 int
856 rte_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
876 int
877 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
878 
882 struct rte_table_action;
883 
899 __rte_experimental
900 struct rte_table_action *
901 rte_table_action_create(struct rte_table_action_profile *profile,
902  uint32_t socket_id);
903 
912 __rte_experimental
913 int
914 rte_table_action_free(struct rte_table_action *action);
915 
926 __rte_experimental
927 int
928 rte_table_action_table_params_get(struct rte_table_action *action,
929  struct rte_pipeline_table_params *params);
930 
949 __rte_experimental
950 int
951 rte_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
970 int
971 rte_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
990 int
991 rte_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
1007 int
1008 rte_table_action_meter_profile_delete(struct rte_table_action *action,
1009  uint32_t meter_profile_id);
1010 
1038 __rte_experimental
1039 int
1040 rte_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
1066 int
1067 rte_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
1092 int
1093 rte_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
1113 int
1114 rte_table_action_time_read(struct rte_table_action *action,
1115  void *data,
1116  uint64_t *timestamp);
1117 
1128 __rte_experimental
1129 struct rte_cryptodev_sym_session *
1130 rte_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_table_hash_op_hash f_hash
struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]
__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
__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_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)
rte_pipeline_action
Definition: rte_pipeline.h:178
#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
__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)
#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX
__rte_experimental int rte_table_action_profile_free(struct rte_table_action_profile *profile)
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)
uint64_t(* rte_table_hash_op_hash)(void *key, void *key_mask, uint32_t key_size, uint64_t seed)
rte_color
Definition: rte_meter.h:32
rte_table_action_type
__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_experimental int rte_table_action_meter_profile_delete(struct rte_table_action *action, uint32_t meter_profile_id)
rte_table_action_encap_type
__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)
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_crypto_sym_xform * xform