-
Notifications
You must be signed in to change notification settings - Fork 274
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
P4Runtime : Status Code additions #545
Conversation
7662145
to
a14f4d5
Compare
a14f4d5
to
00a46d3
Compare
common/producerstatetable.h
Outdated
// In set(), the op is ignored. | ||
void set(const std::vector<KeyOpFieldsValuesTuple>& values); | ||
|
||
void del(const std::vector<std::string>& keys); |
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.
Can we add unit test on these two new APIs?
We can add the test in redis_state_ut.cpp or redis_piped_state_ut.cpp.
(I can help in this if needed.)
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.
@donNewtonAlpha
We have provided the unit test for these. Please integrate them into this pr when you have time. Thanks.
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.
these APIs are removed
Please give a link to HLD for this change. |
Batch updates are introduced and required by the P4Orch: |
@qiluo-msft what do you think about this new API? |
00a46d3
to
d7ed943
Compare
Please change the PR title to more descriptive. People in the swss-common context do not know In reply to: 963379161 |
* Add batch set/delete() to ProducerStateTable * Add StatusCode enum and functions to convert between string and enum values. * Allow exists() to check for whitespace. This is only to allow whitespace when we check for existence. We can already create entries with whitespace. * Add SWSS return code SWSS_RC_UNIMPLEMENTED * Fix json error, refer to nlohmann/json#590 Submission containing materials of a third party: Copyright Google LLC; Licensed under Apache 2.0 Co-authored-by: Akarsh Gupta <akarshgupta@google.com> Co-authored-by: Jay Hu <jiarenhu@google.com> Co-authored-by: Manali Kumar <manalikumar@google.com> Co-authored-by: Robert J. Halstead <rhalstea@google.com> Co-authored-by: Runming Wu <runmingwu@google.com> Co-authored-by: Yilan Ji <yilanji@google.com> Signed-off-by: Don Newton don@opennetworking.org
f768a4d
to
ce1b78a
Compare
signed-of-by:Don Newton<don@opennetworking.org>
ce1b78a
to
0596f17
Compare
@@ -5394,7 +5394,7 @@ class basic_json | |||
{ | |||
assert(lhs.m_value.array != nullptr); | |||
assert(rhs.m_value.array != nullptr); | |||
return *lhs.m_value.array < *rhs.m_value.array; | |||
return (*lhs.m_value.array) < *rhs.m_value.array; |
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.
This is a fix from upstream: nlohmann/json#590
@@ -1,6 +1,7 @@ | |||
#pragma once | |||
|
|||
#include <memory> | |||
#include <vector> |
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.
This is missing import. std::vector is used below.
common/dbconnector.cpp
Outdated
if (key.find_first_of(" \t") != string::npos) | ||
{ | ||
SWSS_LOG_ERROR("EXISTS failed, invalid space or tab in single key: %s", key.c_str()); | ||
throw runtime_error("EXISTS failed, invalid space or tab in single key"); | ||
} |
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.
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.
Agree.
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.
Reverted
@qiluo-msft this PR is cleaned up now. Please take a look |
common/status_code_util.h
Outdated
namespace swss { | ||
|
||
enum class StatusCode { | ||
SWSS_RC_SUCCESS, |
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.
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.
Also p4rt (pins-infra repo)
common/status_code_util.h
Outdated
SWSS_RC_UNKNOWN, | ||
}; | ||
|
||
static std::map<StatusCode, std::string> statusCodeMapping = { |
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.
Also add const
? #Closed
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.
Done
common/status_code_util.h
Outdated
{"SWSS_RC_UNKNOWN", StatusCode::SWSS_RC_UNKNOWN}, | ||
}; | ||
|
||
inline std::string statusCodeToStr(const StatusCode& status) { |
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.
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.
Done
common/status_code_util.h
Outdated
|
||
enum class StatusCode { | ||
SWSS_RC_SUCCESS, | ||
SWSS_RC_INVALID_PARAM, |
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.
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
@qiluo-msft @prsunny @bocon13 |
Please resolve the conflicts. Possibly by rebase your PR to latest master branch. |
@qiluo-msft This now shows able to merge the tests are re-running. |
Please check the build failure
|
I was just looking at that but it doesn't make sense to me.
In azure-pipelines.yml we definitely add that.
Is there something else we need to do?
sudo apt-get install -y python3-pip
sudo pip3 install pytest
sudo apt-get install -y python
sudo apt-get install cmake libgtest-dev
sudo apt-get install cmake libgtest-dev libgmock-dev
cd /usr/src/gtest && sudo cmake . && sudo make
displayName: "Install dependencies"
- script: |
…On Wed, Nov 17, 2021 at 4:29 PM Qi Luo ***@***.***> wrote:
Please check the build failure
saiaclschema_ut.cpp:1:10: fatal error: gmock/gmock.h: No such file or directory
#include <gmock/gmock.h>
^~~~~~~~~~~~~~~
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ4SJM7QHIVPIDBOIOB4DTUMQNCNANCNFSM5GQYHZUA>
.
|
Hmm, this file is not added by this PR. Is the tip of the tree broken? |
556 was merged first. The tests etc including the gmock dependency were the
rebase I had to do.
On Wed, Nov 17, 2021 at 4:51 PM StephenWangGoogle ***@***.***>
wrote:
… I was just looking at that but it doesn't make sense to me. In
azure-pipelines.yml we definitely add that. Is there something else we need
to do? sudo apt-get install -y python3-pip sudo pip3 install pytest sudo
apt-get install -y python sudo apt-get install cmake libgtest-dev sudo
apt-get install cmake libgtest-dev libgmock-dev cd /usr/src/gtest && sudo
cmake . && sudo make displayName: "Install dependencies" - script: |
… <#m_-3355289809722603875_>
On Wed, Nov 17, 2021 at 4:29 PM Qi Luo *@*.***> wrote: Please check the
build failure saiaclschema_ut.cpp:1:10: fatal error: gmock/gmock.h: No such
file or directory #include <gmock/gmock.h> ^~~~~~~~~~~~~~~ — You are
receiving this because you were mentioned. Reply to this email directly,
view it on GitHub <#545 (comment)
<#545 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABJ4SJM7QHIVPIDBOIOB4DTUMQNCNANCNFSM5GQYHZUA
.
Hmm, this file is not added by this PR. Is the tip of the tree broken?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ4SJKRYAEB2PNUGDH7B43UMQPWNANCNFSM5GQYHZUA>
.
|
Yes, #556 seems to have broken master. Somehow gmock is missing from the buildimage container. Update: master and 202012 share a tag, so our builder container reverted and we lost the dependency. |
Probably what needs to be done is the sonic-buildimage commit that adds in
gmock should be backported to all active branches
Don
…On Wed, Nov 17, 2021 at 5:26 PM bocon13 ***@***.***> wrote:
Hmm, this file is not added by this PR. Is the tip of the tree broken?
Yes, #556 <#556> seems to
have broken master. Somehow gmock is missing from the buildimage container.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ4SJO7X6XJINOXWOXR26TUMQTZVANCNFSM5GQYHZUA>
.
|
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Asked for the backport here: |
/azpw run |
1 similar comment
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@qiluo-msft can you approve again? The rebase removed the approval |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@qiluo-msft @prsunny all tests have passed can we get this merged now? |
This PR adds batch operation functions and additional Status Codes necessary for the updated API coming in the follow on PR.