From 49ad38ff5813c1b9eb75251503b8e1a821d4cba8 Mon Sep 17 00:00:00 2001 From: rajkumar38 <54936542+rajkumar38@users.noreply.github.com> Date: Thu, 30 Jan 2020 00:42:39 +0530 Subject: [PATCH] =?UTF-8?q?[orchagent/copp]=20:=20copp=20trap=20priority?= =?UTF-8?q?=20not=20supported=20for=20marvell=20platf=E2=80=A6=20(#1163)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 rpennadamram@marvell.com --- orchagent/copporch.cpp | 6 ++++-- orchagent/orch.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/orchagent/copporch.cpp b/orchagent/copporch.cpp index d6cbfaa736..21cd62f097 100644 --- a/orchagent/copporch.cpp +++ b/orchagent/copporch.cpp @@ -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; @@ -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)); diff --git a/orchagent/orch.h b/orchagent/orch.h index 1ea75b19d3..b00716e174 100644 --- a/orchagent/orch.h +++ b/orchagent/orch.h @@ -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 ":"