Skip to content

Commit

Permalink
[SAIP4] Rename mirror_with_psamp_encapsulation to mirror_with_ipfix_e…
Browse files Browse the repository at this point in the history
…ncapsulation to reflect change in SAI mirror session type to IPFIX.
  • Loading branch information
kishanps authored and divyagayathri-hcl committed Oct 16, 2024
1 parent 36ee476 commit fcf945c
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion sai_p4/fixed/ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define ROUTING_SET_MULTICAST_SRC_MAC_ACTION_ID 0x01000019 // 16777241
#define MIRRORING_MIRROR_AS_IPV4_ERSPAN_ACTION_ID 0x01000007 // 16777223
#define CLONING_INGRESS_CLONE_ACTION_ID 0x0100001C // 16777244
#define CLONING_MIRROR_WITH_PSAMP_ENCAPSULATION_ACTION_ID \
#define CLONING_MIRROR_WITH_IPFIX_ENCAPSULATION_ACTION_ID \
0x0100001D // 16777245
#define L3_ADMIT_ACTION_ID 0x01000008 // 16777224
#define MIRRORING_SET_PRE_SESSION_ACTION_ID 0x01000009 // 16777225
Expand Down
14 changes: 7 additions & 7 deletions sai_p4/fixed/mirroring.p4
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ control mirror_session_lookup(inout headers_t headers,
}

