Skip to content

Commit

Permalink
Add action in pdrs tables to pass qid parameter
Browse files Browse the repository at this point in the history
Change-Id: Id3ee76ba1fc659a1e4ca78b21481da1fe823f407
  • Loading branch information
ersuneetsingh authored and ccascone committed Mar 30, 2021
1 parent a0410b8 commit e326c72
Show file tree
Hide file tree
Showing 12 changed files with 1,513 additions and 788 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ private FabricConstants() {
PiActionId.of("FabricIngress.forwarding.set_next_id_routing_v6");
public static final PiActionId FABRIC_INGRESS_NEXT_ROUTING_SIMPLE =
PiActionId.of("FabricIngress.next.routing_simple");
public static final PiActionId FABRIC_INGRESS_SPGW_LOAD_PDR_QOS =
PiActionId.of("FabricIngress.spgw.load_pdr_qos");
public static final PiActionId FABRIC_EGRESS_EGRESS_NEXT_PUSH_VLAN =
PiActionId.of("FabricEgress.egress_next.push_vlan");
public static final PiActionId FABRIC_EGRESS_BNG_EGRESS_DOWNSTREAM_ENCAP_V4 =
Expand Down Expand Up @@ -322,6 +324,7 @@ private FabricConstants() {
public static final PiActionParamId DMAC = PiActionParamId.of("dmac");
public static final PiActionParamId MON_PORT =
PiActionParamId.of("mon_port");
public static final PiActionParamId QID = PiActionParamId.of("qid");
public static final PiActionParamId NOTIFY_CP =
PiActionParamId.of("notify_cp");
public static final PiActionParamId SRC_IFACE =
Expand Down
16 changes: 13 additions & 3 deletions pipelines/fabric/impl/src/main/resources/include/control/spgw.p4
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,22 @@ control SpgwIngress(inout parsed_headers_t hdr,
//===== PDR Tables ======//
//=============================//

action load_pdr(pdr_ctr_id_t ctr_id,
far_id_t far_id,
bit<1> needs_gtpu_decap) {
action load_pdr(pdr_ctr_id_t ctr_id,
far_id_t far_id,
bit<1> needs_gtpu_decap) {
fabric_md.spgw.ctr_id = ctr_id;
fabric_md.spgw.far_id = far_id;
fabric_md.spgw.needs_gtpu_decap = (_BOOL)needs_gtpu_decap;
}

action load_pdr_qos(pdr_ctr_id_t ctr_id,
far_id_t far_id,
bit<1> needs_gtpu_decap,
qid_t qid) {
load_pdr(ctr_id, far_id, needs_gtpu_decap);
// we cannot set the qid, since bmv2 does not support it
}

// These two tables scale well and cover the average case PDR
table downlink_pdrs {
key = {
Expand All @@ -161,6 +169,7 @@ control SpgwIngress(inout parsed_headers_t hdr,
}
actions = {
load_pdr;
load_pdr_qos;
}
size = MAX_DOWNLINK_PDRS;
}
Expand All @@ -172,6 +181,7 @@ control SpgwIngress(inout parsed_headers_t hdr,
}
actions = {
load_pdr;
load_pdr_qos;
}
size = MAX_UPLINK_PDRS;
}
Expand Down
1 change: 1 addition & 0 deletions pipelines/fabric/impl/src/main/resources/include/define.p4
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ typedef bit<32> pcc_rule_id_t;
typedef bit<32> far_id_t;
typedef bit<32> pdr_ctr_id_t;
typedef bit<32> teid_t;
typedef bit<5> qid_t;

const spgw_interface_t SPGW_IFACE_UNKNOWN = 8w0;
const spgw_interface_t SPGW_IFACE_ACCESS = 8w1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 118,
"line" : 119,
"column" : 31,
"source_fragment" : "0x0800; ..."
}
Expand Down Expand Up @@ -3193,7 +3193,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 122,
"line" : 123,
"column" : 33,
"source_fragment" : "0x8864; ..."
}
Expand Down Expand Up @@ -3364,7 +3364,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 124,
"line" : 125,
"column" : 35,
"source_fragment" : "0x0021; ..."
}
Expand Down Expand Up @@ -3522,7 +3522,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 116,
"line" : 117,
"column" : 31,
"source_fragment" : "0x8847; ..."
}
Expand Down Expand Up @@ -3601,7 +3601,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 115,
"line" : 116,
"column" : 31,
"source_fragment" : "0x8100; ..."
}
Expand Down Expand Up @@ -3718,7 +3718,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 115,
"line" : 116,
"column" : 31,
"source_fragment" : "0x8100; ..."
}
Expand All @@ -3737,7 +3737,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 115,
"line" : 116,
"column" : 31,
"source_fragment" : "0x8100; ..."
}
Expand Down Expand Up @@ -3816,7 +3816,7 @@
],
"source_info" : {
"filename" : "include/control/../define.p4",
"line" : 115,
"line" : 116,
"column" : 31,
"source_fragment" : "0x8100; ..."
}
Expand Down
Loading

0 comments on commit e326c72

Please sign in to comment.