DPDK  24.07.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 
126  enum rte_pipeline_action action;
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 
205  enum rte_color color;
206 };
207 
212 };
213 
218 
221 };
222 
227 
228  union {
231 
234  };
235 };
236 
241 
244 
247 
250 
253 };
254 
259 
262 };
263 
270  uint64_t n_packets[RTE_COLORS];
271 
276  uint64_t n_bytes[RTE_COLORS];
277 
280 
283 };
284 
289 
294  uint32_t n_tc;
295 
302 
309 };
310 
317 
322  uint32_t tc_mask;
323 };
324 
329 
334  uint32_t tc_mask;
335 };
336 
344 
347 };
348 
352  uint32_t subport_id;
353 
355  uint32_t pipe_id;
356 };
357 
365 
368 
371 
374 
377 
382 
385 };
386 
389  struct rte_ether_addr da;
390  struct rte_ether_addr sa;
391 };
392 
395  uint8_t pcp;
396  uint8_t dei;
397  uint16_t vid;
398 };
399 
402  uint32_t label;
403  uint8_t tc;
404  uint8_t ttl;
405 };
406 
409  uint16_t session_id;
410 };
411 
414  uint32_t sa;
415  uint32_t da;
416  uint8_t dscp;
417  uint8_t ttl;
418 };
419 
422  uint8_t sa[16];
423  uint8_t da[16];
424  uint32_t flow_label;
425  uint8_t dscp;
426  uint8_t hop_limit;
427 };
428 
431  uint16_t sp;
432  uint16_t dp;
433 };
434 
437  uint32_t vni;
438 };
439 
443 };
444 
449 };
450 
456 };
457 
459 #ifndef RTE_TABLE_ACTION_MPLS_LABELS_MAX
460 #define RTE_TABLE_ACTION_MPLS_LABELS_MAX 4
461 #endif
462 
467 
470 
472  uint32_t mpls_count;
473 
475  int unicast;
476 };
477 
482 };
483 
489  union {
492  };
493 
496 };
497 
506  uint64_t encap_mask;
507 
509  union {
510  struct {
516  uint32_t data_offset;
517 
521  int vlan;
522 
528  } vxlan;
529  };
530 };
531 
534 
540 };
541 
546 
547  union {
550 
553 
556 
559 
562 
565 
568  };
569 };
570 
581 
586  uint8_t proto;
587 };
588 
593 
595  union {
597  uint32_t ipv4;
598 
600  uint8_t ipv6[16];
601  } addr;
602 
604  uint16_t port;
605 };
606 
618  int drop;
619 
626 };
627 
635 };
636 
642  uint64_t n_packets;
643 };
644 
656 
663 };
664 
671  uint64_t n_packets;
672 
677  uint64_t n_bytes;
678 };
679 
683  uint64_t n_packets;
684 
686  uint64_t n_bytes;
687 
690 
693 };
694 
701  uint64_t time;
702 };
703 
707 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX
708 #define RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX (16)
709 #endif
710 
711 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX
712 #define RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX (16)
713 #endif
714 
715 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET
716 #define RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET \
717  (sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op))
718 #endif
719 
722  uint8_t *val;
723  uint32_t length;
724  uint32_t offset;
725 };
726 
730  uint8_t cryptodev_id;
731 
736  uint32_t op_offset;
737 
740 
743 };
744 
747 
750 
756  uint32_t data_offset;
757 
758  union {
759  struct {
761  struct rte_table_action_vlo cipher_iv;
762 
764  struct rte_table_action_vlo cipher_iv_update;
765 
767  struct rte_table_action_vlo auth_iv;
768 
770  struct rte_table_action_vlo auth_iv_update;
771 
772  } cipher_auth;
773 
774  struct {
777 
780 
782  struct rte_table_action_vlo aad_update;
783 
785  struct rte_table_action_vlo iv_update;
786 
787  } aead;
788  };
789 };
790 
797  uint32_t tag;
798 };
799 
806  uint16_t n;
807 };
808 
812 struct rte_table_action_profile;
813 
822 __rte_experimental
823 struct rte_table_action_profile *
825 
834 __rte_experimental
835 int
836 rte_table_action_profile_free(struct rte_table_action_profile *profile);
837 
853 __rte_experimental
854 int
855 rte_table_action_profile_action_register(struct rte_table_action_profile *profile,
856  enum rte_table_action_type type,
857  void *action_config);
858 
874 __rte_experimental
875 int
876 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
877 
881 struct rte_table_action;
882 
898 __rte_experimental
899 struct rte_table_action *
900 rte_table_action_create(struct rte_table_action_profile *profile,
901  uint32_t socket_id);
902 
911 __rte_experimental
912 int
913 rte_table_action_free(struct rte_table_action *action);
914 
925 __rte_experimental
926 int
927 rte_table_action_table_params_get(struct rte_table_action *action,
928  struct rte_pipeline_table_params *params);
929 
948 __rte_experimental
949 int
950 rte_table_action_apply(struct rte_table_action *action,
951  void *data,
952  enum rte_table_action_type type,
953  void *action_params);
954 
968 __rte_experimental
969 int
970 rte_table_action_dscp_table_update(struct rte_table_action *action,
971  uint64_t dscp_mask,
972  struct rte_table_action_dscp_table *table);
973 
988 __rte_experimental
989 int
990 rte_table_action_meter_profile_add(struct rte_table_action *action,
991  uint32_t meter_profile_id,
992  struct rte_table_action_meter_profile *profile);
993 
1005 __rte_experimental
1006 int
1007 rte_table_action_meter_profile_delete(struct rte_table_action *action,
1008  uint32_t meter_profile_id);
1009 
1037 __rte_experimental
1038 int
1039 rte_table_action_meter_read(struct rte_table_action *action,
1040  void *data,
1041  uint32_t tc_mask,
1042  struct rte_table_action_mtr_counters *stats,
1043  int clear);
1044 
1064 __rte_experimental
1065 int
1066 rte_table_action_ttl_read(struct rte_table_action *action,
1067  void *data,
1068  struct rte_table_action_ttl_counters *stats,
1069  int clear);
1070 
1090 __rte_experimental
1091 int
1092 rte_table_action_stats_read(struct rte_table_action *action,
1093  void *data,
1094  struct rte_table_action_stats_counters *stats,
1095  int clear);
1096 
1111 __rte_experimental
1112 int
1113 rte_table_action_time_read(struct rte_table_action *action,
1114  void *data,
1115  uint64_t *timestamp);
1116 
1127 __rte_experimental
1128 struct rte_cryptodev_sym_session *
1129 rte_table_action_crypto_sym_session_get(struct rte_table_action *action,
1130  void *data);
1131 
1132 #ifdef __cplusplus
1133 }
1134 #endif
1135 
1136 #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