DPDK  19.08.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 #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 4
185 
187 #define RTE_TABLE_ACTION_TC_QUEUE_MAX 4
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 struct rte_table_action_profile * __rte_experimental
828 
837 int __rte_experimental
838 rte_table_action_profile_free(struct rte_table_action_profile *profile);
839 
855 int __rte_experimental
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 int __rte_experimental
876 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
877 
881 struct rte_table_action;
882 
898 struct rte_table_action * __rte_experimental
899 rte_table_action_create(struct rte_table_action_profile *profile,
900  uint32_t socket_id);
901 
910 int __rte_experimental
911 rte_table_action_free(struct rte_table_action *action);
912 
923 int __rte_experimental
924 rte_table_action_table_params_get(struct rte_table_action *action,
925  struct rte_pipeline_table_params *params);
926 
945 int __rte_experimental
946 rte_table_action_apply(struct rte_table_action *action,
947  void *data,
948  enum rte_table_action_type type,
949  void *action_params);
950 
964 int __rte_experimental
965 rte_table_action_dscp_table_update(struct rte_table_action *action,
966  uint64_t dscp_mask,
967  struct rte_table_action_dscp_table *table);
968 
983 int __rte_experimental
984 rte_table_action_meter_profile_add(struct rte_table_action *action,
985  uint32_t meter_profile_id,
986  struct rte_table_action_meter_profile *profile);
987 
999 int __rte_experimental
1000 rte_table_action_meter_profile_delete(struct rte_table_action *action,
1001  uint32_t meter_profile_id);
1002 
1030 int __rte_experimental
1031 rte_table_action_meter_read(struct rte_table_action *action,
1032  void *data,
1033  uint32_t tc_mask,
1034  struct rte_table_action_mtr_counters *stats,
1035  int clear);
1036 
1056 int __rte_experimental
1057 rte_table_action_ttl_read(struct rte_table_action *action,
1058  void *data,
1059  struct rte_table_action_ttl_counters *stats,
1060  int clear);
1061 
1081 int __rte_experimental
1082 rte_table_action_stats_read(struct rte_table_action *action,
1083  void *data,
1084  struct rte_table_action_stats_counters *stats,
1085  int clear);
1086 
1101 int __rte_experimental
1102 rte_table_action_time_read(struct rte_table_action *action,
1103  void *data,
1104  uint64_t *timestamp);
1105 
1116 struct rte_cryptodev_sym_session *__rte_experimental
1117 rte_table_action_crypto_sym_session_get(struct rte_table_action *action,
1118  void *data);
1119 
1120 #ifdef __cplusplus
1121 }
1122 #endif
1123 
1124 #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
int __rte_experimental 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_udp_header udp
enum rte_table_action_policer policer[RTE_COLORS]
struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]
int __rte_experimental rte_table_action_ttl_read(struct rte_table_action *action, void *data, struct rte_table_action_ttl_counters *stats, int clear)
struct rte_table_action_ipv4_header ipv4
#define RTE_TABLE_ACTION_TC_MAX
struct rte_table_action_vlo auth_iv
int __rte_experimental rte_table_action_free(struct rte_table_action *action)
struct rte_table_action_encap_qinq_params qinq
enum rte_table_action_encap_type type
enum rte_color color
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
struct rte_table_action_ether_hdr ether
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
struct rte_table_action_profile *__rte_experimental rte_table_action_profile_create(struct rte_table_action_common_config *common)
uint32_t tc_id
struct rte_table_action_vlan_hdr svlan
int __rte_experimental rte_table_action_table_params_get(struct rte_table_action *action, struct rte_pipeline_table_params *params)
struct rte_table_action_vlan_hdr cvlan
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
struct rte_table_action_mtr_counters_tc stats[RTE_TABLE_ACTION_TC_MAX]
rte_table_action_policer
int __rte_experimental rte_table_action_profile_free(struct rte_table_action_profile *profile)
struct rte_table_action_vlan_hdr svlan
int __rte_experimental 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)
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
union rte_table_action_nat_params::@220 addr
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
int __rte_experimental rte_table_action_time_read(struct rte_table_action *action, void *data, uint64_t *timestamp)
int __rte_experimental rte_table_action_profile_action_register(struct rte_table_action_profile *profile, enum rte_table_action_type type, void *action_config)
int __rte_experimental rte_table_action_apply(struct rte_table_action *action, void *data, enum rte_table_action_type type, void *action_params)
struct rte_table_action_encap_vxlan_params vxlan
rte_color
Definition: rte_meter.h:36
struct rte_table_action_vlan_hdr cvlan
struct rte_cryptodev_sym_session *__rte_experimental rte_table_action_crypto_sym_session_get(struct rte_table_action *action, void *data)
#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
struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX]
struct rte_ether_addr da
struct rte_table_action_vlo iv
struct rte_table_action_vlo cipher_iv
struct rte_table_action_encap_config::@215::@217 vxlan
struct rte_table_action *__rte_experimental rte_table_action_create(struct rte_table_action_profile *profile, uint32_t socket_id)
rte_table_action_encap_type
struct rte_meter_srtcm_params srtcm
#define RTE_TABLE_ACTION_MPLS_LABELS_MAX
rte_table_action_meter_algorithm
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
int __rte_experimental rte_table_action_meter_profile_add(struct rte_table_action *action, uint32_t meter_profile_id, struct rte_table_action_meter_profile *profile)
int __rte_experimental rte_table_action_meter_profile_delete(struct rte_table_action *action, uint32_t meter_profile_id)
struct rte_table_action_encap_pppoe_params pppoe
struct rte_table_encap_ether_qinq_pppoe qinq_pppoe
int __rte_experimental rte_table_action_dscp_table_update(struct rte_table_action *action, uint64_t dscp_mask, struct rte_table_action_dscp_table *table)
uint32_t tc_queue_id
struct rte_table_action_ether_hdr ether
struct rte_crypto_sym_xform * xform
int __rte_experimental rte_table_action_profile_freeze(struct rte_table_action_profile *profile)
struct rte_ether_addr sa
struct rte_table_action_ether_hdr ether
struct rte_table_action_vxlan_hdr vxlan