P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
constants.h
1/*
2Copyright 2021 Intel Corporation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef BACKENDS_DPDK_CONSTANTS_H_
18#define BACKENDS_DPDK_CONSTANTS_H_
19
20#include "lib/cstring.h"
21
22/* Unique handle for action and table */
23const unsigned table_handle_prefix = 0x00010000;
24const unsigned action_handle_prefix = 0x00020000;
25
26// Default values
27const unsigned dpdk_default_table_size = 65536;
28#define DPDK_MAX_SHIFT_AMOUNT 64
29
30// Maximum number of configurable timeout values
31const unsigned dpdk_learner_max_configurable_timeout_values = 8;
32const unsigned default_learner_table_size = 0x10000;
33// default timeout values for learner table to support common protocol states
34const unsigned default_learner_table_timeout[dpdk_learner_max_configurable_timeout_values] = {
35 10, 30, 60, 120, 300, 43200, 120, 120};
36
37// JSON schema versions
38const cstring bfrtSchemaVersion = "1.0.0";
39const cstring tdiSchemaVersion = "0.1";
40
41// HASH Values
42#define JHASH0 0
43#define CRC1 1
44#define CRC2 2
45#define CRC3 3
46#define CRC4 4
47#define JHASH5 5
48#define TOEPLITZ 6
49// Initial values for group_id and member_id for action selector and action profile tables
50const unsigned initial_member_id = 0;
51const unsigned initial_group_id = 0xFFFFFFFF;
52
53// Ipsec related constants
54#define IPSEC_SUCCESS 0
55#define IPSEC_PORT_REG_INDEX 0
56#define IPSEC_PORT_REG_SIZE 1
57#define IPSEC_PORT_REG_INDEX_BITWIDTH 32
58#define IPSEC_PORT_REG_INITVAL_BITWIDTH 32
59#define NET_TO_HOST 0
60
61// Maximum operand size for unary, binary and ternary operations
62const int dpdk_max_operand_size = 64;
63
64#endif /* BACKENDS_DPDK_CONSTANTS_H_ */
Definition cstring.h:72