Skip to content

Commit

Permalink
Merge branch 'main' into Docs-14-p4c-to-P4C-Acronym
Browse files Browse the repository at this point in the history
  • Loading branch information
AdarshRawat1 committed Apr 17, 2024
2 parents fffe129 + 5848a28 commit e906a21
Show file tree
Hide file tree
Showing 115 changed files with 1,535 additions and 544 deletions.
2 changes: 1 addition & 1 deletion backends/dpdk/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void DpdkBackend::convert(const IR::ToplevelBlock *tlb) {
refMap, typeMap,
new P4::OrPolicy(new P4::IsValid(refMap, typeMap), new P4::IsLikeLeftValue())),
new P4::TypeChecking(refMap, typeMap),
// TBD: implement dpdk lowering passes instead of reusing bmv2's lowering pass.
/// TBD: implement dpdk lowering passes instead of reusing bmv2's lowering pass.
new PassRepeated({new BMV2::LowerExpressions(typeMap, DPDK_MAX_SHIFT_AMOUNT)}, 2),
new P4::RemoveComplexExpressions(refMap, typeMap,
new DPDK::ProcessControls(&structure.pipeline_controls)),
Expand Down
18 changes: 9 additions & 9 deletions backends/dpdk/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,46 @@ limitations under the License.

#include "lib/cstring.h"

/* Unique handle for action and table */
/// Unique handle for action and table.
const unsigned table_handle_prefix = 0x00010000;
const unsigned action_handle_prefix = 0x00020000;

// Default values
/// Default values.
const unsigned dpdk_default_table_size = 65536;
#define DPDK_MAX_SHIFT_AMOUNT 64

// Maximum number of configurable timeout values
/// Maximum number of configurable timeout values.
const unsigned dpdk_learner_max_configurable_timeout_values = 8;
const unsigned default_learner_table_size = 0x10000;
// default timeout values for learner table to support common protocol states
/// Default timeout values for learner table to support common protocol states.
const unsigned default_learner_table_timeout[dpdk_learner_max_configurable_timeout_values] = {
10, 30, 60, 120, 300, 43200, 120, 120};

// JSON schema versions
/// JSON schema versions
const cstring bfrtSchemaVersion = "1.0.0";
const cstring tdiSchemaVersion = "0.1";

// HASH Values
/// HASH Values
#define JHASH0 0
#define CRC1 1
#define CRC2 2
#define CRC3 3
#define CRC4 4
#define JHASH5 5
#define TOEPLITZ 6
// Initial values for group_id and member_id for action selector and action profile tables
/// Initial values for group_id and member_id for action selector and action profile tables.
const unsigned initial_member_id = 0;
const unsigned initial_group_id = 0xFFFFFFFF;

// Ipsec related constants
/// Ipsec related constants
#define IPSEC_SUCCESS 0
#define IPSEC_PORT_REG_INDEX 0
#define IPSEC_PORT_REG_SIZE 1
#define IPSEC_PORT_REG_INDEX_BITWIDTH 32
#define IPSEC_PORT_REG_INITVAL_BITWIDTH 32
#define NET_TO_HOST 0

// Maximum operand size for unary, binary and ternary operations
/// Maximum operand size for unary, binary and ternary operations
const int dpdk_max_operand_size = 64;

#endif /* BACKENDS_DPDK_CONSTANTS_H_ */
5 changes: 2 additions & 3 deletions backends/dpdk/control-plane/bfruntime_arch_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ namespace p4configv1 = ::p4::config::v1;

namespace P4 {

/** \addtogroup control_plane
* @{
*/
/// \addtogroup control_plane
/// @{
namespace ControlPlaneAPI {

/// Declarations specific to standard architectures (v1model & PSA).
Expand Down
22 changes: 11 additions & 11 deletions backends/dpdk/control-plane/bfruntime_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ class BFRuntimeSchemaGenerator : public BFRuntimeGenerator {
private:
bool isTDI;
DPDK::DpdkOptions &options;
// TODO(antonin): these values may need to be available to the BF-RT
// implementation as well, if they want to expose them as enums.
/// TODO(antonin): these values may need to be available to the BF-RT
/// implementation as well, if they want to expose them as enums.

// To avoid potential clashes with P4 names, we prefix the names of "fixed"
// data field with a '$'. For example, for TD_DATA_ACTION_MEMBER_ID, we
// use the name $ACTION_MEMBER_ID.
/// To avoid potential clashes with P4 names, we prefix the names of "fixed"
/// data field with a '$'. For example, for TD_DATA_ACTION_MEMBER_ID, we
/// use the name $ACTION_MEMBER_ID.
enum BFRuntimeDataFieldIds : P4Id {
// ids for fixed data fields must not collide with the auto-generated
// ids for P4 fields (e.g. match key fields). Snapshot tables include
// ALL the fields defined in the P4 program so we need to ensure that
// this BF_RT_DATA_START offset is quite large.
// PSA Ids are between TD_DATA_START = (1 << 16) and TD_DATA_END,
/// ids for fixed data fields must not collide with the auto-generated
/// ids for P4 fields (e.g. match key fields). Snapshot tables include
/// ALL the fields defined in the P4 program so we need to ensure that
/// this BF_RT_DATA_START offset is quite large.
/// PSA Ids are between TD_DATA_START = (1 << 16) and TD_DATA_END,
BF_RT_DATA_START = TD_DATA_END,

BF_RT_DATA_ACTION_MEMBER_ID,
Expand All @@ -59,7 +59,7 @@ class BFRuntimeSchemaGenerator : public BFRuntimeGenerator {
BF_RT_DATA_MAX_GROUP_SIZE,
BF_RT_DATA_HASH_VALUE,
};
// Externs only for DPDK backend
/// Externs only for DPDK backend.
struct ActionSelector;

void addDPDKExterns(Util::JsonArray *tablesJson, Util::JsonArray *learnFiltersJson) const;
Expand Down
Loading

0 comments on commit e906a21

Please sign in to comment.