From ee6566409e8c9bfd91488365c26679f62b2ec14a Mon Sep 17 00:00:00 2001 From: mukeshmv Date: Wed, 31 Aug 2022 17:00:46 +0000 Subject: [PATCH] SAI apigen support for tables with no action parameters and a single action --- dash-pipeline/SAI/templates/saiapi.h.j2 | 4 ++-- dash-pipeline/bmv2/dash_pipeline.p4 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dash-pipeline/SAI/templates/saiapi.h.j2 b/dash-pipeline/SAI/templates/saiapi.h.j2 index 6506f68ae..c918cea7d 100644 --- a/dash-pipeline/SAI/templates/saiapi.h.j2 +++ b/dash-pipeline/SAI/templates/saiapi.h.j2 @@ -34,7 +34,7 @@ */ {% for table in sai_api.tables %} -{% if table.actions | length > 1 %} +{% if table.actions | length > 1 or ((table.actions | length == 1) and (((table.is_object == 'false') or (table['keys'] | length <= 1)) and ((table['actionParams'] | length == 0)))) %} /** * @brief Attribute data for #SAI_{{ table.name | upper }}_ATTR_ACTION */ @@ -113,7 +113,7 @@ typedef enum _sai_{{ table.name }}_attr_t SAI_{{ table.name | upper }}_ATTR_START, {% set ns = namespace(firstattr=false) %} -{% if table.actions | length > 1 %} +{% if table.actions | length > 1 or ((table.actions | length == 1) and (((table.is_object == 'false') or (table['keys'] | length <= 1)) and ((table['actionParams'] | length == 0)))) %} /** * @brief Action * diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index 2bb754182..6b21408a0 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -43,7 +43,7 @@ control dash_ingress(inout headers_t hdr, actions = { accept; - deny; + @defaultonly deny; } const default_action = deny; @@ -175,7 +175,7 @@ control dash_ingress(inout headers_t hdr, actions = { permit; - deny; + @defaultonly deny; } const default_action = deny;