Skip to content

Commit 9c02f43

Browse files
authored
Merge branch 'sonic-net:master' into vrrp_orch
2 parents aca8fc9 + 0b331f0 commit 9c02f43

8 files changed

+190
-106
lines changed

orchagent/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ swssdir = $(datadir)/swss
1717
dist_swss_DATA = \
1818
eliminate_events.lua \
1919
rif_rates.lua \
20-
pfc_detect_innovium.lua \
20+
pfc_detect_marvell_teralynx.lua \
2121
pfc_detect_mellanox.lua \
2222
pfc_detect_broadcom.lua \
2323
pfc_detect_marvell.lua \

orchagent/aclorch.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3128,7 +3128,7 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
31283128
platform == MLNX_PLATFORM_SUBSTRING ||
31293129
platform == BFN_PLATFORM_SUBSTRING ||
31303130
platform == MRVL_PLATFORM_SUBSTRING ||
3131-
platform == INVM_PLATFORM_SUBSTRING ||
3131+
platform == MRVL_TL_PLATFORM_SUBSTRING ||
31323132
platform == NPS_PLATFORM_SUBSTRING ||
31333133
platform == XS_PLATFORM_SUBSTRING ||
31343134
platform == VS_PLATFORM_SUBSTRING)
@@ -3149,7 +3149,7 @@ void AclOrch::init(vector<TableConnector>& connectors, PortsOrch *portOrch, Mirr
31493149
}
31503150

