From ee1fa2350a444409e20ad825b13fafdf67010e41 Mon Sep 17 00:00:00 2001 From: Shaofeng Wu <69145577+ShaofengWu123@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:24:32 +0800 Subject: [PATCH 1/2] Add an internal config table to apply unexposed configurations to switch before testing (#638) This PR renamed the table `underlay_mac` to `internal_config`. The new `internal_config` table is ignored for SAI API generation and will be used for setting switch to an initial state required by some test cases. --- dash-pipeline/bmv2/dash_pipeline.p4 | 1 - dash-pipeline/bmv2/stages/pre_pipeline.p4 | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index 49a737cd9..0e3e13a3a 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -234,7 +234,6 @@ control dash_ingress( } apply { - meta.flow_enabled = false; #ifndef TARGET_DPDK_PNA meta.rx_encap.setValid(); diff --git a/dash-pipeline/bmv2/stages/pre_pipeline.p4 b/dash-pipeline/bmv2/stages/pre_pipeline.p4 index b65fb2f64..55728abcd 100644 --- a/dash-pipeline/bmv2/stages/pre_pipeline.p4 +++ b/dash-pipeline/bmv2/stages/pre_pipeline.p4 @@ -25,21 +25,23 @@ control pre_pipeline_stage(inout headers_t hdr, const default_action = accept; } - action set_underlay_mac(EthernetAddress neighbor_mac, - EthernetAddress mac) { + action set_internal_config(EthernetAddress neighbor_mac, + EthernetAddress mac, + bit<1> flow_enabled) { meta.u0_encap_data.underlay_dmac = neighbor_mac; meta.u0_encap_data.underlay_smac = mac; + meta.flow_enabled = (bool)flow_enabled; } - /* This table API should be implemented manually using underlay SAI */ + /* This table API should be implemented manually using SAI */ @SaiTable[ignored = "true"] - table underlay_mac { + table internal_config { key = { meta.appliance_id : ternary; } actions = { - set_underlay_mac; + set_internal_config; } } @@ -120,7 +122,7 @@ control pre_pipeline_stage(inout headers_t hdr, } appliance.apply(); - underlay_mac.apply(); + internal_config.apply(); } } From 07bc9aefcf0bc35a47688f11d3ad397a899d1c44 Mon Sep 17 00:00:00 2001 From: Vinod Kumar <119973184+vikumarks@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:33:10 -0800 Subject: [PATCH 2/2] Pr fix sai_thrift import error (#639) Fixing below error ``` /usr/local/lib/python3.9/dist-packages/saichallenger/common/sai_client/sai_thrift_client/sai_thrift_client.py:8: in from saichallenger.common.sai_client.sai_thrift_client.sai_thrift_utils import * _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import re from itertools import zip_longest import ipaddress import json > from sai_thrift import sai_headers E ModuleNotFoundError: No module named 'sai_thrift' ``` "**python3 setup.py install**" CHANGED to "**pip3 install .**" in Dockerfile.saichallenger-client. **python3 setup.py install** , installs files in /usr/lib/python3.9/**site-packages**/ which is not in sys.path **pip3 install .** , installs filesin /usr/local/lib/python3.9/**dist-packages**/ which is in sys.apth --- dash-pipeline/dockerfiles/Dockerfile.saichallenger-client | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dash-pipeline/dockerfiles/Dockerfile.saichallenger-client b/dash-pipeline/dockerfiles/Dockerfile.saichallenger-client index b0c8f4588..1920962cb 100644 --- a/dash-pipeline/dockerfiles/Dockerfile.saichallenger-client +++ b/dash-pipeline/dockerfiles/Dockerfile.saichallenger-client @@ -11,15 +11,15 @@ ADD SAI/rpc/saithrift-0.9.tar.gz / # Install the python libraries RUN cd /saithrift-0.9 && \ - python3 setup.py install && \ + pip3 install . && \ cd / && \ rm -rf saithrift-0.9 &&\ cd thrift-0.11.0 && \ - python3 setup.py install && \ + pip3 install . && \ cd / &&\ rm -rf thrift-0.11.0 && \ cd /SAI/test/ptf && \ - python3 setup.py install && \ + pip3 install . && \ ln -s ${DASH_PATH}/test/test-cases/scale/saic ${SAI_CHALLENGER_PATH}/dash_tests CMD ["/usr/bin/supervisord"]