Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opencomputeproject/SAI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: opencomputeproject/SAI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.11
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 16 commits
  • 25 files changed
  • 5 contributors

Commits on Nov 1, 2022

  1. [Cherry pick][SAI-PTF]Two fix for sai-ptf infra (#1635)

    * [SAI-PTF] Add decorator for skipping test on specified error (#1609)
    
    * [SAI-PTF] Add decorator for skipping test on specified error
    
    Add decorator method in the perl template  for skipping test on specified error
    
    details:
    1. add decorator method in sai_adapter_utils.tt
    2. use decorator when set parameters ``skip_error``
    3. add parameters when building from template, like ``perl -Irpc gensairpc.pl  --skip_error=-2,-3``
    4. remove the new added parameters, add more doc
    Test done:
    make  rpc
    
    Signed-off-by: richardyu <[email protected]>
    
    * Update sai_fdb_test.py
    
    remove unnecessary test
    
    Signed-off-by: Richard.Yu <[email protected]>
    
    Signed-off-by: richardyu <[email protected]>
    Signed-off-by: Richard.Yu <[email protected]>
    Co-authored-by: richardyu <[email protected]>
    
    * [SAI-PTF] Enhance the function for getting counters in sai_adapter.py (#1626)
    
    * [SAI-PTF] Enhance the function for getting counters in sai_adapter.py
    
        Resolve issue #1614
    
        For the auto-generated adapter, need to add a parameter for which counter_id/counter_ids we want, in order to compatiable with current code and reduce the modification, we can define a constant parameter as the list of counter_ids, and use this constant as the default.
    
        Before
    
        ```
        def sai_thrift_get_bfd_session_stats(client,
                                             bfd_session_oid):
    
            counter_ids = []
            counter_ids.append(SAI_BFD_SESSION_STAT_IN_PACKETS)
            counter_ids.append(SAI_BFD_SESSION_STAT_OUT_PACKETS)
            counter_ids.append(SAI_BFD_SESSION_STAT_DROP_PACKETS)
    
            counters = [0] * 3
            global status
            status = SAI_STATUS_SUCCESS
        ```
    
        After the refactor
        ```
        sai_get_bfd_session_stats_counter_ids = []
        sai_get_bfd_session_stats_counter_ids.append(SAI_BFD_SESSION_STAT_IN_PACKETS)
        sai_get_bfd_session_stats_counter_ids.append(SAI_BFD_SESSION_STAT_OUT_PACKETS)
        sai_get_bfd_session_stats_counter_ids.append(SAI_BFD_SESSION_STAT_DROP_PACKETS)
    
        def sai_thrift_get_bfd_session_stats(client,
                                             bfd_session_oid,
                                             counter_ids=sai_get_bfd_session_stats_counter_ids):
    
            counters = [0] * 3
            global status
            status = SAI_STATUS_SUCCESS
        ```
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    * make some enhancement on the code, add dict which can get the enum name by id
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    Co-authored-by: richardyu <[email protected]>
    
    Signed-off-by: richardyu <[email protected]>
    Signed-off-by: Richard.Yu <[email protected]>
    Signed-off-by: richardyu-ms <[email protected]>
    Co-authored-by: richardyu <[email protected]>
    richardyu-ms and richardyu authored Nov 1, 2022
    Configuration menu
    Copy the full SHA
    c80a284 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2022

  1. [SAI-PTF] Add uninit API support in SAI-PTF and enhance the platform …

    …helper (#1636) (#1638)
    
    Add uninit API support in SAI-PTF and enhance the platform helper
    - add interface for SAI-PTF to uninitalize the sai interface
    - use the uninitalize interface to triger the ASIC data dump
    > this change picked parts of the change in #1440, but without the warm reboot part.
    
    Test Done:
    Local Docker build for building the saiserver
    Local testing environment
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Nov 2, 2022
    Configuration menu
    Copy the full SHA
    8eaa9c5 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. fix a compile issue when build docker-syncd-brcm-dnx-rpc.gz (#1647)

    Add dependence for ``experimental``
    ```
    /usr/include/sai/saiobject.h:40:10: fatal error: saiexperimentalbmtor.h: No such file or directory
       40 | #include <saiexperimentalbmtor.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~
    ```
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Nov 10, 2022
    Configuration menu
    Copy the full SHA
    bee5d7c View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2022

  1. [SAI-PTF]Include sai expermential for generate the rpc headers (#1660) (

    #1661)
    
    When generate the sai_adapter it depends on the files in  sai expermental
    https://github.com/opencomputeproject/SAI/blob/master/meta/Makefile#L72
    ```
    CFLAGS += -I../inc -I../experimental $(WARNINGS)
    ```
    In gensairpc
    https://github.com/opencomputeproject/SAI/blob/master/meta/gensairpc.pl#L132
    ```
    our $EXPERIMENTAL_DIR = catdir( $sai_dir,      'experimental' );
    ```
    But when generate the py headers for RPC service, it doesn't include that.
    In order to make them matched, then add that dependences.
    
    Test done:
    Local compile and checked the headers
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Nov 20, 2022
    Configuration menu
    Copy the full SHA
    bb50de8 View commit details
    Browse the repository at this point in the history
  2. [SAI-PTF] add invocation logger (#1651)

    * add invocation logger
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    * reformat code
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    Co-authored-by: richardyu <[email protected]>
    richardyu-ms and richardyu committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    80ebb3f View commit details
    Browse the repository at this point in the history
  3. [SAI-PTF]add conditional import for unit test (#1656)

    * [SAI-PTF]add conditional import for unit test
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    * [SAI-PTF]add conditional import for unit test
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms committed Nov 20, 2022
    Configuration menu
    Copy the full SHA
    e439a2f View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2022

  1. [SAI-PTF]Fix issue when transfer make parameter GEN_SAIRPC_OPTS (#1675)

    Fix issue when transfer make param GEN_SAIRPC_OPTS with space in it
    
    when transfer GEN_SAIRPC_OPTS with multi parameters in it and use the
    space to split it, there is a issue for translate from build system to
    actual make system.
    ```
    --adapter_logger --skip_error=-2
    ```
    
    add quota when transfer the parameter
    
    Test Done:
    Verified in local container
    Verified in build system
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    5cf1ae4 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2022

  1. [SAI-PTF]Add return value in the SAI-PTF log (#1685)

    Why
    In order to track the SAI-API result and add the return value for each SAI_thrift api.
    
    How
    In sai_adapter, use the invocation_logger, log the return value when sai_thrift API returned
    
    Test:
    Unit test and DUT test
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Dec 20, 2022
    Configuration menu
    Copy the full SHA
    3d96a1d View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2022

  1. [SAI-PTF] API Logger - reformat dict in return value (#1690)

    Why
    Base on some requirement, when logging the return value is a dict, need return the value for each key as a string.
    
    For example,  returning this.
    ```
     "[{
    'client': <sai_thrift.sai_rpc.Client object at 0x7fd9b46861d0>,
    'port_oid': 4294967303,
    'hw_lane_list': sai_thrift_object_list_t(count=100, idlist=[1,2,34])
    }]"
    ```
     it returned as (see the ' around the value too below)
     ```
    "[{
    'client': '<sai_thrift.sai_rpc.Client object at 0x7fd9b46861d0>',
    'port_oid': '4294967303',
    'hw_lane_list': 'sai_thrift_object_list_t(count=100, idlist=[1,2,34])'
    }]"
    ```
    
    How
    Convert the dict value to string
    
    Test:
    Unit test and DUT test
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Dec 22, 2022
    Configuration menu
    Copy the full SHA
    1390cee View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2022

  1. [SAI-PTF] API Logger - reformat arg values (#1696)

    Why
    Base on some requirement, when logging the arg values, need return the value for each key as a string.
    
    For example,  returning this.
    ```
    sai_adapter_invoke func:[sai_thrift_create_route_entry] args: [{'client': <sai_thrift.sai_rpc.Client object at 0x7f9e07154438>, 'route_entry': sai_thrift_route_entry_t(switch_id=None, vr_id=12884901888, destination=sai_thrift_ip_prefix_t(addr_family=1, addr=sai_thrift_ip_addr_t(ip4=None, ip6='0000:0000:0000:0000:0000:0000:0000:0000'), mask=sai_thrift_ip_addr_t(ip4=None, ip6='0000:0000:0000:0000:0000:0000:0000:0000'))), 'packet_action': 0}]
    ```
     Turn into
     ```
    sai_adapter_invoke func:[sai_thrift_create_route_entry] args: [{'client': '<sai_thrift.sai_rpc.Client object at 0x7f9e07154438>', 'route_entry': 'sai_thrift_route_entry_t(switch_id=None, vr_id=12884901888, destination=sai_thrift_ip_prefix_t(addr_family=1, addr=sai_thrift_ip_addr_t(ip4=None, ip6='0000:0000:0000:0000:0000:0000:0000:0000'), mask=sai_thrift_ip_addr_t(ip4=None, ip6='0000:0000:0000:0000:0000:0000:0000:0000')))', 'packet_action': '0'}]
    ```
    
    How
    Convert the dict value to string
    
    Test:
    Unit test and DUT test
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Dec 23, 2022
    Configuration menu
    Copy the full SHA
    aba7612 View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2022

  1. [SAI-PTF] Skip test when hit expected error from sai api (#1699)

    Why
    When hit the expected error like SAI_STATUS_NOT_SUPPORTED = -2, then skip the test.
    related to issue #1610
    
    How
    Add conditional exeption handler when return from sai api invocation
    
    Test:
    Test on brcm platform on case sainexthop.tunnelVrfTest
    
    Signed-off-by: richardyu-ms <[email protected]>
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Dec 24, 2022
    Configuration menu
    Copy the full SHA
    0fd23d2 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2022

  1. Enable github code scanning to replace LGTM. (#1709)

    PR check will be enabled after this PR merged.
    
    Signed-off-by: shilongliu <[email protected]>
    liushilongbuaa authored Dec 28, 2022
    Configuration menu
    Copy the full SHA
    4f11c7e View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2023

  1. improve enum values integration check (#1727) (#1737)

    it allows to use two different 'experimental' dirs during integration check, one belongs to current repository and another to origin/master
    
    Signed-off-by: Anton Parkhomenko <[email protected]>
    Co-authored-by: aparkhomenko-xsight <[email protected]>
    richardyu-ms and aparkhomenko-xsight authored Feb 7, 2023
    Configuration menu
    Copy the full SHA
    0031470 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2023

  1. [cherry-pick][202211]Enhance the check enum lock script (#1741) (#1742)

    * Enhance the check enum lock script
    Why
    workaround fix for git --work-tree=temp/ checkout ...
    after checkout from other branch, data will be left in git
    
    then in when running command from sonic-buildimage/rules/sairedis.dep, it will report
    ```
    sonic-buildimage/rules/sairedis.dep
    ```
    
    How
    clean up the git env
    
    Verify
    run script
    
    
    
    * enhance
    
    
    
    ---------
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Feb 8, 2023
    Configuration menu
    Copy the full SHA
    7710e24 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2023

  1. [cherry-pick][1.11][SAI-PTF] Convert generated enum code from ctypesg…

    …en into pythoon enum class (#1762)
    
    why
    cherry-pick from #1758
    When ctypesgen generated the python code for c++ enum, the python cannot be logged by it enum name, we need to change it to enum class.
    the code like
    ```C++
    /**
     * @brief SAI common API type
     */
    typedef enum _sai_common_api_t
    {
        SAI_COMMON_API_CREATE      = 0,
        SAI_COMMON_API_REMOVE      = 1,
        SAI_COMMON_API_SET         = 2,
        SAI_COMMON_API_GET         = 3,
        SAI_COMMON_API_BULK_CREATE = 4,
        SAI_COMMON_API_BULK_REMOVE = 5,
        SAI_COMMON_API_BULK_SET    = 6,
        SAI_COMMON_API_BULK_GET    = 7,
        SAI_COMMON_API_MAX         = 8,
    } sai_common_api_t;
    ```
    original converted by ctypesgen
    ```
    enum__sai_common_api_t = c_int# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_CREATE = 0# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_REMOVE = 1# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_SET = 2# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_GET = 3# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_BULK_CREATE = 4# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_BULK_REMOVE = 5# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_BULK_SET = 6# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_BULK_GET = 7# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_MAX = 8# /usr/include/sai/saitypes.h: 183
    
    sai_common_api_t = enum__sai_common_api_t# /usr/include/sai/saitypes.h: 183
    
    enum__sai_object_type_t = c_int# /usr/include/sai/saitypes.h: 294
    ```
    new code
    ```
    class sai_common_api(SAIEnum):
    
        SAI_COMMON_API_CREATE = 0# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_REMOVE = 1# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_SET = 2# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_GET = 3# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_BULK_CREATE = 4# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_BULK_REMOVE = 5# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_BULK_SET = 6# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_BULK_GET = 7# /usr/include/sai/saitypes.h: 183
    
        SAI_COMMON_API_MAX = 8# /usr/include/sai/saitypes.h: 183
    
    SAI_COMMON_API_CREATE = sai_common_api.SAI_COMMON_API_CREATE
    SAI_COMMON_API_REMOVE = sai_common_api.SAI_COMMON_API_REMOVE
    SAI_COMMON_API_SET = sai_common_api.SAI_COMMON_API_SET
    SAI_COMMON_API_GET = sai_common_api.SAI_COMMON_API_GET
    SAI_COMMON_API_BULK_CREATE = sai_common_api.SAI_COMMON_API_BULK_CREATE
    SAI_COMMON_API_BULK_REMOVE = sai_common_api.SAI_COMMON_API_BULK_REMOVE
    SAI_COMMON_API_BULK_SET = sai_common_api.SAI_COMMON_API_BULK_SET
    SAI_COMMON_API_BULK_GET = sai_common_api.SAI_COMMON_API_BULK_GET
    SAI_COMMON_API_MAX = sai_common_api.SAI_COMMON_API_MAX
    ```
    
    how
    Convert the python code after generated from ctypesgen
    
    verify
    pipeline
    local testing
    
    
    
    reformat code
    
    
    
    refactor code
    
    Signed-off-by: richardyu-ms <[email protected]>
    richardyu-ms authored Feb 24, 2023
    Configuration menu
    Copy the full SHA
    e0f45ea View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Configuration menu
    Copy the full SHA
    dbb18ad View commit details
    Browse the repository at this point in the history
Loading