// Sets
// * SAI_MIRROR_SESSION_ATTR_TYPE to SAI_MIRROR_SESSION_TYPE_PSAMP
// * SAI_MIRROR_SESSION_ATTR_PSAMP_ENCAPSULATION_TYPE to
// SAI_PSAMP_ENCAPSULATION_TYPE_EXTENDED
// * SAI_MIRROR_SESSION_ATTR_TYPE to SAI_MIRROR_SESSION_TYPE_IPFIX
// * SAI_MIRROR_SESSION_ATTR_IPFIX_ENCAPSULATION_TYPE to
// SAI_IPFIX_ENCAPSULATION_TYPE_EXTENDED
// * SAI_MIRROR_SESSION_ATTR_MONITOR_PORT to `monitor_port`
@id(CLONING_MIRROR_WITH_PSAMP_ENCAPSULATION_ACTION_ID)
// TODO: Add params needed for PSAMP mirroring.
@id(CLONING_MIRROR_WITH_IPFIX_ENCAPSULATION_ACTION_ID)
// TODO: Add params needed for IPFIX mirroring.
// TODO: Remove unsupported annotation once the switch stack
// supports this table.
@unsupported
action mirror_with_psamp_encapsulation(@id(1) port_id_t monitor_port) {
action mirror_with_ipfix_encapsulation(@id(1) port_id_t monitor_port) {
local_metadata.mirror_egress_port = monitor_port;
}

Expand All @@ -63,7 +63,7 @@ control mirror_session_lookup(inout headers_t headers,
}
actions = {
@proto_id(1) mirror_as_ipv4_erspan;
@proto_id(2) mirror_with_psamp_encapsulation;
@proto_id(2) mirror_with_ipfix_encapsulation;
@defaultonly NoAction;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1422,8 +1422,8 @@ actions {
actions {
preamble {
id: 16777245
name: "ingress.mirror_session_lookup.mirror_with_psamp_encapsulation"
alias: "mirror_with_psamp_encapsulation"
name: "ingress.mirror_session_lookup.mirror_with_ipfix_encapsulation"
alias: "mirror_with_ipfix_encapsulation"
annotations: "@unsupported"
}
params {
Expand Down
4 changes: 2 additions & 2 deletions sai_p4/instantiations/google/middleblock.p4info.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,8 @@ actions {
actions {
preamble {
id: 16777245
name: "ingress.mirror_session_lookup.mirror_with_psamp_encapsulation"
alias: "mirror_with_psamp_encapsulation"
name: "ingress.mirror_session_lookup.mirror_with_ipfix_encapsulation"
alias: "mirror_with_ipfix_encapsulation"
annotations: "@unsupported"
}
params {
Expand Down
6 changes: 3 additions & 3 deletions sai_p4/instantiations/google/minimum_guaranteed_sizes.p4
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
#define ROUTING_IPV4_MULTICAST_TABLE_MINIMUM_GUARANTEED_SIZE 1600
#define ROUTING_IPV6_MULTICAST_TABLE_MINIMUM_GUARANTEED_SIZE 1600

#define ROUTING_MULTICAST_ROUTER_INTERFACE_TABLE_MINIMUM_GUARANTEED_SIZE 128

// The maximum number of wcmp groups.
#define WCMP_GROUP_TABLE_MINIMUM_GUARANTEED_SIZE 3968
#define WCMP_GROUP_TABLE_MINIMUM_GUARANTEED_SIZE_TOR 960
Expand Down Expand Up @@ -85,15 +87,13 @@

#define ACL_DEFAULT_PRE_INGRESS_TABLE_MINIMUM_GUARANTEED_SIZE 254


#define ACL_TOR_PRE_INGRESS_TABLE_MINIMUM_GUARANTEED_SIZE 127


#define ACL_INGRESS_QOS_TABLE_MINIMUM_GUARANTEED_SIZE 511

#define ACL_INGRESS_COUNTING_TABLE_MINIMUM_GUARANTEED_SIZE 255

#ifdef SAI_INSTANTIATION_EXPERIMENTAL_TOR
#ifdef SAI_INSTANTIATION_TOR
#define ACL_INGRESS_MIRROR_AND_REDIRECT_TABLE_MINIMUM_GUARANTEED_SIZE 511
#else
#define ACL_INGRESS_MIRROR_AND_REDIRECT_TABLE_MINIMUM_GUARANTEED_SIZE 255
Expand Down
4 changes: 2 additions & 2 deletions sai_p4/instantiations/google/sai_pd.proto
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ message MirrorSessionTableEntry {
oneof action {
MirrorAsIpv4ErspanAction mirror_as_ipv4_erspan = 1;
// CAUTION: This action is not (yet) supported.
MirrorWithPsampEncapsulationAction mirror_with_psamp_encapsulation = 2;
MirrorWithIpfixEncapsulationAction mirror_with_ipfix_encapsulation = 2;
}
}
Action action = 2;
Expand Down Expand Up @@ -892,7 +892,7 @@ message SetPortAndSrcMacAndVlanIdAction {
}

// CAUTION: This action is not (yet) supported.
message MirrorWithPsampEncapsulationAction {
message MirrorWithIpfixEncapsulationAction {
string monitor_port = 1; // Format::STRING
}

Expand Down
6 changes: 3 additions & 3 deletions sai_p4/instantiations/google/test_tools/test_entries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,11 @@ EntryBuilder& EntryBuilder::AddMirrorSessionTableEntry(
*pd_entry.mutable_mirror_session_table_entry();
mirror_session_entry.mutable_match()->set_mirror_session_id(
params.mirror_session_id);
sai::MirrorWithPsampEncapsulationAction& action =
sai::MirrorWithIpfixEncapsulationAction& action =
*mirror_session_entry.mutable_action()
->mutable_mirror_with_psamp_encapsulation();
->mutable_mirror_with_ipfix_encapsulation();
action.set_monitor_port(params.mirror_egress_port);
// TODO: Fill in PSAMP params in table entry's action.
// TODO: Fill in IPFIX params in table entry's action.
*entries_.add_entries() = std::move(pd_entry);

return *this;
Expand Down
2 changes: 1 addition & 1 deletion sai_p4/instantiations/google/test_tools/test_entries.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void AbslStringify(Sink& sink, const IpVersion& ip_version) {
}
}

// Parameters for generating a mirror session table entry with PSAMP
// Parameters for generating a mirror session table entry with IPFIX
// encapsulation.
// TODO: Adds data members with parameters needed for mirror
// encap.
Expand Down
4 changes: 2 additions & 2 deletions sai_p4/instantiations/google/tests/sai_p4_bmv2_vlan_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ sai::TableEntries EntriesForwardingAndRewritingVlanInRifTable(

TEST(VlanTest,
SettingNonReservedVidInRifWithoutVlanChecksResultsInPacketWithThatId) {
const sai::Instantiation kInstantiation = sai::Instantiation::kExperimentalTor;
const sai::Instantiation kInstantiation = sai::Instantiation::kTor;
const pdpi::IrP4Info kIrP4Info = sai::GetIrP4Info(kInstantiation);
ASSERT_OK_AND_ASSIGN(Bmv2 bmv2, sai::SetUpBmv2ForSaiP4(kInstantiation));

Expand Down Expand Up @@ -624,7 +624,7 @@ TEST(VlanTest,
}

TEST(VlanTest, SettingNonReservedVidInRifWithVlanChecksResultsInDrop) {
const sai::Instantiation kInstantiation = sai::Instantiation::kExperimentalTor;
const sai::Instantiation kInstantiation = sai::Instantiation::kTor;
const pdpi::IrP4Info kIrP4Info = sai::GetIrP4Info(kInstantiation);
ASSERT_OK_AND_ASSIGN(Bmv2 bmv2, sai::SetUpBmv2ForSaiP4(kInstantiation));

Expand Down
4 changes: 2 additions & 2 deletions sai_p4/instantiations/google/tor.p4info.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1884,8 +1884,8 @@ actions {
actions {
preamble {
id: 16777245
name: "ingress.mirror_session_lookup.mirror_with_psamp_encapsulation"
alias: "mirror_with_psamp_encapsulation"
name: "ingress.mirror_session_lookup.mirror_with_ipfix_encapsulation"
alias: "mirror_with_ipfix_encapsulation"
annotations: "@unsupported"
}
params {
Expand Down
4 changes: 2 additions & 2 deletions sai_p4/instantiations/google/unioned_p4info.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2035,8 +2035,8 @@ actions {
actions {
preamble {
id: 16777245
name: "ingress.mirror_session_lookup.mirror_with_psamp_encapsulation"
alias: "mirror_with_psamp_encapsulation"
name: "ingress.mirror_session_lookup.mirror_with_ipfix_encapsulation"
alias: "mirror_with_ipfix_encapsulation"
annotations: "@unsupported"
}
params {
Expand Down

0 comments on commit fcf945c

Please sign in to comment.