Skip to content

Commit dc7210f

Browse files
Merge pull request #4258 from bibhuprasad-hcl/bibhu_swss_p4_branch_11_12_13
[P4Orch]Migrate to use new database schema format for update/process/drain/verifystate MulticastGroupEntries.
2 parents d084258 + 49df9e7 commit dc7210f

7 files changed

Lines changed: 3225 additions & 859 deletions

File tree

orchagent/p4orch/l3_multicast_manager.cpp

Lines changed: 446 additions & 178 deletions
Large diffs are not rendered by default.

orchagent/p4orch/l3_multicast_manager.h

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ P4MulticastGroupTable;
108108

109109
// The L3MulticastManager handles updates to two P4 tables:
110110
// * The "fixed" table multicast_router_interface_table, which defines a single
111-
// action set_src_mac to map output port and egress instance ID to a Ethernet
112-
// source MAC address to use for replicated packets. Entries in this table
113-
// create router interface (RIF) objects in the ASIC.
111+
// action set_multicast_src_mac to map output port and egress instance ID to
112+
// an Ethernet source MAC address to use for replicated packets. Entries in
113+
// this table create router interface (RIF) objects in the ASIC.
114114
// * The new "packet replication" table replication_multicast_table, which
115115
// is modeled as an action-less table, where the table key of
116116
// multicast group ID, egress instance, and output port will create entries
@@ -139,9 +139,9 @@ class L3MulticastManager : public ObjectManagerInterface {
139139
ReturnCode drainMulticastRouterInterfaceEntries(
140140
std::deque<swss::KeyOpFieldsValuesTuple>& router_interface_tuples);
141141

142-
// Drains entries associated with the multicast replication table.
143-
ReturnCode drainMulticastReplicationEntries(
144-
std::deque<swss::KeyOpFieldsValuesTuple>& replication_tuples);
142+
// Drains entries associated with the multicast group table.
143+
ReturnCode drainMulticastGroupEntries(
144+
std::deque<swss::KeyOpFieldsValuesTuple>& group_entry_tuples);
145145

146146
// Converts db table entry into P4MulticastRouterInterfaceEntry.
147147
ReturnCodeOr<P4MulticastRouterInterfaceEntry>
@@ -213,12 +213,12 @@ class L3MulticastManager : public ObjectManagerInterface {
213213
const std::deque<swss::KeyOpFieldsValuesTuple>& tuple_list,
214214
const std::string& op, bool update);
215215

216-
// Processes a list of entries of the same operation type for the replication
217-
// multicast table.
216+
// Processes a list of entries of the same operation type for the multicast
217+
// group table.
218218
// Returns an overall status code.
219219
// This method also sends the response to the application.
220-
ReturnCode processMulticastReplicationEntries(
221-
std::vector<P4MulticastReplicationEntry>& entries,
220+
ReturnCode processMulticastGroupEntries(
221+
std::vector<P4MulticastGroupEntry>& entries,
222222
const std::deque<swss::KeyOpFieldsValuesTuple>& tuple_list,
223223
const std::string& op, bool update);
224224

@@ -274,7 +274,9 @@ class L3MulticastManager : public ObjectManagerInterface {
274274
// Add new multicast group table entries.
275275
std::vector<ReturnCode> addMulticastGroupEntries(
276276
std::vector<P4MulticastGroupEntry>& entries);
277-
277+
// Update existing multicast group table entries.
278+
std::vector<ReturnCode> updateMulticastGroupEntries(
279+
std::vector<P4MulticastGroupEntry>& entries);
278280
// Used during failure scenarios where we try to revert to the previous state.
279281
ReturnCode restoreDeletedGroupMembers(
280282
const std::vector<P4Replica>& deleted_replicas,
@@ -288,7 +290,7 @@ class L3MulticastManager : public ObjectManagerInterface {
288290
std::string verifyMulticastRouterInterfaceState(
289291
const std::string& key,
290292
const std::vector<swss::FieldValueTuple>& tuple);
291-
std::string verifyMulticastReplicationState(
293+
std::string verifyMulticastGroupState(
292294
const std::string& key,
293295
const std::vector<swss::FieldValueTuple>& tuple);
294296

@@ -297,16 +299,16 @@ class L3MulticastManager : public ObjectManagerInterface {
297299
const P4MulticastRouterInterfaceEntry& app_db_entry,
298300
const P4MulticastRouterInterfaceEntry* multicast_router_interface_entry);
299301
// Verifies internal cache for a multicast replication entry.
300-
std::string verifyMulticastReplicationStateCache(
301-
const P4MulticastReplicationEntry& app_db_entry,
302-
const P4MulticastReplicationEntry* multicast_replication_entry);
302+
std::string verifyMulticastGroupStateCache(
303+
const P4MulticastGroupEntry& app_db_entry,
304+
const P4MulticastGroupEntry* multicast_group_entry);
303305

304306
// Verifies ASIC DB for a multicast router interface entry.
305307
std::string verifyMulticastRouterInterfaceStateAsicDb(
306308
const P4MulticastRouterInterfaceEntry* multicast_router_interface_entry);
307309
// Verifies ASIC DB for a multicast replication entry.
308-
std::string verifyMulticastReplicationStateAsicDb(
309-
const P4MulticastReplicationEntry* multicast_replication_entry);
310+
std::string verifyMulticastGroupStateAsicDb(
311+
const P4MulticastGroupEntry* multicast_group_entry);
310312

311313
// Gets the internal cached multicast router interface entry.
312314
// Return nullptr if corresponding multicast router interface entry is not

orchagent/p4orch/p4orch_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ constexpr char *kSetNexthopId = "set_nexthop_id";
5151
constexpr char *kSetWcmpGroupId = "set_wcmp_group_id";
5252
constexpr char* kSetMulticastGroupId = "set_multicast_group_id";
5353
constexpr char* kSetSrcMac = "set_src_mac";
54+
constexpr char* kSetMulticastSrcMac = "set_multicast_src_mac";
5455
constexpr char *kSetNexthopIdAndMetadata = "set_nexthop_id_and_metadata";
5556
constexpr char *kSetWcmpGroupIdAndMetadata = "set_wcmp_group_id_and_metadata";
5657
constexpr char *kSetMetadataAndDrop = "set_metadata_and_drop";

0 commit comments

Comments
 (0)