Skip to content

Commit ab01ea0

Browse files
committed
support port isolation group in BFN platform (sonic-net#1940)
1 parent d55ecd6 commit ab01ea0

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

mclagsyncd/mclaglink.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "mclagsyncd/mclaglink.h"
3232
#include "mclagsyncd/mclag.h"
3333
#include <set>
34+
#include <unordered_set>
3435
#include <algorithm>
3536
#include "macaddress.h"
3637
#include <string>
@@ -188,8 +189,13 @@ void MclagLink::mclagsyncdFetchMclagInterfaceConfigFromConfigdb()
188189

189190
void MclagLink::setPortIsolate(char *msg)
190191
{
191-
char *platform = getenv("platform");
192-
if ((NULL != platform) && (strstr(platform, BRCM_PLATFORM_SUBSTRING)))
192+
static const unordered_set<string> supported {
193+
BRCM_PLATFORM_SUBSTRING,
194+
BFN_PLATFORM_SUBSTRING
195+
};
196+
197+
const char *platform = getenv("platform");
198+
if (platform != nullptr && supported.find(string(platform)) != supported.end())
193199
{
194200
mclag_sub_option_hdr_t *op_hdr = NULL;
195201
string isolate_src_port;

mclagsyncd/mclaglink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
#endif /* INET_ADDRSTRLEN */
5151

5252
#define MAX_L_PORT_NAME 20
53+
5354
#define BRCM_PLATFORM_SUBSTRING "broadcom"
55+
#define BFN_PLATFORM_SUBSTRING "barefoot"
5456

5557
using namespace std;
5658

0 commit comments

Comments
 (0)