Skip to content

Commit

Permalink
flow sync state is not in flow_data
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Oct 21, 2024
1 parent 590d9fb commit 2cf4047
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion dash-pipeline/bmv2/dash_headers.p4
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ const bit<16> FLOW_KEY_HDR_SIZE=flow_key_t.minSizeInBytes();
header flow_data_t {
bit<7> reserved;
bit<1> is_unidirectional;
dash_flow_sync_state_t sync_state;
dash_direction_t direction;
bit<32> version;
dash_flow_action_t actions;
Expand Down
1 change: 1 addition & 0 deletions dash-pipeline/bmv2/dash_metadata.p4
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ struct metadata_t {
#else
flow_data_t flow_data;
#endif // TARGET_DPDK_PNA
dash_flow_sync_state_t flow_sync_state;
flow_table_data_t flow_table;
bit<16> bulk_get_session_id;
bit<16> bulk_get_session_filter_id;
Expand Down
2 changes: 1 addition & 1 deletion dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ control dash_ingress(
ha_stage.apply(hdr, meta);

if (!meta.flow_enabled ||
(meta.flow_data.sync_state == dash_flow_sync_state_t.FLOW_MISS &&
(meta.flow_sync_state == dash_flow_sync_state_t.FLOW_MISS &&
hdr.packet_meta.packet_source == dash_packet_source_t.EXTERNAL))
{
dash_match_stage.apply(hdr, meta);
Expand Down
6 changes: 3 additions & 3 deletions dash-pipeline/bmv2/stages/conntrack_lookup.p4
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ control conntrack_flow_created_handle(inout headers_t hdr, inout metadata_t meta
control conntrack_flow_handle(inout headers_t hdr, inout metadata_t meta)
{
apply {
switch (meta.flow_data.sync_state) {
switch (meta.flow_sync_state) {
dash_flow_sync_state_t.FLOW_MISS: {
conntrack_flow_miss_handle.apply(hdr, meta);
}
Expand Down Expand Up @@ -269,9 +269,9 @@ control conntrack_lookup_stage(inout headers_t hdr, inout metadata_t meta) {
meta.flow_data.actions = dash_flow_action;
meta.flow_data.meter_class = meter_class;
meta.flow_data.is_unidirectional= is_unidirectional_flow;
meta.flow_data.sync_state = dash_flow_sync_state;

/* Also set basic metadata */
meta.flow_sync_state = dash_flow_sync_state;
meta.direction = dash_direction;
meta.routing_actions = dash_flow_action;
meta.meter_class = meter_class;
Expand Down Expand Up @@ -304,7 +304,7 @@ control conntrack_lookup_stage(inout headers_t hdr, inout metadata_t meta) {
}

action flow_miss() {
meta.flow_data.sync_state = dash_flow_sync_state_t.FLOW_MISS;
meta.flow_sync_state = dash_flow_sync_state_t.FLOW_MISS;
}

@SaiTable[name = "flow", api = "dash_flow", order = 1, enable_bulk_get_api = "true", enable_bulk_get_server = "true"]
Expand Down

0 comments on commit 2cf4047

Please sign in to comment.