DPDK 23.11.2
Loading...
Searching...
No Matches
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
56extern "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
106
119
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
168
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
213
222
236
254
263
284
310
324
336
348
352 uint32_t subport_id;
353
355 uint32_t pipe_id;
356};
357
386
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
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
444
450
457
459#ifndef RTE_TABLE_ACTION_MPLS_LABELS_MAX
460#define RTE_TABLE_ACTION_MPLS_LABELS_MAX 4
461#endif
462
477
483
497
506 uint64_t encap_mask;
507
509 union {
510 struct {
516 uint32_t data_offset;
517
521 int vlan;
522
529 };
530};
531
541
570
581
586 uint8_t proto;
587};
588
593
595 union {
597 uint32_t ipv4;
598
600 uint8_t ipv6[16];
602
604 uint16_t port;
605};
606
627
636
644
664
671 uint64_t n_packets;
672
677 uint64_t n_bytes;
678};
679
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
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
812struct rte_table_action_profile;
813
822__rte_experimental
823struct rte_table_action_profile *
825
834__rte_experimental
835int
836rte_table_action_profile_free(struct rte_table_action_profile *profile);
837
853__rte_experimental
854int
855rte_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
875int
876rte_table_action_profile_freeze(struct rte_table_action_profile *profile);
877
881struct rte_table_action;
882
898__rte_experimental
899struct rte_table_action *
900rte_table_action_create(struct rte_table_action_profile *profile,
901 uint32_t socket_id);
902
911__rte_experimental
912int
913rte_table_action_free(struct rte_table_action *action);
914
925__rte_experimental
926int
927rte_table_action_table_params_get(struct rte_table_action *action,
928 struct rte_pipeline_table_params *params);
929
948__rte_experimental
949int
950rte_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
969int
970rte_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
989int
990rte_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
1006int
1007rte_table_action_meter_profile_delete(struct rte_table_action *action,
1008 uint32_t meter_profile_id);
1009
1037__rte_experimental
1038int
1039rte_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
1065int
1066rte_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
1091int
1092rte_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
1112int
1113rte_table_action_time_read(struct rte_table_action *action,
1114 void *data,
1115 uint64_t *timestamp);
1116
1127__rte_experimental
1128struct rte_cryptodev_sym_session *
1129rte_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_color
Definition rte_meter.h:32
@ RTE_COLORS
Definition rte_meter.h:36
rte_pipeline_action
__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_apply(struct rte_table_action *action, void *data, enum rte_table_action_type type, void *action_params)
__rte_experimental int rte_table_action_meter_profile_delete(struct rte_table_action *action, uint32_t meter_profile_id)
#define RTE_TABLE_ACTION_LB_KEY_SIZE_MAX
__rte_experimental int rte_table_action_free(struct rte_table_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)
rte_table_action_policer
@ RTE_TABLE_ACTION_POLICER_COLOR_RED
@ RTE_TABLE_ACTION_POLICER_COLOR_GREEN
@ RTE_TABLE_ACTION_POLICER_COLOR_YELLOW
@ RTE_TABLE_ACTION_POLICER_MAX
@ RTE_TABLE_ACTION_POLICER_DROP
__rte_experimental struct rte_table_action_profile * rte_table_action_profile_create(struct rte_table_action_common_config *common)
__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_cryptodev_sym_session * rte_table_action_crypto_sym_session_get(struct rte_table_action *action, void *data)
__rte_experimental int rte_table_action_profile_action_register(struct rte_table_action_profile *profile, enum rte_table_action_type type, void *action_config)
__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)
__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 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_MPLS_LABELS_MAX
__rte_experimental int rte_table_action_time_read(struct rte_table_action *action, void *data, uint64_t *timestamp)
rte_table_action_encap_type
@ RTE_TABLE_ACTION_ENCAP_VLAN
@ RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE
@ RTE_TABLE_ACTION_ENCAP_MPLS
@ RTE_TABLE_ACTION_ENCAP_VXLAN
@ RTE_TABLE_ACTION_ENCAP_QINQ
@ RTE_TABLE_ACTION_ENCAP_PPPOE
@ RTE_TABLE_ACTION_ENCAP_ETHER
rte_table_action_type
@ RTE_TABLE_ACTION_TAG
@ RTE_TABLE_ACTION_STATS
@ RTE_TABLE_ACTION_TIME
@ RTE_TABLE_ACTION_NAT
@ RTE_TABLE_ACTION_TTL
@ RTE_TABLE_ACTION_DECAP
@ RTE_TABLE_ACTION_MTR
@ RTE_TABLE_ACTION_SYM_CRYPTO
@ RTE_TABLE_ACTION_TM
@ RTE_TABLE_ACTION_FWD
@ RTE_TABLE_ACTION_ENCAP
@ RTE_TABLE_ACTION_LB
__rte_experimental int rte_table_action_profile_free(struct rte_table_action_profile *profile)
#define RTE_TABLE_ACTION_TC_MAX
rte_table_action_meter_algorithm
@ RTE_TABLE_ACTION_METER_TRTCM
@ RTE_TABLE_ACTION_METER_SRTCM
__rte_experimental struct rte_table_action * rte_table_action_create(struct rte_table_action_profile *profile, uint32_t socket_id)
#define RTE_TABLE_ACTION_LB_TABLE_SIZE
__rte_experimental int rte_table_action_profile_freeze(struct rte_table_action_profile *profile)
uint64_t(* rte_table_hash_op_hash)(void *key, void *key_mask, uint32_t key_size, uint64_t seed)
uint32_t tc_queue_id
uint32_t tc_id
enum rte_color color
struct rte_table_action_dscp_table_entry entry[64]
struct rte_table_action_encap_config::@369::@371 vxlan
struct rte_table_action_ether_hdr ether
struct rte_table_action_mpls_hdr mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]
struct rte_table_action_ether_hdr ether
struct rte_table_action_encap_vlan_params vlan
struct rte_table_action_encap_pppoe_params pppoe
enum rte_table_action_encap_type type
struct rte_table_action_encap_vxlan_params vxlan
struct rte_table_action_encap_qinq_params qinq
struct rte_table_action_encap_mpls_params mpls
struct rte_table_encap_ether_qinq_pppoe qinq_pppoe
struct rte_table_action_encap_ether_params ether
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
struct rte_table_action_ether_hdr ether
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_vlan_hdr cvlan
struct rte_table_action_vlan_hdr vlan
struct rte_table_action_ether_hdr ether
struct rte_table_action_udp_header udp
struct rte_table_action_vxlan_hdr vxlan
struct rte_table_action_vlan_hdr vlan
struct rte_table_action_ether_hdr ether
struct rte_ether_addr sa
struct rte_ether_addr da
enum rte_pipeline_action action
rte_table_hash_op_hash f_hash
uint8_t key_mask[RTE_TABLE_ACTION_LB_KEY_SIZE_MAX]
uint32_t out[RTE_TABLE_ACTION_LB_TABLE_SIZE]
struct rte_meter_srtcm_params srtcm
struct rte_meter_trtcm_params trtcm
enum rte_table_action_meter_algorithm alg
enum rte_table_action_meter_algorithm alg
struct rte_table_action_mtr_counters_tc stats[RTE_TABLE_ACTION_TC_MAX]
struct rte_table_action_mtr_tc_params mtr[RTE_TABLE_ACTION_TC_MAX]
enum rte_table_action_policer policer[RTE_COLORS]
union rte_table_action_nat_params::@374 addr
struct rte_crypto_sym_xform * xform
struct rte_table_action_pppoe_hdr pppoe
struct rte_table_action_ether_hdr ether
struct rte_table_action_vlan_hdr svlan
struct rte_table_action_vlan_hdr cvlan