Skip to content

Commit

Permalink
Merge branch 'main' into rg
Browse files Browse the repository at this point in the history
  • Loading branch information
marian-pritsak committed Apr 18, 2024
2 parents 5605a81 + 2f9594d commit 9f586cb
Show file tree
Hide file tree
Showing 40 changed files with 1,231 additions and 322 deletions.
6 changes: 6 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Accton
ACK
Ack
ack
ack'ed
acl
ACL
ACLs
Expand Down Expand Up @@ -304,6 +305,7 @@ IxLoad
ixload
IxNetwork
IxNetworkWeb
Jiang
Jinja
jitter
journaled
Expand Down Expand Up @@ -372,6 +374,7 @@ NonSynStateful
NorthBound
Novus
NPL
NPU
NPUS
NSG
NSGs
Expand Down Expand Up @@ -471,11 +474,13 @@ README
READMEs
README's
reconvergence
RECV
RedirectRuleResimulatedUf
redis
renderer
repo
repos
REQ
resimulated
resimulation
responder
Expand Down Expand Up @@ -534,6 +539,7 @@ SmartAppliances
SmartNIC
SmartNic
SmartNICs
SmartSwitch
SmartSwitches
snappi
SNAT
Expand Down
2 changes: 1 addition & 1 deletion dash-pipeline/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ sai-submodule:
# P4 Source code compile TARGETS
######################################

