Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dash libsai does not support APIs set/get attribute of SAI object/entry #650

Open
jimmyzhai opened this issue Dec 16, 2024 · 0 comments
Open
Assignees

Comments

@jimmyzhai
Copy link
Collaborator

The implementation of APIs set/get attribute is still missing like below:

static sai_status_t dash_sai_set_{{ api.name }}_attribute(
        {% include 'templates/headers/sai_api_param_object_id.j2' %},
        _In_ const sai_attribute_t *attr)
{
    DASH_LOG_ENTER();
    assert(0 && "sai_set_{{ api.name }}_attribute NYI");
    return SAI_STATUS_FAILURE;
}

static sai_status_t dash_sai_get_{{ api.name }}_attribute(
        {% include 'templates/headers/sai_api_param_object_id.j2' %},
        _In_ uint32_t attr_count,
        _Inout_ sai_attribute_t *attr_list)
{
    DASH_LOG_ENTER();
    assert(0 && "sai_get_{{ api.name }}_attribute NYI");
    return SAI_STATUS_FAILURE;
}
@jimmyzhai jimmyzhai self-assigned this Dec 20, 2024
r12f pushed a commit that referenced this issue Dec 23, 2024
Following #648, continue to
refactor libsai implementation for easier read and maintenance:

1. Avoid using compilated j2 template as best
2. Use c++ code directly to express the logic of API implementation,
based on p4 table metadata info (p4meta.[h, cpp])
3. Implement APIs set/get attribute by using common `DashSai::set` and
`DashSai::get`, which fix the issue
#650
4. Update libsai test (vnet_out.cpp) to cover sanity test of APIs
set/get attribute

Note: To refactor APIs create/remove with current approach in next PR. 

The generated sample code of APIs set/get attribute is as below:

- SAI object objectID

![image](https://github.com/user-attachments/assets/2df7e786-6d7b-4503-a26f-6f2463748867)
p4meta `outbound_routing_group_meta_table` definition

![image](https://github.com/user-attachments/assets/ddf3e5ee-6fab-4ede-b589-48600b885088)

- SAI object entry

![image](https://github.com/user-attachments/assets/c4d47442-c4bf-4c88-9e8f-14b54f03668e)
p4meta `outbound_routing_entry_meta_table`  definition

![image](https://github.com/user-attachments/assets/deb64ef6-e90c-4d2d-9aad-9aa6db133521)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant