Skip to content

Commit

Permalink
[orchagent/copp] : copp trap priority not supported for marvell platf… (
Browse files Browse the repository at this point in the history
sonic-net#1163)

* [orchagent/copp] : copp trap priority not supported for marvell platform.

* Added MRVL platform macro
* Do not set trap priority for marvell platform

Signed-off-by: RAJKUMAR PENNADAM RAMAMOORTHY [email protected]
  • Loading branch information
rajkumar38 authored and lguohan committed Jan 30, 2020
1 parent cbe1811 commit 49ad38f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions orchagent/copporch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ void CoppOrch::initDefaultTrapIds()
trap_id_attrs.push_back(attr);

/* Mellanox platform doesn't support trap priority setting */
/* Marvell platform doesn't support trap priority. */
char *platform = getenv("platform");
if (!platform || !strstr(platform, MLNX_PLATFORM_SUBSTRING))
if (!platform || (!strstr(platform, MLNX_PLATFORM_SUBSTRING) && (!strstr(platform, MRVL_PLATFORM_SUBSTRING))))
{
attr.id = SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY;
attr.value.u32 = 0;
Expand Down Expand Up @@ -504,8 +505,9 @@ task_process_status CoppOrch::processCoppRule(Consumer& consumer)
else if (fvField(*i) == copp_trap_priority_field)
{
/* Mellanox platform doesn't support trap priority setting */
/* Marvell platform doesn't support trap priority. */
char *platform = getenv("platform");
if (!platform || !strstr(platform, MLNX_PLATFORM_SUBSTRING))
if (!platform || (!strstr(platform, MLNX_PLATFORM_SUBSTRING) && (!strstr(platform, MRVL_PLATFORM_SUBSTRING))))
{
attr.id = SAI_HOSTIF_TRAP_ATTR_TRAP_PRIORITY,
attr.value.u32 = (uint32_t)stoul(fvValue(*i));
Expand Down
1 change: 1 addition & 0 deletions orchagent/orch.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const char state_db_key_delimiter = '|';
#define BFN_PLATFORM_SUBSTRING "barefoot"
#define VS_PLATFORM_SUBSTRING "vs"
#define NPS_PLATFORM_SUBSTRING "nephos"
#define MRVL_PLATFORM_SUBSTRING "marvell"

#define CONFIGDB_KEY_SEPARATOR "|"
#define DEFAULT_KEY_SEPARATOR ":"
Expand Down

0 comments on commit 49ad38f

Please sign in to comment.