DPDK  18.11.11
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 
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 };
384 
387  struct ether_addr da;
388  struct ether_addr sa;
389 };
390 
393  uint8_t pcp;
394  uint8_t dei;
395  uint16_t vid;
396 };
397 
400  uint32_t label;
401  uint8_t tc;
402  uint8_t ttl;
403 };
404 
407  uint16_t session_id;
408 };
409 
412  uint32_t sa;
413  uint32_t da;
414  uint8_t dscp;
415  uint8_t ttl;
416 };
417 
420  uint8_t sa[16];
421  uint8_t da[16];
422  uint32_t flow_label;
423  uint8_t dscp;
424  uint8_t hop_limit;
425 };
426 
429  uint16_t sp;
430  uint16_t dp;
431 };
432 
435  uint32_t vni;
436 };
437 
441 };
442 
447 };
448 
454 };
455 
457 #ifndef RTE_TABLE_ACTION_MPLS_LABELS_MAX
458 #define RTE_TABLE_ACTION_MPLS_LABELS_MAX 4
459 #endif
460 
465 
468 
470  uint32_t mpls_count;
471 
473  int unicast;
474 };
475 
480 };
481 
488  union {
491  };
492 
495 };
496 
505  uint64_t encap_mask;
506 
509  union {
510  struct {
516  uint32_t data_offset;
517 
521  int vlan;
522 
528  } vxlan;
529  };
530 };
531 
536 
538  union {
541 
544 
547 
550 
553 
556  };
557 };
558 
569 
574  uint8_t proto;
575 };
576 
581 
583  union {
585  uint32_t ipv4;
586 
588  uint8_t ipv6[16];
589  } addr;
590 
592  uint16_t port;
593 };
594 
606  int drop;
607 
614 };
615 
623 };
624 
630  uint64_t n_packets;
631 };
632 
644 
651 };
652 
659  uint64_t n_packets;
660 
665  uint64_t n_bytes;
666 };
667 
671  uint64_t n_packets;
672 
674  uint64_t n_bytes;
675 
678 
681 };
682 
689  uint64_t time;
690 };
691 
695 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX
696 #define RTE_TABLE_ACTION_SYM_CRYPTO_IV_SIZE_MAX (16)
697 #endif
698 
699 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX
700 #define RTE_TABLE_ACTION_SYM_CRYPTO_AAD_SIZE_MAX (16)
701 #endif
702 
703 #ifndef RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET
704 #define RTE_TABLE_ACTION_SYM_CRYPTO_IV_OFFSET \
705  (sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op))
706 #endif
707 
710  uint8_t *val;
711  uint32_t length;
712  uint32_t offset;
713 };
714 
718  uint8_t cryptodev_id;
719 
724  uint32_t op_offset;
725 
728 
731 };
732 
735 
738 
744  uint32_t data_offset;
745 
746  union {
747  struct {
750 
753 
756 
759 
760  } cipher_auth;
761 
762  struct {
765 
768 
771 
774 
775  } aead;
776  };
777 };
778 
785  uint32_t tag;
786 };
787 
794  uint16_t n;
795 };
796 
800 struct rte_table_action_profile;
801 
810 struct rte_table_action_profile * __rte_experimental
812 
821 int __rte_experimental
822 rte_table_action_profile_free(struct rte_table_action_profile *profile);
823 
839 int __rte_experimental
840 rte_table_action_profile_action_register(struct rte_table_action_profile *profile,
841  enum rte_table_action_type type,
842  void *action_config);
843 
859 int __rte_experimental
860 rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
861 
865 struct rte_table_action;
866 
882 struct rte_table_action * __rte_experimental
883 rte_table_action_create(struct rte_table_action_profile *profile,
884  uint32_t socket_id);
885 
894 int __rte_experimental
895 rte_table_action_free(struct rte_table_action *action);
896 
907 int __rte_experimental
908 rte_table_action_table_params_get(struct rte_table_action *action,
909  struct rte_pipeline_table_params *params);
910 
929 int __rte_experimental
930 rte_table_action_apply(struct rte_table_action *action,
931  void *data,
932  enum rte_table_action_type type,
933  void *action_params);
934 
948 int __rte_experimental
949 rte_table_action_dscp_table_update(struct rte_table_action *action,
950  uint64_t dscp_mask,
951  struct rte_table_action_dscp_table *table);
952 
967 int __rte_experimental
968 rte_table_action_meter_profile_add(struct rte_table_action *action,
969  uint32_t meter_profile_id,
970  struct rte_table_action_meter_profile *profile);
971 
983 int __rte_experimental
984 rte_table_action_meter_profile_delete(struct rte_table_action *action,
985  uint32_t meter_profile_id);
986 
1014 int __rte_experimental
1015 rte_table_action_meter_read(struct rte_table_action *action,
1016  void *data,
1017  uint32_t tc_mask,
1018  struct rte_table_action_mtr_counters *stats,
1019  int clear);
1020 
1040 int __rte_experimental
1041 rte_table_action_ttl_read(struct rte_table_action *action,
1042  void *data,
1043  struct rte_table_action_ttl_counters *stats,
1044  int clear);
1045 
1065 int __rte_experimental
1066 rte_table_action_stats_read(struct rte_table_action *action,
1067  void *data,
1068  struct rte_table_action_stats_counters *stats,
1069  int clear);
1070 
1085 int __rte_experimental
1086 rte_table_action_time_read(struct rte_table_action *action,
1087  void *data,
1088  uint64_t *timestamp);
1089 
1100 struct rte_cryptodev_sym_session *__rte_experimental
1101 rte_table_action_crypto_sym_session_get(struct rte_table_action *action,
1102  void *data);
1103 
1104 #ifdef __cplusplus
1105 }
1106 #endif
1107 
1108 #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
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
rte_meter_color
Definition: rte_meter.h:30
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
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
union rte_table_action_nat_params::@217 addr
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)
enum rte_table_action_meter_algorithm alg
enum rte_meter_color color
#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
struct rte_table_action_encap_config::@212::@214 vxlan
int __rte_experimental rte_table_action_profile_free(struct rte_table_action_profile *profile)
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
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
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:37
struct rte_table_action_encap_mpls_params mpls
enum rte_table_action_meter_algorithm alg
rte_table_action_type
uint64_t n_bytes[e_RTE_METER_COLORS]
enum rte_pipeline_action action
struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX]
struct rte_table_action_vlo iv
struct rte_table_action_vlo cipher_iv
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
enum rte_table_action_policer policer[e_RTE_METER_COLORS]
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
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
uint64_t n_packets[e_RTE_METER_COLORS]
struct rte_crypto_sym_xform * xform
int __rte_experimental rte_table_action_profile_freeze(struct rte_table_action_profile *profile)
struct rte_table_action_ether_hdr ether
struct rte_table_action_vxlan_hdr vxlan