31513151
if ( platform == MRVL_PLATFORM_SUBSTRING ||
3152-
platform == INVM_PLATFORM_SUBSTRING ||
3152+
platform == MRVL_TL_PLATFORM_SUBSTRING ||
31533153
platform == VS_PLATFORM_SUBSTRING)
31543154
{
31553155
m_L3V4V6Capability =

orchagent/copporch.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,8 @@ bool CoppOrch::getAttribsFromTrapGroup (vector<FieldValueTuple> &fv_tuple,
10141014
{
10151015
/* Mellanox platform doesn't support trap priority setting */
10161016
/* Marvell platform doesn't support trap priority. */
1017-
char *platform = getenv("platform");
1018-
if (!platform || (!strstr(platform, MLNX_PLATFORM_SUBSTRING) && (!strstr(platform, MRVL_PLATFORM_SUBSTRING))))
1017+
char *platform = getenv("platform");
1018+
if (!platform || (!strstr(platform, MLNX_PLATFORM_SUBSTRING) && (!strstr(platform, MRVL_PLATFORM_SUBSTRING))))
10191019
{
10201020
attr.id = SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY,
10211021
attr.value.u32 = (uint32_t)stoul(fvValue(*i));

orchagent/mirrororch.cpp

+15-13
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
#define MIRROR_SESSION_DEFAULT_VLAN_PRI 0
3636
#define MIRROR_SESSION_DEFAULT_VLAN_CFI 0
37-
#define MIRROR_SESSION_DEFAULT_IP_HDR_VER 4
37+
#define MIRROR_SESSION_IP_HDR_VER_4 4
38+
#define MIRROR_SESSION_IP_HDR_VER_6 6
3839
#define MIRROR_SESSION_DSCP_SHIFT 2
3940
#define MIRROR_SESSION_DSCP_MIN 0
4041
#define MIRROR_SESSION_DSCP_MAX 63
@@ -380,6 +381,9 @@ task_process_status MirrorOrch::createEntry(const string& key, const vector<Fiel
380381
{
381382
SWSS_LOG_ENTER();
382383

384+
bool src_ip_initialized = false;
385+
bool dst_ip_initialized = false;
386+
383387
auto session = m_syncdMirrors.find(key);
384388
if (session != m_syncdMirrors.end())
385389
{
@@ -396,20 +400,12 @@ task_process_status MirrorOrch::createEntry(const string& key, const vector<Fiel
396400
if (fvField(i) == MIRROR_SESSION_SRC_IP)
397401
{
398402
entry.srcIp = fvValue(i);
399-
if (!entry.srcIp.isV4())
400-
{
401-
SWSS_LOG_ERROR("Unsupported version of sessions %s source IP address", key.c_str());
402-
return task_process_status::task_invalid_entry;
403-
}
403+
src_ip_initialized = true;
404404
}
405405
else if (fvField(i) == MIRROR_SESSION_DST_IP)
406406
{
407407
entry.dstIp = fvValue(i);
408-
if (!entry.dstIp.isV4())
409-
{
410-
SWSS_LOG_ERROR("Unsupported version of sessions %s destination IP address", key.c_str());
411-
return task_process_status::task_invalid_entry;
412-
}
408+
dst_ip_initialized = true;
413409
}
414410
else if (fvField(i) == MIRROR_SESSION_GRE_TYPE)
415411
{
@@ -493,6 +489,12 @@ task_process_status MirrorOrch::createEntry(const string& key, const vector<Fiel
493489
return task_process_status::task_failed;
494490
}
495491
}
492+
// Entry validation as a whole
493+
if (src_ip_initialized && dst_ip_initialized && entry.srcIp.getIp().family != entry.dstIp.getIp().family)
494+
{
495+
SWSS_LOG_ERROR("Address family of source and destination IPs is different");
496+
return task_process_status::task_invalid_entry;
497+
}
496498

497499
if (!isHwResourcesAvailable())
498500
{
@@ -992,7 +994,7 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session)
992994
attrs.push_back(attr);
993995

994996
attr.id = SAI_MIRROR_SESSION_ATTR_IPHDR_VERSION;
995-
attr.value.u8 = MIRROR_SESSION_DEFAULT_IP_HDR_VER;
997+
attr.value.u8 = session.dstIp.isV4() ? MIRROR_SESSION_IP_HDR_VER_4 : MIRROR_SESSION_IP_HDR_VER_6;
996998
attrs.push_back(attr);
997999

9981000
// TOS value format is the following:
@@ -1341,7 +1343,7 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
13411343
else
13421344
{
13431345
string alias = "";
1344-
session.nexthopInfo.nexthop = NextHopKey("0.0.0.0", alias);
1346+
session.nexthopInfo.nexthop = session.dstIp.isV4() ? NextHopKey("0.0.0.0", alias) : NextHopKey("::", alias);
13451347
}
13461348

13471349
// Update State DB Nexthop

orchagent/orch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const char range_specifier = '-';
3434
const char config_db_key_delimiter = '|';
3535
const char state_db_key_delimiter = '|';
3636

37-
#define INVM_PLATFORM_SUBSTRING "innovium"
37+
#define MRVL_TL_PLATFORM_SUBSTRING "marvell-teralynx"
3838
#define MLNX_PLATFORM_SUBSTRING "mellanox"
3939
#define BRCM_PLATFORM_SUBSTRING "broadcom"
4040
#define BRCM_DNX_PLATFORM_SUBSTRING "broadcom-dnx"

orchagent/orchdaemon.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,9 @@ bool OrchDaemon::init()
590590
queueAttrIds,
591591
PFC_WD_POLL_MSECS));
592592
}
593-
else if ((platform == INVM_PLATFORM_SUBSTRING)
593+
else if ((platform == MRVL_TL_PLATFORM_SUBSTRING)
594+
|| (platform == MRVL_PLATFORM_SUBSTRING)
594595
|| (platform == BFN_PLATFORM_SUBSTRING)
595-
|| (platform == MRVL_PLATFORM_SUBSTRING)
596596
|| (platform == NPS_PLATFORM_SUBSTRING))
597597
{
598598

@@ -624,7 +624,9 @@ bool OrchDaemon::init()
624624

625625
static const vector<sai_queue_attr_t> queueAttrIds;
626626

627-
if ((platform == INVM_PLATFORM_SUBSTRING) || (platform == NPS_PLATFORM_SUBSTRING) || (platform == MRVL_PLATFORM_SUBSTRING))
627+
if ((platform == MRVL_PLATFORM_SUBSTRING) ||
628+
(platform == MRVL_TL_PLATFORM_SUBSTRING) ||
629+
(platform == NPS_PLATFORM_SUBSTRING))
628630
{
629631
m_orchList.push_back(new PfcWdSwOrch<PfcWdZeroBufferHandler, PfcWdLossyHandler>(
630632
m_configDb,

0 commit comments

Comments
 (0)