From a3b9cf2c487e3b51938dacd52fd70afaf40579e7 Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Thu, 5 Sep 2024 10:23:54 +0000 Subject: [PATCH] Revert set_flow_entry_attr params for flow SAI backward compatible --- dash-pipeline/SAI/specs/dash_flow.yaml | 322 ++++++++++-------- dash-pipeline/SAI/specs/sai_spec.yaml | 24 ++ dash-pipeline/bmv2/dash_headers.p4 | 21 +- dash-pipeline/bmv2/dash_metadata.p4 | 29 +- dash-pipeline/bmv2/dash_parser.p4 | 9 +- dash-pipeline/bmv2/dash_pipeline.p4 | 3 +- dash-pipeline/bmv2/stages/conntrack_lookup.p4 | 145 ++++---- documentation/dataplane/dash-flow-api.md | 4 + documentation/high-avail/ha-api-hld.md | 19 +- 9 files changed, 330 insertions(+), 246 deletions(-) diff --git a/dash-pipeline/SAI/specs/dash_flow.yaml b/dash-pipeline/SAI/specs/dash_flow.yaml index 9db3b7865..b106f147a 100644 --- a/dash-pipeline/SAI/specs/dash_flow.yaml +++ b/dash-pipeline/SAI/specs/dash_flow.yaml @@ -95,6 +95,12 @@ sai_apis: type: sai_uint16_t objects: null valid_only: null + - !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry + name: ip_proto + description: Exact matched key ip_proto + type: sai_uint8_t + objects: null + valid_only: null - !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry name: src_ip description: Exact matched key src_ip @@ -119,12 +125,6 @@ sai_apis: type: sai_uint16_t objects: null valid_only: null - - !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry - name: ip_proto - description: Exact matched key ip_proto - type: sai_uint8_t - objects: null - valid_only: null attributes: - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute name: SAI_FLOW_ENTRY_ATTR_ACTION @@ -140,11 +140,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_IS_UNIDIRECTIONAL - description: Action parameter is unidirectional - type: bool - attr_value_field: booldata - default: 'false' + name: SAI_FLOW_ENTRY_ATTR_VERSION + description: Action parameter version + type: sai_uint32_t + attr_value_field: u32 + default: '0' isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -153,11 +153,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_STATE - description: Action parameter state - type: sai_uint8_t - attr_value_field: u8 - default: '0' + name: SAI_FLOW_ENTRY_ATTR_DASH_DIRECTION + description: Action parameter DASH direction + type: sai_dash_direction_t + attr_value_field: s32 + default: SAI_DASH_DIRECTION_INVALID isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -166,8 +166,21 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_VERSION - description: Action parameter version + name: SAI_FLOW_ENTRY_ATTR_DASH_FLOW_ACTION + description: Action parameter DASH flow action + type: sai_dash_flow_action_t + attr_value_field: s32 + default: SAI_DASH_FLOW_ACTION_NONE + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + is_vlan: false + deprecated: false + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_FLOW_ENTRY_ATTR_METER_CLASS + description: Action parameter meter class type: sai_uint32_t attr_value_field: u32 default: '0' @@ -179,11 +192,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_DASH_DIRECTION - description: Action parameter DASH direction - type: sai_dash_direction_t - attr_value_field: s32 - default: SAI_DASH_DIRECTION_INVALID + name: SAI_FLOW_ENTRY_ATTR_IS_UNIDIRECTIONAL_FLOW + description: Action parameter is unidirectional flow + type: bool + attr_value_field: booldata + default: 'false' isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -192,8 +205,21 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_ID - description: Action parameter tunnel id + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_ENI_MAC + description: Action parameter reverse flow ENI MAC + type: sai_mac_t + attr_value_field: mac + default: vendor + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + is_vlan: false + deprecated: false + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_VNET_ID + description: Action parameter reverse flow VNET id type: sai_uint16_t attr_value_field: u16 default: '0' @@ -205,10 +231,10 @@ sai_apis: is_vlan: true deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ROUTING_ACTIONS - description: Action parameter routing actions - type: sai_uint32_t - attr_value_field: u32 + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_IP_PROTO + description: Action parameter reverse flow IP protocol + type: sai_uint8_t + attr_value_field: u8 default: '0' isresourcetype: false flags: CREATE_AND_SET @@ -218,11 +244,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_METER_CLASS - description: Action parameter meter class - type: sai_uint32_t - attr_value_field: u32 - default: '0' + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_SRC_IP + description: Action parameter reverse flow src IP + type: sai_ip_address_t + attr_value_field: ipaddr + default: 0.0.0.0 isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -231,11 +257,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_VNI - description: Action parameter encap data VNI - type: sai_uint32_t - attr_value_field: u32 - default: '0' + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_DST_IP + description: Action parameter reverse flow dst IP + type: sai_ip_address_t + attr_value_field: ipaddr + default: 0.0.0.0 isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -244,34 +270,34 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_DEST_VNET_VNI - description: Action parameter encap data destination VNET VNI - type: sai_uint32_t - attr_value_field: u32 + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_SRC_PORT + description: Action parameter reverse flow src port + type: sai_uint16_t + attr_value_field: u16 default: '0' isresourcetype: false flags: CREATE_AND_SET object_name: null allow_null: false valid_only: null - is_vlan: false + is_vlan: true deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_SIP - description: Action parameter encap data underlay sip - type: sai_uint32_t - attr_value_field: u32 + name: SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_DST_PORT + description: Action parameter reverse flow dst port + type: sai_uint16_t + attr_value_field: u16 default: '0' isresourcetype: false flags: CREATE_AND_SET object_name: null allow_null: false valid_only: null - is_vlan: false + is_vlan: true deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_DIP - description: Action parameter encap data underlay dip + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_VNET_ID + description: Action parameter underlay0 VNET id type: sai_uint32_t attr_value_field: u32 default: '0' @@ -283,11 +309,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_SMAC - description: Action parameter encap data underlay source MAC - type: sai_mac_t - attr_value_field: mac - default: vendor + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SIP + description: Action parameter underlay0 sip + type: sai_uint32_t + attr_value_field: u32 + default: '0' isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -296,11 +322,11 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_DMAC - description: Action parameter encap data underlay destination MAC - type: sai_mac_t - attr_value_field: mac - default: vendor + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DIP + description: Action parameter underlay0 dip + type: sai_uint32_t + attr_value_field: u32 + default: '0' isresourcetype: false flags: CREATE_AND_SET object_name: null @@ -309,8 +335,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_DASH_ENCAPSULATION - description: Action parameter encap data DASH encapsulation + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DASH_ENCAPSULATION + description: Action parameter underlay0 DASH encapsulation type: sai_dash_encapsulation_t attr_value_field: s32 default: SAI_DASH_ENCAPSULATION_INVALID @@ -322,8 +348,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_VNI - description: Action parameter tunnel data VNI + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_VNET_ID + description: Action parameter underlay1 VNET id type: sai_uint32_t attr_value_field: u32 default: '0' @@ -335,8 +361,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_DEST_VNET_VNI - description: Action parameter tunnel data destination VNET VNI + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_SIP + description: Action parameter underlay1 sip type: sai_uint32_t attr_value_field: u32 default: '0' @@ -348,8 +374,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_SIP - description: Action parameter tunnel data underlay sip + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DIP + description: Action parameter underlay1 dip type: sai_uint32_t attr_value_field: u32 default: '0' @@ -361,21 +387,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_DIP - description: Action parameter tunnel data underlay dip - type: sai_uint32_t - attr_value_field: u32 - default: '0' - isresourcetype: false - flags: CREATE_AND_SET - object_name: null - allow_null: false - valid_only: null - is_vlan: false - deprecated: false - - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_SMAC - description: Action parameter tunnel data underlay source MAC + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_SMAC + description: Action parameter underlay1 source MAC type: sai_mac_t attr_value_field: mac default: vendor @@ -387,8 +400,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_DMAC - description: Action parameter tunnel data underlay destination MAC + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DMAC + description: Action parameter underlay1 destination MAC type: sai_mac_t attr_value_field: mac default: vendor @@ -400,8 +413,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_DASH_ENCAPSULATION - description: Action parameter tunnel data DASH encapsulation + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DASH_ENCAPSULATION + description: Action parameter underlay1 DASH encapsulation type: sai_dash_encapsulation_t attr_value_field: s32 default: SAI_DASH_ENCAPSULATION_INVALID @@ -413,21 +426,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_IS_IPV6 - description: Action parameter overlay data is ipv6 - type: bool - attr_value_field: booldata - default: 'false' - isresourcetype: false - flags: CREATE_AND_SET - object_name: null - allow_null: false - valid_only: null - is_vlan: false - deprecated: false - - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DST_MAC - description: Action parameter overlay data dst MAC + name: SAI_FLOW_ENTRY_ATTR_DST_MAC + description: Action parameter dst MAC type: sai_mac_t attr_value_field: mac default: vendor @@ -439,8 +439,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_SIP - description: Action parameter overlay data sip + name: SAI_FLOW_ENTRY_ATTR_SIP + description: Action parameter sip type: sai_ip_address_t attr_value_field: ipaddr default: 0.0.0.0 @@ -452,8 +452,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DIP - description: Action parameter overlay data dip + name: SAI_FLOW_ENTRY_ATTR_DIP + description: Action parameter dip type: sai_ip_address_t attr_value_field: ipaddr default: 0.0.0.0 @@ -465,8 +465,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_SIP_MASK - description: Action parameter overlay data sip mask + name: SAI_FLOW_ENTRY_ATTR_SIP_MASK + description: Action parameter sip mask type: sai_ip_address_t attr_value_field: ipaddr default: 0.0.0.0 @@ -478,8 +478,8 @@ sai_apis: is_vlan: false deprecated: false - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute - name: SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DIP_MASK - description: Action parameter overlay data dip mask + name: SAI_FLOW_ENTRY_ATTR_DIP_MASK + description: Action parameter dip mask type: sai_ip_address_t attr_value_field: ipaddr default: 0.0.0.0 @@ -529,6 +529,45 @@ sai_apis: valid_only: null is_vlan: false deprecated: false + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_FLOW_ENTRY_ATTR_DASH_FLOW_SYNC_STATE + description: Action parameter DASH flow sync state + type: sai_dash_flow_sync_state_t + attr_value_field: s32 + default: SAI_DASH_FLOW_SYNC_STATE_FLOW_MISS + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + is_vlan: false + deprecated: false + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SMAC + description: Action parameter underlay0 source MAC + type: sai_mac_t + attr_value_field: mac + default: vendor + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + is_vlan: false + deprecated: false + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DMAC + description: Action parameter underlay0 destination MAC + type: sai_mac_t + attr_value_field: mac + default: vendor + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + is_vlan: false + deprecated: false stats: [] p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta tables: @@ -539,35 +578,38 @@ sai_apis: name: SAI_FLOW_ENTRY_ACTION_SET_FLOW_ENTRY_ATTR id: 26241621 attr_param_id: - SAI_FLOW_ENTRY_ATTR_IS_UNIDIRECTIONAL: 1 - SAI_FLOW_ENTRY_ATTR_STATE: 2 - SAI_FLOW_ENTRY_ATTR_VERSION: 3 - SAI_FLOW_ENTRY_ATTR_DASH_DIRECTION: 4 - SAI_FLOW_ENTRY_ATTR_TUNNEL_ID: 5 - SAI_FLOW_ENTRY_ATTR_ROUTING_ACTIONS: 6 - SAI_FLOW_ENTRY_ATTR_METER_CLASS: 7 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_VNI: 8 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_DEST_VNET_VNI: 9 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_SIP: 10 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_DIP: 11 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_SMAC: 12 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_UNDERLAY_DMAC: 13 - SAI_FLOW_ENTRY_ATTR_ENCAP_DATA_DASH_ENCAPSULATION: 14 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_VNI: 15 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_DEST_VNET_VNI: 16 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_SIP: 17 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_DIP: 18 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_SMAC: 19 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_UNDERLAY_DMAC: 20 - SAI_FLOW_ENTRY_ATTR_TUNNEL_DATA_DASH_ENCAPSULATION: 21 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_IS_IPV6: 22 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DST_MAC: 23 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_SIP: 24 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DIP: 25 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_SIP_MASK: 26 - SAI_FLOW_ENTRY_ATTR_OVERLAY_DATA_DIP_MASK: 27 - SAI_FLOW_ENTRY_ATTR_VENDOR_METADATA: 28 - SAI_FLOW_ENTRY_ATTR_FLOW_DATA_PB: 29 + SAI_FLOW_ENTRY_ATTR_VERSION: 1 + SAI_FLOW_ENTRY_ATTR_DASH_DIRECTION: 2 + SAI_FLOW_ENTRY_ATTR_DASH_FLOW_ACTION: 3 + SAI_FLOW_ENTRY_ATTR_METER_CLASS: 4 + SAI_FLOW_ENTRY_ATTR_IS_UNIDIRECTIONAL_FLOW: 5 + SAI_FLOW_ENTRY_ATTR_DASH_FLOW_SYNC_STATE: 6 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_ENI_MAC: 7 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_VNET_ID: 8 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_IP_PROTO: 9 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_SRC_IP: 10 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_DST_IP: 11 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_SRC_PORT: 12 + SAI_FLOW_ENTRY_ATTR_REVERSE_FLOW_DST_PORT: 13 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_VNET_ID: 14 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SIP: 15 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DIP: 16 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SMAC: 17 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DMAC: 18 + SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DASH_ENCAPSULATION: 19 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_VNET_ID: 20 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_SIP: 21 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DIP: 22 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_SMAC: 23 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DMAC: 24 + SAI_FLOW_ENTRY_ATTR_UNDERLAY1_DASH_ENCAPSULATION: 25 + SAI_FLOW_ENTRY_ATTR_DST_MAC: 26 + SAI_FLOW_ENTRY_ATTR_SIP: 27 + SAI_FLOW_ENTRY_ATTR_DIP: 28 + SAI_FLOW_ENTRY_ATTR_SIP_MASK: 29 + SAI_FLOW_ENTRY_ATTR_DIP_MASK: 30 + SAI_FLOW_ENTRY_ATTR_VENDOR_METADATA: 32 + SAI_FLOW_ENTRY_ATTR_FLOW_DATA_PB: 33 - !!python/object:utils.sai_spec.sai_api.SaiApi name: flow_entry_bulk_get_session_filter description: flow entry bulk get session filter diff --git a/dash-pipeline/SAI/specs/sai_spec.yaml b/dash-pipeline/SAI/specs/sai_spec.yaml index 3419f1395..2e241673f 100644 --- a/dash-pipeline/SAI/specs/sai_spec.yaml +++ b/dash-pipeline/SAI/specs/sai_spec.yaml @@ -419,6 +419,30 @@ enums: name: DST_MAC description: '' value: '2' +- !!python/object:utils.sai_spec.sai_enum.SaiEnum + name: sai_dash_flow_sync_state_t + description: '' + members: + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: FLOW_MISS + description: '' + value: '0' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: FLOW_CREATED + description: '' + value: '1' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: FLOW_SYNCED + description: '' + value: '2' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: FLOW_PENDING_DELETE + description: '' + value: '3' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: FLOW_PENDING_RESIMULATION + description: '' + value: '4' port_extenstion: !!python/object:utils.sai_spec.sai_api_extension.SaiApiExtension attributes: [] stats: diff --git a/dash-pipeline/bmv2/dash_headers.p4 b/dash-pipeline/bmv2/dash_headers.p4 index 87b952ee5..061217773 100644 --- a/dash-pipeline/bmv2/dash_headers.p4 +++ b/dash-pipeline/bmv2/dash_headers.p4 @@ -45,7 +45,7 @@ enum bit<16> dash_encapsulation_t { header encap_data_t { bit<24> vni; - bit<24> dest_vnet_vni; + bit<8> reserved; IPv4Address underlay_sip; IPv4Address underlay_dip; EthernetAddress underlay_smac; @@ -153,6 +153,19 @@ header ipv6_t { const bit<16> IPV6_HDR_SIZE=320/8; +// Flow sync state +enum bit<8> dash_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 +} + +enum bit<32> dash_flow_action_t { + NONE = 0 +} + enum bit<16> dash_flow_enabled_key_t { ENI_MAC = (1 << 0), VNI = (1 << 1), @@ -214,10 +227,10 @@ const bit<16> FLOW_KEY_HDR_SIZE=flow_key_t.minSizeInBytes(); header flow_data_t { bit<7> reserved; bit<1> is_unidirectional; - bit<32> version; + dash_flow_sync_state_t sync_state; dash_direction_t direction; - bit<16> tunnel_id; - bit<32> routing_actions; + bit<32> version; + dash_flow_action_t actions; dash_meter_class_t meter_class; } const bit<16> FLOW_DATA_HDR_SIZE=flow_data_t.minSizeInBytes(); diff --git a/dash-pipeline/bmv2/dash_metadata.p4 b/dash-pipeline/bmv2/dash_metadata.p4 index b3cd19a72..fcd90b011 100644 --- a/dash-pipeline/bmv2/dash_metadata.p4 +++ b/dash-pipeline/bmv2/dash_metadata.p4 @@ -117,15 +117,6 @@ enum bit<8> dash_ha_state_t { SWITCHING_TO_STANDALONE = 12 }; -// Flow state -enum bit<8> dash_flow_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 -}; - struct ha_data_t { // HA scope settings bit<16> ha_scope_id; @@ -140,18 +131,24 @@ struct ha_data_t { 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_flow_state_t ha_flow_state; } #ifdef TARGET_DPDK_PNA // redefine encap_data_t -> meta_encap_data_t // redefine overlay_rewrite_data_t -> meta_overlay_rewrite_data_t // header in struct is not well supported for target dpdk-pna +struct meta_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; + dash_meter_class_t meter_class; +} struct meta_encap_data_t { bit<24> vni; - bit<24> dest_vnet_vni; + bit<8> reserved; IPv4Address underlay_sip; IPv4Address underlay_dip; EthernetAddress underlay_smac; @@ -214,8 +211,12 @@ struct metadata_t { // Flow data conntrack_data_t conntrack_data; +#ifdef TARGET_DPDK_PNA + meta_flow_data_t flow_data; +#else + flow_data_t flow_data; +#endif // TARGET_DPDK_PNA flow_table_data_t flow_table; - dash_flow_state_t flow_state; bit<16> bulk_get_session_id; bit<16> bulk_get_session_filter_id; bool flow_enabled; diff --git a/dash-pipeline/bmv2/dash_parser.p4 b/dash-pipeline/bmv2/dash_parser.p4 index 8592cf453..69a728531 100644 --- a/dash-pipeline/bmv2/dash_parser.p4 +++ b/dash-pipeline/bmv2/dash_parser.p4 @@ -58,17 +58,16 @@ parser dash_parser( // Flow delete, extract flow_data ... packet.extract(hd.flow_data); - if (hd.flow_data.routing_actions != 0) { + if (hd.flow_data.actions != 0) { packet.extract(hd.flow_overlay_data); } - if (hd.flow_data.routing_actions & dash_routing_actions_t.STATIC_ENCAP != 0) { + if (hd.flow_data.actions & dash_routing_actions_t.STATIC_ENCAP != 0) { packet.extract(hd.flow_encap_data); } - if (hd.flow_data.tunnel_id != 0) { - packet.extract(hd.flow_tunnel_data); - } + // FIXME: assume no tunnel data + // packet.extract(hd.flow_tunnel_data); } transition parse_customer_ethernet; diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index d1de27d3d..8f451c468 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -232,6 +232,7 @@ control dash_ingress( #ifndef TARGET_DPDK_PNA meta.rx_encap.setValid(); + meta.flow_data.setValid(); meta.encap_data.setValid(); meta.tunnel_data.setValid(); meta.overlay_data.setValid(); @@ -268,7 +269,7 @@ control dash_ingress( ha_stage.apply(hdr, meta); if (!meta.flow_enabled || - (meta.flow_state == dash_flow_state_t.FLOW_MISS && + (meta.flow_data.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); diff --git a/dash-pipeline/bmv2/stages/conntrack_lookup.p4 b/dash-pipeline/bmv2/stages/conntrack_lookup.p4 index c46bb2ba6..78d63344e 100644 --- a/dash-pipeline/bmv2/stages/conntrack_lookup.p4 +++ b/dash-pipeline/bmv2/stages/conntrack_lookup.p4 @@ -7,14 +7,13 @@ action conntrack_set_meta_from_dash_header(in headers_t hdr, out metadata_t meta { /* basic metadata */ meta.direction = hdr.flow_data.direction; - meta.dash_tunnel_id = hdr.flow_data.tunnel_id; - meta.routing_actions = hdr.flow_data.routing_actions; + meta.dash_tunnel_id = 0; + meta.routing_actions = (bit<32>)hdr.flow_data.actions; meta.meter_class = hdr.flow_data.meter_class; /* encapsulation metadata */ #ifdef TARGET_DPDK_PNA meta.encap_data.vni = hdr.flow_encap_data.vni; - meta.encap_data.dest_vnet_vni = hdr.flow_encap_data.dest_vnet_vni; meta.encap_data.underlay_sip = hdr.flow_encap_data.underlay_sip; meta.encap_data.underlay_dip = hdr.flow_encap_data.underlay_dip; meta.encap_data.underlay_smac = hdr.flow_encap_data.underlay_smac; @@ -27,7 +26,6 @@ action conntrack_set_meta_from_dash_header(in headers_t hdr, out metadata_t meta /* tunnel metadata */ #ifdef TARGET_DPDK_PNA meta.tunnel_data.vni = hdr.flow_tunnel_data.vni; - meta.tunnel_data.dest_vnet_vni = hdr.flow_tunnel_data.dest_vnet_vni; meta.tunnel_data.underlay_sip = hdr.flow_tunnel_data.underlay_sip; meta.tunnel_data.underlay_dip = hdr.flow_tunnel_data.underlay_dip; meta.tunnel_data.underlay_smac = hdr.flow_tunnel_data.underlay_smac; @@ -71,8 +69,7 @@ control conntrack_build_dash_header(inout headers_t hdr, in metadata_t meta, hdr.flow_data.is_unidirectional = 0; hdr.flow_data.version = 0; hdr.flow_data.direction = meta.direction; - hdr.flow_data.tunnel_id = meta.dash_tunnel_id; - hdr.flow_data.routing_actions = meta.routing_actions; + hdr.flow_data.actions = (dash_flow_action_t)meta.routing_actions; hdr.flow_data.meter_class = meta.meter_class; length = length + FLOW_DATA_HDR_SIZE; @@ -80,7 +77,6 @@ control conntrack_build_dash_header(inout headers_t hdr, in metadata_t meta, #ifdef TARGET_DPDK_PNA hdr.flow_encap_data.setValid(); hdr.flow_encap_data.vni = meta.encap_data.vni; - hdr.flow_encap_data.dest_vnet_vni = meta.encap_data.dest_vnet_vni; hdr.flow_encap_data.underlay_sip = meta.encap_data.underlay_sip; hdr.flow_encap_data.underlay_dip = meta.encap_data.underlay_dip; hdr.flow_encap_data.underlay_smac = meta.encap_data.underlay_smac; @@ -96,7 +92,6 @@ control conntrack_build_dash_header(inout headers_t hdr, in metadata_t meta, #ifdef TARGET_DPDK_PNA hdr.flow_tunnel_data.setValid(); hdr.flow_tunnel_data.vni = meta.tunnel_data.vni; - hdr.flow_tunnel_data.dest_vnet_vni = meta.tunnel_data.dest_vnet_vni; hdr.flow_tunnel_data.underlay_sip = meta.tunnel_data.underlay_sip; hdr.flow_tunnel_data.underlay_dip = meta.tunnel_data.underlay_dip; hdr.flow_tunnel_data.underlay_smac = meta.tunnel_data.underlay_smac; @@ -178,11 +173,11 @@ 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_state) { - dash_flow_state_t.FLOW_MISS: { + switch (meta.flow_data.sync_state) { + dash_flow_sync_state_t.FLOW_MISS: { conntrack_flow_miss_handle.apply(hdr, meta); } - dash_flow_state_t.FLOW_CREATED: { + dash_flow_sync_state_t.FLOW_CREATED: { conntrack_flow_created_handle.apply(hdr, meta); } } @@ -225,87 +220,91 @@ control conntrack_lookup_stage(inout headers_t hdr, inout metadata_t meta) { // action set_flow_entry_attr( /* Flow basic metadata */ - bit<1> is_unidirectional, - dash_flow_state_t state, bit<32> version, @SaiVal[type="sai_dash_direction_t"] dash_direction_t dash_direction, - bit<16> tunnel_id, - bit<32> routing_actions, + @SaiVal[type="sai_dash_flow_action_t"] dash_flow_action_t dash_flow_action, bit<32> meter_class, + bit<1> is_unidirectional_flow, + @SaiVal[type="sai_dash_flow_sync_state_t"] dash_flow_sync_state_t dash_flow_sync_state, + + /* Reverse flow key */ + EthernetAddress reverse_flow_eni_mac, + bit<16> reverse_flow_vnet_id, + bit<8> reverse_flow_ip_proto, + IPv4ORv6Address reverse_flow_src_ip, + IPv4ORv6Address reverse_flow_dst_ip, + bit<16> reverse_flow_src_port, + bit<16> reverse_flow_dst_port, /* Flow encap related attributes */ - bit<24> encap_data_vni, - bit<24> encap_data_dest_vnet_vni, - IPv4Address encap_data_underlay_sip, - IPv4Address encap_data_underlay_dip, - EthernetAddress encap_data_underlay_smac, - EthernetAddress encap_data_underlay_dmac, - @SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t encap_data_dash_encapsulation, - - /* Flow tunnel related attributes */ - bit<24> tunnel_data_vni, - bit<24> tunnel_data_dest_vnet_vni, - IPv4Address tunnel_data_underlay_sip, - IPv4Address tunnel_data_underlay_dip, - EthernetAddress tunnel_data_underlay_smac, - EthernetAddress tunnel_data_underlay_dmac, - @SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t tunnel_data_dash_encapsulation, + bit<24> underlay0_vnet_id, + IPv4Address underlay0_sip, + IPv4Address underlay0_dip, + EthernetAddress underlay0_smac, + EthernetAddress underlay0_dmac, + @SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t underlay0_dash_encapsulation, + + bit<24> underlay1_vnet_id, + IPv4Address underlay1_sip, + IPv4Address underlay1_dip, + EthernetAddress underlay1_smac, + EthernetAddress underlay1_dmac, + @SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t underlay1_dash_encapsulation, /* Flow overlay rewrite related attributes */ - bit<1> overlay_data_is_ipv6, - EthernetAddress overlay_data_dst_mac, - IPv4ORv6Address overlay_data_sip, - IPv4ORv6Address overlay_data_dip, - IPv6Address overlay_data_sip_mask, - IPv6Address overlay_data_dip_mask, - - /* Extra flow metadata, unused */ + EthernetAddress dst_mac, + IPv4ORv6Address sip, + IPv4ORv6Address dip, + IPv6Address sip_mask, + IPv6Address dip_mask, + @SaiVal[name = "ip_is_v6"]bit<1> is_ipv6, + + /* Extra flow metadata */ @SaiVal[type="sai_u8_list_t"] bit<16> vendor_metadata, @SaiVal[type="sai_u8_list_t"] bit<16> flow_data_pb) { - meta.flow_state = state; - // TODO check FLOW_SYNCED in ha - // Do state FSM later - if (state != dash_flow_state_t.FLOW_CREATED) { - return; - } - - /* Set basic metadata */ + /* Set Flow basic metadata */ + meta.flow_data.version = version; + meta.flow_data.direction = dash_direction; + 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.direction = dash_direction; - meta.dash_tunnel_id = tunnel_id; - meta.routing_actions = routing_actions; + meta.routing_actions = (bit<32>)dash_flow_action; meta.meter_class = meter_class; + /* Reverse flow key is not used by now */ + ; + /* Set encapsulation metadata */ - meta.encap_data.vni = encap_data_vni; - meta.encap_data.dest_vnet_vni = encap_data_dest_vnet_vni; - meta.encap_data.underlay_sip = encap_data_underlay_sip; - meta.encap_data.underlay_dip = encap_data_underlay_dip; - meta.encap_data.underlay_smac = encap_data_underlay_smac; - meta.encap_data.underlay_dmac = encap_data_underlay_dmac; - meta.encap_data.dash_encapsulation = encap_data_dash_encapsulation; - - - /* Set tunnel metadata */ - meta.tunnel_data.vni = tunnel_data_vni; - meta.tunnel_data.dest_vnet_vni = tunnel_data_dest_vnet_vni; - meta.tunnel_data.underlay_sip = tunnel_data_underlay_sip; - meta.tunnel_data.underlay_dip = tunnel_data_underlay_dip; - meta.tunnel_data.underlay_smac = tunnel_data_underlay_smac; - meta.tunnel_data.underlay_dmac = tunnel_data_underlay_dmac; - meta.tunnel_data.dash_encapsulation = tunnel_data_dash_encapsulation; + meta.encap_data.vni = underlay0_vnet_id; + meta.encap_data.underlay_sip = underlay0_sip; + meta.encap_data.underlay_dip = underlay0_dip; + meta.encap_data.dash_encapsulation = underlay0_dash_encapsulation; + meta.encap_data.underlay_smac = underlay0_smac; + meta.encap_data.underlay_dmac = underlay0_dmac; + + meta.tunnel_data.vni = underlay1_vnet_id; + meta.tunnel_data.underlay_sip = underlay1_sip; + meta.tunnel_data.underlay_dip = underlay1_dip; + meta.tunnel_data.dash_encapsulation = underlay1_dash_encapsulation; + meta.tunnel_data.underlay_smac = underlay1_smac; + meta.tunnel_data.underlay_dmac = underlay1_dmac; /* Set overlay rewrite metadata */ - meta.overlay_data.is_ipv6 = overlay_data_is_ipv6; - meta.overlay_data.dmac = overlay_data_dst_mac; - meta.overlay_data.sip = overlay_data_sip; - meta.overlay_data.dip = overlay_data_dip; - meta.overlay_data.sip_mask = overlay_data_sip_mask; - meta.overlay_data.dip_mask = overlay_data_dip_mask; + meta.overlay_data.dmac = dst_mac; + meta.overlay_data.sip = sip; + meta.overlay_data.dip = dip; + meta.overlay_data.sip_mask = sip_mask; + meta.overlay_data.dip_mask = dip_mask; + meta.overlay_data.is_ipv6 = is_ipv6; } action flow_miss() { - meta.flow_state = dash_flow_state_t.FLOW_MISS; + meta.flow_data.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"] diff --git a/documentation/dataplane/dash-flow-api.md b/documentation/dataplane/dash-flow-api.md index 5710bce10..c44a645db 100644 --- a/documentation/dataplane/dash-flow-api.md +++ b/documentation/dataplane/dash-flow-api.md @@ -3,6 +3,7 @@ | Rev | Date | Author | Change Description | | --- | ---- | ------ | ------------------ | | 0.1 | 03/20/2024 | Zhixiong Niu | Initial version | +| 0.2 | 09/10/2024 | Junhua Zhai | Added flow attrs - flow_sync_state, underlay0 smac/dmac | ## Table of Contents @@ -207,6 +208,7 @@ These are the basic attributes of flow entry. | SAI_FLOW_ENTRY_ATTR_DASH_FLOW_ACTION | `sai_dash_flow_action_t` | Action to be applied on the flow | | SAI_FLOW_ENTRY_ATTR_METER_CLASS | `sai_uint32_t` | Meter class for flow entry, used for traffic metering and policing. | | SAI_FLOW_ENTRY_ATTR_IS_UNIDIRECTIONAL_FLOW | `bool` | Indicates if the flow is unidirectional | +| SAI_FLOW_ENTRY_ATTR_DASH_FLOW_SYNC_STATE | `sai_dash_flow_sync_state_t` | [Flow sync state](https://github.com/sonic-net/DASH/blob/main/documentation/high-avail/ha-api-hld.md#44-flow) | #### Reverse flow key @@ -231,6 +233,8 @@ These are the related attributes of flow encapsulation. | SAI_FLOW_ENTRY_ATTR_UNDERLAY0_VNI | `sai_uint32_t` | Destination VNI in the underlay network | | SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SIP | `sai_uint32_t` | Source IP address in the underlay network | | SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DIP | `sai_uint32_t` | Destination IP address in the underlay network | +| SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SMAC | `sai_mac_t` | Source MAC address in the underlay network | +| SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DMAC | `sai_mac_t` | Destination MAC address in the underlay network | | SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DASH_ENCAPSULATION | `sai_dash_encapsulation_t` | Encapsulation method for DASH traffic in the underlay network | | SAI_FLOW_ENTRY_ATTR_UNDERLAY1_VNI | `sai_uint32_t` | Destination VNI in the 2nd underlay network | | SAI_FLOW_ENTRY_ATTR_UNDERLAY1_SIP | `sai_uint32_t` | Source IP address in the 2nd underlay network | diff --git a/documentation/high-avail/ha-api-hld.md b/documentation/high-avail/ha-api-hld.md index 30406b894..39aff79ab 100644 --- a/documentation/high-avail/ha-api-hld.md +++ b/documentation/high-avail/ha-api-hld.md @@ -9,6 +9,7 @@ | 0.5 | 04/08/2024 | Riff Jiang | Added support for bulk sync. | | 0.6 | 04/09/2024 | Riff Jiang | Added support for flow reconcile for planned and unplanned switchover. | | 0.7 | 06/20/2024 | Mukesh Velayudhan | Added DPU scope DPU driven attributes and description. | +| 0.8 | 09/10/2024 | Junhua Zhai| Updated flow attr name and type for flow sync state. | 1. [1. Terminology](#1-terminology) 2. [2. Background](#2-background) @@ -175,20 +176,20 @@ To support HA, each flow contains the following SAI attributes: | Attribute name | Type | Description | | -------------- | ---- | ----------- | -| SAI_FLOW_ATTR_FLOW_VERSION | `sai_uint32_t` | The flow version. | -| SAI_FLOW_ATTR_FLOW_SYNC_STATE | `sai_dash_ha_flow_sync_state_t` | The flow sync state. | +| SAI_FLOW_ENTRY_ATTR_VERSION | `sai_uint32_t` | The flow version. | +| SAI_FLOW_ENTRY_ATTR_DASH_FLOW_SYNC_STATE | `sai_dash_flow_sync_state_t` | The flow sync state. | The flow sync state is defined as below: ```c -typedef enum _sai_dash_ha_flow_sync_state_t +typedef enum _sai_dash_flow_sync_state_t { - SAI_DASH_HA_FLOW_SYNC_STATE_FLOW_MISS, - SAI_DASH_HA_FLOW_SYNC_STATE_FLOW_CREATED, - SAI_DASH_HA_FLOW_SYNC_STATE_FLOW_SYNCED, - SAI_DASH_HA_FLOW_SYNC_STATE_FLOW_PENDING_DELETE, - SAI_DASH_HA_FLOW_SYNC_STATE_FLOW_PENDING_RESIMULATION -} sai_dash_ha_flow_sync_state_t; + SAI_DASH_FLOW_SYNC_STATE_FLOW_MISS, + SAI_DASH_FLOW_SYNC_STATE_FLOW_CREATED, + SAI_DASH_FLOW_SYNC_STATE_FLOW_SYNCED, + SAI_DASH_FLOW_SYNC_STATE_FLOW_PENDING_DELETE, + SAI_DASH_FLOW_SYNC_STATE_FLOW_PENDING_RESIMULATION +} sai_dash_flow_sync_state_t; ``` The flow sync state is a small state machine that represents if the flow is synched or not, so we can make the packet processing decision accordingly to achieve HA.