-
Notifications
You must be signed in to change notification settings - Fork 94
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
[libsai] Re-implement APIs create/remove #653
base: main
Are you sure you want to change the base?
Conversation
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
d7f18a9
to
28dabbe
Compare
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
5c2bc0b
to
6b8b884
Compare
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
6b8b884
to
8b334c3
Compare
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
dash-pipeline/SAI/src/p4meta.cpp
Outdated
{ | ||
for (auto i=0u; i<keys.size(); i++) { | ||
if (key_name == keys[i].name) { | ||
return &keys[i]; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over entire PR incosistent placemtn { once in end of function once in new line, over all project has { in new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dash-pipeline/SAI/src/p4meta.cpp
Outdated
get_attr_value_from_p4(key.field, key.bitwidth, mf_optional, value); | ||
} | ||
else { | ||
assert(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some error message would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dash-pipeline/SAI/src/p4meta.h
Outdated
} | ||
else if (field == "u64") { | ||
uint64_t val = *(const uint64_t*)v; | ||
if (*reinterpret_cast<const char*>("\0\x01") == 0) { // Little Endian |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick approach to checking host arch endianness, from https://github.com/sonic-net/DASH/blob/main/dash-pipeline/SAI/src/utils.h#L143.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use that, use proper macros/functions defined endian.h? and make proper function for that if you need running time host endian
8b334c3
to
93e8cca
Compare
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
/azp run |
Commenter does not have sufficient privileges for PR 653 in repo sonic-net/DASH |
Following #651, refactor APIs create/remove for easier read and maintenance:
DashSai::create
andDashSai::remove
to implement them for all SAI objects/entriesThe generated sample code of APIs create/remove attribute is as below:
SAI object objectID
SAI object entry