-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin-1/main' into patch-4
- Loading branch information
Showing
83 changed files
with
2,818 additions
and
882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ extern "C" { | |
|
||
#include <set> | ||
#include <map> | ||
#include <string> | ||
|
||
namespace dash | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "saiimpl.h" | ||
|
||
DASH_GENERIC_QUAD(BUFFER_POOL,buffer_pool); | ||
DASH_GENERIC_QUAD(INGRESS_PRIORITY_GROUP,ingress_priority_group); | ||
DASH_GENERIC_QUAD(BUFFER_PROFILE,buffer_profile); | ||
|
||
sai_buffer_api_t redis_buffer_api = { | ||
|
||
DASH_GENERIC_QUAD_API(buffer_pool) | ||
|
||
.get_buffer_pool_stats = 0, | ||
.get_buffer_pool_stats_ext = 0, | ||
.clear_buffer_pool_stats = 0, | ||
|
||
DASH_GENERIC_QUAD_API(ingress_priority_group) | ||
|
||
.get_ingress_priority_group_stats = 0, | ||
.get_ingress_priority_group_stats_ext = 0, | ||
.clear_ingress_priority_group_stats = 0, | ||
|
||
DASH_GENERIC_QUAD_API(buffer_profile) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "saiimpl.h" | ||
|
||
DASH_GENERIC_QUAD(DTEL,dtel); | ||
DASH_GENERIC_QUAD(DTEL_QUEUE_REPORT,dtel_queue_report); | ||
DASH_GENERIC_QUAD(DTEL_INT_SESSION,dtel_int_session); | ||
DASH_GENERIC_QUAD(DTEL_REPORT_SESSION,dtel_report_session); | ||
DASH_GENERIC_QUAD(DTEL_EVENT,dtel_event); | ||
|
||
sai_dtel_api_t dash_sai_dtel_api = { | ||
|
||
DASH_GENERIC_QUAD_API(dtel) | ||
DASH_GENERIC_QUAD_API(dtel_queue_report) | ||
DASH_GENERIC_QUAD_API(dtel_int_session) | ||
DASH_GENERIC_QUAD_API(dtel_report_session) | ||
DASH_GENERIC_QUAD_API(dtel_event) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,93 @@ | ||
#ifndef __DASH_TARGET_SPECIFIC__ | ||
#define __DASH_TARGET_SPECIFIC__ | ||
|
||
#ifdef TARGET_BMV2_V1MODEL | ||
// | ||
// P4 arch/target includes | ||
// | ||
#if defined(TARGET_BMV2_V1MODEL) | ||
#include <v1model.p4> | ||
#elif defined(TARGET_DPDK_PNA) // TARGET_BMV2_V1MODEL | ||
#include <pna.p4> | ||
#endif // TARGET_DPDK_PNA | ||
|
||
// | ||
// Counters | ||
// - The counters are defined differently for different arch. | ||
// | ||
#if defined(TARGET_BMV2_V1MODEL) | ||
|
||
#define DEFINE_COUNTER(name, count, ...) \ | ||
@SaiCounter[__VA_ARGS__] \ | ||
counter(count, CounterType.packets_and_bytes) name; | ||
|
||
#include <v1model.p4> | ||
#define DIRECT_COUNTER_TABLE_PROPERTY counters | ||
#define DEFINE_PACKET_COUNTER(name, count, ...) \ | ||
@SaiCounter[__VA_ARGS__] \ | ||
counter(count, CounterType.packets) name; | ||
|
||
#endif // TARGET_BMV2_V1MODEL | ||
#define DEFINE_BYTE_COUNTER(name, count, ...) \ | ||
@SaiCounter[__VA_ARGS__] \ | ||
counter(count, CounterType.bytes) name; | ||
|
||
#ifdef TARGET_DPDK_PNA | ||
#define DEFINE_HIT_COUNTER(name, count, ...) \ | ||
@SaiCounter[__VA_ARGS__, no_suffix="true"] \ | ||
counter(count, CounterType.packets) name; | ||
|
||
#include <pna.p4> | ||
#define DIRECT_COUNTER_TABLE_PROPERTY pna_direct_counter | ||
#define UPDATE_COUNTER(name, index) \ | ||
name.count((bit<32>)index) | ||
|
||
#define DEFINE_TABLE_COUNTER(counter_name) direct_counter(CounterType.packets_and_bytes) counter_name; | ||
#define ATTACH_TABLE_COUNTER(counter_name) counters = counter_name; | ||
|
||
#elif defined(TARGET_DPDK_PNA) // TARGET_BMV2_V1MODEL | ||
|
||
// Counters are not supported yet for PNA arch in DASH | ||
#define DEFINE_COUNTER(name, count, ...) | ||
#define DEFINE_PACKET_COUNTER(name, count, ...) | ||
#define DEFINE_BYTE_COUNTER(name, count, ...) | ||
#define DEFINE_HIT_COUNTER(name, count, ...) | ||
#define UPDATE_COUNTER(name, index) | ||
|
||
#ifdef DPDK_SUPPORTS_DIRECT_COUNTER_ON_WILDCARD_KEY_TABLE | ||
// Omit all direct counters for tables with ternary match keys, | ||
// because the latest version of p4c-dpdk as of 2023-Jan-26 does | ||
// not support this combination of features. If you try to | ||
// compile it with this code enabled, the error message looks like | ||
// this: | ||
// | ||
// [--Werror=target-error] error: Direct counters and direct meters are unsupported for wildcard match table outbound_acl_stage1:dash_acl_rule|dash_acl | ||
// | ||
// This p4c issue is tracking this feature gap in p4c-dpdk: | ||
// https://github.com/p4lang/p4c/issues/3868 | ||
#define DEFINE_TABLE_COUNTER(counter_name) DirectCounter<bit<64>>(PNA_CounterType_t.PACKETS_AND_BYTES) counter_name; | ||
#define ATTACH_TABLE_COUNTER(counter_name) pna_direct_counter = counter_name; | ||
#else | ||
#define DEFINE_TABLE_COUNTER(counter_name) | ||
#define ATTACH_TABLE_COUNTER(counter_name) | ||
#endif | ||
|
||
#endif // TARGET_DPDK_PNA | ||
|
||
// | ||
// DBC (Design By Contract) macros | ||
// - These macros will be used as a replacement for asserts, which makes the precondition and postcondition checks more explicit. | ||
// | ||
#if defined(TARGET_BMV2_V1MODEL) | ||
|
||
#define REQUIRES(cond) assert(cond) | ||
|
||
#elif defined(TARGET_DPDK_PNA) // TARGET_BMV2_V1MODEL | ||
|
||
// NOTE: PNA doesn't support assert, hence all macros are defined as empty | ||
#define REQUIRES(cond) | ||
|
||
#endif // TARGET_DPDK_PNA | ||
|
||
// | ||
// Utility macros | ||
// | ||
|
||
// The second macro will have the value of x expanded before stringification. | ||
#define PP_STR_RAW(x) #x | ||
#define PP_STR(x) PP_STR_RAW(x) | ||
|
||
#endif // __DASH_TARGET_SPECIFIC__ |
Oops, something went wrong.