P4_SRC=$(wildcard bmv2/*.p4)
P4_SRC=$(wildcard bmv2/**/*.p4)
P4_MAIN=bmv2/dash_pipeline.p4
P4_OUTDIR=bmv2/dash_pipeline.bmv2
P4_ARTIFACTS=$(P4_OUTDIR)/dash_pipeline.json $(P4_OUTDIR)/dash_pipeline_p4rt.txt
Expand Down
2 changes: 1 addition & 1 deletion dash-pipeline/SAI/SAI
Submodule SAI updated 201 files
2 changes: 2 additions & 0 deletions dash-pipeline/SAI/debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ libsai-dev_$(VERSION)_amd64.deb: ../SAI/inc/*.h ../SAI/experimental/*.h
dpkg-deb --build --root-owner-group libsai-dev_$(VERSION)_amd64

libsai_$(VERSION)_amd64.deb: ../lib/libsai.so
mkdir -p -m 755 libsai_$(VERSION)_amd64/etc/dash
install -vCD ../../bmv2/dash_pipeline.bmv2/* libsai_$(VERSION)_amd64/etc/dash/
mkdir -p -m 755 libsai_$(VERSION)_amd64/usr/lib/x86_64-linux-gnu/
find -type d |xargs chmod go-w
install -vCD ../lib/libsai.so libsai_$(VERSION)_amd64/usr/lib/x86_64-linux-gnu/libsai.so
Expand Down
4 changes: 2 additions & 2 deletions dash-pipeline/SAI/sai_api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ def parse_p4rt(self, p4rt_table_action: Dict[str, Any], sai_enums: List[SAIEnum]
},
"params": [
{ "id": 1, "name": "dst_vnet_id", "bitwidth": 16 },
{ "id": 2, "name": "meter_policy_en", "bitwidth": 1 },
{ "id": 3, "name": "meter_class", "bitwidth": 16 }
{ "id": 2, "name": "meter_class_or", "bitwidth": 32 },
{ "id": 3, "name": "meter_class_and", "bitwidth": 32 }
]
}
'''
Expand Down
8 changes: 8 additions & 0 deletions dash-pipeline/bmv2/dash_arch_specific.p4
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@

#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__
2 changes: 1 addition & 1 deletion dash-pipeline/bmv2/dash_inbound.p4
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ control inbound(inout headers_t hdr,
ConntrackOut.apply(hdr, meta);
#endif //PNA_CONNTRACK

tunnel_encap(hdr,
do_tunnel_encap(hdr,
meta,
meta.overlay_data.dmac,
meta.encap_data.underlay_dmac,
Expand Down
91 changes: 80 additions & 11 deletions dash-pipeline/bmv2/dash_metadata.p4
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include "dash_headers.p4"

#define MAX_ENI 64
#define MAX_HA_SET 1

enum bit<32> dash_routing_actions_t {
NONE = 0,
STATIC_ENCAP = (1 << 0),
Expand All @@ -14,7 +17,21 @@ enum bit<16> dash_direction_t {
INVALID = 0,
OUTBOUND = 1,
INBOUND = 2
}
};

enum bit<8> dash_packet_source_t {
EXTERNAL = 0, // Packets from external sources.
DPAPP = 1, // Packets from data plane app.
PEER = 2 // Packets from the paired DPU.
};

enum bit<8> dash_packet_type_t {
REGULAR = 0, // Regular packets from external sources.
FLOW_SYNC_REQ = 1, // Flow sync request packet.
FLOW_SYNC_ACK = 2, // Flow sync ack packet.
DP_PROBE_REQ = 3, // Data plane probe packet.
DP_PROBE_ACK = 4 // Data plane probe ack packet.
};

// Pipeline stages:
enum bit<16> dash_pipeline_stage_t {
Expand All @@ -30,7 +47,7 @@ enum bit<16> dash_pipeline_stage_t {

// Common stages
ROUTING_ACTION_APPLY = 300
}
};

struct conntrack_data_t {
bool allow_in;
Expand All @@ -50,12 +67,19 @@ struct eni_data_t {
IPv6Address pl_sip;
IPv6Address pl_sip_mask;
IPv4Address pl_underlay_sip;
bit<6> dscp;
bit<6> dscp;
dash_tunnel_dscp_mode_t dscp_mode;
bit<16> routing_group_id;
bool routing_group_admin_state;
}

struct meter_context_t {
bit<32> meter_class_or;
bit<32> meter_class_and;
bit<16> meter_policy_id;
IPv4ORv6Address meter_policy_lookup_ip;
}

struct encap_data_t {
bit<24> vni;
bit<24> dest_vnet_vni;
Expand All @@ -75,7 +99,55 @@ struct overlay_rewrite_data_t {
IPv6Address dip_mask;
}

// HA roles
enum bit<8> dash_ha_role_t {
DEAD = 0,
ACTIVE = 1,
STANDBY = 2,
STANDALONE = 3,
SWITCHING_TO_ACTIVE = 4
};

// Flow sync state
enum bit<8> dash_ha_flow_sync_state_t {
FLOW_MISS = 0, // Flow not created yet
FLOW_CREATED = 1, // Flow is created but not synched or waiting for ack
FLOW_SYNCED = 2, // Flow has been synched to its peer
FLOW_PENDING_DELETE = 3, // Flow is pending deletion, waiting for ack
FLOW_PENDING_RESIMULATION = 4 // Flow is marked as pending resimulation
};

// HA flow sync operations
enum bit<8> dash_ha_flow_sync_op_t {
FLOW_CREATE = 0, // New flow creation.
FLOW_UPDATE = 1, // Flow resimulation or any other reason causing existing flow to be updated.
FLOW_DELETE = 2 // Flow deletion.
};

struct ha_data_t {
// HA scope settings
bit<16> ha_scope_id;
bit<16> ha_set_id;
dash_ha_role_t ha_role;

// HA set settings
bit<1> local_ip_is_v6;
IPv4ORv6Address local_ip;
bit<1> peer_ip_is_v6;
IPv4ORv6Address peer_ip;
bit<16> dp_channel_dst_port;
bit<16> dp_channel_src_port_min;
bit<16> dp_channel_src_port_max;

// HA packet/flow state
dash_ha_flow_sync_state_t flow_sync_state;
}

struct metadata_t {
// Packet type
dash_packet_source_t packet_source; // TODO: Parse packet source in parser.
dash_packet_type_t packet_type; // TODO: Parse packet type in parser.

// Lookup context
dash_direction_t direction;
EthernetAddress eni_addr;
Expand All @@ -99,17 +171,13 @@ struct metadata_t {
bit<16> stage3_dash_acl_group_id;
bit<16> stage4_dash_acl_group_id;
bit<16> stage5_dash_acl_group_id;
bit<1> meter_policy_en;
bit<1> mapping_meter_class_override;
bit<16> meter_policy_id;
bit<16> policy_meter_class;
bit<16> route_meter_class;
bit<16> mapping_meter_class;
bit<16> meter_class;
bit<32> meter_bucket_index;
bit<16> tunnel_pointer;
bool is_fast_path_icmp_flow_redirection_packet;
bit<1> fast_path_icmp_flow_redirection_disabled;
meter_context_t meter_context;

// HA
ha_data_t ha;

// Stage transition control
dash_pipeline_stage_t target_stage;
Expand All @@ -121,6 +189,7 @@ struct metadata_t {
bool dropped;
encap_data_t encap_data;
overlay_rewrite_data_t overlay_data;
bit<32> meter_class;
}

#endif /* _SIRIUS_METADATA_P4_ */
Loading

0 comments on commit 9f586cb

Please sign in to comment.