Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENI admin state #133

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dash-pipeline/bmv2/dash_metadata.p4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct eni_data_t {
bit<32> cps;
bit<32> pps;
bit<32> flows;
bit<1> admin_state;
}

struct metadata_t {
Expand Down
14 changes: 10 additions & 4 deletions dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ control dash_ingress(inout headers_t hdr,

action set_eni_attrs(bit<32> cps,
bit<32> pps,
bit<32> flows) {
meta.eni_data.cps = cps;
meta.eni_data.pps = pps;
meta.eni_data.flows = flows;
bit<32> flows,
bit<1> admin_state) {
meta.eni_data.cps = cps;
meta.eni_data.pps = pps;
meta.eni_data.flows = flows;
meta.eni_data.admin_state = admin_state;
}

@name("eni|dash")
Expand Down Expand Up @@ -208,6 +210,10 @@ control dash_ingress(inout headers_t hdr,
hdr.ethernet.dst_addr;
eni_ether_address_map.apply();
eni.apply();
if (meta.eni_data.admin_state == 0) {
deny();
return;
}

if (meta.direction == direction_t.OUTBOUND) {
outbound.apply(hdr, meta, standard_metadata);
Expand Down